[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/6] x86/cpu-policy: Drop build time cross-checks of featureset sizes
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 9 May 2023 14:04:48 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aPJaUOtLXSna1hDllO7PoB9exQDqte8dXEP66cZMgqI=; b=UVLnDBv5DpZl2QpFmoPbIFJk0zkLue0D97nsM5Mf/hMUovFiWL8/woYwm+THDab/7GBDPgUuMvIfdVdpsY5pwiuvH18ysRlJ+DUrxVhuSY5PKu9O1ztItbyLkwSjLBD1HfygZQReTMPMHa0KzqD1Q88eY4ydMD07DnVvGfVJ8nch1z62E8KXdEjaXXgtsucQptx7EhtLAUnQ18E9LfjfrkNFcvU9szjllSIMII88GgZmNECQIqdFpmmJnY6DpiQ+NlxZm41ubyYVqEsJEJ/5TjJTowcTcbT1a6AsLVz4v77OtLej3pbhFEdgfiD3oTykglOOrcf1uQKuVSNNxk/slw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eBc2NL7JMxSzfKScWfJvlJKu2EIfAb7r06eXZeIIniDCbXt7+pr6Zgju5DvKvLe/DLi5VCqNUvgxxmH7MIsifUDw/XnPFptHJO/YGDXiP6Mx/4KZzWy9mJG6BUS4egGe4THQj872zCX5/3BZ0ViIhhxCOknbGkUKeUtVc5dyVekJ4THDSVTm6ScUH9S0FWWhAflnTdYAwIikSDwiBJpvN64w94k0C0bbiacs/VqEv5FGlHic+ngwuQ1rb8FjbxIgVGASDZVWnEhBkXmpjFzGLrW6RYIWnn5yq7YR7ZM7W820M7H2qt51Ub/gIRPlao2hchkG3xNxYt8W7AUIHnxgQg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 09 May 2023 13:05:16 +0000
- Ironport-data: A9a23:gtnfa6MFLjwGtzvvrR2IlsFynXyQoLVcMsEvi/4bfWQNrUoigWZSn GEeD26GbqyPM2Okftwlb4S2908AsZXSydFrGgto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvPrRC9H5qyo42tF5g1mP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0sFNPm9B2 KwmERsITyuituedx7ypFNA506zPLOGzVG8ekldJ6GiDSNoDH9XESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PtxujeJpOBy+OGF3N79U9qGX8hK2G2fo XrL5T/RCRAGLt2PjzGC9xpAg8eWxXykAd1CReDQGvhC0Xyo4jQWFT8se1KbvdKJ0Uy4ecBBA hlBksYphe1onKCxdfH/VRClpH+PvjYHRsFdVeY97Wml1a788wufQG8eQVZpeNEg8cM7WzEu/ luIhM/yQyxitqWPTnCQ/avSqim9URX5NkcHbC4ACAcAvd/qpdhpigqVF4k5VqmoktfyBDf8h SiQqzQzjKkSishN0Lin+VfAgHSnoZ2hohMJ2zg7l1mNtmtRDLNJraTygbQHxZ6s9Lqkc2Q=
- Ironport-hdrordr: A9a23:QBNhg6Ppz/HZuMBcTgWjsMiBIKoaSvp037BK7S1MoH1uA6mlfq WV9sjzuiWatN98Yh8dcLO7Scu9qBHnlaKdiLN5VduftWHd01dAR7sSjrcKrQeAJ8X/nNQtr5 uJccJFeaDN5Y4Rt7eH3OG6eexQv+Vu6MqT9IPjJ+8Gd3ATV0lnhT0JbTqzIwlNayRtI4E2L5 aY7tovnUvaRZxGBv7LYEXsRoL41qT2qK4=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 08/05/2023 7:47 am, Jan Beulich wrote:
> On 04.05.2023 21:39, Andrew Cooper wrote:
>> These BUILD_BUG_ON()s exist to cover the curious absence of a diagnostic for
>> code which looks like:
>>
>> uint32_t foo[1] = { 1, 2, 3 };
>>
>> However, GCC 12 at least does now warn for this:
>>
>> foo.c:1:24: error: excess elements in array initializer [-Werror]
>> 884 | uint32_t foo[1] = { 1, 2, 3 };
>> | ^
>> foo.c:1:24: note: (near initialization for 'foo')
> I'm pretty sure all gcc versions we support diagnose such cases. In turn
> the arrays in question don't have explicit dimensions at their
> definition sites, and hence they derive their dimensions from their
> initializers. So the build-time-checks are about the arrays in fact
> obtaining the right dimensions, i.e. the initializers being suitable.
>
> With the core part of the reasoning not being applicable, I'm afraid I
> can't even say "okay with an adjusted description".
Now I'm extra confused.
I put those BUILD_BUG_ON()'s in because I was not getting a diagnostic
when I was expecting one, and there was a bug in the original featureset
work caused by this going wrong.
But godbolt seems to agree that even GCC 4.1 notices.
Maybe it was some other error (C file not seeing the header properly?)
which disappeared across the upstream review?
Either way, these aren't appropriate, and need deleting before patch 5,
because the check is no longer valid when a featureset can be longer
than the autogen length.
~Andrew
|