Re: [PATCH] KVM: PPC: booke: check for signals in kvmppc_vcpu_run

Alexander Graf
2011-11-11T15:35:30Z

On 11/11/2011 04:32 PM, Scott Wood wrote:
> On Fri, Nov 11, 2011 at 03:09:17PM +0100, Alexander Graf wrote:
>> On 11/08/2011 11:11 PM, Scott Wood wrote:
>>> Currently we check prior to returning from a lightweight exit,
>>> but not prior to initial entry.
>>>
>>> book3s already does a similar test.
>>>
>>> Signed-off-by: Scott Wood<scottwood@freescale.com>
>>> ---
>>> arch/powerpc/kvm/booke.c | 10 +++++++++-
>>> 1 files changed, 9 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
>>> index b642200..9c78589 100644
>>> --- a/arch/powerpc/kvm/booke.c
>>> +++ b/arch/powerpc/kvm/booke.c
>>> @@ -322,11 +322,19 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
>>> }
>>>
>>> local_irq_disable();
>>> +
>>> + if (signal_pending(current)) {
>> Any reason you're doing this after irq_disable()?
> If we get a signal after the check, we want to be sure that we don't
> receive the reschedule IPI until after we're in the guest, so that it
> will cause another signal check.

Makes sense. So the current book3s implementation is wrong?

Alex