From patchwork Thu Nov 9 02:44:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Hoemann X-Patchwork-Id: 742825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 380B9C4332F for ; Thu, 9 Nov 2023 02:44:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbjKICoh (ORCPT ); Wed, 8 Nov 2023 21:44:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231182AbjKICoh (ORCPT ); Wed, 8 Nov 2023 21:44:37 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F472590; Wed, 8 Nov 2023 18:44:35 -0800 (PST) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A8NDEhj001752; Thu, 9 Nov 2023 02:44:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=jvroFxjIEfKMHqS9Yu3vEGmrFVqJdVo0sL4vHN2hf4E=; b=SGjslzC6LrlOx1fnFMa2oCgWud8iMZlTD5v5AYpE48tyLM16uDjBhYFVEL9Q5ewaPRqT Q0AnHT/+dd5bbf4hab5BAnrPiVBfNEPcCA9uBFXNwcx5azlwOHMSgbihQGH07fXycRKc pg2PciaQmLtMR67KPuHQM3z33AfOq3kxUpdZ0kPQgru1o87SGBxXolpRdqaxhX9EB6Zy jsz+IWfsh4mwDKhlShwtnQVmumhFs7OgX7ijoVcMyK8Drl9ByFkZHMsV//Kfekw2wuz6 jXNaKQszJzRSun3/DxOVpBClwVrb7c+B+sri5XDYpWrDdAcEW7dtZhBSh8JtpnC4d5vK Lg== Received: from p1lg14879.it.hpe.com ([16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3u8ceye0m8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 02:44:21 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id 661CB13140; Thu, 9 Nov 2023 02:44:19 +0000 (UTC) Received: from anatevka.americas.hpqcorp.net (unknown [16.231.227.39]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 152EC801FDA; Thu, 9 Nov 2023 02:44:19 +0000 (UTC) From: Jerry Hoemann To: linux@roeck-us.net, wim@linux-watchdog.org Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Jerry Hoemann Subject: [PATCH 1/2] watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO Date: Wed, 8 Nov 2023 19:44:06 -0700 Message-ID: <20231109024407.120856-2-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231109024407.120856-1-jerry.hoemann@hpe.com> References: <20231109024407.120856-1-jerry.hoemann@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: 8rN7v3iRRZnYRag-s4f9vuE6EkoWWUtY X-Proofpoint-ORIG-GUID: 8rN7v3iRRZnYRag-s4f9vuE6EkoWWUtY X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-09_01,2023-11-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 phishscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311090020 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Do not claim NMIs that are not watchdog or ERRORs as it could cause unnecessary crashes. The code does this, but only for iLO5. The intent was to preserve legacy (Gen8/9 and earlier) semantics of using hpwdt for error containtment as hardware/firmware would signal fatal IO errors as an NMI with the expectation of hpwdt crashing the system. But these IO errors should be received by hpwdt as an NMI_IO_CHECK. So the test is overly permissive and should not be limited to only ilo5. This enables this protection for future iLO not matching current PCI IDs. Fixes: 62290a5c194b ("watchdog: hpwdt: Claim NMIs generated by iLO5") Signed-off-by: Jerry Hoemann --- drivers/watchdog/hpwdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index f79f932bca14..79ed1626d8ea 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -178,7 +178,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs) "3. OA Forward Progress Log\n" "4. iLO Event Log"; - if (ilo5 && ulReason == NMI_UNKNOWN && !mynmi) + if (ulReason == NMI_UNKNOWN && !mynmi) return NMI_DONE; if (ilo5 && !pretimeout && !mynmi)