diff options
| author | 2026-09-03 17:24:09 -0700 | |
|---|---|---|
| committer | 2026-09-11 09:08:09 -0700 | |
| commit | be7875808fcdec9e76eaf611b8fd1f1cb5121939 (patch) | |
| tree | 8631421ca9695047e376379124d9bf32bdd3a42f /scripts/Makefile.thinlto | |
| parent | KVM: nVMX: Make VMPTRST return eVMCS GPA when it is used (diff) | |
KVM: selftests: Don't clobber RFLAGS in happy path of __KVM_ASM_SAFE()
Use a straight MOV instead of an XOR to zero R9 in the non-faulting path of
__KVM_ASM_SAFE() so as not to clobber RFLAGS. XOR generates smaller code,
but optimizing performance by minimizing the code footprint is just about
the last thing that KVM selftests care about.
The bug is relatively benign in the current code base, e.g. it marginally
degrades the coverage in the fastops test, but otherwise does no harm. But
the bug will become actively problematic if/when the "safe assembly" macros
are used for instructions that communicate results via RFLAGS, e.g. for VMX
instructions, which signal failure via RFLAGS.CF and RFLAGS.ZF.
Opportunistically use R9D instead of the full R9, as bits 63:32 of GPRs are
zeroed on writes to bit 31:0.
Reported-by: Sashiko Bot <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260818165258.2613603-5-vkuznets@redhat.com
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://patch.msgid.link/20260904002423.3154436-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
