mbox series

[0/2] KVM: x86: Fix dirty logging of emulated atomics

Message ID 20240215010004.1456078-1-seanjc@google.com (mailing list archive)
Headers show
Series KVM: x86: Fix dirty logging of emulated atomics | expand

Message

Sean Christopherson Feb. 15, 2024, 1 a.m. UTC
Fix a bug in KVM's emulator where the target page of an atomic write isn't
marked dirty, and enhance the dirty_log_test selftest to serve as
a regression test by conditionally doing forced emulation of guest writes.

Note, the selftest depends on several patches that are sitting in
`kvm-x86 pmu`, so I'll likely take the selftest through that branch (eww).

Sean Christopherson (2):
  KVM: x86: Mark target gfn of emulated atomic instruction as dirty
  KVM: selftests: Test forced instruction emulation in dirty log test
    (x86 only)

 arch/x86/kvm/x86.c                           | 10 ++++++
 tools/testing/selftests/kvm/dirty_log_test.c | 36 ++++++++++++++++++--
 2 files changed, 43 insertions(+), 3 deletions(-)


base-commit: 7455665a3521aa7b56245c0a2810f748adc5fdd4

Comments

Sean Christopherson Feb. 17, 2024, 1:02 a.m. UTC | #1
On Wed, 14 Feb 2024 17:00:02 -0800, Sean Christopherson wrote:
> Fix a bug in KVM's emulator where the target page of an atomic write isn't
> marked dirty, and enhance the dirty_log_test selftest to serve as
> a regression test by conditionally doing forced emulation of guest writes.
> 
> Note, the selftest depends on several patches that are sitting in
> `kvm-x86 pmu`, so I'll likely take the selftest through that branch (eww).
> 
> [...]

Applied the fix itself to kvm-x86 fixes, I'll follow up with a heftier version
of the selftest patch for 6.9.

[1/2] KVM: x86: Mark target gfn of emulated atomic instruction as dirty
      https://github.com/kvm-x86/linux/commit/910c57dfa4d1

--
https://github.com/kvm-x86/linux/tree/next