On Sun, 5 Jul 2020 at 21:54, Max Filippov <jcmvb...@gmail.com> wrote: > > On Sun, Jul 5, 2020 at 11:16 AM Max Filippov <jcmvb...@gmail.com> wrote: > > On Sun, Jul 5, 2020 at 10:09 AM Peter Maydell <peter.mayd...@linaro.org> > > wrote: > > > On Thu, 2 Jul 2020 at 19:53, Richard Henderson > > > <richard.hender...@linaro.org> wrote: > > > > This isn't right. Not so much the gen_io_start portion, but the entire > > > > existence of helper_check_interrupt. > > > I agree that it looks bogus (xtensa has a similar helper as well, > > > incidentally), > > I think there was a reason for it. > > ...and the reason is that this helper calls cpu_[re]set_interrupt > to update CPU_INTERRUPT_HARD, which makes exit to the > main CPU loop do something to handle IRQ. > Maybe 'check_interrupt' is not a good name for that, but the > action taken there seems right to me.
Usually I would expect that CPU_INTERRUPT_HARD would be set by whatever was setting the interrupt (often a handler for an inbound qemu_irq line to the CPU). Then the cpu_exec_interrupt hook only actually does something if both the INTERRUPT_HARD bit is set and the CPU register says "and interrupts are unmasked". If you have a design like that then "unmasking interrupts just means going out to the main loop" will work. thanks -- PMM