|
From: | Richard Henderson |
Subject: | Re: [PATCH v2 1/6] linux-user/aarch64: Extend PR_SET_TAGGED_ADDR_CTRL for FEAT_MTE3 |
Date: | Wed, 7 Feb 2024 12:10:11 +1000 |
User-agent: | Mozilla Thunderbird |
On 2/7/24 00:23, Peter Maydell wrote:
+++ b/linux-user/aarch64/target_prctl.h @@ -173,21 +173,22 @@ static abi_long do_prctl_set_tagged_addr_ctrl(CPUArchState *env, abi_long arg2) env->tagged_addr_enable = arg2 & PR_TAGGED_ADDR_ENABLE; if (cpu_isar_feature(aa64_mte, cpu)) { - switch (arg2 & PR_MTE_TCF_MASK) { - case PR_MTE_TCF_NONE: - case PR_MTE_TCF_SYNC: - case PR_MTE_TCF_ASYNC: - break; - default: - return -EINVAL; - }We should probably check here and reject unknown bits being set in arg2, as set_tagged_addr_ctrl() does; but the old code didn't get that right either.
This is done higher up in this function: if (arg2 & ~valid_mask) { return -TARGET_EINVAL; }The rejection of ASYNC | SYNC here was either a bug in my original implementation, or the kernel API changed since the initial implementation in June 2020 (not worth digging to find out).
r~
[Prev in Thread] | Current Thread | [Next in Thread] |