aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-06-02 17:40:24 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-06-02 17:40:24 +0000
commita12ff66914dd33f093f526e6d99f88b15a7ea6ab (patch)
tree36ab61426635a4ed60d432c70827c29906a50a1f
parentbf6fe7ee2ef5c1a2e1b16e8548e7b94b356430c8 (diff)
downloadxen-a12ff66914dd33f093f526e6d99f88b15a7ea6ab.tar.gz
xen-a12ff66914dd33f093f526e6d99f88b15a7ea6ab.tar.bz2
xen-a12ff66914dd33f093f526e6d99f88b15a7ea6ab.zip
bitkeeper revision 1.1643 (429f4488tj590Fmn5s5Gd_pv8fLXeg)
The merge of PAE support introduced the intpte_t type and PRIpte format specifier. Most of the shadow mode code was fixed, but debugging printks were not; this broke the compile if shadow mode debugging was enabled. The attached patch should fix the problem. Not tested with PAE enabled, but it shouldn't make anything worse than it already is. Signed-off-by: Michael Vrable <mvrable@cs.ucsd.edu>
-rw-r--r--xen/arch/x86/shadow.c31
-rw-r--r--xen/include/asm-x86/shadow.h12
2 files changed, 22 insertions, 21 deletions
diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c
index 0d89d1931c..944d1f6f3d 100644
--- a/xen/arch/x86/shadow.c
+++ b/xen/arch/x86/shadow.c
@@ -1222,8 +1222,8 @@ static int shadow_mode_table_op(
ASSERT(shadow_lock_is_acquired(d));
SH_VLOG("shadow mode table op %lx %lx count %d",
- pagetable_val(d->exec_domain[0]->arch.guest_table), /* XXX SMP */
- pagetable_val(d->exec_domain[0]->arch.shadow_table), /* XXX SMP */
+ (unsigned long)pagetable_get_pfn(d->exec_domain[0]->arch.guest_table), /* XXX SMP */
+ (unsigned long)pagetable_get_pfn(d->exec_domain[0]->arch.shadow_table), /* XXX SMP */
d->arch.shadow_page_count);
shadow_audit(d, 1);
@@ -2594,7 +2594,7 @@ int shadow_fault(unsigned long va, struct cpu_user_regs *regs)
orig_gpte = gpte = linear_pg_table[l1_linear_offset(va)];
if ( unlikely(!(l1e_get_flags(gpte) & _PAGE_PRESENT)) )
{
- SH_VVLOG("shadow_fault - EXIT: gpte not present (%lx)",
+ SH_VVLOG("shadow_fault - EXIT: gpte not present (%" PRIpte ")",
l1e_get_intpte(gpte));
perfc_incrc(shadow_fault_bail_pte_not_present);
goto fail;
@@ -2615,7 +2615,7 @@ int shadow_fault(unsigned long va, struct cpu_user_regs *regs)
else
{
/* Write fault on a read-only mapping. */
- SH_VVLOG("shadow_fault - EXIT: wr fault on RO page (%lx)",
+ SH_VVLOG("shadow_fault - EXIT: wr fault on RO page (%" PRIpte ")",
l1e_get_intpte(gpte));
perfc_incrc(shadow_fault_bail_ro_mapping);
goto fail;
@@ -2692,7 +2692,7 @@ void shadow_l1_normal_pt_update(
sl1mfn = __shadow_status(current->domain, pa >> PAGE_SHIFT, PGT_l1_shadow);
if ( sl1mfn )
{
- SH_VVLOG("shadow_l1_normal_pt_update pa=%p, gpte=%08lx",
+ SH_VVLOG("shadow_l1_normal_pt_update pa=%p, gpte=%" PRIpte,
(void *)pa, l1e_get_intpte(gpte));
l1pte_propagate_from_guest(current->domain, gpte, &spte);
@@ -2717,7 +2717,7 @@ void shadow_l2_normal_pt_update(
sl2mfn = __shadow_status(current->domain, pa >> PAGE_SHIFT, PGT_l2_shadow);
if ( sl2mfn )
{
- SH_VVLOG("shadow_l2_normal_pt_update pa=%p, gpde=%08lx",
+ SH_VVLOG("shadow_l2_normal_pt_update pa=%p, gpde=%" PRIpte,
(void *)pa, l2e_get_intpte(gpde));
spl2e = map_domain_mem_with_cache(sl2mfn << PAGE_SHIFT, cache);
validate_pde_change(d, gpde,
@@ -2946,7 +2946,7 @@ mark_shadows_as_reflecting_snapshot(struct domain *d, unsigned long gpfn)
{
l2e = map_domain_mem(smfn << PAGE_SHIFT);
for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
- if ( is_guest_l2_slot(i) &&
+ if ( is_guest_l2_slot(0, i) &&
(l2e_get_flags(l2e[i]) & _PAGE_PRESENT) )
l2e_add_flags(l2e[i], SHADOW_REFLECTS_SNAPSHOT);
unmap_domain_mem(l2e);
@@ -2978,9 +2978,10 @@ int shadow_status_noswap;
printk("XXX %s-FAIL (%d,%d,%d) " _f " at %s(%d)\n", \
sh_check_name, level, l2_idx, l1_idx, ## _a, \
__FILE__, __LINE__); \
- printk("guest_pte=%lx eff_guest_pte=%lx shadow_pte=%lx " \
- "snapshot_pte=%lx &guest=%p &shadow=%p &snap=%p " \
- "v2m(&guest)=%p v2m(&shadow)=%p v2m(&snap)=%p ea=%08x\n", \
+ printk("guest_pte=%" PRIpte " eff_guest_pte=%" PRIpte \
+ " shadow_pte=%" PRIpte " snapshot_pte=%" PRIpte \
+ " &guest=%p &shadow=%p &snap=%p v2m(&guest)=%p" \
+ " v2m(&shadow)=%p v2m(&snap)=%p ea=%08x\n", \
l1e_get_intpte(guest_pte), l1e_get_intpte(eff_guest_pte), \
l1e_get_intpte(shadow_pte), l1e_get_intpte(snapshot_pte), \
p_guest_pte, p_shadow_pte, p_snapshot_pte, \
@@ -3048,8 +3049,8 @@ static int check_pte(
shadow_mfn = l1e_get_pfn(shadow_pte);
if ( !VALID_MFN(eff_guest_mfn) && !shadow_mode_refcounts(d) )
- FAIL("%s: invalid eff_guest_pfn=%lx eff_guest_pte=%lx\n", __func__, eff_guest_pfn,
- l1e_get_intpte(eff_guest_pte));
+ FAIL("%s: invalid eff_guest_pfn=%lx eff_guest_pte=%" PRIpte "\n",
+ __func__, eff_guest_pfn, l1e_get_intpte(eff_guest_pte));
page_table_page = mfn_is_page_table(eff_guest_mfn);
@@ -3184,7 +3185,7 @@ int check_l2_table(
l2e_has_changed(spl2e[SH_LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT],
match, PAGE_FLAG_MASK))
{
- FAILPT("hypervisor shadow linear map inconsistent %lx %lx",
+ FAILPT("hypervisor shadow linear map inconsistent %" PRIpte " %" PRIpte,
l2e_get_intpte(spl2e[SH_LINEAR_PT_VIRT_START >>
L2_PAGETABLE_SHIFT]),
l2e_get_intpte(match));
@@ -3195,7 +3196,7 @@ int check_l2_table(
l2e_has_changed(spl2e[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT],
match, PAGE_FLAG_MASK))
{
- FAILPT("hypervisor per-domain map inconsistent saw %lx, expected (va=%p) %lx",
+ FAILPT("hypervisor per-domain map inconsistent saw %" PRIpte ", expected (va=%p) %" PRIpte,
l2e_get_intpte(spl2e[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT]),
d->arch.mm_perdomain_pt,
l2e_get_intpte(match));
@@ -3234,7 +3235,7 @@ int _check_pagetable(struct exec_domain *ed, char *s)
{
struct domain *d = ed->domain;
pagetable_t pt = ed->arch.guest_table;
- unsigned long gptbase = pagetable_val(pt);
+ unsigned long gptbase = pagetable_get_paddr(pt);
unsigned long ptbase_pfn, smfn;
unsigned long i;
l2_pgentry_t *gpl2e, *spl2e;
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index d68ba114eb..d699c92dc0 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -397,7 +397,7 @@ shadow_get_page_from_l1e(l1_pgentry_t l1e, struct domain *d)
if ( unlikely(!res) )
{
perfc_incrc(shadow_get_page_fail);
- FSH_LOG("%s failed to get ref l1e=%lx\n",
+ FSH_LOG("%s failed to get ref l1e=%" PRIpte "\n",
__func__, l1e_get_intpte(l1e));
}
@@ -738,7 +738,7 @@ static inline int l1pte_write_fault(
l1e_add_flags(gpte, _PAGE_DIRTY | _PAGE_ACCESSED);
spte = l1e_from_pfn(gmfn, l1e_get_flags(gpte) & ~_PAGE_GLOBAL);
- SH_VVLOG("l1pte_write_fault: updating spte=0x%lx gpte=0x%lx",
+ SH_VVLOG("l1pte_write_fault: updating spte=0x%" PRIpte " gpte=0x%" PRIpte,
l1e_get_intpte(spte), l1e_get_intpte(gpte));
if ( shadow_mode_log_dirty(d) )
@@ -777,7 +777,7 @@ static inline int l1pte_read_fault(
l1e_remove_flags(spte, _PAGE_RW);
}
- SH_VVLOG("l1pte_read_fault: updating spte=0x%lx gpte=0x%lx",
+ SH_VVLOG("l1pte_read_fault: updating spte=0x%" PRIpte " gpte=0x%" PRIpte,
l1e_get_intpte(spte), l1e_get_intpte(gpte));
*gpte_p = gpte;
*spte_p = spte;
@@ -809,7 +809,7 @@ static inline void l1pte_propagate_from_guest(
}
if ( l1e_get_intpte(spte) || l1e_get_intpte(gpte) )
- SH_VVVLOG("%s: gpte=%lx, new spte=%lx",
+ SH_VVVLOG("%s: gpte=%" PRIpte ", new spte=%" PRIpte,
__func__, l1e_get_intpte(gpte), l1e_get_intpte(spte));
*spte_p = spte;
@@ -843,7 +843,7 @@ static inline void hl2e_propagate_from_guest(
}
if ( l1e_get_intpte(hl2e) || l2e_get_intpte(gpde) )
- SH_VVLOG("%s: gpde=%lx hl2e=%lx", __func__,
+ SH_VVLOG("%s: gpde=%" PRIpte " hl2e=%" PRIpte, __func__,
l2e_get_intpte(gpde), l1e_get_intpte(hl2e));
*hl2e_p = hl2e;
@@ -872,7 +872,7 @@ static inline void l2pde_general(
}
if ( l2e_get_intpte(spde) || l2e_get_intpte(gpde) )
- SH_VVLOG("%s: gpde=%lx, new spde=%lx", __func__,
+ SH_VVLOG("%s: gpde=%" PRIpte ", new spde=%" PRIpte, __func__,
l2e_get_intpte(gpde), l2e_get_intpte(spde));
*spde_p = spde;