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

Re: [PATCH 03/10] mini-os: don't assume contiguous RAM when initializing in PVH mode



Juergen Gross, le lun. 06 déc. 2021 08:23:30 +0100, a ecrit:
> -    unsigned long pfn, max = 0;
> +    unsigned long pfns, max = 0;

I'd say rather rename max to start.

>      e820_get_memmap();
>  
> @@ -166,9 +166,12 @@ unsigned long e820_get_maxpfn(void)
>      {
>          if ( e820_map[i].type != E820_RAM )
>              continue;
> -        pfn = (e820_map[i].addr + e820_map[i].size) >> PAGE_SHIFT;
> -        if ( pfn > max )
> -            max = pfn;
> +        pfns = e820_map[i].size >> PAGE_SHIFT;
> +        max = e820_map[i].addr >> PAGE_SHIFT;

since it's it's always the start of the e820 entry.

> +        if ( pages <= pfns )
> +            return max + pages;
> +        pages -= pfns;
> +        max += pfns;

Here we don't need do change max, only pages.

Samuel



 


Rackspace

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