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]
Message-ID: <87o740i6ic.fsf@redhat.com>
Date: Fri, 04 Oct 2024 11:04:11 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>, Sean Christopherson
 <seanjc@...gle.com>, Paolo Bonzini <pbonzini@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/11] KVM: selftests: Verify XCR0 can be "downgraded"
 and "upgraded"

Sean Christopherson <seanjc@...gle.com> writes:

> Now that KVM selftests enable all supported XCR0 features by default, add
> a testcase to the XCR0 vs. CPUID test to verify that the guest can disable
> everything except the legacy FPU in XCR0, and then re-enable the full
> feature set, which is kinda sorta what the test did before XCR0 was setup
> by default.
>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
>  tools/testing/selftests/kvm/x86_64/xcr0_cpuid_test.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/x86_64/xcr0_cpuid_test.c b/tools/testing/selftests/kvm/x86_64/xcr0_cpuid_test.c
> index a4aecdc77da5..c8a5c5e51661 100644
> --- a/tools/testing/selftests/kvm/x86_64/xcr0_cpuid_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/xcr0_cpuid_test.c
> @@ -79,6 +79,11 @@ static void guest_code(void)
>  	ASSERT_ALL_OR_NONE_XFEATURE(supported_xcr0,
>  				    XFEATURE_MASK_XTILE);
>  
> +	vector = xsetbv_safe(0, XFEATURE_MASK_FP);
> +	__GUEST_ASSERT(!vector,
> +		       "Expected success on XSETBV(FP), got vector '0x%x'",
> +		       vector);
> +
>  	vector = xsetbv_safe(0, supported_xcr0);
>  	__GUEST_ASSERT(!vector,
>  		       "Expected success on XSETBV(0x%lx), got vector '0x%x'",

Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>

-- 
Vitaly


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