From: Fiona Ebner <f.ebner@proxmox.com>
To: Kaiyang Wu <wukaiyang2003@gmail.com>, pve-devel@lists.proxmox.com
Cc: Kaiyang Wu <wukaiyang@loongfans.cn>
Subject: Re: [PATCH qemu-server v2] query-machine-capabilities: limit AuthenticAMD and GenuineIntel checks to x86-64
Date: Wed, 29 Jul 2026 17:33:51 +0200 [thread overview]
Message-ID: <3d50f82f-be99-49da-9ac2-41cc7a8cbf9e@proxmox.com> (raw)
In-Reply-To: <20260729111024.58285-2-wukaiyang@loongfans.cn>
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 <wukaiyang@loongfans.cn>
> ---
>
> 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
next prev parent reply other threads:[~2026-07-29 15:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 11:10 [PATCH qemu-server v2] query-machine-capabilities: limit AuthenticAMD and GenuineIntel checks to x86-64 Kaiyang Wu
2026-07-29 15:33 ` Fiona Ebner [this message]
2026-07-29 16:05 ` Kaiyang Wu
2026-07-30 1:49 ` superseded: " Kaiyang Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d50f82f-be99-49da-9ac2-41cc7a8cbf9e@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=wukaiyang2003@gmail.com \
--cc=wukaiyang@loongfans.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.