Skip to contentSkip to conversation

target/arm: Reduce overhead of cpu_get_tb_cpu_state

PATCH Superseded Richard Henderson 4 participants 10 messages Feb 22, 2019 – Mar 2, 2019

v3 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v3 cover target/arm: Reduce overhead of cpu_get_tb_cpu_state

Changes since v2:
* Do not cache VECLEN, VECSTRIDE, VFPEN.
These variables come from VFP_FPSCR and VFP_FPEXC, not from system control registers.
* Move HANDLER and STACKCHECK to rebuild_hflags_a32, instead of building them in rebuild_hflags_common.

Changes since v1:
* Apparently I had started a last-minute API change, and failed to covert all of the users, and also failed to re-test afterward.
* Retain assertions for --enable-debug-tcg.

r~

Richard Henderson (3):
target/arm: Split out recompute_hflags et al target/arm: Rebuild hflags at el changes and MSR writes target/arm: Rely on hflags correct in cpu_get_tb_cpu_state

 target/arm/cpu.h           |  28 ++--
 target/arm/helper.h        |   3 +
 target/arm/internals.h     |   4 +
 linux-user/syscall.c       |   1 +
 target/arm/cpu.c           |   1 +
 target/arm/helper-a64.c    |   3 +
 target/arm/helper.c        | 266 ++++++++++++++++++++++---------------
 target/arm/machine.c       |   1 +
 target/arm/op_helper.c     |   1 +
 target/arm/translate-a64.c |   6 +-
 target/arm/translate.c     |  14 +-
 11 files changed, 212 insertions(+), 116 deletions(-)
Signature · 1 line
2.17.2
#1 lore raw

PATCH v3 1/3 target/arm: Split out recompute_hflags et al

We will use these to minimize the computation for every call to cpu_get_tb_cpu_state. For now, the env->hflags variable is not used.

---
v3: Do not cache VECLEN, VECSTRIDE, VFPEN.
Move HANDLER and STACKCHECK to rebuild_hflags_a32.

---
 target/arm/cpu.h       |  28 +++--
 target/arm/helper.h    |   3 +
 target/arm/internals.h |   3 +
 target/arm/helper.c    | 254 ++++++++++++++++++++++++-----------------
 4 files changed, 175 insertions(+), 113 deletions(-)
