From patchwork Fri Jul 1 10:53:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 71298 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp234813qgy; Fri, 1 Jul 2016 03:53:27 -0700 (PDT) X-Received: by 10.98.149.10 with SMTP id p10mr30329334pfd.88.1467370405934; Fri, 01 Jul 2016 03:53:25 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id q8si3678474pan.184.2016.07.01.03.53.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jul 2016 03:53:25 -0700 (PDT) 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; 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 dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EC8FC1A1E27; Fri, 1 Jul 2016 03:54:00 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 450BB1A1E1D for ; Fri, 1 Jul 2016 03:53:59 -0700 (PDT) Received: by mail-wm0-x229.google.com with SMTP id v199so21543330wmv.0 for ; Fri, 01 Jul 2016 03:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iwo0IuA6Trr3l8DddQI4qOxgdnoD117ex73/TuesJBI=; b=hWpkbLumuCy0wc9N9gPTCq6rl+Uql61jinVgxBmY+onNWCVZPe83glavig/h8hxH/6 UnaLqqvkIq8xyWo6yXuppxmRfSwQ5/UMi+KVtLx55LEs0fs1ld+NNoRA7nkFsp1VcgBA OfTZ5zEDmbJ5aKicNEaQuvSZXbr8ELwqb/MOs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iwo0IuA6Trr3l8DddQI4qOxgdnoD117ex73/TuesJBI=; b=GIIyf7g/SKk7wEaPzEDpqD72LKNF4M+pCr+9Qx1F4bRqddrlllqf7gpzHMR4UstQva TbzbpwykNkYwR/nzoNTZtG/RkN3owUUTCPXqlrdjX8gt37H7Oqu56R8amIQasJo3BKLX p4OcCowmZqe5h3yMnHc0vX3+cAFv7mQ1L1MtxKukH1FyJc3A/+4B3OClARK11RHIdQoh Jj274gtjZ8Px2NFQWt3KVHd0LHf4v5dOJud+JkX+xaGPk2g78rpHk+2lvo/f8usvkMpE FvLAwB3kIp4dZKr7ExQa0EWo08OT2uQtH4gbAR7Z+HiW9LWCoNl/rv52rAO8TcrP9sNu KNCw== X-Gm-Message-State: ALyK8tIy+Q5ziyVv60S0g2XHODNf4L/Cv7xIOZ640F+pGOZ6qSz9OTCVVkIQ11nUo41h+ZiF X-Received: by 10.194.191.135 with SMTP id gy7mr2991178wjc.125.1467370400967; Fri, 01 Jul 2016 03:53:20 -0700 (PDT) Received: from localhost.localdomain ([188.203.148.129]) by smtp.gmail.com with ESMTPSA id x194sm2063997wmf.13.2016.07.01.03.53.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jul 2016 03:53:20 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, mark.rutland@arm.com Date: Fri, 1 Jul 2016 12:53:13 +0200 Message-Id: <1467370393-7703-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467370393-7703-1-git-send-email-ard.biesheuvel@linaro.org> References: <1467370393-7703-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 2/2] ArmPkg/CpuDxe: unmask SErrors in DEBUG builds X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" SErrors (formerly called asynchronous aborts) are a distinct class of exceptions that are not closely tied to the currently executing instruction. Since execution may be able to proceed in such a condition, this class of exception is masked by default, and software needs to unmask it explicitly if it is prepared to handle such exceptions. On DEBUG builds, we are well equipped to report the CPU context to the user and it makes sense to report an SError as soon as it occurs rather than to wait for the OS to take it when it unmasks them, especially since the current arm64/Linux implementation simply panics in that case. So unmask them when ArmCpuDxe loads. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/CpuDxe/Exception.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Acked-by: Mark Rutland Reviewed-by: Leif Lindholm diff --git a/ArmPkg/Drivers/CpuDxe/Exception.c b/ArmPkg/Drivers/CpuDxe/Exception.c index c3107cd4a6bc..d806a5fdf910 100644 --- a/ArmPkg/Drivers/CpuDxe/Exception.c +++ b/ArmPkg/Drivers/CpuDxe/Exception.c @@ -62,6 +62,15 @@ InitializeExceptions ( Status = Cpu->EnableInterrupt (Cpu); } + // + // On a DEBUG build, unmask SErrors so they are delivered right away rather + // than when the OS unmasks them. This gives us a better chance of figuring + // out the cause. + // + DEBUG_CODE ( + ArmEnableAsynchronousAbort (); + ); + return Status; }