linux/arch
Stefan Bader 8e1b4cf210 xen: p2m: correctly initialize partial p2m leaf
After changing the p2m mapping to a tree by

  commit 58e05027b5
    xen: convert p2m to a 3 level tree

and trying to boot a DomU with 615MB of memory, the following crash was
observed in the dump:

kernel direct mapping tables up to 26f00000 @ 1ec4000-1fff000
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<c0107397>] xen_set_pte+0x27/0x60
*pdpt = 0000000000000000 *pde = 0000000000000000

Adding further debug statements showed that when trying to set up
pfn=0x26700 the returned mapping was invalid.

pfn=0x266ff calling set_pte(0xc1fe77f8, 0x6b3003)
pfn=0x26700 calling set_pte(0xc1fe7800, 0x3)

Although the last_pfn obtained from the startup info is 0x26700, which
should in turn not be hit, the additional 8MB which are added as extra
memory normally seem to be ok. This lead to looking into the initial
p2m tree construction, which uses the smaller value and assuming that
there is other code handling the extra memory.

When the p2m tree is set up, the leaves are directly pointed to the
array which the domain builder set up. But if the mapping is not on a
boundary that fits into one p2m page, this will result in the last leaf
being only partially valid. And as the invalid entries are not
initialized in that case, things go badly wrong.

I am trying to fix that by checking whether the current leaf is a
complete map and if not, allocate a completely new page and copy only
the valid pointers there. This may not be the most efficient or elegant
solution, but at least it seems to allow me booting DomUs with memory
assignments all over the range.

BugLink: http://bugs.launchpad.net/bugs/686692
[v2: Redid a bit of commit wording and fixed a compile warning]

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-01-21 11:24:14 -05:00
..
alpha alpha: fix WARN_ON in __local_bh_enable() 2011-01-17 05:42:16 +01:00
arm ARM: S5PV310: Add missing virtual ASoC DMA device 2011-01-18 14:47:07 +09:00
avr32 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/avr32-2.6 2011-01-13 12:06:58 -08:00
blackfin Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-01-13 10:05:56 -08:00
cris Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-01-13 10:05:56 -08:00
frv BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
h8300 Merge branch 'master' into for-next 2010-12-22 18:57:02 +01:00
ia64 [IA64] fix ia64 build failure in pmdp_get_and_clear 2011-01-14 10:56:38 -08:00
m32r
m68k Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2011-01-18 08:05:20 -08:00
m68knommu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2011-01-18 08:05:20 -08:00
microblaze Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2011-01-18 08:06:22 -08:00
mips Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus 2011-01-18 14:28:48 -08:00
mn10300 kernel: clean up USE_GENERIC_SMP_HELPERS 2011-01-13 08:03:08 -08:00
parisc parisc: fix compile breakage caused by inlining maybe_mkwrite 2011-01-16 15:05:44 -08:00
powerpc Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-01-18 08:04:30 -08:00
s390 Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2011-01-14 08:47:26 -08:00
score
sh Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6 2011-01-13 20:15:18 -08:00
sparc thp: pte alloc trans splitting 2011-01-13 17:32:40 -08:00
tile arch/tile: handle rt_sigreturn() more cleanly 2010-12-17 16:59:29 -05:00
um thp: pte alloc trans splitting 2011-01-13 17:32:40 -08:00
x86 xen: p2m: correctly initialize partial p2m leaf 2011-01-21 11:24:14 -05:00
xtensa thp: mm: define MADV_NOHUGEPAGE 2011-01-13 17:32:47 -08:00
.gitignore
Kconfig [S390] mutex: Introduce arch_mutex_cpu_relax() 2011-01-05 12:47:31 +01:00