All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hvm: handle PoD and grant pages in HVMOP_get_mem_type
@ 2012-10-19 14:09 Olaf Hering
  2012-10-19 14:14 ` Olaf Hering
  2012-10-22 15:22 ` Tim Deegan
  0 siblings, 2 replies; 9+ messages in thread
From: Olaf Hering @ 2012-10-19 14:09 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1350655745 -7200
# Node ID 8ebe7b80f02900d5a83e023c2833de26b70f3ff1
# Parent  3fa2ab30bb05297f30d9a33b30f29db960900971
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 <olaf@aepfle.de>

diff -r 3fa2ab30bb05 -r 8ebe7b80f029 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4086,6 +4086,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 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;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-10-23  7:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.15017.1350657933.1399.xen-devel@lists.xen.org>
2012-10-19 15:45 ` [PATCH] hvm: handle PoD and grant pages in HVMOP_get_mem_type Andres Lagar-Cavilla
2012-10-22 14:48   ` Olaf Hering
2012-10-22 14:59     ` Olaf Hering
2012-10-19 14:09 Olaf Hering
2012-10-19 14:14 ` Olaf Hering
2012-10-22 15:22 ` Tim Deegan
2012-10-22 15:33   ` Olaf Hering
2012-10-22 16:13     ` Tim Deegan
2012-10-23  7:16       ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.