From nobody Mon Feb 9 09:34:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1568403034; cv=none; d=zoho.com; s=zohoarc; b=nJqhafPxgCVEhaEbOqfqFMwiN2Wl+jDy4fn9ktwyVfG7Hoy79mpR9GkcmTB8nbrOD4m0NQof1uYJJZXys/+kInEy8C/FB0dTeVS8xeM1rCbUPH9tuoHAMkTckeuOu4NW1KbVM2xtAI4qtKLc24NflBj/PfnYnylwVbDCXftIcb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568403034; 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:ARC-Authentication-Results; bh=GhfSXnW7MLLpCwFcg4oJlHH374+mU2fT2REs0+o0RC4=; b=CepEqV7RuL90AR2CYj0eXTOlwnCeFbAsB2ukx6/h7SsMCC7T1U7agvCP8AwWvyXC4hmaIxCzFBYkh7ylXl6cHyj0f/RUV3/17I7gd3sOtu1EiLep6DML6E9n5B+l5sA3bEKOXP8gkQ+8ai+6BUcjZCBcZ9g74zEIWaHTMtrklvc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1568403034818883.1534707435084; Fri, 13 Sep 2019 12:30:34 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i8rEm-0006mj-1r; Fri, 13 Sep 2019 19:28: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.89) (envelope-from ) id 1i8rEk-0006kM-9O for xen-devel@lists.xenproject.org; Fri, 13 Sep 2019 19:28:06 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9ad9f737-d65c-11e9-95b9-12813bfff9fa; Fri, 13 Sep 2019 19:28:05 +0000 (UTC) X-Inumbo-ID: 9ad9f737-d65c-11e9-95b9-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568402886; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BBEMLZnLm26tjDsc8qn1/8XcgCfCIPk3+lDhvg0ZFL0=; b=EM7nLtYp2GgdRc4DJ/6JvC/efTaftgBOZUhUY+kogS8Hlz4r8Hj5nP1w XJ4r40sIA/l6y8uGYdvB6j1AJwwXoHV6A4wPDWPScmopOUMiwX9A8iQmR y6MRWl+qdZ1J4A6+N45p8TizTsy4BqaqxrYVFYTH6Ric3lDdFsACowp74 s=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: WIJNVgLDnCAc99Gi9yrvYIIDDJsyf74ZNdhpJQJAcucky4RduIMnRMEqGx8gtihtRO0wMe/rcK xsA1hfwpzjIIaP1J0KXJF0xVwwWb5R1HtXgFqUgvxavEiAgrz0dr21B3slg3/PQg8HEZ9HkmSM EoBenp0kUkYdhsCXHmO06CHxn3v08BHq9qyn66MZJ20G4erjMwIz+RT3THx8muwJw0ocG/5GG3 VGEz4xshA1FBuX2TvKJcmbi6oPGUoPODgSFYRL0ilOb9pCIUgIfwwk41/PLF5DZ2AfXOxbCUul XgA= X-SBRS: 2.7 X-MesageID: 5553055 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.64,501,1559534400"; d="scan'208";a="5553055" From: Andrew Cooper To: Xen-devel Date: Fri, 13 Sep 2019 20:27:50 +0100 Message-ID: <20190913192759.10795-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190913192759.10795-1-andrew.cooper3@citrix.com> References: <20190913192759.10795-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 01/10] x86/msr: Offer CPUID Faulting to PVH control domains X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The control domain exclusion for CPUID Faulting predates dom0 PVH, but the reason for the exclusion (to allow the domain builder to see host CPUID values) isn't applicable. The domain builder *is* broken in PVH control domains, and restricting the = use of CPUID Faulting doesn't make it any less broken. Tweak the logic to only exclude PV control domains. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 v2: * New --- xen/arch/x86/cpu/common.c | 5 +++-- xen/arch/x86/msr.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c index 937d8e82a8..4bf852c948 100644 --- a/xen/arch/x86/cpu/common.c +++ b/xen/arch/x86/cpu/common.c @@ -169,7 +169,7 @@ void ctxt_switch_levelling(const struct vcpu *next) if (nextd && is_idle_domain(nextd)) return; /* - * We *should* be enabling faulting for the control domain. + * We *should* be enabling faulting for PV control domains. * * Unfortunately, the domain builder (having only ever been a * PV guest) expects to be able to see host cpuid state in a @@ -184,7 +184,8 @@ void ctxt_switch_levelling(const struct vcpu *next) * generating the maximum full cpuid policy into Xen, at which * this problem will disappear. */ - set_cpuid_faulting(nextd && !is_control_domain(nextd) && + set_cpuid_faulting(nextd && (!is_control_domain(nextd) || + !is_pv_domain(nextd)) && (is_pv_domain(nextd) || next->arch.msrs-> misc_features_enables.cpuid_faulting)); diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c index e65961fccb..a6c8cc7627 100644 --- a/xen/arch/x86/msr.c +++ b/xen/arch/x86/msr.c @@ -91,8 +91,8 @@ int init_domain_msr_policy(struct domain *d) if ( !mp ) return -ENOMEM; =20 - /* See comment in intel_ctxt_switch_levelling() */ - if ( is_control_domain(d) ) + /* See comment in ctxt_switch_levelling() */ + if ( is_control_domain(d) && is_pv_domain(d) ) mp->platform_info.cpuid_faulting =3D false; =20 d->arch.msr =3D mp; --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel