Skip to content

Rework secure memslot dropping

Ram Pai kvm-ppc linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 1 replyIn review

Changes in v2 from the cover letter

- Rebase on top of Ram's V4 series
- Address Bharata's comment to use mmap_read_*lock().

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: PPC: Book3S HV: move kvmppc_svm_page_out uparch/powerpc/kvm/book3s_hv_uvmem.c+90 -760 replies
2/2KVM: PPC: Book3S HV: rework secure mem slot droppingarch/powerpc/kvm/book3s_hv_uvmem.c+35 -170 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchBharata B Rao
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] Rework secure memslot dropping

From: Laurent Dufour <[email protected]>

When doing memory hotplug on a secure VM, the secure pages are not well cleaned from the secure device when dropping the memslot. This silent error, is then preventing the SVM to reboot properly after the following sequence of commands are run in the Qemu monitor:

device_add pc-dimm,id=dimm1,memdev=mem1
device_del dimm1
device_add pc-dimm,id=dimm1,memdev=mem1

At reboot time, when the kernel is booting again and switching to the secure mode, the page_in is failing for the pages in the memslot because the cleanup was not done properly, because the memslot is flagged as invalid during the hot unplug and thus the page fault mechanism is not triggered.

To prevent that during the memslot dropping, instead of belonging on the page fault mechanism to trigger the page out of the secured pages, it seems simpler to directly call the function doing the page out. This way the state of the memslot is not interfering on the page out process.

This series applies on top of the Ram's one titled:
"[v6 0/5] Migrate non-migrated pages of a SVM."

Changes since V2:
- fix to vma boundary check in kvmppc_uvmem_drop_pages().

Changes since V1:
- Rebase on top of Ram's V4 series
- Address Bharata's comment to use mmap_read_*lock().

Laurent Dufour (2):
KVM: PPC: Book3S HV: move kvmppc_svm_page_out up
KVM: PPC: Book3S HV: rework secure mem slot dropping

 arch/powerpc/kvm/book3s_hv_uvmem.c | 218 +++++++++++++++++++++----------------
 1 file changed, 125 insertions(+), 93 deletions(-)
Signature · 1 line
1.8.3.1