Re: [PATCH 1/1 v2] KVM: MMU: Use ptep_user for cmpxchg_gpte()

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

 



> > >  >gfn_to_page is the interface for mapping guest pages inside KVM,
> > >  >and you're bypassing it for IMO no good reason (i doubt there's any
> > >  >performance improvement by skipping the translation).
> > >
> > >  He isn't skipping it - he's using gfn_to_hva() to derive ptep_user,
> > >  which is equivalent.
> >
> > Well, he is removing the second translation. So that is skipped.
> 
> hva->gpa translation is not supposed to be changed by kvm.
> 
> > >  The motivation isn't performance, it's to ensure that cmpxchg_gpte()
> > >  operates on the same address as we read it from.
> >
> > OK, my objection is direct get_user_pages_fast usage. Please pass gfn to
> > gfn_to_page.
> 
> We do get_user() in read_gpte().  That is equivalent to 
> get_user_pages().  So we already broke that layer of abstraction.

At first, I broke hva_to_pfn() into two functions:
  hva_to_page
  hva_to_pfn
and used the former to get the page.

But after making that patch, I thought it might be a bit extra to do such
things in the function which is doing low level page manipulations like
kmapping.

Actually, we are already assuming that the page returned by gfn_to_page is
always a usual page which contains gptes without extra checks.

Which way do you like the best?

Takuya
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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