From patchwork Thu Apr 18 00:57:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Yang Z" X-Patchwork-Id: 2457161 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 2D9E7DF23A for ; Thu, 18 Apr 2013 01:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753467Ab3DRBCX (ORCPT ); Wed, 17 Apr 2013 21:02:23 -0400 Received: from mga09.intel.com ([134.134.136.24]:18806 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752459Ab3DRBCW (ORCPT ); Wed, 17 Apr 2013 21:02:22 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 17 Apr 2013 18:00:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,496,1363158000"; d="scan'208";a="320013464" Received: from yang-desktop.sh.intel.com ([10.239.47.153]) by orsmga002.jf.intel.com with ESMTP; 17 Apr 2013 18:02:18 -0700 From: Yang Zhang To: kvm@vger.kernel.org Cc: gleb@redhat.com, mtosatti@redhat.com, rdunlap@infradead.org, rientjes@google.com, sfr@canb.auug.org.au, linux-next@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Yang Zhang Subject: [PATCH] KVM: x86: Don't sending posted interrupt if not config CONFIG_SMP Date: Thu, 18 Apr 2013 08:57:47 +0800 Message-Id: <1366246667-7599-1-git-send-email-yang.z.zhang@intel.com> X-Mailer: git-send-email 1.7.1.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Yang Zhang If not config smp, posted interrupt logic will not work. So we should not send posted interrupt and let vcpu to pick the pending interrupt before vmentry. Without this patch, the build fails when CONFIG_SMP is disabled. Thanks Randy to report this issue. Reported-by: Randy Dunlap Signed-off-by: Yang Zhang Acked-by: Randy Dunlap --- arch/x86/kvm/vmx.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 52b21da..d5c6b95 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3946,10 +3946,12 @@ static void vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) r = pi_test_and_set_on(&vmx->pi_desc); kvm_make_request(KVM_REQ_EVENT, vcpu); +#ifdef CONFIG_SMP if (!r && (vcpu->mode == IN_GUEST_MODE)) apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), POSTED_INTR_VECTOR); else +#endif kvm_vcpu_kick(vcpu); }