From patchwork Fri Jul 1 15:01:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 71313 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp348307qgy; Fri, 1 Jul 2016 08:03:21 -0700 (PDT) X-Received: by 10.66.47.196 with SMTP id f4mr32010850pan.126.1467385401567; Fri, 01 Jul 2016 08:03:21 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id b10si4469437pan.98.2016.07.01.08.03.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jul 2016 08:03:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; 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 linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIzxT-00015X-Cd; Fri, 01 Jul 2016 15:02:19 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIzxQ-0000z8-3J for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2016 15:02:17 +0000 Received: by mail-wm0-x22f.google.com with SMTP id f126so30115687wma.1 for ; Fri, 01 Jul 2016 08:01:55 -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; bh=05LV9IcPDc7hjUi5mAR9hL6T3LpplUKGSnuJT1XdJzc=; b=j0QZhpbvJ1k/vlJFepbj/DDiBEDCvjXjV0ZAgzK+9rN74pllc8YAMyY4Mt4Vc1tTNO x2OEGvDRjVr6p1RQugsPTrInmNzgalFUgpN5+JmrdDjczVkLAJvDiDhV15dCrvVW2RyM jk+998pao2UjVOWmhe1qcxeiNA+xfOdjAY0lo= 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; bh=05LV9IcPDc7hjUi5mAR9hL6T3LpplUKGSnuJT1XdJzc=; b=GUXNX+OWXaozkUogwIKCm1wdmAbpOHkevSlyFCB31OIVyJPdJnWvVTiFSCl3Kg7Mpk t/YX+mRYL4nB4TAVg8B2+6oDBmwDFKUdwoC2lcrn7e2Rx3cQcjC9Q+cepWf/TvEmYGwn ZjpjdDJPu6fDQ3UJVvTy1SDJb+IhkBjTHe6rn2vsQoA3Ioo5AzQuf36YzhYyq5ik5wwk HQ5nNgTlDWkn93/RSCRHuOgN33crx8U4VIGpZ4nsGXI+c0ebzSOjMTmu+X+YDURRc/ej GtuNeaQ2dDY6vIqeTN29mVIfl2bTowDAMEsLvo8tLA1iPrP4TExt7+LNKOzd1ZVrstLi c7Eg== X-Gm-Message-State: ALyK8tK3cQ252DVsmeiWzwe8QdcEN/ogGyng4onQ/OXabQcBNL8Rs6+KNEYwuCdVieLT5crT X-Received: by 10.194.104.40 with SMTP id gb8mr4432399wjb.146.1467385314304; Fri, 01 Jul 2016 08:01:54 -0700 (PDT) Received: from localhost.localdomain ([188.203.148.129]) by smtp.gmail.com with ESMTPSA id q6sm3024631wjt.46.2016.07.01.08.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jul 2016 08:01:53 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, catalin.marinas@arm.com, mark.rutland@arm.com, leif.lindholm@linaro.org Subject: [PATCH 1/2] efi: arm64: abort boot on pending SError Date: Fri, 1 Jul 2016 17:01:30 +0200 Message-Id: <1467385291-9880-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160701_080216_454406_550AD394 X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org It is the firmware's job to clear any pending SErrors before entering the kernel. On UEFI, we can fail gracefully rather than panic during early boot, so check for this condition in the stub. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/arm64-stub.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c index eae693eb3e91..c7e7396de876 100644 --- a/drivers/firmware/efi/libstub/arm64-stub.c +++ b/drivers/firmware/efi/libstub/arm64-stub.c @@ -20,7 +20,14 @@ extern bool __nokaslr; efi_status_t check_platform_features(efi_system_table_t *sys_table_arg) { - u64 tg; + u64 tg, isr; + + /* check for a pending SError */ + asm ("mrs %0, isr_el1" : "=r"(isr)); + if (isr & BIT(8)) { + pr_efi_err(sys_table_arg, "Pending SError detected -- aborting\n"); + return EFI_LOAD_ERROR; + } /* UEFI mandates support for 4 KB granularity, no need to check */ if (IS_ENABLED(CONFIG_ARM64_4K_PAGES))