Add the required functions for minidump support, based on the ARM64 port.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Did some of this work before I realized the obvious blocker that we don't have kgdb for RISC-V yet. It dumps successfully but I can't inspect it yet until we have that. Regardless, I figured I'd put this up now to get some initial looks at the changes. I will look into adding the required bits to kgdb to get it working.
sys/riscv/riscv/minidump_machdep.c | ||
---|---|---|
227 ↗ | (On Diff #51031) | First major differences to the ARM64 version are in this loop. This is built on my understanding that we support 3 levels of page tables (L1 through L3), and that L2 and L3 level entries can be leaf entries. |
319 ↗ | (On Diff #51031) | Second major differences are in this loop. |
sys/riscv/riscv/pmap.c | ||
707 ↗ | (On Diff #51031) | Setting up dump_avail is required so that pmap_page_dump_size will be non-zero (see vm_page.c). |
sys/vm/vm_page.c | ||
656 ↗ | (On Diff #51031) | Do we need a || defined(__riscv) here? |
Small update fixing some extra #ifdefs.
Ripped out the initialization of dump_avail[] to a separate review (D19170).
Fix a small bug while dumping pagetable entries.
Reading dumps seems to now be working without issue. Take a look at P247 for a sample from crashinfo(8).
Yes. I tried writing out more than one page at a time and it failed quite spectacularly, so this could be a good spot to revisit and introduce pmap_kenter_temporary() as we discussed on IRC.
I'm happy for that to be handled in a separate diff/commit; just wanted to make sure I wasn't missing something. It might be worth adding an /* XXX */ comment for now noting the 4KB write limitation.