On 07/08/18 11:44, Jan Beulich wrote:
>>>> On 07.08.18 at 12:00, <[email protected]> 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.

I agree.

Each of the 4 initialisation functions could be static inlines, because
there is nothing complicated about them, and the static evaluation of
is_*_domain() would cause the properly unused ones to be omitted.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to