1 | A respin/update on the aarch64 KVM cpu models. Also available at | ||
---|---|---|---|
2 | gitlab.com/cohuck/qemu arm-cpu-model-rfcv2 | ||
3 | |||
4 | Find Eric's original cover letter below, so that I do not need to | ||
5 | repeat myself on the aspects that have not changed since RFCv1 :) | ||
6 | |||
7 | Changes from RFCv1: | ||
8 | |||
9 | Rebased on more recent QEMU (some adaptions in the register conversions | ||
10 | of the first few patches.) | ||
11 | |||
12 | Based on feedback, I have removed the "custom" cpu model; instead, I | ||
13 | have added the new SYSREG_<REG>_<FIELD> properties to the "host" model. | ||
14 | This works well if you want to tweak anything that does not correspond | ||
15 | to the existing properties for the host model; however, if you e.g. | ||
16 | wanted to tweak sve, you have two ways to do so -- we'd probably either | ||
17 | want to check for conflicts, or just declare precedence. The kvm-specific | ||
18 | props remain unchanged, as they are orthogonal to this configuration. | ||
19 | |||
20 | The cpu model expansion for the "host" model now dumps the new SYSREG_ | ||
21 | properties in addition to the existing host model properties; this is a | ||
22 | bit ugly, but I don't see a good way on how to split this up. | ||
23 | |||
24 | Some more adaptions due to the removal of the "custom" model. | ||
25 | |||
26 | Things *not* changed from RFCv1: | ||
27 | |||
28 | SYSREG_ property naming (can be tweaked easily, once we are clear on what | ||
29 | the interface should look like.) | ||
30 | |||
31 | Sysreg generation scripts, and the generated files (I have not updated | ||
32 | anything there.) I think generating the various definitions makes sense, | ||
33 | as long as we double-check the generated files on each update (which would | ||
34 | be something to trigger manually anyway.) | ||
35 | |||
36 | What I would like us to reach some kind of consensus on: | ||
37 | |||
38 | How to continue with the patches moving the ID registers from the isar | ||
39 | struct into the idregs array. These are a bit of churn to drag along; | ||
40 | if they make sense, maybe they can be picked independently of this series? | ||
41 | |||
42 | Whether it make sense to continue with the approach of tweaking values in | ||
43 | the ID registers in general. If we want to be able to migrate between cpus | ||
44 | that do not differ wildly, we'll encounter differences that cannot be | ||
45 | expressed via FEAT_xxx -- e.g. when comparing various AmpereAltra Max systems, | ||
46 | they only differ in parts of CTR_EL0 -- which is not a feature register, but | ||
47 | a writable register. | ||
48 | |||
49 | Please take a look, and looking forward to your feedback :) | ||
50 | |||
51 | *********************************************************************** | ||
52 | |||
53 | Title: Introduce a customizable aarch64 KVM host model | ||
54 | |||
1 | This RFC series introduces a KVM host "custom" model. | 55 | This RFC series introduces a KVM host "custom" model. |
2 | 56 | ||
3 | Since v6.7 kernel, KVM/arm allows the userspace to overwrite the values | 57 | Since v6.7 kernel, KVM/arm allows the userspace to overwrite the values |
4 | of a subset of ID regs. The list of writable fields continues to grow. | 58 | of a subset of ID regs. The list of writable fields continues to grow. |
5 | The feature ID range is defined as the AArch64 System register space | 59 | The feature ID range is defined as the AArch64 System register space |
6 | with op0==3, op1=={0, 1, 3}, CRn==0, CRm=={0-7}, op2=={0-7}. | 60 | with op0==3, op1=={0, 1, 3}, CRn==0, CRm=={0-7}, op2=={0-7}. |
7 | 61 | ||
8 | The custom model uses this capability and allows to tune the host | 62 | The custom model uses this capability and allows to tune the host |
9 | passthrough model by overriding some of the host passthrough ID regs. | 63 | passthrough model by overriding some of the host passthrough ID regs. |
10 | 64 | ||
11 | The end goal is to get more flexibility when migrating guests | 65 | The end goal is to get more flexibility when migrating guests |
12 | between different machines. We would like the upper software layer | 66 | between different machines. We would like the upper software layer |
13 | to be able detect how tunable the vpcu is on both source and destination | 67 | to be able detect how tunable the vpcu is on both source and destination |
14 | and accordingly define a customized KVM host model that can fit | 68 | and accordingly define a customized KVM host model that can fit |
... | ... | ||
42 | match them against a "human readable" description of those fields. | 96 | match them against a "human readable" description of those fields. |
43 | We use awk scripts, derived from kernel arch/arm64/tools/gen-sysreg.awk | 97 | We use awk scripts, derived from kernel arch/arm64/tools/gen-sysreg.awk |
44 | (so all the credit to Mark Rutland) that populates a data structure | 98 | (so all the credit to Mark Rutland) that populates a data structure |
45 | which describes all the ID regs in sysreg and their fields. We match | 99 | which describes all the ID regs in sysreg and their fields. We match |
46 | writable ID reg fields with those latter and dynamically create a | 100 | writable ID reg fields with those latter and dynamically create a |
47 | uint64 property. | 101 | uint64 property. |
48 | 102 | ||
49 | Then we need to extend the list of id regs read from the host | 103 | Then we need to extend the list of id regs read from the host |
50 | so that we get a chance to let their value overriden and write them | 104 | so that we get a chance to let their value overriden and write them |
51 | back into KVM . | 105 | back into KVM . |
52 | 106 | ||
... | ... | ||
56 | 110 | ||
57 | Obviously this series is not able to cope with non writable ID regs. | 111 | Obviously this series is not able to cope with non writable ID regs. |
58 | For instance the problematic of MIDR/REVIDR setting is not handled | 112 | For instance the problematic of MIDR/REVIDR setting is not handled |
59 | at the moment. | 113 | at the moment. |
60 | 114 | ||
61 | Connie & Eric | ||
62 | |||
63 | This series can be found at: | ||
64 | https://github.com/eauger/qemu/tree/custom-cpu-model-rfc | ||
65 | 115 | ||
66 | TESTS: | 116 | TESTS: |
67 | - with few IDREG fields that can be easily examined from guest | 117 | - with few IDREG fields that can be easily examined from guest |
68 | userspace: | 118 | userspace: |
69 | -cpu custom,SYSREG_ID_AA64ISAR0_EL1_DP=0x0,SYSREG_ID_AA64ISAR1_EL1_DPB=0x0 | 119 | -cpu custom,SYSREG_ID_AA64ISAR0_EL1_DP=0x0,SYSREG_ID_AA64ISAR1_EL1_DPB=0x0 |
... | ... | ||
125 | [4] linux "sysreg" file | 175 | [4] linux "sysreg" file |
126 | linux/arch/arm64/tools/sysreg and gen-sysreg.awk | 176 | linux/arch/arm64/tools/sysreg and gen-sysreg.awk |
127 | ./tools/include/generated/asm/sysreg-defs.h | 177 | ./tools/include/generated/asm/sysreg-defs.h |
128 | 178 | ||
129 | 179 | ||
130 | Cornelia Huck (4): | 180 | Cornelia Huck (3): |
131 | kvm: kvm_get_writable_id_regs | 181 | kvm: kvm_get_writable_id_regs |
132 | virt: Allow custom vcpu model in arm virt | 182 | arm-qmp-cmds: introspection for ID register props |
133 | arm-qmp-cmds: introspection for custom model | 183 | arm/cpu-features: document ID reg properties |
134 | arm/cpu-features: Document custom vcpu model | ||
135 | 184 | ||
136 | Eric Auger (17): | 185 | Eric Auger (17): |
137 | arm/cpu: Add sysreg definitions in cpu-sysegs.h | 186 | arm/cpu: Add sysreg definitions in cpu-sysregs.h |
138 | arm/cpu: Store aa64isar0 into the idregs arrays | 187 | arm/cpu: Store aa64isar0 into the idregs arrays |
139 | arm/cpu: Store aa64isar1/2 into the idregs array | 188 | arm/cpu: Store aa64isar1/2 into the idregs array |
140 | arm/cpu: Store aa64drf0/1 into the idregs array | 189 | arm/cpu: Store aa64drf0/1 into the idregs array |
141 | arm/cpu: Store aa64mmfr0-3 into the idregs array | 190 | arm/cpu: Store aa64mmfr0-3 into the idregs array |
142 | arm/cpu: Store aa64drf0/1 into the idregs array | 191 | arm/cpu: Store aa64drf0/1 into the idregs array |
... | ... | ||
148 | arm/cpu: Add infra to handle generated ID register definitions | 197 | arm/cpu: Add infra to handle generated ID register definitions |
149 | arm/cpu: Add sysreg generation scripts | 198 | arm/cpu: Add sysreg generation scripts |
150 | arm/cpu: Add generated files | 199 | arm/cpu: Add generated files |
151 | arm/kvm: Allow reading all the writable ID registers | 200 | arm/kvm: Allow reading all the writable ID registers |
152 | arm/kvm: write back modified ID regs to KVM | 201 | arm/kvm: write back modified ID regs to KVM |
153 | arm/cpu: Introduce a customizable kvm host cpu model | 202 | arm/cpu: more customization for the kvm host cpu model |
154 | 203 | ||
155 | docs/system/arm/cpu-features.rst | 55 ++- | 204 | docs/system/arm/cpu-features.rst | 47 +- |
205 | hw/intc/armv7m_nvic.c | 27 +- | ||
206 | scripts/gen-cpu-sysreg-properties.awk | 325 ++++++++++++ | ||
207 | scripts/gen-cpu-sysregs-header.awk | 47 ++ | ||
208 | scripts/update-aarch64-sysreg-code.sh | 27 + | ||
209 | target/arm/arm-qmp-cmds.c | 19 + | ||
156 | target/arm/cpu-custom.h | 58 +++ | 210 | target/arm/cpu-custom.h | 58 +++ |
157 | target/arm/cpu-features.h | 307 ++++++------ | 211 | target/arm/cpu-features.h | 311 ++++++------ |
212 | target/arm/cpu-sysreg-properties.c | 682 ++++++++++++++++++++++++++ | ||
158 | target/arm/cpu-sysregs.h | 152 ++++++ | 213 | target/arm/cpu-sysregs.h | 152 ++++++ |
214 | target/arm/cpu.c | 123 ++--- | ||
159 | target/arm/cpu.h | 120 +++-- | 215 | target/arm/cpu.h | 120 +++-- |
216 | target/arm/cpu64.c | 260 +++++++--- | ||
217 | target/arm/helper.c | 68 +-- | ||
160 | target/arm/internals.h | 6 +- | 218 | target/arm/internals.h | 6 +- |
219 | target/arm/kvm.c | 253 +++++++--- | ||
161 | target/arm/kvm_arm.h | 16 +- | 220 | target/arm/kvm_arm.h | 16 +- |
162 | hw/arm/virt.c | 3 + | 221 | target/arm/meson.build | 1 + |
163 | hw/intc/armv7m_nvic.c | 27 +- | ||
164 | target/arm/arm-qmp-cmds.c | 56 ++- | ||
165 | target/arm/cpu-sysreg-properties.c | 682 ++++++++++++++++++++++++++ | ||
166 | target/arm/cpu.c | 124 +++-- | ||
167 | target/arm/cpu64.c | 265 +++++++--- | ||
168 | target/arm/helper.c | 68 +-- | ||
169 | target/arm/kvm.c | 253 +++++++--- | ||
170 | target/arm/ptw.c | 6 +- | 222 | target/arm/ptw.c | 6 +- |
171 | target/arm/tcg/cpu-v7m.c | 174 +++---- | 223 | target/arm/tcg/cpu-v7m.c | 174 +++---- |
172 | target/arm/tcg/cpu32.c | 320 ++++++------ | 224 | target/arm/tcg/cpu32.c | 320 ++++++------ |
173 | target/arm/tcg/cpu64.c | 460 ++++++++--------- | 225 | target/arm/tcg/cpu64.c | 460 ++++++++--------- |
174 | scripts/gen-cpu-sysreg-properties.awk | 325 ++++++++++++ | ||
175 | scripts/gen-cpu-sysregs-header.awk | 47 ++ | ||
176 | scripts/update-aarch64-sysreg-code.sh | 27 + | ||
177 | target/arm/meson.build | 1 + | ||
178 | target/arm/trace-events | 8 + | 226 | target/arm/trace-events | 8 + |
179 | 24 files changed, 2646 insertions(+), 914 deletions(-) | 227 | 23 files changed, 2594 insertions(+), 916 deletions(-) |
180 | create mode 100644 target/arm/cpu-custom.h | ||
181 | create mode 100644 target/arm/cpu-sysregs.h | ||
182 | create mode 100644 target/arm/cpu-sysreg-properties.c | ||
183 | create mode 100755 scripts/gen-cpu-sysreg-properties.awk | 228 | create mode 100755 scripts/gen-cpu-sysreg-properties.awk |
184 | create mode 100755 scripts/gen-cpu-sysregs-header.awk | 229 | create mode 100755 scripts/gen-cpu-sysregs-header.awk |
185 | create mode 100755 scripts/update-aarch64-sysreg-code.sh | 230 | create mode 100755 scripts/update-aarch64-sysreg-code.sh |
231 | create mode 100644 target/arm/cpu-custom.h | ||
232 | create mode 100644 target/arm/cpu-sysreg-properties.c | ||
233 | create mode 100644 target/arm/cpu-sysregs.h | ||
186 | 234 | ||
187 | -- | 235 | -- |
188 | 2.41.0 | 236 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Cornelia Huck <cohuck@redhat.com> | ||
---|---|---|---|
2 | |||
3 | Add an helper to retrieve the writable id reg bitmask. The | 1 | Add an helper to retrieve the writable id reg bitmask. The |
4 | status of the query is stored in the CPU struct so that an | 2 | status of the query is stored in the CPU struct so that an |
5 | an error, if any, can be reported on vcpu realize(). | 3 | an error, if any, can be reported on vcpu realize(). |
6 | 4 | ||
7 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 5 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
8 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | 6 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> |
9 | --- | 7 | --- |
10 | target/arm/cpu.h | 19 +++++++++++++++++++ | 8 | target/arm/cpu.h | 19 +++++++++++++++++++ |
9 | target/arm/kvm.c | 32 ++++++++++++++++++++++++++++++++ | ||
11 | target/arm/kvm_arm.h | 7 +++++++ | 10 | target/arm/kvm_arm.h | 7 +++++++ |
12 | target/arm/kvm.c | 32 ++++++++++++++++++++++++++++++++ | ||
13 | 3 files changed, 58 insertions(+) | 11 | 3 files changed, 58 insertions(+) |
14 | 12 | ||
15 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 13 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h |
16 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/cpu.h | 15 | --- a/target/arm/cpu.h |
... | ... | ||
47 | + ARMIdRegsState writable_id_regs; | 45 | + ARMIdRegsState writable_id_regs; |
48 | + | 46 | + |
49 | /* QOM property to indicate we should use the back-compat CNTFRQ default */ | 47 | /* QOM property to indicate we should use the back-compat CNTFRQ default */ |
50 | bool backcompat_cntfrq; | 48 | bool backcompat_cntfrq; |
51 | 49 | ||
52 | diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h | ||
53 | index XXXXXXX..XXXXXXX 100644 | ||
54 | --- a/target/arm/kvm_arm.h | ||
55 | +++ b/target/arm/kvm_arm.h | ||
56 | @@ -XXX,XX +XXX,XX @@ void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa); | ||
57 | |||
58 | int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); | ||
59 | |||
60 | +int kvm_arm_get_writable_id_regs(ARMCPU *cpu, IdRegMap *idregmap); | ||
61 | + | ||
62 | #else | ||
63 | |||
64 | /* | ||
65 | @@ -XXX,XX +XXX,XX @@ static inline bool kvm_arm_sve_supported(void) | ||
66 | return false; | ||
67 | } | ||
68 | |||
69 | +static inline int kvm_arm_get_writable_id_regs(ARMCPU *cpu, IdRegMap *idregmap) | ||
70 | +{ | ||
71 | + return -ENOSYS; | ||
72 | +} | ||
73 | + | ||
74 | /* | ||
75 | * These functions should never actually be called without KVM support. | ||
76 | */ | ||
77 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | 50 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c |
78 | index XXXXXXX..XXXXXXX 100644 | 51 | index XXXXXXX..XXXXXXX 100644 |
79 | --- a/target/arm/kvm.c | 52 | --- a/target/arm/kvm.c |
80 | +++ b/target/arm/kvm.c | 53 | +++ b/target/arm/kvm.c |
81 | @@ -XXX,XX +XXX,XX @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { | 54 | @@ -XXX,XX +XXX,XX @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { |
... | ... | ||
122 | +} | 95 | +} |
123 | + | 96 | + |
124 | static bool kvm_no_adjvtime_get(Object *obj, Error **errp) | 97 | static bool kvm_no_adjvtime_get(Object *obj, Error **errp) |
125 | { | 98 | { |
126 | return !ARM_CPU(obj)->kvm_adjvtime; | 99 | return !ARM_CPU(obj)->kvm_adjvtime; |
100 | diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h | ||
101 | index XXXXXXX..XXXXXXX 100644 | ||
102 | --- a/target/arm/kvm_arm.h | ||
103 | +++ b/target/arm/kvm_arm.h | ||
104 | @@ -XXX,XX +XXX,XX @@ int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); | ||
105 | |||
106 | void kvm_arm_enable_mte(Object *cpuobj, Error **errp); | ||
107 | |||
108 | +int kvm_arm_get_writable_id_regs(ARMCPU *cpu, IdRegMap *idregmap); | ||
109 | + | ||
110 | #else | ||
111 | |||
112 | /* | ||
113 | @@ -XXX,XX +XXX,XX @@ static inline bool kvm_arm_mte_supported(void) | ||
114 | return false; | ||
115 | } | ||
116 | |||
117 | +static inline int kvm_arm_get_writable_id_regs(ARMCPU *cpu, IdRegMap *idregmap) | ||
118 | +{ | ||
119 | + return -ENOSYS; | ||
120 | +} | ||
121 | + | ||
122 | /* | ||
123 | * These functions should never actually be called without KVM support. | ||
124 | */ | ||
127 | -- | 125 | -- |
128 | 2.41.0 | 126 | 2.47.0 | diff view generated by jsdifflib |
1 | This new header contains macros that define aarch64 regiters. | 1 | From: Eric Auger <eric.auger@redhat.com> |
---|---|---|---|
2 | In a subsequent patche, this will be replaced by a more exhaustive | 2 | |
3 | This new header contains macros that define aarch64 registers. | ||
4 | In a subsequent patch, this will be replaced by a more exhaustive | ||
3 | version that will be generated from linux arch/arm64/tools/sysreg | 5 | version that will be generated from linux arch/arm64/tools/sysreg |
4 | file. Those macros are sufficient to migrate the storage of those | 6 | file. Those macros are sufficient to migrate the storage of those |
5 | ID regs from named fields in isar struct to an array cell. | 7 | ID regs from named fields in isar struct to an array cell. |
6 | 8 | ||
7 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 9 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
10 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
8 | --- | 11 | --- |
9 | target/arm/cpu-sysregs.h | 42 +++++++++++++++++++++++++++++++ | 12 | target/arm/cpu-sysregs.h | 42 +++++++++++++++++++++++++++++++ |
10 | target/arm/cpu.h | 54 ++++++++++++++++++++++++++++++++++++++++ | 13 | target/arm/cpu.h | 54 ++++++++++++++++++++++++++++++++++++++++ |
11 | 2 files changed, 96 insertions(+) | 14 | 2 files changed, 96 insertions(+) |
12 | create mode 100644 target/arm/cpu-sysregs.h | 15 | create mode 100644 target/arm/cpu-sysregs.h |
... | ... | ||
137 | + IdRegMap idregs; | 140 | + IdRegMap idregs; |
138 | } isar; | 141 | } isar; |
139 | uint64_t midr; | 142 | uint64_t midr; |
140 | uint32_t revidr; | 143 | uint32_t revidr; |
141 | -- | 144 | -- |
142 | 2.41.0 | 145 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
3 | target/arm/cpu-features.h | 57 ++++++++++++++++++++------------------- | 6 | target/arm/cpu-features.h | 57 ++++++++++++++++++++------------------- |
7 | target/arm/cpu.c | 14 ++++------ | ||
4 | target/arm/cpu.h | 2 -- | 8 | target/arm/cpu.h | 2 -- |
5 | target/arm/cpu.c | 13 ++++----- | ||
6 | target/arm/cpu64.c | 8 +++--- | 9 | target/arm/cpu64.c | 8 +++--- |
7 | target/arm/helper.c | 6 +++-- | 10 | target/arm/helper.c | 6 +++-- |
8 | target/arm/kvm.c | 20 +++++++++++--- | 11 | target/arm/kvm.c | 20 +++++++++++--- |
9 | target/arm/tcg/cpu64.c | 44 ++++++++++++++++++------------ | 12 | target/arm/tcg/cpu64.c | 44 ++++++++++++++++++------------ |
10 | 7 files changed, 86 insertions(+), 64 deletions(-) | 13 | 7 files changed, 86 insertions(+), 65 deletions(-) |
11 | 14 | ||
12 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | 15 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h |
13 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/arm/cpu-features.h | 17 | --- a/target/arm/cpu-features.h |
15 | +++ b/target/arm/cpu-features.h | 18 | +++ b/target/arm/cpu-features.h |
16 | @@ -XXX,XX +XXX,XX @@ | 19 | @@ -XXX,XX +XXX,XX @@ |
17 | #define TARGET_ARM_FEATURES_H | ||
18 | 20 | ||
19 | #include "hw/registerfields.h" | 21 | #include "hw/registerfields.h" |
22 | #include "qemu/host-utils.h" | ||
20 | +#include "cpu-sysregs.h" | 23 | +#include "cpu-sysregs.h" |
21 | 24 | ||
22 | /* | 25 | /* |
23 | * Naming convention for isar_feature functions: | 26 | * Naming convention for isar_feature functions: |
24 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_doublelock(const ARMISARegisters *id) | 27 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_doublelock(const ARMISARegisters *id) |
... | ... | ||
193 | - return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, F64MM) != 0; | 196 | - return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, F64MM) != 0; |
194 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ZFR0, F64MM) != 0; | 197 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ZFR0, F64MM) != 0; |
195 | } | 198 | } |
196 | 199 | ||
197 | static inline bool isar_feature_aa64_sme_f64f64(const ARMISARegisters *id) | 200 | static inline bool isar_feature_aa64_sme_f64f64(const ARMISARegisters *id) |
201 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
202 | index XXXXXXX..XXXXXXX 100644 | ||
203 | --- a/target/arm/cpu.c | ||
204 | +++ b/target/arm/cpu.c | ||
205 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
206 | { | ||
207 | CPUState *cs = CPU(dev); | ||
208 | ARMCPU *cpu = ARM_CPU(dev); | ||
209 | + IdRegMap *idregs = &cpu->isar.idregs; | ||
210 | ARMCPUClass *acc = ARM_CPU_GET_CLASS(dev); | ||
211 | CPUARMState *env = &cpu->env; | ||
212 | Error *local_err = NULL; | ||
213 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
214 | |||
215 | unset_feature(env, ARM_FEATURE_NEON); | ||
216 | |||
217 | - t = cpu->isar.id_aa64isar0; | ||
218 | + t = GET_IDREG(idregs, ID_AA64ISAR0); | ||
219 | t = FIELD_DP64(t, ID_AA64ISAR0, AES, 0); | ||
220 | t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 0); | ||
221 | t = FIELD_DP64(t, ID_AA64ISAR0, SHA2, 0); | ||
222 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
223 | t = FIELD_DP64(t, ID_AA64ISAR0, SM3, 0); | ||
224 | t = FIELD_DP64(t, ID_AA64ISAR0, SM4, 0); | ||
225 | t = FIELD_DP64(t, ID_AA64ISAR0, DP, 0); | ||
226 | - cpu->isar.id_aa64isar0 = t; | ||
227 | + SET_IDREG(idregs, ID_AA64ISAR0, t); | ||
228 | |||
229 | t = cpu->isar.id_aa64isar1; | ||
230 | t = FIELD_DP64(t, ID_AA64ISAR1, FCMA, 0); | ||
231 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
232 | } | ||
233 | |||
234 | if (!cpu->has_neon && !cpu->has_vfp) { | ||
235 | - uint64_t t; | ||
236 | uint32_t u; | ||
237 | |||
238 | - t = cpu->isar.id_aa64isar0; | ||
239 | - t = FIELD_DP64(t, ID_AA64ISAR0, FHM, 0); | ||
240 | - cpu->isar.id_aa64isar0 = t; | ||
241 | + FIELD_DP64_IDREG(idregs, ID_AA64ISAR0, FHM, 0); | ||
242 | |||
243 | - t = cpu->isar.id_aa64isar1; | ||
244 | - t = FIELD_DP64(t, ID_AA64ISAR1, FRINTTS, 0); | ||
245 | - cpu->isar.id_aa64isar1 = t; | ||
246 | + FIELD_DP64_IDREG(idregs, ID_AA64ISAR1, FRINTTS, 0); | ||
247 | |||
248 | u = cpu->isar.mvfr0; | ||
249 | u = FIELD_DP32(u, MVFR0, SIMDREG, 0); | ||
198 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 250 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h |
199 | index XXXXXXX..XXXXXXX 100644 | 251 | index XXXXXXX..XXXXXXX 100644 |
200 | --- a/target/arm/cpu.h | 252 | --- a/target/arm/cpu.h |
201 | +++ b/target/arm/cpu.h | 253 | +++ b/target/arm/cpu.h |
202 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | 254 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { |
... | ... | ||
213 | uint64_t id_aa64dfr1; | 265 | uint64_t id_aa64dfr1; |
214 | - uint64_t id_aa64zfr0; | 266 | - uint64_t id_aa64zfr0; |
215 | uint64_t id_aa64smfr0; | 267 | uint64_t id_aa64smfr0; |
216 | uint64_t reset_pmcr_el0; | 268 | uint64_t reset_pmcr_el0; |
217 | IdRegMap idregs; | 269 | IdRegMap idregs; |
218 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
219 | index XXXXXXX..XXXXXXX 100644 | ||
220 | --- a/target/arm/cpu.c | ||
221 | +++ b/target/arm/cpu.c | ||
222 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
223 | { | ||
224 | CPUState *cs = CPU(dev); | ||
225 | ARMCPU *cpu = ARM_CPU(dev); | ||
226 | + IdRegMap *idregs = &cpu->isar.idregs; | ||
227 | ARMCPUClass *acc = ARM_CPU_GET_CLASS(dev); | ||
228 | CPUARMState *env = &cpu->env; | ||
229 | Error *local_err = NULL; | ||
230 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
231 | |||
232 | unset_feature(env, ARM_FEATURE_NEON); | ||
233 | |||
234 | - t = cpu->isar.id_aa64isar0; | ||
235 | + t = GET_IDREG(idregs, ID_AA64ISAR0); | ||
236 | t = FIELD_DP64(t, ID_AA64ISAR0, AES, 0); | ||
237 | t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 0); | ||
238 | t = FIELD_DP64(t, ID_AA64ISAR0, SHA2, 0); | ||
239 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
240 | t = FIELD_DP64(t, ID_AA64ISAR0, SM3, 0); | ||
241 | t = FIELD_DP64(t, ID_AA64ISAR0, SM4, 0); | ||
242 | t = FIELD_DP64(t, ID_AA64ISAR0, DP, 0); | ||
243 | - cpu->isar.id_aa64isar0 = t; | ||
244 | + SET_IDREG(idregs, ID_AA64ISAR0, t); | ||
245 | |||
246 | t = cpu->isar.id_aa64isar1; | ||
247 | t = FIELD_DP64(t, ID_AA64ISAR1, FCMA, 0); | ||
248 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
249 | uint64_t t; | ||
250 | uint32_t u; | ||
251 | |||
252 | - t = cpu->isar.id_aa64isar0; | ||
253 | - t = FIELD_DP64(t, ID_AA64ISAR0, FHM, 0); | ||
254 | - cpu->isar.id_aa64isar0 = t; | ||
255 | + FIELD_DP64_IDREG(idregs, ID_AA64ISAR0, FHM, 0); | ||
256 | |||
257 | - t = cpu->isar.id_aa64isar1; | ||
258 | - t = FIELD_DP64(t, ID_AA64ISAR1, FRINTTS, 0); | ||
259 | - cpu->isar.id_aa64isar1 = t; | ||
260 | + FIELD_DP64_IDREG(idregs, ID_AA64ISAR1, FRINTTS, 0); | ||
261 | |||
262 | u = cpu->isar.mvfr0; | ||
263 | u = FIELD_DP32(u, MVFR0, SIMDREG, 0); | ||
264 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 270 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
265 | index XXXXXXX..XXXXXXX 100644 | 271 | index XXXXXXX..XXXXXXX 100644 |
266 | --- a/target/arm/cpu64.c | 272 | --- a/target/arm/cpu64.c |
267 | +++ b/target/arm/cpu64.c | 273 | +++ b/target/arm/cpu64.c |
268 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) | 274 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) |
... | ... | ||
400 | 406 | ||
401 | diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c | 407 | diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c |
402 | index XXXXXXX..XXXXXXX 100644 | 408 | index XXXXXXX..XXXXXXX 100644 |
403 | --- a/target/arm/tcg/cpu64.c | 409 | --- a/target/arm/tcg/cpu64.c |
404 | +++ b/target/arm/tcg/cpu64.c | 410 | +++ b/target/arm/tcg/cpu64.c |
405 | @@ -XXX,XX +XXX,XX @@ static uint64_t make_ccsidr64(unsigned assoc, unsigned linesize, | 411 | @@ -XXX,XX +XXX,XX @@ |
406 | static void aarch64_a35_initfn(Object *obj) | 412 | static void aarch64_a35_initfn(Object *obj) |
407 | { | 413 | { |
408 | ARMCPU *cpu = ARM_CPU(obj); | 414 | ARMCPU *cpu = ARM_CPU(obj); |
409 | + IdRegMap *idregs = &cpu->isar.idregs; | 415 | + IdRegMap *idregs = &cpu->isar.idregs; |
410 | 416 | ||
... | ... | ||
486 | + SET_IDREG(idregs, ID_AA64ISAR0, 0x0000000010211120); | 492 | + SET_IDREG(idregs, ID_AA64ISAR0, 0x0000000010211120); |
487 | cpu->isar.id_aa64isar1 = 0x0000000000010001; | 493 | cpu->isar.id_aa64isar1 = 0x0000000000010001; |
488 | - cpu->isar.id_aa64zfr0 = 0x0000000000000000; | 494 | - cpu->isar.id_aa64zfr0 = 0x0000000000000000; |
489 | + SET_IDREG(idregs, ID_AA64ZFR0, 0x0000000000000000); | 495 | + SET_IDREG(idregs, ID_AA64ZFR0, 0x0000000000000000); |
490 | cpu->clidr = 0x0000000080000023; | 496 | cpu->clidr = 0x0000000080000023; |
491 | cpu->ccsidr[0] = 0x7007e01c; /* 64KB L1 dcache */ | 497 | /* 64KB L1 dcache */ |
492 | cpu->ccsidr[1] = 0x2007e01c; /* 64KB L1 icache */ | 498 | cpu->ccsidr[0] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 4, 256, 64 * KiB, 7); |
493 | @@ -XXX,XX +XXX,XX @@ static void define_neoverse_v1_cp_reginfo(ARMCPU *cpu) | 499 | @@ -XXX,XX +XXX,XX @@ static void define_neoverse_v1_cp_reginfo(ARMCPU *cpu) |
494 | static void aarch64_neoverse_n1_initfn(Object *obj) | 500 | static void aarch64_neoverse_n1_initfn(Object *obj) |
495 | { | 501 | { |
496 | ARMCPU *cpu = ARM_CPU(obj); | 502 | ARMCPU *cpu = ARM_CPU(obj); |
497 | + IdRegMap *idregs = &cpu->isar.idregs; | 503 | + IdRegMap *idregs = &cpu->isar.idregs; |
... | ... | ||
519 | cpu->id_aa64afr1 = 0x00000000; | 525 | cpu->id_aa64afr1 = 0x00000000; |
520 | cpu->isar.id_aa64dfr0 = 0x000001f210305519ull; | 526 | cpu->isar.id_aa64dfr0 = 0x000001f210305519ull; |
521 | cpu->isar.id_aa64dfr1 = 0x00000000; | 527 | cpu->isar.id_aa64dfr1 = 0x00000000; |
522 | - cpu->isar.id_aa64isar0 = 0x1011111110212120ull; /* with FEAT_RNG */ | 528 | - cpu->isar.id_aa64isar0 = 0x1011111110212120ull; /* with FEAT_RNG */ |
523 | + SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ | 529 | + SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ |
524 | cpu->isar.id_aa64isar1 = 0x0111000001211032ull; | 530 | cpu->isar.id_aa64isar1 = 0x0011100001211032ull; |
525 | cpu->isar.id_aa64mmfr0 = 0x0000000000101125ull; | 531 | cpu->isar.id_aa64mmfr0 = 0x0000000000101125ull; |
526 | cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull; | 532 | cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull; |
527 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_v1_initfn(Object *obj) | 533 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_v1_initfn(Object *obj) |
528 | cpu->isar.mvfr2 = 0x00000043; | 534 | cpu->isar.mvfr2 = 0x00000043; |
529 | 535 | ||
... | ... | ||
622 | + SET_IDREG(idregs, ID_AA64ZFR0, t); | 628 | + SET_IDREG(idregs, ID_AA64ZFR0, t); |
623 | 629 | ||
624 | t = cpu->isar.id_aa64dfr0; | 630 | t = cpu->isar.id_aa64dfr0; |
625 | t = FIELD_DP64(t, ID_AA64DFR0, DEBUGVER, 10); /* FEAT_Debugv8p8 */ | 631 | t = FIELD_DP64(t, ID_AA64DFR0, DEBUGVER, 10); /* FEAT_Debugv8p8 */ |
626 | -- | 632 | -- |
627 | 2.41.0 | 633 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
3 | target/arm/cpu-features.h | 38 +++++++++++++++++++------------------- | 6 | target/arm/cpu-features.h | 40 +++++++++++++++++++-------------------- |
7 | target/arm/cpu.c | 8 +++----- | ||
4 | target/arm/cpu.h | 2 -- | 8 | target/arm/cpu.h | 2 -- |
5 | target/arm/cpu.c | 9 +++------ | ||
6 | target/arm/cpu64.c | 9 +++++---- | 9 | target/arm/cpu64.c | 9 +++++---- |
7 | target/arm/helper.c | 4 ++-- | 10 | target/arm/helper.c | 4 ++-- |
8 | target/arm/kvm.c | 6 ++---- | 11 | target/arm/kvm.c | 6 ++---- |
9 | target/arm/tcg/cpu64.c | 24 ++++++++++++------------ | 12 | target/arm/tcg/cpu64.c | 24 +++++++++++------------ |
10 | 7 files changed, 43 insertions(+), 49 deletions(-) | 13 | 7 files changed, 44 insertions(+), 49 deletions(-) |
11 | 14 | ||
12 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | 15 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h |
13 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/arm/cpu-features.h | 17 | --- a/target/arm/cpu-features.h |
15 | +++ b/target/arm/cpu-features.h | 18 | +++ b/target/arm/cpu-features.h |
... | ... | ||
92 | { | 95 | { |
93 | - return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, BF16) != 0; | 96 | - return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, BF16) != 0; |
94 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ISAR1, BF16) != 0; | 97 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ISAR1, BF16) != 0; |
95 | } | 98 | } |
96 | 99 | ||
100 | static inline bool isar_feature_aa64_ebf16(const ARMISARegisters *id) | ||
101 | { | ||
102 | - return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, BF16) > 1; | ||
103 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ISAR1, BF16) > 1; | ||
104 | } | ||
105 | |||
97 | static inline bool isar_feature_aa64_rcpc_8_3(const ARMISARegisters *id) | 106 | static inline bool isar_feature_aa64_rcpc_8_3(const ARMISARegisters *id) |
98 | { | 107 | { |
99 | - return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, LRCPC) != 0; | 108 | - return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, LRCPC) != 0; |
100 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ISAR1, LRCPC) != 0; | 109 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ISAR1, LRCPC) != 0; |
101 | } | 110 | } |
... | ... | ||
129 | - return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, MOPS); | 138 | - return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, MOPS); |
130 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ISAR2, MOPS); | 139 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64ISAR2, MOPS); |
131 | } | 140 | } |
132 | 141 | ||
133 | static inline bool isar_feature_aa64_fp_simd(const ARMISARegisters *id) | 142 | static inline bool isar_feature_aa64_fp_simd(const ARMISARegisters *id) |
143 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
144 | index XXXXXXX..XXXXXXX 100644 | ||
145 | --- a/target/arm/cpu.c | ||
146 | +++ b/target/arm/cpu.c | ||
147 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
148 | uint64_t t; | ||
149 | uint32_t u; | ||
150 | |||
151 | - t = cpu->isar.id_aa64isar1; | ||
152 | - t = FIELD_DP64(t, ID_AA64ISAR1, JSCVT, 0); | ||
153 | - cpu->isar.id_aa64isar1 = t; | ||
154 | + FIELD_DP64_IDREG(idregs, ID_AA64ISAR1, JSCVT, 0); | ||
155 | |||
156 | t = cpu->isar.id_aa64pfr0; | ||
157 | t = FIELD_DP64(t, ID_AA64PFR0, FP, 0xf); | ||
158 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
159 | t = FIELD_DP64(t, ID_AA64ISAR0, DP, 0); | ||
160 | SET_IDREG(idregs, ID_AA64ISAR0, t); | ||
161 | |||
162 | - t = cpu->isar.id_aa64isar1; | ||
163 | + t = GET_IDREG(idregs, ID_AA64ISAR1); | ||
164 | t = FIELD_DP64(t, ID_AA64ISAR1, FCMA, 0); | ||
165 | t = FIELD_DP64(t, ID_AA64ISAR1, BF16, 0); | ||
166 | t = FIELD_DP64(t, ID_AA64ISAR1, I8MM, 0); | ||
167 | - cpu->isar.id_aa64isar1 = t; | ||
168 | + SET_IDREG(idregs, ID_AA64ISAR1, t); | ||
169 | |||
170 | t = cpu->isar.id_aa64pfr0; | ||
171 | t = FIELD_DP64(t, ID_AA64PFR0, ADVSIMD, 0xf); | ||
134 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 172 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h |
135 | index XXXXXXX..XXXXXXX 100644 | 173 | index XXXXXXX..XXXXXXX 100644 |
136 | --- a/target/arm/cpu.h | 174 | --- a/target/arm/cpu.h |
137 | +++ b/target/arm/cpu.h | 175 | +++ b/target/arm/cpu.h |
138 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | 176 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { |
... | ... | ||
142 | - uint64_t id_aa64isar1; | 180 | - uint64_t id_aa64isar1; |
143 | - uint64_t id_aa64isar2; | 181 | - uint64_t id_aa64isar2; |
144 | uint64_t id_aa64pfr0; | 182 | uint64_t id_aa64pfr0; |
145 | uint64_t id_aa64pfr1; | 183 | uint64_t id_aa64pfr1; |
146 | uint64_t id_aa64mmfr0; | 184 | uint64_t id_aa64mmfr0; |
147 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
148 | index XXXXXXX..XXXXXXX 100644 | ||
149 | --- a/target/arm/cpu.c | ||
150 | +++ b/target/arm/cpu.c | ||
151 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
152 | uint64_t t; | ||
153 | uint32_t u; | ||
154 | |||
155 | - t = cpu->isar.id_aa64isar1; | ||
156 | - t = FIELD_DP64(t, ID_AA64ISAR1, JSCVT, 0); | ||
157 | - cpu->isar.id_aa64isar1 = t; | ||
158 | + FIELD_DP64_IDREG(idregs, ID_AA64ISAR1, JSCVT, 0); | ||
159 | |||
160 | t = cpu->isar.id_aa64pfr0; | ||
161 | t = FIELD_DP64(t, ID_AA64PFR0, FP, 0xf); | ||
162 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
163 | t = FIELD_DP64(t, ID_AA64ISAR0, DP, 0); | ||
164 | SET_IDREG(idregs, ID_AA64ISAR0, t); | ||
165 | |||
166 | - t = cpu->isar.id_aa64isar1; | ||
167 | + t = GET_IDREG(idregs, ID_AA64ISAR1); | ||
168 | t = FIELD_DP64(t, ID_AA64ISAR1, FCMA, 0); | ||
169 | t = FIELD_DP64(t, ID_AA64ISAR1, BF16, 0); | ||
170 | t = FIELD_DP64(t, ID_AA64ISAR1, I8MM, 0); | ||
171 | - cpu->isar.id_aa64isar1 = t; | ||
172 | + SET_IDREG(idregs, ID_AA64ISAR1, t); | ||
173 | |||
174 | t = cpu->isar.id_aa64pfr0; | ||
175 | t = FIELD_DP64(t, ID_AA64PFR0, ADVSIMD, 0xf); | ||
176 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
177 | } | ||
178 | |||
179 | if (!cpu->has_neon && !cpu->has_vfp) { | ||
180 | - uint64_t t; | ||
181 | uint32_t u; | ||
182 | |||
183 | FIELD_DP64_IDREG(idregs, ID_AA64ISAR0, FHM, 0); | ||
184 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 185 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
185 | index XXXXXXX..XXXXXXX 100644 | 186 | index XXXXXXX..XXXXXXX 100644 |
186 | --- a/target/arm/cpu64.c | 187 | --- a/target/arm/cpu64.c |
187 | +++ b/target/arm/cpu64.c | 188 | +++ b/target/arm/cpu64.c |
188 | @@ -XXX,XX +XXX,XX @@ void aarch64_add_sme_properties(Object *obj) | 189 | @@ -XXX,XX +XXX,XX @@ void aarch64_add_sme_properties(Object *obj) |
... | ... | ||
293 | SET_IDREG(idregs, ID_AA64ISAR0, 0x0000000010211120); | 294 | SET_IDREG(idregs, ID_AA64ISAR0, 0x0000000010211120); |
294 | - cpu->isar.id_aa64isar1 = 0x0000000000010001; | 295 | - cpu->isar.id_aa64isar1 = 0x0000000000010001; |
295 | + SET_IDREG(idregs, ID_AA64ISAR1, 0x0000000000010001); | 296 | + SET_IDREG(idregs, ID_AA64ISAR1, 0x0000000000010001); |
296 | SET_IDREG(idregs, ID_AA64ZFR0, 0x0000000000000000); | 297 | SET_IDREG(idregs, ID_AA64ZFR0, 0x0000000000000000); |
297 | cpu->clidr = 0x0000000080000023; | 298 | cpu->clidr = 0x0000000080000023; |
298 | cpu->ccsidr[0] = 0x7007e01c; /* 64KB L1 dcache */ | 299 | /* 64KB L1 dcache */ |
299 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_n1_initfn(Object *obj) | 300 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_n1_initfn(Object *obj) |
300 | cpu->dcz_blocksize = 4; | 301 | cpu->dcz_blocksize = 4; |
301 | cpu->isar.id_aa64dfr0 = 0x0000000110305408ull; | 302 | cpu->isar.id_aa64dfr0 = 0x0000000110305408ull; |
302 | SET_IDREG(idregs, ID_AA64ISAR0, 0x0000100010211120ull); | 303 | SET_IDREG(idregs, ID_AA64ISAR0, 0x0000100010211120ull); |
303 | - cpu->isar.id_aa64isar1 = 0x0000000000100001ull; | 304 | - cpu->isar.id_aa64isar1 = 0x0000000000100001ull; |
... | ... | ||
307 | cpu->isar.id_aa64mmfr2 = 0x0000000000001011ull; | 308 | cpu->isar.id_aa64mmfr2 = 0x0000000000001011ull; |
308 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_v1_initfn(Object *obj) | 309 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_v1_initfn(Object *obj) |
309 | cpu->isar.id_aa64dfr0 = 0x000001f210305519ull; | 310 | cpu->isar.id_aa64dfr0 = 0x000001f210305519ull; |
310 | cpu->isar.id_aa64dfr1 = 0x00000000; | 311 | cpu->isar.id_aa64dfr1 = 0x00000000; |
311 | SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ | 312 | SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ |
312 | - cpu->isar.id_aa64isar1 = 0x0111000001211032ull; | 313 | - cpu->isar.id_aa64isar1 = 0x0011100001211032ull; |
313 | + SET_IDREG(idregs, ID_AA64ISAR1, 0x0111000001211032ull); | 314 | + SET_IDREG(idregs, ID_AA64ISAR1, 0x0011000001211032ull); |
314 | cpu->isar.id_aa64mmfr0 = 0x0000000000101125ull; | 315 | cpu->isar.id_aa64mmfr0 = 0x0000000000101125ull; |
315 | cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull; | 316 | cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull; |
316 | cpu->isar.id_aa64mmfr2 = 0x0220011102101011ull; | 317 | cpu->isar.id_aa64mmfr2 = 0x0220011102101011ull; |
317 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a710_initfn(Object *obj) | 318 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a710_initfn(Object *obj) |
318 | cpu->id_aa64afr0 = 0; | 319 | cpu->id_aa64afr0 = 0; |
... | ... | ||
340 | + t = GET_IDREG(idregs, ID_AA64ISAR1); | 341 | + t = GET_IDREG(idregs, ID_AA64ISAR1); |
341 | t = FIELD_DP64(t, ID_AA64ISAR1, DPB, 2); /* FEAT_DPB2 */ | 342 | t = FIELD_DP64(t, ID_AA64ISAR1, DPB, 2); /* FEAT_DPB2 */ |
342 | t = FIELD_DP64(t, ID_AA64ISAR1, APA, PauthFeat_FPACCOMBINED); | 343 | t = FIELD_DP64(t, ID_AA64ISAR1, APA, PauthFeat_FPACCOMBINED); |
343 | t = FIELD_DP64(t, ID_AA64ISAR1, API, 1); | 344 | t = FIELD_DP64(t, ID_AA64ISAR1, API, 1); |
344 | @@ -XXX,XX +XXX,XX @@ void aarch64_max_tcg_initfn(Object *obj) | 345 | @@ -XXX,XX +XXX,XX @@ void aarch64_max_tcg_initfn(Object *obj) |
345 | t = FIELD_DP64(t, ID_AA64ISAR1, BF16, 1); /* FEAT_BF16 */ | 346 | t = FIELD_DP64(t, ID_AA64ISAR1, BF16, 2); /* FEAT_BF16, FEAT_EBF16 */ |
346 | t = FIELD_DP64(t, ID_AA64ISAR1, DGH, 1); /* FEAT_DGH */ | 347 | t = FIELD_DP64(t, ID_AA64ISAR1, DGH, 1); /* FEAT_DGH */ |
347 | t = FIELD_DP64(t, ID_AA64ISAR1, I8MM, 1); /* FEAT_I8MM */ | 348 | t = FIELD_DP64(t, ID_AA64ISAR1, I8MM, 1); /* FEAT_I8MM */ |
348 | - cpu->isar.id_aa64isar1 = t; | 349 | - cpu->isar.id_aa64isar1 = t; |
349 | + SET_IDREG(idregs, ID_AA64ISAR1, t); | 350 | + SET_IDREG(idregs, ID_AA64ISAR1, t); |
350 | 351 | ||
... | ... | ||
357 | + SET_IDREG(idregs, ID_AA64ISAR2, t); | 358 | + SET_IDREG(idregs, ID_AA64ISAR2, t); |
358 | 359 | ||
359 | t = cpu->isar.id_aa64pfr0; | 360 | t = cpu->isar.id_aa64pfr0; |
360 | t = FIELD_DP64(t, ID_AA64PFR0, FP, 1); /* FEAT_FP16 */ | 361 | t = FIELD_DP64(t, ID_AA64PFR0, FP, 1); /* FEAT_FP16 */ |
361 | -- | 362 | -- |
362 | 2.41.0 | 363 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
3 | target/arm/cpu-features.h | 40 ++++++++++++++++----------------- | 6 | target/arm/cpu-features.h | 40 ++++++++++++++++----------------- |
7 | target/arm/cpu.c | 29 ++++++++---------------- | ||
4 | target/arm/cpu.h | 5 +++-- | 8 | target/arm/cpu.h | 5 +++-- |
5 | target/arm/cpu.c | 27 +++++++--------------- | ||
6 | target/arm/cpu64.c | 14 ++++-------- | 9 | target/arm/cpu64.c | 14 ++++-------- |
7 | target/arm/helper.c | 6 ++--- | 10 | target/arm/helper.c | 6 ++--- |
8 | target/arm/kvm.c | 24 +++++++++----------- | 11 | target/arm/kvm.c | 24 +++++++++----------- |
9 | target/arm/tcg/cpu64.c | 47 ++++++++++++++++++--------------------- | 12 | target/arm/tcg/cpu64.c | 47 ++++++++++++++++++--------------------- |
10 | 7 files changed, 70 insertions(+), 93 deletions(-) | 13 | 7 files changed, 71 insertions(+), 94 deletions(-) |
11 | 14 | ||
12 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | 15 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h |
13 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/arm/cpu-features.h | 17 | --- a/target/arm/cpu-features.h |
15 | +++ b/target/arm/cpu-features.h | 18 | +++ b/target/arm/cpu-features.h |
... | ... | ||
138 | - return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, NMI) != 0; | 141 | - return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, NMI) != 0; |
139 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64PFR1, NMI) != 0; | 142 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64PFR1, NMI) != 0; |
140 | } | 143 | } |
141 | 144 | ||
142 | static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id) | 145 | static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id) |
143 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
144 | index XXXXXXX..XXXXXXX 100644 | ||
145 | --- a/target/arm/cpu.h | ||
146 | +++ b/target/arm/cpu.h | ||
147 | @@ -XXX,XX +XXX,XX @@ _set_idreg(MAP, SYS_ ## REG ## _EL1, regval); \ | ||
148 | #define FIELD_EX64_IDREG(MAP, REG, FIELD) \ | ||
149 | FIELD_EX64(_get_idreg(MAP, SYS_ ## REG ## _EL1), REG, FIELD) \ | ||
150 | |||
151 | +#define FIELD_EX32_IDREG(MAP, REG, FIELD) \ | ||
152 | +FIELD_EX32(_get_idreg(MAP, SYS_ ## REG ## _EL1), REG, FIELD) \ | ||
153 | + | ||
154 | #define SET_IDREG(MAP, REG, VALUE) \ | ||
155 | _set_idreg(MAP, SYS_ ## REG ## _EL1, VALUE) | ||
156 | |||
157 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
158 | uint32_t dbgdidr; | ||
159 | uint32_t dbgdevid; | ||
160 | uint32_t dbgdevid1; | ||
161 | - uint64_t id_aa64pfr0; | ||
162 | - uint64_t id_aa64pfr1; | ||
163 | uint64_t id_aa64mmfr0; | ||
164 | uint64_t id_aa64mmfr1; | ||
165 | uint64_t id_aa64mmfr2; | ||
166 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 146 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
167 | index XXXXXXX..XXXXXXX 100644 | 147 | index XXXXXXX..XXXXXXX 100644 |
168 | --- a/target/arm/cpu.c | 148 | --- a/target/arm/cpu.c |
169 | +++ b/target/arm/cpu.c | 149 | +++ b/target/arm/cpu.c |
170 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 150 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
... | ... | ||
220 | ID_PFR1, VIRTUALIZATION, 0); | 200 | ID_PFR1, VIRTUALIZATION, 0); |
221 | } | 201 | } |
222 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 202 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
223 | * This matches Cortex-A710 BROADCASTMTE input being LOW. | 203 | * This matches Cortex-A710 BROADCASTMTE input being LOW. |
224 | */ | 204 | */ |
225 | if (cpu->tag_memory == NULL) { | 205 | if (tcg_enabled() && cpu->tag_memory == NULL) { |
226 | - cpu->isar.id_aa64pfr1 = | 206 | - cpu->isar.id_aa64pfr1 = |
227 | - FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 1); | 207 | - FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 1); |
228 | + FIELD_DP64_IDREG(idregs, ID_AA64PFR1, MTE, 1); | 208 | + FIELD_DP64_IDREG(idregs, ID_AA64PFR1, MTE, 1); |
209 | } | ||
210 | |||
211 | /* | ||
212 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
213 | * enabled on the guest (i.e mte=off), clear guest's MTE bits." | ||
214 | */ | ||
215 | if (kvm_enabled() && !cpu->kvm_mte) { | ||
216 | - FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0); | ||
217 | + FIELD_DP64_IDREG(idregs, ID_AA64PFR1, MTE, 0); | ||
229 | } | 218 | } |
230 | #endif | 219 | #endif |
231 | } | 220 | } |
232 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 221 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
233 | cpu->isar.id_dfr0 = | 222 | cpu->isar.id_dfr0 = |
... | ... | ||
243 | - FIELD_DP64(cpu->isar.id_aa64pfr0, ID_AA64PFR0, MPAM, 0); | 232 | - FIELD_DP64(cpu->isar.id_aa64pfr0, ID_AA64PFR0, MPAM, 0); |
244 | + FIELD_DP64_IDREG(idregs, ID_AA64PFR0, MPAM, 0); | 233 | + FIELD_DP64_IDREG(idregs, ID_AA64PFR0, MPAM, 0); |
245 | } | 234 | } |
246 | 235 | ||
247 | /* MPU can be configured out of a PMSA CPU either by setting has-mpu | 236 | /* MPU can be configured out of a PMSA CPU either by setting has-mpu |
237 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
238 | index XXXXXXX..XXXXXXX 100644 | ||
239 | --- a/target/arm/cpu.h | ||
240 | +++ b/target/arm/cpu.h | ||
241 | @@ -XXX,XX +XXX,XX @@ _set_idreg(MAP, SYS_ ## REG ## _EL1, regval); \ | ||
242 | #define FIELD_EX64_IDREG(MAP, REG, FIELD) \ | ||
243 | FIELD_EX64(_get_idreg(MAP, SYS_ ## REG ## _EL1), REG, FIELD) \ | ||
244 | |||
245 | +#define FIELD_EX32_IDREG(MAP, REG, FIELD) \ | ||
246 | +FIELD_EX32(_get_idreg(MAP, SYS_ ## REG ## _EL1), REG, FIELD) \ | ||
247 | + | ||
248 | #define SET_IDREG(MAP, REG, VALUE) \ | ||
249 | _set_idreg(MAP, SYS_ ## REG ## _EL1, VALUE) | ||
250 | |||
251 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
252 | uint32_t dbgdidr; | ||
253 | uint32_t dbgdevid; | ||
254 | uint32_t dbgdevid1; | ||
255 | - uint64_t id_aa64pfr0; | ||
256 | - uint64_t id_aa64pfr1; | ||
257 | uint64_t id_aa64mmfr0; | ||
258 | uint64_t id_aa64mmfr1; | ||
259 | uint64_t id_aa64mmfr2; | ||
248 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 260 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
249 | index XXXXXXX..XXXXXXX 100644 | 261 | index XXXXXXX..XXXXXXX 100644 |
250 | --- a/target/arm/cpu64.c | 262 | --- a/target/arm/cpu64.c |
251 | +++ b/target/arm/cpu64.c | 263 | +++ b/target/arm/cpu64.c |
252 | @@ -XXX,XX +XXX,XX @@ static bool cpu_arm_get_sve(Object *obj, Error **errp) | 264 | @@ -XXX,XX +XXX,XX @@ static bool cpu_arm_get_sve(Object *obj, Error **errp) |
... | ... | ||
533 | + SET_IDREG(idregs, ID_AA64PFR1, t); | 545 | + SET_IDREG(idregs, ID_AA64PFR1, t); |
534 | 546 | ||
535 | t = cpu->isar.id_aa64mmfr0; | 547 | t = cpu->isar.id_aa64mmfr0; |
536 | t = FIELD_DP64(t, ID_AA64MMFR0, PARANGE, 6); /* FEAT_LPA: 52 bits */ | 548 | t = FIELD_DP64(t, ID_AA64MMFR0, PARANGE, 6); /* FEAT_LPA: 52 bits */ |
537 | -- | 549 | -- |
538 | 2.41.0 | 550 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
3 | target/arm/cpu-features.h | 70 +++++++++++++++++++-------------------- | 6 | target/arm/cpu-features.h | 72 +++++++++++++++++++-------------------- |
4 | target/arm/cpu.h | 7 ++-- | 7 | target/arm/cpu.h | 7 ++-- |
5 | target/arm/cpu64.c | 8 ++--- | 8 | target/arm/cpu64.c | 8 ++--- |
6 | target/arm/helper.c | 8 ++--- | 9 | target/arm/helper.c | 8 ++--- |
7 | target/arm/kvm.c | 12 +++---- | 10 | target/arm/kvm.c | 12 +++---- |
8 | target/arm/ptw.c | 6 ++-- | 11 | target/arm/ptw.c | 6 ++-- |
9 | target/arm/tcg/cpu64.c | 64 +++++++++++++++++------------------ | 12 | target/arm/tcg/cpu64.c | 64 +++++++++++++++++----------------- |
10 | 7 files changed, 84 insertions(+), 91 deletions(-) | 13 | 7 files changed, 85 insertions(+), 92 deletions(-) |
11 | 14 | ||
12 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | 15 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h |
13 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/arm/cpu-features.h | 17 | --- a/target/arm/cpu-features.h |
15 | +++ b/target/arm/cpu-features.h | 18 | +++ b/target/arm/cpu-features.h |
... | ... | ||
138 | { | 141 | { |
139 | - return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, TIDCP1) != 0; | 142 | - return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, TIDCP1) != 0; |
140 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64MMFR1, TIDCP1) != 0; | 143 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64MMFR1, TIDCP1) != 0; |
141 | } | 144 | } |
142 | 145 | ||
146 | static inline bool isar_feature_aa64_cmow(const ARMISARegisters *id) | ||
147 | { | ||
148 | - return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, CMOW) != 0; | ||
149 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64MMFR1, CMOW) != 0; | ||
150 | } | ||
151 | |||
143 | static inline bool isar_feature_aa64_hafs(const ARMISARegisters *id) | 152 | static inline bool isar_feature_aa64_hafs(const ARMISARegisters *id) |
144 | { | 153 | { |
145 | - return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HAFDBS) != 0; | 154 | - return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HAFDBS) != 0; |
146 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64MMFR1, HAFDBS) != 0; | 155 | + return FIELD_EX64_IDREG(&id->idregs, ID_AA64MMFR1, HAFDBS) != 0; |
147 | } | 156 | } |
... | ... | ||
455 | SET_IDREG(idregs, ID_AA64PFR1, 0x0000000000000020ull); | 464 | SET_IDREG(idregs, ID_AA64PFR1, 0x0000000000000020ull); |
456 | cpu->id_afr0 = 0x00000000; | 465 | cpu->id_afr0 = 0x00000000; |
457 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_v1_initfn(Object *obj) | 466 | @@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_v1_initfn(Object *obj) |
458 | cpu->isar.id_aa64dfr1 = 0x00000000; | 467 | cpu->isar.id_aa64dfr1 = 0x00000000; |
459 | SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ | 468 | SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ |
460 | SET_IDREG(idregs, ID_AA64ISAR1, 0x0111000001211032ull); | 469 | SET_IDREG(idregs, ID_AA64ISAR1, 0x0011000001211032ull); |
461 | - cpu->isar.id_aa64mmfr0 = 0x0000000000101125ull; | 470 | - cpu->isar.id_aa64mmfr0 = 0x0000000000101125ull; |
462 | - cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull; | 471 | - cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull; |
463 | - cpu->isar.id_aa64mmfr2 = 0x0220011102101011ull; | 472 | - cpu->isar.id_aa64mmfr2 = 0x0220011102101011ull; |
464 | + SET_IDREG(idregs, ID_AA64MMFR0, 0x0000000000101125ull); | 473 | + SET_IDREG(idregs, ID_AA64MMFR0, 0x0000000000101125ull); |
465 | + SET_IDREG(idregs, ID_AA64MMFR1, 0x0000000010212122ull), | 474 | + SET_IDREG(idregs, ID_AA64MMFR1, 0x0000000010212122ull), |
... | ... | ||
513 | + t = GET_IDREG(idregs, ID_AA64MMFR1); | 522 | + t = GET_IDREG(idregs, ID_AA64MMFR1); |
514 | t = FIELD_DP64(t, ID_AA64MMFR1, HAFDBS, 2); /* FEAT_HAFDBS */ | 523 | t = FIELD_DP64(t, ID_AA64MMFR1, HAFDBS, 2); /* FEAT_HAFDBS */ |
515 | t = FIELD_DP64(t, ID_AA64MMFR1, VMIDBITS, 2); /* FEAT_VMID16 */ | 524 | t = FIELD_DP64(t, ID_AA64MMFR1, VMIDBITS, 2); /* FEAT_VMID16 */ |
516 | t = FIELD_DP64(t, ID_AA64MMFR1, VH, 1); /* FEAT_VHE */ | 525 | t = FIELD_DP64(t, ID_AA64MMFR1, VH, 1); /* FEAT_VHE */ |
517 | @@ -XXX,XX +XXX,XX @@ void aarch64_max_tcg_initfn(Object *obj) | 526 | @@ -XXX,XX +XXX,XX @@ void aarch64_max_tcg_initfn(Object *obj) |
518 | t = FIELD_DP64(t, ID_AA64MMFR1, ETS, 2); /* FEAT_ETS2 */ | ||
519 | t = FIELD_DP64(t, ID_AA64MMFR1, HCX, 1); /* FEAT_HCX */ | 527 | t = FIELD_DP64(t, ID_AA64MMFR1, HCX, 1); /* FEAT_HCX */ |
520 | t = FIELD_DP64(t, ID_AA64MMFR1, TIDCP1, 1); /* FEAT_TIDCP1 */ | 528 | t = FIELD_DP64(t, ID_AA64MMFR1, TIDCP1, 1); /* FEAT_TIDCP1 */ |
529 | t = FIELD_DP64(t, ID_AA64MMFR1, CMOW, 1); /* FEAT_CMOW */ | ||
521 | - cpu->isar.id_aa64mmfr1 = t; | 530 | - cpu->isar.id_aa64mmfr1 = t; |
522 | + SET_IDREG(idregs, ID_AA64MMFR1, t); | 531 | + SET_IDREG(idregs, ID_AA64MMFR1, t); |
523 | 532 | ||
524 | - t = cpu->isar.id_aa64mmfr2; | 533 | - t = cpu->isar.id_aa64mmfr2; |
525 | + t = GET_IDREG(idregs, ID_AA64MMFR2); | 534 | + t = GET_IDREG(idregs, ID_AA64MMFR2); |
... | ... | ||
539 | + FIELD_DP64_IDREG(idregs, ID_AA64MMFR3, SPEC_FPACC, 1); /* FEAT_FPACC_SPEC */ | 548 | + FIELD_DP64_IDREG(idregs, ID_AA64MMFR3, SPEC_FPACC, 1); /* FEAT_FPACC_SPEC */ |
540 | 549 | ||
541 | t = GET_IDREG(idregs, ID_AA64ZFR0); | 550 | t = GET_IDREG(idregs, ID_AA64ZFR0); |
542 | t = FIELD_DP64(t, ID_AA64ZFR0, SVEVER, 1); | 551 | t = FIELD_DP64(t, ID_AA64ZFR0, SVEVER, 1); |
543 | -- | 552 | -- |
544 | 2.41.0 | 553 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
3 | target/arm/cpu-features.h | 16 ++++++++-------- | 6 | target/arm/cpu-features.h | 16 ++++++++-------- |
7 | target/arm/cpu.c | 15 +++++---------- | ||
4 | target/arm/cpu.h | 2 -- | 8 | target/arm/cpu.h | 2 -- |
5 | target/arm/internals.h | 6 +++--- | ||
6 | target/arm/cpu.c | 15 +++++---------- | ||
7 | target/arm/cpu64.c | 4 ++-- | 9 | target/arm/cpu64.c | 4 ++-- |
8 | target/arm/helper.c | 4 ++-- | 10 | target/arm/helper.c | 4 ++-- |
11 | target/arm/internals.h | 6 +++--- | ||
9 | target/arm/kvm.c | 6 ++---- | 12 | target/arm/kvm.c | 6 ++---- |
10 | target/arm/tcg/cpu64.c | 33 +++++++++++++++++---------------- | 13 | target/arm/tcg/cpu64.c | 33 +++++++++++++++++---------------- |
11 | 8 files changed, 39 insertions(+), 47 deletions(-) | 14 | 8 files changed, 39 insertions(+), 47 deletions(-) |
12 | 15 | ||
13 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | 16 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h |
... | ... | ||
51 | - return FIELD_SEX64(id->id_aa64dfr0, ID_AA64DFR0, DOUBLELOCK) >= 0; | 54 | - return FIELD_SEX64(id->id_aa64dfr0, ID_AA64DFR0, DOUBLELOCK) >= 0; |
52 | + return FIELD_SEX64_IDREG(&id->idregs, ID_AA64DFR0, DOUBLELOCK) >= 0; | 55 | + return FIELD_SEX64_IDREG(&id->idregs, ID_AA64DFR0, DOUBLELOCK) >= 0; |
53 | } | 56 | } |
54 | 57 | ||
55 | static inline bool isar_feature_aa64_sve2(const ARMISARegisters *id) | 58 | static inline bool isar_feature_aa64_sve2(const ARMISARegisters *id) |
59 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
60 | index XXXXXXX..XXXXXXX 100644 | ||
61 | --- a/target/arm/cpu.c | ||
62 | +++ b/target/arm/cpu.c | ||
63 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
64 | cpu); | ||
65 | #endif | ||
66 | } else { | ||
67 | - cpu->isar.id_aa64dfr0 = | ||
68 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, PMUVER, 0); | ||
69 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, PMUVER, 0); | ||
70 | cpu->isar.id_dfr0 = FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, PERFMON, 0); | ||
71 | cpu->pmceid0 = 0; | ||
72 | cpu->pmceid1 = 0; | ||
73 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
74 | * try to access the non-existent system registers for them. | ||
75 | */ | ||
76 | /* FEAT_SPE (Statistical Profiling Extension) */ | ||
77 | - cpu->isar.id_aa64dfr0 = | ||
78 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, PMSVER, 0); | ||
79 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, PMSVER, 0); | ||
80 | /* FEAT_TRBE (Trace Buffer Extension) */ | ||
81 | - cpu->isar.id_aa64dfr0 = | ||
82 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEBUFFER, 0); | ||
83 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, TRACEBUFFER, 0); | ||
84 | /* FEAT_TRF (Self-hosted Trace Extension) */ | ||
85 | - cpu->isar.id_aa64dfr0 = | ||
86 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEFILT, 0); | ||
87 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, TRACEFILT, 0); | ||
88 | cpu->isar.id_dfr0 = | ||
89 | FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, TRACEFILT, 0); | ||
90 | /* Trace Macrocell system register access */ | ||
91 | - cpu->isar.id_aa64dfr0 = | ||
92 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEVER, 0); | ||
93 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, TRACEVER, 0); | ||
94 | cpu->isar.id_dfr0 = | ||
95 | FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, COPTRC, 0); | ||
96 | /* Memory mapped trace */ | ||
56 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 97 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h |
57 | index XXXXXXX..XXXXXXX 100644 | 98 | index XXXXXXX..XXXXXXX 100644 |
58 | --- a/target/arm/cpu.h | 99 | --- a/target/arm/cpu.h |
59 | +++ b/target/arm/cpu.h | 100 | +++ b/target/arm/cpu.h |
60 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | 101 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { |
... | ... | ||
64 | - uint64_t id_aa64dfr0; | 105 | - uint64_t id_aa64dfr0; |
65 | - uint64_t id_aa64dfr1; | 106 | - uint64_t id_aa64dfr1; |
66 | uint64_t id_aa64smfr0; | 107 | uint64_t id_aa64smfr0; |
67 | uint64_t reset_pmcr_el0; | 108 | uint64_t reset_pmcr_el0; |
68 | IdRegMap idregs; | 109 | IdRegMap idregs; |
69 | diff --git a/target/arm/internals.h b/target/arm/internals.h | ||
70 | index XXXXXXX..XXXXXXX 100644 | ||
71 | --- a/target/arm/internals.h | ||
72 | +++ b/target/arm/internals.h | ||
73 | @@ -XXX,XX +XXX,XX @@ static inline bool regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx) | ||
74 | static inline int arm_num_brps(ARMCPU *cpu) | ||
75 | { | ||
76 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
77 | - return FIELD_EX64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, BRPS) + 1; | ||
78 | + return FIELD_EX64_IDREG(&cpu->isar.idregs, ID_AA64DFR0, BRPS) + 1; | ||
79 | } else { | ||
80 | return FIELD_EX32(cpu->isar.dbgdidr, DBGDIDR, BRPS) + 1; | ||
81 | } | ||
82 | @@ -XXX,XX +XXX,XX @@ static inline int arm_num_brps(ARMCPU *cpu) | ||
83 | static inline int arm_num_wrps(ARMCPU *cpu) | ||
84 | { | ||
85 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
86 | - return FIELD_EX64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, WRPS) + 1; | ||
87 | + return FIELD_EX64_IDREG(&cpu->isar.idregs, ID_AA64DFR0, WRPS) + 1; | ||
88 | } else { | ||
89 | return FIELD_EX32(cpu->isar.dbgdidr, DBGDIDR, WRPS) + 1; | ||
90 | } | ||
91 | @@ -XXX,XX +XXX,XX @@ static inline int arm_num_wrps(ARMCPU *cpu) | ||
92 | static inline int arm_num_ctx_cmps(ARMCPU *cpu) | ||
93 | { | ||
94 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
95 | - return FIELD_EX64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, CTX_CMPS) + 1; | ||
96 | + return FIELD_EX64_IDREG(&cpu->isar.idregs, ID_AA64DFR0, CTX_CMPS) + 1; | ||
97 | } else { | ||
98 | return FIELD_EX32(cpu->isar.dbgdidr, DBGDIDR, CTX_CMPS) + 1; | ||
99 | } | ||
100 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
101 | index XXXXXXX..XXXXXXX 100644 | ||
102 | --- a/target/arm/cpu.c | ||
103 | +++ b/target/arm/cpu.c | ||
104 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
105 | cpu); | ||
106 | #endif | ||
107 | } else { | ||
108 | - cpu->isar.id_aa64dfr0 = | ||
109 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, PMUVER, 0); | ||
110 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, PMUVER, 0); | ||
111 | cpu->isar.id_dfr0 = FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, PERFMON, 0); | ||
112 | cpu->pmceid0 = 0; | ||
113 | cpu->pmceid1 = 0; | ||
114 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
115 | * try to access the non-existent system registers for them. | ||
116 | */ | ||
117 | /* FEAT_SPE (Statistical Profiling Extension) */ | ||
118 | - cpu->isar.id_aa64dfr0 = | ||
119 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, PMSVER, 0); | ||
120 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, PMSVER, 0); | ||
121 | /* FEAT_TRBE (Trace Buffer Extension) */ | ||
122 | - cpu->isar.id_aa64dfr0 = | ||
123 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEBUFFER, 0); | ||
124 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, TRACEBUFFER, 0); | ||
125 | /* FEAT_TRF (Self-hosted Trace Extension) */ | ||
126 | - cpu->isar.id_aa64dfr0 = | ||
127 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEFILT, 0); | ||
128 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, TRACEFILT, 0); | ||
129 | cpu->isar.id_dfr0 = | ||
130 | FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, TRACEFILT, 0); | ||
131 | /* Trace Macrocell system register access */ | ||
132 | - cpu->isar.id_aa64dfr0 = | ||
133 | - FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEVER, 0); | ||
134 | + FIELD_DP64_IDREG(idregs, ID_AA64DFR0, TRACEVER, 0); | ||
135 | cpu->isar.id_dfr0 = | ||
136 | FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, COPTRC, 0); | ||
137 | /* Memory mapped trace */ | ||
138 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 110 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
139 | index XXXXXXX..XXXXXXX 100644 | 111 | index XXXXXXX..XXXXXXX 100644 |
140 | --- a/target/arm/cpu64.c | 112 | --- a/target/arm/cpu64.c |
141 | +++ b/target/arm/cpu64.c | 113 | +++ b/target/arm/cpu64.c |
142 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) | 114 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) |
... | ... | ||
174 | - .resetvalue = cpu->isar.id_aa64dfr1 }, | 146 | - .resetvalue = cpu->isar.id_aa64dfr1 }, |
175 | + .resetvalue = GET_IDREG(idregs, ID_AA64DFR1) }, | 147 | + .resetvalue = GET_IDREG(idregs, ID_AA64DFR1) }, |
176 | { .name = "ID_AA64DFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64, | 148 | { .name = "ID_AA64DFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64, |
177 | .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 2, | 149 | .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 2, |
178 | .access = PL1_R, .type = ARM_CP_CONST, | 150 | .access = PL1_R, .type = ARM_CP_CONST, |
151 | diff --git a/target/arm/internals.h b/target/arm/internals.h | ||
152 | index XXXXXXX..XXXXXXX 100644 | ||
153 | --- a/target/arm/internals.h | ||
154 | +++ b/target/arm/internals.h | ||
155 | @@ -XXX,XX +XXX,XX @@ static inline bool regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx) | ||
156 | static inline int arm_num_brps(ARMCPU *cpu) | ||
157 | { | ||
158 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
159 | - return FIELD_EX64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, BRPS) + 1; | ||
160 | + return FIELD_EX64_IDREG(&cpu->isar.idregs, ID_AA64DFR0, BRPS) + 1; | ||
161 | } else { | ||
162 | return FIELD_EX32(cpu->isar.dbgdidr, DBGDIDR, BRPS) + 1; | ||
163 | } | ||
164 | @@ -XXX,XX +XXX,XX @@ static inline int arm_num_brps(ARMCPU *cpu) | ||
165 | static inline int arm_num_wrps(ARMCPU *cpu) | ||
166 | { | ||
167 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
168 | - return FIELD_EX64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, WRPS) + 1; | ||
169 | + return FIELD_EX64_IDREG(&cpu->isar.idregs, ID_AA64DFR0, WRPS) + 1; | ||
170 | } else { | ||
171 | return FIELD_EX32(cpu->isar.dbgdidr, DBGDIDR, WRPS) + 1; | ||
172 | } | ||
173 | @@ -XXX,XX +XXX,XX @@ static inline int arm_num_wrps(ARMCPU *cpu) | ||
174 | static inline int arm_num_ctx_cmps(ARMCPU *cpu) | ||
175 | { | ||
176 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
177 | - return FIELD_EX64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, CTX_CMPS) + 1; | ||
178 | + return FIELD_EX64_IDREG(&cpu->isar.idregs, ID_AA64DFR0, CTX_CMPS) + 1; | ||
179 | } else { | ||
180 | return FIELD_EX32(cpu->isar.dbgdidr, DBGDIDR, CTX_CMPS) + 1; | ||
181 | } | ||
179 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | 182 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c |
180 | index XXXXXXX..XXXXXXX 100644 | 183 | index XXXXXXX..XXXXXXX 100644 |
181 | --- a/target/arm/kvm.c | 184 | --- a/target/arm/kvm.c |
182 | +++ b/target/arm/kvm.c | 185 | +++ b/target/arm/kvm.c |
183 | @@ -XXX,XX +XXX,XX @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | 186 | @@ -XXX,XX +XXX,XX @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) |
... | ... | ||
262 | - cpu->isar.id_aa64dfr0 = 0x000001f210305519ull; | 265 | - cpu->isar.id_aa64dfr0 = 0x000001f210305519ull; |
263 | - cpu->isar.id_aa64dfr1 = 0x00000000; | 266 | - cpu->isar.id_aa64dfr1 = 0x00000000; |
264 | + SET_IDREG(idregs, ID_AA64DFR0, 0x000001f210305519ull), | 267 | + SET_IDREG(idregs, ID_AA64DFR0, 0x000001f210305519ull), |
265 | + SET_IDREG(idregs, ID_AA64DFR1, 0x00000000), | 268 | + SET_IDREG(idregs, ID_AA64DFR1, 0x00000000), |
266 | SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ | 269 | SET_IDREG(idregs, ID_AA64ISAR0, 0x1011111110212120ull); /* with FEAT_RNG */ |
267 | SET_IDREG(idregs, ID_AA64ISAR1, 0x0111000001211032ull); | 270 | SET_IDREG(idregs, ID_AA64ISAR1, 0x0011000001211032ull); |
268 | SET_IDREG(idregs, ID_AA64MMFR0, 0x0000000000101125ull); | 271 | SET_IDREG(idregs, ID_AA64MMFR0, 0x0000000000101125ull); |
269 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a710_initfn(Object *obj) | 272 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a710_initfn(Object *obj) |
270 | SET_IDREG(idregs, ID_AA64PFR0, 0x1201111120111112ull); /* GIC filled in later */ | 273 | SET_IDREG(idregs, ID_AA64PFR0, 0x1201111120111112ull); /* GIC filled in later */ |
271 | SET_IDREG(idregs, ID_AA64PFR1, 0x0000000000000221ull); | 274 | SET_IDREG(idregs, ID_AA64PFR1, 0x0000000000000221ull); |
272 | SET_IDREG(idregs, ID_AA64ZFR0, 0x0000110100110021ull); /* with Crypto */ | 275 | SET_IDREG(idregs, ID_AA64ZFR0, 0x0000110100110021ull); /* with Crypto */ |
... | ... | ||
302 | + SET_IDREG(idregs, ID_AA64DFR0, t); | 305 | + SET_IDREG(idregs, ID_AA64DFR0, t); |
303 | 306 | ||
304 | t = cpu->isar.id_aa64smfr0; | 307 | t = cpu->isar.id_aa64smfr0; |
305 | t = FIELD_DP64(t, ID_AA64SMFR0, F32F32, 1); /* FEAT_SME */ | 308 | t = FIELD_DP64(t, ID_AA64SMFR0, F32F32, 1); /* FEAT_SME */ |
306 | -- | 309 | -- |
307 | 2.41.0 | 310 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
3 | target/arm/cpu-features.h | 6 +++--- | 6 | target/arm/cpu-features.h | 6 +++--- |
4 | target/arm/cpu.h | 1 - | 7 | target/arm/cpu.h | 1 - |
5 | target/arm/cpu64.c | 7 ++----- | 8 | target/arm/cpu64.c | 7 ++----- |
6 | target/arm/helper.c | 2 +- | 9 | target/arm/helper.c | 2 +- |
... | ... | ||
119 | + SET_IDREG(idregs, ID_AA64SMFR0, t); | 122 | + SET_IDREG(idregs, ID_AA64SMFR0, t); |
120 | 123 | ||
121 | /* Replicate the same data to the 32-bit id registers. */ | 124 | /* Replicate the same data to the 32-bit id registers. */ |
122 | aa32_max_features(cpu); | 125 | aa32_max_features(cpu); |
123 | -- | 126 | -- |
124 | 2.41.0 | 127 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
6 | hw/intc/armv7m_nvic.c | 12 ++-- | ||
3 | target/arm/cpu-features.h | 36 +++++----- | 7 | target/arm/cpu-features.h | 36 +++++----- |
8 | target/arm/cpu.c | 24 +++---- | ||
4 | target/arm/cpu.h | 14 ++-- | 9 | target/arm/cpu.h | 14 ++-- |
5 | hw/intc/armv7m_nvic.c | 12 ++-- | ||
6 | target/arm/cpu.c | 24 +++---- | ||
7 | target/arm/cpu64.c | 28 ++++---- | 10 | target/arm/cpu64.c | 28 ++++---- |
8 | target/arm/helper.c | 14 ++-- | 11 | target/arm/helper.c | 14 ++-- |
9 | target/arm/kvm.c | 34 +++++---- | 12 | target/arm/kvm.c | 34 +++++---- |
10 | target/arm/tcg/cpu-v7m.c | 90 +++++++++++++----------- | 13 | target/arm/tcg/cpu-v7m.c | 90 +++++++++++++----------- |
11 | target/arm/tcg/cpu32.c | 143 ++++++++++++++++++++------------------ | 14 | target/arm/tcg/cpu32.c | 143 ++++++++++++++++++++------------------ |
12 | target/arm/tcg/cpu64.c | 108 ++++++++++++++-------------- | 15 | target/arm/tcg/cpu64.c | 108 ++++++++++++++-------------- |
13 | 10 files changed, 262 insertions(+), 241 deletions(-) | 16 | 10 files changed, 262 insertions(+), 241 deletions(-) |
14 | 17 | ||
15 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/cpu-features.h | ||
18 | +++ b/target/arm/cpu-features.h | ||
19 | @@ -XXX,XX +XXX,XX @@ | ||
20 | */ | ||
21 | static inline bool isar_feature_aa32_thumb_div(const ARMISARegisters *id) | ||
22 | { | ||
23 | - return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) != 0; | ||
24 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR0, DIVIDE) != 0; | ||
25 | } | ||
26 | |||
27 | static inline bool isar_feature_aa32_arm_div(const ARMISARegisters *id) | ||
28 | { | ||
29 | - return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) > 1; | ||
30 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR0, DIVIDE) > 1; | ||
31 | } | ||
32 | |||
33 | static inline bool isar_feature_aa32_lob(const ARMISARegisters *id) | ||
34 | { | ||
35 | /* (M-profile) low-overhead loops and branch future */ | ||
36 | - return FIELD_EX32(id->id_isar0, ID_ISAR0, CMPBRANCH) >= 3; | ||
37 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR0, CMPBRANCH) >= 3; | ||
38 | } | ||
39 | |||
40 | static inline bool isar_feature_aa32_jazelle(const ARMISARegisters *id) | ||
41 | { | ||
42 | - return FIELD_EX32(id->id_isar1, ID_ISAR1, JAZELLE) != 0; | ||
43 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR1, JAZELLE) != 0; | ||
44 | } | ||
45 | |||
46 | static inline bool isar_feature_aa32_aes(const ARMISARegisters *id) | ||
47 | { | ||
48 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) != 0; | ||
49 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, AES) != 0; | ||
50 | } | ||
51 | |||
52 | static inline bool isar_feature_aa32_pmull(const ARMISARegisters *id) | ||
53 | { | ||
54 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) > 1; | ||
55 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, AES) > 1; | ||
56 | } | ||
57 | |||
58 | static inline bool isar_feature_aa32_sha1(const ARMISARegisters *id) | ||
59 | { | ||
60 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA1) != 0; | ||
61 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, SHA1) != 0; | ||
62 | } | ||
63 | |||
64 | static inline bool isar_feature_aa32_sha2(const ARMISARegisters *id) | ||
65 | { | ||
66 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA2) != 0; | ||
67 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, SHA2) != 0; | ||
68 | } | ||
69 | |||
70 | static inline bool isar_feature_aa32_crc32(const ARMISARegisters *id) | ||
71 | { | ||
72 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, CRC32) != 0; | ||
73 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, CRC32) != 0; | ||
74 | } | ||
75 | |||
76 | static inline bool isar_feature_aa32_rdm(const ARMISARegisters *id) | ||
77 | { | ||
78 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, RDM) != 0; | ||
79 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, RDM) != 0; | ||
80 | } | ||
81 | |||
82 | static inline bool isar_feature_aa32_vcma(const ARMISARegisters *id) | ||
83 | { | ||
84 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, VCMA) != 0; | ||
85 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, VCMA) != 0; | ||
86 | } | ||
87 | |||
88 | static inline bool isar_feature_aa32_jscvt(const ARMISARegisters *id) | ||
89 | { | ||
90 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, JSCVT) != 0; | ||
91 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, JSCVT) != 0; | ||
92 | } | ||
93 | |||
94 | static inline bool isar_feature_aa32_dp(const ARMISARegisters *id) | ||
95 | { | ||
96 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, DP) != 0; | ||
97 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, DP) != 0; | ||
98 | } | ||
99 | |||
100 | static inline bool isar_feature_aa32_fhm(const ARMISARegisters *id) | ||
101 | { | ||
102 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, FHM) != 0; | ||
103 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, FHM) != 0; | ||
104 | } | ||
105 | |||
106 | static inline bool isar_feature_aa32_sb(const ARMISARegisters *id) | ||
107 | { | ||
108 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, SB) != 0; | ||
109 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, SB) != 0; | ||
110 | } | ||
111 | |||
112 | static inline bool isar_feature_aa32_predinv(const ARMISARegisters *id) | ||
113 | { | ||
114 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, SPECRES) != 0; | ||
115 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, SPECRES) != 0; | ||
116 | } | ||
117 | |||
118 | static inline bool isar_feature_aa32_bf16(const ARMISARegisters *id) | ||
119 | { | ||
120 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, BF16) != 0; | ||
121 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, BF16) != 0; | ||
122 | } | ||
123 | |||
124 | static inline bool isar_feature_aa32_i8mm(const ARMISARegisters *id) | ||
125 | { | ||
126 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, I8MM) != 0; | ||
127 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, I8MM) != 0; | ||
128 | } | ||
129 | |||
130 | static inline bool isar_feature_aa32_ras(const ARMISARegisters *id) | ||
131 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
132 | index XXXXXXX..XXXXXXX 100644 | ||
133 | --- a/target/arm/cpu.h | ||
134 | +++ b/target/arm/cpu.h | ||
135 | @@ -XXX,XX +XXX,XX @@ regval = FIELD_DP64(regval, REG, FIELD, VALUE); \ | ||
136 | _set_idreg(MAP, SYS_ ## REG ## _EL1, regval); \ | ||
137 | } | ||
138 | |||
139 | +#define FIELD_DP32_IDREG(MAP, REG, FIELD, VALUE) \ | ||
140 | +{ \ | ||
141 | +uint64_t regval = _get_idreg(MAP, SYS_ ## REG ## _EL1); \ | ||
142 | +regval = FIELD_DP32(regval, REG, FIELD, VALUE); \ | ||
143 | +_set_idreg(MAP, SYS_ ## REG ## _EL1, regval); \ | ||
144 | +} | ||
145 | + | ||
146 | #define FIELD_EX64_IDREG(MAP, REG, FIELD) \ | ||
147 | FIELD_EX64(_get_idreg(MAP, SYS_ ## REG ## _EL1), REG, FIELD) \ | ||
148 | |||
149 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
150 | * field by reading the value from the KVM vCPU. | ||
151 | */ | ||
152 | struct ARMISARegisters { | ||
153 | - uint32_t id_isar0; | ||
154 | - uint32_t id_isar1; | ||
155 | - uint32_t id_isar2; | ||
156 | - uint32_t id_isar3; | ||
157 | - uint32_t id_isar4; | ||
158 | - uint32_t id_isar5; | ||
159 | - uint32_t id_isar6; | ||
160 | uint32_t id_mmfr0; | ||
161 | uint32_t id_mmfr1; | ||
162 | uint32_t id_mmfr2; | ||
163 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 18 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
164 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
165 | --- a/hw/intc/armv7m_nvic.c | 20 | --- a/hw/intc/armv7m_nvic.c |
166 | +++ b/hw/intc/armv7m_nvic.c | 21 | +++ b/hw/intc/armv7m_nvic.c |
167 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) | 22 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) |
... | ... | ||
201 | - return cpu->isar.id_isar5; | 56 | - return cpu->isar.id_isar5; |
202 | + return GET_IDREG(&cpu->isar.idregs, ID_ISAR5); | 57 | + return GET_IDREG(&cpu->isar.idregs, ID_ISAR5); |
203 | case 0xd78: /* CLIDR */ | 58 | case 0xd78: /* CLIDR */ |
204 | return cpu->clidr; | 59 | return cpu->clidr; |
205 | case 0xd7c: /* CTR */ | 60 | case 0xd7c: /* CTR */ |
61 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
62 | index XXXXXXX..XXXXXXX 100644 | ||
63 | --- a/target/arm/cpu-features.h | ||
64 | +++ b/target/arm/cpu-features.h | ||
65 | @@ -XXX,XX +XXX,XX @@ | ||
66 | */ | ||
67 | static inline bool isar_feature_aa32_thumb_div(const ARMISARegisters *id) | ||
68 | { | ||
69 | - return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) != 0; | ||
70 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR0, DIVIDE) != 0; | ||
71 | } | ||
72 | |||
73 | static inline bool isar_feature_aa32_arm_div(const ARMISARegisters *id) | ||
74 | { | ||
75 | - return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) > 1; | ||
76 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR0, DIVIDE) > 1; | ||
77 | } | ||
78 | |||
79 | static inline bool isar_feature_aa32_lob(const ARMISARegisters *id) | ||
80 | { | ||
81 | /* (M-profile) low-overhead loops and branch future */ | ||
82 | - return FIELD_EX32(id->id_isar0, ID_ISAR0, CMPBRANCH) >= 3; | ||
83 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR0, CMPBRANCH) >= 3; | ||
84 | } | ||
85 | |||
86 | static inline bool isar_feature_aa32_jazelle(const ARMISARegisters *id) | ||
87 | { | ||
88 | - return FIELD_EX32(id->id_isar1, ID_ISAR1, JAZELLE) != 0; | ||
89 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR1, JAZELLE) != 0; | ||
90 | } | ||
91 | |||
92 | static inline bool isar_feature_aa32_aes(const ARMISARegisters *id) | ||
93 | { | ||
94 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) != 0; | ||
95 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, AES) != 0; | ||
96 | } | ||
97 | |||
98 | static inline bool isar_feature_aa32_pmull(const ARMISARegisters *id) | ||
99 | { | ||
100 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) > 1; | ||
101 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, AES) > 1; | ||
102 | } | ||
103 | |||
104 | static inline bool isar_feature_aa32_sha1(const ARMISARegisters *id) | ||
105 | { | ||
106 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA1) != 0; | ||
107 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, SHA1) != 0; | ||
108 | } | ||
109 | |||
110 | static inline bool isar_feature_aa32_sha2(const ARMISARegisters *id) | ||
111 | { | ||
112 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA2) != 0; | ||
113 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, SHA2) != 0; | ||
114 | } | ||
115 | |||
116 | static inline bool isar_feature_aa32_crc32(const ARMISARegisters *id) | ||
117 | { | ||
118 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, CRC32) != 0; | ||
119 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, CRC32) != 0; | ||
120 | } | ||
121 | |||
122 | static inline bool isar_feature_aa32_rdm(const ARMISARegisters *id) | ||
123 | { | ||
124 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, RDM) != 0; | ||
125 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, RDM) != 0; | ||
126 | } | ||
127 | |||
128 | static inline bool isar_feature_aa32_vcma(const ARMISARegisters *id) | ||
129 | { | ||
130 | - return FIELD_EX32(id->id_isar5, ID_ISAR5, VCMA) != 0; | ||
131 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR5, VCMA) != 0; | ||
132 | } | ||
133 | |||
134 | static inline bool isar_feature_aa32_jscvt(const ARMISARegisters *id) | ||
135 | { | ||
136 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, JSCVT) != 0; | ||
137 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, JSCVT) != 0; | ||
138 | } | ||
139 | |||
140 | static inline bool isar_feature_aa32_dp(const ARMISARegisters *id) | ||
141 | { | ||
142 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, DP) != 0; | ||
143 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, DP) != 0; | ||
144 | } | ||
145 | |||
146 | static inline bool isar_feature_aa32_fhm(const ARMISARegisters *id) | ||
147 | { | ||
148 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, FHM) != 0; | ||
149 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, FHM) != 0; | ||
150 | } | ||
151 | |||
152 | static inline bool isar_feature_aa32_sb(const ARMISARegisters *id) | ||
153 | { | ||
154 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, SB) != 0; | ||
155 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, SB) != 0; | ||
156 | } | ||
157 | |||
158 | static inline bool isar_feature_aa32_predinv(const ARMISARegisters *id) | ||
159 | { | ||
160 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, SPECRES) != 0; | ||
161 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, SPECRES) != 0; | ||
162 | } | ||
163 | |||
164 | static inline bool isar_feature_aa32_bf16(const ARMISARegisters *id) | ||
165 | { | ||
166 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, BF16) != 0; | ||
167 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, BF16) != 0; | ||
168 | } | ||
169 | |||
170 | static inline bool isar_feature_aa32_i8mm(const ARMISARegisters *id) | ||
171 | { | ||
172 | - return FIELD_EX32(id->id_isar6, ID_ISAR6, I8MM) != 0; | ||
173 | + return FIELD_EX32_IDREG(&id->idregs, ID_ISAR6, I8MM) != 0; | ||
174 | } | ||
175 | |||
176 | static inline bool isar_feature_aa32_ras(const ARMISARegisters *id) | ||
206 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 177 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
207 | index XXXXXXX..XXXXXXX 100644 | 178 | index XXXXXXX..XXXXXXX 100644 |
208 | --- a/target/arm/cpu.c | 179 | --- a/target/arm/cpu.c |
209 | +++ b/target/arm/cpu.c | 180 | +++ b/target/arm/cpu.c |
210 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 181 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
... | ... | ||
268 | - cpu->isar.id_isar3 = u; | 239 | - cpu->isar.id_isar3 = u; |
269 | + SET_IDREG(idregs, ID_ISAR3, u); | 240 | + SET_IDREG(idregs, ID_ISAR3, u); |
270 | } | 241 | } |
271 | 242 | ||
272 | 243 | ||
244 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
245 | index XXXXXXX..XXXXXXX 100644 | ||
246 | --- a/target/arm/cpu.h | ||
247 | +++ b/target/arm/cpu.h | ||
248 | @@ -XXX,XX +XXX,XX @@ regval = FIELD_DP64(regval, REG, FIELD, VALUE); \ | ||
249 | _set_idreg(MAP, SYS_ ## REG ## _EL1, regval); \ | ||
250 | } | ||
251 | |||
252 | +#define FIELD_DP32_IDREG(MAP, REG, FIELD, VALUE) \ | ||
253 | +{ \ | ||
254 | +uint64_t regval = _get_idreg(MAP, SYS_ ## REG ## _EL1); \ | ||
255 | +regval = FIELD_DP32(regval, REG, FIELD, VALUE); \ | ||
256 | +_set_idreg(MAP, SYS_ ## REG ## _EL1, regval); \ | ||
257 | +} | ||
258 | + | ||
259 | #define FIELD_EX64_IDREG(MAP, REG, FIELD) \ | ||
260 | FIELD_EX64(_get_idreg(MAP, SYS_ ## REG ## _EL1), REG, FIELD) \ | ||
261 | |||
262 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
263 | * field by reading the value from the KVM vCPU. | ||
264 | */ | ||
265 | struct ARMISARegisters { | ||
266 | - uint32_t id_isar0; | ||
267 | - uint32_t id_isar1; | ||
268 | - uint32_t id_isar2; | ||
269 | - uint32_t id_isar3; | ||
270 | - uint32_t id_isar4; | ||
271 | - uint32_t id_isar5; | ||
272 | - uint32_t id_isar6; | ||
273 | uint32_t id_mmfr0; | ||
274 | uint32_t id_mmfr1; | ||
275 | uint32_t id_mmfr2; | ||
273 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 276 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
274 | index XXXXXXX..XXXXXXX 100644 | 277 | index XXXXXXX..XXXXXXX 100644 |
275 | --- a/target/arm/cpu64.c | 278 | --- a/target/arm/cpu64.c |
276 | +++ b/target/arm/cpu64.c | 279 | +++ b/target/arm/cpu64.c |
277 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) | 280 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) |
... | ... | ||
1101 | + SET_IDREG(idregs, ID_ISAR6, 0x01111111); | 1104 | + SET_IDREG(idregs, ID_ISAR6, 0x01111111); |
1102 | cpu->isar.mvfr0 = 0x10110222; | 1105 | cpu->isar.mvfr0 = 0x10110222; |
1103 | cpu->isar.mvfr1 = 0x13211111; | 1106 | cpu->isar.mvfr1 = 0x13211111; |
1104 | cpu->isar.mvfr2 = 0x00000043; | 1107 | cpu->isar.mvfr2 = 0x00000043; |
1105 | -- | 1108 | -- |
1106 | 2.41.0 | 1109 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
6 | hw/intc/armv7m_nvic.c | 5 ++-- | ||
3 | target/arm/cpu-features.h | 10 +++---- | 7 | target/arm/cpu-features.h | 10 +++---- |
8 | target/arm/cpu.c | 8 ++--- | ||
4 | target/arm/cpu.h | 3 -- | 9 | target/arm/cpu.h | 3 -- |
5 | hw/intc/armv7m_nvic.c | 5 ++-- | ||
6 | target/arm/cpu.c | 8 ++--- | ||
7 | target/arm/cpu64.c | 8 ++--- | 10 | target/arm/cpu64.c | 8 ++--- |
8 | target/arm/helper.c | 8 ++--- | 11 | target/arm/helper.c | 8 ++--- |
9 | target/arm/kvm.c | 3 +- | 12 | target/arm/kvm.c | 3 +- |
10 | target/arm/tcg/cpu-v7m.c | 24 +++++++-------- | 13 | target/arm/tcg/cpu-v7m.c | 24 +++++++-------- |
11 | target/arm/tcg/cpu32.c | 61 ++++++++++++++++++++------------------- | 14 | target/arm/tcg/cpu32.c | 61 ++++++++++++++++++++------------------- |
12 | target/arm/tcg/cpu64.c | 44 ++++++++++++++-------------- | 15 | target/arm/tcg/cpu64.c | 44 ++++++++++++++-------------- |
13 | 10 files changed, 85 insertions(+), 89 deletions(-) | 16 | 10 files changed, 85 insertions(+), 89 deletions(-) |
14 | 17 | ||
15 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/cpu-features.h | ||
18 | +++ b/target/arm/cpu-features.h | ||
19 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_i8mm(const ARMISARegisters *id) | ||
20 | |||
21 | static inline bool isar_feature_aa32_ras(const ARMISARegisters *id) | ||
22 | { | ||
23 | - return FIELD_EX32(id->id_pfr0, ID_PFR0, RAS) != 0; | ||
24 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR0, RAS) != 0; | ||
25 | } | ||
26 | |||
27 | static inline bool isar_feature_aa32_mprofile(const ARMISARegisters *id) | ||
28 | { | ||
29 | - return FIELD_EX32(id->id_pfr1, ID_PFR1, MPROGMOD) != 0; | ||
30 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR1, MPROGMOD) != 0; | ||
31 | } | ||
32 | |||
33 | static inline bool isar_feature_aa32_m_sec_state(const ARMISARegisters *id) | ||
34 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_m_sec_state(const ARMISARegisters *id) | ||
35 | * Return true if M-profile state handling insns | ||
36 | * (VSCCLRM, CLRM, FPCTX access insns) are implemented | ||
37 | */ | ||
38 | - return FIELD_EX32(id->id_pfr1, ID_PFR1, SECURITY) >= 3; | ||
39 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR1, SECURITY) >= 3; | ||
40 | } | ||
41 | |||
42 | static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id) | ||
43 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_evt(const ARMISARegisters *id) | ||
44 | |||
45 | static inline bool isar_feature_aa32_dit(const ARMISARegisters *id) | ||
46 | { | ||
47 | - return FIELD_EX32(id->id_pfr0, ID_PFR0, DIT) != 0; | ||
48 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR0, DIT) != 0; | ||
49 | } | ||
50 | |||
51 | static inline bool isar_feature_aa32_ssbs(const ARMISARegisters *id) | ||
52 | { | ||
53 | - return FIELD_EX32(id->id_pfr2, ID_PFR2, SSBS) != 0; | ||
54 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR2, SSBS) != 0; | ||
55 | } | ||
56 | |||
57 | static inline bool isar_feature_aa32_debugv7p1(const ARMISARegisters *id) | ||
58 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
59 | index XXXXXXX..XXXXXXX 100644 | ||
60 | --- a/target/arm/cpu.h | ||
61 | +++ b/target/arm/cpu.h | ||
62 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
63 | uint32_t id_mmfr3; | ||
64 | uint32_t id_mmfr4; | ||
65 | uint32_t id_mmfr5; | ||
66 | - uint32_t id_pfr0; | ||
67 | - uint32_t id_pfr1; | ||
68 | - uint32_t id_pfr2; | ||
69 | uint32_t mvfr0; | ||
70 | uint32_t mvfr1; | ||
71 | uint32_t mvfr2; | ||
72 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 18 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
73 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
74 | --- a/hw/intc/armv7m_nvic.c | 20 | --- a/hw/intc/armv7m_nvic.c |
75 | +++ b/hw/intc/armv7m_nvic.c | 21 | +++ b/hw/intc/armv7m_nvic.c |
76 | @@ -XXX,XX +XXX,XX @@ static void nvic_nmi_trigger(void *opaque, int n, int level) | 22 | @@ -XXX,XX +XXX,XX @@ static void nvic_nmi_trigger(void *opaque, int n, int level) |
... | ... | ||
94 | - return cpu->isar.id_pfr1; | 40 | - return cpu->isar.id_pfr1; |
95 | + return GET_IDREG(idregs, ID_PFR1); | 41 | + return GET_IDREG(idregs, ID_PFR1); |
96 | case 0xd48: /* DFR0. */ | 42 | case 0xd48: /* DFR0. */ |
97 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { | 43 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { |
98 | goto bad_offset; | 44 | goto bad_offset; |
45 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
46 | index XXXXXXX..XXXXXXX 100644 | ||
47 | --- a/target/arm/cpu-features.h | ||
48 | +++ b/target/arm/cpu-features.h | ||
49 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_i8mm(const ARMISARegisters *id) | ||
50 | |||
51 | static inline bool isar_feature_aa32_ras(const ARMISARegisters *id) | ||
52 | { | ||
53 | - return FIELD_EX32(id->id_pfr0, ID_PFR0, RAS) != 0; | ||
54 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR0, RAS) != 0; | ||
55 | } | ||
56 | |||
57 | static inline bool isar_feature_aa32_mprofile(const ARMISARegisters *id) | ||
58 | { | ||
59 | - return FIELD_EX32(id->id_pfr1, ID_PFR1, MPROGMOD) != 0; | ||
60 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR1, MPROGMOD) != 0; | ||
61 | } | ||
62 | |||
63 | static inline bool isar_feature_aa32_m_sec_state(const ARMISARegisters *id) | ||
64 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_m_sec_state(const ARMISARegisters *id) | ||
65 | * Return true if M-profile state handling insns | ||
66 | * (VSCCLRM, CLRM, FPCTX access insns) are implemented | ||
67 | */ | ||
68 | - return FIELD_EX32(id->id_pfr1, ID_PFR1, SECURITY) >= 3; | ||
69 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR1, SECURITY) >= 3; | ||
70 | } | ||
71 | |||
72 | static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id) | ||
73 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_evt(const ARMISARegisters *id) | ||
74 | |||
75 | static inline bool isar_feature_aa32_dit(const ARMISARegisters *id) | ||
76 | { | ||
77 | - return FIELD_EX32(id->id_pfr0, ID_PFR0, DIT) != 0; | ||
78 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR0, DIT) != 0; | ||
79 | } | ||
80 | |||
81 | static inline bool isar_feature_aa32_ssbs(const ARMISARegisters *id) | ||
82 | { | ||
83 | - return FIELD_EX32(id->id_pfr2, ID_PFR2, SSBS) != 0; | ||
84 | + return FIELD_EX32_IDREG(&id->idregs, ID_PFR2, SSBS) != 0; | ||
85 | } | ||
86 | |||
87 | static inline bool isar_feature_aa32_debugv7p1(const ARMISARegisters *id) | ||
99 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 88 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
100 | index XXXXXXX..XXXXXXX 100644 | 89 | index XXXXXXX..XXXXXXX 100644 |
101 | --- a/target/arm/cpu.c | 90 | --- a/target/arm/cpu.c |
102 | +++ b/target/arm/cpu.c | 91 | +++ b/target/arm/cpu.c |
103 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 92 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
... | ... | ||
127 | - FIELD_DP32(cpu->isar.id_pfr0, ID_PFR0, AMU, 0); | 116 | - FIELD_DP32(cpu->isar.id_pfr0, ID_PFR0, AMU, 0); |
128 | + FIELD_DP32_IDREG(idregs, ID_PFR0, AMU, 0); | 117 | + FIELD_DP32_IDREG(idregs, ID_PFR0, AMU, 0); |
129 | /* FEAT_MPAM (Memory Partitioning and Monitoring Extension) */ | 118 | /* FEAT_MPAM (Memory Partitioning and Monitoring Extension) */ |
130 | FIELD_DP64_IDREG(idregs, ID_AA64PFR0, MPAM, 0); | 119 | FIELD_DP64_IDREG(idregs, ID_AA64PFR0, MPAM, 0); |
131 | } | 120 | } |
121 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
122 | index XXXXXXX..XXXXXXX 100644 | ||
123 | --- a/target/arm/cpu.h | ||
124 | +++ b/target/arm/cpu.h | ||
125 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
126 | uint32_t id_mmfr3; | ||
127 | uint32_t id_mmfr4; | ||
128 | uint32_t id_mmfr5; | ||
129 | - uint32_t id_pfr0; | ||
130 | - uint32_t id_pfr1; | ||
131 | - uint32_t id_pfr2; | ||
132 | uint32_t mvfr0; | ||
133 | uint32_t mvfr1; | ||
134 | uint32_t mvfr2; | ||
132 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 135 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
133 | index XXXXXXX..XXXXXXX 100644 | 136 | index XXXXXXX..XXXXXXX 100644 |
134 | --- a/target/arm/cpu64.c | 137 | --- a/target/arm/cpu64.c |
135 | +++ b/target/arm/cpu64.c | 138 | +++ b/target/arm/cpu64.c |
136 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) | 139 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) |
... | ... | ||
319 | t = FIELD_DP32(t, ID_MMFR5, ETS, 2); /* FEAT_ETS2 */ | 322 | t = FIELD_DP32(t, ID_MMFR5, ETS, 2); /* FEAT_ETS2 */ |
320 | cpu->isar.id_mmfr5 = t; | 323 | cpu->isar.id_mmfr5 = t; |
321 | 324 | ||
322 | - t = cpu->isar.id_pfr0; | 325 | - t = cpu->isar.id_pfr0; |
323 | + t = GET_IDREG(idregs, ID_PFR0); | 326 | + t = GET_IDREG(idregs, ID_PFR0); |
324 | t = FIELD_DP32(t, ID_PFR0, CSV2, 2); /* FEAT_CVS2 */ | 327 | t = FIELD_DP32(t, ID_PFR0, CSV2, 2); /* FEAT_CSV2 */ |
325 | t = FIELD_DP32(t, ID_PFR0, DIT, 1); /* FEAT_DIT */ | 328 | t = FIELD_DP32(t, ID_PFR0, DIT, 1); /* FEAT_DIT */ |
326 | t = FIELD_DP32(t, ID_PFR0, RAS, 1); /* FEAT_RAS */ | 329 | t = FIELD_DP32(t, ID_PFR0, RAS, 1); /* FEAT_RAS */ |
327 | - cpu->isar.id_pfr0 = t; | 330 | - cpu->isar.id_pfr0 = t; |
328 | + SET_IDREG(idregs, ID_PFR0, t); | 331 | + SET_IDREG(idregs, ID_PFR0, t); |
329 | 332 | ||
... | ... | ||
574 | + SET_IDREG(idregs, ID_PFR2, 0x00000011); | 577 | + SET_IDREG(idregs, ID_PFR2, 0x00000011); |
575 | SET_IDREG(idregs, ID_AA64PFR0, 0x1201111120111112ull); /* GIC filled in later */ | 578 | SET_IDREG(idregs, ID_AA64PFR0, 0x1201111120111112ull); /* GIC filled in later */ |
576 | SET_IDREG(idregs, ID_AA64PFR1, 0x0000000000000221ull); | 579 | SET_IDREG(idregs, ID_AA64PFR1, 0x0000000000000221ull); |
577 | SET_IDREG(idregs, ID_AA64ZFR0, 0x0000110100110021ull); /* with Crypto */ | 580 | SET_IDREG(idregs, ID_AA64ZFR0, 0x0000110100110021ull); /* with Crypto */ |
578 | -- | 581 | -- |
579 | 2.41.0 | 582 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
6 | hw/intc/armv7m_nvic.c | 2 +- | ||
3 | target/arm/cpu-features.h | 16 ++++++++-------- | 7 | target/arm/cpu-features.h | 16 ++++++++-------- |
8 | target/arm/cpu.c | 13 +++++-------- | ||
4 | target/arm/cpu.h | 2 -- | 9 | target/arm/cpu.h | 2 -- |
5 | hw/intc/armv7m_nvic.c | 2 +- | ||
6 | target/arm/cpu.c | 13 +++++-------- | ||
7 | target/arm/cpu64.c | 4 ++-- | 10 | target/arm/cpu64.c | 4 ++-- |
8 | target/arm/helper.c | 4 ++-- | 11 | target/arm/helper.c | 4 ++-- |
9 | target/arm/kvm.c | 6 ++---- | 12 | target/arm/kvm.c | 6 ++---- |
10 | target/arm/tcg/cpu-v7m.c | 12 ++++++------ | 13 | target/arm/tcg/cpu-v7m.c | 12 ++++++------ |
11 | target/arm/tcg/cpu32.c | 30 ++++++++++++++---------------- | 14 | target/arm/tcg/cpu32.c | 30 ++++++++++++++---------------- |
12 | target/arm/tcg/cpu64.c | 16 ++++++++-------- | 15 | target/arm/tcg/cpu64.c | 16 ++++++++-------- |
13 | 10 files changed, 48 insertions(+), 57 deletions(-) | 16 | 10 files changed, 48 insertions(+), 57 deletions(-) |
14 | 17 | ||
15 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/cpu-features.h | ||
18 | +++ b/target/arm/cpu-features.h | ||
19 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_ats1e1(const ARMISARegisters *id) | ||
20 | static inline bool isar_feature_aa32_pmuv3p1(const ARMISARegisters *id) | ||
21 | { | ||
22 | /* 0xf means "non-standard IMPDEF PMU" */ | ||
23 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 4 && | ||
24 | - FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf; | ||
25 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) >= 4 && | ||
26 | + FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) != 0xf; | ||
27 | } | ||
28 | |||
29 | static inline bool isar_feature_aa32_pmuv3p4(const ARMISARegisters *id) | ||
30 | { | ||
31 | /* 0xf means "non-standard IMPDEF PMU" */ | ||
32 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 5 && | ||
33 | - FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf; | ||
34 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) >= 5 && | ||
35 | + FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) != 0xf; | ||
36 | } | ||
37 | |||
38 | static inline bool isar_feature_aa32_pmuv3p5(const ARMISARegisters *id) | ||
39 | { | ||
40 | /* 0xf means "non-standard IMPDEF PMU" */ | ||
41 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 6 && | ||
42 | - FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf; | ||
43 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) >= 6 && | ||
44 | + FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) != 0xf; | ||
45 | } | ||
46 | |||
47 | static inline bool isar_feature_aa32_hpd(const ARMISARegisters *id) | ||
48 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_ssbs(const ARMISARegisters *id) | ||
49 | |||
50 | static inline bool isar_feature_aa32_debugv7p1(const ARMISARegisters *id) | ||
51 | { | ||
52 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 5; | ||
53 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, COPDBG) >= 5; | ||
54 | } | ||
55 | |||
56 | static inline bool isar_feature_aa32_debugv8p2(const ARMISARegisters *id) | ||
57 | { | ||
58 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 8; | ||
59 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, COPDBG) >= 8; | ||
60 | } | ||
61 | |||
62 | static inline bool isar_feature_aa32_doublelock(const ARMISARegisters *id) | ||
63 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
64 | index XXXXXXX..XXXXXXX 100644 | ||
65 | --- a/target/arm/cpu.h | ||
66 | +++ b/target/arm/cpu.h | ||
67 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
68 | uint32_t mvfr0; | ||
69 | uint32_t mvfr1; | ||
70 | uint32_t mvfr2; | ||
71 | - uint32_t id_dfr0; | ||
72 | - uint32_t id_dfr1; | ||
73 | uint32_t dbgdidr; | ||
74 | uint32_t dbgdevid; | ||
75 | uint32_t dbgdevid1; | ||
76 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 18 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
77 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
78 | --- a/hw/intc/armv7m_nvic.c | 20 | --- a/hw/intc/armv7m_nvic.c |
79 | +++ b/hw/intc/armv7m_nvic.c | 21 | +++ b/hw/intc/armv7m_nvic.c |
80 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) | 22 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) |
... | ... | ||
84 | - return cpu->isar.id_dfr0; | 26 | - return cpu->isar.id_dfr0; |
85 | + return GET_IDREG(idregs, ID_DFR0); | 27 | + return GET_IDREG(idregs, ID_DFR0); |
86 | case 0xd4c: /* AFR0. */ | 28 | case 0xd4c: /* AFR0. */ |
87 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { | 29 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { |
88 | goto bad_offset; | 30 | goto bad_offset; |
31 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
32 | index XXXXXXX..XXXXXXX 100644 | ||
33 | --- a/target/arm/cpu-features.h | ||
34 | +++ b/target/arm/cpu-features.h | ||
35 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_ats1e1(const ARMISARegisters *id) | ||
36 | static inline bool isar_feature_aa32_pmuv3p1(const ARMISARegisters *id) | ||
37 | { | ||
38 | /* 0xf means "non-standard IMPDEF PMU" */ | ||
39 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 4 && | ||
40 | - FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf; | ||
41 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) >= 4 && | ||
42 | + FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) != 0xf; | ||
43 | } | ||
44 | |||
45 | static inline bool isar_feature_aa32_pmuv3p4(const ARMISARegisters *id) | ||
46 | { | ||
47 | /* 0xf means "non-standard IMPDEF PMU" */ | ||
48 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 5 && | ||
49 | - FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf; | ||
50 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) >= 5 && | ||
51 | + FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) != 0xf; | ||
52 | } | ||
53 | |||
54 | static inline bool isar_feature_aa32_pmuv3p5(const ARMISARegisters *id) | ||
55 | { | ||
56 | /* 0xf means "non-standard IMPDEF PMU" */ | ||
57 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 6 && | ||
58 | - FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf; | ||
59 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) >= 6 && | ||
60 | + FIELD_EX32_IDREG(&id->idregs, ID_DFR0, PERFMON) != 0xf; | ||
61 | } | ||
62 | |||
63 | static inline bool isar_feature_aa32_hpd(const ARMISARegisters *id) | ||
64 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_ssbs(const ARMISARegisters *id) | ||
65 | |||
66 | static inline bool isar_feature_aa32_debugv7p1(const ARMISARegisters *id) | ||
67 | { | ||
68 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 5; | ||
69 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, COPDBG) >= 5; | ||
70 | } | ||
71 | |||
72 | static inline bool isar_feature_aa32_debugv8p2(const ARMISARegisters *id) | ||
73 | { | ||
74 | - return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 8; | ||
75 | + return FIELD_EX32_IDREG(&id->idregs, ID_DFR0, COPDBG) >= 8; | ||
76 | } | ||
77 | |||
78 | static inline bool isar_feature_aa32_doublelock(const ARMISARegisters *id) | ||
89 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 79 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
90 | index XXXXXXX..XXXXXXX 100644 | 80 | index XXXXXXX..XXXXXXX 100644 |
91 | --- a/target/arm/cpu.c | 81 | --- a/target/arm/cpu.c |
92 | +++ b/target/arm/cpu.c | 82 | +++ b/target/arm/cpu.c |
93 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 83 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
... | ... | ||
125 | - FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, MMAPTRC, 0); | 115 | - FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, MMAPTRC, 0); |
126 | + FIELD_DP32_IDREG(idregs, ID_DFR0, MMAPTRC, 0); | 116 | + FIELD_DP32_IDREG(idregs, ID_DFR0, MMAPTRC, 0); |
127 | /* FEAT_AMU (Activity Monitors Extension) */ | 117 | /* FEAT_AMU (Activity Monitors Extension) */ |
128 | FIELD_DP64_IDREG(idregs, ID_AA64PFR0, AMU, 0); | 118 | FIELD_DP64_IDREG(idregs, ID_AA64PFR0, AMU, 0); |
129 | FIELD_DP32_IDREG(idregs, ID_PFR0, AMU, 0); | 119 | FIELD_DP32_IDREG(idregs, ID_PFR0, AMU, 0); |
120 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
121 | index XXXXXXX..XXXXXXX 100644 | ||
122 | --- a/target/arm/cpu.h | ||
123 | +++ b/target/arm/cpu.h | ||
124 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
125 | uint32_t mvfr0; | ||
126 | uint32_t mvfr1; | ||
127 | uint32_t mvfr2; | ||
128 | - uint32_t id_dfr0; | ||
129 | - uint32_t id_dfr1; | ||
130 | uint32_t dbgdidr; | ||
131 | uint32_t dbgdevid; | ||
132 | uint32_t dbgdevid1; | ||
130 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 133 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
131 | index XXXXXXX..XXXXXXX 100644 | 134 | index XXXXXXX..XXXXXXX 100644 |
132 | --- a/target/arm/cpu64.c | 135 | --- a/target/arm/cpu64.c |
133 | +++ b/target/arm/cpu64.c | 136 | +++ b/target/arm/cpu64.c |
134 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) | 137 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) |
... | ... | ||
456 | + SET_IDREG(idregs, ID_DFR0, 0x16011099); | 459 | + SET_IDREG(idregs, ID_DFR0, 0x16011099); |
457 | cpu->id_afr0 = 0; | 460 | cpu->id_afr0 = 0; |
458 | cpu->isar.id_mmfr0 = 0x10201105; | 461 | cpu->isar.id_mmfr0 = 0x10201105; |
459 | cpu->isar.id_mmfr1 = 0x40000000; | 462 | cpu->isar.id_mmfr1 = 0x40000000; |
460 | -- | 463 | -- |
461 | 2.41.0 | 464 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
6 | hw/intc/armv7m_nvic.c | 8 ++-- | ||
3 | target/arm/cpu-features.h | 18 ++++---- | 7 | target/arm/cpu-features.h | 18 ++++---- |
4 | target/arm/cpu.h | 6 --- | 8 | target/arm/cpu.h | 6 --- |
5 | hw/intc/armv7m_nvic.c | 8 ++-- | ||
6 | target/arm/cpu64.c | 16 +++---- | 9 | target/arm/cpu64.c | 16 +++---- |
7 | target/arm/helper.c | 12 ++--- | 10 | target/arm/helper.c | 12 ++--- |
8 | target/arm/kvm.c | 18 +++----- | 11 | target/arm/kvm.c | 18 +++----- |
9 | target/arm/tcg/cpu-v7m.c | 48 ++++++++++---------- | 12 | target/arm/tcg/cpu-v7m.c | 48 ++++++++++---------- |
10 | target/arm/tcg/cpu32.c | 94 +++++++++++++++++++-------------------- | 13 | target/arm/tcg/cpu32.c | 94 +++++++++++++++++++-------------------- |
11 | target/arm/tcg/cpu64.c | 76 +++++++++++++++---------------- | 14 | target/arm/tcg/cpu64.c | 76 +++++++++++++++---------------- |
12 | 9 files changed, 140 insertions(+), 156 deletions(-) | 15 | 9 files changed, 140 insertions(+), 156 deletions(-) |
13 | 16 | ||
14 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/cpu-features.h | ||
17 | +++ b/target/arm/cpu-features.h | ||
18 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_vminmaxnm(const ARMISARegisters *id) | ||
19 | |||
20 | static inline bool isar_feature_aa32_pxn(const ARMISARegisters *id) | ||
21 | { | ||
22 | - return FIELD_EX32(id->id_mmfr0, ID_MMFR0, VMSA) >= 4; | ||
23 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR0, VMSA) >= 4; | ||
24 | } | ||
25 | |||
26 | static inline bool isar_feature_aa32_pan(const ARMISARegisters *id) | ||
27 | { | ||
28 | - return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) != 0; | ||
29 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR3, PAN) != 0; | ||
30 | } | ||
31 | |||
32 | static inline bool isar_feature_aa32_ats1e1(const ARMISARegisters *id) | ||
33 | { | ||
34 | - return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) >= 2; | ||
35 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR3, PAN) >= 2; | ||
36 | } | ||
37 | |||
38 | static inline bool isar_feature_aa32_pmuv3p1(const ARMISARegisters *id) | ||
39 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_pmuv3p5(const ARMISARegisters *id) | ||
40 | |||
41 | static inline bool isar_feature_aa32_hpd(const ARMISARegisters *id) | ||
42 | { | ||
43 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, HPDS) != 0; | ||
44 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, HPDS) != 0; | ||
45 | } | ||
46 | |||
47 | static inline bool isar_feature_aa32_ac2(const ARMISARegisters *id) | ||
48 | { | ||
49 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, AC2) != 0; | ||
50 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, AC2) != 0; | ||
51 | } | ||
52 | |||
53 | static inline bool isar_feature_aa32_ccidx(const ARMISARegisters *id) | ||
54 | { | ||
55 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, CCIDX) != 0; | ||
56 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, CCIDX) != 0; | ||
57 | } | ||
58 | |||
59 | static inline bool isar_feature_aa32_tts2uxn(const ARMISARegisters *id) | ||
60 | { | ||
61 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, XNX) != 0; | ||
62 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, XNX) != 0; | ||
63 | } | ||
64 | |||
65 | static inline bool isar_feature_aa32_half_evt(const ARMISARegisters *id) | ||
66 | { | ||
67 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 1; | ||
68 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, EVT) >= 1; | ||
69 | } | ||
70 | |||
71 | static inline bool isar_feature_aa32_evt(const ARMISARegisters *id) | ||
72 | { | ||
73 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 2; | ||
74 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, EVT) >= 2; | ||
75 | } | ||
76 | |||
77 | static inline bool isar_feature_aa32_dit(const ARMISARegisters *id) | ||
78 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
79 | index XXXXXXX..XXXXXXX 100644 | ||
80 | --- a/target/arm/cpu.h | ||
81 | +++ b/target/arm/cpu.h | ||
82 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
83 | * field by reading the value from the KVM vCPU. | ||
84 | */ | ||
85 | struct ARMISARegisters { | ||
86 | - uint32_t id_mmfr0; | ||
87 | - uint32_t id_mmfr1; | ||
88 | - uint32_t id_mmfr2; | ||
89 | - uint32_t id_mmfr3; | ||
90 | - uint32_t id_mmfr4; | ||
91 | - uint32_t id_mmfr5; | ||
92 | uint32_t mvfr0; | ||
93 | uint32_t mvfr1; | ||
94 | uint32_t mvfr2; | ||
95 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 17 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
96 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
97 | --- a/hw/intc/armv7m_nvic.c | 19 | --- a/hw/intc/armv7m_nvic.c |
98 | +++ b/hw/intc/armv7m_nvic.c | 20 | +++ b/hw/intc/armv7m_nvic.c |
99 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) | 21 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) |
... | ... | ||
121 | - return cpu->isar.id_mmfr3; | 43 | - return cpu->isar.id_mmfr3; |
122 | + return GET_IDREG(idregs, ID_MMFR3); | 44 | + return GET_IDREG(idregs, ID_MMFR3); |
123 | case 0xd60: /* ISAR0. */ | 45 | case 0xd60: /* ISAR0. */ |
124 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { | 46 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { |
125 | goto bad_offset; | 47 | goto bad_offset; |
48 | diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h | ||
49 | index XXXXXXX..XXXXXXX 100644 | ||
50 | --- a/target/arm/cpu-features.h | ||
51 | +++ b/target/arm/cpu-features.h | ||
52 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_vminmaxnm(const ARMISARegisters *id) | ||
53 | |||
54 | static inline bool isar_feature_aa32_pxn(const ARMISARegisters *id) | ||
55 | { | ||
56 | - return FIELD_EX32(id->id_mmfr0, ID_MMFR0, VMSA) >= 4; | ||
57 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR0, VMSA) >= 4; | ||
58 | } | ||
59 | |||
60 | static inline bool isar_feature_aa32_pan(const ARMISARegisters *id) | ||
61 | { | ||
62 | - return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) != 0; | ||
63 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR3, PAN) != 0; | ||
64 | } | ||
65 | |||
66 | static inline bool isar_feature_aa32_ats1e1(const ARMISARegisters *id) | ||
67 | { | ||
68 | - return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) >= 2; | ||
69 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR3, PAN) >= 2; | ||
70 | } | ||
71 | |||
72 | static inline bool isar_feature_aa32_pmuv3p1(const ARMISARegisters *id) | ||
73 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_pmuv3p5(const ARMISARegisters *id) | ||
74 | |||
75 | static inline bool isar_feature_aa32_hpd(const ARMISARegisters *id) | ||
76 | { | ||
77 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, HPDS) != 0; | ||
78 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, HPDS) != 0; | ||
79 | } | ||
80 | |||
81 | static inline bool isar_feature_aa32_ac2(const ARMISARegisters *id) | ||
82 | { | ||
83 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, AC2) != 0; | ||
84 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, AC2) != 0; | ||
85 | } | ||
86 | |||
87 | static inline bool isar_feature_aa32_ccidx(const ARMISARegisters *id) | ||
88 | { | ||
89 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, CCIDX) != 0; | ||
90 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, CCIDX) != 0; | ||
91 | } | ||
92 | |||
93 | static inline bool isar_feature_aa32_tts2uxn(const ARMISARegisters *id) | ||
94 | { | ||
95 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, XNX) != 0; | ||
96 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, XNX) != 0; | ||
97 | } | ||
98 | |||
99 | static inline bool isar_feature_aa32_half_evt(const ARMISARegisters *id) | ||
100 | { | ||
101 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 1; | ||
102 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, EVT) >= 1; | ||
103 | } | ||
104 | |||
105 | static inline bool isar_feature_aa32_evt(const ARMISARegisters *id) | ||
106 | { | ||
107 | - return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 2; | ||
108 | + return FIELD_EX32_IDREG(&id->idregs, ID_MMFR4, EVT) >= 2; | ||
109 | } | ||
110 | |||
111 | static inline bool isar_feature_aa32_dit(const ARMISARegisters *id) | ||
112 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
113 | index XXXXXXX..XXXXXXX 100644 | ||
114 | --- a/target/arm/cpu.h | ||
115 | +++ b/target/arm/cpu.h | ||
116 | @@ -XXX,XX +XXX,XX @@ struct ArchCPU { | ||
117 | * field by reading the value from the KVM vCPU. | ||
118 | */ | ||
119 | struct ARMISARegisters { | ||
120 | - uint32_t id_mmfr0; | ||
121 | - uint32_t id_mmfr1; | ||
122 | - uint32_t id_mmfr2; | ||
123 | - uint32_t id_mmfr3; | ||
124 | - uint32_t id_mmfr4; | ||
125 | - uint32_t id_mmfr5; | ||
126 | uint32_t mvfr0; | ||
127 | uint32_t mvfr1; | ||
128 | uint32_t mvfr2; | ||
126 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 129 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
127 | index XXXXXXX..XXXXXXX 100644 | 130 | index XXXXXXX..XXXXXXX 100644 |
128 | --- a/target/arm/cpu64.c | 131 | --- a/target/arm/cpu64.c |
129 | +++ b/target/arm/cpu64.c | 132 | +++ b/target/arm/cpu64.c |
130 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) | 133 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a57_initfn(Object *obj) |
... | ... | ||
370 | - t = FIELD_DP32(t, ID_MMFR5, ETS, 2); /* FEAT_ETS2 */ | 373 | - t = FIELD_DP32(t, ID_MMFR5, ETS, 2); /* FEAT_ETS2 */ |
371 | - cpu->isar.id_mmfr5 = t; | 374 | - cpu->isar.id_mmfr5 = t; |
372 | + FIELD_DP32_IDREG(idregs, ID_MMFR5, ETS, 2); /* FEAT_ETS2 */ | 375 | + FIELD_DP32_IDREG(idregs, ID_MMFR5, ETS, 2); /* FEAT_ETS2 */ |
373 | 376 | ||
374 | t = GET_IDREG(idregs, ID_PFR0); | 377 | t = GET_IDREG(idregs, ID_PFR0); |
375 | t = FIELD_DP32(t, ID_PFR0, CSV2, 2); /* FEAT_CVS2 */ | 378 | t = FIELD_DP32(t, ID_PFR0, CSV2, 2); /* FEAT_CSV2 */ |
376 | @@ -XXX,XX +XXX,XX @@ static void arm1136_r2_initfn(Object *obj) | 379 | @@ -XXX,XX +XXX,XX @@ static void arm1136_r2_initfn(Object *obj) |
377 | SET_IDREG(idregs, ID_PFR1, 0x1); | 380 | SET_IDREG(idregs, ID_PFR1, 0x1); |
378 | SET_IDREG(idregs, ID_DFR0, 0x2); | 381 | SET_IDREG(idregs, ID_DFR0, 0x2); |
379 | cpu->id_afr0 = 0x3; | 382 | cpu->id_afr0 = 0x3; |
380 | - cpu->isar.id_mmfr0 = 0x01130003; | 383 | - cpu->isar.id_mmfr0 = 0x01130003; |
... | ... | ||
679 | + SET_IDREG(idregs, ID_MMFR4, 0x01021110); | 682 | + SET_IDREG(idregs, ID_MMFR4, 0x01021110); |
680 | SET_IDREG(idregs, ID_ISAR6, 0x01111111); | 683 | SET_IDREG(idregs, ID_ISAR6, 0x01111111); |
681 | cpu->isar.mvfr0 = 0x10110222; | 684 | cpu->isar.mvfr0 = 0x10110222; |
682 | cpu->isar.mvfr1 = 0x13211111; | 685 | cpu->isar.mvfr1 = 0x13211111; |
683 | -- | 686 | -- |
684 | 2.41.0 | 687 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | The known ID regs are described in a new initialization function | 3 | The known ID regs are described in a new initialization function |
2 | dubbed initialize_cpu_sysreg_properties(). That code will be | 4 | dubbed initialize_cpu_sysreg_properties(). That code will be |
3 | automatically generated from linux arch/arm64/tools/sysreg. For the | 5 | automatically generated from linux arch/arm64/tools/sysreg. For the |
4 | time being let's just describe a single id reg, CTR_EL0. In this | 6 | time being let's just describe a single id reg, CTR_EL0. In this |
5 | description we only care about non RES/RAZ fields, ie. named fields. | 7 | description we only care about non RES/RAZ fields, ie. named fields. |
6 | 8 | ||
7 | The registers are populated in a 3x8x8 array and their fields are | 9 | The registers are populated in a 3x8x8 array and their fields are |
8 | added in a sorted list. | 10 | added in a sorted list. |
9 | 11 | ||
10 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 12 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
13 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
11 | --- | 14 | --- |
12 | target/arm/cpu-custom.h | 58 ++++++++++++++++++++++++++++++ | 15 | target/arm/cpu-custom.h | 58 ++++++++++++++++++++++++++++++ |
13 | target/arm/cpu-sysreg-properties.c | 41 +++++++++++++++++++++ | 16 | target/arm/cpu-sysreg-properties.c | 41 +++++++++++++++++++++ |
14 | target/arm/cpu64.c | 2 ++ | 17 | target/arm/cpu64.c | 2 ++ |
15 | target/arm/meson.build | 1 + | 18 | target/arm/meson.build | 1 + |
... | ... | ||
89 | @@ -XXX,XX +XXX,XX @@ | 92 | @@ -XXX,XX +XXX,XX @@ |
90 | +/* | 93 | +/* |
91 | + * QEMU ARM CPU SYSREG PROPERTIES | 94 | + * QEMU ARM CPU SYSREG PROPERTIES |
92 | + * to be generated from linux sysreg | 95 | + * to be generated from linux sysreg |
93 | + * | 96 | + * |
94 | + * Copyright (c) 2024, Inc. 2024 | 97 | + * Copyright (c) Red Hat, Inc. 2024 |
95 | + * | 98 | + * |
96 | + * This program is free software; you can redistribute it and/or | 99 | + * This program is free software; you can redistribute it and/or |
97 | + * modify it under the terms of the GNU General Public License | 100 | + * modify it under the terms of the GNU General Public License |
98 | + * as published by the Free Software Foundation; either version 2 | 101 | + * as published by the Free Software Foundation; either version 2 |
99 | + * of the License, or (at your option) any later version. | 102 | + * of the License, or (at your option) any later version. |
... | ... | ||
159 | + 'cpu-sysreg-properties.c', | 162 | + 'cpu-sysreg-properties.c', |
160 | )) | 163 | )) |
161 | 164 | ||
162 | arm_system_ss = ss.source_set() | 165 | arm_system_ss = ss.source_set() |
163 | -- | 166 | -- |
164 | 2.41.0 | 167 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Introduce scripts that automate the generation of system register | 3 | Introduce scripts that automate the generation of system register |
2 | definitions from a given linux source tree arch/arm64/tools/sysreg. | 4 | definitions from a given linux source tree arch/arm64/tools/sysreg. |
3 | 5 | ||
4 | Invocation of | 6 | Invocation of |
5 | ./update-aarch64-sysreg-code.sh $PATH_TO_LINUX_SOURCE_TREE | 7 | ./update-aarch64-sysreg-code.sh $PATH_TO_LINUX_SOURCE_TREE |
... | ... | ||
14 | gen-cpu-sysreg-properties.awk is inherited from kernel | 16 | gen-cpu-sysreg-properties.awk is inherited from kernel |
15 | arch/arm64/tools/gen-sysreg.awk. All credits to Mark Rutland | 17 | arch/arm64/tools/gen-sysreg.awk. All credits to Mark Rutland |
16 | the original author of this script. | 18 | the original author of this script. |
17 | 19 | ||
18 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 20 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
21 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
19 | --- | 22 | --- |
20 | scripts/gen-cpu-sysreg-properties.awk | 325 ++++++++++++++++++++++++++ | 23 | scripts/gen-cpu-sysreg-properties.awk | 325 ++++++++++++++++++++++++++ |
21 | scripts/gen-cpu-sysregs-header.awk | 47 ++++ | 24 | scripts/gen-cpu-sysregs-header.awk | 47 ++++ |
22 | scripts/update-aarch64-sysreg-code.sh | 27 +++ | 25 | scripts/update-aarch64-sysreg-code.sh | 27 +++ |
23 | 3 files changed, 399 insertions(+) | 26 | 3 files changed, 399 insertions(+) |
... | ... | ||
441 | +awk -f gen-cpu-sysregs-header.awk \ | 444 | +awk -f gen-cpu-sysregs-header.awk \ |
442 | + $linux/arch/arm64/tools/sysreg > ../target/arm/cpu-sysregs.h | 445 | + $linux/arch/arm64/tools/sysreg > ../target/arm/cpu-sysregs.h |
443 | +awk -f gen-cpu-sysreg-properties.awk \ | 446 | +awk -f gen-cpu-sysreg-properties.awk \ |
444 | + $linux/arch/arm64/tools/sysreg > ../target/arm/cpu-sysreg-properties.c | 447 | + $linux/arch/arm64/tools/sysreg > ../target/arm/cpu-sysreg-properties.c |
445 | -- | 448 | -- |
446 | 2.41.0 | 449 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 3 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
4 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
2 | --- | 5 | --- |
6 | target/arm/cpu-sysreg-properties.c | 689 ++++++++++++++++++++++++++++- | ||
3 | target/arm/cpu-sysregs.h | 142 +++++- | 7 | target/arm/cpu-sysregs.h | 142 +++++- |
4 | target/arm/cpu-sysreg-properties.c | 689 ++++++++++++++++++++++++++++- | ||
5 | 2 files changed, 791 insertions(+), 40 deletions(-) | 8 | 2 files changed, 791 insertions(+), 40 deletions(-) |
6 | 9 | ||
10 | diff --git a/target/arm/cpu-sysreg-properties.c b/target/arm/cpu-sysreg-properties.c | ||
11 | index XXXXXXX..XXXXXXX 100644 | ||
12 | --- a/target/arm/cpu-sysreg-properties.c | ||
13 | +++ b/target/arm/cpu-sysreg-properties.c | ||
14 | @@ -XXX,XX +XXX,XX @@ | ||
15 | -/* | ||
16 | - * QEMU ARM CPU SYSREG PROPERTIES | ||
17 | - * to be generated from linux sysreg | ||
18 | - * | ||
19 | - * Copyright (c) Red Hat, Inc. 2024 | ||
20 | - * | ||
21 | - * This program is free software; you can redistribute it and/or | ||
22 | - * modify it under the terms of the GNU General Public License | ||
23 | - * as published by the Free Software Foundation; either version 2 | ||
24 | - * of the License, or (at your option) any later version. | ||
25 | - * | ||
26 | - * This program is distributed in the hope that it will be useful, | ||
27 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
28 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
29 | - * GNU General Public License for more details. | ||
30 | - * | ||
31 | - * You should have received a copy of the GNU General Public License | ||
32 | - * along with this program; if not, see | ||
33 | - * <http://www.gnu.org/licenses/gpl-2.0.html> | ||
34 | - */ | ||
35 | - | ||
36 | #include "cpu-custom.h" | ||
37 | |||
38 | ARM64SysReg arm64_id_regs[NR_ID_REGS]; | ||
39 | @@ -XXX,XX +XXX,XX @@ ARM64SysReg arm64_id_regs[NR_ID_REGS]; | ||
40 | void initialize_cpu_sysreg_properties(void) | ||
41 | { | ||
42 | memset(arm64_id_regs, 0, sizeof(ARM64SysReg) * NR_ID_REGS); | ||
43 | + | ||
44 | + /* ID_PFR0_EL1 */ | ||
45 | + ARM64SysReg *ID_PFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 0); | ||
46 | + ID_PFR0_EL1->name = "ID_PFR0_EL1"; | ||
47 | + arm64_sysreg_add_field(ID_PFR0_EL1, "RAS", 28, 31); | ||
48 | + arm64_sysreg_add_field(ID_PFR0_EL1, "DIT", 24, 27); | ||
49 | + arm64_sysreg_add_field(ID_PFR0_EL1, "AMU", 20, 23); | ||
50 | + arm64_sysreg_add_field(ID_PFR0_EL1, "CSV2", 16, 19); | ||
51 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State3", 12, 15); | ||
52 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State2", 8, 11); | ||
53 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State1", 4, 7); | ||
54 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State0", 0, 3); | ||
55 | + | ||
56 | + /* ID_PFR1_EL1 */ | ||
57 | + ARM64SysReg *ID_PFR1_EL1 = arm64_sysreg_get(3, 0, 0, 1, 1); | ||
58 | + ID_PFR1_EL1->name = "ID_PFR1_EL1"; | ||
59 | + arm64_sysreg_add_field(ID_PFR1_EL1, "GIC", 28, 31); | ||
60 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Virt_frac", 24, 27); | ||
61 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Sec_frac", 20, 23); | ||
62 | + arm64_sysreg_add_field(ID_PFR1_EL1, "GenTimer", 16, 19); | ||
63 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Virtualization", 12, 15); | ||
64 | + arm64_sysreg_add_field(ID_PFR1_EL1, "MProgMod", 8, 11); | ||
65 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Security", 4, 7); | ||
66 | + arm64_sysreg_add_field(ID_PFR1_EL1, "ProgMod", 0, 3); | ||
67 | + | ||
68 | + /* ID_DFR0_EL1 */ | ||
69 | + ARM64SysReg *ID_DFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 2); | ||
70 | + ID_DFR0_EL1->name = "ID_DFR0_EL1"; | ||
71 | + arm64_sysreg_add_field(ID_DFR0_EL1, "TraceFilt", 28, 31); | ||
72 | + arm64_sysreg_add_field(ID_DFR0_EL1, "PerfMon", 24, 27); | ||
73 | + arm64_sysreg_add_field(ID_DFR0_EL1, "MProfDbg", 20, 23); | ||
74 | + arm64_sysreg_add_field(ID_DFR0_EL1, "MMapTrc", 16, 19); | ||
75 | + arm64_sysreg_add_field(ID_DFR0_EL1, "CopTrc", 12, 15); | ||
76 | + arm64_sysreg_add_field(ID_DFR0_EL1, "MMapDbg", 8, 11); | ||
77 | + arm64_sysreg_add_field(ID_DFR0_EL1, "CopSDbg", 4, 7); | ||
78 | + arm64_sysreg_add_field(ID_DFR0_EL1, "CopDbg", 0, 3); | ||
79 | + | ||
80 | + /* ID_AFR0_EL1 */ | ||
81 | + ARM64SysReg *ID_AFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 3); | ||
82 | + ID_AFR0_EL1->name = "ID_AFR0_EL1"; | ||
83 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF3", 12, 15); | ||
84 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF2", 8, 11); | ||
85 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF1", 4, 7); | ||
86 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF0", 0, 3); | ||
87 | + | ||
88 | + /* ID_MMFR0_EL1 */ | ||
89 | + ARM64SysReg *ID_MMFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 4); | ||
90 | + ID_MMFR0_EL1->name = "ID_MMFR0_EL1"; | ||
91 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "InnerShr", 28, 31); | ||
92 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "FCSE", 24, 27); | ||
93 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "AuxReg", 20, 23); | ||
94 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "TCM", 16, 19); | ||
95 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "ShareLvl", 12, 15); | ||
96 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "OuterShr", 8, 11); | ||
97 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "PMSA", 4, 7); | ||
98 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "VMSA", 0, 3); | ||
99 | + | ||
100 | + /* ID_MMFR1_EL1 */ | ||
101 | + ARM64SysReg *ID_MMFR1_EL1 = arm64_sysreg_get(3, 0, 0, 1, 5); | ||
102 | + ID_MMFR1_EL1->name = "ID_MMFR1_EL1"; | ||
103 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "BPred", 28, 31); | ||
104 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1TstCln", 24, 27); | ||
105 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1Uni", 20, 23); | ||
106 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1Hvd", 16, 19); | ||
107 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1UniSW", 12, 15); | ||
108 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1HvdSW", 8, 11); | ||
109 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1UniVA", 4, 7); | ||
110 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1HvdVA", 0, 3); | ||
111 | + | ||
112 | + /* ID_MMFR2_EL1 */ | ||
113 | + ARM64SysReg *ID_MMFR2_EL1 = arm64_sysreg_get(3, 0, 0, 1, 6); | ||
114 | + ID_MMFR2_EL1->name = "ID_MMFR2_EL1"; | ||
115 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "HWAccFlg", 28, 31); | ||
116 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "WFIStall", 24, 27); | ||
117 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "MemBarr", 20, 23); | ||
118 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "UniTLB", 16, 19); | ||
119 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "HvdTLB", 12, 15); | ||
120 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "L1HvdRng", 8, 11); | ||
121 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "L1HvdBG", 4, 7); | ||
122 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "L1HvdFG", 0, 3); | ||
123 | + | ||
124 | + /* ID_MMFR3_EL1 */ | ||
125 | + ARM64SysReg *ID_MMFR3_EL1 = arm64_sysreg_get(3, 0, 0, 1, 7); | ||
126 | + ID_MMFR3_EL1->name = "ID_MMFR3_EL1"; | ||
127 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "Supersec", 28, 31); | ||
128 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CMemSz", 24, 27); | ||
129 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CohWalk", 20, 23); | ||
130 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "PAN", 16, 19); | ||
131 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "MaintBcst", 12, 15); | ||
132 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "BPMaint", 8, 11); | ||
133 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CMaintSW", 4, 7); | ||
134 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CMaintVA", 0, 3); | ||
135 | + | ||
136 | + /* ID_ISAR0_EL1 */ | ||
137 | + ARM64SysReg *ID_ISAR0_EL1 = arm64_sysreg_get(3, 0, 0, 2, 0); | ||
138 | + ID_ISAR0_EL1->name = "ID_ISAR0_EL1"; | ||
139 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Divide", 24, 27); | ||
140 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Debug", 20, 23); | ||
141 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Coproc", 16, 19); | ||
142 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "CmpBranch", 12, 15); | ||
143 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "BitField", 8, 11); | ||
144 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "BitCount", 4, 7); | ||
145 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Swap", 0, 3); | ||
146 | + | ||
147 | + /* ID_ISAR1_EL1 */ | ||
148 | + ARM64SysReg *ID_ISAR1_EL1 = arm64_sysreg_get(3, 0, 0, 2, 1); | ||
149 | + ID_ISAR1_EL1->name = "ID_ISAR1_EL1"; | ||
150 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Jazelle", 28, 31); | ||
151 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Interwork", 24, 27); | ||
152 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Immediate", 20, 23); | ||
153 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "IfThen", 16, 19); | ||
154 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Extend", 12, 15); | ||
155 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Except_AR", 8, 11); | ||
156 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Except", 4, 7); | ||
157 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Endian", 0, 3); | ||
158 | + | ||
159 | + /* ID_ISAR2_EL1 */ | ||
160 | + ARM64SysReg *ID_ISAR2_EL1 = arm64_sysreg_get(3, 0, 0, 2, 2); | ||
161 | + ID_ISAR2_EL1->name = "ID_ISAR2_EL1"; | ||
162 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "Reversal", 28, 31); | ||
163 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "PSR_AR", 24, 27); | ||
164 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MultU", 20, 23); | ||
165 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MultS", 16, 19); | ||
166 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "Mult", 12, 15); | ||
167 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MultiAccessInt", 8, 11); | ||
168 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MemHint", 4, 7); | ||
169 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "LoadStore", 0, 3); | ||
170 | + | ||
171 | + /* ID_ISAR3_EL1 */ | ||
172 | + ARM64SysReg *ID_ISAR3_EL1 = arm64_sysreg_get(3, 0, 0, 2, 3); | ||
173 | + ID_ISAR3_EL1->name = "ID_ISAR3_EL1"; | ||
174 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "T32EE", 28, 31); | ||
175 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "TrueNOP", 24, 27); | ||
176 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "T32Copy", 20, 23); | ||
177 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "TabBranch", 16, 19); | ||
178 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "SynchPrim", 12, 15); | ||
179 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "SVC", 8, 11); | ||
180 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "SIMD", 4, 7); | ||
181 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "Saturate", 0, 3); | ||
182 | + | ||
183 | + /* ID_ISAR4_EL1 */ | ||
184 | + ARM64SysReg *ID_ISAR4_EL1 = arm64_sysreg_get(3, 0, 0, 2, 4); | ||
185 | + ID_ISAR4_EL1->name = "ID_ISAR4_EL1"; | ||
186 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "SWP_frac", 28, 31); | ||
187 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "PSR_M", 24, 27); | ||
188 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "SynchPrim_frac", 20, 23); | ||
189 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "Barrier", 16, 19); | ||
190 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "SMC", 12, 15); | ||
191 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "Writeback", 8, 11); | ||
192 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "WithShifts", 4, 7); | ||
193 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "Unpriv", 0, 3); | ||
194 | + | ||
195 | + /* ID_ISAR5_EL1 */ | ||
196 | + ARM64SysReg *ID_ISAR5_EL1 = arm64_sysreg_get(3, 0, 0, 2, 5); | ||
197 | + ID_ISAR5_EL1->name = "ID_ISAR5_EL1"; | ||
198 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "VCMA", 28, 31); | ||
199 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "RDM", 24, 27); | ||
200 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "CRC32", 16, 19); | ||
201 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "SHA2", 12, 15); | ||
202 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "SHA1", 8, 11); | ||
203 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "AES", 4, 7); | ||
204 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "SEVL", 0, 3); | ||
205 | + | ||
206 | + /* ID_ISAR6_EL1 */ | ||
207 | + ARM64SysReg *ID_ISAR6_EL1 = arm64_sysreg_get(3, 0, 0, 2, 7); | ||
208 | + ID_ISAR6_EL1->name = "ID_ISAR6_EL1"; | ||
209 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "I8MM", 24, 27); | ||
210 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "BF16", 20, 23); | ||
211 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "SPECRES", 16, 19); | ||
212 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "SB", 12, 15); | ||
213 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "FHM", 8, 11); | ||
214 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "DP", 4, 7); | ||
215 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "JSCVT", 0, 3); | ||
216 | + | ||
217 | + /* ID_MMFR4_EL1 */ | ||
218 | + ARM64SysReg *ID_MMFR4_EL1 = arm64_sysreg_get(3, 0, 0, 2, 6); | ||
219 | + ID_MMFR4_EL1->name = "ID_MMFR4_EL1"; | ||
220 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "EVT", 28, 31); | ||
221 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "CCIDX", 24, 27); | ||
222 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "LSM", 20, 23); | ||
223 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "HPDS", 16, 19); | ||
224 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "CnP", 12, 15); | ||
225 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "XNX", 8, 11); | ||
226 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "AC2", 4, 7); | ||
227 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "SpecSEI", 0, 3); | ||
228 | + | ||
229 | + /* MVFR0_EL1 */ | ||
230 | + ARM64SysReg *MVFR0_EL1 = arm64_sysreg_get(3, 0, 0, 3, 0); | ||
231 | + MVFR0_EL1->name = "MVFR0_EL1"; | ||
232 | + arm64_sysreg_add_field(MVFR0_EL1, "FPRound", 28, 31); | ||
233 | + arm64_sysreg_add_field(MVFR0_EL1, "FPShVec", 24, 27); | ||
234 | + arm64_sysreg_add_field(MVFR0_EL1, "FPSqrt", 20, 23); | ||
235 | + arm64_sysreg_add_field(MVFR0_EL1, "FPDivide", 16, 19); | ||
236 | + arm64_sysreg_add_field(MVFR0_EL1, "FPTrap", 12, 15); | ||
237 | + arm64_sysreg_add_field(MVFR0_EL1, "FPDP", 8, 11); | ||
238 | + arm64_sysreg_add_field(MVFR0_EL1, "FPSP", 4, 7); | ||
239 | + arm64_sysreg_add_field(MVFR0_EL1, "SIMDReg", 0, 3); | ||
240 | + | ||
241 | + /* MVFR1_EL1 */ | ||
242 | + ARM64SysReg *MVFR1_EL1 = arm64_sysreg_get(3, 0, 0, 3, 1); | ||
243 | + MVFR1_EL1->name = "MVFR1_EL1"; | ||
244 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDFMAC", 28, 31); | ||
245 | + arm64_sysreg_add_field(MVFR1_EL1, "FPHP", 24, 27); | ||
246 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDHP", 20, 23); | ||
247 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDSP", 16, 19); | ||
248 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDInt", 12, 15); | ||
249 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDLS", 8, 11); | ||
250 | + arm64_sysreg_add_field(MVFR1_EL1, "FPDNaN", 4, 7); | ||
251 | + arm64_sysreg_add_field(MVFR1_EL1, "FPFtZ", 0, 3); | ||
252 | + | ||
253 | + /* MVFR2_EL1 */ | ||
254 | + ARM64SysReg *MVFR2_EL1 = arm64_sysreg_get(3, 0, 0, 3, 2); | ||
255 | + MVFR2_EL1->name = "MVFR2_EL1"; | ||
256 | + arm64_sysreg_add_field(MVFR2_EL1, "FPMisc", 4, 7); | ||
257 | + arm64_sysreg_add_field(MVFR2_EL1, "SIMDMisc", 0, 3); | ||
258 | + | ||
259 | + /* ID_PFR2_EL1 */ | ||
260 | + ARM64SysReg *ID_PFR2_EL1 = arm64_sysreg_get(3, 0, 0, 3, 4); | ||
261 | + ID_PFR2_EL1->name = "ID_PFR2_EL1"; | ||
262 | + arm64_sysreg_add_field(ID_PFR2_EL1, "RAS_frac", 8, 11); | ||
263 | + arm64_sysreg_add_field(ID_PFR2_EL1, "SSBS", 4, 7); | ||
264 | + arm64_sysreg_add_field(ID_PFR2_EL1, "CSV3", 0, 3); | ||
265 | + | ||
266 | + /* ID_DFR1_EL1 */ | ||
267 | + ARM64SysReg *ID_DFR1_EL1 = arm64_sysreg_get(3, 0, 0, 3, 5); | ||
268 | + ID_DFR1_EL1->name = "ID_DFR1_EL1"; | ||
269 | + arm64_sysreg_add_field(ID_DFR1_EL1, "HPMN0", 4, 7); | ||
270 | + arm64_sysreg_add_field(ID_DFR1_EL1, "MTPMU", 0, 3); | ||
271 | + | ||
272 | + /* ID_MMFR5_EL1 */ | ||
273 | + ARM64SysReg *ID_MMFR5_EL1 = arm64_sysreg_get(3, 0, 0, 3, 6); | ||
274 | + ID_MMFR5_EL1->name = "ID_MMFR5_EL1"; | ||
275 | + arm64_sysreg_add_field(ID_MMFR5_EL1, "nTLBPA", 4, 7); | ||
276 | + arm64_sysreg_add_field(ID_MMFR5_EL1, "ETS", 0, 3); | ||
277 | + | ||
278 | + /* ID_AA64PFR0_EL1 */ | ||
279 | + ARM64SysReg *ID_AA64PFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 0); | ||
280 | + ID_AA64PFR0_EL1->name = "ID_AA64PFR0_EL1"; | ||
281 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "CSV3", 60, 63); | ||
282 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "CSV2", 56, 59); | ||
283 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "RME", 52, 55); | ||
284 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "DIT", 48, 51); | ||
285 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "AMU", 44, 47); | ||
286 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "MPAM", 40, 43); | ||
287 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "SEL2", 36, 39); | ||
288 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "SVE", 32, 35); | ||
289 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "RAS", 28, 31); | ||
290 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "GIC", 24, 27); | ||
291 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "AdvSIMD", 20, 23); | ||
292 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "AdvSIMD", 20, 23); | ||
293 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "FP", 16, 19); | ||
294 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "FP", 16, 19); | ||
295 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL3", 12, 15); | ||
296 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL2", 8, 11); | ||
297 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL1", 4, 7); | ||
298 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL0", 0, 3); | ||
299 | + | ||
300 | + /* ID_AA64PFR1_EL1 */ | ||
301 | + ARM64SysReg *ID_AA64PFR1_EL1 = arm64_sysreg_get(3, 0, 0, 4, 1); | ||
302 | + ID_AA64PFR1_EL1->name = "ID_AA64PFR1_EL1"; | ||
303 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "PFAR", 60, 63); | ||
304 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "DF2", 56, 59); | ||
305 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MTEX", 52, 55); | ||
306 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "THE", 48, 51); | ||
307 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "GCS", 44, 47); | ||
308 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MTE_frac", 40, 43); | ||
309 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "NMI", 36, 39); | ||
310 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "CSV2_frac", 32, 35); | ||
311 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "RNDR_trap", 28, 31); | ||
312 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "SME", 24, 27); | ||
313 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MPAM_frac", 16, 19); | ||
314 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "RAS_frac", 12, 15); | ||
315 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MTE", 8, 11); | ||
316 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "SSBS", 4, 7); | ||
317 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "BT", 0, 3); | ||
318 | + | ||
319 | + /* ID_AA64PFR2_EL1 */ | ||
320 | + ARM64SysReg *ID_AA64PFR2_EL1 = arm64_sysreg_get(3, 0, 0, 4, 2); | ||
321 | + ID_AA64PFR2_EL1->name = "ID_AA64PFR2_EL1"; | ||
322 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "FPMR", 32, 35); | ||
323 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "MTEFAR", 8, 11); | ||
324 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "MTESTOREONLY", 4, 7); | ||
325 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "MTEPERM", 0, 3); | ||
326 | + | ||
327 | + /* ID_AA64ZFR0_EL1 */ | ||
328 | + ARM64SysReg *ID_AA64ZFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 4); | ||
329 | + ID_AA64ZFR0_EL1->name = "ID_AA64ZFR0_EL1"; | ||
330 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "F64MM", 56, 59); | ||
331 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "F32MM", 52, 55); | ||
332 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "I8MM", 44, 47); | ||
333 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "SM4", 40, 43); | ||
334 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "SHA3", 32, 35); | ||
335 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "B16B16", 24, 27); | ||
336 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "BF16", 20, 23); | ||
337 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "BitPerm", 16, 19); | ||
338 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "AES", 4, 7); | ||
339 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "SVEver", 0, 3); | ||
340 | + | ||
341 | + /* ID_AA64SMFR0_EL1 */ | ||
342 | + ARM64SysReg *ID_AA64SMFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 5); | ||
343 | + ID_AA64SMFR0_EL1->name = "ID_AA64SMFR0_EL1"; | ||
344 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "FA64", 63, 63); | ||
345 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "LUTv2", 60, 60); | ||
346 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SMEver", 56, 59); | ||
347 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "I16I64", 52, 55); | ||
348 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F64F64", 48, 48); | ||
349 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "I16I32", 44, 47); | ||
350 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "B16B16", 43, 43); | ||
351 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F16F16", 42, 42); | ||
352 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F8F16", 41, 41); | ||
353 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F8F32", 40, 40); | ||
354 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "I8I32", 36, 39); | ||
355 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F16F32", 35, 35); | ||
356 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "B16F32", 34, 34); | ||
357 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "BI32I32", 33, 33); | ||
358 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F32F32", 32, 32); | ||
359 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SF8FMA", 30, 30); | ||
360 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SF8DP4", 29, 29); | ||
361 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SF8DP2", 28, 28); | ||
362 | + | ||
363 | + /* ID_AA64FPFR0_EL1 */ | ||
364 | + ARM64SysReg *ID_AA64FPFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 7); | ||
365 | + ID_AA64FPFR0_EL1->name = "ID_AA64FPFR0_EL1"; | ||
366 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8CVT", 31, 31); | ||
367 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8FMA", 30, 30); | ||
368 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8DP4", 29, 29); | ||
369 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8DP2", 28, 28); | ||
370 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8E4M3", 1, 1); | ||
371 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8E5M2", 0, 0); | ||
372 | + | ||
373 | + /* ID_AA64DFR0_EL1 */ | ||
374 | + ARM64SysReg *ID_AA64DFR0_EL1 = arm64_sysreg_get(3, 0, 0, 5, 0); | ||
375 | + ID_AA64DFR0_EL1->name = "ID_AA64DFR0_EL1"; | ||
376 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "HPMN0", 60, 63); | ||
377 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "ExtTrcBuff", 56, 59); | ||
378 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "BRBE", 52, 55); | ||
379 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "MTPMU", 48, 51); | ||
380 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "TraceBuffer", 44, 47); | ||
381 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "TraceFilt", 40, 43); | ||
382 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "DoubleLock", 36, 39); | ||
383 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "PMSVer", 32, 35); | ||
384 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "CTX_CMPs", 28, 31); | ||
385 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "WRPs", 20, 23); | ||
386 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "BRPs", 12, 15); | ||
387 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "PMUVer", 8, 11); | ||
388 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "TraceVer", 4, 7); | ||
389 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "DebugVer", 0, 3); | ||
390 | + | ||
391 | + /* ID_AA64DFR1_EL1 */ | ||
392 | + ARM64SysReg *ID_AA64DFR1_EL1 = arm64_sysreg_get(3, 0, 0, 5, 1); | ||
393 | + ID_AA64DFR1_EL1->name = "ID_AA64DFR1_EL1"; | ||
394 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "ABL_CMPs", 56, 63); | ||
395 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "DPFZS", 52, 55); | ||
396 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "EBEP", 48, 51); | ||
397 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "ITE", 44, 47); | ||
398 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "ABLE", 40, 43); | ||
399 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "PMICNTR", 36, 39); | ||
400 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "SPMU", 32, 35); | ||
401 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "CTX_CMPs", 24, 31); | ||
402 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "WRPs", 16, 23); | ||
403 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "BRPs", 8, 15); | ||
404 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "SYSPMUID", 0, 7); | ||
405 | + | ||
406 | + /* ID_AA64AFR0_EL1 */ | ||
407 | + ARM64SysReg *ID_AA64AFR0_EL1 = arm64_sysreg_get(3, 0, 0, 5, 4); | ||
408 | + ID_AA64AFR0_EL1->name = "ID_AA64AFR0_EL1"; | ||
409 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF7", 28, 31); | ||
410 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF6", 24, 27); | ||
411 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF5", 20, 23); | ||
412 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF4", 16, 19); | ||
413 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF3", 12, 15); | ||
414 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF2", 8, 11); | ||
415 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF1", 4, 7); | ||
416 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF0", 0, 3); | ||
417 | + | ||
418 | + /* ID_AA64AFR1_EL1 */ | ||
419 | + ARM64SysReg *ID_AA64AFR1_EL1 = arm64_sysreg_get(3, 0, 0, 5, 5); | ||
420 | + ID_AA64AFR1_EL1->name = "ID_AA64AFR1_EL1"; | ||
421 | + | ||
422 | + /* ID_AA64ISAR0_EL1 */ | ||
423 | + ARM64SysReg *ID_AA64ISAR0_EL1 = arm64_sysreg_get(3, 0, 0, 6, 0); | ||
424 | + ID_AA64ISAR0_EL1->name = "ID_AA64ISAR0_EL1"; | ||
425 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "RNDR", 60, 63); | ||
426 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "TLB", 56, 59); | ||
427 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "TS", 52, 55); | ||
428 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "FHM", 48, 51); | ||
429 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "DP", 44, 47); | ||
430 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SM4", 40, 43); | ||
431 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SM3", 36, 39); | ||
432 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SHA3", 32, 35); | ||
433 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "RDM", 28, 31); | ||
434 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "TME", 24, 27); | ||
435 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "ATOMIC", 20, 23); | ||
436 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "CRC32", 16, 19); | ||
437 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SHA2", 12, 15); | ||
438 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SHA1", 8, 11); | ||
439 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "AES", 4, 7); | ||
440 | + | ||
441 | + /* ID_AA64ISAR1_EL1 */ | ||
442 | + ARM64SysReg *ID_AA64ISAR1_EL1 = arm64_sysreg_get(3, 0, 0, 6, 1); | ||
443 | + ID_AA64ISAR1_EL1->name = "ID_AA64ISAR1_EL1"; | ||
444 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "LS64", 60, 63); | ||
445 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "XS", 56, 59); | ||
446 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "I8MM", 52, 55); | ||
447 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "DGH", 48, 51); | ||
448 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "BF16", 44, 47); | ||
449 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "SPECRES", 40, 43); | ||
450 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "SB", 36, 39); | ||
451 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "FRINTTS", 32, 35); | ||
452 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "GPI", 28, 31); | ||
453 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "GPA", 24, 27); | ||
454 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "LRCPC", 20, 23); | ||
455 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "FCMA", 16, 19); | ||
456 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "JSCVT", 12, 15); | ||
457 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "API", 8, 11); | ||
458 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "APA", 4, 7); | ||
459 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "DPB", 0, 3); | ||
460 | + | ||
461 | + /* ID_AA64ISAR2_EL1 */ | ||
462 | + ARM64SysReg *ID_AA64ISAR2_EL1 = arm64_sysreg_get(3, 0, 0, 6, 2); | ||
463 | + ID_AA64ISAR2_EL1->name = "ID_AA64ISAR2_EL1"; | ||
464 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "ATS1A", 60, 63); | ||
465 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "LUT", 56, 59); | ||
466 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "CSSC", 52, 55); | ||
467 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "RPRFM", 48, 51); | ||
468 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "PRFMSLC", 40, 43); | ||
469 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "SYSINSTR_128", 36, 39); | ||
470 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "SYSREG_128", 32, 35); | ||
471 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "CLRBHB", 28, 31); | ||
472 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "PAC_frac", 24, 27); | ||
473 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "BC", 20, 23); | ||
474 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "MOPS", 16, 19); | ||
475 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "APA3", 12, 15); | ||
476 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "GPA3", 8, 11); | ||
477 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "RPRES", 4, 7); | ||
478 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "WFxT", 0, 3); | ||
479 | + | ||
480 | + /* ID_AA64ISAR3_EL1 */ | ||
481 | + ARM64SysReg *ID_AA64ISAR3_EL1 = arm64_sysreg_get(3, 0, 0, 6, 3); | ||
482 | + ID_AA64ISAR3_EL1->name = "ID_AA64ISAR3_EL1"; | ||
483 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "PACM", 12, 15); | ||
484 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "TLBIW", 8, 11); | ||
485 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "FAMINMAX", 4, 7); | ||
486 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "CPA", 0, 3); | ||
487 | + | ||
488 | + /* ID_AA64MMFR0_EL1 */ | ||
489 | + ARM64SysReg *ID_AA64MMFR0_EL1 = arm64_sysreg_get(3, 0, 0, 7, 0); | ||
490 | + ID_AA64MMFR0_EL1->name = "ID_AA64MMFR0_EL1"; | ||
491 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "ECV", 60, 63); | ||
492 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "FGT", 56, 59); | ||
493 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "EXS", 44, 47); | ||
494 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN4_2", 40, 43); | ||
495 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN64_2", 36, 39); | ||
496 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN16_2", 32, 35); | ||
497 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN4", 28, 31); | ||
498 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN4", 28, 31); | ||
499 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN64", 24, 27); | ||
500 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN64", 24, 27); | ||
501 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN16", 20, 23); | ||
502 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "BIGENDEL0", 16, 19); | ||
503 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "SNSMEM", 12, 15); | ||
504 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "BIGEND", 8, 11); | ||
505 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "ASIDBITS", 4, 7); | ||
506 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "PARANGE", 0, 3); | ||
507 | + | ||
508 | + /* ID_AA64MMFR1_EL1 */ | ||
509 | + ARM64SysReg *ID_AA64MMFR1_EL1 = arm64_sysreg_get(3, 0, 0, 7, 1); | ||
510 | + ID_AA64MMFR1_EL1->name = "ID_AA64MMFR1_EL1"; | ||
511 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "ECBHB", 60, 63); | ||
512 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "CMOW", 56, 59); | ||
513 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "TIDCP1", 52, 55); | ||
514 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "nTLBPA", 48, 51); | ||
515 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "AFP", 44, 47); | ||
516 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "HCX", 40, 43); | ||
517 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "ETS", 36, 39); | ||
518 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "TWED", 32, 35); | ||
519 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "XNX", 28, 31); | ||
520 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "SpecSEI", 24, 27); | ||
521 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "PAN", 20, 23); | ||
522 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "LO", 16, 19); | ||
523 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "HPDS", 12, 15); | ||
524 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "VH", 8, 11); | ||
525 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "VMIDBits", 4, 7); | ||
526 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "HAFDBS", 0, 3); | ||
527 | + | ||
528 | + /* ID_AA64MMFR2_EL1 */ | ||
529 | + ARM64SysReg *ID_AA64MMFR2_EL1 = arm64_sysreg_get(3, 0, 0, 7, 2); | ||
530 | + ID_AA64MMFR2_EL1->name = "ID_AA64MMFR2_EL1"; | ||
531 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "E0PD", 60, 63); | ||
532 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "EVT", 56, 59); | ||
533 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "BBM", 52, 55); | ||
534 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "TTL", 48, 51); | ||
535 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "FWB", 40, 43); | ||
536 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "IDS", 36, 39); | ||
537 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "AT", 32, 35); | ||
538 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "ST", 28, 31); | ||
539 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "NV", 24, 27); | ||
540 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "CCIDX", 20, 23); | ||
541 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "VARange", 16, 19); | ||
542 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "IESB", 12, 15); | ||
543 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "LSM", 8, 11); | ||
544 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "UAO", 4, 7); | ||
545 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "CnP", 0, 3); | ||
546 | + | ||
547 | + /* ID_AA64MMFR3_EL1 */ | ||
548 | + ARM64SysReg *ID_AA64MMFR3_EL1 = arm64_sysreg_get(3, 0, 0, 7, 3); | ||
549 | + ID_AA64MMFR3_EL1->name = "ID_AA64MMFR3_EL1"; | ||
550 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "Spec_FPACC", 60, 63); | ||
551 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "ADERR", 56, 59); | ||
552 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "SDERR", 52, 55); | ||
553 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "ANERR", 44, 47); | ||
554 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "SNERR", 40, 43); | ||
555 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "D128_2", 36, 39); | ||
556 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "D128", 32, 35); | ||
557 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "MEC", 28, 31); | ||
558 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "AIE", 24, 27); | ||
559 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S2POE", 20, 23); | ||
560 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S1POE", 16, 19); | ||
561 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S2PIE", 12, 15); | ||
562 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S1PIE", 8, 11); | ||
563 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "SCTLRX", 4, 7); | ||
564 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "TCRX", 0, 3); | ||
565 | + | ||
566 | + /* ID_AA64MMFR4_EL1 */ | ||
567 | + ARM64SysReg *ID_AA64MMFR4_EL1 = arm64_sysreg_get(3, 0, 0, 7, 4); | ||
568 | + ID_AA64MMFR4_EL1->name = "ID_AA64MMFR4_EL1"; | ||
569 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "E3DSE", 36, 39); | ||
570 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "E2H0", 24, 27); | ||
571 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "E2H0", 24, 27); | ||
572 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "NV_frac", 20, 23); | ||
573 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "FGWTE3", 16, 19); | ||
574 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "HACDBS", 12, 15); | ||
575 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "ASID2", 8, 11); | ||
576 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "EIESB", 4, 7); | ||
577 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "EIESB", 4, 7); | ||
578 | + | ||
579 | +/* For CPACR_EL1 fields see CPACR_ELx */ | ||
580 | + | ||
581 | +/* For ZCR_EL1 fields see ZCR_ELx */ | ||
582 | + | ||
583 | +/* For SMCR_EL1 fields see SMCR_ELx */ | ||
584 | + | ||
585 | +/* For GCSCR_EL1 fields see GCSCR_ELx */ | ||
586 | + | ||
587 | +/* For GCSPR_EL1 fields see GCSPR_ELx */ | ||
588 | + | ||
589 | +/* For CONTEXTIDR_EL1 fields see CONTEXTIDR_ELx */ | ||
590 | + | ||
591 | + /* CCSIDR_EL1 */ | ||
592 | + ARM64SysReg *CCSIDR_EL1 = arm64_sysreg_get(3, 1, 0, 0, 0); | ||
593 | + CCSIDR_EL1->name = "CCSIDR_EL1"; | ||
594 | + arm64_sysreg_add_field(CCSIDR_EL1, "NumSets", 13, 27); | ||
595 | + arm64_sysreg_add_field(CCSIDR_EL1, "Associativity", 3, 12); | ||
596 | + arm64_sysreg_add_field(CCSIDR_EL1, "LineSize", 0, 2); | ||
597 | + | ||
598 | + /* CLIDR_EL1 */ | ||
599 | + ARM64SysReg *CLIDR_EL1 = arm64_sysreg_get(3, 1, 0, 0, 1); | ||
600 | + CLIDR_EL1->name = "CLIDR_EL1"; | ||
601 | + arm64_sysreg_add_field(CLIDR_EL1, "Ttypen", 33, 46); | ||
602 | + arm64_sysreg_add_field(CLIDR_EL1, "ICB", 30, 32); | ||
603 | + arm64_sysreg_add_field(CLIDR_EL1, "LoUU", 27, 29); | ||
604 | + arm64_sysreg_add_field(CLIDR_EL1, "LoC", 24, 26); | ||
605 | + arm64_sysreg_add_field(CLIDR_EL1, "LoUIS", 21, 23); | ||
606 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype7", 18, 20); | ||
607 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype6", 15, 17); | ||
608 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype5", 12, 14); | ||
609 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype4", 9, 11); | ||
610 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype3", 6, 8); | ||
611 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype2", 3, 5); | ||
612 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype1", 0, 2); | ||
613 | + | ||
614 | + /* CCSIDR2_EL1 */ | ||
615 | + ARM64SysReg *CCSIDR2_EL1 = arm64_sysreg_get(3, 1, 0, 0, 2); | ||
616 | + CCSIDR2_EL1->name = "CCSIDR2_EL1"; | ||
617 | + arm64_sysreg_add_field(CCSIDR2_EL1, "NumSets", 0, 23); | ||
618 | + | ||
619 | + /* GMID_EL1 */ | ||
620 | + ARM64SysReg *GMID_EL1 = arm64_sysreg_get(3, 1, 0, 0, 4); | ||
621 | + GMID_EL1->name = "GMID_EL1"; | ||
622 | + arm64_sysreg_add_field(GMID_EL1, "BS", 0, 3); | ||
623 | + | ||
624 | + /* SMIDR_EL1 */ | ||
625 | + ARM64SysReg *SMIDR_EL1 = arm64_sysreg_get(3, 1, 0, 0, 6); | ||
626 | + SMIDR_EL1->name = "SMIDR_EL1"; | ||
627 | + arm64_sysreg_add_field(SMIDR_EL1, "IMPLEMENTER", 24, 31); | ||
628 | + arm64_sysreg_add_field(SMIDR_EL1, "REVISION", 16, 23); | ||
629 | + arm64_sysreg_add_field(SMIDR_EL1, "SMPS", 15, 15); | ||
630 | + arm64_sysreg_add_field(SMIDR_EL1, "AFFINITY", 0, 11); | ||
631 | + | ||
632 | + /* CSSELR_EL1 */ | ||
633 | + ARM64SysReg *CSSELR_EL1 = arm64_sysreg_get(3, 2, 0, 0, 0); | ||
634 | + CSSELR_EL1->name = "CSSELR_EL1"; | ||
635 | + arm64_sysreg_add_field(CSSELR_EL1, "TnD", 4, 4); | ||
636 | + arm64_sysreg_add_field(CSSELR_EL1, "Level", 1, 3); | ||
637 | + arm64_sysreg_add_field(CSSELR_EL1, "InD", 0, 0); | ||
638 | + | ||
639 | /* CTR_EL0 */ | ||
640 | ARM64SysReg *CTR_EL0 = arm64_sysreg_get(3, 3, 0, 0, 1); | ||
641 | CTR_EL0->name = "CTR_EL0"; | ||
642 | - arm64_sysreg_add_field(CTR_EL0, "TMinline", 32, 37); | ||
643 | + arm64_sysreg_add_field(CTR_EL0, "TminLine", 32, 37); | ||
644 | arm64_sysreg_add_field(CTR_EL0, "DIC", 29, 29); | ||
645 | arm64_sysreg_add_field(CTR_EL0, "IDC", 28, 28); | ||
646 | arm64_sysreg_add_field(CTR_EL0, "CWG", 24, 27); | ||
647 | arm64_sysreg_add_field(CTR_EL0, "ERG", 20, 23); | ||
648 | - arm64_sysreg_add_field(CTR_EL0, "DMinLine", 16, 19); | ||
649 | + arm64_sysreg_add_field(CTR_EL0, "DminLine", 16, 19); | ||
650 | arm64_sysreg_add_field(CTR_EL0, "L1Ip", 14, 15); | ||
651 | arm64_sysreg_add_field(CTR_EL0, "IminLine", 0, 3); | ||
652 | -} | ||
653 | |||
654 | + /* DCZID_EL0 */ | ||
655 | + ARM64SysReg *DCZID_EL0 = arm64_sysreg_get(3, 3, 0, 0, 7); | ||
656 | + DCZID_EL0->name = "DCZID_EL0"; | ||
657 | + arm64_sysreg_add_field(DCZID_EL0, "DZP", 4, 4); | ||
658 | + arm64_sysreg_add_field(DCZID_EL0, "BS", 0, 3); | ||
659 | + | ||
660 | +/* For GCSPR_EL0 fields see GCSPR_ELx */ | ||
661 | + | ||
662 | +/* For HFGRTR_EL2 fields see HFGxTR_EL2 */ | ||
663 | + | ||
664 | +/* For HFGWTR_EL2 fields see HFGxTR_EL2 */ | ||
665 | + | ||
666 | +/* For ZCR_EL2 fields see ZCR_ELx */ | ||
667 | + | ||
668 | +/* For SMCR_EL2 fields see SMCR_ELx */ | ||
669 | + | ||
670 | +/* For GCSCR_EL2 fields see GCSCR_ELx */ | ||
671 | + | ||
672 | +/* For GCSPR_EL2 fields see GCSPR_ELx */ | ||
673 | + | ||
674 | +/* For CONTEXTIDR_EL2 fields see CONTEXTIDR_ELx */ | ||
675 | + | ||
676 | +/* For CPACR_EL12 fields see CPACR_ELx */ | ||
677 | + | ||
678 | +/* For ZCR_EL12 fields see ZCR_ELx */ | ||
679 | + | ||
680 | +/* For SMCR_EL12 fields see SMCR_ELx */ | ||
681 | + | ||
682 | +/* For GCSCR_EL12 fields see GCSCR_ELx */ | ||
683 | + | ||
684 | +/* For GCSPR_EL12 fields see GCSPR_ELx */ | ||
685 | + | ||
686 | +/* For CONTEXTIDR_EL12 fields see CONTEXTIDR_ELx */ | ||
687 | + | ||
688 | +/* For TTBR0_EL1 fields see TTBRx_EL1 */ | ||
689 | + | ||
690 | +/* For TTBR1_EL1 fields see TTBRx_EL1 */ | ||
691 | + | ||
692 | +/* For TCR2_EL1 fields see TCR2_EL1x */ | ||
693 | + | ||
694 | +/* For TCR2_EL12 fields see TCR2_EL1x */ | ||
695 | + | ||
696 | +/* For MAIR2_EL1 fields see MAIR2_ELx */ | ||
697 | + | ||
698 | +/* For MAIR2_EL2 fields see MAIR2_ELx */ | ||
699 | + | ||
700 | +/* For PIRE0_EL1 fields see PIRx_ELx */ | ||
701 | + | ||
702 | +/* For PIRE0_EL12 fields see PIRx_ELx */ | ||
703 | + | ||
704 | +/* For PIR_EL1 fields see PIRx_ELx */ | ||
705 | + | ||
706 | +/* For PIR_EL12 fields see PIRx_ELx */ | ||
707 | + | ||
708 | +/* For PIR_EL2 fields see PIRx_ELx */ | ||
709 | + | ||
710 | +/* For POR_EL0 fields see PIRx_ELx */ | ||
711 | + | ||
712 | +/* For POR_EL1 fields see PIRx_ELx */ | ||
713 | + | ||
714 | +/* For POR_EL12 fields see PIRx_ELx */ | ||
715 | + | ||
716 | +/* For S2POR_EL1 fields see PIRx_ELx */ | ||
717 | + | ||
718 | +/* For S2PIR_EL2 fields see PIRx_ELx */ | ||
719 | + | ||
720 | +} | ||
7 | diff --git a/target/arm/cpu-sysregs.h b/target/arm/cpu-sysregs.h | 721 | diff --git a/target/arm/cpu-sysregs.h b/target/arm/cpu-sysregs.h |
8 | index XXXXXXX..XXXXXXX 100644 | 722 | index XXXXXXX..XXXXXXX 100644 |
9 | --- a/target/arm/cpu-sysregs.h | 723 | --- a/target/arm/cpu-sysregs.h |
10 | +++ b/target/arm/cpu-sysregs.h | 724 | +++ b/target/arm/cpu-sysregs.h |
11 | @@ -XXX,XX +XXX,XX @@ | 725 | @@ -XXX,XX +XXX,XX @@ |
... | ... | ||
172 | +#define SYS_TRBTRG_EL1 sys_reg(3, 0, 9, 11, 6) | 886 | +#define SYS_TRBTRG_EL1 sys_reg(3, 0, 9, 11, 6) |
173 | +#define SYS_TRBIDR_EL1 sys_reg(3, 0, 9, 11, 7) | 887 | +#define SYS_TRBIDR_EL1 sys_reg(3, 0, 9, 11, 7) |
174 | 888 | ||
175 | -#endif | 889 | -#endif |
176 | +#endif /* ARM_CPU_SYSREGS_H */ | 890 | +#endif /* ARM_CPU_SYSREGS_H */ |
177 | diff --git a/target/arm/cpu-sysreg-properties.c b/target/arm/cpu-sysreg-properties.c | ||
178 | index XXXXXXX..XXXXXXX 100644 | ||
179 | --- a/target/arm/cpu-sysreg-properties.c | ||
180 | +++ b/target/arm/cpu-sysreg-properties.c | ||
181 | @@ -XXX,XX +XXX,XX @@ | ||
182 | -/* | ||
183 | - * QEMU ARM CPU SYSREG PROPERTIES | ||
184 | - * to be generated from linux sysreg | ||
185 | - * | ||
186 | - * Copyright (c) 2024, Inc. 2024 | ||
187 | - * | ||
188 | - * This program is free software; you can redistribute it and/or | ||
189 | - * modify it under the terms of the GNU General Public License | ||
190 | - * as published by the Free Software Foundation; either version 2 | ||
191 | - * of the License, or (at your option) any later version. | ||
192 | - * | ||
193 | - * This program is distributed in the hope that it will be useful, | ||
194 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
195 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
196 | - * GNU General Public License for more details. | ||
197 | - * | ||
198 | - * You should have received a copy of the GNU General Public License | ||
199 | - * along with this program; if not, see | ||
200 | - * <http://www.gnu.org/licenses/gpl-2.0.html> | ||
201 | - */ | ||
202 | - | ||
203 | #include "cpu-custom.h" | ||
204 | |||
205 | ARM64SysReg arm64_id_regs[NR_ID_REGS]; | ||
206 | @@ -XXX,XX +XXX,XX @@ ARM64SysReg arm64_id_regs[NR_ID_REGS]; | ||
207 | void initialize_cpu_sysreg_properties(void) | ||
208 | { | ||
209 | memset(arm64_id_regs, 0, sizeof(ARM64SysReg) * NR_ID_REGS); | ||
210 | + | ||
211 | + /* ID_PFR0_EL1 */ | ||
212 | + ARM64SysReg *ID_PFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 0); | ||
213 | + ID_PFR0_EL1->name = "ID_PFR0_EL1"; | ||
214 | + arm64_sysreg_add_field(ID_PFR0_EL1, "RAS", 28, 31); | ||
215 | + arm64_sysreg_add_field(ID_PFR0_EL1, "DIT", 24, 27); | ||
216 | + arm64_sysreg_add_field(ID_PFR0_EL1, "AMU", 20, 23); | ||
217 | + arm64_sysreg_add_field(ID_PFR0_EL1, "CSV2", 16, 19); | ||
218 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State3", 12, 15); | ||
219 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State2", 8, 11); | ||
220 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State1", 4, 7); | ||
221 | + arm64_sysreg_add_field(ID_PFR0_EL1, "State0", 0, 3); | ||
222 | + | ||
223 | + /* ID_PFR1_EL1 */ | ||
224 | + ARM64SysReg *ID_PFR1_EL1 = arm64_sysreg_get(3, 0, 0, 1, 1); | ||
225 | + ID_PFR1_EL1->name = "ID_PFR1_EL1"; | ||
226 | + arm64_sysreg_add_field(ID_PFR1_EL1, "GIC", 28, 31); | ||
227 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Virt_frac", 24, 27); | ||
228 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Sec_frac", 20, 23); | ||
229 | + arm64_sysreg_add_field(ID_PFR1_EL1, "GenTimer", 16, 19); | ||
230 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Virtualization", 12, 15); | ||
231 | + arm64_sysreg_add_field(ID_PFR1_EL1, "MProgMod", 8, 11); | ||
232 | + arm64_sysreg_add_field(ID_PFR1_EL1, "Security", 4, 7); | ||
233 | + arm64_sysreg_add_field(ID_PFR1_EL1, "ProgMod", 0, 3); | ||
234 | + | ||
235 | + /* ID_DFR0_EL1 */ | ||
236 | + ARM64SysReg *ID_DFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 2); | ||
237 | + ID_DFR0_EL1->name = "ID_DFR0_EL1"; | ||
238 | + arm64_sysreg_add_field(ID_DFR0_EL1, "TraceFilt", 28, 31); | ||
239 | + arm64_sysreg_add_field(ID_DFR0_EL1, "PerfMon", 24, 27); | ||
240 | + arm64_sysreg_add_field(ID_DFR0_EL1, "MProfDbg", 20, 23); | ||
241 | + arm64_sysreg_add_field(ID_DFR0_EL1, "MMapTrc", 16, 19); | ||
242 | + arm64_sysreg_add_field(ID_DFR0_EL1, "CopTrc", 12, 15); | ||
243 | + arm64_sysreg_add_field(ID_DFR0_EL1, "MMapDbg", 8, 11); | ||
244 | + arm64_sysreg_add_field(ID_DFR0_EL1, "CopSDbg", 4, 7); | ||
245 | + arm64_sysreg_add_field(ID_DFR0_EL1, "CopDbg", 0, 3); | ||
246 | + | ||
247 | + /* ID_AFR0_EL1 */ | ||
248 | + ARM64SysReg *ID_AFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 3); | ||
249 | + ID_AFR0_EL1->name = "ID_AFR0_EL1"; | ||
250 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF3", 12, 15); | ||
251 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF2", 8, 11); | ||
252 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF1", 4, 7); | ||
253 | + arm64_sysreg_add_field(ID_AFR0_EL1, "IMPDEF0", 0, 3); | ||
254 | + | ||
255 | + /* ID_MMFR0_EL1 */ | ||
256 | + ARM64SysReg *ID_MMFR0_EL1 = arm64_sysreg_get(3, 0, 0, 1, 4); | ||
257 | + ID_MMFR0_EL1->name = "ID_MMFR0_EL1"; | ||
258 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "InnerShr", 28, 31); | ||
259 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "FCSE", 24, 27); | ||
260 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "AuxReg", 20, 23); | ||
261 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "TCM", 16, 19); | ||
262 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "ShareLvl", 12, 15); | ||
263 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "OuterShr", 8, 11); | ||
264 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "PMSA", 4, 7); | ||
265 | + arm64_sysreg_add_field(ID_MMFR0_EL1, "VMSA", 0, 3); | ||
266 | + | ||
267 | + /* ID_MMFR1_EL1 */ | ||
268 | + ARM64SysReg *ID_MMFR1_EL1 = arm64_sysreg_get(3, 0, 0, 1, 5); | ||
269 | + ID_MMFR1_EL1->name = "ID_MMFR1_EL1"; | ||
270 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "BPred", 28, 31); | ||
271 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1TstCln", 24, 27); | ||
272 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1Uni", 20, 23); | ||
273 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1Hvd", 16, 19); | ||
274 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1UniSW", 12, 15); | ||
275 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1HvdSW", 8, 11); | ||
276 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1UniVA", 4, 7); | ||
277 | + arm64_sysreg_add_field(ID_MMFR1_EL1, "L1HvdVA", 0, 3); | ||
278 | + | ||
279 | + /* ID_MMFR2_EL1 */ | ||
280 | + ARM64SysReg *ID_MMFR2_EL1 = arm64_sysreg_get(3, 0, 0, 1, 6); | ||
281 | + ID_MMFR2_EL1->name = "ID_MMFR2_EL1"; | ||
282 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "HWAccFlg", 28, 31); | ||
283 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "WFIStall", 24, 27); | ||
284 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "MemBarr", 20, 23); | ||
285 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "UniTLB", 16, 19); | ||
286 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "HvdTLB", 12, 15); | ||
287 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "L1HvdRng", 8, 11); | ||
288 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "L1HvdBG", 4, 7); | ||
289 | + arm64_sysreg_add_field(ID_MMFR2_EL1, "L1HvdFG", 0, 3); | ||
290 | + | ||
291 | + /* ID_MMFR3_EL1 */ | ||
292 | + ARM64SysReg *ID_MMFR3_EL1 = arm64_sysreg_get(3, 0, 0, 1, 7); | ||
293 | + ID_MMFR3_EL1->name = "ID_MMFR3_EL1"; | ||
294 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "Supersec", 28, 31); | ||
295 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CMemSz", 24, 27); | ||
296 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CohWalk", 20, 23); | ||
297 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "PAN", 16, 19); | ||
298 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "MaintBcst", 12, 15); | ||
299 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "BPMaint", 8, 11); | ||
300 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CMaintSW", 4, 7); | ||
301 | + arm64_sysreg_add_field(ID_MMFR3_EL1, "CMaintVA", 0, 3); | ||
302 | + | ||
303 | + /* ID_ISAR0_EL1 */ | ||
304 | + ARM64SysReg *ID_ISAR0_EL1 = arm64_sysreg_get(3, 0, 0, 2, 0); | ||
305 | + ID_ISAR0_EL1->name = "ID_ISAR0_EL1"; | ||
306 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Divide", 24, 27); | ||
307 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Debug", 20, 23); | ||
308 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Coproc", 16, 19); | ||
309 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "CmpBranch", 12, 15); | ||
310 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "BitField", 8, 11); | ||
311 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "BitCount", 4, 7); | ||
312 | + arm64_sysreg_add_field(ID_ISAR0_EL1, "Swap", 0, 3); | ||
313 | + | ||
314 | + /* ID_ISAR1_EL1 */ | ||
315 | + ARM64SysReg *ID_ISAR1_EL1 = arm64_sysreg_get(3, 0, 0, 2, 1); | ||
316 | + ID_ISAR1_EL1->name = "ID_ISAR1_EL1"; | ||
317 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Jazelle", 28, 31); | ||
318 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Interwork", 24, 27); | ||
319 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Immediate", 20, 23); | ||
320 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "IfThen", 16, 19); | ||
321 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Extend", 12, 15); | ||
322 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Except_AR", 8, 11); | ||
323 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Except", 4, 7); | ||
324 | + arm64_sysreg_add_field(ID_ISAR1_EL1, "Endian", 0, 3); | ||
325 | + | ||
326 | + /* ID_ISAR2_EL1 */ | ||
327 | + ARM64SysReg *ID_ISAR2_EL1 = arm64_sysreg_get(3, 0, 0, 2, 2); | ||
328 | + ID_ISAR2_EL1->name = "ID_ISAR2_EL1"; | ||
329 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "Reversal", 28, 31); | ||
330 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "PSR_AR", 24, 27); | ||
331 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MultU", 20, 23); | ||
332 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MultS", 16, 19); | ||
333 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "Mult", 12, 15); | ||
334 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MultiAccessInt", 8, 11); | ||
335 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "MemHint", 4, 7); | ||
336 | + arm64_sysreg_add_field(ID_ISAR2_EL1, "LoadStore", 0, 3); | ||
337 | + | ||
338 | + /* ID_ISAR3_EL1 */ | ||
339 | + ARM64SysReg *ID_ISAR3_EL1 = arm64_sysreg_get(3, 0, 0, 2, 3); | ||
340 | + ID_ISAR3_EL1->name = "ID_ISAR3_EL1"; | ||
341 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "T32EE", 28, 31); | ||
342 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "TrueNOP", 24, 27); | ||
343 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "T32Copy", 20, 23); | ||
344 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "TabBranch", 16, 19); | ||
345 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "SynchPrim", 12, 15); | ||
346 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "SVC", 8, 11); | ||
347 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "SIMD", 4, 7); | ||
348 | + arm64_sysreg_add_field(ID_ISAR3_EL1, "Saturate", 0, 3); | ||
349 | + | ||
350 | + /* ID_ISAR4_EL1 */ | ||
351 | + ARM64SysReg *ID_ISAR4_EL1 = arm64_sysreg_get(3, 0, 0, 2, 4); | ||
352 | + ID_ISAR4_EL1->name = "ID_ISAR4_EL1"; | ||
353 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "SWP_frac", 28, 31); | ||
354 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "PSR_M", 24, 27); | ||
355 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "SynchPrim_frac", 20, 23); | ||
356 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "Barrier", 16, 19); | ||
357 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "SMC", 12, 15); | ||
358 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "Writeback", 8, 11); | ||
359 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "WithShifts", 4, 7); | ||
360 | + arm64_sysreg_add_field(ID_ISAR4_EL1, "Unpriv", 0, 3); | ||
361 | + | ||
362 | + /* ID_ISAR5_EL1 */ | ||
363 | + ARM64SysReg *ID_ISAR5_EL1 = arm64_sysreg_get(3, 0, 0, 2, 5); | ||
364 | + ID_ISAR5_EL1->name = "ID_ISAR5_EL1"; | ||
365 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "VCMA", 28, 31); | ||
366 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "RDM", 24, 27); | ||
367 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "CRC32", 16, 19); | ||
368 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "SHA2", 12, 15); | ||
369 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "SHA1", 8, 11); | ||
370 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "AES", 4, 7); | ||
371 | + arm64_sysreg_add_field(ID_ISAR5_EL1, "SEVL", 0, 3); | ||
372 | + | ||
373 | + /* ID_ISAR6_EL1 */ | ||
374 | + ARM64SysReg *ID_ISAR6_EL1 = arm64_sysreg_get(3, 0, 0, 2, 7); | ||
375 | + ID_ISAR6_EL1->name = "ID_ISAR6_EL1"; | ||
376 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "I8MM", 24, 27); | ||
377 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "BF16", 20, 23); | ||
378 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "SPECRES", 16, 19); | ||
379 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "SB", 12, 15); | ||
380 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "FHM", 8, 11); | ||
381 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "DP", 4, 7); | ||
382 | + arm64_sysreg_add_field(ID_ISAR6_EL1, "JSCVT", 0, 3); | ||
383 | + | ||
384 | + /* ID_MMFR4_EL1 */ | ||
385 | + ARM64SysReg *ID_MMFR4_EL1 = arm64_sysreg_get(3, 0, 0, 2, 6); | ||
386 | + ID_MMFR4_EL1->name = "ID_MMFR4_EL1"; | ||
387 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "EVT", 28, 31); | ||
388 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "CCIDX", 24, 27); | ||
389 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "LSM", 20, 23); | ||
390 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "HPDS", 16, 19); | ||
391 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "CnP", 12, 15); | ||
392 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "XNX", 8, 11); | ||
393 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "AC2", 4, 7); | ||
394 | + arm64_sysreg_add_field(ID_MMFR4_EL1, "SpecSEI", 0, 3); | ||
395 | + | ||
396 | + /* MVFR0_EL1 */ | ||
397 | + ARM64SysReg *MVFR0_EL1 = arm64_sysreg_get(3, 0, 0, 3, 0); | ||
398 | + MVFR0_EL1->name = "MVFR0_EL1"; | ||
399 | + arm64_sysreg_add_field(MVFR0_EL1, "FPRound", 28, 31); | ||
400 | + arm64_sysreg_add_field(MVFR0_EL1, "FPShVec", 24, 27); | ||
401 | + arm64_sysreg_add_field(MVFR0_EL1, "FPSqrt", 20, 23); | ||
402 | + arm64_sysreg_add_field(MVFR0_EL1, "FPDivide", 16, 19); | ||
403 | + arm64_sysreg_add_field(MVFR0_EL1, "FPTrap", 12, 15); | ||
404 | + arm64_sysreg_add_field(MVFR0_EL1, "FPDP", 8, 11); | ||
405 | + arm64_sysreg_add_field(MVFR0_EL1, "FPSP", 4, 7); | ||
406 | + arm64_sysreg_add_field(MVFR0_EL1, "SIMDReg", 0, 3); | ||
407 | + | ||
408 | + /* MVFR1_EL1 */ | ||
409 | + ARM64SysReg *MVFR1_EL1 = arm64_sysreg_get(3, 0, 0, 3, 1); | ||
410 | + MVFR1_EL1->name = "MVFR1_EL1"; | ||
411 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDFMAC", 28, 31); | ||
412 | + arm64_sysreg_add_field(MVFR1_EL1, "FPHP", 24, 27); | ||
413 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDHP", 20, 23); | ||
414 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDSP", 16, 19); | ||
415 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDInt", 12, 15); | ||
416 | + arm64_sysreg_add_field(MVFR1_EL1, "SIMDLS", 8, 11); | ||
417 | + arm64_sysreg_add_field(MVFR1_EL1, "FPDNaN", 4, 7); | ||
418 | + arm64_sysreg_add_field(MVFR1_EL1, "FPFtZ", 0, 3); | ||
419 | + | ||
420 | + /* MVFR2_EL1 */ | ||
421 | + ARM64SysReg *MVFR2_EL1 = arm64_sysreg_get(3, 0, 0, 3, 2); | ||
422 | + MVFR2_EL1->name = "MVFR2_EL1"; | ||
423 | + arm64_sysreg_add_field(MVFR2_EL1, "FPMisc", 4, 7); | ||
424 | + arm64_sysreg_add_field(MVFR2_EL1, "SIMDMisc", 0, 3); | ||
425 | + | ||
426 | + /* ID_PFR2_EL1 */ | ||
427 | + ARM64SysReg *ID_PFR2_EL1 = arm64_sysreg_get(3, 0, 0, 3, 4); | ||
428 | + ID_PFR2_EL1->name = "ID_PFR2_EL1"; | ||
429 | + arm64_sysreg_add_field(ID_PFR2_EL1, "RAS_frac", 8, 11); | ||
430 | + arm64_sysreg_add_field(ID_PFR2_EL1, "SSBS", 4, 7); | ||
431 | + arm64_sysreg_add_field(ID_PFR2_EL1, "CSV3", 0, 3); | ||
432 | + | ||
433 | + /* ID_DFR1_EL1 */ | ||
434 | + ARM64SysReg *ID_DFR1_EL1 = arm64_sysreg_get(3, 0, 0, 3, 5); | ||
435 | + ID_DFR1_EL1->name = "ID_DFR1_EL1"; | ||
436 | + arm64_sysreg_add_field(ID_DFR1_EL1, "HPMN0", 4, 7); | ||
437 | + arm64_sysreg_add_field(ID_DFR1_EL1, "MTPMU", 0, 3); | ||
438 | + | ||
439 | + /* ID_MMFR5_EL1 */ | ||
440 | + ARM64SysReg *ID_MMFR5_EL1 = arm64_sysreg_get(3, 0, 0, 3, 6); | ||
441 | + ID_MMFR5_EL1->name = "ID_MMFR5_EL1"; | ||
442 | + arm64_sysreg_add_field(ID_MMFR5_EL1, "nTLBPA", 4, 7); | ||
443 | + arm64_sysreg_add_field(ID_MMFR5_EL1, "ETS", 0, 3); | ||
444 | + | ||
445 | + /* ID_AA64PFR0_EL1 */ | ||
446 | + ARM64SysReg *ID_AA64PFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 0); | ||
447 | + ID_AA64PFR0_EL1->name = "ID_AA64PFR0_EL1"; | ||
448 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "CSV3", 60, 63); | ||
449 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "CSV2", 56, 59); | ||
450 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "RME", 52, 55); | ||
451 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "DIT", 48, 51); | ||
452 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "AMU", 44, 47); | ||
453 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "MPAM", 40, 43); | ||
454 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "SEL2", 36, 39); | ||
455 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "SVE", 32, 35); | ||
456 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "RAS", 28, 31); | ||
457 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "GIC", 24, 27); | ||
458 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "AdvSIMD", 20, 23); | ||
459 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "AdvSIMD", 20, 23); | ||
460 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "FP", 16, 19); | ||
461 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "FP", 16, 19); | ||
462 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL3", 12, 15); | ||
463 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL2", 8, 11); | ||
464 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL1", 4, 7); | ||
465 | + arm64_sysreg_add_field(ID_AA64PFR0_EL1, "EL0", 0, 3); | ||
466 | + | ||
467 | + /* ID_AA64PFR1_EL1 */ | ||
468 | + ARM64SysReg *ID_AA64PFR1_EL1 = arm64_sysreg_get(3, 0, 0, 4, 1); | ||
469 | + ID_AA64PFR1_EL1->name = "ID_AA64PFR1_EL1"; | ||
470 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "PFAR", 60, 63); | ||
471 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "DF2", 56, 59); | ||
472 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MTEX", 52, 55); | ||
473 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "THE", 48, 51); | ||
474 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "GCS", 44, 47); | ||
475 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MTE_frac", 40, 43); | ||
476 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "NMI", 36, 39); | ||
477 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "CSV2_frac", 32, 35); | ||
478 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "RNDR_trap", 28, 31); | ||
479 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "SME", 24, 27); | ||
480 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MPAM_frac", 16, 19); | ||
481 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "RAS_frac", 12, 15); | ||
482 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "MTE", 8, 11); | ||
483 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "SSBS", 4, 7); | ||
484 | + arm64_sysreg_add_field(ID_AA64PFR1_EL1, "BT", 0, 3); | ||
485 | + | ||
486 | + /* ID_AA64PFR2_EL1 */ | ||
487 | + ARM64SysReg *ID_AA64PFR2_EL1 = arm64_sysreg_get(3, 0, 0, 4, 2); | ||
488 | + ID_AA64PFR2_EL1->name = "ID_AA64PFR2_EL1"; | ||
489 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "FPMR", 32, 35); | ||
490 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "MTEFAR", 8, 11); | ||
491 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "MTESTOREONLY", 4, 7); | ||
492 | + arm64_sysreg_add_field(ID_AA64PFR2_EL1, "MTEPERM", 0, 3); | ||
493 | + | ||
494 | + /* ID_AA64ZFR0_EL1 */ | ||
495 | + ARM64SysReg *ID_AA64ZFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 4); | ||
496 | + ID_AA64ZFR0_EL1->name = "ID_AA64ZFR0_EL1"; | ||
497 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "F64MM", 56, 59); | ||
498 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "F32MM", 52, 55); | ||
499 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "I8MM", 44, 47); | ||
500 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "SM4", 40, 43); | ||
501 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "SHA3", 32, 35); | ||
502 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "B16B16", 24, 27); | ||
503 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "BF16", 20, 23); | ||
504 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "BitPerm", 16, 19); | ||
505 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "AES", 4, 7); | ||
506 | + arm64_sysreg_add_field(ID_AA64ZFR0_EL1, "SVEver", 0, 3); | ||
507 | + | ||
508 | + /* ID_AA64SMFR0_EL1 */ | ||
509 | + ARM64SysReg *ID_AA64SMFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 5); | ||
510 | + ID_AA64SMFR0_EL1->name = "ID_AA64SMFR0_EL1"; | ||
511 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "FA64", 63, 63); | ||
512 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "LUTv2", 60, 60); | ||
513 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SMEver", 56, 59); | ||
514 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "I16I64", 52, 55); | ||
515 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F64F64", 48, 48); | ||
516 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "I16I32", 44, 47); | ||
517 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "B16B16", 43, 43); | ||
518 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F16F16", 42, 42); | ||
519 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F8F16", 41, 41); | ||
520 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F8F32", 40, 40); | ||
521 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "I8I32", 36, 39); | ||
522 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F16F32", 35, 35); | ||
523 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "B16F32", 34, 34); | ||
524 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "BI32I32", 33, 33); | ||
525 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "F32F32", 32, 32); | ||
526 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SF8FMA", 30, 30); | ||
527 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SF8DP4", 29, 29); | ||
528 | + arm64_sysreg_add_field(ID_AA64SMFR0_EL1, "SF8DP2", 28, 28); | ||
529 | + | ||
530 | + /* ID_AA64FPFR0_EL1 */ | ||
531 | + ARM64SysReg *ID_AA64FPFR0_EL1 = arm64_sysreg_get(3, 0, 0, 4, 7); | ||
532 | + ID_AA64FPFR0_EL1->name = "ID_AA64FPFR0_EL1"; | ||
533 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8CVT", 31, 31); | ||
534 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8FMA", 30, 30); | ||
535 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8DP4", 29, 29); | ||
536 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8DP2", 28, 28); | ||
537 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8E4M3", 1, 1); | ||
538 | + arm64_sysreg_add_field(ID_AA64FPFR0_EL1, "F8E5M2", 0, 0); | ||
539 | + | ||
540 | + /* ID_AA64DFR0_EL1 */ | ||
541 | + ARM64SysReg *ID_AA64DFR0_EL1 = arm64_sysreg_get(3, 0, 0, 5, 0); | ||
542 | + ID_AA64DFR0_EL1->name = "ID_AA64DFR0_EL1"; | ||
543 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "HPMN0", 60, 63); | ||
544 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "ExtTrcBuff", 56, 59); | ||
545 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "BRBE", 52, 55); | ||
546 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "MTPMU", 48, 51); | ||
547 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "TraceBuffer", 44, 47); | ||
548 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "TraceFilt", 40, 43); | ||
549 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "DoubleLock", 36, 39); | ||
550 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "PMSVer", 32, 35); | ||
551 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "CTX_CMPs", 28, 31); | ||
552 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "WRPs", 20, 23); | ||
553 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "BRPs", 12, 15); | ||
554 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "PMUVer", 8, 11); | ||
555 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "TraceVer", 4, 7); | ||
556 | + arm64_sysreg_add_field(ID_AA64DFR0_EL1, "DebugVer", 0, 3); | ||
557 | + | ||
558 | + /* ID_AA64DFR1_EL1 */ | ||
559 | + ARM64SysReg *ID_AA64DFR1_EL1 = arm64_sysreg_get(3, 0, 0, 5, 1); | ||
560 | + ID_AA64DFR1_EL1->name = "ID_AA64DFR1_EL1"; | ||
561 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "ABL_CMPs", 56, 63); | ||
562 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "DPFZS", 52, 55); | ||
563 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "EBEP", 48, 51); | ||
564 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "ITE", 44, 47); | ||
565 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "ABLE", 40, 43); | ||
566 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "PMICNTR", 36, 39); | ||
567 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "SPMU", 32, 35); | ||
568 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "CTX_CMPs", 24, 31); | ||
569 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "WRPs", 16, 23); | ||
570 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "BRPs", 8, 15); | ||
571 | + arm64_sysreg_add_field(ID_AA64DFR1_EL1, "SYSPMUID", 0, 7); | ||
572 | + | ||
573 | + /* ID_AA64AFR0_EL1 */ | ||
574 | + ARM64SysReg *ID_AA64AFR0_EL1 = arm64_sysreg_get(3, 0, 0, 5, 4); | ||
575 | + ID_AA64AFR0_EL1->name = "ID_AA64AFR0_EL1"; | ||
576 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF7", 28, 31); | ||
577 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF6", 24, 27); | ||
578 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF5", 20, 23); | ||
579 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF4", 16, 19); | ||
580 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF3", 12, 15); | ||
581 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF2", 8, 11); | ||
582 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF1", 4, 7); | ||
583 | + arm64_sysreg_add_field(ID_AA64AFR0_EL1, "IMPDEF0", 0, 3); | ||
584 | + | ||
585 | + /* ID_AA64AFR1_EL1 */ | ||
586 | + ARM64SysReg *ID_AA64AFR1_EL1 = arm64_sysreg_get(3, 0, 0, 5, 5); | ||
587 | + ID_AA64AFR1_EL1->name = "ID_AA64AFR1_EL1"; | ||
588 | + | ||
589 | + /* ID_AA64ISAR0_EL1 */ | ||
590 | + ARM64SysReg *ID_AA64ISAR0_EL1 = arm64_sysreg_get(3, 0, 0, 6, 0); | ||
591 | + ID_AA64ISAR0_EL1->name = "ID_AA64ISAR0_EL1"; | ||
592 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "RNDR", 60, 63); | ||
593 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "TLB", 56, 59); | ||
594 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "TS", 52, 55); | ||
595 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "FHM", 48, 51); | ||
596 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "DP", 44, 47); | ||
597 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SM4", 40, 43); | ||
598 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SM3", 36, 39); | ||
599 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SHA3", 32, 35); | ||
600 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "RDM", 28, 31); | ||
601 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "TME", 24, 27); | ||
602 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "ATOMIC", 20, 23); | ||
603 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "CRC32", 16, 19); | ||
604 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SHA2", 12, 15); | ||
605 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "SHA1", 8, 11); | ||
606 | + arm64_sysreg_add_field(ID_AA64ISAR0_EL1, "AES", 4, 7); | ||
607 | + | ||
608 | + /* ID_AA64ISAR1_EL1 */ | ||
609 | + ARM64SysReg *ID_AA64ISAR1_EL1 = arm64_sysreg_get(3, 0, 0, 6, 1); | ||
610 | + ID_AA64ISAR1_EL1->name = "ID_AA64ISAR1_EL1"; | ||
611 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "LS64", 60, 63); | ||
612 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "XS", 56, 59); | ||
613 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "I8MM", 52, 55); | ||
614 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "DGH", 48, 51); | ||
615 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "BF16", 44, 47); | ||
616 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "SPECRES", 40, 43); | ||
617 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "SB", 36, 39); | ||
618 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "FRINTTS", 32, 35); | ||
619 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "GPI", 28, 31); | ||
620 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "GPA", 24, 27); | ||
621 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "LRCPC", 20, 23); | ||
622 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "FCMA", 16, 19); | ||
623 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "JSCVT", 12, 15); | ||
624 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "API", 8, 11); | ||
625 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "APA", 4, 7); | ||
626 | + arm64_sysreg_add_field(ID_AA64ISAR1_EL1, "DPB", 0, 3); | ||
627 | + | ||
628 | + /* ID_AA64ISAR2_EL1 */ | ||
629 | + ARM64SysReg *ID_AA64ISAR2_EL1 = arm64_sysreg_get(3, 0, 0, 6, 2); | ||
630 | + ID_AA64ISAR2_EL1->name = "ID_AA64ISAR2_EL1"; | ||
631 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "ATS1A", 60, 63); | ||
632 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "LUT", 56, 59); | ||
633 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "CSSC", 52, 55); | ||
634 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "RPRFM", 48, 51); | ||
635 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "PRFMSLC", 40, 43); | ||
636 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "SYSINSTR_128", 36, 39); | ||
637 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "SYSREG_128", 32, 35); | ||
638 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "CLRBHB", 28, 31); | ||
639 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "PAC_frac", 24, 27); | ||
640 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "BC", 20, 23); | ||
641 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "MOPS", 16, 19); | ||
642 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "APA3", 12, 15); | ||
643 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "GPA3", 8, 11); | ||
644 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "RPRES", 4, 7); | ||
645 | + arm64_sysreg_add_field(ID_AA64ISAR2_EL1, "WFxT", 0, 3); | ||
646 | + | ||
647 | + /* ID_AA64ISAR3_EL1 */ | ||
648 | + ARM64SysReg *ID_AA64ISAR3_EL1 = arm64_sysreg_get(3, 0, 0, 6, 3); | ||
649 | + ID_AA64ISAR3_EL1->name = "ID_AA64ISAR3_EL1"; | ||
650 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "PACM", 12, 15); | ||
651 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "TLBIW", 8, 11); | ||
652 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "FAMINMAX", 4, 7); | ||
653 | + arm64_sysreg_add_field(ID_AA64ISAR3_EL1, "CPA", 0, 3); | ||
654 | + | ||
655 | + /* ID_AA64MMFR0_EL1 */ | ||
656 | + ARM64SysReg *ID_AA64MMFR0_EL1 = arm64_sysreg_get(3, 0, 0, 7, 0); | ||
657 | + ID_AA64MMFR0_EL1->name = "ID_AA64MMFR0_EL1"; | ||
658 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "ECV", 60, 63); | ||
659 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "FGT", 56, 59); | ||
660 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "EXS", 44, 47); | ||
661 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN4_2", 40, 43); | ||
662 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN64_2", 36, 39); | ||
663 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN16_2", 32, 35); | ||
664 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN4", 28, 31); | ||
665 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN4", 28, 31); | ||
666 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN64", 24, 27); | ||
667 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN64", 24, 27); | ||
668 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "TGRAN16", 20, 23); | ||
669 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "BIGENDEL0", 16, 19); | ||
670 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "SNSMEM", 12, 15); | ||
671 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "BIGEND", 8, 11); | ||
672 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "ASIDBITS", 4, 7); | ||
673 | + arm64_sysreg_add_field(ID_AA64MMFR0_EL1, "PARANGE", 0, 3); | ||
674 | + | ||
675 | + /* ID_AA64MMFR1_EL1 */ | ||
676 | + ARM64SysReg *ID_AA64MMFR1_EL1 = arm64_sysreg_get(3, 0, 0, 7, 1); | ||
677 | + ID_AA64MMFR1_EL1->name = "ID_AA64MMFR1_EL1"; | ||
678 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "ECBHB", 60, 63); | ||
679 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "CMOW", 56, 59); | ||
680 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "TIDCP1", 52, 55); | ||
681 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "nTLBPA", 48, 51); | ||
682 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "AFP", 44, 47); | ||
683 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "HCX", 40, 43); | ||
684 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "ETS", 36, 39); | ||
685 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "TWED", 32, 35); | ||
686 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "XNX", 28, 31); | ||
687 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "SpecSEI", 24, 27); | ||
688 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "PAN", 20, 23); | ||
689 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "LO", 16, 19); | ||
690 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "HPDS", 12, 15); | ||
691 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "VH", 8, 11); | ||
692 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "VMIDBits", 4, 7); | ||
693 | + arm64_sysreg_add_field(ID_AA64MMFR1_EL1, "HAFDBS", 0, 3); | ||
694 | + | ||
695 | + /* ID_AA64MMFR2_EL1 */ | ||
696 | + ARM64SysReg *ID_AA64MMFR2_EL1 = arm64_sysreg_get(3, 0, 0, 7, 2); | ||
697 | + ID_AA64MMFR2_EL1->name = "ID_AA64MMFR2_EL1"; | ||
698 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "E0PD", 60, 63); | ||
699 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "EVT", 56, 59); | ||
700 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "BBM", 52, 55); | ||
701 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "TTL", 48, 51); | ||
702 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "FWB", 40, 43); | ||
703 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "IDS", 36, 39); | ||
704 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "AT", 32, 35); | ||
705 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "ST", 28, 31); | ||
706 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "NV", 24, 27); | ||
707 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "CCIDX", 20, 23); | ||
708 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "VARange", 16, 19); | ||
709 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "IESB", 12, 15); | ||
710 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "LSM", 8, 11); | ||
711 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "UAO", 4, 7); | ||
712 | + arm64_sysreg_add_field(ID_AA64MMFR2_EL1, "CnP", 0, 3); | ||
713 | + | ||
714 | + /* ID_AA64MMFR3_EL1 */ | ||
715 | + ARM64SysReg *ID_AA64MMFR3_EL1 = arm64_sysreg_get(3, 0, 0, 7, 3); | ||
716 | + ID_AA64MMFR3_EL1->name = "ID_AA64MMFR3_EL1"; | ||
717 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "Spec_FPACC", 60, 63); | ||
718 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "ADERR", 56, 59); | ||
719 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "SDERR", 52, 55); | ||
720 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "ANERR", 44, 47); | ||
721 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "SNERR", 40, 43); | ||
722 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "D128_2", 36, 39); | ||
723 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "D128", 32, 35); | ||
724 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "MEC", 28, 31); | ||
725 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "AIE", 24, 27); | ||
726 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S2POE", 20, 23); | ||
727 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S1POE", 16, 19); | ||
728 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S2PIE", 12, 15); | ||
729 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "S1PIE", 8, 11); | ||
730 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "SCTLRX", 4, 7); | ||
731 | + arm64_sysreg_add_field(ID_AA64MMFR3_EL1, "TCRX", 0, 3); | ||
732 | + | ||
733 | + /* ID_AA64MMFR4_EL1 */ | ||
734 | + ARM64SysReg *ID_AA64MMFR4_EL1 = arm64_sysreg_get(3, 0, 0, 7, 4); | ||
735 | + ID_AA64MMFR4_EL1->name = "ID_AA64MMFR4_EL1"; | ||
736 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "E3DSE", 36, 39); | ||
737 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "E2H0", 24, 27); | ||
738 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "E2H0", 24, 27); | ||
739 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "NV_frac", 20, 23); | ||
740 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "FGWTE3", 16, 19); | ||
741 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "HACDBS", 12, 15); | ||
742 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "ASID2", 8, 11); | ||
743 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "EIESB", 4, 7); | ||
744 | + arm64_sysreg_add_field(ID_AA64MMFR4_EL1, "EIESB", 4, 7); | ||
745 | + | ||
746 | +/* For CPACR_EL1 fields see CPACR_ELx */ | ||
747 | + | ||
748 | +/* For ZCR_EL1 fields see ZCR_ELx */ | ||
749 | + | ||
750 | +/* For SMCR_EL1 fields see SMCR_ELx */ | ||
751 | + | ||
752 | +/* For GCSCR_EL1 fields see GCSCR_ELx */ | ||
753 | + | ||
754 | +/* For GCSPR_EL1 fields see GCSPR_ELx */ | ||
755 | + | ||
756 | +/* For CONTEXTIDR_EL1 fields see CONTEXTIDR_ELx */ | ||
757 | + | ||
758 | + /* CCSIDR_EL1 */ | ||
759 | + ARM64SysReg *CCSIDR_EL1 = arm64_sysreg_get(3, 1, 0, 0, 0); | ||
760 | + CCSIDR_EL1->name = "CCSIDR_EL1"; | ||
761 | + arm64_sysreg_add_field(CCSIDR_EL1, "NumSets", 13, 27); | ||
762 | + arm64_sysreg_add_field(CCSIDR_EL1, "Associativity", 3, 12); | ||
763 | + arm64_sysreg_add_field(CCSIDR_EL1, "LineSize", 0, 2); | ||
764 | + | ||
765 | + /* CLIDR_EL1 */ | ||
766 | + ARM64SysReg *CLIDR_EL1 = arm64_sysreg_get(3, 1, 0, 0, 1); | ||
767 | + CLIDR_EL1->name = "CLIDR_EL1"; | ||
768 | + arm64_sysreg_add_field(CLIDR_EL1, "Ttypen", 33, 46); | ||
769 | + arm64_sysreg_add_field(CLIDR_EL1, "ICB", 30, 32); | ||
770 | + arm64_sysreg_add_field(CLIDR_EL1, "LoUU", 27, 29); | ||
771 | + arm64_sysreg_add_field(CLIDR_EL1, "LoC", 24, 26); | ||
772 | + arm64_sysreg_add_field(CLIDR_EL1, "LoUIS", 21, 23); | ||
773 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype7", 18, 20); | ||
774 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype6", 15, 17); | ||
775 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype5", 12, 14); | ||
776 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype4", 9, 11); | ||
777 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype3", 6, 8); | ||
778 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype2", 3, 5); | ||
779 | + arm64_sysreg_add_field(CLIDR_EL1, "Ctype1", 0, 2); | ||
780 | + | ||
781 | + /* CCSIDR2_EL1 */ | ||
782 | + ARM64SysReg *CCSIDR2_EL1 = arm64_sysreg_get(3, 1, 0, 0, 2); | ||
783 | + CCSIDR2_EL1->name = "CCSIDR2_EL1"; | ||
784 | + arm64_sysreg_add_field(CCSIDR2_EL1, "NumSets", 0, 23); | ||
785 | + | ||
786 | + /* GMID_EL1 */ | ||
787 | + ARM64SysReg *GMID_EL1 = arm64_sysreg_get(3, 1, 0, 0, 4); | ||
788 | + GMID_EL1->name = "GMID_EL1"; | ||
789 | + arm64_sysreg_add_field(GMID_EL1, "BS", 0, 3); | ||
790 | + | ||
791 | + /* SMIDR_EL1 */ | ||
792 | + ARM64SysReg *SMIDR_EL1 = arm64_sysreg_get(3, 1, 0, 0, 6); | ||
793 | + SMIDR_EL1->name = "SMIDR_EL1"; | ||
794 | + arm64_sysreg_add_field(SMIDR_EL1, "IMPLEMENTER", 24, 31); | ||
795 | + arm64_sysreg_add_field(SMIDR_EL1, "REVISION", 16, 23); | ||
796 | + arm64_sysreg_add_field(SMIDR_EL1, "SMPS", 15, 15); | ||
797 | + arm64_sysreg_add_field(SMIDR_EL1, "AFFINITY", 0, 11); | ||
798 | + | ||
799 | + /* CSSELR_EL1 */ | ||
800 | + ARM64SysReg *CSSELR_EL1 = arm64_sysreg_get(3, 2, 0, 0, 0); | ||
801 | + CSSELR_EL1->name = "CSSELR_EL1"; | ||
802 | + arm64_sysreg_add_field(CSSELR_EL1, "TnD", 4, 4); | ||
803 | + arm64_sysreg_add_field(CSSELR_EL1, "Level", 1, 3); | ||
804 | + arm64_sysreg_add_field(CSSELR_EL1, "InD", 0, 0); | ||
805 | + | ||
806 | /* CTR_EL0 */ | ||
807 | ARM64SysReg *CTR_EL0 = arm64_sysreg_get(3, 3, 0, 0, 1); | ||
808 | CTR_EL0->name = "CTR_EL0"; | ||
809 | - arm64_sysreg_add_field(CTR_EL0, "TMinline", 32, 37); | ||
810 | + arm64_sysreg_add_field(CTR_EL0, "TminLine", 32, 37); | ||
811 | arm64_sysreg_add_field(CTR_EL0, "DIC", 29, 29); | ||
812 | arm64_sysreg_add_field(CTR_EL0, "IDC", 28, 28); | ||
813 | arm64_sysreg_add_field(CTR_EL0, "CWG", 24, 27); | ||
814 | arm64_sysreg_add_field(CTR_EL0, "ERG", 20, 23); | ||
815 | - arm64_sysreg_add_field(CTR_EL0, "DMinLine", 16, 19); | ||
816 | + arm64_sysreg_add_field(CTR_EL0, "DminLine", 16, 19); | ||
817 | arm64_sysreg_add_field(CTR_EL0, "L1Ip", 14, 15); | ||
818 | arm64_sysreg_add_field(CTR_EL0, "IminLine", 0, 3); | ||
819 | -} | ||
820 | |||
821 | + /* DCZID_EL0 */ | ||
822 | + ARM64SysReg *DCZID_EL0 = arm64_sysreg_get(3, 3, 0, 0, 7); | ||
823 | + DCZID_EL0->name = "DCZID_EL0"; | ||
824 | + arm64_sysreg_add_field(DCZID_EL0, "DZP", 4, 4); | ||
825 | + arm64_sysreg_add_field(DCZID_EL0, "BS", 0, 3); | ||
826 | + | ||
827 | +/* For GCSPR_EL0 fields see GCSPR_ELx */ | ||
828 | + | ||
829 | +/* For HFGRTR_EL2 fields see HFGxTR_EL2 */ | ||
830 | + | ||
831 | +/* For HFGWTR_EL2 fields see HFGxTR_EL2 */ | ||
832 | + | ||
833 | +/* For ZCR_EL2 fields see ZCR_ELx */ | ||
834 | + | ||
835 | +/* For SMCR_EL2 fields see SMCR_ELx */ | ||
836 | + | ||
837 | +/* For GCSCR_EL2 fields see GCSCR_ELx */ | ||
838 | + | ||
839 | +/* For GCSPR_EL2 fields see GCSPR_ELx */ | ||
840 | + | ||
841 | +/* For CONTEXTIDR_EL2 fields see CONTEXTIDR_ELx */ | ||
842 | + | ||
843 | +/* For CPACR_EL12 fields see CPACR_ELx */ | ||
844 | + | ||
845 | +/* For ZCR_EL12 fields see ZCR_ELx */ | ||
846 | + | ||
847 | +/* For SMCR_EL12 fields see SMCR_ELx */ | ||
848 | + | ||
849 | +/* For GCSCR_EL12 fields see GCSCR_ELx */ | ||
850 | + | ||
851 | +/* For GCSPR_EL12 fields see GCSPR_ELx */ | ||
852 | + | ||
853 | +/* For CONTEXTIDR_EL12 fields see CONTEXTIDR_ELx */ | ||
854 | + | ||
855 | +/* For TTBR0_EL1 fields see TTBRx_EL1 */ | ||
856 | + | ||
857 | +/* For TTBR1_EL1 fields see TTBRx_EL1 */ | ||
858 | + | ||
859 | +/* For TCR2_EL1 fields see TCR2_EL1x */ | ||
860 | + | ||
861 | +/* For TCR2_EL12 fields see TCR2_EL1x */ | ||
862 | + | ||
863 | +/* For MAIR2_EL1 fields see MAIR2_ELx */ | ||
864 | + | ||
865 | +/* For MAIR2_EL2 fields see MAIR2_ELx */ | ||
866 | + | ||
867 | +/* For PIRE0_EL1 fields see PIRx_ELx */ | ||
868 | + | ||
869 | +/* For PIRE0_EL12 fields see PIRx_ELx */ | ||
870 | + | ||
871 | +/* For PIR_EL1 fields see PIRx_ELx */ | ||
872 | + | ||
873 | +/* For PIR_EL12 fields see PIRx_ELx */ | ||
874 | + | ||
875 | +/* For PIR_EL2 fields see PIRx_ELx */ | ||
876 | + | ||
877 | +/* For POR_EL0 fields see PIRx_ELx */ | ||
878 | + | ||
879 | +/* For POR_EL1 fields see PIRx_ELx */ | ||
880 | + | ||
881 | +/* For POR_EL12 fields see PIRx_ELx */ | ||
882 | + | ||
883 | +/* For S2POR_EL1 fields see PIRx_ELx */ | ||
884 | + | ||
885 | +/* For S2PIR_EL2 fields see PIRx_ELx */ | ||
886 | + | ||
887 | +} | ||
888 | -- | 891 | -- |
889 | 2.41.0 | 892 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | At the moment kvm_arm_get_host_cpu_features() reads a subset of the | 3 | At the moment kvm_arm_get_host_cpu_features() reads a subset of the |
2 | ID regs. As we want to introduce properties for all writable ID reg | 4 | ID regs. As we want to introduce properties for all writable ID reg |
3 | fields, we want more genericity and read more default host register | 5 | fields, we want more genericity and read more default host register |
4 | values. | 6 | values. |
5 | 7 | ||
6 | Introduce a new get_host_cpu_idregs() helper and add a new exhaustive | 8 | Introduce a new get_host_cpu_idregs() helper and add a new exhaustive |
7 | boolean parameter to kvm_arm_get_host_cpu_features() and | 9 | boolean parameter to kvm_arm_get_host_cpu_features() and |
8 | kvm_arm_set_cpu_features_from_host() to select the right behavior. | 10 | kvm_arm_set_cpu_features_from_host() to select the right behavior. |
9 | the host cpu model keeps the legacy behavior while the new custom | 11 | The host cpu model will keep the legacy behavior unless the writable |
10 | model will read the legacy regs plus all the writable ones. This | 12 | id register interface is available. |
11 | definitively brings some redundancy. | ||
12 | 13 | ||
13 | A writable_map IdRegMap is introduced in the CPU object. A subsequent | 14 | A writable_map IdRegMap is introduced in the CPU object. A subsequent |
14 | patch will populate it. | 15 | patch will populate it. |
15 | 16 | ||
16 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 17 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
18 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
17 | --- | 19 | --- |
18 | target/arm/cpu.h | 3 +++ | 20 | target/arm/cpu.h | 3 +++ |
19 | target/arm/kvm_arm.h | 9 +++++-- | ||
20 | target/arm/cpu64.c | 4 ++-- | 21 | target/arm/cpu64.c | 4 ++-- |
21 | target/arm/kvm.c | 53 ++++++++++++++++++++++++++++++++++++++--- | 22 | target/arm/kvm.c | 53 ++++++++++++++++++++++++++++++++++++++--- |
23 | target/arm/kvm_arm.h | 9 +++++-- | ||
22 | target/arm/trace-events | 1 + | 24 | target/arm/trace-events | 1 + |
23 | 5 files changed, 63 insertions(+), 7 deletions(-) | 25 | 5 files changed, 63 insertions(+), 7 deletions(-) |
24 | 26 | ||
25 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 27 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h |
26 | index XXXXXXX..XXXXXXX 100644 | 28 | index XXXXXXX..XXXXXXX 100644 |
... | ... | ||
34 | + IdRegMap *writable_map; | 36 | + IdRegMap *writable_map; |
35 | + | 37 | + |
36 | /* QOM property to indicate we should use the back-compat CNTFRQ default */ | 38 | /* QOM property to indicate we should use the back-compat CNTFRQ default */ |
37 | bool backcompat_cntfrq; | 39 | bool backcompat_cntfrq; |
38 | 40 | ||
39 | diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/target/arm/kvm_arm.h | ||
42 | +++ b/target/arm/kvm_arm.h | ||
43 | @@ -XXX,XX +XXX,XX @@ uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu); | ||
44 | * | ||
45 | * Set up the ARMCPU struct fields up to match the information probed | ||
46 | * from the host CPU. | ||
47 | + * | ||
48 | + * @cpu: cpu object | ||
49 | + * @exhaustive: if true, all the feature ID regs are queried instead of | ||
50 | + * a subset | ||
51 | */ | ||
52 | -void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); | ||
53 | +void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu, bool exhaustive); | ||
54 | |||
55 | /** | ||
56 | * kvm_arm_add_vcpu_properties: | ||
57 | @@ -XXX,XX +XXX,XX @@ static inline int kvm_arm_get_writable_id_regs(ARMCPU *cpu, IdRegMap *idregmap) | ||
58 | /* | ||
59 | * These functions should never actually be called without KVM support. | ||
60 | */ | ||
61 | -static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) | ||
62 | +static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu, | ||
63 | + bool exhaustive) | ||
64 | { | ||
65 | g_assert_not_reached(); | ||
66 | } | ||
67 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 41 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
68 | index XXXXXXX..XXXXXXX 100644 | 42 | index XXXXXXX..XXXXXXX 100644 |
69 | --- a/target/arm/cpu64.c | 43 | --- a/target/arm/cpu64.c |
70 | +++ b/target/arm/cpu64.c | 44 | +++ b/target/arm/cpu64.c |
71 | @@ -XXX,XX +XXX,XX @@ static void aarch64_host_initfn(Object *obj) | 45 | @@ -XXX,XX +XXX,XX @@ static void aarch64_host_initfn(Object *obj) |
... | ... | ||
88 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | 62 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c |
89 | index XXXXXXX..XXXXXXX 100644 | 63 | index XXXXXXX..XXXXXXX 100644 |
90 | --- a/target/arm/kvm.c | 64 | --- a/target/arm/kvm.c |
91 | +++ b/target/arm/kvm.c | 65 | +++ b/target/arm/kvm.c |
92 | @@ -XXX,XX +XXX,XX @@ | 66 | @@ -XXX,XX +XXX,XX @@ |
93 | #include "hw/acpi/acpi.h" | ||
94 | #include "hw/acpi/ghes.h" | 67 | #include "hw/acpi/ghes.h" |
95 | #include "target/arm/gtimer.h" | 68 | #include "target/arm/gtimer.h" |
69 | #include "migration/blocker.h" | ||
96 | +#include "cpu-custom.h" | 70 | +#include "cpu-custom.h" |
97 | 71 | ||
98 | const KVMCapabilityInfo kvm_arch_required_capabilities[] = { | 72 | const KVMCapabilityInfo kvm_arch_required_capabilities[] = { |
99 | KVM_CAP_LAST_INFO | 73 | KVM_CAP_INFO(DEVICE_CTRL), |
100 | @@ -XXX,XX +XXX,XX @@ static int get_host_cpu_reg64(int fd, ARMHostCPUFeatures *ahcf, ARMSysReg sr) | 74 | @@ -XXX,XX +XXX,XX @@ static int get_host_cpu_reg64(int fd, ARMHostCPUFeatures *ahcf, ARMSysReg sr) |
101 | return ret; | 75 | return ret; |
102 | } | 76 | } |
103 | 77 | ||
104 | +/* | 78 | +/* |
... | ... | ||
111 | + */ | 85 | + */ |
112 | +static int get_host_cpu_idregs(ARMCPU *cpu, int fd, ARMHostCPUFeatures *ahcf) | 86 | +static int get_host_cpu_idregs(ARMCPU *cpu, int fd, ARMHostCPUFeatures *ahcf) |
113 | +{ | 87 | +{ |
114 | + int err = 0; | 88 | + int err = 0; |
115 | + int i; | 89 | + int i; |
116 | 90 | + | |
117 | -static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | ||
118 | + for (i = 0; i < NR_ID_REGS; i++) { | 91 | + for (i = 0; i < NR_ID_REGS; i++) { |
119 | + ARM64SysReg *sysregdesc = &arm64_id_regs[i]; | 92 | + ARM64SysReg *sysregdesc = &arm64_id_regs[i]; |
120 | + ARMSysReg *sysreg = sysregdesc->sysreg; | 93 | + ARMSysReg *sysreg = sysregdesc->sysreg; |
121 | + uint64_t writable_mask = cpu->writable_map->regs[i]; | 94 | + uint64_t writable_mask = cpu->writable_map->regs[i]; |
122 | + uint64_t *reg; | 95 | + uint64_t *reg; |
... | ... | ||
133 | + sysreg->op2)); | 106 | + sysreg->op2)); |
134 | + trace_get_host_cpu_idregs(sysregdesc->name, *reg); | 107 | + trace_get_host_cpu_idregs(sysregdesc->name, *reg); |
135 | + if (ret) { | 108 | + if (ret) { |
136 | + error_report("%s error reading value of host %s register (%m)", | 109 | + error_report("%s error reading value of host %s register (%m)", |
137 | + __func__, sysregdesc->name); | 110 | + __func__, sysregdesc->name); |
138 | + | 111 | |
112 | -static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | ||
139 | + err = ret; | 113 | + err = ret; |
140 | + } | 114 | + } |
141 | + } | 115 | + } |
142 | + return err; | 116 | + return err; |
143 | +} | 117 | +} |
... | ... | ||
174 | - !kvm_arm_get_host_cpu_features(&arm_host_cpu_features)) { | 148 | - !kvm_arm_get_host_cpu_features(&arm_host_cpu_features)) { |
175 | + !kvm_arm_get_host_cpu_features(cpu, &arm_host_cpu_features, exhaustive)) { | 149 | + !kvm_arm_get_host_cpu_features(cpu, &arm_host_cpu_features, exhaustive)) { |
176 | /* We can't report this error yet, so flag that we need to | 150 | /* We can't report this error yet, so flag that we need to |
177 | * in arm_cpu_realizefn(). | 151 | * in arm_cpu_realizefn(). |
178 | */ | 152 | */ |
153 | diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h | ||
154 | index XXXXXXX..XXXXXXX 100644 | ||
155 | --- a/target/arm/kvm_arm.h | ||
156 | +++ b/target/arm/kvm_arm.h | ||
157 | @@ -XXX,XX +XXX,XX @@ uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu); | ||
158 | * | ||
159 | * Set up the ARMCPU struct fields up to match the information probed | ||
160 | * from the host CPU. | ||
161 | + * | ||
162 | + * @cpu: cpu object | ||
163 | + * @exhaustive: if true, all the feature ID regs are queried instead of | ||
164 | + * a subset | ||
165 | */ | ||
166 | -void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); | ||
167 | +void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu, bool exhaustive); | ||
168 | |||
169 | /** | ||
170 | * kvm_arm_add_vcpu_properties: | ||
171 | @@ -XXX,XX +XXX,XX @@ static inline int kvm_arm_get_writable_id_regs(ARMCPU *cpu, IdRegMap *idregmap) | ||
172 | /* | ||
173 | * These functions should never actually be called without KVM support. | ||
174 | */ | ||
175 | -static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) | ||
176 | +static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu, | ||
177 | + bool exhaustive) | ||
178 | { | ||
179 | g_assert_not_reached(); | ||
180 | } | ||
179 | diff --git a/target/arm/trace-events b/target/arm/trace-events | 181 | diff --git a/target/arm/trace-events b/target/arm/trace-events |
180 | index XXXXXXX..XXXXXXX 100644 | 182 | index XXXXXXX..XXXXXXX 100644 |
181 | --- a/target/arm/trace-events | 183 | --- a/target/arm/trace-events |
182 | +++ b/target/arm/trace-events | 184 | +++ b/target/arm/trace-events |
183 | @@ -XXX,XX +XXX,XX @@ arm_gt_update_irq(int timer, int irqstate) "gt_update_irq: timer %d irqstate %d" | 185 | @@ -XXX,XX +XXX,XX @@ arm_gt_update_irq(int timer, int irqstate) "gt_update_irq: timer %d irqstate %d" |
184 | 186 | ||
185 | # kvm.c | 187 | # kvm.c |
186 | kvm_arm_fixup_msi_route(uint64_t iova, uint64_t gpa) "MSI iova = 0x%"PRIx64" is translated into 0x%"PRIx64 | 188 | kvm_arm_fixup_msi_route(uint64_t iova, uint64_t gpa) "MSI iova = 0x%"PRIx64" is translated into 0x%"PRIx64 |
187 | +get_host_cpu_idregs(const char *name, uint64_t value) "scratch vcpu gost value for %s is 0x%"PRIx64 | 189 | +get_host_cpu_idregs(const char *name, uint64_t value) "scratch vcpu gost value for %s is 0x%"PRIx64 |
188 | -- | 190 | -- |
189 | 2.41.0 | 191 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | ||
---|---|---|---|
2 | |||
1 | We want to give a chance to override the value of host ID regs. | 3 | We want to give a chance to override the value of host ID regs. |
2 | In a previous patch we made sure all their values could be fetched | 4 | In a previous patch we made sure all their values could be fetched |
3 | through kvm_get_one_reg() calls before their modification. After | 5 | through kvm_get_one_reg() calls before their modification. After |
4 | their potential modification we need to make sure we write back | 6 | their potential modification we need to make sure we write back |
5 | the values through kvm_set_one_reg() calls. | 7 | the values through kvm_set_one_reg() calls. |
6 | 8 | ||
7 | Make sure the cpreg_list is modified with updated values and | 9 | Make sure the cpreg_list is modified with updated values and |
8 | transfer those values back to kvm. | 10 | transfer those values back to kvm. |
9 | 11 | ||
10 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 12 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
13 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
11 | --- | 14 | --- |
12 | target/arm/kvm.c | 36 +++++++++++++++++++++++++++++++++++- | 15 | target/arm/kvm.c | 36 +++++++++++++++++++++++++++++++++++- |
13 | target/arm/trace-events | 1 + | 16 | target/arm/trace-events | 1 + |
14 | 2 files changed, 36 insertions(+), 1 deletion(-) | 17 | 2 files changed, 36 insertions(+), 1 deletion(-) |
15 | 18 | ||
... | ... | ||
75 | # kvm.c | 78 | # kvm.c |
76 | kvm_arm_fixup_msi_route(uint64_t iova, uint64_t gpa) "MSI iova = 0x%"PRIx64" is translated into 0x%"PRIx64 | 79 | kvm_arm_fixup_msi_route(uint64_t iova, uint64_t gpa) "MSI iova = 0x%"PRIx64" is translated into 0x%"PRIx64 |
77 | get_host_cpu_idregs(const char *name, uint64_t value) "scratch vcpu gost value for %s is 0x%"PRIx64 | 80 | get_host_cpu_idregs(const char *name, uint64_t value) "scratch vcpu gost value for %s is 0x%"PRIx64 |
78 | +kvm_arm_writable_idregs_to_cpreg_list(const char *name, uint64_t previous, uint64_t new) "%s overwrite default 0x%"PRIx64" with 0x%"PRIx64 | 81 | +kvm_arm_writable_idregs_to_cpreg_list(const char *name, uint64_t previous, uint64_t new) "%s overwrite default 0x%"PRIx64" with 0x%"PRIx64 |
79 | -- | 82 | -- |
80 | 2.41.0 | 83 | 2.47.0 | diff view generated by jsdifflib |
1 | This new cpu model takes by default the host cpu values. | 1 | From: Eric Auger <eric.auger@redhat.com> |
---|---|---|---|
2 | However it exposes uint64 SYSREG properties for writable ID reg | 2 | |
3 | fields exposed by the host kernel. Properties are named | 3 | If the interface for writable ID registers is available, expose uint64 |
4 | SYSREG_<REG>_<FIELD> with REG and FIELD being those used | 4 | SYSREG properties for writable ID reg fields exposed by the host |
5 | in linux arch/arm64/tools/sysreg. This done by matching the | 5 | kernel. Properties are named SYSREG_<REG>_<FIELD> with REG and FIELD |
6 | writable fields retrieved from the host kernel against the | 6 | being those used in linux arch/arm64/tools/sysreg. This done by |
7 | matching the writable fields retrieved from the host kernel against the | ||
7 | generated description of sysregs. | 8 | generated description of sysregs. |
8 | 9 | ||
9 | An example of invocation is: | 10 | An example of invocation is: |
10 | -cpu custom,SYSREG_ID_AA64ISAR0_EL1_DP=0x0 | 11 | -cpu host,SYSREG_ID_AA64ISAR0_EL1_DP=0x0 |
11 | which sets DP field of ID_AA64ISAR0_EL1 to 0. | 12 | which sets DP field of ID_AA64ISAR0_EL1 to 0. |
12 | 13 | ||
14 | [CH: add properties to the host model instead of introducing a new | ||
15 | "custom" model] | ||
13 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 16 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
14 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | 17 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> |
15 | 18 | ||
16 | --- | 19 | --- |
17 | 20 | ||
18 | At the moment, the custom model does not support legacy options | 21 | Interaction with the existing cpu properties is still a bit unclear -- |
19 | of the host cpu model. We need to understand what we do with those | 22 | at the moment, the different configurations can overwrite each other. |
20 | latter (SVE, ...). This means that related KVM ioctl are | ||
21 | not called yet. | ||
22 | --- | 23 | --- |
23 | target/arm/cpu.c | 15 ++++ | 24 | target/arm/cpu.c | 12 ++++ |
24 | target/arm/cpu64.c | 153 ++++++++++++++++++++++++++++++++++++++++ | 25 | target/arm/cpu64.c | 150 +++++++++++++++++++++++++++++++++++++++- |
25 | target/arm/trace-events | 6 ++ | 26 | target/arm/trace-events | 6 ++ |
26 | 3 files changed, 174 insertions(+) | 27 | 3 files changed, 167 insertions(+), 1 deletion(-) |
27 | 28 | ||
28 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 29 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
29 | index XXXXXXX..XXXXXXX 100644 | 30 | index XXXXXXX..XXXXXXX 100644 |
30 | --- a/target/arm/cpu.c | 31 | --- a/target/arm/cpu.c |
31 | +++ b/target/arm/cpu.c | 32 | +++ b/target/arm/cpu.c |
32 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 33 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
33 | return; | 34 | return; |
34 | } | 35 | } |
35 | 36 | ||
36 | + /* | 37 | + /* |
37 | + * If we failed to retrieve the set of writable ID registers for a "custom" | 38 | + * If we failed to retrieve the set of writable ID registers for the "host" |
38 | + * CPU model, report it here. | 39 | + * CPU model, report it here. No error if the interface for discovering |
40 | + * writable ID registers is not available. | ||
39 | + * In case we did get the set of writable ID registers, set the features to | 41 | + * In case we did get the set of writable ID registers, set the features to |
40 | + * the configured values here and perform some sanity checks. | 42 | + * the configured values here and perform some sanity checks. |
41 | + */ | 43 | + */ |
42 | + if (cpu->writable_id_regs == WRITABLE_ID_REGS_NOT_DISCOVERABLE) { | 44 | + if (cpu->writable_id_regs == WRITABLE_ID_REGS_FAILED) { |
43 | + error_setg(errp, "Host kernel does not support discovering " | ||
44 | + "writable id registers"); | ||
45 | + return; | ||
46 | + } else if (cpu->writable_id_regs == WRITABLE_ID_REGS_FAILED) { | ||
47 | + error_setg(errp, "Failed to discover writable id registers"); | 45 | + error_setg(errp, "Failed to discover writable id registers"); |
48 | + return; | 46 | + return; |
49 | + } | 47 | + } |
50 | + | 48 | + |
51 | if (!cpu->gt_cntfrq_hz) { | 49 | if (!cpu->gt_cntfrq_hz) { |
... | ... | ||
65 | #include "qemu/module.h" | 63 | #include "qemu/module.h" |
66 | @@ -XXX,XX +XXX,XX @@ | 64 | @@ -XXX,XX +XXX,XX @@ |
67 | #include "cpu-features.h" | 65 | #include "cpu-features.h" |
68 | #include "cpregs.h" | 66 | #include "cpregs.h" |
69 | #include "cpu-custom.h" | 67 | #include "cpu-custom.h" |
70 | +#include "cpu-sysregs.h" | ||
71 | +#include "trace.h" | 68 | +#include "trace.h" |
72 | 69 | ||
73 | void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) | 70 | void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) |
74 | { | 71 | { |
75 | @@ -XXX,XX +XXX,XX @@ static void aarch64_max_initfn(Object *obj) | 72 | @@ -XXX,XX +XXX,XX @@ static void aarch64_a53_initfn(Object *obj) |
76 | } | 73 | define_cortex_a72_a57_a53_cp_reginfo(cpu); |
77 | } | 74 | } |
78 | 75 | ||
79 | +#ifdef CONFIG_KVM | 76 | +#ifdef CONFIG_KVM |
80 | + | 77 | + |
81 | +static ARM64SysRegField *get_field(int i, ARM64SysReg *reg) | 78 | +static ARM64SysRegField *get_field(int i, ARM64SysReg *reg) |
... | ... | ||
198 | + } | 195 | + } |
199 | + } | 196 | + } |
200 | + return 0; | 197 | + return 0; |
201 | +} | 198 | +} |
202 | + | 199 | + |
203 | +static void aarch64_customcpu_initfn(Object *obj) | 200 | +#endif |
204 | +{ | 201 | + |
205 | + ARMCPU *cpu = ARM_CPU(obj); | 202 | static void aarch64_host_initfn(Object *obj) |
203 | { | ||
204 | #if defined(CONFIG_KVM) | ||
205 | ARMCPU *cpu = ARM_CPU(obj); | ||
206 | - kvm_arm_set_cpu_features_from_host(cpu, false); | ||
207 | + bool expose_id_regs = true; | ||
206 | + int ret; | 208 | + int ret; |
207 | + | 209 | + |
208 | + cpu->writable_map = g_malloc(sizeof(IdRegMap)); | 210 | + cpu->writable_map = g_malloc(sizeof(IdRegMap)); |
209 | + | 211 | + |
210 | + /* discover via KVM_ARM_GET_REG_WRITABLE_MASKS */ | 212 | + /* discover via KVM_ARM_GET_REG_WRITABLE_MASKS */ |
211 | + ret = kvm_arm_get_writable_id_regs(cpu, cpu->writable_map); | 213 | + ret = kvm_arm_get_writable_id_regs(cpu, cpu->writable_map); |
212 | + if (ret) { | 214 | + if (ret == -ENOSYS) { |
215 | + /* legacy: continue without writable id regs */ | ||
216 | + expose_id_regs = false; | ||
217 | + } else if (ret) { | ||
213 | + /* function will have marked an error */ | 218 | + /* function will have marked an error */ |
214 | + return; | 219 | + return; |
215 | + } | 220 | + } |
216 | + | 221 | + |
217 | + /* populate from the host (exhaustive) , validate during realize */ | 222 | + kvm_arm_set_cpu_features_from_host(cpu, expose_id_regs); |
218 | + kvm_arm_set_cpu_features_from_host(cpu, true); | 223 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { |
219 | + | 224 | aarch64_add_sve_properties(obj); |
220 | + /* generate SYSREG properties according to writable masks */ | 225 | aarch64_add_pauth_properties(obj); |
221 | + expose_idreg_properties(obj, cpu->writable_map, arm64_id_regs); | 226 | } |
222 | +} | 227 | + if (expose_id_regs) { |
223 | + | 228 | + /* generate SYSREG properties according to writable masks */ |
224 | +#endif | 229 | + expose_idreg_properties(obj, cpu->writable_map, arm64_id_regs); |
225 | + | 230 | + } |
226 | static const ARMCPUInfo aarch64_cpus[] = { | 231 | + |
227 | { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, | 232 | #elif defined(CONFIG_HVF) |
228 | { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, | 233 | ARMCPU *cpu = ARM_CPU(obj); |
229 | @@ -XXX,XX +XXX,XX @@ static const ARMCPUInfo aarch64_cpus[] = { | 234 | hvf_arm_set_cpu_features_from_host(cpu, false); |
230 | #if defined(CONFIG_KVM) || defined(CONFIG_HVF) | ||
231 | { .name = "host", .initfn = aarch64_host_initfn }, | ||
232 | #endif | ||
233 | +#ifdef CONFIG_KVM | ||
234 | + { .name = "custom", .initfn = aarch64_customcpu_initfn }, | ||
235 | +#endif | ||
236 | }; | ||
237 | |||
238 | static bool aarch64_cpu_get_aarch64(Object *obj, Error **errp) | ||
239 | diff --git a/target/arm/trace-events b/target/arm/trace-events | 235 | diff --git a/target/arm/trace-events b/target/arm/trace-events |
240 | index XXXXXXX..XXXXXXX 100644 | 236 | index XXXXXXX..XXXXXXX 100644 |
241 | --- a/target/arm/trace-events | 237 | --- a/target/arm/trace-events |
242 | +++ b/target/arm/trace-events | 238 | +++ b/target/arm/trace-events |
243 | @@ -XXX,XX +XXX,XX @@ arm_gt_update_irq(int timer, int irqstate) "gt_update_irq: timer %d irqstate %d" | 239 | @@ -XXX,XX +XXX,XX @@ arm_gt_update_irq(int timer, int irqstate) "gt_update_irq: timer %d irqstate %d" |
... | ... | ||
249 | +decode_idreg_writemap(const char* name, int lower, int upper, char *prop_name) "%s [%d:%d] is writable (prop %s)" | 245 | +decode_idreg_writemap(const char* name, int lower, int upper, char *prop_name) "%s [%d:%d] is writable (prop %s)" |
250 | +get_sysreg_prop(const char *name, uint64_t value) "%s 0x%"PRIx64 | 246 | +get_sysreg_prop(const char *name, uint64_t value) "%s 0x%"PRIx64 |
251 | +set_sysreg_prop(const char *name, uint64_t old, uint64_t mask, uint64_t field_value, uint64_t new) "%s old reg value=0x%"PRIx64" mask=0x%"PRIx64" new field value=0x%"PRIx64" new reg value=0x%"PRIx64 | 247 | +set_sysreg_prop(const char *name, uint64_t old, uint64_t mask, uint64_t field_value, uint64_t new) "%s old reg value=0x%"PRIx64" mask=0x%"PRIx64" new field value=0x%"PRIx64" new reg value=0x%"PRIx64 |
252 | +nb_sysreg_props(const char *name, int count) "%s: %d SYSREG properties" | 248 | +nb_sysreg_props(const char *name, int count) "%s: %d SYSREG properties" |
253 | -- | 249 | -- |
254 | 2.41.0 | 250 | 2.47.0 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Cornelia Huck <cohuck@redhat.com> | ||
2 | 1 | ||
3 | Allowing the use of the custom vcpu model in ARM virt. | ||
4 | |||
5 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
6 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | ||
7 | --- | ||
8 | hw/arm/virt.c | 3 +++ | ||
9 | 1 file changed, 3 insertions(+) | ||
10 | |||
11 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/hw/arm/virt.c | ||
14 | +++ b/hw/arm/virt.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static void virt_machine_class_init(ObjectClass *oc, void *data) | ||
16 | #if defined(CONFIG_KVM) || defined(CONFIG_HVF) | ||
17 | ARM_CPU_TYPE_NAME("host"), | ||
18 | #endif /* CONFIG_KVM || CONFIG_HVF */ | ||
19 | +#ifdef CONFIG_KVM | ||
20 | + ARM_CPU_TYPE_NAME("custom"), | ||
21 | +#endif /* CONFIG_KVM */ | ||
22 | #endif /* TARGET_AARCH64 */ | ||
23 | ARM_CPU_TYPE_NAME("max"), | ||
24 | NULL | ||
25 | -- | ||
26 | 2.41.0 | diff view generated by jsdifflib |
1 | From: Cornelia Huck <cohuck@redhat.com> | 1 | Implement the capability to query available ID register values by |
---|---|---|---|
2 | adding SYSREG_* options and values to the cpu model expansion for the | ||
3 | host model, if available. | ||
2 | 4 | ||
3 | Implement the capability to query available options for the | ||
4 | custom model. | ||
5 | |||
6 | At the moment it only returns SYSREG_* options and values. | ||
7 | Excerpt: | 5 | Excerpt: |
8 | (QEMU) query-cpu-model-expansion type=full model={"name":"custom"} | 6 | (QEMU) query-cpu-model-expansion type=full model={"name":"host"} |
9 | {"return": {"model": {"name": "custom", "props": | 7 | {"return": {"model": {"name": "host", "props": |
10 | {"SYSREG_ID_AA64PFR0_EL1_EL3": 1224979098931106066, | 8 | {"SYSREG_ID_AA64PFR0_EL1_EL3": 1224979098931106066, |
11 | "SYSREG_ID_AA64ISAR2_EL1_CLRBHB": 0, | 9 | "SYSREG_ID_AA64ISAR2_EL1_CLRBHB": 0, |
12 | ../.. | 10 | ../.. |
13 | 11 | ||
14 | So this allows the upper stack to detect available writable ID | 12 | So this allows the upper stack to detect available writable ID |
15 | regs and the "host passthrough model" values. | 13 | regs and the "host passthrough model" values. |
16 | 14 | ||
15 | [CH: moved SYSREG_* values to host model] | ||
17 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 16 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
18 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | 17 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> |
19 | 18 | ||
20 | --- | 19 | --- |
21 | 20 | ||
22 | TODO: Add the moment there is no way to test changing a given | 21 | TODO: Add the moment there is no way to test changing a given |
23 | ID reg field value. ie: | 22 | ID reg field value. ie: |
24 | 23 | ||
25 | (QEMU) query-cpu-model-expansion type=full model={"name":"custom", "prop":{"SYSREG_ID_AA64ISAR0_EL1_DP":0x13}} | 24 | (QEMU) query-cpu-model-expansion type=full model={"name":"host", "prop":{"SYSREG_ID_AA64ISAR0_EL1_DP":0x13}} |
26 | --- | 25 | --- |
27 | target/arm/arm-qmp-cmds.c | 56 ++++++++++++++++++++++++++++++++++++++- | 26 | target/arm/arm-qmp-cmds.c | 19 +++++++++++++++++++ |
28 | 1 file changed, 55 insertions(+), 1 deletion(-) | 27 | 1 file changed, 19 insertions(+) |
29 | 28 | ||
30 | diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c | 29 | diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c |
31 | index XXXXXXX..XXXXXXX 100644 | 30 | index XXXXXXX..XXXXXXX 100644 |
32 | --- a/target/arm/arm-qmp-cmds.c | 31 | --- a/target/arm/arm-qmp-cmds.c |
33 | +++ b/target/arm/arm-qmp-cmds.c | 32 | +++ b/target/arm/arm-qmp-cmds.c |
... | ... | ||
37 | #include "qemu/osdep.h" | 36 | #include "qemu/osdep.h" |
38 | +#include "qemu/error-report.h" | 37 | +#include "qemu/error-report.h" |
39 | #include "hw/boards.h" | 38 | #include "hw/boards.h" |
40 | #include "kvm_arm.h" | 39 | #include "kvm_arm.h" |
41 | #include "qapi/error.h" | 40 | #include "qapi/error.h" |
42 | @@ -XXX,XX +XXX,XX @@ static const char *cpu_model_advertised_features[] = { | 41 | @@ -XXX,XX +XXX,XX @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, |
43 | NULL | 42 | } |
44 | }; | 43 | } |
45 | 44 | ||
46 | +static CpuModelExpansionInfo * | 45 | + /* If writable ID regs are supported, add them as well */ |
47 | +arm_query_custom_cpu_model_expansion(Object *obj, CpuModelExpansionType type, | 46 | + if (ARM_CPU(obj)->writable_id_regs == WRITABLE_ID_REGS_AVAIL) { |
48 | + CpuModelInfo *model, | 47 | + ObjectProperty *prop; |
49 | + Error **errp) | 48 | + ObjectPropertyIterator iter; |
50 | +{ | ||
51 | + /* returns id register map */ | ||
52 | + CpuModelExpansionInfo *expansion_info; | ||
53 | + ObjectProperty *prop; | ||
54 | + ObjectPropertyIterator iter; | ||
55 | + QDict *qdict_out; | ||
56 | + | 49 | + |
57 | + expansion_info = g_new0(CpuModelExpansionInfo, 1); | 50 | + object_property_iter_init(&iter, obj); |
58 | + expansion_info->model = g_malloc0(sizeof(*expansion_info->model)); | ||
59 | + expansion_info->model->name = g_strdup(model->name); | ||
60 | + | 51 | + |
61 | + qdict_out = qdict_new(); | 52 | + while ((prop = object_property_iter_next(&iter))) { |
53 | + QObject *value; | ||
62 | + | 54 | + |
63 | + object_property_iter_init(&iter, obj); | 55 | + if (!g_str_has_prefix(prop->name, "SYSREG_")) { |
64 | + | 56 | + continue; |
65 | + while ((prop = object_property_iter_next(&iter))) { | 57 | + } |
66 | + QObject *value; | 58 | + value = object_property_get_qobject(obj, prop->name, &error_abort); |
67 | + | 59 | + qdict_put_obj(qdict_out, prop->name, value); |
68 | + if (!g_str_has_prefix(prop->name, "SYSREG_")) { | ||
69 | + continue; | ||
70 | + } | 60 | + } |
71 | + value = object_property_get_qobject(obj, prop->name, &error_abort); | ||
72 | + qdict_put_obj(qdict_out, prop->name, value); | ||
73 | + } | 61 | + } |
74 | + | 62 | + |
75 | + if (!qdict_size(qdict_out)) { | 63 | if (!qdict_size(qdict_out)) { |
76 | + qobject_unref(qdict_out); | 64 | qobject_unref(qdict_out); |
77 | + } else { | 65 | } else { |
78 | + expansion_info->model->props = QOBJECT(qdict_out); | ||
79 | + } | ||
80 | + | ||
81 | + object_unref(obj); | ||
82 | + | ||
83 | + | ||
84 | + return expansion_info; | ||
85 | +} | ||
86 | + | ||
87 | CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, | ||
88 | CpuModelInfo *model, | ||
89 | Error **errp) | ||
90 | @@ -XXX,XX +XXX,XX @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, | ||
91 | if (kvm_enabled()) { | ||
92 | bool supported = false; | ||
93 | |||
94 | - if (!strcmp(model->name, "host") || !strcmp(model->name, "max")) { | ||
95 | + if (!strcmp(model->name, "host") || !strcmp(model->name, "max") || | ||
96 | + !strcmp(model->name, "custom")) { | ||
97 | /* These are kvmarm's recommended cpu types */ | ||
98 | supported = true; | ||
99 | } else if (current_machine->cpu_type) { | ||
100 | @@ -XXX,XX +XXX,XX @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, | ||
101 | |||
102 | obj = object_new(object_class_get_name(oc)); | ||
103 | |||
104 | + /* The "custom" model is handled differently. */ | ||
105 | + if (!strcmp(model->name, "custom")) { | ||
106 | + expansion_info = arm_query_custom_cpu_model_expansion(obj, type, model, | ||
107 | + errp); | ||
108 | + if (*errp) { | ||
109 | + object_unref(obj); | ||
110 | + return NULL; | ||
111 | + } | ||
112 | + return expansion_info; | ||
113 | + } | ||
114 | + | ||
115 | if (model->props) { | ||
116 | Visitor *visitor; | ||
117 | Error *err = NULL; | ||
118 | -- | 66 | -- |
119 | 2.41.0 | 67 | 2.47.0 | diff view generated by jsdifflib |
1 | From: Cornelia Huck <cohuck@redhat.com> | 1 | Add some documentation for how individual ID registers can be |
---|---|---|---|
2 | configured with the host cpu model. | ||
2 | 3 | ||
3 | Add some documentation for the custom model. | 4 | [CH: adapt to removal of the 'custom' model] |
4 | |||
5 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | 5 | Signed-off-by: Eric Auger <eric.auger@redhat.com> |
6 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> | 6 | Signed-off-by: Cornelia Huck <cohuck@redhat.com> |
7 | --- | 7 | --- |
8 | docs/system/arm/cpu-features.rst | 55 +++++++++++++++++++++++++++----- | 8 | docs/system/arm/cpu-features.rst | 47 ++++++++++++++++++++++++++------ |
9 | 1 file changed, 47 insertions(+), 8 deletions(-) | 9 | 1 file changed, 39 insertions(+), 8 deletions(-) |
10 | 10 | ||
11 | diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst | 11 | diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/docs/system/arm/cpu-features.rst | 13 | --- a/docs/system/arm/cpu-features.rst |
14 | +++ b/docs/system/arm/cpu-features.rst | 14 | +++ b/docs/system/arm/cpu-features.rst |
... | ... | ||
26 | indicate that it is not implemented. An example of an Arm CPU feature | 26 | indicate that it is not implemented. An example of an Arm CPU feature |
27 | @@ -XXX,XX +XXX,XX @@ supports the feature. While ``aarch64`` currently only works with KVM, | 27 | @@ -XXX,XX +XXX,XX @@ supports the feature. While ``aarch64`` currently only works with KVM, |
28 | it could work with TCG. CPU features that are specific to KVM are | 28 | it could work with TCG. CPU features that are specific to KVM are |
29 | prefixed with "kvm-" and are described in "KVM VCPU Features". | 29 | prefixed with "kvm-" and are described in "KVM VCPU Features". |
30 | 30 | ||
31 | +2. Alternatively, the ``custom`` CPU model allows to configure optional | 31 | +2. Additionally, the ``host`` CPU model on KVM allows to configure optional |
32 | +CPU features via the corresponding ID registers. The host kernel allows | 32 | +CPU features via the corresponding ID registers. The host kernel allows |
33 | +to write a subset of ID register fields. The custom model exposes | 33 | +to write a subset of ID register fields. The host model exposes |
34 | +properties for each write ID register fields. Those options are named | 34 | +properties for each write ID register fields. Those options are named |
35 | +SYSREG_<IDREG>_<FIELD>. IDREG and FIELD names are those used in the | 35 | +SYSREG_<IDREG>_<FIELD>. IDREG and FIELD names are those used in the |
36 | +ARM ARM Reference Manual. They can also be found in the linux | 36 | +ARM ARM Reference Manual. They can also be found in the linux |
37 | +arch/arm64/tool/sysreg file which is used to automatically generate the | 37 | +arch/arm64/tool/sysreg file which is used to automatically generate the |
38 | +description for those registers and fields. The custom model is currently | 38 | +description for those registers and fields. This currently only has been |
39 | +only implemented for KVM. | 39 | +implemented for KVM. |
40 | + | 40 | + |
41 | CPU Feature Probing | 41 | CPU Feature Probing |
42 | =================== | 42 | =================== |
43 | 43 | ||
44 | @@ -XXX,XX +XXX,XX @@ As expected they are now all ``false``. | 44 | @@ -XXX,XX +XXX,XX @@ As expected they are now all ``false``. |
... | ... | ||
50 | +writable ID register fields) | 50 | +writable ID register fields) |
51 | + | 51 | + |
52 | A note about CPU feature dependencies | 52 | A note about CPU feature dependencies |
53 | ------------------------------------- | 53 | ------------------------------------- |
54 | 54 | ||
55 | @@ -XXX,XX +XXX,XX @@ independently without error. For these reasons callers should always | 55 | @@ -XXX,XX +XXX,XX @@ A note about CPU models and KVM |
56 | attempt to make their desired changes all at once in order to ensure the | ||
57 | collection is valid. | ||
58 | |||
59 | +When using the ``custom`` CPU model, the provided set of ID registers | ||
60 | +is always evaluated as a whole. | ||
61 | + | ||
62 | A note about CPU models and KVM | ||
63 | ------------------------------- | ||
64 | 56 | ||
65 | Named CPU models generally do not work with KVM. There are a few cases | 57 | Named CPU models generally do not work with KVM. There are a few cases |
66 | that do work, e.g. using the named CPU model ``cortex-a57`` with KVM on a | 58 | that do work, e.g. using the named CPU model ``cortex-a57`` with KVM on a |
67 | -seattle host, but mostly if KVM is enabled the ``host`` CPU type must be | 59 | -seattle host, but mostly if KVM is enabled the ``host`` CPU type must be |
68 | -used. This means the guest is provided all the same CPU features as the | 60 | -used. This means the guest is provided all the same CPU features as the |
69 | -host CPU type has. And, for this reason, the ``host`` CPU type should | 61 | -host CPU type has. And, for this reason, the ``host`` CPU type should |
70 | -enable all CPU features that the host has by default. Indeed it's even | 62 | -enable all CPU features that the host has by default. Indeed it's even |
71 | -a bit strange to allow disabling CPU features that the host has when using | 63 | -a bit strange to allow disabling CPU features that the host has when using |
72 | -the ``host`` CPU type, but in the absence of CPU models it's the best we can | 64 | -the ``host`` CPU type, but in the absence of CPU models it's the best we can |
73 | -do if we want to launch guests without all the host's CPU features enabled. | 65 | -do if we want to launch guests without all the host's CPU features enabled. |
74 | +seattle host, but mostly if KVM is enabled, either the ``host`` or the | 66 | +seattle host, but mostly if KVM is enabled, the ``host`` CPU model must be |
75 | +``custom`` CPU types must be used. | 67 | +used. |
76 | + | 68 | + |
77 | +Using the ``host`` type means the guest is provided all the same CPU | 69 | +Using the ``host`` type means the guest is provided all the same CPU |
78 | +features as the host CPU type has. And, for this reason, the ``host`` | 70 | +features as the host CPU type has. And, for this reason, the ``host`` |
79 | +CPU type should enable all CPU features that the host has by default. | 71 | +CPU type should enable all CPU features that the host has by default. |
80 | + | 72 | + |
81 | +In case some features need to be hidden to the guest, ``custom`` model | 73 | +In case some features need to be hidden to the guest, and the host kernel |
82 | +shall be used instead. This is especially useful for migration purpose. | 74 | +supports it, the ``host`` model can be instructed to disable individual |
83 | + | 75 | +ID register values. This is especially useful for migration purposes. |
84 | +The ``custom`` CPU model generally is the better choice if you want more | 76 | +However, this interface will not allow configuring an arbitrary set of |
85 | +flexibility or stability across different machines or with different kernel | 77 | +features; the ID registers must describe a subset of the host's features, |
86 | +versions. However, even the ``custom`` CPU model will not allow configuring | 78 | +and all differences to the host's configuration must actually be supported |
87 | +an arbitrary set of features; the ID registers must describe a subset of the | 79 | +by the kernel to be deconfigured. |
88 | +host's features, and all differences to the host's configuration must actually | ||
89 | +be supported by the kernel to be deconfigured. | ||
90 | 80 | ||
91 | Enabling KVM also affects the ``query-cpu-model-expansion`` QMP command. The | 81 | Enabling KVM also affects the ``query-cpu-model-expansion`` QMP command. The |
92 | affect is not only limited to specific features, as pointed out in example | 82 | affect is not only limited to specific features, as pointed out in example |
93 | @@ -XXX,XX +XXX,XX @@ disabling many SVE vector lengths would be quite verbose, the ``sve<N>`` CPU | 83 | @@ -XXX,XX +XXX,XX @@ disabling many SVE vector lengths would be quite verbose, the ``sve<N>`` CPU |
94 | properties have special semantics (see "SVE CPU Property Parsing | 84 | properties have special semantics (see "SVE CPU Property Parsing |
95 | Semantics"). | 85 | Semantics"). |
96 | 86 | ||
97 | +The ``custom`` CPU model needs to be configured via individual ID register | 87 | +Additionally, if supported by KVM on the host kernel, the ``host`` CPU model |
98 | +field properties, for example:: | 88 | +may be configured via individual ID register field properties, for example:: |
99 | + | 89 | + |
100 | + $ qemu-system-aarch64 -M virt -cpu custom,SYSREG_ID_AA64ISAR0_EL1_DP=0x0 | 90 | + $ qemu-system-aarch64 -M virt -cpu host,SYSREG_ID_AA64ISAR0_EL1_DP=0x0 |
101 | + | 91 | + |
102 | +This forces ID_AA64ISAR0_EL1 DP field to 0. | 92 | +This forces ID_AA64ISAR0_EL1 DP field to 0. |
103 | + | 93 | + |
104 | +Note that the other CPU feature properties are not supported when using | ||
105 | +this model. | ||
106 | + | ||
107 | KVM VCPU Features | 94 | KVM VCPU Features |
108 | ================= | 95 | ================= |
109 | 96 | ||
110 | -- | 97 | -- |
111 | 2.41.0 | 98 | 2.47.0 | diff view generated by jsdifflib |