All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] efi: Implement generic EFI boot for x86
@ 2023-05-23 15:31 Ard Biesheuvel
  2023-05-23 15:31 ` [PATCH v4 1/5] efi: Make EFI PXE protocol methods non-callable Ard Biesheuvel
                   ` (5 more replies)
  0 siblings, 6 replies; 29+ messages in thread
From: Ard Biesheuvel @ 2023-05-23 15:31 UTC (permalink / raw)
  To: grub-devel; +Cc: Ard Biesheuvel, Daniel Kiper, Glenn Washburn

Switch the i386-efi and x86_64-efi builds to the generic EFI loader,
which enters the Linux kernel via the EFI stub and provides the initrd
via the LoadFile2 protocol. This unifies x86 with other EFI
architectures, and removes the dependency on the setup header and struct
bootparams.

Do some preparatory cleanup first, so we no longer need to rely on the
MS to SysV calling convention translation code.

Changes since v3:
- add missing efiapi annotations to efiemu routines
- work around dead code warning from Coverity by making unnecessary
  changes to the initrd loading logic in the generic EFI loader

Changes since v2:
- rebase onto latest master, which has the Loongarch changes
- retain Itanium support for now
- simplify the fallback logic - attempt to load the image as usual, and
  fallback on failure or if the image does not implement LoadFile2

Changes since v1:
- drop Itanium support, which is a maintenance burden as it shares the
  EFI code with other architectures, but does not have a EFI stub in
  Linux, and there is no way to test whether our changes break the boot
  for it or not;
- enable generic EFI for i386 as well
- wire up the existing x86 code as a fallback for kernels that lack EFI
  stub or LoadFile2 support. This removes the need for additional
  changes to support v5.8 or older kernels.

Cc: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Glenn Washburn <development@efficientek.com>

Ard Biesheuvel (5):
  efi: Make EFI PXE protocol methods non-callable
  efi: Add calling convention annotation to all prototypes
  efi: Drop all uses of efi_call_XX wrappers
  efi: Remove x86_64 call wrappers
  efi: Use generic EFI loader for x86_64 and i386

 grub-core/Makefile.core.def           |   3 +-
 grub-core/commands/acpi.c             |   8 +-
 grub-core/commands/efi/efitextmode.c  |   8 +-
 grub-core/commands/efi/lsefi.c        |   5 +-
 grub-core/commands/efi/tpm.c          |  21 +-
 grub-core/disk/efi/efidisk.c          |   7 +-
 grub-core/efiemu/runtime/efiemu.c     |  48 +-
 grub-core/kern/arm/efi/init.c         |  12 +-
 grub-core/kern/efi/efi.c              |  56 +-
 grub-core/kern/efi/init.c             |  15 +-
 grub-core/kern/efi/mm.c               |  17 +-
 grub-core/kern/i386/efi/tsc.c         |   2 +-
 grub-core/kern/ia64/efi/init.c        |  14 +-
 grub-core/kern/loongarch64/efi/init.c |  10 +-
 grub-core/kern/x86_64/efi/callwrap.S  | 129 ----
 grub-core/lib/efi/datetime.c          |   9 +-
 grub-core/lib/efi/halt.c              |   4 +-
 grub-core/lib/efi/relocator.c         |   6 +-
 grub-core/loader/efi/appleloader.c    |   8 +-
 grub-core/loader/efi/chainloader.c    |  20 +-
 grub-core/loader/efi/linux.c          |  47 +-
 grub-core/loader/i386/linux.c         |   8 +
 grub-core/mmap/efi/mmap.c             |  16 +-
 grub-core/net/drivers/efi/efinet.c    |  26 +-
 grub-core/term/efi/console.c          |  29 +-
 grub-core/term/efi/serial.c           |  18 +-
 grub-core/video/efi_gop.c             |  18 +-
 grub-core/video/efi_uga.c             |   8 +-
 include/grub/efi/api.h                | 666 +++++++++-----------
 include/grub/efi/efi.h                |   2 +-
 include/grub/efi/tpm.h                | 149 +++--
 31 files changed, 628 insertions(+), 761 deletions(-)
 delete mode 100644 grub-core/kern/x86_64/efi/callwrap.S

-- 
2.39.2



