* Re: [PATCH] KVM: VMX: Leave atomic context while emulating real mode
[not found] <20080820140100.07333250A43@il.qumranet.com>
@ 2008-09-10 14:12 ` Laurent Vivier
2008-09-10 14:57 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2008-09-10 14:12 UTC (permalink / raw)
To: Avi Kivity; +Cc: KVM
Le mercredi 20 août 2008 à 14:01 +0000, Avi Kivity a écrit :
> From: Avi Kivity <avi@qumranet.com>
>
> Emulation requires access to user memory, and potentially schedules.
>
> Signed-off-by: Avi Kivity <avi@qumranet.com>
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index d5d25a2..81c121c 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -2911,6 +2911,9 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
> struct vcpu_vmx *vmx = to_vmx(vcpu);
> int err;
>
> + preempt_enable();
> + local_irq_enable();
> +
> while (!guest_state_valid(vcpu)) {
> err = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
>
> @@ -2932,6 +2935,9 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
> schedule();
> }
>
> + local_irq_disable();
> + preempt_enable();
should be a preempt_disable() ?
> /* Guest state should be valid now, no more emulation should be needed */
> vmx->emulation_required = 0;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
----------------- Laurent.Vivier@bull.net ------------------
"La perfection est atteinte non quand il ne reste rien à
ajouter mais quand il ne reste rien à enlever." Saint Exupéry
^ permalink raw reply [flat|nested] 2+ messages in thread