target/ppc: Various TCG emulation patches
cover target/ppc: Various TCG emulation patches
This is a bunch of instruction and register additions, improved SMT support, etc. for TCG.
Thanks,
Nick
Nicholas Piggin (14):
target/ppc: larx/stcx generation need only apply DEF_MEMOP() once target/ppc: Remove redundant MEMOP_GET_SIZE macro target/ppc: Make checkstop actually stop the system target/ppc: improve checkstop logging
target/ppc: Implement attn instruction on BookS 64-bit processors target/ppc: BookE DECAR SPR is 32-bit
target/ppc: Wire up BookE ATB registers for e500 family target/ppc: Add PPR32 SPR
target/ppc: add helper to write per-LPAR SPRs target/ppc: Add SMT support to simple SPRs
target/ppc: Add SMT support to PTCR SPR
target/ppc: Implement LDBAR, TTR SPRs
target/ppc: Implement SPRC/SPRD SPRs
target/ppc: add SMT support to msgsnd broadcast
target/ppc/cpu.h | 32 +++- target/ppc/helper.h | 6 +- target/ppc/spr_common.h | 7 + target/ppc/cpu_init.c | 145 ++++++++++++++++-- target/ppc/excp_helper.c | 114 ++++++++++---- target/ppc/misc_helper.c | 82 +++++++++- target/ppc/translate.c | 101 ++++++++++-- .../ppc/translate/processor-ctrl-impl.c.inc | 2 +- 8 files changed, 426 insertions(+), 63 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/14 target/ppc: larx/stcx generation need only apply DEF_MEMOP() once
Use DEF_MEMOP() consistently in larx and stcx. generation, and apply it once when it's used rather than where the macros are expanded, to reduce typing.
--- target/ppc/translate.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
target/ppc/translate.c +9 -9
@@ -2913,7 +2913,7 @@ static void gen_load_locked(DisasContext *ctx, MemOp memop)gen_set_access_type (ctx,ACCESS_RES );gen_addr_reg_index (ctx, t0); -tcg_gen_qemu_ld_tl (gpr, t0, ctx->mem_idx, memop |MO_ALIGN ); +tcg_gen_qemu_ld_tl (gpr, t0, ctx->mem_idx,DEF_MEMOP (memop) |MO_ALIGN );tcg_gen_mov_tl (cpu_reserve, t0);tcg_gen_movi_tl (cpu_reserve_length,memop_size (memop));tcg_gen_mov_tl (cpu_reserve_val, gpr);
@@ -2926,9 +2926,9 @@ static void gen_##name(DisasContext *ctx) \ }/* lwarx */ -LARX(lbarx, DEF_MEMOP(MO_UB)) -LARX(lharx, DEF_MEMOP(MO_UW)) -LARX(lwarx, DEF_MEMOP(MO_UL)) +LARX(lbarx, MO_UB) +LARX(lharx, MO_UW) +LARX(lwarx, MO_UL)static void gen_fetch_inc_conditional (DisasContext *ctx,MemOp memop,TCGv EA ,TCGCond cond,int addend)
@@ -3173,15 +3173,15 @@ static void gen_##name(DisasContext *ctx) \gen_conditional_store (ctx, memop); \ } -STCX(stbcx_, DEF_MEMOP(MO_UB)) -STCX(sthcx_, DEF_MEMOP(MO_UW)) -STCX(stwcx_, DEF_MEMOP(MO_UL)) +STCX(stbcx_, MO_UB) +STCX(sthcx_, MO_UW) +STCX(stwcx_, MO_UL)#if defined(TARGET_PPC64 )/* ldarx */ -LARX (ldarx,DEF_MEMOP (MO_UQ )) +LARX (ldarx,MO_UQ ) /* stdcx. */ -STCX (stdcx_,DEF_MEMOP (MO_UQ )) +STCX (stdcx_,MO_UQ ) /* lqarx */static void gen_lqarx (DisasContext *ctx)
Signature · 1 line
2.43.0
Re: [PATCH 01/14] target/ppc: larx/stcx generation need only apply DEF_MEMOP() once
Quoted 8 lines · Nicholas Piggin
Use
DEF_MEMOP()consistently in larx and stcx. generation, and apply it once when it's used rather than where the macros are expanded, to reduce typing.Signed-off-by Nicholas Piggin<[email protected]>--- target/ppc/translate.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
r~
PATCH 2/14 target/ppc: Remove redundant MEMOP_GET_SIZE macro
In reply to Nicholas PigginThere is a memop_size() function for this.
--- target/ppc/translate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
target/ppc/translate.c +3 -5
@@ -2904,8 +2904,6 @@ static void gen_isync(DisasContext *ctx) ctx->base.is_jmp =DISAS_EXIT_UPDATE ; } -#define MEMOP_GET_SIZE (x) (1 << ((x) & MO_SIZE)) -static void gen_load_locked (DisasContext *ctx,MemOp memop) {TCGv gpr = cpu_gpr[rD (ctx->opcode)];
@@ -2938,7 +2936,7 @@ static void gen_fetch_inc_conditional(DisasContext *ctx, MemOp memop,TCGv u =tcg_temp_new ();tcg_gen_qemu_ld_tl (t,EA , ctx->mem_idx, memop); -tcg_gen_addi_tl (t2,EA ,MEMOP_GET_SIZE (memop)); +tcg_gen_addi_tl (t2,EA ,memop_size (memop));tcg_gen_qemu_ld_tl (t2, t2, ctx->mem_idx, memop);tcg_gen_addi_tl (u, t, addend);
@@ -2948,7 +2946,7 @@ static void gen_fetch_inc_conditional(DisasContext *ctx, MemOp memop,tcg_gen_qemu_st_tl (u,EA , ctx->mem_idx, memop);/* RT = (t != t2 ? t : u = 1<<(s*8-1)) */ -tcg_gen_movi_tl (u,1 << (MEMOP_GET_SIZE (memop) *8 -1 )); +tcg_gen_movi_tl (u,1 << (memop_size (memop) *8 -1 ));tcg_gen_movcond_tl (cond, cpu_gpr[rD (ctx->opcode)], t, t2, t, u); }
@@ -3110,7 +3108,7 @@ static void gen_st_atomic(DisasContext *ctx, MemOp memop)TCGv ea_plus_s =tcg_temp_new ();tcg_gen_qemu_ld_tl (t,EA , ctx->mem_idx, memop); -tcg_gen_addi_tl (ea_plus_s,EA ,MEMOP_GET_SIZE (memop)); +tcg_gen_addi_tl (ea_plus_s,EA ,memop_size (memop));tcg_gen_qemu_ld_tl (t2, ea_plus_s, ctx->mem_idx, memop);tcg_gen_movcond_tl (TCG_COND_EQ , s, t, t2, src, t);tcg_gen_movcond_tl (TCG_COND_EQ , s2, t, t2, src, t2);
Signature · 1 line
2.43.0
Re: [PATCH 02/14] target/ppc: Remove redundant MEMOP_GET_SIZE macro
Quoted 3 lines · Nicholas Piggin
There is a
memop_size()function for this.Signed-off-by Nicholas Piggin <[email protected]>
Quoted 45 lines
---
target/ppc/translate.c| 8 +++-----1 file changed, 3 insertions(+), 5 deletions(-)target/ppc/translate.c +3
-5@@ -2904,8 +2904,6 @@ static void gen_isync(DisasContext *ctx) ctx->base.is_jmp =DISAS_EXIT_UPDATE ; } -#define MEMOP_GET_SIZE (x) (1 << ((x) & MO_SIZE)) -static void gen_load_locked (DisasContext *ctx,MemOp memop) {TCGv gpr = cpu_gpr[rD (ctx->opcode)];@@ -2938,7 +2936,7 @@ static void gen_fetch_inc_conditional(DisasContext *ctx, MemOp memop,TCGv u =tcg_temp_new ();tcg_gen_qemu_ld_tl (t,EA , ctx->mem_idx, memop); -tcg_gen_addi_tl (t2,EA ,MEMOP_GET_SIZE (memop)); +tcg_gen_addi_tl (t2,EA ,memop_size (memop));tcg_gen_qemu_ld_tl (t2, t2, ctx->mem_idx, memop);tcg_gen_addi_tl (u, t, addend);@@ -2948,7 +2946,7 @@ static void gen_fetch_inc_conditional(DisasContext *ctx, MemOp memop,tcg_gen_qemu_st_tl (u,EA , ctx->mem_idx, memop);/* RT = (t != t2 ? t : u = 1<<(s*8-1)) */ -tcg_gen_movi_tl (u,1 << (MEMOP_GET_SIZE (memop) *8 -1 )); +tcg_gen_movi_tl (u,1 << (memop_size (memop) *8 -1 ));tcg_gen_movcond_tl (cond, cpu_gpr[rD (ctx->opcode)], t, t2, t, u); }@@ -3110,7 +3108,7 @@ static void gen_st_atomic(DisasContext *ctx, MemOp memop)TCGv ea_plus_s =tcg_temp_new ();tcg_gen_qemu_ld_tl (t,EA , ctx->mem_idx, memop); -tcg_gen_addi_tl (ea_plus_s,EA ,MEMOP_GET_SIZE (memop)); +tcg_gen_addi_tl (ea_plus_s,EA ,memop_size (memop));tcg_gen_qemu_ld_tl (t2, ea_plus_s, ctx->mem_idx, memop);tcg_gen_movcond_tl (TCG_COND_EQ , s, t, t2, src, t);tcg_gen_movcond_tl (TCG_COND_EQ , s2, t, t2, src, t2);
Re: [PATCH 02/14] target/ppc: Remove redundant MEMOP_GET_SIZE macro
In reply to Nicholas PigginQuoted 6 lines · Nicholas Piggin
There is a
memop_size()function for this.Signed-off-by Nicholas Piggin<[email protected]>--- target/ppc/translate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
r~
PATCH 3/14 target/ppc: Make checkstop actually stop the system
In reply to Nicholas Piggincheckstop state does not halt the system, interrupts continue to be serviced, and other CPUs run. Make it stop the machine with qemu_system_guest_panicked.
--- target/ppc/excp_helper.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
target/ppc/excp_helper.c +13 -3
@@ -19,6 +19,8 @@#include "qemu/osdep.h" #include "qemu/main-loop.h" #include "qemu/log.h" +#include "sysemu/sysemu.h" +#include "sysemu/runstate.h" #include "cpu.h" #include "exec/exec-all.h" #include "internal.h"
@@ -425,6 +427,8 @@ static void powerpc_set_excp_state(PowerPCCPU *cpu, target_ulong vector,static void powerpc_mcheck_checkstop (CPUPPCState *env) { +/* KVM guests always have MSR[ME] enabled */ +#ifdef CONFIG_TCG CPUState *cs =env_cpu (env);if (FIELD_EX64 (env->msr,MSR ,ME )) {
@@ -437,9 +441,15 @@ static void powerpc_mcheck_checkstop(CPUPPCState *env)if (qemu_log_separate ()) {qemu_log ("Machine check while not allowed. " "Entering checkstop state\n" ); - } - cs->halted =1 ; -cpu_interrupt_exittb (cs); + +/* +* This stops the machine and logs CPU state without killing QEMU +* (like cpu_abort()) so the machine can still be debugged (because +* it is often a guest error). +*/ +qemu_system_guest_panicked (NULL ); +cpu_loop_exit_noexc (cs); +#endif }static void powerpc_excp_40x (PowerPCCPU *cpu,int excp)
Signature · 1 line
2.43.0
PATCH 4/14 target/ppc: improve checkstop logging
In reply to Nicholas PigginChange the logging not to print to stderr as well, because a checkstop is a guest error (or perhaps a simulated machine error) rather than a QEMU error, so send it to the log.
Update the checkstop message, and log CPU registers too.
--- target/ppc/excp_helper.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
target/ppc/excp_helper.c +8 -6
@@ -430,17 +430,19 @@ static void powerpc_mcheck_checkstop(CPUPPCState *env)/* KVM guests always have MSR[ME] enabled */ #ifdef CONFIG_TCG CPUState *cs =env_cpu (env); +FILE *f;if (FIELD_EX64 (env->msr,MSR ,ME )) {return ; } -/* Machine check exception is not enabled. Enter checkstop state. */ -fprintf (stderr,"Machine check while not allowed. " -"Entering checkstop state\n" ); -if (qemu_log_separate ()) { -qemu_log ("Machine check while not allowed. " -"Entering checkstop state\n" ); + f =qemu_log_trylock (); +if (f) { +fprintf (f,"Entering checkstop state: " +"machine check with MSR[ME]=0\n" ); +cpu_dump_state (cs, f,CPU_DUMP_FPU |CPU_DUMP_CCOP ); +qemu_log_unlock (f); + }/* * This stops the machine and logs CPU state without killing QEMU
Signature · 1 line
2.43.0
PATCH 5/14 target/ppc: Implement attn instruction on BookS 64-bit processors
In reply to Nicholas Pigginattn is an implementation-specific instruction that on POWER (and G5/
970) can be enabled with a HID bit (disabled = illegal), and executing it causes the host processor to stop and the service processor to be notified. Generally used for debugging.
Implement attn and make it checkstop the system, which should be good enough for QEMU debugging.
--- target/ppc/cpu.h | 16 +++++++- target/ppc/helper.h | 1 + target/ppc/cpu_init.c | 82 +++++++++++++++++++++++++++++++++++++--- target/ppc/excp_helper.c | 39 +++++++++++++++---- target/ppc/translate.c | 11 ++++++ 5 files changed, 135 insertions(+), 14 deletions(-)
target/ppc/cpu.h +15 -1
@@ -1375,6 +1375,9 @@ struct CPUArchState {/* Power management */ int (*check_pow)(CPUPPCState *env); +/* attn instruction enable */ +int (*check_attn)(CPUPPCState *env); +#if !defined(CONFIG_USER_ONLY )void *load_info;/* holds boot loading state */ #endif
@@ -1523,6 +1526,7 @@ struct PowerPCCPUClass {int n_host_threads;void (*init_proc)(CPUPPCState *env);int (*check_pow)(CPUPPCState *env); +int (*check_attn)(CPUPPCState *env); };ObjectClass *ppc_cpu_class_by_name (const char *name);
@@ -2320,6 +2324,8 @@ void ppc_compat_add_property(Object *obj, const char *name,#define HID0_NAP (1 << 22)/* pre-2.06 */ #define HID0_HILE PPC_BIT(19)/* POWER8 */ #define HID0_POWER9_HILE PPC_BIT(4) +#define HID0_ENABLE_ATTN PPC_BIT(31)/* POWER8 */ +#define HID0_POWER9_ENABLE_ATTN PPC_BIT(3)/*****************************************************************************/ /* PowerPC Instructions types definitions */
@@ -2516,6 +2522,8 @@ enum {PPC2_MEM_LWSYNC =0x0000000000200000ULL ,/* ISA 2.06 BCD assist instructions */ PPC2_BCDA_ISA206 =0x0000000000400000ULL , +/* attn instruction found in IBM POWER (including 970) */ +PPC2_ATTN =0x0000000000800000ULL , #define PPC_TCG_INSNS2 (PPC2_BOOKE206 | PPC2_VSX | PPC2_PRCNTL | PPC2_DBRX | \ PPC2_ISA205 | PPC2_VSX207 | PPC2_PERM_ISA206 | \
@@ -2525,7 +2533,7 @@ enum {PPC2_ALTIVEC_207 |PPC2_ISA207S |PPC2_DFP | \PPC2_FP_CVT_S64 |PPC2_TM |PPC2_PM_ISA206 | \PPC2_ISA300 |PPC2_ISA310 |PPC2_MEM_LWSYNC | \ - PPC2_BCDA_ISA206) + PPC2_BCDA_ISA206 | PPC2_ATTN) };/*****************************************************************************/
@@ -3025,6 +3033,12 @@ static inline int check_pow_nocheck(CPUPPCState *env)return 1 ; } +/* attn enable check */ +static inline int check_attn_none (CPUPPCState *env) +{ +return 0 ; +} +/*****************************************************************************/ /* PowerPC implementations definitions */
target/ppc/helper.h +1 -0
@@ -825,5 +825,6 @@ DEF_HELPER_FLAGS_1(fixup_thrm, TCG_CALL_NO_RWG, void, env)#if defined(TARGET_PPC64 ) DEF_HELPER_1(clrbhrb, void, env) DEF_HELPER_FLAGS_2(mfbhrbe, TCG_CALL_NO_WG, i64, env, i32) +DEF_HELPER_1(attn, noreturn, env)#endif #endif
target/ppc/cpu_init.c +76 -6
394 lines not on this page · raw message
target/ppc/excp_helper.c +32 -7
@@ -154,6 +154,7 @@ static uint32_t ppc_ldl_code(CPUArchState *env, target_ulong addr) return insn; } +#endif static void ppc_excp_debug_sw_tlb (CPUPPCState *env,int excp)
@@ -425,17 +426,17 @@ static void powerpc_set_excp_state(PowerPCCPU *cpu, target_ulong vector, env->reserve_addr =-1 ; } -static void powerpc_mcheck_checkstop (CPUPPCState *env) -{ -/* KVM guests always have MSR[ME] enabled */ #ifdef CONFIG_TCG +/* +* This stops the machine and logs CPU state without killing QEMU (like +* cpu_abort()) because it is often a guest error as opposed to a QEMU error, +* so the machine can still be debugged. +*/ +static G_NORETURN void powerpc_checkstop(CPUPPCState *env, const char *reason) +{CPUState *cs =env_cpu (env);FILE *f; -if (FIELD_EX64 (env->msr,MSR ,ME )) { -return ; - } - f =qemu_log_trylock ();if (f) { fprintf(f, "Entering checkstop state: "
@@ -451,6 +452,30 @@ static void powerpc_mcheck_checkstop(CPUPPCState *env)*/ qemu_system_guest_panicked (NULL ); cpu_loop_exit_noexc(cs); +} + +#ifdef TARGET_PPC64 +void helper_attn (CPUPPCState *env) +{ +if ((*env->check_attn)(env)) { +powerpc_checkstop (env,"host executed attn" ); + }else { +raise_exception_err (env,POWERPC_EXCP_HV_EMU , +POWERPC_EXCP_INVAL |POWERPC_EXCP_INVAL_INVAL ); + } +} +#endif +#endif /* CONFIG_TCG */ + +static void powerpc_mcheck_checkstop (CPUPPCState *env) +{ +/* KVM guests always have MSR[ME] enabled */ +#ifdef CONFIG_TCG +if (FIELD_EX64 (env->msr,MSR ,ME )) { +return ; + } + +powerpc_checkstop (env,"machine check with MSR[ME]=0" );#endif }
target/ppc/translate.c +11 -0
@@ -5668,6 +5668,16 @@ static void gen_dform3D(DisasContext *ctx) }#if defined(TARGET_PPC64 ) +/* attn */ +static void gen_attn (DisasContext *ctx) +{ +#if defined(CONFIG_USER_ONLY ) +GEN_PRIV (ctx); +#else +gen_helper_attn (tcg_env); +#endif +} +/* brd */ static void gen_brd (DisasContext *ctx) {
@@ -5699,6 +5709,7 @@ static void gen_brh(DisasContext *ctx) static opcode_t opcodes[] = {#if defined(TARGET_PPC64 ) +GEN_HANDLER_E (attn,0x00 ,0x00 ,0x08 ,0xFFFFFDFF ,PPC_NONE ,PPC2_ATTN ),GEN_HANDLER_E (brd,0x1F ,0x1B ,0x05 ,0x0000F801 ,PPC_NONE ,PPC2_ISA310 ),GEN_HANDLER_E (brw,0x1F ,0x1B ,0x04 ,0x0000F801 ,PPC_NONE ,PPC2_ISA310 ), GEN_HANDLER_E(brh, 0x1F, 0x1B, 0x06, 0x0000F801, PPC_NONE, PPC2_ISA310),
Signature · 1 line
2.43.0
Re: [PATCH 05/14] target/ppc: Implement attn instruction on BookS 64-bit processors
Quoted 26 lines · Nicholas Piggin
target/ppc/excp_helper.c +7
-7@@ -425,17 +426,17 @@ static void powerpc_set_excp_state(PowerPCCPU *cpu, target_ulong vector, env->reserve_addr =-1 ; } -static void powerpc_mcheck_checkstop (CPUPPCState *env) -{ -/* KVM guests always have MSR[ME] enabled */ #ifdef CONFIG_TCG +/* +* This stops the machine and logs CPU state without killing QEMU (like +* cpu_abort()) because it is often a guest error as opposed to a QEMU error, +* so the machine can still be debugged. +*/ +static G_NORETURN void powerpc_checkstop(CPUPPCState *env, const char *reason) +{CPUState *cs =env_cpu (env);FILE *f; -if (FIELD_EX64 (env->msr,MSR ,ME )) { -return ; - } - f =qemu_log_trylock ();if (f) { fprintf(f, "Entering checkstop state: "
target/ppc/excp_helper.c static void powerpc_mcheck_checkstop(CPUPPCState *env) · line 455
Quoted 4 lines
target/ppc/excp_helper.c +1
-0@@ -451,6 +452,30 @@ static void powerpc_mcheck_checkstop(CPUPPCState *env)*/ qemu_system_guest_panicked (NULL );cpu_loop_exit_noexc (cs); +}
Looks like you're not using reason.
Missed swapping out in the logging block?
r~
Re: [PATCH 05/14] target/ppc: Implement attn instruction on BookS 64-bit processors
Quoted 19 lines · Richard Henderson
Quoted 18 lines · Nicholas Piggin
target/ppc/excp_helper.c +7
-3@@ -425,17 +426,17 @@ static void powerpc_set_excp_state(PowerPCCPU *cpu, target_ulong vector, env->reserve_addr =-1 ; } -static void powerpc_mcheck_checkstop (CPUPPCState *env) -{ -/* KVM guests always have MSR[ME] enabled */ #ifdef CONFIG_TCG +/* +* This stops the machine and logs CPU state without killing QEMU (like +* cpu_abort()) because it is often a guest error as opposed to a QEMU error, +* so the machine can still be debugged. +*/ +static G_NORETURN void powerpc_checkstop(CPUPPCState *env, const char *reason) +{CPUState *cs =env_cpu (env);FILE *f;
Quoted 15 lines
target/ppc/excp_helper.c static void powerpc_mcheck_checkstop(CPUPPCState *env) · line 455
Quoted 12 lines
target/ppc/excp_helper.c +1
-4-if (FIELD_EX64 (env->msr,MSR ,ME )) { -return ; - } - f =qemu_log_trylock ();if (f) { fprintf(f, "Entering checkstop state: "@@ -451,6 +452,30 @@ static void powerpc_mcheck_checkstop(CPUPPCState *env)*/ qemu_system_guest_panicked (NULL );cpu_loop_exit_noexc (cs); +}Looks like you're not using reason.
Missed swapping out in the logging block?
Good catch thanks, I lost the hunk in a rebase.
Thanks,
Nick
Re: [PATCH 05/14] target/ppc: Implement attn instruction on BookS 64-bit processors
In reply to Nicholas Piggintarget/ppc/translate.c static void gen_dform3D(DisasContext *ctx) · line 5679
Quoted 8 lines · Nicholas Piggin
target/ppc/translate.c +8
-0+static void gen_attn (DisasContext *ctx) +{ +#if defined(CONFIG_USER_ONLY ) +GEN_PRIV (ctx); +#else +gen_helper_attn (tcg_env); +#endif +}
You forgot to check priv in system mode.
Better as
GEN_PRIV(ctx);
#ifndef CONFIG_USER_ONLY
gen_helper_attn(...)#endif
r~
Re: [PATCH 05/14] target/ppc: Implement attn instruction on BookS 64-bit processors
Quoted 13 lines · Richard Henderson
target/ppc/translate.c static void gen_dform3D(DisasContext *ctx) · line 5679
Quoted 8 lines · Nicholas Piggin
target/ppc/translate.c +8
-0+static void gen_attn (DisasContext *ctx) +{ +#if defined(CONFIG_USER_ONLY ) +GEN_PRIV (ctx); +#else +gen_helper_attn (tcg_env); +#endif +}You forgot to check priv in system mode.
Better as
Quoted 4 lines
GEN_PRIV(ctx); #ifndef CONFIG_USER_ONLY gen_helper_attn(...)#endif
Good catch again.
I'm actually wrong there too, it should be treated as illegal unless it is enabled with a system SPR, in which case it's unprivileged (it can be inserted by external hardware debuggers to stop the CPU and get notified).
Thanks,
Nick
PATCH 6/14 target/ppc: BookE DECAR SPR is 32-bit
In reply to Nicholas PigginThe DECAR SPR is 32-bits width.
--- target/ppc/cpu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/cpu_init.c +1 -1
@@ -792,7 +792,7 @@ static void register_BookE_sprs(CPUPPCState *env, uint64_t ivor_mask) 0x00000000);spr_register (env,SPR_BOOKE_DECAR ,"DECAR" ,SPR_NOACCESS ,SPR_NOACCESS , -SPR_NOACCESS , &spr_write_generic, +SPR_NOACCESS , &spr_write_generic32,0x00000000 );/* SPRGs */ spr_register(env, SPR_USPRG0, "USPRG0",
Signature · 1 line
2.43.0
PATCH 7/14 target/ppc: Wire up BookE ATB registers for e500 family
In reply to Nicholas PigginFrom the Freescale PowerPC Architecture Primer:
Alternate time base APU. This APU, implemented on the e500v2, defines a 64-bit time base counter that differs from the PowerPC defined time base in that it is not writable and counts at a different, and typically much higher, frequency. The alternate time base always counts up, wrapping when the 64-bit count overflows.
This implementation of ATB uses the same frequency as the TB. The existing spr_read_atbu/l functions are unused without this patch to wire them into the SPR.
RTEMS uses this SPR on the e6500, though this hasn't been tested.
--- target/ppc/cpu_init.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
target/ppc/cpu_init.c +17 -0
@@ -920,6 +920,18 @@ static void register_BookE206_sprs(CPUPPCState *env, uint32_t mas_mask,#endif } +static void register_atb_sprs (CPUPPCState *env) +{ +spr_register (env,SPR_ATBL ,"ATBL" , + &spr_read_atbl,SPR_NOACCESS , + &spr_read_atbl,SPR_NOACCESS , +0x00000000 ); +spr_register (env,SPR_ATBU ,"ATBU" , + &spr_read_atbu,SPR_NOACCESS , + &spr_read_atbu,SPR_NOACCESS , +0x00000000 ); +} +/* SPR specific to PowerPC 440 implementation */ static void register_440_sprs (CPUPPCState *env) {
@@ -2927,6 +2939,11 @@ static void init_proc_e500(CPUPPCState *env, int version)register_BookE206_sprs (env,0x000000DF , tlbncfg, mmucfg);register_usprgh_sprs (env); +if (version != fsl_e500v1) { +/* e500v1 has no support for alternate timebase */ +register_atb_sprs (env); + } + spr_register(env, SPR_HID0, "HID0", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic,
Signature · 1 line
2.43.0
PATCH 8/14 target/ppc: Add PPR32 SPR
In reply to Nicholas PigginPPR32 provides access to the upper half of PPR.
--- target/ppc/cpu.h | 1 + target/ppc/spr_common.h | 2 ++ target/ppc/cpu_init.c | 12 ++++++++++++ target/ppc/translate.c | 16 ++++++++++++++++ 4 files changed, 31 insertions(+)
target/ppc/cpu.h +1 -0
@@ -2120,6 +2120,7 @@ void ppc_compat_add_property(Object *obj, const char *name,#define SPR_POWER_MMCRS (0x37E)#define SPR_WORT (0x37F)#define SPR_PPR (0x380) +#define SPR_PPR32 (0x382)#define SPR_750_GQR0 (0x390)#define SPR_440_DNV0 (0x390)#define SPR_750_GQR1 (0x391)
target/ppc/spr_common.h +2 -0
@@ -203,6 +203,8 @@ void spr_read_tfmr(DisasContext *ctx, int gprn, int sprn);void spr_write_tfmr (DisasContext *ctx,int sprn,int gprn);void spr_write_lpcr (DisasContext *ctx,int sprn,int gprn);void spr_read_dexcr_ureg (DisasContext *ctx,int gprn,int sprn); +void spr_read_ppr32 (DisasContext *ctx,int sprn,int gprn); +void spr_write_ppr32 (DisasContext *ctx,int sprn,int gprn);#endif void register_low_BATs (CPUPPCState *env);
target/ppc/cpu_init.c +12 -0
@@ -5623,6 +5623,14 @@ static void register_HEIR64_spr(CPUPPCState *env) 0x00000000); } +static void register_power7_common_sprs (CPUPPCState *env) +{ +spr_register (env,SPR_PPR32 ,"PPR32" , + &spr_read_ppr32, &spr_write_ppr32, + &spr_read_ppr32, &spr_write_ppr32, +0x00000000 ); +} +static void register_power8_tce_address_control_sprs (CPUPPCState *env) { spr_register_kvm(env, SPR_TAR, "TAR",
@@ -6118,6 +6126,7 @@ static void init_proc_POWER7(CPUPPCState *env)register_power6_common_sprs (env);register_HEIR32_spr (env);register_power6_dbg_sprs (env); +register_power7_common_sprs (env);register_power7_book4_sprs (env);/* env variables */
@@ -6265,6 +6274,7 @@ static void init_proc_POWER8(CPUPPCState *env)register_power6_common_sprs (env);register_HEIR32_spr (env);register_power6_dbg_sprs (env); +register_power7_common_sprs (env);register_power8_tce_address_control_sprs (env);register_power8_ids_sprs (env);register_power8_ebb_sprs (env);
@@ -6432,6 +6442,7 @@ static void init_proc_POWER9(CPUPPCState *env)register_power6_common_sprs (env);register_HEIR32_spr (env);register_power6_dbg_sprs (env); +register_power7_common_sprs (env);register_power8_tce_address_control_sprs (env);register_power8_ids_sprs (env);register_power8_ebb_sprs (env);
@@ -6626,6 +6637,7 @@ static void init_proc_POWER10(CPUPPCState *env)register_power6_common_sprs (env);register_HEIR64_spr (env);register_power6_dbg_sprs (env); +register_power7_common_sprs (env);register_power8_tce_address_control_sprs (env);register_power8_ids_sprs (env);register_power8_ebb_sprs (env);
target/ppc/translate.c +16 -0
@@ -1416,6 +1416,22 @@ void spr_read_dexcr_ureg(DisasContext *ctx, int gprn, int sprn)gen_load_spr (t0, sprn +16 ); tcg_gen_ext32u_tl(cpu_gpr[gprn], t0); } + +/* The PPR32 SPR accesses the upper 32-bits of PPR */ +void spr_read_ppr32 (DisasContext *ctx,int sprn,int gprn) +{ +gen_load_spr (cpu_gpr[gprn],SPR_PPR ); +tcg_gen_shri_tl (cpu_gpr[gprn], cpu_gpr[gprn],32 ); +} + +void spr_write_ppr32 (DisasContext *ctx,int sprn,int gprn) +{ +TCGv t0 =tcg_temp_new (); + +tcg_gen_shli_tl (t0, cpu_gpr[gprn],32 ); +gen_store_spr (SPR_PPR , t0); +spr_store_dump_spr (SPR_PPR ); +}#endif #define GEN_HANDLER (name, opc1, opc2, opc3, inval, type) \
Signature · 1 line
2.43.0
PATCH 9/14 target/ppc: add helper to write per-LPAR SPRs
In reply to Nicholas PigginAn SPR can be either per-thread, per-core, or per-LPAR. Per-LPAR means per-thread or per-core, depending on 1LPAR mode.
--- target/ppc/spr_common.h | 2 ++ target/ppc/translate.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
target/ppc/spr_common.h +2 -0
@@ -83,6 +83,8 @@ void spr_read_generic(DisasContext *ctx, int gprn, int sprn);void spr_write_generic (DisasContext *ctx,int sprn,int gprn);void spr_write_generic32 (DisasContext *ctx,int sprn,int gprn);void spr_core_write_generic (DisasContext *ctx,int sprn,int gprn); +void spr_core_write_generic32 (DisasContext *ctx,int sprn,int gprn); +void spr_core_lpar_write_generic (DisasContext *ctx,int sprn,int gprn);void spr_write_MMCR0 (DisasContext *ctx,int sprn,int gprn);void spr_write_MMCR1 (DisasContext *ctx,int sprn,int gprn);void spr_write_MMCRA (DisasContext *ctx,int sprn,int gprn);
target/ppc/translate.c +26 -0
@@ -537,6 +537,32 @@ void spr_core_write_generic(DisasContext *ctx, int sprn, int gprn)spr_store_dump_spr (sprn); } +void spr_core_write_generic32 (DisasContext *ctx,int sprn,int gprn) +{ +TCGv t0 =tcg_temp_new (); +if (!(ctx->flags &POWERPC_FLAG_SMT )) { +spr_write_generic32 (ctx, sprn, gprn); +return ; + } + +if (!gen_serialize (ctx)) { +return ; + } + +tcg_gen_ext32u_tl (t0, cpu_gpr[gprn]); +gen_helper_spr_core_write_generic (tcg_env,tcg_constant_i32 (sprn), t0); +spr_store_dump_spr (sprn); +} + +void spr_core_lpar_write_generic (DisasContext *ctx,int sprn,int gprn) +{ +if (ctx->flags &POWERPC_FLAG_SMT_1LPAR ) { +spr_core_write_generic (ctx, sprn, gprn); + }else { +spr_write_generic (ctx, sprn, gprn); + } +} +static void spr_write_CTRL_ST (DisasContext *ctx,int sprn,int gprn) {/* This does not implement >1 thread */
Signature · 1 line
2.43.0
Re: [PATCH 09/14] target/ppc: add helper to write per-LPAR SPRs
target/ppc/translate.c void spr_core_write_generic(DisasContext *ctx, int sprn, int gprn) · line 552
Quoted 13 lines · Nicholas Piggin
target/ppc/translate.c +13
-0+void spr_core_write_generic32 (DisasContext *ctx,int sprn,int gprn) +{ +TCGv t0 =tcg_temp_new (); +if (!(ctx->flags &POWERPC_FLAG_SMT )) { +spr_write_generic32 (ctx, sprn, gprn); +return ; + } + +if (!gen_serialize (ctx)) { +return ; + } + +tcg_gen_ext32u_tl (t0, cpu_gpr[gprn]);
Better to delay allocating the temp until needed, so that you don't allocate one along the return paths.
r~
Re: [PATCH 09/14] target/ppc: add helper to write per-LPAR SPRs
Quoted 17 lines · Richard Henderson
target/ppc/translate.c void spr_core_write_generic(DisasContext *ctx, int sprn, int gprn) · line 552
Quoted 13 lines · Nicholas Piggin
target/ppc/translate.c +13
-0+void spr_core_write_generic32 (DisasContext *ctx,int sprn,int gprn) +{ +TCGv t0 =tcg_temp_new (); +if (!(ctx->flags &POWERPC_FLAG_SMT )) { +spr_write_generic32 (ctx, sprn, gprn); +return ; + } + +if (!gen_serialize (ctx)) { +return ; + } + +tcg_gen_ext32u_tl (t0, cpu_gpr[gprn]);Better to delay allocating the temp until needed, so that you don't allocate one along the return paths.
Will fix.
Thanks,
Nick
PATCH 10/14 target/ppc: Add SMT support to simple SPRs
In reply to Nicholas PigginAMOR, MMCRC, HRMOR, TSCR, HMEER, RPR SPRs are per-core or per-LPAR registers with simple (generic) implementations.
--- target/ppc/cpu_init.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
target/ppc/cpu_init.c +6 -6
@@ -246,7 +246,7 @@ static void register_amr_sprs(CPUPPCState *env)spr_register_hv (env,SPR_AMOR ,"AMOR" ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS , - &spr_read_generic, &spr_write_generic, + &spr_read_generic, &spr_core_lpar_write_generic,0 );#endif /* !CONFIG_USER_ONLY */ }
@@ -5489,7 +5489,7 @@ static void register_book3s_ids_sprs(CPUPPCState *env)spr_register_hv (env,SPR_MMCRC ,"MMCRC" ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS , - &spr_read_generic, &spr_write_generic32, + &spr_read_generic, &spr_core_write_generic32,0x00000000 ); spr_register_hv(env, SPR_MMCRH, "MMCRH", SPR_NOACCESS, SPR_NOACCESS,
@@ -5529,7 +5529,7 @@ static void register_book3s_ids_sprs(CPUPPCState *env)spr_register_hv (env,SPR_HRMOR ,"HRMOR" ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS , - &spr_read_generic, &spr_write_generic, + &spr_read_generic, &spr_core_write_generic,0x00000000 ); }
@@ -5757,7 +5757,7 @@ static void register_power_common_book4_sprs(CPUPPCState *env)spr_register_hv (env,SPR_TSCR ,"TSCR" ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS , - &spr_read_generic, &spr_write_generic32, + &spr_read_generic, &spr_core_write_generic32,0x00000000 ); spr_register_hv(env, SPR_HMER, "HMER", SPR_NOACCESS, SPR_NOACCESS,
@@ -5767,7 +5767,7 @@ static void register_power_common_book4_sprs(CPUPPCState *env)spr_register_hv (env,SPR_HMEER ,"HMEER" ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS , - &spr_read_generic, &spr_write_generic, + &spr_read_generic, &spr_core_write_generic,0x00000000 ); spr_register_hv(env, SPR_TFMR, "TFMR", SPR_NOACCESS, SPR_NOACCESS,
@@ -5843,7 +5843,7 @@ static void register_power8_rpr_sprs(CPUPPCState *env)spr_register_hv (env,SPR_RPR ,"RPR" ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS ,SPR_NOACCESS , - &spr_read_generic, &spr_write_generic, + &spr_read_generic, &spr_core_write_generic,0x00000103070F1F3F );#endif }
Signature · 1 line
2.43.0
PATCH 11/14 target/ppc: Add SMT support to PTCR SPR
In reply to Nicholas PigginPTCR is a per-core register.
--- target/ppc/misc_helper.c | 16 ++++++++++++++-- target/ppc/translate.c | 4 ++++ 2 files changed, 18 insertions(+), 2 deletions(-)
target/ppc/misc_helper.c +14 -2
@@ -173,6 +173,7 @@ void helper_store_sdr1(CPUPPCState *env, target_ulong val)void helper_store_ptcr (CPUPPCState *env,target_ulong val) {if (env->spr[SPR_PTCR ] != val) { +CPUState *cs =env_cpu (env);PowerPCCPU *cpu =env_archcpu (env);target_ulong ptcr_mask =PTCR_PATB |PTCR_PATS ;target_ulong patbsize = val &PTCR_PATS ;
@@ -194,8 +195,19 @@ void helper_store_ptcr(CPUPPCState *env, target_ulong val)return ; } - env->spr[SPR_PTCR ] = val; -tlb_flush (env_cpu (env)); +if (cs->nr_threads ==1 || !(env->flags &POWERPC_FLAG_SMT_1LPAR )) { + env->spr[SPR_PTCR ] = val; +tlb_flush (cs); + }else { +CPUState *ccs; + + THREAD_SIBLING_FOREACH(cs, ccs) { +PowerPCCPU *ccpu =POWERPC_CPU (ccs); +CPUPPCState *cenv = &ccpu->env; + cenv->spr[SPR_PTCR ] = val; +tlb_flush (ccs); + } + } } }
target/ppc/translate.c +4 -0
@@ -971,6 +971,10 @@ void spr_write_hior(DisasContext *ctx, int sprn, int gprn) }void spr_write_ptcr (DisasContext *ctx,int sprn,int gprn) { +if (!gen_serialize_core (ctx)) { +return ; + } +gen_helper_store_ptcr (tcg_env, cpu_gpr[gprn]); }
Signature · 1 line
2.43.0
PATCH 12/14 target/ppc: Implement LDBAR, TTR SPRs
In reply to Nicholas PigginLDBAR, TTR are a Power-specific SPRs. These simple implementations are enough for IBM proprietary firmware for now.
--- target/ppc/cpu.h | 2 ++ target/ppc/cpu_init.c | 10 ++++++++++ 2 files changed, 12 insertions(+)
target/ppc/cpu.h +2 -0
@@ -2098,6 +2098,7 @@ void ppc_compat_add_property(Object *obj, const char *name,#define SPR_DEXCR (0x33C)#define SPR_IC (0x350)#define SPR_VTB (0x351) +#define SPR_LDBAR (0x352)#define SPR_MMCRC (0x353)#define SPR_PSSCR (0x357)#define SPR_440_INV0 (0x370)
@@ -2144,6 +2145,7 @@ void ppc_compat_add_property(Object *obj, const char *name,#define SPR_440_IVLIM (0x399)#define SPR_TSCR (0x399)#define SPR_750_DMAU (0x39A) +#define SPR_POWER_TTR (0x39A)#define SPR_750_DMAL (0x39B)#define SPR_440_RSTCFG (0x39B)#define SPR_BOOKE_DCDBTRL (0x39C)
target/ppc/cpu_init.c +10 -0
@@ -5784,6 +5784,16 @@ static void register_power_common_book4_sprs(CPUPPCState *env) &spr_access_nop, &spr_write_generic, &spr_access_nop, &spr_write_generic, 0x00000000); +spr_register_hv (env,SPR_LDBAR ,"LDBAR" , +SPR_NOACCESS ,SPR_NOACCESS , +SPR_NOACCESS ,SPR_NOACCESS , + &spr_read_generic, &spr_core_lpar_write_generic, +0x00000000 ); +spr_register_hv (env,SPR_POWER_TTR ,"TTR" , +SPR_NOACCESS ,SPR_NOACCESS , +SPR_NOACCESS ,SPR_NOACCESS , + &spr_read_generic, &spr_core_write_generic, +0x00000000 );#endif }
Signature · 1 line
2.43.0
PATCH 13/14 target/ppc: Implement SPRC/SPRD SPRs
In reply to Nicholas PigginThis implements the POWER SPRC/SPRD SPRs, and SCRATCH0-7 registers that can be accessed via these indirect SPRs.
SCRATCH registers only provide storage, but they are used by firmware for low level crash and progress data, so this implementation logs writes to the registers to help with analysis.
--- target/ppc/cpu.h | 7 +++-- target/ppc/helper.h | 3 ++ target/ppc/spr_common.h | 3 ++ target/ppc/cpu_init.c | 10 ++++++ target/ppc/misc_helper.c | 66 ++++++++++++++++++++++++++++++++++++++++ target/ppc/translate.c | 18 +++++++++++ 6 files changed, 105 insertions(+), 2 deletions(-)
target/ppc/cpu.h +5 -2
@@ -1264,6 +1264,9 @@ struct CPUArchState {ppc_slb_t slb[MAX_SLB_ENTRIES ];/* PowerPC 64 SLB area */ struct CPUBreakpoint *ciabr_breakpoint;struct CPUWatchpoint *dawr0_watchpoint; + +/* POWER CPU regs/state */ +target_ulong scratch[8 ];/* SCRATCH registers (shared across core) */ #endif target_ulong sr[32 ];/* segment registers */ uint32_t nb_BATs;/* number of BATs */
@@ -1806,9 +1809,9 @@ void ppc_compat_add_property(Object *obj, const char *name,#define SPR_SPRG2 (0x112)#define SPR_SPRG3 (0x113)#define SPR_SPRG4 (0x114) -#define SPR_SCOMC (0x114) +#define SPR_POWER_SPRC (0x114)#define SPR_SPRG5 (0x115) -#define SPR_SCOMD (0x115) +#define SPR_POWER_SPRD (0x115)#define SPR_SPRG6 (0x116)#define SPR_SPRG7 (0x117)#define SPR_ASR (0x118)
target/ppc/helper.h +3 -0
@@ -730,6 +730,9 @@ DEF_HELPER_2(book3s_msgsndp, void, env, tl) DEF_HELPER_2(book3s_msgclrp, void, env, tl) DEF_HELPER_1(load_tfmr, tl, env) DEF_HELPER_2(store_tfmr, void, env, tl) +DEF_HELPER_FLAGS_2(store_sprc, TCG_CALL_NO_RWG, void, env, tl) +DEF_HELPER_FLAGS_1(load_sprd, TCG_CALL_NO_RWG_SE, tl, env) +DEF_HELPER_FLAGS_2(store_sprd, TCG_CALL_NO_RWG, void, env, tl)#endif DEF_HELPER_2(store_sdr1, void, env, tl)DEF_HELPER_2 (store_pidr, void, env, tl)
target/ppc/spr_common.h +3 -0
@@ -207,6 +207,9 @@ void spr_write_lpcr(DisasContext *ctx, int sprn, int gprn);void spr_read_dexcr_ureg (DisasContext *ctx,int gprn,int sprn);void spr_read_ppr32 (DisasContext *ctx,int sprn,int gprn);void spr_write_ppr32 (DisasContext *ctx,int sprn,int gprn); +void spr_write_sprc (DisasContext *ctx,int sprn,int gprn); +void spr_read_sprd (DisasContext *ctx,int sprn,int gprn); +void spr_write_sprd (DisasContext *ctx,int sprn,int gprn);#endif void register_low_BATs (CPUPPCState *env);
target/ppc/cpu_init.c +10 -0
@@ -5794,6 +5794,16 @@ static void register_power_common_book4_sprs(CPUPPCState *env)SPR_NOACCESS ,SPR_NOACCESS , &spr_read_generic, &spr_core_write_generic, 0x00000000); +spr_register_hv (env,SPR_POWER_SPRC ,"SPRC" , +SPR_NOACCESS ,SPR_NOACCESS , +SPR_NOACCESS ,SPR_NOACCESS , + &spr_read_generic, &spr_write_sprc, +0x00000000 ); +spr_register_hv (env,SPR_POWER_SPRD ,"SPRD" , +SPR_NOACCESS ,SPR_NOACCESS , +SPR_NOACCESS ,SPR_NOACCESS , + &spr_read_sprd, &spr_write_sprd, +0x00000000 );#endif }
target/ppc/misc_helper.c +66 -0
72 lines not on this page · raw message
target/ppc/translate.c +18 -0
@@ -1363,6 +1363,24 @@ void spr_write_tfmr(DisasContext *ctx, int sprn, int gprn)gen_helper_store_tfmr (tcg_env, cpu_gpr[gprn]); } +void spr_write_sprc (DisasContext *ctx,int sprn,int gprn) +{ +gen_helper_store_sprc (tcg_env, cpu_gpr[gprn]); +} + +void spr_read_sprd (DisasContext *ctx,int gprn,int sprn) +{ +gen_helper_load_sprd (cpu_gpr[gprn], tcg_env); +} + +void spr_write_sprd (DisasContext *ctx,int sprn,int gprn) +{ +if (!gen_serialize_core (ctx)) { +return ; + } +gen_helper_store_sprd (tcg_env, cpu_gpr[gprn]); +} +void spr_write_lpcr (DisasContext *ctx,int sprn,int gprn) {translator_io_start (&ctx->base);
Signature · 1 line
2.43.0
PATCH 14/14 target/ppc: add SMT support to msgsnd broadcast
In reply to Nicholas Pigginmsgsnd has a broadcast mode that sends hypervisor doorbells to all threads belonging to the same core as the target. A "subcore" mode sends to all or one thread depending on 1LPAR mode.
--- target/ppc/cpu.h | 6 +- target/ppc/helper.h | 2 +- target/ppc/excp_helper.c | 57 +++++++++++++------ .../ppc/translate/processor-ctrl-impl.c.inc | 2 +- 4 files changed, 46 insertions(+), 21 deletions(-)
target/ppc/cpu.h +5 -1
@@ -1163,7 +1163,11 @@ FIELD(FPSCR, FI, FPSCR_FI, 1)#define DBELL_TYPE_DBELL_SERVER (0x05 << DBELL_TYPE_SHIFT) -#define DBELL_BRDCAST PPC_BIT(37) +#define DBELL_BRDCAST_MASK PPC_BITMASK(37, 38) +#define DBELL_BRDCAST_SHIFT 25 +#define DBELL_BRDCAST_SUBPROC (0x1 << DBELL_BRDCAST_SHIFT) +#define DBELL_BRDCAST_CORE (0x2 << DBELL_BRDCAST_SHIFT) +#define DBELL_LPIDTAG_SHIFT 14#define DBELL_LPIDTAG_MASK (0xfff << DBELL_LPIDTAG_SHIFT)#define DBELL_PIRTAG_MASK 0x3fff
target/ppc/helper.h +1 -1
@@ -695,7 +695,7 @@ DEF_HELPER_FLAGS_3(store_sr, TCG_CALL_NO_RWG, void, env, tl, tl) DEF_HELPER_1(msgsnd, void, tl) DEF_HELPER_2(msgclr, void, env, tl) -DEF_HELPER_1(book3s_msgsnd, void, tl) +DEF_HELPER_2(book3s_msgsnd, void, env, tl) DEF_HELPER_2(book3s_msgclr, void, env, tl)#endif
target/ppc/excp_helper.c +39 -18
84 lines not on this page · raw message
target/ppc/translate/processor-ctrl-impl.c.inc +1 -1
@@ -59,7 +59,7 @@ static bool trans_MSGSND(DisasContext *ctx, arg_X_rb *a) #if !defined(CONFIG_USER_ONLY) if (is_book3s_arch2x(ctx)) { - gen_helper_book3s_msgsnd(cpu_gpr[a->rb]); + gen_helper_book3s_msgsnd(tcg_env, cpu_gpr[a->rb]); } else { gen_helper_msgsnd(cpu_gpr[a->rb]); }
Signature · 1 line
2.43.0