Commit 10231f69 authored by Juergen Gross's avatar Juergen Gross

xen: split up xen_hvm_init_shared_info()

Instead of calling xen_hvm_init_shared_info() on boot and resume split
it up into a boot time function searching for the pfn to use and a
mapping function doing the hypervisor mapping call.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent c138d811
...@@ -21,12 +21,22 @@ ...@@ -21,12 +21,22 @@
#include "mmu.h" #include "mmu.h"
#include "smp.h" #include "smp.h"
void __ref xen_hvm_init_shared_info(void) void xen_hvm_init_shared_info(void)
{ {
struct xen_add_to_physmap xatp; struct xen_add_to_physmap xatp;
xatp.domid = DOMID_SELF;
xatp.idx = 0;
xatp.space = XENMAPSPACE_shared_info;
xatp.gpfn = virt_to_pfn(HYPERVISOR_shared_info);
if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
BUG();
}
static void __init reserve_shared_info(void)
{
u64 pa; u64 pa;
if (HYPERVISOR_shared_info == &xen_dummy_shared_info) {
/* /*
* Search for a free page starting at 4kB physical address. * Search for a free page starting at 4kB physical address.
* Low memory is preferred to avoid an EPT large page split up * Low memory is preferred to avoid an EPT large page split up
...@@ -43,14 +53,6 @@ void __ref xen_hvm_init_shared_info(void) ...@@ -43,14 +53,6 @@ void __ref xen_hvm_init_shared_info(void)
memblock_reserve(pa, PAGE_SIZE); memblock_reserve(pa, PAGE_SIZE);
HYPERVISOR_shared_info = __va(pa); HYPERVISOR_shared_info = __va(pa);
}
xatp.domid = DOMID_SELF;
xatp.idx = 0;
xatp.space = XENMAPSPACE_shared_info;
xatp.gpfn = virt_to_pfn(HYPERVISOR_shared_info);
if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
BUG();
} }
static void __init init_hvm_pv_info(void) static void __init init_hvm_pv_info(void)
...@@ -153,6 +155,7 @@ static void __init xen_hvm_guest_init(void) ...@@ -153,6 +155,7 @@ static void __init xen_hvm_guest_init(void)
init_hvm_pv_info(); init_hvm_pv_info();
reserve_shared_info();
xen_hvm_init_shared_info(); xen_hvm_init_shared_info();
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment