[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] x86/msr: Fix Solaris and turbostat following XSA-351
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 16 Mar 2021 21:20:10 +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=GEzroIj0gAs/8HZEqRSFg63+ZpN1LwgWVvxr7JUIQAw=; b=Naq3TFOBNXBgNm82+jnIX22DFDAHwV9NWPt2z3n3UbbwYoKVPNiBGQM660FthymynMAeyUBwjRycT3XLax6uRJq/PYFyhFxBfYratvAT91PLsYevqMnn7jsYU16yAxcUy74NoSCx8lpb7+4+sTCmIu1THkrBloLoM+dnWCiURXcdzMo6Bnb41sMkCsn+CqKp7KA0cmRzMrTCprsPFrzce2nms5hvSN00iVbKVs5jWSp0XqZdHpzJJKhq5SMJ6Q6OD1GVNCR0zGXv2E4OcSByzx4BQtJmCHGvll/UBtZL/rDgxYrlW14J2xoox4tu1W1W8bgfhQIAJ+NG3NS8vDPN0w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qc6UY3baIfPZI4IklCy0gq4Hw0dIQFQ31m9bn4W1ZXvR2r9TCuTpWGAz5mqBX3Xca0hbgzCTZUuUnS5oHv4Z48LGdrWWZa4lH0hu/80T22g3u9JjnFUDA9LJysW/EAkYESTqAxmXc2EaYAWFfz9/D0+XyKApj91WF/TAEjnAfp4olRF6Ay6eWwsZPupjsLuzMr8beYlB5rsFDbCj0MFpS86JgNqDfStccarbP64Q6896RqAl1OAyPl/LCQm/Nd7iEgNxYzRv0qHXjQuLmK9xQ3ua1fx7zid56ywgW3om8ecUb5W8D5Z8kCcly9UlQHqjvaO6/b+SeYTfnsWhjX+u2g==
- Authentication-results: esa3.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: Tue, 16 Mar 2021 21:20:32 +0000
- Ironport-hdrordr: A9a23:rq0sY68pOgWVTDmei/Juk+F1cL1zdoIgy1knxilNYDRvWIixi9 2ukPMH1RX9lTYWXzUalcqdPbSbKEmyybdc2qNUGbu5RgHptC+TLI9k5Zb/2DGIIUHD38Zn/+ Nbf6B6YeecMXFTkdv67A6kE9wp3dmA9+SSif3Dymp2JDsKV4hLxW5Ce2OmO2dxQxRLAod8MZ Ka6NZOqTbIQwVpUu2QAH4ZU+/f4+DRnJX9bhIcQzIh4g+CjTSngYSKbySw9BEYTj9J3PMe4X HI+jaJm5mLntOa7lvn12HV54lLg9eJ8LV+LeGFl8R9EESVti+Gf4JkMofy2wwdgObq01oylc mJnhFIBbUI11r0XkWY5STgwBPh1jFG0Q6Q9Xa9jWH4qcL0ABIWYvAx/L5xSRfS50o+sNwU6s sitAj4xvkneC/opyjz68PFUBtnjCOP0B4fuNUekmBFVs8mYKJRxLZvjH99KosKHy7x9ekcYY 9TJfzbjcwmE2+yU2rUpS1GztCqQx0Ib2y7a3lHkMmU3z9KpWt+3ksVyecO901wha4Vet1q4f /JPb9vk6wLZsgKbbhlDONEesevDHfRKCi8f166EBDCLuUqKnjNo5n47PEc4/yrQoUByN8XlI 7aWF1VmGYucyvVeIOz9awO1iqIbHS2XDzrxM0bzYN+oKfASL3iNjDGYEwykuO7ys9vQfHzar KWAtZ7EvXjJWzhFcJixAvlQaRfLnE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Ig99+ksqI 3LTC7dDOBKhXe1IXDnzbCyNXIIXZXvm1Xxc9mQQpSmyDLrC8q/XoDaY/ae0L6I260P/FbwqCZW t21Vg0dBYkPHLK9SRHDOXwnlZnXQ4vs5u7UDdK4vIODV0/y13XYQi3bijGIRqAa+1cSn3pMS1o rM1cJ00L60D57NPl0/RtsYs3ukwbUc+tPFQ1ubsd4GIxVmJKyXMG68LXEpMpFSawkQTtjKnb1F Ge0=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 16/03/2021 16:56, Roger Pau Monné wrote:
> On Tue, Mar 16, 2021 at 04:18:44PM +0000, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Thanks!
>
>> ---
>> 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>
>>
>> For 4.15 This wants backporting to all security trees, as it is a fix to a
>> regression introduced in XSA-351.
>>
>> Also it means that users don't need msr_relaxed=1 to unbreak Solaris guests,
>> which is a strict useability improvement.
>> ---
>> xen/arch/x86/msr.c | 13 ++++++++++++-
>> 1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
>> index 5927b6811b..a83a1d7fba 100644
>> --- a/xen/arch/x86/msr.c
>> +++ b/xen/arch/x86/msr.c
>> @@ -188,7 +188,6 @@ 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:
>> @@ -284,6 +283,18 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t
>> *val)
>> goto gp_fault;
>> break;
>>
>> + case MSR_RAPL_POWER_UNIT:
>> + /*
>> + * This MSR is non-architectural. However, some versions of Solaris
>> + * blindly reads it without a #GP guard, and some versions of
>> + * turbostat crash after expecting a read of /proc/cpu/0/msr not to
>> + * fail. Read as zero on Intel hardware.
>> + */
>> + if ( !(cp->x86_vendor & X86_VENDOR_INTEL) )
>> + goto gp_fault;
> AFAICT from Linux usage this is Intel specific (not present in any of
> the clones).
Indeed.
>
>> + *val = 0;
>> + break;
> Do we also need to care about MSR_AMD_RAPL_POWER_UNIT (0xc0010299) for
> Solaris?
AMD has a CPUID bit for this interface, 0x80000007.EDX[14].
~Andrew
|