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

2019-07-09 Thread Peter Zijlstra
On Mon, Jul 08, 2019 at 08:11:41AM -0700, Andi Kleen wrote: > > I don't understand a word of that. > > > > Who cares if the LBR MSRs are touched; the guest expects up-to-date > > values when it does reads them. > > This is for only when the LBRs are disabled in the guest. But your Changelog

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

2019-07-08 Thread Wei Wang
On 07/08/2019 10:53 PM, Peter Zijlstra wrote: On Mon, Jul 08, 2019 at 09:23:17AM +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 capture whether the lbr feature

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

2019-07-08 Thread Andi Kleen
> I don't understand a word of that. > > Who cares if the LBR MSRs are touched; the guest expects up-to-date > values when it does reads them. This is for only when the LBRs are disabled in the guest. It doesn't make sense to constantly save/restore disabled LBRs, which would be a large

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

2019-07-08 Thread Peter Zijlstra
On Mon, Jul 08, 2019 at 09:23:17AM +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 capture whether the > lbr feature will be used in this time slice; > - if the

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

2019-07-07 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