kvm: svm: count all irq windows exit
diff mbox series

Message ID 20120308100756.3984.25343.stgit@amd-6168-8-1.englab.nay.redhat.com
State New, archived
Headers show
Series
  • kvm: svm: count all irq windows exit
Related show

Commit Message

Jason Wang March 8, 2012, 10:07 a.m. UTC
Also count the exits of fast-path.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 arch/x86/kvm/svm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Joerg Roedel March 8, 2012, 10:40 a.m. UTC | #1
On Thu, Mar 08, 2012 at 06:07:56PM +0800, Jason Wang wrote:
> Also count the exits of fast-path.

And align it with how it is counted in VMX.

> Signed-off-by: Jason Wang <jasowang@redhat.com>

Acked-by: Joerg Roedel <joerg.roedel@amd.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 53efd59..5ef7233 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -3235,6 +3235,7 @@ static int interrupt_window_interception(struct vcpu_svm *svm)
>  	svm_clear_vintr(svm);
>  	svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
>  	mark_dirty(svm->vmcb, VMCB_INTR);
> +	++svm->vcpu.stat.irq_window_exits;
>  	/*
>  	 * If the user space waits to inject interrupts, exit as soon as
>  	 * possible
> @@ -3242,7 +3243,6 @@ static int interrupt_window_interception(struct vcpu_svm *svm)
>  	if (!irqchip_in_kernel(svm->vcpu.kvm) &&
>  	    kvm_run->request_interrupt_window &&
>  	    !kvm_cpu_has_interrupt(&svm->vcpu)) {
> -		++svm->vcpu.stat.irq_window_exits;
>  		kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN;
>  		return 0;
>  	}
>
Marcelo Tosatti March 9, 2012, 10:25 p.m. UTC | #2
On Thu, Mar 08, 2012 at 06:07:56PM +0800, Jason Wang wrote:
> Also count the exits of fast-path.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  arch/x86/kvm/svm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 53efd59..5ef7233 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3235,6 +3235,7 @@  static int interrupt_window_interception(struct vcpu_svm *svm)
 	svm_clear_vintr(svm);
 	svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
 	mark_dirty(svm->vmcb, VMCB_INTR);
+	++svm->vcpu.stat.irq_window_exits;
 	/*
 	 * If the user space waits to inject interrupts, exit as soon as
 	 * possible
@@ -3242,7 +3243,6 @@  static int interrupt_window_interception(struct vcpu_svm *svm)
 	if (!irqchip_in_kernel(svm->vcpu.kvm) &&
 	    kvm_run->request_interrupt_window &&
 	    !kvm_cpu_has_interrupt(&svm->vcpu)) {
-		++svm->vcpu.stat.irq_window_exits;
 		kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN;
 		return 0;
 	}