On Sat, 8 Aug 2020 at 08:00, Paolo Bonzini <pbonz...@redhat.com> wrote: > > We are thinking that 2) would be a good option. > > Yes, it is. The only slight complication is that you'd have both > ->do_interrupt and ->do_interrupt_locked so you probably should add some > consistency check, for example > > /* > * cc->do_interrupt_locked should only be needed if > * the class uses cpu_common_do_interrupt. > */ > assert(cc->do_interrupt == cpu_common_do_interrupt || > !cc->do_interrupt_locked); > > Therefore, a variant is to add ->do_interrupt_locked to ARMCPUClass and > CRISCPUClass (target/avr/helper.c can just call > avr_cpu_do_interrupt_locked, because that's the only value that > cc->do_interrupt can have). Then ARM and CRIS can have a do_interrupt > like you wrote above: > > void arm_do_interrupt(CPUState *cs) > { > ARMCPUClass *acc = ARM_CPU_GET_CLASS(cs); > qemu_mutex_lock_iothread(); > acc->do_interrupt_locked(cpu); > qemu_mutex_unlock_iothread(); > } > > with a small duplication between ARM and CRIS but on the other hand a > simpler definition of the common CPUClass.
Thanks for all the details! It sounds like a good approach and we will move forward with it. Thanks & Regards, -Rob > > Paolo >