Received: by 10.192.165.148 with SMTP id m20csp617069imm; Fri, 4 May 2018 03:39:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpj0bh8SDRH8umDBB8Jp7qo04S8+mB/9SD50Hat094evtkQgFlVNlDIKDST/VRubBI+CCIZ X-Received: by 2002:a63:887:: with SMTP id 129-v6mr21646812pgi.17.1525430355021; Fri, 04 May 2018 03:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525430354; cv=none; d=google.com; s=arc-20160816; b=YJurEM7S2HoDdYfFmXowij2O0dNv0FDw8RkZClZN27MyMhFw9Y6uFE2hysmFFNJ09s QtSO5xeH3tJl4k0106/vj6OJsf8B3LU0Xz8EUXqZa7/ISxcD7M8QDk4PWLQpGl2KkOX+ aSPu/f9LhRcuyCaBIncpP+8iRGZ7UOtE0J/26OIkXgr0e2RiDmF+Iy9kGA4F0LzN9gUP afxTYrY77H04jPuOg9oyQOOZ+OFJ8HUeM/Ekg5oT/ENEYl6myPgD3B2LOb9IRRZ9IVKE CCe2oQsNVv/Mw9UAce5RNYyAQWgZasA1Hc3GLksLgCrdjMFBA1ZPfsgAmy8j9NKy6mZ+ lzng== 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=Dd+RGeFQwXaM9+Qz7e/LQQpTvqoYx7AgIaNUneDh5NU=; b=BlBkXtY6QQQDiRbLpr/7ifp3xjqJyxHA5StcwUZW7CiDSpltGJliBbZjBe1f4pGHVT SSvfCakwcwgLz+rxyb72zvOddhLjh8x9SHiGNMQxXVVKiGtVEz07XQQ7zihy47EN3e6j T45JPoccFZtqIzWSukgE/GL8XVF/NpWz5Bqilu030MEfYKj6AFpCn7lPIeU6bk4jPu3D SslrfFMiuGrCRbMkF4KbcUqXAL1oGSdAxtxeUo5Jqz7eyxwX7O2PZjjuQnfr/mCQRsHh VLnuCQhx32y3CXCkjYUSnGLCy+OHE24KkwGQlYp1Qa3mSrKgAoAZirI9hQvkNyUHTkbw VorQ== 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 i89si6713975pfd.117.2018.05.04.03.39.00; Fri, 04 May 2018 03:39:14 -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 S1751236AbeEDKiv (ORCPT + 99 others); Fri, 4 May 2018 06:38:51 -0400 Received: from mga04.intel.com ([192.55.52.120]:21479 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbeEDKiu (ORCPT ); Fri, 4 May 2018 06:38:50 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2018 03:38:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,362,1520924400"; d="scan'208";a="52376694" Received: from um.fi.intel.com (HELO um) ([10.237.72.212]) by fmsmga001.fm.intel.com with ESMTP; 04 May 2018 03:38:44 -0700 Received: from ash by um with local (Exim 4.90_1) (envelope-from ) id 1fEY6s-0001zX-GH; Fri, 04 May 2018 13:38:42 +0300 Date: Fri, 4 May 2018 13:38:42 +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: <20180504103842.rcbpnkjeoavulii6@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> <20180503124847.tcrizs2sxy3j6mu2@um.fi.intel.com> <26505f7a-9e6b-efb9-e5f9-8aae3756be49@redhat.com> <20180503133823.tqbraql3b7ltuo6a@um.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 03:48:12PM +0200, Paolo Bonzini wrote: > On 03/05/2018 15:38, Alexander Shishkin wrote: > > On Thu, May 03, 2018 at 02:50:12PM +0200, Paolo Bonzini wrote: > >> 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? > > > > Off the top of my head: > > * you don't; > > * you write something to the PT stream; > > * you signal an error via RTIT_STATUS; > > * guest always prevails: host gets PARTIAL records in case of a conflict. > > > >> And you still need the module parameter to decide > >> whether the host is _allowed_ to cause incomplete traces in the guest. > > > > Or rather a parameter to decide who wins in case both host and guest want > > to trace the guest. That's arguably better than having different versions of > > PT in the guest depending on a module parameter setting. > > It's not different versions; it's having PT vs. not having PT at all. I > don't really see it as a big issue. The nice thing about this series is > that the interactions between PT code and KVM code are minimal. Unfortunately, it gets it wrong. Like I just said in another email, if you switch off host's PT, you need to let them know, which this patchset doesn't do. And when it does, it would be the same amount of interaction with PT code as what would be required to get the dynamic guest PT right. Regards, -- Alex