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

Re: [PATCH 15/17] hvmloader: Set MCFG in ACPI table



On 4/29/26 14:33, Roger Pau Monné wrote:
> On Fri, Mar 13, 2026 at 04:35:05PM +0000, Thierry Escande wrote:
>> This patch extends hvmloader_acpi_build_tables() to detect if MMCONFIG
>> is available by obtaining its base address and size from the hypercall
>> HVMOP_get_ecam_space and sets the flag ACPI_HAS_MCFG in the ACPI config
>> if needed.
>>
>> This also sets the MMCONFIG area in E820 map using the same method.
>>
>> Signed-off-by: Thierry Escande <thierry.escande@xxxxxxxxxx>
>> ---
>>  tools/firmware/hvmloader/e820.c | 11 +++++++++++
>>  tools/firmware/hvmloader/util.c |  9 +++++++++
>>  2 files changed, 20 insertions(+)
>>
>> diff --git a/tools/firmware/hvmloader/e820.c 
>> b/tools/firmware/hvmloader/e820.c
>> index 86d39544e8..ff5c270f57 100644
>> --- a/tools/firmware/hvmloader/e820.c
>> +++ b/tools/firmware/hvmloader/e820.c
>> @@ -158,6 +158,8 @@ int build_e820_table(struct e820entry *e820,
>>      unsigned long acpi_mem_end = acpi_enabled ?
>>          ACPI_MEMORY_DYNAMIC_START + (acpi_pages_allocated() << PAGE_SHIFT) :
>>          RESERVED_MEMBASE;
>> +    uint64_t mmconfig_addr;
>> +    uint32_t mmconfig_size;
>>  
>>      if ( !lowmem_reserved_base )
>>              lowmem_reserved_base = 0xA0000;
>> @@ -260,6 +262,15 @@ int build_e820_table(struct e820entry *e820,
>>          nr++;
>>      }
>>  
>> +    /* mark MMCONFIG area */
>> +    if ( ! hvm_get_ecam_space(&mmconfig_addr, &mmconfig_size) )
>              ^ extra space
> 
> However, having to query the hypervisor for something that has been
> set by hvmloader itself seems very inefficient.  Just store the values
> in global variables so they can be consumed from here?

Indeed. And that would remove the need for the hvm_get_ecam_space() helper.

Regards,


--
Thierry Escande | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

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