diff mbox

KVM: VMX: Fix locking imbalance on emulation failure

Message ID 4A657F9B.1090305@siemens.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka July 21, 2009, 8:43 a.m. UTC
We have to disable preemption and IRQs on every exit from
handle_invalid_guest_state, otherwise we generate at least a
preempt_disable imbalance.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 arch/x86/kvm/vmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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

Comments

Marcelo Tosatti July 21, 2009, 5:35 p.m. UTC | #1
On Tue, Jul 21, 2009 at 10:43:07AM +0200, Jan Kiszka wrote:
> We have to disable preemption and IRQs on every exit from
> handle_invalid_guest_state, otherwise we generate at least a
> preempt_disable imbalance.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
>  arch/x86/kvm/vmx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 3a75db3..7a8d464 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3335,7 +3335,7 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
>  
>  		if (err != EMULATE_DONE) {
>  			kvm_report_emulation_failure(vcpu, "emulation failure");
> -			return;
> +			break;
>  		}
>  
>  		if (signal_pending(current))

Applied, thanks.

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

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 3a75db3..7a8d464 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3335,7 +3335,7 @@  static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
 
 		if (err != EMULATE_DONE) {
 			kvm_report_emulation_failure(vcpu, "emulation failure");
-			return;
+			break;
 		}
 
 		if (signal_pending(current))