public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Li, Jiongxi" <jiongxi.li@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 4/5]KVM:x86, apicv: add interface for poking EOI exit bitmap
Date: Wed, 19 Sep 2012 17:45:01 +0300	[thread overview]
Message-ID: <5059DA6D.4090908@redhat.com> (raw)
In-Reply-To: <D9137FCD9CFF644B965863BCFBEDABB8782E64@SHSMSX101.ccr.corp.intel.com>

On 09/17/2012 02:28 PM, Li, Jiongxi wrote:
>> > +++ b/arch/x86/kvm/lapic.c
>> > @@ -499,8 +499,13 @@ static int __apic_accept_irq(struct kvm_lapic *apic,
>> int delivery_mode,
>> >  		if (trig_mode) {
>> >  			apic_debug("level trig mode for vector %d", vector);
>> >  			apic_set_vector(vector, apic->regs + APIC_TMR);
>> > -		} else
>> > +			if (kvm_apic_vid_enabled(vcpu))
>> > +				kvm_x86_ops->set_eoi_exitmap(vcpu, vector, 1);
>> > +		} else {
>> >  			apic_clear_vector(vector, apic->regs + APIC_TMR);
>> > +			if (kvm_apic_vid_enabled(vcpu))
>> > +				kvm_x86_ops->set_eoi_exitmap(vcpu, vector, 0);
>> > +		}
>> 
>> This is way too late.  The flow should come from the IOAPIC and PIC, when
>> setting up an irq, to the local APIC.
>> 
> I just wonder why you think it is too late to do that. Out of the reason
> that If post interrupt is enabled, here won't be called?

That was not the reason, but it is true as well.  With posted interrupts
this path is bypassed completely.

> Or because we
> can't set eoi bitmap for PIT here just according to TMR and needs to set
> it in a place where can recognize the PIT vector?

Yes.  When we register an irq ack notifier we know the gsi and therefore
the vector, and can update the eoi exit bitmap accordingly.  This works
with posted interrupts as well.  Note we have to rebuild the table when
the ioapic redirection bitmap is updated (or the PIC irq base, or ELCR
change, etc.)

-- 
error compiling committee.c: too many arguments to function

      reply	other threads:[~2012-09-19 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05  5:41 [PATCH 4/5]KVM:x86, apicv: add interface for poking EOI exit bitmap Li, Jiongxi
2012-09-06 16:37 ` Avi Kivity
2012-09-14 14:19   ` Li, Jiongxi
2012-09-16  9:53     ` Avi Kivity
2012-09-17 11:28   ` Li, Jiongxi
2012-09-19 14:45     ` Avi Kivity [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=5059DA6D.4090908@redhat.com \
    --to=avi@redhat.com \
    --cc=jiongxi.li@intel.com \
    --cc=kvm@vger.kernel.org \
    /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