]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86: Open code read vs. write userspace MMIO exits in emulator_read_write()
authorSean Christopherson <seanjc@google.com>
Wed, 25 Feb 2026 01:20:40 +0000 (17:20 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 3 Mar 2026 00:02:52 +0000 (16:02 -0800)
commitcbbf8228c0716d8f96f354f378efd1cbadb428e0
treee3aa6741af8c0f5ce19345fc0552feeaded52275
parent523b6269f700373eba65ad8a0bfaac284a12c167
KVM: x86: Open code read vs. write userspace MMIO exits in emulator_read_write()

Open code the differences in read vs. write userspace MMIO exits instead
of burying three lines of code behind indirect callbacks, as splitting the
logic makes it extremely hard to track that KVM's handling of reads vs.
write is _significantly_ different.  Add a comment to explain why the
semantics are different, and how on earth an MMIO write ends up triggering
an exit to userspace.

No functional change intended.

Tested-by: Tom Lendacky <thomas.lendacky@gmail.com>
Tested-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Link: https://patch.msgid.link/20260225012049.920665-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c