diff mbox

No need to kick cpu if not in a guest mode.

Message ID 20090707122732.GG28046@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gleb Natapov July 7, 2009, 12:27 p.m. UTC
This will save a couple of IPIs.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
--
			Gleb.
--
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 7, 2009, 2:56 p.m. UTC | #1
ACK

On Tue, Jul 07, 2009 at 03:27:32PM +0300, Gleb Natapov wrote:
> This will save a couple of IPIs.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index efb0b68..1e30400 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3498,6 +3498,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
>  	smp_mb__after_clear_bit();
>  
>  	if (vcpu->requests || need_resched() || signal_pending(current)) {
> +		set_bit(KVM_REQ_KICK, &vcpu->requests);
>  		local_irq_enable();
>  		preempt_enable();
>  		r = 1;
> --
> 			Gleb.
--
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
Avi Kivity July 7, 2009, 3:39 p.m. UTC | #2
On 07/07/2009 03:27 PM, Gleb Natapov wrote:
> This will save a couple of IPIs.
>
>    

Applied, thanks.
diff mbox

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index efb0b68..1e30400 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3498,6 +3498,7 @@  static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	smp_mb__after_clear_bit();
 
 	if (vcpu->requests || need_resched() || signal_pending(current)) {
+		set_bit(KVM_REQ_KICK, &vcpu->requests);
 		local_irq_enable();
 		preempt_enable();
 		r = 1;