[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 64/74] ppc: convert to cpu_has_work_with_iothread_lock
From: |
Robert Foley |
Subject: |
[PATCH v9 64/74] ppc: convert to cpu_has_work_with_iothread_lock |
Date: |
Thu, 21 May 2020 12:40:01 -0400 |
From: "Emilio G. Cota" <address@hidden>
Soon we will call cpu_has_work without the BQL.
Cc: address@hidden
Reviewed-by: Richard Henderson <address@hidden>
Acked-by: David Gibson <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
[RF: Converted new code related to POWER10]
Signed-off-by: Robert Foley <address@hidden>
---
target/ppc/translate_init.inc.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index e61ba39982..0aeddf3eef 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -8539,6 +8539,8 @@ static bool cpu_has_work_POWER7(CPUState *cs)
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
+ g_assert(qemu_mutex_iothread_locked());
+
if (cpu_halted(cs)) {
if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) {
return false;
@@ -8581,7 +8583,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data)
pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05;
pcc->init_proc = init_proc_POWER7;
pcc->check_pow = check_pow_nocheck;
- cc->has_work = cpu_has_work_POWER7;
+ cc->has_work_with_iothread_lock = cpu_has_work_POWER7;
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
@@ -8701,6 +8703,8 @@ static bool cpu_has_work_POWER8(CPUState *cs)
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
+ g_assert(qemu_mutex_iothread_locked());
+
if (cpu_halted(cs)) {
if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) {
return false;
@@ -8751,7 +8755,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05;
pcc->init_proc = init_proc_POWER8;
pcc->check_pow = check_pow_nocheck;
- cc->has_work = cpu_has_work_POWER8;
+ cc->has_work_with_iothread_lock = cpu_has_work_POWER8;
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
@@ -8901,6 +8905,8 @@ static bool cpu_has_work_POWER9(CPUState *cs)
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
+ g_assert(qemu_mutex_iothread_locked());
+
if (cpu_halted(cs)) {
uint64_t psscr = env->spr[SPR_PSSCR];
@@ -8968,7 +8974,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data)
PCR_COMPAT_2_05;
pcc->init_proc = init_proc_POWER9;
pcc->check_pow = check_pow_nocheck;
- cc->has_work = cpu_has_work_POWER9;
+ cc->has_work_with_iothread_lock = cpu_has_work_POWER9;
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
@@ -9117,6 +9123,7 @@ static bool cpu_has_work_POWER10(CPUState *cs)
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
+ g_assert(qemu_mutex_iothread_locked());
if (cpu_halted(cs)) {
uint64_t psscr = env->spr[SPR_PSSCR];
@@ -9185,7 +9192,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data)
PCR_COMPAT_2_06 | PCR_COMPAT_2_05;
pcc->init_proc = init_proc_POWER10;
pcc->check_pow = check_pow_nocheck;
- cc->has_work = cpu_has_work_POWER10;
+ cc->has_work_with_iothread_lock = cpu_has_work_POWER10;
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
@@ -10655,6 +10662,8 @@ static bool ppc_cpu_has_work(CPUState *cs)
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
+ g_assert(qemu_mutex_iothread_locked());
+
return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD);
}
@@ -10879,7 +10888,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void
*data)
cc->class_by_name = ppc_cpu_class_by_name;
pcc->parent_parse_features = cc->parse_features;
cc->parse_features = ppc_cpu_parse_featurestr;
- cc->has_work = ppc_cpu_has_work;
+ cc->has_work_with_iothread_lock = ppc_cpu_has_work;
cc->do_interrupt = ppc_cpu_do_interrupt;
cc->cpu_exec_interrupt = ppc_cpu_exec_interrupt;
cc->dump_state = ppc_cpu_dump_state;
--
2.17.1
- [PATCH v9 56/74] sparc: convert to cpu_interrupt_request, (continued)
- [PATCH v9 56/74] sparc: convert to cpu_interrupt_request, Robert Foley, 2020/05/21
- [PATCH v9 58/74] unicore32: convert to cpu_interrupt_request, Robert Foley, 2020/05/21
- [PATCH v9 57/74] openrisc: convert to cpu_interrupt_request, Robert Foley, 2020/05/21
- [PATCH v9 54/74] alpha: convert to cpu_interrupt_request, Robert Foley, 2020/05/21
- [PATCH v9 61/74] cpu: convert to interrupt_request, Robert Foley, 2020/05/21
- [PATCH v9 60/74] accel/tcg: convert to cpu_interrupt_request, Robert Foley, 2020/05/21
- [PATCH v9 62/74] cpu: call .cpu_has_work with the CPU lock held, Robert Foley, 2020/05/21
- [PATCH v9 59/74] microblaze: convert to cpu_interrupt_request, Robert Foley, 2020/05/21
- [PATCH v9 63/74] cpu: introduce cpu_has_work_with_iothread_lock, Robert Foley, 2020/05/21
- [PATCH v9 64/74] ppc: convert to cpu_has_work_with_iothread_lock,
Robert Foley <=
- [PATCH v9 65/74] mips: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/05/21
- [PATCH v9 67/74] riscv: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/05/21
- [PATCH v9 66/74] s390x: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/05/21
- [PATCH v9 68/74] sparc: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/05/21
- [PATCH v9 69/74] xtensa: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/05/21
- [PATCH v9 70/74] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle, Robert Foley, 2020/05/21
- [PATCH v9 71/74] cpu: protect CPU state with cpu->lock instead of the BQL, Robert Foley, 2020/05/21
- [PATCH v9 72/74] cpus-common: release BQL earlier in run_on_cpu, Robert Foley, 2020/05/21
- [PATCH v9 73/74] cpu: add async_run_on_cpu_no_bql, Robert Foley, 2020/05/21
- [PATCH v9 74/74] cputlb: queue async flush jobs without the BQL, Robert Foley, 2020/05/21