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

Re: [Xen-devel] [PATCH v3] x86/altp2m: cleanup p2m_altp2m_lazy_copy



>>> On 28.05.19 at 12:28, <george.dunlap@xxxxxxxxxx> wrote:
> From: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
> 
> The p2m_altp2m_lazy_copy is responsible for lazily populating an
> altp2m view when the guest traps out due to no EPT entry being present
> in the active view.  Currently, in addition to taking a number of
> unused argements, the whole calling convention has a number of
> redundant p2m lookups: the function reads the hostp2m, even though the
> caller has just read the same hostp2m entry; and then the caller
> re-reads the altp2m entry that the function has just read (and possibly set).
> 
> Rework this function to make it a bit more rational.  Specifically:
> 
> - Pass the current hostp2m entry values we have just read for it to
>   use to populate the altp2m entry if it finds the entry empty.
> 
> - If the altp2m entry is not empty, pass out the values we've read so
>   the caller doesn't need to re-walk the tables
> 
> - Either way, return with the gfn 'locked', to make clean-up handling
>   more consistent.
> 
> Rename the function to better reflect this functionality.
> 
> While we're here, change bool_t to bool, and return true/false rather
> than 1/0.
> 
> It's a bit grating to do both the p2m_lock() and the get_gfn(),
> knowing that they boil down to the same thing at the moment; but we
> have to maintain the fiction until such time as we decide to get rid
> of it entirely.
> 
> Signed-off-by: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>

FWIW
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.