This fixes /dev/kmem causing panic on machines not using DMAP.
The issue was found while running "lib/libkvm/kvm_geterr_test:kvm_geterr_positive_test_no_error" test case on QEMU VM without Huge Pages support.
Details
Run 'kyua test -k /usr/tests/Kyuafile lib/libkvm/kvm_geterr_test:kvm_geterr_positive_test_no_error' on QEMU powerpc64 VM with and without huge pages
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/powerpc/powerpc/mem.c | ||
---|---|---|
159 ↗ | (On Diff #68961) | Don't you need to break here too (from the for and the while), instead of returning an error? |
165 ↗ | (On Diff #68961) | IIRC, you have noticed that kernacc() panics when !hw_direct_map and va was in DMAP range, because there were no vm_map's for DMAP range. Instead, we should check if va is outside the DMAP range, or, to match the previous if logic, check if va is inside VM range: |
166 ↗ | (On Diff #68961) | A space is needed between ')' and '{'. |
sys/powerpc/powerpc/mem.c | ||
---|---|---|
159 ↗ | (On Diff #68961) | I decided to not break here because this is a check made prior any read/write, so it's a case of a "hard" error that I would like to return immediatelly. We can set `error=EFAULT``` and break, then rely on "if (uio->uio_resid != orig_resid)" to return the error correctly. Do you have any preference? |
165 ↗ | (On Diff #68961) | Yeah, good reminder. I'll work on that, and it will require more tests. |
sys/powerpc/powerpc/mem.c | ||
---|---|---|
159 ↗ | (On Diff #68961) |
Are you sure about that? This part is inside an outer while. |