Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167750139
D23776.id68611.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23776.id68611.diff
View Options
Index: lib/libkvm/tests/kvm_geterr_test.c
===================================================================
--- lib/libkvm/tests/kvm_geterr_test.c
+++ lib/libkvm/tests/kvm_geterr_test.c
@@ -26,6 +26,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/types.h>
+#include <sys/sysctl.h>
#include <sys/param.h>
#include <errno.h>
#include <fcntl.h>
@@ -125,6 +127,15 @@
"error message changed: %s", error_msg);
ATF_REQUIRE_MSG(kvm_close(kd) == 0, "kvm_close failed: %s",
strerror(errno));
+
+ /* sanity check of value read from kvm_read */
+ int sysctl_maxcpus;
+ size_t len = sizeof(sysctl_maxcpus);
+ retcode = sysctlbyname("kern.smp.maxcpus", &sysctl_maxcpus, &len, NULL, 0);
+ ATF_REQUIRE_MSG(retcode == 0, "sysctl read failed : %d", retcode);
+ ATF_REQUIRE_EQ_MSG(mp_maxcpus, sysctl_maxcpus,
+ "sanity check failed: kvm_read returned %d but sysctl maxcpus returned %d",
+ mp_maxcpus, sysctl_maxcpus);
}
#endif
Index: sys/powerpc/powerpc/mem.c
===================================================================
--- sys/powerpc/powerpc/mem.c
+++ sys/powerpc/powerpc/mem.c
@@ -137,7 +137,8 @@
else if (dev2unit(dev) == CDEV_MINOR_KMEM) {
va = uio->uio_offset;
- if ((va < VM_MIN_KERNEL_ADDRESS) || (va > virtual_end)) {
+ if (hw_direct_map &&
+ ((va < VM_MIN_KERNEL_ADDRESS) || (va > virtual_end))) {
v = DMAP_TO_PHYS(va);
goto kmem_direct_mapped;
}
@@ -159,8 +160,9 @@
? VM_PROT_READ : VM_PROT_WRITE;
va = uio->uio_offset;
- if (kernacc((void *) va, iov->iov_len, prot)
- == FALSE)
+
+ if (hw_direct_map &&
+ kernacc((void *) va, iov->iov_len, prot) == FALSE)
return (EFAULT);
error = uiomove((void *)va, iov->iov_len, uio);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 25, 6:43 AM (11 m, 34 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37224722
Default Alt Text
D23776.id68611.diff (1 KB)
Attached To
Mode
D23776: [PowerPC] fix panic reading /dev/kmem on !DMAP machines
Attached
Detach File
Event Timeline
Log In to Comment