Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp951317ybx; Thu, 31 Oct 2019 03:33:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgvnLnwhR/oAtpMeFc3PataTr3R1hxR6dCcbPx2anOOb2f0hm/kgI3P4cvzztB1sejS0+z X-Received: by 2002:a17:906:5907:: with SMTP id h7mr3078845ejq.328.1572517986642; Thu, 31 Oct 2019 03:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572517986; cv=none; d=google.com; s=arc-20160816; b=CnLldzSX9J3NG4IYjpNyxmC6h2GSlkvouzkgGPurE8K4QpPnA28CAbpf7C5roKJ0A6 9zqsNMhgkmRWC00u/A7TJs6EfVD4EUyKA0+Za+Bhn9eHRl7+RC7+Bf6TVX3uJMTg3Xwy +IYmnxUw2r+VmwpOANrzUY7PfD8uUn6czo0VM0Pq2qTxOVEO2eJi7de4DtSUDtjD0IBP uo/Re0zgFX0a96qusF6papIeMFy0lULkd2wYRZHTbP2sBDSeskSSyxNO7R1vcb3l42Ig I1nW7Ure01jxBtVSk7mdW50I1bAccwTgaRyshFuMhwjbwzm7OIe/G8HhKEIbZdYKMBIt ATNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=HWQtGIVLiUkX6iqNWOsE71RKistFRqTG8FTkIZpQPRY=; b=po/xjgZJV9VbEzW+m9sKY/gt8o4OW6IAgCQKJL6a5oQyX2DwLhfe4oN6WBK1BDKzZv /IjkYrLIEujk32rHGTVi2wM1DHh7UBvigzLhSXm1kzSDV2rjm0TswAGiuaIp1bt33Fvk b1/VsD2QiW6057tK5FFLZTcBexeacFm78HIx48wwb6+XD7z+5erd0WR/OOFuC0spJZxf Fe1zMjHA7GhJQvNVjMGKHD+3uGFW3VRCbSDCWIQ1A97kgZ4vmojaG3cokTaI84tzghnd YX1jYmNAq1QV2Akf4ySX4/mKSNOKg5h0oTZ3fbx3Sz2ZWRjfG+TBpElJsgaNOVeudHbS H2GA== 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 v9si3775587edf.36.2019.10.31.03.32.42; Thu, 31 Oct 2019 03:33:06 -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 S1727119AbfJaKbY convert rfc822-to-8bit (ORCPT + 99 others); Thu, 31 Oct 2019 06:31:24 -0400 Received: from mga06.intel.com ([134.134.136.31]:10024 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727021AbfJaKbX (ORCPT ); Thu, 31 Oct 2019 06:31:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2019 03:31:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,250,1569308400"; d="scan'208";a="375198433" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 31 Oct 2019 03:31:22 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 31 Oct 2019 03:31:21 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 31 Oct 2019 03:31:21 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 31 Oct 2019 03:31:21 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0439.000; Thu, 31 Oct 2019 18:31:20 +0800 From: "Kang, Luwei" To: Alexander Shishkin , 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" Subject: RE: [PATCH v1 8/8] perf/x86: Add event owner check when PEBS output to Intel PT Thread-Topic: [PATCH v1 8/8] perf/x86: Add event owner check when PEBS output to Intel PT Thread-Index: AQHVjLd7YuomyMFGekW7/CerqBL266dxNysAgAFIGiD///EXAIABvUSA//+vdgCAALWpgA== Date: Thu, 31 Oct 2019 10:31:20 +0000 Message-ID: <82D7661F83C1A047AF7DC287873BF1E1738363E9@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> <87bltxfjo3.fsf@ashishki-desk.ger.corp.intel.com> In-Reply-To: <87bltxfjo3.fsf@ashishki-desk.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWIxMzBhNzctZTg2ZS00OTkwLTlmZGUtZTg1N2ZiZWQyNGMzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUit0SlZZVGtzeFZaQnhUV01YeXRzOW9mMHV4aFNKamM0QU9sZ05FOXI5WHYwaEFLRFNYcnFDVkVyN0VKNEVFdCJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> 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. Hi Alexander, The host buffer does not include guest packets in this mode because the guest trace will be saved in guest PT buffer in this mode. You can think it is stealing. > > Regards, > -- > Alex