grub-devel
[Top][All Lists]
Advanced

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

Re: [Xen-devel] [PATCH v4 11/19] xen: get memory map from hypervisor for


From: Juergen Gross
Subject: Re: [Xen-devel] [PATCH v4 11/19] xen: get memory map from hypervisor for PVH
Date: Wed, 21 Nov 2018 09:52:04 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

On 15/11/2018 10:36, Roger Pau Monné wrote:
> On Fri, Nov 02, 2018 at 01:37:30PM +0100, Juergen Gross wrote:
>> Retrieve the memory map from the hypervisor and normalize it to contain
>> no overlapping entries and to be sorted by address.
>>
>> Signed-off-by: Juergen Gross <address@hidden>
>> ---
>> V3: use grub_e820_mmap_entry instead of own struct (Daniel Kiper)
>> ---
>>  grub-core/kern/i386/xen/pvh.c | 96 
>> ++++++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 95 insertions(+), 1 deletion(-)
>>
>> diff --git a/grub-core/kern/i386/xen/pvh.c b/grub-core/kern/i386/xen/pvh.c
>> index 7e90a4538..58e6fefd5 100644
>> --- a/grub-core/kern/i386/xen/pvh.c
>> +++ b/grub-core/kern/i386/xen/pvh.c
>> @@ -23,9 +23,14 @@
>>  #include <grub/i386/cpuid.h>
>>  #include <grub/i386/io.h>
>>  #include <grub/xen.h>
>> +#include <grub/i386/linux.h>
>>  #include <grub/machine/kernel.h>
>> +#include <grub/machine/memory.h>
>> +#include <xen/memory.h>
>>  
>> -#define XEN_CONSOLE_PORT   0xe9
>> +#define XEN_CONSOLE_PORT      0xe9
>> +
>> +#define XEN_MEMORY_MAP_SIZE   128
>>  
>>  grub_uint64_t grub_rsdp_addr;
>>  
>> @@ -33,6 +38,8 @@ static char hypercall_page[GRUB_XEN_PAGE_SIZE]
>>    __attribute__ ((aligned (GRUB_XEN_PAGE_SIZE)));
>>  
>>  static grub_uint32_t xen_cpuid_base;
>> +static struct grub_e820_mmap_entry map[XEN_MEMORY_MAP_SIZE];
>> +static unsigned int nr_map_entries;
>>  
>>  static void
>>  grub_xen_panic (const char *msg)
>> @@ -92,11 +99,98 @@ grub_xen_hypercall (grub_uint32_t callno, grub_uint32_t 
>> a0,
>>    return __res;
>>  }
>>  
>> +static void
>> +grub_xen_sort_mmap (void)
> 
> There's nothing Xen-specific about this function, shouldn't it reside
> in some x86 related file?

As long as there is no other potential user of it I don't think so. Why
should we bloat up grub for other machine types without a need?


Juergen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]