^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v4 1/5] efi: Make EFI PXE protocol methods non-callable
  2023-05-23 15:31 [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Ard Biesheuvel
@ 2023-05-23 15:31 ` Ard Biesheuvel
  2023-05-23 15:31 ` [PATCH v4 2/5] efi: Add calling convention annotation to all prototypes Ard Biesheuvel
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 29+ messages in thread
From: Ard Biesheuvel @ 2023-05-23 15:31 UTC (permalink / raw)
  To: grub-devel; +Cc: Ard Biesheuvel, Daniel Kiper, Glenn Washburn

The grub_efi_pxe_t struct definition has placeholders for the various
protocol method pointers, given that they are never called in the code,
and the prototypes have been omitted, and therefore do not comply with
the UEFI spec.

So let's convert them into void* pointers, so they cannot be called
inadvertently.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 include/grub/efi/api.h | 24 ++++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index 4ae5e51c9013ceb3..7077d2265df9b20a 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -1539,18 +1539,18 @@ typedef struct grub_efi_pxe_mode
 typedef struct grub_efi_pxe
 {
   grub_uint64_t rev;
-  void (*start) (void);
-  void (*stop) (void);
-  void (*dhcp) (void);
-  void (*discover) (void);
-  void (*mftp) (void);
-  void (*udpwrite) (void);
-  void (*udpread) (void);
-  void (*setipfilter) (void);
-  void (*arp) (void);
-  void (*setparams) (void);
-  void (*setstationip) (void);
-  void (*setpackets) (void);
+  void *start;
+  void *stop;
+  void *dhcp;
+  void *discover;
+  void *mftp;
+  void *udpwrite;
+  void *udpread;
+  void *setipfilter;
+  void *arp;
+  void *setparams;
+  void *setstationip;
+  void *setpackets;
   struct grub_efi_pxe_mode *mode;
 } grub_efi_pxe_t;
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v4 2/5] efi: Add calling convention annotation to all prototypes
  2023-05-23 15:31 [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Ard Biesheuvel
  2023-05-23 15:31 ` [PATCH v4 1/5] efi: Make EFI PXE protocol methods non-callable Ard Biesheuvel
@ 2023-05-23 15:31 ` Ard Biesheuvel
  2023-05-23 15:31 ` [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers Ard Biesheuvel
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 29+ messages in thread
From: Ard Biesheuvel @ 2023-05-23 15:31 UTC (permalink / raw)
  To: grub-devel; +Cc: Ard Biesheuvel, Daniel Kiper, Glenn Washburn

UEFI mandates MS calling convention on x86_64, which was not supported
on GCC when UEFI support was first introduced into GRUB. However, now we
can use the ms_abi function type attribute to annotate functions and
function pointers as adhering to the MS calling convention, and the
compiler will generate the correct instruction sequence for us.

So let's add the appropriate annotation to all the function prototypes.
This will allow us to drop the special call wrappers in a subsequent
patch.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 grub-core/efiemu/runtime/efiemu.c |  48 +-
 grub-core/kern/arm/efi/init.c     |   2 +-
 include/grub/efi/api.h            | 569 ++++++++++----------
 include/grub/efi/tpm.h            | 149 +++--
 4 files changed, 397 insertions(+), 371 deletions(-)

diff --git a/grub-core/efiemu/runtime/efiemu.c b/grub-core/efiemu/runtime/efiemu.c
index 5db1f347b5db54cc..53b3cce7b0c2ecf8 100644
--- a/grub-core/efiemu/runtime/efiemu.c
+++ b/grub-core/efiemu/runtime/efiemu.c
@@ -32,17 +32,17 @@
 #include <grub/efi/api.h>
 #include <grub/efiemu/runtime.h>
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_get_time (grub_efi_time_t *time,
 		 grub_efi_time_capabilities_t *capabilities);
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_set_time (grub_efi_time_t *time);
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_get_wakeup_time (grub_efi_boolean_t *enabled,
 			grub_efi_boolean_t *pending,
 			grub_efi_time_t *time);
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_set_wakeup_time (grub_efi_boolean_t enabled,
 			grub_efi_time_t *time);
 
@@ -52,51 +52,51 @@ efiemu_set_wakeup_time (grub_efi_boolean_t enabled,
 #define PHYSICAL_ATTRIBUTE __attribute__ ((section(".text-physical")));
 #endif
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size,
 				grub_efi_uintn_t descriptor_size,
 				grub_efi_uint32_t descriptor_version,
 				grub_efi_memory_descriptor_t *virtual_map)
   PHYSICAL_ATTRIBUTE;
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_convert_pointer (grub_efi_uintn_t debug_disposition,
 			void **address)
   PHYSICAL_ATTRIBUTE;
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_get_variable (grub_efi_char16_t *variable_name,
 		     const grub_efi_guid_t *vendor_guid,
 		     grub_efi_uint32_t *attributes,
 		     grub_efi_uintn_t *data_size,
 		     void *data);
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_get_next_variable_name (grub_efi_uintn_t *variable_name_size,
 			       grub_efi_char16_t *variable_name,
 			       grub_efi_guid_t *vendor_guid);
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_set_variable (grub_efi_char16_t *variable_name,
 		     const grub_efi_guid_t *vendor_guid,
 		     grub_efi_uint32_t attributes,
 		     grub_efi_uintn_t data_size,
 		     void *data);
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 efiemu_get_next_high_monotonic_count (grub_efi_uint32_t *high_count);
-void
+void __grub_efi_api
 efiemu_reset_system (grub_efi_reset_type_t reset_type,
 		     grub_efi_status_t reset_status,
 		     grub_efi_uintn_t data_size,
 		     grub_efi_char16_t *reset_data);
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t,
 					      grub_efi_uintn_t,
 					      grub_efi_uint32_t,
 					      grub_efi_memory_descriptor_t *)
      PHYSICAL_ATTRIBUTE;
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition,
 				      void **address)
      PHYSICAL_ATTRIBUTE;
@@ -202,7 +202,7 @@ bcd_to_hex (grub_uint8_t in)
   return 10 * ((in & 0xf0) >> 4) + (in & 0x0f);
 }
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time,
 			       grub_efi_time_capabilities_t *capabilities)
 {
@@ -246,7 +246,7 @@ EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time,
   return GRUB_EFI_SUCCESS;
 }
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time)
 {
   LOG ('b');
@@ -265,7 +265,7 @@ EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time)
 }
 
 /* Following 2 functions are vendor specific. So announce it as unsupported */
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_get_wakeup_time) (grub_efi_boolean_t *enabled,
 				      grub_efi_boolean_t *pending,
 				      grub_efi_time_t *time)
@@ -274,7 +274,7 @@ EFI_FUNC (efiemu_get_wakeup_time) (grub_efi_boolean_t *enabled,
   return GRUB_EFI_UNSUPPORTED;
 }
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_set_wakeup_time) (grub_efi_boolean_t enabled,
 				      grub_efi_time_t *time)
 {
@@ -337,7 +337,7 @@ efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size)
 }
 
 
-grub_efi_status_t EFI_FUNC
+grub_efi_status_t __grub_efi_api EFI_FUNC
 (efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size,
 				  grub_efi_uintn_t descriptor_size,
 				  grub_efi_uint32_t descriptor_version,
@@ -403,7 +403,7 @@ grub_efi_status_t EFI_FUNC
 
 /* since efiemu_set_virtual_address_map corrects all the pointers
    we don't need efiemu_convert_pointer */
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition,
 				      void **address)
 {
@@ -436,7 +436,7 @@ find_variable (const grub_efi_guid_t *vendor_guid,
   return 0;
 }
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name,
 				const grub_efi_guid_t *vendor_guid,
 				grub_efi_uint32_t *attributes,
@@ -461,7 +461,7 @@ EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name,
   return GRUB_EFI_SUCCESS;
 }
 
-grub_efi_status_t EFI_FUNC
+grub_efi_status_t __grub_efi_api EFI_FUNC
 (efiemu_get_next_variable_name) (grub_efi_uintn_t *variable_name_size,
 				 grub_efi_char16_t *variable_name,
 				 grub_efi_guid_t *vendor_guid)
@@ -501,7 +501,7 @@ grub_efi_status_t EFI_FUNC
   return GRUB_EFI_SUCCESS;
 }
 
-grub_efi_status_t
+grub_efi_status_t __grub_efi_api
 EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name,
 				const grub_efi_guid_t *vendor_guid,
 				grub_efi_uint32_t attributes,
@@ -556,7 +556,7 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name,
   return GRUB_EFI_SUCCESS;
 }
 
-grub_efi_status_t EFI_FUNC
+grub_efi_status_t __grub_efi_api EFI_FUNC
 (efiemu_get_next_high_monotonic_count) (grub_efi_uint32_t *high_count)
 {
   LOG ('j');
@@ -570,7 +570,7 @@ grub_efi_status_t EFI_FUNC
    Besides EFI specification says that this function shouldn't be used
    on systems supporting ACPI
  */
-void
+void __grub_efi_api
 EFI_FUNC (efiemu_reset_system) (grub_efi_reset_type_t reset_type,
 				   grub_efi_status_t reset_status,
 				   grub_efi_uintn_t data_size,
diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c
index 7fcf91bf41168d4a..ab48342f3cda116d 100644
--- a/grub-core/kern/arm/efi/init.c
+++ b/grub-core/kern/arm/efi/init.c
@@ -34,7 +34,7 @@ grub_efi_get_time_ms (void)
   return tmr;
 }
 
-static void
+static void __grub_efi_api
 increment_timer (grub_efi_event_t event __attribute__ ((unused)),
 		 void *context __attribute__ ((unused)))
 {
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index 7077d2265df9b20a..ebfa6c40fba34eae 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -1127,209 +1127,210 @@ struct grub_efi_boot_services
   grub_efi_table_header_t hdr;
 
   grub_efi_tpl_t
-  (*raise_tpl) (grub_efi_tpl_t new_tpl);
+  (__grub_efi_api *raise_tpl) (grub_efi_tpl_t new_tpl);
 
   void
-  (*restore_tpl) (grub_efi_tpl_t old_tpl);
+  (__grub_efi_api *restore_tpl) (grub_efi_tpl_t old_tpl);
 
   grub_efi_status_t
-  (*allocate_pages) (grub_efi_allocate_type_t type,
-		     grub_efi_memory_type_t memory_type,
-		     grub_efi_uintn_t pages,
-		     grub_efi_physical_address_t *memory);
+  (__grub_efi_api *allocate_pages) (grub_efi_allocate_type_t type,
+				    grub_efi_memory_type_t memory_type,
+				    grub_efi_uintn_t pages,
+				    grub_efi_physical_address_t *memory);
 
   grub_efi_status_t
-  (*free_pages) (grub_efi_physical_address_t memory,
-		 grub_efi_uintn_t pages);
+  (__grub_efi_api *free_pages) (grub_efi_physical_address_t memory,
+				grub_efi_uintn_t pages);
 
   grub_efi_status_t
-  (*get_memory_map) (grub_efi_uintn_t *memory_map_size,
-		     grub_efi_memory_descriptor_t *memory_map,
-		     grub_efi_uintn_t *map_key,
-		     grub_efi_uintn_t *descriptor_size,
-		     grub_efi_uint32_t *descriptor_version);
+  (__grub_efi_api *get_memory_map) (grub_efi_uintn_t *memory_map_size,
+				    grub_efi_memory_descriptor_t *memory_map,
+				    grub_efi_uintn_t *map_key,
+				    grub_efi_uintn_t *descriptor_size,
+				    grub_efi_uint32_t *descriptor_version);
 
   grub_efi_status_t
-  (*allocate_pool) (grub_efi_memory_type_t pool_type,
-		    grub_efi_uintn_t size,
-		    void **buffer);
+  (__grub_efi_api *allocate_pool) (grub_efi_memory_type_t pool_type,
+				   grub_efi_uintn_t size,
+				   void **buffer);
 
   grub_efi_status_t
-  (*free_pool) (void *buffer);
+  (__grub_efi_api *free_pool) (void *buffer);
 
   grub_efi_status_t
-  (*create_event) (grub_efi_uint32_t type,
-		   grub_efi_tpl_t notify_tpl,
-		   void (*notify_function) (grub_efi_event_t event,
-					    void *context),
-		   void *notify_context,
-		   grub_efi_event_t *event);
+  (__grub_efi_api *create_event) (grub_efi_uint32_t type,
+				  grub_efi_tpl_t notify_tpl,
+				  void (__grub_efi_api *notify_function) (grub_efi_event_t,
+									  void *context),
+				  void *notify_context,
+				  grub_efi_event_t *event);
 
   grub_efi_status_t
-  (*set_timer) (grub_efi_event_t event,
-		grub_efi_timer_delay_t type,
-		grub_efi_uint64_t trigger_time);
+  (__grub_efi_api *set_timer) (grub_efi_event_t event,
+			       grub_efi_timer_delay_t type,
+			       grub_efi_uint64_t trigger_time);
 
   grub_efi_status_t
-  (*wait_for_event) (grub_efi_uintn_t num_events,
-		     grub_efi_event_t *event,
-		     grub_efi_uintn_t *index);
+  (__grub_efi_api *wait_for_event) (grub_efi_uintn_t num_events,
+				    grub_efi_event_t *event,
+				    grub_efi_uintn_t *index);
 
   grub_efi_status_t
-  (*signal_event) (grub_efi_event_t event);
+  (__grub_efi_api *signal_event) (grub_efi_event_t event);
 
   grub_efi_status_t
-  (*close_event) (grub_efi_event_t event);
+  (__grub_efi_api *close_event) (grub_efi_event_t event);
 
   grub_efi_status_t
-  (*check_event) (grub_efi_event_t event);
+  (__grub_efi_api *check_event) (grub_efi_event_t event);
 
   grub_efi_status_t
-  (*install_protocol_interface) (grub_efi_handle_t *handle,
-				 grub_efi_guid_t *protocol,
-				 grub_efi_interface_type_t protocol_interface_type,
-				 void *protocol_interface);
+  (__grub_efi_api *install_protocol_interface) (grub_efi_handle_t *handle,
+						grub_efi_guid_t *protocol,
+						grub_efi_interface_type_t protocol_interface_type,
+						void *protocol_interface);
 
   grub_efi_status_t
-  (*reinstall_protocol_interface) (grub_efi_handle_t handle,
-				   grub_efi_guid_t *protocol,
-				   void *old_interface,
-				   void *new_interface);
+  (__grub_efi_api *reinstall_protocol_interface) (grub_efi_handle_t handle,
+						  grub_efi_guid_t *protocol,
+						  void *old_interface,
+						  void *new_interface);
 
   grub_efi_status_t
-  (*uninstall_protocol_interface) (grub_efi_handle_t handle,
-				   grub_efi_guid_t *protocol,
-				   void *protocol_interface);
+  (__grub_efi_api *uninstall_protocol_interface) (grub_efi_handle_t handle,
+						  grub_efi_guid_t *protocol,
+						  void *protocol_interface);
 
   grub_efi_status_t
-  (*handle_protocol) (grub_efi_handle_t handle,
-		      grub_efi_guid_t *protocol,
-		      void **protocol_interface);
+  (__grub_efi_api *handle_protocol) (grub_efi_handle_t handle,
+				     grub_efi_guid_t *protocol,
+				     void **protocol_interface);
 
   void *reserved;
 
   grub_efi_status_t
-  (*register_protocol_notify) (grub_efi_guid_t *protocol,
-			       grub_efi_event_t event,
-			       void **registration);
+  (__grub_efi_api *register_protocol_notify) (grub_efi_guid_t *protocol,
+					      grub_efi_event_t event,
+					      void **registration);
 
   grub_efi_status_t
-  (*locate_handle) (grub_efi_locate_search_type_t search_type,
-		    grub_efi_guid_t *protocol,
-		    void *search_key,
-		    grub_efi_uintn_t *buffer_size,
-		    grub_efi_handle_t *buffer);
+  (__grub_efi_api *locate_handle) (grub_efi_locate_search_type_t search_type,
+				   grub_efi_guid_t *protocol,
+				   void *search_key,
+				   grub_efi_uintn_t *buffer_size,
+				   grub_efi_handle_t *buffer);
 
   grub_efi_status_t
-  (*locate_device_path) (grub_efi_guid_t *protocol,
-			 grub_efi_device_path_t **device_path,
-			 grub_efi_handle_t *device);
+  (__grub_efi_api *locate_device_path) (grub_efi_guid_t *protocol,
+					grub_efi_device_path_t **device_path,
+					grub_efi_handle_t *device);
 
   grub_efi_status_t
-  (*install_configuration_table) (grub_efi_guid_t *guid, void *table);
+  (__grub_efi_api *install_configuration_table) (grub_efi_guid_t *guid,
+						 void *table);
 
   grub_efi_status_t
-  (*load_image) (grub_efi_boolean_t boot_policy,
-		 grub_efi_handle_t parent_image_handle,
-		 grub_efi_device_path_t *file_path,
-		 void *source_buffer,
-		 grub_efi_uintn_t source_size,
-		 grub_efi_handle_t *image_handle);
+  (__grub_efi_api *load_image) (grub_efi_boolean_t boot_policy,
+				grub_efi_handle_t parent_image_handle,
+				grub_efi_device_path_t *file_path,
+				void *source_buffer,
+				grub_efi_uintn_t source_size,
+				grub_efi_handle_t *image_handle);
 
   grub_efi_status_t
-  (*start_image) (grub_efi_handle_t image_handle,
-		  grub_efi_uintn_t *exit_data_size,
-		  grub_efi_char16_t **exit_data);
+  (__grub_efi_api *start_image) (grub_efi_handle_t image_handle,
+				 grub_efi_uintn_t *exit_data_size,
+				 grub_efi_char16_t **exit_data);
 
   grub_efi_status_t
-  (*exit) (grub_efi_handle_t image_handle,
-	   grub_efi_status_t exit_status,
-	   grub_efi_uintn_t exit_data_size,
-	   grub_efi_char16_t *exit_data);
+  (__grub_efi_api *exit) (grub_efi_handle_t image_handle,
+			  grub_efi_status_t exit_status,
+			  grub_efi_uintn_t exit_data_size,
+			  grub_efi_char16_t *exit_data);
 
   grub_efi_status_t
-  (*unload_image) (grub_efi_handle_t image_handle);
+  (__grub_efi_api *unload_image) (grub_efi_handle_t image_handle);
 
   grub_efi_status_t
-  (*exit_boot_services) (grub_efi_handle_t image_handle,
-			 grub_efi_uintn_t map_key);
+  (__grub_efi_api *exit_boot_services) (grub_efi_handle_t image_handle,
+					grub_efi_uintn_t map_key);
 
   grub_efi_status_t
-  (*get_next_monotonic_count) (grub_efi_uint64_t *count);
+  (__grub_efi_api *get_next_monotonic_count) (grub_efi_uint64_t *count);
 
   grub_efi_status_t
-  (*stall) (grub_efi_uintn_t microseconds);
+  (__grub_efi_api *stall) (grub_efi_uintn_t microseconds);
 
   grub_efi_status_t
-  (*set_watchdog_timer) (grub_efi_uintn_t timeout,
-			 grub_efi_uint64_t watchdog_code,
-			 grub_efi_uintn_t data_size,
-			 grub_efi_char16_t *watchdog_data);
+  (__grub_efi_api *set_watchdog_timer) (grub_efi_uintn_t timeout,
+					grub_efi_uint64_t watchdog_code,
+					grub_efi_uintn_t data_size,
+					grub_efi_char16_t *watchdog_data);
 
   grub_efi_status_t
-  (*connect_controller) (grub_efi_handle_t controller_handle,
-			 grub_efi_handle_t *driver_image_handle,
-			 grub_efi_device_path_protocol_t *remaining_device_path,
-			 grub_efi_boolean_t recursive);
+  (__grub_efi_api *connect_controller) (grub_efi_handle_t controller_handle,
+					grub_efi_handle_t *driver_image_handle,
+					grub_efi_device_path_protocol_t *remaining_device_path,
+					grub_efi_boolean_t recursive);
 
   grub_efi_status_t
-  (*disconnect_controller) (grub_efi_handle_t controller_handle,
-			    grub_efi_handle_t driver_image_handle,
-			    grub_efi_handle_t child_handle);
+  (__grub_efi_api *disconnect_controller) (grub_efi_handle_t controller_handle,
+					   grub_efi_handle_t driver_image_handle,
+					   grub_efi_handle_t child_handle);
 
   grub_efi_status_t
-  (*open_protocol) (grub_efi_handle_t handle,
-		    grub_efi_guid_t *protocol,
-		    void **protocol_interface,
-		    grub_efi_handle_t agent_handle,
-		    grub_efi_handle_t controller_handle,
-		    grub_efi_uint32_t attributes);
+  (__grub_efi_api *open_protocol) (grub_efi_handle_t handle,
+				   grub_efi_guid_t *protocol,
+				   void **protocol_interface,
+				   grub_efi_handle_t agent_handle,
+				   grub_efi_handle_t controller_handle,
+				   grub_efi_uint32_t attributes);
 
   grub_efi_status_t
-  (*close_protocol) (grub_efi_handle_t handle,
-		     grub_efi_guid_t *protocol,
-		     grub_efi_handle_t agent_handle,
-		     grub_efi_handle_t controller_handle);
+  (__grub_efi_api *close_protocol) (grub_efi_handle_t handle,
+				    grub_efi_guid_t *protocol,
+				    grub_efi_handle_t agent_handle,
+				    grub_efi_handle_t controller_handle);
 
   grub_efi_status_t
-  (*open_protocol_information) (grub_efi_handle_t handle,
-				grub_efi_guid_t *protocol,
-				grub_efi_open_protocol_information_entry_t **entry_buffer,
-				grub_efi_uintn_t *entry_count);
+  (__grub_efi_api *open_protocol_information) (grub_efi_handle_t handle,
+					       grub_efi_guid_t *protocol,
+					       grub_efi_open_protocol_information_entry_t **entry_buffer,
+					       grub_efi_uintn_t *entry_count);
 
   grub_efi_status_t
-  (*protocols_per_handle) (grub_efi_handle_t handle,
-			   grub_efi_packed_guid_t ***protocol_buffer,
-			   grub_efi_uintn_t *protocol_buffer_count);
+  (__grub_efi_api *protocols_per_handle) (grub_efi_handle_t handle,
+					  grub_efi_packed_guid_t ***protocol_buffer,
+					  grub_efi_uintn_t *protocol_buffer_count);
 
   grub_efi_status_t
-  (*locate_handle_buffer) (grub_efi_locate_search_type_t search_type,
-			   grub_efi_guid_t *protocol,
-			   void *search_key,
-			   grub_efi_uintn_t *no_handles,
-			   grub_efi_handle_t **buffer);
+  (__grub_efi_api *locate_handle_buffer) (grub_efi_locate_search_type_t search_type,
+					  grub_efi_guid_t *protocol,
+					  void *search_key,
+					  grub_efi_uintn_t *no_handles,
+					  grub_efi_handle_t **buffer);
 
   grub_efi_status_t
-  (*locate_protocol) (grub_efi_guid_t *protocol,
-		      void *registration,
-		      void **protocol_interface);
+  (__grub_efi_api *locate_protocol) (grub_efi_guid_t *protocol,
+				     void *registration,
+				     void **protocol_interface);
 
   grub_efi_status_t
-  (*install_multiple_protocol_interfaces) (grub_efi_handle_t *handle, ...);
+  (__grub_efi_api *install_multiple_protocol_interfaces) (grub_efi_handle_t *handle, ...);
 
   grub_efi_status_t
-  (*uninstall_multiple_protocol_interfaces) (grub_efi_handle_t handle, ...);
+  (__grub_efi_api *uninstall_multiple_protocol_interfaces) (grub_efi_handle_t handle, ...);
 
   grub_efi_status_t
-  (*calculate_crc32) (void *data,
-		      grub_efi_uintn_t data_size,
-		      grub_efi_uint32_t *crc32);
+  (__grub_efi_api *calculate_crc32) (void *data,
+				     grub_efi_uintn_t data_size,
+				     grub_efi_uint32_t *crc32);
 
   void
-  (*copy_mem) (void *destination, void *source, grub_efi_uintn_t length);
+  (__grub_efi_api *copy_mem) (void *destination, void *source, grub_efi_uintn_t length);
 
   void
-  (*set_mem) (void *buffer, grub_efi_uintn_t size, grub_efi_uint8_t value);
+  (__grub_efi_api *set_mem) (void *buffer, grub_efi_uintn_t size, grub_efi_uint8_t value);
 };
 typedef struct grub_efi_boot_services grub_efi_boot_services_t;
 
@@ -1338,61 +1339,61 @@ struct grub_efi_runtime_services
   grub_efi_table_header_t hdr;
 
   grub_efi_status_t
-  (*get_time) (grub_efi_time_t *time,
-	       grub_efi_time_capabilities_t *capabilities);
+  (__grub_efi_api *get_time) (grub_efi_time_t *time,
+			      grub_efi_time_capabilities_t *capabilities);
 
   grub_efi_status_t
-  (*set_time) (grub_efi_time_t *time);
+  (__grub_efi_api *set_time) (grub_efi_time_t *time);
 
   grub_efi_status_t
-  (*get_wakeup_time) (grub_efi_boolean_t *enabled,
-		      grub_efi_boolean_t *pending,
-		      grub_efi_time_t *time);
+  (__grub_efi_api *get_wakeup_time) (grub_efi_boolean_t *enabled,
+				     grub_efi_boolean_t *pending,
+				     grub_efi_time_t *time);
 
   grub_efi_status_t
-  (*set_wakeup_time) (grub_efi_boolean_t enabled,
-		      grub_efi_time_t *time);
+  (__grub_efi_api *set_wakeup_time) (grub_efi_boolean_t enabled,
+				     grub_efi_time_t *time);
 
   grub_efi_status_t
-  (*set_virtual_address_map) (grub_efi_uintn_t memory_map_size,
-			      grub_efi_uintn_t descriptor_size,
-			      grub_efi_uint32_t descriptor_version,
-			      grub_efi_memory_descriptor_t *virtual_map);
+  (__grub_efi_api *set_virtual_address_map) (grub_efi_uintn_t memory_map_size,
+					     grub_efi_uintn_t descriptor_size,
+					     grub_efi_uint32_t descriptor_version,
+					     grub_efi_memory_descriptor_t *virtual_map);
 
   grub_efi_status_t
-  (*convert_pointer) (grub_efi_uintn_t debug_disposition, void **address);
+  (__grub_efi_api *convert_pointer) (grub_efi_uintn_t debug_disposition, void **address);
 
 #define GRUB_EFI_GLOBAL_VARIABLE_GUID \
   { 0x8BE4DF61, 0x93CA, 0x11d2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }}
 
 
   grub_efi_status_t
-  (*get_variable) (grub_efi_char16_t *variable_name,
-		   const grub_efi_guid_t *vendor_guid,
-		   grub_efi_uint32_t *attributes,
-		   grub_efi_uintn_t *data_size,
-		   void *data);
+  (__grub_efi_api *get_variable) (grub_efi_char16_t *variable_name,
+				  const grub_efi_guid_t *vendor_guid,
+				  grub_efi_uint32_t *attributes,
+				  grub_efi_uintn_t *data_size,
+				  void *data);
 
   grub_efi_status_t
-  (*get_next_variable_name) (grub_efi_uintn_t *variable_name_size,
-			     grub_efi_char16_t *variable_name,
-			     grub_efi_guid_t *vendor_guid);
+  (__grub_efi_api *get_next_variable_name) (grub_efi_uintn_t *variable_name_size,
+					    grub_efi_char16_t *variable_name,
+					    grub_efi_guid_t *vendor_guid);
 
   grub_efi_status_t
-  (*set_variable) (grub_efi_char16_t *variable_name,
-		   const grub_efi_guid_t *vendor_guid,
-		   grub_efi_uint32_t attributes,
-		   grub_efi_uintn_t data_size,
-		   void *data);
+  (__grub_efi_api *set_variable) (grub_efi_char16_t *variable_name,
+				  const grub_efi_guid_t *vendor_guid,
+				  grub_efi_uint32_t attributes,
+				  grub_efi_uintn_t data_size,
+				  void *data);
 
   grub_efi_status_t
-  (*get_next_high_monotonic_count) (grub_efi_uint32_t *high_count);
+  (__grub_efi_api *get_next_high_monotonic_count) (grub_efi_uint32_t *high_count);
 
   void
-  (*reset_system) (grub_efi_reset_type_t reset_type,
-		   grub_efi_status_t reset_status,
-		   grub_efi_uintn_t data_size,
-		   grub_efi_char16_t *reset_data);
+  (__grub_efi_api *reset_system) (grub_efi_reset_type_t reset_type,
+				  grub_efi_status_t reset_status,
+				  grub_efi_uintn_t data_size,
+				  grub_efi_char16_t *reset_data);
 };
 typedef struct grub_efi_runtime_services grub_efi_runtime_services_t;
 
@@ -1410,33 +1411,42 @@ struct grub_efi_serial_io_interface
 {
   grub_efi_uint32_t revision;
   void (*reset) (void);
-  grub_efi_status_t (*set_attributes) (struct grub_efi_serial_io_interface *this,
-				       grub_efi_uint64_t speed,
-				       grub_efi_uint32_t fifo_depth,
-				       grub_efi_uint32_t timeout,
-				       grub_efi_parity_type_t parity,
-				       grub_uint8_t word_len,
-				       grub_efi_stop_bits_t stop_bits);
-  grub_efi_status_t (*set_control_bits) (struct grub_efi_serial_io_interface *this,
-					 grub_efi_uint32_t flags);
-  void (*get_control_bits) (void);
-  grub_efi_status_t (*write) (struct grub_efi_serial_io_interface *this,
-			      grub_efi_uintn_t *buf_size,
-			      void *buffer);
-  grub_efi_status_t (*read) (struct grub_efi_serial_io_interface *this,
-			     grub_efi_uintn_t *buf_size,
-			     void *buffer);
+
+  grub_efi_status_t
+  (__grub_efi_api *set_attributes) (struct grub_efi_serial_io_interface *this,
+				    grub_efi_uint64_t speed,
+				    grub_efi_uint32_t fifo_depth,
+				    grub_efi_uint32_t timeout,
+				    grub_efi_parity_type_t parity,
+				    grub_uint8_t word_len,
+				    grub_efi_stop_bits_t stop_bits);
+
+  grub_efi_status_t
+  (__grub_efi_api *set_control_bits) (struct grub_efi_serial_io_interface *this,
+				      grub_efi_uint32_t flags);
+
+  void (__grub_efi_api *get_control_bits) (void);
+
+  grub_efi_status_t
+  (__grub_efi_api *write) (struct grub_efi_serial_io_interface *this,
+			   grub_efi_uintn_t *buf_size,
+			   void *buffer);
+
+  grub_efi_status_t
+  (__grub_efi_api *read) (struct grub_efi_serial_io_interface *this,
+			  grub_efi_uintn_t *buf_size,
+			  void *buffer);
 };
 
 struct grub_efi_simple_input_interface
 {
   grub_efi_status_t
-  (*reset) (struct grub_efi_simple_input_interface *this,
-	    grub_efi_boolean_t extended_verification);
+  (__grub_efi_api *reset) (struct grub_efi_simple_input_interface *this,
+			   grub_efi_boolean_t extended_verification);
 
   grub_efi_status_t
-  (*read_key_stroke) (struct grub_efi_simple_input_interface *this,
-		      grub_efi_input_key_t *key);
+  (__grub_efi_api *read_key_stroke) (struct grub_efi_simple_input_interface *this,
+				     grub_efi_input_key_t *key);
 
   grub_efi_event_t wait_for_key;
 };
@@ -1448,77 +1458,77 @@ struct grub_efi_key_data {
 };
 typedef struct grub_efi_key_data grub_efi_key_data_t;
 
-typedef grub_efi_status_t (*grub_efi_key_notify_function_t) (
+typedef grub_efi_status_t (__grub_efi_api *grub_efi_key_notify_function_t) (
 	grub_efi_key_data_t *key_data
 	);
 
 struct grub_efi_simple_text_input_ex_interface
 {
   grub_efi_status_t
-  (*reset) (struct grub_efi_simple_text_input_ex_interface *this,
-	    grub_efi_boolean_t extended_verification);
+  (__grub_efi_api *reset) (struct grub_efi_simple_text_input_ex_interface *this,
+			   grub_efi_boolean_t extended_verification);
 
   grub_efi_status_t
-  (*read_key_stroke) (struct grub_efi_simple_text_input_ex_interface *this,
-		      grub_efi_key_data_t *key_data);
+  (__grub_efi_api *read_key_stroke) (struct grub_efi_simple_text_input_ex_interface *this,
+				     grub_efi_key_data_t *key_data);
 
   grub_efi_event_t wait_for_key;
 
   grub_efi_status_t
-  (*set_state) (struct grub_efi_simple_text_input_ex_interface *this,
-	        grub_efi_key_toggle_state_t *key_toggle_state);
+  (__grub_efi_api *set_state) (struct grub_efi_simple_text_input_ex_interface *this,
+			       grub_efi_key_toggle_state_t *key_toggle_state);
 
   grub_efi_status_t
-  (*register_key_notify) (struct grub_efi_simple_text_input_ex_interface *this,
-			  grub_efi_key_data_t *key_data,
-			  grub_efi_key_notify_function_t key_notification_function,
-			  void **notify_handle);
+  (__grub_efi_api *register_key_notify) (struct grub_efi_simple_text_input_ex_interface *this,
+					 grub_efi_key_data_t *key_data,
+					 grub_efi_key_notify_function_t key_notification_function,
+					 void **notify_handle);
 
   grub_efi_status_t
-  (*unregister_key_notify) (struct grub_efi_simple_text_input_ex_interface *this,
-			    void *notification_handle);
+  (__grub_efi_api *unregister_key_notify) (struct grub_efi_simple_text_input_ex_interface *this,
+					   void *notification_handle);
 };
 typedef struct grub_efi_simple_text_input_ex_interface grub_efi_simple_text_input_ex_interface_t;
 
 struct grub_efi_simple_text_output_interface
 {
   grub_efi_status_t
-  (*reset) (struct grub_efi_simple_text_output_interface *this,
-	    grub_efi_boolean_t extended_verification);
+  (__grub_efi_api *reset) (struct grub_efi_simple_text_output_interface *this,
+			   grub_efi_boolean_t extended_verification);
 
   grub_efi_status_t
-  (*output_string) (struct grub_efi_simple_text_output_interface *this,
-		    grub_efi_char16_t *string);
+  (__grub_efi_api *output_string) (struct grub_efi_simple_text_output_interface *this,
+				   grub_efi_char16_t *string);
 
   grub_efi_status_t
-  (*test_string) (struct grub_efi_simple_text_output_interface *this,
-		  grub_efi_char16_t *string);
+  (__grub_efi_api *test_string) (struct grub_efi_simple_text_output_interface *this,
+				 grub_efi_char16_t *string);
 
   grub_efi_status_t
-  (*query_mode) (struct grub_efi_simple_text_output_interface *this,
-		 grub_efi_uintn_t mode_number,
-		 grub_efi_uintn_t *columns,
-		 grub_efi_uintn_t *rows);
+  (__grub_efi_api *query_mode) (struct grub_efi_simple_text_output_interface *this,
+				grub_efi_uintn_t mode_number,
+				grub_efi_uintn_t *columns,
+				grub_efi_uintn_t *rows);
 
   grub_efi_status_t
-  (*set_mode) (struct grub_efi_simple_text_output_interface *this,
-	       grub_efi_uintn_t mode_number);
+  (__grub_efi_api *set_mode) (struct grub_efi_simple_text_output_interface *this,
+			      grub_efi_uintn_t mode_number);
 
   grub_efi_status_t
-  (*set_attributes) (struct grub_efi_simple_text_output_interface *this,
-		     grub_efi_uintn_t attribute);
+  (__grub_efi_api *set_attributes) (struct grub_efi_simple_text_output_interface *this,
+				    grub_efi_uintn_t attribute);
 
   grub_efi_status_t
-  (*clear_screen) (struct grub_efi_simple_text_output_interface *this);
+  (__grub_efi_api *clear_screen) (struct grub_efi_simple_text_output_interface *this);
 
   grub_efi_status_t
-  (*set_cursor_position) (struct grub_efi_simple_text_output_interface *this,
-			  grub_efi_uintn_t column,
-			  grub_efi_uintn_t row);
+  (__grub_efi_api *set_cursor_position) (struct grub_efi_simple_text_output_interface *this,
+					 grub_efi_uintn_t column,
+					 grub_efi_uintn_t row);
 
   grub_efi_status_t
-  (*enable_cursor) (struct grub_efi_simple_text_output_interface *this,
-		    grub_efi_boolean_t visible);
+  (__grub_efi_api *enable_cursor) (struct grub_efi_simple_text_output_interface *this,
+				   grub_efi_boolean_t visible);
 
   grub_efi_simple_text_output_mode_t *mode;
 };
@@ -1619,23 +1629,23 @@ struct grub_efi_loaded_image
   grub_efi_memory_type_t image_code_type;
   grub_efi_memory_type_t image_data_type;
 
-  grub_efi_status_t (*unload) (grub_efi_handle_t image_handle);
+  grub_efi_status_t (__grub_efi_api *unload) (grub_efi_handle_t image_handle);
 };
 typedef struct grub_efi_loaded_image grub_efi_loaded_image_t;
 
 struct grub_efi_disk_io
 {
   grub_efi_uint64_t revision;
-  grub_efi_status_t (*read) (struct grub_efi_disk_io *this,
-			     grub_efi_uint32_t media_id,
-			     grub_efi_uint64_t offset,
-			     grub_efi_uintn_t buffer_size,
-			     void *buffer);
-  grub_efi_status_t (*write) (struct grub_efi_disk_io *this,
-			     grub_efi_uint32_t media_id,
-			     grub_efi_uint64_t offset,
-			     grub_efi_uintn_t buffer_size,
-			     void *buffer);
+  grub_efi_status_t (__grub_efi_api *read) (struct grub_efi_disk_io *this,
+					    grub_efi_uint32_t media_id,
+					    grub_efi_uint64_t offset,
+					    grub_efi_uintn_t buffer_size,
+					    void *buffer);
+  grub_efi_status_t (__grub_efi_api *write) (struct grub_efi_disk_io *this,
+					     grub_efi_uint32_t media_id,
+					     grub_efi_uint64_t offset,
+					     grub_efi_uintn_t buffer_size,
+					     void *buffer);
 };
 typedef struct grub_efi_disk_io grub_efi_disk_io_t;
 
@@ -1699,41 +1709,60 @@ enum
 struct grub_efi_simple_network
 {
   grub_uint64_t revision;
-  grub_efi_status_t (*start) (struct grub_efi_simple_network *this);
-  grub_efi_status_t (*stop) (struct grub_efi_simple_network *this);
-  grub_efi_status_t (*initialize) (struct grub_efi_simple_network *this,
-				   grub_efi_uintn_t extra_rx,
-				   grub_efi_uintn_t extra_tx);
-  void (*reset) (void);
-  grub_efi_status_t (*shutdown) (struct grub_efi_simple_network *this);
-  grub_efi_status_t (*receive_filters) (struct grub_efi_simple_network *this,
-					grub_uint32_t enable,
-					grub_uint32_t disable,
-					grub_efi_boolean_t reset_mcast_filter,
-					grub_efi_uintn_t mcast_filter_count,
-					grub_efi_mac_address_t *mcast_filter);
-  void (*station_address) (void);
-  void (*statistics) (void);
-  void (*mcastiptomac) (void);
-  void (*nvdata) (void);
-  grub_efi_status_t (*get_status) (struct grub_efi_simple_network *this,
-				   grub_uint32_t *int_status,
-				   void **txbuf);
-  grub_efi_status_t (*transmit) (struct grub_efi_simple_network *this,
-				 grub_efi_uintn_t header_size,
-				 grub_efi_uintn_t buffer_size,
-				 void *buffer,
-				 grub_efi_mac_t *src_addr,
-				 grub_efi_mac_t *dest_addr,
-				 grub_efi_uint16_t *protocol);
-  grub_efi_status_t (*receive) (struct grub_efi_simple_network *this,
-				grub_efi_uintn_t *header_size,
-				grub_efi_uintn_t *buffer_size,
-				void *buffer,
-				grub_efi_mac_t *src_addr,
-				grub_efi_mac_t *dest_addr,
-				grub_uint16_t *protocol);
-  void (*waitforpacket) (void);
+
+  grub_efi_status_t
+  (__grub_efi_api *start) (struct grub_efi_simple_network *this);
+
+  grub_efi_status_t
+  (__grub_efi_api *stop) (struct grub_efi_simple_network *this);
+
+  grub_efi_status_t
+  (__grub_efi_api *initialize) (struct grub_efi_simple_network *this,
+				grub_efi_uintn_t extra_rx,
+				grub_efi_uintn_t extra_tx);
+
+  void (__grub_efi_api *reset) (void);
+
+  grub_efi_status_t
+  (__grub_efi_api *shutdown) (struct grub_efi_simple_network *this);
+
+  grub_efi_status_t
+  (__grub_efi_api *receive_filters) (struct grub_efi_simple_network *this,
+				     grub_uint32_t enable,
+				     grub_uint32_t disable,
+				     grub_efi_boolean_t reset_mcast_filter,
+				     grub_efi_uintn_t mcast_filter_count,
+				     grub_efi_mac_address_t *mcast_filter);
+
+  void (__grub_efi_api *station_address) (void);
+  void (__grub_efi_api *statistics) (void);
+  void (__grub_efi_api *mcastiptomac) (void);
+  void (__grub_efi_api *nvdata) (void);
+
+  grub_efi_status_t
+  (__grub_efi_api *get_status) (struct grub_efi_simple_network *this,
+				grub_uint32_t *int_status,
+				void **txbuf);
+
+  grub_efi_status_t
+  (__grub_efi_api *transmit) (struct grub_efi_simple_network *this,
+			      grub_efi_uintn_t header_size,
+			      grub_efi_uintn_t buffer_size,
+			      void *buffer,
+			      grub_efi_mac_t *src_addr,
+			      grub_efi_mac_t *dest_addr,
+			      grub_efi_uint16_t *protocol);
+
+  grub_efi_status_t
+  (__grub_efi_api *receive) (struct grub_efi_simple_network *this,
+			     grub_efi_uintn_t *header_size,
+			     grub_efi_uintn_t *buffer_size,
+			     void *buffer,
+			     grub_efi_mac_t *src_addr,
+			     grub_efi_mac_t *dest_addr,
+			     grub_uint16_t *protocol);
+
+  void (__grub_efi_api *waitforpacket) (void);
   struct grub_efi_simple_network_mode *mode;
 };
 typedef struct grub_efi_simple_network grub_efi_simple_network_t;
@@ -1743,25 +1772,25 @@ struct grub_efi_block_io
 {
   grub_efi_uint64_t revision;
   grub_efi_block_io_media_t *media;
-  grub_efi_status_t (*reset) (struct grub_efi_block_io *this,
-			      grub_efi_boolean_t extended_verification);
-  grub_efi_status_t (*read_blocks) (struct grub_efi_block_io *this,
-				    grub_efi_uint32_t media_id,
-				    grub_efi_lba_t lba,
-				    grub_efi_uintn_t buffer_size,
-				    void *buffer);
-  grub_efi_status_t (*write_blocks) (struct grub_efi_block_io *this,
-				     grub_efi_uint32_t media_id,
-				     grub_efi_lba_t lba,
-				     grub_efi_uintn_t buffer_size,
-				     void *buffer);
-  grub_efi_status_t (*flush_blocks) (struct grub_efi_block_io *this);
+  grub_efi_status_t (__grub_efi_api *reset) (struct grub_efi_block_io *this,
+					     grub_efi_boolean_t extended_verification);
+  grub_efi_status_t (__grub_efi_api *read_blocks) (struct grub_efi_block_io *this,
+						   grub_efi_uint32_t media_id,
+						   grub_efi_lba_t lba,
+						   grub_efi_uintn_t buffer_size,
+						   void *buffer);
+  grub_efi_status_t (__grub_efi_api *write_blocks) (struct grub_efi_block_io *this,
+						    grub_efi_uint32_t media_id,
+						    grub_efi_lba_t lba,
+						    grub_efi_uintn_t buffer_size,
+						    void *buffer);
+  grub_efi_status_t (__grub_efi_api *flush_blocks) (struct grub_efi_block_io *this);
 };
 typedef struct grub_efi_block_io grub_efi_block_io_t;
 
 struct grub_efi_shim_lock_protocol
 {
-  grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size);
+  grub_efi_status_t (__grub_efi_api *verify) (void *buffer, grub_uint32_t size);
 };
 typedef struct grub_efi_shim_lock_protocol grub_efi_shim_lock_protocol_t;
 
@@ -1769,13 +1798,13 @@ typedef grub_efi_guid_t grub_efi_rng_algorithm_t;
 
 struct grub_efi_rng_protocol
 {
-  grub_efi_status_t (*get_info) (struct grub_efi_rng_protocol *this,
-				 grub_efi_uintn_t *rng_algorithm_list_size,
-				 grub_efi_rng_algorithm_t *rng_algorithm_list);
-  grub_efi_status_t (*get_rng) (struct grub_efi_rng_protocol *this,
-				grub_efi_rng_algorithm_t *rng_algorithm,
-				grub_efi_uintn_t rng_value_length,
-				grub_efi_uint8_t *rng_value);
+  grub_efi_status_t (__grub_efi_api *get_info) (struct grub_efi_rng_protocol *this,
+						grub_efi_uintn_t *rng_algorithm_list_size,
+						grub_efi_rng_algorithm_t *rng_algorithm_list);
+  grub_efi_status_t (__grub_efi_api *get_rng) (struct grub_efi_rng_protocol *this,
+					       grub_efi_rng_algorithm_t *rng_algorithm,
+					       grub_efi_uintn_t rng_value_length,
+					       grub_efi_uint8_t *rng_value);
 };
 typedef struct grub_efi_rng_protocol grub_efi_rng_protocol_t;
 
diff --git a/include/grub/efi/tpm.h b/include/grub/efi/tpm.h
index ec39725c00abd1b9..6c6802ee594ed945 100644
--- a/include/grub/efi/tpm.h
+++ b/include/grub/efi/tpm.h
@@ -62,42 +62,42 @@ typedef struct tdTCG_PCR_EVENT TCG_PCR_EVENT;
 
 struct grub_efi_tpm_protocol
 {
-  grub_efi_status_t (*status_check) (struct grub_efi_tpm_protocol *this,
-				     TCG_EFI_BOOT_SERVICE_CAPABILITY *
-				     ProtocolCapability,
-				     grub_efi_uint32_t *TCGFeatureFlags,
-				     grub_efi_physical_address_t *
-				     EventLogLocation,
-				     grub_efi_physical_address_t *
-				     EventLogLastEntry);
-  grub_efi_status_t (*hash_all) (struct grub_efi_tpm_protocol *this,
-				 grub_efi_uint8_t *HashData,
-				 grub_efi_uint64_t HashLen,
-				 grub_efi_uint32_t AlgorithmId,
-				 grub_efi_uint64_t *HashedDataLen,
-				 grub_efi_uint8_t **HashedDataResult);
-  grub_efi_status_t (*log_event) (struct grub_efi_tpm_protocol *this,
-				  TCG_PCR_EVENT *TCGLogData,
-				  grub_efi_uint32_t *EventNumber,
-				  grub_efi_uint32_t Flags);
-  grub_efi_status_t (*pass_through_to_tpm) (struct grub_efi_tpm_protocol *
-					    this,
-					    grub_efi_uint32_t
-					    TpmInputParameterBlockSize,
-					    grub_efi_uint8_t *
-					    TpmInputParameterBlock,
-					    grub_efi_uint32_t
-					    TpmOutputParameterBlockSize,
-					    grub_efi_uint8_t *
-					    TpmOutputParameterBlock);
-  grub_efi_status_t (*log_extend_event) (struct grub_efi_tpm_protocol *this,
-					 grub_efi_physical_address_t HashData,
-					 grub_efi_uint64_t HashDataLen,
-					 grub_efi_uint32_t AlgorithmId,
-					 TCG_PCR_EVENT *TCGLogData,
-					 grub_efi_uint32_t *EventNumber,
-					 grub_efi_physical_address_t *
-					 EventLogLastEntry);
+  grub_efi_status_t
+  (__grub_efi_api *status_check) (struct grub_efi_tpm_protocol *this,
+				  TCG_EFI_BOOT_SERVICE_CAPABILITY *ProtocolCapability,
+				  grub_efi_uint32_t *TCGFeatureFlags,
+				  grub_efi_physical_address_t *EventLogLocation,
+				  grub_efi_physical_address_t *EventLogLastEntry);
+
+  grub_efi_status_t
+  (__grub_efi_api *hash_all) (struct grub_efi_tpm_protocol *this,
+			      grub_efi_uint8_t *HashData,
+			      grub_efi_uint64_t HashLen,
+			      grub_efi_uint32_t AlgorithmId,
+			      grub_efi_uint64_t *HashedDataLen,
+			      grub_efi_uint8_t **HashedDataResult);
+
+  grub_efi_status_t
+  (__grub_efi_api *log_event) (struct grub_efi_tpm_protocol *this,
+			       TCG_PCR_EVENT *TCGLogData,
+			       grub_efi_uint32_t *EventNumber,
+			       grub_efi_uint32_t Flags);
+
+  grub_efi_status_t
+  (__grub_efi_api *pass_through_to_tpm) (struct grub_efi_tpm_protocol *this,
+					 grub_efi_uint32_t TpmInputParameterBlockSize,
+					 grub_efi_uint8_t *TpmInputParameterBlock,
+					 grub_efi_uint32_t TpmOutputParameterBlockSize,
+					 grub_efi_uint8_t *TpmOutputParameterBlock);
+
+  grub_efi_status_t
+  (__grub_efi_api *log_extend_event) (struct grub_efi_tpm_protocol *this,
+				      grub_efi_physical_address_t HashData,
+				      grub_efi_uint64_t HashDataLen,
+				      grub_efi_uint32_t AlgorithmId,
+				      TCG_PCR_EVENT *TCGLogData,
+				      grub_efi_uint32_t *EventNumber,
+				      grub_efi_physical_address_t *EventLogLastEntry);
 };
 
 typedef struct grub_efi_tpm_protocol grub_efi_tpm_protocol_t;
@@ -151,46 +151,43 @@ typedef struct tdEFI_TCG2_EVENT EFI_TCG2_EVENT;
 
 struct grub_efi_tpm2_protocol
 {
-  grub_efi_status_t (*get_capability) (struct grub_efi_tpm2_protocol *this,
-				       EFI_TCG2_BOOT_SERVICE_CAPABILITY *
-				       ProtocolCapability);
-  grub_efi_status_t (*get_event_log) (struct grub_efi_tpm2_protocol *this,
-				      EFI_TCG2_EVENT_LOG_FORMAT
-				      EventLogFormat,
-				      grub_efi_physical_address_t *
-				      EventLogLocation,
-				      grub_efi_physical_address_t *
-				      EventLogLastEntry,
-				      grub_efi_boolean_t * EventLogTruncated);
-  grub_efi_status_t (*hash_log_extend_event) (struct grub_efi_tpm2_protocol *
-					      this, grub_efi_uint64_t Flags,
-					      grub_efi_physical_address_t
-					      DataToHash,
-					      grub_efi_uint64_t DataToHashLen,
-					      EFI_TCG2_EVENT *EfiTcgEvent);
-  grub_efi_status_t (*submit_command) (struct grub_efi_tpm2_protocol *this,
-				       grub_efi_uint32_t
-				       InputParameterBlockSize,
-				       grub_efi_uint8_t *InputParameterBlock,
-				       grub_efi_uint32_t
-				       OutputParameterBlockSize,
-				       grub_efi_uint8_t *
-				       OutputParameterBlock);
-  grub_efi_status_t (*get_active_pcr_banks) (struct grub_efi_tpm2_protocol *
-					     this,
-					     grub_efi_uint32_t *
-					     ActivePcrBanks);
-  grub_efi_status_t (*set_active_pcr_banks) (struct grub_efi_tpm2_protocol *
-					     this,
-					     grub_efi_uint32_t
-					     ActivePcrBanks);
-  grub_efi_status_t (*get_result_of_set_active_pcr_banks) (struct
-							   grub_efi_tpm2_protocol
-							   *this,
-							   grub_efi_uint32_t *
-							   OperationPresent,
-							   grub_efi_uint32_t *
-							   Response);
+  grub_efi_status_t
+  (__grub_efi_api *get_capability) (struct grub_efi_tpm2_protocol *this,
+				    EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability);
+
+  grub_efi_status_t
+  (__grub_efi_api *get_event_log) (struct grub_efi_tpm2_protocol *this,
+				   EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat,
+				   grub_efi_physical_address_t *EventLogLocation,
+				   grub_efi_physical_address_t *EventLogLastEntry,
+				   grub_efi_boolean_t *EventLogTruncated);
+
+  grub_efi_status_t
+  (__grub_efi_api *hash_log_extend_event) (struct grub_efi_tpm2_protocol *this,
+					   grub_efi_uint64_t Flags,
+					   grub_efi_physical_address_t DataToHash,
+					   grub_efi_uint64_t DataToHashLen,
+					   EFI_TCG2_EVENT *EfiTcgEvent);
+
+  grub_efi_status_t
+  (__grub_efi_api *submit_command) (struct grub_efi_tpm2_protocol *this,
+				    grub_efi_uint32_t InputParameterBlockSize,
+				    grub_efi_uint8_t *InputParameterBlock,
+				    grub_efi_uint32_t OutputParameterBlockSize,
+				    grub_efi_uint8_t *OutputParameterBlock);
+
+  grub_efi_status_t
+  (__grub_efi_api *get_active_pcr_banks) (struct grub_efi_tpm2_protocol *this,
+				          grub_efi_uint32_t *ActivePcrBanks);
+
+  grub_efi_status_t
+  (__grub_efi_api *set_active_pcr_banks) (struct grub_efi_tpm2_protocol *this,
+					  grub_efi_uint32_t ActivePcrBanks);
+
+  grub_efi_status_t
+  (__grub_efi_api *get_result_of_set_active_pcr_banks) (struct grub_efi_tpm2_protocol *this,
+							grub_efi_uint32_t *OperationPresent,
+							grub_efi_uint32_t *Response);
 };
 
 typedef struct grub_efi_tpm2_protocol grub_efi_tpm2_protocol_t;
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-05-23 15:31 [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Ard Biesheuvel
  2023-05-23 15:31 ` [PATCH v4 1/5] efi: Make EFI PXE protocol methods non-callable Ard Biesheuvel
  2023-05-23 15:31 ` [PATCH v4 2/5] efi: Add calling convention annotation to all prototypes Ard Biesheuvel
@ 2023-05-23 15:31 ` Ard Biesheuvel
  2023-06-12 17:19   ` Christian Hesse
  2023-05-23 15:31 ` [PATCH v4 4/5] efi: Remove x86_64 call wrappers Ard Biesheuvel
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 29+ messages in thread
From: Ard Biesheuvel @ 2023-05-23 15:31 UTC (permalink / raw)
  To: grub-devel; +Cc: Ard Biesheuvel, Daniel Kiper, Glenn Washburn

Now that GCC can generate function calls using the correct calling
convention for us, we can stop using the efi_call_XX () wrappers, and
just dereference the function pointers directly.

This avoids the untyped variadic wrapper routines, which means better
type checking for the method calls.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 grub-core/commands/acpi.c             |  8 +--
 grub-core/commands/efi/efitextmode.c  |  8 ++-
 grub-core/commands/efi/lsefi.c        |  5 +-
 grub-core/commands/efi/tpm.c          | 21 ++++----
 grub-core/disk/efi/efidisk.c          |  7 +--
 grub-core/kern/arm/efi/init.c         | 10 ++--
 grub-core/kern/efi/efi.c              | 56 ++++++++++----------
 grub-core/kern/efi/init.c             | 15 +++---
 grub-core/kern/efi/mm.c               | 17 +++---
 grub-core/kern/i386/efi/tsc.c         |  2 +-
 grub-core/kern/ia64/efi/init.c        | 14 ++---
 grub-core/kern/loongarch64/efi/init.c | 10 ++--
 grub-core/lib/efi/datetime.c          |  9 ++--
 grub-core/lib/efi/halt.c              |  4 +-
 grub-core/lib/efi/relocator.c         |  6 +--
 grub-core/loader/efi/appleloader.c    |  8 +--
 grub-core/loader/efi/chainloader.c    | 20 +++----
 grub-core/mmap/efi/mmap.c             | 16 +++---
 grub-core/net/drivers/efi/efinet.c    | 26 ++++-----
 grub-core/term/efi/console.c          | 29 +++++-----
 grub-core/term/efi/serial.c           | 18 +++----
 grub-core/video/efi_gop.c             | 18 +++----
 grub-core/video/efi_uga.c             |  8 +--
 23 files changed, 165 insertions(+), 170 deletions(-)

diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c
index fda62f4ea98a6da8..ab067ae6e51d43af 100644
--- a/grub-core/commands/acpi.c
+++ b/grub-core/commands/acpi.c
@@ -762,10 +762,10 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
     struct grub_efi_guid acpi = GRUB_EFI_ACPI_TABLE_GUID;
     struct grub_efi_guid acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
 
-    efi_call_2 (grub_efi_system_table->boot_services->install_configuration_table,
-      &acpi20, grub_acpi_get_rsdpv2 ());
-    efi_call_2 (grub_efi_system_table->boot_services->install_configuration_table,
-      &acpi, grub_acpi_get_rsdpv1 ());
+    grub_efi_system_table->boot_services->install_configuration_table (&acpi20,
+								       grub_acpi_get_rsdpv2 ());
+    grub_efi_system_table->boot_services->install_configuration_table (&acpi,
+								       grub_acpi_get_rsdpv1 ());
   }
 #endif
 
