linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Zhang <yang.z.zhang@intel.com>
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 <yang.z.zhang@Intel.com>
Subject: [PATCH] KVM: x86: Don't sending posted interrupt if not config CONFIG_SMP
Date: Thu, 18 Apr 2013 08:57:47 +0800	[thread overview]
Message-ID: <1366246667-7599-1-git-send-email-yang.z.zhang@intel.com> (raw)

From: Yang Zhang <yang.z.zhang@Intel.com>

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 <rdunlap@infradead.org>
Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
---
 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);
 }
 
-- 
1.7.1

                 reply	other threads:[~2013-04-18  0:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1366246667-7599-1-git-send-email-yang.z.zhang@intel.com \
    --to=yang.z.zhang@intel.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rientjes@google.com \
    --cc=sfr@canb.auug.org.au \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).