Re: [PATCH v4 09/16] KVM: Introduce KVM_CAP_NOWAIT_ON_FAULT without implementation

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

 



On Wed, Jun 14, 2023 at 2:23 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> Gah, got turned around and forgot to account for @atomic.  So this?
>
>         if (!atomic && memslot_is_nowait_on_fault(slot)) {
>                 atomic = true;
>                 if (async) {
>                         *async = false;
>                         async = NULL;
>                 }
>         }
>
> > +
> >         return hva_to_pfn(addr, atomic, interruptible, async, write_fault,
> >                           writable);
> >  }

Makes sense to me, although I think the documentation for hva_to_pfn(),
where those async/atomic parameters eventually feed into, is slightly
off

> /*
>  * Pin guest page in memory and return its pfn.
> * @addr: host virtual address which maps memory to the guest
> * @atomic: whether this function can sleep
> ...
> */
> kvm_pfn_t hva_to_pfn(unsigned long addr, bool atomic, bool interruptible,
 >     bool *async, bool write_fault, bool *writable)

I initially read this as "atomic == true if function can sleep," but I
think it actually means to say "atomic == true if function can *not*
sleep". So I'll add a patch to change the line to

> @atomic: whether this function is disallowed from sleeping

I'm pretty sure I have things straight: if I don't though, then we
can't upgrade the __gfn_to_pfn_memslot() calls to "atomic=true" like
you suggested above.




[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