On 07/03/2012 04:49 PM, Peter Maydell wrote: > On 3 July 2012 14:24, Avi Kivity <avi@xxxxxxxxxx> wrote: >> On 07/03/2012 04:14 PM, Peter Maydell wrote: >>> You could just always wake the cpu when migrating: the >>> architecture allows WFI to return early for any reason >>> it likes including implementation convenience. >> >> Seems reasonable. >> >> I imagine wfi works with interrupts disabled, unlike the x86 silliness? > > Not sure exactly which bit of x86 silliness you're referring > to, but WFI will wake up regardless of the interrupt mask > bits in the CPSR. (If you've disabled interrupts in the GIC > that's your own bad lookout I guess.) On x86 HLT respects the interrupt enable flag, so to avoid races, you have to use a feature of STI (enable interrupts instruction) that only enables interrupts after another instruction has executed. So the sequence STI; HLT atomically enables interrupts and waits for one (as long as HLT didn't trigger an exception like a page fault). The problem is that this "interrupt shadow" has to be tracked by virtualization hardware, live migration, instruction emulation, etc. It interacts with non-maskable interrupts as well. A horrible hack. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html