* [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
@ 2021-02-04 9:36 Jan Beulich
2021-02-04 9:40 ` Roger Pau Monné
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Jan Beulich @ 2021-02-04 9:36 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné, James Dingwall
X86_VENDOR_* aren't bit masks in the older trees.
Reported-by: James Dingwall <james@dingwall.me.uk>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -226,7 +226,8 @@ int guest_rdmsr(const struct vcpu *v, ui
*/
case MSR_IA32_PERF_STATUS:
case MSR_IA32_PERF_CTL:
- if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR)) )
+ if ( cp->x86_vendor != X86_VENDOR_INTEL &&
+ cp->x86_vendor != X86_VENDOR_CENTAUR )
goto gp_fault;
*val = 0;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
2021-02-04 9:36 [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again) Jan Beulich
@ 2021-02-04 9:40 ` Roger Pau Monné
2021-02-04 9:48 ` Jan Beulich
2021-02-04 11:34 ` James Dingwall
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Roger Pau Monné @ 2021-02-04 9:40 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel, Andrew Cooper, Wei Liu, James Dingwall
On Thu, Feb 04, 2021 at 10:36:06AM +0100, Jan Beulich wrote:
> X86_VENDOR_* aren't bit masks in the older trees.
>
> Reported-by: James Dingwall <james@dingwall.me.uk>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Should this have a set of Fixes tag for the commit hashes on <= 4.12?
Thanks, Roger.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
2021-02-04 9:40 ` Roger Pau Monné
@ 2021-02-04 9:48 ` Jan Beulich
0 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2021-02-04 9:48 UTC (permalink / raw)
To: Roger Pau Monné; +Cc: xen-devel, Andrew Cooper, Wei Liu, James Dingwall
On 04.02.2021 10:40, Roger Pau Monné wrote:
> On Thu, Feb 04, 2021 at 10:36:06AM +0100, Jan Beulich wrote:
>> X86_VENDOR_* aren't bit masks in the older trees.
>>
>> Reported-by: James Dingwall <james@dingwall.me.uk>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks.
> Should this have a set of Fixes tag for the commit hashes on <= 4.12?
I'd prefer Fixes: to only reference non-backports. The tag is
mainly meant to allow noticing what needs backporting, after all.
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
2021-02-04 9:36 [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again) Jan Beulich
2021-02-04 9:40 ` Roger Pau Monné
@ 2021-02-04 11:34 ` James Dingwall
2021-02-04 12:48 ` Andrew Cooper
2021-02-04 15:53 ` Jan Beulich
3 siblings, 0 replies; 7+ messages in thread
From: James Dingwall @ 2021-02-04 11:34 UTC (permalink / raw)
To: Jan Beulich
Cc: xen-devel, Andrew Cooper, Wei Liu, Roger Pau Monné, James Dingwall
Hi Jan,
On Thu, Feb 04, 2021 at 10:36:06AM +0100, Jan Beulich wrote:
> X86_VENDOR_* aren't bit masks in the older trees.
>
> Reported-by: James Dingwall <james@dingwall.me.uk>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/msr.c
> +++ b/xen/arch/x86/msr.c
> @@ -226,7 +226,8 @@ int guest_rdmsr(const struct vcpu *v, ui
> */
> case MSR_IA32_PERF_STATUS:
> case MSR_IA32_PERF_CTL:
> - if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR)) )
> + if ( cp->x86_vendor != X86_VENDOR_INTEL &&
> + cp->x86_vendor != X86_VENDOR_CENTAUR )
> goto gp_fault;
>
> *val = 0;
Thanks for this patch, I've applied it and the Windows guest no longer crashes.
Regards,
James
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
2021-02-04 9:36 [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again) Jan Beulich
2021-02-04 9:40 ` Roger Pau Monné
2021-02-04 11:34 ` James Dingwall
@ 2021-02-04 12:48 ` Andrew Cooper
2021-02-04 15:53 ` Jan Beulich
3 siblings, 0 replies; 7+ messages in thread
From: Andrew Cooper @ 2021-02-04 12:48 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Wei Liu, Roger Pau Monné, James Dingwall
On 04/02/2021 09:36, Jan Beulich wrote:
> X86_VENDOR_* aren't bit masks in the older trees.
>
> Reported-by: James Dingwall <james@dingwall.me.uk>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
2021-02-04 9:36 [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again) Jan Beulich
` (2 preceding siblings ...)
2021-02-04 12:48 ` Andrew Cooper
@ 2021-02-04 15:53 ` Jan Beulich
2021-02-04 16:01 ` Andrew Cooper
3 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2021-02-04 15:53 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné, James Dingwall
On 04.02.2021 10:36, Jan Beulich wrote:
> X86_VENDOR_* aren't bit masks in the older trees.
>
> Reported-by: James Dingwall <james@dingwall.me.uk>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/msr.c
> +++ b/xen/arch/x86/msr.c
> @@ -226,7 +226,8 @@ int guest_rdmsr(const struct vcpu *v, ui
> */
> case MSR_IA32_PERF_STATUS:
> case MSR_IA32_PERF_CTL:
> - if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR)) )
> + if ( cp->x86_vendor != X86_VENDOR_INTEL &&
> + cp->x86_vendor != X86_VENDOR_CENTAUR )
> goto gp_fault;
>
> *val = 0;
Darn - this was only half of it. There's a similar construct
in guest_wrmsr() which also wants replacing.
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
2021-02-04 15:53 ` Jan Beulich
@ 2021-02-04 16:01 ` Andrew Cooper
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Cooper @ 2021-02-04 16:01 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Wei Liu, Roger Pau Monné, James Dingwall
On 04/02/2021 15:53, Jan Beulich wrote:
> On 04.02.2021 10:36, Jan Beulich wrote:
>> X86_VENDOR_* aren't bit masks in the older trees.
>>
>> Reported-by: James Dingwall <james@dingwall.me.uk>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/arch/x86/msr.c
>> +++ b/xen/arch/x86/msr.c
>> @@ -226,7 +226,8 @@ int guest_rdmsr(const struct vcpu *v, ui
>> */
>> case MSR_IA32_PERF_STATUS:
>> case MSR_IA32_PERF_CTL:
>> - if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR)) )
>> + if ( cp->x86_vendor != X86_VENDOR_INTEL &&
>> + cp->x86_vendor != X86_VENDOR_CENTAUR )
>> goto gp_fault;
>>
>> *val = 0;
> Darn - this was only half of it. There's a similar construct
> in guest_wrmsr() which also wants replacing.
I really should have renamed the constants when I changed their layout...
My R-by stands in light of that change.
~Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-02-04 16:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 9:36 [PATCH for-4.12 and older] x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again) Jan Beulich
2021-02-04 9:40 ` Roger Pau Monné
2021-02-04 9:48 ` Jan Beulich
2021-02-04 11:34 ` James Dingwall
2021-02-04 12:48 ` Andrew Cooper
2021-02-04 15:53 ` Jan Beulich
2021-02-04 16:01 ` Andrew Cooper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.