All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Gleb Natapov <gleb@kernel.org>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: nVMX: Support direct APIC access from L2
Date: Wed, 18 Dec 2013 10:27:31 +0100	[thread overview]
Message-ID: <52B16A83.6050402@redhat.com> (raw)
In-Reply-To: <52AEEA42.7020608@siemens.com>

Il 16/12/2013 12:55, Jan Kiszka ha scritto:
> It's a pathological case, but still a valid one: If L1 disables APIC
> virtualization and also allows L2 to directly write to the APIC page, we
> have to forcibly enable APIC virtualization while in L2 if the in-kernel
> APIC is in use.
> 
> This allows to run the direct interrupt test case in the vmx unit test
> without x2APIC.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  arch/x86/kvm/vmx.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index da04247..7c3ea63 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -7771,6 +7771,11 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
>  			else
>  				vmcs_write64(APIC_ACCESS_ADDR,
>  				  page_to_phys(vmx->nested.apic_access_page));
> +		} else if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) {
> +			exec_control |=
> +				SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
> +			vmcs_write64(APIC_ACCESS_ADDR,
> +				page_to_phys(vcpu->kvm->arch.apic_access_page));
>  		}
>  
>  		vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control);
> 

Applied, thanks.

Paolo

      reply	other threads:[~2013-12-18  9:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 11:55 [PATCH] KVM: nVMX: Support direct APIC access from L2 Jan Kiszka
2013-12-18  9:27 ` Paolo Bonzini [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=52B16A83.6050402@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@kernel.org \
    --cc=jan.kiszka@siemens.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.