On 08.01.2012, at 14:18, Avi Kivity wrote:

> On 01/04/2012 03:10 AM, Alexander Graf wrote:
>> From: Scott Wood <scottw...@freescale.com>
>> 
>> 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 <scottw...@freescale.com>
>> Signed-off-by: Alexander Graf <ag...@suse.de>
>> ---
>> 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)) {
>> +            kvm_run->exit_reason = KVM_EXIT_INTR;
>> +            ret = -EINTR;
>> +            goto out;
>> +    }
>> +
>>      kvm_guest_enter();
>>      ret = __kvmppc_vcpu_run(kvm_run, vcpu);
>>      kvm_guest_exit();
>> -    local_irq_enable();
>> 
>> 
> 
> In general a single check prior to entry is sufficient (well, in
> addition to the one in kvm_vcpu_block()).

Yes, and IIUC this is the single check prior to entry. On lightweight exit, we 
don't return from __kvmppc_vcpu_run, but only call kvmppc_handle_exit() and if 
that exits that we return to the guest, we stay inside of __kvmppc_vcpu_run and 
don't return from here.


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to