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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 2 Mar 2020 21:20:52 +0100
From:   Jan Kiszka <jan.kiszka@...mens.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Cc:     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 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.

Jan

>   }
>   EXPORT_SYMBOL_GPL(kvm_cpuid);
>   
> 

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