Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/minidump_machdep.c
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
static struct kerneldumpheader kdh; | static struct kerneldumpheader kdh; | ||||
/* Handle chunked writes. */ | /* Handle chunked writes. */ | ||||
static size_t fragsz; | static size_t fragsz; | ||||
static void *dump_va; | static void *dump_va; | ||||
static uint64_t counter, progress; | static uint64_t counter, progress; | ||||
static int | |||||
is_dumpable(vm_paddr_t pa) | |||||
{ | |||||
vm_page_t m; | |||||
int i; | |||||
if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) | |||||
return ((m->flags & PG_NODUMP) == 0); | |||||
for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { | |||||
if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) | |||||
return (1); | |||||
} | |||||
return (0); | |||||
} | |||||
#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) | #define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) | ||||
static int | static int | ||||
blk_flush(struct dumperinfo *di) | blk_flush(struct dumperinfo *di) | ||||
{ | { | ||||
int error; | int error; | ||||
if (fragsz == 0) | if (fragsz == 0) | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | minidumpsys(struct dumperinfo *di) | ||||
*/ | */ | ||||
dcache_wbinv_poc_all(); | dcache_wbinv_poc_all(); | ||||
counter = 0; | counter = 0; | ||||
/* Walk page table pages, set bits in vm_page_dump */ | /* Walk page table pages, set bits in vm_page_dump */ | ||||
ptesize = 0; | ptesize = 0; | ||||
for (va = KERNBASE; va < kernel_vm_end; va += PAGE_SIZE) { | for (va = KERNBASE; va < kernel_vm_end; va += PAGE_SIZE) { | ||||
pa = pmap_dump_kextract(va, NULL); | pa = pmap_dump_kextract(va, NULL); | ||||
if (pa != 0 && is_dumpable(pa)) | if (pa != 0 && vm_phys_is_dumpable(pa)) | ||||
dump_add_page(pa); | dump_add_page(pa); | ||||
ptesize += sizeof(pt2_entry_t); | ptesize += sizeof(pt2_entry_t); | ||||
} | } | ||||
/* Calculate dump size. */ | /* Calculate dump size. */ | ||||
dumpsize = ptesize; | dumpsize = ptesize; | ||||
dumpsize += round_page(msgbufp->msg_size); | dumpsize += round_page(msgbufp->msg_size); | ||||
dumpsize += round_page(nitems(dump_avail) * sizeof(uint64_t)); | dumpsize += round_page(nitems(dump_avail) * sizeof(uint64_t)); | ||||
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); | dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); | ||||
VM_PAGE_DUMP_FOREACH(pa) { | VM_PAGE_DUMP_FOREACH(pa) { | ||||
/* Clear out undumpable pages now if needed */ | /* Clear out undumpable pages now if needed */ | ||||
if (is_dumpable(pa)) | if (vm_phys_is_dumpable(pa)) | ||||
dumpsize += PAGE_SIZE; | dumpsize += PAGE_SIZE; | ||||
else | else | ||||
dump_drop_page(pa); | dump_drop_page(pa); | ||||
} | } | ||||
dumpsize += PAGE_SIZE; | dumpsize += PAGE_SIZE; | ||||
progress = dumpsize; | progress = dumpsize; | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |