From patchwork Wed Dec 19 17:39:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154283 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5203940ljp; Wed, 19 Dec 2018 09:39:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/XBZmL/c6W0L3RIZ3CzlCzOuEEzPfBjk3uR4s5D2yogG9nwkie8JtYUMwqBX2ujJlcrwUiE X-Received: by 2002:a62:36c1:: with SMTP id d184mr21486665pfa.242.1545241156660; Wed, 19 Dec 2018 09:39:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545241156; cv=none; d=google.com; s=arc-20160816; b=n7b/MUCOXzPaHfHzY7KfPmA244oUzqDI1waLETpzBPQTfM40dY71K/TSeK+nB1X5xW wTqstyy+rZUf4yO47O7IGYrk2QOO71y7cvJFD8DRmXKXMQIBtJ5imccbk6sOta56kZB1 WCMo+LR5ffJZ9id0WZkyKalXitVCIRvGAlDq/DMmnPmNP+wl1ENH0WCsGmZXNmA9RC6I oa2f72jrQ2xeQYyET9IOZx4eftnO8INe+6bj9eO0/dAWFjdb0QadSoAGeog32HEf7eGQ UpESEg6Em9ivdL4nChFvjPvCJ+lr4gdV5Tyiv5sZijGxGjw5MOXC7U8Rb16pcZ9+2Gkf MuQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=3ylEdY5pqDN8IBYIdZnxgrNcrFkdMBITxO2ImVcjQuw=; b=H8pA+OF+Kuoq+yvvz5/Pg47pqbNeLosRdZiQNdAVUr+Bs1Ljy0rAfXzzXIKEWDJc5R FLAetOF/kaRNrpbMa0FsHb7/KvGUQQH0tlBe265avpV8xHjaeaZzSbfRGftCo4NUsvyv dD5EaJCAwbMay0O6Sl3nVEwtAv3090hkXG52SZ4ICj7sdB+2QyL6/oHVCSK6w7KMMZFY 2jvrPXu6I7Wj8oyC4cPVEUGtzuAUoYLlu0nAmAHIy4e4ofaqrMox4+XdLM290aFBVZgQ Umx1k9xvMaEvmHW4OOyiP8Hy4lfvNoakwHzczS1aRz+UNgdMn/2Nbov9IyR5YgLM8Qjn xDHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HWlLSBek; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id y7si10034892pgq.545.2018.12.19.09.39.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 09:39:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HWlLSBek; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 09C69211A208E; Wed, 19 Dec 2018 09:39:16 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::442; helo=mail-wr1-x442.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C9BD021BADAB2 for ; Wed, 19 Dec 2018 09:39:13 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id r10so20360857wrs.10 for ; Wed, 19 Dec 2018 09:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3JQ/G5uLbqYT4MG8YJx0LsPWhViVk6sBhaIqujQdlEg=; b=HWlLSBek+Ei5DJgQ8fYgZqTqkT5ZVRxQtsLOHmFKMG3QR1y8m2Llr3nf3GP/EkQ4He +QWnqGzGCB3ZkXSP++HRwz2vp9Gkez9SBukhK/Fr/tLkYqgkPkSQiOU/kHCQDOcHKC5Z 3iBx39aKx4wcp3ZY+xuMdPr6H0L0fQfrHhnPY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3JQ/G5uLbqYT4MG8YJx0LsPWhViVk6sBhaIqujQdlEg=; b=G4J+bprEhmr/xaNWKYyIOlg2y0cPg1C7i/+ITJxcbiHNyWCoMwo72s9NGoxlZzIeJ1 tsQijkMW6irwjiBvb5YIjj4R4NSMvNIAhbeADeWW2btE0/Pav9M08Klq1pTfAt5FJD7x um6d+Cl47EXjMPgzSXu7dqUY2Xz3jInXEAQcUUBsg1EgfpwJWmT6JLFVXbqXMh/B+Mcl NbL0HADtR67oZzbDHYCSr4YLIFVcU1svgrr/ZlrxMY3qvPiDBKgoS8j4Qm1D4e2LZbbm xcRVjIYe+GFKbEUaRY4Qgy25S0bkRPi5mqmRNDnTzrMph9uQW/FHSntRddOX5e+bb74C iFoA== X-Gm-Message-State: AA+aEWYW+b2e4k63JsmwQC6LEFOjF9LK3Doe9iHxLLxiZRRoelb9YEzn 4zWwZjqulCpXnL0Dk8xsELfx9dnnX0yDaw== X-Received: by 2002:a5d:4652:: with SMTP id j18mr20025086wrs.279.1545241151780; Wed, 19 Dec 2018 09:39:11 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:e5c9:6e00:25cb:e32e]) by smtp.gmail.com with ESMTPSA id t12sm9308969wrr.65.2018.12.19.09.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 09:39:10 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 19 Dec 2018 18:39:07 +0100 Message-Id: <20181219173907.2602-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [edk2] [PATCH v2] ArmPkg/DefaultExceptionHandlerLib ARM: avoid endless loop in RELEASE builds X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Ensure that we prevent the CPU from proceeding after having taken an unhandled exception on a RELEASE build, which does not contain the ASSERT() which ensures this on DEBUG and NOOPT builds. Retain the code following the deadloop so that we can keep going when running in a debugger. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- v2: remove pointless 'if (!PcdAdjust)' conditional ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c index 0b9da031b47d..4978711ed0e8 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c @@ -267,6 +267,8 @@ DefaultExceptionHandler ( DEBUG ((EFI_D_ERROR, "\n")); ASSERT (FALSE); + CpuDeadLoop (); + // Clear the error registers that we have already displayed incase some one wants to keep going SystemContext.SystemContextArm->DFSR = 0; SystemContext.SystemContextArm->IFSR = 0;