amd64: extract uiomove_mem() from memrw() The MD function with MI interface to provide a way to read arbitrary (canonical) KVA. amd64 only for now. Tested by: aokblast
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/amd64/amd64/trap.c | ||
|---|---|---|
| 797 | I believe that the first check for tf_rip makes the shortest path through the condition: userspace must work hard to fault with this specific %rip, and kernel most likely would not fault on safe_read_read with other conditions false. | |
| sys/amd64/amd64/machdep.c | ||
|---|---|---|
| 1868 ↗ | (On Diff #178524) | uio_rw is indeed used. uio_segflg too, if we end up calling uiomove(). |
| sys/amd64/amd64/machdep.c | ||
|---|---|---|
| 1868 ↗ | (On Diff #178524) | IMO it would be better to explicitly initialize uio_td, either to curthread or NULL. |
| sys/amd64/amd64/uio_machdep.c | ||
| 194 ↗ | (On Diff #178621) | So with this check and the DMAP boundary check above, we can only use safe_read() to access the kernel map and direct map. Is that the intent? |
| sys/amd64/amd64/uio_machdep.c | ||
|---|---|---|
| 194 ↗ | (On Diff #178621) | I believe it is enough for the use at hand, D46193. More, returning to the 'faulting' implementation, I now think that it opened the access too wide, it should check at least that the address is in KVA. Of course we can return to the 'faulting' way of doing things for other addresses which cannot be handled by pmap_extract(kernel_pmap). I thought that avoiding adding a check to the page fault path is good. |