grub-devel
[Top][All Lists]
Advanced

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

Re: [Xen-devel] [PATCH v4 13/19] xen: setup Xen specific data for PVH


From: Juergen Gross
Subject: Re: [Xen-devel] [PATCH v4 13/19] xen: setup Xen specific data for PVH
Date: Wed, 21 Nov 2018 10:07:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

On 15/11/2018 11:03, Roger Pau Monné wrote:
> On Fri, Nov 02, 2018 at 01:37:32PM +0100, Juergen Gross wrote:
>> Initialize the needed Xen specific data. This is:
>>
>> - the Xen start of day page containing the console and Xenstore ring
>>   page PFN and event channel
>> - the grant table
>> - the shared info page
>>
>> Write back the possibly modified memory map to the hypervisor in case
>> the guest is reading it from there again.
>>
>> Set the RSDP address for the guest from the start_info page passed
>> as boot parameter.
>>
>> Signed-off-by: Juergen Gross <address@hidden>
>> ---
>> V4: write back memory map to Xen (Roger Pau Monné)
>> ---
>>  grub-core/kern/i386/xen/pvh.c | 119 
>> ++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 119 insertions(+)
>>
>> diff --git a/grub-core/kern/i386/xen/pvh.c b/grub-core/kern/i386/xen/pvh.c
>> +static grub_uint64_t
>> +grub_xen_find_page (grub_uint64_t start)
>> +{
>> +  unsigned int i, j;
>> +  grub_uint64_t last = start;
>> +
>> +  /* Try to find a e820 map hole below 4G. */
>> +  for (i = 0; i < nr_map_entries; i++)
>> +    {
>> +      if (last > map[i].addr + map[i].len)
>> +    continue;
>> +      if (last < map[i].addr)
> 
> Shouldn't this be last + PAGE_SIZE <= map[i].addr?
> 
> grub_xen_sort_mmap already aligns memory map entries to page
> boundaries, so the result will be correct as long as 'start' is also
> page aligned.

Correct, page alignment is a requirement (which is met currently).
I'll add a comment to point that out.


Juergen




reply via email to

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