Re: [RFC] use realmode code to reserve end-of-conventional-memory to 1MB

H. Peter Anvin
2008-03-05T16:12:59Z

Eduardo Habkost wrote:
>>
>> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
>> index 3bad477..2341492 100644
>> --- a/arch/x86/xen/setup.c
>> +++ b/arch/x86/xen/setup.c
>> @@ -38,7 +38,8 @@ char * __init xen_memory_setup(void)
>> unsigned long max_pfn = xen_start_info->nr_pages;
>>
>> e820.nr_map = 0;
>> - add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
>> + add_memory_region(0, LOWMEMSIZE(), E820_RAM);
>> + add_memory_region(HIGH_MEMORY, PFN_PHYS(max_pfn)-HIGH_MEMORY, E820_RAM);
>
> Won't this waste 300+ KB of Perfectly Good RAM? Or I understood it
> incorrectly?
>
> I am aware that it would take more work to tell all kernel code that it
> shouldn't look for BIOS data on this region when running as a domU guest,
> but it seems that it would be a better solution.
>

No, the right thing is for Xen to not try to map RAM in this area.

-hpa