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

Re: [Xen-devel] [PATCH 3/9] x86: enclose hypercall page initialisation code in CONFIG_{HVM, PV}



>>> On 07.08.18 at 12:00, <wei.liu2@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/x86_64/traps.c
> +++ b/xen/arch/x86/x86_64/traps.c
> @@ -352,12 +352,19 @@ void subarch_percpu_traps_init(void)
>  void hypercall_page_initialise(struct domain *d, void *hypercall_page)
>  {
>      memset(hypercall_page, 0xCC, PAGE_SIZE);
> +#if CONFIG_HVM
>      if ( is_hvm_domain(d) )
>          hvm_hypercall_page_initialise(d, hypercall_page);
> -    else if ( !is_pv_32bit_domain(d) )
> -        hypercall_page_initialise_ring3_kernel(hypercall_page);
> -    else
> -        hypercall_page_initialise_ring1_kernel(hypercall_page);
> +#endif
> +#if CONFIG_PV
> +    if ( is_pv_domain(d) )
> +    {
> +        if ( !is_pv_32bit_domain(d) )
> +            hypercall_page_initialise_ring3_kernel(hypercall_page);
> +        else
> +            hypercall_page_initialise_ring1_kernel(hypercall_page);
> +    }
> +#endif
>  }

I'm not convinced: This is uglier to read, and things like is_hvm_domain()
should evaluate to constant false anyway without the respective
CONFIG_* setting enabled.

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®.