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:   Sat, 9 May 2020 10:09:00 +0800
From:   Xiaoyao Li <xiaoyao.li@...el.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
Subject: Re: [PATCH] KVM: x86: Restore update of required xstate size in
 guest's CPUID

On 5/9/2020 7:37 AM, Sean Christopherson wrote:
> Restore a guest CPUID update that was unintentional collateral damage
> when the per-vCPU guest_xstate_size field was removed.

It's really unintentional. None of us noticed it. :(

It's good that you catch it!

> Cc: Xiaoyao Li <xiaoyao.li@...el.com>
> Fixes: d87277414b851 ("kvm: x86: Cleanup vcpu->arch.guest_xstate_size")
> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> ---
> 
> There's nothing more thrilling than watching bisect home in on your own
> commits, only to land on someone else's on the very last step.
> 
>   arch/x86/kvm/cpuid.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 35845704cf57a..cd708b0b460a0 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -84,11 +84,13 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu)
>   				   kvm_read_cr4_bits(vcpu, X86_CR4_PKE));
>   
>   	best = kvm_find_cpuid_entry(vcpu, 0xD, 0);
> -	if (!best)
> +	if (!best) {
>   		vcpu->arch.guest_supported_xcr0 = 0;
> -	else
> +	} else {
>   		vcpu->arch.guest_supported_xcr0 =
>   			(best->eax | ((u64)best->edx << 32)) & supported_xcr0;
> +		best->ebx = xstate_required_size(vcpu->arch.xcr0, false);
> +	}
>   
>   	best = kvm_find_cpuid_entry(vcpu, 0xD, 1);
>   	if (best && (cpuid_entry_has(best, X86_FEATURE_XSAVES) ||
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