From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Xiaoyao Li <xiaoyao.li@intel.com>
Subject: Re: [PATCH 6/6] KVM: x86: Add requested index to the CPUID tracepoint
Date: Mon, 9 Mar 2020 21:00:23 -0700 [thread overview]
Message-ID: <20200310040023.GF19235@linux.intel.com> (raw)
In-Reply-To: <00827dc7-3338-ce1a-923a-784284cb26db@web.de>
On Sat, Mar 07, 2020 at 10:48:25AM +0100, Jan Kiszka wrote:
> On 02.03.20 20:57, Sean Christopherson wrote:
> >Output the requested index when tracing CPUID emulation; it's basically
> >mandatory for leafs where the index is meaningful, and is helpful for
> >verifying KVM correctness even when the index isn't meaningful, e.g. the
> >trace for a Linux guest's hypervisor_cpuid_base() probing appears to
> >be broken (returns all zeroes) at first glance, but is correct because
> >the index is non-zero, i.e. the output values correspond to random index
> >in the maximum basic leaf.
> >
> >Suggested-by: Xiaoyao Li <xiaoyao.li@intel.com>
> >Cc: Jan Kiszka <jan.kiszka@siemens.com>
> >Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> >---
> > arch/x86/kvm/cpuid.c | 3 ++-
> > arch/x86/kvm/trace.h | 13 ++++++++-----
> > 2 files changed, 10 insertions(+), 6 deletions(-)
> >
> >diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> >index b0a4f3c17932..a3c9f6bf43f3 100644
> >--- a/arch/x86/kvm/cpuid.c
> >+++ b/arch/x86/kvm/cpuid.c
> >@@ -1047,7 +1047,8 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
> > }
> > }
> > }
> >- trace_kvm_cpuid(function, *eax, *ebx, *ecx, *edx, exact_entry_exists);
> >+ trace_kvm_cpuid(function, index, *eax, *ebx, *ecx, *edx,
> >+ exact_entry_exists);
> > }
> > EXPORT_SYMBOL_GPL(kvm_cpuid);
> >
> >diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
> >index f194dd058470..aa372d0119f0 100644
> >--- a/arch/x86/kvm/trace.h
> >+++ b/arch/x86/kvm/trace.h
> >@@ -151,12 +151,14 @@ TRACE_EVENT(kvm_fast_mmio,
> > * Tracepoint for cpuid.
> > */
> > TRACE_EVENT(kvm_cpuid,
> >- TP_PROTO(unsigned int function, unsigned long rax, unsigned long rbx,
> >- unsigned long rcx, unsigned long rdx, bool found),
> >- TP_ARGS(function, rax, rbx, rcx, rdx, found),
> >+ TP_PROTO(unsigned int function, unsigned int index, unsigned long rax,
> >+ unsigned long rbx, unsigned long rcx, unsigned long rdx,
> >+ bool found),
> >+ TP_ARGS(function, index, rax, rbx, rcx, rdx, found),
> >
> > TP_STRUCT__entry(
> > __field( unsigned int, function )
> >+ __field( unsigned int, index )
> > __field( unsigned long, rax )
> > __field( unsigned long, rbx )
> > __field( unsigned long, rcx )
> >@@ -166,6 +168,7 @@ TRACE_EVENT(kvm_cpuid,
> >
> > TP_fast_assign(
> > __entry->function = function;
> >+ __entry->index = index;
> > __entry->rax = rax;
> > __entry->rbx = rbx;
> > __entry->rcx = rcx;
> >@@ -173,8 +176,8 @@ TRACE_EVENT(kvm_cpuid,
> > __entry->found = found;
> > ),
> >
> >- TP_printk("func %x rax %lx rbx %lx rcx %lx rdx %lx, cpuid entry %s",
> >- __entry->function, __entry->rax,
> >+ TP_printk("func %x idx %x rax %lx rbx %lx rcx %lx rdx %lx, cpuid entry %s",
> >+ __entry->function, __entry->index, __entry->rax,
> > __entry->rbx, __entry->rcx, __entry->rdx,
> > __entry->found ? "found" : "not found")
> > );
> >
>
> What happened to this patch in your v2 round?
I completely forgot about it...
next prev parent reply other threads:[~2020-03-10 4:00 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 19:57 [PATCH 0/6] KVM: x86: CPUID emulation and tracing fixes Sean Christopherson
2020-03-02 19:57 ` [PATCH 1/6] KVM: x86: Fix tracing of CPUID.function when function is out-of-range Sean Christopherson
2020-03-02 20:26 ` Jan Kiszka
2020-03-02 20:49 ` Sean Christopherson
2020-03-02 20:59 ` Jan Kiszka
2020-03-03 2:27 ` Xiaoyao Li
2020-03-03 3:45 ` Sean Christopherson
2020-03-03 4:02 ` Xiaoyao Li
2020-03-03 4:12 ` Sean Christopherson
2020-03-03 4:30 ` Xiaoyao Li
2020-03-03 2:50 ` Xiaoyao Li
2020-03-03 4:08 ` Sean Christopherson
2020-03-03 4:16 ` Xiaoyao Li
2020-03-02 19:57 ` [PATCH 2/6] KVM: x86: Fix CPUID range check for Centaur and Hypervisor ranges Sean Christopherson
2020-03-02 21:59 ` Jim Mattson
2020-03-03 0:57 ` Sean Christopherson
2020-03-03 3:25 ` Jim Mattson
2020-03-03 4:25 ` Jim Mattson
2020-03-03 4:58 ` Sean Christopherson
2020-03-03 17:42 ` Jim Mattson
2020-03-03 18:01 ` Sean Christopherson
2020-03-03 18:08 ` Jim Mattson
2020-03-04 11:18 ` Paolo Bonzini
2020-03-02 19:57 ` [PATCH 3/6] KVM: x86: Add dedicated emulator helper for grabbing CPUID.maxphyaddr Sean Christopherson
2020-03-03 8:48 ` Paolo Bonzini
2020-03-03 9:48 ` Jan Kiszka
2020-03-03 10:14 ` Paolo Bonzini
2020-03-04 20:47 ` Sean Christopherson
2020-03-03 16:28 ` Sean Christopherson
2020-03-03 17:21 ` Paolo Bonzini
2020-03-02 19:57 ` [PATCH 4/6] KVM: x86: Drop return value from kvm_cpuid() Sean Christopherson
2020-03-02 19:57 ` [PATCH 5/6] KVM: x86: Rename "found" variable in kvm_cpuid() to "exact_entry_exists" Sean Christopherson
2020-03-02 20:20 ` Jan Kiszka
2020-03-02 20:35 ` Sean Christopherson
2020-03-02 20:48 ` Jan Kiszka
2020-03-02 19:57 ` [PATCH 6/6] KVM: x86: Add requested index to the CPUID tracepoint Sean Christopherson
2020-03-07 9:48 ` Jan Kiszka
2020-03-10 4:00 ` Sean Christopherson [this message]
2020-03-03 8:48 ` [PATCH 0/6] KVM: x86: CPUID emulation and tracing fixes Paolo Bonzini
2020-03-03 16:38 ` Sean Christopherson
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=20200310040023.GF19235@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=jan.kiszka@web.de \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=xiaoyao.li@intel.com \
/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).