On 25/04/17 14:52, Wei Liu wrote:
> This patch encapsulates the perdomain creation and destruction into
> helper functions and use them where appropriate.
>
> Since destroy_perdomain_mapping is idempotent, it is safe to call the
> destruction function multiple times.
>
> Signed-off-by: Wei Liu <wei.l...@citrix.com>
> ---
> Cc: Jan Beulich <jbeul...@suse.com>
> Cc: Andrew Cooper <andrew.coop...@citrix.com>
> ---
>  xen/arch/x86/domain.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> index 90e2b1f82a..1f76d034a7 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -387,6 +387,18 @@ int switch_compat(struct domain *d)
>      return rc;
>  }
>  
> +static int pv_create_gdt_ldt_l1tab(struct domain *d, struct vcpu *v)
> +{
> +    return create_perdomain_mapping(d, GDT_VIRT_START(v),
> +                                    1 << GDT_LDT_VCPU_SHIFT,
> +                                    d->arch.pv_domain.gdt_ldt_l1tab, NULL);
> +}
> +
> +static void pv_destroy_gdt_ldt_l1tab(struct domain *d, struct vcpu *v)
> +{
> +    destroy_perdomain_mapping(d, GDT_VIRT_START(v), 1 << GDT_LDT_VCPU_SHIFT);
> +}

What is the point of passing both d and v?  Isn't d always v->domain ?

Otherwise, LGTM.

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

Reply via email to