From patchwork Thu Jan 28 17:02:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 60746 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp600191lbb; Thu, 28 Jan 2016 09:06:04 -0800 (PST) X-Received: by 10.98.10.73 with SMTP id s70mr6117251pfi.85.1454000764298; Thu, 28 Jan 2016 09:06:04 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fe7si17926506pab.100.2016.01.28.09.06.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 09:06:04 -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 1aOq07-0000cZ-N0; Thu, 28 Jan 2016 17:04:55 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOpyI-0007Rb-Jc for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2016 17:03:05 +0000 Received: by mail-wm0-x22e.google.com with SMTP id p63so33657078wmp.1 for ; Thu, 28 Jan 2016 09:02:42 -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=AIUUyO97Uykpmc2dcj5Iz9es6U7sa2GvTAdJojmDxRs=; b=PcZw0stYPCOIphU7vZefWKqIFsPFYklzkefNQj2ed5bjS2+RblvXLvtEnNSGiW8ASa weydgcOiB+JupXUMAK/fjKpKHqSe92DApUOw2dI+Qt32fKthnpHY7S/cbyYP2MT0KtQw p03kKcHeOr6gr9pdeYcbxQ366GHDTrPha46bE= 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=AIUUyO97Uykpmc2dcj5Iz9es6U7sa2GvTAdJojmDxRs=; b=f/rC4D7EbKr2IdUjLR8DRMGcNGzmiM1j3kI3t7i8ueQuEBJFdWpibvyKjmMsdVxmsT FBhw7QQZUoaL7nDKN3ixHhaybZ9aQvDkbijl1Zx1IxwqaDmwLghXohvU/zw4jJurrvAq 3YcOlKX1LcF8SsAPtyZvvQpAM/TXHyQUIpna1QV137H7/nHY3Nyt0NQClUqm82QQhfU8 MP+dA8WYbpMuGt0jrQrrCbuupDlY2Yw3Yy0zwwYyF7179WenAZFSS+j5ScTHH8KhU9PH RkawdO0VZZOCF1EvUuz7lIf5HE+EA6poCJuFEjwb/FwKmBcLk20wTIFiNRtWl9XTxSn6 3BUg== X-Gm-Message-State: AG10YOSvb2qYRb9Jbqan9HkQvFp1wtd251zHrNHwOLeBR1STR8v3Uaqvj5PU8qTq5Unv877+ X-Received: by 10.28.55.76 with SMTP id e73mr4449581wma.53.1454000560858; Thu, 28 Jan 2016 09:02:40 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id b127sm3709301wmh.9.2016.01.28.09.02.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 09:02:40 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, jeremy.linton@arm.com, Suzuki.Poulose@arm.com Subject: [PATCH 3/3] ARM/arm64: efistub: perform hardware compatibility check Date: Thu, 28 Jan 2016 18:02:29 +0100 Message-Id: <1454000549-9189-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454000549-9189-1-git-send-email-ard.biesheuvel@linaro.org> References: <1454000549-9189-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160128_090302_943269_EDCFCEF3 X-CRM114-Status: GOOD ( 11.38 ) 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:22e 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 , dann.frazier@canonical.com, dhdang@apm.com, leif.lindholm@linaro.org, lho@apm.com, ksankaran@apm.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. 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 6b6548fda089..33b1284c7319 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -43,4 +43,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