summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2009-12-10 03:09:35 +0000
committerkmacy <kmacy@FreeBSD.org>2009-12-10 03:09:35 +0000
commit798466d5795a04d7f7b6886898aa8aaf1910085a (patch)
tree0e4e1f896ad54df008c2f7bf69e3c08333411c29
parent6e354b089d9a67edb1364fc96a1a26d764f713ff (diff)
downloadFreeBSD-src-798466d5795a04d7f7b6886898aa8aaf1910085a.zip
FreeBSD-src-798466d5795a04d7f7b6886898aa8aaf1910085a.tar.gz
- revert pmap_kenter_temporary to taking a physical address
- make minidump work
-rw-r--r--sys/i386/i386/dump_machdep.c4
-rw-r--r--sys/i386/i386/minidump_machdep.c13
-rw-r--r--sys/i386/xen/pmap.c3
3 files changed, 11 insertions, 9 deletions
diff --git a/sys/i386/i386/dump_machdep.c b/sys/i386/i386/dump_machdep.c
index 2f5dcc9..d0c6ba7 100644
--- a/sys/i386/i386/dump_machdep.c
+++ b/sys/i386/i386/dump_machdep.c
@@ -182,11 +182,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
}
for (i = 0; i < chunk; i++) {
a = pa + i * PAGE_SIZE;
-#ifdef XEN
- va = pmap_kenter_temporary(xpmap_ptom(trunc_page(a)), i);
-#else
va = pmap_kenter_temporary(trunc_page(a), i);
-#endif
}
error = dump_write(di, va, 0, dumplo, sz);
if (error)
diff --git a/sys/i386/i386/minidump_machdep.c b/sys/i386/i386/minidump_machdep.c
index af52306..8d9db0c 100644
--- a/sys/i386/i386/minidump_machdep.c
+++ b/sys/i386/i386/minidump_machdep.c
@@ -65,6 +65,11 @@ static void *dump_va;
static uint64_t counter, progress;
CTASSERT(sizeof(*vm_page_dump) == 4);
+#ifndef XEN
+#define xpmap_mtop(x) (x)
+#define xpmap_ptom(x) (x)
+#endif
+
static int
is_dumpable(vm_paddr_t pa)
@@ -194,7 +199,7 @@ minidumpsys(struct dumperinfo *di)
j = va >> PDRSHIFT;
if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) {
/* This is an entire 2M page. */
- pa = pd[j] & PG_PS_FRAME;
+ pa = xpmap_mtop(pd[j] & PG_PS_FRAME);
for (k = 0; k < NPTEPG; k++) {
if (is_dumpable(pa))
dump_add_page(pa);
@@ -204,10 +209,10 @@ minidumpsys(struct dumperinfo *di)
}
if ((pd[j] & PG_V) == PG_V) {
/* set bit for each valid page in this 2MB block */
- pt = pmap_kenter_temporary(pd[j] & PG_FRAME, 0);
+ pt = pmap_kenter_temporary(xpmap_mtop(pd[j] & PG_FRAME), 0);
for (k = 0; k < NPTEPG; k++) {
if ((pt[k] & PG_V) == PG_V) {
- pa = pt[k] & PG_FRAME;
+ pa = xpmap_mtop(pt[k] & PG_FRAME);
if (is_dumpable(pa))
dump_add_page(pa);
}
@@ -307,7 +312,7 @@ minidumpsys(struct dumperinfo *di)
continue;
}
if ((pd[j] & PG_V) == PG_V) {
- pa = pd[j] & PG_FRAME;
+ pa = xpmap_mtop(pd[j] & PG_FRAME);
error = blk_write(di, 0, pa, PAGE_SIZE);
if (error)
goto fail;
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c
index 1b4345f..c5c3e66 100644
--- a/sys/i386/xen/pmap.c
+++ b/sys/i386/xen/pmap.c
@@ -3101,9 +3101,10 @@ void *
pmap_kenter_temporary(vm_paddr_t pa, int i)
{
vm_offset_t va;
+ vm_paddr_t ma = xpmap_ptom(pa);
va = (vm_offset_t)crashdumpmap + (i * PAGE_SIZE);
- PT_SET_MA(va, (pa & ~PAGE_MASK) | PG_V | pgeflag);
+ PT_SET_MA(va, (ma & ~PAGE_MASK) | PG_V | pgeflag);
invlpg(va);
return ((void *)crashdumpmap);
}
OpenPOWER on IntegriCloud