From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 7/7] ARM/arm64: efistub: perform hardware compatibility check
Date: Thu, 4 Feb 2016 16:50:30 +0100 [thread overview]
Message-ID: <1454601030-9093-8-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1454601030-9093-1-git-send-email-ard.biesheuvel@linaro.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 <jeremy.linton@arm.com>
Tested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
drivers/firmware/efi/libstub/arm-stub.c | 4 ++++
drivers/firmware/efi/libstub/efistub.h | 2 ++
2 files changed, 6 insertions(+)
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
--
2.5.0
next prev parent reply other threads:[~2016-02-04 15:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-04 15:50 [PATCH v2 0/7] ARM/efi minor fixes + stub pre-boot compat checks Ard Biesheuvel
2016-02-04 15:50 ` [PATCH v2 1/7] arm64: efistub: drop __init annotation from handle_kernel_image() Ard Biesheuvel
2016-02-04 15:50 ` [PATCH v2 2/7] arm64: vmlinux.lds.S: handle .init.rodata.xxx and .init.bss sections Ard Biesheuvel
2016-02-04 15:50 ` [PATCH v2 3/7] efi: efistub: prevent __init annotations from being used Ard Biesheuvel
2016-02-04 15:50 ` [PATCH v2 4/7] efi: arm-init: use read-only early mappings Ard Biesheuvel
2016-02-04 15:50 ` [PATCH v2 5/7] ARM: efistub: check for LPAE support before booting a LPAE kernel Ard Biesheuvel
2016-02-04 15:50 ` [PATCH v2 6/7] arm64: efistub: check for h/w support before booting a >4 KB granule kernel Ard Biesheuvel
2016-02-04 15:50 ` Ard Biesheuvel [this message]
2016-02-04 16:13 ` [PATCH v2 0/7] ARM/efi minor fixes + stub pre-boot compat checks Mark Rutland
2016-02-11 16:16 ` Matt Fleming
2016-02-11 16:18 ` Ard Biesheuvel
2016-02-11 16:29 ` Matt Fleming
2016-02-11 16:32 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1454601030-9093-8-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).