Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1928099ybb; Thu, 9 Apr 2020 11:36:21 -0700 (PDT) X-Google-Smtp-Source: APiQypKt4W8RxRDPaYqOGpIBMo2YgX/yftKVaFb12kQiMV8gWWlGM1HdiM+J1Pup7GzMnzGIkEbV X-Received: by 2002:aed:249c:: with SMTP id t28mr755097qtc.169.1586457378998; Thu, 09 Apr 2020 11:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586457378; cv=none; d=google.com; s=arc-20160816; b=Ql/7niH2X3gvUz6meLQVp8SgE34wi9yW9fustkju4nNPOGIzivhMM2ZUcFOq8GiMjL W9i9ZrcQfer1R4dbYcrJb2qGFbiaDQxeCkIEGh8ct3r7x1ZJYz+K6wg+RWKyyYmFRACR 4vETkvw3Mx6dTEv+wMT1JW2Oiv1NcS23Fm3uTirwwTkl1WQodlrPXaTAaBo7wy3VEfdS 20XocKhtVB0JyoQAIL5D6U9eVD3fMdebrGC16xnWEHk1lNQG5nwBU6r9Z8Jk0snrGIV5 0AE4O4jkJjNcguyUf9HdUQia3ho/gtY9K9KjEaWak/ZYx1oizAB3AF4IT9PyEJcZBwfs 2g7w== 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:ironport-sdr:ironport-sdr; bh=JPyNWE3HBIjqL4T5k2C7j2nFyV6blCH2f+7ypLbXZa0=; b=GjgIzkdpCBH8YXJ5yExcqmztJ6JXJ9Ty8hlc47G1FUSBbwqRJQfsvsxpTRsyl1MhQ1 n2n6Yds8ZAuicW9FS+A70IwGRWQa92pbsn+qy5Qi0ZhciJOy9ROvrcODZ5IBbpYdiBCH ZE9WWmTGQAjF9BLA0sTsNUCEBJhQ8BrWeJtY7y0A5fu+8r/l28yaT9nR0Qsb4xNWAhNj MN6EOtedr3HWktnFWu2gRPc2lajna9P2hELH817pdWVQu4WRomdWpJTUhSDt7WyyAz4z 7hotTpRzPjv3dJNbOwi74jUSvJ9Vnz07+jxNyCsTjOsI8J1AIOM5jJ04kiIxlBGqNCNH po7w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d205si6754701qke.279.2020.04.09.11.35.53; Thu, 09 Apr 2020 11:36:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726648AbgDISea (ORCPT + 99 others); Thu, 9 Apr 2020 14:34:30 -0400 Received: from mga11.intel.com ([192.55.52.93]:23441 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbgDISe3 (ORCPT ); Thu, 9 Apr 2020 14:34:29 -0400 IronPort-SDR: sOVKgnjaZM2QywELzJE6Xp5QY/Fl+TLrl8+VJh+oKgM4j+CF8DpByLuA17bQg6zBrfyCj2les3 gXfIA3+580lw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 11:34:29 -0700 IronPort-SDR: TXiQILKrvdolDKooLN9c/56KVHIEqAB+3FOJVk0Pm8gC6Cuodb9ZMB8c7oO0p3xyw7/Wf3Del6 S0hoHcbVYIdw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,363,1580803200"; d="scan'208";a="453259274" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by fmsmga006.fm.intel.com with ESMTP; 09 Apr 2020 11:34:29 -0700 Date: Thu, 9 Apr 2020 11:34:29 -0700 From: Sean Christopherson To: "Kang, Luwei" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "pbonzini@redhat.com" , "vkuznets@redhat.com" , "wanpengli@tencent.com" , "jmattson@google.com" , "joro@8bytes.org" Subject: Re: [PATCH] KVM: VMX: Disable Intel PT before VM-entry Message-ID: <20200409183429.GA8919@linux.intel.com> References: <1584503298-18731-1-git-send-email-luwei.kang@intel.com> <20200318154826.GC24357@linux.intel.com> <82D7661F83C1A047AF7DC287873BF1E1738A9724@SHSMSX104.ccr.corp.intel.com> <20200330172152.GE24988@linux.intel.com> <82D7661F83C1A047AF7DC287873BF1E1738B1A1C@SHSMSX104.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82D7661F83C1A047AF7DC287873BF1E1738B1A1C@SHSMSX104.ccr.corp.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 30, 2020 at 08:29:26PM -0700, Kang, Luwei wrote: > > > > On Wed, Mar 18, 2020 at 11:48:18AM +0800, Luwei Kang wrote: > > Ah, right. What about enhancing intel_pt_handle_vmx() and 'struct pt' to > > replace vmx_on with a field that incorporates the KVM mode? > > Some history is the host perf didn't fully agree with introducing HOST_GUEST > mode for PT in KVM. Because the KVM will disable the host trace before > VM-entry in HOST_GUEST mode and KVM guest will win in this case. e.g. Intel > PT has been enabled in KVM guest and the host wants to start system-wide > trace(collect all the trace on this system) at this time, the trace produced > by the Guest OS will be saved in guest PT buffer and host buffer can't get > this. So I prefer don't introduce the KVM PT mode to host perf framework. The > similar problem happens on PEBS virtualization via DS as well. A maintainer's distaste for a feature isn't a good reason to put a hack into KVM. Perf burying its head in the sand won't change the fact that "pt->vmx_on" is poorly named and misleading. Disagreement over features is fine, but things will go sideways quick if perf and KVM are outright hostile towards each other.