Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5944199imd; Wed, 31 Oct 2018 04:39:32 -0700 (PDT) X-Google-Smtp-Source: AJdET5cOR2yhEQhmMAf5VN9O/acZfSC9ng2h4TFYuZ9W2SZm26LMzIof0sYlSzit7OE62uYzaxQU X-Received: by 2002:a17:902:6b04:: with SMTP id o4-v6mr3033412plk.333.1540985972130; Wed, 31 Oct 2018 04:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540985972; cv=none; d=google.com; s=arc-20160816; b=waMmNTukNZ7b+pG9RaOa0WfLfxOsH6c1dfxpV2sg4dwKo5Ia+byGJQFnj9Ntz+lbdv sKYacW+iJgNSdGAoizVtU29Aom/uUZXoFFI6k8yAKd6SzRDHaWlvtC0tsYb+/2qhS7Eq +HRY9KqjfE/iLhT5IQu9alGM7NLEEfliaJ0obyUPYIW5kQAJgc57Brzbk7pWxpTLpV3w XjryCzOh552vlPBytBTWU9WW0hOwBdkVwxon4W2FljoMLRFzKMRuBrhzCvXDiqkEz353 rFjUL8UKwdudwSkns97vrqwnQmcDs2So3/Ks64zErbaAMcyXzcmRW2CK+H6rRKWN/pYa IL9Q== 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=8L9LNrDZmrSwmBcbVt21x6e9758kxjyPVIxs5TBxc/Q=; b=ZUTn3YMia6tZEIdwCwaJzjy5/B9+ozNwow045gJFhVEKTmFK+oEvStQHxCY/Dd/3p+ eX4A+5cOBwT+oGm9TaxNxGn5mAxPn6vS+upo+942ufWAn2oTQrbh+fIyn3gIH0YYwVKZ 8Irxoh4wi8CJtEva/0lHqcSUqO5RdT10aKDlpsNiBYJRqETjo3Hk3LOaMPFTwCzwrFbz 3Vr1eNJHUxQb7RZx4HD6DHmvkLHUe8gqD4TmYoWE7s6DR7RFGlm9wF6vvZ5U90V+6DGM 6mstyiw1wQyhiU5c7Fc6bQRgWjz87pxrF0Nl7S0IVf5W1HqMu07pYFxICJfwMVZhrDHm lDjQ== 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 h28-v6si26320588pgm.67.2018.10.31.04.39.15; Wed, 31 Oct 2018 04:39:32 -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 S1728706AbeJaUg1 (ORCPT + 99 others); Wed, 31 Oct 2018 16:36:27 -0400 Received: from mga07.intel.com ([134.134.136.100]:12442 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbeJaUg1 (ORCPT ); Wed, 31 Oct 2018 16:36:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2018 04:38:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,447,1534834800"; d="scan'208";a="104788439" Received: from um.fi.intel.com (HELO localhost) ([10.237.72.212]) by orsmga002.jf.intel.com with ESMTP; 31 Oct 2018 04:38:40 -0700 From: Alexander Shishkin To: Paolo Bonzini , Luwei Kang , kvm@vger.kernel.org, x86@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, rkrcmar@redhat.com, joro@8bytes.org, songliubraving@fb.com, peterz@infradead.org, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, thomas.lendacky@amd.com, konrad.wilk@oracle.com, mattst88@gmail.com, Janakarajan.Natarajan@amd.com, dwmw@amazon.co.uk, jpoimboe@redhat.com, marcorr@google.com, ubizjak@gmail.com, sean.j.christopherson@intel.com, jmattson@google.com, linux-kernel@vger.kernel.org, Chao Peng Subject: Re: [PATCH v13 08/12] KVM: x86: Add Intel PT context switch for each vcpu In-Reply-To: References: <1540368316-12998-1-git-send-email-luwei.kang@intel.com> <1540368316-12998-9-git-send-email-luwei.kang@intel.com> <87a7n37iuf.fsf@ashishki-desk.ger.corp.intel.com> <87y3af65fi.fsf@ashishki-desk.ger.corp.intel.com> Date: Wed, 31 Oct 2018 13:38:39 +0200 Message-ID: <87r2g65osg.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 Paolo Bonzini writes: > On 30/10/2018 12:26, Alexander Shishkin wrote: >> There is a control in the perf event attribute that enables tracing the >> guest. If this control is enabled, the kvm needs to stay away from any >> PT related MSRs. > > This cannot happen once the guest has been told it can trace itself. So, they need to be made mutually exclusive. > There is no standard way to tell the guest that the host overrode its > choice to use PT. However, the host will get a PGD/PGE packet around > vmentry and vmexit, so there _will_ be an indication that the guest > owned the MSRs for that period of time. Not if they are not tracing the kernel. > If PT context switching is enabled with the module parameter, we could > also reject creation of events with the attribute set. However that > won't help if the event is created before KVM is even loaded. In that case, modprobe kvm should fail. Regards, -- Alex