diff --git a/grub-core/commands/efi/efitextmode.c b/grub-core/commands/efi/efitextmode.c
index 3679f6b4d8028bc7..198bc694d3fc3c3b 100644
--- a/grub-core/commands/efi/efitextmode.c
+++ b/grub-core/commands/efi/efitextmode.c
@@ -36,7 +36,7 @@ grub_efi_set_mode (grub_efi_simple_text_output_interface_t *o,
 
   if (mode != o->mode->mode)
     {
-      status = efi_call_2 (o->set_mode, o, mode);
+      status = o->set_mode (o, mode);
       if (status == GRUB_EFI_SUCCESS)
 	;
       else if (status == GRUB_EFI_DEVICE_ERROR)
@@ -79,8 +79,7 @@ grub_cmd_efitextmode (grub_command_t cmd __attribute__ ((unused)),
       grub_printf_ (N_("Available modes for console output device.\n"));
 
       for (i = 0; i < o->mode->max_mode; i++)
-	if (GRUB_EFI_SUCCESS == efi_call_4 (o->query_mode, o, i,
-					    &columns, &rows))
+	if (GRUB_EFI_SUCCESS == o->query_mode (o, i, &columns, &rows))
 	  grub_printf_ (N_(" [%" PRIuGRUB_EFI_UINT32_T "]  Col %5"
 			   PRIuGRUB_EFI_UINTN_T " Row %5" PRIuGRUB_EFI_UINTN_T
 			   " %c\n"),
@@ -129,8 +128,7 @@ grub_cmd_efitextmode (grub_command_t cmd __attribute__ ((unused)),
 			   N_("non-numeric or invalid rows number `%s'"), args[1]);
 
       for (i = 0; i < o->mode->max_mode; i++)
-	if (GRUB_EFI_SUCCESS == efi_call_4 (o->query_mode, o, i,
-					    &columns, &rows))
+	if (GRUB_EFI_SUCCESS == o->query_mode (o, i, &columns, &rows))
 	  if (u_columns == columns && u_rows == rows)
 	    return grub_efi_set_mode (o, (grub_efi_int32_t) i);
 
diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c
index c304d25ccdd6f32b..53970149785a28f8 100644
--- a/grub-core/commands/efi/lsefi.c
+++ b/grub-core/commands/efi/lsefi.c
@@ -108,8 +108,9 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),
 	  grub_efi_print_device_path (dp);
 	}
 
-      status = efi_call_3 (grub_efi_system_table->boot_services->protocols_per_handle,
-			   handle, &protocols, &num_protocols);
+      status = grub_efi_system_table->boot_services->protocols_per_handle (handle,
+									   &protocols,
+									   &num_protocols);
       if (status != GRUB_EFI_SUCCESS) {
 	grub_printf ("Unable to retrieve protocols\n");
 	continue;
diff --git a/grub-core/commands/efi/tpm.c b/grub-core/commands/efi/tpm.c
index e1f343fea3ff3503..4213552048aebad6 100644
--- a/grub-core/commands/efi/tpm.c
+++ b/grub-core/commands/efi/tpm.c
@@ -53,8 +53,7 @@ grub_tpm1_present (grub_efi_tpm_protocol_t *tpm)
 
   caps.Size = (grub_uint8_t) sizeof (caps);
 
-  status = efi_call_5 (tpm->status_check, tpm, &caps, &flags, &eventlog,
-		       &lastevent);
+  status = tpm->status_check (tpm, &caps, &flags, &eventlog, &lastevent);
 
   if (status != GRUB_EFI_SUCCESS || caps.TPMDeactivatedFlag
       || !caps.TPMPresentFlag)
@@ -78,7 +77,7 @@ grub_tpm2_present (grub_efi_tpm2_protocol_t *tpm)
   if (tpm2_present != -1)
     return (grub_efi_boolean_t) tpm2_present;
 
-  status = efi_call_2 (tpm->get_capability, tpm, &caps);
+  status = tpm->get_capability (tpm, &caps);
 
   if (status != GRUB_EFI_SUCCESS || !caps.TPMPresentFlag)
     tpm2_present = 0;
@@ -180,8 +179,8 @@ grub_tpm1_log_event (grub_efi_handle_t tpm_handle, unsigned char *buf,
   grub_strcpy ((char *) event->Event, description);
 
   algorithm = TCG_ALG_SHA;
-  status = efi_call_7 (tpm->log_extend_event, tpm, (grub_addr_t) buf, (grub_uint64_t) size,
-		       algorithm, event, &eventnum, &lastevent);
+  status = tpm->log_extend_event (tpm, (grub_addr_t) buf, (grub_uint64_t) size,
+				  algorithm, event, &eventnum, &lastevent);
   grub_free (event);
 
   return grub_efi_log_event_status (status);
@@ -216,8 +215,8 @@ grub_tpm2_log_event (grub_efi_handle_t tpm_handle, unsigned char *buf,
     sizeof (*event) - sizeof (event->Event) + grub_strlen (description) + 1;
   grub_strcpy ((char *) event->Event, description);
 
-  status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, (grub_addr_t) buf,
-		       (grub_uint64_t) size, event);
+  status = tpm->hash_log_extend_event (tpm, 0, (grub_addr_t) buf,
+				       (grub_uint64_t) size, event);
   grub_free (event);
 
   return grub_efi_log_event_status (status);
@@ -236,7 +235,7 @@ grub_cc_log_event (unsigned char *buf, grub_size_t size, grub_uint8_t pcr,
   if (cc == NULL)
     return;
 
-  status = efi_call_3 (cc->map_pcr_to_mr_index, cc, pcr, &mr);
+  status = cc->map_pcr_to_mr_index (cc, pcr, &mr);
   if (status != GRUB_EFI_SUCCESS)
     {
       grub_efi_log_event_status (status);
@@ -258,9 +257,9 @@ grub_cc_log_event (unsigned char *buf, grub_size_t size, grub_uint8_t pcr,
   event->Size = sizeof (*event) + grub_strlen (description) + 1;
   grub_strcpy ((char *) event->Event, description);
 
-  status = efi_call_5 (cc->hash_log_extend_event, cc, 0,
-		       (grub_efi_physical_address_t)(grub_addr_t) buf,
-		       (grub_efi_uint64_t) size, event);
+  status = cc->hash_log_extend_event (cc, 0,
+				      (grub_efi_physical_address_t)(grub_addr_t) buf,
+				      (grub_efi_uint64_t) size, event);
   grub_free (event);
 
   if (status != GRUB_EFI_SUCCESS)
diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
index d7540040ed067063..ad025010a06bd338 100644
--- a/grub-core/disk/efi/efidisk.c
+++ b/grub-core/disk/efi/efidisk.c
@@ -579,9 +579,10 @@ grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector,
       aligned_buf = buf;
     }
 
-  status =  efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio,
-			bio->media->media_id, (grub_efi_uint64_t) sector,
-			(grub_efi_uintn_t) num_bytes, aligned_buf);
+  status =  (wr ? bio->write_blocks : bio->read_blocks) (bio, bio->media->media_id,
+							 (grub_efi_uint64_t) sector,
+							 (grub_efi_uintn_t) num_bytes,
+							 aligned_buf);
 
   if ((grub_addr_t) buf & (io_align - 1))
     {
diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c
index ab48342f3cda116d..809f69c8cfc8727e 100644
--- a/grub-core/kern/arm/efi/init.c
+++ b/grub-core/kern/arm/efi/init.c
@@ -50,9 +50,9 @@ grub_machine_init (void)
 
   b = grub_efi_system_table->boot_services;
 
-  efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL,
-	      GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt);
-  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 100000);
+  b->create_event (GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL,
+		   GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt);
+  b->set_timer (tmr_evt, GRUB_EFI_TIMER_PERIODIC, 100000);
 
   grub_install_get_time_ms (grub_efi_get_time_ms);
 }
@@ -67,8 +67,8 @@ grub_machine_fini (int flags)
 
   b = grub_efi_system_table->boot_services;
 
-  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0);
-  efi_call_1 (b->close_event, tmr_evt);
+  b->set_timer (tmr_evt, GRUB_EFI_TIMER_CANCEL, 0);
+  b->close_event (tmr_evt);
 
   grub_efi_fini ();
 
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index cf49d6357e00f49c..c84d5d28005670c4 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -45,8 +45,9 @@ grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration)
   void *interface;
   grub_efi_status_t status;
 
-  status = efi_call_3 (grub_efi_system_table->boot_services->locate_protocol,
-                       protocol, registration, &interface);
+  status = grub_efi_system_table->boot_services->locate_protocol (protocol,
+								  registration,
+								  &interface);
   if (status != GRUB_EFI_SUCCESS)
     return 0;
 
@@ -72,7 +73,7 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type,
     return 0;
 
   b = grub_efi_system_table->boot_services;
-  status = efi_call_5 (b->locate_handle, search_type, protocol, search_key,
+  status = b->locate_handle (search_type, protocol, search_key,
 			     &buffer_size, buffer);
   if (status == GRUB_EFI_BUFFER_TOO_SMALL)
     {
@@ -81,7 +82,7 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type,
       if (! buffer)
 	return 0;
 
-      status = efi_call_5 (b->locate_handle, search_type, protocol, search_key,
+      status = b->locate_handle (search_type, protocol, search_key,
 				 &buffer_size, buffer);
     }
 
@@ -105,12 +106,12 @@ grub_efi_open_protocol (grub_efi_handle_t handle,
   void *interface;
 
   b = grub_efi_system_table->boot_services;
-  status = efi_call_6 (b->open_protocol, handle,
-		       protocol,
-		       &interface,
-		       grub_efi_image_handle,
-		       0,
-		       attributes);
+  status = b->open_protocol (handle,
+			     protocol,
+			     &interface,
+			     grub_efi_image_handle,
+			     0,
+			     attributes);
   if (status != GRUB_EFI_SUCCESS)
     return 0;
 
@@ -122,7 +123,7 @@ grub_efi_close_protocol (grub_efi_handle_t handle, grub_efi_guid_t *protocol)
 {
   grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;
 
-  return efi_call_4 (b->close_protocol, handle, protocol, grub_efi_image_handle, NULL);
+  return b->close_protocol (handle, protocol, grub_efi_image_handle, NULL);
 }
 
 int
@@ -137,12 +138,12 @@ grub_efi_set_text_mode (int on)
        already in text mode. */
     return 1;
 
-  if (efi_call_4 (c->get_mode, c, &mode, 0, 0) != GRUB_EFI_SUCCESS)
+  if (c->get_mode (c, &mode, 0, 0) != GRUB_EFI_SUCCESS)
     return 0;
 
   new_mode = on ? GRUB_EFI_SCREEN_TEXT : GRUB_EFI_SCREEN_GRAPHICS;
   if (mode != new_mode)
-    if (efi_call_2 (c->set_mode, c, new_mode) != GRUB_EFI_SUCCESS)
+    if (c->set_mode (c, new_mode) != GRUB_EFI_SUCCESS)
       return 0;
 
   return 1;
@@ -151,7 +152,7 @@ grub_efi_set_text_mode (int on)
 void
 grub_efi_stall (grub_efi_uintn_t microseconds)
 {
-  efi_call_1 (grub_efi_system_table->boot_services->stall, microseconds);
+  grub_efi_system_table->boot_services->stall (microseconds);
 }
 
 grub_efi_loaded_image_t *
@@ -167,8 +168,9 @@ grub_reboot (void)
 {
   grub_machine_fini (GRUB_LOADER_FLAG_NORETURN |
 		     GRUB_LOADER_FLAG_EFI_KEEP_ALLOCATED_MEMORY);
-  efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
-              GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL);
+  grub_efi_system_table->runtime_services->reset_system (GRUB_EFI_RESET_COLD,
+							 GRUB_EFI_SUCCESS, 0,
+							 NULL);
   for (;;) ;
 }
 
@@ -176,8 +178,8 @@ void
 grub_exit (void)
 {
   grub_machine_fini (GRUB_LOADER_FLAG_NORETURN);
-  efi_call_4 (grub_efi_system_table->boot_services->exit,
-              grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0);
+  grub_efi_system_table->boot_services->exit (grub_efi_image_handle,
+					      GRUB_EFI_SUCCESS, 0, 0);
   for (;;) ;
 }
 
@@ -191,8 +193,8 @@ grub_efi_set_virtual_address_map (grub_efi_uintn_t memory_map_size,
   grub_efi_status_t status;
 
   r = grub_efi_system_table->runtime_services;
-  status = efi_call_4 (r->set_virtual_address_map, memory_map_size,
-		       descriptor_size, descriptor_version, virtual_map);
+  status = r->set_virtual_address_map (memory_map_size, descriptor_size,
+				       descriptor_version, virtual_map);
 
   if (status == GRUB_EFI_SUCCESS)
     return GRUB_ERR_NONE;
@@ -219,11 +221,11 @@ grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid,
 
   r = grub_efi_system_table->runtime_services;
 
-  status = efi_call_5 (r->set_variable, var16, guid,
-		       (GRUB_EFI_VARIABLE_NON_VOLATILE
-			| GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS
-			| GRUB_EFI_VARIABLE_RUNTIME_ACCESS),
-		       datasize, data);
+  status = r->set_variable (var16, guid,
+			    (GRUB_EFI_VARIABLE_NON_VOLATILE
+			     | GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS
+			     | GRUB_EFI_VARIABLE_RUNTIME_ACCESS),
+			    datasize, data);
   grub_free (var16);
   if (status == GRUB_EFI_SUCCESS)
     return GRUB_ERR_NONE;
@@ -258,7 +260,7 @@ grub_efi_get_variable_with_attributes (const char *var,
 
   r = grub_efi_system_table->runtime_services;
 
-  status = efi_call_5 (r->get_variable, var16, guid, NULL, &datasize, NULL);
+  status = r->get_variable (var16, guid, NULL, &datasize, NULL);
 
   if (status != GRUB_EFI_BUFFER_TOO_SMALL || !datasize)
     {
@@ -273,7 +275,7 @@ grub_efi_get_variable_with_attributes (const char *var,
       return GRUB_EFI_OUT_OF_RESOURCES;
     }
 
-  status = efi_call_5 (r->get_variable, var16, guid, attributes, &datasize, data);
+  status = r->get_variable (var16, guid, attributes, &datasize, data);
   grub_free (var16);
 
   if (status == GRUB_EFI_SUCCESS)
diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
index b67bc73a1b0102a8..e873ef5298ff3a5b 100644
--- a/grub-core/kern/efi/init.c
+++ b/grub-core/kern/efi/init.c
@@ -56,11 +56,11 @@ __stack_chk_fail (void)
    * the serial console, at least on EDK2.
    */
   o = grub_efi_system_table->con_out;
-  efi_call_2 (o->output_string, o, stack_chk_fail_msg);
+  o->output_string (o, stack_chk_fail_msg);
 
-  efi_call_1 (grub_efi_system_table->boot_services->stall, 5000000);
-  efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
-	      GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_ABORTED, 0, NULL);
+  grub_efi_system_table->boot_services->stall (5000000);
+  grub_efi_system_table->runtime_services->reset_system (GRUB_EFI_RESET_SHUTDOWN,
+							 GRUB_EFI_ABORTED, 0, NULL);
 
   /*
    * We shouldn't get here. It's unsafe to return because the stack
@@ -86,8 +86,8 @@ stack_protector_init (void)
     {
       grub_efi_status_t status;
 
-      status = efi_call_4 (rng->get_rng, rng, NULL, sizeof (stack_chk_guard_buf),
-			   stack_chk_guard_buf);
+      status = rng->get_rng (rng, NULL, sizeof (stack_chk_guard_buf),
+			     stack_chk_guard_buf);
       if (status == GRUB_EFI_SUCCESS)
 	grub_memcpy (&__stack_chk_guard, stack_chk_guard_buf, sizeof (__stack_chk_guard));
     }
@@ -124,8 +124,7 @@ grub_efi_init (void)
       grub_shim_lock_verifier_setup ();
     }
 
-  efi_call_4 (grub_efi_system_table->boot_services->set_watchdog_timer,
-	      0, 0, 0, NULL);
+  grub_efi_system_table->boot_services->set_watchdog_timer (0, 0, 0, NULL);
 
   grub_efidisk_init ();
 }
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index ac13e95e9b261712..2be0e697359d4ffd 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -69,8 +69,8 @@ grub_efi_store_alloc (grub_efi_physical_address_t address,
   grub_efi_status_t status;
 
   b = grub_efi_system_table->boot_services;
-  status = efi_call_3 (b->allocate_pool, GRUB_EFI_LOADER_DATA,
-                           sizeof(*alloc), (void**)&alloc);
+  status = b->allocate_pool (GRUB_EFI_LOADER_DATA,
+			     sizeof(*alloc), (void**)&alloc);
 
   if (status == GRUB_EFI_SUCCESS)
     {
@@ -105,7 +105,7 @@ grub_efi_drop_alloc (grub_efi_physical_address_t address,
         efi_allocated_memory = ea->next;
 
       /* Then free the memory backing it. */
-      efi_call_1 (b->free_pool, ea);
+      b->free_pool (ea);
 
       /* And leave, we're done. */
       break;
@@ -137,7 +137,7 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address,
     }
 
   b = grub_efi_system_table->boot_services;
-  status = efi_call_4 (b->allocate_pages, alloctype, memtype, pages, &address);
+  status = b->allocate_pages (alloctype, memtype, pages, &address);
   if (status != GRUB_EFI_SUCCESS)
     {
       grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
@@ -149,7 +149,7 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address,
       /* Uggh, the address 0 was allocated... This is too annoying,
 	 so reallocate another one.  */
       address = GRUB_EFI_MAX_USABLE_ADDRESS;
-      status = efi_call_4 (b->allocate_pages, alloctype, memtype, pages, &address);
+      status = b->allocate_pages (alloctype, memtype, pages, &address);
       grub_efi_free_pages (0, pages);
       if (status != GRUB_EFI_SUCCESS)
 	{
@@ -188,7 +188,7 @@ grub_efi_free_pages (grub_efi_physical_address_t address,
   grub_efi_boot_services_t *b;
 
   b = grub_efi_system_table->boot_services;
-  efi_call_2 (b->free_pages, address, pages);
+  b->free_pages (address, pages);
 
   grub_efi_drop_alloc (address, pages);
 }
@@ -267,8 +267,7 @@ grub_efi_finish_boot_services (grub_efi_uintn_t *outbuf_size, void *outbuf,
 	}
 
       b = grub_efi_system_table->boot_services;
-      status = efi_call_2 (b->exit_boot_services, grub_efi_image_handle,
-			   finish_key);
+      status = b->exit_boot_services (grub_efi_image_handle, finish_key);
       if (status == GRUB_EFI_SUCCESS)
 	break;
 
@@ -381,7 +380,7 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size,
     descriptor_size = &size;
 
   b = grub_efi_system_table->boot_services;
-  status = efi_call_5 (b->get_memory_map, memory_map_size, memory_map, map_key,
+  status = b->get_memory_map (memory_map_size, memory_map, map_key,
 			      descriptor_size, descriptor_version);
   if (*descriptor_size == 0)
     *descriptor_size = sizeof (grub_efi_memory_descriptor_t);
diff --git a/grub-core/kern/i386/efi/tsc.c b/grub-core/kern/i386/efi/tsc.c
index 4b93ba8e1b5f377c..e41dc6526dda08d7 100644
--- a/grub-core/kern/i386/efi/tsc.c
+++ b/grub-core/kern/i386/efi/tsc.c
@@ -33,7 +33,7 @@ grub_tsc_calibrate_from_efi (void)
   grub_uint64_t start_tsc, end_tsc;
   /* Use EFI Time Service to calibrate TSC */
   start_tsc = grub_get_tsc ();
-  efi_call_1 (grub_efi_system_table->boot_services->stall, 1000);
+  grub_efi_system_table->boot_services->stall (1000);
   end_tsc = grub_get_tsc ();
   grub_tsc_rate = grub_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0);
   return 1;
diff --git a/grub-core/kern/ia64/efi/init.c b/grub-core/kern/ia64/efi/init.c
index f1965571b1dc0dce..f8de85398da123ce 100644
--- a/grub-core/kern/ia64/efi/init.c
+++ b/grub-core/kern/ia64/efi/init.c
@@ -51,16 +51,16 @@ grub_machine_init (void)
   grub_efi_uintn_t idx;
   grub_efi_init ();
 
-  efi_call_5 (grub_efi_system_table->boot_services->create_event,
-	      GRUB_EFI_EVT_TIMER, GRUB_EFI_TPL_CALLBACK, 0, 0, &event);
+  grub_efi_system_table->boot_services->create_event (GRUB_EFI_EVT_TIMER,
+						      GRUB_EFI_TPL_CALLBACK,
+						      0, 0, &event);
 
   before = get_itc ();
-  efi_call_3 (grub_efi_system_table->boot_services->set_timer, event,
-	      GRUB_EFI_TIMER_RELATIVE, 200000);
-  efi_call_3 (grub_efi_system_table->boot_services->wait_for_event, 1,
-	      &event, &idx);
+  grub_efi_system_table->boot_services->set_timer (event, GRUB_EFI_TIMER_RELATIVE,
+						   200000);
+  grub_efi_system_table->boot_services->wait_for_event (1, &event, &idx);
   after = get_itc ();
-  efi_call_1 (grub_efi_system_table->boot_services->close_event, event);
+  grub_efi_system_table->boot_services->close_event (event);
   divisor = (after - before + 5) / 20;
   if (divisor == 0)
     divisor = 800000;
diff --git a/grub-core/kern/loongarch64/efi/init.c b/grub-core/kern/loongarch64/efi/init.c
index 561c50a0a8b18550..924b0e87d0ab0a43 100644
--- a/grub-core/kern/loongarch64/efi/init.c
+++ b/grub-core/kern/loongarch64/efi/init.c
@@ -50,9 +50,9 @@ grub_machine_init (void)
   grub_efi_init ();
 
   b = grub_efi_system_table->boot_services;
-  efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL,
-	      GRUB_EFI_TPL_CALLBACK, grub_loongson_increment_timer, NULL, &tmr_evt);
-  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, EFI_TIMER_PERIOD_MILLISECONDS(10));
+  b->create_event (GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL,
+		   GRUB_EFI_TPL_CALLBACK, grub_loongson_increment_timer, NULL, &tmr_evt);
+  b->set_timer (tmr_evt, GRUB_EFI_TIMER_PERIODIC, EFI_TIMER_PERIOD_MILLISECONDS(10));
 
   grub_install_get_time_ms (grub_efi_get_time_ms);
 }
@@ -67,8 +67,8 @@ grub_machine_fini (int flags)
 
   b = grub_efi_system_table->boot_services;
 
-  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0);
-  efi_call_1 (b->close_event, tmr_evt);
+  b->set_timer (tmr_evt, GRUB_EFI_TIMER_CANCEL, 0);
+  b->close_event (tmr_evt);
 
   grub_efi_fini ();
 
diff --git a/grub-core/lib/efi/datetime.c b/grub-core/lib/efi/datetime.c
index 0fd1b5fbd615cfec..b03e4df5ecc1e98b 100644
--- a/grub-core/lib/efi/datetime.c
+++ b/grub-core/lib/efi/datetime.c
@@ -32,8 +32,7 @@ grub_get_datetime (struct grub_datetime *datetime)
   grub_efi_status_t status;
   struct grub_efi_time efi_time;
 
-  status = efi_call_2 (grub_efi_system_table->runtime_services->get_time,
-                       &efi_time, 0);
+  status = grub_efi_system_table->runtime_services->get_time (&efi_time, 0);
 
   if (status)
     return grub_error (GRUB_ERR_INVALID_COMMAND,
@@ -57,8 +56,7 @@ grub_set_datetime (struct grub_datetime *datetime)
   grub_efi_status_t status;
   struct grub_efi_time efi_time;
 
-  status = efi_call_2 (grub_efi_system_table->runtime_services->get_time,
-                       &efi_time, 0);
+  status = grub_efi_system_table->runtime_services->get_time (&efi_time, 0);
 
   if (status)
     return grub_error (GRUB_ERR_INVALID_COMMAND,
@@ -71,8 +69,7 @@ grub_set_datetime (struct grub_datetime *datetime)
   efi_time.minute = datetime->minute;
   efi_time.second = datetime->second;
 
-  status = efi_call_1 (grub_efi_system_table->runtime_services->set_time,
-                       &efi_time);
+  status = grub_efi_system_table->runtime_services->set_time (&efi_time);
 
   if (status)
     return grub_error (GRUB_ERR_INVALID_COMMAND,
diff --git a/grub-core/lib/efi/halt.c b/grub-core/lib/efi/halt.c
index e6356894afa15197..a58a747e5827bed0 100644
--- a/grub-core/lib/efi/halt.c
+++ b/grub-core/lib/efi/halt.c
@@ -34,8 +34,8 @@ grub_halt (void)
     !defined(__loongarch__) && !defined(__riscv)
   grub_acpi_halt ();
 #endif
-  efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
-              GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL);
+  grub_efi_system_table->runtime_services->reset_system (GRUB_EFI_RESET_SHUTDOWN,
+							 GRUB_EFI_SUCCESS, 0, NULL);
 
   while (1);
 }
diff --git a/grub-core/lib/efi/relocator.c b/grub-core/lib/efi/relocator.c
index 84da70a86cf7b992..b4518d0002485511 100644
--- a/grub-core/lib/efi/relocator.c
+++ b/grub-core/lib/efi/relocator.c
@@ -101,8 +101,8 @@ grub_relocator_firmware_alloc_region (grub_addr_t start, grub_size_t size)
 		(unsigned long long) start, (unsigned long long) size);
 #endif
   b = grub_efi_system_table->boot_services;
-  status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS,
-		       GRUB_EFI_LOADER_DATA, size >> 12, &address);
+  status = b->allocate_pages (GRUB_EFI_ALLOCATE_ADDRESS,
+			      GRUB_EFI_LOADER_DATA, size >> 12, &address);
   return (status == GRUB_EFI_SUCCESS);
 }
 
