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
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 29676 Build 27532: arc lint + arc unit
Event Timeline
sys/powerpc/powerpc/mem.c | ||
---|---|---|
159 | Don't you need to break here too (from the for and the while), instead of returning an error? | |
165 | 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 | A space is needed between ')' and '{'. |
sys/powerpc/powerpc/mem.c | ||
---|---|---|
159 | 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 | Yeah, good reminder. I'll work on that, and it will require more tests. |
sys/powerpc/powerpc/mem.c | ||
---|---|---|
159 |
Are you sure about that? This part is inside an outer while. |