diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2007-03-21 17:02:59 -0500 |
---|---|---|
committer | Hollis Blanchard <hollisb@us.ibm.com> | 2007-03-21 17:02:59 -0500 |
commit | ba5aedc1938300faac14bfb3ed39453c244cbecf (patch) | |
tree | 76a70ac43596be5b83c91b07e44418bc174a2688 /tools/libxc/xc_dom_x86.c | |
parent | 06aaae8408dc2b372ab5740e0ca64cfa48a5168d (diff) | |
download | xen-ba5aedc1938300faac14bfb3ed39453c244cbecf.tar.gz xen-ba5aedc1938300faac14bfb3ed39453c244cbecf.tar.bz2 xen-ba5aedc1938300faac14bfb3ed39453c244cbecf.zip |
[LIBXC] Allocate memory and populate p2m in arch-specific code.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Diffstat (limited to 'tools/libxc/xc_dom_x86.c')
-rw-r--r-- | tools/libxc/xc_dom_x86.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c index 0d6a737c99..0641078f9c 100644 --- a/tools/libxc/xc_dom_x86.c +++ b/tools/libxc/xc_dom_x86.c @@ -22,6 +22,7 @@ #include "xg_private.h" #include "xc_dom.h" +#include "xenctrl.h" /* ------------------------------------------------------------------------ */ @@ -626,14 +627,26 @@ static int x86_shadow(int xc, domid_t domid) int arch_setup_meminit(struct xc_dom_image *dom) { - int rc = 0; + int rc; x86_compat(dom->guest_xc, dom->guest_domid, dom->guest_type); if ( xc_dom_feature_translated(dom) ) { dom->shadow_enabled = 1; rc = x86_shadow(dom->guest_xc, dom->guest_domid); + if ( rc ) + return rc; } + + /* setup initial p2m */ + dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->total_pages); + for ( pfn = 0; pfn < dom->total_pages; pfn++ ) + dom->p2m_host[pfn] = pfn; + + /* allocate guest memory */ + rc = xc_domain_memory_populate_physmap(dom->guest_xc, dom->guest_domid, + dom->total_pages, 0, 0, + dom->p2m_host); return rc; } |