linux/drivers/tty/hvc
Karl Mehltretter 782f4dbd17 tty: hvc: restrict HVC_DCC to ARMv6+ and ARM64
hvc_dcc drives the JTAG DCC via the ARMv6/v7 CP14 debug registers
(mrc/mcr p14, 0, rX, c0, c1/c5, 0 in asm/dcc.h). That encoding is
undefined on older ARM cores, and also on ARMv7-M, but HVC_DCC only
depends on ARM, so it can be enabled on e.g. ARM926 (ARCH_MULTI_V5),
where hvc_dcc_console_init() runs __dcc_putchar() at boot and takes an
undefined-instruction trap before the console is up:

  Internal error: Oops - undefined instruction: 0 [#1] ARM
  PC is at hvc_dcc_check+0x50/0x8c
   hvc_dcc_check from hvc_dcc_console_init+0x18/0x48
   hvc_dcc_console_init from console_init+0x58/0x170
  Kernel panic - not syncing: Fatal exception

Restrict HVC_DCC to the CPUs where that encoding is valid: the
CPU_V6 || CPU_V6K || CPU_V7 set that arch/arm/include/debug/icedcc.S
guards it with, plus ARM64.

Fixes: 16c63f8ea4 ("drivers: char: hvc: add arm JTAG DCC console support")
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260717071616.91423-1-kmehltretter@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-17 13:03:42 +02:00
..
hvc_console.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hvc_console.h tty: hvc: convert to u8 and size_t 2023-12-08 12:02:37 +01:00
hvc_dcc.c tty: hvc: convert to u8 and size_t 2023-12-08 12:02:37 +01:00
hvc_irq.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hvc_iucv.c s390/hvc_iucv: Replace get_zeroed_page() with kzalloc() 2026-06-03 15:32:45 +02:00
hvc_opal.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hvc_riscv_sbi.c RISC-V Patches for the 6.8 Merge Window, Part 4 2024-01-20 11:06:04 -08:00
hvc_rtas.c tty: hvc: convert to u8 and size_t 2023-12-08 12:02:37 +01:00
hvc_udbg.c tty: hvc: convert to u8 and size_t 2023-12-08 12:02:37 +01:00
hvc_vio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hvc_xen.c hvc/xen: Check console connection flag 2026-03-30 17:37:18 +02:00
hvcs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hvsi_lib.c tty: hvc: convert comma to semicolon 2024-09-03 10:47:56 +02:00
hvsi.c tty: hvc: convert counts to size_t 2023-08-11 21:12:47 +02:00
Kconfig tty: hvc: restrict HVC_DCC to ARMv6+ and ARM64 2026-07-17 13:03:42 +02:00
Makefile TTY/Serial driver patches for 4.17-rc1 2018-04-04 18:43:49 -07:00