[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] hvm: handle PoD and grant pages in HVMOP_get_mem_type



> # HG changeset patch
> # User Olaf Hering <olaf@xxxxxxxxx>
> # 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@xxxxxxxxx>
> 
> 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;
p2m_is_magic is this bizarre thing that should just be p2m_is_pod. Can you take 
advantage of this opportunity and fix it?

> +            else if ( p2m_is_grant(t) )
> +                a.mem_type =  HVMMEM_ram_rw;

Yes there can be p2m_is_grant pages in an HVM, if it is running a backend. Note 
that you need to discriminate whether the grant is mapped writable in order to 
return ram_rw or ram_ro.

It might be a good idea to extend this interface to return HVMMEM_grant_rw/ro. 
These are, in essence, different types of ram from an HVM point of view. 
However, it might be overkill for the current users.

Thanks
Andres
>             else
>                 a.mem_type =  HVMMEM_mmio_dm;
>             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.