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

Re: [Xen-devel] [PATCH 2/5] x86/pv: map_ldt_shadow_page() cleanup



On Tue, Aug 29, 2017 at 12:19:13PM +0100, Andrew Cooper wrote:
> Switch the return value from int to bool, to match its semantics.  Switch its
> parameter from a frame offset to a byte offset (simplifying the sole caller)
> and allowing for an extra sanity check that the fault is within the LDT limit.
> 
> Drop the unnecessary gmfn and okay local variables, and correct the gva
> parameter to be named linear.  Rename l1e to gl1e, and simplify the
> construction of the new pte by simply taking (the now validated) gl1e and
> ensuring that _PAGE_RW is set.
> 
> Calculate the pte to updated outside of the spinlock, which halves the size of

be updated?

> the critical region.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>

with some nitpicking.

> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
>  xen/arch/x86/mm.c        | 42 +++++++++++++++++++++++-------------------
>  xen/arch/x86/traps.c     |  2 +-
>  xen/include/asm-x86/mm.h |  2 +-
>  3 files changed, 25 insertions(+), 21 deletions(-)
> 
> diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
> index 79780da..c41ed1b 100644
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -667,45 +667,49 @@ static int alloc_segdesc_page(struct page_info *page)
>  }
>  
>  
> -/* Map shadow page at offset @off. */
> -int map_ldt_shadow_page(unsigned int off)
> +/*
> + * Map a guests LDT page (at @offset bytes from the start of the LDT) into

guest's

> + * Xen's virtual range.  Returns true if the mapping changed, false 
> otherwise.

if the mapping is established / successful?

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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