linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Zhenyu Wang <zhenyuw@linux.intel.com>,
	kvm@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, H Peter Anvin <hpa@zytor.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Mingwei Zhang <mizhang@google.com>
Subject: Re: [PATCH 0/3] KVM: x86: Fix Intel PT Host/Guest mode when host tracing also
Date: Tue, 10 Sep 2024 14:02:28 +0800	[thread overview]
Message-ID: <Zt/g9Cpix06Ccg4z@debian-scheme> (raw)
In-Reply-To: <20240906130026.10705-1-adrian.hunter@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2465 bytes --]


Add Mingwei.

On 2024.09.06 16:00:23 +0300, Adrian Hunter wrote:
> Hi
> 
> There is a long-standing problem whereby running Intel PT on host and guest
> in Host/Guest mode, causes VM-Entry failure.
> 
> The motivation for this patch set is to provide a fix for stable kernels
> prior to the advent of the "Mediated Passthrough vPMU" patch set:
> 
> 	https://lore.kernel.org/kvm/20240801045907.4010984-1-mizhang@google.com/
> 
> which would render a large part of the fix unnecessary but likely not be
> suitable for backport to stable due to its size and complexity.
> 
> Ideally, this patch set would be applied before "Mediated Passthrough vPMU"
> 
> Note that the fix does not conflict with "Mediated Passthrough vPMU", it
> is just that "Mediated Passthrough vPMU" will make the code to stop and
> restart Intel PT unnecessary.
>

With mediated passthrough vPMU, we could enable PT pmu's PERF_PMU_CAP_PASSTHROUGH_VPMU
capability like core pmu, then perf guest helper could handle any host PT events
during VM entry/exit as well like core perf events. The benefit is general perf interface
to handle like others. But it would be sure to depend on passthrough vPMU be enabled,
not as this to fix in case w/o that.

I have local patches to work against passthrough vPMU, but like passthrough vPMU
to be settled down first. With Adrian's change, it could be also possible to decouple
the dependency, so may support in both cases with or w/o passthrough vPMU enabled. 

> 
> Adrian Hunter (3):
>       KVM: x86: Fix Intel PT IA32_RTIT_CTL MSR validation
>       KVM: x86: Fix Intel PT Host/Guest mode when host tracing also
>       KVM: selftests: Add guest Intel PT test
> 
>  arch/x86/events/intel/pt.c                         | 131 ++++++-
>  arch/x86/events/intel/pt.h                         |  10 +
>  arch/x86/include/asm/intel_pt.h                    |   4 +
>  arch/x86/kvm/vmx/vmx.c                             |  26 +-
>  arch/x86/kvm/vmx/vmx.h                             |   1 -
>  tools/testing/selftests/kvm/Makefile               |   1 +
>  .../selftests/kvm/include/x86_64/processor.h       |   1 +
>  tools/testing/selftests/kvm/x86_64/intel_pt.c      | 381 +++++++++++++++++++++
>  8 files changed, 532 insertions(+), 23 deletions(-)
>  create mode 100644 tools/testing/selftests/kvm/x86_64/intel_pt.c
> 
> base-commit: d45aab436cf06544abeeffc607110f559a3af3b4
> 
> 
> Regards
> Adrian
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2024-09-10  6:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 13:00 [PATCH 0/3] KVM: x86: Fix Intel PT Host/Guest mode when host tracing also Adrian Hunter
2024-09-06 13:00 ` [PATCH 1/3] KVM: x86: Fix Intel PT IA32_RTIT_CTL MSR validation Adrian Hunter
2024-09-06 13:00 ` [PATCH 2/3] KVM: x86: Fix Intel PT Host/Guest mode when host tracing also Adrian Hunter
2024-09-06 13:00 ` [PATCH 3/3] KVM: selftests: Add guest Intel PT test Adrian Hunter
2024-09-10  6:02 ` Zhenyu Wang [this message]
2024-09-26 14:05 ` [PATCH 0/3] KVM: x86: Fix Intel PT Host/Guest mode when host tracing also Adrian Hunter
2024-10-04 16:59   ` Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zt/g9Cpix06Ccg4z@debian-scheme \
    --to=zhenyuw@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=mizhang@google.com \
    --cc=namhyung@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).