Re: [PATCH v8 08/13] KVM: guest_memfd: Allow host to map guest_memfd() pages

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

 



On Sun, 2025-05-11 at 09:03 +0100, David Hildenbrand wrote:
>>>                return -ENODEV;
>>> +
>>> +       if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) !=
>>> +           (VM_SHARED | VM_MAYSHARE)) {
>>> +               return -EINVAL;
>>> +       }
>>> +
>>> +       vm_flags_set(vma, VM_DONTDUMP);
>>
>> Hi Fuad,
>>
>> Sorry if I missed this, but why exactly do we set VM_DONTDUMP here?
>> Could you leave a small comment? (I see that it seems to have
>> originally come from Patrick? [1]) I get that guest memory VMAs
>> generally should have VM_DONTDUMP; is there a bigger reason?

Iirc, I essentially copied my mmap handler from secretmem for that RFC. But
even for direct map removal, it seems this is not needed, because get_dump_page
goes via GUP, which errors out for direct map removed VMAs. So what David is
saying below also applies in that case.
 
> (David replying)
> 
> I assume because we might have inaccessible parts in there that SIGBUS
> on access.
> 
> get_dump_page() does ignore any errors, though (returning NULL), so
> likely we don't need VM_DONTDUMP.
> 
> -- 
> Cheers,
> 
> David / dhildenb

Best,
Patrick





[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