[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] x86emul: respect NSCB
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 15 Sep 2022 09:22:48 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0NMgwMZFryGjeLshoYixp5UtIBsvl6HipZhufTopacQ=; b=XVarDBTiWO7IxYA33Yw0eGk3IddqX7y1txT208l26VH76TLx78btsn6nxZdcz3Wr8+/eqRoeT+5wd5oGI7x4wzgx15OGQhTyKnkGkqhVEspnxl9a58tlwvVRQZFei67+yxyXcznrwiZfb/9PhPYsLlf9OPAW3pNQzWAIjE4UW5+IqsFjyf64RMmQDk6NGbJn4NzxCFOa4iVvD+RdMzCyDwt+5mSPI8jsp+sD5hGzCs+iiZpmxDRH9Q4AKwPQMVD78Ugjq74Uo2SeRM1TNT077m1ShkBNefPv5W1b1EPNGjMY5G/DuEY7OukP3fNV+V+8mYZqrqup8g8r2vlB1OOxmQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZbGBjBJHe+6Dle6kJCy4v5Snpbu3FNAnERZ6AFgPDbgbJfyQxY6Mt8FEBIapbSH5iVQYNh0fsRulM9og/DjyCYylwrku2L97l6ZIC+C8RQCowD6G60vpDeHF7F/souVsVU+VfyGL8OXdUQ1ZXTi9UuTz3Y91LViYTeMMlRw4wlqJ1C0SJ5QmbL45vbekuhK5JWSnEKInEX/7zTTXM/Xd5yzQ5cYRuf60iYBj7BZrBYK6jm7mQagqATTnaAJMqHK0CHNIPfFhEOCx1/zU656+rVtV7R6dpv8VHMvBS5ySeEqen1vi4FdR4KozHNGPOOOQf0TVFhAl7fpfdFDQnsIBgg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Thu, 15 Sep 2022 07:23:02 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
protmode_load_seg() would better adhere to that "feature" of clearing
base (and limit) during NULL selector loads.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1970,6 +1970,7 @@ amd_like(const struct x86_emulate_ctxt *
#define vcpu_has_tbm() (ctxt->cpuid->extd.tbm)
#define vcpu_has_clzero() (ctxt->cpuid->extd.clzero)
#define vcpu_has_wbnoinvd() (ctxt->cpuid->extd.wbnoinvd)
+#define vcpu_has_nscb() (ctxt->cpuid->extd.nscb)
#define vcpu_has_bmi1() (ctxt->cpuid->feat.bmi1)
#define vcpu_has_hle() (ctxt->cpuid->feat.hle)
@@ -2102,7 +2103,7 @@ protmode_load_seg(
case x86_seg_tr:
goto raise_exn;
}
- if ( !_amd_like(cp) || !ops->read_segment ||
+ if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
memset(sreg, 0, sizeof(*sreg));
else
|