From patchwork Fri Feb 14 19:55:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11383193 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1A1417F0 for ; Fri, 14 Feb 2020 19:56:48 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7DC1A206D7 for ; Fri, 14 Feb 2020 19:56:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="M3qs0iV0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DC1A206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j2h3U-0007GM-UH; Fri, 14 Feb 2020 19:55:16 +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 1j2h3T-0007GH-FN for xen-devel@lists.xenproject.org; Fri, 14 Feb 2020 19:55:15 +0000 X-Inumbo-ID: ea47791a-4f63-11ea-bb15-12813bfff9fa Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ea47791a-4f63-11ea-bb15-12813bfff9fa; Fri, 14 Feb 2020 19:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1581710114; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vJbYquKhzTURDxBSC6+aFfQAoKAp8avsVonHsh/50E8=; b=M3qs0iV0rKmLYFn+fCREHWitS6IZnu/jleqiDg5qXjUzMM382z8hdghH hcU844fnWyu9l1mCMIetGs7P2nMfGgXtwQmghbtbXwm3uc7ddA4fwgGkS SG/zamr8TiNhMphPTB0zivR/Edb6kvjadPMQwbAlLDdgeW/H9u4IjwKUN Y=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: VteUx0HQqxY1mCExpFHzMNsnsaAVJUh1vZq6mByjxIiJFMExshijMiG3sH284tr++cvQeqyHgc 4Ci6NlANC8swf2XuhJsmoETvQQ9HWQO2AI+u1LM0+I5dJSPpw3V2dJh1OreQgEuKGXNAAsp7IG GPY4YDnTQLxnhciunjTpRllhm1LIqpQMwbPDBk5wJ2iWwW3sJRt90dCTrS60yS8WR2HJpA/coU 4EaEAgEBY7MAzKq7hQRHVbeXFbsElPJjf2hhBD/9adzRCxJG0/lDrF6gUVt4bUkDolrXLDQw2+ O/I= X-SBRS: 2.7 X-MesageID: 13110272 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,441,1574139600"; d="scan'208";a="13110272" From: Andrew Cooper To: Xen-devel Date: Fri, 14 Feb 2020 19:55:10 +0000 Message-ID: <20200214195510.22667-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/msr: Virtualise MSR_PLATFORM_ID properly 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_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This is an Intel-only, read-only MSR related to microcode loading. Expose it in similar circumstances as the PATCHLEVEL MSR. This should have been alongside c/s 013896cb8b2 "x86/msr: Fix handling of MSR_AMD_PATCHLEVEL/MSR_IA32_UCODE_REV" Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné Turns out I wrote this nearly a year ago and didn't send it. It obviously got dropped in the leadup to MDS. --- xen/arch/x86/msr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c index 785574de67..1cea777680 100644 --- a/xen/arch/x86/msr.c +++ b/xen/arch/x86/msr.c @@ -143,6 +143,13 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val) /* Not offered to guests. */ goto gp_fault; + case MSR_IA32_PLATFORM_ID: + if ( !(cp->x86_vendor & X86_VENDOR_INTEL) || + !(boot_cpu_data.x86_vendor & X86_VENDOR_INTEL) ) + goto gp_fault; + rdmsrl(MSR_IA32_PLATFORM_ID, *val); + break; + case MSR_AMD_PATCHLEVEL: BUILD_BUG_ON(MSR_IA32_UCODE_REV != MSR_AMD_PATCHLEVEL); /* @@ -275,6 +282,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val) { uint64_t rsvd; + case MSR_IA32_PLATFORM_ID: case MSR_INTEL_CORE_THREAD_COUNT: case MSR_INTEL_PLATFORM_INFO: case MSR_ARCH_CAPABILITIES: