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 185BF1FF0E5 for ; Wed, 29 Jul 2026 18:05:52 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 95A9020968; Wed, 29 Jul 2026 18:05:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1785341119; cv=none; d=google.com; s=arc-20260327; b=dZG6D0ACohEly/xiim/az6APRBJGA9Ow5PYla9C+LB2UM+exM9+r5TscEF0VapL4dR 5Euk+BVRFKIbga6b6yoLibF19nupU4gINB+vZRH7FQdQ5xAWgldk3w6f6N9H/jVv7ZTH ZVPtTubQeLKhCyhXz4Z/7y2B1xKmh2OMW+IdsXJO1TO2GI/GuJqMsy73dczVPPsMkht0 20GLoBCG4VdknjntvHjuT+vFy/NXDXUS1unvL7XqUimQcpFm8qwCgjgEWe+1McH45Sd3 v5NHnOcanDt+fGjHlOwpIMSWXHiqmUxOraMBCvTUmP+lbJ06H6JqpAQi92e9f7iouWt5 V60A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bsnbgCwotIpcnBjoZxB7AfWfRgtvyHZ088hs/AlkPk8=; fh=NN0dwKGAys30K7K8TPbrpUWKL7yhIWsep2B6JTqMZcQ=; b=kZ8ym9/SoHFdnpHRAVSUelxuXIC+dvnUcrzlV5mo4Mz7vuhBPVfIQfYre0G3VL0XKR fek5Bcq6D8gr1nRaQFQ4lmPi2jKnv4nmqVxmB6o2cp4kI2f8izxQOxDN42wWlkTYbcP8 h2FCtOLcsTb4wnWJvrbTfEiJAlUgojD03T05SLzBripUxQdApfFWuXYMzsUVfdRxsR6r 5chCx4fZD6gFo+HR/96sHnXavoQjTj9CIE09aAHoIVjlun3g+et8W/kFQY12d2QbzAGk SSTehSUYuSXasmHKQ7wIOpuO3yK89xWZ5aPUpDjI0CqqQDbNMmFASAHjdlYDsNTfk1NS mreA==; darn=lists.proxmox.com ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785341119; x=1785945919; darn=lists.proxmox.com; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=bsnbgCwotIpcnBjoZxB7AfWfRgtvyHZ088hs/AlkPk8=; b=nJECrW/SvWbDoLnL7Fy+3Z2alFFH6cy7jsgv+wmS7OrZz57FF3KWOEqBYoEzx/VLQ+ UfAbQJoZ+f+Ti+tiTKyqWRFvhgFjqJPWKHYpmRv0vYy6d4VGXn9gNpNcZ/qb6KQ1z551 2G6PJC6Ff91ZlH8233i5BTHykOo7PW1B9UW+istaRmGLDhL72xdCj/0BsYJs423OioKI U64KW2Yjum5dJzKJq+xfcEkV1GJInLkC0I4WjxuhN0EoEQe6yI3qakrXpau0lvNjdXNt 6fFEgolYYpt8vBAxVzCFjy0jE8Y4OrQByaDRbLaGxeTG/tyl4DEDI74P6jkaJD1n71s4 +N2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785341119; x=1785945919; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=bsnbgCwotIpcnBjoZxB7AfWfRgtvyHZ088hs/AlkPk8=; b=EeUtCp9H7Kaxwr6CY9lkju0FoZIArw5Ph+f2SAGvPgKiqliC1K58js2vSS2n4LyQmw zxM1iAaRxPXzl9A+kKeWAXnQMHjwHWBPkSgQ5rWzpW1Kw2kRWPxiycajuT2QFC2sr1kR GYj/joJ6ynmqIH4FcZVIdsDerX0MCcrf0QxI54T8apK+0l50R5ru3Sl/LncmJh7pmB1/ Orpo7ZNnK6xdAKb7icTUuzoNE6IwOYwaAIUzSORkWzjsrbpEHypvAjrJnhWKOHlHLe89 h26CRapsfVq1TuPqs04+CQBdbe6iNLr22wisysgkZriF85BDpNSEO1BBMCJSetbhrGip zUrQ== X-Gm-Message-State: AOJu0YzFX9hgbN1s+ZNoItfIUB9jLRoek083pYKjwOMFL1IXdX6hmbSE hka0ZKGJ+0+qkykMtK1pklK9uYinuG+3nk+eridhC0Tyl7En8ysGYFAfUydcfpM88pMwCKrV+CC uoyRicyLlq7ZWsgs3IWvXNBFflsmdsZo= X-Gm-Gg: AR+sD13IB2cjzIBcLuZIpDU0a7Wpghnxslyifc/vZQ05IgSGo/TXpj3zJ9K7jpoyOPz clNNOshGIGpvpSRCC9F5lhFORHJuoSYYSTPdgM3BGs8U/cEYBuk4LUDWwKUBJwiU16NueLHlOxN xt6ziyi/KcocBhNgPkyXi3PPw8kUa9LQHlC4s/EwssS3f6QJNcWckQTRngFcP2/oTdQM0nt7ynW XwgBTpq+vJu5zuAJXM9iyKaJ5QRvcZGWwFoF0NmfnBJHDtbYXdaavWx3rN6yLCErHC4B91NoTZ3 Sz5P6JKXNZ2I/wr4+rlU9h3u2qr04xY+Lw3VriQ/ELgjb/EWDzeWdSfubw== X-Received: by 2002:a05:600c:34d2:b0:495:5e07:649b with SMTP id 5b1f17b1804b1-496c6576533mr83285725e9.24.1785341119294; Wed, 29 Jul 2026 09:05:19 -0700 (PDT) MIME-Version: 1.0 References: <20260729111024.58285-2-wukaiyang@loongfans.cn> <3d50f82f-be99-49da-9ac2-41cc7a8cbf9e@proxmox.com> In-Reply-To: <3d50f82f-be99-49da-9ac2-41cc7a8cbf9e@proxmox.com> From: Kaiyang Wu Date: Thu, 30 Jul 2026 00:05:07 +0800 X-Gm-Features: AUfX_mzU3I4fgnZtb5BzWLbRROU23KHpSO9smXWkJ8IUQfrzq3MLS2EjzLKsK9k Message-ID: Subject: Re: [PATCH qemu-server v2] query-machine-capabilities: limit AuthenticAMD and GenuineIntel checks to x86-64 To: Fiona Ebner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 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: XACB334YT6F2IIHCUYJ4WXUHHF2LIGVY X-Message-ID-Hash: XACB334YT6F2IIHCUYJ4WXUHHF2LIGVY 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: pve-devel@lists.proxmox.com, 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: On 7/29/26 23:33, Fiona Ebner wrote: > 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 curre= nt >> 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: =E2=80=98strncmp=E2=80=99 of strings of length 7 and 12 and bound= of 12 >> evaluates to nonzero [-Werror=3Dstring-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 x= 86-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) =3D=3D 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? I will fix this in v3. Thank you for pointing it out. > >> 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 > Yes, I have already submitted a signed CLA for my entity (sent from this email address on May 28, 2026).