From patchwork Tue Dec 11 13:25:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153459 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp615675ljp; Tue, 11 Dec 2018 05:27:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/WQ2+XPn64gEHEY3RMvGZAGPLx8tTeRJmN23fDEj2r1XcPfpQEv+fHfC8BzBxLsj6SkbmGW X-Received: by 2002:a25:c6c6:: with SMTP id k189mr15848581ybf.288.1544534849605; Tue, 11 Dec 2018 05:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544534849; cv=none; d=google.com; s=arc-20160816; b=by/UvNmC3mzowFIjVcUaVqIh18JQ2TMuO0kLsLg/nx/xndFN6guBc21o/Pjn24Xha8 i6Vu7y+YO5U6503M/cmsmyO2Dqlzcvbg05BjTYQfyy1P73wun+mcr8y8nWzMefBAWcUL 6wMKa8bbbrCPx4xbO4RqsKYbs+ev4XXvxYwueRs3U0C6VhCPpiQ99BC8S/JTVp0vDT4l u4/HcIRwtKwshnnBIsVr2821PON+B+MGcvOzW/AkJm0GQRo01kVPsgpCqTd2rlXZQyKO MAaR3WCJdYMSsJtjQqDhuGRn9cxsX82z/5j2wh0VQAjztNw97orswdY4ffGz268vkn7x lz1w== 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=1RIDhjwkheq3aN4Bx4oju7VVA3yjzE7OpXqqVV0qZQE=; b=0HaPtggGDbhambr+i2KXGOFTd43ndHk2BLdc5jPmKwE06h3sw6pSqteTQkf/y/cbVB xN+IOwwI85pVRHt0cvRnUWdBaWPtcYmzr8GBHjP+UxeZrATxeXCwkjUoQLhC3eDNk2Rv wBP1PWLzQmAgpxoQIh21pKdB/6KIG+u+6C636sKLtC4rG4IF3orhkcRnjbyk3exaSTmf H7T9GVcMcdjfhE2uC/7A/37QXOHF8XTSyMqXiN19+bPg8piTtWwC0O9OlxbZZx6z2jnk bBVcs6Bfo4cXwZSkylDA7JUug3b2YG+cMvFLf+xzgU1Hpkrfpb1z0g7ybe8Senwf+UiY kZIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d2xj53Jk; 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 s63si4930138ywe.266.2018.12.11.05.27.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 05:27:29 -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=d2xj53Jk; 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 EA1652194D3AE; Tue, 11 Dec 2018 05:27:26 -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::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 263D22119378C for ; Tue, 11 Dec 2018 05:25:16 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id j10so14065950wru.4 for ; Tue, 11 Dec 2018 05:25:16 -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=8rhSQt4SVfdSQfDYa/PpvmhjqFcDFwCK7aLn3s0JxTg=; b=d2xj53Jk+YEaxHzWmQ3jWOFGbmQGxdhZeP7zyRzEM58yyi2AkQhRqboWav5Lj3K4GS kRfVQBpOEAwrZqVKcrSyZoK5qgLceNRMkeinoK2rqY7k95y208goj4YvbhpHANyHkPza 8mH1U/yNGN8d8HGukQlAMfirvkme8yixpMIv4= 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=8rhSQt4SVfdSQfDYa/PpvmhjqFcDFwCK7aLn3s0JxTg=; b=mAzDOI4vxcVSMyRbzzIWWBSJTt4Sg9RPIUf7MtCNAe/Q7j0Vo4QZKvbN3ju/UTVqBd qz5smpmP1j4GdsrA3EZdTW2hw26Xih6JMJyowful8QfRlCqb35/yoGQpTQ97GGANrDrI ktHdC+FPa0Qr0CxP8x4fWVuS7YJw7f1+q8AQPvRj3/lwn9gMm7CKJofl1tLOJIhTIxp+ r910QFcFSGFocWpNifonlFjtU0FfV6m+nZGLO4ZL0xmuVHZox+VOoVB8LENxdqCGC8JR 6cxXQHvmQNrsbDf09eRhYuQ4y1SidU+5iMlpidtCmIh8RKJ3J1RkLjvi7eJ0TXxdXZsq 2ZDA== X-Gm-Message-State: AA+aEWaetw3/+04RrSzSbczysBdPssZkV6EpkuDYlUx/NDi3grKEsJO2 HGQAOZP6xJpAvCcwOTdDFre6Za051f/6kQ== X-Received: by 2002:a5d:63c3:: with SMTP id c3mr13153170wrw.215.1544534714265; Tue, 11 Dec 2018 05:25:14 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:8c3:6b9d:cbc9:58c6]) by smtp.gmail.com with ESMTPSA id n17sm25945wmc.5.2018.12.11.05.25.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 05:25:12 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 11 Dec 2018 14:25:10 +0100 Message-Id: <20181211132510.21359-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [edk2] [PATCH] 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. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c index 0b9da031b47d..9d96d5aabd96 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c @@ -267,10 +267,15 @@ DefaultExceptionHandler ( DEBUG ((EFI_D_ERROR, "\n")); ASSERT (FALSE); + if (!PcAdjust) { + 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; // If some one is stepping past the exception handler adjust the PC to point to the next instruction SystemContext.SystemContextArm->PC += PcAdjust; + }