Page MenuHomeFreeBSD

riscv pmap: allocate leaf page table page for wired userspace superpages
ClosedPublic

Authored by bnovkov on Aug 29 2023, 2:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 24, 3:15 AM
Unknown Object (File)
Sun, Feb 18, 9:41 AM
Unknown Object (File)
Dec 12 2023, 1:25 AM
Unknown Object (File)
Dec 10 2023, 1:32 AM
Unknown Object (File)
Dec 5 2023, 8:42 AM
Unknown Object (File)
Dec 2 2023, 10:42 PM
Unknown Object (File)
Nov 29 2023, 12:10 AM
Unknown Object (File)
Nov 25 2023, 5:27 PM
Subscribers

Details

Summary

This patch fixes a syzkaller issue regarding wired userspace superpages by allocating a leaf page table page for wired userspace superpages.

The original issue is an edge case that creates an unmapped, wired region in userspace. Subsequent faults on this region can trigger wired superpage creation, leading to a panic upon demotion as the pmap does not create a leaf page table page for the wired superpage. D19670 fixed this by disallowing preemptive creation of wired superpage mappings, but that fix is currently interfering with an ongoing effort of speeding up vm_map_wire for large, contiguous entries (e.g. bhyve wiring guest memory) .

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sep 17 2023, 11:22 AM

Is there a reason this hasn't been merged but the versions for other architectures have?

If it's a matter of testing, please let me know.

Is there a reason this hasn't been merged but the versions for other architectures have?

If it's a matter of testing, please let me know.

There are some pmap changes that I've ported over to riscv that we'd like to rebase this patch on top of. I just need to test my patch for that, hopefully this week.

Is there a reason this hasn't been merged but the versions for other architectures have?

If it's a matter of testing, please let me know.

There are some pmap changes that I've ported over to riscv that we'd like to rebase this patch on top of. I just need to test my patch for that, hopefully this week.

The above mentioned changes are in a patch series on phabricator now: https://reviews.freebsd.org/D42287

Also here: https://github.com/markjdb/freebsd/commits/riscv-pmap-improvements

Sorry for the delayed reply. The above-mentioned riscv pmap commits are in main now - @bojan.novkovic_fer.hr would it be possible to rebase on top of that? Then I can commit this patch, and we can finally revert D19670.

This revision now requires review to proceed.Nov 7 2023, 6:14 PM

Sorry for the delayed reply. The above-mentioned riscv pmap commits are in main now - @bojan.novkovic_fer.hr would it be possible to rebase on top of that? Then I can commit this patch, and we can finally revert D19670.

No problem, thank you for taking the time to work on those commits.
I've updated the patch on top of your changes.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 8 2023, 12:32 PM
This revision was automatically updated to reflect the committed changes.
In D41633#969735, @bojan.novkovic_fer.hr wrote:

Sorry for the delayed reply. The above-mentioned riscv pmap commits are in main now - @bojan.novkovic_fer.hr would it be possible to rebase on top of that? Then I can commit this patch, and we can finally revert D19670.

No problem, thank you for taking the time to work on those commits.
I've updated the patch on top of your changes.

Would you like to do the honours of reverting the vm_fault change? :)

Would you like to do the honours of reverting the vm_fault change? :)

Of course! I've created a revision.