Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 ddb/i386: Don't go out of the way to dete...



details:   https://anonhg.NetBSD.org/src/rev/109bd74a83ce
branches:  trunk
changeset: 1021283:109bd74a83ce
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun May 23 11:56:28 2021 +0000

description:
ddb/i386: Don't go out of the way to detect invalid addresses.

db_read_bytes already does this better (but didn't at the time this
check was originally added back in 1998).  Not sure if this code had
the same mistake as the amd64 code causing it to trip over its own
shoelaces, but there should be no need for it here.

diffstat:

 sys/arch/i386/i386/db_disasm.c |  24 ++----------------------
 1 files changed, 2 insertions(+), 22 deletions(-)

diffs (45 lines):

diff -r 38e2fadb872e -r 109bd74a83ce sys/arch/i386/i386/db_disasm.c
--- a/sys/arch/i386/i386/db_disasm.c    Sun May 23 11:49:45 2021 +0000
+++ b/sys/arch/i386/i386/db_disasm.c    Sun May 23 11:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_disasm.c,v 1.48 2019/03/09 08:42:25 maxv Exp $      */
+/*     $NetBSD: db_disasm.c,v 1.49 2021/05/23 11:56:28 riastradh Exp $ */
 
 /* 
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.48 2019/03/09 08:42:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.49 2021/05/23 11:56:28 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -1132,26 +1132,6 @@
        int     len;
        struct i_addr   address;
 
-#ifdef _KERNEL
-       pt_entry_t *pte, *pde;
-
-       /*
-        * Don't try to disassemble the location if the mapping is invalid.
-        * If we do, we'll fault, and end up debugging the debugger!
-        * in the case of largepages, "pte" is really the pde and "pde" is
-        * really the entry for the pdp itself.
-        */
-       if ((vaddr_t)loc >= VM_MIN_KERNEL_ADDRESS)
-               pte = kvtopte((vaddr_t)loc);
-       else
-               pte = vtopte((vaddr_t)loc);
-       pde = vtopte((vaddr_t)pte);
-       if ((*pde & PTE_P) == 0 || (*pte & PTE_P) == 0) {
-               db_printf("invalid address\n");
-               return (loc);
-       }
-#endif
-
        get_value_inc(inst, loc, 1, false);
        short_addr = false;
        size = LONG;



Home | Main Index | Thread Index | Old Index