All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	dhowells@redhat.com, linux-security-module@vger.kernel.org,
	keyrings@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/8] efi: use typed function pointers for runtime services table [ver #5]
Date: Wed, 07 Dec 2016 13:18:09 +0000	[thread overview]
Message-ID: <148111668993.23390.8165077275527037412.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <148111668193.23390.6340512985876251017.stgit@warthog.procyon.org.uk>

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Instead of using void pointers, and casting them to correctly typed
function pointers upon use, declare the runtime services pointers
as function pointers using their respective prototypes, for which
typedefs are already available.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/efi.h |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/linux/efi.h b/include/linux/efi.h
index a07a476178cd..93a82de167eb 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -508,24 +508,6 @@ typedef struct {
 	u64 query_variable_info;
 } efi_runtime_services_64_t;
 
-typedef struct {
-	efi_table_hdr_t hdr;
-	void *get_time;
-	void *set_time;
-	void *get_wakeup_time;
-	void *set_wakeup_time;
-	void *set_virtual_address_map;
-	void *convert_pointer;
-	void *get_variable;
-	void *get_next_variable;
-	void *set_variable;
-	void *get_next_high_mono_count;
-	void *reset_system;
-	void *update_capsule;
-	void *query_capsule_caps;
-	void *query_variable_info;
-} efi_runtime_services_t;
-
 typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc);
 typedef efi_status_t efi_set_time_t (efi_time_t *tm);
 typedef efi_status_t efi_get_wakeup_time_t (efi_bool_t *enabled, efi_bool_t *pending,
@@ -560,6 +542,24 @@ typedef efi_status_t efi_query_variable_store_t(u32 attributes,
 						unsigned long size,
 						bool nonblocking);
 
+typedef struct {
+	efi_table_hdr_t			hdr;
+	efi_get_time_t			*get_time;
+	efi_set_time_t			*set_time;
+	efi_get_wakeup_time_t		*get_wakeup_time;
+	efi_set_wakeup_time_t		*set_wakeup_time;
+	efi_set_virtual_address_map_t	*set_virtual_address_map;
+	void				*convert_pointer;
+	efi_get_variable_t		*get_variable;
+	efi_get_next_variable_t		*get_next_variable;
+	efi_set_variable_t		*set_variable;
+	efi_get_next_high_mono_count_t	*get_next_high_mono_count;
+	efi_reset_system_t		*reset_system;
+	efi_update_capsule_t		*update_capsule;
+	efi_query_capsule_caps_t	*query_capsule_caps;
+	efi_query_variable_info_t	*query_variable_info;
+} efi_runtime_services_t;
+
 void efi_native_runtime_setup(void);
 
 /*

WARNING: multiple messages have this Message-ID (diff)
From: dhowells@redhat.com (David Howells)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/8] efi: use typed function pointers for runtime services table [ver #5]
Date: Wed, 07 Dec 2016 13:18:09 +0000	[thread overview]
Message-ID: <148111668993.23390.8165077275527037412.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <148111668193.23390.6340512985876251017.stgit@warthog.procyon.org.uk>

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Instead of using void pointers, and casting them to correctly typed
function pointers upon use, declare the runtime services pointers
as function pointers using their respective prototypes, for which
typedefs are already available.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/efi.h |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/linux/efi.h b/include/linux/efi.h
index a07a476178cd..93a82de167eb 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -508,24 +508,6 @@ typedef struct {
 	u64 query_variable_info;
 } efi_runtime_services_64_t;
 
-typedef struct {
-	efi_table_hdr_t hdr;
-	void *get_time;
-	void *set_time;
-	void *get_wakeup_time;
-	void *set_wakeup_time;
-	void *set_virtual_address_map;
-	void *convert_pointer;
-	void *get_variable;
-	void *get_next_variable;
-	void *set_variable;
-	void *get_next_high_mono_count;
-	void *reset_system;
-	void *update_capsule;
-	void *query_capsule_caps;
-	void *query_variable_info;
-} efi_runtime_services_t;
-
 typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc);
 typedef efi_status_t efi_set_time_t (efi_time_t *tm);
 typedef efi_status_t efi_get_wakeup_time_t (efi_bool_t *enabled, efi_bool_t *pending,
@@ -560,6 +542,24 @@ typedef efi_status_t efi_query_variable_store_t(u32 attributes,
 						unsigned long size,
 						bool nonblocking);
 
+typedef struct {
+	efi_table_hdr_t			hdr;
+	efi_get_time_t			*get_time;
+	efi_set_time_t			*set_time;
+	efi_get_wakeup_time_t		*get_wakeup_time;
+	efi_set_wakeup_time_t		*set_wakeup_time;
+	efi_set_virtual_address_map_t	*set_virtual_address_map;
+	void				*convert_pointer;
+	efi_get_variable_t		*get_variable;
+	efi_get_next_variable_t		*get_next_variable;
+	efi_set_variable_t		*set_variable;
+	efi_get_next_high_mono_count_t	*get_next_high_mono_count;
+	efi_reset_system_t		*reset_system;
+	efi_update_capsule_t		*update_capsule;
+	efi_query_capsule_caps_t	*query_capsule_caps;
+	efi_query_variable_info_t	*query_variable_info;
+} efi_runtime_services_t;
+
 void efi_native_runtime_setup(void);
 
 /*

  reply	other threads:[~2016-12-07 13:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 13:18 [PATCH 0/8] efi: Pass secure boot mode to kernel [ver #5] David Howells
2016-12-07 13:18 ` David Howells
2016-12-07 13:18 ` David Howells
2016-12-07 13:18 ` David Howells [this message]
2016-12-07 13:18   ` [PATCH 1/8] efi: use typed function pointers for runtime services table " David Howells
2016-12-07 13:18 ` [PATCH 2/8] x86/efi: Allow invocation of arbitrary runtime services " David Howells
2016-12-07 13:18   ` David Howells
2016-12-07 13:18 ` [PATCH 3/8] arm/efi: " David Howells
2016-12-07 13:18   ` David Howells
2016-12-07 13:18 ` [PATCH 4/8] efi: Add SHIM and image security database GUID definitions " David Howells
2016-12-07 13:18   ` David Howells
2016-12-07 13:18 ` [PATCH 5/8] efi: Get the secure boot status " David Howells
2016-12-07 13:18   ` David Howells
2016-12-08  6:57   ` Lukas Wunner
2016-12-08  6:57     ` Lukas Wunner
2016-12-08  8:16   ` David Howells
2016-12-08  8:16     ` David Howells
2016-12-08  8:16     ` David Howells
2016-12-08 12:42     ` Lukas Wunner
2016-12-08 12:42       ` Lukas Wunner
2016-12-08 17:31     ` David Howells
2016-12-08 17:31       ` David Howells
2016-12-08 17:31       ` David Howells
2016-12-09  0:35       ` Lukas Wunner
2016-12-09  0:35         ` Lukas Wunner
2016-12-09  0:35         ` Lukas Wunner
2016-12-07 13:18 ` [PATCH 6/8] efi: Disable secure boot if shim is in insecure mode " David Howells
2016-12-07 13:18   ` David Howells
2016-12-07 13:18 ` [PATCH 7/8] efi: Add EFI_SECURE_BOOT bit " David Howells
2016-12-07 13:18   ` David Howells
2016-12-07 13:19 ` [PATCH 8/8] efi: Handle secure boot from UEFI-2.6 " David Howells
2016-12-07 13:19   ` David Howells

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=148111668993.23390.8165077275527037412.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    /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.