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

Re: [Xen-devel] [PATCH v1 19/20] libxl/pvhv2: Include APIC page in MMIO hole for PVHv2 guests



On 07/07/2016 12:47 PM, Wei Liu wrote:
> On Tue, Jul 05, 2016 at 03:05:18PM -0400, Boris Ostrovsky wrote:
>>  
>> @@ -1006,10 +1009,21 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
>>          dom->target_pages = mem_size >> XC_PAGE_SHIFT;
>>      if (dom->mmio_size == 0 && device_model)
>>          dom->mmio_size = HVM_BELOW_4G_MMIO_LENGTH;
>> -    else if (dom->mmio_size == 0 && !device_model)
>> -        dom->mmio_size = GB(4) -
>> -                    ((X86_HVM_END_SPECIAL_REGION - X86_HVM_NR_SPECIAL_PAGES)
>> -                    << XC_PAGE_SHIFT);
>> +    else if (dom->mmio_size == 0 && !device_model) {
>> +#if defined(__i386__) || defined(__x86_64__)
>> +        if (libxl_defbool_val(info->u.hvm.apic)) {
>> +            /* Make sure LAPIC_BASE_ADDRESS is below special pages */
>> +            assert(((((X86_HVM_END_SPECIAL_REGION - 
>> X86_HVM_NR_SPECIAL_PAGES)
>> +                      << XC_PAGE_SHIFT) - LAPIC_BASE_ADDRESS)) >= 
>> XC_PAGE_SIZE);
>> +            dom->mmio_size = GB(4) - LAPIC_BASE_ADDRESS;
>> +        } else
>> +            dom->mmio_size = GB(4) -
>> +                ((X86_HVM_END_SPECIAL_REGION - X86_HVM_NR_SPECIAL_PAGES)
>> +                 << XC_PAGE_SHIFT);
>> +#else
>> +        assert(1);
> This looks a bit odd. Do you want to avoid "if {}" (nothing in braces)?
>
> If this branch doesn't nothing on ARM, maybe you can just do
>
>     #if defined(x86)
>      else if () {
>      }
>     #endif
>
> ?

Sure, I could do that. I was trying to flag a case on ARM when we show
up here without device model. Which (the flagging) we haven't done
before so perhaps it's not needed.

-boris

>       
>> +#endif
>> +    }
>>      lowmem_end = mem_size;
>>      highmem_end = 0;
>>      mmio_start = (1ull << 32) - dom->mmio_size;
>> -- 
>> 1.7.1
>>


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