Re: [RFC PATCH 1/5] efi/gop: Remove bogus packed attribute from GOP structures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 12 Dec 2019 at 22:34, Arvind Sankar <nivedita@xxxxxxxxxxxx> wrote:
>
> EFI structures are not packed, they follow natural alignment.
>
> The packed attribute doesn't have any effect on the structure layout due
> to the types and order of the members, and we only ever get these
> structures as output from the EFI firmware so alignment issues have not
> come up.
>

__packed may also affect the size of a struct, given that it won't be
rounded up to its alignment. This broke the config table array at some
point when we used the alignment for EFI_GUIDs that is actually
mentioned in the spec.

In this particular case, I think your analysis is correct wrt the
types in question, just be aware that padding is not the complete
picture.


> Signed-off-by: Arvind Sankar <nivedita@xxxxxxxxxxxx>
> ---
>  include/linux/efi.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/efi.h b/include/linux/efi.h
> index 99dfea595c8c..bffe6e0a9b53 100644
> --- a/include/linux/efi.h
> +++ b/include/linux/efi.h
> @@ -1429,7 +1429,7 @@ struct efi_graphics_output_mode_info {
>         int pixel_format;
>         struct efi_pixel_bitmask pixel_information;
>         u32 pixels_per_scan_line;
> -} __packed;
> +};
>
>  struct efi_graphics_output_protocol_mode_32 {
>         u32 max_mode;
> @@ -1438,7 +1438,7 @@ struct efi_graphics_output_protocol_mode_32 {
>         u32 size_of_info;
>         u64 frame_buffer_base;
>         u32 frame_buffer_size;
> -} __packed;
> +};
>
>  struct efi_graphics_output_protocol_mode_64 {
>         u32 max_mode;
> @@ -1447,7 +1447,7 @@ struct efi_graphics_output_protocol_mode_64 {
>         u64 size_of_info;
>         u64 frame_buffer_base;
>         u64 frame_buffer_size;
> -} __packed;
> +};
>
>  struct efi_graphics_output_protocol_mode {
>         u32 max_mode;
> @@ -1456,7 +1456,7 @@ struct efi_graphics_output_protocol_mode {
>         unsigned long size_of_info;
>         u64 frame_buffer_base;
>         unsigned long frame_buffer_size;
> -} __packed;
> +};
>
>  struct efi_graphics_output_protocol_32 {
>         u32 query_mode;
> --
> 2.23.0
>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux