[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DS0PR11MB6373ACD91938CE70EBADA831DC4D9@DS0PR11MB6373.namprd11.prod.outlook.com>
Date: Mon, 19 Sep 2022 15:22:58 +0000
From: "Wang, Wei W" <wei.w.wang@...el.com>
To: "Liang, Kan" <kan.liang@...ux.intel.com>,
"Li, Xiaoyao" <xiaoyao.li@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
"Arnaldo Carvalho de Melo" <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
"Christopherson,, Sean" <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"Liang, Kan" <kan.liang@...el.com>,
"Kleen, Andi" <andi.kleen@...el.com>
CC: "linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: RE: [RFC PATCH 0/2] KVM: VMX: Fix VM entry failure on
PT_MODE_HOST_GUEST while host is using PT
On Monday, September 19, 2022 10:41 PM, Liang, Kan wrote:
> Another fake event? We have to specially handle it in the perf code. I don't
> think it's a clean way for perf.
We can check the patch later. I think it should be clean, like the LBR side.
>
> > - on VMEnter:
> > -- perf_disable_event_local(host_event);
> > -- perf_enable_event_local(guest_event);
> > - on VMExit:
> > -- perf_disable_event_local(guest_event);
> > -- perf_enable_event_local(host_event);
>
> Why we cannot use the same way as the perf core driver to switch the MSRs in
> the VMCS?
The current MSR switching list from VMCS isn’t fast,
should be the last resort when really necessary.
>
> You just need one generic function, perf_guest_get_msrs(), for both PT and
> core driver. If you have to disable PT explicitly before VMCS, I think you can do
> it in the PT specific perf_guest_get_msrs().
The disable is done via " Clear IA32_RTIT_CTL" VMExit control.
It can ensure PT disabled in time on VMExit, so no need to go through perf_guest_get_msrs.
Thanks,
Wei
Powered by blists - more mailing lists