Re: [PATCH 3/6] KVM: PPC: booke: Check for MSR[WE] in prepare_to_enter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/14/2011 12:01 PM, Alexander Graf wrote:
> 
> On 14.11.2011, at 18:22, Scott Wood <scottwood@xxxxxxxxxxxxx> wrote:
> 
>> kvmppc_core_check_exceptions can clear MSR_WE, so we need to check after
>> that.  We can't enable interrupts after kvmppc_core_check_exceptions (or
>> rather, if we do, we need to check again once interrupts are
>> re-disabled, as in the MSR_WE case) because otherwise we could have an
>> exception delivered afterward and receive the resched IPI at just the
>> wrong time to take any action on it (just like the signal check).
> 
> Well, but if you enable interrupts here you're basically rendering code that runs earlier in disabled-interrupt mode racy.

That's why once we wake, we disable interrupts and check again.

> How does this align with the signal handling? We could receive a signal here and not handle it the same as the race you fixed earlier, no?

Signals are checked by the caller after calling prepare_to_enter.

Moving the check into prepare_to_enter wouldn't buy us much since the
method of returning is different, and so there'd still need to be code
in the caller to deal with it.

-Scott

--
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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux