From 95ca4720f00451b3e45a02a1cf9e6f8afcffed44 Mon Sep 17 00:00:00 2001 From: Leandro Lupori Date: Mon, 21 Oct 2019 11:56:57 +0000 Subject: [PATCH] [PPC64] Add minidump support to PowerNV Implementation of PowerNV specific minidump code. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21643 --- sys/powerpc/aim/moea64_native.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sys/powerpc/aim/moea64_native.c b/sys/powerpc/aim/moea64_native.c index c65ca2e0d613..d9f8c63cbe4f 100644 --- a/sys/powerpc/aim/moea64_native.c +++ b/sys/powerpc/aim/moea64_native.c @@ -212,6 +212,12 @@ static struct rwlock moea64_eviction_lock; static volatile struct pate *moea64_part_table; +/* + * Dump function. + */ +static void *moea64_dump_pmap_native(mmu_t mmu, void *ctx, void *buf, + u_long *nbytes); + /* * PTE calls. */ @@ -233,6 +239,7 @@ static mmu_method_t moea64_native_methods[] = { /* Internal interfaces */ MMUMETHOD(mmu_bootstrap, moea64_bootstrap_native), MMUMETHOD(mmu_cpu_bootstrap, moea64_cpu_bootstrap_native), + MMUMETHOD(mmu_dump_pmap, moea64_dump_pmap_native), MMUMETHOD(moea64_pte_synch, moea64_pte_synch_native), MMUMETHOD(moea64_pte_clear, moea64_pte_clear_native), @@ -787,3 +794,21 @@ moea64_pte_insert_native(mmu_t mmu, struct pvo_entry *pvo) return (-1); } +static void * +moea64_dump_pmap_native(mmu_t mmu, void *ctx, void *buf, u_long *nbytes) +{ + struct dump_context *dctx; + u_long ptex, ptex_end; + + dctx = (struct dump_context *)ctx; + ptex = dctx->ptex; + ptex_end = ptex + dctx->blksz / sizeof(struct lpte); + ptex_end = MIN(ptex_end, dctx->ptex_end); + *nbytes = (ptex_end - ptex) * sizeof(struct lpte); + + if (*nbytes == 0) + return (NULL); + + dctx->ptex = ptex_end; + return (__DEVOLATILE(struct lpte *, moea64_pteg_table) + ptex); +}