[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] x86/msr: Forward port XSA-351 changes from 4.14


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 19 Mar 2021 13:19:41 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=w5bDv9kfZkr+AU1/mzly39sY+NHjKP0bnPnEXb8xafA=; b=J01fgCgsa3WVud/vbQTfMWkAgD1d/v6ZB5/1Ss+zBDc/x2ko2Zg6X0M8ibJNDk0BzMzvwYFySVO1s7jQsJztgDutOYn0E2sZYpX+SKDYrrTZ7WNw9K0wycUPQSjhJ8eXn8cPAsn1XM49IWivm6B+Bk3KL0tmSawlsmBSFIh9zLODpkEdJsQgWwG4esg/JE2d39elgYbqTtCy5qFWmK+pZWf2MlJTJf5KIdcssIh1OiRfkYfrgps5CXtSGg3wubz2FjqQTZ3Upi0scnj6c0xNQrG/VGmbwuvpK6X+9WqUbZyLtXqAc7LD93hYYBd0K9YIkPeJyLElsLBRKrW3ynT/Jg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKYcTY3y6eZ3DaXkF7/OPvwCenDraTuPr+P4ds2At4Pe9A37o/OPP4FlHuHLWLlVEjaNmFrL1SVByzuhuEEaWySG4vRcFAAevkr+TTbaXVOV25tFVxGxSP2e0JNxXRvrxKvxbhQyCqxnS1f7sekn/5cLr3uneXVxc7NIERaF5AVq/bkQHNOg8bCFxikxC6MzHcwgcW43VXBiKFT8OVEnyZvVwV8cHwMTM57RBD6kXRVCmGxnRadcI/Gkm6BPPhkWTCqWZ1OREn831dMXkFnwEZy3EAnrah8fHVo84LVi09iDKUFlY1XmNfYgQsKnSOVl1cz1exLu/lJwQTs7vs0X/A==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 Mar 2021 13:19:57 +0000
  • Ironport-hdrordr: A9a23:te7oIKEsvPblY6rCpLqECseALOonbusQ8zAX/mp2TgFYddHdqt unm+4V2QSxpDEaXnwhnt7oAtjjfVr385lp7Y4NeYqzRQWOghrKEKhO5ZbvqgeNJwTQ7ehYvJ 0OT4FbKPndSWd3ltz75g7QKadF/PCi/LqzjenTi1dBJDsFV4ha4w10ChmWHyRNLWEsb/cEPa GR+9ZdoH6YcWkXB/7LY0UtZfTJpNHAifvdASIuOhhP0mizpALtwpH7FgWVxVM6VTVXqI1Sll T4rw==
  • Ironport-sdr: SitBBHG6+155rW5S1rP+5eKp+FR2hVL7UL+5Kdx2ReUUUE3jEUe1cL1k8my2CfYPzb0cvf6rgY /wz5c4PVpCzHyCydjTQ7X/LLvb07DKllV7MRukuBZQz8/FdKnH96WWKi72Jk+SCbRgvwYSwYrm 05qR8YSQuDcKM1jS7hvii3oC+L0//wLpZG+9iEArFhhhUSrU9bygda9/1DTQ4+ozpEazC44Pxp uunDYEqle4B9Pj0wHcqhO0+KY5GnQHX7AK+IcU2E/m17Jcsl7sr1U2QAqaPR+OUdcST7WQjxdG w1s=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17/03/2021 08:52, Roger Pau Monné wrote:
> On Tue, Mar 16, 2021 at 04:18:43PM +0000, Andrew Cooper wrote:
>> staging was not impacted by XSA-351 at the time of release, due to c/s
>> 322ec7c89f and 84e848fd7a which disallows read access by default.
>>
>> Forward port the XSA-351 changes to make the code structure consistent 
>> between
>> 4.14 and 4.15.
>>
>> This removes logspew for guests probing for the RAPL interface.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> ---
>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>> CC: Wei Liu <wl@xxxxxxx>
>> CC: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
>> CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>
>>
>> Technically this breaks Solaris/turbostat insofar as you can no longer use
>> msr_relaxed to "fix" the guest.  The subsequent patch will unbreak it
>> differently.
>>
>> For 4.15.  Restoring behaviour closer to 4.14, and prereq for a bugfix 
>> needing
>> backporting.
>> ---
>>  xen/arch/x86/msr.c              | 19 +++++++++++++++++++
>>  xen/include/asm-x86/msr-index.h | 39 +++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 58 insertions(+)
>>
>> diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
>> index c3a988bd11..5927b6811b 100644
>> --- a/xen/arch/x86/msr.c
>> +++ b/xen/arch/x86/msr.c
>> @@ -188,6 +188,13 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t 
>> *val)
>>      case MSR_TSX_CTRL:
>>      case MSR_MCU_OPT_CTRL:
>>      case MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7):
>> +    case MSR_RAPL_POWER_UNIT:
>> +    case MSR_PKG_POWER_LIMIT  ... MSR_PKG_POWER_INFO:
>> +    case MSR_DRAM_POWER_LIMIT ... MSR_DRAM_POWER_INFO:
>> +    case MSR_PP0_POWER_LIMIT  ... MSR_PP0_POLICY:
>> +    case MSR_PP1_POWER_LIMIT  ... MSR_PP1_POLICY:
>> +    case MSR_PLATFORM_ENERGY_COUNTER:
>> +    case MSR_PLATFORM_POWER_LIMIT:
>>      case MSR_U_CET:
>>      case MSR_S_CET:
>>      case MSR_PL0_SSP ... MSR_INTERRUPT_SSP_TABLE:
>> @@ -195,6 +202,8 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t 
>> *val)
>>      case MSR_AMD64_LWP_CBADDR:
>>      case MSR_PPIN_CTL:
>>      case MSR_PPIN:
>> +    case MSR_F15H_CU_POWER ... MSR_F15H_CU_MAX_POWER:
>> +    case MSR_AMD_RAPL_POWER_UNIT ... MSR_AMD_PKG_ENERGY_STATUS:
>>      case MSR_AMD_PPIN_CTL:
>>      case MSR_AMD_PPIN:
>>          goto gp_fault;
>> @@ -412,6 +421,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t 
>> val)
>>      case MSR_INTEL_CORE_THREAD_COUNT:
>>      case MSR_INTEL_PLATFORM_INFO:
>>      case MSR_ARCH_CAPABILITIES:
>> +    case MSR_IA32_PERF_STATUS:
> Should the MSR_IA32_PERF_STATUS addition maybe be part of the previous
> commit, as it's not related to the XSA-351 content?

It is XSA-351.  We sent out two patches in the end.

c/s 3059178798a (the PERF_STATUS/CTL fix in 4.15) was backported to 4.14
as one half of XSA-351, and gained the above hunk because it went
backwards over the #GP-default change.

In light of patch 1, it now needs reintroducing.

It doesn't really matter if this hunk is in patch 1 or 2, but it needs
to be present, and fits better here IMO.

>
> The rest LGTM:
>
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>
> I wonder whether we could squash this with 3/3 for staging commit, and
> then only backport 3/3 for older branches. But it's likely too much
> work just to prevent breaking msr_relaxed for Solaris for a single
> commit time span.

I did consider the bisectability, but the reality is that it has only
been a week or so with msr_relaxed working at all.

Splitting them apart is simpler to review.

~Andrew




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.