Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp792432ybx; Thu, 31 Oct 2019 00:41:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzemXO563p8lY3uOnLzuOctNwhvRH6HMulqP3bO/yP9jrGZROofn5agpLdu2Jftq8KQfPlm X-Received: by 2002:a17:906:24d4:: with SMTP id f20mr2113518ejb.182.1572507664969; Thu, 31 Oct 2019 00:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572507664; cv=none; d=google.com; s=arc-20160816; b=ejMlgSdAgKcntQOkGtxkpu0fmK/Qq/R5tcX6GrgnRgSGrHbTvhsIEl9UFL6Ke1ePRG 60EedShUF1fp6o/4baFKtnM4szHWu6yVaIk6ozU4gMWaO91sJL4Qq+i05gQwkhm76pwL akf7cezAGwZ2krB0HfJXQ9f+a3t9/QIMO4O7YTUcUSTJYeQxD4P+mREIA+QzRsB2wEZZ SRJuBOGqB41u83IpS7zbnVewbxo34AUg8bR3ZYUIcxmreIoHZ0niAAfRJZUCkB6e11wO GEifcsSi/7pJn9R8fdlREHgWnIgVVqaIIhpzVGYaF641yE0H2mlKxHCRhffL8e/Lqwli 2b3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=kdjSmKkLqkUsPSrkNP5ZfULJr9Y71zSDom5mbKz5us8=; b=aCk+dZJ4bOIkBBdhBzPecHSXvw8evhGYxX3AhXCkWtdS42/QVdj9z+YG4TWOMPr+3s QujOZTuOqgqY+8I4jd7w+ZPmNQ1G53xjOMZD3D0ZD68xw/mSUCUTGyGyNjvDjs7WzNXY TfdmnOco+5VJzspxSKIgnmJ+5uwFMHGGDgVqgCxuMJ1C2GLYE/EERdlp+KIIEOaX/fpj E0p2KHWFHwbsO1oQvRspNlLxxMoXnH7ZbeKfqQwNkWWZ2LfAiIj2IgOUZlz5uw0M6WEh ckAkY/bKSynCdpR59pf0K8haBRLTpnOcW+/KKx6rJvyCj3f8R6vXXqYmDb1uTlEM9eUO UVvA== 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 u12si4107759eda.319.2019.10.31.00.40.40; Thu, 31 Oct 2019 00:41:04 -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 S1727005AbfJaHjc (ORCPT + 99 others); Thu, 31 Oct 2019 03:39:32 -0400 Received: from mga07.intel.com ([134.134.136.100]:26720 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbfJaHjc (ORCPT ); Thu, 31 Oct 2019 03:39:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2019 00:39:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,250,1569308400"; d="scan'208";a="401792868" Received: from um.fi.intel.com (HELO um) ([10.237.72.57]) by fmsmga006.fm.intel.com with ESMTP; 31 Oct 2019 00:39:25 -0700 From: Alexander Shishkin To: "Kang\, Luwei" , Peter Zijlstra Cc: "kvm\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , "pbonzini\@redhat.com" , "rkrcmar\@redhat.com" , "Christopherson\, Sean J" , "vkuznets\@redhat.com" , "wanpengli\@tencent.com" , "jmattson\@google.com" , "joro\@8bytes.org" , "tglx\@linutronix.de" , "mingo\@redhat.com" , "bp\@alien8.de" , "hpa\@zytor.com" , "x86\@kernel.org" , "ak\@linux.intel.com" , "thomas.lendacky\@amd.com" , "acme\@kernel.org" , "mark.rutland\@arm.com" , "jolsa\@redhat.com" , "namhyung\@kernel.org" , alexander.shishkin@linux.intel.com Subject: RE: [PATCH v1 8/8] perf/x86: Add event owner check when PEBS output to Intel PT In-Reply-To: <82D7661F83C1A047AF7DC287873BF1E173836317@SHSMSX104.ccr.corp.intel.com> References: <1572217877-26484-1-git-send-email-luwei.kang@intel.com> <1572217877-26484-9-git-send-email-luwei.kang@intel.com> <20191029151302.GO4097@hirez.programming.kicks-ass.net> <82D7661F83C1A047AF7DC287873BF1E173835B6A@SHSMSX104.ccr.corp.intel.com> <20191030095400.GU4097@hirez.programming.kicks-ass.net> <82D7661F83C1A047AF7DC287873BF1E173836317@SHSMSX104.ccr.corp.intel.com> Date: Thu, 31 Oct 2019 09:39:24 +0200 Message-ID: <87bltxfjo3.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Kang, Luwei" writes: >> Then how does KVM deal with the host using PT? You can't just steal PT. > > Intel PT in virtualization can work in system and host_guest mode. > In system mode (default), the trace produced by host and guest will be saved in host PT buffer. Intel PT will not be exposed to guest in this mode. > In host_guest mode, Intel PT will be exposed to guest and guest can use PT like native. The value of host PT register will be saved and guest PT register value will be restored during VM-entry. Both trace of host and guest are exported to their respective PT buffer. The host PT buffer not include guest trace in this mode. IOW, it will steal PT from the host. Regards, -- Alex