From patchwork Thu Feb 4 15:50: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: 61204 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp536187lbl; Thu, 4 Feb 2016 07:52:42 -0800 (PST) X-Received: by 10.66.252.136 with SMTP id zs8mr11889894pac.110.1454601162253; Thu, 04 Feb 2016 07:52:42 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id hz1si17426702pac.132.2016.02.04.07.52.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Feb 2016 07:52:42 -0800 (PST) Received-SPF: pass (google.com: 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; spf=pass (google.com: 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRMC3-0004ic-Q5; Thu, 04 Feb 2016 15:51:39 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRMBa-0004Mo-9v for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2016 15:51:13 +0000 Received: by mail-wm0-x229.google.com with SMTP id g62so10723114wme.0 for ; Thu, 04 Feb 2016 07:50:49 -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:in-reply-to:references; bh=KV6megqCj6JX4DXWaB8xH/tI4jGz55j+OQybnS5+HB0=; b=R6sVx3pHbiHHdgZ1IpTA4Y4U4ZkyimE/LSpIbvFMqEW2oAK2WOnSTkt7QBYbmtt3Ug b0JnyPwIpqkwM/F48I9gWhORf0rGeJ0luWWqXZjmg9ImhvSsS026m5AeXGQrn89hg5bV xLk2+0CDs2dQDjnJ66I8sAc8CMXFbYvW/Ewak= 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=KV6megqCj6JX4DXWaB8xH/tI4jGz55j+OQybnS5+HB0=; b=Wzhszs8Zl34eP0XZQUT0Jp5OXFWfPEOAjkg770f26SiA76BN3ZKHsamIbV+wx+Q+v3 DKBw3NStuPdFXZqSxLgV6RXMW4aFxX2C53cSIV2CxaATOBPKxiyexjbXN1TvdYQOstEh 6Awbj97HHAwuZX+tZoKi3LD3VpnIJkvww+bKl0sigfhrJsIQ8bndJULyqK02Fx9Nbuk8 R5/at1pEnWb6KPNgoVkWsVzey2IvT2uJoQ8kPe/+JPDC/NYe6OIC9yuNlVt64UXyh5/4 Ea6x9ubCrcciYJT5FucUc4MpVfIx3Cq70hLr0ynQ1+OeJkiWndrfSG4nRqCiLU3AEiUu D0Xg== X-Gm-Message-State: AG10YOQu+faltSwNOZeHlEiD18uPOkEyK/B2Z027kH5n2sIQ7f+2STIhOGGKaHxGpqVww3SE X-Received: by 10.28.137.213 with SMTP id l204mr33135684wmd.100.1454601048670; Thu, 04 Feb 2016 07:50:48 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id q73sm26885838wmb.1.2016.02.04.07.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 07:50:47 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, matt@codeblueprint.co.uk, catalin.marinas@arm.com Subject: [PATCH v2 7/7] ARM/arm64: efistub: perform hardware compatibility check Date: Thu, 4 Feb 2016 16:50:30 +0100 Message-Id: <1454601030-9093-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454601030-9093-1-git-send-email-ard.biesheuvel@linaro.org> References: <1454601030-9093-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160204_075110_785229_42585245 X-CRM114-Status: GOOD ( 11.85 ) 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:229 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: mark.rutland@arm.com, Ard Biesheuvel , will.deacon@arm.com, jeremy.linton@arm.com, suzuki.poulose@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Before proceeding with relocating the kernel and parsing the command line, insert a call to check_platform_features() to allow an arch specific check to be performed whether the current kernel can execute on the current hardware. Reviewed-by: Jeremy Linton Tested-by: Suzuki K Poulose Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/arm-stub.c | 4 ++++ drivers/firmware/efi/libstub/efistub.h | 2 ++ 2 files changed, 6 insertions(+) -- 2.5.0 _______________________________________________ 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/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index 3397902e4040..6086a874fa3c 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c @@ -190,6 +190,10 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, pr_efi(sys_table, "Booting Linux Kernel...\n"); + status = check_platform_features(sys_table); + if (status != EFI_SUCCESS) + goto fail; + /* * Get a handle to the loaded image protocol. This is used to get * information about the running image, such as size and the command diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index 275f395c886d..a25ac4c7955f 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -53,4 +53,6 @@ void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size, unsigned long desc_size, efi_memory_desc_t *runtime_map, int *count); +efi_status_t check_platform_features(efi_system_table_t *sys_table_arg); + #endif