Skip to content

Fix some mmu/emulator atomicity issues

Avi Kivity kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: MMU: Consolidate two guest pte reads in kvm_mmu_pte_write()arch/x86/kvm/mmu.c+31 -380 replies
2/4KVM: Make locked operations truly atomicarch/x86/kvm/x86.c+48 -210 replies
3/4KVM: Don't follow an atmoic operation by a non-atomic onearch/x86/kvm/x86.c+25 -70 replies
4/4KVM: MMU: Reinstate pte prefetch on invlpgarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+39 -141 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Fix some mmu/emulator atomicity issues

Currently when we emulate a locked operation into a shadowed guest page table, we perform a write rather than a true atomic. This is indicated by the "emulating exchange as write" message that shows up in dmesg.

In addition, the pte prefetch operation during invlpg suffered from a race. This was fixed by removing the operation.

This patchset fixes both issues and reinstates pte prefetch on invlpg.

Avi Kivity (4):
KVM: MMU: Consolidate two guest pte reads in kvm_mmu_pte_write()
KVM: Make locked operations truly atomic
KVM: Don't follow an atmoic operation by a non-atomic one
KVM: MMU: Reinstate pte prefetch on invlpg

 arch/x86/include/asm/kvm_host.h |    1 +
 arch/x86/kvm/mmu.c              |   78 +++++++++++++++---------------
 arch/x86/kvm/paging_tmpl.h      |   15 ++++++
 arch/x86/kvm/x86.c              |  101 ++++++++++++++++++++++++++++-----------
 4 files changed, 129 insertions(+), 66 deletions(-)