Message ID | 20180917163103.6113-22-cota@braap.org |
---|---|
State | New |
Headers | show |
Series | exec: drop BQL from interrupt handling | expand |
On 9/17/18 6:30 PM, Emilio G. Cota wrote: > From: Paolo Bonzini <pbonzini@redhat.com> > > Cc: Stafford Horne <shorne@gmail.com> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > Signed-off-by: Emilio G. Cota <cota@braap.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > hw/openrisc/cputimer.c | 2 +- > target/openrisc/cpu.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c > index 850f88761c..4d1b638025 100644 > --- a/hw/openrisc/cputimer.c > +++ b/hw/openrisc/cputimer.c > @@ -102,7 +102,7 @@ static void openrisc_timer_cb(void *opaque) > CPUState *cs = CPU(cpu); > > cpu->env.ttmr |= TTMR_IP; > - cs->interrupt_request |= CPU_INTERRUPT_TIMER; > + atomic_or(&cs->interrupt_request, CPU_INTERRUPT_TIMER); > } > > switch (cpu->env.ttmr & TTMR_M) { > diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c > index fb7cb5c507..269c947f05 100644 > --- a/target/openrisc/cpu.c > +++ b/target/openrisc/cpu.c > @@ -32,8 +32,8 @@ static void openrisc_cpu_set_pc(CPUState *cs, vaddr value) > > static bool openrisc_cpu_has_work(CPUState *cs) > { > - return cs->interrupt_request & (CPU_INTERRUPT_HARD | > - CPU_INTERRUPT_TIMER); > + return atomic_read(&cs->interrupt_request) & (CPU_INTERRUPT_HARD | > + CPU_INTERRUPT_TIMER); > } > > static void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info) >
diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c index 850f88761c..4d1b638025 100644 --- a/hw/openrisc/cputimer.c +++ b/hw/openrisc/cputimer.c @@ -102,7 +102,7 @@ static void openrisc_timer_cb(void *opaque) CPUState *cs = CPU(cpu); cpu->env.ttmr |= TTMR_IP; - cs->interrupt_request |= CPU_INTERRUPT_TIMER; + atomic_or(&cs->interrupt_request, CPU_INTERRUPT_TIMER); } switch (cpu->env.ttmr & TTMR_M) { diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index fb7cb5c507..269c947f05 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -32,8 +32,8 @@ static void openrisc_cpu_set_pc(CPUState *cs, vaddr value) static bool openrisc_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & (CPU_INTERRUPT_HARD | - CPU_INTERRUPT_TIMER); + return atomic_read(&cs->interrupt_request) & (CPU_INTERRUPT_HARD | + CPU_INTERRUPT_TIMER); } static void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info)