RE: [PATCH v1 8/8] perf/x86: Add event owner check when PEBS output to Intel PT
From: Alexander Shishkin
Date: Thu Oct 31 2019 - 03:39:34 EST
"Kang, Luwei" <luwei.kang@xxxxxxxxx> writes:
>> Then how does KVM deal with the host using PT? You can't just steal PT.
>
> Intel PT in virtualization can work in system and host_guest mode.
> In system mode (default), the trace produced by host and guest will be saved in host PT buffer. Intel PT will not be exposed to guest in this mode.
> In host_guest mode, Intel PT will be exposed to guest and guest can use PT like native. The value of host PT register will be saved and guest PT register value will be restored during VM-entry. Both trace of host and guest are exported to their respective PT buffer. The host PT buffer not include guest trace in this mode.
IOW, it will steal PT from the host.
Regards,
--
Alex