target/arm/cpu.h +20 -8
index 84ae6849c2..30532bf53e 100644
@@ -240,6 +240,9 @@ typedef struct CPUARMState {
     uint32_t pstate;
     uint32_t aarch64; /* 1 if CPU is in aarch64 state; inverse of PSTATE.nRW */
 
+    /* Cached TBFLAGS state.  See below for which bits are included.  */
+    uint32_t hflags;
+
     /* Frequently accessed CPSR bits are stored separately for efficiency.
        This contains all the other bits.  Use cpsr_{read,write} to access
        the whole CPSR.  */
@@ -3065,25 +3068,28 @@ static inline bool arm_cpu_data_is_big_endian(CPUARMState *env)
 
 #include "exec/cpu-all.h"
 
-/* Bit usage in the TB flags field: bit 31 indicates whether we are
+/*
+ * Bit usage in the TB flags field: bit 31 indicates whether we are
  * in 32 or 64 bit mode. The meaning of the other bits depends on that.
  * We put flags which are shared between 32 and 64 bit mode at the top
  * of the word, and flags which apply to only one mode at the bottom.
+ *
+ * Unless otherwise noted, these bits are cached in env->hflags.
  */
 FIELD(TBFLAG_ANY, AARCH64_STATE, 31, 1)
 FIELD(TBFLAG_ANY, MMUIDX, 28, 3)
 FIELD(TBFLAG_ANY, SS_ACTIVE, 27, 1)
-FIELD(TBFLAG_ANY, PSTATE_SS, 26, 1)
+FIELD(TBFLAG_ANY, PSTATE_SS, 26, 1)     /* Not cached. */
 /* Target EL if we take a floating-point-disabled exception */
 FIELD(TBFLAG_ANY, FPEXC_EL, 24, 2)
 FIELD(TBFLAG_ANY, BE_DATA, 23, 1)
 
 /* Bit usage when in AArch32 state: */
-FIELD(TBFLAG_A32, THUMB, 0, 1)
-FIELD(TBFLAG_A32, VECLEN, 1, 3)
-FIELD(TBFLAG_A32, VECSTRIDE, 4, 2)
-FIELD(TBFLAG_A32, VFPEN, 7, 1)
-FIELD(TBFLAG_A32, CONDEXEC, 8, 8)
+FIELD(TBFLAG_A32, THUMB, 0, 1)          /* Not cached. */
+FIELD(TBFLAG_A32, VECLEN, 1, 3)         /* Not cached. */
+FIELD(TBFLAG_A32, VECSTRIDE, 4, 2)      /* Not cached. */
+FIELD(TBFLAG_A32, VFPEN, 7, 1)          /* Not cached. */
+FIELD(TBFLAG_A32, CONDEXEC, 8, 8)       /* Not cached. */
 FIELD(TBFLAG_A32, SCTLR_B, 16, 1)
 /* We store the bottom two bits of the CPAR as TB flags and handle
  * checks on the other bits at runtime
@@ -3105,7 +3111,7 @@ FIELD(TBFLAG_A64, SVEEXC_EL, 2, 2)
 FIELD(TBFLAG_A64, ZCR_LEN, 4, 4)
 FIELD(TBFLAG_A64, PAUTH_ACTIVE, 8, 1)
 FIELD(TBFLAG_A64, BT, 9, 1)
-FIELD(TBFLAG_A64, BTYPE, 10, 2)
+FIELD(TBFLAG_A64, BTYPE, 10, 2)         /* Not cached. */
 FIELD(TBFLAG_A64, TBID, 12, 2)
 
 static inline bool bswap_code(bool sctlr_b)
@@ -3190,6 +3196,12 @@ void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook,
 void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, void
         *opaque);
 
+/**
+ * arm_rebuild_hflags:
+ * Rebuild the cached TBFLAGS for arbitrary changed processor state.
+ */
+void arm_rebuild_hflags(CPUARMState *env);
+
 /**
  * aa32_vfp_dreg:
  * Return a pointer to the Dn register within env in 32-bit mode.
target/arm/helper.h +3 -0
index 923e8e1525..bbc1a48089 100644
@@ -89,6 +89,9 @@ DEF_HELPER_4(msr_banked, void, env, i32, i32, i32)
 DEF_HELPER_2(get_user_reg, i32, env, i32)
 DEF_HELPER_3(set_user_reg, void, env, i32, i32)
 
+DEF_HELPER_FLAGS_2(rebuild_hflags_a32, TCG_CALL_NO_RWG, void, env, i32)
+DEF_HELPER_FLAGS_2(rebuild_hflags_a64, TCG_CALL_NO_RWG, void, env, i32)
+
 DEF_HELPER_1(vfp_get_fpscr, i32, env)
 DEF_HELPER_2(vfp_set_fpscr, void, env, i32)
 
target/arm/internals.h +3 -0
index a4bd1becb7..8c1b813364 100644
@@ -968,4 +968,7 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va,
 ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va,
                                    ARMMMUIdx mmu_idx, bool data);
 
+uint32_t rebuild_hflags_a32(CPUARMState *env, int el);
+uint32_t rebuild_hflags_a64(CPUARMState *env, int el);
+
 #endif
target/arm/helper.c +149 -105

288 lines not on this page · raw message

Signature · 1 line
2.17.2
#2 lore raw

PATCH v3 2/3 target/arm: Rebuild hflags at el changes and MSR writes

In reply to Richard Henderson

Now setting, but not relying upon, env->hflags.

---
v2: Fixed partial conversion to assignment to env->hflags.

---
 target/arm/internals.h     |  1 +
 linux-user/syscall.c       |  1 +
 target/arm/cpu.c           |  1 +
 target/arm/helper-a64.c    |  3 +++
 target/arm/helper.c        |  2 ++
 target/arm/machine.c       |  1 +
 target/arm/op_helper.c     |  1 +
 target/arm/translate-a64.c |  6 +++++-
 target/arm/translate.c     | 14 ++++++++++++--
 9 files changed, 27 insertions(+), 3 deletions(-)
target/arm/internals.h +1 -0
index 8c1b813364..235f4fafec 100644
@@ -970,5 +970,6 @@ ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va,
 
 uint32_t rebuild_hflags_a32(CPUARMState *env, int el);
 uint32_t rebuild_hflags_a64(CPUARMState *env, int el);
+void rebuild_hflags_any(CPUARMState *env);
 
 #endif
linux-user/syscall.c +1 -0
index 5bbb72f3d5..123f342bdc 100644
@@ -9691,6 +9691,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                     aarch64_sve_narrow_vq(env, vq);
                 }
                 env->vfp.zcr_el[1] = vq - 1;
+                arm_rebuild_hflags(env);
                 ret = vq * 16;
             }
             return ret;
target/arm/cpu.c +1 -0
index edf6e0e1f1..e4da513eb3 100644
@@ -390,6 +390,7 @@ static void arm_cpu_reset(CPUState *s)
 
     hw_breakpoint_update_all(cpu);
     hw_watchpoint_update_all(cpu);
+    arm_rebuild_hflags(env);
 }
 
 bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
target/arm/helper-a64.c +3 -0
index 70850e564d..17200f1288 100644
@@ -995,6 +995,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
         } else {
             env->regs[15] = new_pc & ~0x3;
         }
+        env->hflags = rebuild_hflags_a32(env, new_el);
         qemu_log_mask(CPU_LOG_INT, "Exception return from AArch64 EL%d to "
                       "AArch32 EL%d PC 0x%" PRIx32 "\n",
                       cur_el, new_el, env->regs[15]);
@@ -1006,10 +1007,12 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
         }
         aarch64_restore_sp(env, new_el);
         env->pc = new_pc;
+        env->hflags = rebuild_hflags_a64(env, new_el);
         qemu_log_mask(CPU_LOG_INT, "Exception return from AArch64 EL%d to "
                       "AArch64 EL%d PC 0x%" PRIx64 "\n",
                       cur_el, new_el, env->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.
target/arm/helper.c +2 -0
index 29486a09f6..1140739d6b 100644
@@ -9201,6 +9201,7 @@ static void take_aarch32_exception(CPUARMState *env, int new_mode,
         env->regs[14] = env->regs[15] + offset;
     }
     env->regs[15] = newpc;
+    env->hflags = rebuild_hflags_a32(env, arm_current_el(env));
 }
 
 static void arm_cpu_do_interrupt_aarch32_hyp(CPUState *cs)
@@ -9546,6 +9547,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
 
     pstate_write(env, PSTATE_DAIF | new_mode);
     env->aarch64 = 1;
+    env->hflags = rebuild_hflags_a64(env, new_el);
     aarch64_restore_sp(env, new_el);
 
     env->pc = addr;
target/arm/machine.c +1 -0
index 124192bfc2..e944d6b736 100644
@@ -743,6 +743,7 @@ static int cpu_post_load(void *opaque, int version_id)
     if (!kvm_enabled()) {
         pmu_op_finish(&cpu->env);
     }
+    arm_rebuild_hflags(&cpu->env);
 
     return 0;
 }
target/arm/op_helper.c +1 -0
index c998eadfaa..f82eeae7e4 100644
@@ -571,6 +571,7 @@ void HELPER(cpsr_write_eret)(CPUARMState *env, uint32_t val)
      */
     env->regs[15] &= (env->thumb ? ~1 : ~3);
 
+    env->hflags = rebuild_hflags_a32(env, arm_current_el(env));
     qemu_mutex_lock_iothread();
     arm_call_el_change_hook(arm_env_get_cpu(env));
     qemu_mutex_unlock_iothread();
target/arm/translate-a64.c +5 -1
index af8e4fd4be..a786c7ef5f 100644
@@ -1841,11 +1841,15 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
         /* I/O operations must end the TB here (whether read or write) */
         gen_io_end();
         s->base.is_jmp = DISAS_UPDATE;
-    } else if (!isread && !(ri->type & ARM_CP_SUPPRESS_TB_END)) {
+    }
+    if (!isread && !(ri->type & ARM_CP_SUPPRESS_TB_END)) {
         /* We default to ending the TB on a coprocessor register write,
          * but allow this to be suppressed by the register definition
          * (usually only necessary to work around guest bugs).
          */
+        TCGv_i32 tcg_el = tcg_const_i32(s->current_el);
+        gen_helper_rebuild_hflags_a64(cpu_env, tcg_el);
+        tcg_temp_free_i32(tcg_el);
         s->base.is_jmp = DISAS_UPDATE;
     }
 }
target/arm/translate.c +12 -2
index dac737f6ca..1cdb575ccd 100644
@@ -8563,6 +8563,8 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn)
     ri = get_arm_cp_reginfo(s->cp_regs,
             ENCODE_CP_REG(cpnum, is64, s->ns, crn, crm, opc1, opc2));
     if (ri) {
+        bool need_exit_tb;
+
         /* Check access permissions */
         if (!cp_access_ok(s->current_el, ri, isread)) {
             return 1;
@@ -8735,15 +8737,23 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn)
             }
         }
 
+        need_exit_tb = false;
         if ((tb_cflags(s->base.tb) & CF_USE_ICOUNT) && (ri->type & ARM_CP_IO)) {
             /* I/O operations must end the TB here (whether read or write) */
             gen_io_end();
-            gen_lookup_tb(s);
-        } else if (!isread && !(ri->type & ARM_CP_SUPPRESS_TB_END)) {
+            need_exit_tb = true;
+        }
+        if (!isread && !(ri->type & ARM_CP_SUPPRESS_TB_END)) {
             /* We default to ending the TB on a coprocessor register write,
              * but allow this to be suppressed by the register definition
              * (usually only necessary to work around guest bugs).
              */
+            TCGv_i32 tcg_el = tcg_const_i32(s->current_el);
+            gen_helper_rebuild_hflags_a32(cpu_env, tcg_el);
+            tcg_temp_free_i32(tcg_el);
+            need_exit_tb = true;
+        }
+        if (need_exit_tb) {
             gen_lookup_tb(s);
         }
 
Signature · 1 line
2.17.2
#3 lore raw

PATCH v3 3/3 target/arm: Rely on hflags correct in cpu_get_tb_cpu_state

In reply to Richard Henderson

This is the payoff.

Quoted 1 line

From perf record -g data of ubuntu 18 boot and shutdown:

BEFORE:

- 23.02% 2.82% qemu-system-aar [.] helper_lookup_tb_ptr
- 20.22% helper_lookup_tb_ptr
+ 10.05% tb_htable_lookup
- 9.13% cpu_get_tb_cpu_state
3.20% aa64_va_parameters_both
0.55% fp_exception_el

- 11.66% 4.74% qemu-system-aar [.] cpu_get_tb_cpu_state
- 6.96% cpu_get_tb_cpu_state

        3.63% aa64_va_parameters_both
        0.60% fp_exception_el
        0.53% sve_exception_el

AFTER:

- 16.40% 3.40% qemu-system-aar [.] helper_lookup_tb_ptr
- 13.03% helper_lookup_tb_ptr

      + 11.19% tb_htable_lookup
        0.55% cpu_get_tb_cpu_state

     0.98%     0.71%  qemu-system-aar  [.] cpu_get_tb_cpu_state

     0.87%     0.24%  qemu-system-aar  [.] rebuild_hflags_a64

Before, helper_lookup_tb_ptr is the second hottest function in the application, consuming almost a quarter of the runtime. Within the entire execution, cpu_get_tb_cpu_state consumes about 12%.

After, helper_lookup_tb_ptr has dropped to the fourth hottest function, with consumption dropping to a sixth of the runtime. Within the entire execution, cpu_get_tb_cpu_state has dropped below 1%, and the supporting function to rebuild hflags also consumes about 1%.

Assertions are retained for --enable-debug-tcg.

---
v2: Retain asserts for future debugging.

---
 target/arm/helper.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
target/arm/helper.c +15 -5
index 1140739d6b..0d19333be0 100644
@@ -14027,19 +14027,29 @@ void HELPER(rebuild_hflags_a64)(CPUARMState *env, uint32_t el)
 void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc,
                           target_ulong *cs_base, uint32_t *pflags)
 {
-    int current_el = arm_current_el(env);
-    uint32_t flags;
+    uint32_t flags = env->hflags;
     uint32_t pstate_for_ss;
 
+#ifdef CONFIG_DEBUG_TCG
+    {
+        int el = arm_current_el(env);
+        uint32_t check_flags;
+        if (is_a64(env)) {
+            check_flags = rebuild_hflags_a64(env, el);
+        } else {
+            check_flags = rebuild_hflags_a32(env, el);
+        }
+        g_assert_cmphex(flags, ==, check_flags);
+    }
+#endif
+
     *cs_base = 0;
-    if (is_a64(env)) {
+    if (FIELD_EX32(flags, TBFLAG_ANY, AARCH64_STATE)) {
         *pc = env->pc;
-        flags = rebuild_hflags_a64(env, current_el);
         flags = FIELD_DP32(flags, TBFLAG_A64, BTYPE, env->btype);
         pstate_for_ss = env->pstate;
     } else {
         *pc = env->regs[15];
-        flags = rebuild_hflags_a32(env, current_el);
         flags = FIELD_DP32(flags, TBFLAG_A32, THUMB, env->thumb);
         flags = FIELD_DP32(flags, TBFLAG_A32, CONDEXEC, env->condexec_bits);
         flags = FIELD_DP32(flags, TBFLAG_A32, VECLEN, env->vfp.vec_len);
Signature · 1 line
2.17.2
Tested-by on the v3 series
#4 lore raw
In reply to Richard Henderson
Quoted 11 lines · Richard Henderson

Changes since v2:
* Do not cache VECLEN, VECSTRIDE, VFPEN.
These variables come from VFP_FPSCR and VFP_FPEXC, not from system control registers.
* Move HANDLER and STACKCHECK to rebuild_hflags_a32, instead of building them in rebuild_hflags_common.

Changes since v1:
* Apparently I had started a last-minute API change, and failed to covert all of the users, and also failed to re-test afterward.
* Retain assertions for --enable-debug-tcg.

I thought I was being clever by running our armhf test binaries on a aarch64 image. However I have re-tested by doing a full armhf buster install this time:

Quoted 11 lines

r~

Richard Henderson (3):
target/arm: Split out recompute_hflags et al target/arm: Rebuild hflags at el changes and MSR writes target/arm: Rely on hflags correct in cpu_get_tb_cpu_state

Quoted 12 lines
 target/arm/cpu.h           |  28 ++--
 target/arm/helper.h        |   3 +
 target/arm/internals.h     |   4 +
 linux-user/syscall.c       |   1 +
 target/arm/cpu.c           |   1 +
 target/arm/helper-a64.c    |   3 +
 target/arm/helper.c        | 266 ++++++++++++++++++++++---------------
 target/arm/machine.c       |   1 +
 target/arm/op_helper.c     |   1 +
 target/arm/translate-a64.c |   6 +-
 target/arm/translate.c     |  14 +-
 11 files changed, 212 insertions(+), 116 deletions(-)

--
Alex Bennée

#5 lore raw
Quoted 10 lines · Alex Bennée
Quoted 7 lines · Richard Henderson

Changes since v2:
* Do not cache VECLEN, VECSTRIDE, VFPEN.
These variables come from VFP_FPSCR and VFP_FPEXC, not from system control registers.
* Move HANDLER and STACKCHECK to rebuild_hflags_a32, instead of building them in rebuild_hflags_common.

Quoted 7 lines
Quoted 4 lines

Changes since v1:
* Apparently I had started a last-minute API change, and failed to covert all of the users, and also failed to re-test afterward.
* Retain assertions for --enable-debug-tcg.

I thought I was being clever by running our armhf test binaries on a aarch64 image.

You and me both. ;-P

r~

#6 lore raw
In reply to Richard Henderson
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 0/3] target/arm: Reduce overhead of cpu_get_tb_cpu_state
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
1d4a9cbd21 target/arm: Rely on hflags correct in cpu_get_tb_cpu_state c6ed04439c target/arm: Rebuild hflags at el changes and MSR writes 37d8117eac target/arm: Split out recompute_hflags et al

=== OUTPUT BEGIN ===
1/3 Checking commit 37d8117eacef (target/arm: Split out recompute_hflags et al)
WARNING: Block comments use a leading /* on a separate line
#125: FILE: target/arm/helper.c:12860:
+ /* v8M always applies stack limit checks unless CCR.STKOFHFNMIGN is

WARNING: Block comments use a leading /* on a separate line #170: FILE: target/arm/helper.c:12905:
+ /* If SVE is disabled, but FP is enabled,

total: 0 errors, 2 warnings, 368 lines checked

Patch 1/3 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/3 Checking commit c6ed04439c57 (target/arm: Rebuild hflags at el changes and MSR writes) 3/3 Checking commit 1d4a9cbd219d (target/arm: Rely on hflags correct in cpu_get_tb_cpu_state)
ERROR: Use g_assert or g_assert_not_reached
#75: FILE: target/arm/helper.c:12982:
+ g_assert_cmphex(flags, ==, check_flags);

total: 1 errors, 0 warnings, 34 lines checked

Patch 3/3 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

#7 lore raw
In reply to Richard Henderson
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Message-id: [email protected]
Subject: [Qemu-devel] [PATCH v3 0/3] target/arm: Reduce overhead of cpu_get_tb_cpu_state
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/1550834773-873512-1-git-send-email-andrey.shinkevich@virtuozzo.com -> patchew/1550834773-873512-1-git-send-email-andrey.shinkevich@virtuozzo.com
Switched to a new branch 'test'
23f3cda99d target/arm: Rely on hflags correct in cpu_get_tb_cpu_state d721906406 target/arm: Rebuild hflags at el changes and MSR writes 6fba240718 target/arm: Split out recompute_hflags et al

=== OUTPUT BEGIN ===
1/3 Checking commit 6fba240718be (target/arm: Split out recompute_hflags et al)
WARNING: Block comments use a leading /* on a separate line
#126: FILE: target/arm/helper.c:12860:
+ /* v8M always applies stack limit checks unless CCR.STKOFHFNMIGN is

WARNING: Block comments use a leading /* on a separate line #171: FILE: target/arm/helper.c:12905:
+ /* If SVE is disabled, but FP is enabled,

total: 0 errors, 2 warnings, 368 lines checked

Patch 1/3 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/3 Checking commit d721906406a8 (target/arm: Rebuild hflags at el changes and MSR writes) 3/3 Checking commit 23f3cda99d91 (target/arm: Rely on hflags correct in cpu_get_tb_cpu_state)
ERROR: Use g_assert or g_assert_not_reached
#75: FILE: target/arm/helper.c:12982:
+ g_assert_cmphex(flags, ==, check_flags);

total: 1 errors, 0 warnings, 34 lines checked

Patch 3/3 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

Tested-by on the v3 series
#8 lore raw
In reply to Richard Henderson
Quoted 6 lines · Richard Henderson

Changes since v2:
* Do not cache VECLEN, VECSTRIDE, VFPEN.
These variables come from VFP_FPSCR and VFP_FPEXC, not from system control registers.
* Move HANDLER and STACKCHECK to rebuild_hflags_a32, instead of building them in rebuild_hflags_common.

You might want to add these numbers (I re-ran the benchmarks for v3) to patch 3's commit log:

                        aarch64-linux-user SPEC06int (train set)
                     Host: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
         2.2 +--------------------------------------------------------------+
             |                                                              |
             |                                                after         |
           2 |-+.........................................+-+..............+-|
             |                                            |                 |
             |                                           *|*                |
             |                                           *|*      +-+       |
         1.8 |-+..........+-+............................+-+.......|......+-|
             |             |                             * *       |        |
             |           **|*               +-+     *+-+ * *      *|*       |
         1.6 |-+.........*+-+..............**|*.....*..*.*.*.*+-+.*|*.....+-|
             |           *  *              *+-+     *  * * * *+-+ *|*       |
             |           *  *              *  *     *  * * * *  * +-+       |
         1.4 |-+.........*..*......+-+.....*..*.....*..*.*.*.*..*.*.*.*+-++-|
             |           *  *     **|*     *  *     *  * * * *  * * * *+-+  |
             |  *+-+     *  *     *+-+     *  *     *  * * * *  * * * *  *  |
         1.2 |-+*+-+.....*..*.....*..*.....*..*.....*..*.*.*.*..*.*.*.*..*+-|
             |  *  * +-+ *  *     *  * +-+ *  *     *  * * * *  * * * *  *  |
             |  *  *  |  *  * +-+ *  * +-+ *  * +-+ *  * * * *  * * * *  *  |
             |  *  * *|* *  * *|* *  * * * *  * +-+ *  * * * *  * * * *  *  |
           1 |++*++*++-++*++*++-++*++*+*+*+*++*+*+*+*++*+*+*+*++*+*+*+*++*++|
             |  *  * * * *  * * * *  * * * *  * * * *  * * * *  * * * *  *  |
             |  *  * * * *  * * * *  * * * *  * * * *  * * * *  * * * *  *  |
         0.8 +--------------------------------------------------------------+
     400.perl401.bzi403.429445.456.462.libq464.471.omn483.xalancbgeomean

png: https://imgur.com/wr4ODMw

Thanks,

Emilio

#9 lore raw
In reply to Richard Henderson
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

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] [PATCH v3 0/3] target/arm: Reduce overhead of cpu_get_tb_cpu_state

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
9819e46d70 target/arm: Rely on hflags correct in cpu_get_tb_cpu_state a0f765dba8 target/arm: Rebuild hflags at el changes and MSR writes d65ebaa1a8 target/arm: Split out recompute_hflags et al

=== OUTPUT BEGIN ===
1/3 Checking commit d65ebaa1a826 (target/arm: Split out recompute_hflags et al)
WARNING: Block comments use a leading /* on a separate line
#127: FILE: target/arm/helper.c:12837:
+ /* v8M always applies stack limit checks unless CCR.STKOFHFNMIGN is

WARNING: Block comments use a leading /* on a separate line #172: FILE: target/arm/helper.c:12882:
+ /* If SVE is disabled, but FP is enabled,

total: 0 errors, 2 warnings, 368 lines checked

Patch 1/3 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/3 Checking commit a0f765dba8a1 (target/arm: Rebuild hflags at el changes and MSR writes) 3/3 Checking commit 9819e46d702e (target/arm: Rely on hflags correct in cpu_get_tb_cpu_state)
ERROR: Use g_assert or g_assert_not_reached
#76: FILE: target/arm/helper.c:12959:
+ g_assert_cmphex(flags, ==, check_flags);

total: 1 errors, 0 warnings, 34 lines checked

Patch 3/3 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]