Re: [PATCH v3 08/26] x86/virt/seamldr: Retrieve P-SEAMLDR information
From: Xu Yilun
Date: Thu Jan 29 2026 - 23:20:02 EST
> I'd also prefer a
>
> BUILD_BUG_ON(sizeof(struct seamldr_info) != 2048);
^
BUILD_BUG_ON(sizeof(struct seamldr_info) != 256); is it?
>
> just as a sanity check. It doesn't cost anything and it makes sure that
> as you muck around with reserved fields and padding that there's at
> least one check making sure it's OK.
And I recently received a comments that "never __packed for naturally
aligned structures cause it leads to bad generated code and hurts
performance", but I really want to highlight nearby it is for a
formatted binary blob, so:
struct seamldr_info {
u32 version;
u32 attributes;
u32 vendor_id;
u32 build_date;
u16 build_num;
u16 minor_version;
u16 major_version;
u16 update_version;
u8 reserved0[4];
u32 num_remaining_updates;
u8 reserved1[224];
}; //delete __packed here
static_assert(sizeof(struct seamldr_info) == 256);
Is it better?