Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] KVM: selftests: missing Fixes trailer for commit 676a863ce605 --
commit ec0caf7c95f47c5b258b6b71433582cb4674f3a4 Author: David Woodhouse <[email protected]> > KVM: selftests: Make the x86 SSE register helpers volatile > > read_sse_reg() and write_sse_reg() were borrowed from KVM's > _kvm_read_sse_reg() and _kvm_write_sse_reg(). The kernel is built > without SSE, so the compiler never uses the XMM registers itself and a > plain asm() is enough there. Selftest guest code is built with SSE, and > there the asm statements have to tell the compiler what they do. > > read_sse_reg() has an output and is not volatile, so the compiler may > treat it as a pure computation and move it, for example ahead of the > hypercall whose XMM output it is meant to read. write_sse_reg() has no > outputs and is therefore implicitly volatile, but it doesn't declare the > register it overwrites, so a value the compiler was keeping there does > not survive. > > Mark both volatile, and declare the register each write_sse_reg() case > writes as clobbered. A read_sse_reg() after __hyperv_hypercall() now > stays after it. > > That still leaves the compiler free to use an XMM register for its own > code between a write_sse_reg() and the asm which consumes it. > hyperv_write_xmm_input() in the hyperv_ipi and hyperv_tlb_flush tests > relies on that not happening; GCC 11.5 at -O2 emits nothing there. > Closing that window entirely would mean passing the XMM values as > operands of the hypercall asm itself. > > Reported-by: Sashiko <[email protected]> > Closes: https://lore.kernel.org/all/[email protected]/ > Signed-off-by: David Woodhouse <[email protected]> [Severity: Low] Since this fixes read_sse_reg() and write_sse_reg(), should it include: Fixes: 676a863ce605 ("KVM: selftests: Better XMM read/write helpers") -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1
