diff options
author | gonzo <gonzo@FreeBSD.org> | 2017-05-08 20:09:23 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2017-05-08 20:09:23 +0000 |
commit | 572e01a8599a176db6d58cd6d621b534fd6150c5 (patch) | |
tree | 18264ccb48c736b0d4d1aa10bcef3d9e673752b4 /sys/arm | |
parent | 0c7f6f6fad18a504020fb399ded4b6374f218a64 (diff) | |
download | FreeBSD-src-572e01a8599a176db6d58cd6d621b534fd6150c5.zip FreeBSD-src-572e01a8599a176db6d58cd6d621b534fd6150c5.tar.gz |
MFC r310791:
[qemu] Fix VERSATILEPB kernel boot in QEMU broken by r300968
QEMU does not implement hardware debug registers so when
dbg_monitor_is_enabled is called kernel receives "invalid instruction"
exception. QEMU implements only DIDR register and on read returns all
zeroes to indicate that it doesn't support other registers. Real
hardware has Version bits set.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/debug_monitor.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/arm/arm/debug_monitor.c b/sys/arm/arm/debug_monitor.c index 284d077..d5751ab 100644 --- a/sys/arm/arm/debug_monitor.c +++ b/sys/arm/arm/debug_monitor.c @@ -792,10 +792,21 @@ dbg_get_ossr(void) static __inline boolean_t dbg_arch_supported(void) { + uint32_t dbg_didr; switch (dbg_model) { case ID_DFR0_CP_DEBUG_M_V6: case ID_DFR0_CP_DEBUG_M_V6_1: + dbg_didr = cp14_dbgdidr_get(); + /* + * read-all-zeroes is used by QEMU + * to indicate that ARMv6 debug support + * is not implemented. Real hardware has at + * least version bits set + */ + if (dbg_didr == 0) + return (FALSE); + return (TRUE); case ID_DFR0_CP_DEBUG_M_V7: case ID_DFR0_CP_DEBUG_M_V7_1: /* fall through */ return (TRUE); |