[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 38/73] arm: convert to cpu_interrupt_request
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH v5 38/73] arm: convert to cpu_interrupt_request |
Date: |
Thu, 13 Dec 2018 00:04:18 -0500 |
Cc: Peter Maydell <address@hidden>
Cc: address@hidden
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
---
target/arm/cpu.c | 6 +++---
target/arm/helper.c | 16 +++++++---------
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 8baa5bb891..738b80944c 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -49,7 +49,7 @@ static bool arm_cpu_has_work(CPUState *cs)
ARMCPU *cpu = ARM_CPU(cs);
return (cpu->power_state != PSCI_OFF)
- && cs->interrupt_request &
+ && cpu_interrupt_request(cs) &
(CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD
| CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ
| CPU_INTERRUPT_EXITTB);
@@ -448,7 +448,7 @@ void arm_cpu_update_virq(ARMCPU *cpu)
bool new_state = (env->cp15.hcr_el2 & HCR_VI) ||
(env->irq_line_state & CPU_INTERRUPT_VIRQ);
- if (new_state != ((cs->interrupt_request & CPU_INTERRUPT_VIRQ) != 0)) {
+ if (new_state != ((cpu_interrupt_request(cs) & CPU_INTERRUPT_VIRQ) != 0)) {
if (new_state) {
cpu_interrupt(cs, CPU_INTERRUPT_VIRQ);
} else {
@@ -469,7 +469,7 @@ void arm_cpu_update_vfiq(ARMCPU *cpu)
bool new_state = (env->cp15.hcr_el2 & HCR_VF) ||
(env->irq_line_state & CPU_INTERRUPT_VFIQ);
- if (new_state != ((cs->interrupt_request & CPU_INTERRUPT_VFIQ) != 0)) {
+ if (new_state != ((cpu_interrupt_request(cs) & CPU_INTERRUPT_VFIQ) != 0)) {
if (new_state) {
cpu_interrupt(cs, CPU_INTERRUPT_VFIQ);
} else {
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 0da1424f72..8c9b1210b2 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -1328,23 +1328,24 @@ static uint64_t isr_read(CPUARMState *env, const
ARMCPRegInfo *ri)
{
CPUState *cs = ENV_GET_CPU(env);
uint64_t ret = 0;
+ uint32_t interrupt_request = cpu_interrupt_request(cs);
if (arm_hcr_el2_imo(env)) {
- if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) {
+ if (interrupt_request & CPU_INTERRUPT_VIRQ) {
ret |= CPSR_I;
}
} else {
- if (cs->interrupt_request & CPU_INTERRUPT_HARD) {
+ if (interrupt_request & CPU_INTERRUPT_HARD) {
ret |= CPSR_I;
}
}
if (arm_hcr_el2_fmo(env)) {
- if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) {
+ if (interrupt_request & CPU_INTERRUPT_VFIQ) {
ret |= CPSR_F;
}
} else {
- if (cs->interrupt_request & CPU_INTERRUPT_FIQ) {
+ if (interrupt_request & CPU_INTERRUPT_FIQ) {
ret |= CPSR_F;
}
}
@@ -8693,10 +8694,7 @@ void arm_cpu_do_interrupt(CPUState *cs)
return;
}
- /* Hooks may change global state so BQL should be held, also the
- * BQL needs to be held for any modification of
- * cs->interrupt_request.
- */
+ /* Hooks may change global state so BQL should be held */
g_assert(qemu_mutex_iothread_locked());
arm_call_pre_el_change_hook(cpu);
@@ -8711,7 +8709,7 @@ void arm_cpu_do_interrupt(CPUState *cs)
arm_call_el_change_hook(cpu);
if (!kvm_enabled()) {
- cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
+ cpu_interrupt_request_or(cs, CPU_INTERRUPT_EXITTB);
}
}
--
2.17.1
- Re: [Qemu-devel] [PATCH v5 55/73] sparc: convert to cpu_interrupt_request, (continued)
- [Qemu-devel] [PATCH v5 51/73] nios: convert to cpu_interrupt_request, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 71/73] cpus-common: release BQL earlier in run_on_cpu, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 73/73] cputlb: queue async flush jobs without the BQL, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 17/73] arm: convert to cpu_halted, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 57/73] unicore32: convert to cpu_interrupt_request, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 61/73] cpu: call .cpu_has_work with the CPU lock held, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 67/73] sparc: convert to cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 38/73] arm: convert to cpu_interrupt_request,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v5 47/73] hppa: convert to cpu_interrupt_request, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 62/73] cpu: introduce cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 59/73] accel/tcg: convert to cpu_interrupt_request, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 64/73] mips: convert to cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 25/73] s390x: convert to cpu_halted, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 44/73] ppc: convert to cpu_interrupt_request, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 68/73] xtensa: convert to cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 52/73] s390x: convert to cpu_interrupt_request, Emilio G. Cota, 2018/12/13
- [Qemu-devel] [PATCH v5 63/73] ppc: convert to cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/12/13