xen/x86: Workaround 64-bit hypervisor and 32-bit initial domain.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 21 Aug 2012 18:31:24 +0000 (14:31 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 21 Aug 2012 18:45:33 +0000 (14:45 -0400)
commit806c312e50f122c47913145cf884f53dd09d9199
treec6d64ccc297c5f8e9a2959365d74c877cde93894
parent59b294403e9814e7c1154043567f0d71bac7a511
xen/x86: Workaround 64-bit hypervisor and 32-bit initial domain.

If a 64-bit hypervisor is booted with a 32-bit initial domain,
the hypervisor deals with the initial domain as "compat" and
does some extra adjustments (like pagetables are 4 bytes instead
of 8). It also adjusts the xen_start_info->pt_base incorrectly.

When booted with a 32-bit hypervisor (32-bit initial domain):
..
(XEN)  Start info:    cf831000->cf83147c
(XEN)  Page tables:   cf832000->cf8b5000
..
[    0.000000] PT: cf832000 (f832000)
[    0.000000] Reserving PT: f832000->f8b5000

And with a 64-bit hypervisor:
(XEN)  Start info:    00000000cf831000->00000000cf8314b4
(XEN)  Page tables:   00000000cf832000->00000000cf8b6000

[    0.000000] PT: cf834000 (f834000)
[    0.000000] Reserving PT: f834000->f8b8000

To deal with this, we keep keep track of the highest physical
address we have reserved via memblock_reserve. If that address
does not overlap with pt_base, we have a gap which we reserve.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/xen/enlighten.c