[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47690d71-6ebf-b85c-97f7-d37b20f3cd65@intel.com>
Date: Sun, 15 May 2022 10:27:43 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Andi Kleen <ak@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>, Leo Yan <leo.yan@...aro.org>,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
kvm@...r.kernel.org
Subject: Re: [PATCH 6/6] perf intel-pt: Add guest_code support
On 13/05/22 21:13, Andi Kleen wrote:
> Adrian Hunter <adrian.hunter@...el.com> writes:
>>>
>>> I'm still not fully sure how it exactly finds the code on the host,
>>> how is the code transferred?
>>
>> I don't know. From a quick look at the code in
>> tools/testing/selftests/kvm/lib/kvm_util.c it seems to be using
>> KVM_SET_USER_MEMORY_REGION IOCTL.
>
> Okay so it assumes that the pages with code on the guest are still intact: that is
> you cannot quit the traced program, or at least not do something that would
> fill it with other data?. Is that correct?
>
> It sounds like with that restriction it's more useful for kernel traces.
These patches are to support tracing of test programs that
*are* the hypervisor, creating, populating, and destroying the VM.
The VM is not running an OS.
Like:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c
guest_code() gets mapped into the VM at the same virtual address as the host,
so the Intel PT decoder, which wants to walk the object code, can find the
object code in the host program.
Powered by blists - more mailing lists