On Mon, 01 Jul 2024 15:30:05 +0800, Binbin Wu wrote: > Intel Linear-address masking (LAM) [1], modifies the checking that is applied to > *64-bit* linear addresses, allowing software to use of the untranslated address > bits for metadata. > > The patch series add test cases for KVM LAM: > > Patch 1 moves struct invpcid_desc to header file for new test cases. > Patch 2 makes change to allow setting of CR3 LAM bits in vmlaunch tests. > Patch 3~5 add test cases for LAM supervisor mode and user mode, including: > - For supervisor mode > CR4.LAM_SUP toggle > Memory/MMIO access with tagged pointer > INVLPG > INVPCID > INVVPID (also used to cover VMX instruction VMExit path) > - For user mode > CR3 LAM bits toggle > Memory/MMIO access with tagged pointer > > [...] Applied to kvm-x86 next (and now pulled by Paolo), except for patch 1, as a previous commit from a different series moved the INVPCID helpers to common code. Note, I deliberately dropped the "packed" addition. The storage size may be implementation specific, but the layout is not. If the compiler does something bizarre, e.g. allocates 32 instead of 16 bytes for the union, INVPCID will still work correctly as the CPU won't be aware that the compiler reserved 16 extra bytes. [1/5] x86: Move struct invpcid_desc to processor.h (no commit info) [2/5] x86: Allow setting of CR3 LAM bits if LAM supported https://github.com/kvm-x86/kvm-unit-tests/commit/0a6b8b7d601a [3/5] x86: Add test case for LAM_SUP https://github.com/kvm-x86/kvm-unit-tests/commit/14520f8e9709 [4/5] x86: Add test cases for LAM_{U48,U57} https://github.com/kvm-x86/kvm-unit-tests/commit/0164d7595c85 [5/5] x86: Add test case for INVVPID with LAM https://github.com/kvm-x86/kvm-unit-tests/commit/a33a3ac8db56 -- https://github.com/kvm-x86/kvm-unit-tests/tree/next