From nobody Fri Dec 19 16:07:14 2025 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658918125; cv=none; d=zohomail.com; s=zohoarc; b=n1EsQn3c0agXvxcLv1MKVmyBnI8P8CPt7EGV1Etd8HQM2u0pZ/R1YoDWKLIeRhQ0z3BIqLRnIi/H6kQXI/mkLA26ZDuNlUgoPSlhT+nVfiO3Pgcdz9XOwqnTpOSp82bGF/dYvf2hkRwes5fKqWAWdsJYcBDrW35DFzbkoGL82RM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658918125; 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=sYM4wKvsGvyNjujU6jmrSfN1yn+J2+aCCD4ESirdj/E=; b=Rzy6G2AhkCNqzpnEn0D6Yn3SIRESjS/VoO8D+/4EIdDJG9gUZU6d3L8rqqiZxatLMAe39JB00JKcm9yR+fB+N///A/3GRGKAfsO4Uv7KlCfaN+ovrHtsuJINcEFNp9cGtnLZpj7B8UiCz50CtXTSl7b6qF+m/jy5Us1RxvAYziM= 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=pass 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 1658918125774904.4108643517043; Wed, 27 Jul 2022 03:35:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-600-XvmVqDriNlKLDD4kUBk8CQ-1; Wed, 27 Jul 2022 06:35:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3F1F93C0ED6B; Wed, 27 Jul 2022 10:35:19 +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 2B9232026D07; Wed, 27 Jul 2022 10:35:19 +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 B0AC71945DA1; Wed, 27 Jul 2022 10:35:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 041AA1945D94 for ; Wed, 27 Jul 2022 10:35:17 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EBD05C27D95; Wed, 27 Jul 2022 10:35:16 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D5FCC15D67; Wed, 27 Jul 2022 10:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658918123; 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=sYM4wKvsGvyNjujU6jmrSfN1yn+J2+aCCD4ESirdj/E=; b=DpoEABkn3tba4dKvns+0bmLsjHmJTqdLTD2s5tZF5QWNsp5wrOX7tvjDDgL2NGtSEMhrst T1F+An9QY6lPxZmeXjZM9Vlghffgiz+clahi8GJN001rwhFb/bOY86ffV4WPEE6x3kr7eT Z6asdIRTurbNZ4TJrqGLjy9QToTGFY0= X-MC-Unique: XvmVqDriNlKLDD4kUBk8CQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v14 13/15] qemu_namespace: Create SGX related nodes in domain's namespace Date: Wed, 27 Jul 2022 12:34:59 +0200 Message-Id: <57c62ec15ecc9d8c0894f3128e1ef878a3b39985.1658917571.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: lin.a.yang@intel.com, jian-feng.ding@intel.com, haibin.huang@intel.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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: 1658918127416100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This is similar to the previous commit. SGX memory backend needs to access /dev/sgx_vepc and /dev/sgx_provision. Create these nodes in domain's private /dev when required by domain's config. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_namespace.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index 98cd794666..8fba39a690 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -350,11 +350,23 @@ static int qemuDomainSetupMemory(virDomainMemoryDef *mem, GSList **paths) { - if (mem->model !=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && - mem->model !=3D VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM) - return 0; + switch (mem->model) { + case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: + case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM: + *paths =3D g_slist_prepend(*paths, g_strdup(mem->nvdimmPath)); + break; =20 - *paths =3D g_slist_prepend(*paths, g_strdup(mem->nvdimmPath)); + case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC: + *paths =3D g_slist_prepend(*paths, g_strdup(QEMU_DEV_SGX_VEPVC)); + *paths =3D g_slist_prepend(*paths, g_strdup(QEMU_DEV_SGX_PROVISION= )); + break; + + case VIR_DOMAIN_MEMORY_MODEL_NONE: + case VIR_DOMAIN_MEMORY_MODEL_DIMM: + case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM: + case VIR_DOMAIN_MEMORY_MODEL_LAST: + break; + } =20 return 0; } --=20 2.35.1