From b00d54d3d54adfb9fab309301e0019e703feb0a2 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 25 Oct 2012 15:31:08 +0200 Subject: [PATCH] hvm: handle PoD and grant pages in HVMOP_get_mem_type During kexec in a ballooned PVonHVM guest the new kernel needs to check each pfn if its backed by a mfn to find ballooned pages. Currently all PoD and grant pages will appear as HVMMEM_mmio_dm, so the new kernel has to assume they are ballooned. This is wrong: PoD pages may turn into real RAM at runtime, grant pages are also RAM. Signed-off-by: Olaf Hering Acked-by: Tim Deegan xen-unstable changeset: 26093:4ae08ca5500f xen-unstable date: Fri Oct 19 16:09:05 2012 +0200 --- xen/arch/x86/hvm/hvm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 8b269aca06..0e9e520f61 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4071,6 +4071,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg) a.mem_type = HVMMEM_ram_ro; else if ( p2m_is_ram(t) ) a.mem_type = HVMMEM_ram_rw; + else if ( p2m_is_magic(t) ) + a.mem_type = HVMMEM_ram_rw; + else if ( p2m_is_grant(t) ) + a.mem_type = HVMMEM_ram_rw; else a.mem_type = HVMMEM_mmio_dm; rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;