From nobody Sat Jul 25 05:29:19 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70B14390608 for ; Fri, 17 Jul 2026 09:44:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784281453; cv=none; b=dLrdo6SISRqFAhU8AoXxvIrn51vZoJ9gQXWnqp8spws3++PM0GOwtMGlKLVOO6MiIkPraLQLVWfA1PDbJcbSNcCwHYdnaEvTL+GinD9aPw2LCrKpDApIbWMhc8IMRlRssyVhu6oINCx8rGY9jCgviXI1j92vXQuF7/lSCYL/0d4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784281453; c=relaxed/simple; bh=ys1Bnnn/LANGHx4LJ/blN4Y406HHq5JwZRPZZ4WEMSw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=su2n75XSOzED+aiaQ/AB8XOLQsJN0WP21CIXfF2X8pu0Dj8pphySqto/hH8OQ/zDz06aelKiunzlwUYIGDC/uw/Y1BI8Gy5zXjr+2SXe6aZ8TQJ/HOWydNuF6BvsoWzSkYJoAxOuiUZgkDz6UxnARGY+OEFKR0WmX7h7S/WyPpY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ex9Nd7Gv; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ex9Nd7Gv" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-493d92b7db3so32195935e9.2 for ; Fri, 17 Jul 2026 02:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784281449; x=1784886249; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=rfVvhbBQ4LOML2JmIul+hMSx6zjHvq6VT6JmZI2Uurg=; b=ex9Nd7GvJ++2V2bwVoAfdgM0O2i3f1mecr3j/1CHjAsrK8ZBGKOef9qImNc2NP6IkN N+U4A9/TWovrJoY/fC5kUdH0mTl16j0vKyeLG7EAP3X7X/nmWiPVxLPDRRuq8vXeEOtI EtBlNV1HoPIPGcB6ft/7WOv5vL6L1oODfhmwfAgH5BHRKoAIH2AfLYc62xUjQUZ2QGNn 0fhVLvsybcMTZYGsgw3VEivYZNDNgn+rtsm07aFtIjb5zvVYqwg28viglyE7atIQffTO on48Z0RYx1K08jFkF+Dodf9/N9FNMJ7MgjwjQLu6uxoi+KycgcNnv6IQl7uTOsmWCjt0 Dcvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784281449; x=1784886249; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rfVvhbBQ4LOML2JmIul+hMSx6zjHvq6VT6JmZI2Uurg=; b=O+tOB2VX4+aO38gryjyvbjJ4wASNNE/vlTDHXakk6WAkdU3rg46J8C6sy3Hb4+aUZC uWZmlo0zcQ7xVp9uNx2kemCkstnCLl7FmuQdcEC0FAVUdQhWBGeTstBUQkhAcFfrAXKO B3p31fpmLpaJljwM4lCFtwIEA6AekWVC5CWQbWN/JUN8G0IJSI2Ln0wO3rwXH7HbIvlA /n3cr8y2tEL5p8A7hfD902OkNQUHqWy8VsSuHIEAD+q9la6wI740DgD3fU+nZwnjDfS5 L33OHTOSAzaZN7yFlaii6A3a14xmYXSmDzMSt2FTRv24/0EeFKiqxazusM6WwKlu3yLx RuQQ== X-Forwarded-Encrypted: i=1; AHgh+RoM3cxidxv5Yd2p0Rmhoi8DvMLMk/qdSkvSCuji3+vSL1YDrBH7snbZt7S4CZz4dmtANPMU8dJfnGpoPKk=@vger.kernel.org X-Gm-Message-State: AOJu0YyFAYpKZkMYWBhVivBy+RBASr2HiF4w4EVbLrbJJsCRWFeqOFZe 3vN1c0Ob0P93EVQpDhZBW1ZVWIeXGhD0pM1eC7v/GI8Jh2n/8QjQYHcZ X-Gm-Gg: AfdE7cm3hgFcf+tc3PJ9TXKbz9Eq0+rTO7ETet574MiB1RL6VLlMEtoJjI4qCY25g/n ZCVPUvQwTd0zjkXiDlQpeuBP8XfB+9wZgSC7Uep5dIw/SExHsym+FFqp7sHTXd9dMKBQl6trZUO Vq7Kw4VRbwy3ajDiv9YNatomghw36V3gsZVDvxbzZuy8GNQ1P3tmZkqHWC1uboi3f7EQH5lW4Wl ZKjwyFZoZm+w0cqJklsB2X4/MeIWqD5T8ugKGhNDYmP+J/Tep5juspKfQ20z66UPBbu073q8AIy gOFX9LFxRMHFapb6bJxBhucjb11TYGE5qVA99L57H3IHSc4Us1TyJwwvI+ZLFPdTNKYAjwhazW4 7cwM4tHVgx3xElD+xYUIl4nTB3wVAnJTg3Q9T0h3NRPvF/i3jyPeiQ/Q9mgOKdYd4MefAt5qeD2 6H7dPsSe+pRE4uV1k/P7YzpKQfe17fmk+5isLy+2K54hNJkka7Ix/IsVrKzLNhfb6jbkiV+HN/q j4r51h5o14LO7bkoqS+MyC/h73dUAcZxJ4gOooS5F1MDjMxLdyDmuEdIJ7QnRx7ADDStOvMnmsL Gk23GweN7w== X-Received: by 2002:a05:600c:6a0b:b0:493:c453:6002 with SMTP id 5b1f17b1804b1-4954a516453mr13102905e9.35.1784281448075; Fri, 17 Jul 2026 02:44:08 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a02-3100-a56c-5c01-55c4-777b-77ab-69e3.310.pool.telefonica.de. [2a02:3100:a56c:5c01:55c4:777b:77ab:69e3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4954966a033sm30243855e9.0.2026.07.17.02.44.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 17 Jul 2026 02:44:07 -0700 (PDT) From: Karl Mehltretter To: Greg Kroah-Hartman , Jiri Slaby Cc: Arnd Bergmann , Nicolas Pitre , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Karl Mehltretter Subject: [PATCH v2] tty: hvc: restrict HVC_DCC to ARMv6+ and ARM64 Date: Fri, 17 Jul 2026 11:44:00 +0200 Message-Id: <20260717094400.67501-1-kmehltretter@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. COMPILE_TEST keeps the driver buildable on the excluded cores, where the p14 encodings still assemble. Fixes: 16c63f8ea49c ("drivers: char: hvc: add arm JTAG DCC console support") Signed-off-by: Karl Mehltretter --- v2: add COMPILE_TEST to keep arm build coverage, per Greg's comment drivers/tty/hvc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig index c2a4e88b328f..51320f2f9a3f 100644 --- a/drivers/tty/hvc/Kconfig +++ b/drivers/tty/hvc/Kconfig @@ -79,7 +79,7 @@ config HVC_UDBG =20 config HVC_DCC bool "ARM JTAG DCC console" - depends on ARM || ARM64 + depends on (ARM && (CPU_V6 || CPU_V6K || CPU_V7 || COMPILE_TEST)) || ARM64 select HVC_DRIVER select SERIAL_CORE_CONSOLE help --=20 2.39.5 (Apple Git-154)