diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-12-12 00:03:05 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-12-12 00:05:16 +0100 |
commit | 3c26c30fd2a5bdec081384d45e42a7ea4e424846 (patch) | |
tree | f9a526dce882145a8948c1dafc1d9f9897dfd2c6 /i386 | |
parent | 6a643459ea45594d91984d0ad98e8d2d5fa7ca5a (diff) | |
download | gnumach-3c26c30fd2a5bdec081384d45e42a7ea4e424846.tar.gz gnumach-3c26c30fd2a5bdec081384d45e42a7ea4e424846.tar.bz2 gnumach-3c26c30fd2a5bdec081384d45e42a7ea4e424846.zip |
copy_to/from_phys: fix non-page-aligned case
The vaddr field of the returned map only points to the base address, we
have to add the offset within the page before reading/writing.
This fixes accessing tasks different from the current task, and
the user part of ddb backtraces.
Diffstat (limited to 'i386')
-rw-r--r-- | i386/i386/phys.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/i386/i386/phys.c b/i386/i386/phys.c index a5c3a15c..e864489f 100644 --- a/i386/i386/phys.c +++ b/i386/i386/phys.c @@ -128,7 +128,7 @@ copy_to_phys( if (mapped) { dst_map = pmap_get_mapwindow(INTEL_PTE_W(dst_addr_p)); - dst_addr_v = dst_map->vaddr; + dst_addr_v = dst_map->vaddr + (dst_addr_p & (INTEL_PGBYTES-1)); } else dst_addr_v = phystokv(dst_addr_p); @@ -160,7 +160,7 @@ copy_from_phys( if (mapped) { src_map = pmap_get_mapwindow(INTEL_PTE_R(src_addr_p)); - src_addr_v = src_map->vaddr; + src_addr_v = src_map->vaddr + (src_addr_p & (INTEL_PGBYTES-1)); } else src_addr_v = phystokv(src_addr_p); |