Received: by 10.192.165.148 with SMTP id m20csp1805838imm; Thu, 3 May 2018 05:49:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZplvJeNjyULqZFrRBFAr22I5kVc4Grqa2feWMWYFerye5VGQ3OapnEx8kBfThCHX/3NELJK X-Received: by 10.98.174.19 with SMTP id q19mr22978252pff.155.1525351776460; Thu, 03 May 2018 05:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525351776; cv=none; d=google.com; s=arc-20160816; b=puY1SR/22RURbmbeHirFxvuxUD0hS2pmthS0kB+ma9vPHzHvcZI+41zTs2WIAT/n/m rJgUVqSBhWAzwhzFYDHl9pQYucBUFhSns7+mnxdNmGZE8Zmaxbr420EeBap5vZWq5ON2 DqTaolDHlPpgal070NpXe0BMRuexLbOFQDB1J32ozaYHuyBkj46nMpkQPphfFlCV/JBC IiKE6avSCoPGzZlyY++Is6Sby1WkYP2UaYQa5UbTTgr8G0KvwvYAJkajqDyruUfyHPzN vfh8/m+1eeEW0Stle4F3+QVdYRIc7AsyX8LJwmTUJLaH8CEmC/Gasvq2CCNhquk+ztzR Pu7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=hT+gr5fa3m2lTyDJ+IiLfqbvTyTYif/ZKJeUqBF0HYo=; b=Tgaxi7cDaQ4QlmOMKW6w8sEbekBJdIALgR7zW9/04EFcdgiFuOx+SxKOsOqF20LZ07 UsuktlxNttqB4CFZpNZmhtxQ3RbyqK3BNOJ/KpwZSKobzjlTLGD6jNr/7rF0tHY4Wlxu ZwgZvqSNUxcOAaz6sH7/ZtKFRtnDtvel3na2bT1bRsKC7PTJ+Zof8N2NV4xZ5G14Keyl C6XfrVdOt+6OB8wCWUttQSaW7b4RZfgBlvJIHcRY9XqcHT/m/0r6H+sJqYyUn2aoIx9L V5b/hYyGV9b5dh0yGpz7iuNwUsjKS1DItRNjFH64dA1KbuUUskNHAnaQsPW1Bn21uGou QEbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63-v6si13121656pld.429.2018.05.03.05.49.22; Thu, 03 May 2018 05:49:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751912AbeECMs5 (ORCPT + 99 others); Thu, 3 May 2018 08:48:57 -0400 Received: from mga06.intel.com ([134.134.136.31]:6049 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbeECMsy (ORCPT ); Thu, 3 May 2018 08:48:54 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 05:48:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,358,1520924400"; d="scan'208";a="37159985" Received: from um.fi.intel.com (HELO um) ([10.237.72.212]) by fmsmga008.fm.intel.com with ESMTP; 03 May 2018 05:48:50 -0700 Received: from ash by um with local (Exim 4.90_1) (envelope-from ) id 1fEDfE-00007f-8m; Thu, 03 May 2018 15:48:48 +0300 Date: Thu, 3 May 2018 15:48:47 +0300 From: Alexander Shishkin To: Paolo Bonzini Cc: Alexander Shishkin , 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 Subject: Re: [PATCH v7 06/13] KVM: x86: Add Intel Processor Trace virtualization mode Message-ID: <20180503124847.tcrizs2sxy3j6mu2@um.fi.intel.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <221c297b-1270-371b-70a3-4cff4bed7a7e@redhat.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 03, 2018 at 02:30:25PM +0200, Paolo Bonzini wrote: > On 03/05/2018 14:02, Alexander Shishkin wrote: > > I don't see why. System-wide tracing takes place while perf record is > > running. When it's done, it's done and we can un-disable the guest > > tracing, without requiring the user to kill all their VMs and reload > > modules. > > 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. 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. Regards, -- Alex