Module Name: src
Committed By: maxv
Date: Sat Sep 8 12:40:17 UTC 2018
Modified Files:
src/sys/arch/amd64/amd64: db_disasm.c
Log Message:
Work around dumb KASSERT in vtopte(), the PTE area can now be above the
MAIN area. I guess the KASSERT should be removed because it doesn't make
a lot of sense.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amd64/amd64/db_disasm.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/arch/amd64/amd64/db_disasm.c
diff -u src/sys/arch/amd64/amd64/db_disasm.c:1.24 src/sys/arch/amd64/amd64/db_disasm.c:1.25
--- src/sys/arch/amd64/amd64/db_disasm.c:1.24 Sun Jan 21 16:51:14 2018
+++ src/sys/arch/amd64/amd64/db_disasm.c Sat Sep 8 12:40:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.24 2018/01/21 16:51:14 christos Exp $ */
+/* $NetBSD: db_disasm.c,v 1.25 2018/09/08 12:40:17 maxv Exp $ */
/*
* Mach Operating System
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.24 2018/01/21 16:51:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.25 2018/09/08 12:40:17 maxv Exp $");
#ifndef _KERNEL
#include <sys/types.h>
@@ -1207,7 +1207,11 @@ db_disasm(db_addr_t loc, bool altfmt)
pte = kvtopte((vaddr_t)loc);
else
pte = vtopte((vaddr_t)loc);
- pde = vtopte((vaddr_t)pte);
+ if ((vaddr_t)pte >= VM_MIN_KERNEL_ADDRESS)
+ pde = kvtopte((vaddr_t)pte);
+ else
+ pde = vtopte((vaddr_t)pte);
+
if ((*pde & PG_V) == 0 || (*pte & PG_V) == 0) {
db_printf("invalid address\n");
return (loc);