From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473464; cv=none; d=zohomail.com; s=zohoarc; b=CYPmC0800saLX8ZedFG7ov44lwLNEGlILa1Gnx0r0ny2x44DQ3OjXrBE1iaDxvWpsgwB63FkTPgMvhpPaHzXZ06W3xuLvpQyNMJmMic2VBUOOgQ9mpj0d8mEOUPdyz6KytLhWzNlYCBoVK1CGa1nA8z733wnpSfjU+c4ejeLpjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473464; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wVDy82XWJii7WOeYl5Vqg+03p1rvNQlK1ICBkgZ/TFo=; b=RLe/5Hg+7mWcgo65RQjEcyNGGE+9Ns5ksG+h39RCAskMSgq23JNuYIFW8FNK5It7+G0WEj6DursSEtxL3mZc0EFFNZZdD9zwYYAPd2Vxaa1khJEsx5PcQVOLKOlFsxnF5gDTN8rrlHjffxgv8gfbUDsTjKbsna62Ag6bGB9t1aY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473464968790.7714262159088; Wed, 30 Sep 2020 06:44:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.712.2391 (Exim 4.92) (envelope-from ) id 1kNcOo-0004XV-Uw; Wed, 30 Sep 2020 13:44:02 +0000 Received: by outflank-mailman (output) from mailman id 712.2391; Wed, 30 Sep 2020 13:44:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOo-0004XO-Rz; Wed, 30 Sep 2020 13:44:02 +0000 Received: by outflank-mailman (input) for mailman id 712; Wed, 30 Sep 2020 13:44:01 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOn-0004XG-Nf for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:01 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d7361e63-6388-4a26-a8f1-db055c534621; Wed, 30 Sep 2020 13:44:00 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOn-0004XG-Nf for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:01 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d7361e63-6388-4a26-a8f1-db055c534621; Wed, 30 Sep 2020 13:44:00 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d7361e63-6388-4a26-a8f1-db055c534621 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473441; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=75RX+AZWjDMe6ak5ckm6ABFszfT5TF31cklPbQHcxpg=; b=XZBWohuL54YIvny7D2e9VpoJVwojbxqvaU9x2Hw7eKj1ueXs2CW211nH nBFKy4kJqGzak6k/nODpqQ/Li+mZnQKpgZAWDAVqnYuXNkd3wVK4359GQ pqwaWBDg5CNIYI0zMu3ytM9ELc4jkKd5Qj9qAaAYTHTOXE1F0DWV/CJ/t 0=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 3K4PJ/Y/F2MlGKIteVCm0+8eKfmy46PsqNoEUVhsURGR+kYwYalZOfCPHBMSXkjheV0tNZzyfl /29OcoAj21arAOUD0mrYjDWaLauRxRS9ZKQDeFkvuPiBrkPp/wads34uUBtxLAy59ny7NrLW9K bOuUZRfNMQmVAWyATv5rCN/iUqrXX4beCzczJ3zbNCgxhuOLvAXiw8Nd+QZd9PbE9cy/VugZqk 4TC+1I7O68fdcwWSKQNZQFwhakrZtxDMTSg2uZJI1Xt0LRlDGN3pCM1dXeVVtYd4vy6MWcs0en CA4= X-SBRS: None X-MesageID: 28300089 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="28300089" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH 1/8] tools/libxl: Simplify DOMCTL_CDF_ flags handling in libxl__domain_make() Date: Wed, 30 Sep 2020 14:42:41 +0100 Message-ID: <20200930134248.4918-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @citrix.com) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The use of the ternary operator serves only to obfuscate the code. Rewrite= it in more simple terms, avoiding the need to conditionally OR zero into the flags. Signed-off-by: Andrew Cooper Acked-by: Wei Liu Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libxl/libxl_create.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 1031b75159..ed671052d7 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -612,10 +612,12 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_co= nfig *d_config, =20 if (info->type !=3D LIBXL_DOMAIN_TYPE_PV) { create.flags |=3D XEN_DOMCTL_CDF_hvm; - create.flags |=3D - libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0; - create.flags |=3D - libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off; + + if ( libxl_defbool_val(info->hap) ) + create.flags |=3D XEN_DOMCTL_CDF_hap; + + if ( !libxl_defbool_val(info->oos) ) + create.flags |=3D XEN_DOMCTL_CDF_oos_off; } =20 assert(info->passthrough !=3D LIBXL_PASSTHROUGH_DEFAULT); --=20 2.11.0 From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473578; cv=none; d=zohomail.com; s=zohoarc; b=Z/1pLiub8sJvcPJEdG+PJCYsRjneO+WNHgpdvtuGibEV6+AqKKN/3go7WGjrkc44QHwFKzv23zRaMWQl7U06kzKPsGZ/+9z41tGk2WJX/Ksfj15Vzeqx5Zr0rcEHFTuRmG2/GV7cshmUx5WuOT9vPlK6r5Zv7+oMVFPyXyaeJkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473578; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tk4GWUmkYfn7kgyuNSuM2/s5IllFK2lSc6LK7LerNIE=; b=PYN7GTXANXPTIq9I1g6kgbYSxIWzfqgN7Dg96hdUN2zUDGf3uRz5yUtS+eg2TO/NWhxooEl9bXjYf5ZgOYwdz3F6ZHF6LDsGNl9xnDMPOYMs1c1dGeQIy5Ag2cJhR35ZzphoMJEkwU7pVS+W4Qe4afP+RP4QmwYQFlPjmVvHMcE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473578759540.4101002271046; Wed, 30 Sep 2020 06:46:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.721.2451 (Exim 4.92) (envelope-from ) id 1kNcQl-00056O-Pc; Wed, 30 Sep 2020 13:46:03 +0000 Received: by outflank-mailman (output) from mailman id 721.2451; Wed, 30 Sep 2020 13:46:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcQl-00056F-MB; Wed, 30 Sep 2020 13:46:03 +0000 Received: by outflank-mailman (input) for mailman id 721; Wed, 30 Sep 2020 13:46:03 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcQl-00052v-4d for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:46:03 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1206cba0-a852-4df3-b2b9-f626274909e9; Wed, 30 Sep 2020 13:45:59 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcQl-00052v-4d for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:46:03 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1206cba0-a852-4df3-b2b9-f626274909e9; Wed, 30 Sep 2020 13:45:59 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1206cba0-a852-4df3-b2b9-f626274909e9 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473560; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sjwCbNEiAtCg61EY837b6G5uXXMGVuCb608FCmyhoBg=; b=SD3NlFu1lBo+YpotcdsTTujCxvM8pkS2h4Zm4xgrGYrIK28kn3bXJw/1 qZd8Lw8vN7/Gs7rvft1dRvK6HLuAyNMWkUC3vCz7WMRNRIykS6jS2YPcz kF04lGkG69Z9VqBDEBW8FBpfmeHkzF3nTl29LlOdMy81NQrfZUjfvJsp6 o=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: TH2UcGYEphdKtwsoYvyNDdY7u52FzEHYlVlR6kZfdbEn9ZNDiF2S7wf7+L262B56OSCDaS4MVq CJQBWyspV1dN7bf1oIWYSVpW/k5DQblFq3Fr34fnw6rejh69lStgGAH44LijK04GDGCPP83DYR yP+9DqzZ4ftbvDUeQTSMCUQVohvGxzGxGiEzfVSd0fwbV5CwS021cxPSCjlpghDMzG0snLwQq5 Jm9/2JNZiAFwhkQAMn/vqVR9ESXjgWudm5rXJS03bxFa3xsPZAgyEOcEN7Zof+cR2x/L4Zqogc MgA= X-SBRS: None X-MesageID: 27971438 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="27971438" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 2/8] xen/domctl: Simplify DOMCTL_CDF_ checking logic Date: Wed, 30 Sep 2020 14:42:42 +0100 Message-ID: <20200930134248.4918-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) Introduce some local variables to make the resulting logic easier to follow. Join the two IOMMU checks in sanitise_domain_config(). Tweak some of the terminology for better accuracy. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 Reviewed-by: Wei Liu --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/domain.c | 7 ++++--- xen/common/domain.c | 32 ++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 7e16d49bfd..d8f9be132c 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -629,6 +629,7 @@ void arch_vcpu_destroy(struct vcpu *v) int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) { bool hvm =3D config->flags & XEN_DOMCTL_CDF_hvm; + bool hap =3D config->flags & XEN_DOMCTL_CDF_hap; unsigned int max_vcpus; =20 if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) ) @@ -653,13 +654,13 @@ int arch_sanitise_domain_config(struct xen_domctl_cre= atedomain *config) return -EINVAL; } =20 - if ( (config->flags & XEN_DOMCTL_CDF_hap) && !hvm_hap_supported() ) + if ( hap && !hvm_hap_supported() ) { - dprintk(XENLOG_INFO, "HAP requested but not supported\n"); + dprintk(XENLOG_INFO, "HAP requested but not available\n"); return -EINVAL; } =20 - if ( !(config->flags & XEN_DOMCTL_CDF_hvm) ) + if ( !hvm ) /* * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear * for HVM guests. diff --git a/xen/common/domain.c b/xen/common/domain.c index 8cfa2e0b6b..cb617dc5aa 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -299,6 +299,10 @@ static void _domain_destroy(struct domain *d) =20 static int sanitise_domain_config(struct xen_domctl_createdomain *config) { + bool hvm =3D config->flags & XEN_DOMCTL_CDF_hvm; + bool hap =3D config->flags & XEN_DOMCTL_CDF_hap; + bool iommu =3D config->flags & XEN_DOMCTL_CDF_iommu; + if ( config->flags & ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap | XEN_DOMCTL_CDF_s3_integrity | @@ -310,30 +314,34 @@ static int sanitise_domain_config(struct xen_domctl_c= reatedomain *config) return -EINVAL; } =20 - if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts ) - { - dprintk(XENLOG_INFO, - "IOMMU options specified but IOMMU not enabled\n"); - return -EINVAL; - } - if ( config->max_vcpus < 1 ) { dprintk(XENLOG_INFO, "No vCPUS\n"); return -EINVAL; } =20 - if ( !(config->flags & XEN_DOMCTL_CDF_hvm) && - (config->flags & XEN_DOMCTL_CDF_hap) ) + if ( hap && !hvm ) { dprintk(XENLOG_INFO, "HAP requested for non-HVM guest\n"); return -EINVAL; } =20 - if ( (config->flags & XEN_DOMCTL_CDF_iommu) && !iommu_enabled ) + if ( iommu ) { - dprintk(XENLOG_INFO, "IOMMU is not enabled\n"); - return -EINVAL; + if ( !iommu_enabled ) + { + dprintk(XENLOG_INFO, "IOMMU requested but not available\n"); + return -EINVAL; + } + } + else + { + if ( config->iommu_opts ) + { + dprintk(XENLOG_INFO, + "IOMMU options specified but IOMMU not requested\n"); + return -EINVAL; + } } =20 return arch_sanitise_domain_config(config); --=20 2.11.0 From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473588; cv=none; d=zohomail.com; s=zohoarc; b=bQSvmN7YaUoDQMD77r9v7QtGvnXPkWrpaVV9lReNnZwNtDCYOFxoMEsxMah8OyXSSMbFUlM4FpwDP1oXl3I4xyV5esq1T+x8kEqYIT5naOyB1txNc0NWq1D2DKVcAlHNQ6rMSRuxY7g6CrPf9f8klLGkE/M5AJQSleS4xzNppZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473588; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3TsJxOvMWAumvXYpqEQXC3dL/T+gvsavc8GhbT93hvU=; b=hT4uNYGPuBnylgjbIs4vTjNbpp5dM4ZhJm9h+ZWuwf4rhdtYtdGq9nI0bcO/gUFbRwA2G7byxCoPKTGxYor1uyta9tDJPAMW5klAHs6lD+DCaoSQiALTx7RwgV6jutDs0uIWgQF13o7kPt2CUdn3k7IQjTNvD94RvVk1k9BfetQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473588305415.5872879356615; Wed, 30 Sep 2020 06:46:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.723.2463 (Exim 4.92) (envelope-from ) id 1kNcQr-0005Ab-5I; Wed, 30 Sep 2020 13:46:09 +0000 Received: by outflank-mailman (output) from mailman id 723.2463; Wed, 30 Sep 2020 13:46:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcQr-0005AT-1Y; Wed, 30 Sep 2020 13:46:09 +0000 Received: by outflank-mailman (input) for mailman id 723; Wed, 30 Sep 2020 13:46:08 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcQq-00052v-4T for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:46:08 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id bc52b6fc-b7d0-47a3-85bd-aa002a210392; Wed, 30 Sep 2020 13:46:01 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcQq-00052v-4T for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:46:08 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id bc52b6fc-b7d0-47a3-85bd-aa002a210392; Wed, 30 Sep 2020 13:46:01 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bc52b6fc-b7d0-47a3-85bd-aa002a210392 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473561; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OjuvPpFkciD4PB0zF10QdC1ef/eF6ozHZwFD86WkT0o=; b=UUaLsUwPRZF+DPO8QWgrLPdG1cM6c43IwQn6UfVw3TLafO8fH0A5h8vd 5pXIZwL4QNbmlQssu2shFaUrwrXgJgpcrUQ21+9js5H9qkUukc1hdfaeJ c59MhOiCskKL02KlHyUf4Xw/RgW5vqDmEXF0kF6SS4cfvEvG8SlvAVryK w=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: oIxanzhGrZSaqWoUT8gH61xIFZr1nzXyOVpm3IW54UIOYSEmFB8mPdlZZtto5F9Ngka4gLWfSn LT7PADtf7S/IsHQZ9hcmnkMYZw0tNixptRqqUogBP7NzF2TgeJYCGMJFYpRnkIHL/2TbQlnfWF IWSsPTcQ2Gza09vkRpVIMoUSZU6Te69oiS39ZRNCiSYNveUQgx1o2v670/HXw+pAvfIqfIccgC VJeSb9qZqsimF7rnvknwMwdgM+ylW31M4xdqBmDD2vZbxzWfVd2qp39+QX9UFEJBSIMdXHvvgE kSA= X-SBRS: None X-MesageID: 28239648 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="28239648" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Ian Jackson , Christian Lindig , =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= , Rob Hoes Subject: [PATCH 3/8] xen/domctl: Introduce and use XEN_DOMCTL_CDF_nested_virt Date: Wed, 30 Sep 2020 14:42:43 +0100 Message-ID: <20200930134248.4918-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) Like other major areas of functionality, nested virt (or not) needs to be known at domain creation time for sensible CPUID handling, and wants to be known this early for sensible infrastructure handling in Xen. Introduce XEN_DOMCTL_CDF_nested_virt and modify libxl to set it appropriate= ly when creating domains. There is no need to adjust the ARM logic to reject = the use of this new flag. No functional change yet. Signed-off-by: Andrew Cooper Acked-by: Christian Lindig Acked-by: Wei Liu Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Ian Jackson CC: Wei Liu CC: Christian Lindig CC: Edwin T=C3=B6r=C3=B6k CC: Rob Hoes --- tools/libxl/libxl_create.c | 3 +++ tools/ocaml/libs/xc/xenctrl.ml | 1 + tools/ocaml/libs/xc/xenctrl.mli | 1 + xen/arch/x86/domain.c | 7 +++++++ xen/common/domain.c | 11 +++++------ xen/include/public/domctl.h | 4 +++- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index ed671052d7..51e6809f3c 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -618,6 +618,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_conf= ig *d_config, =20 if ( !libxl_defbool_val(info->oos) ) create.flags |=3D XEN_DOMCTL_CDF_oos_off; + + if ( libxl_defbool_val(b_info->nested_hvm) ) + create.flags |=3D XEN_DOMCTL_CDF_nested_virt; } =20 assert(info->passthrough !=3D LIBXL_PASSTHROUGH_DEFAULT); diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml index 497ded7ce2..e878699b0a 100644 --- a/tools/ocaml/libs/xc/xenctrl.ml +++ b/tools/ocaml/libs/xc/xenctrl.ml @@ -64,6 +64,7 @@ type domain_create_flag =3D | CDF_OOS_OFF | CDF_XS_DOMAIN | CDF_IOMMU + | CDF_NESTED_VIRT =20 type domain_create_iommu_opts =3D | IOMMU_NO_SHAREPT diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.= mli index f7f6ec570d..e64907df8e 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@ -57,6 +57,7 @@ type domain_create_flag =3D | CDF_OOS_OFF | CDF_XS_DOMAIN | CDF_IOMMU + | CDF_NESTED_VIRT =20 type domain_create_iommu_opts =3D | IOMMU_NO_SHAREPT diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index d8f9be132c..5454f94d18 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -630,6 +630,7 @@ int arch_sanitise_domain_config(struct xen_domctl_creat= edomain *config) { bool hvm =3D config->flags & XEN_DOMCTL_CDF_hvm; bool hap =3D config->flags & XEN_DOMCTL_CDF_hap; + bool nested_virt =3D config->flags & XEN_DOMCTL_CDF_nested_virt; unsigned int max_vcpus; =20 if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) ) @@ -667,6 +668,12 @@ int arch_sanitise_domain_config(struct xen_domctl_crea= tedomain *config) */ config->flags |=3D XEN_DOMCTL_CDF_oos_off; =20 + if ( nested_virt && !hap ) + { + dprintk(XENLOG_INFO, "Nested virt not supported without HAP\n"); + return -EINVAL; + } + return 0; } =20 diff --git a/xen/common/domain.c b/xen/common/domain.c index cb617dc5aa..58b62d2fe4 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -303,12 +303,11 @@ static int sanitise_domain_config(struct xen_domctl_c= reatedomain *config) bool hap =3D config->flags & XEN_DOMCTL_CDF_hap; bool iommu =3D config->flags & XEN_DOMCTL_CDF_iommu; =20 - if ( config->flags & ~(XEN_DOMCTL_CDF_hvm | - XEN_DOMCTL_CDF_hap | - XEN_DOMCTL_CDF_s3_integrity | - XEN_DOMCTL_CDF_oos_off | - XEN_DOMCTL_CDF_xs_domain | - XEN_DOMCTL_CDF_iommu) ) + if ( config->flags & + ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap | + XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off | + XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu | + XEN_DOMCTL_CDF_nested_virt) ) { dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags); return -EINVAL; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 791f0a2592..666aeb71bf 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -68,9 +68,11 @@ struct xen_domctl_createdomain { /* Should this domain be permitted to use the IOMMU? */ #define _XEN_DOMCTL_CDF_iommu 5 #define XEN_DOMCTL_CDF_iommu (1U<<_XEN_DOMCTL_CDF_iommu) +#define _XEN_DOMCTL_CDF_nested_virt 6 +#define XEN_DOMCTL_CDF_nested_virt (1U << _XEN_DOMCTL_CDF_nested_virt) =20 /* Max XEN_DOMCTL_CDF_* constant. Used for ABI checking. */ -#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_iommu +#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_nested_virt =20 uint32_t flags; =20 --=20 2.11.0 From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473515; cv=none; d=zohomail.com; s=zohoarc; b=C21n4ls/p+CBnkVhmnfODApfVyEMTnn8YwxrsH2pvbcq2P9uuJXC0y3AZ09GL8AAVbjtNGsHRI1wv1SpOwQvV58E/zw43j7lPWue23edoPDrxxXkHvY2BkuJtd5WhhdgxAXUd6/dGxfn8i1mgz3JK9Wx0yryIWwGoyMQO5PgJuQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473515; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V4/AATAJ5rgrZuW366CryQcPG8fJ+6V/xZN4LAAM3PQ=; b=eKjuexHFxWDvi8nY9USjwtiacEe2spS9CJ3Uc15/JnW5xyu0nbANl7nCzPx4PpQtPWbXV+MAHPwx7ET7W5I4HEB46mJZ7EVgray/TWLYboCC6u2kOMyRMbwquUiQwcT7TxIvwfz/9sNexP26lrpvu0UkA3DdJWa2TbmW9HDM69Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473515929441.4442527084233; Wed, 30 Sep 2020 06:45:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.717.2427 (Exim 4.92) (envelope-from ) id 1kNcPg-0004r9-Ut; Wed, 30 Sep 2020 13:44:56 +0000 Received: by outflank-mailman (output) from mailman id 717.2427; Wed, 30 Sep 2020 13:44:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcPg-0004r2-Rm; Wed, 30 Sep 2020 13:44:56 +0000 Received: by outflank-mailman (input) for mailman id 717; Wed, 30 Sep 2020 13:44:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcPg-0004qv-2Q for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:56 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 084cbfe0-67fa-4484-94f4-a274a3f87eea; Wed, 30 Sep 2020 13:44:55 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcPg-0004qv-2Q for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:56 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 084cbfe0-67fa-4484-94f4-a274a3f87eea; Wed, 30 Sep 2020 13:44:55 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 084cbfe0-67fa-4484-94f4-a274a3f87eea DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473495; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=HC6SnQwiIswEb/tmrOppoZWsZUS9u8+dTDPCo4DGq8I=; b=ZepEBaJ0SJJpzHXcF7EBDR9ROfxHwzpwnm2ICkLY88P8TDeVF4WQ12vz 6zthn7K0szMHSjDH0/Cp3Zdl+OBB0Sdq4B239usuj5QGuPpXogctfSCoe l4N1ZjH5OeRkfrVC04N6ya1ryJZ1alhTbsN4xWZsnuYYjLGR56Bdo2MWv Y=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: /h0miN674r1cikaV0thv3EGCa7qVSECvQKjDt+gyFnbM0tDhCHMzzCZ5oOeyolWdW/EZupFPYY cBnxeC91Cl1glCLnYd8SqT355EnI09UwOjlTU6priH2NmkOeqFfnBIdQ02v/NLj607SnJtLjHW oaL2NTx73/HUfWrVr9KLr9NLAbkJh6KG8Z/J32dFzQfmjQ5B48b4v5C9azeqMb6SGCtr7+Ncni 6mnK0dPiQRIrg2FC+gAYVAcdg/q6JdRlOG0E9EUKKEJEjxjxg5LJcKI+q34j1JfaA9blqBU9KI Okk= X-SBRS: None X-MesageID: 28058130 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="28058130" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH 4/8] tools/cpuid: Plumb nested_virt down into xc_cpuid_apply_policy() Date: Wed, 30 Sep 2020 14:42:44 +0100 Message-ID: <20200930134248.4918-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @citrix.com) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Nested Virt is the final special case in legacy CPUID handling. Pass the (poorly named) nested_hvm setting down into xc_cpuid_apply_policy() to break the semantic dependency on HVM_PARAM_NESTEDHVM. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libs/ctrl/include/xenctrl.h | 4 ++-- tools/libs/guest/xg_cpuid_x86.c | 14 +++++--------- tools/libxl/libxl_cpuid.c | 3 ++- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/tools/libs/ctrl/include/xenctrl.h b/tools/libs/ctrl/include/xe= nctrl.h index 73e9535fc8..ba70bec9c4 100644 --- a/tools/libs/ctrl/include/xenctrl.h +++ b/tools/libs/ctrl/include/xenctrl.h @@ -1826,7 +1826,7 @@ struct xc_xend_cpuid { * cases, and the generated policy must be compatible with a 4.13. * * Either pass a full new @featureset (and @nr_features), or adjust indivi= dual - * features (@pae, @itsc). + * features (@pae, @itsc, @nested_virt). * * Then (optionally) apply legacy XEND overrides (@xend) to the result. */ @@ -1834,7 +1834,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore, const uint32_t *featureset, unsigned int nr_features, bool pae, bool itsc, - const struct xc_xend_cpuid *xend); + bool nested_virt, const struct xc_xend_cpuid *xe= nd); int xc_mca_op(xc_interface *xch, struct xen_mc *mc); int xc_mca_op_inject_v2(xc_interface *xch, unsigned int flags, xc_cpumap_t cpumap, unsigned int nr_cpus); diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x8= 6.c index dc50106975..aae6931a11 100644 --- a/tools/libs/guest/xg_cpuid_x86.c +++ b/tools/libs/guest/xg_cpuid_x86.c @@ -427,7 +427,7 @@ static int xc_cpuid_xend_policy( =20 int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore, const uint32_t *featureset, unsigned int nr_feat= ures, - bool pae, bool itsc, + bool pae, bool itsc, bool nested_virt, const struct xc_xend_cpuid *xend) { int rc; @@ -559,7 +559,11 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t = domid, bool restore, p->extd.itsc =3D itsc; =20 if ( di.hvm ) + { p->basic.pae =3D pae; + p->basic.vmx =3D nested_virt; + p->extd.svm =3D nested_virt; + } } =20 if ( !di.hvm ) @@ -625,14 +629,6 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t = domid, bool restore, } break; } - - /* - * These settings are necessary to cause earlier HVM_PARAM_NESTEDH= VM - * to be reflected correctly in CPUID. Xen will discard these bit= s if - * configuration hasn't been set for the domain. - */ - p->basic.vmx =3D true; - p->extd.svm =3D true; } =20 rc =3D x86_cpuid_copy_to_buffer(p, leaves, &nr_leaves); diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c index f54eb83a90..08e85dcffb 100644 --- a/tools/libxl/libxl_cpuid.c +++ b/tools/libxl/libxl_cpuid.c @@ -422,6 +422,7 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid= , bool restore, { bool pae =3D true; bool itsc; + bool nested_virt =3D libxl_defbool_val(info->nested_hvm); =20 /* * For PV guests, PAE is Xen-controlled (it is the 'p' that differenti= ates @@ -452,7 +453,7 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid= , bool restore, info->tsc_mode =3D=3D LIBXL_TSC_MODE_ALWAYS_EMULATE); =20 xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0, - pae, itsc, info->cpuid); + pae, itsc, nested_virt, info->cpuid); } =20 static const char *input_names[2] =3D { "leaf", "subleaf" }; --=20 2.11.0 From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473472; cv=none; d=zohomail.com; s=zohoarc; b=TDD6GST70VQQG1AV2OKO894wAkh+mKS0K0HgEy2hoRjBfUwgupY4XF5JioutGgyDeItQNQAx/TMrKeWvJPctZOjoFlw1Rzp8EUXqwwKznbqkWRtG5ETeuLpqyiruAMscsYhrxqjMZ23t4HElE/DfIJP5tJeMttezBUoe48D8aow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473472; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hsIvB8YwXXGbTpkH8+sg1Epu4zveCxhPBGzOvIKKKlM=; b=jh9E+CG6qhkDTzpLIWS/kcggzygSQcV3cqS3YUL3RkwmkoxzpC8LdGvnkmZilvR2o/0haGlRidRdEra+O7Nrvsex7U8sGZe+5Cxz+9azHry13ZpZbY/KkfH+1mheJVKKkD7ctivw1VAJncA3AfmOgjDPV6CZxF498U8YE3VA4F4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473472502786.2739729908999; Wed, 30 Sep 2020 06:44:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.714.2415 (Exim 4.92) (envelope-from ) id 1kNcOt-0004cD-IY; Wed, 30 Sep 2020 13:44:07 +0000 Received: by outflank-mailman (output) from mailman id 714.2415; Wed, 30 Sep 2020 13:44:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOt-0004c6-F8; Wed, 30 Sep 2020 13:44:07 +0000 Received: by outflank-mailman (input) for mailman id 714; Wed, 30 Sep 2020 13:44:06 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOs-0004XG-M4 for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:06 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a22d1d71-d2b5-4b7d-be5f-3cba54ee3e0c; Wed, 30 Sep 2020 13:44:01 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOs-0004XG-M4 for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:06 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a22d1d71-d2b5-4b7d-be5f-3cba54ee3e0c; Wed, 30 Sep 2020 13:44:01 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a22d1d71-d2b5-4b7d-be5f-3cba54ee3e0c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473443; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NPZHvV7WercRVJvbGr8hSw3MlS+5rPwGf4cgVL7SwpY=; b=RI/wbZzp7gqW3EIUxIASZMXvRGKTEgU5d2ZBtFPr8Bm3X5QD8plSJ+eG DgfS/hak0S9prGa7cZg6xUfjOyKnIsljC/Pw1IPioKl8mPb66ZnnqSD7a kFZEAZhLDWtL6Vm9itDzeUaBVGjsr5TISx92y43iHMNVNMHB9/fo5HQwV A=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: a6x58zNrPSi7fF0Odnji6cHgo3gjdaHN/R9Iwjt3tGJ8sOvFYpkKZG31dpV01LURqicrzQmN8G 5BanRU9OgXtAzlGGeMrid+9FnPA7N7T9RP+zWOc18fE+ZKK86YUFeo1492bcjXpvjjUULfYETE Ll6LzkdtiKEayVR/+yja9uBH6AB9CWCSLDEO+kAVUQ9Hv/vzuvTOFzXsqyAht7/QQ0sSmIOSpM IyR0Oc66yWxvyoVap87d8T6mCQOU3UByXBE0MsRVEMBe9kQAGKD9enywGPpmrz8HZxMMQyegqC UVk= X-SBRS: None X-MesageID: 28300090 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="28300090" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Ian Jackson , Anthony PERARD Subject: [PATCH 5/8] x86/hvm: Obsolete the use of HVM_PARAM_NESTEDHVM Date: Wed, 30 Sep 2020 14:42:45 +0100 Message-ID: <20200930134248.4918-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) With XEN_DOMCTL_CDF_nested_virt now passed properly to domain_create(), reimplement nestedhvm_enabled() to use the property which is fixed for the lifetime of the domain. This makes the call to nestedhvm_vcpu_initialise() from hvm_vcpu_initialise= () no longer dead. It became logically dead with the Xend =3D> XL transition,= as they initialise HVM_PARAM_NESTEDHVM in opposite orders with respect to XEN_DOMCTL_max_vcpus. There is one opencoded user of nestedhvm_enabled() in HVM_PARAM_ALTP2M's safety check. Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 Reviewed-by: Wei Liu --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Ian Jackson CC: Anthony PERARD The redunction in complexity of nestedhvm_enabled() has a substantial effec= t: add/remove: 1/0 grow/shrink: 2/37 up/down: 669/-2095 (-1426) --- tools/libxl/libxl_x86.c | 5 ----- xen/arch/x86/hvm/hvm.c | 33 ++++----------------------------- xen/include/asm-x86/hvm/nestedhvm.h | 5 ++--- xen/include/public/hvm/params.h | 4 +--- 4 files changed, 7 insertions(+), 40 deletions(-) diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c index 7d95506e00..72777fcaad 100644 --- a/tools/libxl/libxl_x86.c +++ b/tools/libxl/libxl_x86.c @@ -428,11 +428,6 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t= domid, LOG(ERROR, "Couldn't set HVM_PARAM_TIMER_MODE"); goto out; } - if (xc_hvm_param_set(xch, domid, HVM_PARAM_NESTEDHVM, - libxl_defbool_val(info->nested_hvm))) { - LOG(ERROR, "Couldn't set HVM_PARAM_NESTEDHVM"); - goto out; - } if (xc_hvm_param_set(xch, domid, HVM_PARAM_ALTP2M, altp2m)) { LOG(ERROR, "Couldn't set HVM_PARAM_ALTP2M"); goto out; diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 2dfda93e09..101a739952 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4086,6 +4086,7 @@ static int hvm_allow_set_param(struct domain *d, case HVM_PARAM_MEMORY_EVENT_CR3: case HVM_PARAM_MEMORY_EVENT_CR4: case HVM_PARAM_MEMORY_EVENT_INT3: + case HVM_PARAM_NESTEDHVM: case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP: case HVM_PARAM_BUFIOREQ_EVTCHN: case HVM_PARAM_MEMORY_EVENT_MSR: @@ -4204,39 +4205,12 @@ static int hvm_set_param(struct domain *d, uint32_t= index, uint64_t value) case HVM_PARAM_ACPI_IOPORTS_LOCATION: rc =3D pmtimer_change_ioport(d, value); break; - case HVM_PARAM_NESTEDHVM: - rc =3D xsm_hvm_param_nested(XSM_PRIV, d); - if ( rc ) - break; - if ( value > 1 ) - rc =3D -EINVAL; - /* - * Remove the check below once we have - * shadow-on-shadow. - */ - if ( !paging_mode_hap(d) && value ) - rc =3D -EINVAL; - if ( value && - d->arch.hvm.params[HVM_PARAM_ALTP2M] ) - rc =3D -EINVAL; - /* Set up NHVM state for any vcpus that are already up. */ - if ( value && - !d->arch.hvm.params[HVM_PARAM_NESTEDHVM] ) - for_each_vcpu(d, v) - if ( rc =3D=3D 0 ) - rc =3D nestedhvm_vcpu_initialise(v); - if ( !value || rc ) - for_each_vcpu(d, v) - nestedhvm_vcpu_destroy(v); - break; case HVM_PARAM_ALTP2M: rc =3D xsm_hvm_param_altp2mhvm(XSM_PRIV, d); if ( rc ) break; - if ( value > XEN_ALTP2M_limited ) - rc =3D -EINVAL; - if ( value && - d->arch.hvm.params[HVM_PARAM_NESTEDHVM] ) + if ( (value > XEN_ALTP2M_limited) || + (value && nestedhvm_enabled(d)) ) rc =3D -EINVAL; break; case HVM_PARAM_TRIPLE_FAULT_REASON: @@ -4390,6 +4364,7 @@ static int hvm_allow_get_param(struct domain *d, case HVM_PARAM_MEMORY_EVENT_CR3: case HVM_PARAM_MEMORY_EVENT_CR4: case HVM_PARAM_MEMORY_EVENT_INT3: + case HVM_PARAM_NESTEDHVM: case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP: case HVM_PARAM_BUFIOREQ_EVTCHN: case HVM_PARAM_MEMORY_EVENT_MSR: diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/= nestedhvm.h index d9784a2e0b..385cb708a3 100644 --- a/xen/include/asm-x86/hvm/nestedhvm.h +++ b/xen/include/asm-x86/hvm/nestedhvm.h @@ -34,10 +34,9 @@ enum nestedhvm_vmexits { }; =20 /* Nested HVM on/off per domain */ -static always_inline bool nestedhvm_enabled(const struct domain *d) +static inline bool nestedhvm_enabled(const struct domain *d) { - return is_hvm_domain(d) && d->arch.hvm.params && - d->arch.hvm.params[HVM_PARAM_NESTEDHVM]; + return d->options & XEN_DOMCTL_CDF_nested_virt; } =20 /* Nested VCPU */ diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/param= s.h index 0a91bfa749..0e3fdca096 100644 --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -34,6 +34,7 @@ #define HVM_PARAM_MEMORY_EVENT_CR3 21 #define HVM_PARAM_MEMORY_EVENT_CR4 22 #define HVM_PARAM_MEMORY_EVENT_INT3 23 +#define HVM_PARAM_NESTEDHVM 24 #define HVM_PARAM_MEMORY_EVENT_SINGLE_STEP 25 #define HVM_PARAM_BUFIOREQ_EVTCHN 26 #define HVM_PARAM_MEMORY_EVENT_MSR 30 @@ -232,9 +233,6 @@ */ #define HVM_PARAM_ACPI_IOPORTS_LOCATION 19 =20 -/* Boolean: Enable nestedhvm (hvm only) */ -#define HVM_PARAM_NESTEDHVM 24 - /* Params for the mem event rings */ #define HVM_PARAM_PAGING_RING_PFN 27 #define HVM_PARAM_MONITOR_RING_PFN 28 --=20 2.11.0 From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473412; cv=none; d=zohomail.com; s=zohoarc; b=EEf4UlmUL8YTY22atqXIjkdNxGUH+vzUP2T5+aXpGtdPhD5zVJIdw+xnjIMjqvBZIki4c3YJMy1ZulC6cFhqYSX9mewtV2vAngkIGYR3uBOyKaUFK5GaIJWvPxEkiU5d6VVKyOtGKiPMaOB6LLhxQlYh7dA7FgBVqJdLuOkkKy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473412; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U2+cWgr4ecgG6pdbkBEm2QKoxSq5PnPcUWRFQvynL4Q=; b=NSq/Vj0QT1XUG42TpMjYT9bv2E1360CQHVkp7zxEeDtgJCK9g2roWYbQW3TxcTv+dhLYR873lBRrc348m7a5DIciP7nvifvgk+aENlz2hcFNrEWzUXfJwcNyYpMI8pxn2mFTAaNuzNYcWKa2hwvCSOOMvg/WpuRdzNyf0yt7W2s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473412700828.5485619822076; Wed, 30 Sep 2020 06:43:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.709.2379 (Exim 4.92) (envelope-from ) id 1kNcO2-0004Ly-GY; Wed, 30 Sep 2020 13:43:14 +0000 Received: by outflank-mailman (output) from mailman id 709.2379; Wed, 30 Sep 2020 13:43:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcO2-0004Lq-DB; Wed, 30 Sep 2020 13:43:14 +0000 Received: by outflank-mailman (input) for mailman id 709; Wed, 30 Sep 2020 13:43:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcO1-0004Jq-Js for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:43:13 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id be0b216d-03f7-43c9-984c-37fc38ec7a78; Wed, 30 Sep 2020 13:43:08 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcO1-0004Jq-Js for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:43:13 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id be0b216d-03f7-43c9-984c-37fc38ec7a78; Wed, 30 Sep 2020 13:43:08 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: be0b216d-03f7-43c9-984c-37fc38ec7a78 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473389; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pfaebICHsT9Xpl+dEptwfDkHBqyC5sZfCXsNsPLhVsc=; b=bAVuFgzfeTaU/htJWNkNIaMmB3gxGcjMxJB49Jn2HCeFT+EIXBjsTdE0 JYxYg1/inJmeNOYWbdOzwERxeaLdJPad91JMJhhyh7tcFV7fAENEnicFe KP0ghHBscf/PlSuH1NHtEZcqtMgvyJxPZs+JIQkBQ8k3lqWtOB4pgWp0U Q=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: boXrHQnCsD1fTNyo2vlXTroxje/blgHgumD2CZjzJ/6ZfjxImnSHpDDeDsoBoeHwp7525KHynV N4iYRSGVlrvjaZC1ggojIqxQltUc8VQPZuvvd3RDumLfBodPXY2eyB1hyD5lldgBVHLtKRK1dd VQaD67CYazYcD+Dh8nBVOEB7ZaLvWTAszq95aioLgI5B2Wm0DBOM/0xsdk2vA3OhJvjbC4oEKr ktrcb0lwp4O7Q6BccnJqwjcAYxCYfdnwWFbnzEHJVJExxo6emriCXSIUo44QHvSCncMTCr5Z8k ZXI= X-SBRS: None X-MesageID: 27971143 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="27971143" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 6/8] xen/xsm: Drop xsm_hvm_param_nested() Date: Wed, 30 Sep 2020 14:42:46 +0100 Message-ID: <20200930134248.4918-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) The sole caller has been removed. Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monn=C3=A9 Acked-by: Wei Liu --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- tools/flask/policy/modules/xen.if | 2 +- xen/include/xsm/dummy.h | 6 ------ xen/include/xsm/xsm.h | 6 ------ xen/xsm/dummy.c | 1 - xen/xsm/flask/hooks.c | 6 ------ xen/xsm/flask/policy/access_vectors | 2 -- 6 files changed, 1 insertion(+), 22 deletions(-) diff --git a/tools/flask/policy/modules/xen.if b/tools/flask/policy/modules= /xen.if index 8eb2293a52..5e2aa472b6 100644 --- a/tools/flask/policy/modules/xen.if +++ b/tools/flask/policy/modules/xen.if @@ -59,7 +59,7 @@ define(`create_domain_common', ` allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmu= ext_op updatemp }; allow $1 $2:grant setup; allow $1 $2:hvm { getparam hvmctl sethvmc - setparam nested altp2mhvm altp2mhvm_op dm }; + setparam altp2mhvm altp2mhvm_op dm }; ') =20 # create_domain(priv, target) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 2368acebed..7ae3c40eb5 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -551,12 +551,6 @@ static XSM_INLINE int xsm_hvm_control(XSM_DEFAULT_ARG = struct domain *d, unsigned return xsm_default_action(action, current->domain, d); } =20 -static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *= d) -{ - XSM_ASSERT_ACTION(XSM_PRIV); - return xsm_default_action(action, current->domain, d); -} - static XSM_INLINE int xsm_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domai= n *d) { XSM_ASSERT_ACTION(XSM_PRIV); diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index a80bcf3e42..7bd03d8817 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -136,7 +136,6 @@ struct xsm_operations { =20 int (*hvm_param) (struct domain *d, unsigned long op); int (*hvm_control) (struct domain *d, unsigned long op); - int (*hvm_param_nested) (struct domain *d); int (*hvm_param_altp2mhvm) (struct domain *d); int (*hvm_altp2mhvm_op) (struct domain *d, uint64_t mode, uint32_t op); int (*get_vnumainfo) (struct domain *d); @@ -564,11 +563,6 @@ static inline int xsm_hvm_control(xsm_default_t def, s= truct domain *d, unsigned return xsm_ops->hvm_control(d, op); } =20 -static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *= d) -{ - return xsm_ops->hvm_param_nested(d); -} - static inline int xsm_hvm_param_altp2mhvm (xsm_default_t def, struct domai= n *d) { return xsm_ops->hvm_param_altp2mhvm(d); diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index d4cce68089..9e09512144 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -106,7 +106,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, hypfs_op); set_to_dummy_if_null(ops, hvm_param); set_to_dummy_if_null(ops, hvm_control); - set_to_dummy_if_null(ops, hvm_param_nested); set_to_dummy_if_null(ops, hvm_param_altp2mhvm); set_to_dummy_if_null(ops, hvm_altp2mhvm_op); =20 diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index fab5d30c3a..19b0d9e3eb 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1208,11 +1208,6 @@ static int flask_hvm_param(struct domain *d, unsigne= d long op) return current_has_perm(d, SECCLASS_HVM, perm); } =20 -static int flask_hvm_param_nested(struct domain *d) -{ - return current_has_perm(d, SECCLASS_HVM, HVM__NESTED); -} - static int flask_hvm_param_altp2mhvm(struct domain *d) { return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM); @@ -1816,7 +1811,6 @@ static struct xsm_operations flask_ops =3D { .hypfs_op =3D flask_hypfs_op, .hvm_param =3D flask_hvm_param, .hvm_control =3D flask_hvm_param, - .hvm_param_nested =3D flask_hvm_param_nested, .hvm_param_altp2mhvm =3D flask_hvm_param_altp2mhvm, .hvm_altp2mhvm_op =3D flask_hvm_altp2mhvm_op, =20 diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/acc= ess_vectors index fde5162c7e..1aa0bb501c 100644 --- a/xen/xsm/flask/policy/access_vectors +++ b/xen/xsm/flask/policy/access_vectors @@ -272,8 +272,6 @@ class hvm # source =3D domain whose memory is being shared # target =3D client domain share_mem -# HVMOP_set_param setting HVM_PARAM_NESTEDHVM - nested # HVMOP_set_param setting HVM_PARAM_ALTP2MHVM altp2mhvm # HVMOP_altp2m_set_domain_state HVMOP_altp2m_get_domain_state --=20 2.11.0 From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473464; cv=none; d=zohomail.com; s=zohoarc; b=fC8YdGhXFT5129nYLVkkzOedwfUsVDBbMlu5+ce2rSLLjchGiWcSr5gCk7n1tm7UZ9021iNqu3i9ydvu2Xj5Sz26DvTb4j3U24MbntX+WoLsPdTg/KY5jN47jZ7mNKSXko/0O5omDXj1ewTuAcEwKnYu8yn0JMDQv42Wmt6WJso= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473464; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jbzhXN7dOazi3RueKbn+HOJfpJ2/OBim6/SWDr/3sM8=; b=T/NgpREV6XF7vD43swSO08oy7TbwQoPIpgoVzsdDHMRAfnozMop7gIMO5LHdHLJqBZJ+s56m++MLa3c7y8Z36vdRDAy5JF1XbKqGyBPTMEkvKdfDuOJFphXlzBnMMEzfF5CexiaBBc/t+9q1t/taU2CNlUmKQ87fRUEGlO0hI3M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473464794536.953579964985; Wed, 30 Sep 2020 06:44:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.713.2403 (Exim 4.92) (envelope-from ) id 1kNcOr-0004Zb-9H; Wed, 30 Sep 2020 13:44:05 +0000 Received: by outflank-mailman (output) from mailman id 713.2403; Wed, 30 Sep 2020 13:44:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOr-0004ZR-4Z; Wed, 30 Sep 2020 13:44:05 +0000 Received: by outflank-mailman (input) for mailman id 713; Wed, 30 Sep 2020 13:44:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOp-0004YJ-DI for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:03 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id dfcfd5d9-4c79-41bb-b3ef-ece8d0941c31; Wed, 30 Sep 2020 13:44:02 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcOp-0004YJ-DI for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:44:03 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id dfcfd5d9-4c79-41bb-b3ef-ece8d0941c31; Wed, 30 Sep 2020 13:44:02 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: dfcfd5d9-4c79-41bb-b3ef-ece8d0941c31 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473443; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tthMpROINA5RAkSPIiMBl10BH/IKTfi+k+TFtLZ7eE4=; b=cn6uluEWpO06EjSC0oj6JxIQlKBwhn3GAUG1fFymHjyCSSbjPxGLkz/b xnZiPIopWWXGR7JnzmCDD5mWo2gjN1C9tomVNX4M+Ca39oOK3MJkPR6G5 QZMsMw126raWQ5y61lCNUfcqqyRA0k2EuGGXNri1SdZsVIH9s8Zsa0f3C g=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Ezf7PnSO3XtkQbnhDGOuxIvvef5jaBsUxNk488ciVVYvHxJgzLzOrb2VUhm5McXgGYqwpv5pi0 4npkJvY+5xLbYutMTxJXugTYnznLbOWYpwmzYZS3mMrfCD7/1xIrn2R9ZHqq/WmD73KAF1XfjS JsVDKSCJiWtS7y6Fq5nVc06nCh/C4xb5HfqFvIs5VLLaXhGUXPi8zuVkgEh2hd/3SMwR5TBbWg HzXQUOfSBIJWRTA9VYaWQ8jNppRcDwJTX0jcIYpbIiA2if+wtTw4YcXbaC7H4xaCJeTEbkFBkk nsU= X-SBRS: None X-MesageID: 28300093 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="28300093" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Jun Nakajima , Kevin Tian Subject: [PATCH 7/8] x86/hvm: Drop restore boolean from hvm_cr4_guest_valid_bits() Date: Wed, 30 Sep 2020 14:42:47 +0100 Message-ID: <20200930134248.4918-8-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) Previously, migration was reordered so the CPUID data was available before register state. nestedhvm_enabled() has recently been made accurate for the entire lifetime of the domain. Therefore, we can drop the bodge in hvm_cr4_guest_valid_bits() which existed previously to tolerate a guests' CR4 being set/restored before HVM_PARAM_NESTEDHVM. Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Jun Nakajima CC: Kevin Tian --- xen/arch/x86/hvm/domain.c | 2 +- xen/arch/x86/hvm/hvm.c | 8 ++++---- xen/arch/x86/hvm/svm/svmdebug.c | 6 ++++-- xen/arch/x86/hvm/vmx/vmx.c | 2 +- xen/arch/x86/hvm/vmx/vvmx.c | 2 +- xen/include/asm-x86/hvm/hvm.h | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c index 8e3375265c..0ce132b308 100644 --- a/xen/arch/x86/hvm/domain.c +++ b/xen/arch/x86/hvm/domain.c @@ -275,7 +275,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_= hvm_context_t *ctx) if ( v->arch.hvm.guest_efer & EFER_LME ) v->arch.hvm.guest_efer |=3D EFER_LMA; =20 - if ( v->arch.hvm.guest_cr[4] & ~hvm_cr4_guest_valid_bits(d, false) ) + if ( v->arch.hvm.guest_cr[4] & ~hvm_cr4_guest_valid_bits(d) ) { gprintk(XENLOG_ERR, "Bad CR4 value: %#016lx\n", v->arch.hvm.guest_cr[4]); diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 101a739952..54e32e4fe8 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -972,14 +972,14 @@ const char *hvm_efer_valid(const struct vcpu *v, uint= 64_t value, X86_CR0_CD | X86_CR0_PG))) =20 /* These bits in CR4 can be set by the guest. */ -unsigned long hvm_cr4_guest_valid_bits(const struct domain *d, bool restor= e) +unsigned long hvm_cr4_guest_valid_bits(const struct domain *d) { const struct cpuid_policy *p =3D d->arch.cpuid; bool mce, vmxe; =20 /* Logic broken out simply to aid readability below. */ mce =3D p->basic.mce || p->basic.mca; - vmxe =3D p->basic.vmx && (restore || nestedhvm_enabled(d)); + vmxe =3D p->basic.vmx && nestedhvm_enabled(d); =20 return ((p->basic.vme ? X86_CR4_VME | X86_CR4_PVI : 0) | (p->basic.tsc ? X86_CR4_TSD : 0) | @@ -1033,7 +1033,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_do= main_context_t *h) return -EINVAL; } =20 - if ( ctxt.cr4 & ~hvm_cr4_guest_valid_bits(d, true) ) + if ( ctxt.cr4 & ~hvm_cr4_guest_valid_bits(d) ) { printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n", d->domain_id, ctxt.cr4); @@ -2425,7 +2425,7 @@ int hvm_set_cr4(unsigned long value, bool may_defer) struct vcpu *v =3D current; unsigned long old_cr; =20 - if ( value & ~hvm_cr4_guest_valid_bits(v->domain, false) ) + if ( value & ~hvm_cr4_guest_valid_bits(v->domain) ) { HVM_DBG_LOG(DBG_LEVEL_1, "Guest attempts to set reserved bit in CR4: %lx", diff --git a/xen/arch/x86/hvm/svm/svmdebug.c b/xen/arch/x86/hvm/svm/svmdebu= g.c index ba26b6a80b..f450391df4 100644 --- a/xen/arch/x86/hvm/svm/svmdebug.c +++ b/xen/arch/x86/hvm/svm/svmdebug.c @@ -106,6 +106,7 @@ bool svm_vmcb_isvalid(const char *from, const struct vm= cb_struct *vmcb, unsigned long cr0 =3D vmcb_get_cr0(vmcb); unsigned long cr3 =3D vmcb_get_cr3(vmcb); unsigned long cr4 =3D vmcb_get_cr4(vmcb); + unsigned long valid; uint64_t efer =3D vmcb_get_efer(vmcb); =20 #define PRINTF(fmt, args...) do { \ @@ -130,9 +131,10 @@ bool svm_vmcb_isvalid(const char *from, const struct v= mcb_struct *vmcb, (cr3 >> v->domain->arch.cpuid->extd.maxphysaddr))) ) PRINTF("CR3: MBZ bits are set (%#"PRIx64")\n", cr3); =20 - if ( cr4 & ~hvm_cr4_guest_valid_bits(v->domain, false) ) + valid =3D hvm_cr4_guest_valid_bits(v->domain); + if ( cr4 & ~valid ) PRINTF("CR4: invalid bits are set (%#"PRIx64", valid: %#"PRIx64")\= n", - cr4, hvm_cr4_guest_valid_bits(v->domain, false)); + cr4, valid); =20 if ( vmcb_get_dr6(vmcb) >> 32 ) PRINTF("DR6: bits [63:32] are not zero (%#"PRIx64")\n", diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 95d109f962..86b8916a5d 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1529,7 +1529,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsig= ned int cr, */ v->arch.hvm.vmx.cr4_host_mask =3D (HVM_CR4_HOST_MASK | X86_CR4_PKE | - ~hvm_cr4_guest_valid_bits(v->domain, false)); + ~hvm_cr4_guest_valid_bits(v->domain)); =20 v->arch.hvm.vmx.cr4_host_mask |=3D v->arch.hvm.vmx.vmx_realmod= e ? X86_CR4_VME : 0; diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index 1e51689ef3..3a37e9ebea 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -2323,7 +2323,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *ms= r_content) data =3D X86_CR4_VMXE; break; case MSR_IA32_VMX_CR4_FIXED1: - data =3D hvm_cr4_guest_valid_bits(d, false); + data =3D hvm_cr4_guest_valid_bits(d); break; case MSR_IA32_VMX_MISC: /* Do not support CR3-target feature now */ diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index be0d8b0a4d..334bd573b9 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -334,7 +334,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned lon= g gla, /* Check CR4/EFER values */ const char *hvm_efer_valid(const struct vcpu *v, uint64_t value, signed int cr0_pg); -unsigned long hvm_cr4_guest_valid_bits(const struct domain *d, bool restor= e); +unsigned long hvm_cr4_guest_valid_bits(const struct domain *d); =20 int hvm_copy_context_and_params(struct domain *src, struct domain *dst); =20 --=20 2.11.0 From nobody Sat May 4 01:12:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601473415; cv=none; d=zohomail.com; s=zohoarc; b=RbekHZIg/EE45Zu0BsyHuS1hRp/A7fRxU15jpKjv4sP079qCCVgte8IpBPhjnAnq35gsGaJZF5UUZa8wfkHrneI7IdNN/Cc4kVnX48RcIkwzp1DPHft3bLrcIYXKfaW7gBTrWXhyR63p8VIg/tNmPnf7MwZ9qEKoSB1wtjoR9FE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601473415; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IJlfuzq8K12s3Xts0ybiwf6PM4yW752cbr+zZhyVSlc=; b=NlXcUIviuohap5dRBGwPvaiKEMZ0v2/mpeNOq5WnMsHLFw/AyipB5O/X8W3BNNycmyRBrJjdVoxFVh6JskDM3fGK5TG2O2JXQsoJKx4ea9O3ca2oO9PmHUu+QUPt08xw+eSLb/gIri3DDcXuCKZlz3qEzBC7ZnBxPW7U+Pde7Uw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601473415205674.4395577281134; Wed, 30 Sep 2020 06:43:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.708.2367 (Exim 4.92) (envelope-from ) id 1kNcNx-0004K2-7C; Wed, 30 Sep 2020 13:43:09 +0000 Received: by outflank-mailman (output) from mailman id 708.2367; Wed, 30 Sep 2020 13:43:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcNx-0004Jv-48; Wed, 30 Sep 2020 13:43:09 +0000 Received: by outflank-mailman (input) for mailman id 708; Wed, 30 Sep 2020 13:43:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcNw-0004Jq-NE for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:43:08 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 331baf0a-6d0c-4de4-904a-a23335a13515; Wed, 30 Sep 2020 13:43:07 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kNcNw-0004Jq-NE for xen-devel@lists.xenproject.org; Wed, 30 Sep 2020 13:43:08 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 331baf0a-6d0c-4de4-904a-a23335a13515; Wed, 30 Sep 2020 13:43:07 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 331baf0a-6d0c-4de4-904a-a23335a13515 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601473388; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zCgloXqKLi3h4wrtUxAfnK1YiX7r251p1U0n04eKO08=; b=cYekyCSisrLQm7olnlWfioleHr/pr5Xp7ht8HwylE+CWCuoFeRYFOAfG R+c2LTlzdUvScspJZNCGKBM14+tzeycIHpJV5ufxU6YMRwrdfWVW+tNli JVG1XyYor56Tg0ex52t+K4CiTQpW8gxHgZ0cvKzWDOFGnryksF8HHp+KR o=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: hDw4USf9skInVC4gYmFwUFaQnMtcBLlyE2lQvtdpk/Fbyy+COdv4+1+Jb6bkGeP2hjs3JdiUaK R/xAIxBAjIMI5ynGPKjm1uM5cEMhSbncaP/ubPWK7iWdQ5HziW59yAYQFxzPcG/QpIouicau+/ vQwq5YWxmiqlkwc6IydrtKV9Vrg0BmRXMg2cuCHpILAMWFnOk/SwYcZ5taAoYiw4MsvTEnHcpQ n0gxtEpz4DsUXuVrBY370AS9eIp57KThzgc+tGU9p/f4Hh56Nz1crwGlsoKf6+RGNQhUtgXo/q zb8= X-SBRS: None X-MesageID: 27971142 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,322,1596513600"; d="scan'208";a="27971142" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 8/8] x86/cpuid: Move VMX/SVM out of the default policy Date: Wed, 30 Sep 2020 14:42:48 +0100 Message-ID: <20200930134248.4918-9-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200930134248.4918-1-andrew.cooper3@citrix.com> References: <20200930134248.4918-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) Nested virt is still experimental, and requires explicitly opting in to at domain create time. The VMX/SVM features should not be visible by default. Also correct them from all HVM guests, to just HAP-enabled guests. This has been the restriction for SVM right from the outset (c/s e006a0e0aaa), while VMX was first introduced supporting shadow mode (c/s 9122c69c8d3) but later adjusted to HAP-only (c/s 77751ed79e3). There is deliberately no adjustment to xc_cpuid_apply_policy() for pre-4.14 migration compatibility. The migration stream doesn't contain the required architectural state for either VMX/SVM, and a nested virt VM which migrates will explode in weird and wonderful ways. Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monn=C3=A9 --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/include/public/arch-x86/cpufeatureset.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/publ= ic/arch-x86/cpufeatureset.h index abd18722ee..ef7cca334d 100644 --- a/xen/include/public/arch-x86/cpufeatureset.h +++ b/xen/include/public/arch-x86/cpufeatureset.h @@ -127,7 +127,7 @@ XEN_CPUFEATURE(PCLMULQDQ, 1*32+ 1) /*A Carry-less = multiplication */ XEN_CPUFEATURE(DTES64, 1*32+ 2) /* 64-bit Debug Store */ XEN_CPUFEATURE(MONITOR, 1*32+ 3) /* Monitor/Mwait support */ XEN_CPUFEATURE(DSCPL, 1*32+ 4) /* CPL Qualified Debug Store */ -XEN_CPUFEATURE(VMX, 1*32+ 5) /*S Virtual Machine Extensions */ +XEN_CPUFEATURE(VMX, 1*32+ 5) /*h Virtual Machine Extensions */ XEN_CPUFEATURE(SMX, 1*32+ 6) /* Safer Mode Extensions */ XEN_CPUFEATURE(EIST, 1*32+ 7) /* Enhanced SpeedStep */ XEN_CPUFEATURE(TM2, 1*32+ 8) /* Thermal Monitor 2 */ @@ -166,7 +166,7 @@ XEN_CPUFEATURE(3DNOW, 2*32+31) /*A 3DNow! */ /* AMD-defined CPU features, CPUID level 0x80000001.ecx, word 3 */ XEN_CPUFEATURE(LAHF_LM, 3*32+ 0) /*A LAHF/SAHF in long mode */ XEN_CPUFEATURE(CMP_LEGACY, 3*32+ 1) /*!A If yes HyperThreading not vali= d */ -XEN_CPUFEATURE(SVM, 3*32+ 2) /*S Secure virtual machine */ +XEN_CPUFEATURE(SVM, 3*32+ 2) /*h Secure virtual machine */ XEN_CPUFEATURE(EXTAPIC, 3*32+ 3) /* Extended APIC space */ XEN_CPUFEATURE(CR8_LEGACY, 3*32+ 4) /*S CR8 in 32-bit mode */ XEN_CPUFEATURE(ABM, 3*32+ 5) /*A Advanced bit manipulation */ --=20 2.11.0