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 2/5]KVM:x86, apicv: adjust for virtual interrupt delivery
Date: Wed, 19 Sep 2012 17:53:23 +0300 [thread overview]
Message-ID: <5059DC63.4010002@redhat.com> (raw)
In-Reply-To: <D9137FCD9CFF644B965863BCFBEDABB8781AD3@SHSMSX101.ccr.corp.intel.com>
On 09/14/2012 05:15 PM, Li, Jiongxi wrote:
>
>>
>> > @@ -5293,16 +5300,27 @@ static int vcpu_enter_guest(struct kvm_vcpu
>> *vcpu)
>> > }
>> >
>> > if (kvm_check_request(KVM_REQ_EVENT, vcpu) || req_int_win) {
>> > + /* update archtecture specific hints for APIC virtual interrupt delivery
>> */
>> > + if (kvm_apic_vid_enabled(vcpu))
>> > + kvm_x86_ops->update_irq(vcpu);
>> > +
>>
>> Not defined.
> This function is defined in patch 3/5. Because virtual interrupt delivery is not enabled in this patch. So this function is not called. Since we will enable this feature by default, so maybe we can merge PATCH 2,3,4 together into one patch.
That will make it hard to review. You might try to build the eoi exit
bitmap in the first patch, and do the rest (including posted interrupts)
in a following patch. If you can split it further, it will be helpful.
>>
>> > inject_pending_event(vcpu);
>> >
>> > /* enable NMI/IRQ window open exits if needed */
>> > if (vcpu->arch.nmi_pending)
>> > kvm_x86_ops->enable_nmi_window(vcpu);
>> > - else if (kvm_cpu_has_interrupt(vcpu) || req_int_win)
>> > + else if (kvm_apic_vid_enabled(vcpu)) {
>> > + if (kvm_cpu_has_interrupt_apic_vid(vcpu))
>> > + kvm_x86_ops->enable_irq_window(vcpu);
>> > + } else if (kvm_cpu_has_interrupt(vcpu) || req_int_win)
>> > kvm_x86_ops->enable_irq_window(vcpu);
>> >
>> > if (kvm_lapic_enabled(vcpu)) {
>> > - update_cr8_intercept(vcpu);
>> > + /* no need for tpr_threshold update if APIC virtual
>> > + * interrupt delivery is enabled
>> > + */
>> > + if (!kvm_apic_vid_enabled(vcpu))
>> > + update_cr8_intercept(vcpu);
>>
>> Perhaps the arch function should do the ignoring.
> You means putting the 'vid_enabled' judgement in 'kvm_x86_ops->update_cr8_intercept'? Is it just out of the reason that reducing the code change in common code?
One option is to replace all the code above with
kvm_x86_ops->update_irq()
where
static void vmx_update_irq()
{
if (vid) {
... do vid stuff ...
} else
kvm_process_interrupt_queue(); // all the non-vid code above,
in a function
}
So instead of kvm_apic_vid_enabled() scattered throughout the code we
have just one check. svm_update_irq() can just call
kvm_process_interrupt_queue() and work as before, and later we can add
the AVIC code (the svm equivalent of APIC-V).
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-09-19 14:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 5:41 [PATCH 2/5]KVM:x86, apicv: adjust for virtual interrupt delivery Li, Jiongxi
2012-09-06 16:22 ` Avi Kivity
2012-09-14 14:15 ` Li, Jiongxi
2012-09-19 14:53 ` Avi Kivity [this message]
2012-09-17 11:28 ` Li, Jiongxi
2012-09-19 15:19 ` Avi Kivity
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=5059DC63.4010002@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.