Module Name: src
Committed By: rin
Date: Thu Jul 9 09:24:33 UTC 2020
Modified Files:
src/sys/uvm: uvm_bio.c
Log Message:
PR kern/55467
tmpfs calls pmap_kenter_pa(9) with virtual address with page offset
Bisectioning revealed that the failure starts with this commit:
sys/fs/tmpfs/tmpfs_vnops.c rev 1.142:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/fs/tmpfs/tmpfs_vnops.c#rev1.142
by which tmpfs became to use UBC_FAULTBUSY flag for ubc_uiomove(9).
If this flag is specified, pmap_kenter_pa(9) is called with virtual
address with page offset via ubc_alloc(9):
https://nxr.netbsd.org/xref/src/sys/uvm/uvm_bio.c#616
Most ports seem to neglect silently page offset of va argument for
pmap_kenter_pa(9). However, it causes KASSERT failure correctly for
powerpc/booke. So, truncate page offset there.
Now, tmpfs works just fine on evbppc-booke, and I've confirmed that
no new failures are detected by ATF.
Discussed with chs@. Thanks!
To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/uvm/uvm_bio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.120 src/sys/uvm/uvm_bio.c:1.121
--- src/sys/uvm/uvm_bio.c:1.120 Thu Jul 9 05:57:15 2020
+++ src/sys/uvm/uvm_bio.c Thu Jul 9 09:24:32 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_bio.c,v 1.120 2020/07/09 05:57:15 skrll Exp $ */
+/* $NetBSD: uvm_bio.c,v 1.121 2020/07/09 09:24:32 rin Exp $ */
/*
* Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.120 2020/07/09 05:57:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.121 2020/07/09 09:24:32 rin Exp $");
#include "opt_uvmhist.h"
#include "opt_ubc.h"
@@ -613,7 +613,8 @@ again_faultbusy:
rw_exit(uobj->vmobjlock);
pgs[i] = pg;
}
- pmap_kenter_pa(va + slot_offset + (i << PAGE_SHIFT),
+ pmap_kenter_pa(
+ va + trunc_page(slot_offset) + (i << PAGE_SHIFT),
VM_PAGE_TO_PHYS(pg),
VM_PROT_READ | VM_PROT_WRITE, 0);
}