From: Gleb Natapov <gleb@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
"Nakajima, Jun" <jun.nakajima@intel.com>,
"Ren, Yongjie" <yongjie.ren@intel.com>
Subject: Re: [PATCH] KVM: x86: Check KVM_REQ_IMMEDIATE_EXIT after enable_irq_window
Date: Sun, 28 Apr 2013 11:29:51 +0300 [thread overview]
Message-ID: <20130428082951.GD30504@redhat.com> (raw)
In-Reply-To: <517CCE8E.6010805@web.de>
On Sun, Apr 28, 2013 at 09:23:58AM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> The VMX implementation of enable_irq_window will raise
> KVM_REQ_IMMEDIATE_EXIT if an interrupt window shall be opened during
> nested vmrun. We have to transfer this request into the local variable
> to avoid looping over a continuously re-asserted request on vmentry.
>
> This issue only affects nested VMX scenarios.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
So KVM_REQ_IMMEDIATE_EXIT does not behave like request bit should. What
about dropping it and letting enable_irq_window() return true if
immediate exit is needed.
> ---
> arch/x86/kvm/x86.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 2a434bf..57ff14a 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -5759,6 +5759,9 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
> else if (kvm_cpu_has_injectable_intr(vcpu) || req_int_win)
> kvm_x86_ops->enable_irq_window(vcpu);
>
> + req_immediate_exit =
> + kvm_check_request(KVM_REQ_IMMEDIATE_EXIT, vcpu);
> +
The code will become:
req_immediate_exit = kvm_x86_ops->enable_irq_window(vcpu);
> if (kvm_lapic_enabled(vcpu)) {
> /*
> * Update architecture specific hints for APIC
> --
> 1.7.3.4
--
Gleb.
next prev parent reply other threads:[~2013-04-28 8:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-28 7:23 [PATCH] KVM: x86: Check KVM_REQ_IMMEDIATE_EXIT after enable_irq_window Jan Kiszka
2013-04-28 8:29 ` Gleb Natapov [this message]
2013-04-28 8:50 ` [PATCH] KVM: x86: Rework request for immediate exit Jan Kiszka
2013-05-03 1:20 ` Marcelo Tosatti
2013-05-03 5:33 ` Gleb Natapov
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=20130428082951.GD30504@redhat.com \
--to=gleb@redhat.com \
--cc=jan.kiszka@web.de \
--cc=jun.nakajima@intel.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=yongjie.ren@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox