From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AFSGD/XU/4OmvkMF9blJuufSOBqQyv6cxG/uZ0drzOVft0hCGU7DXIpmyi3eo5T/opwDx994DNlRBA== 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: [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: , X-List-Received-Date: Wed, 19 Dec 2018 17:39:14 -0000 Content-Transfer-Encoding: 8bit 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(+) 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; -- 2.19.2