@@ -115,5 +115,5 @@ grub_relocator_firmware_free_region (grub_addr_t start, grub_size_t size)
     return;
 
   b = grub_efi_system_table->boot_services;
-  efi_call_2 (b->free_pages, start, size >> 12);
+  b->free_pages (start, size >> 12);
 }
diff --git a/grub-core/loader/efi/appleloader.c b/grub-core/loader/efi/appleloader.c
index fc89e23bdc6f6ab3..a0b61a240b73af10 100644
--- a/grub-core/loader/efi/appleloader.c
+++ b/grub-core/loader/efi/appleloader.c
@@ -40,7 +40,7 @@ grub_appleloader_unload (void)
   grub_efi_boot_services_t *b;
 
   b = grub_efi_system_table->boot_services;
-  efi_call_1 (b->unload_image, image_handle);
+  b->unload_image (image_handle);
 
   grub_free (cmdline);
   cmdline = 0;
@@ -55,7 +55,7 @@ grub_appleloader_boot (void)
   grub_efi_boot_services_t *b;
 
   b = grub_efi_system_table->boot_services;
-  efi_call_3 (b->start_image, image_handle, 0, 0);
+  b->start_image (image_handle, 0, 0);
 
   grub_appleloader_unload ();
 
@@ -165,8 +165,8 @@ grub_cmd_appleloader (grub_command_t cmd __attribute__ ((unused)),
   b = grub_efi_system_table->boot_services;
 
   for (pdev = devs ; pdev->devpath ; pdev++)
-    if (efi_call_6 (b->load_image, 0, grub_efi_image_handle, pdev->devpath,
-                    NULL, 0, &image_handle) == GRUB_EFI_SUCCESS)
+    if (b->load_image (0, grub_efi_image_handle, pdev->devpath,
+                       NULL, 0, &image_handle) == GRUB_EFI_SUCCESS)
       break;
 
   if (! pdev->devpath)
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
index 7557eb269be34888..1759af632fe90b01 100644
--- a/grub-core/loader/efi/chainloader.c
+++ b/grub-core/loader/efi/chainloader.c
@@ -56,7 +56,7 @@ grub_chainloader_unload (void *context)
     grub_free (loaded_image->load_options);
 
   b = grub_efi_system_table->boot_services;
-  efi_call_1 (b->unload_image, image_handle);
+  b->unload_image (image_handle);
 
   grub_dl_unref (my_mod);
   return GRUB_ERR_NONE;
@@ -72,7 +72,7 @@ grub_chainloader_boot (void *context)
   grub_efi_char16_t *exit_data = NULL;
 
   b = grub_efi_system_table->boot_services;
-  status = efi_call_3 (b->start_image, image_handle, &exit_data_size, &exit_data);
+  status = b->start_image (image_handle, &exit_data_size, &exit_data);
   if (status != GRUB_EFI_SUCCESS)
     {
       if (exit_data)
@@ -94,7 +94,7 @@ grub_chainloader_boot (void *context)
     }
 
   if (exit_data)
-    efi_call_1 (b->free_pool, exit_data);
+    b->free_pool (exit_data);
 
   grub_loader_unset ();
 
@@ -289,7 +289,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
     }
   pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12);
 
-  status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES,
+  status = b->allocate_pages (GRUB_EFI_ALLOCATE_ANY_PAGES,
 			      GRUB_EFI_LOADER_CODE,
 			      pages, &address);
   if (status != GRUB_EFI_SUCCESS)
@@ -346,9 +346,9 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
     }
 #endif
 
