From nobody Sat Oct 24 14:06:33 2026 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 479A44AC17E for ; Thu, 15 Oct 2026 10:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059850; cv=none; b=XhPWR9TdniBfHzTukh/e3gmrjQ9Dip7MNj6mfPGUAPY7ehgQGzc6+j1jx94HVrUeb/0XcQ1unwX5JnlujBodnS4z/+6gxbgQycpYa1PKbcoOlM/rfRueryGNlYUnWtScBZFqdtLfIZVOo0ET0CtZ89hB2MGvkSWuQkY6rYQYqYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059850; c=relaxed/simple; bh=0Dams8yhDKRdt2LapkcleFLfxS6mpwRM4s1oYHTD54s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lIF0bK/EPIww4XxytuYl7imGie4xm0JvHYX3HQwtdpHc9aXeZefkHkQnihwHsIdnndMk9Eb/AKXoSw0DAUsyUZVlPcg1NSJNYkFmijFGvji4COMw9KyLEaRzDkk6zdSurCaEg6Lmz/RS78Xtmh06DG4Ik6yFgcwWFu9PE6Oi54M= 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=ekV7gGL5; arc=none smtp.client-ip=209.85.218.52 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="ekV7gGL5" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-c2e69aa07c3so295715666b.1 for ; Thu, 15 Oct 2026 03:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792059847; x=1792664647; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZjcAwhXe9YAn5uo+Rr2PV+mZ56EMyAKAQzi8CgIvfOg=; b=ekV7gGL508Iu6wNHLNY1kbfjkYz75LVA3HrzUgzJSxt7bbcRevCvKcbEIl67+6fgpd dxbh68HrDjpV41CnzU0D5dGhI6u93UlHpUuUdgLB8WnWAG9hKGjv2M8XwKg7lF8aEubS p8jYP8NZt+VlLM2FER5nPJ1nUzYoCYOBT05DeXtZEnXBt5VjYhRe+MhsYSjL+8SJGF2W yUuFs6N5Strw+3Lgiz7Z/ZaMSmdce1okmmOfUx/fH50OCDFp2mgcsn6Z4DssjyoUk9OC dQWIpSerh5nQLHb9fspMpI2w8DLYnMLqdhcbHyb/6+RQIeoPTJqFKRs0IIOUPiOEv+n/ FdeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792059847; x=1792664647; h=content-transfer-encoding:mime-version:references:in-reply-to :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=ZjcAwhXe9YAn5uo+Rr2PV+mZ56EMyAKAQzi8CgIvfOg=; b=FCXc+gjHDj0mlP95Bi9itfduMwKGM2sNsh2HTlp5IsFRi2tbHIAnwMOZfQdvqpdtML WRZymkO2apxL/FcBffUmAtl8EezFNkcOyC+7LpOHJ1FU6WfzDngHt+i5wtlRC981/VoU w0dUmmsCMaQkkXE/yotY3KolK40cgPMxEeoMhnDPYliWKMTxulZT2nFx91KG237SfH4l T+bgLEvxUTs7G5pulx+0uFKbkijw6QK7mGn8ZDCLQVKhIMcn4EgixFToZKVM9790NoD7 Wbl71eSlDxw9RnvoKMsNoIFhKdbGM2RHTDncG/7TQjc5v6q0+JVTqKio0v/HY37LvYjY iimw== X-Forwarded-Encrypted: i=1; AKwUvBxCB1zw9ugLPOHgR9DG5YgBaGNmearJwHGGvWfizZfkMX1ThwMFW9tTS/Kq4DUlLRla6QKZETNZ320fEYw=@vger.kernel.org X-Gm-Message-State: AFq9FYIxfK14n9I6rLz+Nv1XfnZh9AEQVn0dQ0MHlRyJRfktr50D7G1t /PPwA/Hz6/3x6AnIWd3t0lzoc51E6LbLCej+4+D0tTjwbK4mUhgDH9HY X-Gm-Gg: AYBFou1FPBON9irWqVfPR3qaD0uq+5g9hYIdhnqCtWLIL1dzaAfjHxnyKU0WaDHD3zo tp6ZN+iKqp7Njcpazrx9w7LCS8X3+lVSCpSiGONe+6oUoQBe3uT67ekIGIQV8cvbx4oAyBVeRdK dFgcFcTUzOk8ozghJn1fBYkJREWx6/DLzkTO2OPnTvEXDrptRegzTv3Su8G0ge8GcygWQKm1QQj +Jfn/CAddG1YT36yw30XpK+6Iv5Llq+qKu6lPi5aAzBDsh+4YIJyljSnagKJor/BLaPu9V2rPUR f+w1E+ZvRYu/HSQlnhH84fVCDe9GvaMjPUuAj6NhzTfbQJ0Deqb3R9uaPZWvWcemNd1xiudpNke CA7vVQ8+Qb83ykCET1r2SpuJnvGY44c0OMXl1emM+dHw9tUh+sbZGLVAaQwO5Y7D16zxYkbrFUN 3BQL3NIYMZPdC7oZlq8CRKfqIHwDYNQC9XgDw25P8kntfhux9mqx4hibwa8rxur+yDzgmQfQ20s lelgTQlZ3LdeIVhtXXgeAX5nI2CtyfwCbA2TNiL X-Received: by 2002:a17:906:4796:b0:c34:d75b:dde0 with SMTP id a640c23a62f3a-c34d75be9famr1139276466b.20.1792059847402; Thu, 15 Oct 2026 03:24:07 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c3edab13f4esm108371766b.87.2026.10.15.03.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2026 03:24:06 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com Subject: [PATCH v8 1/6] alpha: move Tsunami machine check handling to err_tsunami.c Date: Thu, 15 Oct 2026 12:22:50 +0200 Message-ID: <20261015102353.999695-2-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261015102353.999695-1-linmag7@gmail.com> References: <20261015102353.999695-1-linmag7@gmail.com> 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" Move the existing handler and PCI error clearing helpers without changing their behavior. Build the error objects for ALPHA_TSUNAMI so that all Tsunami configurations, including non-generic Shark, can use them. Signed-off-by: Magnus Lindholm Reviewed-by: Matt Turner --- arch/alpha/kernel/Makefile | 4 ++- arch/alpha/kernel/core_tsunami.c | 34 ----------------------- arch/alpha/kernel/err_tsunami.c | 47 ++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 35 deletions(-) create mode 100644 arch/alpha/kernel/err_tsunami.c diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile index 4ea5c189e60e..a453e487b9d0 100644 --- a/arch/alpha/kernel/Makefile +++ b/arch/alpha/kernel/Makefile @@ -39,7 +39,7 @@ obj-y +=3D err_ev7.o err_titan.o err_marvel.o endif =20 obj-y +=3D irq_pyxis.o irq_i8259.o irq_srm.o -obj-y +=3D err_ev6.o +obj-y +=3D err_ev6.o err_tsunami.o obj-y +=3D es1888.o smc37c669.o smc37c93x.o pc873xx.o gct.o obj-y +=3D srmcons.o =20 @@ -89,4 +89,6 @@ obj-$(CONFIG_ALPHA_MARVEL) +=3D err_ev7.o err_marvel.o obj-$(CONFIG_ALPHA_NAUTILUS) +=3D err_ev6.o obj-$(CONFIG_ALPHA_TITAN) +=3D err_ev6.o err_titan.o =20 +obj-$(CONFIG_ALPHA_TSUNAMI) +=3D err_tsunami.o + endif # GENERIC diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsun= ami.c index fc1ab73f23de..d435ec9fb828 100644 --- a/arch/alpha/kernel/core_tsunami.c +++ b/arch/alpha/kernel/core_tsunami.c @@ -448,37 +448,3 @@ tsunami_kill_arch(int mode) if (TSUNAMI_cchip->csc.csr & 1L<<14) tsunami_kill_one_pchip(TSUNAMI_pchip1, 1); } - -static inline void -tsunami_pci_clr_err_1(tsunami_pchip *pchip) -{ - pchip->perror.csr; - pchip->perror.csr =3D 0x040; - mb(); - pchip->perror.csr; -} - -static inline void -tsunami_pci_clr_err(void) -{ - tsunami_pci_clr_err_1(TSUNAMI_pchip0); - - /* TSUNAMI and TYPHOON can have 2, but might only have 1 (DS10) */ - if (TSUNAMI_cchip->csc.csr & 1L<<14) - tsunami_pci_clr_err_1(TSUNAMI_pchip1); -} - -void -tsunami_machine_check(unsigned long vector, unsigned long la_ptr) -{ - /* Clear error before any reporting. */ - mb(); - mb(); /* magic */ - draina(); - tsunami_pci_clr_err(); - wrmces(0x7); - mb(); - - process_mcheck_info(vector, la_ptr, "TSUNAMI", - mcheck_expected(smp_processor_id())); -} diff --git a/arch/alpha/kernel/err_tsunami.c b/arch/alpha/kernel/err_tsunam= i.c new file mode 100644 index 000000000000..1045b920fa6b --- /dev/null +++ b/arch/alpha/kernel/err_tsunami.c @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Machine check handling for Tsunami/Typhoon systems. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include "err_impl.h" +#include "proto.h" +#include "pci_impl.h" + +static inline void +tsunami_pci_clr_err_1(tsunami_pchip *pchip) +{ + pchip->perror.csr; + pchip->perror.csr =3D 0x040; + mb(); + pchip->perror.csr; +} + +static inline void +tsunami_pci_clr_err(void) +{ + tsunami_pci_clr_err_1(TSUNAMI_pchip0); + + /* TSUNAMI and TYPHOON can have 2, but might only have 1 (DS10) */ + if (TSUNAMI_cchip->csc.csr & 1L<<14) + tsunami_pci_clr_err_1(TSUNAMI_pchip1); +} + +void +tsunami_machine_check(unsigned long vector, unsigned long la_ptr) +{ + /* Clear error before any reporting. */ + mb(); + mb(); /* magic */ + draina(); + tsunami_pci_clr_err(); + wrmces(0x7); + mb(); + + process_mcheck_info(vector, la_ptr, "TSUNAMI", + mcheck_expected(smp_processor_id())); +} --=20 2.43.0 From nobody Sat Oct 24 14:06:33 2026 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 1F566515880 for ; Thu, 15 Oct 2026 10:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059853; cv=none; b=Ai9j2u1r3zWee5T3nsfuYOnz88O9k2JQrNR05MNjI+cxWS8ubcA17OlgNrr0MWu69eiT+Imbt1FC5QicFqeUALPJREH5gfyixRpeRAsYaZUCCbpJaHJAW9Uv6o5coM6nPP1qKaUoHw3SZ0kl9HJyx3jn+0hxCcNxXGd9o1VvLhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059853; c=relaxed/simple; bh=pGvPZxYQqsPDT0NieGlqMGA1j1B4VhkvXqUEbOfXDks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nu9BMu76+hWasfDeXRXQ2ZAnsXRIk14+/rfuJ9alr4i35BBmq+P4kIrmS7jpAM+Nea8oMwyWvHD3dsM8aSjrQ/+ekL2CVKkV1guRxckU17M3M/Ru8itCJ7ho6UaFVA5OCqPPFNU26srbOgvgQU1C8Gb7L17k2Ts4Iho+iDW6lhs= 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=LpxKabw0; arc=none smtp.client-ip=209.85.218.45 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="LpxKabw0" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-c3f5e5e4c1dso48187866b.1 for ; Thu, 15 Oct 2026 03:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792059850; x=1792664650; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ED82b6L34mz4qhKpVZQtr88/BQW1IKL21JdDQLu4khk=; b=LpxKabw0qPmFJKl1+ST4agaLcAkK2YZ5c1iz4GakhNp6VBConLgnqf0SVDG5RDAbAa 1NoumD4XG5nmijOoqxtzCKDAIaFW+vUn8v5CxDxybI2f5Rm1id2HdxLuE+kA2Bfu2ZCs BeVNE3hDMjMU3k3305ZsNER2a2p8LD8OwE3SUpCltdC6usJsKxJZpXhUICs8tzS/qC8M 46D/zMfc4NArdjxSnY6i0uYm5n29w70+nsuXm5j1qa6VMWbA826tySAN2G1Qx9hc6Q7o lRWgmZbgIy65ESRvhFOQCUz+5dAHd/61AALJGgl2ZRglS/gSTUrryKJsmWQky54DoBCh j83A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792059850; x=1792664650; h=content-transfer-encoding:mime-version:references:in-reply-to :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=ED82b6L34mz4qhKpVZQtr88/BQW1IKL21JdDQLu4khk=; b=dj2DymjSFk9ogM1UVqmXAA2fqo/eC2BMRXCpVdKXFXDGtk148YCRlwn2nNkxMCM8uQ x4MEyUPSppqL0T7ORzSPSaq+JhTuSkJlec+kFQMwLGleCRyjsTGUGR+8x2vEwIpuSxdb smcnlLQuVdjn8wdLE/4x+3y7q5Nunk7ifPYKcYiBIchM85IrNzKsrOkL4d2tMPv+V3fz eEMsPwXMgM74B5h5iT5EZpBHv8bR2YHw3ekJkUY3iPuaCKizYXmbtDlp63W8Nvfym+eY 16O1t/LVt7yoyeQRefoHrv4rWmXuh9hmCxAVvjDRE6CG+4doMGDaUXRNOIqfuuo6ShcO CNoQ== X-Forwarded-Encrypted: i=1; AKwUvBwMHzTvCadLkFveIO2VD9y78KU2deY3Il9ZsVqu7cptkBCNac65+fU0upZ9m7fHGtLOpz6oG7W7K6/6WY0=@vger.kernel.org X-Gm-Message-State: AFq9FYJHfbuWi/oyQ8pp35O+BwbFMghDUNMmFr3fEhUn6Qol6T5xzmEv PbMpfLyqZ1MpdmEZRoBC0afVk3RW+lTdea30XDxkLXb4zEf+KvsX+s0B X-Gm-Gg: AYBFou34elnip0Y4HxTS9Vi0Cvej39RM/BVRnCAcyTOLSqFtQsMaIi72SuJyAsl7/CS Gy0WefXNVLcYDRQY3zIY7/3b6ZSgAMfYg8fwhvfpBKOv/CX4Jd5ZfkRvy2yHn8iWDPZQFBvco3w SaipOfmjOV68WGvzWWd1b343EJkoClow1n/leisrg9wqycTFp+mbnPACeI/1/OK+8kr1v1ZHS7U K8h8TT2Q149kkirewq7Hg0MgIJ6xfPCK5re8kbEbr4XSRp4yl8bfVJgiWuNe0uZtMmhAqdYlHl7 aAak+3a7CTYULRyS0vydPnB/s5e1HaGOQ2D2cHsvLK0k0y75fcrgk0SyYzDYGLupxfD2o1yD4y8 tJpJPIHPXZ46GKMNL+gA6dsh47ljDIQuTogd0xb56xahLTdkH8yMypDouV2oa8eiPE6V1rU/+yb hIrGS7rKOw93a1V8g60XZ6BTxEffYzEl0bqSDHQ1FaYJRPLTNSLY+5/JM7gfnsvcsL8v2U3SFVb /+IoIlut01u5sCalcZ7Ogbgemj6Eb0LrIMmIHv6VA== X-Received: by 2002:a17:907:e916:b0:c3f:84aa:af0d with SMTP id a640c23a62f3a-c3f84ba35f3mr84289166b.18.1792059850126; Thu, 15 Oct 2026 03:24:10 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c3edab13f4esm108371766b.87.2026.10.15.03.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2026 03:24:07 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com Subject: [PATCH v8 2/6] alpha: describe the Tsunami system machine check frame Date: Thu, 15 Oct 2026 12:22:51 +0200 Message-ID: <20261015102353.999695-3-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261015102353.999695-1-linmag7@gmail.com> References: <20261015102353.999695-1-linmag7@gmail.com> 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" Define the five system-specific quadwords in the SRM logout frame, as documented in the AlphaServer ES40 Service Guide, Table D-19. Signed-off-by: Magnus Lindholm Reviewed-by: Matt Turner --- arch/alpha/include/asm/core_tsunami.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/alpha/include/asm/core_tsunami.h b/arch/alpha/include/asm= /core_tsunami.h index 3391e95754f2..fe3fd4570fac 100644 --- a/arch/alpha/include/asm/core_tsunami.h +++ b/arch/alpha/include/asm/core_tsunami.h @@ -283,6 +283,11 @@ union TPchipPERRMASK { * Data structure for handling TSUNAMI machine checks: */ struct el_TSUNAMI_sysdata_mcheck { + u64 sesf; + u64 dir; + u64 misc; + u64 p0_perror; + u64 p1_perror; }; =20 =20 --=20 2.43.0 From nobody Sat Oct 24 14:06:33 2026 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 DD2CD516152 for ; Thu, 15 Oct 2026 10:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059854; cv=none; b=ReGuz5EsuCUr3LHz2ymLzGz+GhBmS/LIbctay0PM92Dgc1Kf7zhTGhmZruoUfaTAlJDPTtTgxIM48X5Nn4QQ+nCsuO2oGoBZmzMV9HZ67fQ60W2FFr7B8z9QTCYLCbSv/geqXcYB0tQ+ai/aRU0Zgejs3OL7MM4OnrH+pCl+9ec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059854; c=relaxed/simple; bh=mYsd403UguRpErjneRCONzy9EwzsT+JCk5m6pugKqy8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p8nWtw2yDXUxsiVJXJQQAyLPyvMfGwldTeOG8L/yEEWp6Prw39S9E23R7swbF+3AgqUt5Arc38Cxugq4Bvu07/wLB78GAxY+a+zPuSs5nuxGfNhziwGaE+BbKULOIid6W4tNxFG5SUuR7o4NC1keByAaPwI/UEOfCKpewcRxZyw= 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=qk5JODL2; arc=none smtp.client-ip=209.85.218.42 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="qk5JODL2" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-c3156e7705cso330662366b.1 for ; Thu, 15 Oct 2026 03:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792059851; x=1792664651; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wA5IrwmhjCels3NLWyd4qYpH5Gev6ZGf3R+/qrMipb0=; b=qk5JODL2gWH/Hu6l7rXj3P6pF9agKGy0LS6ELtcyHVKNTZUFokwU5vgXH+Ax/+WWtb w1qEF5Q1xS9d+0iLqa8+J4/egXE8EmP6m/UmSF0D1j+vB68uokUeGeNoPhtTXBme0dRR 9uEq9KU/cVPL1tdipCTwjJV8MDwITKeXZ8SA9QJni3U9Sn4/+9kI//77dAaMeRPzjDGl 3SlNJE+E84MonpwL2t3IR67Ll4/xkvlA8kam9QdHCz7QQUNHi0NzR52AGqaET/AB2T8/ JbM1Owvwqgapj3IpLPXDousMOhyOYmwSkhuLBHGKH7uygdpEcbmKEiIngdfk6KD7s8Wh rDYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792059851; x=1792664651; h=content-transfer-encoding:mime-version:references:in-reply-to :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=wA5IrwmhjCels3NLWyd4qYpH5Gev6ZGf3R+/qrMipb0=; b=bWNJOiR95bEULK7p8w1qy4DOvlti6IlDU4UGvOseoPoNRi4h3cDIXGfhVF6HQ85fU2 aCNA0zfo4/ymdRW5TIyV9OB4VCrJNZ7LQXLjv4BqYHip+t3p+HgwIjxyusr8a/NZHgah 0zt0deSMdqOrhASmF1kHP13O8ICBx60Stk0YWeUXOIF/TWnJR0jnyNN1gPZx/P2dNuI9 IZrnHCH3VIsmiZjFoDCd90OJqQ2WOflcLlmtTkVLZE1NfizVgmnHZ1IlwfxotcxdBbfN 4B0tiUrpMhFjJZ+42641GdKHPhNR7uSD0K1i+kIe0HdAsEXR1bMm6feRAnBhUpCFlW0n f/mg== X-Forwarded-Encrypted: i=1; AKwUvBwLTfHswauWxglXOmrjIY2zzCU1ZUe9F2nNz4QkndkJTwMcZnhjCchH9fp7DggDBB36uvLl+vuplfnb+tA=@vger.kernel.org X-Gm-Message-State: AFq9FYIOZ2eChF+yUlYPBMQxD+eMAOLQ8GLzEKdlVqcoxBjh3W1MKvAI Ta9y1whplMsKj+WhCksZJJXI3qnd/Vl/ndoRNeVBmDSZsABOO9qoH+8SElGee4i4 X-Gm-Gg: AYBFou1eFy/dLEDTlONvCLbZjwh7UBX1WyBGTx1hCYx0IULH126OyweyCD52pfjp7Ro ukWT3jL1RGnyX2VAmXphV4A5SQYxihlmXTlyGSJXjqod2InIGfmt6cwZlfTVNGDnR6w8tg3OLqi ATP6b0hQvHr5oS3QNgQzqCQBTUXzway+mcGoxcMMxTWu+okTvoiGM7XEFar3kuanEv41qszx+F9 uJee+Gy3wLQTqY0emfRy9SW6JuZm83NwKmS0Zn6VWXPJm/abOPUTJYxBd0BGAglacpSSi8fyXlT EFQG6OOx4DBHDZJ3baTi2v83gpn38ytBz0VtzFVG6sQUjW/OUfnpPBzef9nxuF4XQL3yhipzgbh UqowgqreANv7eQSBsNoih6eQTwQf4bUsmEEomjeS9xZO46tiYyDvNXTNgXjaDDQzcSyI800FX4G AeosiofVlNXO3oI/J/MFADNBTg5jHrPXqojcgeYWU86kDEgzolNnez6yuA6CqosIN0VnZNNsxmV ZtsSDseJDOCttPE2ZyuzRPa1jHh8Q/0ZVXyiOqlmQ== X-Received: by 2002:a17:907:3d48:b0:c29:659e:2fd6 with SMTP id a640c23a62f3a-c31a9fc1522mr1869085666b.10.1792059851048; Thu, 15 Oct 2026 03:24:11 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c3edab13f4esm108371766b.87.2026.10.15.03.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2026 03:24:10 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com Subject: [PATCH v8 3/6] alpha: bound EV6 logout decoding by the processor area Date: Thu, 15 Oct 2026 12:22:52 +0200 Message-ID: <20261015102353.999695-4-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261015102353.999695-1-linmag7@gmail.com> References: <20261015102353.999695-1-linmag7@gmail.com> 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" The ES40 Service Guide, Table D-19, documents a correctable frame with its system area at 0x58 and total size 0x80. The existing EV6 decoder interprets system words as extended CPU registers and reads past its end. This establishes the layout for ES40; whether Titan and Nautilus PALcode also emits this short frame has not been verified. Validate the processor area before decoding it and only print extended registers when present. Preserve rejected frames with a raw dump rather than trusting their invalid offsets. Cap the dump at 1 KiB and round down to complete quadwords. This still relies on firmware supplying an accessible frame of its advertised size; the cap is not pointer validation. Signed-off-by: Magnus Lindholm Reviewed-by: Matt Turner --- arch/alpha/kernel/err_common.c | 13 ++++++++++++ arch/alpha/kernel/err_ev6.c | 38 +++++++++++++++++++++++++--------- arch/alpha/kernel/err_impl.h | 1 + 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/arch/alpha/kernel/err_common.c b/arch/alpha/kernel/err_common.c index 94e1b3dcf6d4..9271ea425a7b 100644 --- a/arch/alpha/kernel/err_common.c +++ b/arch/alpha/kernel/err_common.c @@ -44,6 +44,19 @@ mchk_dump_mem(void *data, size_t length, char **annotati= on) } } =20 +/* Preserve rejected frames without trusting their internal offsets. */ +void +mchk_dump_logout_frame_raw(struct el_common *header) +{ + size_t length =3D header->size; + + /* Bound diagnostic output and never read a partial final quadword. */ + if (length > 1024) + length =3D 1024; + length &=3D ~7UL; + mchk_dump_mem(header, length, NULL); +} + void mchk_dump_logout_frame(struct el_common *mchk_header) { diff --git a/arch/alpha/kernel/err_ev6.c b/arch/alpha/kernel/err_ev6.c index 8144f2045b5b..f12299ae1f24 100644 --- a/arch/alpha/kernel/err_ev6.c +++ b/arch/alpha/kernel/err_ev6.c @@ -190,6 +190,25 @@ ev6_process_logout_frame(struct el_common *mchk_header= , int print) (struct el_common_EV6_mcheck *)mchk_header; int status =3D MCHK_DISPOSITION_UNKNOWN_ERROR; =20 + /* + * ES40 correctable frames end the CPU area before EXC_ADDR (Table + * D-19). Validate both regions before decoding or dumping any data. + */ + if (mchk_header->proc_offset !=3D offsetof(struct el_common_EV6_mcheck, + I_STAT) || + mchk_header->sys_offset < offsetof(struct el_common_EV6_mcheck, + EXC_ADDR) || + mchk_header->sys_offset > mchk_header->size || + ((mchk_header->sys_offset | mchk_header->size) & 7)) { + if (print) { + printk("%s Invalid EV6 logout frame: size %x, CPU %x, system %x\n", + err_print_prefix, mchk_header->size, + mchk_header->proc_offset, mchk_header->sys_offset); + mchk_dump_logout_frame_raw(mchk_header); + } + return MCHK_DISPOSITION_UNKNOWN_ERROR; + } + status |=3D ev6_parse_ibox(ev6mchk->I_STAT, print); status |=3D ev6_parse_mbox(ev6mchk->MM_STAT, ev6mchk->DC_STAT,=20 ev6mchk->C_STAT, print); @@ -203,16 +222,15 @@ ev6_process_logout_frame(struct el_common *mchk_heade= r, int print) if (status !=3D MCHK_DISPOSITION_DISMISS) { char *saved_err_prefix =3D err_print_prefix; =20 - /* - * Dump some additional information from the frame - */ - printk("%s EXC_ADDR: 0x%016lx IER_CM: 0x%016lx" - " ISUM: 0x%016lx\n" - " PAL_BASE: 0x%016lx I_CTL: 0x%016lx" - " PCTX: 0x%016lx\n", - err_print_prefix, - ev6mchk->EXC_ADDR, ev6mchk->IER_CM, ev6mchk->ISUM, - ev6mchk->PAL_BASE, ev6mchk->I_CTL, ev6mchk->PCTX); + /* These registers are absent from short correctable frames. */ + if (mchk_header->sys_offset >=3D sizeof(*ev6mchk)) + printk("%s EXC_ADDR: 0x%016lx IER_CM: 0x%016lx" + " ISUM: 0x%016lx\n" + " PAL_BASE: 0x%016lx I_CTL: 0x%016lx" + " PCTX: 0x%016lx\n", + err_print_prefix, + ev6mchk->EXC_ADDR, ev6mchk->IER_CM, ev6mchk->ISUM, + ev6mchk->PAL_BASE, ev6mchk->I_CTL, ev6mchk->PCTX); =20 if (status =3D=3D MCHK_DISPOSITION_UNKNOWN_ERROR) { printk("%s UNKNOWN error, frame follows:\n", diff --git a/arch/alpha/kernel/err_impl.h b/arch/alpha/kernel/err_impl.h index 737b958a586d..5bef23a00942 100644 --- a/arch/alpha/kernel/err_impl.h +++ b/arch/alpha/kernel/err_impl.h @@ -47,6 +47,7 @@ struct el_subpacket_handler { extern char *err_print_prefix; =20 extern void mchk_dump_mem(void *, size_t, char **); +extern void mchk_dump_logout_frame_raw(struct el_common *header); extern void mchk_dump_logout_frame(struct el_common *); extern void el_print_timestamp(union el_timestamp *); extern void el_process_subpackets(struct el_subpacket *, int); --=20 2.43.0 From nobody Sat Oct 24 14:06:33 2026 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 EEDF5511E73 for ; Thu, 15 Oct 2026 10:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059859; cv=none; b=bwjmNwKqG1zvUaOr4o/XV5ar87sSkRyZmrivbwR3Qlui703QctQ3dBijjE3Q4fs4/DyyFmRHmPxhv0yLgtZTdlM86JBk9HgacSZBer/M8P3YUofAnvOzEhWouD8rVH5PHv7kK6AlcdOV6o7gKvo5r/xtNbcninwQ0agd82VvPhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059859; c=relaxed/simple; bh=tFjb4WNGJXfXmi1JOlUjmfEpmnhqi7/JUuAvovYnQAo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OKRDcKPTksS4VmjWu6pCvS3UrWMUPFIx15ioXhiKLQNzGTAxjJkRDYzW/+fTXYdudmPbFD5nshFkNyuWUTurj8N4h3cpq0UuMhL5EsHn6viHyn1DWYDkF+y0LgaZT5jDMug+J+I0nLqgXq/heXVfyPow0So3rWVnkzBrJN6T/ZU= 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=DL+6WM+h; arc=none smtp.client-ip=209.85.208.54 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="DL+6WM+h" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-6acba4bf65eso6680704a12.1 for ; Thu, 15 Oct 2026 03:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792059852; x=1792664652; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hEIHx/GPAzOwioEMBa/gwWEJDDSuySiQ6qW5+XvxvMg=; b=DL+6WM+hqxCOb9mSkbzhk5b/LU88qiNHAquc6UjCWSmfg1NDM8K+hTLZO6P7nFyGLZ pChg94X2hjGr1T9wk9P5UecTlo/LG/dMDpE2SFWnKPmRZou+Za9GKp1z+zvq9cGbdzT8 /CcVfluU4cXxKdZ54aYuUawIJ81t4UFKSw5/OUsXUS4xOVu1+j+grHqwL3AAOjekrCva mIJoc3+zmVfUBmfJs7D9IgN9ckL7cEvzAd65i4WkwqALeCcPXwIE0SDWjBPJrVDGCRKn EHAN+KM+wfZZFlBQD69jhcw/6WKC5/Hr8AmjbtESkIAyI8Zx0IO/M5/pJ9YPOrphuPP1 UPdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792059852; x=1792664652; h=content-transfer-encoding:mime-version:references:in-reply-to :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=hEIHx/GPAzOwioEMBa/gwWEJDDSuySiQ6qW5+XvxvMg=; b=vHbWd+KQE3finHrDT4rd7WUewiZn8BwOl6D6IAwfcxIf+P52lPdpJJg44GVTdFjfJ1 9vqPKutpBIyogiMiq1fXBWtkxoxap1WQE4Xd5nmsIwLIMh1HxqnHlXrvLFowIOU4/Ime jDt3IdBhGSVC9yrERnwMONC/T6YFO5O3IBjDSnbaxeKg10AJzkV4T6gazEdjButyd2Sn Q1USdVpglcSkftGOTox5WzfpHYbnzDKHxCClPZlg2MmN0i8cQe54Fb43rxXlQjFGBiIl nSFcADDHegQoMlVHHBSQkCzCFX3vSlY6XxumJNupBGkVXNqkRxYR8ndk4kiFBvSFurFF FRRA== X-Forwarded-Encrypted: i=1; AKwUvBySdiwvz32vVxc9ct0Jg0W4hONnWvSYkl4HHKC3CivTugJ4E0soxwU+xnXuR24eC8tmrZzPGmx1sa8yb7s=@vger.kernel.org X-Gm-Message-State: AFq9FYLMF/Ea1V5zTrjDv9gps4VcpoxYtOKMCHtDvN1wMnRRoWTDw6wG cLFgkV92SV/EAZBExiUdFxLF/WY44ewftTr9SRf1gg3ZctmNVY0hJXphOHz3bCVB X-Gm-Gg: AYBFou3Y8eQVcbC/TnW4+U5h7RyaRoy9MMwxwAd2wyCIoya6PbVdF+QDRziOR7d07l6 m85hHZohB8+w6CRx7eBTgtjWVQ0liHEomlzhEEOiYB21MaKoLw9+Cv0acUcIGPz/ygqp5IeF2KQ lUIz5tX/o4K5JJSxmV+qgwnhBdlY1+ZMUS535BqQ6azMrTwZGPF0q4h6kpf6J7EP6Erbepi2lzh oqEq1ulTG3e4tgZpdfyY+au8fCjfJnCEQcdb3OtRIVfIRpw568rsfy4Aam4qQYt3A1X78fbIK3j Rejc5eG488vyCVONEYAPylyvVNStE0h3lWvZWvj1cOhLtIlNFQIZzuhUYKBKjRM90dVJuIn7PPt 1uW3C4Wx54YgfDhHzMMZ4KsMhY4JbqXQ2OtCV56fBOimlSEtX7B/sXWwiW97j+I3gj/1H9Du7SC we7FspMEeBKSfF3WH1YebY/AI1O4FOOXes1cmrOaIozWTGRfc0SVOgMuIaeoA9NUH+kF8tRQehd oCOgMiIYMg7MqL6xm5xV0GgBEqA5A9fS8waW8Pl X-Received: by 2002:a17:907:7b8a:b0:c2e:1b4d:e9e9 with SMTP id a640c23a62f3a-c31a9f6ade4mr1680050166b.30.1792059851989; Thu, 15 Oct 2026 03:24:11 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c3edab13f4esm108371766b.87.2026.10.15.03.24.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2026 03:24:11 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com Subject: [PATCH v8 4/6] alpha: decode and acknowledge Tsunami system machine checks Date: Thu, 15 Oct 2026 12:22:53 +0200 Message-ID: <20261015102353.999695-5-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261015102353.999695-1-linmag7@gmail.com> References: <20261015102353.999695-1-linmag7@gmail.com> 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" Decode PCI and ECC transactions separately, honor invalid transaction information, and select Pchip errors using the logout summary. Report master aborts without importing Titan-specific dismissal policy. Delegate processor vectors to the bounded EV6 decoder. On system vectors 660/620, capture live PERROR and MISC before acknowledging their defined W1C bits and report live status absent from the saved frame. Leave live chipset registers alone on CPU and environmental vectors: HRM 10.2.5.6 warns that PERROR can have INV set before the error reaches DRIR. Consuming that state from a CPU vector could lose the transaction and its pending system-error notification. Leave PERRMASK as configured by firmware. HRM 10.2.5.7 says a cleared mask bit prevents the corresponding PERROR bit from being set, including by PERRSET. Table 10-43 gives a reset value of zero, so this reporting depends on firmware enabling the errors; changing masks does not establish that previously latched state is cleared. Table 10-42 marks PERROR bit 9 reserved (MBZ/RAZ); remove the obsolete RTO definition and reserve its bitfield. Use the system vector and frame bounds without restricting the reason code to the ES40 values. Preserve invalid frames and unknown environmental layouts in bounded raw dumps. Print CPU registers for uncorrectable system errors, including the PC needed to diagnose NXM. Gate correctable system register dumps on CONFIG_VERBOSE_MCHECK and alpha_verbose_mcheck while retaining their error decode. Keep transaction information unavailable whenever SERR is set, as required by HRM 8.8.2.6. Table 10-42 selects ECC fields for CRE/UECC. The first error freezes PERROR and only LOST can be set afterwards, so mixed error bits were detected together. The expected-probe path has no active Tsunami writer. Reporting and acknowledgment do not establish recovery; panic policy remains separate. Signed-off-by: Magnus Lindholm Reviewed-by: Matt Turner --- Changes since v7: - Restrict live chipset reads, W1C acknowledgments and live-status reporting to system vectors 660/620. CPU and environmental vectors leave them alone. - Correct the mixed-error comment: first-error freeze means mixed error bits were detected together; only LOST can be set afterwards. - Remove the detached PERRMASK comment and add Matt Turner's Reviewed-by. - Document the firmware dependency. Both ES40 Pchips read PERRMASK 0x0000000000000ff7 under the v7 console-test kernel (read-only check). arch/alpha/include/asm/core_tsunami.h | 3 +- arch/alpha/kernel/Makefile | 2 +- arch/alpha/kernel/err_tsunami.c | 254 ++++++++++++++++++++++++-- 3 files changed, 238 insertions(+), 21 deletions(-) diff --git a/arch/alpha/include/asm/core_tsunami.h b/arch/alpha/include/asm= /core_tsunami.h index fe3fd4570fac..5c5d3ff849ed 100644 --- a/arch/alpha/include/asm/core_tsunami.h +++ b/arch/alpha/include/asm/core_tsunami.h @@ -105,7 +105,6 @@ extern int TSUNAMI_bootcpu; #define perror_m_ta 0x40 #define perror_m_rdpe 0x80 #define perror_m_nds 0x100 -#define perror_m_rto 0x200 #define perror_m_uecc 0x400 #define perror_m_cre 0x800 #define perror_m_addrl 0xFFFFFFFF0000UL @@ -123,7 +122,7 @@ union TPchipPERROR { unsigned perror_v_ta : 1; unsigned perror_v_rdpe : 1; unsigned perror_v_nds : 1; - unsigned perror_v_rto : 1; + unsigned perror_v_reserved : 1; /* PERROR<9>: MBZ, RAZ */ unsigned perror_v_uecc : 1; unsigned perror_v_cre : 1; =20 unsigned perror_v_rsvd1 : 4; diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile index a453e487b9d0..0178f6a5bdb8 100644 --- a/arch/alpha/kernel/Makefile +++ b/arch/alpha/kernel/Makefile @@ -89,6 +89,6 @@ obj-$(CONFIG_ALPHA_MARVEL) +=3D err_ev7.o err_marvel.o obj-$(CONFIG_ALPHA_NAUTILUS) +=3D err_ev6.o obj-$(CONFIG_ALPHA_TITAN) +=3D err_ev6.o err_titan.o =20 -obj-$(CONFIG_ALPHA_TSUNAMI) +=3D err_tsunami.o +obj-$(CONFIG_ALPHA_TSUNAMI) +=3D err_ev6.o err_tsunami.o =20 endif # GENERIC diff --git a/arch/alpha/kernel/err_tsunami.c b/arch/alpha/kernel/err_tsunam= i.c index 1045b920fa6b..03080d219cde 100644 --- a/arch/alpha/kernel/err_tsunami.c +++ b/arch/alpha/kernel/err_tsunami.c @@ -1,5 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 -/* Machine check handling for Tsunami/Typhoon systems. */ +/* + * Machine check handling for Tsunami/Typhoon systems. + * Author: Magnus Lindholm + * Based on Titan error handling by Jeff Wiedemeier (Compaq). + * Register definitions: 21272 Hardware Reference Manual, revision 4.0. + */ #include #include #include @@ -12,36 +17,249 @@ #include "proto.h" #include "pci_impl.h" =20 -static inline void -tsunami_pci_clr_err_1(tsunami_pchip *pchip) +#define TSUNAMI_PERROR_ERRMASK 0xdffUL +#define TSUNAMI_PERROR_ECCMASK (perror_m_uecc | perror_m_cre) +#define TSUNAMI_PERROR_INV (1UL << 51) +#define TSUNAMI_MISC_NXM (1UL << 28) + +static int +tsunami_frame_valid(struct el_common *header, size_t size) { - pchip->perror.csr; - pchip->perror.csr =3D 0x040; + return !((header->sys_offset | header->size) & 7) && + header->sys_offset >=3D sizeof(*header) && + header->sys_offset <=3D header->size && + size <=3D header->size - header->sys_offset; +} + +static int +tsunami_parse_p_perror(int which, u64 perror, int print) +{ + static const char * const errors[] =3D { + "Lost error", "SERR asserted", "PERR asserted", + "Delayed-completion retry timeout", "Invalid scatter-gather PTE", + "Address parity error", "Target abort", "Read data parity error", + "No DEVSEL (master abort)", NULL, + "Uncorrectable ECC error", "Correctable ECC error" + }; + static const char * const pci_cmd[] =3D { + "Interrupt acknowledge", "Special cycle", "I/O read", "I/O write", + "Reserved", "Reserved", "Memory read", "Memory write", + "Reserved", "Reserved", "Configuration read", "Configuration write", + "Memory read multiple", "Dual address cycle", + "Memory read line", "Memory write and invalidate" + }; + unsigned long addr; + unsigned int cmd; + int i; + + if (!(perror & TSUNAMI_PERROR_ERRMASK)) + return MCHK_DISPOSITION_UNKNOWN_ERROR; + /* Do not import Titan's BIOS master-abort dismissal policy. */ + if (!print) + return MCHK_DISPOSITION_REPORT; + + printk("%s Pchip %d PERROR: %016llx\n", err_print_prefix, which, perror); + for (i =3D 0; i < ARRAY_SIZE(errors); i++) + if ((perror & TSUNAMI_PERROR_ERRMASK & (1UL << i)) && errors[i]) + printk("%s %s\n", err_print_prefix, errors[i]); + + /* + * INV invalidates SYN, CMD and ADDR. HRM 8.8.2.6 leaves command/address + * undefined whenever SERR is set, including with other error bits. + */ + if (perror & (TSUNAMI_PERROR_INV | perror_m_serr)) { + printk("%s Transaction information unavailable\n", err_print_prefix); + return MCHK_DISPOSITION_REPORT; + } + cmd =3D (perror & perror_m_cmd) >> 52; + /* + * Table 10-42 selects the ECC fields whenever CRE or UECC is set. + * The first error freezes PERROR (10.2.5.6); mixed error bits were + * detected together. Only LOST can be set afterwards. + */ + if (perror & TSUNAMI_PERROR_ECCMASK) { + const char *command =3D "Reserved"; + + if (cmd =3D=3D 0) + command =3D "DMA read"; + else if (cmd =3D=3D 1) + command =3D "DMA RMW"; + else if (cmd =3D=3D 3) + command =3D "SGTE read"; + addr =3D ((perror >> 19) & 0xffffffffUL) << 3; + printk("%s Command: %s (%x), syndrome: %02llx\n", + err_print_prefix, command, cmd, (perror & perror_m_syn) >> 56); + printk("%s System address: %lx\n", err_print_prefix, addr); + } else { + addr =3D ((perror >> 18) & 0x3fffffffUL) << 2; + /* SGE captures only PCI address bits <31:13> (8KB page). */ + if (perror & perror_m_sge) + addr &=3D ~0x1fffUL; + printk("%s Command: %s (%x), PCI address: %lx%s\n", + err_print_prefix, pci_cmd[cmd], cmd, addr, + (perror & perror_m_sge) ? " (8KB page)" : ""); + if (perror & (1UL << 17)) + printk("%s Monster window\n", err_print_prefix); + else if (perror & (1UL << 16)) + printk("%s DAC scatter-gather window 3\n", err_print_prefix); + } + return MCHK_DISPOSITION_REPORT; +} + +/* SESF bits 0/1 identify PCI errors, bit 2 covers ECC on either Pchip/CPU= . */ +static u64 +tsunami_pchip_error(struct el_TSUNAMI_sysdata_mcheck *frame, int which) +{ + u64 perror =3D which ? frame->p1_perror : frame->p0_perror; + + if (frame->sesf & (1UL << which)) + return perror; + if ((frame->sesf & 4) && (perror & TSUNAMI_PERROR_ECCMASK)) + return perror; + return 0; +} + +static struct el_TSUNAMI_sysdata_mcheck * +tsunami_system_frame(struct el_common *header) +{ + if (!tsunami_frame_valid(header, sizeof(struct el_TSUNAMI_sysdata_mcheck)= )) + return NULL; + return (void *)header + header->sys_offset; +} + +static int +tsunami_process_logout_frame(struct el_common *header, int print) +{ + struct el_TSUNAMI_sysdata_mcheck *frame =3D tsunami_system_frame(header); + int status =3D MCHK_DISPOSITION_UNKNOWN_ERROR; + int i; + + if (!frame) { + if (print) { + printk("%s Invalid Tsunami system frame; raw frame follows\n", + err_print_prefix); + mchk_dump_logout_frame_raw(header); + } + return MCHK_DISPOSITION_UNKNOWN_ERROR; + } + if (print) + printk("%s SESF: %016llx DIR: %016llx MISC: %016llx\n", + err_print_prefix, frame->sesf, frame->dir, frame->misc); + if (frame->misc & TSUNAMI_MISC_NXM) { + status =3D MCHK_DISPOSITION_REPORT; + if (print) + printk("%s Non-existent memory, NXS: %llu\n", + err_print_prefix, (frame->misc >> 29) & 7); + } + for (i =3D 0; i < 2; i++) + status |=3D tsunami_parse_p_perror(i, tsunami_pchip_error(frame, i), pri= nt); + return status; +} + +struct tsunami_error_state { + u64 perror[2]; + u64 misc; +}; + +static void +tsunami_ack_pchip(tsunami_pchip *pchip, u64 perror) +{ + if (!(perror & TSUNAMI_PERROR_ERRMASK)) + return; + pchip->perror.csr =3D perror & TSUNAMI_PERROR_ERRMASK; + /* Complete the W1C write before releasing the logout frame. */ mb(); pchip->perror.csr; } =20 -static inline void -tsunami_pci_clr_err(void) +static void +tsunami_clear_errors(struct tsunami_error_state *state) +{ + bool pchip1 =3D TSUNAMI_cchip->csc.csr & (1UL << 14); + + /* Preserve each chip's transaction and the NXM source before clearing. */ + state->perror[0] =3D TSUNAMI_pchip0->perror.csr; + state->perror[1] =3D pchip1 ? TSUNAMI_pchip1->perror.csr : 0; + state->misc =3D TSUNAMI_cchip->misc.csr; + + tsunami_ack_pchip(TSUNAMI_pchip0, state->perror[0]); + /* Do not access the second Pchip on single-Pchip systems. */ + if (pchip1) + tsunami_ack_pchip(TSUNAMI_pchip1, state->perror[1]); + if (state->misc & TSUNAMI_MISC_NXM) { + /* Zero writes leave the other MISC fields unchanged. */ + TSUNAMI_cchip->misc.csr =3D TSUNAMI_MISC_NXM; + /* Complete the NXM acknowledgment before releasing the frame. */ + mb(); + TSUNAMI_cchip->misc.csr; + } +} + +static void +tsunami_report_live_errors(struct tsunami_error_state *state, + struct el_TSUNAMI_sysdata_mcheck *frame) { - tsunami_pci_clr_err_1(TSUNAMI_pchip0); + int i; =20 - /* TSUNAMI and TYPHOON can have 2, but might only have 1 (DS10) */ - if (TSUNAMI_cchip->csc.csr & 1L<<14) - tsunami_pci_clr_err_1(TSUNAMI_pchip1); + /* PALcode's frame may predate these errors, or describe another chip. */ + for (i =3D 0; i < 2; i++) { + if (!(state->perror[i] & TSUNAMI_PERROR_ERRMASK) || + (frame && state->perror[i] =3D=3D tsunami_pchip_error(frame, i))) + continue; + printk("%s Live Pchip status before acknowledgment:\n", err_print_prefi= x); + tsunami_parse_p_perror(i, state->perror[i], 1); + } + if ((state->misc & TSUNAMI_MISC_NXM) && + (!frame || ((state->misc ^ frame->misc) & (0xfUL << 28)))) + printk("%s Live MISC: %016llx, non-existent memory, NXS: %llu\n", + err_print_prefix, state->misc, (state->misc >> 29) & 7); } =20 void tsunami_machine_check(unsigned long vector, unsigned long la_ptr) { - /* Clear error before any reporting. */ + struct el_common *header =3D (void *)la_ptr; + struct el_TSUNAMI_sysdata_mcheck *frame =3D NULL; + struct tsunami_error_state live; + char *saved_err_prefix =3D err_print_prefix; + bool show_regs =3D vector =3D=3D SCB_Q_SYSMCHK; + + /* Synchronize pending accesses before inspecting the chipset. */ mb(); - mb(); /* magic */ - draina(); - tsunami_pci_clr_err(); - wrmces(0x7); mb(); + draina(); + /* CPU/event vectors must not consume a pending Pchip system error. */ + if (vector =3D=3D SCB_Q_SYSMCHK || vector =3D=3D SCB_Q_SYSERR) { + tsunami_clear_errors(&live); + frame =3D tsunami_system_frame(header); + } + +#ifdef CONFIG_VERBOSE_MCHECK + show_regs |=3D alpha_verbose_mcheck !=3D 0; +#endif + err_print_prefix =3D KERN_CRIT; + if (vector =3D=3D SCB_Q_SYSMCHK || vector =3D=3D SCB_Q_SYSERR) { + printk("%sSystem %s error (vector %lx, code %x) on CPU %d:\n", + err_print_prefix, vector =3D=3D SCB_Q_SYSERR ? "correctable" : + "uncorrectable", vector, header->code, smp_processor_id()); + tsunami_process_logout_frame(header, 1); + if (show_regs) + dik_show_regs(get_irq_regs(), NULL); + tsunami_report_live_errors(&live, frame); + } else if (vector =3D=3D SCB_Q_SYSEVENT) { + printk("%sTsunami environmental event (code %x): layout unknown\n", + err_print_prefix, header->code); + mchk_dump_logout_frame_raw(header); + } + err_print_prefix =3D saved_err_prefix; =20 - process_mcheck_info(vector, la_ptr, "TSUNAMI", - mcheck_expected(smp_processor_id())); + if (vector !=3D SCB_Q_SYSMCHK && vector !=3D SCB_Q_SYSERR && + vector !=3D SCB_Q_SYSEVENT) { + /* EV6 decoding also releases the logout frame. */ + ev6_machine_check(vector, la_ptr); + } else { + wrmces(0x7); + /* Complete acknowledgment before resuming. */ + mb(); + } } --=20 2.43.0 From nobody Sat Oct 24 14:06:33 2026 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 7B88B51814F for ; Thu, 15 Oct 2026 10:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059857; cv=none; b=iliiqpcTzb4ffdpl0H2b5ORRyAVZ2ZdHp/jiREud+76p0YgncI07QAP44JVkpIeyeiuZadsFmfxmzvgQ36y61/AmjDYD+vGtKPOaND1LtVzwlEces3mIOk0EX50XYQjIDJ8tNqbcWdMGwgJQRxWAsMk3dPCvkCkwl8NVIZkoGO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059857; c=relaxed/simple; bh=uQEDniOn1PwdKF3FSnKRHiZwsCWkSsCRoWdBTC2Z7pA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NA0yI+YkC6BLi9+BTtLnVqgpObSVet+DBM/JouKQ9cn5kDc6AUgstEONozuI1Bf/SQdgtOY95MkDohGYH5L1kol0zF3nZVXc4cXV6iCEb+lPS63oJ/rxaPv0ILDB2hdb8C+/yWIXktpcqiQPh6bhV4sNiJMBujae05utCMCNXkw= 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=hH3ao5qp; arc=none smtp.client-ip=209.85.218.49 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="hH3ao5qp" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-c3f5e5e4c1dso48193866b.1 for ; Thu, 15 Oct 2026 03:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792059854; x=1792664654; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cp28yyr3SzAyjRv8HYwIaVWW5BzBa/tEPBTq/XwtduI=; b=hH3ao5qpxCifSa/GhWpwt302MYg0x/O+panT3e4Tatj8mMPuVRMYGnmltkXLNkC7/T sN/ictZDsbx99ZfAhxuceLhSIBGUuhwvBeHqxRzdrtG886fdS7uo7QUepeO24IPedT9y +saTJw3ZRdE3h7feYMN7EgTptRJGRAt7G5EpA0QEKX3HbE6TMrdnX57ALmeDHvTsFGcF FQpu57s6gz0jH7/+El1/WU7zhvA+YKaQ6Wxbw9NBsE4y/cVtvSzvgv7+5y/FRSx1B6Sq vtr20qtEqyOYTtqeDLVjQAiBd3TqmhywLjd5sva9A80OkEEbcz8O3RZgkJj8Jh33ltid 3liA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792059854; x=1792664654; h=content-transfer-encoding:mime-version:references:in-reply-to :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=cp28yyr3SzAyjRv8HYwIaVWW5BzBa/tEPBTq/XwtduI=; b=xg65t1h+EJMhr9ZUw0zfxB3qyFOgioU2yMoC+x7VXzP8Ay5czjTKGtFB87WfmoB5pR kORqQOol7oLdGzU79I0wm7yC0BZM4OoKkEwIUQoRFM2c4QzXQcK9qBxBn9OwhVIuXpUF hvCcQBXHz6H+2BqInl2iPDNJOgcX2zmsNfJrIR4+h4Q9phmYdOyY/CZg7JdaCn9FsxFL YOQ+9s6408kDdtJu59viAHcTGLSrGng0vFWTdxjxUBR6Zp/KSGuJMJV44zCIu5oi74d2 SW00job51Hq6FhShxJdg/pEkZXECwk24VOxMhZuiBHXIAEwoUft/foDDKx4zPd9CuvaB YMjw== X-Forwarded-Encrypted: i=1; AKwUvBwhTv5WIISEQQQefuQDAFl81BWVVIdKcLe0JUXX9TTSjRCU2nz3mHkRlmnIbgLaUX9t8cxWj2FgtDG25Gg=@vger.kernel.org X-Gm-Message-State: AFq9FYJcJ9c6y2RVopOo1PlXjE79RY5eNeS/BesBiv8IpS9WBg2vb2AZ lG1PKDVdoBV5EXAbbkADgqWCIE6PFvUmiEZVuYAblLndfxr13E9XwWf3 X-Gm-Gg: AYBFou0kz140h8dtpHW74ZdXMZVPFpvYHkubqbvsHTv+4sekxdBOoHd5cWX3ED2OHtt 3Gj+F5rUvkc9MFOwOzMhUElc4bj8csXzf1WQDE6CS8YNW/Ccsyf+5cwbKvbsoRz7UODCTzhZlBN ydXMDoEOZ4Yc+ZO7Tnjaf/f4Rjqbrw1CEt6ZMk/lDlAQyN/Z3Eir8YeSk1FftSF9+zDFRPZOOK6 1Dz5kCP+3jLXv/U1Zjfgt2DiJdU1XmXoNqBnbRygr7wE1hQyDWqOWeGiovOUxjT6P5olwGAqrfS BJtyEKNjemEn163e+O7oQSJ1dl7+zxMkcEX2qRVoTr9/dCFoZrl23AmjbcM78tOByMm3TPOcf7T /p5BKfTWXPyLCagCmn4NqmhuaCm/PmzJ9yBiwnVgfvwBM3+arTODqI7F8MH4ctjR7SVuKCRpWFT e8wzbu9zwTnUTo7exSCU8701KluvNpuB9cHz5099GVy99k66qu7gGoR7U6PReLyJKVO6gHklHia lEOf5xz8KM0V4xSlBONorWFpH6iXvVKVHMRmtDa X-Received: by 2002:a17:906:630c:b0:c19:45e3:2f57 with SMTP id a640c23a62f3a-c31a9d0ab5amr1764971966b.9.1792059853367; Thu, 15 Oct 2026 03:24:13 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c3edab13f4esm108371766b.87.2026.10.15.03.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2026 03:24:12 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com Subject: [PATCH v8 5/6] alpha: decode Clipper environmental events Date: Thu, 15 Oct 2026 12:22:54 +0200 Message-ID: <20261015102353.999695-6-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261015102353.999695-1-linmag7@gmail.com> References: <20261015102353.999695-1-linmag7@gmail.com> 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" Restrict ES40 live environmental decoding to Clipper. Validate frame bounds and string-table masks, and separate fault bits from status context. Report valid notifications even when no recognized fault bits are set, so door-closed and supply-return notifications remain visible. A single status snapshot does not establish a recovery transition. Keep SMIR bit 0 and inverted halt/reset bits as raw context. During the ES40 PSU cable test, bit 0 remained set after the individual PSU failure indication cleared. Its polarity/latching is unverified, so do not call it a current PSU failure. Use mask 0x14 for the remaining SMIR faults. Decode only QW1 through QW7 as live environmental status, as documented in the ES40 Service Guide, Tables D-20 and D-21. Use plain door-status messages. Preserve unknown or truncated frames in bounded raw dumps. Firmware console-log scanning is independent of the live environmental handler. Signed-off-by: Magnus Lindholm --- Changes since v7: - Split console-log support into patch 6 so it can be reviewed separately. - Make clipper_process_environment() void and remove its unused print parameter. Always print from the bit helper, retaining a boolean only to decide whether to report that no recognized faults are present. - Keep version-history remarks here rather than in the commit message. Changes since v6: - Remove the redundant environmental silent pass, treat SMIR bit 0 as raw context, and retain only mask 0x14 for recognized SMIR faults. arch/alpha/kernel/err_tsunami.c | 221 ++++++++++++++++++++++++++++++++ arch/alpha/kernel/proto.h | 1 + arch/alpha/kernel/sys_dp264.c | 2 +- 3 files changed, 223 insertions(+), 1 deletion(-) diff --git a/arch/alpha/kernel/err_tsunami.c b/arch/alpha/kernel/err_tsunam= i.c index 03080d219cde..471d6888b9d4 100644 --- a/arch/alpha/kernel/err_tsunami.c +++ b/arch/alpha/kernel/err_tsunami.c @@ -263,3 +263,224 @@ tsunami_machine_check(unsigned long vector, unsigned = long la_ptr) mb(); } } + +static const char * const CLIPPER_EnvQW1SMIR[] =3D { + "", /* SMIR<0>: retain as raw context until its semantics are known. */ + "OCP or RMC halt detected", + "Sys_DC_Notok failure detected", + "", + "System temperature over 50 degrees C failure", + "PCI Bus #0 is in reset", + "PCI Bus #1 is in reset", + "System is being reset" +}; + +static const char * const CLIPPER_EnvQW2CPUIR[] =3D { + "CPU0 regulator is enabled", + "CPU1 regulator is enabled", + "CPU2 regulator is enabled", + "CPU3 regulator is enabled", + "CPU0 regulator or configuration sequence fail", + "CPU1 regulator or configuration sequence fail", + "CPU2 regulator or configuration sequence fail", + "CPU3 regulator or configuration sequence fail" +}; + +static const char * const CLIPPER_EnvQW3PSIR[] =3D { + "Power Supply 0 is enabled", + "Power Supply 1 is enabled", + "Power Supply 2 is enabled", + "", + "Power Supply 0 was enabled but failed", + "Power Supply 1 was enabled but failed", + "Power Supply 2 was enabled but failed" +}; + +static const char * const CLIPPER_EnvQW4LM78ISR[] =3D { + "PS +3.3V out of tolerance", + "PS +5V out of tolerance", + "PS +12V out of tolerance", + "VTERM out of tolerance", + "Temperature zone 0 (PCI Backplane slots 1-3 area) over limit failure", + "LM75 CPU0-3 Temperature over limit failure", + "System Fan 1 failure", + "System Fan 2 failure", + "CTERM out of tolerance", + "", + "-12V out of tolerance", + "", + "", + "", + "", + "", + "CPU0_VCORE +2V out of tolerance", + "CPU0_VIO +1.5V out of tolerance", + "CPU1_VCORE +2V out of tolerance", + "CPU1_VIO +1.5V out of tolerance", + "Temperature zone 1 (PCI Backplane slots 7-10 area) over limit failure", + "", + "System Fan 4 failure", + "System Fan 5 failure", + "", + "", + "", + "", + "", + "", + "", + "", + "CPU2_VCORE +2V out of tolerance", + "CPU2_VIO +1.5V out of tolerance", + "CPU3_VCORE +2V out of tolerance", + "CPU3_VIO +1.5V out of tolerance", + "Temperature zone 2 (PCI Backplane slots 4-6 area) over limit failure", + "", + "System Fan 3 failure", + "System Fan 6 failure", + "", + "", + "Power supply 3.3V rail above high amperage warning", + "Power supply 5.0V rail above high amperage warning", + "Power supply 12V rail above high amperage warning", + "Power supply high temperature warning", + "Power supply AC input low limit warning", + "Power supply AC input high limit warning" +}; + +static const char * const CLIPPER_EnvQW5DOOR[] =3D { + "", + "System CPU door is open", + "System Fan door is open", + "System PCI door is open", + "", + "System CPU door is closed", + "System Fan door is closed", + "System PCI door is closed" +}; + +static const char * const CLIPPER_EnvQW6TEMP[] =3D { + "CPU0 temperature warning fault has occurred", + "CPU1 temperature warning fault has occurred", + "CPU2 temperature warning fault has occurred", + "CPU3 temperature warning fault has occurred", + "System temperature zone 0 warning fault has occurred", + "System temperature zone 1 warning fault has occurred", + "System temperature zone 2 warning fault has occurred" +}; + +static const char * const CLIPPER_EnvQW7FAN[] =3D { + "System Fan 1 is not responding to RMC Commands", + "System Fan 2 is not responding to RMC Commands", + "System Fan 3 is not responding to RMC Commands", + "System Fan 4 is not responding to RMC Commands", + "System Fan 5 is not responding to RMC Commands", + "System Fan 6 is not responding to RMC Commands", + "", + "", + "CPU fans 5/6 at maximum speed", + "CPU fans 5/6 reduced speed from maximum", + "PCI fans 1-4 at maximum speed", + "PCI fans 1-4 reduced speed from maximum" +}; + +#define CLIPPER_ENV_LM78ISR_MASK 0xfcdf00df05ffUL + +/* ES40 Service Guide EK-ES240-SV A01, live frame: Tables D-20 and D-21. */ +struct el_clipper_envdata { + u64 summary; + u64 dir; + u64 smir; + u64 cpuir; + u64 psir; + u64 fault; + u64 doors; + u64 temp_warn; + u64 fan_ctrl; + u64 fatal_power_down; + u64 reserved; +}; + +static bool +clipper_print_bits(const char * const *messages, size_t count, + u64 value, u64 mask) +{ + size_t i; + + if (!(value & mask)) + return false; + for (i =3D 0; i < count; i++) + if (value & mask & (1UL << i)) + printk("%s %s\n", err_print_prefix, messages[i]); + return true; +} + +#define CLIPPER_BITS(table, value, mask) \ + clipper_print_bits(table, ARRAY_SIZE(table), value, mask) + +static void +clipper_process_environment(struct el_common *header) +{ + struct el_clipper_envdata *frame; + bool fault =3D false; + + if (!tsunami_frame_valid(header, sizeof(*frame))) { + printk("%s Truncated Clipper environmental frame\n", err_print_prefix); + mchk_dump_logout_frame_raw(header); + return; + } + frame =3D (void *)header + header->sys_offset; + /* Only QW1 through QW7 carry error state in the live 680 frame. */ + /* PSU summary and inverted halt/reset signals remain raw context. */ + fault |=3D CLIPPER_BITS(CLIPPER_EnvQW1SMIR, frame->smir, 0x14); + fault |=3D CLIPPER_BITS(CLIPPER_EnvQW2CPUIR, frame->cpuir, 0xf0); + fault |=3D CLIPPER_BITS(CLIPPER_EnvQW3PSIR, frame->psir, 0x70); + fault |=3D CLIPPER_BITS(CLIPPER_EnvQW4LM78ISR, + frame->fault, CLIPPER_ENV_LM78ISR_MASK); + fault |=3D CLIPPER_BITS(CLIPPER_EnvQW5DOOR, frame->doors, 0x0e); + fault |=3D CLIPPER_BITS(CLIPPER_EnvQW6TEMP, frame->temp_warn, 0x7f); + fault |=3D CLIPPER_BITS(CLIPPER_EnvQW7FAN, frame->fan_ctrl, 0x3f); + /* A notification with no recognized fault can describe recovery. */ + if (!fault) + printk("%s No recognized environmental fault bits set\n", + err_print_prefix); + printk("%s Environmental summary: %016llx DIR: %016llx\n", + err_print_prefix, frame->summary, frame->dir); + printk("%s SMIR: %016llx (PSU summary/halt/reset bits undecoded)\n", + err_print_prefix, frame->smir); + CLIPPER_BITS(CLIPPER_EnvQW2CPUIR, frame->cpuir, 0x0f); + CLIPPER_BITS(CLIPPER_EnvQW3PSIR, frame->psir, 0x07); + CLIPPER_BITS(CLIPPER_EnvQW5DOOR, frame->doors, 0xe0); + CLIPPER_BITS(CLIPPER_EnvQW7FAN, frame->fan_ctrl, 0xf00); + if (frame->fault & (0x3fUL << 42)) + printk("%s Power supply warning source: %llu (3 =3D reserved)\n", + err_print_prefix, (frame->fault >> 40) & 3); +} + +void +clipper_machine_check(unsigned long vector, unsigned long la_ptr) +{ + struct el_common *header =3D (void *)la_ptr; + char *saved_err_prefix =3D err_print_prefix; + + if (vector !=3D SCB_Q_SYSEVENT) { + tsunami_machine_check(vector, la_ptr); + return; + } + /* Drain pending accesses before inspecting the environmental frame. */ + mb(); + draina(); + err_print_prefix =3D KERN_CRIT; + printk("%sSystem correctable environmental event (code %x) on CPU %d:\n", + err_print_prefix, header->code, smp_processor_id()); + if (header->code =3D=3D 0x206) + clipper_process_environment(header); + else { + printk("%s Unrecognized environmental event; raw frame follows\n", + err_print_prefix); + mchk_dump_logout_frame_raw(header); + } + err_print_prefix =3D saved_err_prefix; + wrmces(0x7); + /* Complete acknowledgment before returning from the event. */ + mb(); +} diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index f138bd494628..8cdf72f4ab8b 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -78,6 +78,7 @@ extern struct _alpha_agp_info *titan_agp_info(void); extern struct pci_ops tsunami_pci_ops; extern void tsunami_init_arch(void); extern void tsunami_kill_arch(int); +extern void clipper_machine_check(unsigned long vector, unsigned long la_p= tr); extern void tsunami_machine_check(unsigned long vector, unsigned long la_p= tr); extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_= t); =20 diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index 0a2d319bb1c8..0b5687ab45f2 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c @@ -627,7 +627,7 @@ struct alpha_machine_vector clipper_mv __initmv =3D { DO_EV6_MMU, DO_DEFAULT_RTC, DO_TSUNAMI_IO, - .machine_check =3D tsunami_machine_check, + .machine_check =3D clipper_machine_check, .max_isa_dma_address =3D ALPHA_MAX_ISA_DMA_ADDRESS, .min_io_address =3D DEFAULT_IO_BASE, .min_mem_address =3D DEFAULT_MEM_BASE, --=20 2.43.0 From nobody Sat Oct 24 14:06:33 2026 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 67C9D5187EB for ; Thu, 15 Oct 2026 10:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059858; cv=none; b=aAOZgGADtlEcm8GNkA0WbrX5IocKQPcWeFELKq2M6VMufWsa8JqHjc5zQ/R0jZyz9hWjvULfbylAfGNGug1+RQo0ApdH7M+NzsV7SXXf3vRqdjZyt7WleUaUn0b0qjIeIyf0d4/Si/Yz09cTyibfFVDVpFnbq8dIJhn2VdOcFGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792059858; c=relaxed/simple; bh=zD+L5KHfj9GRtwAR++EBgo1T8d5iADu23RvrPbiHu1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ICmNkhr4iyQpQXXEPSCdWMRiIISNlD69WcPJvlhsZuq2vq8F5RQfY/iZlX4MaAbAGPmOhcAZNhFgZVU9dj3JuBOTxIbbtRAXm0FuBMjMNAY3ohSsti31ova6nisjDP3zUQXNBDJ9d1/oIW5lto8NEDwto32piCOjG/nykyPjhEQ= 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=AaRz1nsn; arc=none smtp.client-ip=209.85.218.49 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="AaRz1nsn" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-c2e36c3478aso270701966b.0 for ; Thu, 15 Oct 2026 03:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792059854; x=1792664654; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=h5bOlJnTGH5cpuiaTW0rEF4siHSAFvk91ho32bHKFDc=; b=AaRz1nsnuhXlltigisvUE/SVdbW4xFB9P+cM9Y++6PACL96EeeKO1GoUES1ZrksEmp p1DAAU/hX37XLjaM4g3sZN8ky3SDRwvMjDxW7wPvlKAcy7QJ0fNeWwHhXKKhIWAXgnkd RD14U/bO2yi+wYM4HTMdOhKv8mwzg5KQIUmyk4gNL2RB3Rxa2a7IflqMOX6C1eCyTERQ AKcLD730PA1ohaqHs5KAwOmFoDby883b6MmElGgu7RT3ZTGAMecsJm/b1H0PSqWMd6zf A3F806EhXuM2lO/qhOE3RyS3UogEQN+fe8SbwdsrXjHrFz2FELUJ9K0iw2If2MAqikDg Q2rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792059854; x=1792664654; h=content-transfer-encoding:mime-version:references:in-reply-to :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=h5bOlJnTGH5cpuiaTW0rEF4siHSAFvk91ho32bHKFDc=; b=c3F36pHy+TYYY6cKgPzzn+ITfCWbZyJjSpblo1XHFCj4nuwP2AOwSZ66S7ID5aIzqY L/fM9Fv9Dg0+Usnwzl8hiqnBw6iA4a242OhSI5QY+h23Mv3jR7nHcOjt9KDkmHfdnFd1 E9U7jksQEUb5jyAKd0vlRLt6pXJxJhiDkVabr1MNI8sVDY2/mNWiqzzjk5sekgjwdqpN +CoFkh3Gt10MUuvoYE9gmyJobvu8yhJ3w+EWgIR0rI63+zeOumRVJ07pts/QNUKDA7re ulUGzv6RGRRSf52vqBtHp38QvaVnDeaJOfQTZ3WEjp9x/Zw28MLh+OAnoTHfnwUxCwh6 KLYg== X-Forwarded-Encrypted: i=1; AKwUvBw9qvIcF0buoow8wA8ZVfhfqhhsPaptzg3QLXepOcsv35aF006njH8ibsPYYiNVMuxksm2lJrz8rUKhjU0=@vger.kernel.org X-Gm-Message-State: AFq9FYLfRindLxPyNjNasGw9uJynzVVPIZwv5UqZCfYV2mUjQv1DnZXn eR8VwX7i4krt8PaYp4Yh4fE8tonBEz6T5oDe806NcFAoDKyEhxun9V76 X-Gm-Gg: AYBFou2rVA+Bfr9+h7SeDBhnp/9vFAddmKsWWWAVHtXZKe7H7FBnxIfscG+6Sp1Pz3m ZEoz/c4wqsS1GmStPns5uKqJJfA0MkBZy8B40UPKG8m6A5sFhH2kbfkwTY4/HbzdlpfkH6Kh1yM 1aVQHxVWDmcQo9xBenAG7KCB1wOkiBjRM5bC9YYXPePHnMQJVQFHMvzGGyBQdAEbNxVyeFxjvrV eVDDR4Q3YQ3ujMWzI2T5XHP2sXZ64l7rnsmFPdo2CJvfs5FmLR5EKaS5LSz1SsY/nbiM+fItGAV LKR/9ibCmacQzXNuLuKDl8cDkpkno8in/q1mGr0AZm111G26/miG1fJ5NcAibET5VVm4ROP9UU3 ehQLbobWBuGAnzHbX3F9GNcX5w/BpHssCcNas6hWEk5G3aob2OB+OXfnM1jcKBQpFCyl/QgxmWx vQVh8dJxq6mhj7MdzUs+Q0rytci6zhDFfA34+TLP9mlFZVlwaK0BImK9r4TX/yViQPy1e07qlZ5 5VYIwby540zbGPKn+7vKECK/ixKZj8ICCnrJ6NA X-Received: by 2002:a17:907:72ca:b0:c29:462b:f908 with SMTP id a640c23a62f3a-c31a9fec198mr2249276866b.10.1792059854413; Thu, 15 Oct 2026 03:24:14 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c3edab13f4esm108371766b.87.2026.10.15.03.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2026 03:24:13 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com Subject: [PATCH v8 6/6] alpha: add bounded Clipper console-log scanning Date: Thu, 15 Oct 2026 12:22:55 +0200 Message-ID: <20261015102353.999695-7-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261015102353.999695-1-linmag7@gmail.com> References: <20261015102353.999695-1-linmag7@gmail.com> 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" Clipper console logs have an HWRPB byte count. Bound wrapper and child traversal by that count before decoding embedded processor and system logout frames. Print the wrapper name and event/halt timestamp, halt code, and recorded CPU ID for processor packets. Acknowledge the log only after a complete termination packet. Retain the firmware pointer on unknown or incomplete wrappers and print at most 1 KiB of raw bytes using print_hex_dump(). This avoids the generic scanner's unconditional acknowledgment after a parsing failure. The ES40 record observed during testing is class 5, type 4. Its wrapper layout is unknown and remains raw and unacknowledged; it may therefore be printed again at each boot. Successful decoding of a nonempty hardware log remains unverified. Keep console scanning independent of the live machine-check and environmental handlers and restrict it to Clipper. Console environmental payloads also remain raw: ES40 Service Guide Table D-18's sys_offset conflicts with its field offsets. No register layout is assumed for unverified extended subpacket types 6 and 7. The scanner invokes the payload decoder directly during PCI init; no generic subpacket-handler registration is needed. Mark its helpers __init and retain the PCI init hook in sys_dp264.c. Signed-off-by: Magnus Lindholm --- Changes since v7 patch 5: - Separate the console scanner from live environmental decoding. - Print wrapper names, event/halt timestamps and the halt code. - Use print_hex_dump() for the bounded raw fallback. - Remove the unused subpacket-handler registration and mark the three private console helpers __init. The empty registration wrapper and its call to the currently empty EV6 registration function are unnecessary. - Remove the unverified extended-type 6/7 definitions and annotations. Those payloads remain raw, without assigning register names. - Keep the observed class-5/type-4 record unsupported and preserve its pointer on incomplete parsing. Successful hardware decode is unverified. arch/alpha/kernel/err_tsunami.c | 196 ++++++++++++++++++++++++++++++++ arch/alpha/kernel/proto.h | 1 + arch/alpha/kernel/sys_dp264.c | 1 + 3 files changed, 198 insertions(+) diff --git a/arch/alpha/kernel/err_tsunami.c b/arch/alpha/kernel/err_tsunam= i.c index 471d6888b9d4..ea4cce54d042 100644 --- a/arch/alpha/kernel/err_tsunami.c +++ b/arch/alpha/kernel/err_tsunami.c @@ -6,9 +6,11 @@ * Register definitions: 21272 Hardware Reference Manual, revision 4.0. */ #include +#include #include #include #include +#include #include #include #include @@ -484,3 +486,197 @@ clipper_machine_check(unsigned long vector, unsigned = long la_ptr) /* Complete acknowledgment before returning from the event. */ mb(); } + +static struct el_subpacket * __init +tsunami_process_subpacket(struct el_subpacket *packet) +{ + struct el_common *frame; + size_t offset =3D offsetof(struct el_subpacket, by_type.regatta_frame.dat= a_start); + int status; + + /* Raw dumps consume whole quadwords, and the next packet must advance. */ + if (packet->length < offsetof(struct el_subpacket, by_type) || + (packet->length & 7)) + return NULL; + if (packet->revision !=3D 1) { + el_annotate_subpacket(packet); + return (void *)packet + packet->length; + } + + switch (packet->type) { + case EL_TYPE__REGATTA__PROCESSOR_ERROR_FRAME: + case EL_TYPE__REGATTA__PROCESSOR_DBL_ERROR_HALT: + case EL_TYPE__REGATTA__SYSTEM_ERROR_FRAME: + case EL_TYPE__REGATTA__SYSTEM_DBL_ERROR_HALT: + if (packet->length < offset + sizeof(*frame)) + return NULL; + frame =3D (void *)packet + offset; + if (frame->size > packet->length - offset || frame->size < sizeof(*frame= )) + return NULL; + if (packet->type =3D=3D EL_TYPE__REGATTA__PROCESSOR_ERROR_FRAME || + packet->type =3D=3D EL_TYPE__REGATTA__PROCESSOR_DBL_ERROR_HALT) { + printk("%s ** Occurred on CPU %d:\n", err_print_prefix, + (int)packet->by_type.regatta_frame.cpuid); + status =3D ev6_process_logout_frame(frame, 0); + if (status !=3D MCHK_DISPOSITION_DISMISS) + ev6_process_logout_frame(frame, 1); + } else { + tsunami_process_logout_frame(frame, 1); + } + break; + case EL_TYPE__REGATTA__ENVIRONMENTAL_FRAME: + /* + * ES40 Table D-18 gives sys_offset=3D0x20, but places the + * summary at frame+0x18. Preserve the complete packet until + * the console layout is verified; do not apply the live layout. + */ + printk("%s Console environmental layout unverified; raw packet follows\= n", + err_print_prefix); + el_annotate_subpacket(packet); + break; + default: + el_annotate_subpacket(packet); + break; + } + return (void *)packet + packet->length; +} + +/* + * Clipper console logs have an HWRPB byte count. Do not use the generic + * unbounded dispatcher: a rejected record must not acknowledge the log. + */ +static bool __init +tsunami_console_log(void *data, size_t remaining) +{ + struct el_subpacket *packet; + unsigned char *pos =3D data; + size_t size, length; + u32 count; + union el_timestamp timestamp; + const char *name; + + while (remaining >=3D offsetof(struct el_subpacket, by_type)) { + packet =3D (void *)pos; + size =3D packet->length; + if (size < offsetof(struct el_subpacket, by_type) || + size > remaining || (size & 7)) + return false; + if (packet->class =3D=3D EL_CLASS__TERMINATION) + return packet->type =3D=3D EL_TYPE__TERMINATION__TERMINATION; + if (packet->class !=3D EL_CLASS__HEADER || packet->revision !=3D 1) + return false; + + timestamp.as_int =3D 0; + /* Check each header's extent before accessing its union member. */ +#define CONSOLE_HEADER_SIZE(member) \ + (offsetof(struct el_subpacket, by_type.member) + \ + sizeof(packet->by_type.member)) + switch (packet->type) { + case EL_TYPE__HEADER__SYSTEM_ERROR_FRAME: + if (size < CONSOLE_HEADER_SIZE(sys_err)) + return false; + name =3D "SYSTEM ERROR"; + length =3D packet->by_type.sys_err.frame_length; + count =3D packet->by_type.sys_err.frame_packet_count; + break; + case EL_TYPE__HEADER__SYSTEM_EVENT_FRAME: + if (size < CONSOLE_HEADER_SIZE(sys_event)) + return false; + name =3D "SYSTEM EVENT"; + timestamp =3D packet->by_type.sys_event.timestamp; + length =3D packet->by_type.sys_event.frame_length; + count =3D packet->by_type.sys_event.frame_packet_count; + break; + case EL_TYPE__HEADER__HALT_FRAME: + if (size < CONSOLE_HEADER_SIZE(err_halt)) + return false; + name =3D "ERROR HALT"; + timestamp =3D packet->by_type.err_halt.timestamp; + length =3D packet->by_type.err_halt.frame_length; + count =3D packet->by_type.err_halt.frame_packet_count; + break; + case EL_TYPE__HEADER__LOGOUT_FRAME: + if (size < CONSOLE_HEADER_SIZE(logout_header)) + return false; + name =3D "LOGOUT FRAME"; + length =3D packet->by_type.logout_header.frame_length; + count =3D 1; + break; + default: + return false; + } +#undef CONSOLE_HEADER_SIZE + if (length > remaining - size || (length & 7) || + count > length / offsetof(struct el_subpacket, by_type)) + return false; + printk("%s*** %s: CLASS %u, TYPE %u\n", err_print_prefix, + name, packet->class, packet->type); + el_print_timestamp(×tamp); + if (packet->type =3D=3D EL_TYPE__HEADER__HALT_FRAME) + printk("%s HALT CODE: %04x\n", err_print_prefix, + packet->by_type.err_halt.halt_code); + pos +=3D size; + remaining -=3D size + length; + while (count--) { + if (length < offsetof(struct el_subpacket, by_type)) + return false; + packet =3D (void *)pos; + size =3D packet->length; + if (size < offsetof(struct el_subpacket, by_type) || + size > length || (size & 7) || + packet->class !=3D EL_CLASS__REGATTA_FAMILY) + return false; + /* This handler checks embedded logout-frame bounds. */ + if (tsunami_process_subpacket(packet) !=3D (void *)pos + size) + return false; + pos +=3D size; + length -=3D size; + } + if (length) + return false; + } + /* Exhaustion without a complete termination packet is incomplete. */ + return false; +} + +static void __init +tsunami_console_data_log(int cpu, struct percpu_struct *pcpu) +{ + unsigned char *data =3D (void *)(IDENT_ADDR | pcpu->console_data_log_pa); + size_t length =3D pcpu->console_data_log_length; + size_t dump =3D length < 1024 ? length : 1024; + + printk("%sConsole data log for CPU %d (%zu bytes):\n", + err_print_prefix, cpu, length); + if (!(pcpu->console_data_log_pa & 7) && + length <=3D ~0UL - (unsigned long)data && + tsunami_console_log(data, length)) { + /* Acknowledge only after reaching a valid termination packet. */ + pcpu->console_data_log_pa =3D 0; + return; + } + printk("%s Incomplete console log; retaining firmware pointer\n", + err_print_prefix); + /* Byte reads preserve partial headers without rounding beyond length. */ + if (dump > ~0UL - (unsigned long)data) + return; + print_hex_dump(err_print_prefix, " ", DUMP_PREFIX_OFFSET, 16, 1, + data, dump, false); + if (dump < length) + printk("%s Raw console log truncated to %zu bytes\n", + err_print_prefix, dump); +} + +void __init +tsunami_check_console_data_log(void) +{ + struct percpu_struct *pcpu; + unsigned long cpu; + + for (cpu =3D 0; cpu < hwrpb->nr_processors; cpu++) { + pcpu =3D (void *)hwrpb + hwrpb->processor_offset + + cpu * hwrpb->processor_size; + if (pcpu->console_data_log_pa) + tsunami_console_data_log(cpu, pcpu); + } +} diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 8cdf72f4ab8b..7ece3b635e27 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h @@ -78,6 +78,7 @@ extern struct _alpha_agp_info *titan_agp_info(void); extern struct pci_ops tsunami_pci_ops; extern void tsunami_init_arch(void); extern void tsunami_kill_arch(int); +extern void tsunami_check_console_data_log(void); extern void clipper_machine_check(unsigned long vector, unsigned long la_p= tr); extern void tsunami_machine_check(unsigned long vector, unsigned long la_p= tr); extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_= t); diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index 0b5687ab45f2..f844d8141553 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c @@ -533,6 +533,7 @@ monet_init_pci(void) static void __init clipper_init_pci(void) { + tsunami_check_console_data_log(); common_init_pci(); locate_and_init_vga(NULL); } --=20 2.43.0