From: Avi Kivity <avi@redhat.com>
To: "Nadav Har'El" <nyh@il.ibm.com>
Cc: kvm@vger.kernel.org, Dave Allan <dallan@redhat.com>,
Federico Simoncelli <fsimonce@redhat.com>,
Abel Gordon <abelg@il.ibm.com>
Subject: Re: [PATCH] nVMX: Fix warning-causing idt-vectoring-info behavior
Date: Wed, 21 Sep 2011 14:45:47 +0300 [thread overview]
Message-ID: <4E79CE6B.4070305@redhat.com> (raw)
In-Reply-To: <201109211048.p8LAmDG5016952@rice.haifa.ibm.com>
On 09/21/2011 01:48 PM, Nadav Har'El wrote:
> This patch solves two outstanding nested-VMX issues:
<snip>
Sorry, I missed an important point on the first review.
> --- .before/arch/x86/kvm/vmx.c 2011-09-21 13:45:59.000000000 +0300
> +++ .after/arch/x86/kvm/vmx.c 2011-09-21 13:45:59.000000000 +0300
> @@ -3858,12 +3858,17 @@ static bool nested_exit_on_intr(struct k
> static void enable_irq_window(struct kvm_vcpu *vcpu)
> {
> u32 cpu_based_vm_exec_control;
> - if (is_guest_mode(vcpu)&& nested_exit_on_intr(vcpu))
> - /* We can get here when nested_run_pending caused
> - * vmx_interrupt_allowed() to return false. In this case, do
> - * nothing - the interrupt will be injected later.
> + if (is_guest_mode(vcpu)&& nested_exit_on_intr(vcpu)) {
> + /*
> + * We get here if vmx_interrupt_allowed() returned 0 because
> + * we must enter L2 now, so we can't inject to L1 now. If we
> + * just do nothing, L2 will later exit and we can inject the
> + * IRQ to L1 then. But to make L2 exit more promptly, we send
> + * a self-IPI, causing L2 to exit right after entry.
> */
> + smp_send_reschedule(vcpu->cpu);
> return;
> + }
->enable_irq_window() is called with interrupts enabled, so the self-IPI
will be dispatched immediately and be lost.
The way to handle it is to kvm_make_request(KVM_REQ_IMMEDIATE_EXIT)
here, and to add code to vcpu_enter_guest() to sample this into a local
variable, and, after disabling interrupts, do the self-IPI.
A unit test would have caught this...
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2011-09-21 11:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 10:48 [PATCH] nVMX: Fix warning-causing idt-vectoring-info behavior Nadav Har'El
2011-09-21 11: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=4E79CE6B.4070305@redhat.com \
--to=avi@redhat.com \
--cc=abelg@il.ibm.com \
--cc=dallan@redhat.com \
--cc=fsimonce@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=nyh@il.ibm.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 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.