All of lore.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 3/5]KVM:x86, apicv: enable virtual interrupt delivery for VMX
Date: Thu, 06 Sep 2012 19:29:44 +0300	[thread overview]
Message-ID: <5048CF78.5080807@redhat.com> (raw)
In-Reply-To: <D9137FCD9CFF644B965863BCFBEDABB877AC75@SHSMSX101.ccr.corp.intel.com>

On 09/05/2012 08:41 AM, Li, Jiongxi wrote:
> - before returning to guest, RVI should be updated if any pending IRRs

process pending interrupts does that for you, so you only need this with
KVM_SET_APIC.

> - EOI exit bitmap controls whether an EOI write should cause VM-Exit.
>   if set, a trap-like induced EOI VM-Exit is triggered. Keep all the
>   bitmaps cleared for now, which should be enough to allow a MSI based
>   device passthrough

What about level-triggered interrupts, or interrupts which have ack
notifiers set?

>  
> -static void apic_send_ipi(struct kvm_lapic *apic)
> +/*
> + * this interface assumes a trap-like exit, which has already finished
> + * desired side effect including vISR and vPPR update.
> + */
> +void kvm_apic_set_eoi(struct kvm_vcpu *vcpu, int vector)
> +{
> +	struct kvm_lapic *apic = vcpu->arch.apic;
> +	int trigger_mode;
> +
> +	if (apic_test_and_clear_vector(vector, apic->regs + APIC_TMR))
> +		trigger_mode = IOAPIC_LEVEL_TRIG;
> +	else
> +		trigger_mode = IOAPIC_EDGE_TRIG;
> +
> +	if (!(apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI))
> +		kvm_ioapic_update_eoi(apic->vcpu->kvm, vector, trigger_mode);
> +	kvm_make_request(KVM_REQ_EVENT, apic->vcpu);
> +}
> +EXPORT_SYMBOL_GPL(kvm_apic_set_eoi);

What's the difference between this and apic_set_eoi()?

> +
> + static void apic_send_ipi(struct kvm_lapic *apic)

Extra space added.

>  /*
>   * If nested=1, nested virtualization is supported, i.e., guests may use
>   * VMX and be a hypervisor for its own guests. If nested=0, guests may not
> @@ -430,6 +433,8 @@ struct vcpu_vmx {
>  
>  	bool rdtscp_enabled;
>  
> +	u64 eoi_exit_bitmap[4];
> +

Unused?

>  
> @@ -3876,6 +3894,15 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
>  				vmx_secondary_exec_control(vmx));
>  	}
>  
> +	if (enable_apicv_vid) {
> +		vmcs_write64(EOI_EXIT_BITMAP0, 0);
> +		vmcs_write64(EOI_EXIT_BITMAP1, 0);
> +		vmcs_write64(EOI_EXIT_BITMAP2, 0);
> +		vmcs_write64(EOI_EXIT_BITMAP3, 0);
> +
> +		vmcs_write16(GUEST_INTR_STATUS, 0);

Need to update GUEST_INTR_STATUS after live migration (or perhaps also
when enabling the APIC?)



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

  reply	other threads:[~2012-09-06 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05  5:41 [PATCH 3/5]KVM:x86, apicv: enable virtual interrupt delivery for VMX Li, Jiongxi
2012-09-06 16:29 ` Avi Kivity [this message]
2012-09-14 14:17   ` Li, Jiongxi
2012-09-16  9:45     ` 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=5048CF78.5080807@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.