Date: Mon, 8 May 2017 20:09:23 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317976 - stable/11/sys/arm/arm Message-ID: <201705082009.v48K9NYw021297@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gonzo Date: Mon May 8 20:09:23 2017 New Revision: 317976 URL: https://svnweb.freebsd.org/changeset/base/317976 Log: 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. Modified: stable/11/sys/arm/arm/debug_monitor.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/debug_monitor.c ============================================================================== --- stable/11/sys/arm/arm/debug_monitor.c Mon May 8 19:57:43 2017 (r317975) +++ stable/11/sys/arm/arm/debug_monitor.c Mon May 8 20:09:23 2017 (r317976) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705082009.v48K9NYw021297>