Re: [PATCH v5 10/17] KVM: Implement KVM_CAP_USERFAULT_ON_MISSING by atomizing __gfn_to_pfn_memslot() calls

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

 



On Wed, Oct 4, 2023 at 6:44 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> Eh, the shortlog basically says "do work" with a lot of fancy words.  It really
> just boils down to:
>
>   KVM: Let callers of __gfn_to_pfn_memslot() opt-out of USERFAULT_ON_MISSING

Proposed commit message for v6:

> KVM: Implement KVM_CAP EXIT_ON_MISSING by checking memslot flag in __gfn_to_pfn_memslot()
>
> When the slot flag is enabled, forbid __gfn_to_pfn_memslot() from
> faulting in pages for which mappings are absent. However, some callers of
> __gfn_to_pfn_memslot() (such as kvm_vcpu_map()) must be able to opt out
> of this behavior: allow doing so via the new can_exit_on_missing
> parameter.

Although separately, I don't think the parameter should be named
can_exit_on_missing (or, as you suggested, can_do_userfault)-
__gfn_to_pfn_memslot() shouldn't know or care how its callers are
setting up KVM exits, after all.

I think it makes sense to rename the new parameter and, for the same
reasoning, the memslot flag to "forbid_fault_on_missing" and
KVM_MEM_FORBID_FAULT_ON_MISSING respectively. Objections?





[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