debuggers.hg

changeset 20937:91358472d8c4

x86: fix frame table initialization when hotplug memory regions were detected

max_idx is not a pdx, and hence needs to be converted to one in all
cases where it is being passed to pdx_to_page().

Also, just like for max_pdx, the conversion result of max_idx may
point into an address space hole, and hence it must not be used
directly as an argument to pdx_to_page(). Note that this doesn't apply
to the arguments passed to memset(), as the size argument would be
zero in the case of hitting an address space hole.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 04 08:53:16 2010 +0000 (2010-02-04)
parents 0c3e4a2f14d6
children d311d1efc25e
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Feb 03 09:46:38 2010 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Thu Feb 04 08:53:16 2010 +0000
     1.3 @@ -225,10 +225,11 @@ void __init init_frametable(void)
     1.4                                pdx_to_page(max_pdx - 1) + 1);
     1.5      else
     1.6      {
     1.7 -        init_frametable_chunk(pdx_to_page(sidx *PDX_GROUP_COUNT),
     1.8 -                              pdx_to_page(max_idx * PDX_GROUP_COUNT));
     1.9 -        memset(pdx_to_page(max_pdx), -1, (unsigned long)pdx_to_page(max_idx) -
    1.10 -                        (unsigned long)(pdx_to_page(max_pdx)));
    1.11 +        init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT),
    1.12 +                              pdx_to_page(max_idx * PDX_GROUP_COUNT - 1) + 1);
    1.13 +        memset(pdx_to_page(max_pdx), -1,
    1.14 +               (unsigned long)pdx_to_page(max_idx * PDX_GROUP_COUNT) -
    1.15 +               (unsigned long)pdx_to_page(max_pdx));
    1.16      }
    1.17  }
    1.18