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

Re: [Xen-devel] [PATCH 5/7] xen: support RAM at addresses 0 and 4096



On 13/09/2013 04:20, "Ian Campbell" <Ian.Campbell@xxxxxxxxxx> wrote:

> Actually, if I don't make a mess of my arithmetic then I don't think
> this is needed, at least not for correctness.
> 
> page_to_zone() is still wrong for page 0, but that was true with the
> previous version too, hence the checks to avoid adding page 0 to any
> heap.
> 
> The difference is that it now ends up in zone 0 (Xen, bad) instead of
> zone -1 (even worse!). Even that could be solved with this extra hunk
> (which would mean we could drop all the checks in init_*_pages from
> below too):
> 
> @@ -268,7 +267,7 @@ unsigned long __init alloc_boot_pages(
>  
>  #define bits_to_zone(b) (((b) < (PAGE_SHIFT + 1)) ? 1 : ((b) - PAGE_SHIFT))
>  #define page_to_zone(pg) (is_xen_heap_page(pg) ? MEMZONE_XEN :  \
> -                          (fls(page_to_mfn(pg))))
> +                          (fls(page_to_mfn(pg)) ? : 1))
>  
>  typedef struct page_list_head
> heap_by_zone_and_order_t[NR_ZONES][MAX_ORDER+1];
>  static heap_by_zone_and_order_t *_heap[MAX_NUMNODES];
> 
> What do you think?

Yeah, looks good!

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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