From nobody Sun Feb 8 17:21:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1656702951; cv=none; d=zohomail.com; s=zohoarc; b=kIgIaPbdMtfnE0Fy4W7o2UhqBDnUpud5dnJaslWj85uqz1tgtNUpFVjfOSFz2y05E6bcqznBV6bhIzH+Yqlna4iP2Q7nTUOftmrXvgiMBkf33BndzBy+wbo706WtKr5RaXEe8JGUowbwCt+20ByKTZVLYpuuopM5tk9alK0JFuo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656702951; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=crfRQdqB8QdZckFgh7DU0KlIdWRtaJ2n8hTPifdALRI=; b=copyI/j+3lMgMX408GG6oegZlFqLGytGzZelLz0CiBlQ2fwlE4TEjPrdeHOmk2QEv7l8HZFp1pEt04jiAl6y4TqrWsiP6DdT0TBFfRz8Jv+lHLP7jo0S8GqVgREYdjhHcgvQkkhYphEKMx6FbSbLxt5x296hEglrdjISvbmAIl4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1656702951176312.66161039411975; Fri, 1 Jul 2022 12:15:51 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-264-YeCYRGTSNI-jKKu5-KM-kQ-1; Fri, 01 Jul 2022 15:15:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C71082404E; Fri, 1 Jul 2022 19:15:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE9052166B26; Fri, 1 Jul 2022 19:15:43 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 87D611947B93; Fri, 1 Jul 2022 19:15:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A96C31947058 for ; Fri, 1 Jul 2022 19:15:41 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 96D35492CA4; Fri, 1 Jul 2022 19:15:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9039A492C3B for ; Fri, 1 Jul 2022 19:15:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 78C70811E75 for ; Fri, 1 Jul 2022 19:15:41 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-FNtGk0abPvCfoHFaFuHMbg-2; Fri, 01 Jul 2022 15:15:39 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 12:15:37 -0700 Received: from sdp540.jf.intel.com ([10.165.9.5]) by orsmga003.jf.intel.com with ESMTP; 01 Jul 2022 12:15:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656702950; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=crfRQdqB8QdZckFgh7DU0KlIdWRtaJ2n8hTPifdALRI=; b=fJ7Qq974WJb7IDZ/Bin1SMiz9WHleSF8kCzc8L2JfHyXyFmwPP8SqI0R5yS5xbw4uFzb1A syInVi2QuhVOjkRNsV14wn3a7HI/TifNWBlXFOysSIVrS15f2feN8JSSPfiI7Zu7Zbtubm g/TyVeBpgH8p80Wg0f5aST+72nI/JYE= X-MC-Unique: YeCYRGTSNI-jKKu5-KM-kQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: FNtGk0abPvCfoHFaFuHMbg-2 X-IronPort-AV: E=McAfee;i="6400,9594,10395"; a="281488248" X-IronPort-AV: E=Sophos;i="5.92,238,1650956400"; d="scan'208";a="281488248" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,238,1650956400"; d="scan'208";a="541833087" From: Lin Yang To: libvir-list@redhat.com, haibin.huang@intel.com, jian-feng.ding@intel.com, lin.a.yang@intel.com Subject: [libvirt][PATCH v13 1/6] Define SGX capabilities structs Date: Fri, 1 Jul 2022 12:14:41 -0700 Message-Id: <20220701191446.727066-2-lin.a.yang@intel.com> In-Reply-To: <20220701191446.727066-1-lin.a.yang@intel.com> References: <20220701191446.727066-1-lin.a.yang@intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Privoznik Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656702952113100003 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Haibin Huang Signed-off-by: Michal Privoznik Signed-off-by: Haibin Huang --- src/conf/domain_capabilities.c | 10 ++++++++++ src/conf/domain_capabilities.h | 24 ++++++++++++++++++++++++ src/libvirt_private.syms | 1 + 3 files changed, 35 insertions(+) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 895e8d00e8..27f3fb8d36 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -76,6 +76,16 @@ virSEVCapabilitiesFree(virSEVCapability *cap) } =20 =20 +void +virSGXCapabilitiesFree(virSGXCapability *cap) +{ + if (!cap) + return; + + g_free(cap); +} + + static void virDomainCapsDispose(void *obj) { diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index f2eed80b15..dac1098e98 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -192,6 +192,24 @@ struct _virSEVCapability { unsigned int max_es_guests; }; =20 +typedef struct _virSection virSection; +typedef virSection *virSectionPtr; +struct _virSection { + unsigned long long size; + unsigned int node; +}; + +typedef struct _virSGXCapability virSGXCapability; +typedef virSGXCapability *virSGXCapabilityPtr; +struct _virSGXCapability { + bool flc; + bool sgx1; + bool sgx2; + unsigned long long section_size; + size_t nSections; + virSectionPtr pSections; +}; + typedef enum { VIR_DOMAIN_CAPS_FEATURE_IOTHREADS =3D 0, VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO, @@ -228,6 +246,7 @@ struct _virDomainCaps { =20 virDomainCapsFeatureGIC gic; virSEVCapability *sev; + virSGXCapability *sgx; /* add new domain features here */ =20 virTristateBool features[VIR_DOMAIN_CAPS_FEATURE_LAST]; @@ -276,3 +295,8 @@ void virSEVCapabilitiesFree(virSEVCapability *capabilities); =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSEVCapability, virSEVCapabilitiesFree); + +void +virSGXCapabilitiesFree(virSGXCapability *capabilities); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSGXCapability, virSGXCapabilitiesFree); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 76bcc64eb0..5d17890746 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -216,6 +216,7 @@ virDomainCapsEnumSet; virDomainCapsFormat; virDomainCapsNew; virSEVCapabilitiesFree; +virSGXCapabilitiesFree; =20 =20 # conf/domain_conf.h --=20 2.25.1