[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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Tue, 16 Mar 2021 17:56:49 +0100
- 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=hVIvL2AQAwlGUKJpF3Vu/Q8SeQcDuyYF4lk2o3iA9wA=; b=hfqFeDVTjFxpohJWiKhFlfxDDR5bpqv4lZwnWaPqs3VtKbVTRaL/ebUO2hJutOwFn53hf7ABE0qU+s9KZCG0rukFJwsDf7Dv/3wGofvecS5aT9QZm0i8ZaWAnqI53yJ8vIHu5LjYXqsjJBmXSmsJpvSgvEJ3GfzWFbatLw8tOoujwiIlYfhFuwsPkM7MZy0mWhfAJEvlUB8k9CjQb9D4mGfeP9bSMyIHE3R17cjXS16qgiKeRvhD+IPS1g/LUNwj6XC+StHXPEAhOAK69IlDuyCfXuDLciWO1ISHEzTL6KbIPdd7j7q+8ew0QmTcha4f3XUpQI+B61x5VdVqHkXUdA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vyn3XuK/xfuGDRomolcYeIhgpwcp4nsbpYaWXENDzjww3LnYn+wRtZypffpX8ldHp7WpZy8MMvr5KS5JlSLyIj5uvA9/bPrnIWpJ03YOPTQ4Qqs2Z/qCZYRPxL8OWPNZOk1jpXgJffqF8lY5PSMEMoFSFYbSzA8KwuW5ud7dMxxFLJD/Xxj7MaRZsx8lqYpbqVoUtXOlnVw4Be5n13COwE2ROSopwiy1uwCs3/i7AZAbdzDdNW7lAJB6bT2MjVrAo04D/DyUD6EkPCNtlVKV7RvU+Y6CoyKBbfDW1Yz1hmA/az3UPxRSB63uzqmz00yiJL5kEihNe6xK5OpxA795/A==
- Authentication-results: esa2.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 16:57:22 +0000
- Ironport-hdrordr: A9a23:hON646517ePWDYSnQQPXwRKBI+orLtY04lQ7vn1ZYQBJc8Ceis CllOka0xixszoKRHQ8g7m7VZWoa3Xa6JJz/M0tLa6vNTOW3VeAAaNDyc/ZwzPmEzDj7eI178 1dWoV3FdGYNzdHpOng5g3QKbgd6f2m1IztuuvE1XdqSmhRGsNdxiN0EBySHEEzZCQuP/oEPa GR7MZGuDasEE5/BqiGL0IIQvTZoJnznI/mCCRsOzcc9AKMgTm0gYSKcCSw4xF2aVJy6IZny0 fpuUjT5qKvs/a0oyWsrVP73tBtt/bKjvdGDMyIoMAJJjvrkRbAXvUdZ5Sy+AobjcvqxFE2kM TdgxpIBbUO11rhOlubjDGo+w783C0g43XvoGXo/kfLkIjCax8RT+9i7LgpFifx2g4bk/xXlJ 9v5Sa/saFaCBvR9R6Nn+TgZlVRuWef5UY5nfV7tQ05baIuLIV/gKY4501vHJIJDEvBmfsaOd grNs3a6fpMGGnqCUzxjy1qyNyoaHw5Ag2LdEgEotCUyDhbhhlCvjIl+PA=
- Ironport-sdr: a6jNA+HNR6+ZELLmCpqg8EiDcute/q/ASAEBiQYz305h3hOp16AQg4i0yP1lOgaec5sAogC29d ghRjfFW5QQ2gMi7egq0zN/WHg5z8YjCBV/EMEflSSHbhBJW5Lla09yMxQKQzOkEtUuqT4fy8SQ Je93BgK4aBEHBTCKOP/+4w6PDL6z+jQ1OJIH6bdbWkbYVPhnBbQ4eJNcuSGPDX+SXMrHzYt9xE vuf6Y+MZJie6ePYz1Q0sCaqA4piHbAoMqjSjX0X+yxzI94KcH2ZWgDLpylX4K5Jh9S8IbhRjYN /DM=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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).
> + *val = 0;
> + break;
Do we also need to care about MSR_AMD_RAPL_POWER_UNIT (0xc0010299) for
Solaris?
Thanks, Roger.
|