From: Brad Smith <brad@comstyle.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH 3/7] util/cpuinfo-aarch64: Detect FEAT_CSSC
Date: Tue, 11 Aug 2026 23:35:31 -0400 [thread overview]
Message-ID: <8dcd5fde-7d99-441a-86c2-5e293d474e23@comstyle.com> (raw)
In-Reply-To: <20260812003143.225228-4-richard.henderson@linaro.org>
On 2026-08-11 8:31 p.m., Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> host/include/aarch64/host/cpuinfo.h | 1 +
> util/cpuinfo-aarch64.c | 13 ++++++++++++-
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/host/include/aarch64/host/cpuinfo.h b/host/include/aarch64/host/cpuinfo.h
> index fe671534e4..c32c04dade 100644
> --- a/host/include/aarch64/host/cpuinfo.h
> +++ b/host/include/aarch64/host/cpuinfo.h
> @@ -12,6 +12,7 @@
> #define CPUINFO_AES (1u << 3)
> #define CPUINFO_PMULL (1u << 4)
> #define CPUINFO_BTI (1u << 5)
> +#define CPUINFO_CSSC (1u << 6)
>
> /* Initialized with a constructor. */
> extern unsigned cpuinfo;
> diff --git a/util/cpuinfo-aarch64.c b/util/cpuinfo-aarch64.c
> index 288074c08f..0b4f8a747d 100644
> --- a/util/cpuinfo-aarch64.c
> +++ b/util/cpuinfo-aarch64.c
> @@ -72,6 +72,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
>
> unsigned long hwcap2 = qemu_getauxval(AT_HWCAP2);
> info |= (hwcap2 & HWCAP2_BTI ? CPUINFO_BTI : 0);
> + info |= (hwcap2 & HWCAP2_CSSC ? CPUINFO_CSSC : 0);
> #endif
> #ifdef CONFIG_DARWIN
> info |= sysctl_for_bool("hw.optional.arm.FEAT_LSE") * CPUINFO_LSE;
> @@ -79,10 +80,11 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
> info |= sysctl_for_bool("hw.optional.arm.FEAT_AES") * CPUINFO_AES;
> info |= sysctl_for_bool("hw.optional.arm.FEAT_PMULL") * CPUINFO_PMULL;
> info |= sysctl_for_bool("hw.optional.arm.FEAT_BTI") * CPUINFO_BTI;
> + info |= sysctl_for_bool("hw.optional.arm.FEAT_CSSC") * CPUINFO_CSSC;
> #endif
> #if defined(__OpenBSD__) && !defined(CONFIG_ELF_AUX_INFO)
> int mib[2];
> - uint64_t isar0;
> + uint64_t isar0, isar2;
> uint64_t pfr1;
> size_t len;
>
> @@ -101,6 +103,15 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
> }
> }
>
> + mib[0] = CTL_MACHDEP;
> + mib[1] = CPU_ID_AA64ISAR2;
> + len = sizeof(isar2);
> + if (sysctl(mib, 2, &isar2, &len, NULL, 0) != -1) {
> + if (ID_AA64ISAR2_CSSC(isar2) >= ID_AA64ISAR2_CSSC_IMPL) {
> + info |= CPUINFO_CSSC;
> + }
> + }
> +
> mib[0] = CTL_MACHDEP;
> mib[1] = CPU_ID_AA64PFR1;
> len = sizeof(pfr1);
You can remove the bottom chunk. Any OpenBSD release that has the
ID_AA64ISAR2_CSSC
and ID_AA64ISAR2_CSSC_IMPL constants is also covered by elf_aux_info()
which is the
first chunk.
ID_AA64ISAR2_CSSC_IMPL
next prev parent reply other threads:[~2026-08-12 3:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 0:31 [PATCH 0/7] tcg: Add min/max opcodes Richard Henderson
2026-08-12 0:31 ` [PATCH 1/7] tcg: Add integer " Richard Henderson
2026-08-12 8:42 ` Alex Bennée
2026-08-12 0:31 ` [PATCH 2/7] tcg/optimize: Handle " Richard Henderson
2026-08-12 7:17 ` Philippe Mathieu-Daudé
2026-08-12 8:46 ` Alex Bennée
2026-08-12 0:31 ` [PATCH 3/7] util/cpuinfo-aarch64: Detect FEAT_CSSC Richard Henderson
2026-08-12 3:35 ` Brad Smith [this message]
2026-08-12 13:56 ` Richard Henderson
2026-08-12 0:31 ` [PATCH 4/7] tcg/aarch64: Implement min/max with FEAT_CSSC Richard Henderson
2026-08-12 7:15 ` Philippe Mathieu-Daudé
2026-08-12 0:31 ` [PATCH 5/7] target/riscv64: Implement min/max with Zbb Richard Henderson
2026-08-12 0:31 ` [PATCH 6/7] tcg/aarch64: Implement ctpop with FEAT_CSSC Richard Henderson
2026-08-12 6:59 ` Philippe Mathieu-Daudé
2026-08-12 0:31 ` [PATCH 7/7] tcg/aarch64: Use CTZ from FEAT_CSSC Richard Henderson
2026-08-12 7:06 ` Philippe Mathieu-Daudé
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=8dcd5fde-7d99-441a-86c2-5e293d474e23@comstyle.com \
--to=brad@comstyle.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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.