diff mbox series

[RFC,v2,08/10] target/arm: Introduce user_mask to indicate whether the feature is set explicitly

Message ID 20200917121449.3442059-9-liangpeng10@huawei.com (mailing list archive)
State New, archived
Headers show
Series Support disable/enable CPU features for AArch64 | expand

Commit Message

Peng Liang Sept. 17, 2020, 12:14 p.m. UTC
To add CPU feature dependencies, we need to known whether a CPU feature
is set explicitly or automatically by dependencies mechanism.  Introduce
user_mask to do that.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
---
 target/arm/cpu.h | 1 +
 target/arm/cpu.c | 2 ++
 2 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index d93ad0f8f00e..c7513a5d393c 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -925,6 +925,7 @@  struct ARMCPU {
      */
     struct ARMISARegisters {
         uint64_t regs[ID_MAX];
+        uint64_t user_mask[ID_MAX];
     } isar;
     uint64_t midr;
     uint32_t revidr;
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 10a52518dd14..36375807e19d 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1312,6 +1312,8 @@  static void arm_cpu_set_feature_prop(Object *obj, Visitor *v, const char *name,
                                           feat->shift, feat->length,
                                           feat->ni_value);
     }
+
+    isar->user_mask[feat->reg] |= MAKE_64BIT_MASK(feat->shift, feat->length);
 }
 
 static void arm_cpu_register_feature_props(ARMCPU *cpu)