[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/20] target/ppc: Substitute msr_ts macro with new M_MSR_TS macr
From: |
Víctor Colombo |
Subject: |
[PATCH 18/20] target/ppc: Substitute msr_ts macro with new M_MSR_TS macro |
Date: |
Fri, 22 Apr 2022 15:54:48 -0300 |
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
---
target/ppc/cpu.h | 4 +++-
target/ppc/kvm.c | 4 ++--
target/ppc/machine.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index b957fc95e0..ee00b27818 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -353,6 +353,9 @@ typedef enum {
#define MSR_RI 1 /* Recoverable interrupt 1 */
#define MSR_LE 0 /* Little-endian mode 1 hflags */
+#define M_MSR_TS0 (1ull << MSR_TS0)
+#define M_MSR_TS1 (1ull << MSR_TS1)
+#define M_MSR_TS (M_MSR_TS0 | M_MSR_TS1)
#define M_MSR_CM (1ull << MSR_CM)
#define M_MSR_GS (1ull << MSR_GS)
#define M_MSR_POW (1ull << MSR_POW)
@@ -486,7 +489,6 @@ typedef enum {
#else
#define msr_hv (0)
#endif
-#define msr_ts ((env->msr >> MSR_TS1) & 3)
#define DBCR0_ICMP (1 << 27)
#define DBCR0_BRT (1 << 26)
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 1ca18f21b2..3cccac41fd 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -973,7 +973,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
}
#ifdef TARGET_PPC64
- if (msr_ts) {
+ if (env->msr & M_MSR_TS) {
for (i = 0; i < ARRAY_SIZE(env->tm_gpr); i++) {
kvm_set_one_reg(cs, KVM_REG_PPC_TM_GPR(i), &env->tm_gpr[i]);
}
@@ -1281,7 +1281,7 @@ int kvm_arch_get_registers(CPUState *cs)
}
#ifdef TARGET_PPC64
- if (msr_ts) {
+ if (env->msr & M_MSR_TS) {
for (i = 0; i < ARRAY_SIZE(env->tm_gpr); i++) {
kvm_get_one_reg(cs, KVM_REG_PPC_TM_GPR(i), &env->tm_gpr[i]);
}
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index e673944597..51832c4bde 100644
--- a/target/ppc/machine.c
+++ b/target/ppc/machine.c
@@ -417,7 +417,7 @@ static bool tm_needed(void *opaque)
{
PowerPCCPU *cpu = opaque;
CPUPPCState *env = &cpu->env;
- return msr_ts;
+ return env->msr & M_MSR_TS;
}
static const VMStateDescription vmstate_tm = {
--
2.25.1
- [PATCH 08/20] target/ppc: Substitute msr_ce macro with new M_MSR_CE macro, (continued)
- [PATCH 08/20] target/ppc: Substitute msr_ce macro with new M_MSR_CE macro, Víctor Colombo, 2022/04/22
- [PATCH 09/20] target/ppc: Substitute msr_pow macro with new M_MSR_POW macro, Víctor Colombo, 2022/04/22
- [PATCH 10/20] target/ppc: Substitute msr_me macro with new M_MSR_ME macro, Víctor Colombo, 2022/04/22
- [PATCH 11/20] target/ppc: Substitute msr_gs macro with new M_MSR_GS macro, Víctor Colombo, 2022/04/22
- [PATCH 12/20] target/ppc: Substitute msr_fp macro with new M_MSR_FP macro, Víctor Colombo, 2022/04/22
- [PATCH 13/20] target/ppc: Substitute msr_cm macro with new M_MSR_CM macro, Víctor Colombo, 2022/04/22
- [PATCH 14/20] target/ppc: Substitute msr_ir macro with new M_MSR_IR macro, Víctor Colombo, 2022/04/22
- [PATCH 16/20] target/ppc: Substitute msr_ep macro with new M_MSR_EP macro, Víctor Colombo, 2022/04/22
- [PATCH 15/20] target/ppc: Substitute msr_dr macro with new M_MSR_DR macro, Víctor Colombo, 2022/04/22
- [PATCH 17/20] target/ppc: Substitute msr_fe macro with new M_MSR_FE macro, Víctor Colombo, 2022/04/22
- [PATCH 18/20] target/ppc: Substitute msr_ts macro with new M_MSR_TS macro,
Víctor Colombo <=
- [PATCH 19/20] target/ppc: Substitute msr_hv macro with new M_MSR_HV macro, Víctor Colombo, 2022/04/22
- [PATCH 20/20] target/ppc: Add unused M_MSR_* macros, Víctor Colombo, 2022/04/22
- Re: [PATCH 00/20] target/ppc: Remove hidden usages of *env, Richard Henderson, 2022/04/26