x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
PATCH 1/1 x86/msr: fix handling of MSR_IA32_PERF_{STATUS/CTL} (again)
X86_VENDOR_* aren't bit masks in the older trees.
xen/arch/x86/msr.c +2 -1
@@ -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 ;
Quoted 4 lines · Jan Beulich
X86_VENDOR_* aren't bit masks in the older trees.
Reported-by James Dingwall <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Should this have a set of Fixes tag for the commit hashes on <= 4.12?
Thanks, Roger.
Quoted 7 lines · Roger Pau Monné
Quoted 4 lines · Jan Beulich
X86_VENDOR_* aren't bit masks in the older trees.
Reported-by James Dingwall <[email protected]>Signed-off-by Jan Beulich <[email protected]>Acked-by Roger Pau Monné <[email protected]>
Thanks.
Quoted 1 line
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
Hi Jan,
Quoted 8 lines · Jan Beulich
X86_VENDOR_* aren't bit masks in the older trees.
Reported-by James Dingwall <[email protected]>Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/msr.c int guest_rdmsr(const struct vcpu *v, ui · line 233
Quoted 9 lines
xen/arch/x86/msr.c +2
-1@@ -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
Quoted 4 lines · Jan Beulich
X86_VENDOR_* aren't bit masks in the older trees.
Reported-by James Dingwall <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Quoted 8 lines · Jan Beulich
X86_VENDOR_* aren't bit masks in the older trees.
Reported-by James Dingwall <[email protected]>Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/msr.c int guest_rdmsr(const struct vcpu *v, ui · line 233
Quoted 9 lines
xen/arch/x86/msr.c +2
-1@@ -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
Quoted 17 lines · Jan Beulich
Quoted 16 lines · Jan Beulich
X86_VENDOR_* aren't bit masks in the older trees.
Reported-by James Dingwall <[email protected]>Signed-off-by Jan Beulich <[email protected]>xen/arch/x86/msr.c +2
-1@@ -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;
Quoted 3 lines
xen/arch/x86/msr.c int guest_rdmsr(const struct vcpu *v, ui · line 233
Quoted 1 line
xen/arch/x86/msr.c +0
-0*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