xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Jan Beulich <JBeulich@suse.com>, Wei Liu <wl@xen.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Ian Jackson <iwj@xenproject.org>
Subject: Re: [PATCH 3/3] x86/msr: Fix Solaris and turbostat following XSA-351
Date: Tue, 16 Mar 2021 21:20:10 +0000	[thread overview]
Message-ID: <e7ee5d1d-d793-1ab6-deb0-e2eb13b89a47@citrix.com> (raw)
In-Reply-To: <YFDjUSz/whe9Jrqp@Air-de-Roger>

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@citrix.com>
> Thanks!
>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>> CC: Wei Liu <wl@xen.org>
>> CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> CC: Ian Jackson <iwj@xenproject.org>
>>
>> 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



  parent reply	other threads:[~2021-03-16 21:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 16:18 [PATCH for-4.15 0/3] x86/msr: Fixes for XSA-351 Andrew Cooper
2021-03-16 16:18 ` [PATCH 1/3] Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()" Andrew Cooper
2021-03-16 16:58   ` Jan Beulich
2021-03-19 12:59     ` Andrew Cooper
2021-03-19 13:56       ` Jan Beulich
2021-03-19 14:03         ` Andrew Cooper
2021-03-17  8:40   ` Roger Pau Monné
2021-03-17 13:37   ` Ian Jackson
2021-03-17 13:45     ` Andrew Cooper
2021-03-17 14:46       ` Ian Jackson
2021-03-17 15:06         ` Roger Pau Monné
2021-03-17 15:15           ` Ian Jackson
2021-03-26 14:25             ` [PATCH for-4.15 0/3] x86/msr: Fixes for XSA-351 [and 1 more messages] Ian Jackson
2021-03-26 14:30               ` Ian Jackson
2021-03-29  8:58                 ` Roger Pau Monné
2021-03-18  9:37         ` [PATCH 1/3] Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()" Jan Beulich
2021-03-18  9:35     ` Jan Beulich
2021-03-19 13:11       ` Andrew Cooper
2021-03-16 16:18 ` [PATCH 2/3] x86/msr: Forward port XSA-351 changes from 4.14 Andrew Cooper
2021-03-17  8:52   ` Roger Pau Monné
2021-03-19 13:19     ` Andrew Cooper
2021-03-16 16:18 ` [PATCH 3/3] x86/msr: Fix Solaris and turbostat following XSA-351 Andrew Cooper
2021-03-16 16:56   ` Roger Pau Monné
2021-03-16 17:45     ` Boris Ostrovsky
2021-03-16 21:20     ` Andrew Cooper [this message]
2021-03-17  8:32       ` Roger Pau Monné
2021-03-19 13:23         ` Andrew Cooper
2021-03-17  9:26   ` Jan Beulich
2021-03-26 15:08 ` [PATCH for-4.15 v1.1 1/3] Revert "x86/msr: drop compatibility #GP handling in guest_{rd,wr}msr()" Jan Beulich
2021-03-26 15:13   ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7ee5d1d-d793-1ab6-deb0-e2eb13b89a47@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=iwj@xenproject.org \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).