lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXwtILdwb/KMX9uH@yilunxu-OptiPlex-7050>
Date: Fri, 30 Jan 2026 12:01:36 +0800
From: Xu Yilun <yilun.xu@...ux.intel.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Chao Gao <chao.gao@...el.com>, linux-coco@...ts.linux.dev,
	linux-kernel@...r.kernel.org, kvm@...r.kernel.org, x86@...nel.org,
	reinette.chatre@...el.com, ira.weiny@...el.com, kai.huang@...el.com,
	dan.j.williams@...el.com, sagis@...gle.com, vannapurve@...gle.com,
	paulmck@...nel.org, nik.borisov@...e.com, zhenzhong.duan@...el.com,
	seanjc@...gle.com, rick.p.edgecombe@...el.com, kas@...nel.org,
	dave.hansen@...ux.intel.com, vishal.l.verma@...el.com,
	Farrah Chen <farrah.chen@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH v3 08/26] x86/virt/seamldr: Retrieve P-SEAMLDR information

> 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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