From: tip-bot for David Howells <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: ard.biesheuvel@linaro.org, lukas@wunner.de,
linux-kernel@vger.kernel.org, peterz@infradead.org,
matt@codeblueprint.co.uk, mingo@kernel.org, tglx@linutronix.de,
hpa@zytor.com, dhowells@redhat.com,
torvalds@linux-foundation.org
Subject: [tip:efi/core] x86/efi: Allow invocation of arbitrary runtime services
Date: Tue, 7 Feb 2017 01:45:46 -0800 [thread overview]
Message-ID: <tip-a2cd2f3f29f26782b7484b32e2af172e29313717@git.kernel.org> (raw)
In-Reply-To: <1486380166-31868-2-git-send-email-ard.biesheuvel@linaro.org>
Commit-ID: a2cd2f3f29f26782b7484b32e2af172e29313717
Gitweb: http://git.kernel.org/tip/a2cd2f3f29f26782b7484b32e2af172e29313717
Author: David Howells <dhowells@redhat.com>
AuthorDate: Mon, 6 Feb 2017 11:22:40 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 7 Feb 2017 10:42:09 +0100
x86/efi: Allow invocation of arbitrary runtime services
Provide the ability to perform mixed-mode runtime service calls for x86 in
the same way the following commit provided the ability to invoke for boot
services:
0a637ee61247bd ("x86/efi: Allow invocation of arbitrary boot services")
Suggested-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/1486380166-31868-2-git-send-email-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/boot/compressed/eboot.c | 1 +
arch/x86/boot/compressed/head_32.S | 6 +++---
arch/x86/boot/compressed/head_64.S | 8 ++++----
arch/x86/include/asm/efi.h | 5 +++++
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 6d3aeab..f99978d 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -32,6 +32,7 @@ static void setup_boot_services##bits(struct efi_config *c) \
\
table = (typeof(table))sys_table; \
\
+ c->runtime_services = table->runtime; \
c->boot_services = table->boottime; \
c->text_output = table->con_out; \
}
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index fd0b6a2..d85b962 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -82,7 +82,7 @@ ENTRY(efi_pe_entry)
/* Relocate efi_config->call() */
leal efi32_config(%esi), %eax
- add %esi, 32(%eax)
+ add %esi, 40(%eax)
pushl %eax
call make_boot_params
@@ -108,7 +108,7 @@ ENTRY(efi32_stub_entry)
/* Relocate efi_config->call() */
leal efi32_config(%esi), %eax
- add %esi, 32(%eax)
+ add %esi, 40(%eax)
pushl %eax
2:
call efi_main
@@ -264,7 +264,7 @@ relocated:
#ifdef CONFIG_EFI_STUB
.data
efi32_config:
- .fill 4,8,0
+ .fill 5,8,0
.long efi_call_phys
.long 0
.byte 0
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 4d85e60..d2ae1f8 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -264,7 +264,7 @@ ENTRY(efi_pe_entry)
/*
* Relocate efi_config->call().
*/
- addq %rbp, efi64_config+32(%rip)
+ addq %rbp, efi64_config+40(%rip)
movq %rax, %rdi
call make_boot_params
@@ -284,7 +284,7 @@ handover_entry:
* Relocate efi_config->call().
*/
movq efi_config(%rip), %rax
- addq %rbp, 32(%rax)
+ addq %rbp, 40(%rax)
2:
movq efi_config(%rip), %rdi
call efi_main
@@ -456,14 +456,14 @@ efi_config:
#ifdef CONFIG_EFI_MIXED
.global efi32_config
efi32_config:
- .fill 4,8,0
+ .fill 5,8,0
.quad efi64_thunk
.byte 0
#endif
.global efi64_config
efi64_config:
- .fill 4,8,0
+ .fill 5,8,0
.quad efi_call
.byte 1
#endif /* CONFIG_EFI_STUB */
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index e99675b..2f77bce 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -191,6 +191,7 @@ static inline efi_status_t efi_thunk_set_virtual_address_map(
struct efi_config {
u64 image_handle;
u64 table;
+ u64 runtime_services;
u64 boot_services;
u64 text_output;
efi_status_t (*call)(unsigned long, ...);
@@ -226,6 +227,10 @@ static inline bool efi_is_64bit(void)
#define __efi_call_early(f, ...) \
__efi_early()->call((unsigned long)f, __VA_ARGS__);
+#define efi_call_runtime(f, ...) \
+ __efi_early()->call(efi_table_attr(efi_runtime_services, f, \
+ __efi_early()->runtime_services), __VA_ARGS__)
+
extern bool efi_reboot_required(void);
#else
next prev parent reply other threads:[~2017-02-07 9:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-06 11:22 [GIT PULL 0/7] EFI updates for v4.11 part 2 Ard Biesheuvel
2017-02-06 11:22 ` Ard Biesheuvel
2017-02-06 11:22 ` [PATCH 1/7] x86/efi: Allow invocation of arbitrary runtime services Ard Biesheuvel
2017-02-07 9:45 ` tip-bot for David Howells [this message]
2017-02-06 11:22 ` [PATCH 3/7] efi: Add SHIM and image security database GUID definitions Ard Biesheuvel
2017-02-07 7:52 ` Ingo Molnar
[not found] ` <20170207075219.GB24528-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-07 8:07 ` Ard Biesheuvel
2017-02-07 8:07 ` Ard Biesheuvel
2017-02-07 9:23 ` David Howells
[not found] ` <27407.1486459390-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2017-02-07 9:42 ` Ingo Molnar
2017-02-07 9:42 ` Ingo Molnar
2017-02-07 9:46 ` [tip:efi/core] " tip-bot for Josh Boyer
2017-02-06 11:22 ` [PATCH 5/7] efi: Disable secure boot if shim is in insecure mode Ard Biesheuvel
2017-02-07 9:48 ` [tip:efi/core] " tip-bot for Josh Boyer
2017-02-06 11:22 ` [PATCH 6/7] efi: Print the secure boot status in x86 setup_arch() Ard Biesheuvel
2017-02-07 9:48 ` [tip:efi/core] " tip-bot for David Howells
[not found] ` <1486380166-31868-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-06 11:22 ` [PATCH 2/7] arm/efi: Allow invocation of arbitrary runtime services Ard Biesheuvel
2017-02-06 11:22 ` Ard Biesheuvel
2017-02-07 9:46 ` [tip:efi/core] " tip-bot for David Howells
2017-02-06 11:22 ` [PATCH 4/7] efi: Get the secure boot status Ard Biesheuvel
2017-02-06 11:22 ` Ard Biesheuvel
2017-02-07 9:47 ` [tip:efi/core] efi: Get and store " tip-bot for David Howells
2017-02-06 11:22 ` [PATCH 7/7] efi: libstub: Make file I/O chunking x86-specific Ard Biesheuvel
2017-02-06 11:22 ` Ard Biesheuvel
2017-02-07 9:49 ` [tip:efi/core] efi/libstub: " tip-bot for Ard Biesheuvel
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=tip-a2cd2f3f29f26782b7484b32e2af172e29313717@git.kernel.org \
--to=tipbot@zytor.com \
--cc=ard.biesheuvel@linaro.org \
--cc=dhowells@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=matt@codeblueprint.co.uk \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.