lkml.org 
[lkml]   [2020]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 09/23] perf/x86/intel: Check Arch LBR MSRs
On Fri, Jun 26, 2020 at 11:20:06AM -0700, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> The KVM may not support the MSRs of Architecture LBR. Accessing the
> MSRs may cause #GP and crash the guest.
>
> The MSRs have to be checked at guest boot time.
>
> Only using the max number of Architecture LBR depth to check the
> MSR_ARCH_LBR_DEPTH should be good enough. The max number can be
> calculated by 8 * the position of the last set bit of LBR_DEPTH value
> in CPUID enumeration.

But But But, this is architectural, it's in CPUID. If KVM lies to us, it
gets to keep the pices.

This was different when it was not enumerated and all we had was poking
the MSRs, but here KVM can simply mask the CPUID bits if it doesn't
support the MSRs.

If KVM gives us the CPUID bits, we should let it crash and burn if it
then doesn't provide the MSRs.

\
 
 \ /
  Last update: 2020-06-30 16:58    [W:0.122 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site