[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v3 29/56] arm: convert to cpu_interrupt_request
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [RFC v3 29/56] arm: convert to cpu_interrupt_request |
Date: |
Sun, 21 Oct 2018 14:21:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 10/19/18 2:05 AM, Emilio G. Cota wrote:
> +++ b/target/arm/helper.c
> @@ -1295,12 +1295,14 @@ static uint64_t isr_read(CPUARMState *env, const
> ARMCPRegInfo *ri)
> CPUState *cs = ENV_GET_CPU(env);
> uint64_t ret = 0;
>
> - if (cs->interrupt_request & CPU_INTERRUPT_HARD) {
> + cpu_mutex_lock(cs);
> + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) {
> ret |= CPSR_I;
> }
> - if (cs->interrupt_request & CPU_INTERRUPT_FIQ) {
> + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_FIQ) {
> ret |= CPSR_F;
> }
> + cpu_mutex_unlock(cs);
> /* External aborts are not possible in QEMU so A bit is always clear */
> return ret;
> }
I think simply reading cpu_interrupt_request once into a local variable is
better, and no need for extra locking then.
Otherwise,
Reviewed-by: Richard Henderson <address@hidden>
r~
- Re: [Qemu-devel] [RFC v3 48/56] ppc: acquire the BQL in cpu_has_work, (continued)
[Qemu-devel] [RFC v3 50/56] s390: acquire the BQL in cpu_has_work, Emilio G. Cota, 2018/10/18
[Qemu-devel] [RFC v3 39/56] s390x: convert to cpu_interrupt_request, Emilio G. Cota, 2018/10/18
[Qemu-devel] [RFC v3 27/56] s390x: use cpu_reset_interrupt, Emilio G. Cota, 2018/10/18
[Qemu-devel] [RFC v3 55/56] cpu: add async_run_on_cpu_no_bql, Emilio G. Cota, 2018/10/18
[Qemu-devel] [RFC v3 56/56] cputlb: queue async flush jobs without the BQL, Emilio G. Cota, 2018/10/18
[Qemu-devel] [RFC v3 29/56] arm: convert to cpu_interrupt_request, Emilio G. Cota, 2018/10/18
- Re: [Qemu-devel] [RFC v3 29/56] arm: convert to cpu_interrupt_request,
Richard Henderson <=
[Qemu-devel] [RFC v3 54/56] cpu: protect most CPU state with cpu->lock, Emilio G. Cota, 2018/10/18
[Qemu-devel] [RFC v3 53/56] xtensa: acquire the BQL in cpu_has_work, Emilio G. Cota, 2018/10/18
Re: [Qemu-devel] [RFC v3 0/56] per-CPU locks, Paolo Bonzini, 2018/10/19