Page MenuHomeFreeBSD

RISC-V: add minidump support
ClosedPublic

Authored by mhorne063_gmail.com on Nov 24 2018, 12:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 12 2024, 5:19 PM
Unknown Object (File)
Jan 27 2024, 7:35 AM
Unknown Object (File)
Dec 22 2023, 9:21 PM
Unknown Object (File)
Dec 13 2023, 12:05 AM
Unknown Object (File)
Nov 28 2023, 10:59 AM
Unknown Object (File)
Nov 28 2023, 9:37 AM
Unknown Object (File)
Nov 26 2023, 5:13 AM
Unknown Object (File)
Nov 22 2023, 8:17 PM
Subscribers

Details

Summary

Add the required functions for minidump support, based on the ARM64 port.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

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
235

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.

327

Second major differences are in this loop.

sys/riscv/riscv/pmap.c
663

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
661–662

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).

Looks ok, just a couple of nits.

Am I right that we only write 4KB at a time?

sys/riscv/riscv/uma_machdep.c
57–58

No need to keep the extra newlines.

72–73

Ditto.

sys/vm/vm_page.c
661–662

Yes, since riscv uses a direct map.

This revision is now accepted and ready to land.Feb 28 2019, 6:36 PM

Am I right that we only write 4KB at a time?

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.

This revision now requires review to proceed.Mar 1 2019, 3:48 PM

Am I right that we only write 4KB at a time?

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.

Add advisory comment to blk_write().

This revision was not accepted when it landed; it landed in state Needs Review.Mar 6 2019, 12:01 AM
This revision was automatically updated to reflect the committed changes.