[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o9ba5ofj.fsf@ashishki-desk.ger.corp.intel.com>
Date: Wed, 31 Oct 2018 13:46:24 +0200
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Luwei Kang <luwei.kang@...el.com>, kvm@...r.kernel.org,
x86@...nel.org, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
rkrcmar@...hat.com, joro@...tes.org, songliubraving@...com,
peterz@...radead.org, kstewart@...uxfoundation.org,
gregkh@...uxfoundation.org, thomas.lendacky@....com,
konrad.wilk@...cle.com, mattst88@...il.com,
Janakarajan.Natarajan@....com, dwmw@...zon.co.uk,
jpoimboe@...hat.com, marcorr@...gle.com, ubizjak@...il.com,
sean.j.christopherson@...el.com, jmattson@...gle.com,
linux-kernel@...r.kernel.org,
Chao Peng <chao.p.peng@...ux.intel.com>
Subject: Re: [PATCH v13 08/12] KVM: x86: Add Intel PT context switch for each vcpu
Paolo Bonzini <pbonzini@...hat.com> writes:
> On 30/10/2018 11:00, Thomas Gleixner wrote:
>> So at least we need a way for perf on the host to programmatically detect,
>> that 'guest traces itself' is enabled, so it can inject that information
>> into the host data and post processing can tell that. W/o something like
>> that it's going to be a FAQ.
>
> In guest-tracing mode there will be already a TIP.PGD and TIP.PGE packet
> respectively before vmentry and after vmexit, caused by the RTIT_CTL
> WRMSRs in pt_guest_enter and pt_guest_exit. The target IP of the
> packets will come from kvm-intel.ko.
Most people aren't tracing the kernel, so they'd just get a PGD with no
address and a PGE after the kvm is done without any indication of what
happened in between.
> In system mode instead you get a Paging Information Packet on
> vmentry/vmexit, with bit 0 set in the third byte. You won't get it if
> guest-side tracing is on (because tracing has been disabled by
> pt_guest_enter and won't be re-enabled until pt_guest_exit). I don't
> think it's correct to "fake" the PIP in guest-tracing mode, because
> TIP.PGD should be followed immediately by TIP.PGE.
Indeed, we should most definitely not fake PIP. Perf has RECORD_AUX,
which already has PARTIAL flag that was introduced specifically because
of kvm.
Regards,
--
Alex
Powered by blists - more mailing lists