lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 2 Mar 2020 12:35:10 -0800
From:   Sean Christopherson <sean.j.christopherson@...el.com>
To:     Jan Kiszka <jan.kiszka@...mens.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Xiaoyao Li <xiaoyao.li@...el.com>
Subject: Re: [PATCH 5/6] KVM: x86: Rename "found" variable in kvm_cpuid() to
 "exact_entry_exists"

On Mon, Mar 02, 2020 at 09:20:52PM +0100, Jan Kiszka wrote:
> On 02.03.20 20:57, Sean Christopherson wrote:
> >Rename "found" in kvm_cpuid() to "exact_entry_exists" to better convey
> >that the intent of the tracepoint's "found/not found" output is to trace
> >whether the output values are for the actual requested leaf or for some
> >other (likely unrelated) leaf that was found while processing entries to
> >emulate funky CPU behavior, e.g. the max basic leaf on Intel CPUs when
> >the requested CPUID leaf is out of range.
> >
> >Suggested-by: Jan Kiszka <jan.kiszka@...mens.com>
> >Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> >---
> >  arch/x86/kvm/cpuid.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> >diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> >index 869526930cf7..b0a4f3c17932 100644
> >--- a/arch/x86/kvm/cpuid.c
> >+++ b/arch/x86/kvm/cpuid.c
> >@@ -1002,10 +1002,10 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
> >  {
> >  	const u32 function = *eax, index = *ecx;
> >  	struct kvm_cpuid_entry2 *entry;
> >-	bool found;
> >+	bool exact_entry_exists;
> >  	entry = kvm_find_cpuid_entry(vcpu, function, index);
> >-	found = entry;
> >+	exact_entry_exists = !!entry;
> >  	/*
> >  	 * Intel CPUID semantics treats any query for an out-of-range
> >  	 * leaf as if the highest basic leaf (i.e. CPUID.0H:EAX) were
> >@@ -1047,7 +1047,7 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
> >  			}
> >  		}
> >  	}
> >-	trace_kvm_cpuid(function, *eax, *ebx, *ecx, *edx, found);
> >+	trace_kvm_cpuid(function, *eax, *ebx, *ecx, *edx, exact_entry_exists);
> 
> Actually, I think we also what to change output in the tracepoint.

Oh, I definitely want to change it, but AIUI it's ABI and shouldn't be
changed.  Paolo?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