* [PATCH] efi: Add missing __grub_efi_api attributes
@ 2023-06-15 14:45 Daniel Kiper
2023-06-15 21:37 ` Christian Hesse
2023-06-20 17:38 ` Peter Jones
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Kiper @ 2023-06-15 14:45 UTC (permalink / raw)
To: grub-devel; +Cc: antiz, ardb, development, list
The commit bb4aa6e06 (efi: Drop all uses of efi_call_XX() wrappers) did
not add some __grub_efi_api attributes to the EFI calls. Lack of them
led to hangs on x86_64-efi target. So, let's add missing __grub_efi_api
attributes.
Fixes: bb4aa6e06 (efi: Drop all uses of efi_call_XX() wrappers)
Reported-by: Christian Hesse <list@eworm.de>
Reported-by: Robin Candau <antiz@archlinux.org>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
include/grub/efi/cc.h | 30 ++++++++++++++--------------
include/grub/efi/console_control.h | 16 +++++++--------
include/grub/efi/graphics_output.h | 32 +++++++++++++++---------------
include/grub/efi/uga_draw.h | 40 +++++++++++++++++++-------------------
4 files changed, 59 insertions(+), 59 deletions(-)
diff --git a/include/grub/efi/cc.h b/include/grub/efi/cc.h
index 896030689..978e0cdfe 100644
--- a/include/grub/efi/cc.h
+++ b/include/grub/efi/cc.h
@@ -124,27 +124,27 @@ typedef struct grub_efi_cc_boot_service_capability grub_efi_cc_boot_service_capa
struct grub_efi_cc_protocol
{
grub_efi_status_t
- (*get_capability) (struct grub_efi_cc_protocol *this,
- grub_efi_cc_boot_service_capability_t *ProtocolCapability);
+ (__grub_efi_api *get_capability) (struct grub_efi_cc_protocol *this,
+ grub_efi_cc_boot_service_capability_t *ProtocolCapability);
grub_efi_status_t
- (*get_event_log) (struct grub_efi_cc_protocol *this,
- grub_efi_cc_event_log_format_t EventLogFormat,
- grub_efi_physical_address_t *EventLogLocation,
- grub_efi_physical_address_t *EventLogLastEntry,
- grub_efi_boolean_t *EventLogTruncated);
+ (__grub_efi_api *get_event_log) (struct grub_efi_cc_protocol *this,
+ grub_efi_cc_event_log_format_t 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_cc_protocol *this,
- grub_efi_uint64_t Flags,
- grub_efi_physical_address_t DataToHash,
- grub_efi_uint64_t DataToHashLen,
- grub_efi_cc_event_t *EfiCcEvent);
+ (__grub_efi_api *hash_log_extend_event) (struct grub_efi_cc_protocol *this,
+ grub_efi_uint64_t Flags,
+ grub_efi_physical_address_t DataToHash,
+ grub_efi_uint64_t DataToHashLen,
+ grub_efi_cc_event_t *EfiCcEvent);
grub_efi_status_t
- (*map_pcr_to_mr_index) (struct grub_efi_cc_protocol *this,
- grub_efi_uint32_t PcrIndex,
- grub_efi_cc_mr_index_t *MrIndex);
+ (__grub_efi_api *map_pcr_to_mr_index) (struct grub_efi_cc_protocol *this,
+ grub_efi_uint32_t PcrIndex,
+ grub_efi_cc_mr_index_t *MrIndex);
};
typedef struct grub_efi_cc_protocol grub_efi_cc_protocol_t;
diff --git a/include/grub/efi/console_control.h b/include/grub/efi/console_control.h
index bb5fd038e..008ac5896 100644
--- a/include/grub/efi/console_control.h
+++ b/include/grub/efi/console_control.h
@@ -41,18 +41,18 @@ typedef enum grub_efi_screen_mode grub_efi_screen_mode_t;
struct grub_efi_console_control_protocol
{
grub_efi_status_t
- (*get_mode) (struct grub_efi_console_control_protocol *this,
- grub_efi_screen_mode_t *mode,
- grub_efi_boolean_t *uga_exists,
- grub_efi_boolean_t *std_in_locked);
+ (__grub_efi_api *get_mode) (struct grub_efi_console_control_protocol *this,
+ grub_efi_screen_mode_t *mode,
+ grub_efi_boolean_t *uga_exists,
+ grub_efi_boolean_t *std_in_locked);
grub_efi_status_t
- (*set_mode) (struct grub_efi_console_control_protocol *this,
- grub_efi_screen_mode_t mode);
+ (__grub_efi_api *set_mode) (struct grub_efi_console_control_protocol *this,
+ grub_efi_screen_mode_t mode);
grub_efi_status_t
- (*lock_std_in) (struct grub_efi_console_control_protocol *this,
- grub_efi_char16_t *password);
+ (__grub_efi_api *lock_std_in) (struct grub_efi_console_control_protocol *this,
+ grub_efi_char16_t *password);
};
typedef struct grub_efi_console_control_protocol grub_efi_console_control_protocol_t;
diff --git a/include/grub/efi/graphics_output.h b/include/grub/efi/graphics_output.h
index e4388127c..044e786b8 100644
--- a/include/grub/efi/graphics_output.h
+++ b/include/grub/efi/graphics_output.h
@@ -83,26 +83,26 @@ struct grub_efi_gop_mode
struct grub_efi_gop;
typedef grub_efi_status_t
-(*grub_efi_gop_query_mode_t) (struct grub_efi_gop *this,
- grub_efi_uint32_t mode_number,
- grub_efi_uintn_t *size_of_info,
- struct grub_efi_gop_mode_info **info);
+(__grub_efi_api *grub_efi_gop_query_mode_t) (struct grub_efi_gop *this,
+ grub_efi_uint32_t mode_number,
+ grub_efi_uintn_t *size_of_info,
+ struct grub_efi_gop_mode_info **info);
typedef grub_efi_status_t
-(*grub_efi_gop_set_mode_t) (struct grub_efi_gop *this,
- grub_efi_uint32_t mode_number);
+(__grub_efi_api *grub_efi_gop_set_mode_t) (struct grub_efi_gop *this,
+ grub_efi_uint32_t mode_number);
typedef grub_efi_status_t
-(*grub_efi_gop_blt_t) (struct grub_efi_gop *this,
- void *buffer,
- grub_efi_uintn_t operation,
- grub_efi_uintn_t sx,
- grub_efi_uintn_t sy,
- grub_efi_uintn_t dx,
- grub_efi_uintn_t dy,
- grub_efi_uintn_t width,
- grub_efi_uintn_t height,
- grub_efi_uintn_t delta);
+(__grub_efi_api *grub_efi_gop_blt_t) (struct grub_efi_gop *this,
+ void *buffer,
+ grub_efi_uintn_t operation,
+ grub_efi_uintn_t sx,
+ grub_efi_uintn_t sy,
+ grub_efi_uintn_t dx,
+ grub_efi_uintn_t dy,
+ grub_efi_uintn_t width,
+ grub_efi_uintn_t height,
+ grub_efi_uintn_t delta);
struct grub_efi_gop
{
diff --git a/include/grub/efi/uga_draw.h b/include/grub/efi/uga_draw.h
index a31f2672e..1ea157a7e 100644
--- a/include/grub/efi/uga_draw.h
+++ b/include/grub/efi/uga_draw.h
@@ -46,30 +46,30 @@ struct grub_efi_uga_pixel
struct grub_efi_uga_draw_protocol
{
grub_efi_status_t
- (*get_mode) (struct grub_efi_uga_draw_protocol *this,
- grub_uint32_t *width,
- grub_uint32_t *height,
- grub_uint32_t *depth,
- grub_uint32_t *refresh_rate);
+ (__grub_efi_api *get_mode) (struct grub_efi_uga_draw_protocol *this,
+ grub_uint32_t *width,
+ grub_uint32_t *height,
+ grub_uint32_t *depth,
+ grub_uint32_t *refresh_rate);
grub_efi_status_t
- (*set_mode) (struct grub_efi_uga_draw_protocol *this,
- grub_uint32_t width,
- grub_uint32_t height,
- grub_uint32_t depth,
- grub_uint32_t refresh_rate);
+ (__grub_efi_api *set_mode) (struct grub_efi_uga_draw_protocol *this,
+ grub_uint32_t width,
+ grub_uint32_t height,
+ grub_uint32_t depth,
+ grub_uint32_t refresh_rate);
grub_efi_status_t
- (*blt) (struct grub_efi_uga_draw_protocol *this,
- struct grub_efi_uga_pixel *blt_buffer,
- enum grub_efi_uga_blt_operation blt_operation,
- grub_efi_uintn_t src_x,
- grub_efi_uintn_t src_y,
- grub_efi_uintn_t dest_x,
- grub_efi_uintn_t dest_y,
- grub_efi_uintn_t width,
- grub_efi_uintn_t height,
- grub_efi_uintn_t delta);
+ (__grub_efi_api *blt) (struct grub_efi_uga_draw_protocol *this,
+ struct grub_efi_uga_pixel *blt_buffer,
+ enum grub_efi_uga_blt_operation blt_operation,
+ grub_efi_uintn_t src_x,
+ grub_efi_uintn_t src_y,
+ grub_efi_uintn_t dest_x,
+ grub_efi_uintn_t dest_y,
+ grub_efi_uintn_t width,
+ grub_efi_uintn_t height,
+ grub_efi_uintn_t delta);
};
typedef struct grub_efi_uga_draw_protocol grub_efi_uga_draw_protocol_t;
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] efi: Add missing __grub_efi_api attributes
2023-06-15 14:45 [PATCH] efi: Add missing __grub_efi_api attributes Daniel Kiper
@ 2023-06-15 21:37 ` Christian Hesse
2023-06-20 17:38 ` Peter Jones
1 sibling, 0 replies; 3+ messages in thread
From: Christian Hesse @ 2023-06-15 21:37 UTC (permalink / raw)
To: Daniel Kiper; +Cc: The development of GNU GRUB, antiz, ardb, development
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
Daniel Kiper <daniel.kiper@oracle.com> on Thu, 2023/06/15 16:45:
> The commit bb4aa6e06 (efi: Drop all uses of efi_call_XX() wrappers) did
> not add some __grub_efi_api attributes to the EFI calls. Lack of them
> led to hangs on x86_64-efi target. So, let's add missing __grub_efi_api
> attributes.
>
> Fixes: bb4aa6e06 (efi: Drop all uses of efi_call_XX() wrappers)
I can confirm this fixes the issue 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] 3+ messages in thread
* Re: [PATCH] efi: Add missing __grub_efi_api attributes
2023-06-15 14:45 [PATCH] efi: Add missing __grub_efi_api attributes Daniel Kiper
2023-06-15 21:37 ` Christian Hesse
@ 2023-06-20 17:38 ` Peter Jones
1 sibling, 0 replies; 3+ messages in thread
From: Peter Jones @ 2023-06-20 17:38 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: antiz, ardb, development, list
On Thu, Jun 15, 2023 at 04:45:00PM +0200, Daniel Kiper wrote:
> The commit bb4aa6e06 (efi: Drop all uses of efi_call_XX() wrappers) did
> not add some __grub_efi_api attributes to the EFI calls. Lack of them
> led to hangs on x86_64-efi target. So, let's add missing __grub_efi_api
> attributes.
>
> Fixes: bb4aa6e06 (efi: Drop all uses of efi_call_XX() wrappers)
>
> Reported-by: Christian Hesse <list@eworm.de>
> Reported-by: Robin Candau <antiz@archlinux.org>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
These all look like correct additions to me.
Reviewed-by: Peter Jones <pjones@redhat.com>
> ---
> include/grub/efi/cc.h | 30 ++++++++++++++--------------
> include/grub/efi/console_control.h | 16 +++++++--------
> include/grub/efi/graphics_output.h | 32 +++++++++++++++---------------
> include/grub/efi/uga_draw.h | 40 +++++++++++++++++++-------------------
> 4 files changed, 59 insertions(+), 59 deletions(-)
>
> diff --git a/include/grub/efi/cc.h b/include/grub/efi/cc.h
> index 896030689..978e0cdfe 100644
> --- a/include/grub/efi/cc.h
> +++ b/include/grub/efi/cc.h
> @@ -124,27 +124,27 @@ typedef struct grub_efi_cc_boot_service_capability grub_efi_cc_boot_service_capa
> struct grub_efi_cc_protocol
> {
> grub_efi_status_t
> - (*get_capability) (struct grub_efi_cc_protocol *this,
> - grub_efi_cc_boot_service_capability_t *ProtocolCapability);
> + (__grub_efi_api *get_capability) (struct grub_efi_cc_protocol *this,
> + grub_efi_cc_boot_service_capability_t *ProtocolCapability);
>
> grub_efi_status_t
> - (*get_event_log) (struct grub_efi_cc_protocol *this,
> - grub_efi_cc_event_log_format_t EventLogFormat,
> - grub_efi_physical_address_t *EventLogLocation,
> - grub_efi_physical_address_t *EventLogLastEntry,
> - grub_efi_boolean_t *EventLogTruncated);
> + (__grub_efi_api *get_event_log) (struct grub_efi_cc_protocol *this,
> + grub_efi_cc_event_log_format_t 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_cc_protocol *this,
> - grub_efi_uint64_t Flags,
> - grub_efi_physical_address_t DataToHash,
> - grub_efi_uint64_t DataToHashLen,
> - grub_efi_cc_event_t *EfiCcEvent);
> + (__grub_efi_api *hash_log_extend_event) (struct grub_efi_cc_protocol *this,
> + grub_efi_uint64_t Flags,
> + grub_efi_physical_address_t DataToHash,
> + grub_efi_uint64_t DataToHashLen,
> + grub_efi_cc_event_t *EfiCcEvent);
>
> grub_efi_status_t
> - (*map_pcr_to_mr_index) (struct grub_efi_cc_protocol *this,
> - grub_efi_uint32_t PcrIndex,
> - grub_efi_cc_mr_index_t *MrIndex);
> + (__grub_efi_api *map_pcr_to_mr_index) (struct grub_efi_cc_protocol *this,
> + grub_efi_uint32_t PcrIndex,
> + grub_efi_cc_mr_index_t *MrIndex);
> };
> typedef struct grub_efi_cc_protocol grub_efi_cc_protocol_t;
>
> diff --git a/include/grub/efi/console_control.h b/include/grub/efi/console_control.h
> index bb5fd038e..008ac5896 100644
> --- a/include/grub/efi/console_control.h
> +++ b/include/grub/efi/console_control.h
> @@ -41,18 +41,18 @@ typedef enum grub_efi_screen_mode grub_efi_screen_mode_t;
> struct grub_efi_console_control_protocol
> {
> grub_efi_status_t
> - (*get_mode) (struct grub_efi_console_control_protocol *this,
> - grub_efi_screen_mode_t *mode,
> - grub_efi_boolean_t *uga_exists,
> - grub_efi_boolean_t *std_in_locked);
> + (__grub_efi_api *get_mode) (struct grub_efi_console_control_protocol *this,
> + grub_efi_screen_mode_t *mode,
> + grub_efi_boolean_t *uga_exists,
> + grub_efi_boolean_t *std_in_locked);
>
> grub_efi_status_t
> - (*set_mode) (struct grub_efi_console_control_protocol *this,
> - grub_efi_screen_mode_t mode);
> + (__grub_efi_api *set_mode) (struct grub_efi_console_control_protocol *this,
> + grub_efi_screen_mode_t mode);
>
> grub_efi_status_t
> - (*lock_std_in) (struct grub_efi_console_control_protocol *this,
> - grub_efi_char16_t *password);
> + (__grub_efi_api *lock_std_in) (struct grub_efi_console_control_protocol *this,
> + grub_efi_char16_t *password);
> };
> typedef struct grub_efi_console_control_protocol grub_efi_console_control_protocol_t;
>
> diff --git a/include/grub/efi/graphics_output.h b/include/grub/efi/graphics_output.h
> index e4388127c..044e786b8 100644
> --- a/include/grub/efi/graphics_output.h
> +++ b/include/grub/efi/graphics_output.h
> @@ -83,26 +83,26 @@ struct grub_efi_gop_mode
> struct grub_efi_gop;
>
> typedef grub_efi_status_t
> -(*grub_efi_gop_query_mode_t) (struct grub_efi_gop *this,
> - grub_efi_uint32_t mode_number,
> - grub_efi_uintn_t *size_of_info,
> - struct grub_efi_gop_mode_info **info);
> +(__grub_efi_api *grub_efi_gop_query_mode_t) (struct grub_efi_gop *this,
> + grub_efi_uint32_t mode_number,
> + grub_efi_uintn_t *size_of_info,
> + struct grub_efi_gop_mode_info **info);
>
> typedef grub_efi_status_t
> -(*grub_efi_gop_set_mode_t) (struct grub_efi_gop *this,
> - grub_efi_uint32_t mode_number);
> +(__grub_efi_api *grub_efi_gop_set_mode_t) (struct grub_efi_gop *this,
> + grub_efi_uint32_t mode_number);
>
> typedef grub_efi_status_t
> -(*grub_efi_gop_blt_t) (struct grub_efi_gop *this,
> - void *buffer,
> - grub_efi_uintn_t operation,
> - grub_efi_uintn_t sx,
> - grub_efi_uintn_t sy,
> - grub_efi_uintn_t dx,
> - grub_efi_uintn_t dy,
> - grub_efi_uintn_t width,
> - grub_efi_uintn_t height,
> - grub_efi_uintn_t delta);
> +(__grub_efi_api *grub_efi_gop_blt_t) (struct grub_efi_gop *this,
> + void *buffer,
> + grub_efi_uintn_t operation,
> + grub_efi_uintn_t sx,
> + grub_efi_uintn_t sy,
> + grub_efi_uintn_t dx,
> + grub_efi_uintn_t dy,
> + grub_efi_uintn_t width,
> + grub_efi_uintn_t height,
> + grub_efi_uintn_t delta);
>
> struct grub_efi_gop
> {
> diff --git a/include/grub/efi/uga_draw.h b/include/grub/efi/uga_draw.h
> index a31f2672e..1ea157a7e 100644
> --- a/include/grub/efi/uga_draw.h
> +++ b/include/grub/efi/uga_draw.h
> @@ -46,30 +46,30 @@ struct grub_efi_uga_pixel
> struct grub_efi_uga_draw_protocol
> {
> grub_efi_status_t
> - (*get_mode) (struct grub_efi_uga_draw_protocol *this,
> - grub_uint32_t *width,
> - grub_uint32_t *height,
> - grub_uint32_t *depth,
> - grub_uint32_t *refresh_rate);
> + (__grub_efi_api *get_mode) (struct grub_efi_uga_draw_protocol *this,
> + grub_uint32_t *width,
> + grub_uint32_t *height,
> + grub_uint32_t *depth,
> + grub_uint32_t *refresh_rate);
>
> grub_efi_status_t
> - (*set_mode) (struct grub_efi_uga_draw_protocol *this,
> - grub_uint32_t width,
> - grub_uint32_t height,
> - grub_uint32_t depth,
> - grub_uint32_t refresh_rate);
> + (__grub_efi_api *set_mode) (struct grub_efi_uga_draw_protocol *this,
> + grub_uint32_t width,
> + grub_uint32_t height,
> + grub_uint32_t depth,
> + grub_uint32_t refresh_rate);
>
> grub_efi_status_t
> - (*blt) (struct grub_efi_uga_draw_protocol *this,
> - struct grub_efi_uga_pixel *blt_buffer,
> - enum grub_efi_uga_blt_operation blt_operation,
> - grub_efi_uintn_t src_x,
> - grub_efi_uintn_t src_y,
> - grub_efi_uintn_t dest_x,
> - grub_efi_uintn_t dest_y,
> - grub_efi_uintn_t width,
> - grub_efi_uintn_t height,
> - grub_efi_uintn_t delta);
> + (__grub_efi_api *blt) (struct grub_efi_uga_draw_protocol *this,
> + struct grub_efi_uga_pixel *blt_buffer,
> + enum grub_efi_uga_blt_operation blt_operation,
> + grub_efi_uintn_t src_x,
> + grub_efi_uintn_t src_y,
> + grub_efi_uintn_t dest_x,
> + grub_efi_uintn_t dest_y,
> + grub_efi_uintn_t width,
> + grub_efi_uintn_t height,
> + grub_efi_uintn_t delta);
> };
> typedef struct grub_efi_uga_draw_protocol grub_efi_uga_draw_protocol_t;
>
> --
> 2.11.0
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-20 17:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 14:45 [PATCH] efi: Add missing __grub_efi_api attributes Daniel Kiper
2023-06-15 21:37 ` Christian Hesse
2023-06-20 17:38 ` Peter Jones
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.