public inbox for chrome-platform@lists.linux.dev
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: tzungbi@kernel.org, briannorris@chromium.org,
	jwerner@chromium.org, javierm@redhat.com, samuel@sholland.org,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	airlied@gmail.com, simona@ffwll.ch
Cc: chrome-platform@lists.linux.dev, dri-devel@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH v4 09/12] firmware: google: Pack structures for coreboot table entries
Date: Tue, 17 Feb 2026 16:56:19 +0100	[thread overview]
Message-ID: <20260217155836.96267-10-tzimmermann@suse.de> (raw)
In-Reply-To: <20260217155836.96267-1-tzimmermann@suse.de>

Pack the fields in the coreboot table entries. These entries are part of
the coreboot ABI, so they don't follow regular calling conventions. Fields
of type u64 are aligned to boundaries of 4 bytes instead of 8. [1]

So far this has not been a problem. In the future, padding bytes should
be added where explicit alignment is required.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://github.com/coreboot/coreboot/blob/main/payloads/libpayload/include/coreboot_tables.h#L96 # [1]
Suggested-by: Julius Werner <jwerner@chromium.org>
Acked-by: Julius Werner <jwerner@chromium.org>
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
v2:
- use aligned 64-bit type instead of __packed__ attribute (Julius)
---
 include/linux/coreboot.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/linux/coreboot.h b/include/linux/coreboot.h
index 48705b439c6e..5746b99a070d 100644
--- a/include/linux/coreboot.h
+++ b/include/linux/coreboot.h
@@ -12,8 +12,11 @@
 #ifndef _LINUX_COREBOOT_H
 #define _LINUX_COREBOOT_H
 
+#include <linux/compiler_attributes.h>
 #include <linux/types.h>
 
+typedef __aligned(4) u64 cb_u64;
+
 /* List of coreboot entry structures that is used */
 
 #define CB_TAG_FRAMEBUFFER 0x12
@@ -30,7 +33,7 @@ struct lb_cbmem_ref {
 	u32 tag;
 	u32 size;
 
-	u64 cbmem_addr;
+	cb_u64 cbmem_addr;
 };
 
 /* Corresponds to LB_TAG_CBMEM_ENTRY */
@@ -38,7 +41,7 @@ struct lb_cbmem_entry {
 	u32 tag;
 	u32 size;
 
-	u64 address;
+	cb_u64 address;
 	u32 entry_size;
 	u32 id;
 };
@@ -48,7 +51,7 @@ struct lb_framebuffer {
 	u32 tag;
 	u32 size;
 
-	u64 physical_address;
+	cb_u64 physical_address;
 	u32 x_resolution;
 	u32 y_resolution;
 	u32 bytes_per_line;
-- 
2.52.0


  parent reply	other threads:[~2026-02-17 15:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 15:56 [PATCH v4 00/12] drm, coreboot: Add DRM coreboot driver Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 01/12] firmware: google: framebuffer: Do not unregister platform device Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 02/12] firmware: google: framebuffer: Do not mark framebuffer as busy Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 03/12] firmware: google: framebuffer: Init memory resource with helper macro Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 04/12] firmware: google: framebuffer: Tie platform device to PCI hardware Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 05/12] firmware: google: framebuffer: Fix dependencies Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 06/12] firmware: google: Init coreboot bus with subsys_initcall() Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 07/12] firmware: google: Clean up include statements in coreboot_table.h Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 08/12] firmware: google: Export coreboot table entries Thomas Zimmermann
2026-02-17 15:56 ` Thomas Zimmermann [this message]
2026-02-17 15:56 ` [PATCH v4 10/12] drm/sysfb: Generalize pixel-format matching Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 11/12] drm/sysfb: corebootdrm: Add DRM driver for coreboot framebuffers Thomas Zimmermann
2026-02-17 15:56 ` [PATCH v4 12/12] drm/sysfb: corebootdrm: Support panel orientation Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260217155836.96267-10-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=briannorris@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jwerner@chromium.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=samuel@sholland.org \
    --cc=simona@ffwll.ch \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox