single-binary patch queue
Subsystems (12)
[PULL 135/148] tcg: Define guest_default_memory_order in TCGCPUOps
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Add the TCGCPUOps::guest_default_memory_order field and have each target initialize it.
--- include/accel/tcg/cpu-ops.h | 8 ++++++++ target/alpha/cpu.c | 2 ++ target/arm/cpu.c | 2 ++ target/arm/tcg/cpu-v7m.c | 2 ++ target/avr/cpu.c | 1 + target/hexagon/cpu.c | 1 + target/hppa/cpu.c | 2 ++ target/i386/tcg/tcg-cpu.c | 1 + target/loongarch/cpu.c | 2 ++ target/m68k/cpu.c | 2 ++ target/microblaze/cpu.c | 2 ++ target/mips/cpu.c | 2 ++ target/openrisc/cpu.c | 2 ++ target/ppc/cpu_init.c | 1 + target/riscv/tcg/tcg-cpu.c | 2 ++ target/rx/cpu.c | 2 ++ target/s390x/cpu.c | 2 ++ target/sh4/cpu.c | 2 ++ target/sparc/cpu.c | 2 ++ target/tricore/cpu.c | 1 + target/xtensa/cpu.c | 2 ++ 21 files changed, 43 insertions(+)
include/accel/tcg/cpu-ops.h +8 -0
@@ -16,8 +16,16 @@#include "exec/memop.h" #include "exec/mmu-access-type.h" #include "exec/vaddr.h" +#include "tcg/tcg-mo.h" struct TCGCPUOps { + +/** +* @guest_default_memory_order: default barrier that is required +* for the guest memory ordering. +*/ +TCGBar guest_default_memory_order; +/** * @initialize: Initialize TCG state *
target/alpha/cpu.c +2 -0
@@ -235,6 +235,8 @@ static const struct SysemuCPUOps alpha_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps alpha_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = alpha_translate_init, .translate_code = alpha_translate_code, .synchronize_from_tb = alpha_cpu_synchronize_from_tb,
target/arm/cpu.c +2 -0
@@ -2671,6 +2671,8 @@ static const struct SysemuCPUOps arm_sysemu_ops = {#ifdef CONFIG_TCG static const TCGCPUOps arm_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = arm_translate_init, .translate_code = arm_translate_code, .synchronize_from_tb = arm_cpu_synchronize_from_tb,
target/arm/tcg/cpu-v7m.c +2 -0
@@ -232,6 +232,8 @@ static void cortex_m55_initfn(Object *obj) }static const TCGCPUOps arm_v7m_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = arm_translate_init, .translate_code = arm_translate_code, .synchronize_from_tb = arm_cpu_synchronize_from_tb,
target/avr/cpu.c +1 -0
@@ -224,6 +224,7 @@ static const struct SysemuCPUOps avr_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps avr_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , .initialize = avr_cpu_tcg_init, .translate_code = avr_cpu_translate_code, .synchronize_from_tb = avr_cpu_synchronize_from_tb,
target/hexagon/cpu.c +1 -0
@@ -325,6 +325,7 @@ static void hexagon_cpu_init(Object *obj)#include "accel/tcg/cpu-ops.h" static const TCGCPUOps hexagon_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , .initialize = hexagon_translate_init, .translate_code = hexagon_translate_code, .synchronize_from_tb = hexagon_cpu_synchronize_from_tb,
target/hppa/cpu.c +2 -0
@@ -253,6 +253,8 @@ static const struct SysemuCPUOps hppa_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps hppa_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = hppa_translate_init, .translate_code = hppa_translate_code, .synchronize_from_tb = hppa_cpu_synchronize_from_tb,
target/i386/tcg/tcg-cpu.c +1 -0
@@ -125,6 +125,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs)#include "accel/tcg/cpu-ops.h" static const TCGCPUOps x86_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , .initialize = tcg_x86_init, .translate_code = x86_translate_code, .synchronize_from_tb = x86_cpu_synchronize_from_tb,
target/loongarch/cpu.c +2 -0
@@ -864,6 +864,8 @@ static void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags)#include "accel/tcg/cpu-ops.h" static const TCGCPUOps loongarch_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = loongarch_translate_init, .translate_code = loongarch_translate_code, .synchronize_from_tb = loongarch_cpu_synchronize_from_tb,
target/m68k/cpu.c +2 -0
@@ -589,6 +589,8 @@ static const struct SysemuCPUOps m68k_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps m68k_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = m68k_tcg_init, .translate_code = m68k_translate_code, .restore_state_to_opc = m68k_restore_state_to_opc,
target/microblaze/cpu.c +2 -0
@@ -427,6 +427,8 @@ static const struct SysemuCPUOps mb_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps mb_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = mb_tcg_init, .translate_code = mb_translate_code, .synchronize_from_tb = mb_cpu_synchronize_from_tb,
target/mips/cpu.c +2 -0
@@ -551,6 +551,8 @@ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc) }static const TCGCPUOps mips_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = mips_tcg_init, .translate_code = mips_translate_code, .synchronize_from_tb = mips_cpu_synchronize_from_tb,
target/openrisc/cpu.c +2 -0
@@ -243,6 +243,8 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps openrisc_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = openrisc_translate_init, .translate_code = openrisc_translate_code, .synchronize_from_tb = openrisc_cpu_synchronize_from_tb,
target/ppc/cpu_init.c +1 -0
@@ -7479,6 +7479,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps ppc_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , .initialize = ppc_translate_init, .translate_code = ppc_translate_code, .restore_state_to_opc = ppc_restore_state_to_opc,
target/riscv/tcg/tcg-cpu.c +2 -0
@@ -140,6 +140,8 @@ static void riscv_restore_state_to_opc(CPUState *cs, }static const TCGCPUOps riscv_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = riscv_translate_init, .translate_code = riscv_translate_code, .synchronize_from_tb = riscv_cpu_synchronize_from_tb,
target/rx/cpu.c +2 -0
@@ -204,6 +204,8 @@ static const struct SysemuCPUOps rx_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps rx_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = rx_translate_init, .translate_code = rx_translate_code, .synchronize_from_tb = rx_cpu_synchronize_from_tb,
target/s390x/cpu.c +2 -0
@@ -345,6 +345,8 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, }static const TCGCPUOps s390_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = s390x_translate_init, .translate_code = s390x_translate_code, .restore_state_to_opc = s390x_restore_state_to_opc,
target/sh4/cpu.c +2 -0
@@ -262,6 +262,8 @@ static const struct SysemuCPUOps sh4_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps superh_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = sh4_translate_init, .translate_code = sh4_translate_code, .synchronize_from_tb = superh_cpu_synchronize_from_tb,
target/sparc/cpu.c +2 -0
@@ -1001,6 +1001,8 @@ static const struct SysemuCPUOps sparc_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps sparc_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = sparc_tcg_init, .translate_code = sparc_translate_code, .synchronize_from_tb = sparc_cpu_synchronize_from_tb,
target/tricore/cpu.c +1 -0
@@ -172,6 +172,7 @@ static const struct SysemuCPUOps tricore_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps tricore_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , .initialize = tricore_tcg_init, .translate_code = tricore_translate_code, .synchronize_from_tb = tricore_cpu_synchronize_from_tb,
target/xtensa/cpu.c +2 -0
@@ -232,6 +232,8 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps xtensa_tcg_ops = { + .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .initialize = xtensa_translate_init, .translate_code = xtensa_translate_code, .debug_excp_handler = xtensa_breakpoint_handler,
Signature · 1 line
2.43.0
[PULL 075/148] target/arm: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Move arm_cpu_mmu_index() within CONFIG_TCG #ifdef'ry, convert CPUClass::mmu_index() to TCGCPUOps::mmu_index().
Message-ID: <[email protected]>
--- target/arm/internals.h | 1 + target/arm/cpu.c | 13 +++++++------ target/arm/tcg/cpu-v7m.c | 1 + 3 files changed, 9 insertions(+), 6 deletions(-)
target/arm/internals.h +1 -0
@@ -373,6 +373,7 @@ void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb);/* Our implementation of TCGCPUOps::cpu_exec_halt */ bool arm_cpu_exec_halt (CPUState *cs); +int arm_cpu_mmu_index (CPUState *cs,bool ifetch);#endif /* CONFIG_TCG */ typedef enum ARMFPRounding {
target/arm/cpu.c +7 -6
@@ -121,6 +121,12 @@ void arm_restore_state_to_opc(CPUState *cs, env->exception.syndrome = data[2] << ARM_INSN_START_WORD2_SHIFT; } } + +int arm_cpu_mmu_index (CPUState *cs,bool ifetch) +{ +return arm_env_mmu_index (cpu_env (cs)); +} +#endif /* CONFIG_TCG */ #ifndef CONFIG_USER_ONLY
@@ -144,11 +150,6 @@ static bool arm_cpu_has_work(CPUState *cs) }#endif /* !CONFIG_USER_ONLY */ -static int arm_cpu_mmu_index (CPUState *cs,bool ifetch) -{ -return arm_env_mmu_index (cpu_env (cs)); -} -void arm_register_pre_el_change_hook (ARMCPU *cpu,ARMELChangeHookFn *hook,void *opaque) {
@@ -2674,6 +2675,7 @@ static const TCGCPUOps arm_tcg_ops = { .synchronize_from_tb = arm_cpu_synchronize_from_tb, .debug_excp_handler = arm_debug_excp_handler, .restore_state_to_opc = arm_restore_state_to_opc, + .mmu_index = arm_cpu_mmu_index, #ifdef CONFIG_USER_ONLY .record_sigsegv = arm_cpu_record_sigsegv,
@@ -2708,7 +2710,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_phases); cc->class_by_name = arm_cpu_class_by_name; - cc->mmu_index = arm_cpu_mmu_index; cc->dump_state = arm_cpu_dump_state; cc->set_pc = arm_cpu_set_pc; cc->get_pc = arm_cpu_get_pc;
target/arm/tcg/cpu-v7m.c +1 -0
@@ -237,6 +237,7 @@ static const TCGCPUOps arm_v7m_tcg_ops = { .synchronize_from_tb = arm_cpu_synchronize_from_tb, .debug_excp_handler = arm_debug_excp_handler, .restore_state_to_opc = arm_restore_state_to_opc, + .mmu_index = arm_cpu_mmu_index, #ifdef CONFIG_USER_ONLY .record_sigsegv = arm_cpu_record_sigsegv,
Signature · 1 line
2.43.0
[PULL 004/148] exec/memory_ldst_phys: extract memory_ldst_phys declarations from cpu-all.h
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code.
Move stl_phys_notdirty function as well.
Cached endianness agnostic version rely on st/ld*_p, which is available through tswap.h.
Message-ID: <[email protected]>
--- include/exec/cpu-all.h | 31 ----------------------------- include/exec/memory.h | 10 ++++++++++ include/exec/memory_ldst_phys.h.inc | 5 +---- 3 files changed, 11 insertions(+), 35 deletions(-)
include/exec/cpu-all.h +0 -31
@@ -25,37 +25,6 @@#include "exec/memory.h" #include "exec/tswap.h" #include "hw/core/cpu.h" - -/* MMU memory access macros */ - -#if !defined(CONFIG_USER_ONLY ) - -#include "exec/hwaddr.h" - -static inline void stl_phys_notdirty (AddressSpace *as,hwaddr addr,uint32_t val) -{ -address_space_stl_notdirty (as, addr, val, -MEMTXATTRS_UNSPECIFIED ,NULL ); -} - -#define SUFFIX -#define ARG1 as -#define ARG1_DECL AddressSpace *as -#define TARGET_ENDIANNESS -#include "exec/memory_ldst_phys.h.inc" - -/* Inline fast path for direct RAM access. */ -#define ENDIANNESS -#include "exec/memory_ldst_cached.h.inc" - -#define SUFFIX _cached -#define ARG1 cache -#define ARG1_DECL MemoryRegionCache *cache -#define TARGET_ENDIANNESS -#include "exec/memory_ldst_phys.h.inc" -#endif - -/* page related stuff */ #include "exec/cpu-defs.h" #include "exec/target_page.h"
include/exec/memory.h +10 -0
@@ -21,6 +21,7 @@#include "exec/memattrs.h" #include "exec/memop.h" #include "exec/ramlist.h" +#include "exec/tswap.h" #include "qemu/bswap.h" #include "qemu/queue.h" #include "qemu/int128.h"
@@ -2732,6 +2733,12 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr,#define ARG1_DECL AddressSpace *as#include "exec/memory_ldst.h.inc" +static inline void stl_phys_notdirty (AddressSpace *as,hwaddr addr,uint32_t val) +{ +address_space_stl_notdirty (as, addr, val, +MEMTXATTRS_UNSPECIFIED ,NULL ); +} +#define SUFFIX #define ARG1 as#define ARG1_DECL AddressSpace *as
@@ -2798,6 +2805,9 @@ static inline void address_space_stb_cached(MemoryRegionCache *cache, } } +#define ENDIANNESS +#include "exec/memory_ldst_cached.h.inc" +#define ENDIANNESS _le#include "exec/memory_ldst_cached.h.inc"
include/exec/memory_ldst_phys.h.inc +1 -4
@@ -19,7 +19,6 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#ifdef TARGET_ENDIANNESS static inline uint16_t glue(lduw_phys, SUFFIX)(ARG1_DECL, hwaddr addr) { return glue(address_space_lduw, SUFFIX)(ARG1, addr,
@@ -55,7 +54,7 @@ static inline void glue(stq_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val) glue(address_space_stq, SUFFIX)(ARG1, addr, val, MEMTXATTRS_UNSPECIFIED, NULL); } -#else + static inline uint8_t glue(ldub_phys, SUFFIX)(ARG1_DECL, hwaddr addr) { return glue(address_space_ldub, SUFFIX)(ARG1, addr,
@@ -139,9 +138,7 @@ static inline void glue(stq_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t va glue(address_space_stq_be, SUFFIX)(ARG1, addr, val, MEMTXATTRS_UNSPECIFIED, NULL); } -#endif #undef ARG1_DECL #undef ARG1 #undef SUFFIX -#undef TARGET_ENDIANNESS
Signature · 1 line
2.43.0
[PULL 020/148] accel/tcg: Build plugin-gen.c once
In reply to Richard HendersonWe assert that env immediately follows CPUState in cpu-all.h. Change the offsetof expressions to be based on CPUState instead of ArchCPU.
--- accel/tcg/plugin-gen.c | 13 +++++-------- accel/tcg/meson.build | 7 ++++--- 2 files changed, 9 insertions(+), 11 deletions(-)
accel/tcg/plugin-gen.c +5 -8
@@ -22,13 +22,12 @@#include "qemu/osdep.h" #include "qemu/plugin.h" #include "qemu/log.h" -#include "cpu.h" #include "tcg/tcg.h" #include "tcg/tcg-temp-internal.h" -#include "tcg/tcg-op.h" -#include "exec/exec-all.h" +#include "tcg/tcg-op-common.h" #include "exec/plugin-gen.h" #include "exec/translator.h" +#include "exec/translation-block.h" enum plugin_gen_from {PLUGIN_GEN_FROM_TB ,
@@ -89,15 +88,13 @@ static void gen_enable_mem_helper(struct qemu_plugin_tb *ptb,qemu_plugin_add_dyn_cb_arr (arr);tcg_gen_st_ptr (tcg_constant_ptr ((intptr_t )arr), tcg_env, - offsetof(CPUState, neg.plugin_mem_cbs) - - offsetof(ArchCPU , env)); + offsetof(CPUState, neg.plugin_mem_cbs) - sizeof(CPUState)); }static void gen_disable_mem_helper (void ) {tcg_gen_st_ptr (tcg_constant_ptr (0 ), tcg_env, - offsetof(CPUState, neg.plugin_mem_cbs) - - offsetof(ArchCPU , env)); + offsetof(CPUState, neg.plugin_mem_cbs) - sizeof(CPUState)); }static TCGv_i32 gen_cpu_index (void )
@@ -113,7 +110,7 @@ static TCGv_i32 gen_cpu_index(void) }TCGv_i32 cpu_index =tcg_temp_ebb_new_i32 ();tcg_gen_ld_i32 (cpu_index, tcg_env, - -offsetof(ArchCPU , env) + offsetof(CPUState , cpu_index)); + offsetof(CPUState , cpu_index) -sizeof (CPUState));return cpu_index; }
accel/tcg/meson.build +4 -3
@@ -3,6 +3,10 @@ common_ss.add(when: 'CONFIG_TCG', if_true: files( 'tcg-runtime.c', 'tcg-runtime-gvec.c', )) +if get_option('plugins') + common_ss.add(when: 'CONFIG_TCG', if_true: files('plugin-gen.c')) +endif + tcg_specific_ss = ss.source_set() tcg_specific_ss.add(files( 'tcg-all.c',
@@ -12,9 +16,6 @@ tcg_specific_ss.add(files( 'translator.c', )) tcg_specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) -if get_option('plugins') - tcg_specific_ss.add(files('plugin-gen.c')) -endif specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files(
Signature · 1 line
2.43.0
[PULL 032/148] accel/tcg: Remove mmap_lock/unlock from watchpoint.c
In reply to Richard HendersonThe mmap_lock is user-only, whereas watchpoint.c is only compiled for system mode.
--- accel/tcg/watchpoint.c | 3 --- 1 file changed, 3 deletions(-)
accel/tcg/watchpoint.c +0 -3
@@ -124,17 +124,14 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, } cpu->watchpoint_hit = wp; -mmap_lock ();/* This call also restores vCPU state */ tb_check_watchpoint (cpu, ra);if (wp->flags &BP_STOP_BEFORE_ACCESS ) { cpu->exception_index =EXCP_DEBUG ; -mmap_unlock ();cpu_loop_exit (cpu); }else {/* Force execution of one insn next time. */ cpu->cflags_next_tb =1 |CF_NOIRQ |curr_cflags (cpu); -mmap_unlock ();cpu_loop_exit_noexc (cpu); } }else {
Signature · 1 line
2.43.0
[PULL 091/148] target/sparc: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
--- target/sparc/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/sparc/cpu.c +1 -1
@@ -1005,6 +1005,7 @@ static const TCGCPUOps sparc_tcg_ops = { .translate_code = sparc_translate_code, .synchronize_from_tb = sparc_cpu_synchronize_from_tb, .restore_state_to_opc = sparc_restore_state_to_opc, + .mmu_index = sparc_cpu_mmu_index, #ifndef CONFIG_USER_ONLY .tlb_fill = sparc_cpu_tlb_fill,
@@ -1033,7 +1034,6 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = sparc_cpu_class_by_name; cc->parse_features = sparc_cpu_parse_features; - cc->mmu_index = sparc_cpu_mmu_index; cc->dump_state = sparc_cpu_dump_state;#if !defined(TARGET_SPARC64 ) && !defined(CONFIG_USER_ONLY ) cc->memory_rw_debug = sparc_cpu_memory_rw_debug;
Signature · 1 line
2.43.0
[PULL 119/148] target/arm: Expose Aarch64 helpers unconditionally
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
At worst, for 32-bit arm binary, using these methods will now produce a link time error, instead of a compile time one.
Message-ID: <[email protected]>
--- target/arm/internals.h | 2 -- 1 file changed, 2 deletions(-)
target/arm/internals.h +0 -2
@@ -1808,7 +1808,6 @@ static inline uint64_t pmu_counter_mask(CPUARMState *env)return (1ULL <<31 ) | ((1ULL <<pmu_num_counters (env)) -1 ); } -#ifdef TARGET_AARCH64 GDBFeature *arm_gen_dynamic_svereg_feature (CPUState *cpu,int base_reg);int aarch64_gdb_get_sve_reg (CPUState *cs,GByteArray *buf,int reg);int aarch64_gdb_set_sve_reg (CPUState *cs,uint8_t *buf,int reg);
@@ -1826,7 +1825,6 @@ void aarch64_max_tcg_initfn(Object *obj);void aarch64_add_pauth_properties (Object *obj);void aarch64_add_sve_properties (Object *obj);void aarch64_add_sme_properties (Object *obj); -#endif /* Read the CONTROL register as the MRS instruction would. */ uint32_t arm_v7m_mrs_control (CPUARMState *env,uint32_t secure);
Signature · 1 line
2.43.0
[PULL 068/148] accel/tcg: Move get_page_addr_code* declarations
In reply to Richard HendersonMove the declarations from exec/exec-all.h to the
private accel/tcg/internal-common.h.
--- accel/tcg/internal-common.h | 34 ++++++++++++++++++++++++++++++++++ include/exec/exec-all.h | 34 ---------------------------------- accel/tcg/translator.c | 1 + 3 files changed, 35 insertions(+), 34 deletions(-)
accel/tcg/internal-common.h +34 -0
@@ -74,4 +74,38 @@ uint32_t curr_cflags(CPUState *cpu);void tb_check_watchpoint (CPUState *cpu,uintptr_t retaddr); +/** +* get_page_addr_code_hostp() +* @env: CPUArchState +* @addr: guest virtual address of guest code +* +* See get_page_addr_code() (full-system version) for documentation on the +* return value. +* +* Sets *@hostp (when @hostp is non-NULL) as follows. +* If the return value is -1, sets *@hostp to NULL. Otherwise, sets *@hostp +* to the host address where @addr's content is kept. +* +* Note: this function can trigger an exception. +*/ +tb_page_addr_t get_page_addr_code_hostp (CPUArchState *env,vaddr addr, +void **hostp); + +/** +* get_page_addr_code() +* @env: CPUArchState +* @addr: guest virtual address of guest code +* +* If we cannot translate and execute from the entire RAM page, or if +* the region is not backed by RAM, returns -1. Otherwise, returns the +* ram_addr_t corresponding to the guest code at @addr. +* +* Note: this function can trigger an exception. +*/ +static inline tb_page_addr_t get_page_addr_code (CPUArchState *env, +vaddr addr) +{ +return get_page_addr_code_hostp (env, addr,NULL ); +} +#endif
include/exec/exec-all.h +0 -34
@@ -143,40 +143,6 @@ struct MemoryRegionSection *iotlb_to_section(CPUState *cpu, hwaddr index, MemTxAttrs attrs);#endif -/** -* get_page_addr_code_hostp() -* @env: CPUArchState -* @addr: guest virtual address of guest code -* -* See get_page_addr_code() (full-system version) for documentation on the -* return value. -* -* Sets *@hostp (when @hostp is non-NULL) as follows. -* If the return value is -1, sets *@hostp to NULL. Otherwise, sets *@hostp -* to the host address where @addr's content is kept. -* -* Note: this function can trigger an exception. -*/ -tb_page_addr_t get_page_addr_code_hostp (CPUArchState *env,vaddr addr, -void **hostp); - -/** -* get_page_addr_code() -* @env: CPUArchState -* @addr: guest virtual address of guest code -* -* If we cannot translate and execute from the entire RAM page, or if -* the region is not backed by RAM, returns -1. Otherwise, returns the -* ram_addr_t corresponding to the guest code at @addr. -* -* Note: this function can trigger an exception. -*/ -static inline tb_page_addr_t get_page_addr_code (CPUArchState *env, -vaddr addr) -{ -return get_page_addr_code_hostp (env, addr,NULL ); -} -#if !defined(CONFIG_USER_ONLY ) MemoryRegionSection *
accel/tcg/translator.c +1 -0
@@ -17,6 +17,7 @@#include "exec/translator.h" #include "exec/plugin-gen.h" #include "tcg/tcg-op-common.h" +#include "internal-common.h" #include "internal-target.h" #include "disas/disas.h" #include "tb-internal.h"
Signature · 1 line
2.43.0
[PULL 069/148] accel/tcg: Remove page_protect
In reply to Richard HendersonMerge the user-only page_protect function with the user-only implementation of tb_lock_page0. This avoids pulling page-protection.h into tb-internal.h.
--- accel/tcg/tb-internal.h | 11 +++-------- include/user/page-protection.h | 1 - accel/tcg/user-exec.c | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-)
accel/tcg/tb-internal.h +3 -8
@@ -51,28 +51,23 @@#endif /* CONFIG_SOFTMMU */ +void tb_lock_page0 (tb_page_addr_t ); +#ifdef CONFIG_USER_ONLY -#include "user/page-protection.h" /* * For user-only, page_protect sets the page read-only. * Since most execution is already on read-only pages, and we'd need to * account for other TBs on the same page, defer undoing any page protection * until we receive the write fault. */ -static inline void tb_lock_page0 (tb_page_addr_t p0) -{ -page_protect (p0); -} -static inline void tb_lock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) { -page_protect (p1); +tb_lock_page0 (p1); }static inline void tb_unlock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) { }static inline void tb_unlock_pages (TranslationBlock *tb) { }#else -void tb_lock_page0 (tb_page_addr_t );void tb_lock_page1 (tb_page_addr_t ,tb_page_addr_t );void tb_unlock_page1 (tb_page_addr_t ,tb_page_addr_t );void tb_unlock_pages (TranslationBlock *);
include/user/page-protection.h +0 -1
@@ -16,7 +16,6 @@#include "exec/target_long.h" #include "exec/translation-block.h" -void page_protect (tb_page_addr_t page_addr);int page_unprotect (tb_page_addr_t address,uintptr_t pc);int page_get_flags (target_ulong address);
accel/tcg/user-exec.c +1 -1
@@ -657,7 +657,7 @@ target_ulong page_find_range_empty(target_ulong min, target_ulong max, } } -void page_protect (tb_page_addr_t address) +void tb_lock_page0 (tb_page_addr_t address) {PageFlagsNode *p;target_ulong start, last;
Signature · 1 line
2.43.0
[PULL 137/148] tcg: Propagate CPUState argument to cpu_req_mo()
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
In preparation of having tcg_req_mo() access CPUState in the next commit, pass it to cpu_req_mo(), its single caller.
--- accel/tcg/internal-target.h | 3 ++- accel/tcg/cputlb.c | 20 ++++++++++---------- accel/tcg/user-exec.c | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 21 deletions(-)
accel/tcg/internal-target.h +2 -1
@@ -59,12 +59,13 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);/** * cpu_req_mo: +* @cpu: CPUState * @type: TCGBar * * If tcg_req_mo indicates a barrier for @type is required * for the guest memory model, issue a host memory barrier. */ -#define cpu_req_mo (type) \ +#define cpu_req_mo (cpu, type) \ do { \ if (tcg_req_mo(type)) { \ smp_mb(); \
accel/tcg/cputlb.c +10 -10
@@ -2324,7 +2324,7 @@ static uint8_t do_ld1_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,MMULookupLocals l;bool crosspage; -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); crosspage =mmu_lookup (cpu, addr, oi, ra, access_type, &l);tcg_debug_assert (!crosspage);
@@ -2339,7 +2339,7 @@ static uint16_t do_ld2_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,uint16_t ret;uint8_t a, b; -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); crosspage =mmu_lookup (cpu, addr, oi, ra, access_type, &l);if (likely (!crosspage)) {return do_ld_2 (cpu, &l.page[0 ], l.mmu_idx, access_type, l.memop, ra);
@@ -2363,7 +2363,7 @@ static uint32_t do_ld4_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,bool crosspage;uint32_t ret; -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); crosspage =mmu_lookup (cpu, addr, oi, ra, access_type, &l);if (likely (!crosspage)) {return do_ld_4 (cpu, &l.page[0 ], l.mmu_idx, access_type, l.memop, ra);
@@ -2384,7 +2384,7 @@ static uint64_t do_ld8_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,bool crosspage;uint64_t ret; -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); crosspage =mmu_lookup (cpu, addr, oi, ra, access_type, &l);if (likely (!crosspage)) {return do_ld_8 (cpu, &l.page[0 ], l.mmu_idx, access_type, l.memop, ra);
@@ -2407,7 +2407,7 @@ static Int128 do_ld16_mmu(CPUState *cpu, vaddr addr,Int128 ret;int first; -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); crosspage =mmu_lookup (cpu, addr, oi, ra,MMU_DATA_LOAD , &l);if (likely (!crosspage)) {if (unlikely (l.page[0 ].flags &TLB_MMIO )) {
@@ -2735,7 +2735,7 @@ static void do_st1_mmu(CPUState *cpu, vaddr addr, uint8_t val,MMULookupLocals l;bool crosspage; -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); crosspage =mmu_lookup (cpu, addr, oi, ra,MMU_DATA_STORE , &l);tcg_debug_assert (!crosspage);
@@ -2749,7 +2749,7 @@ static void do_st2_mmu(CPUState *cpu, vaddr addr, uint16_t val,bool crosspage;uint8_t a, b; -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); crosspage =mmu_lookup (cpu, addr, oi, ra,MMU_DATA_STORE , &l);if (likely (!crosspage)) {do_st_2 (cpu, &l.page[0 ], val, l.mmu_idx, l.memop, ra);
@@ -2771,7 +2771,7 @@ static void do_st4_mmu(CPUState *cpu, vaddr addr, uint32_t val,MMULookupLocals l;bool crosspage; -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); crosspage =mmu_lookup (cpu, addr, oi, ra,MMU_DATA_STORE , &l);if (likely (!crosspage)) {do_st_4 (cpu, &l.page[0 ], val, l.mmu_idx, l.memop, ra);
@@ -2792,7 +2792,7 @@ static void do_st8_mmu(CPUState *cpu, vaddr addr, uint64_t val,MMULookupLocals l;bool crosspage; -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); crosspage =mmu_lookup (cpu, addr, oi, ra,MMU_DATA_STORE , &l);if (likely (!crosspage)) {do_st_8 (cpu, &l.page[0 ], val, l.mmu_idx, l.memop, ra);
@@ -2815,7 +2815,7 @@ static void do_st16_mmu(CPUState *cpu, vaddr addr, Int128 val,uint64_t a, b;int first; -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); crosspage =mmu_lookup (cpu, addr, oi, ra,MMU_DATA_STORE , &l);if (likely (!crosspage)) {if (unlikely (l.page[0 ].flags &TLB_MMIO )) {
accel/tcg/user-exec.c +10 -10
@@ -1061,7 +1061,7 @@ static uint8_t do_ld1_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,void *haddr;uint8_t ret; -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); haddr =cpu_mmu_lookup (cpu, addr,get_memop (oi), ra, access_type); ret =ldub_p (haddr);clear_helper_retaddr ();
@@ -1075,7 +1075,7 @@ static uint16_t do_ld2_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,uint16_t ret;MemOp mop =get_memop (oi); -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra, access_type); ret =load_atom_2 (cpu, ra, haddr, mop);clear_helper_retaddr ();
@@ -1093,7 +1093,7 @@ static uint32_t do_ld4_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,uint32_t ret;MemOp mop =get_memop (oi); -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra, access_type); ret =load_atom_4 (cpu, ra, haddr, mop);clear_helper_retaddr ();
@@ -1111,7 +1111,7 @@ static uint64_t do_ld8_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi,uint64_t ret;MemOp mop =get_memop (oi); -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra, access_type); ret =load_atom_8 (cpu, ra, haddr, mop);clear_helper_retaddr ();
@@ -1130,7 +1130,7 @@ static Int128 do_ld16_mmu(CPUState *cpu, abi_ptr addr,MemOp mop =get_memop (oi);tcg_debug_assert ((mop &MO_SIZE ) ==MO_128 ); -cpu_req_mo (TCG_MO_LD_LD |TCG_MO_ST_LD ); +cpu_req_mo (cpu,TCG_MO_LD_LD |TCG_MO_ST_LD ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra,MMU_DATA_LOAD ); ret =load_atom_16 (cpu, ra, haddr, mop);clear_helper_retaddr ();
@@ -1146,7 +1146,7 @@ static void do_st1_mmu(CPUState *cpu, vaddr addr, uint8_t val, {void *haddr; -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); haddr =cpu_mmu_lookup (cpu, addr,get_memop (oi), ra,MMU_DATA_STORE );stb_p (haddr, val);clear_helper_retaddr ();
@@ -1158,7 +1158,7 @@ static void do_st2_mmu(CPUState *cpu, vaddr addr, uint16_t val,void *haddr;MemOp mop =get_memop (oi); -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra,MMU_DATA_STORE );if (mop &MO_BSWAP ) {
@@ -1174,7 +1174,7 @@ static void do_st4_mmu(CPUState *cpu, vaddr addr, uint32_t val,void *haddr;MemOp mop =get_memop (oi); -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra,MMU_DATA_STORE );if (mop &MO_BSWAP ) {
@@ -1190,7 +1190,7 @@ static void do_st8_mmu(CPUState *cpu, vaddr addr, uint64_t val,void *haddr;MemOp mop =get_memop (oi); -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra,MMU_DATA_STORE );if (mop &MO_BSWAP ) {
@@ -1206,7 +1206,7 @@ static void do_st16_mmu(CPUState *cpu, vaddr addr, Int128 val,void *haddr;MemOpIdx mop =get_memop (oi); -cpu_req_mo (TCG_MO_LD_ST |TCG_MO_ST_ST ); +cpu_req_mo (cpu,TCG_MO_LD_ST |TCG_MO_ST_ST ); haddr =cpu_mmu_lookup (cpu, addr, mop, ra,MMU_DATA_STORE );if (mop &MO_BSWAP ) {
Signature · 1 line
2.43.0
[PULL 145/148] accel/tcg: Move mttcg warning to tcg_init_machine
In reply to Richard HendersonDelay the warning to tcg_init_machine, because we will have resolved the CPUClass at that point.
--- accel/tcg/tcg-all.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
accel/tcg/tcg-all.c +14 -7
@@ -93,7 +93,8 @@ static int tcg_init_machine(MachineState *ms)# else bool mttcg_supported = false;# endif -if (s->mttcg_enabled ==ON_OFF_AUTO_AUTO ) { +switch (s->mttcg_enabled) { +case ON_OFF_AUTO_AUTO :/* * We default to false if we know other options have been enabled * which are currently incompatible with MTTCG. Otherwise when each
@@ -108,12 +109,22 @@ static int tcg_init_machine(MachineState *ms)*/ if (mttcg_supported && !icount_enabled ()) { s->mttcg_enabled =ON_OFF_AUTO_ON ; + max_threads = ms->smp.max_cpus; }else { s->mttcg_enabled =ON_OFF_AUTO_OFF ; } - } -if (s->mttcg_enabled ==ON_OFF_AUTO_ON ) { +break ; +case ON_OFF_AUTO_ON : +if (!mttcg_supported) { +warn_report ("Guest not yet converted to MTTCG - " +"you may get unexpected results" ); + } max_threads = ms->smp.max_cpus; +break ; +case ON_OFF_AUTO_OFF : +break ; +default : + g_assert_not_reached(); }#endif
@@ -153,10 +164,6 @@ static void tcg_set_thread(Object *obj, const char *value, Error **errp)if (icount_enabled ()) {error_setg (errp,"No MTTCG when icount is enabled" ); }else { -#ifndef TARGET_SUPPORTS_MTTCG -warn_report ("Guest not yet converted to MTTCG - " -"you may get unexpected results" ); -#endif s->mttcg_enabled =ON_OFF_AUTO_ON ; } }else if (strcmp (value,"single" ) ==0 ) {
Signature · 1 line
2.43.0
[PULL 080/148] target/i386: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Move x86_cpu_mmu_index() to tcg-cpu.c, convertCPUClass::mmu_index() to TCGCPUOps::mmu_index().
Message-ID: <[email protected]>
--- target/i386/cpu.h | 2 -- target/i386/tcg/tcg-cpu.h | 2 ++ target/i386/cpu.c | 18 ------------------ target/i386/tcg/seg_helper.c | 1 + target/i386/tcg/tcg-cpu.c | 18 ++++++++++++++++++ 5 files changed, 21 insertions(+), 20 deletions(-)
target/i386/cpu.h +0 -2
@@ -2597,8 +2597,6 @@ static inline bool is_mmu_index_32(int mmu_index)return mmu_index &1 ; } -int x86_mmu_index_pl (CPUX86State *env,unsigned pl); -#define CC_DST (env->cc_dst)#define CC_SRC (env->cc_src)#define CC_SRC2 (env->cc_src2)
target/i386/tcg/tcg-cpu.h +2 -0
@@ -78,4 +78,6 @@ QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET);bool tcg_cpu_realizefn (CPUState *cs,Error **errp); +int x86_mmu_index_pl (CPUX86State *env,unsigned pl); +#endif /* TCG_CPU_H */
target/i386/cpu.c +0 -18
@@ -8664,23 +8664,6 @@ static bool x86_cpu_has_work(CPUState *cs) }#endif /* !CONFIG_USER_ONLY */ -int x86_mmu_index_pl (CPUX86State *env,unsigned pl) -{ -int mmu_index_32 = (env->hflags &HF_CS64_MASK ) ?0 :1 ; -int mmu_index_base = - pl ==3 ?MMU_USER64_IDX : - !(env->hflags &HF_SMAP_MASK ) ?MMU_KNOSMAP64_IDX : - (env->eflags &AC_MASK ) ?MMU_KNOSMAP64_IDX :MMU_KSMAP64_IDX ; - -return mmu_index_base + mmu_index_32; -} - -static int x86_cpu_mmu_index (CPUState *cs,bool ifetch) -{ -CPUX86State *env =cpu_env (cs); -return x86_mmu_index_pl (env, env->hflags &HF_CPL_MASK ); -} -static void x86_disas_set_info (CPUState *cs,disassemble_info *info) {X86CPU *cpu =X86_CPU (cs);
@@ -8922,7 +8905,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->class_by_name = x86_cpu_class_by_name; cc->parse_features = x86_cpu_parse_featurestr; - cc->mmu_index = x86_cpu_mmu_index; cc->dump_state = x86_cpu_dump_state; cc->set_pc = x86_cpu_set_pc; cc->get_pc = x86_cpu_get_pc;
target/i386/tcg/seg_helper.c +1 -0
@@ -28,6 +28,7 @@#include "helper-tcg.h" #include "seg_helper.h" #include "access.h" +#include "tcg-cpu.h" #ifdef TARGET_X86_64 #define SET_ESP (val, sp_mask) \
target/i386/tcg/tcg-cpu.c +18 -0
@@ -94,6 +94,23 @@ static void x86_restore_state_to_opc(CPUState *cs, } } +int x86_mmu_index_pl (CPUX86State *env,unsigned pl) +{ +int mmu_index_32 = (env->hflags &HF_CS64_MASK ) ?0 :1 ; +int mmu_index_base = + pl ==3 ?MMU_USER64_IDX : + !(env->hflags &HF_SMAP_MASK ) ?MMU_KNOSMAP64_IDX : + (env->eflags &AC_MASK ) ?MMU_KNOSMAP64_IDX :MMU_KSMAP64_IDX ; + +return mmu_index_base + mmu_index_32; +} + +static int x86_cpu_mmu_index (CPUState *cs,bool ifetch) +{ +CPUX86State *env =cpu_env (cs); +return x86_mmu_index_pl (env, env->hflags &HF_CPL_MASK ); +} +#ifndef CONFIG_USER_ONLY static bool x86_debug_check_breakpoint (CPUState *cs) {
@@ -112,6 +129,7 @@ static const TCGCPUOps x86_tcg_ops = { .translate_code = x86_translate_code, .synchronize_from_tb = x86_cpu_synchronize_from_tb, .restore_state_to_opc = x86_restore_state_to_opc, + .mmu_index = x86_cpu_mmu_index, .cpu_exec_enter = x86_cpu_exec_enter, .cpu_exec_exit = x86_cpu_exec_exit, #ifdef CONFIG_USER_ONLY
Signature · 1 line
2.43.0
[PULL 107/148] accel/tcg: fix missing includes for TCG_GUEST_DEFAULT_MO
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
We prepare to remove cpu.h from cpu-all.h, which will transitively remove it from accel/tcg/tb-internal.h, and thus from most of tcg compilation units.
Message-ID: <[email protected]>
--- accel/tcg/internal-target.h | 1 + include/exec/poison.h | 1 + accel/tcg/translate-all.c | 1 + 3 files changed, 3 insertions(+)
accel/tcg/internal-target.h +1 -0
@@ -9,6 +9,7 @@#ifndef ACCEL_TCG_INTERNAL_TARGET_H #define ACCEL_TCG_INTERNAL_TARGET_H +#include "cpu-param.h" #include "exec/exec-all.h" #include "exec/translation-block.h" #include "tb-internal.h"
include/exec/poison.h +1 -0
@@ -37,6 +37,7 @@#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCG#pragma GCC poison TARGET_BIG_ENDIAN +#pragma GCC poison TCG_GUEST_DEFAULT_MO#pragma GCC poison TARGET_LONG_BITS#pragma GCC poison TARGET_FMT_lx
accel/tcg/translate-all.c +1 -0
@@ -43,6 +43,7 @@#include "system/ram_addr.h" #endif +#include "cpu-param.h" #include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/mmap-lock.h"
Signature · 1 line
2.43.0
[PULL 118/148] target/arm/cpu: remove inline stubs for aarch32 emulation
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Directly condition associated calls in target/arm/helper.c for now.
Message-ID: <[email protected]>
--- target/arm/cpu.h | 8 -------- target/arm/helper.c | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-)
target/arm/cpu.h +0 -8
@@ -1222,7 +1222,6 @@ int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,*/ void arm_emulate_firmware_reset (CPUState *cpustate,int target_el); -#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);
@@ -1254,13 +1253,6 @@ static inline uint64_t *sve_bswap64(uint64_t *dst, uint64_t *src, int nr)#endif } -#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) -{ } -#endif -void aarch64_sync_32_to_64 (CPUARMState *env);void aarch64_sync_64_to_32 (CPUARMState *env);
target/arm/helper.c +6 -0
@@ -6563,7 +6563,9 @@ static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri,*/ new_len =sve_vqm1_for_el (env, cur_el);if (new_len < old_len) { +#ifdef TARGET_AARCH64 aarch64_sve_narrow_vq (env, new_len +1 ); +#endif } }
@@ -10628,7 +10630,9 @@ static 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. */ +#ifdef TARGET_AARCH64 aarch64_sve_change_el (env, cur_el, new_el,is_a64 (env)); +#endif }if (cur_el < new_el) {
@@ -11640,7 +11644,9 @@ void aarch64_sve_change_el(CPUARMState *env, int old_el,/* When changing vector length, clear inaccessible state. */ if (new_len < old_len) { +#ifdef TARGET_AARCH64 aarch64_sve_narrow_vq (env, new_len +1 ); +#endif } }#endif
Signature · 1 line
2.43.0
[PULL 097/148] accel/tcg: Split out tlb-bounds.h
In reply to Richard HendersonThe CPU_TLB_DYN_{MIN,MAX}_BITS definitions are not required outside of cputlb.c and translate-all.c.
--- accel/tcg/tb-internal.h | 27 --------------------------- accel/tcg/tlb-bounds.h | 32 ++++++++++++++++++++++++++++++++ accel/tcg/cputlb.c | 1 + accel/tcg/translate-all.c | 1 + 4 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 accel/tcg/tlb-bounds.h
accel/tcg/tb-internal.h +0 -27
@@ -22,33 +22,6 @@*/ #define GETPC_ADJ 2 -#ifdef CONFIG_SOFTMMU - -#define CPU_TLB_DYN_MIN_BITS 6 -#define CPU_TLB_DYN_DEFAULT_BITS 8 - -# if HOST_LONG_BITS ==32 -/* Make sure we do not require a double-word shift for the TLB load */ -# define CPU_TLB_DYN_MAX_BITS (32 - TARGET_PAGE_BITS) -# else /* HOST_LONG_BITS == 64 */ -/* -* Assuming TARGET_PAGE_BITS==12, with 2**22 entries we can cover 2**(22+12) == -* 2**34 == 16G of address space. This is roughly what one would expect a -* TLB to cover in a modern (as of 2018) x86_64 CPU. For instance, Intel -* Skylake's Level-2 STLB has 16 1G entries. -* Also, make sure we do not size the TLB past the guest's address space. -*/ -# ifdef TARGET_PAGE_BITS_VARY -# define CPU_TLB_DYN_MAX_BITS \ - MIN(22, TARGET_VIRT_ADDR_SPACE_BITS - TARGET_PAGE_BITS) -# else -# define CPU_TLB_DYN_MAX_BITS \ - MIN_CONST(22, TARGET_VIRT_ADDR_SPACE_BITS - TARGET_PAGE_BITS) -# endif -# endif - -#endif /* CONFIG_SOFTMMU */ -void tb_lock_page0 (tb_page_addr_t );#ifdef CONFIG_USER_ONLY
accel/tcg/tlb-bounds.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* softmmu size bounds +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef ACCEL_TCG_TLB_BOUNDS_H +#define ACCEL_TCG_TLB_BOUNDS_H + +#define CPU_TLB_DYN_MIN_BITS 6 +#define CPU_TLB_DYN_DEFAULT_BITS 8 + +# if HOST_LONG_BITS ==32 +/* Make sure we do not require a double-word shift for the TLB load */ +# define CPU_TLB_DYN_MAX_BITS (32 - TARGET_PAGE_BITS) +# else /* HOST_LONG_BITS == 64 */ +/* +* Assuming TARGET_PAGE_BITS==12, with 2**22 entries we can cover 2**(22+12) == +* 2**34 == 16G of address space. This is roughly what one would expect a +* TLB to cover in a modern (as of 2018) x86_64 CPU. For instance, Intel +* Skylake's Level-2 STLB has 16 1G entries. +* Also, make sure we do not size the TLB past the guest's address space. +*/ +# ifdef TARGET_PAGE_BITS_VARY +# define CPU_TLB_DYN_MAX_BITS \ + MIN(22, TARGET_VIRT_ADDR_SPACE_BITS - TARGET_PAGE_BITS) +# else +# define CPU_TLB_DYN_MAX_BITS \ + MIN_CONST(22, TARGET_VIRT_ADDR_SPACE_BITS - TARGET_PAGE_BITS) +# endif +# endif + +#endif /* ACCEL_TCG_TLB_BOUNDS_H */
accel/tcg/cputlb.c +1 -0
@@ -41,6 +41,7 @@#include "trace.h" #include "tb-hash.h" #include "tb-internal.h" +#include "tlb-bounds.h" #include "internal-common.h" #include "internal-target.h" #ifdef CONFIG_PLUGIN
accel/tcg/translate-all.c +1 -0
@@ -47,6 +47,7 @@#include "exec/page-protection.h" #include "exec/mmap-lock.h" #include "tb-internal.h" +#include "tlb-bounds.h" #include "exec/translator.h" #include "exec/tb-flush.h" #include "qemu/bitmap.h"
Signature · 1 line
2.43.0
[PULL 027/148] include/exec: Inline *_data memory operations
In reply to Richard HendersonThese need to be per-target for 'abi_ptr'. Expand inline to the *_data_ra api with ra == 0.
--- include/exec/cpu_ldst.h | 123 ++++++++++++++++++++++++++++++------ accel/tcg/ldst_common.c.inc | 89 -------------------------- 2 files changed, 104 insertions(+), 108 deletions(-)
include/exec/cpu_ldst.h +104 -19
@@ -74,25 +74,6 @@#include "user/guest-host.h" #endif /* CONFIG_USER_ONLY */ -uint32_t cpu_ldub_data (CPUArchState *env,abi_ptr ptr); -int cpu_ldsb_data (CPUArchState *env,abi_ptr ptr); -uint32_t cpu_lduw_be_data (CPUArchState *env,abi_ptr ptr); -int cpu_ldsw_be_data (CPUArchState *env,abi_ptr ptr); -uint32_t cpu_ldl_be_data (CPUArchState *env,abi_ptr ptr); -uint64_t cpu_ldq_be_data (CPUArchState *env,abi_ptr ptr); -uint32_t cpu_lduw_le_data (CPUArchState *env,abi_ptr ptr); -int cpu_ldsw_le_data (CPUArchState *env,abi_ptr ptr); -uint32_t cpu_ldl_le_data (CPUArchState *env,abi_ptr ptr); -uint64_t cpu_ldq_le_data (CPUArchState *env,abi_ptr ptr); - -void cpu_stb_data (CPUArchState *env,abi_ptr ptr,uint32_t val); -void cpu_stw_be_data (CPUArchState *env,abi_ptr ptr,uint32_t val); -void cpu_stl_be_data (CPUArchState *env,abi_ptr ptr,uint32_t val); -void cpu_stq_be_data (CPUArchState *env,abi_ptr ptr,uint64_t val); -void cpu_stw_le_data (CPUArchState *env,abi_ptr ptr,uint32_t val); -void cpu_stl_le_data (CPUArchState *env,abi_ptr ptr,uint32_t val); -void cpu_stq_le_data (CPUArchState *env,abi_ptr ptr,uint64_t val); -static inline uint32_t cpu_ldub_mmuidx_ra (CPUArchState *env,abi_ptr addr,int mmu_idx,uintptr_t ra) {
@@ -342,6 +323,110 @@ cpu_stq_le_data_ra(CPUArchState *env, abi_ptr addr, uint64_t val, uintptr_t ra)cpu_stq_le_mmuidx_ra (env, addr, val, mmu_index, ra); } +/*--------------------------*/ + +static inline uint32_t +cpu_ldub_data (CPUArchState *env,abi_ptr addr) +{ +return cpu_ldub_data_ra (env, addr,0 ); +} + +static inline int +cpu_ldsb_data (CPUArchState *env,abi_ptr addr) +{ +return (int8_t )cpu_ldub_data (env, addr); +} + +static inline uint32_t +cpu_lduw_be_data (CPUArchState *env,abi_ptr addr) +{ +return cpu_lduw_be_data_ra (env, addr,0 ); +} + +static inline int +cpu_ldsw_be_data (CPUArchState *env,abi_ptr addr) +{ +return (int16_t )cpu_lduw_be_data (env, addr); +} + +static inline uint32_t +cpu_ldl_be_data (CPUArchState *env,abi_ptr addr) +{ +return cpu_ldl_be_data_ra (env, addr,0 ); +} + +static inline uint64_t +cpu_ldq_be_data (CPUArchState *env,abi_ptr addr) +{ +return cpu_ldq_be_data_ra (env, addr,0 ); +} + +static inline uint32_t +cpu_lduw_le_data (CPUArchState *env,abi_ptr addr) +{ +return cpu_lduw_le_data_ra (env, addr,0 ); +} + +static inline int +cpu_ldsw_le_data (CPUArchState *env,abi_ptr addr) +{ +return (int16_t )cpu_lduw_le_data (env, addr); +} + +static inline uint32_t +cpu_ldl_le_data (CPUArchState *env,abi_ptr addr) +{ +return cpu_ldl_le_data_ra (env, addr,0 ); +} + +static inline uint64_t +cpu_ldq_le_data (CPUArchState *env,abi_ptr addr) +{ +return cpu_ldq_le_data_ra (env, addr,0 ); +} + +static inline void +cpu_stb_data (CPUArchState *env,abi_ptr addr,uint32_t val) +{ +cpu_stb_data_ra (env, addr, val,0 ); +} + +static inline void +cpu_stw_be_data (CPUArchState *env,abi_ptr addr,uint32_t val) +{ +cpu_stw_be_data_ra (env, addr, val,0 ); +} + +static inline void +cpu_stl_be_data (CPUArchState *env,abi_ptr addr,uint32_t val) +{ +cpu_stl_be_data_ra (env, addr, val,0 ); +} + +static inline void +cpu_stq_be_data (CPUArchState *env,abi_ptr addr,uint64_t val) +{ +cpu_stq_be_data_ra (env, addr, val,0 ); +} + +static inline void +cpu_stw_le_data (CPUArchState *env,abi_ptr addr,uint32_t val) +{ +cpu_stw_le_data_ra (env, addr, val,0 ); +} + +static inline void +cpu_stl_le_data (CPUArchState *env,abi_ptr addr,uint32_t val) +{ +cpu_stl_le_data_ra (env, addr, val,0 ); +} + +static inline void +cpu_stq_le_data (CPUArchState *env,abi_ptr addr,uint64_t val) +{ +cpu_stq_le_data_ra (env, addr, val,0 ); +} +#if TARGET_BIG_ENDIAN # define cpu_lduw_data cpu_lduw_be_data# define cpu_ldsw_data cpu_ldsw_be_data
accel/tcg/ldst_common.c.inc +0 -89
92 lines not on this page · raw message
Signature · 1 line
2.43.0
[PULL 115/148] target/arm/cpu: always define kvm related registers
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
This does not hurt, even if they are not used.
Message-ID: <[email protected]>
--- target/arm/cpu.h | 2 -- 1 file changed, 2 deletions(-)
target/arm/cpu.h +0 -2
@@ -971,7 +971,6 @@ struct ArchCPU {*/ uint32_t kvm_target; -#ifdef CONFIG_KVM /* KVM init features for this CPU */ uint32_t kvm_init_features[7 ];
@@ -984,7 +983,6 @@ struct ArchCPU {/* KVM steal time */ OnOffAuto kvm_steal_time; -#endif /* CONFIG_KVM */ /* Uniprocessor system with MP extensions */ bool mp_is_up;
Signature · 1 line
2.43.0
[PULL 039/148] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
At some point cputlb.c stopped depending on the "exec/memory-internal.h" header. Clean that now.
Message-ID: <[email protected]>
--- accel/tcg/cputlb.c | 1 - 1 file changed, 1 deletion(-)
accel/tcg/cputlb.c +0 -1
@@ -26,7 +26,6 @@#include "exec/cpu_ldst.h" #include "exec/cputlb.h" #include "exec/tb-flush.h" -#include "exec/memory-internal.h" #include "system/ram_addr.h" #include "exec/mmu-access-type.h" #include "exec/tlb-common.h"
Signature · 1 line
2.43.0
[PULL 139/148] tcg: Remove the TCG_GUEST_DEFAULT_MO definition globally
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
By directly using TCGCPUOps::guest_default_memory_order, we don't need the TCG_GUEST_DEFAULT_MO definition anymore.
--- target/alpha/cpu-param.h | 3 --- target/arm/cpu-param.h | 3 --- target/avr/cpu-param.h | 2 -- target/hexagon/cpu-param.h | 3 --- target/hppa/cpu-param.h | 8 -------- target/i386/cpu-param.h | 3 --- target/loongarch/cpu-param.h | 2 -- target/m68k/cpu-param.h | 3 --- target/microblaze/cpu-param.h | 3 --- target/mips/cpu-param.h | 2 -- target/openrisc/cpu-param.h | 2 -- target/ppc/cpu-param.h | 2 -- target/riscv/cpu-param.h | 2 -- target/rx/cpu-param.h | 3 --- target/s390x/cpu-param.h | 6 ------ target/sh4/cpu-param.h | 3 --- target/sparc/cpu-param.h | 23 ----------------------- target/tricore/cpu-param.h | 3 --- target/xtensa/cpu-param.h | 3 --- target/alpha/cpu.c | 3 ++- target/arm/cpu.c | 3 ++- target/arm/tcg/cpu-v7m.c | 3 ++- target/avr/cpu.c | 2 +- target/hexagon/cpu.c | 3 ++- target/hppa/cpu.c | 8 +++++++- target/i386/tcg/tcg-cpu.c | 5 ++++- target/loongarch/cpu.c | 2 +- target/m68k/cpu.c | 3 ++- target/microblaze/cpu.c | 3 ++- target/mips/cpu.c | 2 +- target/openrisc/cpu.c | 2 +- target/ppc/cpu_init.c | 2 +- target/riscv/tcg/tcg-cpu.c | 2 +- target/rx/cpu.c | 3 ++- target/s390x/cpu.c | 6 +++++- target/sh4/cpu.c | 3 ++- target/sparc/cpu.c | 23 ++++++++++++++++++++++- target/tricore/cpu.c | 3 ++- target/xtensa/cpu.c | 3 ++- docs/devel/multi-thread-tcg.rst | 4 ++-- 40 files changed, 66 insertions(+), 101 deletions(-)
target/alpha/cpu-param.h +0 -3
@@ -26,7 +26,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -/* Alpha processors have a weak memory model */ -#define TCG_GUEST_DEFAULT_MO (0) -#endif
target/arm/cpu-param.h +0 -3
@@ -44,7 +44,4 @@*/ #define TARGET_INSN_START_EXTRA_WORDS 2 -/* ARM processors have a weak memory model */ -#define TCG_GUEST_DEFAULT_MO (0) -#endif
target/avr/cpu-param.h +0 -2
@@ -27,6 +27,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -#define TCG_GUEST_DEFAULT_MO 0 -#endif
target/hexagon/cpu-param.h +0 -3
@@ -25,7 +25,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -/* MTTCG not yet supported: require strict ordering */ -#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#endif
target/hppa/cpu-param.h +0 -8
@@ -21,12 +21,4 @@#define TARGET_INSN_START_EXTRA_WORDS 2 -/* PA-RISC 1.x processors have a strong memory model. */ -/* -* ??? While we do not yet implement PA-RISC 2.0, those processors have -* a weak memory model, but with TLB bits that force ordering on a per-page -* basis. It's probably easier to fall back to a strong memory model. -*/ -#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#endif
target/i386/cpu-param.h +0 -3
@@ -24,7 +24,4 @@#define TARGET_INSN_START_EXTRA_WORDS 1 -/* The x86 has a strong memory model with some store-after-load re-ordering */ -#define TCG_GUEST_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) -#endif
target/loongarch/cpu-param.h +0 -2
@@ -15,6 +15,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -#define TCG_GUEST_DEFAULT_MO (0) -#endif
target/m68k/cpu-param.h +0 -3
@@ -19,7 +19,4 @@#define TARGET_INSN_START_EXTRA_WORDS 1 -/* MTTCG not yet supported: require strict ordering */ -#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#endif
target/microblaze/cpu-param.h +0 -3
@@ -29,7 +29,4 @@#define TARGET_INSN_START_EXTRA_WORDS 1 -/* MicroBlaze is always in-order. */ -#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#endif
target/mips/cpu-param.h +0 -2
@@ -22,6 +22,4 @@#define TARGET_INSN_START_EXTRA_WORDS 2 -#define TCG_GUEST_DEFAULT_MO (0) -#endif
target/openrisc/cpu-param.h +0 -2
@@ -14,6 +14,4 @@#define TARGET_INSN_START_EXTRA_WORDS 1 -#define TCG_GUEST_DEFAULT_MO (0) -#endif
target/ppc/cpu-param.h +0 -2
@@ -39,6 +39,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -#define TCG_GUEST_DEFAULT_MO 0 -#endif
target/riscv/cpu-param.h +0 -2
@@ -34,6 +34,4 @@* - M mode HLV/HLVX/HSV 0b111 */ -#define TCG_GUEST_DEFAULT_MO 0 -#endif
target/rx/cpu-param.h +0 -3
@@ -26,7 +26,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -/* MTTCG not yet supported: require strict ordering */ -#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#endif
target/s390x/cpu-param.h +0 -6
@@ -14,10 +14,4 @@#define TARGET_INSN_START_EXTRA_WORDS 2 -/* -* The z/Architecture has a strong memory model with some -* store-after-load re-ordering. -*/ -#define TCG_GUEST_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) -#endif
target/sh4/cpu-param.h +0 -3
@@ -18,7 +18,4 @@#define TARGET_INSN_START_EXTRA_WORDS 1 -/* MTTCG not yet supported: require strict ordering */ -#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#endif
target/sparc/cpu-param.h +0 -23
@@ -23,27 +23,4 @@#define TARGET_INSN_START_EXTRA_WORDS 1 -/* -* From Oracle SPARC Architecture 2015: -* -* Compatibility notes: The PSO memory model described in SPARC V8 and -* SPARC V9 compatibility architecture specifications was never implemented -* in a SPARC V9 implementation and is not included in the Oracle SPARC -* Architecture specification. -* -* The RMO memory model described in the SPARC V9 specification was -* implemented in some non-Sun SPARC V9 implementations, but is not -* directly supported in Oracle SPARC Architecture 2015 implementations. -* -* Therefore always use TSO in QEMU. -* -* D.5 Specification of Partial Store Order (PSO) -* ... [loads] are followed by an implied MEMBAR #LoadLoad | #LoadStore. -* -* D.6 Specification of Total Store Order (TSO) -* ... PSO with the additional requirement that all [stores] are followed -* by an implied MEMBAR #StoreStore. -*/ -#define TCG_GUEST_DEFAULT_MO (TCG_MO_LD_LD | TCG_MO_LD_ST | TCG_MO_ST_ST) -#endif
target/tricore/cpu-param.h +0 -3
@@ -14,7 +14,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -/* MTTCG not yet supported: require strict ordering */ -#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#endif
target/xtensa/cpu-param.h +0 -3
@@ -18,7 +18,4 @@#define TARGET_INSN_START_EXTRA_WORDS 0 -/* Xtensa processors have a weak memory model */ -#define TCG_GUEST_DEFAULT_MO (0) -#endif
target/alpha/cpu.c +2 -1
@@ -235,7 +235,8 @@ static const struct SysemuCPUOps alpha_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps alpha_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* Alpha processors have a weak memory model */ + .guest_default_memory_order =0 , .initialize = alpha_translate_init, .translate_code = alpha_translate_code,
target/arm/cpu.c +2 -1
@@ -2671,7 +2671,8 @@ static const struct SysemuCPUOps arm_sysemu_ops = {#ifdef CONFIG_TCG static const TCGCPUOps arm_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* ARM processors have a weak memory model */ + .guest_default_memory_order =0 , .initialize = arm_translate_init, .translate_code = arm_translate_code,
target/arm/tcg/cpu-v7m.c +2 -1
@@ -232,7 +232,8 @@ static void cortex_m55_initfn(Object *obj) }static const TCGCPUOps arm_v7m_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* ARM processors have a weak memory model */ + .guest_default_memory_order =0 , .initialize = arm_translate_init, .translate_code = arm_translate_code,
target/avr/cpu.c +1 -1
@@ -224,7 +224,7 @@ static const struct SysemuCPUOps avr_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps avr_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .guest_default_memory_order =0 , .initialize = avr_cpu_tcg_init, .translate_code = avr_cpu_translate_code, .synchronize_from_tb = avr_cpu_synchronize_from_tb,
target/hexagon/cpu.c +2 -1
@@ -325,7 +325,8 @@ static void hexagon_cpu_init(Object *obj)#include "accel/tcg/cpu-ops.h" static const TCGCPUOps hexagon_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* MTTCG not yet supported: require strict ordering */ + .guest_default_memory_order =TCG_MO_ALL , .initialize = hexagon_translate_init, .translate_code = hexagon_translate_code, .synchronize_from_tb = hexagon_cpu_synchronize_from_tb,
target/hppa/cpu.c +7 -1
@@ -253,7 +253,13 @@ static const struct SysemuCPUOps hppa_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps hppa_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* PA-RISC 1.x processors have a strong memory model. */ +/* +* ??? While we do not yet implement PA-RISC 2.0, those processors have +* a weak memory model, but with TLB bits that force ordering on a per-page +* basis. It's probably easier to fall back to a strong memory model. +*/ + .guest_default_memory_order =TCG_MO_ALL , .initialize = hppa_translate_init, .translate_code = hppa_translate_code,
target/i386/tcg/tcg-cpu.c +4 -1
@@ -125,7 +125,10 @@ static bool x86_debug_check_breakpoint(CPUState *cs)#include "accel/tcg/cpu-ops.h" static const TCGCPUOps x86_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* +* The x86 has a strong memory model with some store-after-load re-ordering +*/ + .guest_default_memory_order =TCG_MO_ALL & ~TCG_MO_ST_LD , .initialize = tcg_x86_init, .translate_code = x86_translate_code, .synchronize_from_tb = x86_cpu_synchronize_from_tb,
target/loongarch/cpu.c +1 -1
@@ -864,7 +864,7 @@ static void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags)#include "accel/tcg/cpu-ops.h" static const TCGCPUOps loongarch_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .guest_default_memory_order =0 , .initialize = loongarch_translate_init, .translate_code = loongarch_translate_code,
target/m68k/cpu.c +2 -1
@@ -589,7 +589,8 @@ static const struct SysemuCPUOps m68k_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps m68k_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* MTTCG not yet supported: require strict ordering */ + .guest_default_memory_order =TCG_MO_ALL , .initialize = m68k_tcg_init, .translate_code = m68k_translate_code,
target/microblaze/cpu.c +2 -1
@@ -427,7 +427,8 @@ static const struct SysemuCPUOps mb_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps mb_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* MicroBlaze is always in-order. */ + .guest_default_memory_order =TCG_MO_ALL , .initialize = mb_tcg_init, .translate_code = mb_translate_code,
target/mips/cpu.c +1 -1
@@ -551,7 +551,7 @@ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc) }static const TCGCPUOps mips_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .guest_default_memory_order =0 , .initialize = mips_tcg_init, .translate_code = mips_translate_code,
target/openrisc/cpu.c +1 -1
@@ -243,7 +243,7 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps openrisc_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .guest_default_memory_order =0 , .initialize = openrisc_translate_init, .translate_code = openrisc_translate_code,
target/ppc/cpu_init.c +1 -1
@@ -7479,7 +7479,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps ppc_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .guest_default_memory_order =0 , .initialize = ppc_translate_init, .translate_code = ppc_translate_code, .restore_state_to_opc = ppc_restore_state_to_opc,
target/riscv/tcg/tcg-cpu.c +1 -1
@@ -140,7 +140,7 @@ static void riscv_restore_state_to_opc(CPUState *cs, }static const TCGCPUOps riscv_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , + .guest_default_memory_order =0 , .initialize = riscv_translate_init, .translate_code = riscv_translate_code,
target/rx/cpu.c +2 -1
@@ -204,7 +204,8 @@ static const struct SysemuCPUOps rx_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps rx_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* MTTCG not yet supported: require strict ordering */ + .guest_default_memory_order =TCG_MO_ALL , .initialize = rx_translate_init, .translate_code = rx_translate_code,
target/s390x/cpu.c +5 -1
@@ -345,7 +345,11 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, }static const TCGCPUOps s390_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* +* The z/Architecture has a strong memory model with some +* store-after-load re-ordering. +*/ + .guest_default_memory_order =TCG_MO_ALL & ~TCG_MO_ST_LD , .initialize = s390x_translate_init, .translate_code = s390x_translate_code,
target/sh4/cpu.c +2 -1
@@ -262,7 +262,8 @@ static const struct SysemuCPUOps sh4_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps superh_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* MTTCG not yet supported: require strict ordering */ + .guest_default_memory_order =TCG_MO_ALL , .initialize = sh4_translate_init, .translate_code = sh4_translate_code,
target/sparc/cpu.c +22 -1
@@ -1001,7 +1001,28 @@ static const struct SysemuCPUOps sparc_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps sparc_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* +* From Oracle SPARC Architecture 2015: +* +* Compatibility notes: The PSO memory model described in SPARC V8 and +* SPARC V9 compatibility architecture specifications was never +* implemented in a SPARC V9 implementation and is not included in the +* Oracle SPARC Architecture specification. +* +* The RMO memory model described in the SPARC V9 specification was +* implemented in some non-Sun SPARC V9 implementations, but is not +* directly supported in Oracle SPARC Architecture 2015 implementations. +* +* Therefore always use TSO in QEMU. +* +* D.5 Specification of Partial Store Order (PSO) +* ... [loads] are followed by an implied MEMBAR #LoadLoad | #LoadStore. +* +* D.6 Specification of Total Store Order (TSO) +* ... PSO with the additional requirement that all [stores] are followed +* by an implied MEMBAR #StoreStore. +*/ + .guest_default_memory_order =TCG_MO_LD_LD |TCG_MO_LD_ST |TCG_MO_ST_ST , .initialize = sparc_tcg_init, .translate_code = sparc_translate_code,
target/tricore/cpu.c +2 -1
@@ -172,7 +172,8 @@ static const struct SysemuCPUOps tricore_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps tricore_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* MTTCG not yet supported: require strict ordering */ + .guest_default_memory_order =TCG_MO_ALL , .initialize = tricore_tcg_init, .translate_code = tricore_translate_code, .synchronize_from_tb = tricore_cpu_synchronize_from_tb,
target/xtensa/cpu.c +2 -1
@@ -232,7 +232,8 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps xtensa_tcg_ops = { - .guest_default_memory_order =TCG_GUEST_DEFAULT_MO , +/* Xtensa processors have a weak memory model */ + .guest_default_memory_order =0 , .initialize = xtensa_translate_init, .translate_code = xtensa_translate_code,
docs/devel/multi-thread-tcg.rst +2 -2
@@ -28,8 +28,8 @@ vCPU Scheduling We introduce a new running mode where each vCPU will run on its own user-space thread. This is enabled by default for all FE/BE combinations where the host memory model is able to accommodate the -guest (TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO is zero) and the -guest has had the required work done to support this safely +guest (TCGCPUOps::guest_default_memory_order & ~TCG_TARGET_DEFAULT_MO is zero) +and the guest has had the required work done to support this safely (TARGET_SUPPORTS_MTTCG). System emulation will fall back to the original round robin approach
Signature · 1 line
2.43.0
[PULL 036/148] include/system: Move exec/ioport.h to system/ioport.h
In reply to Richard HendersonConvert the existing includes with sed.
---
hw/display/vga_int.h | 2 +-
include/hw/char/parallel-isa.h | 2 +-
include/hw/dma/i8257.h | 2 +-
include/hw/ide/ide-bus.h | 2 +-
include/hw/isa/isa.h | 2 +-
include/{exec => system}/ioport.h | 6 ++----
hw/block/fdc-isa.c | 2 +-
monitor/hmp-cmds.c | 2 +-
system/ioport.c | 2 +-
system/physmem.c | 2 +-
system/qtest.c | 2 +-
target/i386/nvmm/nvmm-all.c | 2 +-
target/i386/whpx/whpx-all.c | 2 +-
tests/qtest/fuzz/qtest_wrappers.c | 2 +-
MAINTAINERS | 2 +-
15 files changed, 16 insertions(+), 18 deletions(-)
rename include/{exec => system}/ioport.h (97%)hw/display/vga_int.h +1 -1
@@ -26,7 +26,7 @@#define HW_VGA_INT_H #include "ui/console.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "system/memory.h" #include "hw/display/bochs-vbe.h"
include/hw/char/parallel-isa.h +1 -1
@@ -12,7 +12,7 @@#include "parallel.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "hw/isa/isa.h" #include "qom/object.h"
include/hw/dma/i8257.h +1 -1
@@ -2,7 +2,7 @@#define HW_I8257_H #include "hw/isa/isa.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "qom/object.h" #define TYPE_I8257 "i8257"
include/hw/ide/ide-bus.h +1 -1
@@ -1,7 +1,7 @@#ifndef HW_IDE_BUS_H #define HW_IDE_BUS_H -#include "exec/ioport.h" +#include "system/ioport.h" #include "hw/ide/ide-dev.h" #include "hw/ide/ide-dma.h"
include/hw/isa/isa.h +1 -1
@@ -4,7 +4,7 @@/* ISA bus */ #include "system/memory.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "hw/qdev-core.h" #include "qom/object.h"
include/system/ioport.h renamed from include/exec/ioport.h +2 -4
@@ -21,8 +21,8 @@* IO ports API */ -#ifndef IOPORT_H -#define IOPORT_H +#ifndef SYSTEM_IOPORT_H +#define SYSTEM_IOPORT_H #include "system/memory.h"
@@ -39,9 +39,7 @@ typedef struct MemoryRegionPortio {#define PORTIO_END_OF_LIST () { } -#ifndef CONFIG_USER_ONLY extern const MemoryRegionOps unassigned_io_ops; -#endif void cpu_outb (uint32_t addr,uint8_t val);void cpu_outw (uint32_t addr,uint16_t val);
hw/block/fdc-isa.c +1 -1
@@ -42,7 +42,7 @@#include "system/block-backend.h" #include "system/blockdev.h" #include "system/system.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/module.h"
monitor/hmp-cmds.c +1 -1
@@ -15,7 +15,7 @@#include "qemu/osdep.h" #include "system/address-spaces.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "exec/gdbstub.h" #include "gdbstub/enums.h" #include "monitor/hmp.h"
system/ioport.c +1 -1
@@ -26,7 +26,7 @@*/ #include "qemu/osdep.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "system/memory.h" #include "system/address-spaces.h" #include "trace.h"
system/physmem.c +1 -1
@@ -51,7 +51,7 @@#include "qemu/memalign.h" #include "qemu/memfd.h" #include "system/memory.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "system/dma.h" #include "system/hostmem.h" #include "system/hw_accel.h"
system/qtest.c +1 -1
@@ -16,7 +16,7 @@#include "system/qtest.h" #include "system/runstate.h" #include "chardev/char-fe.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "system/memory.h" #include "exec/tswap.h" #include "hw/qdev-core.h"
target/i386/nvmm/nvmm-all.c +1 -1
@@ -10,7 +10,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "system/address-spaces.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "qemu/accel.h" #include "system/nvmm.h" #include "system/cpus.h"
target/i386/whpx/whpx-all.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "system/address-spaces.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "gdbstub/helpers.h" #include "qemu/accel.h" #include "system/whpx.h"
tests/qtest/fuzz/qtest_wrappers.c +1 -1
@@ -13,7 +13,7 @@#include "qemu/osdep.h" #include "hw/core/cpu.h" -#include "exec/ioport.h" +#include "system/ioport.h" #include "fuzz.h"
MAINTAINERS +1 -1
@@ -3118,7 +3118,7 @@ M: Peter Xu <[email protected]> M: David Hildenbrand <[email protected]> R: Philippe Mathieu-Daudé <[email protected]> S: Supported -F: include/exec/ioport.h +F: include/system/ioport.h F: include/exec/memop.h F: include/system/memory.h F: include/exec/ram_addr.h
Signature · 1 line
2.43.0
[PULL 070/148] accel/tcg: Remove cpu-all.h, exec-all.h from tb-internal.h
In reply to Richard HendersonNot used by tb-internal.h, but add an include fortarget_page.h in tb-maint.c.
--- accel/tcg/tb-internal.h | 2 -- accel/tcg/tb-maint.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-)
accel/tcg/tb-internal.h +0 -2
@@ -9,8 +9,6 @@#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H #define ACCEL_TCG_TB_INTERNAL_TARGET_H -#include "exec/cpu-all.h" -#include "exec/exec-all.h" #include "exec/translation-block.h" /*
accel/tcg/tb-maint.c +1 -0
@@ -26,6 +26,7 @@#include "exec/page-protection.h" #include "exec/mmap-lock.h" #include "exec/tb-flush.h" +#include "exec/target_page.h" #include "tb-internal.h" #include "system/tcg.h" #include "tcg/tcg.h"
Signature · 1 line
2.43.0
[PULL 102/148] include/exec/cpu-all: move compile time check for CPUArchState to cpu-target.c
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Message-ID: <[email protected]>
--- include/exec/cpu-all.h | 4 ---- cpu-target.c | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-)
include/exec/cpu-all.h +0 -4
@@ -33,8 +33,4 @@#include "cpu.h" -/* Validate correct placement of CPUArchState. */ -QEMU_BUILD_BUG_ON (offsetof(ArchCPU , parent_obj) !=0 ); -QEMU_BUILD_BUG_ON (offsetof(ArchCPU , env) !=sizeof (CPUState)); -#endif /* CPU_ALL_H */
cpu-target.c +5 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "cpu.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h"
@@ -29,6 +30,10 @@#include "accel/accel-cpu-target.h" #include "trace/trace-root.h" +/* Validate correct placement of CPUArchState. */ +QEMU_BUILD_BUG_ON (offsetof(ArchCPU , parent_obj) !=0 ); +QEMU_BUILD_BUG_ON (offsetof(ArchCPU , env) !=sizeof (CPUState)); +char *cpu_model_from_type (const char *typename) {const char *suffix ="-" CPU_RESOLVING_TYPE ;
Signature · 1 line
2.43.0
[PULL 122/148] hw/arm/digic_boards: prepare compilation unit to be common
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Message-ID: <[email protected]>
--- hw/arm/digic_boards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/digic_boards.c +1 -1
@@ -80,7 +80,7 @@ static void digic4_board_init(MachineState *machine, DigicBoard *board)static void digic_load_rom (DigicState *s,hwaddr addr,hwaddr max_size,const char *filename) { -target_long rom_size; +ssize_t rom_size;if (qtest_enabled ()) {/* qtest runs no code so don't attempt a ROM load which
Signature · 1 line
2.43.0
[PULL 113/148] accel/kvm: move KVM_HAVE_MCE_INJECTION define to kvm-all.c
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
This define is used only in accel/kvm/kvm-all.c, so we push directly the definition there. Add more visibility to kvm_arch_on_sigbus_vcpu() to allow removing this define from any header.
The architectures defining KVM_HAVE_MCE_INJECTION are i386, x86_64 and aarch64.
Message-ID: <[email protected]>
--- include/system/kvm.h | 2 -- target/arm/cpu.h | 4 ---- target/i386/cpu.h | 2 -- accel/kvm/kvm-all.c | 5 +++++ 4 files changed, 5 insertions(+), 8 deletions(-)
include/system/kvm.h +0 -2
@@ -390,9 +390,7 @@ bool kvm_vcpu_id_is_valid(int vcpu_id);/* Returns VCPU ID to be used on KVM_CREATE_VCPU ioctl() */ unsigned long kvm_arch_vcpu_id (CPUState *cpu); -#ifdef KVM_HAVE_MCE_INJECTION void kvm_arch_on_sigbus_vcpu (CPUState *cpu,int code,void *addr); -#endif void kvm_arch_init_irq_routing (KVMState *s);
target/arm/cpu.h +0 -4
@@ -33,10 +33,6 @@#include "target/arm/multiprocessing.h" #include "target/arm/gtimer.h" -#ifdef TARGET_AARCH64 -#define KVM_HAVE_MCE_INJECTION 1 -#endif -#define EXCP_UDEF 1/* undefined instruction */ #define EXCP_SWI 2/* software interrupt */ #define EXCP_PREFETCH_ABORT 3
target/i386/cpu.h +0 -2
@@ -35,8 +35,6 @@#define XEN_NR_VIRQS 24 -#define KVM_HAVE_MCE_INJECTION 1 -/* support for self modifying code even if the modified instruction is close to the modifying instruction */ #define TARGET_HAS_PRECISE_SMC
accel/kvm/kvm-all.c +5 -0
@@ -57,6 +57,11 @@#include <sys/eventfd.h> #endif +#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) +# define KVM_HAVE_MCE_INJECTION 1 +#endif + +/* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We * need to use the real host PAGE_SIZE, as that's what KVM will use. */
Signature · 1 line
2.43.0
[PULL 108/148] accel/tcg: fix missing includes for TARGET_HAS_PRECISE_SMC
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
We prepare to remove cpu.h from cpu-all.h, which will transitively remove it from accel/tcg/tb-internal.h, and thus from most of tcg compilation units.
Note: this was caught by a test regression for s390x-softmmu.
Message-ID: <[email protected]>
--- include/exec/poison.h | 1 + accel/tcg/tb-maint.c | 1 + accel/tcg/user-exec.c | 1 + 3 files changed, 3 insertions(+)
include/exec/poison.h +1 -0
@@ -38,6 +38,7 @@#pragma GCC poison TARGET_SUPPORTS_MTTCG#pragma GCC poison TARGET_BIG_ENDIAN#pragma GCC poison TCG_GUEST_DEFAULT_MO +#pragma GCC poison TARGET_HAS_PRECISE_SMC#pragma GCC poison TARGET_LONG_BITS#pragma GCC poison TARGET_FMT_lx
accel/tcg/tb-maint.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qemu/interval-tree.h" #include "qemu/qtree.h" +#include "cpu.h" #include "exec/cputlb.h" #include "exec/log.h" #include "exec/exec-all.h"
accel/tcg/user-exec.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "accel/tcg/cpu-ops.h" #include "disas/disas.h" +#include "cpu.h" #include "exec/vaddr.h" #include "exec/exec-all.h" #include "exec/tlb-flags.h"
Signature · 1 line
2.43.0
[PULL 142/148] tcg: Move qemu_tcg_mttcg_enabled() to 'system/tcg.h'
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
qemu_tcg_mttcg_enabled() is specific to 1/ TCG and 2/ system emulation. Move the prototype declaration to "system/tcg.h", reducing 'mttcg_enabled' variable scope.
Message-ID: <[email protected]>
--- include/hw/core/cpu.h | 9 --------- include/system/tcg.h | 8 ++++++++ accel/tcg/tcg-all.c | 17 ++++++++++++++--- target/riscv/tcg/tcg-cpu.c | 1 + 4 files changed, 23 insertions(+), 12 deletions(-)
include/hw/core/cpu.h +0 -9
@@ -594,15 +594,6 @@ extern CPUTailQ cpus_queue;extern __threadCPUState *current_cpu; -/** -* qemu_tcg_mttcg_enabled: -* Check whether we are running MultiThread TCG or not. -* -* Returns: %true if we are in MTTCG mode %false otherwise. -*/ -extern bool mttcg_enabled; -#define qemu_tcg_mttcg_enabled () (mttcg_enabled) -/** * cpu_paging_enabled: * @cpu: The CPU whose state is to be inspected.
include/system/tcg.h +8 -0
@@ -17,4 +17,12 @@ extern bool tcg_allowed;#define tcg_enabled () 0#endif +/** +* qemu_tcg_mttcg_enabled: +* Check whether we are running MultiThread TCG or not. +* +* Returns: %true if we are in MTTCG mode %false otherwise. +*/ +bool qemu_tcg_mttcg_enabled (void ); +#endif
accel/tcg/tcg-all.c +14 -3
@@ -38,6 +38,7 @@#include "hw/qdev-core.h" #else #include "hw/boards.h" +#include "system/tcg.h" #endif #include "internal-common.h" #include "cpu-param.h"
@@ -58,6 +59,17 @@ typedef struct TCGState TCGState;DECLARE_INSTANCE_CHECKER (TCGState,TCG_STATE , TYPE_TCG_ACCEL) +#ifndef CONFIG_USER_ONLY + +static bool mttcg_enabled; + +bool qemu_tcg_mttcg_enabled (void ) +{ +return mttcg_enabled; +} + +#endif /* !CONFIG_USER_ONLY */ +/* * We default to false if we know other options have been enabled * which are currently incompatible with MTTCG. Otherwise when each
@@ -97,7 +109,6 @@ static void tcg_accel_instance_init(Object *obj)#endif } -bool mttcg_enabled;bool one_insn_per_tb;static int tcg_init_machine (MachineState *ms)
@@ -106,14 +117,14 @@ static int tcg_init_machine(MachineState *ms)unsigned max_threads =1 ; tcg_allowed = true; - mttcg_enabled = s->mttcg_enabled;page_init ();tb_htable_init ();#ifndef CONFIG_USER_ONLY -if (mttcg_enabled) { +if (s->mttcg_enabled) { max_threads = ms->smp.max_cpus; + mttcg_enabled = true; }#endif tcg_init (s->tb_size * MiB, s->splitwx_enabled, max_threads);
target/riscv/tcg/tcg-cpu.c +1 -0
@@ -36,6 +36,7 @@#include "tcg/tcg.h" #ifndef CONFIG_USER_ONLY #include "hw/boards.h" +#include "system/tcg.h" #endif /* Hash that stores user set extensions */
Signature · 1 line
2.43.0
[PULL 099/148] page-vary: Move and rename qemu_target_page_bits_min
In reply to Richard HendersonRename to migration_legacy_page_bits, to make it clear that we cannot change the value without causing a migration break. Move to page-vary.h and page-vary-target.c.
Define via TARGET_PAGE_BITS if not TARGET_PAGE_BITS_VARY.
--- include/exec/page-vary.h | 9 +++++++++ include/exec/target_page.h | 1 - migration/savevm.c | 6 +++--- page-target.c | 5 ----- page-vary-target.c | 9 +++++++++ 5 files changed, 21 insertions(+), 9 deletions(-)
include/exec/page-vary.h +9 -0
@@ -49,4 +49,13 @@ bool set_preferred_target_page_bits(int bits);*/ void finalize_target_page_bits (void ); +/** +* migration_legacy_page_bits +* +* For migration compatibility with qemu v2.9, prior to the introduction +* of the configuration/target-page-bits section, return the value of +* TARGET_PAGE_BITS that the target had then. +*/ +int migration_legacy_page_bits (void ); +#endif /* EXEC_PAGE_VARY_H */
include/exec/target_page.h +0 -1
@@ -63,7 +63,6 @@ static inline int qemu_target_page_bits(void) return TARGET_PAGE_BITS; } -int qemu_target_page_bits_min (void );size_t qemu_target_pages_to_MiB (size_t pages);#endif
migration/savevm.c +3 -3
@@ -50,6 +50,7 @@#include "system/cpus.h" #include "system/memory.h" #include "exec/target_page.h" +#include "exec/page-vary.h" #include "trace.h" #include "qemu/iov.h" #include "qemu/job.h"
@@ -339,7 +340,7 @@ static int configuration_pre_load(void *opaque)* predates the variable-target-page-bits support and is using the * minimum possible value for this CPU. */ - state->target_page_bits =qemu_target_page_bits_min (); + state->target_page_bits =migration_legacy_page_bits ();return 0 ; }
@@ -462,8 +463,7 @@ static const VMStateInfo vmstate_info_capability = {*/ static bool vmstate_target_page_bits_needed (void *opaque) { -return qemu_target_page_bits () - >qemu_target_page_bits_min (); +return qemu_target_page_bits () >migration_legacy_page_bits (); }static const VMStateDescription vmstate_target_page_bits = {
page-target.c +0 -5
@@ -9,11 +9,6 @@#include "qemu/osdep.h" #include "exec/target_page.h" -int qemu_target_page_bits_min (void ) -{ -return TARGET_PAGE_BITS_MIN ; -} -/* Convert target pages to MiB (2**20). */ size_t qemu_target_pages_to_MiB (size_t pages) {
page-vary-target.c +9 -0
@@ -23,6 +23,15 @@#include "exec/page-vary.h" #include "exec/target_page.h" +int migration_legacy_page_bits (void ) +{ +#ifdef TARGET_PAGE_BITS_VARY +return TARGET_PAGE_BITS_MIN ; +#else +return TARGET_PAGE_BITS ; +#endif +} +bool set_preferred_target_page_bits (int bits) {#ifdef TARGET_PAGE_BITS_VARY
Signature · 1 line
2.43.0
[PULL 141/148] tcg: Pass max_threads not max_cpus to tcg_init
In reply to Richard HendersonIn effect, hoist the check for mttcg from tcg_n_regions() to tcg_init_machine().
--- include/tcg/startup.h | 6 +++--- tcg/tcg-internal.h | 2 +- accel/tcg/tcg-all.c | 14 ++++++++------ tcg/region.c | 27 ++++++++++++--------------- tcg/tcg.c | 14 +++++++------- 5 files changed, 31 insertions(+), 32 deletions(-)
include/tcg/startup.h +3 -3
@@ -29,12 +29,12 @@* tcg_init: Initialize the TCG runtime * @tb_size: translation buffer size * @splitwx: use separate rw and rx mappings -* @max_cpus: number of vcpus in system mode +* @max_threads: number of vcpu threads in system mode * * Allocate and initialize TCG resources, especially the JIT buffer. -* In user-only mode, @max_cpus is unused. +* In user-only mode, @max_threads is unused. */ -void tcg_init (size_t tb_size,int splitwx,unsigned max_cpus); +void tcg_init (size_t tb_size,int splitwx,unsigned max_threads);/** * tcg_register_thread: Register this thread with the TCG runtime
tcg/tcg-internal.h +1 -1
@@ -34,7 +34,7 @@ extern TCGContext **tcg_ctxs;extern unsigned int tcg_cur_ctxs;extern unsigned int tcg_max_ctxs; -void tcg_region_init (size_t tb_size,int splitwx,unsigned max_cpus); +void tcg_region_init (size_t tb_size,int splitwx,unsigned max_threads);bool tcg_region_alloc (TCGContext *s);void tcg_region_initial_alloc (TCGContext *s);void tcg_region_prologue_set (TCGContext *s);
accel/tcg/tcg-all.c +8 -6
@@ -103,18 +103,20 @@ bool one_insn_per_tb;static int tcg_init_machine (MachineState *ms) {TCGState *s =TCG_STATE (current_accel ()); -#ifdef CONFIG_USER_ONLY -unsigned max_cpus =1 ; -#else -unsigned max_cpus = ms->smp.max_cpus; -#endif +unsigned max_threads =1 ; tcg_allowed = true; mttcg_enabled = s->mttcg_enabled;page_init ();tb_htable_init (); -tcg_init (s->tb_size * MiB, s->splitwx_enabled, max_cpus); + +#ifndef CONFIG_USER_ONLY +if (mttcg_enabled) { + max_threads = ms->smp.max_cpus; + } +#endif +tcg_init (s->tb_size * MiB, s->splitwx_enabled, max_threads);#if defined(CONFIG_SOFTMMU )/*
tcg/region.c +12 -15
@@ -422,7 +422,7 @@ void tcg_region_reset_all(void)tcg_region_tree_reset_all (); } -static size_t tcg_n_regions (size_t tb_size,unsigned max_cpus) +static size_t tcg_n_regions (size_t tb_size,unsigned max_threads) {#ifdef CONFIG_USER_ONLY return 1 ;
@@ -431,24 +431,25 @@ static size_t tcg_n_regions(size_t tb_size, unsigned max_cpus)/* * It is likely that some vCPUs will translate more code than others, -* so we first try to set more regions than max_cpus, with those regions +* so we first try to set more regions than threads, with those regions * being of reasonable size. If that's not possible we make do by evenly * dividing the code_gen_buffer among the vCPUs. +* +* Use a single region if all we have is one vCPU thread. */ -/* Use a single region if all we have is one vCPU thread */ -if (max_cpus ==1 || !qemu_tcg_mttcg_enabled ()) { +if (max_threads ==1 ) {return 1 ; }/* -* Try to have more regions than max_cpus, with each region being >= 2 MB. +* Try to have more regions than threads, with each region being >= 2 MB. * If we can't, then just allocate one region per vCPU thread. */ n_regions = tb_size / (2 * MiB); -if (n_regions <= max_cpus) { -return max_cpus; +if (n_regions <= max_threads) { +return max_threads; } -return MIN (n_regions, max_cpus *8 ); +return MIN (n_regions, max_threads *8 );#endif }
@@ -731,11 +732,7 @@ static int alloc_code_gen_buffer(size_t size, int splitwx, Error **errp)* and then assigning regions to TCG threads so that the threads can translate * code in parallel without synchronization. * -* In system-mode the number of TCG threads is bounded by max_cpus, so we use at -* least max_cpus regions in MTTCG. In !MTTCG we use a single region. -* Note that the TCG options from the command-line (i.e. -accel accel=tcg,[...]) -* must have been parsed before calling this function, since it calls -* qemu_tcg_mttcg_enabled(). +* In system-mode the number of TCG threads is bounded by max_threads, * * In user-mode we use a single region. Having multiple regions in user-mode * is not supported, because the number of vCPU threads (recall that each thread
@@ -749,7 +746,7 @@ static int alloc_code_gen_buffer(size_t size, int splitwx, Error **errp)* in practice. Multi-threaded guests share most if not all of their translated * code, which makes parallel code generation less appealing than in system-mode */ -void tcg_region_init (size_t tb_size,int splitwx,unsigned max_cpus) +void tcg_region_init (size_t tb_size,int splitwx,unsigned max_threads) {const size_t page_size =qemu_real_host_page_size ();size_t region_size;
@@ -787,7 +784,7 @@ void tcg_region_init(size_t tb_size, int splitwx, unsigned max_cpus)* As a result of this we might end up with a few extra pages at the end of * the buffer; we will assign those to the last region. */ - region.n =tcg_n_regions (tb_size, max_cpus); + region.n =tcg_n_regions (tb_size, max_threads); region_size = tb_size / region.n; region_size =QEMU_ALIGN_DOWN (region_size, page_size);
tcg/tcg.c +7 -7
@@ -1499,7 +1499,7 @@ static void process_constraint_sets(void);static TCGTemp *tcg_global_reg_new_internal (TCGContext *s,TCGType type,TCGReg reg,const char *name); -static void tcg_context_init (unsigned max_cpus) +static void tcg_context_init (unsigned max_threads) {TCGContext *s = &tcg_init_ctx;int n, i;
@@ -1538,15 +1538,15 @@ static void tcg_context_init(unsigned max_cpus)* In user-mode we simply share the init context among threads, since we * use a single region. See the documentation tcg_region_init() for the * reasoning behind this. -* In system-mode we will have at most max_cpus TCG threads. +* In system-mode we will have at most max_threads TCG threads. */ #ifdef CONFIG_USER_ONLY tcg_ctxs = &tcg_ctx; tcg_cur_ctxs =1 ; tcg_max_ctxs =1 ;#else - tcg_max_ctxs = max_cpus; - tcg_ctxs = g_new0(TCGContext *, max_cpus); + tcg_max_ctxs = max_threads; + tcg_ctxs = g_new0(TCGContext *, max_threads);#endif tcg_debug_assert (!tcg_regset_test_reg (s->reserved_regs,TCG_AREG0 ));
@@ -1554,10 +1554,10 @@ static void tcg_context_init(unsigned max_cpus) tcg_env =temp_tcgv_ptr (ts); } -void tcg_init (size_t tb_size,int splitwx,unsigned max_cpus) +void tcg_init (size_t tb_size,int splitwx,unsigned max_threads) { -tcg_context_init (max_cpus); -tcg_region_init (tb_size, splitwx, max_cpus); +tcg_context_init (max_threads); +tcg_region_init (tb_size, splitwx, max_threads); }/*
Signature · 1 line
2.43.0
[PULL 043/148] accel/tcg: Use libuser_ss and libsystem_ss
In reply to Richard HendersonWhile some of these files are built exactly once, due to being in only libuser_ss or libsystem_ss, some of the includes that they depend on require CONFIG_USER_ONLY. So make use of the common infrastructure to allow that.
--- accel/tcg/meson.build | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
accel/tcg/meson.build +13 -4
@@ -1,12 +1,21 @@ -common_ss.add(when: 'CONFIG_TCG', if_true: files( +if not get_option('tcg').allowed() + subdir_done() +endif + +tcg_ss = ss.source_set() + +tcg_ss.add(files( 'cpu-exec-common.c', 'tcg-runtime.c', 'tcg-runtime-gvec.c', )) if get_option('plugins') - common_ss.add(when: 'CONFIG_TCG', if_true: files('plugin-gen.c')) + tcg_ss.add(files('plugin-gen.c')) endif +libuser_ss.add_all(tcg_ss) +libsystem_ss.add_all(tcg_ss) + tcg_specific_ss = ss.source_set() tcg_specific_ss.add(files( 'tcg-all.c',
@@ -22,11 +31,11 @@ specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( 'cputlb.c', )) -user_ss.add(when: ['CONFIG_TCG'], if_true: files( +libuser_ss.add(files( 'user-exec-stub.c', )) -system_ss.add(when: ['CONFIG_TCG'], if_true: files( +libsystem_ss.add(files( 'icount-common.c', 'monitor.c', 'tcg-accel-ops.c',
Signature · 1 line
2.43.0
[PULL 106/148] exec/cpu-all: remove exec/cpu-interrupt include
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Message-ID: <[email protected]>
--- include/exec/cpu-all.h | 1 - target/alpha/cpu.h | 1 + target/arm/cpu.h | 1 + target/avr/cpu.h | 1 + target/hppa/cpu.h | 1 + target/i386/cpu.h | 1 + target/loongarch/cpu.h | 1 + target/m68k/cpu.h | 1 + target/microblaze/cpu.h | 1 + target/mips/cpu.h | 1 + target/openrisc/cpu.h | 1 + target/ppc/cpu.h | 1 + target/riscv/cpu.h | 1 + target/rx/cpu.h | 1 + target/s390x/cpu.h | 1 + target/sh4/cpu.h | 1 + target/sparc/cpu.h | 1 + target/xtensa/cpu.h | 1 + accel/tcg/cpu-exec.c | 1 + hw/alpha/typhoon.c | 1 + hw/m68k/next-cube.c | 1 + hw/ppc/ppc.c | 1 + hw/xtensa/pic_cpu.c | 1 + 23 files changed, 22 insertions(+), 1 deletion(-)
include/exec/cpu-all.h +0 -1
@@ -20,7 +20,6 @@#define CPU_ALL_H #include "exec/cpu-common.h" -#include "exec/cpu-interrupt.h" #include "hw/core/cpu.h" #include "exec/cpu-defs.h" #include "exec/target_page.h"
target/alpha/cpu.h +1 -0
@@ -22,6 +22,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h" #define ICACHE_LINE_SIZE 32
target/arm/cpu.h +1 -0
@@ -25,6 +25,7 @@#include "hw/registerfields.h" #include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "exec/gdbstub.h" #include "exec/page-protection.h" #include "qapi/qapi-types-common.h"
target/avr/cpu.h +1 -0
@@ -23,6 +23,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "system/memory.h" #ifdef CONFIG_USER_ONLY
target/hppa/cpu.h +1 -0
@@ -22,6 +22,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "system/memory.h" #include "qemu/cpu-float.h" #include "qemu/interval-tree.h"
target/i386/cpu.h +1 -0
@@ -24,6 +24,7 @@#include "cpu-qom.h" #include "kvm/hyperv-proto.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "exec/memop.h" #include "hw/i386/topology.h" #include "qapi/qapi-types-common.h"
target/loongarch/cpu.h +1 -0
@@ -10,6 +10,7 @@#include "qemu/int128.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "fpu/softfloat-types.h" #include "hw/registerfields.h" #include "qemu/timer.h"
target/m68k/cpu.h +1 -0
@@ -22,6 +22,7 @@#define M68K_CPU_H #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h" #include "cpu-qom.h"
target/microblaze/cpu.h +1 -0
@@ -23,6 +23,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "qemu/cpu-float.h" +#include "exec/cpu-interrupt.h" typedef struct CPUArchState CPUMBState ;#if !defined(CONFIG_USER_ONLY )
target/mips/cpu.h +1 -0
@@ -3,6 +3,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #ifndef CONFIG_USER_ONLY #include "system/memory.h" #endif
target/openrisc/cpu.h +1 -0
@@ -22,6 +22,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "fpu/softfloat-types.h" /**
target/ppc/cpu.h +1 -0
@@ -23,6 +23,7 @@#include "qemu/int128.h" #include "qemu/cpu-float.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "cpu-qom.h" #include "qom/object.h" #include "hw/registerfields.h"
target/riscv/cpu.h +1 -0
@@ -24,6 +24,7 @@#include "hw/registerfields.h" #include "hw/qdev-properties.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "exec/gdbstub.h" #include "qemu/cpu-float.h" #include "qom/object.h"
target/rx/cpu.h +1 -0
@@ -24,6 +24,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h" #ifdef CONFIG_USER_ONLY
target/s390x/cpu.h +1 -0
@@ -28,6 +28,7 @@#include "cpu-qom.h" #include "cpu_models.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h" #include "qapi/qapi-types-machine-common.h"
target/sh4/cpu.h +1 -0
@@ -22,6 +22,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h" /* CPU Subtypes */
target/sparc/cpu.h +1 -0
@@ -4,6 +4,7 @@#include "qemu/bswap.h" #include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h" #if !defined(TARGET_SPARC64 )
target/xtensa/cpu.h +1 -0
@@ -31,6 +31,7 @@#include "cpu-qom.h" #include "qemu/cpu-float.h" #include "exec/cpu-defs.h" +#include "exec/cpu-interrupt.h" #include "hw/clock.h" #include "xtensa-isa.h"
accel/tcg/cpu-exec.c +1 -0
@@ -26,6 +26,7 @@#include "trace.h" #include "disas/disas.h" #include "exec/cpu-common.h" +#include "exec/cpu-interrupt.h" #include "exec/page-protection.h" #include "exec/mmap-lock.h" #include "exec/translation-block.h"
hw/alpha/typhoon.c +1 -0
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/units.h" +#include "exec/cpu-interrupt.h" #include "qapi/error.h" #include "hw/pci/pci_host.h" #include "cpu.h"
hw/m68k/next-cube.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "exec/hwaddr.h" +#include "exec/cpu-interrupt.h" #include "system/system.h" #include "system/qtest.h" #include "hw/irq.h"
hw/ppc/ppc.c +1 -0
@@ -27,6 +27,7 @@#include "hw/ppc/ppc.h" #include "hw/ppc/ppc_e500.h" #include "qemu/timer.h" +#include "exec/cpu-interrupt.h" #include "system/cpus.h" #include "qemu/log.h" #include "qemu/main-loop.h"
hw/xtensa/pic_cpu.c +1 -0
@@ -27,6 +27,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/cpu-interrupt.h" #include "hw/irq.h" #include "qemu/log.h" #include "qemu/timer.h"
Signature · 1 line
2.43.0
[PULL 098/148] include/exec: Redefine tlb-flags with absolute values
In reply to Richard HendersonDon't base the values on TARGET_PAGE_BITS_MIN, but do verify that TLB_FLAGS_MASK does not overlap minimum page size. All targets now have the same placement for these flags, simplifying mmu management when we enable heterogeneous systems.
--- include/exec/tlb-flags.h | 68 +++++++++++++++++++--------------------- accel/tcg/cputlb.c | 2 ++ 2 files changed, 34 insertions(+), 36 deletions(-)
include/exec/tlb-flags.h +32 -36
@@ -19,54 +19,29 @@#ifndef TLB_FLAGS_H #define TLB_FLAGS_H -#include "exec/cpu-defs.h" +/* +* Flags returned for lookup of a TLB virtual address. +*/ #ifdef CONFIG_USER_ONLY /* -* Allow some level of source compatibility with softmmu. We do not -* support any of the more exotic features, so only invalid pages may -* be signaled by probe_access_flags(). +* Allow some level of source compatibility with softmmu. +* Invalid is set when the page does not have requested permissions. +* MMIO is set when we want the target helper to use the functional +* interface for load/store so that plugins see the access. */ -#define TLB_INVALID_MASK (1 << (TARGET_PAGE_BITS_MIN - 1)) -#define TLB_MMIO (1 << (TARGET_PAGE_BITS_MIN - 2)) -#define TLB_WATCHPOINT 0 +#define TLB_INVALID_MASK (1 << 0) +#define TLB_MMIO (1 << 1) +#define TLB_WATCHPOINT 0#else -/* -* Flags stored in the low bits of the TLB virtual address. -* These are defined so that fast path ram access is all zeros. -* The flags all must be between TARGET_PAGE_BITS and -* maximum address alignment bit. -* -* Use TARGET_PAGE_BITS_MIN so that these bits are constant -* when TARGET_PAGE_BITS_VARY is in effect. -* -* The count, if not the placement of these bits is known -* to tcg/tcg-op-ldst.c, check_max_alignment(). -*/ -/* Zero if TLB entry is valid. */ -#define TLB_INVALID_MASK (1 << (TARGET_PAGE_BITS_MIN - 1)) -/* -* Set if TLB entry references a clean RAM page. The iotlb entry will -* contain the page physical address. -*/ -#define TLB_NOTDIRTY (1 << (TARGET_PAGE_BITS_MIN - 2)) -/* Set if the slow path must be used; more flags in CPUTLBEntryFull. */ -#define TLB_FORCE_SLOW (1 << (TARGET_PAGE_BITS_MIN - 3)) - -/* -* Use this mask to check interception with an alignment mask -* in a TCG backend. -*/ -#define TLB_FLAGS_MASK \ - (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_FORCE_SLOW) -/* * Flags stored in CPUTLBEntryFull.slow_flags[x]. * TLB_FORCE_SLOW must be set in CPUTLBEntry.addr_idx[x]. */ +/* Set if TLB entry requires byte swap. */ #define TLB_BSWAP (1 << 0)/* Set if TLB entry contains a watchpoint. */
@@ -82,6 +57,27 @@ (TLB_BSWAP |TLB_WATCHPOINT |TLB_CHECK_ALIGNED | \TLB_DISCARD_WRITE |TLB_MMIO ) +/* +* Flags stored in CPUTLBEntry.addr_idx[x]. +* These must be above the largest alignment (64 bytes), +* and below the smallest page size (1024 bytes). +* This leaves bits [9:6] available for use. +*/ + +/* Zero if TLB entry is valid. */ +#define TLB_INVALID_MASK (1 << 6) +/* Set if TLB entry references a clean RAM page. */ +#define TLB_NOTDIRTY (1 << 7) +/* Set if the slow path must be used; more flags in CPUTLBEntryFull. */ +#define TLB_FORCE_SLOW (1 << 8) + +/* +* Use this mask to check interception with an alignment mask +* in a TCG backend. +*/ +#define TLB_FLAGS_MASK \ + (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_FORCE_SLOW) +/* The two sets of flags must not overlap. */ QEMU_BUILD_BUG_ON (TLB_FLAGS_MASK &TLB_SLOW_FLAGS_MASK );
accel/tcg/cputlb.c +2 -0
@@ -49,6 +49,8 @@#endif #include "tcg/tcg-ldst.h" +QEMU_BUILD_BUG_ON (TLB_FLAGS_MASK & ((1u <TARGET_PAGE_BITS_MIN ) -1 )); +/* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */ /* #define DEBUG_TLB */ /* #define DEBUG_TLB_LOG */
Signature · 1 line
2.43.0
[PULL 129/148] tcg: Always define TARGET_INSN_START_EXTRA_WORDS
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Do not define TARGET_INSN_START_EXTRA_WORDS under the hood, have each target explicitly define it.
--- include/tcg/insn-start-words.h | 4 ---- include/tcg/tcg-op.h | 2 +- target/alpha/cpu-param.h | 2 ++ target/avr/cpu-param.h | 2 ++ target/hexagon/cpu-param.h | 2 ++ target/loongarch/cpu-param.h | 2 ++ target/ppc/cpu-param.h | 2 ++ target/rx/cpu-param.h | 2 ++ target/tricore/cpu-param.h | 2 ++ target/xtensa/cpu-param.h | 2 ++ 10 files changed, 17 insertions(+), 5 deletions(-)
include/tcg/insn-start-words.h +0 -4
@@ -8,10 +8,6 @@#include "cpu-param.h" -#ifndef TARGET_INSN_START_EXTRA_WORDS -# define TARGET_INSN_START_WORDS 1 -#else # define TARGET_INSN_START_WORDS (1 + TARGET_INSN_START_EXTRA_WORDS) -#endif #endif /* TARGET_INSN_START_WORDS */
include/tcg/tcg-op.h +1 -1
@@ -23,7 +23,7 @@# error #endif -#ifndef TARGET_INSN_START_EXTRA_WORDS +#if TARGET_INSN_START_EXTRA_WORDS ==0 static inline void tcg_gen_insn_start (target_ulong pc) {TCGOp *op =tcg_emit_op (INDEX_op_insn_start,64 /TCG_TARGET_REG_BITS );
target/alpha/cpu-param.h +2 -0
@@ -24,6 +24,8 @@# define TARGET_VIRT_ADDR_SPACE_BITS (30 + TARGET_PAGE_BITS)#endif +#define TARGET_INSN_START_EXTRA_WORDS 0 +/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
target/avr/cpu-param.h +2 -0
@@ -25,6 +25,8 @@#define TARGET_PHYS_ADDR_SPACE_BITS 24#define TARGET_VIRT_ADDR_SPACE_BITS 24 +#define TARGET_INSN_START_EXTRA_WORDS 0 +#define TCG_GUEST_DEFAULT_MO 0#endif
target/hexagon/cpu-param.h +2 -0
@@ -23,4 +23,6 @@#define TARGET_PHYS_ADDR_SPACE_BITS 36#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#define TARGET_INSN_START_EXTRA_WORDS 0 +#endif
target/loongarch/cpu-param.h +2 -0
@@ -13,6 +13,8 @@#define TARGET_PAGE_BITS 12 +#define TARGET_INSN_START_EXTRA_WORDS 0 +#define TCG_GUEST_DEFAULT_MO (0)#endif
target/ppc/cpu-param.h +2 -0
@@ -37,6 +37,8 @@# define TARGET_PAGE_BITS 12#endif +#define TARGET_INSN_START_EXTRA_WORDS 0 +#define TCG_GUEST_DEFAULT_MO 0#endif
target/rx/cpu-param.h +2 -0
@@ -24,4 +24,6 @@#define TARGET_PHYS_ADDR_SPACE_BITS 32#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#define TARGET_INSN_START_EXTRA_WORDS 0 +#endif
target/tricore/cpu-param.h +2 -0
@@ -12,4 +12,6 @@#define TARGET_PHYS_ADDR_SPACE_BITS 32#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#define TARGET_INSN_START_EXTRA_WORDS 0 +#endif
target/xtensa/cpu-param.h +2 -0
@@ -16,6 +16,8 @@#define TARGET_VIRT_ADDR_SPACE_BITS 32#endif +#define TARGET_INSN_START_EXTRA_WORDS 0 +/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
Signature · 1 line
2.43.0
[PULL 083/148] target/microblaze: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
--- target/microblaze/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/microblaze/cpu.c +1 -1
@@ -431,6 +431,7 @@ static const TCGCPUOps mb_tcg_ops = { .translate_code = mb_translate_code, .synchronize_from_tb = mb_cpu_synchronize_from_tb, .restore_state_to_opc = mb_restore_state_to_opc, + .mmu_index = mb_cpu_mmu_index, #ifndef CONFIG_USER_ONLY .tlb_fill = mb_cpu_tlb_fill,
@@ -455,7 +456,6 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) &mcc->parent_phases); cc->class_by_name = mb_cpu_class_by_name; - cc->mmu_index = mb_cpu_mmu_index; cc->dump_state = mb_cpu_dump_state; cc->set_pc = mb_cpu_set_pc; cc->get_pc = mb_cpu_get_pc;
Signature · 1 line
2.43.0
[PULL 081/148] target/loongarch: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
--- target/loongarch/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/loongarch/cpu.c +1 -1
@@ -868,6 +868,7 @@ static const TCGCPUOps loongarch_tcg_ops = { .translate_code = loongarch_translate_code, .synchronize_from_tb = loongarch_cpu_synchronize_from_tb, .restore_state_to_opc = loongarch_restore_state_to_opc, + .mmu_index = loongarch_cpu_mmu_index, #ifndef CONFIG_USER_ONLY .tlb_fill = loongarch_cpu_tlb_fill,
@@ -919,7 +920,6 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) &lacc->parent_phases); cc->class_by_name = loongarch_cpu_class_by_name; - cc->mmu_index = loongarch_cpu_mmu_index; cc->dump_state = loongarch_cpu_dump_state; cc->set_pc = loongarch_cpu_set_pc; cc->get_pc = loongarch_cpu_get_pc;
Signature · 1 line
2.43.0
[PULL 085/148] target/openrisc: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
--- target/openrisc/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/openrisc/cpu.c +1 -1
@@ -247,6 +247,7 @@ static const TCGCPUOps openrisc_tcg_ops = { .translate_code = openrisc_translate_code, .synchronize_from_tb = openrisc_cpu_synchronize_from_tb, .restore_state_to_opc = openrisc_restore_state_to_opc, + .mmu_index = openrisc_cpu_mmu_index, #ifndef CONFIG_USER_ONLY .tlb_fill = openrisc_cpu_tlb_fill,
@@ -269,7 +270,6 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) &occ->parent_phases); cc->class_by_name = openrisc_cpu_class_by_name; - cc->mmu_index = openrisc_cpu_mmu_index; cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; cc->get_pc = openrisc_cpu_get_pc;
Signature · 1 line
2.43.0
[PULL 105/148] exec/cpu-all: remove tswap include
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Message-ID: <[email protected]>
--- include/exec/cpu-all.h | 1 - target/ppc/mmu-hash64.h | 2 ++ target/i386/tcg/system/excp_helper.c | 1 + target/i386/xsave_helper.c | 1 + target/riscv/vector_helper.c | 1 + 5 files changed, 5 insertions(+), 1 deletion(-)
include/exec/cpu-all.h +0 -1
@@ -21,7 +21,6 @@#include "exec/cpu-common.h" #include "exec/cpu-interrupt.h" -#include "exec/tswap.h" #include "hw/core/cpu.h" #include "exec/cpu-defs.h" #include "exec/target_page.h"
target/ppc/mmu-hash64.h +2 -0
@@ -1,6 +1,8 @@#ifndef MMU_HASH64_H #define MMU_HASH64_H +#include "exec/tswap.h" +#ifndef CONFIG_USER_ONLY #ifdef TARGET_PPC64
target/i386/tcg/system/excp_helper.c +1 -0
@@ -23,6 +23,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/tlb-flags.h" +#include "exec/tswap.h" #include "tcg/helper-tcg.h" typedef struct TranslateParams {
target/i386/xsave_helper.c +1 -0
@@ -5,6 +5,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/tswap.h" void x86_cpu_xsave_all_areas (X86CPU *cpu,void *buf,uint32_t buflen) {
target/riscv/vector_helper.c +1 -0
@@ -26,6 +26,7 @@#include "exec/page-protection.h" #include "exec/helper-proto.h" #include "exec/tlb-flags.h" +#include "exec/tswap.h" #include "fpu/softfloat.h" #include "tcg/tcg-gvec-desc.h" #include "internals.h"
Signature · 1 line
2.43.0
[PULL 088/148] target/rx: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
--- target/rx/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/rx/cpu.c +1 -1
@@ -207,6 +207,7 @@ static const TCGCPUOps rx_tcg_ops = { .translate_code = rx_translate_code, .synchronize_from_tb = rx_cpu_synchronize_from_tb, .restore_state_to_opc = rx_restore_state_to_opc, + .mmu_index = rx_cpu_mmu_index, .tlb_fill = rx_cpu_tlb_fill, .cpu_exec_interrupt = rx_cpu_exec_interrupt,
@@ -227,7 +228,6 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) &rcc->parent_phases); cc->class_by_name = rx_cpu_class_by_name; - cc->mmu_index = rx_cpu_mmu_index; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; cc->get_pc = rx_cpu_get_pc;
Signature · 1 line
2.43.0
[PULL 086/148] target/ppc: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Convert CPUClass::mmu_index() to TCGCPUOps::mmu_index(), restricting ppc_cpu_mmu_index() to TCG #ifdef.
Message-ID: <[email protected]>
--- target/ppc/cpu_init.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
target/ppc/cpu_init.c +6 -6
@@ -7216,6 +7216,11 @@ static void ppc_restore_state_to_opc(CPUState *cs, cpu->env.nip = data[0]; } + +static int ppc_cpu_mmu_index (CPUState *cs,bool ifetch) +{ +return ppc_env_mmu_index (cpu_env (cs), ifetch); +}#endif /* CONFIG_TCG */ #ifndef CONFIG_USER_ONLY
@@ -7225,11 +7230,6 @@ static bool ppc_cpu_has_work(CPUState *cs) }#endif /* !CONFIG_USER_ONLY */ -static int ppc_cpu_mmu_index (CPUState *cs,bool ifetch) -{ -return ppc_env_mmu_index (cpu_env (cs), ifetch); -} -static void ppc_cpu_reset_hold (Object *obj,ResetType type) {CPUState *cs =CPU (obj);
@@ -7482,6 +7482,7 @@ static const TCGCPUOps ppc_tcg_ops = { .initialize = ppc_translate_init, .translate_code = ppc_translate_code, .restore_state_to_opc = ppc_restore_state_to_opc, + .mmu_index = ppc_cpu_mmu_index, #ifdef CONFIG_USER_ONLY .record_sigsegv = ppc_cpu_record_sigsegv,
@@ -7518,7 +7519,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) &pcc->parent_phases); cc->class_by_name = ppc_cpu_class_by_name; - cc->mmu_index = ppc_cpu_mmu_index; cc->dump_state = ppc_cpu_dump_state; cc->set_pc = ppc_cpu_set_pc; cc->get_pc = ppc_cpu_get_pc;
Signature · 1 line
2.43.0
[PULL 110/148] exec/cpu-all: remove exec/target_page include
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
--- accel/tcg/tb-hash.h | 1 + hw/s390x/ipl.h | 1 + include/exec/cpu-all.h | 1 - hw/alpha/dp264.c | 1 + hw/arm/boot.c | 1 + hw/arm/smmuv3.c | 1 + hw/avr/atmega.c | 1 + hw/hppa/machine.c | 1 + hw/hyperv/hyperv.c | 1 + hw/hyperv/syndbg.c | 1 + hw/hyperv/vmbus.c | 1 + hw/i386/multiboot.c | 1 + hw/i386/pc.c | 1 + hw/i386/pc_sysfw_ovmf.c | 1 + hw/i386/vapic.c | 1 + hw/loongarch/virt.c | 1 + hw/m68k/q800.c | 1 + hw/m68k/virt.c | 1 + hw/openrisc/boot.c | 1 + hw/pci-host/astro.c | 1 + hw/ppc/e500.c | 1 + hw/ppc/mac_newworld.c | 1 + hw/ppc/mac_oldworld.c | 1 + hw/ppc/ppc_booke.c | 1 + hw/ppc/prep.c | 1 + hw/ppc/spapr_hcall.c | 1 + hw/riscv/riscv-iommu-pci.c | 1 + hw/riscv/riscv-iommu.c | 1 + hw/s390x/s390-pci-bus.c | 1 + hw/s390x/s390-pci-inst.c | 1 + hw/s390x/s390-skeys.c | 1 + hw/sparc/sun4m.c | 1 + hw/sparc64/sun4u.c | 1 + monitor/hmp-cmds-target.c | 1 + semihosting/uaccess.c | 1 + target/alpha/cpu.c | 1 + target/alpha/helper.c | 1 + target/alpha/translate.c | 1 + target/arm/cpu.c | 1 + target/arm/gdbstub64.c | 1 + target/arm/ptw.c | 1 + target/arm/tcg/helper-a64.c | 1 + target/arm/tcg/op_helper.c | 1 + target/arm/tcg/sve_helper.c | 1 + target/arm/tcg/tlb-insns.c | 1 + target/arm/tcg/translate-a64.c | 2 +- target/arm/tcg/translate.c | 1 + target/avr/helper.c | 1 + target/avr/translate.c | 1 + target/hppa/cpu.c | 1 + target/hppa/mem_helper.c | 1 + target/hppa/translate.c | 1 + target/i386/helper.c | 1 + target/i386/kvm/hyperv.c | 1 + target/i386/kvm/kvm.c | 1 + target/i386/kvm/xen-emu.c | 1 + target/i386/sev.c | 1 + target/i386/tcg/access.c | 1 + target/i386/tcg/mpx_helper.c | 1 + target/i386/tcg/system/excp_helper.c | 1 + target/i386/tcg/tcg-cpu.c | 2 +- target/i386/tcg/translate.c | 1 + target/loongarch/cpu_helper.c | 1 + target/loongarch/tcg/tlb_helper.c | 1 + target/loongarch/tcg/translate.c | 1 + target/m68k/helper.c | 1 + target/m68k/translate.c | 1 + target/microblaze/helper.c | 1 + target/microblaze/mmu.c | 1 + target/microblaze/translate.c | 1 + target/mips/tcg/msa_helper.c | 1 + target/mips/tcg/system/cp0_helper.c | 1 + target/mips/tcg/system/tlb_helper.c | 1 + target/mips/tcg/translate.c | 1 + target/openrisc/mmu.c | 1 + target/openrisc/sys_helper.c | 1 + target/openrisc/translate.c | 2 +- target/ppc/mem_helper.c | 1 + target/ppc/mmu-hash32.c | 1 + target/ppc/mmu_common.c | 1 + target/ppc/mmu_helper.c | 1 + target/ppc/translate.c | 1 + target/riscv/cpu_helper.c | 1 + target/riscv/pmp.c | 1 + target/riscv/tcg/tcg-cpu.c | 1 + target/riscv/translate.c | 2 +- target/riscv/vector_helper.c | 1 + target/rx/cpu.c | 1 + target/s390x/helper.c | 1 + target/s390x/ioinst.c | 1 + target/s390x/mmu_helper.c | 1 + target/s390x/tcg/excp_helper.c | 1 + target/s390x/tcg/mem_helper.c | 1 + target/s390x/tcg/misc_helper.c | 1 + target/sh4/helper.c | 1 + target/sh4/translate.c | 1 + target/sparc/ldst_helper.c | 1 + target/sparc/mmu_helper.c | 1 + target/sparc/translate.c | 1 + target/tricore/helper.c | 1 + target/tricore/translate.c | 1 + target/xtensa/helper.c | 1 + target/xtensa/mmu_helper.c | 1 + target/xtensa/translate.c | 1 + target/xtensa/xtensa-semi.c | 1 + 105 files changed, 104 insertions(+), 5 deletions(-)
accel/tcg/tb-hash.h +1 -0
@@ -22,6 +22,7 @@#include "exec/cpu-defs.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "exec/translation-block.h" #include "qemu/xxhash.h" #include "tb-jmp-cache.h"
hw/s390x/ipl.h +1 -0
@@ -14,6 +14,7 @@#define HW_S390_IPL_H #include "cpu.h" +#include "exec/target_page.h" #include "system/address-spaces.h" #include "system/memory.h" #include "hw/qdev-core.h"
include/exec/cpu-all.h +0 -1
@@ -22,6 +22,5 @@#include "exec/cpu-common.h" #include "hw/core/cpu.h" #include "exec/cpu-defs.h" -#include "exec/target_page.h" #endif /* CPU_ALL_H */
hw/alpha/dp264.c +1 -0
@@ -8,6 +8,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/target_page.h" #include "elf.h" #include "hw/loader.h" #include "alpha_sys.h"
hw/arm/boot.c +1 -0
@@ -14,6 +14,7 @@#include <libfdt.h> #include "hw/arm/boot.h" #include "hw/arm/linux-boot-if.h" +#include "exec/target_page.h" #include "system/kvm.h" #include "system/tcg.h" #include "system/system.h"
hw/arm/smmuv3.c +1 -0
@@ -25,6 +25,7 @@#include "hw/qdev-core.h" #include "hw/pci/pci.h" #include "cpu.h" +#include "exec/target_page.h" #include "trace.h" #include "qemu/log.h" #include "qemu/error-report.h"
hw/avr/atmega.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/module.h" #include "qemu/units.h" #include "qapi/error.h" +#include "exec/target_page.h" #include "system/memory.h" #include "system/address-spaces.h" #include "system/system.h"
hw/hppa/machine.c +1 -0
@@ -11,6 +11,7 @@#include "elf.h" #include "hw/loader.h" #include "qemu/error-report.h" +#include "exec/target_page.h" #include "system/reset.h" #include "system/system.h" #include "system/qtest.h"
hw/hyperv/hyperv.c +1 -0
@@ -25,6 +25,7 @@#include "target/i386/kvm/hyperv-proto.h" #include "target/i386/cpu.h" #include "exec/cpu-all.h" +#include "exec/target_page.h" struct SynICState {DeviceState parent_obj;
hw/hyperv/syndbg.c +1 -0
@@ -15,6 +15,7 @@#include "hw/qdev-properties.h" #include "hw/loader.h" #include "cpu.h" +#include "exec/target_page.h" #include "hw/hyperv/hyperv.h" #include "hw/hyperv/vmbus-bridge.h" #include "hw/hyperv/hyperv-proto.h"
hw/hyperv/vmbus.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" +#include "exec/target_page.h" #include "qapi/error.h" #include "migration/vmstate.h" #include "hw/qdev-properties.h"
hw/i386/multiboot.c +1 -0
@@ -29,6 +29,7 @@#include "multiboot.h" #include "hw/loader.h" #include "elf.h" +#include "exec/target_page.h" #include "system/system.h" #include "qemu/error-report.h"
hw/i386/pc.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "qemu/units.h" +#include "exec/target_page.h" #include "hw/i386/pc.h" #include "hw/char/serial-isa.h" #include "hw/char/parallel.h"
hw/i386/pc_sysfw_ovmf.c +1 -0
@@ -26,6 +26,7 @@#include "qemu/osdep.h" #include "qemu/error-report.h" #include "hw/i386/pc.h" +#include "exec/target_page.h" #include "cpu.h" #define OVMF_TABLE_FOOTER_GUID "96b582de-1fb2-45f7-baea-a366c55a082d"
hw/i386/vapic.c +1 -0
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "qemu/module.h" +#include "exec/target_page.h" #include "system/system.h" #include "system/cpus.h" #include "system/hw_accel.h"
hw/loongarch/virt.c +1 -0
@@ -8,6 +8,7 @@#include "qemu/units.h" #include "qemu/datadir.h" #include "qapi/error.h" +#include "exec/target_page.h" #include "hw/boards.h" #include "hw/char/serial-mm.h" #include "system/kvm.h"
hw/m68k/q800.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/units.h" #include "qemu/datadir.h" #include "qemu/guest-random.h" +#include "exec/target_page.h" #include "system/system.h" #include "cpu.h" #include "hw/boards.h"
hw/m68k/virt.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "qemu/units.h" #include "qemu/guest-random.h" +#include "exec/target_page.h" #include "system/system.h" #include "cpu.h" #include "hw/boards.h"
hw/openrisc/boot.c +1 -0
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/cpu-defs.h" +#include "exec/target_page.h" #include "elf.h" #include "hw/loader.h" #include "hw/openrisc/boot.h"
hw/pci-host/astro.c +1 -0
@@ -35,6 +35,7 @@#include "target/hppa/cpu.h" #include "trace.h" #include "qom/object.h" +#include "exec/target_page.h" /* * Helper functions
hw/ppc/e500.c +1 -0
@@ -18,6 +18,7 @@#include "qemu/datadir.h" #include "qemu/units.h" #include "qemu/guest-random.h" +#include "exec/target_page.h" #include "qapi/error.h" #include "e500.h" #include "e500-ccsr.h"
hw/ppc/mac_newworld.c +1 -0
@@ -50,6 +50,7 @@#include "qemu/datadir.h" #include "qemu/units.h" #include "qapi/error.h" +#include "exec/target_page.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" #include "hw/nvram/mac_nvram.h"
hw/ppc/mac_oldworld.c +1 -0
@@ -28,6 +28,7 @@#include "qemu/datadir.h" #include "qemu/units.h" #include "qapi/error.h" +#include "exec/target_page.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" #include "hw/boards.h"
hw/ppc/ppc_booke.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/target_page.h" #include "hw/ppc/ppc.h" #include "qemu/timer.h" #include "system/reset.h"
hw/ppc/prep.c +1 -0
@@ -39,6 +39,7 @@#include "hw/rtc/mc146818rtc.h" #include "hw/isa/pc87312.h" #include "hw/qdev-properties.h" +#include "exec/target_page.h" #include "system/kvm.h" #include "system/reset.h" #include "trace.h"
hw/ppc/spapr_hcall.c +1 -0
@@ -9,6 +9,7 @@#include "qemu/module.h" #include "qemu/error-report.h" #include "exec/tb-flush.h" +#include "exec/target_page.h" #include "helper_regs.h" #include "hw/ppc/ppc.h" #include "hw/ppc/spapr.h"
hw/riscv/riscv-iommu-pci.c +1 -0
@@ -17,6 +17,7 @@*/ #include "qemu/osdep.h" +#include "exec/target_page.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/pci/pci_bus.h"
hw/riscv/riscv-iommu.c +1 -0
@@ -18,6 +18,7 @@#include "qemu/osdep.h" #include "qom/object.h" +#include "exec/target_page.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_device.h" #include "hw/qdev-properties.h"
hw/s390x/s390-pci-bus.c +1 -0
@@ -14,6 +14,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/visitor.h" +#include "exec/target_page.h" #include "hw/s390x/s390-pci-bus.h" #include "hw/s390x/s390-pci-inst.h" #include "hw/s390x/s390-pci-kvm.h"
hw/s390x/s390-pci-inst.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "exec/memop.h" +#include "exec/target_page.h" #include "system/memory.h" #include "qemu/error-report.h" #include "system/hw_accel.h"
hw/s390x/s390-skeys.c +1 -0
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "qemu/units.h" +#include "exec/target_page.h" #include "hw/s390x/s390-virtio-ccw.h" #include "hw/qdev-properties.h" #include "hw/s390x/storage-keys.h"
hw/sparc/sun4m.c +1 -0
@@ -27,6 +27,7 @@#include "qapi/error.h" #include "qemu/datadir.h" #include "cpu.h" +#include "exec/target_page.h" #include "hw/sysbus.h" #include "qemu/error-report.h" #include "qemu/timer.h"
hw/sparc64/sun4u.c +1 -0
@@ -28,6 +28,7 @@#include "qapi/error.h" #include "qemu/datadir.h" #include "cpu.h" +#include "exec/target_page.h" #include "hw/irq.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h"
monitor/hmp-cmds-target.c +1 -0
@@ -31,6 +31,7 @@#include "qapi/error.h" #include "qobject/qdict.h" #include "system/hw_accel.h" +#include "exec/target_page.h" /* Set the current CPU defined by the user. Callers must hold BQL. */ int monitor_set_cpu (Monitor *mon,int cpu_index)
semihosting/uaccess.c +1 -0
@@ -11,6 +11,7 @@#include "exec/cpu-all.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "semihosting/uaccess.h"
target/alpha/cpu.c +1 -0
@@ -25,6 +25,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "fpu/softfloat.h"
target/alpha/helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/cputlb.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "fpu/softfloat-types.h" #include "exec/helper-proto.h" #include "qemu/qemu-print.h"
target/alpha/translate.c +1 -0
@@ -27,6 +27,7 @@#include "exec/helper-gen.h" #include "exec/translator.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "exec/log.h" #define HELPER_H "helper.h"
target/arm/cpu.c +1 -0
@@ -34,6 +34,7 @@#include "internals.h" #include "cpu-features.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "hw/qdev-properties.h" #if !defined(CONFIG_USER_ONLY )#include "hw/loader.h"
target/arm/gdbstub64.c +1 -0
@@ -29,6 +29,7 @@#endif #ifdef CONFIG_TCG #include "accel/tcg/cpu-mmu-index.h" +#include "exec/target_page.h" #endif int aarch64_cpu_gdb_read_register (CPUState *cs,GByteArray *mem_buf,int n)
target/arm/ptw.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/main-loop.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "cpu.h" #include "internals.h"
target/arm/tcg/helper-a64.c +1 -0
@@ -31,6 +31,7 @@#include "exec/cpu-common.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" +#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "qemu/int128.h" #include "qemu/atomic128.h"
target/arm/tcg/op_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/target_page.h" #include "internals.h" #include "cpu-features.h" #include "exec/exec-all.h"
target/arm/tcg/sve_helper.c +1 -0
@@ -23,6 +23,7 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/helper-proto.h" +#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h"
target/arm/tcg/tlb-insns.c +1 -0
@@ -8,6 +8,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "exec/cputlb.h" +#include "exec/target_page.h" #include "cpu.h" #include "internals.h" #include "cpu-features.h"
target/arm/tcg/translate-a64.c +1 -1
@@ -17,8 +17,8 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" -#include "exec/exec-all.h" +#include "exec/target_page.h" #include "translate.h" #include "translate-a64.h" #include "qemu/log.h"
target/arm/tcg/translate.c +1 -0
@@ -27,6 +27,7 @@#include "semihosting/semihost.h" #include "cpregs.h" #include "exec/helper-proto.h" +#include "exec/target_page.h" #define HELPER_H "helper.h"#include "exec/helper-info.c.inc"
target/avr/helper.c +1 -0
@@ -26,6 +26,7 @@#include "accel/tcg/getpc.h" #include "exec/cputlb.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h"
target/avr/translate.c +1 -0
@@ -29,6 +29,7 @@#include "exec/helper-gen.h" #include "exec/log.h" #include "exec/translator.h" +#include "exec/target_page.h" #define HELPER_H "helper.h"#include "exec/helper-info.c.inc"
target/hppa/cpu.c +1 -0
@@ -26,6 +26,7 @@#include "qemu/module.h" #include "exec/exec-all.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "fpu/softfloat.h" #include "tcg/tcg.h" #include "hw/hppa/hppa_hardware.h"
target/hppa/mem_helper.c +1 -0
@@ -24,6 +24,7 @@#include "exec/cputlb.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/helper-proto.h" #include "hw/core/cpu.h" #include "trace.h"
target/hppa/translate.c +1 -0
@@ -28,6 +28,7 @@#include "exec/helper-gen.h" #include "exec/translator.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "exec/log.h" #define HELPER_H "helper.h"
target/i386/helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/cputlb.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "system/runstate.h" #ifndef CONFIG_USER_ONLY #include "system/hw_accel.h"
target/i386/kvm/hyperv.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "qemu/main-loop.h" +#include "exec/target_page.h" #include "hyperv.h" #include "hw/hyperv/hyperv.h" #include "hyperv-proto.h"
target/i386/kvm/kvm.c +1 -0
@@ -67,6 +67,7 @@#include "hw/pci/msix.h" #include "migration/blocker.h" #include "exec/memattrs.h" +#include "exec/target_page.h" #include "trace.h" #include CONFIG_DEVICES
target/i386/kvm/xen-emu.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/error-report.h" +#include "exec/target_page.h" #include "hw/xen/xen.h" #include "system/kvm_int.h" #include "system/kvm_xen.h"
target/i386/sev.c +1 -0
@@ -26,6 +26,7 @@#include "qemu/uuid.h" #include "qemu/error-report.h" #include "crypto/hash.h" +#include "exec/target_page.h" #include "system/kvm.h" #include "kvm/kvm_i386.h" #include "sev.h"
target/i386/tcg/access.c +1 -0
@@ -5,6 +5,7 @@#include "cpu.h" #include "exec/cpu_ldst.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "access.h"
target/i386/tcg/mpx_helper.c +1 -0
@@ -22,6 +22,7 @@#include "exec/helper-proto.h" #include "exec/cpu_ldst.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "helper-tcg.h"
target/i386/tcg/system/excp_helper.c +1 -0
@@ -22,6 +22,7 @@#include "exec/cpu_ldst.h" #include "exec/cputlb.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "exec/tswap.h" #include "tcg/helper-tcg.h"
target/i386/tcg/tcg-cpu.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/accel.h" #include "accel/accel-cpu-target.h" #include "exec/translation-block.h" - +#include "exec/target_page.h" #include "tcg-cpu.h" /* Frob eflags into and out of the CPU temporary format. */
target/i386/tcg/translate.c +1 -0
@@ -26,6 +26,7 @@#include "tcg/tcg-op.h" #include "tcg/tcg-op-gvec.h" #include "exec/translator.h" +#include "exec/target_page.h" #include "fpu/softfloat.h" #include "exec/helper-proto.h"
target/loongarch/cpu_helper.c +1 -0
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "accel/tcg/cpu-mmu-index.h" +#include "exec/target_page.h" #include "internals.h" #include "cpu-csr.h"
target/loongarch/tcg/tlb_helper.c +1 -0
@@ -15,6 +15,7 @@#include "exec/cputlb.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/cpu_ldst.h" #include "exec/log.h" #include "cpu-csr.h"
target/loongarch/tcg/translate.c +1 -0
@@ -11,6 +11,7 @@#include "tcg/tcg-op-gvec.h" #include "exec/translation-block.h" #include "exec/translator.h" +#include "exec/target_page.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/log.h"
target/m68k/helper.c +1 -0
@@ -23,6 +23,7 @@#include "exec/cputlb.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/gdbstub.h" #include "exec/helper-proto.h" #include "system/memory.h"
target/m68k/translate.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "tcg/tcg-op.h" #include "qemu/log.h" #include "qemu/qemu-print.h"
target/microblaze/helper.c +1 -0
@@ -23,6 +23,7 @@#include "exec/cputlb.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "qemu/host-utils.h" #include "exec/log.h"
target/microblaze/mmu.c +1 -0
@@ -24,6 +24,7 @@#include "exec/cputlb.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/page-protection.h" +#include "exec/target_page.h" static unsigned int tlb_decode_size (unsigned int f) {
target/microblaze/translate.c +1 -0
@@ -27,6 +27,7 @@#include "exec/helper-gen.h" #include "exec/translator.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "qemu/qemu-print.h" #include "exec/log.h"
target/mips/tcg/msa_helper.c +1 -0
@@ -25,6 +25,7 @@#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "exec/memop.h" +#include "exec/target_page.h" #include "fpu/softfloat.h" #include "fpu_helper.h"
target/mips/tcg/system/cp0_helper.c +1 -0
@@ -28,6 +28,7 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/cputlb.h" +#include "exec/target_page.h" /* SMP helpers. */
target/mips/tcg/system/tlb_helper.c +1 -0
@@ -24,6 +24,7 @@#include "exec/cputlb.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/cpu_ldst.h" #include "exec/log.h" #include "exec/helper-proto.h"
target/mips/tcg/translate.c +1 -0
@@ -27,6 +27,7 @@#include "internal.h" #include "exec/helper-proto.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "semihosting/semihost.h" #include "trace.h" #include "fpu_helper.h"
target/openrisc/mmu.c +1 -0
@@ -23,6 +23,7 @@#include "cpu.h" #include "exec/cputlb.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "gdbstub/helpers.h" #include "qemu/host-utils.h" #include "hw/loader.h"
target/openrisc/sys_helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/cputlb.h" +#include "exec/target_page.h" #include "exec/helper-proto.h" #include "exception.h" #ifndef CONFIG_USER_ONLY
target/openrisc/translate.c +1 -1
@@ -28,7 +28,7 @@#include "qemu/qemu-print.h" #include "exec/translator.h" #include "exec/translation-block.h" - +#include "exec/target_page.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h"
target/ppc/mem_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "helper_regs.h"
target/ppc/mmu-hash32.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "system/kvm.h" #include "kvm_ppc.h" #include "internal.h"
target/ppc/mmu_common.c +1 -0
@@ -26,6 +26,7 @@#include "mmu-hash32.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/log.h" #include "helper_regs.h" #include "qemu/error-report.h"
target/ppc/mmu_helper.c +1 -0
@@ -27,6 +27,7 @@#include "exec/cputlb.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/log.h" #include "helper_regs.h" #include "qemu/error-report.h"
target/ppc/translate.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "internal.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "tcg/tcg-op.h" #include "tcg/tcg-op-gvec.h" #include "qemu/host-utils.h"
target/riscv/cpu_helper.c +1 -0
@@ -26,6 +26,7 @@#include "exec/cputlb.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "system/memory.h" #include "instmap.h" #include "tcg/tcg-op.h"
target/riscv/pmp.c +1 -0
@@ -26,6 +26,7 @@#include "trace.h" #include "exec/cputlb.h" #include "exec/page-protection.h" +#include "exec/target_page.h" static bool pmp_write_cfg (CPURISCVState *env,uint32_t addr_index,uint8_t val);
target/riscv/tcg/tcg-cpu.c +1 -0
@@ -22,6 +22,7 @@#include "exec/translation-block.h" #include "tcg-cpu.h" #include "cpu.h" +#include "exec/target_page.h" #include "internals.h" #include "pmu.h" #include "time_helper.h"
target/riscv/translate.c +1 -1
@@ -23,7 +23,7 @@#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" - +#include "exec/target_page.h" #include "exec/translator.h" #include "exec/translation-block.h" #include "exec/log.h"
target/riscv/vector_helper.c +1 -0
@@ -26,6 +26,7 @@#include "exec/page-protection.h" #include "exec/helper-proto.h" #include "exec/tlb-flags.h" +#include "exec/target_page.h" #include "exec/tswap.h" #include "fpu/softfloat.h" #include "tcg/tcg-gvec-desc.h"
target/rx/cpu.c +1 -0
@@ -24,6 +24,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "hw/loader.h" #include "fpu/softfloat.h" #include "tcg/debug-assert.h"
target/s390x/helper.c +1 -0
@@ -27,6 +27,7 @@#include "target/s390x/kvm/pv.h" #include "system/hw_accel.h" #include "system/runstate.h" +#include "exec/target_page.h" #include "exec/watchpoint.h" void s390x_tod_timer (void *opaque)
target/s390x/ioinst.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/target_page.h" #include "s390x-internal.h" #include "hw/s390x/ioinst.h" #include "trace.h"
target/s390x/mmu_helper.c +1 -0
@@ -25,6 +25,7 @@#include "system/tcg.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "hw/hw.h" #include "hw/s390x/storage-keys.h" #include "hw/boards.h"
target/s390x/tcg/excp_helper.c +1 -0
@@ -24,6 +24,7 @@#include "exec/helper-proto.h" #include "exec/cputlb.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "exec/watchpoint.h" #include "s390x-internal.h" #include "tcg_s390x.h"
target/s390x/tcg/mem_helper.c +1 -0
@@ -29,6 +29,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/cpu_ldst.h" +#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "accel/tcg/cpu-ops.h" #include "qemu/int128.h"
target/s390x/tcg/misc_helper.c +1 -0
@@ -29,6 +29,7 @@#include "exec/exec-all.h" #include "exec/cputlb.h" #include "exec/cpu_ldst.h" +#include "exec/target_page.h" #include "qapi/error.h" #include "tcg_s390x.h" #include "s390-tod.h"
target/sh4/helper.c +1 -0
@@ -23,6 +23,7 @@#include "exec/cputlb.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/log.h" #if !defined(CONFIG_USER_ONLY )
target/sh4/translate.c +1 -0
@@ -25,6 +25,7 @@#include "exec/helper-gen.h" #include "exec/translation-block.h" #include "exec/translator.h" +#include "exec/target_page.h" #include "exec/log.h" #include "qemu/qemu-print.h"
target/sparc/ldst_helper.c +1 -0
@@ -26,6 +26,7 @@#include "exec/exec-all.h" #include "exec/cputlb.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/cpu_ldst.h" #include "system/memory.h" #ifdef CONFIG_USER_ONLY
target/sparc/mmu_helper.c +1 -0
@@ -23,6 +23,7 @@#include "exec/cputlb.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "exec/tlb-flags.h" #include "system/memory.h" #include "qemu/qemu-print.h"
target/sparc/translate.c +1 -0
@@ -23,6 +23,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "exec/target_page.h" #include "tcg/tcg-op.h" #include "tcg/tcg-op-gvec.h" #include "exec/helper-gen.h"
target/tricore/helper.c +1 -0
@@ -22,6 +22,7 @@#include "exec/cputlb.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "fpu/softfloat-helpers.h" #include "qemu/qemu-print.h"
target/tricore/translate.c +1 -0
@@ -31,6 +31,7 @@#include "tricore-opcodes.h" #include "exec/translator.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "exec/log.h" #define HELPER_H "helper.h"
target/xtensa/helper.c +1 -0
@@ -29,6 +29,7 @@#include "qemu/log.h" #include "cpu.h" #include "exec/cputlb.h" +#include "exec/target_page.h" #include "gdbstub/helpers.h" #include "exec/helper-proto.h" #include "qemu/error-report.h"
target/xtensa/mmu_helper.c +1 -0
@@ -36,6 +36,7 @@#include "accel/tcg/cpu-mmu-index.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "exec/target_page.h" #include "system/memory.h" #define XTENSA_MPU_SEGMENT_MASK 0x0000001f
target/xtensa/translate.c +1 -0
@@ -37,6 +37,7 @@#include "qemu/qemu-print.h" #include "exec/translator.h" #include "exec/translation-block.h" +#include "exec/target_page.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/log.h"
target/xtensa/xtensa-semi.c +1 -0
@@ -29,6 +29,7 @@#include "cpu.h" #include "chardev/char-fe.h" #include "exec/helper-proto.h" +#include "exec/target_page.h" #include "semihosting/semihost.h" #include "semihosting/uaccess.h" #include "qapi/error.h"
Signature · 1 line
2.43.0
[PULL 078/148] target/i386: Remove unused cpu_(ldub, stb)_kernel macros
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
--- target/i386/tcg/seg_helper.h | 6 ------ 1 file changed, 6 deletions(-)
target/i386/tcg/seg_helper.h +0 -6
@@ -35,8 +35,6 @@* TODO: Convert callers to compute cpu_mmu_index_kernel once * and use *_mmuidx_ra directly. */ -#define cpu_ldub_kernel_ra (e, p, r) \ - cpu_ldub_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)#define cpu_lduw_kernel_ra (e, p, r) \ cpu_lduw_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)#define cpu_ldl_kernel_ra (e, p, r) \
@@ -44,8 +42,6 @@#define cpu_ldq_kernel_ra (e, p, r) \ cpu_ldq_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) -#define cpu_stb_kernel_ra (e, p, v, r) \ - cpu_stb_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)#define cpu_stw_kernel_ra (e, p, v, r) \ cpu_stw_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)#define cpu_stl_kernel_ra (e, p, v, r) \
@@ -53,12 +49,10 @@#define cpu_stq_kernel_ra (e, p, v, r) \ cpu_stq_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) -#define cpu_ldub_kernel (e, p) cpu_ldub_kernel_ra(e, p, 0)#define cpu_lduw_kernel (e, p) cpu_lduw_kernel_ra(e, p, 0)#define cpu_ldl_kernel (e, p) cpu_ldl_kernel_ra(e, p, 0)#define cpu_ldq_kernel (e, p) cpu_ldq_kernel_ra(e, p, 0) -#define cpu_stb_kernel (e, p, v) cpu_stb_kernel_ra(e, p, v, 0)#define cpu_stw_kernel (e, p, v) cpu_stw_kernel_ra(e, p, v, 0)#define cpu_stl_kernel (e, p, v) cpu_stl_kernel_ra(e, p, v, 0)#define cpu_stq_kernel (e, p, v) cpu_stq_kernel_ra(e, p, v, 0)
Signature · 1 line
2.43.0
[PULL 146/148] target/riscv: Remove AccelCPUClass::cpu_class_init need
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Expose riscv_tcg_ops symbol, then directly set it as CPUClass::tcg_ops in TYPE_RISCV_CPU's class_init(), using CONFIG_TCG #ifdef'ry. No need for the AccelCPUClass::cpu_class_init() handler anymore.
Message-ID: <[email protected]>
--- target/riscv/tcg/tcg-cpu.h | 2 ++ target/riscv/cpu.c | 3 +++ target/riscv/tcg/tcg-cpu.c | 16 +--------------- 3 files changed, 6 insertions(+), 15 deletions(-)
target/riscv/tcg/tcg-cpu.h +2 -0
@@ -26,6 +26,8 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp);void riscv_tcg_cpu_finalize_features (RISCVCPU *cpu,Error **errp);bool riscv_cpu_tcg_compatible (RISCVCPU *cpu); +extern const TCGCPUOps riscv_tcg_ops; +struct DisasContext ;struct RISCVCPUConfig ; typedef struct RISCVDecoder {
target/riscv/cpu.c +3 -0
@@ -3054,6 +3054,9 @@ static void riscv_cpu_common_class_init(ObjectClass *c, void *data) cc->get_arch_id = riscv_get_arch_id;#endif cc->gdb_arch_name = riscv_gdb_arch_name; +#ifdef CONFIG_TCG + cc->tcg_ops = &riscv_tcg_ops; +#endif /* CONFIG_TCG */ device_class_set_props (dc, riscv_cpu_properties); }
target/riscv/tcg/tcg-cpu.c +1 -15
@@ -140,7 +140,7 @@ static void riscv_restore_state_to_opc(CPUState *cs, env->excp_uw2 = data[2 ]; } -static const TCGCPUOps riscv_tcg_ops = { +const TCGCPUOps riscv_tcg_ops = { .guest_default_memory_order =0 , .initialize = riscv_translate_init,
@@ -1527,24 +1527,10 @@ static void riscv_tcg_cpu_instance_init(CPUState *cs) } } -static void riscv_tcg_cpu_init_ops (AccelCPUClass *accel_cpu,CPUClass *cc) -{ -/* -* All cpus use the same set of operations. -*/ - cc->tcg_ops = &riscv_tcg_ops; -} - -static void riscv_tcg_cpu_class_init (CPUClass *cc) -{ - cc->init_accel_cpu = riscv_tcg_cpu_init_ops; -} -static void riscv_tcg_cpu_accel_class_init (ObjectClass *oc,void *data) {AccelCPUClass *acc =ACCEL_CPU_CLASS (oc); - acc->cpu_class_init = riscv_tcg_cpu_class_init; acc->cpu_instance_init = riscv_tcg_cpu_instance_init; acc->cpu_target_realize = riscv_tcg_cpu_realize; }
Signature · 1 line
2.43.0
[PULL 048/148] include/exec: Split out watchpoint.h
In reply to Richard HendersonRelatively few objects in qemu care about watchpoints, so split out to a new header. Removes an instance of CONFIG_USER_ONLY from hw/core/cpu.h.
--- include/exec/watchpoint.h | 41 +++++++++++++++++++++++++++++ include/hw/core/cpu.h | 30 --------------------- accel/tcg/tcg-accel-ops.c | 1 + system/watchpoint.c | 1 + target/arm/debug_helper.c | 1 + target/i386/cpu.c | 1 + target/i386/machine.c | 2 +- target/i386/tcg/system/bpt_helper.c | 1 + target/ppc/cpu.c | 1 + target/ppc/cpu_init.c | 2 +- target/riscv/debug.c | 1 + target/s390x/helper.c | 1 + target/s390x/tcg/excp_helper.c | 1 + target/xtensa/dbg_helper.c | 1 + 14 files changed, 53 insertions(+), 32 deletions(-) create mode 100644 include/exec/watchpoint.h
include/exec/watchpoint.h new file +41 -0
@@ -0,0 +1,41 @@ +/* +* CPU watchpoints +* +* Copyright (c) 2012 SUSE LINUX Products GmbH +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef EXEC_WATCHPOINT_H +#define EXEC_WATCHPOINT_H + +#if defined(CONFIG_USER_ONLY ) +static inline int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len, +int flags,CPUWatchpoint **watchpoint) +{ +return -ENOSYS ; +} + +static inline int cpu_watchpoint_remove (CPUState *cpu,vaddr addr, +vaddr len,int flags) +{ +return -ENOSYS ; +} + +static inline void cpu_watchpoint_remove_by_ref (CPUState *cpu, +CPUWatchpoint *wp) +{ +} + +static inline void cpu_watchpoint_remove_all (CPUState *cpu,int mask) +{ +} +#else +int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len, +int flags,CPUWatchpoint **watchpoint); +int cpu_watchpoint_remove (CPUState *cpu,vaddr addr, +vaddr len,int flags); +void cpu_watchpoint_remove_by_ref (CPUState *cpu,CPUWatchpoint *watchpoint); +void cpu_watchpoint_remove_all (CPUState *cpu,int mask); +#endif + +#endif /* EXEC_WATCHPOINT_H */
include/hw/core/cpu.h +0 -30
@@ -1109,36 +1109,6 @@ static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr pc, int mask)return false; } -#if defined(CONFIG_USER_ONLY ) -static inline int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len, -int flags,CPUWatchpoint **watchpoint) -{ -return -ENOSYS ; -} - -static inline int cpu_watchpoint_remove (CPUState *cpu,vaddr addr, -vaddr len,int flags) -{ -return -ENOSYS ; -} - -static inline void cpu_watchpoint_remove_by_ref (CPUState *cpu, -CPUWatchpoint *wp) -{ -} - -static inline void cpu_watchpoint_remove_all (CPUState *cpu,int mask) -{ -} -#else -int cpu_watchpoint_insert (CPUState *cpu,vaddr addr,vaddr len, -int flags,CPUWatchpoint **watchpoint); -int cpu_watchpoint_remove (CPUState *cpu,vaddr addr, -vaddr len,int flags); -void cpu_watchpoint_remove_by_ref (CPUState *cpu,CPUWatchpoint *watchpoint); -void cpu_watchpoint_remove_all (CPUState *cpu,int mask); -#endif -/** * cpu_get_address_space: * @cpu: CPU to get address space from
accel/tcg/tcg-accel-ops.c +1 -0
@@ -37,6 +37,7 @@#include "exec/hwaddr.h" #include "exec/tb-flush.h" #include "exec/translation-block.h" +#include "exec/watchpoint.h" #include "gdbstub/enums.h" #include "hw/core/cpu.h"
system/watchpoint.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/error-report.h" #include "exec/cputlb.h" #include "exec/target_page.h" +#include "exec/watchpoint.h" #include "hw/core/cpu.h" /* Add a watchpoint. */
target/arm/debug_helper.c +1 -0
@@ -13,6 +13,7 @@#include "cpregs.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" +#include "exec/watchpoint.h" #include "system/tcg.h" #ifdef CONFIG_TCG
target/i386/cpu.c +1 -0
@@ -35,6 +35,7 @@#include "standard-headers/asm-x86/kvm_para.h" #include "hw/qdev-properties.h" #include "hw/i386/topology.h" +#include "exec/watchpoint.h" #ifndef CONFIG_USER_ONLY #include "system/reset.h" #include "qapi/qapi-commands-machine-target.h"
target/i386/machine.c +1 -1
@@ -7,7 +7,7 @@#include "hw/i386/x86.h" #include "kvm/kvm_i386.h" #include "hw/xen/xen.h" - +#include "exec/watchpoint.h" #include "system/kvm.h" #include "system/kvm_xen.h" #include "system/tcg.h"
target/i386/tcg/system/bpt_helper.c +1 -0
@@ -21,6 +21,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" +#include "exec/watchpoint.h" #include "tcg/helper-tcg.h"
target/ppc/cpu.c +1 -0
@@ -22,6 +22,7 @@#include "cpu-models.h" #include "cpu-qom.h" #include "exec/log.h" +#include "exec/watchpoint.h" #include "fpu/softfloat-helpers.h" #include "mmu-hash64.h" #include "helper_regs.h"
target/ppc/cpu_init.c +1 -1
@@ -40,7 +40,7 @@#include "qemu/cutils.h" #include "disas/capstone.h" #include "fpu/softfloat.h" - +#include "exec/watchpoint.h" #include "helper_regs.h" #include "internal.h" #include "spr_common.h"
target/riscv/debug.c +1 -0
@@ -30,6 +30,7 @@#include "trace.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" +#include "exec/watchpoint.h" #include "system/cpu-timers.h" /*
target/s390x/helper.c +1 -0
@@ -27,6 +27,7 @@#include "target/s390x/kvm/pv.h" #include "system/hw_accel.h" #include "system/runstate.h" +#include "exec/watchpoint.h" void s390x_tod_timer (void *opaque) {
target/s390x/tcg/excp_helper.c +1 -0
@@ -24,6 +24,7 @@#include "exec/helper-proto.h" #include "exec/cputlb.h" #include "exec/exec-all.h" +#include "exec/watchpoint.h" #include "s390x-internal.h" #include "tcg_s390x.h" #ifndef CONFIG_USER_ONLY
target/xtensa/dbg_helper.c +1 -0
@@ -31,6 +31,7 @@#include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" +#include "exec/watchpoint.h" #include "system/address-spaces.h" void HELPER (wsr_ibreakenable )(CPUXtensaState *env,uint32_t v)
Signature · 1 line
2.43.0
[PULL 054/148] include/hw/intc: Remove ifndef CONFIG_USER_ONLY from armv7m_nvic.h
In reply to Richard HendersonWe were hiding a number of declarations from user-only, although it hurts nothing to allow them. The inlines for user-only are unused.
--- include/hw/intc/armv7m_nvic.h | 14 -------------- 1 file changed, 14 deletions(-)
include/hw/intc/armv7m_nvic.h +0 -14
@@ -189,21 +189,7 @@ int armv7m_nvic_raw_execution_priority(NVICState *s);* @secure: the security state to test * This corresponds to the pseudocode IsReqExecPriNeg(). */ -#ifndef CONFIG_USER_ONLY bool armv7m_nvic_neg_prio_requested (NVICState *s,bool secure); -#else -static inline bool armv7m_nvic_neg_prio_requested (NVICState *s,bool secure) -{ -return false; -} -#endif -#ifndef CONFIG_USER_ONLY bool armv7m_nvic_can_take_pending_exception (NVICState *s); -#else -static inline bool armv7m_nvic_can_take_pending_exception (NVICState *s) -{ -return true; -} -#endif #endif
Signature · 1 line
2.43.0
[PULL 112/148] exec/cpu-all: remove this header
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Message-ID: <[email protected]>
--- include/exec/cpu-all.h | 25 ------------------------- include/hw/core/cpu.h | 2 +- include/qemu/bswap.h | 3 --- target/alpha/cpu.h | 2 -- target/arm/cpu.h | 2 -- target/avr/cpu.h | 2 -- target/hexagon/cpu.h | 2 -- target/hppa/cpu.h | 2 -- target/i386/cpu.h | 1 - target/loongarch/cpu.h | 2 -- target/m68k/cpu.h | 2 -- target/microblaze/cpu.h | 2 -- target/mips/cpu.h | 2 -- target/openrisc/cpu.h | 2 -- target/ppc/cpu.h | 2 -- target/riscv/cpu.h | 2 -- target/rx/cpu.h | 2 -- target/s390x/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/tricore/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- accel/tcg/cpu-exec.c | 1 - hw/hyperv/hyperv.c | 1 - semihosting/uaccess.c | 1 - tcg/tcg-op-ldst.c | 2 +- 26 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 include/exec/cpu-all.h
include/exec/cpu-all.h deleted +0 -25
@@ -1,25 +0,0 @@ -/* -* defines common to all virtual CPUs -* -* Copyright (c) 2003 Fabrice Bellard -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library 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 -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ -#ifndef CPU_ALL_H -#define CPU_ALL_H - -#include "hw/core/cpu.h" -#include "exec/cpu-defs.h" - -#endif /* CPU_ALL_H */
include/hw/core/cpu.h +1 -1
@@ -579,7 +579,7 @@ QEMU_BUILD_BUG_ON(offsetof(CPUState, neg) !=static inline CPUArchState *cpu_env (CPUState *cpu) { -/* We validate that CPUArchState follows CPUState in cpu-all.h. */ +/* We validate that CPUArchState follows CPUState in cpu-target.c */ return (CPUArchState *)(cpu +1 ); }
include/qemu/bswap.h +0 -3
@@ -205,9 +205,6 @@ CPU_CONVERT(le, 64, uint64_t)* te : target endian * (except for byte accesses, which have no endian infix). * -* The target endian accessors are obviously only available to source -* files which are built per-target; they are defined in cpu-all.h. -* * In all cases these functions take a host pointer. * For accessors that take a guest address rather than a * host address, see the cpu_{ld,st}_* accessors defined in
target/alpha/cpu.h +0 -2
@@ -289,8 +289,6 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags);int alpha_cpu_gdb_read_register (CPUState *cpu,GByteArray *buf,int reg);int alpha_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -#include "exec/cpu-all.h" -enum {FEATURE_ASN =0x00000001 ,FEATURE_SPS =0x00000002 ,
target/arm/cpu.h +0 -2
@@ -2968,8 +2968,6 @@ static inline bool arm_sctlr_b(CPUARMState *env)uint64_t arm_sctlr (CPUARMState *env,int el); -#include "exec/cpu-all.h" -/* * We have more than 32-bits worth of state per TB, so we split the data * between tb->flags and tb->cs_base, which is otherwise unused for ARM.
target/avr/cpu.h +0 -2
@@ -259,6 +259,4 @@ bool avr_cpu_tlb_fill(CPUState *cs, vaddr address, int size,extern const MemoryRegionOps avr_cpu_reg1;extern const MemoryRegionOps avr_cpu_reg2; -#include "exec/cpu-all.h" -#endif /* QEMU_AVR_CPU_H */
target/hexagon/cpu.h +0 -2
@@ -158,6 +158,4 @@ void hexagon_translate_init(void);void hexagon_translate_code (CPUState *cs,TranslationBlock *tb,int *max_insns,vaddr pc,void *host_pc); -#include "exec/cpu-all.h" -#endif /* HEXAGON_CPU_H */
target/hppa/cpu.h +0 -2
@@ -306,8 +306,6 @@ struct HPPACPUClass {ResettablePhases parent_phases; }; -#include "exec/cpu-all.h" -static inline bool hppa_is_pa20 (const CPUHPPAState *env) {return env->is_pa20;
target/i386/cpu.h +0 -1
@@ -2604,7 +2604,6 @@ static inline bool is_mmu_index_32(int mmu_index)#define CC_SRC2 (env->cc_src2)#define CC_OP (env->cc_op) -#include "exec/cpu-all.h" #include "svm.h" #if !defined(CONFIG_USER_ONLY )
target/loongarch/cpu.h +0 -2
@@ -504,8 +504,6 @@ static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, vaddr *pc, *flags |=is_va32 (env) *HW_FLAGS_VA32 ; } -#include "exec/cpu-all.h" -#define CPU_RESOLVING_TYPE TYPE_LOONGARCH_CPUvoid loongarch_cpu_post_init (Object *obj);
target/m68k/cpu.h +0 -2
@@ -596,8 +596,6 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, MemTxResult response, uintptr_t retaddr);#endif -#include "exec/cpu-all.h" -/* TB flags */ #define TB_FLAGS_MACSR 0x0f#define TB_FLAGS_MSR_S_BIT 13
target/microblaze/cpu.h +0 -2
@@ -411,8 +411,6 @@ void mb_translate_code(CPUState *cs, TranslationBlock *tb,#define MMU_USER_IDX 2/* See NB_MMU_MODES in cpu-defs.h. */ -#include "exec/cpu-all.h" -/* Ensure there is no overlap between the two masks. */ QEMU_BUILD_BUG_ON (MSR_TB_MASK &IFLAGS_TB_MASK );
target/mips/cpu.h +0 -2
@@ -1258,8 +1258,6 @@ static inline int mips_env_mmu_index(CPUMIPSState *env)return hflags_mmu_index (env->hflags); } -#include "exec/cpu-all.h" -/* Exceptions */ enum {EXCP_NONE =-1 ,
target/openrisc/cpu.h +0 -2
@@ -334,8 +334,6 @@ void cpu_openrisc_count_stop(OpenRISCCPU *cpu);#define CPU_RESOLVING_TYPE TYPE_OPENRISC_CPU -#include "exec/cpu-all.h" -#define TB_FLAGS_SM SR_SM#define TB_FLAGS_DME SR_DME#define TB_FLAGS_IME SR_IME
target/ppc/cpu.h +0 -2
@@ -1704,8 +1704,6 @@ void ppc_compat_add_property(Object *obj, const char *name, uint32_t *compat_pvr, const char *basedesc);#endif /* defined(TARGET_PPC64) */ -#include "exec/cpu-all.h" -/*****************************************************************************/ /* CRF definitions */ #define CRF_LT_BIT 3
target/riscv/cpu.h +0 -2
@@ -634,8 +634,6 @@ G_NORETURN void riscv_raise_exception(CPURISCVState *env,target_ulong riscv_cpu_get_fflags (CPURISCVState *env);void riscv_cpu_set_fflags (CPURISCVState *env,target_ulong ); -#include "exec/cpu-all.h" - FIELD(TB_FLAGS, MEM_IDX, 0, 3)FIELD (TB_FLAGS ,FS ,3 ,2 )/* Vector flags */
target/rx/cpu.h +0 -2
@@ -147,8 +147,6 @@ void rx_translate_code(CPUState *cs, TranslationBlock *tb, int *max_insns, vaddr pc, void *host_pc);void rx_cpu_unpack_psw (CPURXState *env,uint32_t psw,int rte); -#include "exec/cpu-all.h" -#define CPU_INTERRUPT_SOFT CPU_INTERRUPT_TGT_INT_0#define CPU_INTERRUPT_FIR CPU_INTERRUPT_TGT_INT_1
target/s390x/cpu.h +0 -2
@@ -948,6 +948,4 @@ uint64_t s390_cpu_get_psw_mask(CPUS390XState *env);/* outside of target/s390x/ */ S390CPU *s390_cpu_addr2state (uint16_t cpu_addr); -#include "exec/cpu-all.h" -#endif
target/sh4/cpu.h +0 -2
@@ -288,8 +288,6 @@ void cpu_load_tlb(CPUSH4State * env);/* MMU modes definitions */ #define MMU_USER_IDX 1 -#include "exec/cpu-all.h" -/* MMU control register */ #define MMUCR 0x1F000010#define MMUCR_AT (1<<0)
target/sparc/cpu.h +0 -2
@@ -729,8 +729,6 @@ static inline int cpu_pil_allowed(CPUSPARCState *env1, int pil)#endif } -#include "exec/cpu-all.h" -#ifdef TARGET_SPARC64 /* sun4u.c */ void cpu_tick_set_count (CPUTimer *timer,uint64_t count);
target/tricore/cpu.h +0 -2
@@ -251,8 +251,6 @@ void fpu_set_state(CPUTriCoreState *env);#define MMU_USER_IDX 2 -#include "exec/cpu-all.h" - FIELD(TB_FLAGS, PRIV, 0, 2)void cpu_state_reset (CPUTriCoreState *s);
target/xtensa/cpu.h +0 -2
@@ -733,8 +733,6 @@ static inline uint32_t xtensa_replicate_windowstart(CPUXtensaState *env)#define XTENSA_CSBASE_LBEG_OFF_MASK 0x00ff0000#define XTENSA_CSBASE_LBEG_OFF_SHIFT 16 -#include "exec/cpu-all.h" -static inline void cpu_get_tb_cpu_state (CPUXtensaState *env,vaddr *pc,uint64_t *cs_base,uint32_t *flags) {
accel/tcg/cpu-exec.c +0 -1
@@ -35,7 +35,6 @@#include "qemu/rcu.h" #include "exec/log.h" #include "qemu/main-loop.h" -#include "exec/cpu-all.h" #include "cpu.h" #include "exec/icount.h" #include "exec/replay-core.h"
hw/hyperv/hyperv.c +0 -1
@@ -24,7 +24,6 @@#include "qom/object.h" #include "target/i386/kvm/hyperv-proto.h" #include "target/i386/cpu.h" -#include "exec/cpu-all.h" #include "exec/target_page.h" struct SynICState {
semihosting/uaccess.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include "exec/cpu-all.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/exec-all.h" #include "exec/target_page.h"
tcg/tcg-op-ldst.c +1 -1
@@ -37,7 +37,7 @@ static void check_max_alignment(unsigned a_bits) {/* * The requested alignment cannot overlap the TLB flags. -* FIXME: Must keep the count up-to-date with "exec/cpu-all.h". +* FIXME: Must keep the count up-to-date with "exec/tlb-flags.h". */ if (tcg_use_softmmu) {tcg_debug_assert (a_bits +5 <= tcg_ctx->page_bits);
Signature · 1 line
2.43.0
[PULL 111/148] exec/cpu-all: transfer exec/cpu-common include to cpu.h headers
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Message-ID: <[email protected]>
--- include/exec/cpu-all.h | 1 - include/exec/cpu_ldst.h | 1 + target/alpha/cpu.h | 1 + target/arm/cpu.h | 1 + target/avr/cpu.h | 1 + target/hexagon/cpu.h | 1 + target/hppa/cpu.h | 1 + target/i386/cpu.h | 1 + target/loongarch/cpu.h | 1 + target/m68k/cpu.h | 1 + target/microblaze/cpu.h | 1 + target/mips/cpu.h | 1 + target/openrisc/cpu.h | 1 + target/ppc/cpu.h | 1 + target/riscv/cpu.h | 1 + target/rx/cpu.h | 1 + target/s390x/cpu.h | 1 + target/sh4/cpu.h | 1 + target/sparc/cpu.h | 1 + target/tricore/cpu.h | 1 + target/xtensa/cpu.h | 1 + cpu-target.c | 1 + 22 files changed, 21 insertions(+), 1 deletion(-)
include/exec/cpu-all.h +0 -1
@@ -19,7 +19,6 @@#ifndef CPU_ALL_H #define CPU_ALL_H -#include "exec/cpu-common.h" #include "hw/core/cpu.h" #include "exec/cpu-defs.h"
include/exec/cpu_ldst.h +1 -0
@@ -66,6 +66,7 @@#error Can only include this header with TCG#endif +#include "exec/cpu-common.h" #include "exec/cpu-ldst-common.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/abi_ptr.h"
target/alpha/cpu.h +1 -0
@@ -21,6 +21,7 @@#define ALPHA_CPU_H #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h"
target/arm/cpu.h +1 -0
@@ -24,6 +24,7 @@#include "qemu/cpu-float.h" #include "hw/registerfields.h" #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "exec/gdbstub.h"
target/avr/cpu.h +1 -0
@@ -22,6 +22,7 @@#define QEMU_AVR_CPU_H #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "system/memory.h"
target/hexagon/cpu.h +1 -0
@@ -21,6 +21,7 @@#include "fpu/softfloat-types.h" #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "hex_regs.h" #include "mmvec/mmvec.h"
target/hppa/cpu.h +1 -0
@@ -21,6 +21,7 @@#define HPPA_CPU_H #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "system/memory.h"
target/i386/cpu.h +1 -0
@@ -23,6 +23,7 @@#include "system/tcg.h" #include "cpu-qom.h" #include "kvm/hyperv-proto.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "exec/memop.h"
target/loongarch/cpu.h +1 -0
@@ -9,6 +9,7 @@#define LOONGARCH_CPU_H #include "qemu/int128.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "fpu/softfloat-types.h"
target/m68k/cpu.h +1 -0
@@ -21,6 +21,7 @@#ifndef M68K_CPU_H #define M68K_CPU_H +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h"
target/microblaze/cpu.h +1 -0
@@ -21,6 +21,7 @@#define MICROBLAZE_CPU_H #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "qemu/cpu-float.h" #include "exec/cpu-interrupt.h"
target/mips/cpu.h +1 -0
@@ -2,6 +2,7 @@#define MIPS_CPU_H #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #ifndef CONFIG_USER_ONLY
target/openrisc/cpu.h +1 -0
@@ -21,6 +21,7 @@#define OPENRISC_CPU_H #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "fpu/softfloat-types.h"
target/ppc/cpu.h +1 -0
@@ -22,6 +22,7 @@#include "qemu/int128.h" #include "qemu/cpu-float.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "cpu-qom.h"
target/riscv/cpu.h +1 -0
@@ -23,6 +23,7 @@#include "hw/core/cpu.h" #include "hw/registerfields.h" #include "hw/qdev-properties.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "exec/gdbstub.h"
target/rx/cpu.h +1 -0
@@ -23,6 +23,7 @@#include "hw/registerfields.h" #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h"
target/s390x/cpu.h +1 -0
@@ -27,6 +27,7 @@#include "cpu-qom.h" #include "cpu_models.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h"
target/sh4/cpu.h +1 -0
@@ -21,6 +21,7 @@#define SH4_CPU_H #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h"
target/sparc/cpu.h +1 -0
@@ -3,6 +3,7 @@#include "qemu/bswap.h" #include "cpu-qom.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "qemu/cpu-float.h"
target/tricore/cpu.h +1 -0
@@ -22,6 +22,7 @@#include "cpu-qom.h" #include "hw/registerfields.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "qemu/cpu-float.h" #include "tricore-defs.h"
target/xtensa/cpu.h +1 -0
@@ -30,6 +30,7 @@#include "cpu-qom.h" #include "qemu/cpu-float.h" +#include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/cpu-interrupt.h" #include "hw/clock.h"
cpu-target.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/qemu-print.h" #include "system/accel-ops.h" #include "system/cpus.h" +#include "exec/cpu-common.h" #include "exec/tswap.h" #include "exec/replay-core.h" #include "exec/log.h"
Signature · 1 line
2.43.0
[PULL 092/148] target/tricore: Restrict SoftMMU mmu_index() to TCG
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
--- target/tricore/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/tricore/cpu.c +1 -1
@@ -176,6 +176,7 @@ static const TCGCPUOps tricore_tcg_ops = { .translate_code = tricore_translate_code, .synchronize_from_tb = tricore_cpu_synchronize_from_tb, .restore_state_to_opc = tricore_restore_state_to_opc, + .mmu_index = tricore_cpu_mmu_index, .tlb_fill = tricore_cpu_tlb_fill, .cpu_exec_interrupt = tricore_cpu_exec_interrupt, .cpu_exec_halt = tricore_cpu_has_work,
@@ -194,7 +195,6 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data)resettable_class_set_parent_phases (rc,NULL , tricore_cpu_reset_hold,NULL , &mcc->parent_phases); cc->class_by_name = tricore_cpu_class_by_name; - cc->mmu_index = tricore_cpu_mmu_index; cc->gdb_read_register = tricore_cpu_gdb_read_register; cc->gdb_write_register = tricore_cpu_gdb_write_register;
Signature · 1 line
2.43.0
[PULL 095/148] hw/core/cpu: Remove CPUClass::mmu_index()
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
All targets have been converted to TCGCPUOps::mmu_index(), remove the now unused CPUClass::mmu_index().
Message-ID: <[email protected]>
--- include/accel/tcg/cpu-mmu-index.h | 4 +--- include/hw/core/cpu.h | 2 -- accel/tcg/cpu-exec.c | 1 + 3 files changed, 2 insertions(+), 5 deletions(-)
include/accel/tcg/cpu-mmu-index.h +1 -3
@@ -34,9 +34,7 @@ static inline int cpu_mmu_index(CPUState *cs, bool ifetch)# endif #endif -const TCGCPUOps *tcg_ops = cs->cc->tcg_ops; -int ret = tcg_ops->mmu_index ? tcg_ops->mmu_index (cs, ifetch) - : cs->cc->mmu_index (cs, ifetch); +int ret = cs->cc->tcg_ops->mmu_index (cs, ifetch);tcg_debug_assert (ret >=0 && ret <NB_MMU_MODES );return ret; }
include/hw/core/cpu.h +0 -2
@@ -104,7 +104,6 @@ struct SysemuCPUOps;* instantiatable CPU type. * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. -* @mmu_index: Callback for choosing softmmu mmu index. * @memory_rw_debug: Callback for GDB memory access. * @dump_state: Callback for dumping state. * @query_cpu_fast:
@@ -151,7 +150,6 @@ struct CPUClass {ObjectClass *(*class_by_name)(const char *cpu_model);void (*parse_features)(const char *typename,char *str,Error **errp); -int (*mmu_index)(CPUState *cpu,bool ifetch);int (*memory_rw_debug)(CPUState *cpu,vaddr addr,uint8_t *buf,size_t len,bool is_write);void (*dump_state)(CPUState *cpu,FILE *,int flags);
accel/tcg/cpu-exec.c +1 -0
@@ -1075,6 +1075,7 @@ bool tcg_exec_realizefn(CPUState *cpu, Error **errp)assert (tcg_ops->cpu_exec_interrupt);#endif /* !CONFIG_USER_ONLY */ assert (tcg_ops->translate_code); +assert (tcg_ops->mmu_index); tcg_ops->initialize (); tcg_target_initialized = true; }
Signature · 1 line
2.43.0
[PULL 131/148] exec: Restrict 'cpu_ldst.h' to accel/tcg/
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Mechanical change using:
$ sed -i -e 's,exec/cpu_ldst,accel/tcg/cpu-ldst,' \
$(git grep -l exec/cpu_ldst.h)---
bsd-user/qemu.h | 2 +-
include/{exec/cpu_ldst.h => accel/tcg/cpu-ldst.h} | 6 +++---
include/exec/exec-all.h | 2 +-
linux-user/qemu.h | 2 +-
target/arm/tcg/sve_ldst_internal.h | 2 +-
accel/tcg/cputlb.c | 2 +-
accel/tcg/user-exec.c | 2 +-
target/alpha/mem_helper.c | 2 +-
target/arm/tcg/helper-a64.c | 2 +-
target/arm/tcg/m_helper.c | 2 +-
target/arm/tcg/mte_helper.c | 2 +-
target/arm/tcg/mve_helper.c | 2 +-
target/arm/tcg/op_helper.c | 2 +-
target/arm/tcg/pauth_helper.c | 2 +-
target/arm/tcg/sme_helper.c | 2 +-
target/avr/helper.c | 2 +-
target/hexagon/op_helper.c | 2 +-
target/hexagon/translate.c | 2 +-
target/hppa/op_helper.c | 2 +-
target/i386/tcg/access.c | 2 +-
target/i386/tcg/fpu_helper.c | 2 +-
target/i386/tcg/mem_helper.c | 2 +-
target/i386/tcg/mpx_helper.c | 2 +-
target/i386/tcg/seg_helper.c | 2 +-
target/i386/tcg/system/excp_helper.c | 2 +-
target/i386/tcg/system/misc_helper.c | 2 +-
target/i386/tcg/system/seg_helper.c | 2 +-
target/i386/tcg/system/svm_helper.c | 2 +-
target/i386/tcg/user/seg_helper.c | 2 +-
target/loongarch/cpu.c | 2 +-
target/loongarch/tcg/csr_helper.c | 2 +-
target/loongarch/tcg/fpu_helper.c | 2 +-
target/loongarch/tcg/iocsr_helper.c | 2 +-
target/loongarch/tcg/op_helper.c | 2 +-
target/loongarch/tcg/tlb_helper.c | 2 +-
target/m68k/fpu_helper.c | 2 +-
target/m68k/op_helper.c | 2 +-
target/microblaze/cpu.c | 2 +-
target/microblaze/op_helper.c | 2 +-
target/microblaze/translate.c | 2 +-
target/mips/tcg/ldst_helper.c | 2 +-
target/mips/tcg/msa_helper.c | 2 +-
target/mips/tcg/system/tlb_helper.c | 2 +-
target/ppc/mem_helper.c | 2 +-
target/ppc/mmu_helper.c | 2 +-
target/ppc/tcg-excp_helper.c | 2 +-
target/riscv/op_helper.c | 2 +-
target/riscv/vector_helper.c | 2 +-
target/riscv/zce_helper.c | 2 +-
target/rx/helper.c | 2 +-
target/rx/op_helper.c | 2 +-
target/s390x/tcg/crypto_helper.c | 2 +-
target/s390x/tcg/int_helper.c | 2 +-
target/s390x/tcg/mem_helper.c | 2 +-
target/s390x/tcg/misc_helper.c | 2 +-
target/s390x/tcg/vec_helper.c | 2 +-
target/sh4/op_helper.c | 2 +-
target/sparc/int32_helper.c | 2 +-
target/sparc/ldst_helper.c | 2 +-
target/tricore/op_helper.c | 2 +-
target/tricore/translate.c | 2 +-
61 files changed, 63 insertions(+), 63 deletions(-)
rename include/{exec/cpu_ldst.h => accel/tcg/cpu-ldst.h} (99%)bsd-user/qemu.h +1 -1
@@ -22,7 +22,7 @@#include "qemu/int128.h" #include "cpu.h" #include "qemu/units.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/exec-all.h" #include "user/abitypes.h"
include/accel/tcg/cpu-ldst.h renamed from include/exec/cpu_ldst.h +3 -3
@@ -59,8 +59,8 @@* The "mmu" suffix carries the full MemOpIdx, with both mmu_idx and the * MemOp including alignment requirements. The alignment will be enforced. */ -#ifndef CPU_LDST_H -#define CPU_LDST_H +#ifndef ACCEL_TCG_CPU_LDST_H +#define ACCEL_TCG_CPU_LDST_H #ifndef CONFIG_TCG #error Can only include this header with TCG
@@ -560,4 +560,4 @@ static inline void clear_helper_retaddr(void)#define clear_helper_retaddr () do { } while (0)#endif -#endif /* CPU_LDST_H */ +#endif /* ACCEL_TCG_CPU_LDST_H */
include/exec/exec-all.h +1 -1
@@ -21,7 +21,7 @@#define EXEC_ALL_H #if defined(CONFIG_USER_ONLY ) -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #endif #include "exec/mmu-access-type.h" #include "exec/translation-block.h"
linux-user/qemu.h +1 -1
@@ -2,7 +2,7 @@#define QEMU_H #include "cpu.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "user/abitypes.h" #include "user/page-protection.h"
target/arm/tcg/sve_ldst_internal.h +1 -1
@@ -20,7 +20,7 @@#ifndef TARGET_ARM_SVE_LDST_INTERNAL_H #define TARGET_ARM_SVE_LDST_INTERNAL_H -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" /* * Load one element into @vd + @reg_off from @host.
accel/tcg/cputlb.c +1 -1
@@ -23,7 +23,7 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "system/memory.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/cputlb.h" #include "exec/tb-flush.h" #include "system/ram_addr.h"
accel/tcg/user-exec.c +1 -1
@@ -26,7 +26,7 @@#include "tcg/tcg.h" #include "qemu/bitops.h" #include "qemu/rcu.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "user/cpu_loop.h" #include "qemu/main-loop.h" #include "user/page-protection.h"
target/alpha/mem_helper.c +1 -1
@@ -21,7 +21,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" static void do_unaligned_access (CPUAlphaState *env,vaddr addr,uintptr_t retaddr) {
target/arm/tcg/helper-a64.c +1 -1
@@ -30,7 +30,7 @@#include "qemu/crc32c.h" #include "exec/cpu-common.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/target_page.h" #include "exec/tlb-flags.h" #include "qemu/int128.h"
target/arm/tcg/m_helper.c +1 -1
@@ -18,7 +18,7 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #ifdef CONFIG_TCG -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "semihosting/common-semi.h" #endif #if !defined(CONFIG_USER_ONLY )
target/arm/tcg/mte_helper.c +1 -1
@@ -29,7 +29,7 @@#else #include "system/ram_addr.h" #endif -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" #include "exec/tlb-flags.h" #include "accel/tcg/cpu-ops.h"
target/arm/tcg/mve_helper.c +1 -1
@@ -22,7 +22,7 @@#include "internals.h" #include "vec_internal.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/exec-all.h" #include "tcg/tcg.h" #include "fpu/softfloat.h"
target/arm/tcg/op_helper.c +1 -1
@@ -24,7 +24,7 @@#include "internals.h" #include "cpu-features.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "cpregs.h" #define SIGNBIT (uint32_t)0x80000000
target/arm/tcg/pauth_helper.c +1 -1
@@ -22,7 +22,7 @@#include "internals.h" #include "cpu-features.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "qemu/xxhash.h"
target/arm/tcg/sme_helper.c +1 -1
@@ -22,7 +22,7 @@#include "internals.h" #include "tcg/tcg-gvec-desc.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/exec-all.h" #include "qemu/int128.h" #include "fpu/softfloat.h"
target/avr/helper.c +1 -1
@@ -27,7 +27,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/target_page.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" bool avr_cpu_exec_interrupt (CPUState *cs,int interrupt_request)
target/hexagon/op_helper.c +1 -1
@@ -18,7 +18,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "cpu.h"
target/hexagon/translate.c +1 -1
@@ -23,7 +23,7 @@#include "exec/helper-gen.h" #include "exec/helper-proto.h" #include "exec/translation-block.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/log.h" #include "internal.h" #include "attribs.h"
target/hppa/op_helper.c +1 -1
@@ -22,7 +22,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "qemu/timer.h" #include "trace.h" #ifdef CONFIG_USER_ONLY
target/i386/tcg/access.c +1 -1
@@ -3,7 +3,7 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/exec-all.h" #include "exec/target_page.h" #include "access.h"
target/i386/tcg/fpu_helper.c +1 -1
@@ -22,7 +22,7 @@#include "cpu.h" #include "tcg-cpu.h" #include "exec/cputlb.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "fpu/softfloat-macros.h"
target/i386/tcg/mem_helper.c +1 -1
@@ -21,7 +21,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "qemu/int128.h" #include "qemu/atomic128.h" #include "tcg/tcg.h"
target/i386/tcg/mpx_helper.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/exec-all.h" #include "exec/target_page.h" #include "helper-tcg.h"
target/i386/tcg/seg_helper.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/log.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/log.h" #include "helper-tcg.h" #include "seg_helper.h"
target/i386/tcg/system/excp_helper.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/target_page.h"
target/i386/tcg/system/misc_helper.c +1 -1
@@ -21,7 +21,7 @@#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "system/address-spaces.h" #include "system/memory.h" #include "exec/cputlb.h"
target/i386/tcg/system/seg_helper.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "tcg/helper-tcg.h" #include "../seg_helper.h"
target/i386/tcg/system/svm_helper.c +1 -1
@@ -22,7 +22,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/cputlb.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "tcg/helper-tcg.h" /* Secure Virtual Machine helpers */
target/i386/tcg/user/seg_helper.c +1 -1
@@ -22,7 +22,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "tcg/helper-tcg.h" #include "tcg/seg_helper.h"
target/loongarch/cpu.c +1 -1
@@ -29,7 +29,7 @@#include <linux/kvm.h> #endif #ifdef CONFIG_TCG -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "tcg/tcg.h" #endif
target/loongarch/tcg/csr_helper.c +1 -1
@@ -13,7 +13,7 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/cputlb.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "hw/irq.h" #include "cpu-csr.h"
target/loongarch/tcg/fpu_helper.c +1 -1
@@ -9,7 +9,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "fpu/softfloat.h" #include "internals.h"
target/loongarch/tcg/iocsr_helper.c +1 -1
@@ -10,7 +10,7 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #define GET_MEMTXATTRS (cas) \ ((MemTxAttrs){.requester_id = env_cpu(cas)->cpu_index})
target/loongarch/tcg/op_helper.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "internals.h" #include "qemu/crc32c.h" #include <zlib.h> /* for crc32 */
target/loongarch/tcg/tlb_helper.c +1 -1
@@ -16,7 +16,7 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/target_page.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/log.h" #include "cpu-csr.h"
target/m68k/fpu_helper.c +1 -1
@@ -22,7 +22,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "softfloat.h" /*
target/m68k/op_helper.c +1 -1
@@ -21,7 +21,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "semihosting/semihost.h" #if !defined(CONFIG_USER_ONLY )
target/microblaze/cpu.c +1 -1
@@ -28,7 +28,7 @@#include "qemu/module.h" #include "hw/qdev-properties.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/gdbstub.h" #include "exec/translation-block.h" #include "fpu/softfloat-helpers.h"
target/microblaze/op_helper.c +1 -1
@@ -24,7 +24,7 @@#include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "fpu/softfloat.h" void helper_put (uint32_t id,uint32_t ctrl,uint32_t data)
target/microblaze/translate.c +1 -1
@@ -21,7 +21,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "tcg/tcg-op.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h"
target/mips/tcg/ldst_helper.c +1 -1
@@ -24,7 +24,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/memop.h" #include "internal.h"
target/mips/tcg/msa_helper.c +1 -1
@@ -22,7 +22,7 @@#include "internal.h" #include "tcg/tcg.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" #include "exec/memop.h" #include "exec/target_page.h"
target/mips/tcg/system/tlb_helper.c +1 -1
@@ -25,7 +25,7 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/target_page.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/log.h" #include "exec/helper-proto.h"
target/ppc/mem_helper.c +1 -1
@@ -24,7 +24,7 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "helper_regs.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "internal.h" #include "qemu/atomic128.h"
target/ppc/mmu_helper.c +1 -1
@@ -37,7 +37,7 @@#include "mmu-radix64.h" #include "mmu-booke.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" /* #define FLUSH_ALL_TLBS */
target/ppc/tcg-excp_helper.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/main-loop.h" #include "qemu/log.h" #include "target/ppc/cpu.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" #include "system/runstate.h"
target/riscv/op_helper.c +1 -1
@@ -23,7 +23,7 @@#include "internals.h" #include "exec/exec-all.h" #include "exec/cputlb.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/helper-proto.h" #include "exec/tlb-flags.h" #include "trace.h"
target/riscv/vector_helper.c +1 -1
@@ -22,7 +22,7 @@#include "cpu.h" #include "exec/memop.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/page-protection.h" #include "exec/helper-proto.h" #include "exec/tlb-flags.h"
target/riscv/zce_helper.c +1 -1
@@ -20,7 +20,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" target_ulong HELPER (cm_jalt )(CPURISCVState *env,uint32_t index) {
target/rx/helper.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/bitops.h" #include "cpu.h" #include "exec/log.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "hw/irq.h" void rx_cpu_unpack_psw (CPURXState *env,uint32_t psw,int rte)
target/rx/op_helper.c +1 -1
@@ -21,7 +21,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "fpu/softfloat.h" #include "tcg/debug-assert.h"
target/s390x/tcg/crypto_helper.c +1 -1
@@ -18,7 +18,7 @@#include "tcg_s390x.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" static uint64_t R (uint64_t x,int c) {
target/s390x/tcg/int_helper.c +1 -1
@@ -25,7 +25,7 @@#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" /* #define DEBUG_HELPER */ #ifdef DEBUG_HELPER
target/s390x/tcg/mem_helper.c +1 -1
@@ -28,7 +28,7 @@#include "exec/exec-all.h" #include "exec/cputlb.h" #include "exec/page-protection.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/target_page.h" #include "exec/tlb-flags.h" #include "accel/tcg/cpu-ops.h"
target/s390x/tcg/misc_helper.c +1 -1
@@ -28,7 +28,7 @@#include "qemu/timer.h" #include "exec/exec-all.h" #include "exec/cputlb.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/target_page.h" #include "qapi/error.h" #include "tcg_s390x.h"
target/s390x/tcg/vec_helper.c +1 -1
@@ -16,7 +16,7 @@#include "tcg/tcg.h" #include "tcg/tcg-gvec-desc.h" #include "exec/helper-proto.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/exec-all.h" void HELPER(gvec_vbperm)(void *v1, const void *v2, const void *v3,
target/sh4/op_helper.c +1 -1
@@ -20,7 +20,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "fpu/softfloat.h" #ifndef CONFIG_USER_ONLY
target/sparc/int32_helper.c +1 -1
@@ -21,7 +21,7 @@#include "qemu/main-loop.h" #include "cpu.h" #include "trace.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "exec/log.h" #include "system/runstate.h"
target/sparc/ldst_helper.c +1 -1
@@ -27,7 +27,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/target_page.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "system/memory.h" #ifdef CONFIG_USER_ONLY #include "user/page-protection.h"
target/tricore/op_helper.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include <zlib.h> /* for crc32 */
target/tricore/translate.c +1 -1
@@ -22,7 +22,7 @@#include "cpu.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" -#include "exec/cpu_ldst.h" +#include "accel/tcg/cpu-ldst.h" #include "qemu/qemu-print.h" #include "exec/helper-proto.h"
Signature · 1 line
2.43.0
[PULL 049/148] hw/core: Move unconditional files to libsystem_ss, libuser_ss
In reply to Richard HendersonMany of the headers used by these require CONFIG_USER_ONLY.
--- hw/core/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/core/meson.build +2 -2
@@ -26,7 +26,7 @@ system_ss.add(when: 'CONFIG_XILINX_AXI', if_true: files('stream.c')) system_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c')) system_ss.add(when: 'CONFIG_EIF', if_true: [files('eif.c'), zlib, libcbor, gnutls]) -system_ss.add(files( +libsystem_ss.add(files( 'cpu-system.c', 'fw-path-provider.c', 'gpio.c',
@@ -46,7 +46,7 @@ system_ss.add(files( 'vm-change-state-handler.c', 'clock-vmstate.c', )) -user_ss.add(files( +libuser_ss.add(files( 'cpu-user.c', 'qdev-user.c', ))
Signature · 1 line
2.43.0
[PULL 100/148] page-vary: Restrict scope of TARGET_PAGE_BITS_MIN
In reply to Richard HendersonThe only place we really need to know the minimum is within page-vary-target.c. Rename the target/arm TARGET_PAGE_BITS_MIN to TARGET_PAGE_BITS_LEGACY to emphasize what it really means. Move the assertions related to minimum page size as well.
--- include/exec/cpu-defs.h | 10 ++-------- include/exec/target_page.h | 1 - target/alpha/cpu-param.h | 1 - target/arm/cpu-param.h | 3 +-- target/ppc/cpu-param.h | 1 - accel/tcg/cputlb.c | 1 - page-vary-target.c | 39 +++++++++++++++++++++++++++++++++++--- 7 files changed, 39 insertions(+), 17 deletions(-)
include/exec/cpu-defs.h +2 -8
@@ -34,14 +34,8 @@#ifndef TARGET_VIRT_ADDR_SPACE_BITS # error TARGET_VIRT_ADDR_SPACE_BITS must be defined in cpu-param.h#endif -#ifndef TARGET_PAGE_BITS -# ifdef TARGET_PAGE_BITS_VARY -# ifndef TARGET_PAGE_BITS_MIN -# error TARGET_PAGE_BITS_MIN must be defined in cpu-param.h -# endif -# else -# error TARGET_PAGE_BITS must be defined in cpu-param.h -# endif +#if !defined(TARGET_PAGE_BITS ) && !defined(TARGET_PAGE_BITS_VARY ) +# error TARGET_PAGE_BITS must be defined in cpu-param.h#endif #include "exec/target_long.h"
include/exec/target_page.h +0 -1
@@ -41,7 +41,6 @@ extern const TargetPageBits target_page;# endif # define TARGET_PAGE_SIZE (-(int)TARGET_PAGE_MASK)#else -# define TARGET_PAGE_BITS_MIN TARGET_PAGE_BITS# define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS)# define TARGET_PAGE_MASK ((TARGET_PAGE_TYPE)-1 << TARGET_PAGE_BITS)#endif
target/alpha/cpu-param.h +0 -1
@@ -18,7 +18,6 @@* a 4k minimum to match x86 host, which can minimize emulation issues. */ # define TARGET_PAGE_BITS_VARY -# define TARGET_PAGE_BITS_MIN 12# define TARGET_VIRT_ADDR_SPACE_BITS 63#else # define TARGET_PAGE_BITS 13
target/arm/cpu-param.h +1 -2
@@ -24,7 +24,6 @@# else /* Allow user-only to vary page size from 4k */ # define TARGET_PAGE_BITS_VARY -# define TARGET_PAGE_BITS_MIN 12# endif # else # define TARGET_PAGE_BITS 12
@@ -35,7 +34,7 @@* have to support 1K tiny pages. */ # define TARGET_PAGE_BITS_VARY -# define TARGET_PAGE_BITS_MIN 10 +# define TARGET_PAGE_BITS_LEGACY 10#endif /* !CONFIG_USER_ONLY */ /* ARM processors have a weak memory model */
target/ppc/cpu-param.h +0 -1
@@ -33,7 +33,6 @@#ifdef CONFIG_USER_ONLY /* Allow user-only to vary page size from 4k */ # define TARGET_PAGE_BITS_VARY -# define TARGET_PAGE_BITS_MIN 12#else # define TARGET_PAGE_BITS 12#endif
accel/tcg/cputlb.c +0 -1
@@ -49,7 +49,6 @@#endif #include "tcg/tcg-ldst.h" -QEMU_BUILD_BUG_ON (TLB_FLAGS_MASK & ((1u <TARGET_PAGE_BITS_MIN ) -1 ));/* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */ /* #define DEBUG_TLB */
page-vary-target.c +36 -3
@@ -23,19 +23,45 @@#include "exec/page-vary.h" #include "exec/target_page.h" + +/* +* For system mode, the minimum comes from the number of bits +* required for maximum alignment (6) and the number of bits +* required for TLB_FLAGS_MASK (3). +* +* For user mode, TARGET_PAGE_BITS_VARY is a hack to allow the target +* page size to match the host page size. Mostly, this reduces the +* ordinary target page size to run on a host with 4KiB pages (i.e. x86). +* There is no true minimum required by the implementation, but keep the +* same minimum as for system mode for sanity. +* See linux-user/mmap.c, mmap_h_lt_g and mmap_h_gt_g. +*/ +#define TARGET_PAGE_BITS_MIN 9 + +#ifndef TARGET_PAGE_BITS_VARY +QEMU_BUILD_BUG_ON (TARGET_PAGE_BITS <TARGET_PAGE_BITS_MIN ); +#endif + +#ifndef CONFIG_USER_ONLY +#include "exec/tlb-flags.h" + +QEMU_BUILD_BUG_ON (TLB_FLAGS_MASK & ((1u <TARGET_PAGE_BITS_MIN ) -1 )); +int migration_legacy_page_bits (void ) {#ifdef TARGET_PAGE_BITS_VARY -return TARGET_PAGE_BITS_MIN ; +QEMU_BUILD_BUG_ON (TARGET_PAGE_BITS_LEGACY <TARGET_PAGE_BITS_MIN ); +return TARGET_PAGE_BITS_LEGACY ;#else return TARGET_PAGE_BITS ;#endif } +#endif bool set_preferred_target_page_bits (int bits) { -#ifdef TARGET_PAGE_BITS_VARY assert (bits >=TARGET_PAGE_BITS_MIN ); +#ifdef TARGET_PAGE_BITS_VARY return set_preferred_target_page_bits_common (bits);#else return true;
@@ -44,5 +70,12 @@ bool set_preferred_target_page_bits(int bits)void finalize_target_page_bits (void ) { -finalize_target_page_bits_common (TARGET_PAGE_BITS_MIN ); +#ifndef TARGET_PAGE_BITS_VARY +finalize_target_page_bits_common (TARGET_PAGE_BITS ); +#elif defined(CONFIG_USER_ONLY ) +assert (target_page.bits !=0 ); +finalize_target_page_bits_common (target_page.bits); +#else +finalize_target_page_bits_common (TARGET_PAGE_BITS_LEGACY ); +#endif }
Signature · 1 line
2.43.0
[PULL 121/148] hw/arm/boot: make compilation unit hw common
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Now we eliminated poisoned identifiers from headers, this file can now be compiled once for all arm targets.
Message-ID: <[email protected]>
--- hw/arm/boot.c | 1 + hw/arm/meson.build | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
hw/arm/boot.c +1 -0
@@ -14,6 +14,7 @@#include <libfdt.h> #include "hw/arm/boot.h" #include "hw/arm/linux-boot-if.h" +#include "cpu.h" #include "exec/target_page.h" #include "system/kvm.h" #include "system/tcg.h"
hw/arm/meson.build +4 -1
@@ -1,5 +1,5 @@ arm_ss = ss.source_set() -arm_ss.add(files('boot.c')) +arm_common_ss = ss.source_set() arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c')) arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c')) arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c'))
@@ -75,4 +75,7 @@ system_ss.add(when: 'CONFIG_SX1', if_true: files('omap_sx1.c')) system_ss.add(when: 'CONFIG_VERSATILE', if_true: files('versatilepb.c')) system_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c')) +arm_common_ss.add(fdt, files('boot.c')) + hw_arch += {'arm': arm_ss} +hw_common_arch += {'arm': arm_common_ss}
Signature · 1 line
2.43.0
[PULL 128/148] tcg: Declare TARGET_INSN_START_EXTRA_WORDS in 'cpu-param.h'
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
To avoid including the huge "cpu.h" for a simple definition, move TARGET_INSN_START_EXTRA_WORDS to "cpu-param.h".
--- include/tcg/insn-start-words.h | 2 +- target/arm/cpu-param.h | 7 +++++++ target/arm/cpu.h | 6 ------ target/hppa/cpu-param.h | 2 ++ target/hppa/cpu.h | 2 -- target/i386/cpu-param.h | 2 ++ target/i386/cpu.h | 2 -- target/m68k/cpu-param.h | 2 ++ target/m68k/cpu.h | 2 -- target/microblaze/cpu-param.h | 2 ++ target/microblaze/cpu.h | 2 -- target/mips/cpu-param.h | 2 ++ target/mips/cpu.h | 2 -- target/openrisc/cpu-param.h | 2 ++ target/openrisc/cpu.h | 2 -- target/riscv/cpu-param.h | 8 ++++++++ target/riscv/cpu.h | 6 ------ target/s390x/cpu-param.h | 2 ++ target/s390x/cpu.h | 2 -- target/sh4/cpu-param.h | 2 ++ target/sh4/cpu.h | 2 -- target/sparc/cpu-param.h | 2 ++ target/sparc/cpu.h | 1 - 23 files changed, 34 insertions(+), 30 deletions(-)
include/tcg/insn-start-words.h +1 -1
@@ -6,7 +6,7 @@#ifndef TARGET_INSN_START_WORDS -#include "cpu.h" +#include "cpu-param.h" #ifndef TARGET_INSN_START_EXTRA_WORDS # define TARGET_INSN_START_WORDS 1
target/arm/cpu-param.h +7 -0
@@ -37,6 +37,13 @@# define TARGET_PAGE_BITS_LEGACY 10#endif /* !CONFIG_USER_ONLY */ +/* +* ARM-specific extra insn start words: +* 1: Conditional execution bits +* 2: Partial exception syndrome for data aborts +*/ +#define TARGET_INSN_START_EXTRA_WORDS 2 +/* ARM processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
target/arm/cpu.h +0 -6
@@ -98,12 +98,6 @@#define offsetofhigh32 (S ,M ) (offsetof(S, M) + sizeof(uint32_t))#endif -/* ARM-specific extra insn start words: -* 1: Conditional execution bits -* 2: Partial exception syndrome for data aborts -*/ -#define TARGET_INSN_START_EXTRA_WORDS 2 -/* The 2nd extra word holding syndrome info for data aborts does not use * the upper 6 bits nor the lower 13 bits. We mask and shift it down to * help the sleb128 encoder do a better job.
target/hppa/cpu-param.h +2 -0
@@ -19,6 +19,8 @@#define TARGET_PAGE_BITS 12 +#define TARGET_INSN_START_EXTRA_WORDS 2 +/* PA-RISC 1.x processors have a strong memory model. */ /* * ??? While we do not yet implement PA-RISC 2.0, those processors have
target/hppa/cpu.h +0 -2
@@ -48,8 +48,6 @@#define PRIV_KERNEL 0#define PRIV_USER 3 -#define TARGET_INSN_START_EXTRA_WORDS 2 -/* No need to flush MMU_ABS*_IDX */ #define HPPA_MMU_FLUSH_MASK \ (1 << MMU_KERNEL_IDX | 1 << MMU_KERNEL_P_IDX | \
target/i386/cpu-param.h +2 -0
@@ -22,6 +22,8 @@#endif #define TARGET_PAGE_BITS 12 +#define TARGET_INSN_START_EXTRA_WORDS 1 +/* The x86 has a strong memory model with some store-after-load re-ordering */ #define TCG_GUEST_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD)
target/i386/cpu.h +0 -2
@@ -1610,8 +1610,6 @@ typedef struct {#define MAX_FIXED_COUNTERS 3#define MAX_GP_COUNTERS (MSR_IA32_PERF_STATUS - MSR_P6_EVNTSEL0) -#define TARGET_INSN_START_EXTRA_WORDS 1 -#define NB_OPMASK_REGS 8/* CPU can't have 0xFFFFFFFF APIC ID, use that value to distinguish
target/m68k/cpu-param.h +2 -0
@@ -17,4 +17,6 @@#define TARGET_PHYS_ADDR_SPACE_BITS 32#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#define TARGET_INSN_START_EXTRA_WORDS 1 +#endif
target/m68k/cpu.h +0 -2
@@ -78,8 +78,6 @@#define M68K_MAX_TTR 2#define TTR (type, index) ttr[((type & ACCESS_CODE) == ACCESS_CODE) * 2 + index] -#define TARGET_INSN_START_EXTRA_WORDS 1 -typedef CPU_LDoubleU FPReg ; typedef struct CPUArchState {
target/microblaze/cpu-param.h +2 -0
@@ -27,6 +27,8 @@/* FIXME: MB uses variable pages down to 1K but linux only uses 4k. */ #define TARGET_PAGE_BITS 12 +#define TARGET_INSN_START_EXTRA_WORDS 1 +/* MicroBlaze is always in-order. */ #define TCG_GUEST_DEFAULT_MO TCG_MO_ALL
target/microblaze/cpu.h +0 -2
@@ -233,8 +233,6 @@ typedef struct CPUArchState CPUMBState;#define STREAM_CONTROL (1 << 3)#define STREAM_NONBLOCK (1 << 4) -#define TARGET_INSN_START_EXTRA_WORDS 1 -/* use-non-secure property masks */ #define USE_NON_SECURE_M_AXI_DP_MASK 0x1#define USE_NON_SECURE_M_AXI_IP_MASK 0x2
target/mips/cpu-param.h +2 -0
@@ -20,6 +20,8 @@#endif #define TARGET_PAGE_BITS 12 +#define TARGET_INSN_START_EXTRA_WORDS 2 +#define TCG_GUEST_DEFAULT_MO (0)#endif
target/mips/cpu.h +0 -2
@@ -100,8 +100,6 @@ struct CPUMIPSFPUContext {#define FP_UNIMPLEMENTED 32 }; -#define TARGET_INSN_START_EXTRA_WORDS 2 -typedef struct CPUMIPSMVPContext CPUMIPSMVPContext ;struct CPUMIPSMVPContext {int32_t CP0_MVPControl;
target/openrisc/cpu-param.h +2 -0
@@ -12,6 +12,8 @@#define TARGET_PHYS_ADDR_SPACE_BITS 32#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#define TARGET_INSN_START_EXTRA_WORDS 1 +#define TCG_GUEST_DEFAULT_MO (0)#endif
target/openrisc/cpu.h +0 -2
@@ -40,8 +40,6 @@ struct OpenRISCCPUClass {ResettablePhases parent_phases; }; -#define TARGET_INSN_START_EXTRA_WORDS 1 -enum {MMU_NOMMU_IDX =0 ,MMU_SUPERVISOR_IDX =1 ,
target/riscv/cpu-param.h +8 -0
@@ -16,6 +16,14 @@# define TARGET_VIRT_ADDR_SPACE_BITS 32/* sv32 */ #endif #define TARGET_PAGE_BITS 12/* 4 KiB Pages */ + +/* +* RISC-V-specific extra insn start words: +* 1: Original instruction opcode +* 2: more information about instruction +*/ +#define TARGET_INSN_START_EXTRA_WORDS 2 +/* * The current MMU Modes are: * - U mode 0b000
target/riscv/cpu.h +0 -6
@@ -45,12 +45,6 @@ typedef struct CPUArchState CPURISCVState;# define TYPE_RISCV_CPU_BASE TYPE_RISCV_CPU_BASE64#endif -/* -* RISC-V-specific extra insn start words: -* 1: Original instruction opcode -* 2: more information about instruction -*/ -#define TARGET_INSN_START_EXTRA_WORDS 2/* * b0: Whether a instruction always raise a store AMO or not. */
target/s390x/cpu-param.h +2 -0
@@ -12,6 +12,8 @@#define TARGET_PHYS_ADDR_SPACE_BITS 64#define TARGET_VIRT_ADDR_SPACE_BITS 64 +#define TARGET_INSN_START_EXTRA_WORDS 2 +/* * The z/Architecture has a strong memory model with some * store-after-load re-ordering.
target/s390x/cpu.h +0 -2
@@ -37,8 +37,6 @@#define TARGET_HAS_PRECISE_SMC -#define TARGET_INSN_START_EXTRA_WORDS 2 -#define MMU_USER_IDX 0#define S390_MAX_CPUS 248
target/sh4/cpu-param.h +2 -0
@@ -16,4 +16,6 @@# define TARGET_VIRT_ADDR_SPACE_BITS 32#endif +#define TARGET_INSN_START_EXTRA_WORDS 1 +#endif
target/sh4/cpu.h +0 -2
@@ -127,8 +127,6 @@ typedef struct tlb_t {#define UTLB_SIZE 64#define ITLB_SIZE 4 -#define TARGET_INSN_START_EXTRA_WORDS 1 -enum sh_features {SH_FEATURE_SH4A =1 ,SH_FEATURE_BCR3_AND_BCR4 =2 ,
target/sparc/cpu-param.h +2 -0
@@ -21,6 +21,8 @@# define TARGET_VIRT_ADDR_SPACE_BITS 32#endif +#define TARGET_INSN_START_EXTRA_WORDS 1 +/* * From Oracle SPARC Architecture 2015: *
target/sparc/cpu.h +0 -1
@@ -223,7 +223,6 @@ typedef struct trap_state {uint32_t tt; } trap_state;#endif -#define TARGET_INSN_START_EXTRA_WORDS 1 typedef struct sparc_def_t { const char *name;
Signature · 1 line
2.43.0
[PULL 138/148] tcg: Have tcg_req_mo() use TCGCPUOps::guest_default_memory_order
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
In order to use TCG with multiple targets, replace the compile time use of TCG_GUEST_DEFAULT_MO by a runtime access to TCGCPUOps::guest_default_memory_order via CPUState.
--- accel/tcg/internal-target.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
accel/tcg/internal-target.h +4 -5
@@ -46,16 +46,15 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);/** * tcg_req_mo: +* @guest_mo: Guest default memory order * @type: TCGBar * * Filter @type to the barrier that is required for the guest * memory ordering vs the host memory ordering. A non-zero * result indicates that some barrier is required. -* -* This is a macro so that it's constant even without optimization. */ -#define tcg_req_mo (type) \ - ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO) +#define tcg_req_mo (guest_mo, type) \ + ((type) & guest_mo & ~TCG_TARGET_DEFAULT_MO)/** * cpu_req_mo:
@@ -67,7 +66,7 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);*/ #define cpu_req_mo (cpu, type) \ do { \ - if (tcg_req_mo(type)) { \ + if (tcg_req_mo(cpu->cc->tcg_ops->guest_default_memory_order, type)) { \ smp_mb(); \ } \ } while (0)
Signature · 1 line
2.43.0
[PULL 124/148] hw/arm/xlnx-versal: prepare compilation unit to be common
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Remove kvm unused headers.
Message-ID: <[email protected]>
--- hw/arm/xlnx-versal.c | 2 -- 1 file changed, 2 deletions(-)
hw/arm/xlnx-versal.c +0 -2
@@ -17,9 +17,7 @@#include "hw/sysbus.h" #include "net/net.h" #include "system/system.h" -#include "system/kvm.h" #include "hw/arm/boot.h" -#include "kvm_arm.h" #include "hw/misc/unimp.h" #include "hw/arm/xlnx-versal.h" #include "qemu/log.h"
Signature · 1 line
2.43.0
[PULL 148/148] tcg: Convert TARGET_SUPPORTS_MTTCG to TCGCPUOps::mttcg_supported field
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Instead of having a compile-time TARGET_SUPPORTS_MTTCG definition, have each target set the 'mttcg_supported' field in the TCGCPUOps structure.
Message-ID: <[email protected]>
--- include/accel/tcg/cpu-ops.h | 8 ++++++++ include/exec/poison.h | 1 - accel/tcg/tcg-all.c | 11 +++++------ target/alpha/cpu.c | 1 + target/arm/cpu.c | 1 + target/arm/tcg/cpu-v7m.c | 1 + target/avr/cpu.c | 1 + target/hexagon/cpu.c | 1 + target/hppa/cpu.c | 1 + target/i386/tcg/tcg-cpu.c | 1 + target/loongarch/cpu.c | 1 + target/m68k/cpu.c | 1 + target/microblaze/cpu.c | 1 + target/mips/cpu.c | 1 + target/openrisc/cpu.c | 1 + target/ppc/cpu_init.c | 1 + target/riscv/tcg/tcg-cpu.c | 1 + target/rx/cpu.c | 1 + target/s390x/cpu.c | 1 + target/sh4/cpu.c | 1 + target/sparc/cpu.c | 1 + target/tricore/cpu.c | 1 + target/xtensa/cpu.c | 1 + configs/targets/aarch64-softmmu.mak | 1 - configs/targets/alpha-softmmu.mak | 1 - configs/targets/arm-softmmu.mak | 1 - configs/targets/hppa-softmmu.mak | 1 - configs/targets/i386-softmmu.mak | 1 - configs/targets/loongarch64-softmmu.mak | 1 - configs/targets/microblaze-softmmu.mak | 1 - configs/targets/microblazeel-softmmu.mak | 1 - configs/targets/mips-softmmu.mak | 1 - configs/targets/mipsel-softmmu.mak | 1 - configs/targets/or1k-softmmu.mak | 1 - configs/targets/ppc64-softmmu.mak | 1 - configs/targets/riscv32-softmmu.mak | 1 - configs/targets/riscv64-softmmu.mak | 1 - configs/targets/s390x-softmmu.mak | 1 - configs/targets/sparc-softmmu.mak | 1 - configs/targets/sparc64-softmmu.mak | 1 - configs/targets/x86_64-softmmu.mak | 1 - configs/targets/xtensa-softmmu.mak | 1 - configs/targets/xtensaeb-softmmu.mak | 1 - docs/devel/multi-thread-tcg.rst | 2 +- 44 files changed, 34 insertions(+), 28 deletions(-)
include/accel/tcg/cpu-ops.h +8 -0
@@ -19,6 +19,14 @@#include "tcg/tcg-mo.h" struct TCGCPUOps { +/** +* mttcg_supported: multi-threaded TCG is supported +* +* Target (TCG frontend) supports: +* - atomic instructions +* - memory ordering primitives (barriers) +*/ +bool mttcg_supported;/** * @guest_default_memory_order: default barrier that is required
include/exec/poison.h +0 -1
@@ -35,7 +35,6 @@#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME -#pragma GCC poison TARGET_SUPPORTS_MTTCG#pragma GCC poison TARGET_BIG_ENDIAN#pragma GCC poison TCG_GUEST_DEFAULT_MO#pragma GCC poison TARGET_HAS_PRECISE_SMC
accel/tcg/tcg-all.c +5 -6
@@ -41,8 +41,9 @@#include "hw/boards.h" #include "system/tcg.h" #endif +#include "accel/tcg/cpu-ops.h" #include "internal-common.h" -#include "cpu-param.h" +#include "cpu.h" struct TCGState {
@@ -88,11 +89,9 @@ static int tcg_init_machine(MachineState *ms)unsigned max_threads =1 ;#ifndef CONFIG_USER_ONLY -# ifdef TARGET_SUPPORTS_MTTCG -bool mttcg_supported = true; -# else -bool mttcg_supported = false; -# endif +CPUClass *cc =CPU_CLASS (object_class_by_name (CPU_RESOLVING_TYPE )); +bool mttcg_supported = cc->tcg_ops->mttcg_supported; +switch (s->mttcg_enabled) {case ON_OFF_AUTO_AUTO :/*
target/alpha/cpu.c +1 -0
@@ -237,6 +237,7 @@ static const struct SysemuCPUOps alpha_sysemu_ops = {static const TCGCPUOps alpha_tcg_ops = {/* Alpha processors have a weak memory model */ .guest_default_memory_order =0 , + .mttcg_supported = true, .initialize = alpha_translate_init, .translate_code = alpha_translate_code,
target/arm/cpu.c +1 -0
@@ -2671,6 +2671,7 @@ static const struct SysemuCPUOps arm_sysemu_ops = {#ifdef CONFIG_TCG static const TCGCPUOps arm_tcg_ops = { + .mttcg_supported = true,/* ARM processors have a weak memory model */ .guest_default_memory_order = 0,
target/arm/tcg/cpu-v7m.c +1 -0
@@ -234,6 +234,7 @@ static void cortex_m55_initfn(Object *obj)static const TCGCPUOps arm_v7m_tcg_ops = {/* ARM processors have a weak memory model */ .guest_default_memory_order =0 , + .mttcg_supported = true, .initialize = arm_translate_init, .translate_code = arm_translate_code,
target/avr/cpu.c +1 -0
@@ -225,6 +225,7 @@ static const struct SysemuCPUOps avr_sysemu_ops = {static const TCGCPUOps avr_tcg_ops = { .guest_default_memory_order =0 , + .mttcg_supported = false, .initialize = avr_cpu_tcg_init, .translate_code = avr_cpu_translate_code, .synchronize_from_tb = avr_cpu_synchronize_from_tb,
target/hexagon/cpu.c +1 -0
@@ -327,6 +327,7 @@ static void hexagon_cpu_init(Object *obj)static const TCGCPUOps hexagon_tcg_ops = {/* MTTCG not yet supported: require strict ordering */ .guest_default_memory_order =TCG_MO_ALL , + .mttcg_supported = false, .initialize = hexagon_translate_init, .translate_code = hexagon_translate_code, .synchronize_from_tb = hexagon_cpu_synchronize_from_tb,
target/hppa/cpu.c +1 -0
@@ -260,6 +260,7 @@ static const TCGCPUOps hppa_tcg_ops = {* basis. It's probably easier to fall back to a strong memory model. */ .guest_default_memory_order = TCG_MO_ALL, + .mttcg_supported = true, .initialize = hppa_translate_init, .translate_code = hppa_translate_code,
target/i386/tcg/tcg-cpu.c +1 -0
@@ -125,6 +125,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs)#include "accel/tcg/cpu-ops.h" const TCGCPUOps x86_tcg_ops = { + .mttcg_supported = true,/* * The x86 has a strong memory model with some store-after-load re-ordering */
target/loongarch/cpu.c +1 -0
@@ -865,6 +865,7 @@ static void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags)static const TCGCPUOps loongarch_tcg_ops = { .guest_default_memory_order =0 , + .mttcg_supported = true, .initialize = loongarch_translate_init, .translate_code = loongarch_translate_code,
target/m68k/cpu.c +1 -0
@@ -591,6 +591,7 @@ static const struct SysemuCPUOps m68k_sysemu_ops = {static const TCGCPUOps m68k_tcg_ops = {/* MTTCG not yet supported: require strict ordering */ .guest_default_memory_order =TCG_MO_ALL , + .mttcg_supported = false, .initialize = m68k_tcg_init, .translate_code = m68k_translate_code,
target/microblaze/cpu.c +1 -0
@@ -429,6 +429,7 @@ static const struct SysemuCPUOps mb_sysemu_ops = {static const TCGCPUOps mb_tcg_ops = {/* MicroBlaze is always in-order. */ .guest_default_memory_order =TCG_MO_ALL , + .mttcg_supported = true, .initialize = mb_tcg_init, .translate_code = mb_translate_code,
target/mips/cpu.c +1 -0
@@ -551,6 +551,7 @@ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc) }static const TCGCPUOps mips_tcg_ops = { + .mttcg_supported =TARGET_LONG_BITS ==32 , .guest_default_memory_order =0 , .initialize = mips_tcg_init,
target/openrisc/cpu.c +1 -0
@@ -244,6 +244,7 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = {static const TCGCPUOps openrisc_tcg_ops = { .guest_default_memory_order =0 , + .mttcg_supported = true, .initialize = openrisc_translate_init, .translate_code = openrisc_translate_code,
target/ppc/cpu_init.c +1 -0
@@ -7479,6 +7479,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {#include "accel/tcg/cpu-ops.h" static const TCGCPUOps ppc_tcg_ops = { + .mttcg_supported =TARGET_LONG_BITS ==64 , .guest_default_memory_order =0 , .initialize = ppc_translate_init, .translate_code = ppc_translate_code,
target/riscv/tcg/tcg-cpu.c +1 -0
@@ -141,6 +141,7 @@ static void riscv_restore_state_to_opc(CPUState *cs, }const TCGCPUOps riscv_tcg_ops = { + .mttcg_supported = true, .guest_default_memory_order =0 , .initialize = riscv_translate_init,
target/rx/cpu.c +1 -0
@@ -206,6 +206,7 @@ static const struct SysemuCPUOps rx_sysemu_ops = {static const TCGCPUOps rx_tcg_ops = {/* MTTCG not yet supported: require strict ordering */ .guest_default_memory_order =TCG_MO_ALL , + .mttcg_supported = false, .initialize = rx_translate_init, .translate_code = rx_translate_code,
target/s390x/cpu.c +1 -0
@@ -345,6 +345,7 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, }static const TCGCPUOps s390_tcg_ops = { + .mttcg_supported = true,/* * The z/Architecture has a strong memory model with some * store-after-load re-ordering.
target/sh4/cpu.c +1 -0
@@ -264,6 +264,7 @@ static const struct SysemuCPUOps sh4_sysemu_ops = {static const TCGCPUOps superh_tcg_ops = {/* MTTCG not yet supported: require strict ordering */ .guest_default_memory_order =TCG_MO_ALL , + .mttcg_supported = false, .initialize = sh4_translate_init, .translate_code = sh4_translate_code,
target/sparc/cpu.c +1 -0
@@ -1023,6 +1023,7 @@ static const TCGCPUOps sparc_tcg_ops = {* by an implied MEMBAR #StoreStore. */ .guest_default_memory_order = TCG_MO_LD_LD | TCG_MO_LD_ST | TCG_MO_ST_ST, + .mttcg_supported = true, .initialize = sparc_tcg_init, .translate_code = sparc_translate_code,
target/tricore/cpu.c +1 -0
@@ -174,6 +174,7 @@ static const struct SysemuCPUOps tricore_sysemu_ops = {static const TCGCPUOps tricore_tcg_ops = {/* MTTCG not yet supported: require strict ordering */ .guest_default_memory_order =TCG_MO_ALL , + .mttcg_supported = false, .initialize = tricore_tcg_init, .translate_code = tricore_translate_code, .synchronize_from_tb = tricore_cpu_synchronize_from_tb,
target/xtensa/cpu.c +1 -0
@@ -234,6 +234,7 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = {static const TCGCPUOps xtensa_tcg_ops = {/* Xtensa processors have a weak memory model */ .guest_default_memory_order =0 , + .mttcg_supported = true, .initialize = xtensa_translate_init, .translate_code = xtensa_translate_code,
configs/targets/aarch64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=aarch64 TARGET_BASE_ARCH=arm -TARGET_SUPPORTS_MTTCG=y TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml gdb-xml/arm-m-profile-mve.xml gdb-xml/aarch64-pauth.xml # needed by boot.c
configs/targets/alpha-softmmu.mak +0 -1
@@ -1,3 +1,2 @@ TARGET_ARCH=alpha -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=64
configs/targets/arm-softmmu.mak +0 -1
@@ -1,5 +1,4 @@ TARGET_ARCH=arm -TARGET_SUPPORTS_MTTCG=y TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml gdb-xml/arm-m-profile-mve.xml # needed by boot.c TARGET_NEED_FDT=y
configs/targets/hppa-softmmu.mak +0 -1
@@ -1,4 +1,3 @@ TARGET_ARCH=hppa TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=64
configs/targets/i386-softmmu.mak +0 -1
@@ -1,5 +1,4 @@ TARGET_ARCH=i386 -TARGET_SUPPORTS_MTTCG=y TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_KVM_HAVE_RESET_PARKED_VCPU=y TARGET_XML_FILES= gdb-xml/i386-32bit.xml
configs/targets/loongarch64-softmmu.mak +0 -1
@@ -1,7 +1,6 @@ TARGET_ARCH=loongarch64 TARGET_BASE_ARCH=loongarch TARGET_KVM_HAVE_GUEST_DEBUG=y -TARGET_SUPPORTS_MTTCG=y TARGET_XML_FILES= gdb-xml/loongarch-base32.xml gdb-xml/loongarch-base64.xml gdb-xml/loongarch-fpu.xml gdb-xml/loongarch-lsx.xml gdb-xml/loongarch-lasx.xml # all boards require libfdt TARGET_NEED_FDT=y
configs/targets/microblaze-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=microblaze TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y # needed by boot.c TARGET_NEED_FDT=y TARGET_XML_FILES=gdb-xml/microblaze-core.xml gdb-xml/microblaze-stack-protect.xml
configs/targets/microblazeel-softmmu.mak +0 -1
@@ -1,5 +1,4 @@ TARGET_ARCH=microblaze -TARGET_SUPPORTS_MTTCG=y # needed by boot.c TARGET_NEED_FDT=y TARGET_XML_FILES=gdb-xml/microblaze-core.xml gdb-xml/microblaze-stack-protect.xml
configs/targets/mips-softmmu.mak +0 -1
@@ -1,4 +1,3 @@ TARGET_ARCH=mips TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=32
configs/targets/mipsel-softmmu.mak +0 -1
@@ -1,3 +1,2 @@ TARGET_ARCH=mips -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=32
configs/targets/or1k-softmmu.mak +0 -1
@@ -1,5 +1,4 @@ TARGET_ARCH=openrisc -TARGET_SUPPORTS_MTTCG=y TARGET_BIG_ENDIAN=y # needed by boot.c and all boards TARGET_NEED_FDT=y
configs/targets/ppc64-softmmu.mak +0 -1
@@ -1,7 +1,6 @@ TARGET_ARCH=ppc64 TARGET_BASE_ARCH=ppc TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= gdb-xml/power64-core.xml gdb-xml/power-fpu.xml gdb-xml/power-altivec.xml gdb-xml/power-spe.xml gdb-xml/power-vsx.xml # all boards require libfdt
configs/targets/riscv32-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=riscv32 TARGET_BASE_ARCH=riscv -TARGET_SUPPORTS_MTTCG=y TARGET_XML_FILES= gdb-xml/riscv-32bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-32bit-virtual.xml # needed by boot.c TARGET_NEED_FDT=y
configs/targets/riscv64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=riscv64 TARGET_BASE_ARCH=riscv -TARGET_SUPPORTS_MTTCG=y TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= gdb-xml/riscv-64bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-64bit-virtual.xml gdb-xml/riscv-32bit-cpu.xml gdb-xml/riscv-32bit-virtual.xml # needed by boot.c
configs/targets/s390x-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=s390x TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= gdb-xml/s390x-core64.xml gdb-xml/s390-acr.xml gdb-xml/s390-fpr.xml gdb-xml/s390-vx.xml gdb-xml/s390-cr.xml gdb-xml/s390-virt.xml gdb-xml/s390-virt-kvm.xml gdb-xml/s390-gs.xml TARGET_LONG_BITS=64
configs/targets/sparc-softmmu.mak +0 -1
@@ -1,4 +1,3 @@ TARGET_ARCH=sparc TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=32
configs/targets/sparc64-softmmu.mak +0 -1
@@ -1,5 +1,4 @@ TARGET_ARCH=sparc64 TARGET_BASE_ARCH=sparc TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=64
configs/targets/x86_64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=x86_64 TARGET_BASE_ARCH=i386 -TARGET_SUPPORTS_MTTCG=y TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_KVM_HAVE_RESET_PARKED_VCPU=y TARGET_XML_FILES= gdb-xml/i386-64bit.xml
configs/targets/xtensa-softmmu.mak +0 -1
@@ -1,3 +1,2 @@ TARGET_ARCH=xtensa -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=32
configs/targets/xtensaeb-softmmu.mak +0 -1
@@ -1,4 +1,3 @@ TARGET_ARCH=xtensa TARGET_BIG_ENDIAN=y -TARGET_SUPPORTS_MTTCG=y TARGET_LONG_BITS=32
docs/devel/multi-thread-tcg.rst +1 -1
@@ -30,7 +30,7 @@ user-space thread. This is enabled by default for all FE/BE combinations where the host memory model is able to accommodate the guest (TCGCPUOps::guest_default_memory_order & ~TCG_TARGET_DEFAULT_MO is zero) and the guest has had the required work done to support this safely -(TARGET_SUPPORTS_MTTCG). +(TCGCPUOps::mttcg_supported). System emulation will fall back to the original round robin approach if:
Signature · 1 line
2.43.0
[PULL 120/148] meson: add common hw files
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
Those files will be compiled once per base architecture ("arm" in this case), instead of being compiled for every variant/bitness of architecture.
We make sure to not include target cpu definitions (exec/cpu-defs.h) by defining header guard directly. This way, a given compilation unit can access a specific cpu definition, but not access to compile time defines associated.
Previous commits took care to clean up some headers to not rely on cpu-defs.h content.
Message-ID: <[email protected]>
--- meson.build | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
meson.build +36 -1
@@ -3682,6 +3682,7 @@ hw_arch = {} target_arch = {} target_system_arch = {} target_user_arch = {} +hw_common_arch = {} # NOTE: the trace/ subdirectory needs the qapi_trace_events variable # that is filled in by qapi/.
@@ -4079,6 +4080,34 @@ common_all = static_library('common', implicit_include_directories: false, dependencies: common_ss.all_dependencies()) +# construct common libraries per base architecture +hw_common_arch_libs = {} +foreach target : target_dirs + config_target = config_target_mak[target] + target_base_arch = config_target['TARGET_BASE_ARCH'] + + # check if already generated + if target_base_arch in hw_common_arch_libs + continue + endif + + if target_base_arch in hw_common_arch + target_inc = [include_directories('target' / target_base_arch)] + src = hw_common_arch[target_base_arch] + lib = static_library( + 'hw_' + target_base_arch, + build_by_default: false, + sources: src.all_sources() + genh, + include_directories: common_user_inc + target_inc, + implicit_include_directories: false, + # prevent common code to access cpu compile time + # definition, but still allow access to cpu.h + c_args: ['-DCPU_DEFS_H', '-DCOMPILING_SYSTEM_VS_USER', '-DCONFIG_SOFTMMU'], + dependencies: src.all_dependencies()) + hw_common_arch_libs += {target_base_arch: lib} + endif +endforeach + if have_rust # We would like to use --generate-cstr, but it is only available # starting with bindgen 0.66.0. The oldest supported versions
@@ -4244,8 +4273,14 @@ foreach target : target_dirs arch_deps += t.dependencies() target_common = common_ss.apply(config_target, strict: false) - objects = common_all.extract_objects(target_common.sources()) + objects = [common_all.extract_objects(target_common.sources())] arch_deps += target_common.dependencies() + if target_type == 'system' and target_base_arch in hw_common_arch_libs + src = hw_common_arch[target_base_arch].apply(config_target, strict: false) + lib = hw_common_arch_libs[target_base_arch] + objects += lib.extract_objects(src.sources()) + arch_deps += src.dependencies() + endif target_specific = specific_ss.apply(config_target, strict: false) arch_srcs += target_specific.sources()
Signature · 1 line
2.43.0
[PULL 140/148] tcg: Move cpu_req_mo() macro to target-agnostic 'backend-ldst.h'
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
--- accel/tcg/backend-ldst.h | 41 +++++++++++++++++++++++++++++++++++++ accel/tcg/internal-target.h | 28 ------------------------- accel/tcg/cputlb.c | 1 + accel/tcg/user-exec.c | 1 + 4 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 accel/tcg/backend-ldst.h
accel/tcg/backend-ldst.h new file +41 -0
@@ -0,0 +1,41 @@ +/* +* Internal memory barrier helpers for QEMU (target agnostic) +* +* Copyright (c) 2003 Fabrice Bellard +* +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef ACCEL_TCG_BACKEND_LDST_H +#define ACCEL_TCG_BACKEND_LDST_H + +#include "tcg-target-mo.h" + +/** +* tcg_req_mo: +* @guest_mo: Guest default memory order +* @type: TCGBar +* +* Filter @type to the barrier that is required for the guest +* memory ordering vs the host memory ordering. A non-zero +* result indicates that some barrier is required. +*/ +#define tcg_req_mo (guest_mo, type) \ + ((type) & guest_mo & ~TCG_TARGET_DEFAULT_MO) + +/** +* cpu_req_mo: +* @cpu: CPUState +* @type: TCGBar +* +* If tcg_req_mo indicates a barrier for @type is required +* for the guest memory model, issue a host memory barrier. +*/ +#define cpu_req_mo (cpu, type) \ + do { \ + if (tcg_req_mo(cpu->cc->tcg_ops->guest_default_memory_order, type)) { \ + smp_mb(); \ + } \ + } while (0) + +#endif
accel/tcg/internal-target.h +0 -28
@@ -13,7 +13,6 @@#include "exec/exec-all.h" #include "exec/translation-block.h" #include "tb-internal.h" -#include "tcg-target-mo.h" #include "exec/mmap-lock.h" /*
@@ -44,31 +43,4 @@ void page_table_config_init(void); G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);#endif /* CONFIG_USER_ONLY */ -/** -* tcg_req_mo: -* @guest_mo: Guest default memory order -* @type: TCGBar -* -* Filter @type to the barrier that is required for the guest -* memory ordering vs the host memory ordering. A non-zero -* result indicates that some barrier is required. -*/ -#define tcg_req_mo (guest_mo, type) \ - ((type) & guest_mo & ~TCG_TARGET_DEFAULT_MO) - -/** -* cpu_req_mo: -* @cpu: CPUState -* @type: TCGBar -* -* If tcg_req_mo indicates a barrier for @type is required -* for the guest memory model, issue a host memory barrier. -*/ -#define cpu_req_mo (cpu, type) \ - do { \ - if (tcg_req_mo(cpu->cc->tcg_ops->guest_default_memory_order, type)) { \ - smp_mb(); \ - } \ - } while (0) -#endif /* ACCEL_TCG_INTERNAL_H */
accel/tcg/cputlb.c +1 -0
@@ -48,6 +48,7 @@#include "qemu/plugin-memory.h" #endif #include "tcg/tcg-ldst.h" +#include "backend-ldst.h" /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */
accel/tcg/user-exec.c +1 -0
@@ -37,6 +37,7 @@#include "qemu/int128.h" #include "trace.h" #include "tcg/tcg-ldst.h" +#include "backend-ldst.h" #include "internal-common.h" #include "internal-target.h" #include "tb-internal.h"
Signature · 1 line
2.43.0
[PULL 103/148] exec/cpu-all: remove system/memory include
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
We include this header where needed. When includes set already have ifdef CONFIG_USER_ONLY, we add it here, else, we don't condition the include.
Message-ID: <[email protected]>
--- hw/s390x/ipl.h | 1 + include/exec/cpu-all.h | 5 ----- target/arm/internals.h | 1 + target/hppa/cpu.h | 1 + target/i386/hvf/vmx.h | 1 + target/ppc/mmu-hash32.h | 2 ++ hw/ppc/spapr_ovec.c | 1 + target/alpha/helper.c | 1 + target/arm/hvf/hvf.c | 1 + target/i386/arch_memory_mapping.c | 1 + target/i386/helper.c | 1 + target/i386/tcg/system/misc_helper.c | 1 + target/i386/tcg/system/tcg-cpu.c | 1 + target/m68k/helper.c | 1 + target/ppc/excp_helper.c | 1 + target/ppc/mmu-book3s-v3.c | 1 + target/ppc/mmu-hash64.c | 1 + target/ppc/mmu-radix64.c | 1 + target/riscv/cpu_helper.c | 1 + target/sparc/ldst_helper.c | 1 + target/sparc/mmu_helper.c | 1 + target/xtensa/mmu_helper.c | 1 + target/xtensa/op_helper.c | 1 + 23 files changed, 23 insertions(+), 5 deletions(-)
hw/s390x/ipl.h +1 -0
@@ -15,6 +15,7 @@#include "cpu.h" #include "system/address-spaces.h" +#include "system/memory.h" #include "hw/qdev-core.h" #include "hw/s390x/ipl/qipl.h" #include "qom/object.h"
include/exec/cpu-all.h +0 -5
@@ -26,11 +26,6 @@#include "hw/core/cpu.h" #include "exec/cpu-defs.h" #include "exec/target_page.h" -#ifndef CONFIG_USER_ONLY -#include "system/memory.h" -#endif - -#include "cpu.h" #endif /* CPU_ALL_H */
target/arm/internals.h +1 -0
@@ -28,6 +28,7 @@#include "exec/breakpoint.h" #include "hw/registerfields.h" #include "tcg/tcg-gvec-desc.h" +#include "system/memory.h" #include "syndrome.h" #include "cpu-features.h"
target/hppa/cpu.h +1 -0
@@ -22,6 +22,7 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" +#include "system/memory.h" #include "qemu/cpu-float.h" #include "qemu/interval-tree.h" #include "hw/registerfields.h"
target/i386/hvf/vmx.h +1 -0
@@ -34,6 +34,7 @@#include "system/hvf_int.h" #include "system/address-spaces.h" +#include "system/memory.h" static inline uint64_t rreg (hv_vcpuid_t vcpu,hv_x86_reg_t reg) {
target/ppc/mmu-hash32.h +2 -0
@@ -3,6 +3,8 @@#ifndef CONFIG_USER_ONLY +#include "system/memory.h" +bool ppc_hash32_xlate (PowerPCCPU *cpu,vaddr eaddr,MMUAccessType access_type,hwaddr *raddrp,int *psizep,int *protp,int mmu_idx,bool guest_visible);
hw/ppc/spapr_ovec.c +1 -0
@@ -16,6 +16,7 @@#include "migration/vmstate.h" #include "qemu/bitmap.h" #include "system/address-spaces.h" +#include "system/memory.h" #include "qemu/error-report.h" #include "trace.h" #include <libfdt.h>
target/alpha/helper.c +1 -0
@@ -25,6 +25,7 @@#include "fpu/softfloat-types.h" #include "exec/helper-proto.h" #include "qemu/qemu-print.h" +#include "system/memory.h" #define CONVERT_BIT (X ,SRC ,DST ) \
target/arm/hvf/hvf.c +1 -0
@@ -23,6 +23,7 @@#include <mach/mach_time.h> #include "system/address-spaces.h" +#include "system/memory.h" #include "hw/boards.h" #include "hw/irq.h" #include "qemu/main-loop.h"
target/i386/arch_memory_mapping.c +1 -0
@@ -14,6 +14,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "system/memory_mapping.h" +#include "system/memory.h" /* PAE Paging or IA-32e Paging */ static void walk_pte(MemoryMappingList *list, AddressSpace *as,
target/i386/helper.c +1 -0
@@ -25,6 +25,7 @@#include "system/runstate.h" #ifndef CONFIG_USER_ONLY #include "system/hw_accel.h" +#include "system/memory.h" #include "monitor/monitor.h" #include "kvm/kvm_i386.h" #endif
target/i386/tcg/system/misc_helper.c +1 -0
@@ -23,6 +23,7 @@#include "exec/helper-proto.h" #include "exec/cpu_ldst.h" #include "system/address-spaces.h" +#include "system/memory.h" #include "exec/cputlb.h" #include "tcg/helper-tcg.h" #include "hw/i386/apic.h"
target/i386/tcg/system/tcg-cpu.c +1 -0
@@ -24,6 +24,7 @@#include "system/system.h" #include "qemu/units.h" #include "system/address-spaces.h" +#include "system/memory.h" #include "tcg/tcg-cpu.h"
target/m68k/helper.c +1 -0
@@ -25,6 +25,7 @@#include "exec/page-protection.h" #include "exec/gdbstub.h" #include "exec/helper-proto.h" +#include "system/memory.h" #include "gdbstub/helpers.h" #include "fpu/softfloat.h" #include "qemu/qemu-print.h"
target/ppc/excp_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "qemu/main-loop.h" #include "qemu/log.h" +#include "system/memory.h" #include "system/tcg.h" #include "system/system.h" #include "system/runstate.h"
target/ppc/mmu-book3s-v3.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "system/memory.h" #include "cpu.h" #include "mmu-hash64.h" #include "mmu-book3s-v3.h"
target/ppc/mmu-hash64.c +1 -0
@@ -25,6 +25,7 @@#include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "system/hw_accel.h" +#include "system/memory.h" #include "kvm_ppc.h" #include "mmu-hash64.h" #include "exec/log.h"
target/ppc/mmu-radix64.c +1 -0
@@ -23,6 +23,7 @@#include "exec/page-protection.h" #include "qemu/error-report.h" #include "system/kvm.h" +#include "system/memory.h" #include "kvm_ppc.h" #include "exec/log.h" #include "internal.h"
target/riscv/cpu_helper.c +1 -0
@@ -26,6 +26,7 @@#include "exec/cputlb.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "system/memory.h" #include "instmap.h" #include "tcg/tcg-op.h" #include "accel/tcg/cpu-ops.h"
target/sparc/ldst_helper.c +1 -0
@@ -27,6 +27,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" #include "exec/cpu_ldst.h" +#include "system/memory.h" #ifdef CONFIG_USER_ONLY #include "user/page-protection.h" #endif
target/sparc/mmu_helper.c +1 -0
@@ -24,6 +24,7 @@#include "accel/tcg/cpu-mmu-index.h" #include "exec/page-protection.h" #include "exec/tlb-flags.h" +#include "system/memory.h" #include "qemu/qemu-print.h" #include "trace.h"
target/xtensa/mmu_helper.c +1 -0
@@ -36,6 +36,7 @@#include "accel/tcg/cpu-mmu-index.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#include "system/memory.h" #define XTENSA_MPU_SEGMENT_MASK 0x0000001f#define XTENSA_MPU_ACC_RIGHTS_MASK 0x00000f00
target/xtensa/op_helper.c +1 -0
@@ -31,6 +31,7 @@#include "exec/page-protection.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" +#include "system/memory.h" #include "qemu/atomic.h" #include "qemu/timer.h"
Signature · 1 line
2.43.0
[PULL 132/148] exec: Do not include 'accel/tcg/cpu-ldst.h' in 'exec-all.h'
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Only 2 files requiring "accel/tcg/cpu-ldst.h" API do not include it:
- accel/tcg/cpu-exec.c
- target/arm/tcg/sve_helper.c
Include it there and remove it from "exec/exec-all.h".
--- include/exec/exec-all.h | 3 --- accel/tcg/cpu-exec.c | 1 + target/arm/tcg/sve_helper.c | 1 + 3 files changed, 2 insertions(+), 3 deletions(-)
include/exec/exec-all.h +0 -3
@@ -20,9 +20,6 @@#ifndef EXEC_ALL_H #define EXEC_ALL_H -#if defined(CONFIG_USER_ONLY ) -#include "accel/tcg/cpu-ldst.h" -#endif #include "exec/mmu-access-type.h" #include "exec/translation-block.h"
accel/tcg/cpu-exec.c +1 -0
@@ -22,6 +22,7 @@#include "qapi/error.h" #include "qapi/type-helpers.h" #include "hw/core/cpu.h" +#include "accel/tcg/cpu-ldst.h" #include "accel/tcg/cpu-ops.h" #include "trace.h" #include "disas/disas.h"
target/arm/tcg/sve_helper.c +1 -0
@@ -30,6 +30,7 @@#include "tcg/tcg.h" #include "vec_internal.h" #include "sve_ldst_internal.h" +#include "accel/tcg/cpu-ldst.h" #include "accel/tcg/cpu-ops.h" #ifdef CONFIG_USER_ONLY #include "user/page-protection.h"
Signature · 1 line
2.43.0
[PULL 130/148] exec: Restrict 'cpu-ldst-common.h' to accel/tcg/
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
---
include/{exec => accel/tcg}/cpu-ldst-common.h | 6 +++---
include/exec/cpu_ldst.h | 2 +-
accel/tcg/translator.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
rename include/{exec => accel/tcg}/cpu-ldst-common.h (97%)include/accel/tcg/cpu-ldst-common.h renamed from include/exec/cpu-ldst-common.h +3 -3
@@ -4,8 +4,8 @@* SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifndef CPU_LDST_COMMON_H -#define CPU_LDST_COMMON_H +#ifndef ACCEL_TCG_CPU_LDST_COMMON_H +#define ACCEL_TCG_CPU_LDST_COMMON_H #ifndef CONFIG_TCG #error Can only include this header with TCG
@@ -119,4 +119,4 @@ uint32_t cpu_ldl_code_mmu(CPUArchState *env, vaddr addr,uint64_t cpu_ldq_code_mmu (CPUArchState *env,vaddr addr,MemOpIdx oi,uintptr_t ra); -#endif /* CPU_LDST_COMMON_H */ +#endif /* ACCEL_TCG_CPU_LDST_COMMON_H */
include/exec/cpu_ldst.h +1 -1
@@ -67,7 +67,7 @@#endif #include "exec/cpu-common.h" -#include "exec/cpu-ldst-common.h" +#include "accel/tcg/cpu-ldst-common.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/abi_ptr.h"
accel/tcg/translator.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/bswap.h" #include "qemu/log.h" #include "qemu/error-report.h" -#include "exec/cpu-ldst-common.h" +#include "accel/tcg/cpu-ldst-common.h" #include "accel/tcg/cpu-mmu-index.h" #include "exec/target_page.h" #include "exec/translator.h"
Signature · 1 line
2.43.0
[PULL 117/148] target/arm/cpu: define same set of registers for aarch32 and aarch64
In reply to Richard HendersonFrom: Pierrick Bouvier <[email protected]>
To eliminate TARGET_AARCH64, we need to make various definitions common between 32 and 64 bit Arm targets.
Added registers are used only by aarch64 code, and the only impact is on the size of CPUARMState, and added zarray
(ARMVectorReg zarray[ARM_MAX_VQ * 16]) member (+64KB)
It could be eventually possible to allocate this array only for aarch64 emulation, but I'm not sure it's worth the hassle to save a few KB per vcpu. Running qemu-system takes already several hundreds of MB of (resident) memory, and qemu-user takes dozens of MB of (resident) memory anyway.
As part of this, we define ARM_MAX_VQ once for aarch32 and aarch64, which will affect zregs field for aarch32.
This field is used for MVE and SVE implementations. MVE implementation is clipping index value to 0 or 1 for zregs[*].d[],
so we should not touch the rest of data in this case anyway.
This change is safe regarding migration, because aarch64 registers still have the same size, and for aarch32, only zregs is modified. Migration code explicitly specify a size of 2 for env.vfp.zregs[0].d, VMSTATE_UINT64_SUB_ARRAY(env.vfp.zregs[0].d, ARMCPU, 0, 2). So extending the storage size has no impact.
Message-ID: <[email protected]>
--- target/arm/cpu.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
target/arm/cpu.h +1 -11
@@ -169,17 +169,12 @@ typedef struct ARMGenericTimer {* Align the data for use with TCG host vector operations. */ -#ifdef TARGET_AARCH64 -# define ARM_MAX_VQ 16 -#else -# define ARM_MAX_VQ 1 -#endif +#define ARM_MAX_VQ 16typedef struct ARMVectorReg { uint64_t d[2 * ARM_MAX_VQ] QEMU_ALIGNED(16); }ARMVectorReg ; -#ifdef TARGET_AARCH64/* In AArch32 mode, predicate registers do not exist at all. */ typedef struct ARMPredicateReg { uint64_t p[DIV_ROUND_UP(2 * ARM_MAX_VQ, 8)] QEMU_ALIGNED(16);
@@ -189,7 +184,6 @@ typedef struct ARMPredicateReg {typedef struct ARMPACKey {uint64_t lo, hi; }ARMPACKey ; -#endif /* See the commentary above the TBFLAG field definitions. */ typedef struct CPUARMTBFlags {
@@ -660,13 +654,11 @@ typedef struct CPUArchState {struct {ARMVectorReg zregs[32 ]; -#ifdef TARGET_AARCH64 /* Store FFR as pregs[16] to make it easier to treat as any other. */ #define FFR_PRED_NUM 16ARMPredicateReg pregs[17 ];/* Scratch space for aa64 sve predicate temporary. */ ARMPredicateReg preg_tmp; -#endif /* We store these fpcsr fields separately for convenience. */ uint32_t qc[4] QEMU_ALIGNED(16);
@@ -711,7 +703,6 @@ typedef struct CPUArchState {uint32_t cregs[16 ]; } iwmmxt; -#ifdef TARGET_AARCH64struct {ARMPACKey apia;ARMPACKey apib;
@@ -743,7 +734,6 @@ typedef struct CPUArchState {* to keep the offsets into the rest of the structure smaller. */ ARMVectorReg zarray[ARM_MAX_VQ *16 ]; -#endif struct CPUBreakpoint *cpu_breakpoint[16 ];struct CPUWatchpoint *cpu_watchpoint[16 ];
Signature · 1 line
2.43.0
[PULL 136/148] tcg: Remove use of TCG_GUEST_DEFAULT_MO in tb_gen_code()
In reply to Richard HendersonFrom: Philippe Mathieu-Daudé <[email protected]>
Use TCGCPUOps::guest_default_memory_order to set TCGContext::guest_mo.
--- accel/tcg/translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
accel/tcg/translate-all.c +1 -1
@@ -353,7 +353,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tcg_ctx->tlb_dyn_max_bits =CPU_TLB_DYN_MAX_BITS ;#endif tcg_ctx->insn_start_words =TARGET_INSN_START_WORDS ; - tcg_ctx->guest_mo =TCG_GUEST_DEFAULT_MO ; + tcg_ctx->guest_mo = cpu->cc->tcg_ops->guest_default_memory_order; restart_translate:trace_translate_block (tb, pc, tb->tc.ptr);
Signature · 1 line
2.43.0
[PULL 052/148] include/exec: Drop ifndef CONFIG_USER_ONLY from cpu-common.h
In reply to Richard HendersonWe were hiding a number of declarations from user-only, although it hurts nothing to allow them.
--- include/exec/cpu-common.h | 6 ------ 1 file changed, 6 deletions(-)
include/exec/cpu-common.h +0 -6
@@ -9,9 +9,7 @@#define CPU_COMMON_H #include "exec/vaddr.h" -#ifndef CONFIG_USER_ONLY #include "exec/hwaddr.h" -#endif #include "hw/core/cpu.h" #include "tcg/debug-assert.h" #include "exec/page-protection.h"
@@ -40,8 +38,6 @@ int cpu_get_free_index(void);void tcg_iommu_init_notifier_list (CPUState *cpu);void tcg_iommu_free_notifier_list (CPUState *cpu); -#if !defined(CONFIG_USER_ONLY ) -enum device_endian {DEVICE_NATIVE_ENDIAN ,DEVICE_BIG_ENDIAN ,
@@ -176,8 +172,6 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length);int ram_block_discard_guest_memfd_range (RAMBlock *rb,uint64_t start,size_t length); -#endif -/* Returns: 0 on success, -1 on error */ int cpu_memory_rw_debug (CPUState *cpu,vaddr addr,void *ptr,size_t len,bool is_write);
Signature · 1 line
2.43.0
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.