linux/arch/x86/xen
Konrad Rzeszutek Wilk 86b32122fd xen/e820: Don't mark balloon memory as E820_UNUSABLE when running as guest and fix overflow.
If we have a guest that asked for:

memory=1024
maxmem=2048

Which means we want 1GB now, and create pagetables so that we can expand
up to 2GB, we would have this E820 layout:

[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  Xen: 0000000000000000 - 00000000000a0000 (usable)
[    0.000000]  Xen: 00000000000a0000 - 0000000000100000 (reserved)
[    0.000000]  Xen: 0000000000100000 - 0000000080800000 (usable)

Due to patch: "xen/setup: Inhibit resource API from using System RAM E820 gaps as PCI mem gaps."
we would mark the memory past the 1GB mark as unusuable resulting in:

[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  Xen: 0000000000000000 - 00000000000a0000 (usable)
[    0.000000]  Xen: 00000000000a0000 - 0000000000100000 (reserved)
[    0.000000]  Xen: 0000000000100000 - 0000000040000000 (usable)
[    0.000000]  Xen: 0000000040000000 - 0000000080800000 (unusable)

which meant that we could not balloon up anymore. We could
balloon the guest down. The fix is to run the code introduced
by the above mentioned patch only for the initial domain.

We will have to revisit this once we start introducing a modified
E820 for PCI passthrough so that we can utilize the P2M identity code.

We also fix an overflow by having UL instead of ULL on 32-bit machines.

[v2: Ian pointed to the overflow issue]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-03-11 11:01:45 -05:00
..
debugfs.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
debugfs.h xen: add debugfs support 2008-08-21 13:52:58 +02:00
enlighten.c lockdep: Move early boot local IRQ enable/disable status to init/main.c 2011-01-20 13:32:33 +01:00
grant-table.c xen: make grant table arch portable 2008-04-24 23:57:32 +02:00
irq.c xen: fix non-ANSI function warning in irq.c 2011-01-20 14:52:13 -05:00
Kconfig Merge branch 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2010-10-28 17:11:17 -07:00
Makefile xen: move p2m handling to separate file 2011-01-11 14:31:07 -05:00
mmu.c xen: export arbitrary_virt_to_machine 2011-01-14 16:11:12 -08:00
mmu.h xen: make install_p2mtop_page() static 2010-10-22 12:57:23 -07:00
multicalls.c x86, xen: do multicall callbacks with interrupts disabled 2009-02-16 08:56:41 +01:00
multicalls.h xen: Use this_cpu_ops 2010-12-17 15:07:19 +01:00
p2m.c xen/p2m: Mark INVALID_P2M_ENTRY the mfn_list past max_pfn. 2011-01-27 10:49:34 -05:00
pci-swiotlb-xen.c Merge branch 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2010-10-28 17:11:17 -07:00
platform-pci-unplug.c xen: unplug the emulated devices at resume time 2010-12-02 14:40:53 +00:00
setup.c xen/e820: Don't mark balloon memory as E820_UNUSABLE when running as guest and fix overflow. 2011-03-11 11:01:45 -05:00
smp.c Merge branch 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2010-10-28 17:11:17 -07:00
spinlock.c xen: Use this_cpu_ops 2010-12-17 15:07:19 +01:00
suspend.c xen: unplug the emulated devices at resume time 2010-12-02 14:40:53 +00:00
time.c Merge branch 'this_cpu_ops' into for-2.6.38 2010-12-17 15:16:46 +01:00
vdso.h
xen-asm.h xen: make direct versions of irq_enable/disable/save/restore to common code 2009-02-04 16:59:04 -08:00
xen-asm.S x86: style cleanups for xen assemblies 2009-02-05 20:25:41 +01:00
xen-asm_32.S percpu: remove per_cpu__ prefix. 2009-10-29 22:34:15 +09:00
xen-asm_64.S xen: use iret for return from 64b kernel to 32b usermode 2009-12-03 11:14:54 -08:00
xen-head.S x86: use _types.h headers in asm where available 2009-02-13 11:35:01 -08:00
xen-ops.h xen: unplug the emulated devices at resume time 2010-12-02 14:40:53 +00:00