Re: [PATCH 7/7] KVM: arm/arm64: Elide CMOs when unmapping a range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi James,

On 2019-12-18 15:07, James Morse wrote:
Hi Marc,

On 13/12/2019 18:25, Marc Zyngier wrote:
If userspace issues a munmap() on a set of pages, there is no
expectation that the pages are cleaned to the PoC.

(Pedantry: Clean and invalidate. If the guest wrote through a device
mapping, we ditch any clean+stale lines with this path, meaning swapout
saves the correct values)

Indeed.

So let's
not do more work than strictly necessary, and set the magic
flag that avoids CMOs in this case.

I think this assumes the pages went from anonymous->free, so no-one
cares about the contents.

If the pages are backed by a file, won't dirty pages will still get
written back before the page is free? (e.g. EFI flash 'file' mmap()ed in)

I believe so. Is that a problem?

What if this isn't the only mapping of the page? Can't it be swapped
out from another VMA? (tenuous example, poor man's memory mirroring?)

Swap-out wouldn't trigger this code path, as it would use a different
MMU notifier event (MMU_NOTIFY_CLEAR vs MMU_NOTIFY_UNMAP), I believe.

Thanks,

        M.
--
Jazz is not dead. It just smells funny...



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux