[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210719072708.GA23208@intel.com>
Date: Mon, 19 Jul 2021 15:27:08 +0800
From: Yang Weijiang <weijiang.yang@...el.com>
To: Jim Mattson <jmattson@...gle.com>
Cc: Yang Weijiang <weijiang.yang@...el.com>, pbonzini@...hat.com,
seanjc@...gle.com, vkuznets@...hat.com, wei.w.wang@...el.com,
like.xu.linux@...il.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Like Xu <like.xu@...ux.intel.com>
Subject: Re: [PATCH v6 04/12] KVM: vmx/pmu: Emulate MSR_ARCH_LBR_DEPTH for
guest Arch LBR
On Fri, Jul 16, 2021 at 04:33:36PM -0700, Jim Mattson wrote:
> On Fri, Jul 16, 2021 at 1:36 AM Yang Weijiang <weijiang.yang@...el.com> wrote:
> >
> > From: Like Xu <like.xu@...ux.intel.com>
> >
> > The number of Arch LBR entries available is determined by the value
> > in host MSR_ARCH_LBR_DEPTH.DEPTH. The supported LBR depth values are
> > enumerated in CPUID.(EAX=01CH, ECX=0):EAX[7:0]. For each bit "n" set
> > in this field, the MSR_ARCH_LBR_DEPTH.DEPTH value of "8*(n+1)" is
> > supported.
> >
> > On a guest write to MSR_ARCH_LBR_DEPTH, all LBR entries are reset to 0.
> > KVM writes guest requested value to the native ARCH_LBR_DEPTH MSR
> > (this is safe because the two values will be the same) when the Arch LBR
> > records MSRs are pass-through to the guest.
> >
> > Signed-off-by: Like Xu <like.xu@...ux.intel.com>
> > Signed-off-by: Yang Weijiang <weijiang.yang@...el.com>
>
> It might be worth noting that KVM_SET_MSRS cannot be used to emulate a
> wrmsr instruction in the guest, but maybe that's already implicit.
>
> Reviewed-by: Jim Mattson <jmattson@...gle.com>
Thanks Jim. Yes, guest wrmsr read/write emulation shares none-host initiated path.
Powered by blists - more mailing lists