Page MenuHomeFreeBSD

RISC-V: add minidump support
ClosedPublic

Authored by mhorne063_gmail.com on Nov 24 2018, 12:15 AM.

Details

Summary

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

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mhorne063_gmail.com marked 4 inline comments as done.Nov 24 2018, 12:31 AM

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?

emaste added a subscriber: emaste.Dec 18 2018, 7:10 PM

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

markj accepted this revision.Feb 28 2019, 6:36 PM

Looks ok, just a couple of nits.

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

sys/riscv/riscv/uma_machdep.c
58 ↗(On Diff #54491)

No need to keep the extra newlines.

75 ↗(On Diff #54491)

Ditto.

sys/vm/vm_page.c
656 ↗(On Diff #51031)

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.

Fix whitespace.

This revision now requires review to proceed.Mar 1 2019, 3:48 PM
markj added a comment.Mar 1 2019, 3:49 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.