public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/2] KVM: x86: Simplify __apic_accept_irq
Date: Thu, 25 Jul 2013 13:44:26 +0300	[thread overview]
Message-ID: <20130725104426.GE22735@redhat.com> (raw)
In-Reply-To: <51F0DAB5.4000704@siemens.com>

On Thu, Jul 25, 2013 at 09:58:45AM +0200, Jan Kiszka wrote:
> If posted interrupts are enabled, we can no longer track if an IRQ was
> coalesced based on IRR. So drop this logic also from the classic
> software path and simplify apic_test_and_set_irr to apic_set_irr.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied both, thanks.

> ---
>  arch/x86/kvm/lapic.c |   23 ++++++++---------------
>  1 files changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index afc1124..9dc3650 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -331,10 +331,10 @@ void kvm_apic_update_irr(struct kvm_vcpu *vcpu, u32 *pir)
>  }
>  EXPORT_SYMBOL_GPL(kvm_apic_update_irr);
>  
> -static inline int apic_test_and_set_irr(int vec, struct kvm_lapic *apic)
> +static inline void apic_set_irr(int vec, struct kvm_lapic *apic)
>  {
>  	apic->irr_pending = true;
> -	return apic_test_and_set_vector(vec, apic->regs + APIC_IRR);
> +	apic_set_vector(vec, apic->regs + APIC_IRR);
>  }
>  
>  static inline int apic_search_irr(struct kvm_lapic *apic)
> @@ -681,28 +681,21 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
>  		if (unlikely(!apic_enabled(apic)))
>  			break;
>  
> +		result = 1;
> +
>  		if (dest_map)
>  			__set_bit(vcpu->vcpu_id, dest_map);
>  
> -		if (kvm_x86_ops->deliver_posted_interrupt) {
> -			result = 1;
> +		if (kvm_x86_ops->deliver_posted_interrupt)
>  			kvm_x86_ops->deliver_posted_interrupt(vcpu, vector);
> -		} else {
> -			result = !apic_test_and_set_irr(vector, apic);
> -
> -			if (!result) {
> -				if (trig_mode)
> -					apic_debug("level trig mode repeatedly "
> -						"for vector %d", vector);
> -				goto out;
> -			}
> +		else {
> +			apic_set_irr(vector, apic);
>  
>  			kvm_make_request(KVM_REQ_EVENT, vcpu);
>  			kvm_vcpu_kick(vcpu);
>  		}
> -out:
>  		trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode,
> -				trig_mode, vector, !result);
> +					  trig_mode, vector, false);
>  		break;
>  
>  	case APIC_DM_REMRD:
> -- 
> 1.7.3.4

--
			Gleb.

      parent reply	other threads:[~2013-07-25 10:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25  7:58 [PATCH 1/2] KVM: x86: Simplify __apic_accept_irq Jan Kiszka
2013-07-25  7:59 ` [PATCH 2/2] KVM: x86: Drop some unused functions from lapic Jan Kiszka
2013-07-25 10:44 ` Gleb Natapov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130725104426.GE22735@redhat.com \
    --to=gleb@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox