arm tcg/kvm refactor and split with kvm only support
Subsystems (4)
PATCH v16 71/99 target/arm: cpu-sve: new module
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
extract the SVE-related cpu object properties and functions, and move them to a separate module.
--- target/arm/cpu-sve.h | 37 ++++ target/arm/cpu.h | 14 +- target/arm/cpu-sve.c | 358 +++++++++++++++++++++++++++++++++++++++ target/arm/cpu.c | 3 + target/arm/cpu64.c | 329 +---------------------------------- target/arm/kvm/kvm-cpu.c | 1 + target/arm/meson.build | 1 + 7 files changed, 408 insertions(+), 335 deletions(-) create mode 100644 target/arm/cpu-sve.h create mode 100644 target/arm/cpu-sve.c
target/arm/cpu-sve.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* QEMU AArch64 CPU SVE Extensions for TARGET_AARCH64 +* +* Copyright (c) 2013 Linaro Ltd +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see +* <http://www.gnu.org/licenses/gpl-2.0.html> +*/ + +#ifndef CPU_SVE_H +#define CPU_SVE_H + +/* note: SVE is an AARCH64-only option, only include this for TARGET_AARCH64 */ + +#include "cpu.h" + +/* called by arm_cpu_finalize_features in realizefn */ +void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp); + +/* add the CPU SVE properties */ +void aarch64_add_sve_properties (Object *obj); + +/* add the CPU SVE properties specific to the "MAX" CPU */ +void aarch64_add_sve_properties_max (Object *obj); + +#endif /* CPU_SVE_H */
target/arm/cpu.h +6 -8
@@ -173,7 +173,8 @@ typedef struct {#define VSTCR_SW VTCR_NSW#define VSTCR_SA VTCR_NSA -/* Define a maximum sized vector register. +/* +* Define a maximum sized vector register. * For 32-bit, this is a 128-bit NEON/AdvSIMD register. * For 64-bit, this is a 2048-bit SVE register. *
@@ -201,13 +202,9 @@ typedef struct {#ifdef TARGET_AARCH64 # define ARM_MAX_VQ 16 -void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp); -void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp);#else # define ARM_MAX_VQ 1 -static inline void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp) { } -static inline void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { } -#endif +#endif /* TARGET_AARCH64 */ typedef struct ARMVectorReg { uint64_t d[2 * ARM_MAX_VQ] QEMU_ALIGNED(16);
@@ -219,10 +216,13 @@ typedef struct ARMPredicateReg { uint64_t p[DIV_ROUND_UP(2 * ARM_MAX_VQ, 8)] QEMU_ALIGNED(16); } ARMPredicateReg; +void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp);/* In AArch32 mode, PAC keys do not exist at all. */ typedef struct ARMPACKey {uint64_t lo, hi; }ARMPACKey ; +#else +static inline void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { }#endif /* See the commentary above the TBFLAG field definitions. */
@@ -1059,7 +1059,6 @@ int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq);void aarch64_sve_change_el (CPUARMState *env,int old_el,int new_el,bool el0_a64); -void aarch64_add_sve_properties (Object *obj);/* * SVE registers are encoded in KVM's memory in an endianness-invariant format.
@@ -1090,7 +1089,6 @@ static inline void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq) { }static inline void aarch64_sve_change_el (CPUARMState *env,int o,int n,bool a) { } -static inline void aarch64_add_sve_properties (Object *obj) { }#endif void aarch64_sync_32_to_64 (CPUARMState *env);
target/arm/cpu-sve.c new file +358 -0
358 lines not on this page · raw message
target/arm/cpu.c +3 -0
@@ -23,6 +23,7 @@#include "target/arm/idau.h" #include "qapi/error.h" #include "cpu.h" +#include "cpu-sve.h" #include "cpregs.h" #ifdef CONFIG_TCG
@@ -818,6 +819,7 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) {Error *local_err =NULL ; +#ifdef TARGET_AARCH64 if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) {arm_cpu_sve_finalize (cpu, &local_err);if (local_err !=NULL ) {
@@ -838,6 +840,7 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) } } } +#endif /* TARGET_AARCH64 */ if (kvm_enabled ()) {kvm_arm_steal_time_finalize (cpu, &local_err);
target/arm/cpu64.c +2 -327
347 lines not on this page · raw message
target/arm/kvm/kvm-cpu.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "cpu-sve.h" #include "hw/core/accel-cpu.h" #include "qapi/error.h"
target/arm/meson.build +1 -0
@@ -13,6 +13,7 @@ arm_ss.add(zlib) arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'cpu64.c', + 'cpu-sve.c', 'gdbstub64.c', ))
Signature · 1 line
2.20.1
Re: [PATCH v16 71/99] target/arm: cpu-sve: new module
target/arm/cpu-sve.h line 24
Quoted 4 lines · Alex Bennée
target/arm/cpu-sve.h new file +4
-0+#ifndef CPU_SVE_H +#define CPU_SVE_H + +/* note: SVE is an AARCH64-only option, only include this for TARGET_AARCH64 */
This seems unnecessary.
target/arm/cpu.h typedef struct { · line 207
Quoted 12 lines
target/arm/cpu.h +1
-5@@ -201,13 +202,9 @@ typedef struct {#ifdef TARGET_AARCH64 # define ARM_MAX_VQ 16 -void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp); -void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp);#else # define ARM_MAX_VQ 1 -static inline void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp) { } -static inline void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { } -#endif +#endif /* TARGET_AARCH64 */
Hmm. I'm not sure about removing the stubs, but see below.
target/arm/cpu.c line 26
Quoted 9 lines
target/arm/cpu.c +1
-0@@ -23,6 +23,7 @@#include "target/arm/idau.h" #include "qapi/error.h" #include "cpu.h" +#include "cpu-sve.h"
Not following the advice given above, which I agree with.
target/arm/cpu.c void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) · line 843
Quoted 9 lines
target/arm/cpu.c +2
-0+#ifdef TARGET_AARCH64 if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) {arm_cpu_sve_finalize (cpu, &local_err);if (local_err !=NULL ) {@@ -838,6 +840,7 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) } } } +#endif /* TARGET_AARCH64 */
New ifdefs, which isn't great. But I also see that it's more or less a 1-1 swap. One ifdef here, or one ifdef in the header to create the stub. So I guess it's a draw.
So, modulo the comment at the top,
r~
PATCH v16 72/99 target/arm: cpu-sve: rename functions according to module prefix
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
external functions have the cpu_sve prefix,
while for static functions it can be omitted.
--- target/arm/cpu-sve.h | 6 +++--- target/arm/cpu-sve.c | 32 ++++++++++++++++---------------- target/arm/cpu.c | 2 +- target/arm/cpu64.c | 4 ++-- target/arm/kvm/kvm-cpu.c | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-)
target/arm/cpu-sve.h +3 -3
@@ -26,12 +26,12 @@#include "cpu.h" /* called by arm_cpu_finalize_features in realizefn */ -void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp); +void cpu_sve_finalize_features (ARMCPU *cpu,Error **errp);/* add the CPU SVE properties */ -void aarch64_add_sve_properties (Object *obj); +void cpu_sve_add_props (Object *obj);/* add the CPU SVE properties specific to the "MAX" CPU */ -void aarch64_add_sve_properties_max (Object *obj); +void cpu_sve_add_props_max (Object *obj);#endif /* CPU_SVE_H */
target/arm/cpu-sve.c +16 -16
@@ -27,7 +27,7 @@#include "qapi/visitor.h" #include "cpu-sve.h" -void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp) +void cpu_sve_finalize_features (ARMCPU *cpu,Error **errp) {/* * If any vector lengths are explicitly enabled with sve<N> properties,
@@ -229,8 +229,8 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) cpu->sve_max_vq = max_vq; } -static void cpu_max_get_sve_max_vq (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void get_prop_max_vq (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) {ARMCPU *cpu =ARM_CPU (obj);uint32_t value;
@@ -244,8 +244,8 @@ static void cpu_max_get_sve_max_vq(Object *obj, Visitor *v, const char *name,visit_type_uint32 (v, name, &value, errp); } -static void cpu_max_set_sve_max_vq (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void set_prop_max_vq (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) {ARMCPU *cpu =ARM_CPU (obj);uint32_t max_vq;
@@ -276,8 +276,8 @@ static void cpu_max_set_sve_max_vq(Object *obj, Visitor *v, const char *name,* of the contents of "name" to determine which bit on which * to operate. */ -static void cpu_arm_get_sve_vq (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void get_prop_vq (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) {ARMCPU *cpu =ARM_CPU (obj);uint32_t vq =atoi (&name[3 ]) /128 ;
@@ -292,8 +292,8 @@ static void cpu_arm_get_sve_vq(Object *obj, Visitor *v, const char *name,visit_type_bool (v, name, &value, errp); } -static void cpu_arm_set_sve_vq (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void set_prop_vq (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp) {ARMCPU *cpu =ARM_CPU (obj);uint32_t vq =atoi (&name[3 ]) /128 ;
@@ -317,13 +317,13 @@ static void cpu_arm_set_sve_vq(Object *obj, Visitor *v, const char *name,set_bit (vq -1 , cpu->sve_vq_init); } -static bool cpu_arm_get_sve (Object *obj,Error **errp) +static bool get_prop_sve (Object *obj,Error **errp) {ARMCPU *cpu =ARM_CPU (obj);return cpu_isar_feature (aa64_sve, cpu); } -static void cpu_arm_set_sve (Object *obj,bool value,Error **errp) +static void set_prop_sve (Object *obj,bool value,Error **errp) {ARMCPU *cpu =ARM_CPU (obj);uint64_t t;
@@ -338,21 +338,21 @@ static void cpu_arm_set_sve(Object *obj, bool value, Error **errp) cpu->isar.id_aa64pfr0 = t; } -void aarch64_add_sve_properties (Object *obj) +void cpu_sve_add_props (Object *obj) {uint32_t vq; -object_property_add_bool (obj,"sve" , cpu_arm_get_sve, cpu_arm_set_sve); +object_property_add_bool (obj,"sve" , get_prop_sve, set_prop_sve);for (vq =1 ; vq <=ARM_MAX_VQ ; ++vq) {char name[8 ];sprintf (name,"sve%d" , vq *128 ); -object_property_add (obj, name,"bool" , cpu_arm_get_sve_vq, cpu_arm_set_sve_vq,NULL ,NULL ); +object_property_add (obj, name,"bool" , get_prop_vq, set_prop_vq,NULL ,NULL ); } }/* properties added for MAX CPU */ -void aarch64_add_sve_properties_max (Object *obj) +void cpu_sve_add_props_max (Object *obj) { -object_property_add (obj,"sve-max-vq" ,"uint32" , cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq,NULL ,NULL ); +object_property_add (obj,"sve-max-vq" ,"uint32" , get_prop_max_vq, set_prop_max_vq,NULL ,NULL ); }
target/arm/cpu.c +1 -1
@@ -821,7 +821,7 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp)#ifdef TARGET_AARCH64 if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -arm_cpu_sve_finalize (cpu, &local_err); +cpu_sve_finalize_features (cpu, &local_err);if (local_err !=NULL ) {error_propagate (errp, local_err);return ;
target/arm/cpu64.c +2 -2
@@ -452,8 +452,8 @@ static void aarch64_max_initfn(Object *obj)qdev_property_add_static (DEVICE (obj), &arm_cpu_pauth_impdef_property); } -aarch64_add_sve_properties (obj); -aarch64_add_sve_properties_max (obj); +cpu_sve_add_props (obj); +cpu_sve_add_props_max (obj); }static const ARMCPUInfo aarch64_cpus[] = {
target/arm/kvm/kvm-cpu.c +1 -1
@@ -89,7 +89,7 @@ static void host_cpu_instance_init(Object *obj)kvm_arm_set_cpu_features_from_host (cpu);if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -aarch64_add_sve_properties (obj); +cpu_sve_add_props (obj); }arm_cpu_post_init (obj); }
Signature · 1 line
2.20.1
Re: [PATCH v16 72/99] target/arm: cpu-sve: rename functions according to module prefix
target/arm/cpu-sve.c static void cpu_max_set_sve_max_vq(Object *obj, Visitor *v, const char *name, · line 280
Quoted 8 lines · Alex Bennée
target/arm/cpu-sve.c +2
-2@@ -276,8 +276,8 @@ static void cpu_max_set_sve_max_vq(Object *obj, Visitor *v, const char *name,* of the contents of "name" to determine which bit on which * to operate. */ -static void cpu_arm_get_sve_vq (Object *obj,Visitor *v,const char *name, -void *opaque,Error **errp) +static void get_prop_vq (Object *obj,Visitor *v,const char *name, +void *opaque,Error **errp)
The comment above this function needs some renames to match. Otherwise,
target/arm/kvm/kvm-cpu.c static void host_cpu_instance_init(Object *obj) · line 92
Quoted 10 lines
target/arm/kvm/kvm-cpu.c +1
-1@@ -89,7 +89,7 @@ static void host_cpu_instance_init(Object *obj)kvm_arm_set_cpu_features_from_host (cpu);if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -aarch64_add_sve_properties (obj); +cpu_sve_add_props (obj);
As an aside, I think this if is always true. kvm is 64-bit only now. One can start 32-bit guests, with proper host cpu support, but it's the "aarch64" cpu property that controls this. And all cpu properties are processed all at once.
r~
PATCH v16 73/99 target/arm: cpu-sve: split TCG and KVM functionality
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
put the KVM-specific and TCG-specific functionality in the respective subdirectories kvm/ and tcg/
--- target/arm/kvm/kvm-sve.h | 28 +++++++ target/arm/tcg/tcg-sve.h | 24 ++++++ target/arm/cpu-sve.c | 155 ++++++++++--------------------------- target/arm/kvm/kvm-sve.c | 118 ++++++++++++++++++++++++++++ target/arm/tcg/tcg-sve.c | 81 +++++++++++++++++++ target/arm/kvm/meson.build | 1 + target/arm/tcg/meson.build | 1 + 7 files changed, 296 insertions(+), 112 deletions(-) create mode 100644 target/arm/kvm/kvm-sve.h create mode 100644 target/arm/tcg/tcg-sve.h create mode 100644 target/arm/kvm/kvm-sve.c create mode 100644 target/arm/tcg/tcg-sve.c
target/arm/kvm/kvm-sve.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* QEMU AArch64 CPU SVE KVM interface +* +* Copyright 2021 SUSE LLC +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#ifndef KVM_SVE_H +#define KVM_SVE_H + +void kvm_sve_get_supported_lens (ARMCPU *cpu, +unsigned long *kvm_supported); + +void kvm_sve_enable_lens (unsigned long *sve_vq_map, +unsigned long *sve_vq_init,uint32_t max_vq, +unsigned long *kvm_supported); + +uint32_t kvm_sve_disable_lens (unsigned long *sve_vq_map, +unsigned long *sve_vq_init, +unsigned long *kvm_supported,Error **errp); + +bool kvm_sve_validate_lens (unsigned long *sve_vq_map,uint32_t max_vq, +unsigned long *kvm_supported,Error **errp, +uint32_t sve_max_vq); + +#endif /* KVM_SVE_H */
target/arm/tcg/tcg-sve.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* QEMU AArch64 CPU SVE TCG interface +* +* Copyright 2021 SUSE LLC +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#ifndef TCG_SVE_H +#define TCG_SVE_H + +/* note: SVE is an AARCH64-only option, only include this for TARGET_AARCH64 */ + +void tcg_sve_enable_lens (unsigned long *sve_vq_map, +unsigned long *sve_vq_init,uint32_t max_vq); + +uint32_t tcg_sve_disable_lens (unsigned long *sve_vq_map, +unsigned long *sve_vq_init,Error **errp); + +bool tcg_sve_validate_lens (unsigned long *sve_vq_map,uint32_t max_vq, +Error **errp); + +#endif /* TCG_SVE_H */
target/arm/cpu-sve.c +43 -112
203 lines not on this page · raw message
target/arm/kvm/kvm-sve.c new file +118 -0
118 lines not on this page · raw message
target/arm/tcg/tcg-sve.c new file +81 -0
81 lines not on this page · raw message
target/arm/kvm/meson.build +1 -0
@@ -2,4 +2,5 @@ arm_ss.add(when: 'CONFIG_KVM', if_true: files( 'kvm.c', 'kvm64.c', 'kvm-cpu.c', + 'kvm-sve.c', ))
target/arm/tcg/meson.build +1 -0
@@ -45,6 +45,7 @@ arm_ss.add(when: ['TARGET_AARCH64','CONFIG_TCG'], if_true: files( 'mte_helper.c', 'pauth_helper.c', 'sve_helper.c', + 'tcg-sve.c', )) subdir('user')
Signature · 1 line
2.20.1
Re: [PATCH v16 73/99] target/arm: cpu-sve: split TCG and KVM functionality
Quoted 6 lines · Alex Bennée
DECLARE_BITMAP(kvm_supported, ARM_MAX_VQ);target/arm/cpu-sve.c +0
-5-DECLARE_BITMAP (tmp,ARM_MAX_VQ ); -uint32_t vq, max_vq =0 ; - -/* Collect the set of vector lengths supported by KVM. */ -bitmap_zero (kvm_supported,ARM_MAX_VQ );
target/arm/cpu-sve.c void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp) · line 74
Quoted 10 lines
target/arm/cpu-sve.c +4
-5-if (kvm_enabled () &&kvm_arm_sve_supported ()) { -kvm_arm_sve_get_vls (CPU (cpu), kvm_supported); - }else if (kvm_enabled ()) { -assert (!cpu_isar_feature (aa64_sve, cpu)); - } +uint32_t max_vq =0 ; +if (kvm_enabled ()) { +kvm_sve_get_supported_lens (cpu, kvm_supported); + }
Previously, kvm_supported was always initialized.
I guess this is sort-of a cleanup. But we've got 4 different checks for kvm and tcg. I think we can actually tidy this up with a set of callbacks.
static bool do_sve_finalize(ARMCPU *cpu, Error **errp,
void (*get_supported_lens)(ARMCPU *, unsigned long *), void (*enable_lens)(unsigned long *vq_map,
unsigned long *vq_init, uint32_t max_vq,
unsigned long *supported),
void (*disable_lens)(unsigned long *vq_map,
unsigned long *vq_init, unsigned long *supported, Error **errp),
void (*validate_lens)(unsigned long *vq_map,
unsigned long *vq_init, unsigned long *supported, Error **errp, uint32_t max_vq))
{
...
}bool cpu_sve_finalize_features(ARMCPU *cpu, Error **errp)
{
if (kvm_enabled()) {
return do_sve_finalize(cpu, errp,
kvm_sve_get_supported_lens,
kvm_sve_enable_lens,
kvm_sve_disable_lens,
kvm_sve_validate_lens);
} else if (tcg_enabled()) {
return do_sve_finalize(cpu, errp,
tcg_sve_get_supported_lens,
tcg_sve_enable_lens,
tcg_sve_disable_lens,
tcg_sve_validate_lens);
} else {
g_assert_not_reached(); /* ??? */
}
}with
void tcg_sve_get_supported_lens(ARMCPU *cpu,
unsigned long *supported)
{
bitmap_fill(supported, ARM_MAX_VQ);
}which we can later adjust for, e.g. -cpu a64fx and neoverse-v1, etc, which don't support all vq sizes.
r~
Re: [PATCH v16 73/99] target/arm: cpu-sve: split TCG and KVM functionality
In reply to Alex BennéeQuoted 81 lines · Alex Bennée
target/arm/kvm/kvm-sve.c new file +81
-0+void kvm_sve_get_supported_lens (ARMCPU *cpu,unsigned long *kvm_supported) +{ +/* Collect the set of vector lengths supported by KVM. */ +bitmap_zero (kvm_supported,ARM_MAX_VQ ); + +if (kvm_arm_sve_supported ()) { +kvm_arm_sve_get_vls (CPU (cpu), kvm_supported); + }else { +assert (!cpu_isar_feature (aa64_sve, cpu)); + } +} + +void kvm_sve_enable_lens (unsigned long *sve_vq_map, +unsigned long *sve_vq_init,uint32_t max_vq, +unsigned long *kvm_supported) +{ +/* +* For KVM we have to automatically enable all supported unitialized +* lengths, even when the smaller lengths are not all powers-of-two. +*/ +DECLARE_BITMAP (tmp,ARM_MAX_VQ ); + +bitmap_andnot (tmp, kvm_supported, sve_vq_init, max_vq); +bitmap_or (sve_vq_map, sve_vq_map, tmp, max_vq); +} + +uint32_t kvm_sve_disable_lens (unsigned long *sve_vq_map, +unsigned long *sve_vq_init, +unsigned long *kvm_supported,Error **errp) +{ +uint32_t max_vq, vq; + +/* Disabling a supported length disables all larger lengths. */ +for (vq =1 ; vq <=ARM_MAX_VQ ; ++vq) { +if (test_bit (vq -1 , sve_vq_init) && +test_bit (vq -1 , kvm_supported)) { +break ; + } + } + + max_vq = vq <=ARM_MAX_VQ ? vq -1 :ARM_MAX_VQ ; +bitmap_andnot (sve_vq_map, kvm_supported, sve_vq_init, max_vq); + +if (max_vq ==0 ||bitmap_empty (sve_vq_map, max_vq)) { +error_setg (errp,"cannot disable sve%d" , vq *128 ); +error_append_hint (errp,"Disabling sve%d results in all " +"vector lengths being disabled.\n" , + vq *128 ); +error_append_hint (errp,"With SVE enabled, at least one " +"vector length must be enabled.\n" ); +return 0 ; + } + +return max_vq; +} + +bool kvm_sve_validate_lens (unsigned long *sve_vq_map,uint32_t max_vq, +unsigned long *kvm_supported,Error **errp, +uint32_t sve_max_vq) +{ +/* Ensure the set of lengths matches what KVM supports. */ +DECLARE_BITMAP (tmp,ARM_MAX_VQ ); +uint32_t vq; + +bitmap_xor (tmp, sve_vq_map, kvm_supported, max_vq); +if (bitmap_empty (tmp, max_vq)) { +return true; + } + + vq =find_last_bit (tmp, max_vq) +1 ; +if (test_bit (vq -1 , sve_vq_map)) { +if (sve_max_vq) { +error_setg (errp,"cannot set sve-max-vq=%d" , sve_max_vq); +error_append_hint (errp,"This KVM host does not support " +"the vector length %d-bits.\n" , vq *128 ); +error_append_hint (errp,"It may not be possible to use " +"sve-max-vq with this KVM host. Try " +"using only sve<N> properties.\n" ); + }else { +error_setg (errp,"cannot enable sve%d" , vq *128 ); + error_append_hint(errp, "This KVM host does not support "
target/arm/kvm/kvm-sve.c line 118
Quoted 10 lines
target/arm/kvm/kvm-sve.c new file +10
-0+ "the vector length %d-bits.\n", vq * 128); + } + }else { +error_setg (errp,"cannot disable sve%d" , vq *128 ); +error_append_hint (errp,"The KVM host requires all " +"supported vector lengths smaller " +"than %d bits to also be enabled.\n" , max_vq *128 ); + } +return false; +}
Also, I think I mentioned this before in review of a previous version, I strongly suspect that aside from kvm_sve_get_supported_lens, the other functions will be used without change by all other hw virt systems.
So I think we'll do best, short term, to keep all of this in cpu-sve.c for now.
The tcg_enabled() test should elide all of the code that's not needed when
!CONFIG_TCG.
r~
PATCH v16 74/99 target/arm: cpu-sve: make cpu_sve_finalize_features return bool
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
return false on error, true on success.
--- target/arm/cpu-sve.h | 2 +- target/arm/cpu-sve.c | 17 +++++++++-------- target/arm/cpu.c | 3 +-- 3 files changed, 11 insertions(+), 11 deletions(-)
target/arm/cpu-sve.h +1 -1
@@ -26,7 +26,7 @@#include "cpu.h" /* called by arm_cpu_finalize_features in realizefn */ -void cpu_sve_finalize_features (ARMCPU *cpu,Error **errp); +bool cpu_sve_finalize_features (ARMCPU *cpu,Error **errp);/* add the CPU SVE properties */ void cpu_sve_add_props (Object *obj);
target/arm/cpu-sve.c +9 -8
@@ -49,7 +49,7 @@ static bool apply_max_vq(unsigned long *sve_vq_map, unsigned long *sve_vq_init,return true; } -void cpu_sve_finalize_features (ARMCPU *cpu,Error **errp) +bool cpu_sve_finalize_features (ARMCPU *cpu,Error **errp) {/* * If any vector lengths are explicitly enabled with sve<N> properties,
@@ -86,7 +86,7 @@ void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp)"length, sve-max-vq=%d (%d bits)\n" , max_vq *128 , cpu->sve_max_vq, cpu->sve_max_vq * 128); -return ; +return false; }if (kvm_enabled ()) { kvm_sve_enable_lens(cpu->sve_vq_map, cpu->sve_vq_init, max_vq,
@@ -98,7 +98,7 @@ void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp)/* No explicit bits enabled, and no implicit bits from sve-max-vq. */ if (!cpu_isar_feature (aa64_sve, cpu)) {/* SVE is disabled and so are all vector lengths. Good. */ -return ; +return true; }if (kvm_enabled ()) { max_vq = kvm_sve_disable_lens(cpu->sve_vq_map, cpu->sve_vq_init,
@@ -108,7 +108,7 @@ void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp) errp); }if (!max_vq) { -return ; +return false; } max_vq =find_last_bit (cpu->sve_vq_map, max_vq) +1 ; }
@@ -122,7 +122,7 @@ void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp) max_vq = cpu->sve_max_vq;if (!apply_max_vq (cpu->sve_vq_map, cpu->sve_vq_init, max_vq, errp)) { -return ; +return false; } }/*
@@ -136,11 +136,11 @@ void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp)if (kvm_enabled ()) {if (!kvm_sve_validate_lens (cpu->sve_vq_map, max_vq, kvm_supported, errp, cpu->sve_max_vq)) { -return ; +return false; } }else if (tcg_enabled ()) {if (!tcg_sve_validate_lens (cpu->sve_vq_map, max_vq, errp)) { -return ; +return false; } }
@@ -153,11 +153,12 @@ void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp)error_append_hint (errp,"SVE must be enabled to enable vector " "lengths.\n" );error_append_hint (errp,"Add sve=on to the CPU property list.\n" ); -return ; +return false; }/* From now on sve_max_vq is the actual maximum supported length. */ cpu->sve_max_vq = max_vq; +return true; } static void get_prop_max_vq(Object *obj, Visitor *v, const char *name,
target/arm/cpu.c +1 -2
@@ -821,8 +821,7 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp)#ifdef TARGET_AARCH64 if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -cpu_sve_finalize_features (cpu, &local_err); -if (local_err !=NULL ) { +if (!cpu_sve_finalize_features (cpu, &local_err)) {error_propagate (errp, local_err);return ; }
Signature · 1 line
2.20.1
Re: [PATCH v16 74/99] target/arm: cpu-sve: make cpu_sve_finalize_features return bool
Quoted 11 lines · Alex Bennée
From: Claudio Fontana<[email protected]>
return false on error, true on success.
Signed-off-by Claudio Fontana<[email protected]>Signed-off-by Alex Bennée<[email protected]>--- target/arm/cpu-sve.h | 2 +- target/arm/cpu-sve.c | 17 +++++++++-------- target/arm/cpu.c | 3 +-- 3 files changed, 11 insertions(+), 11 deletions(-)
r~
PATCH v16 75/99 target/arm: make is_aa64 and arm_el_is_aa64 a macro for !TARGET_AARCH64
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
when TARGET_AARCH64 is not defined, it is helpful to make is_aa64() and arm_el_is_aa64 macros defined to "false".
This way we can make more code TARGET_AARCH64-only.
--- target/arm/cpu.h | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-)
target/arm/cpu.h +24 -13
@@ -1060,6 +1060,11 @@ void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq);void aarch64_sve_change_el (CPUARMState *env,int old_el,int new_el,bool el0_a64); +static inline bool is_a64 (CPUARMState *env) +{ +return env->aarch64; +} +/* * SVE registers are encoded in KVM's memory in an endianness-invariant format. * The byte at offset i from the start of the in-memory representation contains
@@ -1089,7 +1094,10 @@ static inline void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq) { }static inline void aarch64_sve_change_el (CPUARMState *env,int o,int n,bool a) { } -#endif + +#define is_a64 (env) ((void)env, false) + +#endif /* TARGET_AARCH64 */ void aarch64_sync_32_to_64 (CPUARMState *env);void aarch64_sync_64_to_32 (CPUARMState *env);
@@ -1098,11 +1106,6 @@ int fp_exception_el(CPUARMState *env, int cur_el);int sve_exception_el (CPUARMState *env,int cur_el);uint32_t sve_zcr_len_for_el (CPUARMState *env,int el); -static inline bool is_a64 (CPUARMState *env) -{ -return env->aarch64; -} -/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */
@@ -2212,13 +2215,7 @@ static inline bool arm_is_el2_enabled(CPUARMState *env) }#endif -/** -* arm_hcr_el2_eff(): Return the effective value of HCR_EL2. -* E.g. when in secure state, fields in HCR_EL2 are suppressed, -* "for all purposes other than a direct read or write access of HCR_EL2." -* Not included here is HCR_RW. -*/ -uint64_t arm_hcr_el2_eff (CPUARMState *env); +#ifdef TARGET_AARCH64 /* Return true if the specified exception level is running in AArch64 state. */ static inline bool arm_el_is_aa64 (CPUARMState *env,int el)
@@ -2253,6 +2250,20 @@ static inline bool arm_el_is_aa64(CPUARMState *env, int el) return aa64; } +#else + +#define arm_el_is_aa64 (env, el) ((void)env, (void)el, false) + +#endif /* TARGET_AARCH64 */ + +/** +* arm_hcr_el2_eff(): Return the effective value of HCR_EL2. +* E.g. when in secure state, fields in HCR_EL2 are suppressed, +* "for all purposes other than a direct read or write access of HCR_EL2." +* Not included here is HCR_RW. +*/ +uint64_t arm_hcr_el2_eff (CPUARMState *env); +/* Function for determing whether guest cp register reads and writes should * access the secure or non-secure bank of a cp register. When EL3 is * operating in AArch32 state, the NS-bit determines whether the secure
Signature · 1 line
2.20.1
Re: [PATCH v16 75/99] target/arm: make is_aa64 and arm_el_is_aa64 a macro for !TARGET_AARCH64
Quoted 30 lines · Alex Bennée
From: Claudio Fontana <[email protected]>
when
TARGET_AARCH64is not defined, it is helpful to makeis_aa64()andarm_el_is_aa64macros defined to "false".This way we can make more code TARGET_AARCH64-only.
Signed-off-by Claudio Fontana <[email protected]>Signed-off-by Alex Bennée <[email protected]>--- target/arm/cpu.h | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-)target/arm/cpu.h +5
-0@@ -1060,6 +1060,11 @@ void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq);void aarch64_sve_change_el (CPUARMState *env,int old_el,int new_el,bool el0_a64); +static inline bool is_a64 (CPUARMState *env) +{ +return env->aarch64; +} +/* * SVE registers are encoded in KVM's memory in an endianness-invariant format. * The byte at offset i from the start of the in-memory representation contains
target/arm/cpu.h static inline void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq) { } · line 1098
Quoted 6 lines
target/arm/cpu.h +2
-1@@ -1089,7 +1094,10 @@ static inline void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq) { }static inline void aarch64_sve_change_el (CPUARMState *env,int o,int n,bool a) { } -#endif + +#define is_a64 (env) ((void)env, false)
In theory, parenthesis are required around the env expansion.
target/arm/cpu.h static inline bool arm_el_is_aa64(CPUARMState *env, int el) · line 2255
Quoted 1 line
target/arm/cpu.h +1
-0+#define arm_el_is_aa64 (env, el) ((void)env, (void)el, false)
Likewise. Otherwise,
r~
PATCH v16 76/99 target/arm: restrict rebuild_hflags_a64 to TARGET_AARCH64
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
this work is in preparation of making sve_zcr_len_for_el AARCH64-only.
---
v14
- fix merge failure with CPUARMTBflags update
--- target/arm/helper-a64.h | 2 ++ target/arm/helper.h | 1 - target/arm/tcg/helper.c | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
target/arm/helper-a64.h +2 -0
@@ -118,3 +118,5 @@ DEF_HELPER_FLAGS_2(st2g_stub, TCG_CALL_NO_WG, void, env, i64) DEF_HELPER_FLAGS_2(ldgm, TCG_CALL_NO_WG, i64, env, i64) DEF_HELPER_FLAGS_3(stgm, TCG_CALL_NO_WG, void, env, i64, i64) DEF_HELPER_FLAGS_3(stzgm_tags, TCG_CALL_NO_WG, void, env, i64, i64) + +DEF_HELPER_FLAGS_2 (rebuild_hflags_a64,TCG_CALL_NO_RWG , void, env, int)
target/arm/helper.h +0 -1
@@ -94,7 +94,6 @@ DEF_HELPER_FLAGS_1(rebuild_hflags_m32_newel, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(rebuild_hflags_m32, TCG_CALL_NO_RWG, void, env, int) DEF_HELPER_FLAGS_1(rebuild_hflags_a32_newel, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(rebuild_hflags_a32, TCG_CALL_NO_RWG, void, env, int) -DEF_HELPER_FLAGS_2(rebuild_hflags_a64, TCG_CALL_NO_RWG, void, env, int)DEF_HELPER_FLAGS_5 (probe_access,TCG_CALL_NO_WG , void, env, tl, i32, i32, i32)
target/arm/tcg/helper.c +12 -0
@@ -999,6 +999,8 @@ static CPUARMTBFlags rebuild_hflags_a32(CPUARMState *env, int fp_el,return rebuild_hflags_common_32 (env, fp_el, mmu_idx, flags); } +#ifdef TARGET_AARCH64 +static CPUARMTBFlags rebuild_hflags_a64 (CPUARMState *env,int el,int fp_el,ARMMMUIdx mmu_idx) {
@@ -1122,6 +1124,14 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el,return rebuild_hflags_common (env, fp_el, mmu_idx, flags); } +#else + +QEMU_ERROR("this should have been optimized away!") +CPUARMTBFlags rebuild_hflags_a64 (CPUARMState *env,int el,int fp_el, +ARMMMUIdx mmu_idx); + +#endif /* TARGET_AARCH64 */ +static CPUARMTBFlags rebuild_hflags_internal (CPUARMState *env) {int el =arm_current_el (env);
@@ -1183,6 +1193,7 @@ void HELPER(rebuild_hflags_a32)(CPUARMState *env, int el) env->hflags =rebuild_hflags_a32 (env, fp_el, mmu_idx); } +#ifdef TARGET_AARCH64 void HELPER (rebuild_hflags_a64 )(CPUARMState *env,int el) {int fp_el =fp_exception_el (env, el);
@@ -1190,6 +1201,7 @@ void HELPER(rebuild_hflags_a64)(CPUARMState *env, int el) env->hflags = rebuild_hflags_a64(env, el, fp_el, mmu_idx); } +#endif /* TARGET_AARCH64 */ static inline void assert_hflags_rebuild_correctly (CPUARMState *env) {
Signature · 1 line
2.20.1
Re: [PATCH v16 76/99] target/arm: restrict rebuild_hflags_a64 to TARGET_AARCH64
Quoted 35 lines · Alex Bennée
target/arm/tcg/helper.c +11
-0@@ -999,6 +999,8 @@ static CPUARMTBFlags rebuild_hflags_a32(CPUARMState *env, int fp_el,return rebuild_hflags_common_32 (env, fp_el, mmu_idx, flags); } +#ifdef TARGET_AARCH64 +static CPUARMTBFlags rebuild_hflags_a64 (CPUARMState *env,int el,int fp_el,ARMMMUIdx mmu_idx) {@@ -1122,6 +1124,14 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el,return rebuild_hflags_common (env, fp_el, mmu_idx, flags); } +#else + +QEMU_ERROR("this should have been optimized away!") +CPUARMTBFlags rebuild_hflags_a64 (CPUARMState *env,int el,int fp_el, +ARMMMUIdx mmu_idx); + +#endif /* TARGET_AARCH64 */ +static CPUARMTBFlags rebuild_hflags_internal (CPUARMState *env) {int el =arm_current_el (env);@@ -1183,6 +1193,7 @@ void HELPER(rebuild_hflags_a32)(CPUARMState *env, int el) env->hflags =rebuild_hflags_a32 (env, fp_el, mmu_idx); } +#ifdef TARGET_AARCH64 void HELPER (rebuild_hflags_a64 )(CPUARMState *env,int el) {int fp_el =fp_exception_el (env, el);
target/arm/tcg/helper.c void HELPER(rebuild_hflags_a64)(CPUARMState *env, int el) · line 1204
Quoted 4 lines
target/arm/tcg/helper.c +1
-0@@ -1190,6 +1201,7 @@ void HELPER(rebuild_hflags_a64)(CPUARMState *env, int el) env->hflags = rebuild_hflags_a64(env, el, fp_el, mmu_idx); } +#endif /* TARGET_AARCH64 */
It would be better to move some of this code to helper-a64.c, above multiple ifdefs.
r~
PATCH v16 77/99 target/arm: arch_dump: restrict ELFCLASS64 to AArch64
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
this will allow us to restrict more code to TARGET_AARCH64
---
v16
- fix conflict now notes in arm_sysemu_ops
--- target/arm/arch_dump.c | 12 +++++++----- target/arm/cpu.c | 2 ++ roms/u-boot | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-)
target/arm/arch_dump.c +7 -5
@@ -23,6 +23,8 @@#include "elf.h" #include "sysemu/dump.h" +#ifdef TARGET_AARCH64 + /* struct user_pt_regs from arch/arm64/include/uapi/asm/ptrace.h */ struct aarch64_user_regs { uint64_t regs[31];
@@ -141,7 +143,6 @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,return 0 ; } -#ifdef TARGET_AARCH64 static off_t sve_zreg_offset (uint32_t vq,int n) {off_t off =sizeof (struct aarch64_user_sve_header );
@@ -229,7 +230,6 @@ static int aarch64_write_elf64_sve(WriteCoreDumpFunction f,return 0 ; } -#endif int arm_cpu_write_elf64_note (WriteCoreDumpFunction f,CPUState *cs,int cpuid,void *opaque)
@@ -272,15 +272,15 @@ int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, return ret; } -#ifdef TARGET_AARCH64 if (cpu_isar_feature (aa64_sve, cpu)) { ret =aarch64_write_elf64_sve (f, env, cpuid, s); } -#endif return ret; } +#endif /* TARGET_AARCH64 */ +/* struct pt_regs from arch/arm/include/asm/ptrace.h */ struct arm_user_regs {uint32_t regs[17 ];
@@ -449,12 +449,14 @@ ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)size_t note_size;if (class ==ELFCLASS64 ) { +#ifdef TARGET_AARCH64 note_size =AARCH64_PRSTATUS_NOTE_SIZE ; note_size +=AARCH64_PRFPREG_NOTE_SIZE ; -#ifdef TARGET_AARCH64 if (cpu_isar_feature (aa64_sve, cpu)) { note_size +=AARCH64_SVE_NOTE_SIZE (&cpu->env); } +#else +return -1 ;/* unsupported */ #endif }else { note_size =ARM_PRSTATUS_NOTE_SIZE ;
target/arm/cpu.c +2 -0
@@ -1380,7 +1380,9 @@ static const struct SysemuCPUOps arm_sysemu_ops = { .get_phys_page_attrs_debug = arm_cpu_get_phys_page_attrs_debug, .asidx_from_attrs = arm_asidx_from_attrs, .write_elf32_note = arm_cpu_write_elf32_note, +#ifdef TARGET_AARCH64 .write_elf64_note = arm_cpu_write_elf64_note, +#endif .virtio_is_big_endian = arm_cpu_virtio_is_big_endian, .legacy_vmsd = &vmstate_arm_cpu, };
roms/u-boot +1 -1
@@ -1 +1 @@ -Subproject commit b46dd116ce03e235f2a7d4843c6278e1da44b5e1 +Subproject commit d3689267f92c5956e09cc7d1baa4700141662bff
Signature · 1 line
2.20.1
Re: [PATCH v16 77/99] target/arm: arch_dump: restrict ELFCLASS64 to AArch64
Quoted 7 lines · Alex Bennée
From: Claudio Fontana <[email protected]>
this will allow us to restrict more code to
TARGET_AARCH64Signed-off-by Claudio Fontana <[email protected]>Reviewed-by Richard Henderson <[email protected]>Signed-off-by Alex Bennée <[email protected]>
I don't see this as an improvement, necessarily. IIRC, arch_dump is sysemu only.
I think that for sysemu we should simply work to eliminate qemu-system-arm (or conversely, qemu-system-aarch64), running all Arm stuff with one binary. At which point all this ifdeffery must be undone.
roms/u-boot line 1
Quoted 5 lines
roms/u-boot +1
-1@@ -1 +1 @@ -Subproject commit b46dd116ce03e235f2a7d4843c6278e1da44b5e1 +Subproject commit d3689267f92c5956e09cc7d1baa4700141662bff
Mistake.
r~
PATCH v16 78/99 target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
after restricting AArch64-specific code to TARGET_AARCH64 builds, we can now extract the exception handling code from cpu-sysemu, and split its AArch64-specific part into its own module.
--- target/arm/cpu-exceptions-aa64.h | 28 ++ target/arm/cpu-exceptions-aa64.c | 276 +++++++++++++ target/arm/cpu-exceptions.c | 445 ++++++++++++++++++++ target/arm/cpu-sysemu.c | 672 ------------------------------- target/arm/cpu-user.c | 1 + target/arm/meson.build | 5 + 6 files changed, 755 insertions(+), 672 deletions(-) create mode 100644 target/arm/cpu-exceptions-aa64.h create mode 100644 target/arm/cpu-exceptions-aa64.c create mode 100644 target/arm/cpu-exceptions.c
target/arm/cpu-exceptions-aa64.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* QEMU AArch64 CPU Exceptions Sysemu code +* +* Copyright (c) 2012 SUSE LINUX Products GmbH +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see +* <http://www.gnu.org/licenses/gpl-2.0.html> +*/ + +#ifndef CPU_EXCEPTIONS_AA64_H +#define CPU_EXCEPTIONS_AA64_H + +#include "cpu.h" + +void arm_cpu_do_interrupt_aarch64 (CPUState *cs); + +#endif /* CPU_EXCEPTIONS_AA64_H */
target/arm/cpu-exceptions-aa64.c new file +276 -0
276 lines not on this page · raw message
target/arm/cpu-exceptions.c new file +445 -0
445 lines not on this page · raw message
target/arm/cpu-sysemu.c +0 -672
684 lines not on this page · raw message
target/arm/cpu-user.c +1 -0
@@ -12,6 +12,7 @@#include "qapi/qapi-commands-machine-target.h" #include "qapi/error.h" #include "cpu.h" +#include "cpu-exceptions-aa64.h" #include "internals.h" void switch_mode (CPUARMState *env,int mode)
target/arm/meson.build +5 -0
@@ -21,12 +21,17 @@ arm_softmmu_ss = ss.source_set() arm_softmmu_ss.add(files( 'arch_dump.c', 'arm-powerctl.c', + 'cpu-exceptions.c', 'cpu-mmu-sysemu.c', 'cpu-sysemu.c', 'machine.c', 'monitor.c', )) +arm_softmmu_ss.add(when: 'TARGET_AARCH64', if_true: files( + 'cpu-exceptions-aa64.c' +)) + arm_softmmu_ss.add(when: 'CONFIG_TCG', if_true: files( 'psci.c', ))
Signature · 1 line
2.20.1
Re: [PATCH v16 78/99] target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules
Quoted 24 lines · Alex Bennée
target/arm/cpu-exceptions-aa64.h new file +18
-0@@ -0,0 +1,28 @@ +/* +* QEMU AArch64 CPU Exceptions Sysemu code +* +* Copyright (c) 2012 SUSE LINUX Products GmbH +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see +*<http://www.gnu.org/licenses/gpl-2.0.html>
target/arm/cpu-exceptions-aa64.h line 28
Quoted 10 lines
target/arm/cpu-exceptions-aa64.h new file +10
-0+*/ + +#ifndef CPU_EXCEPTIONS_AA64_H +#define CPU_EXCEPTIONS_AA64_H + +#include "cpu.h" + +void arm_cpu_do_interrupt_aarch64 (CPUState *cs); + +#endif /* CPU_EXCEPTIONS_AA64_H */
I don't see the point in the excessive replication of header files, for exactly one declaration. This is not the first example.
What's wrong with internal.h? Or some other header that collects sysemu specific declarations?
Also, "cpu.h" is not required by this declaration, as I've pointed out before.
r~
Re: [PATCH v16 78/99] target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules
Quoted 39 lines · Richard Henderson
Quoted 24 lines · Alex Bennée
target/arm/cpu-exceptions-aa64.h new file +18
-0@@ -0,0 +1,28 @@ +/* +* QEMU AArch64 CPU Exceptions Sysemu code +* +* Copyright (c) 2012 SUSE LINUX Products GmbH +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see +*<http://www.gnu.org/licenses/gpl-2.0.html> target/arm/cpu-exceptions-aa64.h line 28
Quoted 10 lines
target/arm/cpu-exceptions-aa64.h new file +10
-0+*/ + +#ifndef CPU_EXCEPTIONS_AA64_H +#define CPU_EXCEPTIONS_AA64_H + +#include "cpu.h" + +void arm_cpu_do_interrupt_aarch64 (CPUState *cs); + +#endif /* CPU_EXCEPTIONS_AA64_H */ I don't see the point in the excessive replication of header files, for exactly one declaration. This is not the first example.
Quoted 1 line
What's wrong with
internal.h?
Doesn't mean anything and leads to a mess of unrelated code.
I think we should be better at creating meaningful modules, instead of collections of unrelated functions.
Not defending this particular change, just answering your specific question.
Thanks,
C
Quoted 8 lines
Or some other header that collects sysemu
specific declarations?Also, "
cpu.h" is not required by this declaration, as I've pointed out before.r~
Re: [PATCH v16 78/99] target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules
Quoted 8 lines · Claudio Fontana
Quoted 4 lines · Richard Henderson
I don't see the point in the excessive replication of header files, for exactly one declaration. This is not the first example.
What's wrong with
internal.h?Doesn't mean anything and leads to a mess of unrelated code.
It is all related: it is "things that the target/arm code needs, which are not needed by anything outside target/arm".
Quoted 1 line
I think we should be better at creating meaningful modules
target/arm is a meaningful grouping of code :-)
thanks
-- PMM
Re: [PATCH v16 78/99] target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules
Quoted 8 lines · Peter Maydell
Quoted 7 lines · Claudio Fontana
Quoted 4 lines · Richard Henderson
I don't see the point in the excessive replication of header files, for exactly one declaration. This is not the first example.
What's wrong with
internal.h?
Quoted 9 lines
Quoted 1 line
Doesn't mean anything and leads to a mess of unrelated code.
It is all related: it is "things that the target/arm code needs, which are not needed by anything outside target/arm".
Quoted 1 line
I think we should be better at creating meaningful modules
target/arm is a meaningful grouping of code :-)
Well, seems a bit too large a grouping to me,
and it seems like more effort could be put into recognizing opportunities to split things into self-contained units when they show up, with more clearly defined and commented interfaces about inputs/outputs and initialization dependencies,
instead of cramming everything together. Of course there is a balance to be had, but my impression is that using exclusively things like internal.h leads to people adding anything new just piling unrelated things on top, and missing opportunities for doing things in a more self-contained way.
Just my 2c of course.
Ciao,
C.
Re: [PATCH v16 78/99] target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules
In reply to Alex BennéeQuoted 6 lines · Alex Bennée
From: Claudio Fontana <[email protected]>
after restricting AArch64-specific code to
TARGET_AARCH64builds, we can now extract the exception handling code from cpu-sysemu, and split its AArch64-specific part into its own module.
Quoted 6 lines
Signed-off-by Claudio Fontana <[email protected]>Signed-off-by Alex Bennée <[email protected]>--- target/arm/cpu-exceptions-aa64.h | 28 ++ target/arm/cpu-exceptions-aa64.c | 276 +++++++++++++ target/arm/cpu-exceptions.c | 445 ++++++++++++++++++++
Oh, splitting stuff out of cpu-sysemu.c is fine, but back to the single binary theory, do we gain anything with two files?
target/arm/cpu-user.c line 15
Quoted 9 lines
target/arm/cpu-user.c +1
-0@@ -12,6 +12,7 @@#include "qapi/qapi-commands-machine-target.h" #include "qapi/error.h" #include "cpu.h" +#include "cpu-exceptions-aa64.h"
Please point to what requires this include.
r~
PATCH v16 79/99 target/arm: tcg: restrict ZCR cpregs to TARGET_AARCH64
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
restrict zcr_el1, zcr_el2, zcr_no_el2, zcr_el3 reginfo, and the related SVE functions to TARGET_AARCH64.
--- target/arm/tcg/cpregs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
target/arm/tcg/cpregs.c +6 -2
@@ -5791,6 +5791,8 @@ static const ARMCPRegInfo debug_lpae_cp_reginfo[] = {REGINFO_SENTINEL }; +#ifdef TARGET_AARCH64 +static void zcr_write (CPUARMState *env,const ARMCPRegInfo *ri,uint64_t value) {
@@ -5843,6 +5845,8 @@ static const ARMCPRegInfo zcr_el3_reginfo = { .writefn = zcr_write, .raw_writefn = raw_write }; +#endif /* TARGET_AARCH64 */ +static void dbgwvr_write (CPUARMState *env,const ARMCPRegInfo *ri,uint64_t value) {
@@ -7572,6 +7576,7 @@ void register_cp_regs_for_features(ARMCPU *cpu)define_arm_cp_regs (cpu, vhe_reginfo); } +#ifdef TARGET_AARCH64 if (cpu_isar_feature (aa64_sve, cpu)) {define_one_arm_cp_reg (cpu, &zcr_el1_reginfo);if (arm_feature (env,ARM_FEATURE_EL2 )) {
@@ -7584,7 +7589,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) } } -#ifdef TARGET_AARCH64 if (cpu_isar_feature (aa64_pauth, cpu)) {define_arm_cp_regs (cpu, pauth_reginfo); }
@@ -7614,7 +7618,7 @@ void register_cp_regs_for_features(ARMCPU *cpu)define_arm_cp_regs (cpu, mte_tco_ro_reginfo); define_arm_cp_regs(cpu, mte_el0_cacheop_reginfo); } -#endif +#endif /* TARGET_AARCH64 */ if (cpu_isar_feature (any_predinv, cpu)) {define_arm_cp_regs (cpu, predinv_reginfo);
Signature · 1 line
2.20.1
Re: [PATCH v16 79/99] target/arm: tcg: restrict ZCR cpregs to TARGET_AARCH64
Quoted 26 lines · Alex Bennée
From: Claudio Fontana<[email protected]>
restrict
zcr_el1,zcr_el2,zcr_no_el2,zcr_el3reginfo, and the related SVE functions toTARGET_AARCH64.Signed-off-by Claudio Fontana<[email protected]>Reviewed-by Richard Henderson<[email protected]>Signed-off-by Alex Bennée<[email protected]>--- target/arm/tcg/cpregs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)target/arm/tcg/cpregs.c +2
-0@@ -5791,6 +5791,8 @@ static const ARMCPRegInfo debug_lpae_cp_reginfo[] = {REGINFO_SENTINEL }; +#ifdef TARGET_AARCH64 +static void zcr_write (CPUARMState *env,const ARMCPRegInfo *ri,uint64_t value) {
target/arm/tcg/cpregs.c static const ARMCPRegInfo zcr_el3_reginfo = { · line 5849
Quoted 5 lines
target/arm/tcg/cpregs.c +2
-0@@ -5843,6 +5845,8 @@ static const ARMCPRegInfo zcr_el3_reginfo = { .writefn = zcr_write, .raw_writefn = raw_write }; +#endif /* TARGET_AARCH64 */ +
Given that tcg/cpregs.c is > 7k lines, I wouldn't mind splitting the file on that principal. But just sprinking ifdefs is not on.
r~
PATCH v16 80/99 target/arm: tcg-sve: import narrow_vq and change_el functions
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
aarch64_sve_narrow_vq and aarch64_sve_change_el are SVE-related functions only used for TCG, so we can put them in the tcg-sve.c module.
--- target/arm/cpu.h | 7 --- target/arm/tcg/tcg-sve.h | 5 ++ linux-user/syscall.c | 4 ++ target/arm/cpu-exceptions-aa64.c | 1 + target/arm/tcg/cpregs.c | 4 ++ target/arm/tcg/helper-a64.c | 1 + target/arm/tcg/helper.c | 87 -------------------------------- target/arm/tcg/tcg-sve.c | 86 +++++++++++++++++++++++++++++++ 8 files changed, 101 insertions(+), 94 deletions(-)
target/arm/cpu.h +0 -7
@@ -1056,9 +1056,6 @@ int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,#ifdef TARGET_AARCH64 int aarch64_cpu_gdb_read_register (CPUState *cpu,GByteArray *buf,int reg);int aarch64_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq); -void aarch64_sve_change_el (CPUARMState *env,int old_el, -int new_el,bool el0_a64);static inline bool is_a64 (CPUARMState *env) {
@@ -1090,10 +1087,6 @@ static inline uint64_t *sve_bswap64(uint64_t *dst, uint64_t *src, int nr) }#else -static inline void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq) { } -static inline void aarch64_sve_change_el (CPUARMState *env,int o, -int n,bool a) -{ }#define is_a64 (env) ((void)env, false)
target/arm/tcg/tcg-sve.h +5 -0
@@ -21,4 +21,9 @@ uint32_t tcg_sve_disable_lens(unsigned long *sve_vq_map,bool tcg_sve_validate_lens (unsigned long *sve_vq_map,uint32_t max_vq,Error **errp); +void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq); + +void aarch64_sve_change_el (CPUARMState *env,int old_el, +int new_el,bool el0_a64); +#endif /* TCG_SVE_H */
linux-user/syscall.c +4 -0
@@ -134,6 +134,10 @@#include "fd-trans.h" #include "tcg/tcg.h" +#ifdef TARGET_AARCH64 +#include "tcg/tcg-sve.h" +#endif /* TARGET_AARCH64 */ +#ifndef CLONE_IO #define CLONE_IO 0x80000000/* Clone io context */ #endif
target/arm/cpu-exceptions-aa64.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" +#include "tcg/tcg-sve.h" #include "internals.h" #include "sysemu/tcg.h"
target/arm/tcg/cpregs.c +4 -0
@@ -16,6 +16,10 @@#include "cpu-mmu.h" #include "cpregs.h" +#ifdef TARGET_AARCH64 +#include "tcg/tcg-sve.h" +#endif /* TARGET_AARCH64 */ +#define ARM_CPU_FREQ 1000000000/* FIXME: 1 GHz, should be configurable */ #define PMCR_NUM_COUNTERS 4/* QEMU IMPDEF choice */
target/arm/tcg/helper-a64.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qemu/units.h" #include "cpu.h" +#include "tcg/tcg-sve.h" #include "exec/gdbstub.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target/arm/tcg/helper.c +0 -87
90 lines not on this page · raw message
target/arm/tcg/tcg-sve.c +86 -0
95 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH v16 80/99] target/arm: tcg-sve: import narrow_vq and change_el functions
Quoted 79 lines · Alex Bennée
From: Claudio Fontana <[email protected]>
aarch64_sve_narrow_vqandaarch64_sve_change_elare SVE-related functions only used for TCG, so we can put them in thetcg-sve.cmodule.Signed-off-by Claudio Fontana <[email protected]>Reviewed-by Richard Henderson <[email protected]>Signed-off-by Alex Bennée <[email protected]>--- target/arm/cpu.h | 7 --- target/arm/tcg/tcg-sve.h | 5 ++ linux-user/syscall.c | 4 ++ target/arm/cpu-exceptions-aa64.c | 1 + target/arm/tcg/cpregs.c | 4 ++ target/arm/tcg/helper-a64.c | 1 + target/arm/tcg/helper.c | 87 -------------------------------- target/arm/tcg/tcg-sve.c | 86 +++++++++++++++++++++++++++++++ 8 files changed, 101 insertions(+), 94 deletions(-)target/arm/cpu.h +0
-7@@ -1056,9 +1056,6 @@ int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,#ifdef TARGET_AARCH64 int aarch64_cpu_gdb_read_register (CPUState *cpu,GByteArray *buf,int reg);int aarch64_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq); -void aarch64_sve_change_el (CPUARMState *env,int old_el, -int new_el,bool el0_a64);static inline bool is_a64 (CPUARMState *env) {@@ -1090,10 +1087,6 @@ static inline uint64_t *sve_bswap64(uint64_t *dst, uint64_t *src, int nr) }#else -static inline void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq) { } -static inline void aarch64_sve_change_el (CPUARMState *env,int o, -int n,bool a) -{ }#define is_a64 (env) ((void)env, false)target/arm/tcg/tcg-sve.h +5
-0@@ -21,4 +21,9 @@ uint32_t tcg_sve_disable_lens(unsigned long *sve_vq_map,bool tcg_sve_validate_lens (unsigned long *sve_vq_map,uint32_t max_vq,Error **errp); +void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq); + +void aarch64_sve_change_el (CPUARMState *env,int old_el, +int new_el,bool el0_a64); +#endif /* TCG_SVE_H */ linux-user/syscall.c +4
-0@@ -134,6 +134,10 @@#include "fd-trans.h" #include "tcg/tcg.h" +#ifdef TARGET_AARCH64 +#include "tcg/tcg-sve.h" +#endif /* TARGET_AARCH64 */ +#ifndef CLONE_IO #define CLONE_IO 0x80000000/* Clone io context */ #endif target/arm/cpu-exceptions-aa64.c +0
-0
target/arm/cpu-exceptions-aa64.c line 26
Quoted 6 lines
target/arm/cpu-exceptions-aa64.c +1
-0@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" +#include "tcg/tcg-sve.h" #include "internals.h" #include "sysemu/tcg.h"
Ok, sure.
target/arm/tcg/cpregs.c line 21
Quoted 12 lines
target/arm/tcg/cpregs.c +3
-0@@ -16,6 +16,10 @@#include "cpu-mmu.h" #include "cpregs.h" +#ifdef TARGET_AARCH64 +#include "tcg/tcg-sve.h" +#endif /* TARGET_AARCH64 */
Don't like the ifdef here. If in the previous patch we had moved zcr to cpregs-a64.c, it certainly wouldn't be required.
target/arm/tcg/tcg-sve.c line 27
Quoted 9 lines
target/arm/tcg/tcg-sve.c +1
-0@@ -24,6 +24,7 @@#include "sysemu/tcg.h" #include "cpu-sve.h" #include "tcg-sve.h" +#include "cpu-exceptions-aa64.h"
Unnecessary.
r~
PATCH v16 81/99 target/arm: tcg-sve: rename the narrow_vq and change_el functions
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
make them canonical for the module name.
--- target/arm/tcg/tcg-sve.h | 6 +++--- linux-user/syscall.c | 2 +- target/arm/cpu-exceptions-aa64.c | 2 +- target/arm/tcg/cpregs.c | 2 +- target/arm/tcg/helper-a64.c | 2 +- target/arm/tcg/tcg-sve.c | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-)
target/arm/tcg/tcg-sve.h +3 -3
@@ -21,9 +21,9 @@ uint32_t tcg_sve_disable_lens(unsigned long *sve_vq_map,bool tcg_sve_validate_lens (unsigned long *sve_vq_map,uint32_t max_vq,Error **errp); -void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq); +void tcg_sve_narrow_vq (CPUARMState *env,unsigned vq); -void aarch64_sve_change_el (CPUARMState *env,int old_el, -int new_el,bool el0_a64); +void tcg_sve_change_el (CPUARMState *env,int old_el, +int new_el,bool el0_a64);#endif /* TCG_SVE_H */
linux-user/syscall.c +1 -1
@@ -10877,7 +10877,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, vq =MIN (vq, cpu->sve_max_vq);if (vq < old_vq) { -aarch64_sve_narrow_vq (env, vq); +tcg_sve_narrow_vq (env, vq); } env->vfp.zcr_el[1 ] = vq -1 ;arm_rebuild_hflags (env);
target/arm/cpu-exceptions-aa64.c +1 -1
@@ -119,7 +119,7 @@ void arm_cpu_do_interrupt_aarch64(CPUState *cs)* Note that new_el can never be 0. If cur_el is 0, then * el0_a64 is is_a64(), else el0_a64 is ignored. */ -aarch64_sve_change_el (env, cur_el, new_el,is_a64 (env)); +tcg_sve_change_el (env, cur_el, new_el,is_a64 (env)); }if (cur_el < new_el) {
target/arm/tcg/cpregs.c +1 -1
@@ -5814,7 +5814,7 @@ static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri,*/ new_len =sve_zcr_len_for_el (env, cur_el);if (new_len < old_len) { -aarch64_sve_narrow_vq (env, new_len +1 ); +tcg_sve_narrow_vq (env, new_len +1 ); } }
target/arm/tcg/helper-a64.c +1 -1
@@ -1042,7 +1042,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)* Note that cur_el can never be 0. If new_el is 0, then * el0_a64 is return_to_aa64, else el0_a64 is ignored. */ -aarch64_sve_change_el (env, cur_el, new_el, return_to_aa64); +tcg_sve_change_el (env, cur_el, new_el, return_to_aa64);qemu_mutex_lock_iothread ();arm_call_el_change_hook (env_archcpu (env));
target/arm/tcg/tcg-sve.c +3 -3
@@ -95,7 +95,7 @@ bool tcg_sve_validate_lens(unsigned long *sve_vq_map, uint32_t max_vq,* may well be cheaper than conditionals to restrict the operation * to the relevant portion of a uint16_t[16]. */ -void aarch64_sve_narrow_vq (CPUARMState *env,unsigned vq) +void tcg_sve_narrow_vq (CPUARMState *env,unsigned vq) {int i, j;uint64_t pmask;
@@ -124,7 +124,7 @@ void aarch64_sve_narrow_vq(CPUARMState *env, unsigned vq)/* * Notice a change in SVE vector size when changing EL. */ -void aarch64_sve_change_el (CPUARMState *env,int old_el, +void tcg_sve_change_el (CPUARMState *env,int old_el,int new_el,bool el0_a64) {ARMCPU *cpu =env_archcpu (env);
@@ -162,6 +162,6 @@ void aarch64_sve_change_el(CPUARMState *env, int old_el,/* When changing vector length, clear inaccessible state. */ if (new_len < old_len) { -aarch64_sve_narrow_vq (env, new_len +1 ); +tcg_sve_narrow_vq (env, new_len +1 ); } }
Signature · 1 line
2.20.1
PATCH v16 82/99 target/arm: move sve_zcr_len_for_el to TARGET_AARCH64-only cpu-sve
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
now that we handled the dependency between HELPER(), cpregs defs and functions in tcg/,
we can make sve_zcr_len_for_el TARGET_AARCH64-only, and move it to the cpu-sve module.
--- target/arm/cpu-sve.h | 3 +++ target/arm/cpu.h | 4 ++-- target/arm/arch_dump.c | 1 + target/arm/cpu-common.c | 43 ----------------------------------------- target/arm/cpu-sve.c | 33 +++++++++++++++++++++++++++++++ target/arm/cpu.c | 4 ++++ target/arm/tcg/cpregs.c | 1 + target/arm/tcg/helper.c | 4 ++++ 8 files changed, 48 insertions(+), 45 deletions(-)
target/arm/cpu-sve.h +3 -0
@@ -34,4 +34,7 @@ void cpu_sve_add_props(Object *obj);/* add the CPU SVE properties specific to the "MAX" CPU */ void cpu_sve_add_props_max (Object *obj); +/* return the vector length for EL */ +uint32_t sve_zcr_len_for_el (CPUARMState *env,int el); +#endif /* CPU_SVE_H */
target/arm/cpu.h +2 -2
@@ -223,7 +223,8 @@ typedef struct ARMPACKey { } ARMPACKey;#else static inline void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { } -#endif + +#endif /* TARGET_AARCH64 */ /* See the commentary above the TBFLAG field definitions. */ typedef struct CPUARMTBFlags {
@@ -1097,7 +1098,6 @@ void aarch64_sync_64_to_32(CPUARMState *env);int fp_exception_el (CPUARMState *env,int cur_el);int sve_exception_el (CPUARMState *env,int cur_el); -uint32_t sve_zcr_len_for_el (CPUARMState *env,int el);/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero
target/arm/arch_dump.c +1 -0
@@ -24,6 +24,7 @@#include "sysemu/dump.h" #ifdef TARGET_AARCH64 +#include "cpu-sve.h" /* struct user_pt_regs from arch/arm64/include/uapi/asm/ptrace.h */ struct aarch64_user_regs {
target/arm/cpu-common.c +0 -43
49 lines not on this page · raw message
target/arm/cpu-sve.c +33 -0
@@ -288,3 +288,36 @@ void cpu_sve_add_props_max(Object *obj) {object_property_add (obj,"sve-max-vq" ,"uint32" , get_prop_max_vq, set_prop_max_vq,NULL ,NULL ); } + +static uint32_t sve_zcr_get_valid_len (ARMCPU *cpu,uint32_t start_len) +{ +uint32_t end_len; + + end_len = start_len &=0xf ; +if (!test_bit (start_len, cpu->sve_vq_map)) { + end_len =find_last_bit (cpu->sve_vq_map, start_len); +assert (end_len < start_len); + } +return end_len; +} + +/* +* Given that SVE is enabled, return the vector length for EL. +*/ +uint32_t sve_zcr_len_for_el (CPUARMState *env,int el) +{ +ARMCPU *cpu =env_archcpu (env); +uint32_t zcr_len = cpu->sve_max_vq -1 ; + +if (el <=1 ) { + zcr_len =MIN (zcr_len,0xf & (uint32_t )env->vfp.zcr_el[1 ]); + } +if (el <=2 &&arm_feature (env,ARM_FEATURE_EL2 )) { + zcr_len =MIN (zcr_len,0xf & (uint32_t )env->vfp.zcr_el[2 ]); + } +if (arm_feature (env,ARM_FEATURE_EL3 )) { + zcr_len =MIN (zcr_len,0xf & (uint32_t )env->vfp.zcr_el[3 ]); + } + +return sve_zcr_get_valid_len (cpu, zcr_len); +}
target/arm/cpu.c +4 -0
@@ -23,7 +23,11 @@#include "target/arm/idau.h" #include "qapi/error.h" #include "cpu.h" + +#ifdef TARGET_AARCH64 #include "cpu-sve.h" +#endif /* TARGET_AARCH64 */ +#include "cpregs.h" #ifdef CONFIG_TCG
target/arm/tcg/cpregs.c +1 -0
@@ -17,6 +17,7 @@#include "cpregs.h" #ifdef TARGET_AARCH64 +#include "cpu-sve.h" #include "tcg/tcg-sve.h" #endif /* TARGET_AARCH64 */
target/arm/tcg/helper.c +4 -0
@@ -18,6 +18,10 @@#include "cpregs.h" #include "tcg-cpu.h" +#ifdef TARGET_AARCH64 +#include "cpu-sve.h" +#endif /* TARGET_AARCH64 */ +static int vfp_gdb_get_reg (CPUARMState *env,GByteArray *buf,int reg) {ARMCPU *cpu =env_archcpu (env);
Signature · 1 line
2.20.1
Re: [PATCH v16 82/99] target/arm: move sve_zcr_len_for_el to TARGET_AARCH64-only cpu-sve
Quoted 5 lines · Alex Bennée
target/arm/cpu.h +0
-0
target/arm/cpu.h typedef struct ARMPACKey { · line 230
Quoted 9 lines
target/arm/cpu.h +2
-1@@ -223,7 +223,8 @@ typedef struct ARMPACKey { } ARMPACKey;#else static inline void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { } -#endif + +#endif /* TARGET_AARCH64 */ /* See the commentary above the TBFLAG field definitions. */ typedef struct CPUARMTBFlags {
Unrelated change.
target/arm/cpu.c line 30
Quoted 13 lines
target/arm/cpu.c +4
-0@@ -23,7 +23,11 @@#include "target/arm/idau.h" #include "qapi/error.h" #include "cpu.h" + +#ifdef TARGET_AARCH64 #include "cpu-sve.h" +#endif /* TARGET_AARCH64 */ +
Unrelated change and unnecessary.
target/arm/tcg/helper.c line 23
Quoted 11 lines
target/arm/tcg/helper.c +3
-0@@ -18,6 +18,10 @@#include "cpregs.h" #include "tcg-cpu.h" +#ifdef TARGET_AARCH64 +#include "cpu-sve.h" +#endif /* TARGET_AARCH64 */
Are the ifdefs really necessary?
r~
PATCH v16 83/99 cpu-sve: rename sve_zcr_len_for_el to cpu_sve_get_zcr_len_for_el
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
use a canonical module prefix followed by the get_zcr_len_for_el() method name. Also rename the static internal auxiliary function, where the module prefix is not necessary.
--- target/arm/cpu-sve.h | 2 +- target/arm/arch_dump.c | 2 +- target/arm/cpu-sve.c | 6 +++--- target/arm/cpu64.c | 2 +- target/arm/tcg/cpregs.c | 4 ++-- target/arm/tcg/helper.c | 4 ++-- target/arm/tcg/tcg-sve.c | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-)
target/arm/cpu-sve.h +1 -1
@@ -35,6 +35,6 @@ void cpu_sve_add_props(Object *obj);void cpu_sve_add_props_max (Object *obj);/* return the vector length for EL */ -uint32_t sve_zcr_len_for_el (CPUARMState *env,int el); +uint32_t cpu_sve_get_zcr_len_for_el (CPUARMState *env,int el);#endif /* CPU_SVE_H */
target/arm/arch_dump.c +1 -1
@@ -168,7 +168,7 @@ static off_t sve_fpcr_offset(uint32_t vq)static uint32_t sve_current_vq (CPUARMState *env) { -return sve_zcr_len_for_el (env,arm_current_el (env)) +1 ; +return cpu_sve_get_zcr_len_for_el (env,arm_current_el (env)) +1 ; }static size_t sve_size_vq (uint32_t vq)
target/arm/cpu-sve.c +3 -3
@@ -289,7 +289,7 @@ void cpu_sve_add_props_max(Object *obj)object_property_add (obj,"sve-max-vq" ,"uint32" , get_prop_max_vq, set_prop_max_vq,NULL ,NULL ); } -static uint32_t sve_zcr_get_valid_len (ARMCPU *cpu,uint32_t start_len) +static uint32_t get_valid_len (ARMCPU *cpu,uint32_t start_len) {uint32_t end_len;
@@ -304,7 +304,7 @@ static uint32_t sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len)/* * Given that SVE is enabled, return the vector length for EL. */ -uint32_t sve_zcr_len_for_el (CPUARMState *env,int el) +uint32_t cpu_sve_get_zcr_len_for_el (CPUARMState *env,int el) {ARMCPU *cpu =env_archcpu (env);uint32_t zcr_len = cpu->sve_max_vq -1 ;
@@ -319,5 +319,5 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) zcr_len =MIN (zcr_len,0xf & (uint32_t )env->vfp.zcr_el[3 ]); } -return sve_zcr_get_valid_len (cpu, zcr_len); +return get_valid_len (cpu, zcr_len); }
target/arm/cpu64.c +1 -1
@@ -549,7 +549,7 @@ static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) vfp_get_fpcr(env), vfp_get_fpsr(env));if (cpu_isar_feature (aa64_sve, cpu) &&sve_exception_el (env, el) ==0 ) { -int j, zcr_len =sve_zcr_len_for_el (env, el); +int j, zcr_len =cpu_sve_get_zcr_len_for_el (env, el);for (i =0 ; i <=FFR_PRED_NUM ; i++) {bool eol;
target/arm/tcg/cpregs.c +2 -2
@@ -5802,7 +5802,7 @@ static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) {int cur_el =arm_current_el (env); -int old_len =sve_zcr_len_for_el (env, cur_el); +int old_len =cpu_sve_get_zcr_len_for_el (env, cur_el);int new_len;/* Bits other than [3:0] are RAZ/WI. */
@@ -5813,7 +5813,7 @@ static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri,* Because we arrived here, we know both FP and SVE are enabled; * otherwise we would have trapped access to the ZCR_ELn register. */ - new_len =sve_zcr_len_for_el (env, cur_el); + new_len =cpu_sve_get_zcr_len_for_el (env, cur_el);if (new_len < old_len) {tcg_sve_narrow_vq (env, new_len +1 ); }
target/arm/tcg/helper.c +2 -2
@@ -186,7 +186,7 @@ static int arm_gdb_get_svereg(CPUARMState *env, GByteArray *buf, int reg)* We report in Vector Granules (VG) which is 64bit in a Z reg * while the ZCR works in Vector Quads (VQ) which is 128bit chunks. */ -int vq =sve_zcr_len_for_el (env,arm_current_el (env)) +1 ; +int vq =cpu_sve_get_zcr_len_for_el (env,arm_current_el (env)) +1 ;return gdb_get_reg64 (buf, vq *2 ); }default :
@@ -1034,7 +1034,7 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el,if (sve_el !=0 && fp_el ==0 ) { zcr_len =0 ; }else { - zcr_len =sve_zcr_len_for_el (env, el); + zcr_len =cpu_sve_get_zcr_len_for_el (env, el); }DP_TBFLAG_A64 (flags,SVEEXC_EL , sve_el);DP_TBFLAG_A64 (flags,ZCR_LEN , zcr_len);
target/arm/tcg/tcg-sve.c +2 -2
@@ -155,10 +155,10 @@ void tcg_sve_change_el(CPUARMState *env, int old_el,*/ old_a64 = old_el ?arm_el_is_aa64 (env, old_el) : el0_a64; old_len = (old_a64 && !sve_exception_el (env, old_el) - ?sve_zcr_len_for_el (env, old_el) :0 ); + ?cpu_sve_get_zcr_len_for_el (env, old_el) :0 ); new_a64 = new_el ?arm_el_is_aa64 (env, new_el) : el0_a64; new_len = (new_a64 && !sve_exception_el (env, new_el) - ?sve_zcr_len_for_el (env, new_el) :0 ); + ?cpu_sve_get_zcr_len_for_el (env, new_el) :0 );/* When changing vector length, clear inaccessible state. */ if (new_len < old_len) {
Signature · 1 line
2.20.1
PATCH v16 84/99 target/arm: cpu-common: wrap a64-only check with is_a64
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
now that is_a64() is just always false when !TARGET_AARCH64, we can just use that instead of introducing a new ifdef.
--- target/arm/cpu-common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
target/arm/cpu-common.c +7 -3
@@ -305,9 +305,13 @@ uint64_t arm_sctlr(CPUARMState *env, int el) {/* Only EL0 needs to be adjusted for EL1&0 or EL2&0. */ if (el ==0 ) { -ARMMMUIdx mmu_idx =arm_mmu_idx_el (env,0 ); - el = (mmu_idx == ARMMMUIdx_E20_0 || mmu_idx == ARMMMUIdx_SE20_0) - ?2 :1 ; +if (is_a64 (env)) { +ARMMMUIdx mmu_idx =arm_mmu_idx_el (env,0 ); + el = (mmu_idx == ARMMMUIdx_E20_0 || mmu_idx == ARMMMUIdx_SE20_0) + ?2 :1 ; + }else { + el =1 ; + } }return env->cp15.sctlr_el[el]; }
Signature · 1 line
2.20.1
Re: [PATCH v16 84/99] target/arm: cpu-common: wrap a64-only check with is_a64
Quoted 10 lines · Alex Bennée
From: Claudio Fontana<[email protected]>
now that
is_a64()is just always false when !TARGET_AARCH64, we can just use that instead of introducing a new ifdef.Signed-off-by Claudio Fontana<[email protected]>Signed-off-by Alex Bennée<[email protected]>--- target/arm/cpu-common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Ok, I guess.
r~
PATCH v16 85/99 target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
Pointer Authentication is an AARCH64-only ARMv8.3 optional extension, whose cpu properties can be separated out in its own module.
--- target/arm/cpu.h | 3 -- target/arm/tcg/cpu-pauth.h | 34 ++++++++++++++++++++ target/arm/cpu.c | 1 + target/arm/cpu64.c | 35 ++------------------- target/arm/tcg/cpu-pauth.c | 63 ++++++++++++++++++++++++++++++++++++++ target/arm/tcg/meson.build | 1 + 6 files changed, 101 insertions(+), 36 deletions(-) create mode 100644 target/arm/tcg/cpu-pauth.h create mode 100644 target/arm/tcg/cpu-pauth.c
target/arm/cpu.h +0 -3
@@ -216,13 +216,10 @@ typedef struct ARMPredicateReg { uint64_t p[DIV_ROUND_UP(2 * ARM_MAX_VQ, 8)] QEMU_ALIGNED(16); } ARMPredicateReg; -void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp);/* In AArch32 mode, PAC keys do not exist at all. */ typedef struct ARMPACKey {uint64_t lo, hi; }ARMPACKey ; -#else -static inline void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { }#endif /* TARGET_AARCH64 */
target/arm/tcg/cpu-pauth.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* QEMU AArch64 Pointer Authentication Extensions +* +* Copyright (c) 2013 Linaro Ltd +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see +* <http://www.gnu.org/licenses/gpl-2.0.html> +*/ + +#ifndef CPU_PAUTH_H +#define CPU_PAUTH_H + +/* ARMv8.3 pauth is an AARCH64 option, only include this for TARGET_AARCH64 */ + +#include "cpu.h" + +/* called by arm_cpu_finalize_features in realizefn */ +void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp); + +/* add the CPU Pointer Authentication properties */ +void cpu_pauth_add_props (Object *obj); + +#endif /* CPU_PAUTH_H */
target/arm/cpu.c +1 -0
@@ -33,6 +33,7 @@#ifdef CONFIG_TCG #include "tcg/tcg-cpu.h" #endif /* CONFIG_TCG */ +#include "tcg/cpu-pauth.h" #include "cpu32.h" #include "exec/exec-all.h" #include "hw/qdev-properties.h"
target/arm/cpu64.c +2 -33
@@ -24,6 +24,7 @@#include "cpu.h" #include "cpu32.h" #include "cpu-sve.h" +#include "tcg/cpu-pauth.h" #include "qemu/module.h" #include "sysemu/tcg.h" #include "sysemu/kvm.h"
@@ -246,36 +247,6 @@ static void aarch64_a72_initfn(Object *obj)define_arm_cp_regs (cpu, cortex_a72_a57_a53_cp_reginfo); } -void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) -{ -int arch_val =0 , impdef_val =0 ; -uint64_t t; - -/* TODO: Handle HaveEnhancedPAC, HaveEnhancedPAC2, HaveFPAC. */ -if (cpu->prop_pauth) { -if (cpu->prop_pauth_impdef) { - impdef_val =1 ; - }else { - arch_val =1 ; - } - }else if (cpu->prop_pauth_impdef) { -error_setg (errp,"cannot enable pauth-impdef without pauth" ); -error_append_hint (errp,"Add pauth=on to the CPU property list.\n" ); - } - - t = cpu->isar.id_aa64isar1; - t =FIELD_DP64 (t,ID_AA64ISAR1 ,APA , arch_val); - t =FIELD_DP64 (t,ID_AA64ISAR1 ,GPA , arch_val); - t =FIELD_DP64 (t,ID_AA64ISAR1 ,API , impdef_val); - t =FIELD_DP64 (t,ID_AA64ISAR1 ,GPI , impdef_val); - cpu->isar.id_aa64isar1 = t; -} - -static Property arm_cpu_pauth_property = -DEFINE_PROP_BOOL ("pauth" ,ARMCPU , prop_pauth, true); -static Property arm_cpu_pauth_impdef_property = -DEFINE_PROP_BOOL ("pauth-impdef" ,ARMCPU , prop_pauth_impdef, false); -/* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); * otherwise, a CPU with as many features enabled as our emulation supports. * The version of '-cpu max' for qemu-system-arm is defined in cpu.c;
@@ -447,9 +418,7 @@ static void aarch64_max_initfn(Object *obj) cpu->dcz_blocksize =7 ;/* 512 bytes */ #endif -/* Default to PAUTH on, with the architected algorithm. */ -qdev_property_add_static (DEVICE (obj), &arm_cpu_pauth_property); -qdev_property_add_static (DEVICE (obj), &arm_cpu_pauth_impdef_property); +cpu_pauth_add_props (obj); }cpu_sve_add_props (obj);
target/arm/tcg/cpu-pauth.c new file +63 -0
63 lines not on this page · raw message
target/arm/tcg/meson.build +1 -0
@@ -39,6 +39,7 @@ arm_ss.add(when: 'CONFIG_TCG', if_true: files( )) arm_ss.add(when: ['TARGET_AARCH64','CONFIG_TCG'], if_true: files( + 'cpu-pauth.c', 'translate-a64.c', 'translate-sve.c', 'helper-a64.c',
Signature · 1 line
2.20.1
Re: [PATCH v16 85/99] target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication
Quoted 66 lines · Alex Bennée
From: Claudio Fontana <[email protected]>
Pointer Authentication is an AARCH64-only ARMv8.3 optional extension, whose cpu properties can be separated out in its own module.
Signed-off-by Claudio Fontana <[email protected]>Signed-off-by Alex Bennée <[email protected]>--- target/arm/cpu.h | 3 -- target/arm/tcg/cpu-pauth.h | 34 ++++++++++++++++++++ target/arm/cpu.c | 1 + target/arm/cpu64.c | 35 ++------------------- target/arm/tcg/cpu-pauth.c | 63 ++++++++++++++++++++++++++++++++++++++ target/arm/tcg/meson.build | 1 + 6 files changed, 101 insertions(+), 36 deletions(-)create mode 100644
target/arm/tcg/cpu-pauth.h
create mode 100644target/arm/tcg/cpu-pauth.ctarget/arm/cpu.h +0
-3@@ -216,13 +216,10 @@ typedef struct ARMPredicateReg { uint64_t p[DIV_ROUND_UP(2 * ARM_MAX_VQ, 8)] QEMU_ALIGNED(16); } ARMPredicateReg; -void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp);/* In AArch32 mode, PAC keys do not exist at all. */ typedef struct ARMPACKey {uint64_t lo, hi; }ARMPACKey ; -#else -static inline void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { }#endif /* TARGET_AARCH64 */ target/arm/tcg/cpu-pauth.h new file +24
-0@@ -0,0 +1,34 @@ +/* +* QEMU AArch64 Pointer Authentication Extensions +* +* Copyright (c) 2013 Linaro Ltd +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see +* <http://www.gnu.org/licenses/gpl-2.0.html> +*/ + +#ifndef CPU_PAUTH_H +#define CPU_PAUTH_H + +/* ARMv8.3 pauth is an AARCH64 option, only include this for TARGET_AARCH64 */
target/arm/tcg/cpu-pauth.h line 34
Quoted 10 lines
target/arm/tcg/cpu-pauth.h new file +10
-0+ +#include "cpu.h" + +/* called by arm_cpu_finalize_features in realizefn */ +void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp); + +/* add the CPU Pointer Authentication properties */ +void cpu_pauth_add_props (Object *obj); + +#endif /* CPU_PAUTH_H */
Similar comments re "cpu.h" and the proliferation of headers. Otherwise,
r~
PATCH v16 86/99 target/arm: cpu-pauth: change arm_cpu_pauth_finalize name and sig
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
make arm_cpu_pauth_finalize return a bool,
and make the name canonical for the module (cpu_pauth_finalize).
--- target/arm/tcg/cpu-pauth.h | 2 +- target/arm/cpu.c | 3 +-- target/arm/tcg/cpu-pauth.c | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-)
target/arm/tcg/cpu-pauth.h +1 -1
@@ -26,7 +26,7 @@#include "cpu.h" /* called by arm_cpu_finalize_features in realizefn */ -void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp); +bool cpu_pauth_finalize (ARMCPU *cpu,Error **errp);/* add the CPU Pointer Authentication properties */ void cpu_pauth_add_props (Object *obj);
target/arm/cpu.c +1 -2
@@ -837,8 +837,7 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp)* is in use, so the user will not be able to set them. */ if (tcg_enabled ()) { -arm_cpu_pauth_finalize (cpu, &local_err); -if (local_err !=NULL ) { +if (!cpu_pauth_finalize (cpu, &local_err)) {error_propagate (errp, local_err);return ; }
target/arm/tcg/cpu-pauth.c +4 -1
@@ -25,8 +25,9 @@#include "tcg/cpu-pauth.h" #include "hw/qdev-properties.h" -void arm_cpu_pauth_finalize (ARMCPU *cpu,Error **errp) +bool cpu_pauth_finalize (ARMCPU *cpu,Error **errp) { +bool result = true;int arch_val =0 , impdef_val =0 ;uint64_t t;
@@ -40,6 +41,7 @@ void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) }else if (cpu->prop_pauth_impdef) {error_setg (errp,"cannot enable pauth-impdef without pauth" );error_append_hint (errp,"Add pauth=on to the CPU property list.\n" ); + result = false; } t = cpu->isar.id_aa64isar1;
@@ -48,6 +50,7 @@ void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) t =FIELD_DP64 (t,ID_AA64ISAR1 ,API , impdef_val); t =FIELD_DP64 (t,ID_AA64ISAR1 ,GPI , impdef_val); cpu->isar.id_aa64isar1 = t; +return result; } static Property arm_cpu_pauth_property =
Signature · 1 line
2.20.1
Re: [PATCH v16 86/99] target/arm: cpu-pauth: change arm_cpu_pauth_finalize name and sig
Quoted 5 lines · Alex Bennée
From: Claudio Fontana<[email protected]>
make
arm_cpu_pauth_finalizereturn a bool,
and make the name canonical for the module (cpu_pauth_finalize).
Quoted 7 lines
Signed-off-by Claudio Fontana<[email protected]>Signed-off-by Alex Bennée<[email protected]>--- target/arm/tcg/cpu-pauth.h | 2 +- target/arm/cpu.c | 3 +-- target/arm/tcg/cpu-pauth.c | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-)
r~
PATCH v16 87/99 target/arm: move arm_cpu_finalize_features into cpu64
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
all the features in arm_cpu_finalize_features are actually TARGET_AARCH64-only now, since KVM is now only supported on 64bit.
Therefore move the function to cpu64.
--- target/arm/cpu.c | 36 ++---------------------------------- target/arm/cpu64.c | 34 ++++++++++++++++++++++++++++++++++ target/arm/monitor.c | 4 ++++ 3 files changed, 40 insertions(+), 34 deletions(-)
target/arm/cpu.c +2 -34
@@ -820,40 +820,6 @@ static void arm_cpu_finalizefn(Object *obj)#endif } -void arm_cpu_finalize_features (ARMCPU *cpu,Error **errp) -{ -Error *local_err =NULL ; - -#ifdef TARGET_AARCH64 -if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -if (!cpu_sve_finalize_features (cpu, &local_err)) { -error_propagate (errp, local_err); -return ; - } - -/* -* KVM does not support modifications to this feature. -* We have not registered the cpu properties when KVM -* is in use, so the user will not be able to set them. -*/ -if (tcg_enabled ()) { -if (!cpu_pauth_finalize (cpu, &local_err)) { -error_propagate (errp, local_err); -return ; - } - } - } -#endif /* TARGET_AARCH64 */ - -if (kvm_enabled ()) { -kvm_arm_steal_time_finalize (cpu, &local_err); -if (local_err !=NULL ) { -error_propagate (errp, local_err); -return ; - } - } -} -static void arm_cpu_realizefn (DeviceState *dev,Error **errp) {CPUState *cs =CPU (dev);
@@ -876,6 +842,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)return ; } +#ifdef TARGET_AARCH64 arm_cpu_finalize_features (cpu, &local_err);if (local_err !=NULL ) {error_propagate (errp, local_err);
@@ -892,6 +859,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) "AArch64 CPUs must have both VFP and Neon or neither"); return; } +#endif /* TARGET_AARCH64 */ if (!cpu->has_vfp) {uint64_t t;
target/arm/cpu64.c +34 -0
@@ -469,6 +469,40 @@ static gchar *aarch64_gdb_arch_name(CPUState *cs)return g_strdup ("aarch64" ); } +void arm_cpu_finalize_features (ARMCPU *cpu,Error **errp) +{ +Error *local_err =NULL ; + +#ifdef TARGET_AARCH64 +if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { +if (!cpu_sve_finalize_features (cpu, &local_err)) { +error_propagate (errp, local_err); +return ; + } + +/* +* KVM does not support modifications to this feature. +* We have not registered the cpu properties when KVM +* is in use, so the user will not be able to set them. +*/ +if (tcg_enabled ()) { +if (!cpu_pauth_finalize (cpu, &local_err)) { +error_propagate (errp, local_err); +return ; + } + } + } +#endif /* TARGET_AARCH64 */ + +if (kvm_enabled ()) { +kvm_arm_steal_time_finalize (cpu, &local_err); +if (local_err !=NULL ) { +error_propagate (errp, local_err); +return ; + } + } +} +static void aarch64_cpu_dump_state (CPUState *cs,FILE *f,int flags) {ARMCPU *cpu =ARM_CPU (cs);
target/arm/monitor.c +4 -0
@@ -184,9 +184,11 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,if (!err) {visit_check_struct (visitor, &err); } +#ifdef TARGET_AARCH64 if (!err) {arm_cpu_finalize_features (ARM_CPU (obj), &err); } +#endif /* TARGET_AARCH64 */ visit_end_struct (visitor,NULL );visit_free (visitor);if (err) {
@@ -195,7 +197,9 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,return NULL ; } }else { +#ifdef TARGET_AARCH64 arm_cpu_finalize_features (ARM_CPU (obj), &error_abort); +#endif /* TARGET_AARCH64 */ } expansion_info =g_new0 (CpuModelExpansionInfo,1 );
Signature · 1 line
2.20.1
Re: [PATCH v16 87/99] target/arm: move arm_cpu_finalize_features into cpu64
Quoted 22 lines · Alex Bennée
target/arm/cpu64.c +14
-0@@ -469,6 +469,40 @@ static gchar *aarch64_gdb_arch_name(CPUState *cs)return g_strdup ("aarch64" ); } +void arm_cpu_finalize_features (ARMCPU *cpu,Error **errp) +{ +Error *local_err =NULL ; + +#ifdef TARGET_AARCH64 +if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { +if (!cpu_sve_finalize_features (cpu, &local_err)) { +error_propagate (errp, local_err); +return ; + } + +/* +* KVM does not support modifications to this feature. +* We have not registered the cpu properties when KVM
target/arm/cpu64.c static gchar *aarch64_gdb_arch_name(CPUState *cs) · line 495
Quoted 10 lines
target/arm/cpu64.c +10
-0+* is in use, so the user will not be able to set them. +*/ +if (tcg_enabled ()) { +if (!cpu_pauth_finalize (cpu, &local_err)) { +error_propagate (errp, local_err); +return ; + } + } + } +#endif /* TARGET_AARCH64 */
These ifdefs are useless.
Quoted 17 lines
target/arm/monitor.c +2
-0@@ -184,9 +184,11 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,if (!err) {visit_check_struct (visitor, &err); } +#ifdef TARGET_AARCH64 if (!err) {arm_cpu_finalize_features (ARM_CPU (obj), &err); } +#endif /* TARGET_AARCH64 */ visit_end_struct (visitor,NULL );visit_free (visitor);if (err) {
target/arm/monitor.c CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, · line 202
Quoted 6 lines
target/arm/monitor.c +2
-0@@ -195,7 +197,9 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,return NULL ; } }else { +#ifdef TARGET_AARCH64 arm_cpu_finalize_features (ARM_CPU (obj), &error_abort); +#endif /* TARGET_AARCH64 */
Not keen on all of the extra ifdefs here.
r~
PATCH v16 88/99 target/arm: cpu64: rename arm_cpu_finalize_features
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
also remove the now useless ifdef TARGET_AARCH64 from the function
--- target/arm/cpu-sve.h | 2 +- target/arm/cpu.h | 2 +- target/arm/tcg/cpu-pauth.h | 2 +- target/arm/cpu.c | 2 +- target/arm/cpu64.c | 4 +--- target/arm/monitor.c | 4 ++-- 6 files changed, 7 insertions(+), 9 deletions(-)
target/arm/cpu-sve.h +1 -1
@@ -25,7 +25,7 @@#include "cpu.h" -/* called by arm_cpu_finalize_features in realizefn */ +/* called by aarch64_cpu_finalize_features in realizefn */ bool cpu_sve_finalize_features (ARMCPU *cpu,Error **errp);/* add the CPU SVE properties */
target/arm/cpu.h +1 -1
@@ -2127,7 +2127,7 @@ static inline int arm_feature(CPUARMState *env, int feature)return (env->features & (1ULL << feature)) !=0 ; } -void arm_cpu_finalize_features (ARMCPU *cpu,Error **errp); +void aarch64_cpu_finalize_features (ARMCPU *cpu,Error **errp);#if !defined(CONFIG_USER_ONLY )/* Return true if exception levels below EL3 are in secure state,
target/arm/tcg/cpu-pauth.h +1 -1
@@ -25,7 +25,7 @@#include "cpu.h" -/* called by arm_cpu_finalize_features in realizefn */ +/* called by aarch64_cpu_finalize_features in realizefn */ bool cpu_pauth_finalize (ARMCPU *cpu,Error **errp);/* add the CPU Pointer Authentication properties */
target/arm/cpu.c +1 -1
@@ -843,7 +843,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) }#ifdef TARGET_AARCH64 -arm_cpu_finalize_features (cpu, &local_err); +aarch64_cpu_finalize_features (cpu, &local_err);if (local_err !=NULL ) {error_propagate (errp, local_err);return ;
target/arm/cpu64.c +1 -3
@@ -469,11 +469,10 @@ static gchar *aarch64_gdb_arch_name(CPUState *cs)return g_strdup ("aarch64" ); } -void arm_cpu_finalize_features (ARMCPU *cpu,Error **errp) +void aarch64_cpu_finalize_features (ARMCPU *cpu,Error **errp) {Error *local_err =NULL ; -#ifdef TARGET_AARCH64 if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) {if (!cpu_sve_finalize_features (cpu, &local_err)) {error_propagate (errp, local_err);
@@ -492,7 +491,6 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) } } } -#endif /* TARGET_AARCH64 */ if (kvm_enabled ()) {kvm_arm_steal_time_finalize (cpu, &local_err);
target/arm/monitor.c +2 -2
@@ -186,7 +186,7 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, }#ifdef TARGET_AARCH64 if (!err) { -arm_cpu_finalize_features (ARM_CPU (obj), &err); +aarch64_cpu_finalize_features (ARM_CPU (obj), &err); }#endif /* TARGET_AARCH64 */ visit_end_struct (visitor,NULL );
@@ -198,7 +198,7 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, } }else {#ifdef TARGET_AARCH64 -arm_cpu_finalize_features (ARM_CPU (obj), &error_abort); +aarch64_cpu_finalize_features (ARM_CPU (obj), &error_abort);#endif /* TARGET_AARCH64 */ }
Signature · 1 line
2.20.1
Re: [PATCH v16 88/99] target/arm: cpu64: rename arm_cpu_finalize_features
Quoted 14 lines · Alex Bennée
target/arm/cpu64.c +1
-2@@ -469,11 +469,10 @@ static gchar *aarch64_gdb_arch_name(CPUState *cs)return g_strdup ("aarch64" ); } -void arm_cpu_finalize_features (ARMCPU *cpu,Error **errp) +void aarch64_cpu_finalize_features (ARMCPU *cpu,Error **errp) {Error *local_err =NULL ; -#ifdef TARGET_AARCH64 if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) {if (!cpu_sve_finalize_features (cpu, &local_err)) {error_propagate (errp, local_err);
target/arm/cpu64.c void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) · line 494
Quoted 5 lines
target/arm/cpu64.c +0
-1@@ -492,7 +491,6 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) } } } -#endif /* TARGET_AARCH64 */
The ifdef removal shouldn't be buried in a rename.
r~
PATCH v16 89/99 target/arm: cpu64: some final cleanup on aarch64_cpu_finalize_features
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
bail out immediately if ARM_FEATURE_AARCH64 is not set, and add an else statement when checking for accelerators.
--- target/arm/cpu64.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-)
target/arm/cpu64.c +16 -17
@@ -473,26 +473,25 @@ void aarch64_cpu_finalize_features(ARMCPU *cpu, Error **errp) {Error *local_err =NULL ; -if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -if (!cpu_sve_finalize_features (cpu, &local_err)) { +if (!arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { +return ; + } +if (!cpu_sve_finalize_features (cpu, &local_err)) { +error_propagate (errp, local_err); +return ; + } + +/* +* KVM does not support modifications to this feature. +* We have not registered the cpu properties when KVM +* is in use, so the user will not be able to set them. +*/ +if (tcg_enabled ()) { +if (!cpu_pauth_finalize (cpu, &local_err)) {error_propagate (errp, local_err);return ; } - -/* -* KVM does not support modifications to this feature. -* We have not registered the cpu properties when KVM -* is in use, so the user will not be able to set them. -*/ -if (tcg_enabled ()) { -if (!cpu_pauth_finalize (cpu, &local_err)) { -error_propagate (errp, local_err); -return ; - } - } - } - -if (kvm_enabled ()) { + }else if (kvm_enabled ()) {kvm_arm_steal_time_finalize (cpu, &local_err);if (local_err !=NULL ) {error_propagate (errp, local_err);
Signature · 1 line
2.20.1
Re: [PATCH v16 89/99] target/arm: cpu64: some final cleanup on aarch64_cpu_finalize_features
Quoted 16 lines · Alex Bennée
From: Claudio Fontana <[email protected]>
bail out immediately if
ARM_FEATURE_AARCH64is not set, and add an else statement when checking for accelerators.Signed-off-by Claudio Fontana <[email protected]>Signed-off-by Alex Bennée <[email protected]>--- target/arm/cpu64.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-)target/arm/cpu64.c +0
-0
target/arm/cpu64.c void aarch64_cpu_finalize_features(ARMCPU *cpu, Error **errp) · line 478
Quoted 8 lines
target/arm/cpu64.c +3
-2@@ -473,26 +473,25 @@ void aarch64_cpu_finalize_features(ARMCPU *cpu, Error **errp) {Error *local_err =NULL ; -if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -if (!cpu_sve_finalize_features (cpu, &local_err)) { +if (!arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { +return ; + }
I'm not sure this is correct, either before or after. What about nonsensical combinations such as
-cpu max,aarch64=off,sve-vq-max=4
Don't we want cpu_sve_finalize_features and friends to produce an error about enabling sve without aarch64.
r~
PATCH v16 90/99 XXX target/arm: experiment refactoring cpu "max"
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
XXX Someone who really understands which properties should be added where should review this attentively.
What goes into cpu leaf class initialization?
What goes into arm_post_init / accel_cpu?
What goes into arm_cpu_finalize_features / aarch64_cpu_finalize_features?
Should there be shift of more code into finalize_features?
--- target/arm/cpu.h | 3 + target/arm/cpu64.c | 175 ++---------------------- target/arm/kvm/kvm-cpu.c | 4 +- target/arm/tcg/tcg-cpu-models.c | 63 +-------- target/arm/tcg/tcg-cpu.c | 228 +++++++++++++++++++++++++++++++- 5 files changed, 241 insertions(+), 232 deletions(-)
target/arm/cpu.h +3 -0
@@ -1015,6 +1015,9 @@ struct ARMCPU {/* Generic timer counter frequency, in Hz */ uint64_t gt_cntfrq_hz; + +/* MAX features requested via cpu="max" */ +bool max_features; };unsigned int gt_cntfrq_period_ns (ARMCPU *cpu);
target/arm/cpu64.c +11 -164
191 lines not on this page · raw message
target/arm/kvm/kvm-cpu.c +1 -3
@@ -88,9 +88,7 @@ static void host_cpu_instance_init(Object *obj)ARMCPU *cpu =ARM_CPU (obj);kvm_arm_set_cpu_features_from_host (cpu); -if (arm_feature (&cpu->env,ARM_FEATURE_AARCH64 )) { -cpu_sve_add_props (obj); - } +cpu_sve_add_props (obj);arm_cpu_post_init (obj); }
target/arm/tcg/tcg-cpu-models.c +1 -62
69 lines not on this page · raw message
target/arm/tcg/tcg-cpu.c +225 -3
247 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v16 91/99 target/arm: tcg: remove superfluous CONFIG_TCG check
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
modules under tcg/ are only built for CONFIG_TCG anyway.
--- target/arm/tcg/vfp_helper.c | 6 ------ 1 file changed, 6 deletions(-)
target/arm/tcg/vfp_helper.c +0 -6
@@ -21,10 +21,8 @@#include "cpu.h" #include "exec/helper-proto.h" #include "internals.h" -#ifdef CONFIG_TCG #include "qemu/log.h" #include "fpu/softfloat.h" -#endif /* VFP support. We follow the convention used for VFP instructions: Single precision routines have a "s" suffix, double precision a
@@ -40,8 +38,6 @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val)vfp_set_fpscr (env, val); } -#ifdef CONFIG_TCG -#define VFP_HELPER (name, p) HELPER(glue(glue(vfp_,name),p))#define VFP_BINOP (name) \
@@ -1110,5 +1106,3 @@ void HELPER(check_hcr_el2_trap)(CPUARMState *env, uint32_t rt, uint32_t reg)raise_exception (env,EXCP_HYP_TRAP , syndrome,2 ); } - -#endif
Signature · 1 line
2.20.1
PATCH v16 92/99 target/arm: remove v7m stub function for !CONFIG_TCG
In reply to Alex BennéeFrom: Claudio Fontana <[email protected]>
it is needed just once, so just move the CONFIG_TCG check in place.
--- target/arm/cpu-mmu.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
target/arm/cpu-mmu.c +5 -9
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" +#include "sysemu/tcg.h" #include "cpu-mmu.h" int aa64_va_parameter_tbi (uint64_t tcr,ARMMMUIdx mmu_idx)
@@ -155,20 +156,15 @@ int arm_mmu_idx_to_el(ARMMMUIdx mmu_idx) } } -#ifndef CONFIG_TCG -ARMMMUIdx arm_v7m_mmu_idx_for_secstate (CPUARMState *env,bool secstate) -{ -g_assert_not_reached (); -} -#endif -ARMMMUIdx arm_mmu_idx_el (CPUARMState *env,int el) {ARMMMUIdx idx;uint64_t hcr; -if (arm_feature (env,ARM_FEATURE_M )) { -return arm_v7m_mmu_idx_for_secstate (env, env->v7m.secure); +if (tcg_enabled ()) { +if (arm_feature (env,ARM_FEATURE_M )) { +return arm_v7m_mmu_idx_for_secstate (env, env->v7m.secure); + } }/* See ARM pseudo-function ELIsInHost. */
Signature · 1 line
2.20.1
Re: [PATCH v16 92/99] target/arm: remove v7m stub function for !CONFIG_TCG
target/arm/cpu-mmu.c int arm_mmu_idx_to_el(ARMMMUIdx mmu_idx) · line 165
Quoted 4 lines · Alex Bennée
target/arm/cpu-mmu.c +2
-2-if (arm_feature (env,ARM_FEATURE_M )) { -return arm_v7m_mmu_idx_for_secstate (env, env->v7m.secure); +if (tcg_enabled ()) { +if (arm_feature (env,ARM_FEATURE_M )) {
Merge the two if with &&?
Otherwise,
r~
PATCH v16 93/99 meson: Introduce target-specific Kconfig
In reply to Alex BennéeFrom: Philippe Mathieu-Daudé <[email protected]>
Add a target-specific Kconfig.
Target foo now has CONFIG_FOO defined.
Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.
Message-Id: <[email protected]>
--- meson.build | 3 ++- Kconfig | 1 + target/Kconfig | 23 +++++++++++++++++++++++ target/alpha/Kconfig | 2 ++ target/arm/Kconfig | 6 ++++++ target/avr/Kconfig | 2 ++ target/cris/Kconfig | 2 ++ target/hppa/Kconfig | 2 ++ target/i386/Kconfig | 5 +++++ target/lm32/Kconfig | 2 ++ target/m68k/Kconfig | 2 ++ target/microblaze/Kconfig | 2 ++ target/mips/Kconfig | 6 ++++++ target/moxie/Kconfig | 2 ++ target/nios2/Kconfig | 2 ++ target/openrisc/Kconfig | 2 ++ target/ppc/Kconfig | 5 +++++ target/riscv/Kconfig | 5 +++++ target/rx/Kconfig | 2 ++ target/s390x/Kconfig | 2 ++ target/sh4/Kconfig | 2 ++ target/sparc/Kconfig | 5 +++++ target/tilegx/Kconfig | 2 ++ target/tricore/Kconfig | 2 ++ target/unicore32/Kconfig | 2 ++ target/xtensa/Kconfig | 2 ++ 26 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 target/Kconfig create mode 100644 target/alpha/Kconfig create mode 100644 target/arm/Kconfig create mode 100644 target/avr/Kconfig create mode 100644 target/cris/Kconfig create mode 100644 target/hppa/Kconfig create mode 100644 target/i386/Kconfig create mode 100644 target/lm32/Kconfig create mode 100644 target/m68k/Kconfig create mode 100644 target/microblaze/Kconfig create mode 100644 target/mips/Kconfig create mode 100644 target/moxie/Kconfig create mode 100644 target/nios2/Kconfig create mode 100644 target/openrisc/Kconfig create mode 100644 target/ppc/Kconfig create mode 100644 target/riscv/Kconfig create mode 100644 target/rx/Kconfig create mode 100644 target/s390x/Kconfig create mode 100644 target/sh4/Kconfig create mode 100644 target/sparc/Kconfig create mode 100644 target/tilegx/Kconfig create mode 100644 target/tricore/Kconfig create mode 100644 target/unicore32/Kconfig create mode 100644 target/xtensa/Kconfig
meson.build +2 -1
@@ -1359,7 +1359,8 @@ foreach target : target_dirs command: [minikconf, get_option('default_devices') ? '--defconfig' : '--allnoconfig', config_devices_mak, '@DEPFILE@', '@INPUT@', - host_kconfig, accel_kconfig]) + host_kconfig, accel_kconfig, + 'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y']) config_devices_data = configuration_data() config_devices = keyval.load(config_devices_mak)
Kconfig +1 -0
@@ -1,5 +1,6 @@ source Kconfig.host source backends/Kconfig source accel/Kconfig +source target/Kconfig source hw/Kconfig source semihosting/Kconfig
target/Kconfig new file +23 -0
@@ -0,0 +1,23 @@ +source alpha/Kconfig +source arm/Kconfig +source avr/Kconfig +source cris/Kconfig +source hppa/Kconfig +source i386/Kconfig +source lm32/Kconfig +source m68k/Kconfig +source microblaze/Kconfig +source mips/Kconfig +source moxie/Kconfig +source nios2/Kconfig +source openrisc/Kconfig +source ppc/Kconfig +source riscv/Kconfig +source rx/Kconfig +source s390x/Kconfig +source sh4/Kconfig +source sparc/Kconfig +source tilegx/Kconfig +source tricore/Kconfig +source unicore32/Kconfig +source xtensa/Kconfig
target/alpha/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config ALPHA + bool
target/arm/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +config ARM + bool + +config AARCH64 + bool + select ARM
target/avr/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config AVR + bool
target/cris/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config CRIS + bool
target/hppa/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config HPPA + bool
target/i386/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config I386 + bool + +config X86_64 + bool
target/lm32/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config LM32 + bool
target/m68k/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config M68K + bool
target/microblaze/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config MICROBLAZE + bool
target/mips/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +config MIPS + bool + +config MIPS64 + bool + select MIPS
target/moxie/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config MOXIE + bool
target/nios2/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config NIOS2 + bool
target/openrisc/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config OPENRISC + bool
target/ppc/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config PPC + bool + +config PPC64 + bool
target/riscv/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config RISCV32 + bool + +config RISCV64 + bool
target/rx/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config RX + bool
target/s390x/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config S390X + bool
target/sh4/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config SH4 + bool
target/sparc/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config SPARC + bool + +config SPARC64 + bool
target/tilegx/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config TILEGX + bool
target/tricore/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config TRICORE + bool
target/unicore32/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config UNICORE32 + bool
target/xtensa/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config XTENSA + bool
Signature · 1 line
2.20.1
Re: [PATCH v16 93/99] meson: Introduce target-specific Kconfig
Quoted 55 lines · Alex Bennée
From: Philippe Mathieu-Daudé <[email protected]>
Add a target-specific
Kconfig.Target foo now has
CONFIG_FOOdefined.Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Message-Id: <[email protected]>
--- meson.build | 3 ++- Kconfig | 1 + target/Kconfig | 23 +++++++++++++++++++++++ target/alpha/Kconfig | 2 ++ target/arm/Kconfig | 6 ++++++ target/avr/Kconfig | 2 ++ target/cris/Kconfig | 2 ++ target/hppa/Kconfig | 2 ++ target/i386/Kconfig | 5 +++++ target/lm32/Kconfig | 2 ++ target/m68k/Kconfig | 2 ++ target/microblaze/Kconfig | 2 ++ target/mips/Kconfig | 6 ++++++ target/moxie/Kconfig | 2 ++ target/nios2/Kconfig | 2 ++ target/openrisc/Kconfig | 2 ++ target/ppc/Kconfig | 5 +++++ target/riscv/Kconfig | 5 +++++ target/rx/Kconfig | 2 ++ target/s390x/Kconfig | 2 ++ target/sh4/Kconfig | 2 ++ target/sparc/Kconfig | 5 +++++ target/tilegx/Kconfig | 2 ++ target/tricore/Kconfig | 2 ++ target/unicore32/Kconfig | 2 ++ target/xtensa/Kconfig | 2 ++ 26 files changed, 92 insertions(+), 1 deletion(-)create mode 100644 target/Kconfig
create mode 100644 target/alpha/Kconfig
create mode 100644 target/arm/Kconfig
create mode 100644 target/avr/Kconfig
create mode 100644 target/cris/Kconfig
create mode 100644 target/hppa/Kconfig
create mode 100644 target/i386/Kconfig
create mode 100644 target/lm32/Kconfig
create mode 100644 target/m68k/Kconfig
create mode 100644 target/microblaze/Kconfig
create mode 100644 target/mips/Kconfig
create mode 100644 target/moxie/Kconfig
create mode 100644 target/nios2/Kconfig
create mode 100644 target/openrisc/Kconfig
create mode 100644 target/ppc/Kconfig
create mode 100644 target/riscv/Kconfig
Quoted 8 lines
create mode 100644 target/rx/Kconfig
create mode 100644 target/s390x/Kconfig
create mode 100644 target/sh4/Kconfig
create mode 100644 target/sparc/Kconfig
create mode 100644 target/tilegx/Kconfig
create mode 100644 target/tricore/Kconfig
create mode 100644 target/unicore32/Kconfig
create mode 100644 target/xtensa/Kconfig
I guess you haven't rebased since unicore, moxie et al were removed?
meson.build foreach target : target_dirs · line 1363
Quoted 9 lines
meson.build +2
-1@@ -1359,7 +1359,8 @@ foreach target : target_dirs command: [minikconf, get_option('default_devices') ? '--defconfig' : '--allnoconfig', config_devices_mak, '@DEPFILE@', '@INPUT@', - host_kconfig, accel_kconfig]) + host_kconfig, accel_kconfig, + 'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])
I can understand this,
Quoted 49 lines
meson.build +0
-0config_devices_data = configuration_data() config_devices = keyval.load(config_devices_mak)Kconfig +1
-0@@ -1,5 +1,6 @@ source Kconfig.host source backends/Kconfig source accel/Kconfig +source target/Kconfig source hw/Kconfig source semihosting/Kconfigtarget/Kconfig new file +23
-0@@ -0,0 +1,23 @@ +source alpha/Kconfig +source arm/Kconfig +source avr/Kconfig +source cris/Kconfig +source hppa/Kconfig +source i386/Kconfig +source lm32/Kconfig +source m68k/Kconfig +source microblaze/Kconfig +source mips/Kconfig +source moxie/Kconfig +source nios2/Kconfig +source openrisc/Kconfig +source ppc/Kconfig +source riscv/Kconfig +source rx/Kconfig +source s390x/Kconfig +source sh4/Kconfig +source sparc/Kconfig +source tilegx/Kconfig +source tricore/Kconfig +source unicore32/Kconfig +source xtensa/Kconfigtarget/alpha/Kconfig new file +0
-0
target/alpha/Kconfig line 2
Quoted 2 lines
target/alpha/Kconfig new file +2
-0@@ -0,0 +1,2 @@ +config ALPHA + bool
But not these. I guess the whole Kconfig thing is processed unconditionally, and there must be some definition?
r~
Re: [PATCH v16 93/99] meson: Introduce target-specific Kconfig
Quoted 61 lines · Richard Henderson
Quoted 51 lines · Alex Bennée
From: Philippe Mathieu-Daudé <[email protected]> Add a target-specific
Kconfig.
Target foo now hasCONFIG_FOOdefined.
Two architecture have a particularity, ARM and MIPS:
their 64-bit version include the 32-bit subset.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Message-Id: <[email protected]>
--- meson.build | 3 ++- Kconfig | 1 + target/Kconfig | 23 +++++++++++++++++++++++ target/alpha/Kconfig | 2 ++ target/arm/Kconfig | 6 ++++++ target/avr/Kconfig | 2 ++ target/cris/Kconfig | 2 ++ target/hppa/Kconfig | 2 ++ target/i386/Kconfig | 5 +++++ target/lm32/Kconfig | 2 ++ target/m68k/Kconfig | 2 ++ target/microblaze/Kconfig | 2 ++ target/mips/Kconfig | 6 ++++++ target/moxie/Kconfig | 2 ++ target/nios2/Kconfig | 2 ++ target/openrisc/Kconfig | 2 ++ target/ppc/Kconfig | 5 +++++ target/riscv/Kconfig | 5 +++++ target/rx/Kconfig | 2 ++ target/s390x/Kconfig | 2 ++ target/sh4/Kconfig | 2 ++ target/sparc/Kconfig | 5 +++++ target/tilegx/Kconfig | 2 ++ target/tricore/Kconfig | 2 ++ target/unicore32/Kconfig | 2 ++ target/xtensa/Kconfig | 2 ++ 26 files changed, 92 insertions(+), 1 deletion(-)create mode 100644 target/Kconfig
create mode 100644 target/alpha/Kconfig create mode 100644 target/arm/Kconfig
create mode 100644 target/avr/Kconfig
create mode 100644 target/cris/Kconfig
create mode 100644 target/hppa/Kconfig
create mode 100644 target/i386/Kconfig
create mode 100644 target/lm32/Kconfig
create mode 100644 target/m68k/Kconfig
create mode 100644 target/microblaze/Kconfig create mode 100644 target/mips/Kconfig
create mode 100644 target/moxie/Kconfig create mode 100644 target/nios2/Kconfig create mode 100644 target/openrisc/Kconfig create mode 100644 target/ppc/Kconfig
create mode 100644 target/riscv/KconfigQuoted 8 lines
create mode 100644 target/rx/Kconfig
create mode 100644 target/s390x/Kconfig create mode 100644 target/sh4/Kconfig
create mode 100644 target/sparc/Kconfig create mode 100644 target/tilegx/Kconfig create mode 100644 target/tricore/Kconfig create mode 100644 target/unicore32/Kconfig create mode 100644 target/xtensa/Kconfig
Quoted 1 line
I guess you haven't rebased since unicore, moxie et al were removed?
Ahh it happily rebased them without realising their superfluousness.
Quoted 58 lines
meson.build foreach target : target_dirs · line 1363
Quoted 10 lines
meson.build +2
-1@@ -1359,7 +1359,8 @@ foreach target : target_dirs command: [minikconf, get_option('default_devices') ? '--defconfig' : '--allnoconfig', config_devices_mak, '@DEPFILE@', '@INPUT@', - host_kconfig, accel_kconfig]) + host_kconfig, accel_kconfig, + 'CONFIG_' + config_target['TARGET_ARCH'].to_upper() + '=y'])I can understand this,
Quoted 45 lines
meson.build +0
-0config_devices_data = configuration_data() config_devices = keyval.load(config_devices_mak)Kconfig +1
-0@@ -1,5 +1,6 @@ source Kconfig.host source backends/Kconfig source accel/Kconfig +source target/Kconfig source hw/Kconfig source semihosting/Kconfigtarget/Kconfig new file +23
-0@@ -0,0 +1,23 @@ +source alpha/Kconfig +source arm/Kconfig +source avr/Kconfig +source cris/Kconfig +source hppa/Kconfig +source i386/Kconfig +source lm32/Kconfig +source m68k/Kconfig +source microblaze/Kconfig +source mips/Kconfig +source moxie/Kconfig +source nios2/Kconfig +source openrisc/Kconfig +source ppc/Kconfig +source riscv/Kconfig +source rx/Kconfig +source s390x/Kconfig +source sh4/Kconfig +source sparc/Kconfig +source tilegx/Kconfig +source tricore/Kconfig +source unicore32/Kconfig +source xtensa/Kconfigtarget/alpha/Kconfig new file +0
-0
Quoted 8 lines
target/alpha/Kconfig line 2
Quoted 5 lines
target/alpha/Kconfig new file +2
-0@@ -0,0 +1,2 @@ +config ALPHA + boolBut not these. I guess the whole
Kconfigthing is processed unconditionally, and there must be some definition?
Pretty much - otherwise you get the Kconfig generator complaining:
Configuring aarch64-softmmu-config-target.h using configuration Configuring aarch64-softmmu-config-devices.mak with command
../../meson.build:1372:4: ERROR: Running configure command failed.
undefined symbol AARCH64
Traceback (most recent call last):
File "/home/alex/lsrc/qemu.git/scripts/minikconf.py", line 703, in <module>
config = data.compute_config()
File "/home/alex/lsrc/qemu.git/scripts/minikconf.py", line 222, in compute_config
raise KconfigDataError("there were undefined symbols")
__main__.KconfigDataError: there were undefined symbols
A full log can be found at /home/alex/lsrc/qemu.git/builds/arm.all/meson-logs/meson-log.txt
ninja: error: rebuilding 'build.ninja': subcommand failed
FAILED: build.ninja
/usr/bin/python3 /home/alex/lsrc/qemu.git/meson/meson.py --internal regenerate /home/alex/lsrc/qemu.git /home/alex/lsrc/qemu.git/builds/arm.all --backend ninja
make: *** [Makefile:154: run-ninja] Error 1
I guess we can tweak minikconf to accept the symbol? Paolo?
Signature · 1 line
Alex Bennée
PATCH v16 94/99 target/arm: move CONFIG_V7M out of default-devices
In reply to Alex BennéeWe currently select CONFIG_V7M for a bunch of our m-profile devices. The last sticking point is translate.c which cannot be compiled without expecting v7m support. Express this dependency in Kconfig rather than in default devices as a stepping stone to a fully configurable translate.c.
While we are at it we also need to select ARM_COMPATIBLE_SEMIHOSTING as that is implied for M profile machines.
--- default-configs/devices/arm-softmmu.mak | 3 --- hw/arm/Kconfig | 3 +++ target/arm/tcg/sysemu/meson.build | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-)
default-configs/devices/arm-softmmu.mak +0 -3
@@ -1,8 +1,5 @@ # Default configuration for arm-softmmu -# TODO: ARM_V7M is currently always required - make this more flexible! -CONFIG_ARM_V7M=y - # CONFIG_PCI_DEVICES=n # CONFIG_TEST_DEVICES=n
hw/arm/Kconfig +3 -0
@@ -296,7 +296,10 @@ config ZYNQ config ARM_V7M bool + # currently v7M must be included in a TCG build due to translate.c + default y if TCG && (ARM || AARCH64) select PTIMER + select ARM_COMPATIBLE_SEMIHOSTING config ALLWINNER_A10 bool
target/arm/tcg/sysemu/meson.build +4 -1
@@ -1,7 +1,10 @@ arm_softmmu_ss.add(when: 'CONFIG_TCG', if_true: files( 'debug_helper.c', - 'm_helper.c', 'mte_helper.c', 'tcg-cpu.c', 'tlb_helper.c', )) + +arm_softmmu_ss.add(when: 'CONFIG_ARM_V7M', if_true: files( + 'm_helper.c', +))
Signature · 1 line
2.20.1
Re: [PATCH v16 94/99] target/arm: move CONFIG_V7M out of default-devices
hw/arm/Kconfig config ZYNQ · line 302
Quoted 6 lines · Alex Bennée
config
ARM_V7M
boolhw/arm/Kconfig +3
-0+ # currently v7M must be included in a TCG build due to translate.c + default y if TCG && (ARM || AARCH64) select PTIMER + select ARM_COMPATIBLE_SEMIHOSTING
I don't really understand "default", because if one were to set ARM_V7M=n in the config, things wouldn't work. But I guess the comment sort-of covers that.
I'll give you an
anyway, because it does seem an improvement for the --disable-tcg case.
r~
PATCH v16 95/99 hw/arm: add dependency on OR_IRQ for XLNX_VERSAL
In reply to Alex BennéeWe need this functionality due to:
/* XRAM IRQs get ORed into a single line. */
object_initialize_child(OBJECT(s), "xram-irq-orgate",
&s->lpd.xram.irq_orgate, TYPE_OR_IRQ);--- hw/arm/Kconfig | 1 + 1 file changed, 1 insertion(+)
hw/arm/Kconfig +1 -0
@@ -371,6 +371,7 @@ config XLNX_VERSAL select UNIMP select XLNX_ZDMA select XLNX_ZYNQMP + select OR_IRQ config NPCM7XX bool
Signature · 1 line
2.20.1
Re: [PATCH v16 95/99] hw/arm: add dependency on OR_IRQ for XLNX_VERSAL
Quoted 10 lines · Alex Bennée
We need this functionality due to:
/* XRAM IRQs get ORed into a single line. */ object_initialize_child(OBJECT(s), "xram-irq-orgate", &s->lpd.xram.irq_orgate, TYPE_OR_IRQ);Signed-off-by Alex Bennée<[email protected]>--- hw/arm/Kconfig | 1 + 1 file changed, 1 insertion(+)
r~
PATCH v16 96/99 tests/qtest: split the cdrom-test into arm/aarch64
In reply to Alex BennéeThe assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken and besides it's not likely this is improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
--- tests/qtest/cdrom-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tests/qtest/cdrom-test.c +4 -1
@@ -220,13 +220,16 @@ int main(int argc, char **argv) "magnum", "malta", "pica61", NULL };add_cdrom_param_tests (mips64machines); - }else if (g_str_equal (arch,"arm" ) ||g_str_equal (arch,"aarch64" )) { + }else if (g_str_equal (arch,"arm" )) {const char *armmachines[] = {"realview-eb" ,"realview-eb-mpcore" ,"realview-pb-a8" ,"realview-pbx-a9" ,"versatileab" ,"versatilepb" ,"vexpress-a15" ,"vexpress-a9" ,"virt" ,NULL };add_cdrom_param_tests (armmachines); + }else if (g_str_equal (arch,"aarch64" )) { +const char *aarch64machines[] = {"virt" ,NULL }; +add_cdrom_param_tests (aarch64machines); }else {const char *nonemachine[] = {"none" ,NULL };add_cdrom_param_tests (nonemachine);
Signature · 1 line
2.20.1
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
r~
and besides it's not likely this is
Quoted 31 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
Signed-off-by Alex Bennée <[email protected]>--- tests/qtest/cdrom-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tests/qtest/cdrom-test.c +4
-1@@ -220,13 +220,16 @@ int main(int argc, char **argv) "magnum", "malta", "pica61", NULL };add_cdrom_param_tests (mips64machines); - }else if (g_str_equal (arch,"arm" ) ||g_str_equal (arch,"aarch64" )) { + }else if (g_str_equal (arch,"arm" )) {const char *armmachines[] = {"realview-eb" ,"realview-eb-mpcore" ,"realview-pb-a8" ,"realview-pbx-a9" ,"versatileab" ,"versatilepb" ,"vexpress-a15" ,"vexpress-a9" ,"virt" ,NULL };add_cdrom_param_tests (armmachines); + }else if (g_str_equal (arch,"aarch64" )) { +const char *aarch64machines[] = {"virt" ,NULL }; +add_cdrom_param_tests (aarch64machines); }else {const char *nonemachine[] = {"none" ,NULL };add_cdrom_param_tests (nonemachine);
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 5 lines · Richard Henderson
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
Really what we want is to probe the -M (machines) that a binary supports rather than just barfing the test because we've built a QEMU that doesn't support all the random 32 bit machines.
Quoted 7 lines
r~
and besides it's not likely this is
Quoted 2 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
I think this point still stands though, I don't think we get much from running the cdrom test with realview et all on qemu-system-aarch64.
Quoted 27 lines
Quoted 27 lines
Signed-off-by Alex Bennée <[email protected]>--- tests/qtest/cdrom-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tests/qtest/cdrom-test.c +4
-1@@ -220,13 +220,16 @@ int main(int argc, char **argv) "magnum", "malta", "pica61", NULL };add_cdrom_param_tests (mips64machines); - }else if (g_str_equal (arch,"arm" ) ||g_str_equal (arch,"aarch64" )) { + }else if (g_str_equal (arch,"arm" )) {const char *armmachines[] = {"realview-eb" ,"realview-eb-mpcore" ,"realview-pb-a8" ,"realview-pbx-a9" ,"versatileab" ,"versatilepb" ,"vexpress-a15" ,"vexpress-a9" ,"virt" ,NULL };add_cdrom_param_tests (armmachines); + }else if (g_str_equal (arch,"aarch64" )) { +const char *aarch64machines[] = {"virt" ,NULL }; +add_cdrom_param_tests (aarch64machines); }else {const char *nonemachine[] = {"none" ,NULL };add_cdrom_param_tests (nonemachine);
Signature · 1 line
Alex Bennée
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 4 lines · Alex Bennée
Quoted 1 line · Richard Henderson
On 6/4/21 8:53 AM, Alex Bennée wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
Really what we want is to probe the -M (machines) that a binary supports rather than just barfing the test because we've built a QEMU that doesn't support all the random 32 bit machines.
Ok, so this is rather about being able to use the qtests with custom QEMU builds where you tweaked the default-configs? That's certainly a valid endeavor, but then I think this patch is the wrong way to go. You should rather add a qtest_has_machine() function that checks whether a machine is available in the target binary or not, and then only add the tests to the test plan that match the list of available machines. (we have similar issues in downstream RHEL where we want to limit the amount of machines, so a qtest_has_machine() function would certainly be welcome)
Thomas
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
In reply to Alex BennéeQuoted 17 lines · Alex Bennée
Quoted 5 lines · Richard Henderson
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
Really what we want is to probe the -M (machines) that a binary supports rather than just barfing the test because we've built a QEMU that doesn't support all the random 32 bit machines.
Quoted 4 lines
r~
Quoted 6 lines
Quoted 3 lines
and besides it's not likely this is
Quoted 2 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
I think this point still stands though, I don't think we get much from running the cdrom test with realview et all on qemu-system-aarch64.
That is commentary I can get behind. The former has connotations of doom and gloom and the opposite of where I think we should go.
r~
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
In reply to Alex BennéeQuoted 17 lines · Alex Bennée
Quoted 5 lines · Richard Henderson
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
Really what we want is to probe the -M (machines) that a binary supports rather than just barfing the test because we've built a QEMU that doesn't support all the random 32 bit machines.
Quoted 4 lines
r~
Quoted 6 lines
Quoted 3 lines
and besides it's not likely this is
Quoted 2 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
I think this point still stands though, I don't think we get much from running the cdrom test with realview et all on qemu-system-aarch64.
In a lot of CI pipelines, we are either building aarch64 or arm, but not both, so I think it might be good to keep the tests in here.
Thomas
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 17 lines · Thomas Huth
Quoted 16 lines · Alex Bennée
Quoted 5 lines · Richard Henderson
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
Really what we want is to probe the -M (machines) that a binary supports rather than just barfing the test because we've built a QEMU that doesn't support all the random 32 bit machines.
Quoted 5 lines
r~
and besides it's not likely this is
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
I think this point still stands though, I don't think we get much from
running the cdrom test with realview et all on qemu-system-aarch64.In a lot of CI pipelines, we are either building aarch64 or arm, but not both, so I think it might be good to keep the tests in here.
We do test instantiating the cdrom with -M virt, exactly how many extra lines of coverage do we get for the rest?
Quoted 2 lines
Thomas
Signature · 1 line
Alex Bennée
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 26 lines · Alex Bennée
Quoted 23 lines · Thomas Huth
Quoted 21 lines · Alex Bennée
Quoted 5 lines · Richard Henderson
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
Really what we want is to probe the -M (machines) that a binary supports rather than just barfing the test because we've built a QEMU that doesn't support all the random 32 bit machines.
Quoted 7 lines
r~
and besides it's not likely this is
Quoted 2 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
I think this point still stands though, I don't think we get much from
running the cdrom test with realview et all on qemu-system-aarch64.
Quoted 5 lines
Quoted 2 lines
In a lot of CI pipelines, we are either building aarch64 or arm, but not both, so I think it might be good to keep the tests in here.
We do test instantiating the cdrom with -M virt, exactly how many extra lines of coverage do we get for the rest?
$ grep -r block_default_type.*IF_ hw/arm/ hw/arm/tosa.c: mc->block_default_type = IF_IDE; hw/arm/cubieboard.c: mc->block_default_type = IF_IDE; hw/arm/virt.c: mc->block_default_type = IF_VIRTIO; hw/arm/spitz.c: mc->block_default_type = IF_IDE; hw/arm/orangepi.c: mc->block_default_type = IF_SD; hw/arm/raspi.c: mc->block_default_type = IF_SD; hw/arm/realview.c: mc->block_default_type = IF_SCSI; hw/arm/realview.c: mc->block_default_type = IF_SCSI; hw/arm/xlnx-zcu102.c: mc->block_default_type = IF_IDE; hw/arm/highbank.c: mc->block_default_type = IF_IDE; hw/arm/highbank.c: mc->block_default_type = IF_IDE; hw/arm/sbsa-ref.c: mc->block_default_type = IF_IDE; hw/arm/versatilepb.c: mc->block_default_type = IF_SCSI; hw/arm/versatilepb.c: mc->block_default_type = IF_SCSI;
... thus these tests check quite a bit of different ways to pass a cdrom drive to the machine. I'd rather suggest to keep them, but you're the arm guy here, so if you don't like these tests anymore, feel free to drop them.
Thomas
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
In reply to Thomas HuthQuoted 22 lines · Thomas Huth
Quoted 21 lines · Alex Bennée
Quoted 5 lines · Richard Henderson
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken...
Um, what?
Really what we want is to probe the -M (machines) that a binary supports rather than just barfing the test because we've built a QEMU that doesn't support all the random 32 bit machines.
Quoted 7 lines
r~
and besides it's not likely this is
Quoted 2 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
Quoted 7 lines
Quoted 2 lines
I think this point still stands though, I don't think we get much from running the cdrom test with realview et all on qemu-system-aarch64.
In a lot of CI pipelines, we are either building aarch64 or arm, but not both, so I think it might be good to keep the tests in here.
Thomas
I'm deferring to Thomas on this -- it has just a little bit less to do with the CDROM itself and more to do with machine configuration, which I consider outside of my wheelhouse here.
--js
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
In reply to Alex BennéeQuoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken and besides it's not likely this is
What's changing? I'm not deeply familiar with aarch64. Why is this assumption about to be broken?
Quoted 3 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
Sounds fine to me, but I didn't write this part of the test. Thomas, you wrote this section IIRC -- does this reduce coverage in any meaningful way?
Quoted 28 lines
Signed-off-by Alex Bennée <[email protected]>--- tests/qtest/cdrom-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tests/qtest/cdrom-test.c +4
-1@@ -220,13 +220,16 @@ int main(int argc, char **argv) "magnum", "malta", "pica61", NULL };add_cdrom_param_tests (mips64machines); - }else if (g_str_equal (arch,"arm" ) ||g_str_equal (arch,"aarch64" )) { + }else if (g_str_equal (arch,"arm" )) {const char *armmachines[] = {"realview-eb" ,"realview-eb-mpcore" ,"realview-pb-a8" ,"realview-pbx-a9" ,"versatileab" ,"versatilepb" ,"vexpress-a15" ,"vexpress-a9" ,"virt" ,NULL };add_cdrom_param_tests (armmachines); + }else if (g_str_equal (arch,"aarch64" )) { +const char *aarch64machines[] = {"virt" ,NULL }; +add_cdrom_param_tests (aarch64machines); }else {const char *nonemachine[] = {"none" ,NULL };add_cdrom_param_tests (nonemachine);
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 5 lines · John Snow
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken and besides it's not likely this is
What's changing? I'm not deeply familiar with aarch64. Why is this assumption about to be broken?
That's also quite a surprise to me. Do you have any pointers?
Quoted 5 lines
Quoted 3 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
Sounds fine to me, but I didn't write this part of the test. Thomas, you wrote this section IIRC -- does this reduce coverage in any meaningful way?
I think we built only aarch64 in a couple of our CI pipelines, assuming that it covers all normal arm machines, too ... so we might want to revisit our CI pipelines to check whether we then need more test coverage for qemu-system-arm instead. But apart from that, the patch looks ok to me.
Thomas
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 8 lines · Thomas Huth
Quoted 5 lines · John Snow
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken and besides it's not likely this is
What's changing? I'm not deeply familiar with aarch64. Why is this assumption about to be broken?
That's also quite a surprise to me. Do you have any pointers?
It's at the top of the series. If you build qemu-system-aarch64 with a custom config you won't be able to instantiate those machines. Ideally it would probe and maybe fail safe if the binary doesn't support the model. Is that possible in qtest?
Quoted 15 lines
Quoted 7 lines
Quoted 4 lines
improving out coverage by much. Test the "virt" machine for both arm and aarch64 as it can be used by either architecture.
Sounds fine to me, but I didn't write this part of the test. Thomas, you wrote this section IIRC -- does this reduce coverage in any meaningful way?
I think we built only aarch64 in a couple of our CI pipelines, assuming that it covers all normal arm machines, too ... so we might want to revisit our CI pipelines to check whether we then need more test coverage for qemu-system-arm instead. But apart from that, the patch looks ok to me.
Thomas
Signature · 1 line
Alex Bennée
Re: [PATCH v16 96/99] tests/qtest: split the cdrom-test into arm/aarch64
Quoted 10 lines · Alex Bennée
Quoted 7 lines · Thomas Huth
Quoted 5 lines · John Snow
Quoted 2 lines · Alex Bennée
The assumption that the qemu-system-aarch64 image can run all 32 bit machines is about to be broken and besides it's not likely this is
What's changing? I'm not deeply familiar with aarch64. Why is this assumption about to be broken?
Quoted 6 lines
Quoted 1 line
That's also quite a surprise to me. Do you have any pointers?
It's at the top of the series. If you build qemu-system-aarch64 with a custom config you won't be able to instantiate those machines. Ideally it would probe and maybe fail safe if the binary doesn't support the model. Is that possible in qtest?
Not yet. You'd need to do something similar like Philippe did in patch 03/99, but instead of running query-accel, you have to run query-machines instead.
Thomas
PATCH v16 97/99 tests/qtest: make xlnx-can-test conditional on being configured
In reply to Alex BennéeIt will soon be possible to build an qemu-system-aarch64 system that doesn't have this.
--- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/meson.build +1 -1
@@ -179,11 +179,11 @@ qtests_arm = \ qtests_aarch64 = \ (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \ (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \ + (config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test'] : []) + \ ['arm-cpu-features', 'numa-test', 'boot-serial-test', 'bios-tables-test', - 'xlnx-can-test', 'migration-test'] qtests_s390x = \
Signature · 1 line
2.20.1
Re: [PATCH v16 97/99] tests/qtest: make xlnx-can-test conditional on being configured
Quoted 7 lines · Alex Bennée
It will soon be possible to build an qemu-system-aarch64 system that doesn't have this.
Signed-off-by Alex Bennée<[email protected]>--- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
r~
PATCH v16 98/99 configure: allow the overriding of default-config in the build
In reply to Alex BennéeWhile the default config works well enough it does end up enabling a lot of stuff. For more minimal builds we can pass a slimmed down list of devices and let Kconfig work out what we want. For example:
../../configure --without-default-features \
--target-list=arm-softmmu,aarch64-softmmu \
--with-devices-aarch64=(pwd)/../../configs/aarch64-softmmu/64bit-only.makwill override the aarch64-softmmu default devices to one of our own choosing. Currently there are two configs provided:
- 64bit-only, to build without any 32 bit boards at all
- virt, even more minimal set for --disable-tcg builds
Message-Id: <[email protected]>
---
v2
- remove extraneous cc
- dropped pathname from config
- add virt.mak config
- drop ZYNQMP from the 64bit only build
- test -f the --with-devices-FOO file
--- configure | 20 ++++++++++++++++++++ configs/aarch64-softmmu/64bit-only.mak | 10 ++++++++++ configs/aarch64-softmmu/virt-only.mak | 8 ++++++++ meson.build | 3 ++- 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 configs/aarch64-softmmu/64bit-only.mak create mode 100644 configs/aarch64-softmmu/virt-only.mak
configure +20 -0
@@ -920,6 +920,16 @@ for opt do ;; --without-default-devices) default_devices="false" ;; + --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option" + ;; + --with-devices-*) device_arch=${opt#--with-devices-}; device_arch=${device_arch%%=*} + if test -f "$optarg"; then + device_archs="$device_archs $device_arch" + eval "devices_${device_arch}=\$optarg" + else + error_exit "File $optarg does not exist" + fi + ;; --without-default-features) # processed above ;; --enable-gprof) gprof="yes"
@@ -1766,6 +1776,7 @@ Advanced options (experts only): --without-default-devices do not include any device that is not needed to start the emulator (only use if you are including desired devices in default-configs/devices/) + --with-devices-ARCH=PATH override default-configs/devices with your own file --enable-debug enable common debug build options --enable-sanitizers enable default sanitizers --enable-tsan enable thread sanitizer
@@ -6343,6 +6354,15 @@ if test "$skip_meson" = no; then echo "# Automatically generated by configure - do not modify" > $cross echo "[properties]" >> $cross + + # unroll any custom device configs + if test -n "$device_archs"; then + for a in $device_archs; do + eval "c=\$devices_${a}" + echo "${a}-softmmu = [ '$c' ]" >> $cross + done + fi + test -z "$cxx" && echo "link_language = 'c'" >> $cross echo "[built-in options]" >> $cross echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross
configs/aarch64-softmmu/64bit-only.mak new file +10 -0
@@ -0,0 +1,10 @@ +# +# A version of the config that only supports 64bits and their devices. +# This doesn't quite eliminate all 32 bit devices as some boards like +# "virt" support both. The CONFIG_XLNX_ZYNQMP_ARM isn't included as it +# also requires 32 bit support for the R5s +# + +CONFIG_ARM_VIRT=y +CONFIG_XLNX_VERSAL=y +CONFIG_SBSA_REF=y
configs/aarch64-softmmu/virt-only.mak new file +8 -0
@@ -0,0 +1,8 @@ +# +# A version of the config that only supports virtual machines. This is +# intended to be combined with options like --disable-tcg for a +# minimal build supporting only machines we can virtualise with a +# hypervisor. +# + +CONFIG_ARM_VIRT=y
meson.build +2 -1
@@ -1350,9 +1350,10 @@ foreach target : target_dirs configuration: config_target_data)} if target.endswith('-softmmu') + config_input = meson.get_external_property(target, 'default-configs/devices' / target + '.mak') config_devices_mak = target + '-config-devices.mak' config_devices_mak = configure_file( - input: ['default-configs/devices' / target + '.mak', 'Kconfig'], + input: [config_input, 'Kconfig'], output: config_devices_mak, depfile: config_devices_mak + '.d', capture: true,
Signature · 1 line
2.20.1
Re: [PATCH v16 98/99] configure: allow the overriding of default-config in the build
configs/aarch64-softmmu/64bit-only.mak line 4
Quoted 6 lines · Alex Bennée
+++ b/configs/aarch64-softmmu/64bit-only.mak
configs/aarch64-softmmu/64bit-only.mak new file +4
-0@@ -0,0 +1,10 @@ +# +# A version of the config that only supports 64bits and their devices. +# This doesn't quite eliminate all 32 bit devices as some boards like +# "virt" support both.
It's not really 64bit-only then is it?
What is this attempting to show that virt-only (with sbsa) doesn't?
configs/aarch64-softmmu/virt-only.mak line 8
Quoted 10 lines
configs/aarch64-softmmu/virt-only.mak new file +9
-0+++ b/configs/aarch64-softmmu/virt-only.mak@@ -0,0 +1,8 @@ +# +# A version of the config that only supports virtual machines. This is +# intended to be combined with options like --disable-tcg for a +# minimal build supporting only machines we can virtualise with a +# hypervisor. +# + +CONFIG_ARM_VIRT=y
I would have included SBSA here. That's a virtual machine as well, just not named "virt". It would also make a useful build configuration, imo, suitable for --disable-tcg --enable-kvm.
r~
Re: [PATCH v16 98/99] configure: allow the overriding of default-config in the build
In reply to Alex BennéeQuoted 26 lines · Alex Bennée
While the default config works well enough it does end up enabling a lot of stuff. For more minimal builds we can pass a slimmed down list of devices and let
Kconfigwork out what we want. For example:../../configure --without-default-features \ --target-list=arm-softmmu,aarch64-softmmu \ --with-devices-aarch64=(pwd)/../../configs/aarch64-softmmu/64bit-only.makwill override the aarch64-softmmu default devices to one of our own choosing. Currently there are two configs provided:
- 64bit-only, to build without any 32 bit boards at all
- virt, even more minimal set for --disable-tcg buildsSigned-off-by Alex Bennée <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Cc Paolo Bonzini <[email protected]>Message-Id: <[email protected]>
---
v2
- remove extraneous cc
- dropped pathname from config
- add virt.mak config
- drop ZYNQMP from the 64bit only build
- test -f the --with-devices-FOO file
Quoted 8 lines
--- configure | 20 ++++++++++++++++++++ configs/aarch64-softmmu/64bit-only.mak | 10 ++++++++++ configs/aarch64-softmmu/virt-only.mak | 8 ++++++++ meson.build | 3 ++- 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 configs/aarch64-softmmu/64bit-only.mak create mode 100644 configs/aarch64-softmmu/virt-only.mak
Shouldn't we also move default-configs/devices/X.mak to configs/X/default.mak and adapt ./configure (instead of having configurations spreads in multiple directories)?
PATCH v16 99/99 gitlab: defend the new stripped down arm64 configs
In reply to Alex BennéeWe can now build a KVM only aarch64-softmmu image which we need to cross build. We can also build a version that only supports a limited set of 64 bit images.
--- .gitlab-ci.d/buildtest.yml | 10 ++++++++++ .gitlab-ci.d/crossbuilds.yml | 9 +++++++++ 2 files changed, 19 insertions(+)
.gitlab-ci.d/buildtest.yml +10 -0
@@ -645,6 +645,16 @@ build-without-default-features: --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu MAKE_CHECK_ARGS: check-unit +build-64bit-only-aarch64-softmmu: + extends: .native_build_job_template + needs: + job: amd64-debian-container + variables: + IMAGE: debian-amd64 + TARGETS: aarch64-softmmu + CONFIGURE_ARGS: --with-devices-aarch64=../configs/aarch64-softmmu/64bit-only.mak + MAKE_CHECK_ARGS: check + build-libvhost-user: stage: build image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
.gitlab-ci.d/crossbuilds.yml +9 -0
@@ -36,6 +36,15 @@ cross-arm64-system: variables: IMAGE: debian-arm64-cross +cross-arm64-kvm-only-system: + extends: .cross_accel_build_job + needs: + job: arm64-debian-cross-container + variables: + IMAGE: debian-arm64-cross + ACCEL: kvm + EXTRA_CONFIGURE_OPTS: --disable-tcg + cross-arm64-user: extends: .cross_user_build_job needs:
Signature · 1 line
2.20.1
Re: [PATCH v16 99/99] gitlab: defend the new stripped down arm64 configs
Quoted 38 lines · Alex Bennée
We can now build a KVM only aarch64-softmmu image which we need to cross build. We can also build a version that only supports a limited set of 64 bit images.
Signed-off-by Alex Bennée <[email protected]>--- .gitlab-ci.d/buildtest.yml | 10 ++++++++++ .gitlab-ci.d/crossbuilds.yml | 9 +++++++++ 2 files changed, 19 insertions(+).gitlab-ci.d/buildtest.yml +10
-0@@ -645,6 +645,16 @@ build-without-default-features: --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu MAKE_CHECK_ARGS: check-unit +build-64bit-only-aarch64-softmmu: + extends: .native_build_job_template + needs: + job: amd64-debian-container + variables: + IMAGE: debian-amd64 + TARGETS: aarch64-softmmu + CONFIGURE_ARGS: --with-devices-aarch64=../configs/aarch64-softmmu/64bit-only.mak + MAKE_CHECK_ARGS: check + build-libvhost-user: stage: build image: $CI_REGISTRY_IMAGE/qemu/fedora:latest.gitlab-ci.d/crossbuilds.yml +0
-0@@ -36,6 +36,15 @@ cross-arm64-system: variables: IMAGE: debian-arm64-cross
.gitlab-ci.d/crossbuilds.yml cross-arm64-system: · line 47
Quoted 10 lines
.gitlab-ci.d/crossbuilds.yml +9
-0+cross-arm64-kvm-only-system: + extends: .cross_accel_build_job + needs: + job: arm64-debian-cross-container + variables: + IMAGE: debian-arm64-cross + ACCEL: kvm + EXTRA_CONFIGURE_OPTS: --disable-tcg +
Any reason not to merge these two? And use virt-only, which as I mentioned is a useful kvm-only configuration.
r~
Hi Alex,
Quoted 39 lines · Alex Bennée
Hi,
I have picked up the baton from Claudio to try and get the ARM re-factoring across the line. Most of the patches from Claudio remain unchanged and have just had minor fixups from re-basing against the moving target. I've done my best to make sure any fixes that have been made in the meantime weren't lost.
I've included Phillipe's
qtest_has_accelv7 patches (I had problems with v8) to aid in my aarch64 testing. I'm expecting them to be up-streamed by Phillipe in due course. I've also nabbed one of Phillipe'sKconfigtweaks to allow for target specific expression of some config variables.The main thing that enables the --disable-tcg build is the addition of --with-devices-FOO configure option which is a mechanism to override the existing default device configurations. The two that I've been testing are a 64 bit only build on x86:
'../../configure' '--without-default-features' \ '--target-list=arm-softmmu,aarch64-softmmu' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/64bit-only.mak'which results in the aarch64-softmmu build only supporting sbsa-ref, virt and xlnx-versal-virt.
The second is a KVM only cross build:
'../../configure' '--disable-docs' \ '--target-list=aarch64-softmmu' \ '--enable-kvm' '--disable-tcg' \ '--cross-prefix=aarch64-linux-gnu-' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/virt-only.mak'Finally I've made a few minor
Kconfigand testing tweaks before adding some gitlab coverage. As a result I was able to drop the Revert: idau patch because I can properly build an image without stray devices in the qtree.
Quoted 7 lines
The following need review:
- gitlab: defend the new stripped down arm64 configs
- tests/qtest: make xlnx-can-test conditional on being configured
- tests/qtest: split the cdrom-test into arm/aarch64
- hw/arm: add dependency onOR_IRQforXLNX_VERSAL
- target/arm: moveCONFIG_V7Mout of default-devices
Without using --with-devices-aarch64, I'm getting:
FAILED: libqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.o cc -Ilibqemu-aarch64-softmmu.fa.p -I. -I../.. -Itarget/arm -I../../target/arm -I../../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/spice-server -I/usr/include/spice-1 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -O2 -g -isystem /home/phil/qemu/linux-headers -isystem linux-headers -iquote . -iquote /home/phil/qemu -iquote /home/phil/qemu/include -iquote /home/phil/qemu/disas/libvixl -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -isystem../../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="aarch64-softmmu-config-target.h"' '-DCONFIG_DEVICES="aarch64-softmmu-config-devices.h"' -MD -MQ libqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.o -MF libqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.o.d -o libqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.o -c ../../target/arm/tcg/sysemu/m_helper.c
In file included from ../../target/arm/tcg/sysemu/m_helper.c:12:/home/phil/qemu/include/exec/helper-proto.h:41:10: fatal error:trace/generated-helpers.h: No such file or directory
41 | #include "trace/generated-helpers.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
both --enable-xen and --disable-xen.
Is that expected?
Thanks,
Phil.
Quoted 81 lines · Philippe Mathieu-Daudé
Hi Alex,
Quoted 39 lines · Alex Bennée
Hi,
I have picked up the baton from Claudio to try and get the ARM re-factoring across the line. Most of the patches from Claudio remain unchanged and have just had minor fixups from re-basing against the moving target. I've done my best to make sure any fixes that have been made in the meantime weren't lost.
I've included Phillipe's
qtest_has_accelv7 patches (I had problems with v8) to aid in my aarch64 testing. I'm expecting them to be up-streamed by Phillipe in due course. I've also nabbed one of Phillipe'sKconfigtweaks to allow for target specific expression of some config variables.The main thing that enables the --disable-tcg build is the addition of --with-devices-FOO configure option which is a mechanism to override the existing default device configurations. The two that I've been testing are a 64 bit only build on x86:
'../../configure' '--without-default-features' \ '--target-list=arm-softmmu,aarch64-softmmu' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/64bit-only.mak'which results in the aarch64-softmmu build only supporting sbsa-ref, virt and xlnx-versal-virt.
The second is a KVM only cross build:
'../../configure' '--disable-docs' \ '--target-list=aarch64-softmmu' \ '--enable-kvm' '--disable-tcg' \ '--cross-prefix=aarch64-linux-gnu-' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/virt-only.mak'Finally I've made a few minor
Kconfigand testing tweaks before adding some gitlab coverage. As a result I was able to drop the Revert: idau patch because I can properly build an image without stray devices in the qtree.Quoted 7 lines
The following need review:
- gitlab: defend the new stripped down arm64 configs
- tests/qtest: make xlnx-can-test conditional on being configured
- tests/qtest: split the cdrom-test into arm/aarch64
- hw/arm: add dependency onOR_IRQforXLNX_VERSAL
- target/arm: moveCONFIG_V7Mout of default-devicesWithout using --with-devices-aarch64, I'm getting:
FAILED:
libqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.occ -Ilibqemu-aarch64-softmmu.fa.p -I. -I../.. -Itarget/arm(quoted diff) +0
-5-I../../target/arm -I../../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/spice-server -I/usr/include/spice-1 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -O2 -g -isystem
/home/phil/qemu/linux-headers-isystem linux-headers -iquote . -iquote/home/phil/qemu-iquote/home/phil/qemu/include-iquote/home/phil/qemu/disas/libvixl-pthread -U_FORTIFY_SOURCE(quoted diff) +0
-9-D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -isystem../../linux-headers -isystemlinux-headers -DNEED_CPU_H'-DCONFIG_TARGET="aarch64-softmmu-config-target.h"' '-DCONFIG_DEVICES="aarch64-softmmu-config-devices.h"' -MD -MQ
libqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.o-MF libqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.o.d -olibqemu-aarch64-softmmu.fa.p/target_arm_tcg_sysemu_m_helper.c.o-c../../target/arm/tcg/sysemu/m_helper.c
In file included from../../target/arm/tcg/sysemu/m_helper.c:12:/home/phil/qemu/include/exec/helper-proto.h:41:10: fatal error:trace/generated-helpers.h: No such file or directory
41 | #include "trace/generated-helpers.h"
Quoted 6 lines
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~compilation terminated.
both --enable-xen and --disable-xen.
Is that expected?
IIRC (this was looong ago) before this configuration was not buildable and Kconfig was erroring with something like:
"dependency not satisfied: ARM_V7M select TCG"
Hi Alex,
I am wondering the current status on this patch series.
I have been working on it recently, I am wondering f you have a wip-git-repo, I can send my patches there if not duplicated,
otherwise I can resend the series here with a new rebase and some fixes based on the comments.
Let me know what you think, thanks.
Regards,
Liang
Quoted 462 lines · Alex Bennée
Hi,
I have picked up the baton from Claudio to try and get the ARM re-factoring across the line. Most of the patches from Claudio remain unchanged and have just had minor fixups from re-basing against the moving target. I've done my best to make sure any fixes that have been made in the meantime weren't lost.
I've included Phillipe's
qtest_has_accelv7 patches (I had problems with v8) to aid in my aarch64 testing. I'm expecting them to be up-streamed by Phillipe in due course. I've also nabbed one of Phillipe'sKconfigtweaks to allow for target specific expression of some config variables.The main thing that enables the --disable-tcg build is the addition of --with-devices-FOO configure option which is a mechanism to override the existing default device configurations. The two that I've been testing are a 64 bit only build on x86:
'../../configure' '--without-default-features' \ '--target-list=arm-softmmu,aarch64-softmmu' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/64bit-only.mak'which results in the aarch64-softmmu build only supporting sbsa-ref, virt and xlnx-versal-virt.
The second is a KVM only cross build:
'../../configure' '--disable-docs' \ '--target-list=aarch64-softmmu' \ '--enable-kvm' '--disable-tcg' \ '--cross-prefix=aarch64-linux-gnu-' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/virt-only.mak'Finally I've made a few minor
Kconfigand testing tweaks before adding some gitlab coverage. As a result I was able to drop the Revert: idau patch because I can properly build an image without stray devices in the qtree.The following need review:
- gitlab: defend the new stripped down arm64 configs
- tests/qtest: make xlnx-can-test conditional on being configured
- tests/qtest: split the cdrom-test into arm/aarch64
- hw/arm: add dependency onOR_IRQforXLNX_VERSAL
- target/arm: moveCONFIG_V7Mout of default-devicesAlex Bennée (6):
target/arm: moveCONFIG_V7Mout of default-devices hw/arm: add dependency onOR_IRQforXLNX_VERSALtests/qtest: split the cdrom-test into arm/aarch64 tests/qtest: make xlnx-can-test conditional on being configured
configure: allow the overriding of default-config in the build
gitlab: defend the new stripped down arm64 configsClaudio Fontana (80):
meson: addtarget_user_arch
accel: addcpu_reset
target/arm: move translate modules to tcg/
target/arm: move helpers to tcg/
arm: tcg: only build underCONFIG_TCG
target/arm: tcg: add sysemu and user subdirs
target/arm: tcg: splitmte_helperuser-only and sysemu code target/arm: tcg: move sysemu-only parts ofdebug_helpertarget/arm: tcg: splittlb_helperuser-only and sysemu-only parts target/arm: tcg: splitm_helperuser-only and sysemu-only parts target/arm: only build psci for TCG
target/arm: split offcpu-sysemu.c
target/arm: tcg: fix comment style before move to cpu-mmu target/arm: move physical address translation to cpu-mmu target/arm: fix style in preparation of new cpregs module target/arm: split cpregs fromtcg/helper.c
target/arm: move cpu definitions to common cpu module target/arm: only perform TCG cpu and machine inits if TCG enabled target/arm: tcg: add stubs for some helpers for non-tcg builds target/arm: movecpsr_read,cpsr_writetocpu_commontarget/arm: add temporary stub forarm_rebuild_hflagstarget/arm: movearm_hcr_el2_efffrom tcg/ tocommon_cputarget/arm: split vfp state setting from tcg helpers target/arm: move arm_mmu_idx* to cpu-mmu
target/arm: movesve_zcr_len_for_eltocommon_cputarget/arm: movearm_sctlraway from tcg helpers target/arm: movearm_cpu_listtocommon_cpu
target/arm: moveaarch64_sync_32_to_64(and vv) to cpu code target/arm: new cpu32 ARM 32 bit CPU Class
target/arm: split 32bit and 64bit arm dump state target/arm: move a15 cpu model away from the TCG-only models target/arm: fixupsve_exception_elcode style before move target/arm: movesve_exception_elout of TCG helpers target/arm: fix comments style offp_exception_elbefore moving it target/arm: movefp_exception_elout of TCG helpers target/arm: remove now useless ifndef fromfp_exception_eltarget/arm: make further preparation for the exception code to move target/arm: fix style ofarm_cpu_do_interruptfunctions before move target/arm: move exception code out oftcg/helper.ctarget/arm: renamehandle_semihostingtotcg_handle_semihostingtarget/arm: replaceCONFIG_TCGwithtcg_enabledtarget/arm: move TCGCPUOps totcg/tcg-cpu.c
target/arm: movecpu_tcgtotcg/tcg-cpu-models.ctarget/arm: wrap call toaarch64_sve_change_elintcg_enabled()target/arm: remove kvm include file for PSCI and arm-powerctl target/arm: movekvm-const.h,kvm.c,kvm64.c,kvm_arm.hto kvm/
MAINTAINERS: update arm kvm maintained files to all in target/arm/kvm/ target/arm: cleanup cpu includes
target/arm: remove broad "else" statements when checking accels target/arm: removekvm-stub.c
tests/qtest: skip bios-tables-testtest_acpi_oem_fields_virtfor KVM
tests: do not run test-hmp on all machines for ARM KVM-only
tests: device-introspect-test: cope with ARM TCG-only devices
tests: do not run qom-test on all machines for ARM KVM-only target/arm: create kvm cpu accel class
target/arm: move kvm post init initialization to kvm cpu accel target/arm: add tcg cpu accel class
target/arm: move TCG gt timer creation code in tcg/ target/arm: cpu-sve: new module
target/arm: cpu-sve: rename functions according to module prefix target/arm: cpu-sve: split TCG and KVM functionality target/arm: cpu-sve: makecpu_sve_finalize_featuresreturn bool target/arm: makeis_aa64andarm_el_is_aa64a macro for!TARGET_AARCH64target/arm: restrict
rebuild_hflags_a64toTARGET_AARCH64target/arm:arch_dump: restrict ELFCLASS64 to AArch64 target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules target/arm: tcg: restrict ZCR cpregs toTARGET_AARCH64target/arm: tcg-sve: importnarrow_vqandchange_elfunctions target/arm: tcg-sve: rename thenarrow_vqandchange_elfunctions target/arm: movesve_zcr_len_for_elto TARGET_AARCH64-only cpu-sve
cpu-sve: renamesve_zcr_len_for_eltocpu_sve_get_zcr_len_for_eltarget/arm: cpu-common: wrap a64-only check withis_a64target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication target/arm: cpu-pauth: changearm_cpu_pauth_finalizename and sig target/arm: movearm_cpu_finalize_featuresinto cpu64 target/arm: cpu64: renamearm_cpu_finalize_featurestarget/arm: cpu64: some final cleanup onaarch64_cpu_finalize_featuresXXX target/arm: experiment refactoring cpu "max" target/arm: tcg: remove superfluousCONFIG_TCGcheck target/arm: remove v7m stub function for !CONFIG_TCGPhilippe Mathieu-Daudé (13):
MAINTAINERS: Addqtest/arm-cpu-features.cto ARM TCG CPUs section
accel: Introduce 'query-accels' QMP command
qtest: Addqtest_has_accel()method qtest/arm-cpu-features: Use genericqtest_has_accel()to check for KVM qtest/arm-cpu-features: Restrictsve_tests_sve_off_kvmtest to KVM qtest/arm-cpu-features: Remove TCG fallback to KVM specific tests qtest/arm-cpu-features: Use genericqtest_has_accel()to check for TCG qtest/migration-test: Skip tests if KVM not builtin on s390x/ppc64 qtest/bios-tables-test: Rename tests not TCG specific qtest/bios-tables-test: Rename TCG specific tests qtest/bios-tables-test: Make test build-independent from accelerator
qtest: Do not restrict bios-tables-test to Aarch64 hosts anymore
meson: Introduce target-specificKconfigconfigure | 20 + configs/aarch64-softmmu/64bit-only.mak | 10 + configs/aarch64-softmmu/virt-only.mak | 8 + default-configs/devices/arm-softmmu.mak | 3 - meson.build | 9 +- qapi/machine.json | 47 + include/hw/core/accel-cpu.h | 2 + include/qemu/accel.h | 6 + target/arm/arm-powerctl.h | 2 - target/arm/cpregs.h | 515 ++ target/arm/cpu-exceptions-aa64.h | 28 + target/arm/cpu-mmu.h | 119 + target/arm/cpu-qom.h | 3 - target/arm/cpu-sve.h | 40 + target/arm/cpu-vfp.h | 29 + target/arm/cpu.h | 534 +- target/arm/cpu32.h | 32 + target/arm/helper-a64.h | 2 + target/arm/helper.h | 1 - target/arm/internals.h | 46 +- target/arm/{ => kvm}/kvm-consts.h | 0 target/arm/kvm/kvm-sve.h | 28 + target/arm/{ => kvm}/kvm_arm.h | 0 target/arm/kvm/trace.h | 1 + target/arm/tcg/cpu-pauth.h | 34 + target/arm/tcg/m_helper.h | 21 + target/arm/tcg/mte_helper.h | 53 + target/arm/{ => tcg}/op_addsub.h | 0 target/arm/tcg/tcg-cpu.h | 40 + target/arm/tcg/tcg-sve.h | 29 + target/arm/tcg/tlb_helper.h | 17 + target/arm/tcg/trace.h | 1 + target/arm/{ => tcg}/translate-a64.h | 0 target/arm/{ => tcg}/translate.h | 0 target/arm/{ => tcg}/vec_internal.h | 0 target/arm/trace.h | 1 - tests/qtest/libqos/libqtest.h | 8 + target/arm/{ => tcg}/a32-uncond.decode | 0 target/arm/{ => tcg}/a32.decode | 0 target/arm/{ => tcg}/m-nocp.decode | 0 target/arm/{ => tcg}/neon-dp.decode | 0 target/arm/{ => tcg}/neon-ls.decode | 0 target/arm/{ => tcg}/neon-shared.decode | 0 target/arm/{ => tcg}/sve.decode | 0 target/arm/{ => tcg}/t16.decode | 0 target/arm/{ => tcg}/t32.decode | 0 target/arm/{ => tcg}/vfp-uncond.decode | 0 target/arm/{ => tcg}/vfp.decode | 0 accel/accel-common.c | 9 + accel/accel-qmp.c | 49 + hw/arm/boot.c | 5 +- hw/arm/pxa2xx.c | 1 + hw/arm/pxa2xx_pic.c | 1 + hw/arm/sbsa-ref.c | 2 +- hw/arm/virt-acpi-build.c | 2 +- hw/arm/virt.c | 2 +- hw/arm/xlnx-versal.c | 2 +- hw/arm/xlnx-zynqmp.c | 2 +- hw/core/cpu-common.c | 3 +- hw/cpu/a15mpcore.c | 2 +- hw/intc/arm_gic_kvm.c | 2 +- hw/intc/arm_gicv3_cpuif.c | 1 + hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 3 +- linux-user/syscall.c | 6 +- target/arm/arch_dump.c | 15 +- target/arm/arm-powerctl.c | 8 +- target/arm/cpregs.c | 380 + target/arm/cpu-common.c | 358 + target/arm/cpu-exceptions-aa64.c | 277 + target/arm/cpu-exceptions.c | 445 ++ target/arm/cpu-mmu-sysemu.c | 2307 ++++++ target/arm/cpu-mmu.c | 215 + target/arm/cpu-sve.c | 323 + target/arm/cpu-sysemu.c | 482 ++ target/arm/cpu-user.c | 46 + target/arm/cpu-vfp.c | 97 + target/arm/cpu.c | 759 +- target/arm/cpu32.c | 260 + target/arm/cpu64.c | 723 +- target/arm/cpustate-list.c | 146 + target/arm/gdbstub.c | 1 + target/arm/kvm-stub.c | 24 - target/arm/kvm/kvm-cpu.c | 128 + target/arm/kvm/kvm-sve.c | 118 + target/arm/{ => kvm}/kvm.c | 18 +- target/arm/{ => kvm}/kvm64.c | 0 target/arm/machine.c | 39 +- target/arm/monitor.c | 10 +- target/arm/psci.c | 1 - target/arm/{helper.c => tcg/cpregs.c} | 6557 +---------------- target/arm/tcg/cpu-pauth.c | 66 + target/arm/tcg/cpu-vfp.c | 146 + target/arm/{ => tcg}/crypto_helper.c | 0 target/arm/{ => tcg}/debug_helper.c | 27 - target/arm/{ => tcg}/helper-a64.c | 3 +- target/arm/tcg/helper.c | 1300 ++++ target/arm/{ => tcg}/iwmmxt_helper.c | 0 target/arm/tcg/m_helper.c | 93 + target/arm/{ => tcg}/mte_helper.c | 191 +- target/arm/{ => tcg}/neon_helper.c | 0 target/arm/{ => tcg}/op_helper.c | 1 + target/arm/{ => tcg}/pauth_helper.c | 2 +- target/arm/{ => tcg}/sve_helper.c | 0 target/arm/tcg/sysemu/debug_helper.c | 33 + target/arm/{ => tcg/sysemu}/m_helper.c | 203 +- target/arm/tcg/sysemu/mte_helper.c | 159 + target/arm/tcg/sysemu/tcg-cpu.c | 119 + target/arm/tcg/sysemu/tlb_helper.c | 84 + .../arm/{cpu_tcg.c => tcg/tcg-cpu-models.c} | 153 +- target/arm/tcg/tcg-cpu.c | 502 ++ target/arm/tcg/tcg-stubs.c | 21 + target/arm/tcg/tcg-sve.c | 167 + target/arm/{ => tcg}/tlb_helper.c | 97 +- target/arm/{ => tcg}/translate-a64.c | 1 + target/arm/{ => tcg}/translate-m-nocp.c | 0 target/arm/{ => tcg}/translate-neon.c | 0 target/arm/{ => tcg}/translate-sve.c | 0 target/arm/{ => tcg}/translate-vfp.c | 0 target/arm/{ => tcg}/translate.c | 1 + target/arm/tcg/user/m_helper.c | 97 + target/arm/tcg/user/mte_helper.c | 57 + target/arm/tcg/user/tlb_helper.c | 32 + target/arm/{ => tcg}/vec_helper.c | 0 target/arm/{ => tcg}/vfp_helper.c | 216 +- target/i386/cpu.c | 4 - target/i386/kvm/kvm-cpu.c | 6 + tests/qtest/arm-cpu-features.c | 47 +- tests/qtest/bios-tables-test.c | 163 +- tests/qtest/cdrom-test.c | 5 +- tests/qtest/device-introspect-test.c | 32 +- tests/qtest/libqtest.c | 29 + tests/qtest/migration-test.c | 4 +- tests/qtest/qom-test.c | 20 + tests/qtest/test-hmp.c | 20 + .gitlab-ci.d/buildtest.yml | 10 + .gitlab-ci.d/crossbuilds.yml | 9 + Kconfig | 1 + MAINTAINERS | 3 +- accel/meson.build | 2 +- hw/arm/Kconfig | 4 + roms/u-boot | 2 +- target/Kconfig | 23 + target/alpha/Kconfig | 2 + target/alpha/meson.build | 3 + target/arm/Kconfig | 6 + target/arm/kvm/meson.build | 6 + target/arm/kvm/trace-events | 4 + target/arm/meson.build | 64 +- target/arm/tcg/meson.build | 53 + target/arm/tcg/sysemu/meson.build | 10 + target/arm/{ => tcg}/trace-events | 5 +- target/arm/tcg/user/meson.build | 5 + target/avr/Kconfig | 2 + target/cris/Kconfig | 2 + target/cris/meson.build | 3 + target/hexagon/meson.build | 3 + target/hppa/Kconfig | 2 + target/hppa/meson.build | 3 + target/i386/Kconfig | 5 + target/lm32/Kconfig | 2 + target/m68k/Kconfig | 2 + target/m68k/meson.build | 3 + target/microblaze/Kconfig | 2 + target/microblaze/meson.build | 3 + target/mips/Kconfig | 6 + target/moxie/Kconfig | 2 + target/nios2/Kconfig | 2 + target/nios2/meson.build | 3 + target/openrisc/Kconfig | 2 + target/openrisc/meson.build | 3 + target/ppc/Kconfig | 5 + target/ppc/meson.build | 3 + target/riscv/Kconfig | 5 + target/riscv/meson.build | 3 + target/rx/Kconfig | 2 + target/s390x/Kconfig | 2 + target/s390x/meson.build | 3 + target/sh4/Kconfig | 2 + target/sh4/meson.build | 3 + target/sparc/Kconfig | 5 + target/sparc/meson.build | 3 + target/tilegx/Kconfig | 2 + target/tricore/Kconfig | 2 + target/tricore/meson.build | 3 + target/unicore32/Kconfig | 2 + target/xtensa/Kconfig | 2 + target/xtensa/meson.build | 3 + tests/qtest/meson.build | 5 +- 189 files changed, 10701 insertions(+), 9237 deletions(-)create mode 100644 configs/aarch64-softmmu/64bit-only.mak create mode 100644 configs/aarch64-softmmu/virt-only.mak create mode 100644
target/arm/cpregs.h
create mode 100644target/arm/cpu-exceptions-aa64.hcreate mode 100644target/arm/cpu-mmu.h
create mode 100644target/arm/cpu-sve.h
create mode 100644target/arm/cpu-vfp.h
create mode 100644target/arm/cpu32.h
rename target/arm/{ =>kvm}/kvm-consts.h(100%) create mode 100644target/arm/kvm/kvm-sve.hrename target/arm/{ =>kvm}/kvm_arm.h(100%) create mode 100644target/arm/kvm/trace.h
create mode 100644target/arm/tcg/cpu-pauth.hcreate mode 100644target/arm/tcg/m_helper.hcreate mode 100644target/arm/tcg/mte_helper.hrename target/arm/{ =>tcg}/op_addsub.h(100%) create mode 100644target/arm/tcg/tcg-cpu.hcreate mode 100644target/arm/tcg/tcg-sve.hcreate mode 100644target/arm/tcg/tlb_helper.hcreate mode 100644target/arm/tcg/trace.h
rename target/arm/{ =>tcg}/translate-a64.h(100%) rename target/arm/{ =>tcg}/translate.h(100%) rename target/arm/{ =>tcg}/vec_internal.h(100%) delete mode 100644target/arm/trace.h
rename target/arm/{ => tcg}/a32-uncond.decode (100%) rename target/arm/{ => tcg}/a32.decode (100%) rename target/arm/{ => tcg}/m-nocp.decode (100%) rename target/arm/{ => tcg}/neon-dp.decode (100%) rename target/arm/{ => tcg}/neon-ls.decode (100%) rename target/arm/{ => tcg}/neon-shared.decode (100%) rename target/arm/{ => tcg}/sve.decode (100%) rename target/arm/{ => tcg}/t16.decode (100%) rename target/arm/{ => tcg}/t32.decode (100%) rename target/arm/{ => tcg}/vfp-uncond.decode (100%) rename target/arm/{ => tcg}/vfp.decode (100%) create mode 100644accel/accel-qmp.c
create mode 100644target/arm/cpregs.c
create mode 100644target/arm/cpu-common.c
create mode 100644target/arm/cpu-exceptions-aa64.ccreate mode 100644target/arm/cpu-exceptions.ccreate mode 100644target/arm/cpu-mmu-sysemu.ccreate mode 100644target/arm/cpu-mmu.c
create mode 100644target/arm/cpu-sve.c
create mode 100644target/arm/cpu-sysemu.c
create mode 100644target/arm/cpu-user.c
create mode 100644target/arm/cpu-vfp.c
create mode 100644target/arm/cpu32.c
create mode 100644target/arm/cpustate-list.cdelete mode 100644target/arm/kvm-stub.c
create mode 100644target/arm/kvm/kvm-cpu.ccreate mode 100644target/arm/kvm/kvm-sve.crename target/arm/{ =>kvm}/kvm.c(98%)
rename target/arm/{ =>kvm}/kvm64.c(100%)
renametarget/arm/{helper.c=>tcg/cpregs.c} (57%) create mode 100644target/arm/tcg/cpu-pauth.ccreate mode 100644target/arm/tcg/cpu-vfp.crename target/arm/{ =>tcg}/crypto_helper.c(100%) rename target/arm/{ =>tcg}/debug_helper.c(92%) rename target/arm/{ =>tcg}/helper-a64.c(99%) create mode 100644target/arm/tcg/helper.c
rename target/arm/{ =>tcg}/iwmmxt_helper.c(100%) create mode 100644target/arm/tcg/m_helper.crename target/arm/{ =>tcg}/mte_helper.c(76%) rename target/arm/{ =>tcg}/neon_helper.c(100%) rename target/arm/{ =>tcg}/op_helper.c(99%) rename target/arm/{ =>tcg}/pauth_helper.c(99%) rename target/arm/{ =>tcg}/sve_helper.c(100%) create mode 100644target/arm/tcg/sysemu/debug_helper.crename target/arm/{ =>tcg/sysemu}/m_helper.c(94%) create mode 100644target/arm/tcg/sysemu/mte_helper.ccreate mode 100644target/arm/tcg/sysemu/tcg-cpu.ccreate mode 100644target/arm/tcg/sysemu/tlb_helper.crenametarget/arm/{cpu_tcg.c=>tcg/tcg-cpu-models.c} (86%) create mode 100644target/arm/tcg/tcg-cpu.ccreate mode 100644target/arm/tcg/tcg-stubs.ccreate mode 100644target/arm/tcg/tcg-sve.crename target/arm/{ =>tcg}/tlb_helper.c(56%) rename target/arm/{ =>tcg}/translate-a64.c(99%) rename target/arm/{ =>tcg}/translate-m-nocp.c(100%) rename target/arm/{ =>tcg}/translate-neon.c(100%) rename target/arm/{ =>tcg}/translate-sve.c(100%) rename target/arm/{ =>tcg}/translate-vfp.c(100%) rename target/arm/{ =>tcg}/translate.c(99%) create mode 100644target/arm/tcg/user/m_helper.ccreate mode 100644target/arm/tcg/user/mte_helper.ccreate mode 100644target/arm/tcg/user/tlb_helper.crename target/arm/{ =>tcg}/vec_helper.c(100%) rename target/arm/{ =>tcg}/vfp_helper.c(84%) create mode 100644 target/Kconfig
create mode 100644 target/alpha/Kconfig
create mode 100644 target/arm/Kconfig
create mode 100644 target/arm/kvm/meson.build create mode 100644 target/arm/kvm/trace-events create mode 100644 target/arm/tcg/meson.build create mode 100644 target/arm/tcg/sysemu/meson.build rename target/arm/{ => tcg}/trace-events (78%) create mode 100644 target/arm/tcg/user/meson.build create mode 100644 target/avr/Kconfig
create mode 100644 target/cris/Kconfig
create mode 100644 target/hppa/Kconfig
create mode 100644 target/i386/Kconfig
create mode 100644 target/lm32/Kconfig
create mode 100644 target/m68k/Kconfig
create mode 100644 target/microblaze/Kconfig create mode 100644 target/mips/Kconfig
create mode 100644 target/moxie/Kconfig
create mode 100644 target/nios2/Kconfig
create mode 100644 target/openrisc/Kconfig
create mode 100644 target/ppc/Kconfig
create mode 100644 target/riscv/Kconfig
create mode 100644 target/rx/Kconfig
create mode 100644 target/s390x/Kconfig
create mode 100644 target/sh4/Kconfig
create mode 100644 target/sparc/Kconfig
create mode 100644 target/tilegx/Kconfig
create mode 100644 target/tricore/Kconfig
create mode 100644 target/unicore32/Kconfig create mode 100644 target/xtensa/Kconfig
Quoted 3 lines · Liang Yan
Hi Alex,
I am wondering the current status on this patch series.
The current state of my tree is:
https://github.com/stsquad/qemu/tree/arm/refactor-tcg-accel-split-v17
I haven't had a chance to look at it in the last few months but some bits and pieces have been merged including a few Kconfig tweaks and the --with-default-FOO patches.
Quoted 4 lines
I have been working on it recently, I am wondering f you have a wip-git-repo, I can send my patches there if not duplicated,
otherwise I can resend the series here with a new rebase and some fixes based on the comments.
Whichever works for you. You can either apply your patches to my WIP branch and re-base and post the lot or you can apply my last post and fix up from there. The former may save you some conflict resolutions as that it more or less what I've been doing.
When you post the series please CC me so I can keep in the loop. A lot of the earlier patches are already reviewed so hopefully the non-controversial stuff can get merged into target-arm.next fairly quickly now we have 6.1 out of the door.
Quoted 472 lines
Let me know what you think, thanks.
Regards,
Liang
Quoted 462 lines · Alex Bennée
Hi,
I have picked up the baton from Claudio to try and get the ARM re-factoring across the line. Most of the patches from Claudio remain unchanged and have just had minor fixups from re-basing against the moving target. I've done my best to make sure any fixes that have been made in the meantime weren't lost.
I've included Phillipe's
qtest_has_accelv7 patches (I had problems with v8) to aid in my aarch64 testing. I'm expecting them to be up-streamed by Phillipe in due course. I've also nabbed one of Phillipe'sKconfigtweaks to allow for target specific expression of some config variables.The main thing that enables the --disable-tcg build is the addition of --with-devices-FOO configure option which is a mechanism to override the existing default device configurations. The two that I've been testing are a 64 bit only build on x86:
'../../configure' '--without-default-features' \ '--target-list=arm-softmmu,aarch64-softmmu' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/64bit-only.mak'which results in the aarch64-softmmu build only supporting sbsa-ref, virt and xlnx-versal-virt.
The second is a KVM only cross build:
'../../configure' '--disable-docs' \ '--target-list=aarch64-softmmu' \ '--enable-kvm' '--disable-tcg' \ '--cross-prefix=aarch64-linux-gnu-' \ '--with-devices-aarch64=../../configs/aarch64-softmmu/virt-only.mak'Finally I've made a few minor
Kconfigand testing tweaks before adding some gitlab coverage. As a result I was able to drop the Revert: idau patch because I can properly build an image without stray devices in the qtree.The following need review:
- gitlab: defend the new stripped down arm64 configs
- tests/qtest: make xlnx-can-test conditional on being configured
- tests/qtest: split the cdrom-test into arm/aarch64
- hw/arm: add dependency onOR_IRQforXLNX_VERSAL
- target/arm: moveCONFIG_V7Mout of default-devicesAlex Bennée (6):
target/arm: moveCONFIG_V7Mout of default-devices hw/arm: add dependency onOR_IRQforXLNX_VERSALtests/qtest: split the cdrom-test into arm/aarch64 tests/qtest: make xlnx-can-test conditional on being configured
configure: allow the overriding of default-config in the build
gitlab: defend the new stripped down arm64 configsClaudio Fontana (80):
meson: addtarget_user_arch
accel: addcpu_reset
target/arm: move translate modules to tcg/
target/arm: move helpers to tcg/
arm: tcg: only build underCONFIG_TCG
target/arm: tcg: add sysemu and user subdirs
target/arm: tcg: splitmte_helperuser-only and sysemu code target/arm: tcg: move sysemu-only parts ofdebug_helpertarget/arm: tcg: splittlb_helperuser-only and sysemu-only parts target/arm: tcg: splitm_helperuser-only and sysemu-only parts target/arm: only build psci for TCG
target/arm: split offcpu-sysemu.c
target/arm: tcg: fix comment style before move to cpu-mmu target/arm: move physical address translation to cpu-mmu target/arm: fix style in preparation of new cpregs module target/arm: split cpregs fromtcg/helper.c
target/arm: move cpu definitions to common cpu module target/arm: only perform TCG cpu and machine inits if TCG enabled target/arm: tcg: add stubs for some helpers for non-tcg builds target/arm: movecpsr_read,cpsr_writetocpu_commontarget/arm: add temporary stub forarm_rebuild_hflagstarget/arm: movearm_hcr_el2_efffrom tcg/ tocommon_cputarget/arm: split vfp state setting from tcg helpers target/arm: move arm_mmu_idx* to cpu-mmu
target/arm: movesve_zcr_len_for_eltocommon_cputarget/arm: movearm_sctlraway from tcg helpers target/arm: movearm_cpu_listtocommon_cpu
target/arm: moveaarch64_sync_32_to_64(and vv) to cpu code target/arm: new cpu32 ARM 32 bit CPU Class
target/arm: split 32bit and 64bit arm dump state target/arm: move a15 cpu model away from the TCG-only models target/arm: fixupsve_exception_elcode style before move target/arm: movesve_exception_elout of TCG helpers target/arm: fix comments style offp_exception_elbefore moving it target/arm: movefp_exception_elout of TCG helpers target/arm: remove now useless ifndef fromfp_exception_eltarget/arm: make further preparation for the exception code to move target/arm: fix style ofarm_cpu_do_interruptfunctions before move target/arm: move exception code out oftcg/helper.ctarget/arm: renamehandle_semihostingtotcg_handle_semihostingtarget/arm: replaceCONFIG_TCGwithtcg_enabledtarget/arm: move TCGCPUOps totcg/tcg-cpu.c
target/arm: movecpu_tcgtotcg/tcg-cpu-models.ctarget/arm: wrap call toaarch64_sve_change_elintcg_enabled()target/arm: remove kvm include file for PSCI and arm-powerctl target/arm: movekvm-const.h,kvm.c,kvm64.c,kvm_arm.hto kvm/
MAINTAINERS: update arm kvm maintained files to all in target/arm/kvm/ target/arm: cleanup cpu includes
target/arm: remove broad "else" statements when checking accels target/arm: removekvm-stub.c
tests/qtest: skip bios-tables-testtest_acpi_oem_fields_virtfor KVM
tests: do not run test-hmp on all machines for ARM KVM-only
tests: device-introspect-test: cope with ARM TCG-only devices
tests: do not run qom-test on all machines for ARM KVM-only target/arm: create kvm cpu accel class
target/arm: move kvm post init initialization to kvm cpu accel target/arm: add tcg cpu accel class
target/arm: move TCG gt timer creation code in tcg/ target/arm: cpu-sve: new module
target/arm: cpu-sve: rename functions according to module prefix target/arm: cpu-sve: split TCG and KVM functionality target/arm: cpu-sve: makecpu_sve_finalize_featuresreturn bool target/arm: makeis_aa64andarm_el_is_aa64a macro for!TARGET_AARCH64target/arm: restrict
rebuild_hflags_a64toTARGET_AARCH64target/arm:arch_dump: restrict ELFCLASS64 to AArch64 target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules target/arm: tcg: restrict ZCR cpregs toTARGET_AARCH64target/arm: tcg-sve: importnarrow_vqandchange_elfunctions target/arm: tcg-sve: rename thenarrow_vqandchange_elfunctions target/arm: movesve_zcr_len_for_elto TARGET_AARCH64-only cpu-sve
cpu-sve: renamesve_zcr_len_for_eltocpu_sve_get_zcr_len_for_eltarget/arm: cpu-common: wrap a64-only check withis_a64target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication target/arm: cpu-pauth: changearm_cpu_pauth_finalizename and sig target/arm: movearm_cpu_finalize_featuresinto cpu64 target/arm: cpu64: renamearm_cpu_finalize_featurestarget/arm: cpu64: some final cleanup onaarch64_cpu_finalize_featuresXXX target/arm: experiment refactoring cpu "max" target/arm: tcg: remove superfluousCONFIG_TCGcheck target/arm: remove v7m stub function for !CONFIG_TCGPhilippe Mathieu-Daudé (13):
MAINTAINERS: Addqtest/arm-cpu-features.cto ARM TCG CPUs section
accel: Introduce 'query-accels' QMP command
qtest: Addqtest_has_accel()method qtest/arm-cpu-features: Use genericqtest_has_accel()to check for KVM qtest/arm-cpu-features: Restrictsve_tests_sve_off_kvmtest to KVM qtest/arm-cpu-features: Remove TCG fallback to KVM specific tests qtest/arm-cpu-features: Use genericqtest_has_accel()to check for TCG qtest/migration-test: Skip tests if KVM not builtin on s390x/ppc64 qtest/bios-tables-test: Rename tests not TCG specific qtest/bios-tables-test: Rename TCG specific tests qtest/bios-tables-test: Make test build-independent from accelerator
qtest: Do not restrict bios-tables-test to Aarch64 hosts anymore
meson: Introduce target-specificKconfigconfigure | 20 + configs/aarch64-softmmu/64bit-only.mak | 10 + configs/aarch64-softmmu/virt-only.mak | 8 + default-configs/devices/arm-softmmu.mak | 3 - meson.build | 9 +- qapi/machine.json | 47 + include/hw/core/accel-cpu.h | 2 + include/qemu/accel.h | 6 + target/arm/arm-powerctl.h | 2 - target/arm/cpregs.h | 515 ++ target/arm/cpu-exceptions-aa64.h | 28 + target/arm/cpu-mmu.h | 119 + target/arm/cpu-qom.h | 3 - target/arm/cpu-sve.h | 40 + target/arm/cpu-vfp.h | 29 + target/arm/cpu.h | 534 +- target/arm/cpu32.h | 32 + target/arm/helper-a64.h | 2 + target/arm/helper.h | 1 - target/arm/internals.h | 46 +- target/arm/{ => kvm}/kvm-consts.h | 0 target/arm/kvm/kvm-sve.h | 28 + target/arm/{ => kvm}/kvm_arm.h | 0 target/arm/kvm/trace.h | 1 + target/arm/tcg/cpu-pauth.h | 34 + target/arm/tcg/m_helper.h | 21 + target/arm/tcg/mte_helper.h | 53 + target/arm/{ => tcg}/op_addsub.h | 0 target/arm/tcg/tcg-cpu.h | 40 + target/arm/tcg/tcg-sve.h | 29 + target/arm/tcg/tlb_helper.h | 17 + target/arm/tcg/trace.h | 1 + target/arm/{ => tcg}/translate-a64.h | 0 target/arm/{ => tcg}/translate.h | 0 target/arm/{ => tcg}/vec_internal.h | 0 target/arm/trace.h | 1 - tests/qtest/libqos/libqtest.h | 8 + target/arm/{ => tcg}/a32-uncond.decode | 0 target/arm/{ => tcg}/a32.decode | 0 target/arm/{ => tcg}/m-nocp.decode | 0 target/arm/{ => tcg}/neon-dp.decode | 0 target/arm/{ => tcg}/neon-ls.decode | 0 target/arm/{ => tcg}/neon-shared.decode | 0 target/arm/{ => tcg}/sve.decode | 0 target/arm/{ => tcg}/t16.decode | 0 target/arm/{ => tcg}/t32.decode | 0 target/arm/{ => tcg}/vfp-uncond.decode | 0 target/arm/{ => tcg}/vfp.decode | 0 accel/accel-common.c | 9 + accel/accel-qmp.c | 49 + hw/arm/boot.c | 5 +- hw/arm/pxa2xx.c | 1 + hw/arm/pxa2xx_pic.c | 1 + hw/arm/sbsa-ref.c | 2 +- hw/arm/virt-acpi-build.c | 2 +- hw/arm/virt.c | 2 +- hw/arm/xlnx-versal.c | 2 +- hw/arm/xlnx-zynqmp.c | 2 +- hw/core/cpu-common.c | 3 +- hw/cpu/a15mpcore.c | 2 +- hw/intc/arm_gic_kvm.c | 2 +- hw/intc/arm_gicv3_cpuif.c | 1 + hw/intc/arm_gicv3_its_kvm.c | 2 +- hw/intc/arm_gicv3_kvm.c | 3 +- linux-user/syscall.c | 6 +- target/arm/arch_dump.c | 15 +- target/arm/arm-powerctl.c | 8 +- target/arm/cpregs.c | 380 + target/arm/cpu-common.c | 358 + target/arm/cpu-exceptions-aa64.c | 277 + target/arm/cpu-exceptions.c | 445 ++ target/arm/cpu-mmu-sysemu.c | 2307 ++++++ target/arm/cpu-mmu.c | 215 + target/arm/cpu-sve.c | 323 + target/arm/cpu-sysemu.c | 482 ++ target/arm/cpu-user.c | 46 + target/arm/cpu-vfp.c | 97 + target/arm/cpu.c | 759 +- target/arm/cpu32.c | 260 + target/arm/cpu64.c | 723 +- target/arm/cpustate-list.c | 146 + target/arm/gdbstub.c | 1 + target/arm/kvm-stub.c | 24 - target/arm/kvm/kvm-cpu.c | 128 + target/arm/kvm/kvm-sve.c | 118 + target/arm/{ => kvm}/kvm.c | 18 +- target/arm/{ => kvm}/kvm64.c | 0 target/arm/machine.c | 39 +- target/arm/monitor.c | 10 +- target/arm/psci.c | 1 - target/arm/{helper.c => tcg/cpregs.c} | 6557 +---------------- target/arm/tcg/cpu-pauth.c | 66 + target/arm/tcg/cpu-vfp.c | 146 + target/arm/{ => tcg}/crypto_helper.c | 0 target/arm/{ => tcg}/debug_helper.c | 27 - target/arm/{ => tcg}/helper-a64.c | 3 +- target/arm/tcg/helper.c | 1300 ++++ target/arm/{ => tcg}/iwmmxt_helper.c | 0 target/arm/tcg/m_helper.c | 93 + target/arm/{ => tcg}/mte_helper.c | 191 +- target/arm/{ => tcg}/neon_helper.c | 0 target/arm/{ => tcg}/op_helper.c | 1 + target/arm/{ => tcg}/pauth_helper.c | 2 +- target/arm/{ => tcg}/sve_helper.c | 0 target/arm/tcg/sysemu/debug_helper.c | 33 + target/arm/{ => tcg/sysemu}/m_helper.c | 203 +- target/arm/tcg/sysemu/mte_helper.c | 159 + target/arm/tcg/sysemu/tcg-cpu.c | 119 + target/arm/tcg/sysemu/tlb_helper.c | 84 + .../arm/{cpu_tcg.c => tcg/tcg-cpu-models.c} | 153 +- target/arm/tcg/tcg-cpu.c | 502 ++ target/arm/tcg/tcg-stubs.c | 21 + target/arm/tcg/tcg-sve.c | 167 + target/arm/{ => tcg}/tlb_helper.c | 97 +- target/arm/{ => tcg}/translate-a64.c | 1 + target/arm/{ => tcg}/translate-m-nocp.c | 0 target/arm/{ => tcg}/translate-neon.c | 0 target/arm/{ => tcg}/translate-sve.c | 0 target/arm/{ => tcg}/translate-vfp.c | 0 target/arm/{ => tcg}/translate.c | 1 + target/arm/tcg/user/m_helper.c | 97 + target/arm/tcg/user/mte_helper.c | 57 + target/arm/tcg/user/tlb_helper.c | 32 + target/arm/{ => tcg}/vec_helper.c | 0 target/arm/{ => tcg}/vfp_helper.c | 216 +- target/i386/cpu.c | 4 - target/i386/kvm/kvm-cpu.c | 6 + tests/qtest/arm-cpu-features.c | 47 +- tests/qtest/bios-tables-test.c | 163 +- tests/qtest/cdrom-test.c | 5 +- tests/qtest/device-introspect-test.c | 32 +- tests/qtest/libqtest.c | 29 + tests/qtest/migration-test.c | 4 +- tests/qtest/qom-test.c | 20 + tests/qtest/test-hmp.c | 20 + .gitlab-ci.d/buildtest.yml | 10 + .gitlab-ci.d/crossbuilds.yml | 9 + Kconfig | 1 + MAINTAINERS | 3 +- accel/meson.build | 2 +- hw/arm/Kconfig | 4 + roms/u-boot | 2 +- target/Kconfig | 23 + target/alpha/Kconfig | 2 + target/alpha/meson.build | 3 + target/arm/Kconfig | 6 + target/arm/kvm/meson.build | 6 + target/arm/kvm/trace-events | 4 + target/arm/meson.build | 64 +- target/arm/tcg/meson.build | 53 + target/arm/tcg/sysemu/meson.build | 10 + target/arm/{ => tcg}/trace-events | 5 +- target/arm/tcg/user/meson.build | 5 + target/avr/Kconfig | 2 + target/cris/Kconfig | 2 + target/cris/meson.build | 3 + target/hexagon/meson.build | 3 + target/hppa/Kconfig | 2 + target/hppa/meson.build | 3 + target/i386/Kconfig | 5 + target/lm32/Kconfig | 2 + target/m68k/Kconfig | 2 + target/m68k/meson.build | 3 + target/microblaze/Kconfig | 2 + target/microblaze/meson.build | 3 + target/mips/Kconfig | 6 + target/moxie/Kconfig | 2 + target/nios2/Kconfig | 2 + target/nios2/meson.build | 3 + target/openrisc/Kconfig | 2 + target/openrisc/meson.build | 3 + target/ppc/Kconfig | 5 + target/ppc/meson.build | 3 + target/riscv/Kconfig | 5 + target/riscv/meson.build | 3 + target/rx/Kconfig | 2 + target/s390x/Kconfig | 2 + target/s390x/meson.build | 3 + target/sh4/Kconfig | 2 + target/sh4/meson.build | 3 + target/sparc/Kconfig | 5 + target/sparc/meson.build | 3 + target/tilegx/Kconfig | 2 + target/tricore/Kconfig | 2 + target/tricore/meson.build | 3 + target/unicore32/Kconfig | 2 + target/xtensa/Kconfig | 2 + target/xtensa/meson.build | 3 + tests/qtest/meson.build | 5 +- 189 files changed, 10701 insertions(+), 9237 deletions(-)create mode 100644 configs/aarch64-softmmu/64bit-only.mak create mode 100644 configs/aarch64-softmmu/virt-only.mak create mode 100644
target/arm/cpregs.h
create mode 100644target/arm/cpu-exceptions-aa64.hcreate mode 100644target/arm/cpu-mmu.h
create mode 100644target/arm/cpu-sve.h
create mode 100644target/arm/cpu-vfp.h
create mode 100644target/arm/cpu32.h
rename target/arm/{ =>kvm}/kvm-consts.h(100%) create mode 100644target/arm/kvm/kvm-sve.hrename target/arm/{ =>kvm}/kvm_arm.h(100%) create mode 100644target/arm/kvm/trace.h
create mode 100644target/arm/tcg/cpu-pauth.hcreate mode 100644target/arm/tcg/m_helper.hcreate mode 100644target/arm/tcg/mte_helper.hrename target/arm/{ =>tcg}/op_addsub.h(100%) create mode 100644target/arm/tcg/tcg-cpu.hcreate mode 100644target/arm/tcg/tcg-sve.hcreate mode 100644target/arm/tcg/tlb_helper.hcreate mode 100644target/arm/tcg/trace.h
rename target/arm/{ =>tcg}/translate-a64.h(100%) rename target/arm/{ =>tcg}/translate.h(100%) rename target/arm/{ =>tcg}/vec_internal.h(100%) delete mode 100644target/arm/trace.h
rename target/arm/{ => tcg}/a32-uncond.decode (100%) rename target/arm/{ => tcg}/a32.decode (100%) rename target/arm/{ => tcg}/m-nocp.decode (100%) rename target/arm/{ => tcg}/neon-dp.decode (100%) rename target/arm/{ => tcg}/neon-ls.decode (100%) rename target/arm/{ => tcg}/neon-shared.decode (100%) rename target/arm/{ => tcg}/sve.decode (100%) rename target/arm/{ => tcg}/t16.decode (100%) rename target/arm/{ => tcg}/t32.decode (100%) rename target/arm/{ => tcg}/vfp-uncond.decode (100%) rename target/arm/{ => tcg}/vfp.decode (100%) create mode 100644accel/accel-qmp.c
create mode 100644target/arm/cpregs.c
create mode 100644target/arm/cpu-common.c
create mode 100644target/arm/cpu-exceptions-aa64.ccreate mode 100644target/arm/cpu-exceptions.ccreate mode 100644target/arm/cpu-mmu-sysemu.ccreate mode 100644target/arm/cpu-mmu.c
create mode 100644target/arm/cpu-sve.c
create mode 100644target/arm/cpu-sysemu.c
create mode 100644target/arm/cpu-user.c
create mode 100644target/arm/cpu-vfp.c
create mode 100644target/arm/cpu32.c
create mode 100644target/arm/cpustate-list.cdelete mode 100644target/arm/kvm-stub.c
create mode 100644target/arm/kvm/kvm-cpu.ccreate mode 100644target/arm/kvm/kvm-sve.crename target/arm/{ =>kvm}/kvm.c(98%)
rename target/arm/{ =>kvm}/kvm64.c(100%)
renametarget/arm/{helper.c=>tcg/cpregs.c} (57%) create mode 100644target/arm/tcg/cpu-pauth.ccreate mode 100644target/arm/tcg/cpu-vfp.crename target/arm/{ =>tcg}/crypto_helper.c(100%) rename target/arm/{ =>tcg}/debug_helper.c(92%) rename target/arm/{ =>tcg}/helper-a64.c(99%) create mode 100644target/arm/tcg/helper.c
rename target/arm/{ =>tcg}/iwmmxt_helper.c(100%) create mode 100644target/arm/tcg/m_helper.crename target/arm/{ =>tcg}/mte_helper.c(76%) rename target/arm/{ =>tcg}/neon_helper.c(100%) rename target/arm/{ =>tcg}/op_helper.c(99%) rename target/arm/{ =>tcg}/pauth_helper.c(99%) rename target/arm/{ =>tcg}/sve_helper.c(100%) create mode 100644target/arm/tcg/sysemu/debug_helper.crename target/arm/{ =>tcg/sysemu}/m_helper.c(94%) create mode 100644target/arm/tcg/sysemu/mte_helper.ccreate mode 100644target/arm/tcg/sysemu/tcg-cpu.ccreate mode 100644target/arm/tcg/sysemu/tlb_helper.crenametarget/arm/{cpu_tcg.c=>tcg/tcg-cpu-models.c} (86%) create mode 100644target/arm/tcg/tcg-cpu.ccreate mode 100644target/arm/tcg/tcg-stubs.ccreate mode 100644target/arm/tcg/tcg-sve.crename target/arm/{ =>tcg}/tlb_helper.c(56%) rename target/arm/{ =>tcg}/translate-a64.c(99%) rename target/arm/{ =>tcg}/translate-m-nocp.c(100%) rename target/arm/{ =>tcg}/translate-neon.c(100%) rename target/arm/{ =>tcg}/translate-sve.c(100%) rename target/arm/{ =>tcg}/translate-vfp.c(100%) rename target/arm/{ =>tcg}/translate.c(99%) create mode 100644target/arm/tcg/user/m_helper.ccreate mode 100644target/arm/tcg/user/mte_helper.ccreate mode 100644target/arm/tcg/user/tlb_helper.crename target/arm/{ =>tcg}/vec_helper.c(100%) rename target/arm/{ =>tcg}/vfp_helper.c(84%) create mode 100644 target/Kconfig
create mode 100644 target/alpha/Kconfig
create mode 100644 target/arm/Kconfig
create mode 100644 target/arm/kvm/meson.build create mode 100644 target/arm/kvm/trace-events create mode 100644 target/arm/tcg/meson.build create mode 100644 target/arm/tcg/sysemu/meson.build rename target/arm/{ => tcg}/trace-events (78%) create mode 100644 target/arm/tcg/user/meson.build create mode 100644 target/avr/Kconfig
create mode 100644 target/cris/Kconfig
create mode 100644 target/hppa/Kconfig
create mode 100644 target/i386/Kconfig
create mode 100644 target/lm32/Kconfig
create mode 100644 target/m68k/Kconfig
create mode 100644 target/microblaze/Kconfig create mode 100644 target/mips/Kconfig
create mode 100644 target/moxie/Kconfig
create mode 100644 target/nios2/Kconfig
create mode 100644 target/openrisc/Kconfig
create mode 100644 target/ppc/Kconfig
create mode 100644 target/riscv/Kconfig
create mode 100644 target/rx/Kconfig
create mode 100644 target/s390x/Kconfig
create mode 100644 target/sh4/Kconfig
create mode 100644 target/sparc/Kconfig
create mode 100644 target/tilegx/Kconfig
create mode 100644 target/tricore/Kconfig
create mode 100644 target/unicore32/Kconfig create mode 100644 target/xtensa/Kconfig
Signature · 1 line
Alex Bennée