From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 8F1E91FF0E5 for ; Wed, 29 Jul 2026 17:34:13 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E2C6420A6B; Wed, 29 Jul 2026 17:34:12 +0200 (CEST) Message-ID: <3d50f82f-be99-49da-9ac2-41cc7a8cbf9e@proxmox.com> Date: Wed, 29 Jul 2026 17:33:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server v2] query-machine-capabilities: limit AuthenticAMD and GenuineIntel checks to x86-64 To: Kaiyang Wu , pve-devel@lists.proxmox.com References: <20260729111024.58285-2-wukaiyang@loongfans.cn> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260729111024.58285-2-wukaiyang@loongfans.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785339224345 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.167 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: AXPS2RL3RY4K7NOTOKYNVOHOHSSQETA2 X-Message-ID-Hash: AXPS2RL3RY4K7NOTOKYNVOHOHSSQETA2 X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Kaiyang Wu X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 29.07.26 um 1:11 PM schrieb Kaiyang Wu: > Intel TDX and AMD SEV are both x86-64-only extensions [0] [1]. The current > method of checking results in compilation errors on "unknown" vendors, > where the current placeholder string length ("Unknown") mismatches the > lengths of both "AuthenticAMD" and "GenuineIntel": > > error: ‘strncmp’ of strings of length 7 and 12 and bound of 12 > evaluates to nonzero [-Werror=string-compare] > > Limit the machine capability checks for Intel TDX and AMD SEV to x86-64 to > fix build. > > [0]: https://docs.kernel.org/arch/x86/tdx.html > [1]: https://docs.kernel.org/virt/kvm/x86/amd-memory-encryption.html > > Signed-off-by: Kaiyang Wu > --- > > v1: https://lore.proxmox.com/pve-devel/20260603055031.106241-1-wukaiyang@loongfans.cn/ > > Changes v1 -> v2: > - Use conditional compilation to limit Intel TDX and AMD SEV checks to x86-64 > - Eliminate the vendor string length check > > src/query-machine-capabilities/query-machine-capabilities.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/query-machine-capabilities/query-machine-capabilities.c b/src/query-machine-capabilities/query-machine-capabilities.c > index abb47acd..3ccd30da 100644 > --- a/src/query-machine-capabilities/query-machine-capabilities.c > +++ b/src/query-machine-capabilities/query-machine-capabilities.c > @@ -204,6 +204,7 @@ int main() { > eprintf("Error writing to file '" OUTPUT_PATH "': %s\n", strerror(errno)); > } > > +#ifdef __x86_64__ > if (strncmp(vendor, "AuthenticAMD", 12) == 0) { > cpu_caps_amd_sev_t caps_sev; > query_cpu_capabilities_sev(&caps_sev); > @@ -233,7 +234,7 @@ int main() { > ); > } > } > -#ifdef __aarch64__ > +#elif defined(__aarch64__) > else { I guess this won't compile on aarch64 now, as there will be an else without an if? > cpu_caps_arm_t caps_arm; > query_cpu_capabilities_arm(&caps_arm); Also, did you already submit a signed CLA to office@proxmox.com? See: https://pve.proxmox.com/wiki/Developer_Documentation#Software_License_and_Copyright