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

Re: [Xen-devel] [PATCH] xen/arm: skip first page when RAM starts at 0x0

>>> On 02.05.19 at 00:44, <sstabellini@xxxxxxxxxx> wrote:
> Hi Jan, I have a question on the PDX code.
> The PDX initialization is a bit different between x86 and ARM, but it
> follows roughly the same pattern, look at
> xen/arch/x86/srat.c:srat_parse_regions (I take that is where things
> happen on x86) and xen/arch/arm/setup.c:init_pdx.
> Mask is initialized calling pdx_init_mask on a start address, then a
> loop fills in the rest of the mask calling pdx_region_mask, based on the
> memory regions present.
> I wrote a small unit test of the ARM PDX initialization and while I was
> playing with addresses and values I noticed that actually if I simply
> skip pdx_init_mask and just initialize the mask to 0 (mask = 0) in
> init_pdx, the rest of the function always calculates the right mask.
> In fact, there are cases where initializing the mask to a value causes
> the rest of the code to miss some potential compressions. While
> initializing the mask to 0 leads to more optimizations. I can provide
> specific examples if you are curious.
> Before I make any changes to that code, I would like to understand a bit
> better why things are done that way today. Do you know why the mask is
> initialized to pdx_init_mask(start-of-ram)?

I'm confused, and hence I'm perhaps misunderstanding your
question. To me it looks like you're re-asking a question already
answered. On x86 we don't want to squash out any of the low
32 bits, because of the special address ranges that live below
4Gb. Hence we invoke pdx_init_mask(first-block-at-or-above-4Gb).
Note it's not start-of-ram, as you've said.


Xen-devel mailing list



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