RE: [PATCH v1 8/8] perf/x86: Add event owner check when PEBS output to Intel PT

From: Kang, Luwei
Date: Thu Oct 31 2019 - 06:31:25 EST


> >> 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.

Hi Alexander,
The host buffer does not include guest packets in this mode because the guest trace will be saved in guest PT buffer in this mode. You can think it is stealing.

>
> Regards,
> --
> Alex