From patchwork Wed Feb 17 12:36:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 62104 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2257673lbl; Wed, 17 Feb 2016 04:38:05 -0800 (PST) X-Received: by 10.66.226.238 with SMTP id rv14mr1736189pac.41.1455712685525; Wed, 17 Feb 2016 04:38:05 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si1774564pfb.123.2016.02.17.04.38.05; Wed, 17 Feb 2016 04:38:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934472AbcBQMiB (ORCPT + 30 others); Wed, 17 Feb 2016 07:38:01 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38005 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422798AbcBQMg3 (ORCPT ); Wed, 17 Feb 2016 07:36:29 -0500 Received: by mail-wm0-f47.google.com with SMTP id a4so25967152wme.1 for ; Wed, 17 Feb 2016 04:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZvKUHDZCpP/bBG7E/PgtKUI/gHYAOwQFyyElyMk932Y=; b=eTmT9rDAxUFwZnEnWkLFUzRMaTVzRKu4sbcIq1lPi3bDFqt5GKNpGt3AG8zAkzngRT JTeJgGWfFiLno4EeG2GdfjJt1ch+VsHvoI159wbAamD2bEkEjjlDwxvnhqf0inqNNLDh gDobojN/mLFEu9LT3A8EwUFryMT3cVl/O53z53C0PwF+j22BIHE25VLQ0smQ72r2fmV+ x7X5nFD5YCclcUGQXCAF1LR0wSrJ94hZ/25sDg8XRfI9Y4bC5+rhN2HF7BmUQUkpltVU eik+dIva8AkNVtMoXzWH+qHo/IuoSaU+q2I2mtnSzQNHw+IoFWf/uLIxPHiZ0L7OWIfG rJzQ== 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=ZvKUHDZCpP/bBG7E/PgtKUI/gHYAOwQFyyElyMk932Y=; b=Iv6xk/mvCLNsRRzG1VcAUspES1Ce99mAWAOqxQZEuxxLAVJKN6WCu+rcnsGJyjb2+B nW2KsZIkfXMmFI/kfesYosEPrvZuJX+Ooql2icWF0SaZZhUqX2V7VePNvET1KqF0T2pN kHzujUzeWwEUCmSB7ZNeFDCZ520ReceF796tklRM+/hDOWB1iXs2NtLyqsp5AgQkjO9s li+GbsiTjiSIPs8k//D7argoR3cbiCjiwha2emjQej+jvXY1LMnlD8YKsCGgffVkHHUB ywC142IoUd1Lat/NsrDz5HmIavLIVfvnMje+RAgGN8TmgowF2SE+oi/ucEQ/gFdy4lch +XqQ== X-Gm-Message-State: AG10YOR5i+ezqIFd/lu5j7YZUowVcYMPtvT6stYZTanXXQJ5Tns5QaRtxpcSjLbrrziJ9w== X-Received: by 10.28.50.193 with SMTP id y184mr3462662wmy.103.1455712588830; Wed, 17 Feb 2016 04:36:28 -0800 (PST) Received: from localhost (5ec16434.skybroadband.com. [94.193.100.52]) by smtp.gmail.com with ESMTPSA id z65sm28356972wmg.1.2016.02.17.04.36.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Feb 2016 04:36:28 -0800 (PST) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Jeremy Linton , Mark Rutland , Suzuki K Poulose Subject: [PATCH 10/13] efi/arm*: Perform hardware compatibility check Date: Wed, 17 Feb 2016 12:36:03 +0000 Message-Id: <1455712566-16727-11-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1455712566-16727-1-git-send-email-matt@codeblueprint.co.uk> References: <1455712566-16727-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel 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 Acked-by: Mark Rutland Signed-off-by: Matt Fleming --- drivers/firmware/efi/libstub/arm-stub.c | 4 ++++ drivers/firmware/efi/libstub/efistub.h | 2 ++ 2 files changed, 6 insertions(+) -- 2.6.2 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 86ff7bfa6ace..981c6035ce09 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