[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 3/3] x86/msr: Fix Solaris and turbostat following XSA-351
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> 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; + *val = 0; + break; + /* * These MSRs are not enumerated in CPUID. They have been around * since the Pentium 4, and implemented by other vendors. -- 2.11.0
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |