<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/kvm/include/x86_64/processor.h, branch v6.7</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.7</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-10-12T15:08:59+00:00</updated>
<entry>
<title>KVM: selftests: Force load all supported XSAVE state in state test</title>
<updated>2023-10-12T15:08:59+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2023-09-28T00:19:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=87e3ca055cdc6c63fb82b9bec7c370405d03f6ef'/>
<id>urn:sha1:87e3ca055cdc6c63fb82b9bec7c370405d03f6ef</id>
<content type='text'>
Extend x86's state to forcefully load *all* host-supported xfeatures by
modifying xstate_bv in the saved state.  Stuffing xstate_bv ensures that
the selftest is verifying KVM's full ABI regardless of whether or not the
guest code is successful in getting various xfeatures out of their INIT
state, e.g. see the disaster that is/was MPX.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Message-Id: &lt;20230928001956.924301-6-seanjc@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Touch relevant XSAVE state in guest for state test</title>
<updated>2023-10-12T15:08:58+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2023-09-28T00:19:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=60d351f18f7a8acd08964ef1d5c948354a7907be'/>
<id>urn:sha1:60d351f18f7a8acd08964ef1d5c948354a7907be</id>
<content type='text'>
Modify support XSAVE state in the "state test's" guest code so that saving
and loading state via KVM_{G,S}ET_XSAVE actually does something useful,
i.e. so that xstate_bv in XSAVE state isn't empty.

Punt on BNDCSR for now, it's easier to just stuff that xfeature from the
host side.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Message-Id: &lt;20230928001956.924301-4-seanjc@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Add x86 properties for Intel PMU in processor.h</title>
<updated>2023-08-17T19:58:49+00:00</updated>
<author>
<name>Jinrong Liang</name>
<email>cloudliang@tencent.com</email>
</author>
<published>2023-08-10T09:09:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf6d80c0eb95900e19e1ad54c686a1877dda4276'/>
<id>urn:sha1:cf6d80c0eb95900e19e1ad54c686a1877dda4276</id>
<content type='text'>
Add x86 properties for Intel PMU so that tests don't have to manually
retrieve the correct CPUID leaf+register, and so that the resulting code
is self-documenting.

Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Jinrong Liang &lt;cloudliang@tencent.com&gt;
Link: https://lore.kernel.org/r/20230810090945.16053-2-cloudliang@tencent.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvm-x86-selftests-6.4' of https://github.com/kvm-x86/linux into HEAD</title>
<updated>2023-04-26T19:56:01+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2023-04-26T19:54:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c21775ae021f8d28bb1b8ab857b7342e0f8b180d'/>
<id>urn:sha1:c21775ae021f8d28bb1b8ab857b7342e0f8b180d</id>
<content type='text'>
KVM selftests, and an AMX/XCR0 bugfix, for 6.4:

 - Don't advertise XTILE_CFG in KVM_GET_SUPPORTED_CPUID if XTILE_DATA is
   not being reported due to userspace not opting in via prctl()

 - Overhaul the AMX selftests to improve coverage and cleanup the test

 - Misc cleanups
</content>
</entry>
<entry>
<title>KVM: selftests: Add test to verify KVM's supported XCR0</title>
<updated>2023-04-11T17:19:04+00:00</updated>
<author>
<name>Aaron Lewis</name>
<email>aaronlewis@google.com</email>
</author>
<published>2023-04-05T00:45:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03a405b7a522700a654b79903312d0a305bdce0d'/>
<id>urn:sha1:03a405b7a522700a654b79903312d0a305bdce0d</id>
<content type='text'>
Check both architectural rules and KVM's ABI for KVM_GET_SUPPORTED_CPUID
to ensure the supported xfeatures[1] don't violate any of them.

The architectural rules[2] and KVM's contract with userspace ensure for a
given feature, e.g. sse, avx, amx, etc... their associated xfeatures are
either all sets or none of them are set, and any dependencies are enabled
if needed.

[1] EDX:EAX of CPUID.(EAX=0DH,ECX=0)
[2] SDM vol 1, 13.3 ENABLING THE XSAVE FEATURE SET AND XSAVE-ENABLED
    FEATURES

Cc: Mingwei Zhang &lt;mizhang@google.com&gt;
Signed-off-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
[sean: expand comments, use a fancy X86_PROPERTY]
Reviewed-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Tested-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Link: https://lore.kernel.org/r/20230405004520.421768-7-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Add all known XFEATURE masks to common code</title>
<updated>2023-04-11T17:19:03+00:00</updated>
<author>
<name>Aaron Lewis</name>
<email>aaronlewis@google.com</email>
</author>
<published>2023-04-05T00:45:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28f2302584af8ed60e2108bf40762a5c40ecb372'/>
<id>urn:sha1:28f2302584af8ed60e2108bf40762a5c40ecb372</id>
<content type='text'>
Add all known XFEATURE masks to processor.h to make them more broadly
available in KVM selftests.  Relocate and clean up the exiting AMX (XTILE)
defines in processor.h, e.g. drop the intermediate define and use BIT_ULL.

Signed-off-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Reviewed-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Tested-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Link: https://lore.kernel.org/r/20230405004520.421768-6-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Rework dynamic XFeature helper to take mask, not bit</title>
<updated>2023-04-11T17:19:03+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2023-04-05T00:45:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7040e54fddf681758800d7375e728557213366f9'/>
<id>urn:sha1:7040e54fddf681758800d7375e728557213366f9</id>
<content type='text'>
Take the XFeature mask in __vm_xsave_require_permission() instead of the
bit so that there's no need to define macros for both the bit and the
mask.  Asserting that only a single bit is set and retrieving said bit
is easy enough via log2 helpers.

Opportunistically clean up the error message for the
ARCH_REQ_XCOMP_GUEST_PERM sanity check.

Reviewed-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Tested-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Link: https://lore.kernel.org/r/20230405004520.421768-5-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Move XGETBV and XSETBV helpers to common code</title>
<updated>2023-04-11T17:19:03+00:00</updated>
<author>
<name>Aaron Lewis</name>
<email>aaronlewis@google.com</email>
</author>
<published>2023-04-05T00:45:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b213812d3f4c29502d46f82e40a82cf959670e58'/>
<id>urn:sha1:b213812d3f4c29502d46f82e40a82cf959670e58</id>
<content type='text'>
The instructions XGETBV and XSETBV are useful to other tests.  Move
them to processor.h to make them more broadly available.

No functional change intended.

Reviewed-by: Jim Mattson &lt;jmattson@google.com&gt;
Signed-off-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Reviewed-by: Mingwei Zhang &lt;mizhang@google.com&gt;
[sean: reword shortlog]
Reviewed-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Tested-by: Aaron Lewis &lt;aaronlewis@google.com&gt;
Link: https://lore.kernel.org/r/20230405004520.421768-4-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Verify KVM preserves userspace writes to "durable" MSRs</title>
<updated>2023-04-06T21:58:44+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2023-03-11T00:46:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f138258565d18f0f9a8d07f04162c68eee997ce6'/>
<id>urn:sha1:f138258565d18f0f9a8d07f04162c68eee997ce6</id>
<content type='text'>
Assert that KVM provides "read what you wrote" semantics for all "durable"
MSRs (for lack of a better name).  The extra coverage is cheap from a
runtime performance perspective, and verifying the behavior in the common
helper avoids gratuitous copy+paste in individual tests.

Note, this affects all tests that set MSRs from userspace!

Link: https://lore.kernel.org/r/20230311004618.920745-13-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Print out failing MSR and value in vcpu_set_msr()</title>
<updated>2023-04-06T21:58:43+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2023-03-11T00:46:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=22234c2495eafd6b8f1f26c6c6adc12aca60fd7f'/>
<id>urn:sha1:22234c2495eafd6b8f1f26c6c6adc12aca60fd7f</id>
<content type='text'>
Reimplement vcpu_set_msr() as a macro and pretty print the failing MSR
(when possible) and the value if KVM_SET_MSRS fails instead of using the
using the standard KVM_IOCTL_ERROR().  KVM_SET_MSRS is somewhat odd in
that it returns the index of the last successful write, i.e. will be
'0' on failure barring an entirely different KVM bug.  And for writing
MSRs, the MSR being written and the value being written are almost always
relevant to the failure, i.e. just saying "failed!" doesn't help debug.

Place the string goo in a separate macro in anticipation of using it to
further expand MSR testing.

Link: https://lore.kernel.org/r/20230311004618.920745-12-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
</feed>
