target-arm queue
Subsystems (2)
Arm queue built up to a point where it seems worth sending:
various bug fixes, plus RTH's refactoring in preparation for SVE.
thanks
-- PMM
The following changes since commit 0f79bfe38a2cf0f43c7ea4959da7f8ebd7858f3d:
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging (2018-01-25 09:53:53 +0000)
are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20180125
for you to fetch changes up to 24da047af0e99a83fcc0d50b86c0f2627f7418b3:
pl110: Implement vertical compare/next base interrupts (2018-01-25 11:45:30 +0000)
----------------------------------------------------------------
target-arm queue:
* target/arm: Fix address truncation in 64-bit pagetable walks
* i.MX: Fix FEC/ENET receive functions
* target/arm: preparatory refactoring for SVE emulation
* hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending"
* hw/intc/arm_gic: Fix C_RPR value on idle priority
* hw/intc/arm_gic: Fix group priority computation for group 1 IRQs
* hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1
* hw/arm/virt: Check that the CPU realize method succeeded
* sdhci: fix a NULL pointer dereference due to uninitialized AddressSpace object
* xilinx_spips: Correct usage of an uninitialized local variable
* pl110: Implement vertical compare/next base interrupts
----------------------------------------------------------------
Ard Biesheuvel (1):
target/arm: Fix 32-bit address truncation
Francisco Iglesias (1):
xilinx_spips: Correct usage of an uninitialized local variable
Jean-Christophe Dubois (1):
i.MX: Fix FEC/ENET receive funtions
Linus Walleij (1):
pl110: Implement vertical compare/next base interrupts
Luc MICHEL (4):
hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending" hw/intc/arm_gic: Fix C_RPR value on idle priority
hw/intc/arm_gic: Fix group priority computation for group 1 IRQs hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1
Peter Maydell (1):
hw/arm/virt: Check that the CPU realize method succeeded
Philippe Mathieu-Daudé (1):
sdhci: fix a NULL pointer dereference due to uninitialized AddresSpace object
Richard Henderson (11):
target/arm: Mark disas_set_insn_syndrome inline target/arm: Use pointers in crypto helpers target/arm: Use pointers in neon zip/uzp helpers target/arm: Use pointers in neon tbl helper target/arm: Change the type of vfp.regs
target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers
vmstate: Add VMSTATE_UINT64_SUB_ARRAY
target/arm: Add ARM_FEATURE_SVE
target/arm: Move cpu_get_tb_cpu_state out of line target/arm: Hoist store to flags output in cpu_get_tb_cpu_state target/arm: Simplify fp_exception_el for user-only
include/hw/sd/sdhci.h | 1 + include/migration/vmstate.h | 9 ++- target/arm/cpu.h | 157 ++++++++----------------------------- target/arm/helper.h | 46 +++++------ target/arm/translate.h | 2 +- hw/arm/virt.c | 2 +- hw/display/pl110.c | 30 +++++++- hw/intc/arm_gic.c | 25 +++++- hw/net/imx_fec.c | 8 +- hw/sd/sdhci.c | 1 + hw/ssi/xilinx_spips.c | 18 ++++- linux-user/signal.c | 22 +++--- target/arm/arch_dump.c | 8 +- target/arm/crypto_helper.c | 184 +++++++++++++++++--------------------------- target/arm/helper-a64.c | 5 +- target/arm/helper.c | 164 +++++++++++++++++++++++++++++++++++---- target/arm/kvm32.c | 4 +- target/arm/kvm64.c | 31 +++----- target/arm/machine.c | 2 +- target/arm/neon_helper.c | 162 ++++++++++++++++++++------------------ target/arm/op_helper.c | 17 ++-- target/arm/translate-a64.c | 100 ++++++++++++------------ target/arm/translate.c | 134 +++++++++++++++++--------------- 23 files changed, 607 insertions(+), 525 deletions(-)
[Qemu-devel] [PULL 09/21] vmstate: Add VMSTATE_UINT64_SUB_ARRAY
From: Richard Henderson <[email protected]>
At the same time, move VMSTATE_UINT32_SUB_ARRAY beside the other UINT32 definitions.
Message-id: [email protected]
--- include/migration/vmstate.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
include/migration/vmstate.h +6 -3
@@ -905,6 +905,9 @@ extern const VMStateInfo vmstate_info_qtailq;#define VMSTATE_UINT32_ARRAY (_f, _s, _n) \ VMSTATE_UINT32_ARRAY_V(_f, _s, _n, 0) +#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ + VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) +#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0)
@@ -914,6 +917,9 @@ extern const VMStateInfo vmstate_info_qtailq;#define VMSTATE_UINT64_ARRAY (_f, _s, _n) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, 0) +#define VMSTATE_UINT64_SUB_ARRAY (_f, _s, _start, _num) \ + VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint64, uint64_t) +#define VMSTATE_UINT64_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT64_2DARRAY_V(_f, _s, _n1, _n2, 0)
@@ -932,9 +938,6 @@ extern const VMStateInfo vmstate_info_qtailq;#define VMSTATE_INT32_ARRAY (_f, _s, _n) \ VMSTATE_INT32_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ - VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_INT64_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int64, int64_t)
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 10/21] target/arm: Add ARM_FEATURE_SVE
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Not enabled anywhere so far.
Message-id: [email protected]
--- target/arm/cpu.h | 1 + 1 file changed, 1 insertion(+)
target/arm/cpu.h +1 -0
@@ -1340,6 +1340,7 @@ enum arm_features {ARM_FEATURE_VBAR ,/* has cp15 VBAR */ ARM_FEATURE_M_SECURITY ,/* M profile Security Extension */ ARM_FEATURE_JAZELLE ,/* has (trivial) Jazelle implementation */ + ARM_FEATURE_SVE, /* has Scalable Vector Extension */ };static inline int arm_feature (CPUARMState *env,int feature)
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 06/21] target/arm: Use pointers in neon tbl helper
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Rather than passing a regno to the helper, pass pointers to the vector register directly. This eliminates the need to pass in the environment pointer and reduces the number of places that directly access env->vfp.regs[].
Message-id: [email protected]
--- target/arm/helper.h | 2 +- target/arm/op_helper.c | 17 +++++++---------- target/arm/translate.c | 8 ++++---- 3 files changed, 12 insertions(+), 15 deletions(-)
target/arm/helper.h +1 -1
@@ -188,7 +188,7 @@ DEF_HELPER_FLAGS_2(rsqrte_f32, TCG_CALL_NO_RWG, f32, f32, ptr) DEF_HELPER_FLAGS_2(rsqrte_f64, TCG_CALL_NO_RWG, f64, f64, ptr) DEF_HELPER_2(recpe_u32, i32, i32, ptr) DEF_HELPER_FLAGS_2(rsqrte_u32, TCG_CALL_NO_RWG, i32, i32, ptr) -DEF_HELPER_5(neon_tbl, i32, env, i32, i32, i32, i32) +DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i32, i32, i32, ptr, i32) DEF_HELPER_3(shl_cc, i32, env, i32, i32)DEF_HELPER_3 (shr_cc, i32, env, i32, i32)
target/arm/op_helper.c +7 -10
@@ -54,20 +54,17 @@ static int exception_target_el(CPUARMState *env)return target_el; } -uint32_t HELPER (neon_tbl )(CPUARMState *env,uint32_t ireg,uint32_t def, -uint32_t rn,uint32_t maxindex) +uint32_t HELPER (neon_tbl )(uint32_t ireg,uint32_t def,void *vn, +uint32_t maxindex) { -uint32_t val; -uint32_t tmp; -int index; -int shift; -uint64_t *table; - table = (uint64_t *)&env->vfp.regs[rn]; +uint32_t val, shift; +uint64_t *table = vn; + val =0 ;for (shift =0 ; shift <32 ; shift +=8 ) { - index = (ireg >> shift) &0xff ; +uint32_t index = (ireg >> shift) &0xff ;if (index < maxindex) { - tmp = (table[index >>3 ] >> ((index &7 ) <<3 )) &0xff ; +uint32_t tmp = (table[index >>3 ] >> ((index &7 ) <<3 )) &0xff ; val |= tmp << shift; }else { val |= def & (0xff << shift);
target/arm/translate.c +4 -4
@@ -7544,9 +7544,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)tcg_gen_movi_i32 (tmp,0 ); } tmp2 =neon_load_reg (rm,0 ); - tmp4 =tcg_const_i32 (rn); + ptr1 =vfp_reg_ptr (true, rn); tmp5 =tcg_const_i32 (n); -gen_helper_neon_tbl (tmp2, cpu_env, tmp2, tmp, tmp4, tmp5); +gen_helper_neon_tbl (tmp2, tmp2, tmp, ptr1, tmp5);tcg_temp_free_i32 (tmp);if (insn & (1 <<6 )) { tmp =neon_load_reg (rd,1 );
@@ -7555,9 +7555,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)tcg_gen_movi_i32 (tmp,0 ); } tmp3 =neon_load_reg (rm,1 ); -gen_helper_neon_tbl (tmp3, cpu_env, tmp3, tmp, tmp4, tmp5); +gen_helper_neon_tbl (tmp3, tmp3, tmp, ptr1, tmp5);tcg_temp_free_i32 (tmp5); -tcg_temp_free_i32 (tmp4); +tcg_temp_free_ptr (ptr1);neon_store_reg (rd,0 , tmp2);neon_store_reg (rd,1 , tmp3);tcg_temp_free_i32 (tmp);
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 07/21] target/arm: Change the type of vfp.regs
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
All direct users of this field want an integral value. Drop all of the extra casting between uint64_t and float64.
Message-id: [email protected]
--- target/arm/cpu.h | 2 +- target/arm/arch_dump.c | 4 ++-- target/arm/helper.c | 20 ++++++++++---------- target/arm/machine.c | 2 +- target/arm/translate-a64.c | 8 ++++---- target/arm/translate.c | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-)
target/arm/cpu.h +1 -1
@@ -492,7 +492,7 @@ typedef struct CPUARMState {* the two execution states, and means we do not need to explicitly * map these registers when changing states. */ -float64 regs[64 ]; +uint64_t regs[64 ];uint32_t xregs[16 ];/* We store these fpcsr fields separately for convenience. */
target/arm/arch_dump.c +2 -2
@@ -100,7 +100,7 @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,aarch64_note_init (¬e, s,"CORE" ,5 ,NT_PRFPREG ,sizeof (note.vfp));for (i =0 ; i <64 ; ++i) { - note.vfp.vregs[i] =cpu_to_dump64 (s,float64_val (env->vfp.regs[i])); + note.vfp.vregs[i] =cpu_to_dump64 (s, env->vfp.regs[i]); }if (s->dump_info.d_endian ==ELFDATA2MSB ) {
@@ -229,7 +229,7 @@ static int arm_write_elf32_vfp(WriteCoreDumpFunction f, CPUARMState *env,arm_note_init (¬e, s,"LINUX" ,6 ,NT_ARM_VFP ,sizeof (note.vfp));for (i =0 ; i <32 ; ++i) { - note.vfp.vregs[i] =cpu_to_dump64 (s,float64_val (env->vfp.regs[i])); + note.vfp.vregs[i] =cpu_to_dump64 (s, env->vfp.regs[i]); } note.vfp.fpscr =cpu_to_dump32 (s,vfp_get_fpscr (env));
target/arm/helper.c +10 -10
@@ -64,15 +64,15 @@ static int vfp_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg)/* VFP data registers are always little-endian. */ nregs =arm_feature (env,ARM_FEATURE_VFP3 ) ?32 :16 ;if (reg < nregs) { -stfq_le_p (buf, env->vfp.regs[reg]); +stq_le_p (buf, env->vfp.regs[reg]);return 8 ; }if (arm_feature (env,ARM_FEATURE_NEON )) {/* Aliases for Q regs. */ nregs +=16 ;if (reg < nregs) { -stfq_le_p (buf, env->vfp.regs[(reg -32 ) *2 ]); -stfq_le_p (buf +8 , env->vfp.regs[(reg -32 ) *2 +1 ]); +stq_le_p (buf, env->vfp.regs[(reg -32 ) *2 ]); +stq_le_p (buf +8 , env->vfp.regs[(reg -32 ) *2 +1 ]);return 16 ; } }
@@ -90,14 +90,14 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) nregs =arm_feature (env,ARM_FEATURE_VFP3 ) ?32 :16 ;if (reg < nregs) { - env->vfp.regs[reg] =ldfq_le_p (buf); + env->vfp.regs[reg] =ldq_le_p (buf);return 8 ; }if (arm_feature (env,ARM_FEATURE_NEON )) { nregs +=16 ;if (reg < nregs) { - env->vfp.regs[(reg -32 ) *2 ] =ldfq_le_p (buf); - env->vfp.regs[(reg -32 ) *2 +1 ] =ldfq_le_p (buf +8 ); + env->vfp.regs[(reg -32 ) *2 ] =ldq_le_p (buf); + env->vfp.regs[(reg -32 ) *2 +1 ] =ldq_le_p (buf +8 );return 16 ; } }
@@ -114,8 +114,8 @@ static int aarch64_fpu_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg)switch (reg) { case 0 ... 31:/* 128 bit FP register */ -stfq_le_p (buf, env->vfp.regs[reg *2 ]); -stfq_le_p (buf +8 , env->vfp.regs[reg *2 +1 ]); +stq_le_p (buf, env->vfp.regs[reg *2 ]); +stq_le_p (buf +8 , env->vfp.regs[reg *2 +1 ]);return 16 ;case 32 :/* FPSR */
@@ -135,8 +135,8 @@ static int aarch64_fpu_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg)switch (reg) { case 0 ... 31:/* 128 bit FP register */ - env->vfp.regs[reg *2 ] =ldfq_le_p (buf); - env->vfp.regs[reg *2 +1 ] =ldfq_le_p (buf +8 ); + env->vfp.regs[reg *2 ] =ldq_le_p (buf); + env->vfp.regs[reg *2 +1 ] =ldq_le_p (buf +8 );return 16 ;case 32 :/* FPSR */
target/arm/machine.c +1 -1
@@ -50,7 +50,7 @@ static const VMStateDescription vmstate_vfp = { .minimum_version_id = 3, .needed = vfp_needed, .fields = (VMStateField []) { -VMSTATE_FLOAT64_ARRAY (env.vfp.regs,ARMCPU ,64 ), +VMSTATE_UINT64_ARRAY (env.vfp.regs,ARMCPU ,64 ),/* The xregs array is a little awkward because element 1 (FPSCR) * requires a specific accessor, so we have to split it up in * the vmstate:
target/arm/translate-a64.c +4 -4
@@ -165,12 +165,12 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f,if (flags &CPU_DUMP_FPU ) {int numvfpregs =32 ;for (i =0 ; i < numvfpregs; i +=2 ) { -uint64_t vlo =float64_val (env->vfp.regs[i *2 ]); -uint64_t vhi =float64_val (env->vfp.regs[(i *2 ) +1 ]); +uint64_t vlo = env->vfp.regs[i *2 ]; +uint64_t vhi = env->vfp.regs[(i *2 ) +1 ];cpu_fprintf (f,"q%02d=%016" PRIx64":%016" PRIx64" " , i, vhi, vlo); - vlo =float64_val (env->vfp.regs[(i +1 ) *2 ]); - vhi =float64_val (env->vfp.regs[((i +1 ) *2 ) +1 ]); + vlo = env->vfp.regs[(i +1 ) *2 ]; + vhi = env->vfp.regs[((i +1 ) *2 ) +1 ];cpu_fprintf (f,"q%02d=%016" PRIx64":%016" PRIx64"\n" , i +1 , vhi, vlo); }
target/arm/translate.c +1 -1
@@ -12572,7 +12572,7 @@ void arm_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, numvfpregs +=16 ; }for (i =0 ; i < numvfpregs; i++) { -uint64_t v =float64_val (env->vfp.regs[i]); +uint64_t v = env->vfp.regs[i]; cpu_fprintf(f, "s%02d=%08x s%02d=%08x d%02d=%016" PRIx64 "\n", i * 2, (uint32_t)v, i * 2 + 1, (uint32_t)(v >> 32),
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 11/21] target/arm: Move cpu_get_tb_cpu_state out of line
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Message-id: [email protected]
--- target/arm/cpu.h | 127 +--------------------------------------------------- target/arm/helper.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 125 deletions(-)
target/arm/cpu.h +2 -125
@@ -2667,71 +2667,6 @@ static inline bool bswap_code(bool sctlr_b)#endif } -/* Return the exception level to which FP-disabled exceptions should -* be taken, or 0 if FP is enabled. -*/ -static inline int fp_exception_el (CPUARMState *env) -{ -int fpen; -int cur_el =arm_current_el (env); - -/* CPACR and the CPTR registers don't exist before v6, so FP is -* always accessible -*/ -if (!arm_feature (env,ARM_FEATURE_V6 )) { -return 0 ; - } - -/* The CPACR controls traps to EL1, or PL1 if we're 32 bit: -* 0, 2 : trap EL0 and EL1/PL1 accesses -* 1 : trap only EL0 accesses -* 3 : trap no accesses -*/ - fpen =extract32 (env->cp15.cpacr_el1,20 ,2 ); -switch (fpen) { -case 0 : -case 2 : -if (cur_el ==0 || cur_el ==1 ) { -/* Trap to PL1, which might be EL1 or EL3 */ -if (arm_is_secure (env) && !arm_el_is_aa64 (env,3 )) { -return 3 ; - } -return 1 ; - } -if (cur_el ==3 && !is_a64 (env)) { -/* Secure PL1 running at EL3 */ -return 3 ; - } -break ; -case 1 : -if (cur_el ==0 ) { -return 1 ; - } -break ; -case 3 : -break ; - } - -/* For the CPTR registers we don't need to guard with an ARM_FEATURE -* check because zero bits in the registers mean "don't trap". -*/ - -/* CPTR_EL2 : present in v7VE or v8 */ -if (cur_el <=2 &&extract32 (env->cp15.cptr_el[2 ],10 ,1 ) - && !arm_is_secure_below_el3 (env)) { -/* Trap FP ops at EL2, NS-EL1 or NS-EL0 to EL2 */ -return 2 ; - } - -/* CPTR_EL3 : present in v8 */ -if (extract32 (env->cp15.cptr_el[3 ],10 ,1 )) { -/* Trap all FP ops to EL3 */ -return 3 ; - } - -return 0 ; -} -#ifdef CONFIG_USER_ONLY static inline bool arm_cpu_bswap_data (CPUARMState *env) {
@@ -2778,66 +2713,8 @@ static inline uint32_t arm_regime_tbi1(CPUARMState *env, ARMMMUIdx mmu_idx) }#endif -static inline void cpu_get_tb_cpu_state (CPUARMState *env,target_ulong *pc, -target_ulong *cs_base,uint32_t *flags) -{ -ARMMMUIdx mmu_idx =core_to_arm_mmu_idx (env,cpu_mmu_index (env, false)); -if (is_a64 (env)) { - *pc = env->pc; - *flags =ARM_TBFLAG_AARCH64_STATE_MASK ; -/* Get control bits for tagged addresses */ - *flags |= (arm_regime_tbi0 (env, mmu_idx) <<ARM_TBFLAG_TBI0_SHIFT ); - *flags |= (arm_regime_tbi1 (env, mmu_idx) <<ARM_TBFLAG_TBI1_SHIFT ); - }else { - *pc = env->regs[15 ]; - *flags = (env->thumb <<ARM_TBFLAG_THUMB_SHIFT ) - | (env->vfp.vec_len <<ARM_TBFLAG_VECLEN_SHIFT ) - | (env->vfp.vec_stride <<ARM_TBFLAG_VECSTRIDE_SHIFT ) - | (env->condexec_bits <<ARM_TBFLAG_CONDEXEC_SHIFT ) - | (arm_sctlr_b (env) <<ARM_TBFLAG_SCTLR_B_SHIFT ); -if (!(access_secure_reg (env))) { - *flags |=ARM_TBFLAG_NS_MASK ; - } -if (env->vfp.xregs[ARM_VFP_FPEXC ] & (1 <<30 ) - ||arm_el_is_aa64 (env,1 )) { - *flags |=ARM_TBFLAG_VFPEN_MASK ; - } - *flags |= (extract32 (env->cp15.c15_cpar,0 ,2 ) - <<ARM_TBFLAG_XSCALE_CPAR_SHIFT ); - } - - *flags |= (arm_to_core_mmu_idx (mmu_idx) <<ARM_TBFLAG_MMUIDX_SHIFT ); - -/* The SS_ACTIVE and PSTATE_SS bits correspond to the state machine -* states defined in the ARM ARM for software singlestep: -* SS_ACTIVE PSTATE.SS State -* 0 x Inactive (the TB flag for SS is always 0) -* 1 0 Active-pending -* 1 1 Active-not-pending -*/ -if (arm_singlestep_active (env)) { - *flags |=ARM_TBFLAG_SS_ACTIVE_MASK ; -if (is_a64 (env)) { -if (env->pstate &PSTATE_SS ) { - *flags |=ARM_TBFLAG_PSTATE_SS_MASK ; - } - }else { -if (env->uncached_cpsr &PSTATE_SS ) { - *flags |=ARM_TBFLAG_PSTATE_SS_MASK ; - } - } - } -if (arm_cpu_data_is_big_endian (env)) { - *flags |=ARM_TBFLAG_BE_DATA_MASK ; - } - *flags |=fp_exception_el (env) <<ARM_TBFLAG_FPEXC_EL_SHIFT ; - -if (arm_v7m_is_handler_mode (env)) { - *flags |=ARM_TBFLAG_HANDLER_MASK ; - } - - *cs_base =0 ; -} +void cpu_get_tb_cpu_state (CPUARMState *env,target_ulong *pc, +target_ulong *cs_base,uint32_t *flags);enum {QEMU_PSCI_CONDUIT_DISABLED =0 ,
target/arm/helper.c +126 -0
129 lines not on this page · raw message
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 12/21] target/arm: Hoist store to flags output in cpu_get_tb_cpu_state
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Message-id: [email protected]
--- target/arm/helper.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-)
target/arm/helper.c +19 -16
@@ -11688,34 +11688,36 @@ static inline int fp_exception_el(CPUARMState *env) }void cpu_get_tb_cpu_state (CPUARMState *env,target_ulong *pc, -target_ulong *cs_base,uint32_t *flags) +target_ulong *cs_base,uint32_t *pflags) {ARMMMUIdx mmu_idx =core_to_arm_mmu_idx (env,cpu_mmu_index (env, false)); +uint32_t flags; +if (is_a64 (env)) { *pc = env->pc; - *flags =ARM_TBFLAG_AARCH64_STATE_MASK ; + flags =ARM_TBFLAG_AARCH64_STATE_MASK ;/* Get control bits for tagged addresses */ - *flags |= (arm_regime_tbi0 (env, mmu_idx) <<ARM_TBFLAG_TBI0_SHIFT ); - *flags |= (arm_regime_tbi1 (env, mmu_idx) <<ARM_TBFLAG_TBI1_SHIFT ); + flags |= (arm_regime_tbi0 (env, mmu_idx) <<ARM_TBFLAG_TBI0_SHIFT ); + flags |= (arm_regime_tbi1 (env, mmu_idx) <<ARM_TBFLAG_TBI1_SHIFT ); }else { *pc = env->regs[15 ]; - *flags = (env->thumb <<ARM_TBFLAG_THUMB_SHIFT ) + flags = (env->thumb <<ARM_TBFLAG_THUMB_SHIFT ) | (env->vfp.vec_len <<ARM_TBFLAG_VECLEN_SHIFT ) | (env->vfp.vec_stride <<ARM_TBFLAG_VECSTRIDE_SHIFT ) | (env->condexec_bits <<ARM_TBFLAG_CONDEXEC_SHIFT ) | (arm_sctlr_b (env) <<ARM_TBFLAG_SCTLR_B_SHIFT );if (!(access_secure_reg (env))) { - *flags |=ARM_TBFLAG_NS_MASK ; + flags |=ARM_TBFLAG_NS_MASK ; }if (env->vfp.xregs[ARM_VFP_FPEXC ] & (1 <<30 ) ||arm_el_is_aa64 (env,1 )) { - *flags |=ARM_TBFLAG_VFPEN_MASK ; + flags |=ARM_TBFLAG_VFPEN_MASK ; } - *flags |= (extract32 (env->cp15.c15_cpar,0 ,2 ) - <<ARM_TBFLAG_XSCALE_CPAR_SHIFT ); + flags |= (extract32 (env->cp15.c15_cpar,0 ,2 ) + <<ARM_TBFLAG_XSCALE_CPAR_SHIFT ); } - *flags |= (arm_to_core_mmu_idx (mmu_idx) <<ARM_TBFLAG_MMUIDX_SHIFT ); + flags |= (arm_to_core_mmu_idx (mmu_idx) <<ARM_TBFLAG_MMUIDX_SHIFT );/* The SS_ACTIVE and PSTATE_SS bits correspond to the state machine * states defined in the ARM ARM for software singlestep:
@@ -11725,25 +11727,26 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc,* 1 1 Active-not-pending */ if (arm_singlestep_active (env)) { - *flags |=ARM_TBFLAG_SS_ACTIVE_MASK ; + flags |=ARM_TBFLAG_SS_ACTIVE_MASK ;if (is_a64 (env)) {if (env->pstate &PSTATE_SS ) { - *flags |=ARM_TBFLAG_PSTATE_SS_MASK ; + flags |=ARM_TBFLAG_PSTATE_SS_MASK ; } }else {if (env->uncached_cpsr &PSTATE_SS ) { - *flags |=ARM_TBFLAG_PSTATE_SS_MASK ; + flags |=ARM_TBFLAG_PSTATE_SS_MASK ; } } }if (arm_cpu_data_is_big_endian (env)) { - *flags |=ARM_TBFLAG_BE_DATA_MASK ; + flags |=ARM_TBFLAG_BE_DATA_MASK ; } - *flags |=fp_exception_el (env) <<ARM_TBFLAG_FPEXC_EL_SHIFT ; + flags |=fp_exception_el (env) <<ARM_TBFLAG_FPEXC_EL_SHIFT ;if (arm_v7m_is_handler_mode (env)) { - *flags |=ARM_TBFLAG_HANDLER_MASK ; + flags |=ARM_TBFLAG_HANDLER_MASK ; } + *pflags = flags; *cs_base =0 ; }
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 13/21] target/arm: Simplify fp_exception_el for user-only
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Message-id: [email protected]
--- target/arm/helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
target/arm/helper.c +2 -1
@@ -11627,6 +11627,7 @@ uint32_t HELPER(crc32c)(uint32_t acc, uint32_t val, uint32_t bytes)*/ static inline int fp_exception_el (CPUARMState *env) { +#ifndef CONFIG_USER_ONLY int fpen;int cur_el =arm_current_el (env);
@@ -11683,7 +11684,7 @@ static inline int fp_exception_el(CPUARMState *env)/* Trap all FP ops to EL3 */ return 3; } - +#endif return 0 ; }
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 03/21] target/arm: Mark disas_set_insn_syndrome inline
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
If it isn't used when translate.h is included,
we'll get a compiler Werror.
Message-id: [email protected]
--- target/arm/translate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/translate.h +1 -1
@@ -108,7 +108,7 @@ static inline int default_exception_el(DisasContext *s) ?3 :MAX (1 , s->current_el); } -static void disas_set_insn_syndrome (DisasContext *s,uint32_t syn) +static inline void disas_set_insn_syndrome (DisasContext *s,uint32_t syn) {/* We don't need to save all of the syndrome so we mask and shift * out unneeded bits to help the sleb128 encoder do a better job.
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 08/21] target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Helpers that return a pointer into env->vfp.regs so that we isolate the logic of how to index the regs array for different cpu modes.
Message-id: [email protected]
--- target/arm/cpu.h | 27 +++++++++++++++++++++++++++ linux-user/signal.c | 22 ++++++++++++---------- target/arm/arch_dump.c | 8 +++++--- target/arm/helper-a64.c | 5 +++-- target/arm/helper.c | 32 ++++++++++++++++++++------------ target/arm/kvm32.c | 4 ++-- target/arm/kvm64.c | 31 ++++++++++--------------------- target/arm/translate-a64.c | 25 ++++++++----------------- target/arm/translate.c | 16 +++++++++------- 9 files changed, 96 insertions(+), 74 deletions(-)
target/arm/cpu.h +27 -0
@@ -2885,4 +2885,31 @@ static inline void *arm_get_el_change_hook_opaque(ARMCPU *cpu) return cpu->el_change_hook_opaque; } +/** +* aa32_vfp_dreg: +* Return a pointer to the Dn register within env in 32-bit mode. +*/ +static inline uint64_t *aa32_vfp_dreg (CPUARMState *env,unsigned regno) +{ +return &env->vfp.regs[regno]; +} + +/** +* aa32_vfp_qreg: +* Return a pointer to the Qn register within env in 32-bit mode. +*/ +static inline uint64_t *aa32_vfp_qreg (CPUARMState *env,unsigned regno) +{ +return &env->vfp.regs[2 * regno]; +} + +/** +* aa64_vfp_qreg: +* Return a pointer to the Qn register within env in 64-bit mode. +*/ +static inline uint64_t *aa64_vfp_qreg (CPUARMState *env,unsigned regno) +{ +return &env->vfp.regs[2 * regno]; +} +#endif
linux-user/signal.c +12 -10
@@ -1487,12 +1487,13 @@ static int target_setup_sigframe(struct target_rt_sigframe *sf, }for (i =0 ; i <32 ; i++) { +uint64_t *q =aa64_vfp_qreg (env, i);#ifdef TARGET_WORDS_BIGENDIAN -__put_user (env->vfp.regs[i *2 ], &aux->fpsimd.vregs[i *2 +1 ]); -__put_user (env->vfp.regs[i *2 +1 ], &aux->fpsimd.vregs[i *2 ]); +__put_user (q[0 ], &aux->fpsimd.vregs[i *2 +1 ]); +__put_user (q[1 ], &aux->fpsimd.vregs[i *2 ]);#else -__put_user (env->vfp.regs[i *2 ], &aux->fpsimd.vregs[i *2 ]); -__put_user (env->vfp.regs[i *2 +1 ], &aux->fpsimd.vregs[i *2 +1 ]); +__put_user (q[0 ], &aux->fpsimd.vregs[i *2 ]); +__put_user (q[1 ], &aux->fpsimd.vregs[i *2 +1 ]);#endif }__put_user (vfp_get_fpsr (env), &aux->fpsimd.fpsr);
@@ -1539,12 +1540,13 @@ static int target_restore_sigframe(CPUARMState *env, }for (i =0 ; i <32 ; i++) { +uint64_t *q =aa64_vfp_qreg (env, i);#ifdef TARGET_WORDS_BIGENDIAN -__get_user (env->vfp.regs[i *2 ], &aux->fpsimd.vregs[i *2 +1 ]); -__get_user (env->vfp.regs[i *2 +1 ], &aux->fpsimd.vregs[i *2 ]); +__get_user (q[0 ], &aux->fpsimd.vregs[i *2 +1 ]); +__get_user (q[1 ], &aux->fpsimd.vregs[i *2 ]);#else -__get_user (env->vfp.regs[i *2 ], &aux->fpsimd.vregs[i *2 ]); -__get_user (env->vfp.regs[i *2 +1 ], &aux->fpsimd.vregs[i *2 +1 ]); +__get_user (q[0 ], &aux->fpsimd.vregs[i *2 ]); +__get_user (q[1 ], &aux->fpsimd.vregs[i *2 +1 ]);#endif }__get_user (fpsr, &aux->fpsimd.fpsr);
@@ -1903,7 +1905,7 @@ static abi_ulong *setup_sigframe_v2_vfp(abi_ulong *regspace, CPUARMState *env)__put_user (TARGET_VFP_MAGIC , &vfpframe->magic);__put_user (sizeof (*vfpframe), &vfpframe->size);for (i =0 ; i <32 ; i++) { -__put_user (float64_val (env->vfp.regs[i]), &vfpframe->ufp.fpregs[i]); +__put_user (*aa32_vfp_dreg (env, i), &vfpframe->ufp.fpregs[i]); }__put_user (vfp_get_fpscr (env), &vfpframe->ufp.fpscr);__put_user (env->vfp.xregs[ARM_VFP_FPEXC ], &vfpframe->ufp_exc.fpexc);
@@ -2210,7 +2212,7 @@ static abi_ulong *restore_sigframe_v2_vfp(CPUARMState *env, abi_ulong *regspace)return 0 ; }for (i =0 ; i <32 ; i++) { -__get_user (float64_val (env->vfp.regs[i]), &vfpframe->ufp.fpregs[i]); +__get_user (*aa32_vfp_dreg (env, i), &vfpframe->ufp.fpregs[i]); }__get_user (fpscr, &vfpframe->ufp.fpscr);vfp_set_fpscr (env, fpscr);
target/arm/arch_dump.c +5 -3
@@ -99,8 +99,10 @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,aarch64_note_init (¬e, s,"CORE" ,5 ,NT_PRFPREG ,sizeof (note.vfp)); -for (i =0 ; i <64 ; ++i) { - note.vfp.vregs[i] =cpu_to_dump64 (s, env->vfp.regs[i]); +for (i =0 ; i <32 ; ++i) { +uint64_t *q =aa64_vfp_qreg (env, i); + note.vfp.vregs[2 *i +0 ] =cpu_to_dump64 (s, q[0 ]); + note.vfp.vregs[2 *i +1 ] =cpu_to_dump64 (s, q[1 ]); }if (s->dump_info.d_endian ==ELFDATA2MSB ) {
@@ -229,7 +231,7 @@ static int arm_write_elf32_vfp(WriteCoreDumpFunction f, CPUARMState *env,arm_note_init (¬e, s,"LINUX" ,6 ,NT_ARM_VFP ,sizeof (note.vfp));for (i =0 ; i <32 ; ++i) { - note.vfp.vregs[i] =cpu_to_dump64 (s, env->vfp.regs[i]); + note.vfp.vregs[i] =cpu_to_dump64 (s, *aa32_vfp_dreg (env, i)); } note.vfp.fpscr =cpu_to_dump32 (s,vfp_get_fpscr (env));
target/arm/helper-a64.c +3 -2
@@ -153,13 +153,14 @@ uint64_t HELPER(simd_tbl)(CPUARMState *env, uint64_t result, uint64_t indices,if (index <16 * numregs) {/* Convert index (a byte offset into the virtual table * which is a series of 128-bit vectors concatenated) -* into the correct vfp.regs[] element plus a bit offset +* into the correct register element plus a bit offset * into that element, bearing in mind that the table * can wrap around from V31 to V0. */ int elt = (rn *2 + (index >>3 )) %64 ;int bitidx = (index &7 ) *8 ; -uint64_t val =extract64 (env->vfp.regs[elt], bitidx,8 ); +uint64_t *q =aa64_vfp_qreg (env, elt >>1 ); +uint64_t val =extract64 (q[elt &1 ], bitidx,8 ); result =deposit64 (result, shift,8 , val); }
target/arm/helper.c +20 -12
@@ -64,15 +64,16 @@ static int vfp_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg)/* VFP data registers are always little-endian. */ nregs =arm_feature (env,ARM_FEATURE_VFP3 ) ?32 :16 ;if (reg < nregs) { -stq_le_p (buf, env->vfp.regs[reg]); +stq_le_p (buf, *aa32_vfp_dreg (env, reg));return 8 ; }if (arm_feature (env,ARM_FEATURE_NEON )) {/* Aliases for Q regs. */ nregs +=16 ;if (reg < nregs) { -stq_le_p (buf, env->vfp.regs[(reg -32 ) *2 ]); -stq_le_p (buf +8 , env->vfp.regs[(reg -32 ) *2 +1 ]); +uint64_t *q =aa32_vfp_qreg (env, reg -32 ); +stq_le_p (buf, q[0 ]); +stq_le_p (buf +8 , q[1 ]);return 16 ; } }
@@ -90,14 +91,15 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg) nregs =arm_feature (env,ARM_FEATURE_VFP3 ) ?32 :16 ;if (reg < nregs) { - env->vfp.regs[reg] =ldq_le_p (buf); + *aa32_vfp_dreg (env, reg) =ldq_le_p (buf);return 8 ; }if (arm_feature (env,ARM_FEATURE_NEON )) { nregs +=16 ;if (reg < nregs) { - env->vfp.regs[(reg -32 ) *2 ] =ldq_le_p (buf); - env->vfp.regs[(reg -32 ) *2 +1 ] =ldq_le_p (buf +8 ); +uint64_t *q =aa32_vfp_qreg (env, reg -32 ); + q[0 ] =ldq_le_p (buf); + q[1 ] =ldq_le_p (buf +8 );return 16 ; } }
@@ -114,9 +116,12 @@ static int aarch64_fpu_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg)switch (reg) { case 0 ... 31:/* 128 bit FP register */ -stq_le_p (buf, env->vfp.regs[reg *2 ]); -stq_le_p (buf +8 , env->vfp.regs[reg *2 +1 ]); -return 16 ; + { +uint64_t *q =aa64_vfp_qreg (env, reg); +stq_le_p (buf, q[0 ]); +stq_le_p (buf +8 , q[1 ]); +return 16 ; + }case 32 :/* FPSR */ stl_p (buf,vfp_get_fpsr (env));
@@ -135,9 +140,12 @@ static int aarch64_fpu_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg)switch (reg) { case 0 ... 31:/* 128 bit FP register */ - env->vfp.regs[reg *2 ] =ldq_le_p (buf); - env->vfp.regs[reg *2 +1 ] =ldq_le_p (buf +8 ); -return 16 ; + { +uint64_t *q =aa64_vfp_qreg (env, reg); + q[0 ] =ldq_le_p (buf); + q[1 ] =ldq_le_p (buf +8 ); +return 16 ; + }case 32 :/* FPSR */ vfp_set_fpsr (env,ldl_p (buf));
target/arm/kvm32.c +2 -2
@@ -358,7 +358,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)/* VFP registers */ r.id =KVM_REG_ARM |KVM_REG_SIZE_U64 |KVM_REG_ARM_VFP ;for (i =0 ; i <32 ; i++) { - r.addr = (uintptr_t )(&env->vfp.regs[i]); + r.addr = (uintptr_t )aa32_vfp_dreg (env, i); ret =kvm_vcpu_ioctl (cs,KVM_SET_ONE_REG , &r);if (ret) {return ret;
@@ -445,7 +445,7 @@ int kvm_arch_get_registers(CPUState *cs)/* VFP registers */ r.id =KVM_REG_ARM |KVM_REG_SIZE_U64 |KVM_REG_ARM_VFP ;for (i =0 ; i <32 ; i++) { - r.addr = (uintptr_t )(&env->vfp.regs[i]); + r.addr = (uintptr_t )aa32_vfp_dreg (env, i); ret =kvm_vcpu_ioctl (cs,KVM_GET_ONE_REG , &r);if (ret) {return ret;
target/arm/kvm64.c +10 -21
@@ -696,21 +696,16 @@ int kvm_arch_put_registers(CPUState *cs, int level) } } -/* Advanced SIMD and FP registers -* We map Qn = regs[2n+1]:regs[2n] -*/ +/* Advanced SIMD and FP registers. */ for (i =0 ; i <32 ; i++) { -int rd = i <<1 ; -uint64_t fp_val[2 ]; +uint64_t *q =aa64_vfp_qreg (env, i);#ifdef HOST_WORDS_BIGENDIAN - fp_val[0 ] = env->vfp.regs[rd +1 ]; - fp_val[1 ] = env->vfp.regs[rd]; +uint64_t fp_val[2 ] = { q[1 ], q[0 ] }; + reg.addr = (uintptr_t )fp_val;#else - fp_val[1 ] = env->vfp.regs[rd +1 ]; - fp_val[0 ] = env->vfp.regs[rd]; + reg.addr = (uintptr_t )q;#endif reg.id =AARCH64_SIMD_CORE_REG (fp_regs.vregs[i]); - reg.addr = (uintptr_t )(&fp_val); ret =kvm_vcpu_ioctl (cs,KVM_SET_ONE_REG , ®);if (ret) {return ret;
@@ -837,24 +832,18 @@ int kvm_arch_get_registers(CPUState *cs) env->spsr = env->banked_spsr[i]; } -/* Advanced SIMD and FP registers -* We map Qn = regs[2n+1]:regs[2n] -*/ +/* Advanced SIMD and FP registers */ for (i =0 ; i <32 ; i++) { -uint64_t fp_val[2 ]; +uint64_t *q =aa64_vfp_qreg (env, i); reg.id =AARCH64_SIMD_CORE_REG (fp_regs.vregs[i]); - reg.addr = (uintptr_t )(&fp_val); + reg.addr = (uintptr_t )q; ret =kvm_vcpu_ioctl (cs,KVM_GET_ONE_REG , ®);if (ret) {return ret; }else { -int rd = i <<1 ;#ifdef HOST_WORDS_BIGENDIAN - env->vfp.regs[rd +1 ] = fp_val[0 ]; - env->vfp.regs[rd] = fp_val[1 ]; -#else - env->vfp.regs[rd +1 ] = fp_val[1 ]; - env->vfp.regs[rd] = fp_val[0 ]; +uint64_t t; + t = q[0 ], q[0 ] = q[1 ], q[1 ] = t;#endif } }
target/arm/translate-a64.c +8 -17
@@ -164,15 +164,12 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f,if (flags &CPU_DUMP_FPU ) {int numvfpregs =32 ; -for (i =0 ; i < numvfpregs; i +=2 ) { -uint64_t vlo = env->vfp.regs[i *2 ]; -uint64_t vhi = env->vfp.regs[(i *2 ) +1 ]; -cpu_fprintf (f,"q%02d=%016" PRIx64":%016" PRIx64" " , - i, vhi, vlo); - vlo = env->vfp.regs[(i +1 ) *2 ]; - vhi = env->vfp.regs[((i +1 ) *2 ) +1 ]; -cpu_fprintf (f,"q%02d=%016" PRIx64":%016" PRIx64"\n" , - i +1 , vhi, vlo); +for (i =0 ; i < numvfpregs; i++) { +uint64_t *q =aa64_vfp_qreg (env, i); +uint64_t vlo = q[0 ]; +uint64_t vhi = q[1 ]; +cpu_fprintf (f,"q%02d=%016" PRIx64":%016" PRIx64"%c" , + i, vhi, vlo, (i &1 ?'\n' :' ' )); }cpu_fprintf (f,"FPCR: %08x FPSR: %08x\n" ,vfp_get_fpcr (env),vfp_get_fpsr (env));
@@ -558,19 +555,13 @@ static TCGv_ptr vec_full_reg_ptr(DisasContext *s, int regno)*/ static inline int fp_reg_offset (DisasContext *s,int regno,TCGMemOp size) { - int offs = offsetof(CPUARMState, vfp.regs[regno * 2]); -#ifdef HOST_WORDS_BIGENDIAN - offs += (8 - (1 << size)); -#endif -assert_fp_access_checked (s); -return offs; +return vec_reg_offset (s, regno,0 , size); }/* Offset of the high half of the 128 bit vector Qn */ static inline int fp_reg_hi_offset (DisasContext *s,int regno) { -assert_fp_access_checked (s); - return offsetof(CPUARMState, vfp.regs[regno * 2 + 1]); +return vec_reg_offset (s, regno,1 ,MO_64 ); }/* Convenience accessors for reading and writing single and double
target/arm/translate.c +9 -7
@@ -1515,14 +1515,16 @@ static inline void gen_vfp_st(DisasContext *s, int dp, TCGv_i32 addr)static inline long vfp_reg_offset (int dp,int reg) { -if (dp) +if (dp) { return offsetof(CPUARMState, vfp.regs[reg]); -else if (reg &1 ) { - return offsetof(CPUARMState, vfp.regs[reg >> 1]) - + offsetof(CPU_DoubleU, l.upper); }else { - return offsetof(CPUARMState, vfp.regs[reg >> 1]) - + offsetof(CPU_DoubleU, l.lower); + long ofs = offsetof(CPUARMState, vfp.regs[reg >> 1]); +if (reg &1 ) { + ofs += offsetof(CPU_DoubleU, l.upper); + }else { + ofs += offsetof(CPU_DoubleU, l.lower); + } +return ofs; } }
@@ -12572,7 +12574,7 @@ void arm_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, numvfpregs +=16 ; }for (i =0 ; i < numvfpregs; i++) { -uint64_t v = env->vfp.regs[i]; +uint64_t v = *aa32_vfp_dreg (env, i); cpu_fprintf(f, "s%02d=%08x s%02d=%08x d%02d=%016" PRIx64 "\n", i * 2, (uint32_t)v, i * 2 + 1, (uint32_t)(v >> 32),
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 01/21] target/arm: Fix 32-bit address truncation
In reply to Peter MaydellFrom: Ard Biesheuvel <[email protected]>
Commit ("3b39d734141a target/arm: Handle page table walk load failures correctly") modified both versions of the page table walking code (i.e., arm_ldl_ptw and arm_ldq_ptw) to record the result of the translation in a temporary 'data' variable so that it can be inspected before being returned. However, arm_ldq_ptw() returns an uint64_t, and using a temporary uint32_t variable truncates the upper bits, corrupting the result. This causes problems when using more than 4 GB of memory in a TCG guest. So use a uint64_t instead.
Message-id: [email protected]
--- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/helper.c +1 -1
@@ -8360,7 +8360,7 @@ static uint64_t arm_ldq_ptw(CPUState *cs, hwaddr addr, bool is_secure,MemTxAttrs attrs = {};MemTxResult result =MEMTX_OK ;AddressSpace *as; -uint32_t data; +uint64_t data; attrs.secure = is_secure; as =arm_addressspace (cs, attrs);
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 02/21] i.MX: Fix FEC/ENET receive funtions
In reply to Peter MaydellFrom: Jean-Christophe Dubois <[email protected]>
The actual imx_eth_enable_rx() function is buggy.
It updates s->regs[ENET_RDAR] after calling qemu_flush_queued_packets().
qemu_flush_queued_packets() is going to call imx_XXX_receive() which itself is going to call imx_eth_enable_rx().
By updating s->regs[ENET_RDAR] after calling qemu_flush_queued_packets() we end up updating the register with an outdated value which might lead to disabling the receive function in the i.MX FEC/ENET device.
This patch change the place where the register update is done so that the register value stays up to date and the receive function can keep running.
Message-id: [email protected]
--- hw/net/imx_fec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
hw/net/imx_fec.c +2 -6
@@ -595,19 +595,16 @@ static void imx_eth_do_tx(IMXFECState *s, uint32_t index)static void imx_eth_enable_rx (IMXFECState *s,bool flush) {IMXFECBufDesc bd; -bool rx_ring_full;imx_fec_read_bd (&bd, s->rx_descriptor); - rx_ring_full = !(bd.flags &ENET_BD_E ); + s->regs[ENET_RDAR ] = (bd.flags &ENET_BD_E ) ?ENET_RDAR_RDAR :0 ; -if (rx_ring_full) { +if (!s->regs[ENET_RDAR ]) {FEC_PRINTF ("RX buffer full\n" ); }else if (flush) {qemu_flush_queued_packets (qemu_get_queue (s->nic)); } - - s->regs[ENET_RDAR ] = rx_ring_full ?0 :ENET_RDAR_RDAR ; }static void imx_eth_reset (DeviceState *d)
@@ -866,7 +863,6 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value,case ENET_RDAR :if (s->regs[ENET_ECR ] &ENET_ECR_ETHEREN ) {if (!s->regs[index]) { - s->regs[index] =ENET_RDAR_RDAR ;imx_eth_enable_rx (s, true); } }else {
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 15/21] hw/intc/arm_gic: Fix C_RPR value on idle priority
In reply to Peter MaydellFrom: Luc MICHEL <[email protected]>
When there is no active interrupts in the GIC, a read to the C_RPR register should return the value of the "Idle priority", which is either the maximum value an IRQ priority field can be set to, or 0xff.
Since the QEMU GIC model implements all the 8 priority bits, the Idle priority is 0xff.
Internally, when there is no active interrupt, the running priority value is 0x100. The gic_get_running_priority function returns an uint8_t and thus, truncate this value to 0x00 when returning it. This is wrong since a value of 0x00 correspond to the maximum possible priority.
This commit fixes the returned value when the internal value is 0x100.
Note that it is correct for the Non-Secure view to return 0xff even though from the NS world point of view, only 7 priority bits are implemented. The specification states that the Idle priority can be 0xff even when not all the 8 priority bits are implemented. This has been verified against a real GICv2 hardware on a Xilinx ZynqMP based board.
Regarding the ARM11MPCore version of the GIC, the specification is not clear on that point, so this commit does not alter its behavior.
Message-id: [email protected]
--- hw/intc/arm_gic.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/intc/arm_gic.c +5 -0
@@ -504,6 +504,11 @@ static void gic_set_cpu_control(GICState *s, int cpu, uint32_t value,static uint8_t gic_get_running_priority (GICState *s,int cpu,MemTxAttrs attrs) { +if ((s->revision !=REV_11MPCORE ) && (s->running_priority[cpu] >0xff )) { +/* Idle priority */ +return 0xff ; + } +if (s->security_extn && !attrs.secure) {if (s->running_priority[cpu] &0x80 ) {/* Running priority in upper half of range: return the Non-secure
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 16/21] hw/intc/arm_gic: Fix group priority computation for group 1 IRQs
In reply to Peter MaydellFrom: Luc MICHEL <[email protected]>
When determining the group priority of a group 1 IRQ, if C_CTRL.CBPR is 0, the non-secure BPR value is used. However, this value must be incremented by one so that it matches the secure world number of implemented priority bits (NS world has one less priority bit compared to the Secure world).
Message-id: [email protected]
--- hw/intc/arm_gic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/arm_gic.c +2 -1
@@ -256,7 +256,8 @@ static int gic_get_group_priority(GICState *s, int cpu, int irq)if (gic_has_groups (s) && !(s->cpu_ctlr[cpu] &GICC_CTLR_CBPR ) &&GIC_TEST_GROUP (irq, (1 << cpu))) { - bpr = s->abpr[cpu]; + bpr = s->abpr[cpu] -1 ; +assert (bpr >=0 ); }else { bpr = s->bpr[cpu]; }
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 04/21] target/arm: Use pointers in crypto helpers
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Rather than passing regnos to the helpers, pass pointers to the vector registers directly. This eliminates the need to pass in the environment pointer and reduces the number of places that directly access env->vfp.regs[].
Message-id: [email protected]
--- target/arm/helper.h | 18 ++--- target/arm/crypto_helper.c | 184 +++++++++++++++++---------------------------- target/arm/translate-a64.c | 75 ++++++++++-------- target/arm/translate.c | 68 +++++++++-------- 4 files changed, 161 insertions(+), 184 deletions(-)
target/arm/helper.h +9 -9
@@ -522,17 +522,17 @@ DEF_HELPER_3(neon_qzip8, void, env, i32, i32) DEF_HELPER_3(neon_qzip16, void, env, i32, i32) DEF_HELPER_3(neon_qzip32, void, env, i32, i32) -DEF_HELPER_4(crypto_aese, void, env, i32, i32, i32) -DEF_HELPER_4(crypto_aesmc, void, env, i32, i32, i32) +DEF_HELPER_FLAGS_3(crypto_aese, TCG_CALL_NO_RWG, void, ptr, ptr, i32) +DEF_HELPER_FLAGS_3(crypto_aesmc, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_5(crypto_sha1_3reg, void, env, i32, i32, i32, i32) -DEF_HELPER_3(crypto_sha1h, void, env, i32, i32) -DEF_HELPER_3(crypto_sha1su1, void, env, i32, i32) +DEF_HELPER_FLAGS_4(crypto_sha1_3reg, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_2(crypto_sha1h, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(crypto_sha1su1, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_4(crypto_sha256h, void, env, i32, i32, i32) -DEF_HELPER_4(crypto_sha256h2, void, env, i32, i32, i32) -DEF_HELPER_3(crypto_sha256su0, void, env, i32, i32) -DEF_HELPER_4(crypto_sha256su1, void, env, i32, i32, i32) +DEF_HELPER_FLAGS_3(crypto_sha256h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr) +DEF_HELPER_FLAGS_3(crypto_sha256h2, TCG_CALL_NO_RWG, void, ptr, ptr, ptr) +DEF_HELPER_FLAGS_2(crypto_sha256su0, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_3(crypto_sha256su1, TCG_CALL_NO_RWG, void, ptr, ptr, ptr) DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)DEF_HELPER_FLAGS_3 (crc32c,TCG_CALL_NO_RWG_SE , i32, i32, i32, i32)
target/arm/crypto_helper.c +70 -114
280 lines not on this page · raw message
target/arm/translate-a64.c +44 -31
137 lines not on this page · raw message
target/arm/translate.c +38 -30
132 lines not on this page · raw message
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 14/21] hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending"
In reply to Peter MaydellFrom: Luc MICHEL <[email protected]>
In the GIC, when an IRQ is acknowledged, its state goes from "pending" to:
- "active" if the corresponding IRQ pin has been de-asserted
- "active and pending" otherwise.
The GICv2 manual states that when a IRQ becomes active (or active and pending), the GIC should either signal another (higher priority) IRQ to the CPU if there is one, or de-assert the CPU IRQ pin.
The current implementation of the GIC in QEMU does not check if the IRQ is already active when looking for pending interrupts with sufficient priority in gic_update(). This can lead to signaling an interrupt that is already active.
This usually happens when splitting priority drop and interrupt deactivation. On priority drop, the IRQ stays active until deactivation. If it becomes pending again, chances are that it will be incorrectly selected as best_irq in gic_update().
This commit fixes this by checking if the IRQ is not already active when looking for best_irq in gic_update().
Note that regarding the ARM11MPCore GIC version, the corresponding manual is not clear on that point, but it has has no priority drop/interrupt deactivation separation, so this case should not happen.
Message-id: [email protected]
--- hw/intc/arm_gic.c | 1 + 1 file changed, 1 insertion(+)
hw/intc/arm_gic.c +1 -0
@@ -93,6 +93,7 @@ void gic_update(GICState *s) best_irq =1023 ;for (irq =0 ; irq < s->num_irq; irq++) {if (GIC_TEST_ENABLED (irq, cm) &&gic_test_pending (s, irq, cm) && + (!GIC_TEST_ACTIVE (irq, cm)) && (irq <GIC_INTERNAL ||GIC_TARGET (irq) & cm)) {if (GIC_GET_PRIORITY (irq, cpu) < best_prio) { best_prio =GIC_GET_PRIORITY (irq, cpu);
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 18/21] hw/arm/virt: Check that the CPU realize method succeeded
In reply to Peter MaydellWe were passing a NULL error pointer to the object_property_set_bool() call that realizes the CPU object. This meant that we wouldn't detect failure, and would plough blindly on to crash later trying to use a NULL CPU object pointer. Detect errors and fail instead.
In particular, this will be necessary to detect the user error of using "-cpu host" without "-enable-kvm" once we make the host CPU type be registered unconditionally rather than only in kvm_arch_init().
--- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/virt.c +1 -1
@@ -1404,7 +1404,7 @@ static void machvirt_init(MachineState *machine) "secure-memory", &error_abort); } -object_property_set_bool (cpuobj, true,"realized" ,NULL ); +object_property_set_bool (cpuobj, true,"realized" , &error_fatal);object_unref (cpuobj); }fdt_add_timer_nodes (vms);
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 05/21] target/arm: Use pointers in neon zip/uzp helpers
In reply to Peter MaydellFrom: Richard Henderson <[email protected]>
Rather than passing regnos to the helpers, pass pointers to the vector registers directly. This eliminates the need to pass in the environment pointer and reduces the number of places that directly access env->vfp.regs[].
Message-id: [email protected]
--- target/arm/helper.h | 20 +++--- target/arm/neon_helper.c | 162 +++++++++++++++++++++++++---------------------- target/arm/translate.c | 42 ++++++------ 3 files changed, 120 insertions(+), 104 deletions(-)
target/arm/helper.h +10 -10
@@ -511,16 +511,16 @@ DEF_HELPER_3(iwmmxt_muladdsl, i64, i64, i32, i32) DEF_HELPER_3(iwmmxt_muladdsw, i64, i64, i32, i32) DEF_HELPER_3(iwmmxt_muladdswl, i64, i64, i32, i32) -DEF_HELPER_3(neon_unzip8, void, env, i32, i32) -DEF_HELPER_3(neon_unzip16, void, env, i32, i32) -DEF_HELPER_3(neon_qunzip8, void, env, i32, i32) -DEF_HELPER_3(neon_qunzip16, void, env, i32, i32) -DEF_HELPER_3(neon_qunzip32, void, env, i32, i32) -DEF_HELPER_3(neon_zip8, void, env, i32, i32) -DEF_HELPER_3(neon_zip16, void, env, i32, i32) -DEF_HELPER_3(neon_qzip8, void, env, i32, i32) -DEF_HELPER_3(neon_qzip16, void, env, i32, i32) -DEF_HELPER_3(neon_qzip32, void, env, i32, i32) +DEF_HELPER_FLAGS_2(neon_unzip8, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_unzip16, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_qunzip8, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_qunzip16, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_qunzip32, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_zip8, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_zip16, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_qzip8, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_qzip16, TCG_CALL_NO_RWG, void, ptr, ptr) +DEF_HELPER_FLAGS_2(neon_qzip32, TCG_CALL_NO_RWG, void, ptr, ptr) DEF_HELPER_FLAGS_3(crypto_aese, TCG_CALL_NO_RWG, void, ptr, ptr, i32)DEF_HELPER_FLAGS_3 (crypto_aesmc,TCG_CALL_NO_RWG , void, ptr, ptr, i32)
target/arm/neon_helper.c +88 -74
248 lines not on this page · raw message
target/arm/translate.c +22 -20
99 lines not on this page · raw message
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 19/21] sdhci: fix a NULL pointer dereference due to uninitialized AddresSpace object
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
missed in 60765b6ceeb4.
Thread 1 "qemu-system-aarch64" received signal SIGSEGV, Segmentation fault. address_space_init (as=0x0, root=0x55555726e410, name=name@entry=0x555555e3f0a7 "sdhci-dma") at memory.c:3050
3050 as->root = root;
(gdb) bt
#0 address_space_init (as=0x0, root=0x55555726e410, name=name@entry=0x555555e3f0a7 "sdhci-dma") at memory.c:3050
#1 0x0000555555af62c3 in sdhci_sysbus_realize (dev=<optimized out>, errp=0x7fff7f931150) at hw/sd/sdhci.c:1564
#2 0x00005555558b25e5 in zynqmp_sdhci_realize (dev=0x555557051520, errp=0x7fff7f931150) at hw/sd/zynqmp-sdhci.c:151
#3 0x0000555555a2e7f3 in device_set_realized (obj=0x555557051520, value=<optimized out>, errp=0x7fff7f931270) at hw/core/qdev.c:966
#4 0x0000555555ba3f74 in property_set_bool (obj=0x555557051520, v=<optimized out>, name=<optimized out>, opaque=0x555556e04a20,
errp=0x7fff7f931270) at qom/object.c:1906
#5 0x0000555555ba51f4 in object_property_set (obj=obj@entry=0x555557051520, v=v@entry=0x5555576dbd60,
name=name@entry=0x555555dd6306 "realized", errp=errp@entry=0x7fff7f931270) at qom/object.c:1102Message-id: [email protected]
--- include/hw/sd/sdhci.h | 1 + hw/sd/sdhci.c | 1 + 2 files changed, 2 insertions(+)
include/hw/sd/sdhci.h +1 -0
@@ -41,6 +41,7 @@ typedef struct SDHCIState {/*< public >*/ SDBus sdbus;MemoryRegion iomem; +AddressSpace sysbus_dma_as;AddressSpace *dma_as;MemoryRegion *dma_mr;
hw/sd/sdhci.c +1 -0
@@ -1388,6 +1388,7 @@ static void sdhci_sysbus_realize(DeviceState *dev, Error ** errp) }if (s->dma_mr) { + s->dma_as = &s->sysbus_dma_as;address_space_init (s->dma_as, s->dma_mr,"sdhci-dma" ); }else {/* use system_memory() if property "dma" not set */
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 20/21] xilinx_spips: Correct usage of an uninitialized local variable
In reply to Peter MaydellFrom: Francisco Iglesias <[email protected]>
Coverity found that the variable tx_rx in the function xilinx_spips_flush_txfifo was being used uninitialized (CID 1383841). This patch corrects this by always initializing tx_rx to zeros.
Message-id: [email protected]
--- hw/ssi/xilinx_spips.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
hw/ssi/xilinx_spips.c +17 -1
@@ -210,6 +210,9 @@#define SNOOP_NONE 0xEE#define SNOOP_STRIPING 0 +#define MIN_NUM_BUSSES 1 +#define MAX_NUM_BUSSES 2 +static inline int num_effective_busses (XilinxSPIPS *s) { return (s->regs[R_LQSPI_CFG] & LQSPI_CFG_SEP_BUS &&
@@ -573,7 +576,7 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)for (;;) {int i;uint8_t tx =0 ; -uint8_t tx_rx[num_effective_busses (s)]; +uint8_t tx_rx[MAX_NUM_BUSSES ] = {0 };uint8_t dummy_cycles =0 ;uint8_t addr_length;
@@ -1221,6 +1224,19 @@ static void xilinx_spips_realize(DeviceState *dev, Error **errp)DB_PRINT_L (0 ,"realized spips\n" ); +if (s->num_busses >MAX_NUM_BUSSES ) { +error_setg (errp, +"requested number of SPI busses %u exceeds maximum %d" , + s->num_busses,MAX_NUM_BUSSES ); +return ; + } +if (s->num_busses <MIN_NUM_BUSSES ) { +error_setg (errp, +"requested number of SPI busses %u is below minimum %d" , + s->num_busses,MIN_NUM_BUSSES ); +return ; + } + s->spi = g_new(SSIBus *, s->num_busses);for (i =0 ; i < s->num_busses; ++i) {char bus_name[16 ];
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 17/21] hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1
In reply to Peter MaydellFrom: Luc MICHEL <[email protected]>
When C_CTRL.CBPR is 1, the Non-Secure view of C_BPR is altered:
- A Non-Secure read of C_BPR should return the BPR value plus 1, saturated to 7,
- A Non-Secure write should be ignored.
Message-id: [email protected]
--- hw/intc/arm_gic.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
hw/intc/arm_gic.c +13 -3
@@ -1212,8 +1212,13 @@ static MemTxResult gic_cpu_read(GICState *s, int cpu, int offset,break ;case 0x08 :/* Binary Point */ if (s->security_extn && !attrs.secure) { -/* BPR is banked. Non-secure copy stored in ABPR. */ - *data = s->abpr[cpu]; +if (s->cpu_ctlr[cpu] &GICC_CTLR_CBPR ) { +/* NS view of BPR when CBPR is 1 */ + *data =MIN (s->bpr[cpu] +1 ,7 ); + }else { +/* BPR is banked. Non-secure copy stored in ABPR. */ + *data = s->abpr[cpu]; + } }else { *data = s->bpr[cpu]; }
@@ -1286,7 +1291,12 @@ static MemTxResult gic_cpu_write(GICState *s, int cpu, int offset,break ;case 0x08 :/* Binary Point */ if (s->security_extn && !attrs.secure) { - s->abpr[cpu] =MAX (value &0x7 ,GIC_MIN_ABPR ); +if (s->cpu_ctlr[cpu] &GICC_CTLR_CBPR ) { +/* WI when CBPR is 1 */ +return MEMTX_OK ; + }else { + s->abpr[cpu] =MAX (value &0x7 ,GIC_MIN_ABPR ); + } }else { s->bpr[cpu] =MAX (value &0x7 ,GIC_MIN_BPR ); }
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 21/21] pl110: Implement vertical compare/next base interrupts
In reply to Peter MaydellFrom: Linus Walleij <[email protected]>
This implements rudimentary support for interrupt generation on the PL110. I am working on a new DRI/KMS driver for Linux and since that uses the blanking interrupt, we need something to fire here. Without any interrupt support Linux waits for a while and then gives ugly messages about the vblank not working in the console (it does not hang perpetually or anything though, DRI is pretty forgiving).
I solved it for now by setting up a timer to fire at 60Hz and pull the interrupts for "vertical compare" and "next memory base" at this interval. This works fine and fires roughly the same number of IRQs on QEMU as on the hardware and leaves the console clean and nice.
People who want to create more accurate emulation can probably work on top of this if need be. It is certainly closer to the hardware behaviour than what we have today anyway.
Message-id: [email protected]
--- hw/display/pl110.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
hw/display/pl110.c +29 -1
@@ -12,6 +12,7 @@#include "ui/console.h" #include "framebuffer.h" #include "ui/pixel_ops.h" +#include "qemu/timer.h" #include "qemu/log.h" #define PL110_CR_EN 0x001
@@ -19,6 +20,8 @@#define PL110_CR_BEBO 0x200#define PL110_CR_BEPO 0x400#define PL110_CR_PWR 0x800 +#define PL110_IE_NB 0x004 +#define PL110_IE_VC 0x008enum pl110_bppmode {
@@ -50,6 +53,7 @@ typedef struct PL110State {MemoryRegion iomem;MemoryRegionSection fbsection;QemuConsole *con; +QEMUTimer *vblank_timer;int version;uint32_t timing[4 ];
@@ -320,7 +324,24 @@ static void pl110_resize(PL110State *s, int width, int height)/* Update interrupts. */ static void pl110_update (PL110State *s) { -/* TODO: Implement interrupts. */ +/* Raise IRQ if enabled and any status bit is 1 */ +if (s->int_status & s->int_mask) { +qemu_irq_raise (s->irq); + }else { +qemu_irq_lower (s->irq); + } +} + +static void pl110_vblank_interrupt (void *opaque) +{ +PL110State *s = opaque; + +/* Fire the vertical compare and next base IRQs and re-arm */ + s->int_status |= (PL110_IE_NB |PL110_IE_VC ); +timer_mod (s->vblank_timer, +qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ) + +NANOSECONDS_PER_SECOND /60 ); +pl110_update (s); } static uint64_t pl110_read(void *opaque, hwaddr offset,
@@ -429,6 +450,11 @@ static void pl110_write(void *opaque, hwaddr offset, s->bpp = (val >>1 ) &7 ;if (pl110_enabled (s)) {qemu_console_resize (s->con, s->cols, s->rows); +timer_mod (s->vblank_timer, +qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ) + +NANOSECONDS_PER_SECOND /60 ); + }else { +timer_del (s->vblank_timer); }break ;case 10 :/* LCDICR */
@@ -474,6 +500,8 @@ static void pl110_realize(DeviceState *dev, Error **errp)memory_region_init_io (&s->iomem,OBJECT (s), &pl110_ops, s,"pl110" ,0x1000 );sysbus_init_mmio (sbd, &s->iomem);sysbus_init_irq (sbd, &s->irq); + s->vblank_timer =timer_new_ns (QEMU_CLOCK_VIRTUAL , + pl110_vblank_interrupt, s);qdev_init_gpio_in (dev, pl110_mux_ctrl_set,1 ); s->con =graphic_console_init (dev,0 , &pl110_gfx_ops, s); }
Signature · 1 line
2.7.4
This series seems to have some coding style problems. See output below for more information:
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 00/21] target-arm queue
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
git config --local diff.renamelimit 0
git config --local diff.renames True
commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'a7ead1ca00 pl110: Implement vertical compare/next base interruptsf66ce5c2c3 xilinx_spips: Correct usage of an uninitialized local variable d88421481d sdhci: fix a NULL pointer dereference due to uninitialized AddresSpace object 7564bd6dfb hw/arm/virt: Check that the CPU realize method succeeded18db7a35b4 hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1 157a918a47 hw/intc/arm_gic: Fix group priority computation for group 1 IRQs a896e5197e hw/intc/arm_gic: Fix C_RPR value on idle priorityed702de6c2 hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending" 0c5df69251 target/arm: Simplify fp_exception_el for user-only0901e742d2 target/arm: Hoist store to flags output in cpu_get_tb_cpu_state 30d076c766 target/arm: Move cpu_get_tb_cpu_state out of line9bc4918ade target/arm: Add ARM_FEATURE_SVE9afce6e002 vmstate: Add VMSTATE_UINT64_SUB_ARRAY911f6046fd target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers768420eeb2 target/arm: Change the type of vfp.regsd2beafabf0 target/arm: Use pointers in neon tbl helpere00821354c target/arm: Use pointers in neon zip/uzp helpersac24cb1f18 target/arm: Use pointers in crypto helpersdf207ebf53 target/arm: Mark disas_set_insn_syndrome inlinea13bffeacc i.MX: Fix FEC/ENET receive funtionscc82dfe8c8 target/arm: Fix 32-bit address truncation
=== OUTPUT BEGIN ===
Checking PATCH 1/21: target/arm: Fix 32-bit address truncation... Checking PATCH 2/21: i.MX: Fix FEC/ENET receive funtions... Checking PATCH 3/21: target/arm: Mark disas_set_insn_syndrome inline... Checking PATCH 4/21: target/arm: Use pointers in crypto helpers... Checking PATCH 5/21: target/arm: Use pointers in neon zip/uzp helpers...
ERROR: trailing whitespace
#321: FILE: target/arm/translate.c:4691:
+ $
total: 1 errors, 0 warnings, 373 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 6/21: target/arm: Use pointers in neon tbl helper... Checking PATCH 7/21: target/arm: Change the type of vfp.regs... Checking PATCH 8/21: target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers...
ERROR: spaces required around that '*' (ctx:VxV)
#88: FILE: target/arm/arch_dump.c:104:
+ note.vfp.vregs[2*i + 0] = cpu_to_dump64(s, q[0]);
^ERROR: spaces required around that '*' (ctx:VxV)
#89: FILE: target/arm/arch_dump.c:105:
+ note.vfp.vregs[2*i + 1] = cpu_to_dump64(s, q[1]);
^total: 2 errors, 0 warnings, 327 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 9/21: vmstate: Add VMSTATE_UINT64_SUB_ARRAY...
Checking PATCH 10/21: target/arm: Add ARM_FEATURE_SVE...
Checking PATCH 11/21: target/arm: Move cpu_get_tb_cpu_state out of line...
Checking PATCH 12/21: target/arm: Hoist store to flags output in cpu_get_tb_cpu_state... Checking PATCH 13/21: target/arm: Simplify fp_exception_el for user-only...
Checking PATCH 14/21: hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending"... Checking PATCH 15/21: hw/intc/arm_gic: Fix C_RPR value on idle priority...
Checking PATCH 16/21: hw/intc/arm_gic: Fix group priority computation for group 1 IRQs... Checking PATCH 17/21: hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1... Checking PATCH 18/21: hw/arm/virt: Check that the CPU realize method succeeded...
Checking PATCH 19/21: sdhci: fix a NULL pointer dereference due to uninitialized AddresSpace object... Checking PATCH 20/21: xilinx_spips: Correct usage of an uninitialized local variable... Checking PATCH 21/21: pl110: Implement vertical compare/next base interrupts...
=== OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Peter Maydell
AppliedQuoted 20 lines · Peter Maydell
Arm queue built up to a point where it seems worth sending:
various bug fixes, plus RTH's refactoring in preparation for SVE.thanks
-- PMMThe following changes since commit
0f79bfe38a2cf0f43c7ea4959da7f8ebd7858f3d:Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging (2018-01-25 09:53:53 +0000)
are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.gittags/pull-target-arm-20180125for you to fetch changes up to
24da047af0e99a83fcc0d50b86c0f2627f7418b3:pl110: Implement vertical compare/next base interrupts (2018-01-25 11:45:30 +0000)
Quoted 14 lines
----------------------------------------------------------------
target-arm queue:
* target/arm: Fix address truncation in 64-bit pagetable walks
* i.MX: Fix FEC/ENET receive functions
* target/arm: preparatory refactoring for SVE emulation
* hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending"
* hw/intc/arm_gic: FixC_RPRvalue on idle priority
* hw/intc/arm_gic: Fix group priority computation for group 1 IRQs
* hw/intc/arm_gic: Fix the NS view ofC_BPRwhen C_CTRL.CBPR is 1
* hw/arm/virt: Check that the CPU realize method succeeded
* sdhci: fix a NULL pointer dereference due to uninitialized AddressSpace object
*xilinx_spips: Correct usage of an uninitialized local variable
* pl110: Implement vertical compare/next base interrupts
Applied, thanks.
-- PMM