From patchwork Sun Apr 28 07:23:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 2497971 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 39DF6DF2E5 for ; Sun, 28 Apr 2013 07:24:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751462Ab3D1HYE (ORCPT ); Sun, 28 Apr 2013 03:24:04 -0400 Received: from mout.web.de ([212.227.17.11]:49796 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151Ab3D1HYD (ORCPT ); Sun, 28 Apr 2013 03:24:03 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.56.37]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0M7sw0-1UjMZr0yBs-00vene; Sun, 28 Apr 2013 09:23:59 +0200 Message-ID: <517CCE8E.6010805@web.de> Date: Sun, 28 Apr 2013 09:23:58 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Gleb Natapov , Marcelo Tosatti CC: kvm , "Nakajima, Jun" , "Ren, Yongjie" Subject: [PATCH] KVM: x86: Check KVM_REQ_IMMEDIATE_EXIT after enable_irq_window X-Enigmail-Version: 1.5.1 X-Provags-ID: V02:K0:ZYeHjYp5/NAhGMQS+cv8keDMHip0NYT3CvjZddQ8Lkc I/0FdQHgr0hcnyqRemoAcxcEKZ68B0kWxZ+aksJeJf85YNv16f aajJ/KDBVXHp8IcMfTxkNoqal1SRSORQ74zjAD0vMssS5Y3MkP g4ZyKt8o1D3dhpVjTSjv/TdEjCi4/rWuAziIePlhD2QwJvMhb7 qXz4/hk+3mS7wnKZKg1rg== Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jan Kiszka 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 --- 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); + if (kvm_lapic_enabled(vcpu)) { /* * Update architecture specific hints for APIC