>>> On 04.01.19 at 16:14, <roger....@citrix.com> wrote:
> There's no reason to use long to store the alignment, since the bigger

biggest?

> page size is 1GB, and the alignment is stored as a frame number.
> 
> Reported-by: Jan Beulich <jbeul...@suse.com>
> Signed-off-by: Roger Pau Monné <roger....@citrix.com>
> ---
> Cc: Jan Beulich <jbeul...@suse.com>
> Cc: Andrew Cooper <andrew.coop...@citrix.com>
> Cc: Wei Liu <wei.l...@citrix.com>
> ---
>  xen/arch/x86/hvm/dom0_build.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
> index 5ae3a32060..b696100043 100644
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c
> @@ -92,8 +92,7 @@ static int __init pvh_populate_memory_range(struct domain 
> *d,
>                                              unsigned long nr_pages)
>  {
>      struct {
> -        unsigned long align;
> -        unsigned int order;
> +        unsigned int align, order;
>      } static const __initconst orders[] = {
>          /* NB: must be sorted by decreasing size. */
>          { .align = PFN_DOWN(GB(1)), .order = PAGE_ORDER_1G },

That's not enough afaict, you also need to use 1UL in

            end = (start + nr_pages) & ~(orders[0].align - 1);

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to