unsigned n_mappings;
#define MAPPING_MAX 2
struct xc_dom_x86_mapping maps[MAPPING_MAX];
- struct xc_dom_params *params;
+ const struct xc_dom_params *params;
};
/* get guest IO ABI protocol */
return 0;
}
-static int alloc_pgtables(struct xc_dom_image *dom)
+static int alloc_pgtables_pv(struct xc_dom_image *dom)
{
int pages, extra_pages;
xen_vaddr_t try_virt_end;
/* ------------------------------------------------------------------------ */
/* i386 pagetables */
-static struct xc_dom_params x86_32_params = {
- .levels = PGTBL_LEVELS_I386,
- .vaddr_mask = bits_to_mask(VIRT_BITS_I386),
- .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
- .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
- .lvl_prot[2] = _PAGE_PRESENT,
-};
-
static int alloc_pgtables_x86_32_pae(struct xc_dom_image *dom)
{
+ static const struct xc_dom_params x86_32_params = {
+ .levels = PGTBL_LEVELS_I386,
+ .vaddr_mask = bits_to_mask(VIRT_BITS_I386),
+ .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
+ .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+ .lvl_prot[2] = _PAGE_PRESENT,
+ };
struct xc_dom_image_x86 *domx86 = dom->arch_private;
domx86->params = &x86_32_params;
- return alloc_pgtables(dom);
+
+ return alloc_pgtables_pv(dom);
}
#define pfn_to_paddr(pfn) ((xen_paddr_t)(pfn) << PAGE_SHIFT_X86)
return l3mfn;
}
-static x86_pgentry_t *get_pg_table_x86(struct xc_dom_image *dom, int m, int l)
+static x86_pgentry_t *get_pg_table(struct xc_dom_image *dom, int m, int l)
{
struct xc_dom_image_x86 *domx86 = dom->arch_private;
struct xc_dom_x86_mapping *map;
return NULL;
}
-static x86_pgentry_t get_pg_prot_x86(struct xc_dom_image *dom, int l,
- xen_pfn_t pfn)
+static x86_pgentry_t get_pg_prot(struct xc_dom_image *dom, int l, xen_pfn_t pfn)
{
struct xc_dom_image_x86 *domx86 = dom->arch_private;
struct xc_dom_x86_mapping *map;
return prot;
}
-static int setup_pgtables_x86(struct xc_dom_image *dom)
+static int setup_pgtables_pv(struct xc_dom_image *dom)
{
struct xc_dom_image_x86 *domx86 = dom->arch_private;
struct xc_dom_x86_mapping *map1, *map2;
map1 = domx86->maps + m1;
from = map1->lvls[l].from;
to = map1->lvls[l].to;
- pg = get_pg_table_x86(dom, m1, l);
+ pg = get_pg_table(dom, m1, l);
if ( !pg )
return -1;
for ( m2 = 0; m2 < domx86->n_mappings; m2++ )
for ( p = p_s; p <= p_e; p++ )
{
pg[p] = pfn_to_paddr(xc_dom_p2m(dom, pfn)) |
- get_pg_prot_x86(dom, l, pfn);
+ get_pg_prot(dom, l, pfn);
pfn++;
}
}
}
}
- return setup_pgtables_x86(dom);
+ return setup_pgtables_pv(dom);
}
/* ------------------------------------------------------------------------ */
/* x86_64 pagetables */
-static struct xc_dom_params x86_64_params = {
- .levels = PGTBL_LEVELS_X86_64,
- .vaddr_mask = bits_to_mask(VIRT_BITS_X86_64),
- .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
- .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
- .lvl_prot[2] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
- .lvl_prot[3] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
-};
-
static int alloc_pgtables_x86_64(struct xc_dom_image *dom)
{
+ const static struct xc_dom_params x86_64_params = {
+ .levels = PGTBL_LEVELS_X86_64,
+ .vaddr_mask = bits_to_mask(VIRT_BITS_X86_64),
+ .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
+ .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+ .lvl_prot[2] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+ .lvl_prot[3] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+ };
struct xc_dom_image_x86 *domx86 = dom->arch_private;
domx86->params = &x86_64_params;
- return alloc_pgtables(dom);
+
+ return alloc_pgtables_pv(dom);
}
static int setup_pgtables_x86_64(struct xc_dom_image *dom)
{
- return setup_pgtables_x86(dom);
+ return setup_pgtables_pv(dom);
}
/* ------------------------------------------------------------------------ */
.sizeof_pfn = 4,
.alloc_magic_pages = alloc_magic_pages_hvm,
.alloc_pgtables = alloc_pgtables_hvm,
- .setup_pgtables = NULL,
- .start_info = NULL,
- .shared_info = NULL,
.vcpu = vcpu_hvm,
.meminit = meminit_hvm,
.bootearly = bootearly,