From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v7 06/13] KVM: x86: Add Intel Processor Trace virtualization mode Date: Thu, 3 May 2018 14:50:12 +0200 Message-ID: <26505f7a-9e6b-efb9-e5f9-8aae3756be49@redhat.com> References: <1525349323-9938-1-git-send-email-luwei.kang@intel.com> <1525349323-9938-7-git-send-email-luwei.kang@intel.com> <20180503113223.x2ykby6wglppgdwf@um.fi.intel.com> <47494e95-edcb-e8b5-0a32-004e9470dbdf@redhat.com> <20180503120215.dev7ti43zk7yoovn@um.fi.intel.com> <221c297b-1270-371b-70a3-4cff4bed7a7e@redhat.com> <20180503124847.tcrizs2sxy3j6mu2@um.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Luwei Kang , kvm@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, rkrcmar@redhat.com, linux-kernel@vger.kernel.org, joro@8bytes.org, peterz@infradead.org, chao.p.peng@linux.intel.com To: Alexander Shishkin Return-path: In-Reply-To: <20180503124847.tcrizs2sxy3j6mu2@um.fi.intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 03/05/2018 14:48, Alexander Shishkin wrote: >> Guest tracing can only be enabled at boot time, because the guest's >> CPUID changes depending on whether it's enabled. And likewise if perf >> record can do system-wide tracing at any time during the guest's >> execution, we need to know it at boot time in order to set the guest CPUID. > > CPUID is immaterial here; the real trick is to disallow the use of PT at > runtime when the host suddenly decides to trace the guest, in such a way > that the guest user is informed that their trace is incomplete due to the > host activity. How do you do that? And you still need the module parameter to decide whether the host is _allowed_ to cause incomplete traces in the guest. Paolo > Side note: the "system-wide tracing" is a misnomer here, all that matters > is that there's a perf event on the host that wants to trace the guest, it > can very well be a per-task event.