From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9872D1FF0E5 for ; Wed, 29 Jul 2026 13:11:25 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4DE9221331; Wed, 29 Jul 2026 13:11:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785323463; x=1785928263; darn=lists.proxmox.com; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1Psj/9LCAwZuVJ74NpMxmN5OECWDPNcB2GfwSRmybBo=; b=CD1RNk2LK5tlv6k1d8Vp9H8+ND6BJMigM7hxmS6wUjZ4uozeZJ5fzr6Wh3R+546oq1 xPfb7nLNp/EBU+UcoaTGIDHNmxT9Aw8DDmFwGd0XErK/gbg1WsUjmG4PAGwHCOE0kzeA Zcgrezxmzgv9NuoJbxcA3ncKGJVaXm/a9/obktdZQESTtAuZxk64kM0gyf/9ZPLQzz8h laICeOyqZeDkKy5dxZPiZdQwlSl/Gj4FXmgcQAZVYZEw/dybuF5kQ9GLelrfSHwkyZJN isjV5B5dGvGgQZxZCb3rt7fpvHt2D40z5oMAt+cRLW0BZSjpZtXzqXaUmM4t/8jgIHVW OHWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785323463; x=1785928263; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=1Psj/9LCAwZuVJ74NpMxmN5OECWDPNcB2GfwSRmybBo=; b=qW3O2ICD16Yhnxqlr4Nr8nS4ZoN2JmGaeAF6M/BvVt6hU0dKoCDQvs76bky5PPsbff 383shgVYun14TwYcfJIus2LTOplX8BW9GhItJOZurdQSSwsPkZifBjNk1mlqWYVRxrg7 YsczZ9giWa2FHttyOl1vKq7zVLiYC0pGelg7+dcfZ+g4x2nIAKXckdGGOADyVzaYNLP4 pr+yrziHBwSwq0CDC9CZtZ9ZOSHAzPpCB/pvebqxBho9mwRlCZKEg29px+lZUgs7jKR1 i6dllBDgeka5sl4GuUA3WFZTxsA2cvkhyO/Z/B2kDWEUxQEMJOfdHLeU/R4oVoQDdSnz znRQ== X-Gm-Message-State: AOJu0YyoojDwYB92F5GEslmGp5O4AiLAzIOm49nRowOajhk4Q0DfxXVV tn4y7omXMqB1jZyD+FUkOZ0t+SlIII1s5fs6YUpCUM+Qhh1srpSWLGXIbYOjXBD/J7Y= X-Gm-Gg: AR+sD11HZI37xCmJysxQ37w9zTaev+Vh+3WOYK83izSyAwGxl/qSkyDEcy4RiYrf5pO rGZiDOkpFRtE7rN9ZlOZY9ISJBkO6ZDjhvmMKzWg5RHsKltzuscHwoyWl+xy+47kS+fq3oFGPuJ wB3xy0hv4Bh2annLtyCyaRJXGq3lcFM8j0Em+kdAMHracjtpc0TNu9I0ErAD0aA+O7bIVRVJH1B BPjO6bnqZbHrjZY1/rYkscPjQW4fCPI41htqRKOJtv8hRkITqFkXXBRMiTH70rkyoYZlBINQ2V1 8O4wBr1+2vUUKQVnyPLxeAV5I9JtXJwuYgW/NpA2JVEfHbSnSkK/9nbmrErZy9XGVSeHfQdEHEP GH6HK/QXJz79hGVSAMMRPF9/t53m0AYE+cUv81kbHpwOtmSF1b/E6G1GSVIeuuaM5bEo0mZR8A3 ygWSKTVA8NHNAlK1zF/BdmJupSlZWGmU0s492Otil5H4CE39FfIWoW6ao+LPkWOJJfzNxVxjWBV OpuAYdZlTIF5jXxPkIzouUI X-Received: by 2002:a17:902:d2c4:b0:2c8:1c05:16aa with SMTP id d9443c01a7336-2d015d3deddmr70103285ad.19.1785323462968; Wed, 29 Jul 2026 04:11:02 -0700 (PDT) From: Kaiyang Wu X-Google-Original-From: Kaiyang Wu To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v2] query-machine-capabilities: limit AuthenticAMD and GenuineIntel checks to x86-64 Date: Wed, 29 Jul 2026 19:10:05 +0800 Message-ID: <20260729111024.58285-2-wukaiyang@loongfans.cn> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.000 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_ENVFROM_END_DIGIT 1 Envelope-from freemail username ends in digit FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no 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: 6QVFUU7SFY3EOLWRDZPRIWXI2RI43QLO X-Message-ID-Hash: 6QVFUU7SFY3EOLWRDZPRIWXI2RI43QLO X-MailFrom: wukaiyang2003@gmail.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: 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 { cpu_caps_arm_t caps_arm; query_cpu_capabilities_arm(&caps_arm); -- 2.55.0