public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: SVM: Always clear interrupt shadow in skip_emulated_instruction
@ 2010-02-16  9:46 Jan Kiszka
  2010-02-16 10:04 ` Gleb Natapov
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-02-16  9:46 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Gleb Natapov

emulate_instruction(EMULTYPE_SKIP) does not clear the shadow (only full
emulation does), so we have to do this here.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 arch/x86/kvm/svm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 52f78dd..84c838d 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -282,6 +282,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
 {
 	struct vcpu_svm *svm = to_svm(vcpu);
 
+	svm_set_interrupt_shadow(vcpu, 0);
 	if (!svm->next_rip) {
 		if (emulate_instruction(vcpu, 0, 0, EMULTYPE_SKIP) !=
 				EMULATE_DONE)
@@ -293,7 +294,6 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
 		       __func__, kvm_rip_read(vcpu), svm->next_rip);
 
 	kvm_rip_write(vcpu, svm->next_rip);
-	svm_set_interrupt_shadow(vcpu, 0);
 }
 
 static int has_svm(void)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: SVM: Always clear interrupt shadow in skip_emulated_instruction
  2010-02-16  9:46 [PATCH] KVM: SVM: Always clear interrupt shadow in skip_emulated_instruction Jan Kiszka
@ 2010-02-16 10:04 ` Gleb Natapov
  0 siblings, 0 replies; 2+ messages in thread
From: Gleb Natapov @ 2010-02-16 10:04 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Avi Kivity, Marcelo Tosatti, kvm

On Tue, Feb 16, 2010 at 10:46:31AM +0100, Jan Kiszka wrote:
> emulate_instruction(EMULTYPE_SKIP) does not clear the shadow (only full
> emulation does), so we have to do this here.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Obviously correct.

> ---
>  arch/x86/kvm/svm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 52f78dd..84c838d 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -282,6 +282,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
>  {
>  	struct vcpu_svm *svm = to_svm(vcpu);
>  
> +	svm_set_interrupt_shadow(vcpu, 0);
>  	if (!svm->next_rip) {
>  		if (emulate_instruction(vcpu, 0, 0, EMULTYPE_SKIP) !=
>  				EMULATE_DONE)
> @@ -293,7 +294,6 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
>  		       __func__, kvm_rip_read(vcpu), svm->next_rip);
>  
>  	kvm_rip_write(vcpu, svm->next_rip);
> -	svm_set_interrupt_shadow(vcpu, 0);
>  }
>  
>  static int has_svm(void)

--
			Gleb.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-16 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-16  9:46 [PATCH] KVM: SVM: Always clear interrupt shadow in skip_emulated_instruction Jan Kiszka
2010-02-16 10:04 ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox