RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Saturday, September 8, 2018 4:05 AM, Andi Kleen wrote: > > How would you realize the function of saving/restoring the lbr stack on the > host? > > > > Here, we create a perf event on the host (please see > guest_lbr_event_create on patch 7), which essentially satisfies all the > conditions

RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Saturday, September 8, 2018 4:05 AM, Andi Kleen wrote: > > How would you realize the function of saving/restoring the lbr stack on the > host? > > > > Here, we create a perf event on the host (please see > guest_lbr_event_create on patch 7), which essentially satisfies all the > conditions

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Andi Kleen
> How would you realize the function of saving/restoring the lbr stack on the > host? > > Here, we create a perf event on the host (please see guest_lbr_event_create > on patch 7), which essentially satisfies all the conditions (e.g. increases > cpuc->lbr_users) that are required to have the

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Andi Kleen
> How would you realize the function of saving/restoring the lbr stack on the > host? > > Here, we create a perf event on the host (please see guest_lbr_event_create > on patch 7), which essentially satisfies all the conditions (e.g. increases > cpuc->lbr_users) that are required to have the

RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Friday, September 7, 2018 10:11 PM, Andi Kleen wrote: > > This could achieve the above #1, but how would it solve #2 above? That > > is, after the guest uses the lbr feature for a while, the lbr stack > > has been passed through, then the guest doesn't use lbr any more, but > > the vCPU will

RE: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Wang, Wei W
On Friday, September 7, 2018 10:11 PM, Andi Kleen wrote: > > This could achieve the above #1, but how would it solve #2 above? That > > is, after the guest uses the lbr feature for a while, the lbr stack > > has been passed through, then the guest doesn't use lbr any more, but > > the vCPU will

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Andi Kleen
> This could achieve the above #1, but how would it solve #2 above? That is, > after the guest uses the lbr feature for a while, the lbr stack has been > passed through, then the guest doesn't use lbr any more, but the vCPU will > still save/restore on switching? If nothing accesses the MSR LBRs

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-07 Thread Andi Kleen
> This could achieve the above #1, but how would it solve #2 above? That is, > after the guest uses the lbr feature for a while, the lbr stack has been > passed through, then the guest doesn't use lbr any more, but the vCPU will > still save/restore on switching? If nothing accesses the MSR LBRs

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-06 Thread Wei Wang
On 09/07/2018 11:27 AM, Andi Kleen wrote: On Thu, Sep 06, 2018 at 07:30:54PM +0800, Wei Wang wrote: This patch adds an interface to enable a guest to request KVM to save and restore the lbr stack on vCPU context switching. KVM couldn't capture the info about whether the guest is actively using

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-06 Thread Wei Wang
On 09/07/2018 11:27 AM, Andi Kleen wrote: On Thu, Sep 06, 2018 at 07:30:54PM +0800, Wei Wang wrote: This patch adds an interface to enable a guest to request KVM to save and restore the lbr stack on vCPU context switching. KVM couldn't capture the info about whether the guest is actively using

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-06 Thread Andi Kleen
On Thu, Sep 06, 2018 at 07:30:54PM +0800, Wei Wang wrote: > This patch adds an interface to enable a guest to request KVM to save > and restore the lbr stack on vCPU context switching. > > KVM couldn't capture the info about whether the guest is actively using > the lbr feature via the lbr enable

Re: [PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-06 Thread Andi Kleen
On Thu, Sep 06, 2018 at 07:30:54PM +0800, Wei Wang wrote: > This patch adds an interface to enable a guest to request KVM to save > and restore the lbr stack on vCPU context switching. > > KVM couldn't capture the info about whether the guest is actively using > the lbr feature via the lbr enable

[PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-06 Thread Wei Wang
This patch adds an interface to enable a guest to request KVM to save and restore the lbr stack on vCPU context switching. KVM couldn't capture the info about whether the guest is actively using the lbr feature via the lbr enable bit in the debugctl MSR, because that control bit is frequently

[PATCH v2 6/8] perf/x86/intel/lbr: guest requesting KVM for lbr stack save/restore

2018-09-06 Thread Wei Wang
This patch adds an interface to enable a guest to request KVM to save and restore the lbr stack on vCPU context switching. KVM couldn't capture the info about whether the guest is actively using the lbr feature via the lbr enable bit in the debugctl MSR, because that control bit is frequently