RE: [PATCH v4 10/10] KVM/x86/lbr: lazy save the guest lbr stack II

2018-12-28 Thread Wang, Wei W
On Friday, December 28, 2018 4:53 AM, Andi Kleen wrote: > Actually forgot one case. > > In Arch Perfmon v4 the LBR freezing is also controlled through a > GLOBAL_CTRL bit. > I didn't see any code handling that bit? That GLOBAL_STATUS.LBR_FRZ bit hasn't been supported yet. I'll add that, thanks.

Re: [PATCH v4 10/10] KVM/x86/lbr: lazy save the guest lbr stack

2018-12-28 Thread Andi Kleen
On Fri, Dec 28, 2018 at 11:47:06AM +0800, Wei Wang wrote: > On 12/28/2018 04:51 AM, Andi Kleen wrote: > > Thanks. This looks a lot better than the earlier versions. > > > > Some more comments. > > > > On Wed, Dec 26, 2018 at 05:25:38PM +0800, Wei Wang wrote: > > > When the vCPU is scheduled in:

Re: [PATCH v4 10/10] KVM/x86/lbr: lazy save the guest lbr stack

2018-12-27 Thread Wei Wang
On 12/28/2018 04:51 AM, Andi Kleen wrote: Thanks. This looks a lot better than the earlier versions. Some more comments. On Wed, Dec 26, 2018 at 05:25:38PM +0800, Wei Wang wrote: When the vCPU is scheduled in: - if the lbr feature was used in the last vCPU time slice, set the lbr stack to

Re: [PATCH v4 10/10] KVM/x86/lbr: lazy save the guest lbr stack II

2018-12-27 Thread Andi Kleen
Actually forgot one case. In Arch Perfmon v4 the LBR freezing is also controlled through a GLOBAL_CTRL bit. I didn't see any code handling that bit? -Andi

Re: [PATCH v4 10/10] KVM/x86/lbr: lazy save the guest lbr stack

2018-12-27 Thread Andi Kleen
Thanks. This looks a lot better than the earlier versions. Some more comments. On Wed, Dec 26, 2018 at 05:25:38PM +0800, Wei Wang wrote: > When the vCPU is scheduled in: > - if the lbr feature was used in the last vCPU time slice, set the lbr > stack to be interceptible, so that the host can

[PATCH v4 10/10] KVM/x86/lbr: lazy save the guest lbr stack

2018-12-26 Thread Wei Wang
When the vCPU is scheduled in: - if the lbr feature was used in the last vCPU time slice, set the lbr stack to be interceptible, so that the host can capture whether the lbr feature will be used in this time slice; - if the lbr feature wasn't used in the last vCPU time slice, disable the