RE: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 8:08 PM, Gonglei (Arei) wrote: > > +static bool guest_access_lbr_msr(struct kvm_vcpu *vcpu, > > +struct msr_data *msr_info, > > +bool set) > > +{ > > + bool ret = false; > > + > > + if

RE: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-27 Thread Wang, Wei W
On Thursday, September 20, 2018 8:08 PM, Gonglei (Arei) wrote: > > +static bool guest_access_lbr_msr(struct kvm_vcpu *vcpu, > > +struct msr_data *msr_info, > > +bool set) > > +{ > > + bool ret = false; > > + > > + if

Re: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Peter Zijlstra
On Thu, Sep 20, 2018 at 08:58:16PM +0800, Wei Wang wrote: > On 09/20/2018 08:37 PM, Peter Zijlstra wrote: > > On Thu, Sep 20, 2018 at 06:05:59PM +0800, Wei Wang wrote: > > > /** > > > + * lbr_select_user_callstack - check if the user callstack mode is set > > > + * > > > + * @lbr_select: the lbr

Re: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Peter Zijlstra
On Thu, Sep 20, 2018 at 08:58:16PM +0800, Wei Wang wrote: > On 09/20/2018 08:37 PM, Peter Zijlstra wrote: > > On Thu, Sep 20, 2018 at 06:05:59PM +0800, Wei Wang wrote: > > > /** > > > + * lbr_select_user_callstack - check if the user callstack mode is set > > > + * > > > + * @lbr_select: the lbr

Re: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Wei Wang
On 09/20/2018 08:37 PM, Peter Zijlstra wrote: On Thu, Sep 20, 2018 at 06:05:59PM +0800, Wei Wang wrote: /** + * lbr_select_user_callstack - check if the user callstack mode is set + * + * @lbr_select: the lbr select msr + * + * Returns: true if the msr is configured to the user callstack

Re: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Wei Wang
On 09/20/2018 08:37 PM, Peter Zijlstra wrote: On Thu, Sep 20, 2018 at 06:05:59PM +0800, Wei Wang wrote: /** + * lbr_select_user_callstack - check if the user callstack mode is set + * + * @lbr_select: the lbr select msr + * + * Returns: true if the msr is configured to the user callstack

Re: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Peter Zijlstra
On Thu, Sep 20, 2018 at 06:05:59PM +0800, Wei Wang wrote: > /** > + * lbr_select_user_callstack - check if the user callstack mode is set > + * > + * @lbr_select: the lbr select msr > + * > + * Returns: true if the msr is configured to the user callstack mode. > + * Otherwise, false. > + * > + */

Re: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Peter Zijlstra
On Thu, Sep 20, 2018 at 06:05:59PM +0800, Wei Wang wrote: > /** > + * lbr_select_user_callstack - check if the user callstack mode is set > + * > + * @lbr_select: the lbr select msr > + * > + * Returns: true if the msr is configured to the user callstack mode. > + * Otherwise, false. > + * > + */

RE: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Gonglei (Arei)
redhat.com; > rkrc...@redhat.com; like...@intel.com; wei.w.w...@intel.com; > ja...@google.com; Gonglei (Arei) > Subject: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack > > When the vCPU is scheduled in: > - if the lbr feature was used in the last vCPU time slice, set t

RE: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 Thread Gonglei (Arei)
redhat.com; > rkrc...@redhat.com; like...@intel.com; wei.w.w...@intel.com; > ja...@google.com; Gonglei (Arei) > Subject: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack > > When the vCPU is scheduled in: > - if the lbr feature was used in the last vCPU time slice, set t

[PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 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

[PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack

2018-09-20 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