Hi Michal,

> -----Original Message-----
> From: Michal Orzel <michal.or...@amd.com>
> Subject: Re: [PATCH] xen/arm64: Fix incorrect DIRECTMAP_SIZE calculation
> 
> Hi Henry,
> 
> >> -#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (265-256))
> >> +#define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (266 - 256))
> >
> > From the commit message "L0 slots from 256 to 265 (i.e. 10 slots)", I think
> > the actual range is [256, 265] so probably using "(265 - 256 + 1)" here is a
> > bit better? It seems to me that the number 266 looks like a magic number
> > because 266 is not in the range. But this is my personal taste though and I
> > am open to discussion if you or maintainers have other opinions.
>
> I think this is a matter of taste.

Yes indeed, so I wouldn't argue for your explanation...

> I prefer it the way it is because at least it matches
> how x86 defines the DIRECTMAP_SIZE and it also matches the usual way of
> calculating the size
> which is subtracting the start address of that region from the start address 
> of
> the next region
> (e.g. VMAP_VIRT_SIZE calculation on arm32).

...here and you can have my:

Reviewed-by: Henry Wang <henry.w...@arm.com>

> 
> >
> > Maybe we can also putting a comment on top of the macro to explain this
> > calculation.
> >
> > I did test this patch on FVP using XTP in both arm32 and arm64 execution
> > mode, and this patch is good, so:
> >
> > Tested-by: Henry Wang <henry.w...@arm.com>
> Thanks.

Pleasure.

Kind regards,
Henry

> 
> >
> > Kind regards,
> > Henry
> 
> ~Michal

Reply via email to