On Mon, 11 May 2026 at 15:01, Gabriel Brookman
<[email protected]> wrote:
>
> Introduces a new stage 2 memory attribute, NoTagAccess, that raises a
> stage 2 data abort on a tag check, tag read, or tag write.
>
> Signed-off-by: Gabriel Brookman <[email protected]>
> Reviewed-by: Richard Henderson <[email protected]>
> ---
> target/arm/cpu-features.h | 5 +++++
> target/arm/ptw.c | 25 ++++++++++++++++++++++---
> target/arm/tcg/mte_helper.c | 38 ++++++++++++++++++++++++++++++++++++--
> 3 files changed, 63 insertions(+), 5 deletions(-)
>
> diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h
> index 88fe3ed287..adfbdb9da5 100644
> --- a/target/arm/cpu-features.h
> +++ b/target/arm/cpu-features.h
> @@ -1157,6 +1157,11 @@ static inline bool isar_feature_aa64_mte3(const
> ARMISARegisters *id)
> return FIELD_EX64_IDREG(id, ID_AA64PFR1, MTE) >= 3;
> }
>
> +static inline bool isar_feature_aa64_mteperm(const ARMISARegisters *id)
> +{
> + return FIELD_EX64_IDREG(id, ID_AA64PFR2, MTEPERM) >= 1;
> +}
> +
> static inline bool isar_feature_aa64_sme(const ARMISARegisters *id)
> {
> return FIELD_EX64_IDREG(id, ID_AA64PFR1, SME) != 0;
> diff --git a/target/arm/ptw.c b/target/arm/ptw.c
> index 316e201cfe..467d815e0d 100644
> --- a/target/arm/ptw.c
> +++ b/target/arm/ptw.c
> @@ -3414,7 +3414,7 @@ static ARMCacheAttrs combine_cacheattrs(uint64_t hcr,
> ARMCacheAttrs s1, ARMCacheAttrs s2)
> {
> ARMCacheAttrs ret;
> - bool tagged = false;
> + bool tagged, notagaccess = false;
This drops the previous initialization of 'tagged', and clang
complains:
../../target/arm/ptw.c:3432:9: error: variable 'tagged' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
3432 | if (s1.attrs == 0xf0) {
| ^~~~~~~~~~~~~~~~
../../target/arm/ptw.c:3488:9: note: uninitialized use occurs here
3488 | if (tagged && ret.attrs == 0xff) {
| ^~~~~~
../../target/arm/ptw.c:3432:5: note: remove the 'if' if its condition
is always true
3432 | if (s1.attrs == 0xf0) {
| ^~~~~~~~~~~~~~~~~~~~~
../../target/arm/ptw.c:3427:16: note: initialize the variable 'tagged'
to silence this warning
3427 | bool tagged, notagaccess = false;
| ^
| = false
You want "bool tagged = false, notagaccess = false;".
thanks
-- PMM