-  status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path,
-		       boot_image, size,
-		       &image_handle);
+  status = b->load_image (0, grub_efi_image_handle, file_path,
+			  boot_image, size,
+			  &image_handle);
   if (status != GRUB_EFI_SUCCESS)
     {
       if (status == GRUB_EFI_OUT_OF_RESOURCES)
@@ -403,7 +403,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
   grub_device_close (dev);
 
   /* We're finished with the source image buffer and file path now. */
-  efi_call_2 (b->free_pages, address, pages);
+  b->free_pages (address, pages);
   grub_free (file_path);
 
   grub_loader_set_ex (grub_chainloader_boot, grub_chainloader_unload, image_handle, 0);
@@ -421,10 +421,10 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
   grub_free (file_path);
 
   if (address)
-    efi_call_2 (b->free_pages, address, pages);
+    b->free_pages (address, pages);
 
   if (image_handle != NULL)
-    efi_call_1 (b->unload_image, image_handle);
+    b->unload_image (image_handle);
 
   grub_dl_unref (my_mod);
 
diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c
index bd495a184811445b..2f0ec4d037f02279 100644
--- a/grub-core/mmap/efi/mmap.c
+++ b/grub-core/mmap/efi/mmap.c
@@ -203,14 +203,14 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
   b = grub_efi_system_table->boot_services;
   address = start & (~0xfffULL);
   pages = (end - address + 0xfff) >> 12;
-  status = efi_call_2 (b->free_pages, address, pages);
+  status = b->free_pages (address, pages);
   if (status != GRUB_EFI_SUCCESS && status != GRUB_EFI_NOT_FOUND)
     {
       grub_free (curover);
       return 0;
     }
-  status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS,
-		       make_efi_memtype (type), pages, &address);
+  status = b->allocate_pages (GRUB_EFI_ALLOCATE_ADDRESS,
+			      make_efi_memtype (type), pages, &address);
   if (status != GRUB_EFI_SUCCESS)
     {
       grub_free (curover);
@@ -239,7 +239,7 @@ grub_mmap_unregister (int handle)
     {
       if (curover->handle == handle)
 	{
-	  efi_call_2 (b->free_pages, curover->address, curover->pages);
+	  b->free_pages (curover->address, curover->pages);
 	  if (prevover != 0)
 	    prevover->next = curover->next;
 	  else
@@ -281,8 +281,8 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
 #endif
 
   pages = (size + 0xfff) >> 12;
-  status = efi_call_4 (b->allocate_pages, atype,
-		       make_efi_memtype (type), pages, &address);
+  status = b->allocate_pages (atype,
+			      make_efi_memtype (type), pages, &address);
   if (status != GRUB_EFI_SUCCESS)
     {
       grub_free (curover);
@@ -294,8 +294,8 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
       /* Uggh, the address 0 was allocated... This is too annoying,
 	 so reallocate another one.  */
       address = 0xffffffff;
-      status = efi_call_4 (b->allocate_pages, atype,
-			   make_efi_memtype (type), pages, &address);
+      status = b->allocate_pages (atype,
+				  make_efi_memtype (type), pages, &address);
       grub_efi_free_pages (0, pages);
       if (status != GRUB_EFI_SUCCESS)
 	return 0;
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index 5adf5f40f4924b2e..56a1797093f6cee1 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -46,7 +46,7 @@ send_card_buffer (struct grub_net_card *dev,
     while (1)
       {
 	txbuf = NULL;
-	st = efi_call_3 (net->get_status, net, 0, &txbuf);
+	st = net->get_status (net, 0, &txbuf);
 	if (st != GRUB_EFI_SUCCESS)
 	  return grub_error (GRUB_ERR_IO,
 			     N_("couldn't send network packet"));
@@ -74,8 +74,8 @@ send_card_buffer (struct grub_net_card *dev,
 
   grub_memcpy (dev->txbuf, pack->data, dev->last_pkt_size);
 
-  st = efi_call_7 (net->transmit, net, 0, dev->last_pkt_size,
-		   dev->txbuf, NULL, NULL, NULL);
+  st = net->transmit (net, 0, dev->last_pkt_size,
+		      dev->txbuf, NULL, NULL, NULL);
   if (st != GRUB_EFI_SUCCESS)
     return grub_error (GRUB_ERR_IO, N_("couldn't send network packet"));
 
@@ -88,7 +88,7 @@ send_card_buffer (struct grub_net_card *dev,
      Perhaps a timeout in the FW has discarded the recycle buffer.
    */
   txbuf = NULL;
-  st = efi_call_3 (net->get_status, net, 0, &txbuf);
+  st = net->get_status (net, 0, &txbuf);
   dev->txbusy = !(st == GRUB_EFI_SUCCESS && txbuf);
 
   return GRUB_ERR_NONE;
@@ -114,8 +114,8 @@ get_card_packet (struct grub_net_card *dev)
       if (!dev->rcvbuf)
 	return NULL;
 
-      st = efi_call_7 (net->receive, net, NULL, &bufsize,
-		       dev->rcvbuf, NULL, NULL, NULL);
+      st = net->receive (net, NULL, &bufsize,
+		         dev->rcvbuf, NULL, NULL, NULL);
       if (st != GRUB_EFI_BUFFER_TOO_SMALL)
 	break;
       dev->rcvbufsize = 2 * ALIGN_UP (dev->rcvbufsize > bufsize
@@ -168,7 +168,7 @@ open_card (struct grub_net_card *dev)
   if (net != NULL)
     {
       if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
-	  && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
+	  && net->start (net) != GRUB_EFI_SUCCESS)
 	return grub_error (GRUB_ERR_NET_NO_CARD, "%s: net start failed",
 			   dev->name);
 
@@ -177,7 +177,7 @@ open_card (struct grub_net_card *dev)
 			   dev->name);
 
       if (net->mode->state == GRUB_EFI_NETWORK_STARTED
-	  && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
+	  && net->initialize (net, 0, 0) != GRUB_EFI_SUCCESS)
 	return grub_error (GRUB_ERR_NET_NO_CARD, "%s: net initialize failed",
 			   dev->name);
 
@@ -201,7 +201,7 @@ open_card (struct grub_net_card *dev)
 	    filters |= (net->mode->receive_filter_mask &
 			GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS);
 
-	  efi_call_6 (net->receive_filters, net, filters, 0, 0, 0, NULL);
+	  net->receive_filters (net, filters, 0, 0, 0, NULL);
 	}
 
       dev->efi_net = net;
@@ -216,8 +216,8 @@ open_card (struct grub_net_card *dev)
 static void
 close_card (struct grub_net_card *dev)
 {
-  efi_call_1 (dev->efi_net->shutdown, dev->efi_net);
-  efi_call_1 (dev->efi_net->stop, dev->efi_net);
+  dev->efi_net->shutdown (dev->efi_net);
+  dev->efi_net->stop (dev->efi_net);
   grub_efi_close_protocol (dev->efi_handle, &net_io_guid);
 }
 
@@ -286,14 +286,14 @@ grub_efinet_findcards (void)
 	continue;
 
       if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
-	  && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
+	  && net->start (net) != GRUB_EFI_SUCCESS)
 	continue;
 
       if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
 	continue;
 
       if (net->mode->state == GRUB_EFI_NETWORK_STARTED
-	  && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
+	  && net->initialize (net, 0, 0) != GRUB_EFI_SUCCESS)
 	continue;
 
       card = grub_zalloc (sizeof (struct grub_net_card));
diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
index 532948a8e19fc9de..9a7bc0fcf9d16707 100644
--- a/grub-core/term/efi/console.c
+++ b/grub-core/term/efi/console.c
@@ -107,14 +107,13 @@ grub_console_setcolorstate (struct grub_term_output *term
 
   switch (state) {
     case GRUB_TERM_COLOR_STANDARD:
-      efi_call_2 (o->set_attributes, o, GRUB_TERM_DEFAULT_STANDARD_COLOR
-		  & 0x7f);
+      o->set_attributes (o, GRUB_TERM_DEFAULT_STANDARD_COLOR & 0x7f);
       break;
     case GRUB_TERM_COLOR_NORMAL:
-      efi_call_2 (o->set_attributes, o, grub_term_normal_color & 0x7f);
+      o->set_attributes (o, grub_term_normal_color & 0x7f);
       break;
     case GRUB_TERM_COLOR_HIGHLIGHT:
-      efi_call_2 (o->set_attributes, o, grub_term_highlight_color & 0x7f);
+      o->set_attributes (o, grub_term_highlight_color & 0x7f);
       break;
     default:
       break;
@@ -135,7 +134,7 @@ grub_console_setcursor (struct grub_term_output *term __attribute__ ((unused)),
     }
 
   o = grub_efi_system_table->con_out;
-  efi_call_2 (o->enable_cursor, o, on);
+  o->enable_cursor (o, on);
 }
 
 static grub_err_t
@@ -189,10 +188,10 @@ grub_console_putchar (struct grub_term_output *term,
 
   /* Should this test be cached?  */
   if ((c->base > 0x7f || c->ncomb)
-      && efi_call_2 (o->test_string, o, str) != GRUB_EFI_SUCCESS)
+      && o->test_string (o, str) != GRUB_EFI_SUCCESS)
     return;
 
-  efi_call_2 (o->output_string, o, str);
+  o->output_string (o, str);
 }
 
 const unsigned efi_codes[] =
@@ -242,7 +241,7 @@ grub_console_getkey_con (struct grub_term_input *term __attribute__ ((unused)))
   grub_efi_status_t status;
 
   i = grub_efi_system_table->con_in;
-  status = efi_call_2 (i->read_key_stroke, i, &key);
+  status = i->read_key_stroke (i, &key);
 
   if (status != GRUB_EFI_SUCCESS)
     return GRUB_TERM_NO_KEY;
@@ -270,7 +269,7 @@ grub_console_read_key_stroke (
 
   key = grub_efi_translate_key (key_data.key);
   if (key == GRUB_TERM_NO_KEY) {
-    status = efi_call_2 (text_input->read_key_stroke, text_input, &key_data);
+    status = text_input->read_key_stroke (text_input, &key_data);
     if (status != GRUB_EFI_SUCCESS)
       return GRUB_ERR_EOF;
 
@@ -391,8 +390,8 @@ grub_console_getwh (struct grub_term_output *term)
 
   o = grub_efi_system_table->con_out;
   if (grub_prepare_for_text_output (term) != GRUB_ERR_NONE ||
-      efi_call_4 (o->query_mode, o, o->mode->mode,
-		  &columns, &rows) != GRUB_EFI_SUCCESS)
+      o->query_mode (o, o->mode->mode,
+		     &columns, &rows) != GRUB_EFI_SUCCESS)
     {
       /* Why does this fail?  */
       columns = 80;
@@ -424,7 +423,7 @@ grub_console_gotoxy (struct grub_term_output *term,
     return;
 
   o = grub_efi_system_table->con_out;
-  efi_call_3 (o->set_cursor_position, o, pos.x, pos.y);
+  o->set_cursor_position (o, pos.x, pos.y);
 }
 
 static void
@@ -438,9 +437,9 @@ grub_console_cls (struct grub_term_output *term __attribute__ ((unused)))
 
   o = grub_efi_system_table->con_out;
   orig_attr = o->mode->attribute;
-  efi_call_2 (o->set_attributes, o, GRUB_EFI_BACKGROUND_BLACK);
-  efi_call_1 (o->clear_screen, o);
-  efi_call_2 (o->set_attributes, o, orig_attr);
+  o->set_attributes (o, GRUB_EFI_BACKGROUND_BLACK);
+  o->clear_screen (o);
+  o->set_attributes (o, orig_attr);
 }
 
 static grub_err_t
diff --git a/grub-core/term/efi/serial.c b/grub-core/term/efi/serial.c
index 4c94723c57e7458f..e86ebce3f8bf68cf 100644
--- a/grub-core/term/efi/serial.c
+++ b/grub-core/term/efi/serial.c
@@ -51,16 +51,16 @@ do_real_config (struct grub_serial_port *port)
   if (port->configured)
     return;
 
-  status = efi_call_7 (port->interface->set_attributes, port->interface,
-		       port->config.speed,
-		       0, 0, parities[port->config.parity],
-		       port->config.word_len,
-		       stop_bits[port->config.stop_bits]);
+  status = port->interface->set_attributes (port->interface,
+					    port->config.speed,
+					    0, 0, parities[port->config.parity],
+					    port->config.word_len,
+					    stop_bits[port->config.stop_bits]);
   if (status != GRUB_EFI_SUCCESS)
     port->broken = 1;
 
-  status = efi_call_2 (port->interface->set_control_bits, port->interface,
-		       port->config.rtscts ? 0x4002 : 0x2);
+  status = port->interface->set_control_bits (port->interface,
+					      port->config.rtscts ? 0x4002 : 0x2);
 
   port->configured = 1;
 }
@@ -76,7 +76,7 @@ serial_hw_fetch (struct grub_serial_port *port)
   if (port->broken)
     return -1;
 
-  status = efi_call_3 (port->interface->read, port->interface, &bufsize, &c);
+  status = port->interface->read (port->interface, &bufsize, &c);
   if (status != GRUB_EFI_SUCCESS || bufsize == 0)
     return -1;
 
@@ -95,7 +95,7 @@ serial_hw_put (struct grub_serial_port *port, const int c)
   if (port->broken)
     return;
 
-  efi_call_3 (port->interface->write, port->interface, &bufsize, &c0);
+  port->interface->write (port->interface, &bufsize, &c0);
 }
 
 /* Initialize a serial device. PORT is the port number for a serial device.
diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c
index 7a50546318d62f40..9c79010384312dd3 100644
--- a/grub-core/video/efi_gop.c
+++ b/grub-core/video/efi_gop.c
@@ -110,7 +110,7 @@ grub_video_gop_fini (void)
 {
   if (restore_needed)
     {
-      efi_call_2 (gop->set_mode, gop, old_mode);
+      gop->set_mode (gop, old_mode);
       restore_needed = 0;
     }
   grub_free (framebuffer.offscreen);
@@ -274,7 +274,7 @@ grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, vo
       struct grub_efi_gop_mode_info *info = NULL;
       struct grub_video_mode_info mode_info;
 
-      status = efi_call_4 (gop->query_mode, gop, mode, &size, &info);
+      status = gop->query_mode (gop, mode, &size, &info);
 
       if (status)
 	{
@@ -400,7 +400,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
 	  grub_efi_uintn_t size;
 	  grub_efi_status_t status;
 
-	  status = efi_call_4 (gop->query_mode, gop, mode, &size, &info);
+	  status = gop->query_mode (gop, mode, &size, &info);
 	  if (status)
 	    {
 	      info = 0;
@@ -461,7 +461,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
 	  old_mode = gop->mode->mode;
 	  restore_needed = 1;
 	}
-      efi_call_2 (gop->set_mode, gop, best_mode);
+      gop->set_mode (gop, best_mode);
     }
 
   info = gop->mode->info;
@@ -523,10 +523,10 @@ grub_video_gop_swap_buffers (void)
 {
   if (framebuffer.offscreen)
     {
-      efi_call_10 (gop->blt, gop, framebuffer.offscreen,
-		   GRUB_EFI_BLT_BUFFER_TO_VIDEO, 0, 0, 0, 0,
-		   framebuffer.mode_info.width, framebuffer.mode_info.height,
-		   framebuffer.mode_info.width * 4);
+      gop->blt (gop, framebuffer.offscreen,
+		GRUB_EFI_BLT_BUFFER_TO_VIDEO, 0, 0, 0, 0,
+		framebuffer.mode_info.width, framebuffer.mode_info.height,
+		framebuffer.mode_info.width * 4);
     }
   return GRUB_ERR_NONE;
 }
@@ -613,7 +613,7 @@ GRUB_MOD_FINI(efi_gop)
 {
   if (restore_needed)
     {
-      efi_call_2 (gop->set_mode, gop, old_mode);
+      gop->set_mode (gop, old_mode);
       restore_needed = 0;
     }
   if (gop)
diff --git a/grub-core/video/efi_uga.c b/grub-core/video/efi_uga.c
index e74d6c235000d611..25d22c8a3cd07845 100644
--- a/grub-core/video/efi_uga.c
+++ b/grub-core/video/efi_uga.c
@@ -186,13 +186,13 @@ check_protocol (void)
       grub_uint32_t width, height, depth, rate, pixel;
       int ret;
 
-      if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate))
+      if (c->get_mode (c, &width, &height, &depth, &rate))
 	return 0;
 
       grub_efi_set_text_mode (0);
       pixel = RGB_MAGIC;
-      efi_call_10 (c->blt, c, (struct grub_efi_uga_pixel *) &pixel,
-		   GRUB_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0);
+      c->blt (c, (struct grub_efi_uga_pixel *) &pixel,
+	      GRUB_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0);
       ret = find_framebuf (&uga_fb, &uga_pitch);
       grub_efi_set_text_mode (1);
 
@@ -236,7 +236,7 @@ grub_video_uga_setup (unsigned int width, unsigned int height,
     grub_uint32_t d;
     grub_uint32_t r;
 
-    if ((! efi_call_5 (uga->get_mode, uga, &w, &h, &d, &r)) &&
+    if ((! uga->get_mode (uga, &w, &h, &d, &r)) &&
 	((! width) || (width == w)) &&
 	((! height) || (height == h)) &&
 	((! depth) || (depth == d)))
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v4 4/5] efi: Remove x86_64 call wrappers
  2023-05-23 15:31 [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Ard Biesheuvel
                   ` (2 preceding siblings ...)
  2023-05-23 15:31 ` [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers Ard Biesheuvel
@ 2023-05-23 15:31 ` Ard Biesheuvel
  2023-05-23 15:31 ` [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386 Ard Biesheuvel
  2023-05-24 20:21 ` [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Daniel Kiper
  5 siblings, 0 replies; 29+ messages in thread
From: Ard Biesheuvel @ 2023-05-23 15:31 UTC (permalink / raw)
  To: grub-devel; +Cc: Ard Biesheuvel, Daniel Kiper, Glenn Washburn

The call wrappers are no longer needed now that GCC can generate
function calls using MS calling convention, so let's get rid of them.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 grub-core/Makefile.core.def          |   1 -
 grub-core/kern/x86_64/efi/callwrap.S | 129 --------------------
 include/grub/efi/api.h               |  73 -----------
 3 files changed, 203 deletions(-)

diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index c69c4a3321d27ecd..1d88c4d1c2555f7f 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -236,7 +236,6 @@ kernel = {
 
   x86_64 = kern/x86_64/dl.c;
   x86_64_xen = kern/x86_64/dl.c;
-  x86_64_efi = kern/x86_64/efi/callwrap.S;
   x86_64_efi = kern/i386/efi/init.c;
   x86_64_efi = bus/pci.c;
 
diff --git a/grub-core/kern/x86_64/efi/callwrap.S b/grub-core/kern/x86_64/efi/callwrap.S
deleted file mode 100644
index 1337fd9fc823f8a4..0000000000000000
--- a/grub-core/kern/x86_64/efi/callwrap.S
+++ /dev/null
@@ -1,129 +0,0 @@
-/* callwrap.S - wrapper for x86_64 efi calls */
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2006,2007,2009  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-#include <grub/symbol.h>
-
-/*
- * x86_64 uses registry to pass parameters. Unfortunately, gcc and efi use
- * different call conversion, so we need to do some conversion.
- *
- * gcc:
- *   %rdi,  %rsi,  %rdx,  %rcx, %r8, %r9, 8(%rsp), 16(%rsp), ...
- *
- * efi:
- *   %rcx,  %rdx,  %r8,  %r9,  32(%rsp), 40(%rsp), 48(%rsp), ...
- *
- */
-
-        .file   "callwrap.S"
-        .text
-
-FUNCTION(efi_wrap_0)
-	subq $40, %rsp
-	call *%rdi
-	addq $40, %rsp
-	ret
-
-FUNCTION(efi_wrap_1)
-	subq $40, %rsp
-	mov  %rsi, %rcx
-	call *%rdi
-	addq $40, %rsp
-	ret
-
-FUNCTION(efi_wrap_2)
-	subq $40, %rsp
-	mov  %rsi, %rcx
-	call *%rdi
-	addq $40, %rsp
-	ret
-
-FUNCTION(efi_wrap_3)
-	subq $40, %rsp
-	mov  %rcx, %r8
-	mov  %rsi, %rcx
-	call *%rdi
-	addq $40, %rsp
-	ret
-
-FUNCTION(efi_wrap_4)
-	subq $40, %rsp
-	mov %r8, %r9
-	mov %rcx, %r8
-	mov %rsi, %rcx
-	call *%rdi
-	addq $40, %rsp
-	ret
-
-FUNCTION(efi_wrap_5)
-	subq $40, %rsp
-	mov %r9, 32(%rsp)
-	mov %r8, %r9
-	mov %rcx, %r8
-	mov %rsi, %rcx
-	call *%rdi
-	addq $40, %rsp
-	ret
-
-FUNCTION(efi_wrap_6)
-	subq $56, %rsp
-	mov 56+8(%rsp), %rax
-	mov %rax, 40(%rsp)
-	mov %r9, 32(%rsp)
-	mov %r8, %r9
-	mov %rcx, %r8
-	mov %rsi, %rcx
-	call *%rdi
-	addq $56, %rsp
-	ret
-
-FUNCTION(efi_wrap_7)
-	subq $88, %rsp
-	mov 88+16(%rsp), %rax
-	mov %rax, 48(%rsp)
-	mov 88+8(%rsp), %rax
-	mov %rax, 40(%rsp)
-	mov %r9, 32(%rsp)
-	mov %r8, %r9
-	mov %rcx, %r8
-	mov %rsi, %rcx
-	call *%rdi
-	addq $88, %rsp
-	ret
-
-FUNCTION(efi_wrap_10)
-	subq $88, %rsp
-	mov 88+40(%rsp), %rax
-	mov %rax, 72(%rsp)
-	mov 88+32(%rsp), %rax
-	mov %rax, 64(%rsp)
-	mov 88+24(%rsp), %rax
-	mov %rax, 56(%rsp)
-	mov 88+16(%rsp), %rax
-	mov %rax, 48(%rsp)
-	mov 88+8(%rsp), %rax
-	mov %rax, 40(%rsp)
-	mov %r9, 32(%rsp)
-	mov %r8, %r9
-	mov %rcx, %r8
-	mov %rsi, %rcx
-	call *%rdi
-	addq $88, %rsp
-	ret
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index ebfa6c40fba34eae..fb881ae12d5ae73a 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -1824,77 +1824,4 @@ struct initrd_media_device_path {
 } GRUB_PACKED;
 typedef struct initrd_media_device_path initrd_media_device_path_t;
 
-#if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \
-  || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) \
-  || defined(__riscv) || defined (__loongarch__)
-
-#define efi_call_0(func)		(func)()
-#define efi_call_1(func, a)		(func)(a)
-#define efi_call_2(func, a, b)		(func)(a, b)
-#define efi_call_3(func, a, b, c)	(func)(a, b, c)
-#define efi_call_4(func, a, b, c, d)	(func)(a, b, c, d)
-#define efi_call_5(func, a, b, c, d, e)	(func)(a, b, c, d, e)
-#define efi_call_6(func, a, b, c, d, e, f) (func)(a, b, c, d, e, f)
-#define efi_call_7(func, a, b, c, d, e, f, g) (func)(a, b, c, d, e, f, g)
-#define efi_call_10(func, a, b, c, d, e, f, g, h, i, j)	(func)(a, b, c, d, e, f, g, h, i, j)
-
-#else
-
-#define efi_call_0(func) \
-  efi_wrap_0(func)
-#define efi_call_1(func, a) \
-  efi_wrap_1(func, (grub_uint64_t) (a))
-#define efi_call_2(func, a, b) \
-  efi_wrap_2(func, (grub_uint64_t) (a), (grub_uint64_t) (b))
-#define efi_call_3(func, a, b, c) \
-  efi_wrap_3(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
-	     (grub_uint64_t) (c))
-#define efi_call_4(func, a, b, c, d) \
-  efi_wrap_4(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
-	     (grub_uint64_t) (c), (grub_uint64_t) (d))
-#define efi_call_5(func, a, b, c, d, e)	\
-  efi_wrap_5(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
-	     (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e))
-#define efi_call_6(func, a, b, c, d, e, f) \
-  efi_wrap_6(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
-	     (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \
-	     (grub_uint64_t) (f))
-#define efi_call_7(func, a, b, c, d, e, f, g) \
-  efi_wrap_7(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
-	     (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \
-	     (grub_uint64_t) (f), (grub_uint64_t) (g))
-#define efi_call_10(func, a, b, c, d, e, f, g, h, i, j) \
-  efi_wrap_10(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
-	      (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \
-	      (grub_uint64_t) (f), (grub_uint64_t) (g),	(grub_uint64_t) (h), \
-	      (grub_uint64_t) (i), (grub_uint64_t) (j))
-
-grub_uint64_t EXPORT_FUNC(efi_wrap_0) (void *func);
-grub_uint64_t EXPORT_FUNC(efi_wrap_1) (void *func, grub_uint64_t arg1);
-grub_uint64_t EXPORT_FUNC(efi_wrap_2) (void *func, grub_uint64_t arg1,
-                                       grub_uint64_t arg2);
-grub_uint64_t EXPORT_FUNC(efi_wrap_3) (void *func, grub_uint64_t arg1,
-                                       grub_uint64_t arg2, grub_uint64_t arg3);
-grub_uint64_t EXPORT_FUNC(efi_wrap_4) (void *func, grub_uint64_t arg1,
-                                       grub_uint64_t arg2, grub_uint64_t arg3,
-                                       grub_uint64_t arg4);
-grub_uint64_t EXPORT_FUNC(efi_wrap_5) (void *func, grub_uint64_t arg1,
-                                       grub_uint64_t arg2, grub_uint64_t arg3,
-                                       grub_uint64_t arg4, grub_uint64_t arg5);
-grub_uint64_t EXPORT_FUNC(efi_wrap_6) (void *func, grub_uint64_t arg1,
-                                       grub_uint64_t arg2, grub_uint64_t arg3,
-                                       grub_uint64_t arg4, grub_uint64_t arg5,
-                                       grub_uint64_t arg6);
-grub_uint64_t EXPORT_FUNC(efi_wrap_7) (void *func, grub_uint64_t arg1,
-                                       grub_uint64_t arg2, grub_uint64_t arg3,
-                                       grub_uint64_t arg4, grub_uint64_t arg5,
-                                       grub_uint64_t arg6, grub_uint64_t arg7);
-grub_uint64_t EXPORT_FUNC(efi_wrap_10) (void *func, grub_uint64_t arg1,
-                                        grub_uint64_t arg2, grub_uint64_t arg3,
-                                        grub_uint64_t arg4, grub_uint64_t arg5,
-                                        grub_uint64_t arg6, grub_uint64_t arg7,
-                                        grub_uint64_t arg8, grub_uint64_t arg9,
-                                        grub_uint64_t arg10);
-#endif
-
 #endif /* ! GRUB_EFI_API_HEADER */
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2023-05-23 15:31 [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Ard Biesheuvel
                   ` (3 preceding siblings ...)
  2023-05-23 15:31 ` [PATCH v4 4/5] efi: Remove x86_64 call wrappers Ard Biesheuvel
@ 2023-05-23 15:31 ` Ard Biesheuvel
  2023-05-23 15:34   ` Ard Biesheuvel
  2024-05-16 12:24   ` [REGRESSION] " Jan Čermák
  2023-05-24 20:21 ` [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Daniel Kiper
  5 siblings, 2 replies; 29+ messages in thread
From: Ard Biesheuvel @ 2023-05-23 15:31 UTC (permalink / raw)
  To: grub-devel; +Cc: Ard Biesheuvel, Daniel Kiper, Glenn Washburn

Switch the x86 based EFI platform builds to the generic EFI loader,
which exposes the initrd via the LoadFile2 protocol instead of the
x86-specific setup header. This will launch the Linux kernel via its EFI
stub, which performs its own initialization in the EFI boot services
context before calling ExitBootServices() and performing the bare metal
Linux boot.

Given that only Linux kernel versions v5.8 and later support this initrd
loading method, the existing x86 loader is retained as a fallback, which
will also be used for Linux kernels built without the EFI stub. In this
case, GRUB calls ExitBootServices() before entering the Linux kernel,
and all EFI related information is provided to the kernel via struct
boot_params in the setup header, as before.

Note that this means that booting EFI stub kernels older than v5.8 is
not supported even when not using an initrd at all. Also, the EFI
handover protocol, which has no basis in the UEFI specification, is not
implemented.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 grub-core/Makefile.core.def   |  2 +
 grub-core/loader/efi/linux.c  | 47 ++++++++++++++++++--
 grub-core/loader/i386/linux.c |  8 ++++
 include/grub/efi/efi.h        |  2 +-
 4 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 1d88c4d1c2555f7f..e58b511242618df7 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1853,6 +1853,8 @@ module = {
   loongarch64 = loader/efi/linux.c;
   riscv32 = loader/efi/linux.c;
   riscv64 = loader/efi/linux.c;
+  i386_efi = loader/efi/linux.c;
+  x86_64_efi = loader/efi/linux.c;
   emu = loader/emu/linux.c;
   common = loader/linux.c;
   common = lib/cmdline.c;
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index 15e0686549d7ecca..90ad1a7b82a76066 100644
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -69,6 +69,12 @@ static initrd_media_device_path_t initrd_lf2_device_path = {
   }
 };
 
+extern grub_err_t
+grub_cmd_linux_x86_legacy (grub_command_t cmd, int argc, char *argv[]);
+
+extern grub_err_t
+grub_cmd_initrd_x86_legacy (grub_command_t cmd, int argc, char *argv[]);
+
 static grub_efi_status_t __grub_efi_api
 grub_efi_initrd_load_file2 (grub_efi_load_file2_t *this,
                             grub_efi_device_path_t *device_path,
@@ -125,6 +131,7 @@ grub_arch_efi_linux_load_image_header (grub_file_t file,
   return GRUB_ERR_NONE;
 }
 
+#if !defined(__i386__) && !defined(__x86_64__)
 static grub_err_t
 finalize_params_linux (void)
 {
@@ -169,6 +176,7 @@ failure:
   grub_fdt_unload();
   return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT");
 }
+#endif
 
 grub_err_t
 grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
@@ -231,8 +239,10 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
 static grub_err_t
 grub_linux_boot (void)
 {
+#if !defined(__i386__) && !defined(__x86_64__)
   if (finalize_params_linux () != GRUB_ERR_NONE)
     return grub_errno;
+#endif
 
   return (grub_arch_efi_linux_boot_image((grub_addr_t)kernel_addr,
                                           kernel_size, linux_args));
@@ -253,7 +263,9 @@ grub_linux_unload (void)
   if (kernel_addr)
     grub_efi_free_pages ((grub_addr_t) kernel_addr,
 			 GRUB_EFI_BYTES_TO_PAGES (kernel_size));
+#if !defined(__i386__) && !defined(__x86_64__)
   grub_fdt_unload ();
+#endif
 
   if (initrd_lf2_handle != NULL)
     {
@@ -269,6 +281,7 @@ grub_linux_unload (void)
   return GRUB_ERR_NONE;
 }
 
+#if !defined(__i386__) && !defined(__x86_64__)
 /*
  * As per linux/Documentation/arm/Booting
  * ARM initrd needs to be covered by kernel linear mapping,
@@ -304,6 +317,7 @@ allocate_initrd_mem (int initrd_pages)
 				       GRUB_EFI_ALLOCATE_MAX_ADDRESS,
 				       GRUB_EFI_LOADER_DATA);
 }
+#endif
 
 static grub_efi_status_t __grub_efi_api
 grub_efi_initrd_load_file2 (grub_efi_load_file2_t *this,
@@ -345,7 +359,7 @@ static grub_err_t
 grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
 		 int argc, char *argv[])
 {
-  int initrd_size, initrd_pages;
+  int __attribute__ ((unused)) initrd_size, initrd_pages;
   void *initrd_mem = NULL;
   grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;
   grub_efi_status_t status;
@@ -356,6 +370,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
       goto fail;
     }
 
+#if defined(__i386__) || defined(__x86_64__)
+  if (!initrd_use_loadfile2)
+    return grub_cmd_initrd_x86_legacy (cmd, argc, argv);
+#endif
+
   if (!loaded)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT,
@@ -391,6 +410,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
       return GRUB_ERR_NONE;
     }
 
+#if !defined(__i386__) && !defined(__x86_64__)
   initrd_size = grub_get_initrd_size (&initrd_ctx);
   grub_dprintf ("linux", "Loading initrd\n");
 
@@ -404,17 +424,19 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
     }
 
   if (grub_initrd_load (&initrd_ctx, initrd_mem))
-    goto fail;
+    {
+      grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages);
+      goto fail;
+    }
 
   initrd_start = (grub_addr_t) initrd_mem;
   initrd_end = initrd_start + initrd_size;
   grub_dprintf ("linux", "[addr=%p, size=0x%x]\n",
 		(void *) initrd_start, initrd_size);
+#endif
 
  fail:
   grub_initrd_close (&initrd_ctx);
-  if (initrd_mem && !initrd_start)
-    grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages);
 
   return grub_errno;
 }
@@ -442,7 +464,24 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   kernel_size = grub_file_size (file);
 
   if (grub_arch_efi_linux_load_image_header (file, &lh) != GRUB_ERR_NONE)
+#if !defined(__i386__) && !defined(__x86_64__)
     goto fail;
+#else
+    goto fallback;
+
+  if (!initrd_use_loadfile2)
+    {
+      /*
+       * This is a EFI stub image but it is too old to implement the LoadFile2
+       * based initrd loading scheme, and Linux/x86 does not support the DT
+       * based method either. So fall back to the x86-specific loader that
+       * enters Linux in EFI mode but without going through its EFI stub.
+       */
+fallback:
+      grub_file_close (file);
+      return grub_cmd_linux_x86_legacy (cmd, argc, argv);
+    }
+#endif
 
   grub_loader_unset();
 
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index c2385d0a561a8fc4..997647a33326eeb8 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -1136,6 +1136,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   return grub_errno;
 }
 
+#ifndef GRUB_MACHINE_EFI
 static grub_command_t cmd_linux, cmd_initrd;
 
 GRUB_MOD_INIT(linux)
@@ -1152,3 +1153,10 @@ GRUB_MOD_FINI(linux)
   grub_unregister_command (cmd_linux);
   grub_unregister_command (cmd_initrd);
 }
+#else
+extern grub_err_t __attribute__((alias("grub_cmd_linux")))
+grub_cmd_linux_x86_legacy (grub_command_t cmd, int argc, char *argv[]);
+
+extern grub_err_t __attribute__((alias("grub_cmd_initrd")))
+grub_cmd_initrd_x86_legacy (grub_command_t cmd, int argc, char *argv[]);
+#endif
diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
index 7c12cb9aa91040e0..d3b96761947a0944 100644
--- a/include/grub/efi/efi.h
+++ b/include/grub/efi/efi.h
@@ -113,12 +113,12 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd,
 #if defined(__arm__) || defined(__aarch64__) || defined(__riscv) || defined(__loongarch__)
 void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void);
 grub_err_t EXPORT_FUNC(grub_efi_get_ram_base)(grub_addr_t *);
+#endif
 #include <grub/file.h>
 grub_err_t grub_arch_efi_linux_load_image_header(grub_file_t file,
                                                 struct linux_arch_kernel_header *lh);
 grub_err_t grub_arch_efi_linux_boot_image(grub_addr_t addr, grub_size_t size,
                                            char *args);
-#endif
 
 grub_addr_t grub_efi_modules_addr (void);
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2023-05-23 15:31 ` [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386 Ard Biesheuvel
@ 2023-05-23 15:34   ` Ard Biesheuvel
  2024-05-16 12:24   ` [REGRESSION] " Jan Čermák
  1 sibling, 0 replies; 29+ messages in thread
From: Ard Biesheuvel @ 2023-05-23 15:34 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Glenn Washburn

On Tue, 23 May 2023 at 17:32, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> Switch the x86 based EFI platform builds to the generic EFI loader,
> which exposes the initrd via the LoadFile2 protocol instead of the
> x86-specific setup header. This will launch the Linux kernel via its EFI
> stub, which performs its own initialization in the EFI boot services
> context before calling ExitBootServices() and performing the bare metal
> Linux boot.
>
> Given that only Linux kernel versions v5.8 and later support this initrd
> loading method, the existing x86 loader is retained as a fallback, which
> will also be used for Linux kernels built without the EFI stub. In this
> case, GRUB calls ExitBootServices() before entering the Linux kernel,
> and all EFI related information is provided to the kernel via struct
> boot_params in the setup header, as before.
>
> Note that this means that booting EFI stub kernels older than v5.8 is
> not supported even when not using an initrd at all. Also, the EFI
> handover protocol, which has no basis in the UEFI specification, is not
> implemented.
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

This patch needs the hunk below, which i failed to git add - apologies

--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -360,7 +360,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__
((unused)),
                 int argc, char *argv[])
 {
   int __attribute__ ((unused)) initrd_size, initrd_pages;
-  void *initrd_mem = NULL;
+  void *__attribute__ ((unused)) initrd_mem = NULL;
   grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;
   grub_efi_status_t status;


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 0/5] efi: Implement generic EFI boot for x86
  2023-05-23 15:31 [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Ard Biesheuvel
                   ` (4 preceding siblings ...)
  2023-05-23 15:31 ` [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386 Ard Biesheuvel
@ 2023-05-24 20:21 ` Daniel Kiper
  5 siblings, 0 replies; 29+ messages in thread
From: Daniel Kiper @ 2023-05-24 20:21 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: grub-devel, Glenn Washburn

On Tue, May 23, 2023 at 05:31:40PM +0200, Ard Biesheuvel wrote:
> Switch the i386-efi and x86_64-efi builds to the generic EFI loader,
> which enters the Linux kernel via the EFI stub and provides the initrd
> via the LoadFile2 protocol. This unifies x86 with other EFI
> architectures, and removes the dependency on the setup header and struct
> bootparams.
>
> Do some preparatory cleanup first, so we no longer need to rely on the
> MS to SysV calling convention translation code.
>
> Changes since v3:
> - add missing efiapi annotations to efiemu routines
> - work around dead code warning from Coverity by making unnecessary
>   changes to the initrd loading logic in the generic EFI loader
>
> Changes since v2:
> - rebase onto latest master, which has the Loongarch changes
> - retain Itanium support for now
> - simplify the fallback logic - attempt to load the image as usual, and
>   fallback on failure or if the image does not implement LoadFile2
>
> Changes since v1:
> - drop Itanium support, which is a maintenance burden as it shares the
>   EFI code with other architectures, but does not have a EFI stub in
>   Linux, and there is no way to test whether our changes break the boot
>   for it or not;
> - enable generic EFI for i386 as well
> - wire up the existing x86 code as a fallback for kernels that lack EFI
>   stub or LoadFile2 support. This removes the need for additional
>   changes to support v5.8 or older kernels.
>
> Cc: Daniel Kiper <daniel.kiper@oracle.com>
> Cc: Glenn Washburn <development@efficientek.com>
>
> Ard Biesheuvel (5):
>   efi: Make EFI PXE protocol methods non-callable
>   efi: Add calling convention annotation to all prototypes
>   efi: Drop all uses of efi_call_XX wrappers
>   efi: Remove x86_64 call wrappers
>   efi: Use generic EFI loader for x86_64 and i386

For all the patches Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>...

Thank you for working on this feature!

Daniel


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-05-23 15:31 ` [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers Ard Biesheuvel
@ 2023-06-12 17:19   ` Christian Hesse
  2023-06-12 19:05     ` Daniel Kiper
  0 siblings, 1 reply; 29+ messages in thread
From: Christian Hesse @ 2023-06-12 17:19 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: The development of GNU GRUB, Daniel Kiper, Glenn Washburn,
	Robin Candau

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

Ard Biesheuvel <ardb@kernel.org> on Tue, 2023/05/23 17:31:
> Now that GCC can generate function calls using the correct calling
> convention for us, we can stop using the efi_call_XX () wrappers, and
> just dereference the function pointers directly.
> 
> This avoids the untyped variadic wrapper routines, which means better
> type checking for the method calls.

Building an Arch package from current git master makes the system unbootable
with just a black screen. We did biscect this and found this commit
(bb4aa6e06ee3877110a1dc0eb0d766ffac978993 in master) to be the first bad one.

As gcc is mentioned in the commit message... We are building with gcc
13.1.1-1. Any idea what is going on here?
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-12 17:19   ` Christian Hesse
@ 2023-06-12 19:05     ` Daniel Kiper
  2023-06-12 20:53       ` Robin Candau
  0 siblings, 1 reply; 29+ messages in thread
From: Daniel Kiper @ 2023-06-12 19:05 UTC (permalink / raw)
  To: Christian Hesse
  Cc: Ard Biesheuvel, The development of GNU GRUB, Glenn Washburn,
	Robin Candau

On Mon, Jun 12, 2023 at 07:19:53PM +0200, Christian Hesse wrote:
> Ard Biesheuvel <ardb@kernel.org> on Tue, 2023/05/23 17:31:
> > Now that GCC can generate function calls using the correct calling
> > convention for us, we can stop using the efi_call_XX () wrappers, and
> > just dereference the function pointers directly.
> >
> > This avoids the untyped variadic wrapper routines, which means better
> > type checking for the method calls.
>
> Building an Arch package from current git master makes the system unbootable
> with just a black screen. We did biscect this and found this commit
> (bb4aa6e06ee3877110a1dc0eb0d766ffac978993 in master) to be the first bad one.
>
> As gcc is mentioned in the commit message... We are building with gcc
> 13.1.1-1. Any idea what is going on here?

Could you provide us more details? On which architecture/target do
you run tests? Does GRUB start? If yes which kernel version do you
try to boot? Could you send us a link to the GRUB and kernel packages
and sources? Etc...

Daniel


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-12 19:05     ` Daniel Kiper
@ 2023-06-12 20:53       ` Robin Candau
  2023-06-14 15:15         ` Daniel Kiper
  0 siblings, 1 reply; 29+ messages in thread
From: Robin Candau @ 2023-06-12 20:53 UTC (permalink / raw)
  To: Daniel Kiper, Christian Hesse
  Cc: Ard Biesheuvel, The development of GNU GRUB, Glenn Washburn


[-- Attachment #1.1.1: Type: text/plain, Size: 2248 bytes --]

Le 12/06/2023 à 21:05, Daniel Kiper a écrit :
> On Mon, Jun 12, 2023 at 07:19:53PM +0200, Christian Hesse wrote:
>> Ard Biesheuvel <ardb@kernel.org> on Tue, 2023/05/23 17:31:
>>> Now that GCC can generate function calls using the correct calling
>>> convention for us, we can stop using the efi_call_XX () wrappers, and
>>> just dereference the function pointers directly.
>>>
>>> This avoids the untyped variadic wrapper routines, which means better
>>> type checking for the method calls.
>> Building an Arch package from current git master makes the system unbootable
>> with just a black screen. We did biscect this and found this commit
>> (bb4aa6e06ee3877110a1dc0eb0d766ffac978993 in master) to be the first bad one.
>>
>> As gcc is mentioned in the commit message... We are building with gcc
>> 13.1.1-1. Any idea what is going on here?
> Could you provide us more details? On which architecture/target do
> you run tests? Does GRUB start? If yes which kernel version do you
> try to boot? Could you send us a link to the GRUB and kernel packages
> and sources? Etc...
>
> Daniel

Hi,

Tests have been ran on a x86_64 laptop (but the issue has been 
reproduced on several other x86_64 machines). GRUB does not start, we 
don't even reach the GRUB menu, nothing more than a black screen at boot.
The kernel we're trying to boot is `linux 6.3.7-arch1-1` [1] (package 
[2]), but I doubt the kernel itself is in cause as we're able to boot it 
with a GRUB package built without the 
bb4aa6e06ee3877110a1dc0eb0d766ffac978993 commit. Here's a working GRUB 
package [3] and a faulty one [4].
Sources are taken from https://git.savannah.gnu.org/git/grub.git [5].

I remain available if you need specific tests or additional information.

[1] https://archlinux.org/packages/core/x86_64/linux/
[2] 
http://www.gtlib.gatech.edu/pub/archlinux/core/os/x86_64/linux-6.3.7.arch1-1-x86_64.pkg.tar.zst
[3] 
https://pkgbuild.com/~eworm/grub/grub-2:2.06.r535.g6a080b9cd-2-x86_64.pkg.tar.zst
[4] 
https://pkgbuild.com/~eworm/grub/grub-2:2.06.r554.gc016a969d-2-x86_64.pkg.tar.zst
[5] 
https://gitlab.archlinux.org/archlinux/packaging/packages/grub/-/blob/main/PKGBUILD#L60

-- 
Regards,
Robin Candau / Antiz


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3203 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-12 20:53       ` Robin Candau
@ 2023-06-14 15:15         ` Daniel Kiper
  2023-06-15 15:01           ` Thomas Frauendorfer
  2023-06-15 15:05           ` Daniel Kiper
  0 siblings, 2 replies; 29+ messages in thread
From: Daniel Kiper @ 2023-06-14 15:15 UTC (permalink / raw)
  To: Robin Candau
  Cc: Christian Hesse, Ard Biesheuvel, The development of GNU GRUB,
	Glenn Washburn

On Mon, Jun 12, 2023 at 10:53:09PM +0200, Robin Candau wrote:
> Le 12/06/2023 à 21:05, Daniel Kiper a écrit :
> > On Mon, Jun 12, 2023 at 07:19:53PM +0200, Christian Hesse wrote:
> > > Ard Biesheuvel <ardb@kernel.org> on Tue, 2023/05/23 17:31:
> > > > Now that GCC can generate function calls using the correct calling
> > > > convention for us, we can stop using the efi_call_XX () wrappers, and
> > > > just dereference the function pointers directly.
> > > >
> > > > This avoids the untyped variadic wrapper routines, which means better
> > > > type checking for the method calls.
> > > Building an Arch package from current git master makes the system unbootable
> > > with just a black screen. We did biscect this and found this commit
> > > (bb4aa6e06ee3877110a1dc0eb0d766ffac978993 in master) to be the first bad one.
> > >
> > > As gcc is mentioned in the commit message... We are building with gcc
> > > 13.1.1-1. Any idea what is going on here?
> > Could you provide us more details? On which architecture/target do
> > you run tests? Does GRUB start? If yes which kernel version do you
> > try to boot? Could you send us a link to the GRUB and kernel packages
> > and sources? Etc...
> >
> > Daniel
>
> Hi,
>
> Tests have been ran on a x86_64 laptop (but the issue has been reproduced on
> several other x86_64 machines). GRUB does not start, we don't even reach the
> GRUB menu, nothing more than a black screen at boot.
> The kernel we're trying to boot is `linux 6.3.7-arch1-1` [1] (package [2]),
> but I doubt the kernel itself is in cause as we're able to boot it with a
> GRUB package built without the bb4aa6e06ee3877110a1dc0eb0d766ffac978993
> commit. Here's a working GRUB package [3] and a faulty one [4].
> Sources are taken from https://git.savannah.gnu.org/git/grub.git [5].
>
> I remain available if you need specific tests or additional information.
>
> [1] https://archlinux.org/packages/core/x86_64/linux/
> [2] http://www.gtlib.gatech.edu/pub/archlinux/core/os/x86_64/linux-6.3.7.arch1-1-x86_64.pkg.tar.zst
> [3] https://pkgbuild.com/~eworm/grub/grub-2:2.06.r535.g6a080b9cd-2-x86_64.pkg.tar.zst
> [4] https://pkgbuild.com/~eworm/grub/grub-2:2.06.r554.gc016a969d-2-x86_64.pkg.tar.zst
> [5] https://gitlab.archlinux.org/archlinux/packaging/packages/grub/-/blob/main/PKGBUILD#L60

It looks I was able to reproduce this problem. I will be checking what
is going on in following days...

Daniel


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-14 15:15         ` Daniel Kiper
@ 2023-06-15 15:01           ` Thomas Frauendorfer
  2023-06-15 15:05           ` Daniel Kiper
  1 sibling, 0 replies; 29+ messages in thread
From: Thomas Frauendorfer @ 2023-06-15 15:01 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, Jun 14, 2023 at 5:17 PM Daniel Kiper <daniel.kiper@oracle.com> wrote:
>
> On Mon, Jun 12, 2023 at 10:53:09PM +0200, Robin Candau wrote:
> > Le 12/06/2023 à 21:05, Daniel Kiper a écrit :
> > > On Mon, Jun 12, 2023 at 07:19:53PM +0200, Christian Hesse wrote:
> > > > Ard Biesheuvel <ardb@kernel.org> on Tue, 2023/05/23 17:31:
> > > > > Now that GCC can generate function calls using the correct calling
> > > > > convention for us, we can stop using the efi_call_XX () wrappers, and
> > > > > just dereference the function pointers directly.
> > > > >
> > > > > This avoids the untyped variadic wrapper routines, which means better
> > > > > type checking for the method calls.
> > > > Building an Arch package from current git master makes the system unbootable
> > > > with just a black screen. We did biscect this and found this commit
> > > > (bb4aa6e06ee3877110a1dc0eb0d766ffac978993 in master) to be the first bad one.
> > > >
> > > > As gcc is mentioned in the commit message... We are building with gcc
> > > > 13.1.1-1. Any idea what is going on here?
> > > Could you provide us more details? On which architecture/target do
> > > you run tests? Does GRUB start? If yes which kernel version do you
> > > try to boot? Could you send us a link to the GRUB and kernel packages
> > > and sources? Etc...
> > >
> > > Daniel
> >
> > Hi,
> >
> > Tests have been ran on a x86_64 laptop (but the issue has been reproduced on
> > several other x86_64 machines). GRUB does not start, we don't even reach the
> > GRUB menu, nothing more than a black screen at boot.
> > The kernel we're trying to boot is `linux 6.3.7-arch1-1` [1] (package [2]),
> > but I doubt the kernel itself is in cause as we're able to boot it with a
> > GRUB package built without the bb4aa6e06ee3877110a1dc0eb0d766ffac978993
> > commit. Here's a working GRUB package [3] and a faulty one [4].
> > Sources are taken from https://git.savannah.gnu.org/git/grub.git [5].
> >
> > I remain available if you need specific tests or additional information.
> >
> > [1] https://archlinux.org/packages/core/x86_64/linux/
> > [2] http://www.gtlib.gatech.edu/pub/archlinux/core/os/x86_64/linux-6.3.7.arch1-1-x86_64.pkg.tar.zst
> > [3] https://pkgbuild.com/~eworm/grub/grub-2:2.06.r535.g6a080b9cd-2-x86_64.pkg.tar.zst
> > [4] https://pkgbuild.com/~eworm/grub/grub-2:2.06.r554.gc016a969d-2-x86_64.pkg.tar.zst
> > [5] https://gitlab.archlinux.org/archlinux/packaging/packages/grub/-/blob/main/PKGBUILD#L60
>
> It looks I was able to reproduce this problem. I will be checking what
> is going on in following days...
>
> Daniel

After looking at the patch, I would assume that the __grub_efi_api
calling convention annotiation is missing in the protocol definitions
of

include/grub/efi/console_control.h
include/grub/efi/graphics_output.h
include/grub/efi/uga_draw.h

> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-14 15:15         ` Daniel Kiper
  2023-06-15 15:01           ` Thomas Frauendorfer
@ 2023-06-15 15:05           ` Daniel Kiper
  2023-06-15 21:36             ` Christian Hesse
  1 sibling, 1 reply; 29+ messages in thread
From: Daniel Kiper @ 2023-06-15 15:05 UTC (permalink / raw)
  To: Robin Candau
  Cc: Christian Hesse, Ard Biesheuvel, The development of GNU GRUB,
	Glenn Washburn

On Wed, Jun 14, 2023 at 05:15:43PM +0200, Daniel Kiper wrote:
> On Mon, Jun 12, 2023 at 10:53:09PM +0200, Robin Candau wrote:
> > Le 12/06/2023 à 21:05, Daniel Kiper a écrit :
> > > On Mon, Jun 12, 2023 at 07:19:53PM +0200, Christian Hesse wrote:
> > > > Ard Biesheuvel <ardb@kernel.org> on Tue, 2023/05/23 17:31:
> > > > > Now that GCC can generate function calls using the correct calling
> > > > > convention for us, we can stop using the efi_call_XX () wrappers, and
> > > > > just dereference the function pointers directly.
> > > > >
> > > > > This avoids the untyped variadic wrapper routines, which means better
> > > > > type checking for the method calls.
> > > > Building an Arch package from current git master makes the system unbootable
> > > > with just a black screen. We did biscect this and found this commit
> > > > (bb4aa6e06ee3877110a1dc0eb0d766ffac978993 in master) to be the first bad one.
> > > >
> > > > As gcc is mentioned in the commit message... We are building with gcc
> > > > 13.1.1-1. Any idea what is going on here?
> > > Could you provide us more details? On which architecture/target do
> > > you run tests? Does GRUB start? If yes which kernel version do you
> > > try to boot? Could you send us a link to the GRUB and kernel packages
> > > and sources? Etc...
> > >
> > > Daniel
> >
> > Hi,
> >
> > Tests have been ran on a x86_64 laptop (but the issue has been reproduced on
> > several other x86_64 machines). GRUB does not start, we don't even reach the
> > GRUB menu, nothing more than a black screen at boot.
> > The kernel we're trying to boot is `linux 6.3.7-arch1-1` [1] (package [2]),
> > but I doubt the kernel itself is in cause as we're able to boot it with a
> > GRUB package built without the bb4aa6e06ee3877110a1dc0eb0d766ffac978993
> > commit. Here's a working GRUB package [3] and a faulty one [4].
> > Sources are taken from https://git.savannah.gnu.org/git/grub.git [5].
> >
> > I remain available if you need specific tests or additional information.
> >
> > [1] https://archlinux.org/packages/core/x86_64/linux/
> > [2] http://www.gtlib.gatech.edu/pub/archlinux/core/os/x86_64/linux-6.3.7.arch1-1-x86_64.pkg.tar.zst
> > [3] https://pkgbuild.com/~eworm/grub/grub-2:2.06.r535.g6a080b9cd-2-x86_64.pkg.tar.zst
> > [4] https://pkgbuild.com/~eworm/grub/grub-2:2.06.r554.gc016a969d-2-x86_64.pkg.tar.zst
> > [5] https://gitlab.archlinux.org/archlinux/packaging/packages/grub/-/blob/main/PKGBUILD#L60
>
> It looks I was able to reproduce this problem. I will be checking what
> is going on in following days...

Here [1] is the fix. Please test...

Daniel

[1] https://lists.gnu.org/archive/html/grub-devel/2023-06/msg00092.html


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-15 15:05           ` Daniel Kiper
@ 2023-06-15 21:36             ` Christian Hesse
  2023-06-16  7:15               ` Robin Candau
  0 siblings, 1 reply; 29+ messages in thread
From: Christian Hesse @ 2023-06-15 21:36 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: Robin Candau, Ard Biesheuvel, The development of GNU GRUB,
	Glenn Washburn

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

Daniel Kiper <daniel.kiper@oracle.com> on Thu, 2023/06/15 17:05:
> > It looks I was able to reproduce this problem. I will be checking what
> > is going on in following days...  
> 
> Here [1] is the fix. Please test...

Works for me, thanks!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-15 21:36             ` Christian Hesse
@ 2023-06-16  7:15               ` Robin Candau
  2023-06-16 10:35                 ` Daniel Kiper
  0 siblings, 1 reply; 29+ messages in thread
From: Robin Candau @ 2023-06-16  7:15 UTC (permalink / raw)
  To: Christian Hesse, Daniel Kiper
  Cc: Ard Biesheuvel, The development of GNU GRUB, Glenn Washburn


[-- Attachment #1.1.1: Type: text/plain, Size: 372 bytes --]

Le 15/06/2023 à 23:36, Christian Hesse a écrit :
> Daniel Kiper <daniel.kiper@oracle.com> on Thu, 2023/06/15 17:05:
>>> It looks I was able to reproduce this problem. I will be checking what
>>> is going on in following days...
>> Here [1] is the fix. Please test...
> Works for me, thanks!
Works for me as well, thanks!

-- 
Regards,
Robin Candau / Antiz


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3203 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-16  7:15               ` Robin Candau
@ 2023-06-16 10:35                 ` Daniel Kiper
  2023-06-16 10:48                   ` Robin Candau
  0 siblings, 1 reply; 29+ messages in thread
From: Daniel Kiper @ 2023-06-16 10:35 UTC (permalink / raw)
  To: Robin Candau
  Cc: Christian Hesse, Ard Biesheuvel, The development of GNU GRUB,
	Glenn Washburn

On Fri, Jun 16, 2023 at 09:15:19AM +0200, Robin Candau wrote:
> Le 15/06/2023 à 23:36, Christian Hesse a écrit :
> > Daniel Kiper <daniel.kiper@oracle.com> on Thu, 2023/06/15 17:05:
> > > > It looks I was able to reproduce this problem. I will be checking what
> > > > is going on in following days...
> > > Here [1] is the fix. Please test...
> > Works for me, thanks!
> Works for me as well, thanks!

Cool! Thanks for doing tests!

Christian, Robin, may I add Tested-by tag on your behalf to the patch?

Daniel


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-16 10:35                 ` Daniel Kiper
@ 2023-06-16 10:48                   ` Robin Candau
  2023-06-16 12:24                     ` Christian Hesse
  0 siblings, 1 reply; 29+ messages in thread
From: Robin Candau @ 2023-06-16 10:48 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: Christian Hesse, Ard Biesheuvel, The development of GNU GRUB,
	Glenn Washburn


[-- Attachment #1.1.1: Type: text/plain, Size: 659 bytes --]

Le 16/06/2023 à 12:35, Daniel Kiper a écrit :
> On Fri, Jun 16, 2023 at 09:15:19AM +0200, Robin Candau wrote:
>> Le 15/06/2023 à 23:36, Christian Hesse a écrit :
>>> Daniel Kiper <daniel.kiper@oracle.com> on Thu, 2023/06/15 17:05:
>>>>> It looks I was able to reproduce this problem. I will be checking what
>>>>> is going on in following days...
>>>> Here [1] is the fix. Please test...
>>> Works for me, thanks!
>> Works for me as well, thanks!
> Cool! Thanks for doing tests!
>
> Christian, Robin, may I add Tested-by tag on your behalf to the patch?
>
> Daniel

Fine by me ;)

Thanks again

-- 
Regards,
Robin Candau / Antiz


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3203 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-16 10:48                   ` Robin Candau
@ 2023-06-16 12:24                     ` Christian Hesse
  2023-06-16 14:11                       ` Daniel Kiper
  0 siblings, 1 reply; 29+ messages in thread
From: Christian Hesse @ 2023-06-16 12:24 UTC (permalink / raw)
  To: Robin Candau
  Cc: Daniel Kiper, Ard Biesheuvel, The development of GNU GRUB,
	Glenn Washburn

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

Robin Candau <antiz@archlinux.org> on Fri, 2023/06/16 12:48:
> Le 16/06/2023 à 12:35, Daniel Kiper a écrit :
> > On Fri, Jun 16, 2023 at 09:15:19AM +0200, Robin Candau wrote:  
> >> Le 15/06/2023 à 23:36, Christian Hesse a écrit :  
> >>> Daniel Kiper <daniel.kiper@oracle.com> on Thu, 2023/06/15 17:05:  
> >>>>> It looks I was able to reproduce this problem. I will be checking what
> >>>>> is going on in following days...  
> >>>> Here [1] is the fix. Please test...  
> >>> Works for me, thanks!  
> >> Works for me as well, thanks!  
> > Cool! Thanks for doing tests!
> >
> > Christian, Robin, may I add Tested-by tag on your behalf to the patch?
>
> Fine by me ;)

Sure, same for me! :)

Thanks a lot!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers
  2023-06-16 12:24                     ` Christian Hesse
@ 2023-06-16 14:11                       ` Daniel Kiper
  0 siblings, 0 replies; 29+ messages in thread
From: Daniel Kiper @ 2023-06-16 14:11 UTC (permalink / raw)
  To: Christian Hesse
  Cc: Robin Candau, Ard Biesheuvel, The development of GNU GRUB,
	Glenn Washburn

On Fri, Jun 16, 2023 at 02:24:51PM +0200, Christian Hesse wrote:
> Robin Candau <antiz@archlinux.org> on Fri, 2023/06/16 12:48:
> > Le 16/06/2023 à 12:35, Daniel Kiper a écrit :
> > > On Fri, Jun 16, 2023 at 09:15:19AM +0200, Robin Candau wrote:
> > >> Le 15/06/2023 à 23:36, Christian Hesse a écrit :
> > >>> Daniel Kiper <daniel.kiper@oracle.com> on Thu, 2023/06/15 17:05:
> > >>>>> It looks I was able to reproduce this problem. I will be checking what
> > >>>>> is going on in following days...
> > >>>> Here [1] is the fix. Please test...
> > >>> Works for me, thanks!
> > >> Works for me as well, thanks!
> > > Cool! Thanks for doing tests!
> > >
> > > Christian, Robin, may I add Tested-by tag on your behalf to the patch?
> >
> > Fine by me ;)
>
> Sure, same for me! :)

Great! Thanks a lot!

Daniel


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2023-05-23 15:31 ` [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386 Ard Biesheuvel
  2023-05-23 15:34   ` Ard Biesheuvel
@ 2024-05-16 12:24   ` Jan Čermák
  2024-05-16 13:42     ` Ard Biesheuvel
  1 sibling, 1 reply; 29+ messages in thread
From: Jan Čermák @ 2024-05-16 12:24 UTC (permalink / raw)
  To: Ard Biesheuvel, grub-devel; +Cc: Daniel Kiper, Glenn Washburn, Stefan Agner

Hi Ard, everyone,

On 23. 05. 23 17:31, Ard Biesheuvel wrote:
 > Switch the x86 based EFI platform builds to the generic EFI loader,
 > ...

We use GRUB as the loader for the Home Assistant Operating System (based 
on Buildroot, using mostly unpatched GRUB 2 build [1]) and after 
updating to the latest 2.12 release, this patch (commit 
cfbfae1aef0694b416aa199291cfef7596cdfc20) has been identified to break 
boot on Intel Atom NM10, at least with upstream kernel 6.6 with 
CONFIG_EFI_STUB enabled. I reproduced it on Intel D525MW board, and 
there are some more reports from HAOS users on Github [2].

Initially, we decided to revert the patch [3] for the time being, 
however, while it fixed issue for users running on those rather old 
boards, it broke boot [4] on the comparatively newer Fujitsu Esprimo 
Q920. From the user reports, there is no BIOS update available that will 
make any difference but reverting to a "vanilla" 2.12 fixes that.

Do you have a clue what could have gone wrong, either with the original 
patch, or why the revert breaks the other platform? I'll be happy to get 
any details and perform tests on the NM10 board I have here. 
Alternatively, I can also ask users with the Q920 for more details or do 
some tests.

Regards,
Jan

[1] 
https://github.com/home-assistant/buildroot/tree/2024.02.x-haos/boot/grub2
[2] https://github.com/home-assistant/operating-system/issues/3305
[3] https://github.com/home-assistant/operating-system/pull/3324
[4] https://github.com/home-assistant/operating-system/issues/3348

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-05-16 12:24   ` [REGRESSION] " Jan Čermák
@ 2024-05-16 13:42     ` Ard Biesheuvel
  2024-06-27 10:26       ` Jan Čermák
  0 siblings, 1 reply; 29+ messages in thread
From: Ard Biesheuvel @ 2024-05-16 13:42 UTC (permalink / raw)
  To: Jan Čermák
  Cc: grub-devel, Daniel Kiper, Glenn Washburn, Stefan Agner

On Thu, 16 May 2024 at 14:24, Jan Čermák <sairon@sairon.cz> wrote:
>
> Hi Ard, everyone,
>
> On 23. 05. 23 17:31, Ard Biesheuvel wrote:
>  > Switch the x86 based EFI platform builds to the generic EFI loader,
>  > ...
>
> We use GRUB as the loader for the Home Assistant Operating System (based
> on Buildroot, using mostly unpatched GRUB 2 build [1]) and after
> updating to the latest 2.12 release, this patch (commit
> cfbfae1aef0694b416aa199291cfef7596cdfc20) has been identified to break
> boot on Intel Atom NM10, at least with upstream kernel 6.6 with
> CONFIG_EFI_STUB enabled. I reproduced it on Intel D525MW board, and
> there are some more reports from HAOS users on Github [2].
>
> Initially, we decided to revert the patch [3] for the time being,
> however, while it fixed issue for users running on those rather old
> boards, it broke boot [4] on the comparatively newer Fujitsu Esprimo
> Q920. From the user reports, there is no BIOS update available that will
> make any difference but reverting to a "vanilla" 2.12 fixes that.
>
> Do you have a clue what could have gone wrong, either with the original
> patch, or why the revert breaks the other platform? I'll be happy to get
> any details and perform tests on the NM10 board I have here.
> Alternatively, I can also ask users with the Q920 for more details or do
> some tests.
>

Upstream GRUB 2.06 does not boot Linux via the EFI stub, it uses the
legacy EFI boot method where the Linux kernel is only entered after
the EFI firmware has been shut down.

GRUB 2.12 changed this, and will know always use the pure EFI boot
sequence, relying on the EFI stub in the Linux kernel to shut down the
firmware services.

Does your Kconfig have EFI_DISABLE_PCI_DMA enabled by any chance? That
could definitely produce the issues you are observing.

In any case, given that you never relied on the EFI stub in the past
on x86_64 (as GRUB 2.06 does not rely on it), you could just disable
that in your Kconfig.

That of course does not solve the Fujitsu issue, which apparently
requires boot via the EFI stub, but I don't have a solution for that -
I suppose that simply never worked with the old 'working' version of
the OS?

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-05-16 13:42     ` Ard Biesheuvel
@ 2024-06-27 10:26       ` Jan Čermák
  2024-06-27 10:39         ` Mate Kukri
  2024-06-28 17:28         ` Ard Biesheuvel
  0 siblings, 2 replies; 29+ messages in thread
From: Jan Čermák @ 2024-06-27 10:26 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: grub-devel, Daniel Kiper, Glenn Washburn, Stefan Agner

Hi Ard,

sorry, I feel a little ashamed for replying after such a long time but I 
wanted to do some due diligence first and didn't have time (or the Atom 
board around) until now.

> Does your Kconfig have EFI_DISABLE_PCI_DMA enabled by any chance? That
> could definitely produce the issues you are observing.

No, this option is not set in our kernel.

> In any case, given that you never relied on the EFI stub in the past
> on x86_64 (as GRUB 2.06 does not rely on it), you could just disable
> that in your Kconfig.
> 
> That of course does not solve the Fujitsu issue, which apparently
> requires boot via the EFI stub, but I don't have a solution for that -
> I suppose that simply never worked with the old 'working' version of
> the OS?

The goal is to have a single configuration that works for both (or 
ideally - all amd64) targets so disabling EFI stub is not an option. 
With no changes in the kernel in the meantime, just GRUB 2.06 loaded 
kernel without issues on both devices.

Anyway, what held me up a bit is that I wanted to try any of the major 
distributions that already adopter GRUB 2.12. I tested Ubuntu 24.04 and 
Arch's build of GRUB. While Arch's GRUB behaves exactly the same way 
(error loading image) I was a bit puzzled that it's not the case of 
Ubuntu. It took me a while to figure out why because there are quite 
many patches applied but in the end it boiled up to the following two 
from the grub package repo [1]:

- loader-framework.patch
- efi-use-peimage-shim.patch

Vanilla GRUB with these two patches AND with the introduced `peimage` 
module added to the GRUB binary boots our kernel correctly.

At this point I don't have the knowledge to figure out if it's just side 
effect of that changes or if they indeed make any difference. And I'm 
not sure what effect it has on the Fujitsu board but I can't find any 
mentions of it in Ubuntu's issue tracker or anywhere on the internet so 
I *guess* it's fine.

I don't know what else to try at this point. If you'd like to look into 
the issue yourself, I can give you the board I have, in the end it has 
no other use for me than making sure that our OS boots correctly there, 
and if the issue gets resolved, it will be just gathering dust. Let me 
know if you're interested - if you give me an EU address to ship to, I 
can arrange that. Outside the EU I'm afraid the shipping costs and 
duties would be higher than the cost of the hardware itself :)

Thanks,
Jan

[1] 
https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/patches/secure-boot

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-06-27 10:26       ` Jan Čermák
@ 2024-06-27 10:39         ` Mate Kukri
  2024-06-28 17:28         ` Ard Biesheuvel
  1 sibling, 0 replies; 29+ messages in thread
From: Mate Kukri @ 2024-06-27 10:39 UTC (permalink / raw)
  To: The development of GNU GRUB

This is likely an issue stemming from a bad interaction between the
firmware's PE loader and the kernel's efi stub.

The reason peimage can appear to fix this as it bypasses the
firmware's PE loader for secure boot reasons.

Hiding bugs in said PE loader is a coincidental side benefit and not
an intentional fix.

On Thu, Jun 27, 2024 at 11:27 AM Jan Čermák <sairon@sairon.cz> wrote:
>
> Hi Ard,
>
> sorry, I feel a little ashamed for replying after such a long time but I
> wanted to do some due diligence first and didn't have time (or the Atom
> board around) until now.
>
> > Does your Kconfig have EFI_DISABLE_PCI_DMA enabled by any chance? That
> > could definitely produce the issues you are observing.
>
> No, this option is not set in our kernel.
>
> > In any case, given that you never relied on the EFI stub in the past
> > on x86_64 (as GRUB 2.06 does not rely on it), you could just disable
> > that in your Kconfig.
> >
> > That of course does not solve the Fujitsu issue, which apparently
> > requires boot via the EFI stub, but I don't have a solution for that -
> > I suppose that simply never worked with the old 'working' version of
> > the OS?
>
> The goal is to have a single configuration that works for both (or
> ideally - all amd64) targets so disabling EFI stub is not an option.
> With no changes in the kernel in the meantime, just GRUB 2.06 loaded
> kernel without issues on both devices.
>
> Anyway, what held me up a bit is that I wanted to try any of the major
> distributions that already adopter GRUB 2.12. I tested Ubuntu 24.04 and
> Arch's build of GRUB. While Arch's GRUB behaves exactly the same way
> (error loading image) I was a bit puzzled that it's not the case of
> Ubuntu. It took me a while to figure out why because there are quite
> many patches applied but in the end it boiled up to the following two
> from the grub package repo [1]:
>
> - loader-framework.patch
> - efi-use-peimage-shim.patch
>
> Vanilla GRUB with these two patches AND with the introduced `peimage`
> module added to the GRUB binary boots our kernel correctly.
>
> At this point I don't have the knowledge to figure out if it's just side
> effect of that changes or if they indeed make any difference. And I'm
> not sure what effect it has on the Fujitsu board but I can't find any
> mentions of it in Ubuntu's issue tracker or anywhere on the internet so
> I *guess* it's fine.
>
> I don't know what else to try at this point. If you'd like to look into
> the issue yourself, I can give you the board I have, in the end it has
> no other use for me than making sure that our OS boots correctly there,
> and if the issue gets resolved, it will be just gathering dust. Let me
> know if you're interested - if you give me an EU address to ship to, I
> can arrange that. Outside the EU I'm afraid the shipping costs and
> duties would be higher than the cost of the hardware itself :)
>
> Thanks,
> Jan
>
> [1]
> https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu/tree/debian/patches/secure-boot
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-06-27 10:26       ` Jan Čermák
  2024-06-27 10:39         ` Mate Kukri
@ 2024-06-28 17:28         ` Ard Biesheuvel
  2024-07-03 14:25           ` Jan Čermák
  1 sibling, 1 reply; 29+ messages in thread
From: Ard Biesheuvel @ 2024-06-28 17:28 UTC (permalink / raw)
  To: Jan Čermák
  Cc: grub-devel, Daniel Kiper, Glenn Washburn, Stefan Agner

On Thu, 27 Jun 2024 at 12:27, Jan Čermák <sairon@sairon.cz> wrote:
>
> Hi Ard,
>
> sorry, I feel a little ashamed for replying after such a long time but I
> wanted to do some due diligence first and didn't have time (or the Atom
> board around) until now.
>
> > Does your Kconfig have EFI_DISABLE_PCI_DMA enabled by any chance? That
> > could definitely produce the issues you are observing.
>
> No, this option is not set in our kernel.
>
> > In any case, given that you never relied on the EFI stub in the past
> > on x86_64 (as GRUB 2.06 does not rely on it), you could just disable
> > that in your Kconfig.
> >
> > That of course does not solve the Fujitsu issue, which apparently
> > requires boot via the EFI stub, but I don't have a solution for that -
> > I suppose that simply never worked with the old 'working' version of
> > the OS?
>
> The goal is to have a single configuration that works for both (or
> ideally - all amd64) targets so disabling EFI stub is not an option.
> With no changes in the kernel in the meantime, just GRUB 2.06 loaded
> kernel without issues on both devices.
>
> Anyway, what held me up a bit is that I wanted to try any of the major
> distributions that already adopter GRUB 2.12. I tested Ubuntu 24.04 and
> Arch's build of GRUB. While Arch's GRUB behaves exactly the same way
> (error loading image) I was a bit puzzled that it's not the case of
> Ubuntu. It took me a while to figure out why because there are quite
> many patches applied but in the end it boiled up to the following two
> from the grub package repo [1]:
>
> - loader-framework.patch
> - efi-use-peimage-shim.patch
>
> Vanilla GRUB with these two patches AND with the introduced `peimage`
> module added to the GRUB binary boots our kernel correctly.
>
> At this point I don't have the knowledge to figure out if it's just side
> effect of that changes or if they indeed make any difference. And I'm
> not sure what effect it has on the Fujitsu board but I can't find any
> mentions of it in Ubuntu's issue tracker or anywhere on the internet so
> I *guess* it's fine.
>
> I don't know what else to try at this point. If you'd like to look into
> the issue yourself, I can give you the board I have, in the end it has
> no other use for me than making sure that our OS boots correctly there,
> and if the issue gets resolved, it will be just gathering dust. Let me
> know if you're interested - if you give me an EU address to ship to, I
> can arrange that. Outside the EU I'm afraid the shipping costs and
> duties would be higher than the cost of the hardware itself :)
>

Hello Jan,

I appreciate the gesture but please don't send me stuff.

Given that you carry your own GRUB build, I would recommend reverting
to non-EFI stub boot for affected Atom systems, identified by DMI
data, which should be easy to access on such systems.

Look for 'goto fallback' in the existing loader logic in
grub-core/loader/efi/linux.c - you'd need to jump to the same point to
use the GRUB 2.06 logic for systems that fail that cannot load the EFI
stub kernel image.

Out of curiosity - these are all x86_64 Atoms right? How old are they?

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-06-28 17:28         ` Ard Biesheuvel
@ 2024-07-03 14:25           ` Jan Čermák
  2024-07-03 14:47             ` Ard Biesheuvel
  0 siblings, 1 reply; 29+ messages in thread
From: Jan Čermák @ 2024-07-03 14:25 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: grub-devel, Daniel Kiper, Glenn Washburn, Stefan Agner

Hi Ard

On 28. 06. 24 19:28, Ard Biesheuvel wrote:
> Given that you carry your own GRUB build, I would recommend reverting
> to non-EFI stub boot for affected Atom systems, identified by DMI
> data, which should be easy to access on such systems.
> 
> Look for 'goto fallback' in the existing loader logic in
> grub-core/loader/efi/linux.c - you'd need to jump to the same point to
> use the GRUB 2.06 logic for systems that fail that cannot load the EFI
> stub kernel image.

Thanks for the suggestion, that sounds like a more acceptable solution 
(than the revert). However, would a quirk like that be acceptable in 
upstream code as well? In long term, we'd like to only support hardware 
that is supported in upstream, instead of taking the maintenance burden 
of carrying custom patches indefinitely, so if it is GRUB's maintainers' 
decision to abandon support for old buggy hardware, we shall declare it 
abandoned as well.

> Out of curiosity - these are all x86_64 Atoms right? How old are they?

Yes, they are, e.g. Atom D525 [1], but from the reports we've received 
it seems the problem is with the NM10 chipset [2] in general (as I 
stated in the first message in the thread). They are ~14 years old so 
pretty archaic I'd say O:-)

Regards,
Jan

[1] 
https://ark.intel.com/content/www/us/en/ark/products/49490/intel-atom-processor-d525-1m-cache-1-80-ghz.html
[2] 
https://www.intel.com/content/www/us/en/products/sku/47610/intel-nm10-express-chipset/specifications.html

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-07-03 14:25           ` Jan Čermák
@ 2024-07-03 14:47             ` Ard Biesheuvel
  2024-07-03 17:35               ` Jan Čermák
  0 siblings, 1 reply; 29+ messages in thread
From: Ard Biesheuvel @ 2024-07-03 14:47 UTC (permalink / raw)
  To: Jan Čermák
  Cc: grub-devel, Daniel Kiper, Glenn Washburn, Stefan Agner

On Wed, 3 Jul 2024 at 16:25, Jan Čermák <sairon@sairon.cz> wrote:
>
> Hi Ard
>
> On 28. 06. 24 19:28, Ard Biesheuvel wrote:
> > Given that you carry your own GRUB build, I would recommend reverting
> > to non-EFI stub boot for affected Atom systems, identified by DMI
> > data, which should be easy to access on such systems.
> >
> > Look for 'goto fallback' in the existing loader logic in
> > grub-core/loader/efi/linux.c - you'd need to jump to the same point to
> > use the GRUB 2.06 logic for systems that fail that cannot load the EFI
> > stub kernel image.
>
> Thanks for the suggestion, that sounds like a more acceptable solution
> (than the revert). However, would a quirk like that be acceptable in
> upstream code as well? In long term, we'd like to only support hardware
> that is supported in upstream, instead of taking the maintenance burden
> of carrying custom patches indefinitely, so if it is GRUB's maintainers'
> decision to abandon support for old buggy hardware, we shall declare it
> abandoned as well.
>

If GRUB no longer works correctly on these systems due to the move to
the generic EFI loader, and we can straight-forwardly identify them
using SMBIOS metadata, I don't anticipate any objections from the GRUB
maintainers.

@Daniel?

> > Out of curiosity - these are all x86_64 Atoms right? How old are they?
>
> Yes, they are, e.g. Atom D525 [1], but from the reports we've received
> it seems the problem is with the NM10 chipset [2] in general (as I
> stated in the first message in the thread). They are ~14 years old so
> pretty archaic I'd say O:-)
>

If you can get me the output of 'dmidecode' from preferably more than
one variant of such a system, I can hack up a GRUB patch that
implements the SMBIOS matching and the opt-out.

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-07-03 14:47             ` Ard Biesheuvel
@ 2024-07-03 17:35               ` Jan Čermák
  2024-07-22 10:43                 ` Jan Čermák
  0 siblings, 1 reply; 29+ messages in thread
From: Jan Čermák @ 2024-07-03 17:35 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: grub-devel, Daniel Kiper, Glenn Washburn, Stefan Agner

On 03. 07. 24 16:47, Ard Biesheuvel wrote:
> 
> If GRUB no longer works correctly on these systems due to the move to
> the generic EFI loader, and we can straight-forwardly identify them
> using SMBIOS metadata, I don't anticipate any objections from the GRUB
> maintainers.
> 

Cool, that sounds great!

> If you can get me the output of 'dmidecode' from preferably more than
> one variant of such a system, I can hack up a GRUB patch that
> implements the SMBIOS matching and the opt-out.

Sure, below is output from the board I have available. I'll ask the 
community members who reported the issues to get me output from their 
systems.

Regards,
Jan

------

# dmidecode 3.5
Getting SMBIOS data from sysfs.
SMBIOS 2.5 present.
27 structures occupying 1318 bytes.
Table at 0x7EE97000.

Handle 0x0000, DMI type 4, 35 bytes
Processor Information
	Socket Designation: CPU 1
	Type: Central Processor
	Family: Atom
	Manufacturer: Intel(R) Corporation
	ID: CA 06 01 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 28, Stepping 10
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		DS (Debug store)
		ACPI (ACPI supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		SS (Self-snoop)
		HTT (Multi-threading)
		TM (Thermal monitor supported)
		PBE (Pending break enabled)
	Version: Intel(R) Atom(TM) CPU D525   @ 1.80GHz
	Voltage: 1.1 V
	External Clock: 200 MHz
	Max Speed: 4000 MHz
	Current Speed: 1802 MHz
	Status: Populated, Enabled
	Upgrade: Socket LGA775
	L1 Cache Handle: 0x0003
	L2 Cache Handle: 0x0001
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified

Handle 0x0001, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 512 kB
	Maximum Size: 512 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 8-way Set-associative

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 32 kB
	Maximum Size: 32 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Instruction
	Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 24 kB
	Maximum Size: 24 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 32-way Set-associative

Handle 0x0004, DMI type 0, 24 bytes
BIOS Information
	Vendor: Intel Corp.
	Version: MWPNT10N.86A.0132.2013.0726.1534
	Release Date: 07/26/2013
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 1 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		ATAPI Zip drive boot is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
	BIOS Revision: 0.0
	Firmware Revision: 0.0

Handle 0x0005, DMI type 1, 27 bytes
System Information
	Manufacturer:
	Product Name:
	Version:
	Serial Number:
	UUID: 8a30aaa0-7d3f-11e1-948a-e840f20bacce
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified

Handle 0x0006, DMI type 2, 20 bytes
Base Board Information
	Manufacturer: Intel Corporation
	Product Name: D525MW
	Version: AAE93082-401
	Serial Number: BTMW2140007L
	Asset Tag: Base Board Asset Tag
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Base Board Chassis Location
	Chassis Handle: 0x0007
	Type: Unknown
	Contained Object Handles: 0

Handle 0x0007, DMI type 3, 17 bytes
Chassis Information
	Manufacturer:
	Type: Unknown
	Lock: Not Present
	Version:
	Serial Number:
	Asset Tag:
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Other
	Security Status: Other
	OEM Information: 0x00000000

Handle 0x0008, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: PRIMARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x0009, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: SECONDARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: ATX_PWR
	Internal Connector Type: Other
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000B, DMI type 9, 13 bytes
System Slot Information
	Designation: PCIE X1 SLOT 1
	Type: x1 PCI Express
	Current Usage: Available
	Length: Short
	ID: 1
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported

Handle 0x000C, DMI type 9, 13 bytes
System Slot Information
	Designation: PCI SLOT 1
	Type: 32-bit PCI
	Current Usage: Available
	Length: Long
	ID: 7
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported

Handle 0x000D, DMI type 10, 6 bytes
On Board Device Information
	Type: Video
	Status: Enabled
	Description: Intel(R) GMA 3150 Video Device

Handle 0x000E, DMI type 10, 6 bytes
On Board Device Information
	Type: Ethernet
	Status: Enabled
	Description: Realtek RTL8111DL Ethernet Device

Handle 0x000F, DMI type 10, 6 bytes
On Board Device Information
	Type: Sound
	Status: Enabled
	Description: Intel(R) High Definition Audio Device

Handle 0x0010, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Abbreviated
	Installable Languages: 1
		enUS
	Currently Installed Language: enUS

Handle 0x0011, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x0012, DMI type 16, 15 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 2

Handle 0x0013, DMI type 17, 27 bytes
Memory Device
	Array Handle: 0x0012
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 1 GB
	Form Factor: DIMM
	Set: None
	Locator: J1MY
	Bank Locator: CHAN A DIMM 0
	Type: DDR3
	Type Detail: Synchronous
	Speed: 800 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000

Handle 0x0014, DMI type 20, 19 bytes
Memory Device Mapped Address
	Starting Address: 0x00040000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 1 GB
	Physical Device Handle: 0x0013
	Memory Array Mapped Address Handle: 0x0017
	Partition Row Position: 1

Handle 0x0015, DMI type 17, 27 bytes
Memory Device
	Array Handle: 0x0012
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 1 GB
	Form Factor: DIMM
	Set: None
	Locator: J2MY
	Bank Locator: CHAN A DIMM 1
	Type: DDR3
	Type Detail: Synchronous
	Speed: 800 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000

Handle 0x0016, DMI type 20, 19 bytes
Memory Device Mapped Address
	Starting Address: 0x00040000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 1 GB
	Physical Device Handle: 0x0015
	Memory Array Mapped Address Handle: 0x0017
	Partition Row Position: 1

Handle 0x0017, DMI type 19, 15 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Array Handle: 0x0012
	Partition Width: 2

Handle 0x0018, DMI type 187, 9 bytes
OEM-specific Type
	Header and Data:
		BB 09 18 00 13 00 FF 35 05

Handle 0x0019, DMI type 187, 9 bytes
OEM-specific Type
	Header and Data:
		BB 09 19 00 15 00 FF 35 05

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [REGRESSION] Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
  2024-07-03 17:35               ` Jan Čermák
@ 2024-07-22 10:43                 ` Jan Čermák
  0 siblings, 0 replies; 29+ messages in thread
From: Jan Čermák @ 2024-07-22 10:43 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: grub-devel, Daniel Kiper, Glenn Washburn, Stefan Agner

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

Hi Ard, everyone,

On 03. 07. 24 19:35, Jan Čermák wrote:
> Sure, below is output from the board I have available. I'll ask the 
> community members who reported the issues to get me output from their 
> systems.

in the attachments I'm sending all complete dmidecode outputs I was able 
to gather so far from systems affected by the bug, namely Intel Atom 
D2500, D2700, N2800 and D525 (the last one was already a part of my 
previous message).

If there's anything more needed, please let me know. Also, if you want 
to test that the patch resolves the issues reported before submitting it 
for review, I'm available for testing, just let me know here or privately.

Thanks,
Jan

[-- Attachment #2: dmidecode-d525.txt --]
[-- Type: text/plain, Size: 8771 bytes --]

# dmidecode 3.5
Getting SMBIOS data from sysfs.
SMBIOS 2.5 present.
27 structures occupying 1318 bytes.
Table at 0x7EE97000.

Handle 0x0000, DMI type 4, 35 bytes
Processor Information
	Socket Designation: CPU 1
	Type: Central Processor
	Family: Atom
	Manufacturer: Intel(R) Corporation
	ID: CA 06 01 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 28, Stepping 10
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		DS (Debug store)
		ACPI (ACPI supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		SS (Self-snoop)
		HTT (Multi-threading)
		TM (Thermal monitor supported)
		PBE (Pending break enabled)
	Version: Intel(R) Atom(TM) CPU D525   @ 1.80GHz
	Voltage: 1.1 V
	External Clock: 200 MHz
	Max Speed: 4000 MHz
	Current Speed: 1801 MHz
	Status: Populated, Enabled
	Upgrade: Socket LGA775
	L1 Cache Handle: 0x0003
	L2 Cache Handle: 0x0001
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified

Handle 0x0001, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 512 kB
	Maximum Size: 512 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 8-way Set-associative

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 32 kB
	Maximum Size: 32 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Instruction
	Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 24 kB
	Maximum Size: 24 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 32-way Set-associative

Handle 0x0004, DMI type 0, 24 bytes
BIOS Information
	Vendor: Intel Corp.
	Version: MWPNT10N.86A.0132.2013.0726.1534
	Release Date: 07/26/2013
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 1 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		ATAPI Zip drive boot is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
	BIOS Revision: 0.0
	Firmware Revision: 0.0

Handle 0x0005, DMI type 1, 27 bytes
System Information
	Manufacturer:                                 
	Product Name:                                 
	Version:                         
	Serial Number:                                 
	UUID: 8a30aaa0-7d3f-11e1-948a-e840f20bacce
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified

Handle 0x0006, DMI type 2, 20 bytes
Base Board Information
	Manufacturer: Intel Corporation
	Product Name: D525MW
	Version: AAE93082-401
	Serial Number: BTMW2140007L
	Asset Tag: Base Board Asset Tag
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Base Board Chassis Location
	Chassis Handle: 0x0007
	Type: Unknown
	Contained Object Handles: 0

Handle 0x0007, DMI type 3, 17 bytes
Chassis Information
	Manufacturer:                                 
	Type: Unknown
	Lock: Not Present
	Version:                         
	Serial Number:                                 
	Asset Tag:                                 
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Other
	Security Status: Other
	OEM Information: 0x00000000

Handle 0x0008, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: PRIMARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x0009, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: SECONDARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: ATX_PWR
	Internal Connector Type: Other
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000B, DMI type 9, 13 bytes
System Slot Information
	Designation: PCIE X1 SLOT 1
	Type: x1 PCI Express
	Current Usage: Available
	Length: Short
	ID: 1
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported

Handle 0x000C, DMI type 9, 13 bytes
System Slot Information
	Designation: PCI SLOT 1
	Type: 32-bit PCI
	Current Usage: Available
	Length: Long
	ID: 7
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported

Handle 0x000D, DMI type 10, 6 bytes
On Board Device Information
	Type: Video
	Status: Enabled
	Description: Intel(R) GMA 3150 Video Device

Handle 0x000E, DMI type 10, 6 bytes
On Board Device Information
	Type: Ethernet
	Status: Enabled
	Description: Realtek RTL8111DL Ethernet Device

Handle 0x000F, DMI type 10, 6 bytes
On Board Device Information
	Type: Sound
	Status: Enabled
	Description: Intel(R) High Definition Audio Device

Handle 0x0010, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Abbreviated
	Installable Languages: 1
		enUS
	Currently Installed Language: enUS

Handle 0x0011, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x0012, DMI type 16, 15 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 2

Handle 0x0013, DMI type 17, 27 bytes
Memory Device
	Array Handle: 0x0012
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 1 GB
	Form Factor: DIMM
	Set: None
	Locator: J1MY
	Bank Locator: CHAN A DIMM 0
	Type: DDR3
	Type Detail: Synchronous
	Speed: 800 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000

Handle 0x0014, DMI type 20, 19 bytes
Memory Device Mapped Address
	Starting Address: 0x00040000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 1 GB
	Physical Device Handle: 0x0013
	Memory Array Mapped Address Handle: 0x0017
	Partition Row Position: 1

Handle 0x0015, DMI type 17, 27 bytes
Memory Device
	Array Handle: 0x0012
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 1 GB
	Form Factor: DIMM
	Set: None
	Locator: J2MY
	Bank Locator: CHAN A DIMM 1
	Type: DDR3
	Type Detail: Synchronous
	Speed: 800 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000

Handle 0x0016, DMI type 20, 19 bytes
Memory Device Mapped Address
	Starting Address: 0x00040000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 1 GB
	Physical Device Handle: 0x0015
	Memory Array Mapped Address Handle: 0x0017
	Partition Row Position: 1

Handle 0x0017, DMI type 19, 15 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x0007FFFFFFF
	Range Size: 2 GB
	Physical Array Handle: 0x0012
	Partition Width: 2

Handle 0x0018, DMI type 187, 9 bytes
OEM-specific Type
	Header and Data:
		BB 09 18 00 13 00 FF 35 05

Handle 0x0019, DMI type 187, 9 bytes
OEM-specific Type
	Header and Data:
		BB 09 19 00 15 00 FF 35 05

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table


[-- Attachment #3: dmidecode-d2700.txt --]
[-- Type: text/plain, Size: 8619 bytes --]

# dmidecode 3.5
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
28 structures occupying 1574 bytes.
Table at 0xCEE98000.

Handle 0x0000, DMI type 4, 42 bytes
Processor Information
	Socket Designation: CPU 1
	Type: Central Processor
	Family: Other
	Manufacturer: Intel(R) Corporation
	ID: 61 06 03 00 FF FB EB BF
	Version: Intel(R) Atom(TM) CPU D2700   @ 2.13GHz
	Voltage: 1.1 V
	External Clock: 133 MHz
	Max Speed: 4000 MHz
	Current Speed: 2129 MHz
	Status: Populated, Enabled
	Upgrade: None
	L1 Cache Handle: 0x0003
	L2 Cache Handle: 0x0001
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 2
	Core Enabled: 2
	Thread Count: 1
	Characteristics:
		64-bit capable
		Multi-Core
		Hardware Thread
		Execute Protection

Handle 0x0001, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 512 kB
	Maximum Size: 512 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 8-way Set-associative

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 32 kB
	Maximum Size: 32 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Instruction
	Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 24 kB
	Maximum Size: 24 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 32-way Set-associative

Handle 0x0004, DMI type 0, 24 bytes
BIOS Information
	Vendor: Intel Corp.
	Version: MUCDT10N.86A.0076.2013.0618.1644
	Release Date: 06/18/2013
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 2 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		ATAPI Zip drive boot is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 0.0
	Firmware Revision: 0.0

Handle 0x0005, DMI type 1, 27 bytes
System Information
	Manufacturer:                                 
	Product Name:                                 
	Version:                         
	Serial Number:                                 
	UUID: 0a4222e3-5386-e111-b477-00e04cb00c04
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified

Handle 0x0006, DMI type 2, 20 bytes
Base Board Information
	Manufacturer: Intel Corporation
	Product Name: D2700DC 
	Version: AAG32420-602
	Serial Number: BQDC2150057C                    
	Asset Tag: Base Board Asset Tag
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Base Board Chassis Location
	Chassis Handle: 0x0007
	Type: Unknown
	Contained Object Handles: 0

Handle 0x0007, DMI type 3, 22 bytes
Chassis Information
	Manufacturer:                                 
	Type: Desktop
	Lock: Not Present
	Version:                         
	Serial Number:                                 
	Asset Tag:                                 
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Other
	Security Status: Other
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: Unspecified
	Contained Elements: 0
	SKU Number: Not Specified

Handle 0x0008, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: PRIMARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x0009, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: SECONDARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: ATX_PWR
	Internal Connector Type: Other
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000B, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE X1 SLOT 1
	Type: x1 PCI Express
	Current Usage: Available
	Length: Short
	ID: 2
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported
	Bus Address: 0000:00:00.0

Handle 0x000C, DMI type 9, 17 bytes
System Slot Information
	Designation: PCI SLOT 1
	Type: 32-bit PCI
	Current Usage: Available
	Length: Long
	ID: 1
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported
	Bus Address: 0000:00:00.0

Handle 0x000D, DMI type 10, 6 bytes
On Board Device Information
	Type: Video
	Status: Enabled
	Description: Intel(R) GMA 3600 Video Device

Handle 0x000E, DMI type 10, 6 bytes
On Board Device Information
	Type: Ethernet
	Status: Enabled
	Description: Intel(R) 82574L Gigabit Ethernet Device

Handle 0x000F, DMI type 10, 6 bytes
On Board Device Information
	Type: Sound
	Status: Enabled
	Description: Intel(R) High Definition Audio Device

Handle 0x0010, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) GMA 3600 Video Device
	Type: Video
	Status: Enabled
	Type Instance: 0
	Bus Address: 0000:00:02.0

Handle 0x0011, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) 82574L Gigabit Ethernet Device
	Type: Ethernet
	Status: Enabled
	Type Instance: 0
	Bus Address: 0000:01:00.0

Handle 0x0012, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) High Definition Audio Device
	Type: Sound
	Status: Enabled
	Type Instance: 0
	Bus Address: 0000:00:1b.0

Handle 0x0013, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Abbreviated
	Installable Languages: 1
		enUS
	Currently Installed Language: enUS

Handle 0x0014, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x0015, DMI type 16, 23 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 2

Handle 0x0016, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0015
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2 GB
	Form Factor: DIMM
	Set: None
	Locator: SO DIMM 0
	Bank Locator: Channel A DIMM0
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1066 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000
	Rank: Unknown
	Configured Memory Speed: 1066 MT/s

Handle 0x0017, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00080000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x0016
	Memory Array Mapped Address Handle: 0x001A
	Partition Row Position: 1

Handle 0x0018, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0015
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2 GB
	Form Factor: DIMM
	Set: None
	Locator: SO DIMM 1
	Bank Locator: Channel A DIMM1
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1066 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000
	Rank: Unknown
	Configured Memory Speed: 1066 MT/s

Handle 0x0019, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00080000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x0018
	Memory Array Mapped Address Handle: 0x001A
	Partition Row Position: 1

Handle 0x001A, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 4 GB
	Physical Array Handle: 0x0015
	Partition Width: 2

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table


[-- Attachment #4: dmidecode-d2500.txt --]
[-- Type: text/plain, Size: 8602 bytes --]

# dmidecode 3.5
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
28 structures occupying 1573 bytes.
Table at 0xCEE98000.

Handle 0x0000, DMI type 4, 42 bytes
Processor Information
	Socket Designation: CPU 1
	Type: Central Processor
	Family: Other
	Manufacturer: Intel(R) Corporation
	ID: 61 06 03 00 FF FB EB BF
	Version: Intel(R) Atom(TM) CPU D2500   @ 1.86GHz
	Voltage: 1.1 V
	External Clock: 133 MHz
	Max Speed: 4000 MHz
	Current Speed: 1863 MHz
	Status: Populated, Enabled
	Upgrade: None
	L1 Cache Handle: 0x0003
	L2 Cache Handle: 0x0001
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 2
	Core Enabled: 2
	Thread Count: 1
	Characteristics:
		64-bit capable
		Multi-Core
		Execute Protection

Handle 0x0001, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 512 kB
	Maximum Size: 512 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 8-way Set-associative

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 32 kB
	Maximum Size: 32 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Instruction
	Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 24 kB
	Maximum Size: 24 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 32-way Set-associative

Handle 0x0004, DMI type 0, 24 bytes
BIOS Information
	Vendor: Intel Corp.
	Version: CCCDT10N.86A.0032.2012.0323.1510
	Release Date: 03/23/2012
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 2 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		ATAPI Zip drive boot is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 0.0
	Firmware Revision: 0.0

Handle 0x0005, DMI type 1, 27 bytes
System Information
	Manufacturer:                                 
	Product Name:                                 
	Version:                         
	Serial Number:                                 
	UUID: eae6cc59-d8c4-e111-8863-0013d4f47980
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified

Handle 0x0006, DMI type 2, 20 bytes
Base Board Information
	Manufacturer: Intel Corporation
	Product Name: D2500CC
	Version: AAG43156-304
	Serial Number: BQCC225000CD                    
	Asset Tag: Base Board Asset Tag
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Base Board Chassis Location
	Chassis Handle: 0x0007
	Type: Unknown
	Contained Object Handles: 0

Handle 0x0007, DMI type 3, 22 bytes
Chassis Information
	Manufacturer:                                 
	Type: Desktop
	Lock: Not Present
	Version:                         
	Serial Number:                                 
	Asset Tag:                                 
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Other
	Security Status: Other
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: Unspecified
	Contained Elements: 0
	SKU Number: Not Specified

Handle 0x0008, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: PRIMARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x0009, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: SECONDARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: ATX_PWR
	Internal Connector Type: Other
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000B, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE X1 SLOT 1
	Type: x1 PCI Express
	Current Usage: Available
	Length: Short
	ID: 2
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported
	Bus Address: 0000:00:00.0

Handle 0x000C, DMI type 9, 17 bytes
System Slot Information
	Designation: PCI SLOT 1
	Type: 32-bit PCI
	Current Usage: Available
	Length: Long
	ID: 1
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported
	Bus Address: 0000:00:00.0

Handle 0x000D, DMI type 10, 6 bytes
On Board Device Information
	Type: Video
	Status: Enabled
	Description: Intel(R) GMA 3600 Video Device

Handle 0x000E, DMI type 10, 6 bytes
On Board Device Information
	Type: Ethernet
	Status: Enabled
	Description: Intel(R) 82574L Gigabit Ethernet Device

Handle 0x000F, DMI type 10, 6 bytes
On Board Device Information
	Type: Sound
	Status: Disabled
	Description: Intel(R) High Definition Audio Device

Handle 0x0010, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) GMA 3600 Video Device
	Type: Video
	Status: Enabled
	Type Instance: 0
	Bus Address: 0000:00:02.0

Handle 0x0011, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) 82574L Gigabit Ethernet Device
	Type: Ethernet
	Status: Enabled
	Type Instance: 0
	Bus Address: 0000:01:00.0

Handle 0x0012, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) High Definition Audio Device
	Type: Sound
	Status: Disabled
	Type Instance: 0
	Bus Address: 0000:00:1b.0

Handle 0x0013, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Abbreviated
	Installable Languages: 1
		enUS
	Currently Installed Language: enUS

Handle 0x0014, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x0015, DMI type 16, 23 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 2

Handle 0x0016, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0015
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2 GB
	Form Factor: DIMM
	Set: None
	Locator: SO DIMM 0
	Bank Locator: Channel A DIMM0
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1066 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000
	Rank: Unknown
	Configured Memory Speed: 1066 MT/s

Handle 0x0017, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00080000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x0016
	Memory Array Mapped Address Handle: 0x001A
	Partition Row Position: 1

Handle 0x0018, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0015
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 2 GB
	Form Factor: DIMM
	Set: None
	Locator: SO DIMM 1
	Bank Locator: Channel A DIMM1
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1066 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000
	Rank: Unknown
	Configured Memory Speed: 1066 MT/s

Handle 0x0019, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00080000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 2 GB
	Physical Device Handle: 0x0018
	Memory Array Mapped Address Handle: 0x001A
	Partition Row Position: 1

Handle 0x001A, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 4 GB
	Physical Array Handle: 0x0015
	Partition Width: 2

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table


[-- Attachment #5: dmidecode-n2800.txt --]
[-- Type: text/plain, Size: 8487 bytes --]

# dmidecode 3.5
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
28 structures occupying 1519 bytes.
Table at 0xCEE95000.

Handle 0x0000, DMI type 4, 42 bytes
Processor Information
	Socket Designation: CPU 1
	Type: Central Processor
	Family: Other
	Manufacturer: Intel(R) Corporation
	ID: 61 06 03 00 FF FB EB BF
	Version: Intel(R) Atom(TM) CPU N2800   @ 1.86GHz
	Voltage: 1.1 V
	External Clock: 133 MHz
	Max Speed: 4000 MHz
	Current Speed: 1868 MHz
	Status: Populated, Enabled
	Upgrade: None
	L1 Cache Handle: 0x0003
	L2 Cache Handle: 0x0001
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 2
	Core Enabled: 2
	Thread Count: 1
	Characteristics:
		64-bit capable
		Multi-Core
		Hardware Thread
		Execute Protection
		Power/Performance Control

Handle 0x0001, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 512 kB
	Maximum Size: 512 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 8-way Set-associative

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 32 kB
	Maximum Size: 32 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Instruction
	Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
	Socket Designation: Unknown
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 24 kB
	Maximum Size: 24 kB
	Supported SRAM Types:
		Asynchronous
	Installed SRAM Type: Asynchronous
	Speed: Unknown
	Error Correction Type: Single-bit ECC
	System Type: Data
	Associativity: 32-way Set-associative

Handle 0x0004, DMI type 0, 24 bytes
BIOS Information
	Vendor: Intel Corp.
	Version: MTCDT10N.86A.0171.2015.0122.0901
	Release Date: 01/22/2015
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 2 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		ATAPI Zip drive boot is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 0.0
	Firmware Revision: 0.0

Handle 0x0005, DMI type 1, 27 bytes
System Information
	Manufacturer:                                 
	Product Name:                                 
	Version:                         
	Serial Number:                                 
	UUID: 064e051c-bf46-e211-bfaa-0011116cb251
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified

Handle 0x0006, DMI type 2, 20 bytes
Base Board Information
	Manufacturer: Intel Corporation
	Product Name: DN2800MT
	Version: AAG23738-804
	Serial Number: BQMT2500004V
	Asset Tag: Base Board Asset Tag
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Base Board Chassis Location
	Chassis Handle: 0x0007
	Type: Unknown
	Contained Object Handles: 0

Handle 0x0007, DMI type 3, 22 bytes
Chassis Information
	Manufacturer:                                 
	Type: Desktop
	Lock: Not Present
	Version:                         
	Serial Number:                                 
	Asset Tag:                                 
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Other
	Security Status: Other
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: Unspecified
	Contained Elements: 0
	SKU Number: Not Specified

Handle 0x0008, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: PRIMARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x0009, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: SECONDARY
	Internal Connector Type: On Board IDE
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: ATX_PWR
	Internal Connector Type: Other
	External Reference Designator: Not Specified
	External Connector Type: None
	Port Type: Other

Handle 0x000B, DMI type 9, 17 bytes
System Slot Information
	Designation: mini PCIE X1 SLOT 2
	Type: x1 PCI Express
	Current Usage: In Use
	Length: Short
	ID: 3
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported
	Bus Address: 0000:00:00.0

Handle 0x000C, DMI type 9, 17 bytes
System Slot Information
	Designation: mini PCIE X1 SLOT 1
	Type: x1 PCI Express
	Current Usage: Available
	Length: Short
	ID: 2
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported
	Bus Address: 0000:00:00.0

Handle 0x000D, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE X1 SLOT 1
	Type: x1 PCI Express
	Current Usage: Available
	Length: Short
	ID: 1
	Characteristics:
		3.3 V is provided
		PME signal is supported
		SMBus signal is supported
	Bus Address: 0000:00:00.0

Handle 0x000E, DMI type 10, 6 bytes
On Board Device Information
	Type: Video
	Status: Enabled
	Description: Intel(R) GMA 3600 Video Device

Handle 0x000F, DMI type 10, 6 bytes
On Board Device Information
	Type: Ethernet
	Status: Enabled
	Description: Intel(R) 82574L Gigabit Ethernet Device

Handle 0x0010, DMI type 10, 6 bytes
On Board Device Information
	Type: Sound
	Status: Disabled
	Description: Intel(R) High Definition Audio Device

Handle 0x0011, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) GMA 3600 Video Device
	Type: Video
	Status: Enabled
	Type Instance: 0
	Bus Address: 0000:00:02.0

Handle 0x0012, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) 82574L Gigabit Ethernet Device
	Type: Ethernet
	Status: Enabled
	Type Instance: 0
	Bus Address: 0000:01:00.0

Handle 0x0013, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Intel(R) High Definition Audio Device
	Type: Sound
	Status: Disabled
	Type Instance: 0
	Bus Address: 0000:00:1b.0

Handle 0x0014, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Abbreviated
	Installable Languages: 1
		enUS
	Currently Installed Language: enUS

Handle 0x0015, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x0016, DMI type 16, 23 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 2

Handle 0x0017, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0016
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: No Module Installed
	Form Factor: DIMM
	Set: None
	Locator: SO DIMM 0
	Bank Locator: Channel A DIMM0
	Type: Unknown
	Type Detail: Synchronous

Handle 0x0018, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x0016
	Error Information Handle: Not Provided
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 4 GB
	Form Factor: DIMM
	Set: None
	Locator: SO DIMM 1
	Bank Locator: Channel A DIMM1
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1066 MT/s
	Manufacturer: 0x0000000000000000
	Serial Number: 0x00000000
	Asset Tag: Unknown
	Part Number: 0x000000000000000000000000000000000000
	Rank: Unknown
	Configured Memory Speed: 1066 MT/s

Handle 0x0019, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 4 GB
	Physical Device Handle: 0x0018
	Memory Array Mapped Address Handle: 0x001A
	Partition Row Position: 1

Handle 0x001A, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x000FFFFFFFF
	Range Size: 4 GB
	Physical Array Handle: 0x0016
	Partition Width: 2

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table


[-- Attachment #6: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2024-07-22 10:44 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-23 15:31 [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Ard Biesheuvel
2023-05-23 15:31 ` [PATCH v4 1/5] efi: Make EFI PXE protocol methods non-callable Ard Biesheuvel
2023-05-23 15:31 ` [PATCH v4 2/5] efi: Add calling convention annotation to all prototypes Ard Biesheuvel
2023-05-23 15:31 ` [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers Ard Biesheuvel
2023-06-12 17:19   ` Christian Hesse
2023-06-12 19:05     ` Daniel Kiper
2023-06-12 20:53       ` Robin Candau
2023-06-14 15:15         ` Daniel Kiper
2023-06-15 15:01           ` Thomas Frauendorfer
2023-06-15 15:05           ` Daniel Kiper
2023-06-15 21:36             ` Christian Hesse
2023-06-16  7:15               ` Robin Candau
2023-06-16 10:35                 ` Daniel Kiper
2023-06-16 10:48                   ` Robin Candau
2023-06-16 12:24                     ` Christian Hesse
2023-06-16 14:11                       ` Daniel Kiper
2023-05-23 15:31 ` [PATCH v4 4/5] efi: Remove x86_64 call wrappers Ard Biesheuvel
2023-05-23 15:31 ` [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386 Ard Biesheuvel
2023-05-23 15:34   ` Ard Biesheuvel
2024-05-16 12:24   ` [REGRESSION] " Jan Čermák
2024-05-16 13:42     ` Ard Biesheuvel
2024-06-27 10:26       ` Jan Čermák
2024-06-27 10:39         ` Mate Kukri
2024-06-28 17:28         ` Ard Biesheuvel
2024-07-03 14:25           ` Jan Čermák
2024-07-03 14:47             ` Ard Biesheuvel
2024-07-03 17:35               ` Jan Čermák
2024-07-22 10:43                 ` Jan Čermák
2023-05-24 20:21 ` [PATCH v4 0/5] efi: Implement generic EFI boot for x86 Daniel Kiper

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.