From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B82C23D291 for ; Fri, 30 Jan 2026 04:19:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769746798; cv=none; b=tWDVSmkih5XFJWHsgNM+BybXC8QTUC0kXuzJSpiFet9lCbSONLdey/AYHURUgTw1J90TeVy3XPP+j/mZxy9r7nAzTfqLopjLRzvHdS4XtLMedUWTfFvomw4EDshnxVgc2UgMnS228avzSj3VwN2LA38DiiIFueuNMlUeDDOGfac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769746798; c=relaxed/simple; bh=ox/deh2PiJbxGr7yh4KNQDHHU3XJkCnzWZSOESwWuUE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GnnXNlXQsVHDItVndSwjltIWw2GX2rypJeu1nd8Z7tZxNpxZkITrj4LnHZyrljCL5NenLaDOE4YrA8yER97j/DZZOFHZHLlzhYe62axl41GjNmDW7uP1Pp0P1T9EhRtK0xzFzugnfiwwgZkVeyTaxY9td8X1vLkuZoJmHgKraYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OsrepXs3; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OsrepXs3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769746797; x=1801282797; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ox/deh2PiJbxGr7yh4KNQDHHU3XJkCnzWZSOESwWuUE=; b=OsrepXs3KwxzzRzyPIHX3/wSPMA7Zai6w7lXMtlo5Y97+9vlLq2WUB8C fBnDrFxqJfataTL+z/Fwbymu3uY2ep/gUegDvMqP2aSXhqktKwfxkDt7x hwlsUm+gNYFS9m2SfeypWwo/GBb5Tt2PqrSfSViVcgXZOc3nXISmRHCRs WlSGKp+0P19U5VStkRIlXmvwq7d0d8/OMKLTONtk6i/MsLoU8YO9CezUT rjNHASH3jPVwPYnVDsXzUTjI8OJP+QItuigl8eKmmbN7mOHMXFo7kpNPa sdKTA02DbqqV6scBVzkYkw9bvuN4Qi16wyJfZNa3O7IHqkjwrA/AZ7Jrg Q==; X-CSE-ConnectionGUID: TkQBEIw2QJqqkJna53GYJA== X-CSE-MsgGUID: 2te3Vx+TSo6HdDkSehmw9g== X-IronPort-AV: E=McAfee;i="6800,10657,11686"; a="70014359" X-IronPort-AV: E=Sophos;i="6.21,262,1763452800"; d="scan'208";a="70014359" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2026 20:19:56 -0800 X-CSE-ConnectionGUID: OSkzCLsHQIyvYwVTXpq2jg== X-CSE-MsgGUID: bGKzNJ2JRbiQswS8AGjCIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,262,1763452800"; d="scan'208";a="208670775" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmviesa006.fm.intel.com with ESMTP; 29 Jan 2026 20:19:51 -0800 Date: Fri, 30 Jan 2026 12:01:36 +0800 From: Xu Yilun To: Dave Hansen Cc: Chao Gao , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, reinette.chatre@intel.com, ira.weiny@intel.com, kai.huang@intel.com, dan.j.williams@intel.com, sagis@google.com, vannapurve@google.com, paulmck@kernel.org, nik.borisov@suse.com, zhenzhong.duan@intel.com, seanjc@google.com, rick.p.edgecombe@intel.com, kas@kernel.org, dave.hansen@linux.intel.com, vishal.l.verma@intel.com, Farrah Chen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: Re: [PATCH v3 08/26] x86/virt/seamldr: Retrieve P-SEAMLDR information Message-ID: References: <20260123145645.90444-1-chao.gao@intel.com> <20260123145645.90444-9-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: > 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?