linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zhang, Yang Z" <yang.z.zhang@intel.com>
To: David Rientjes <rientjes@google.com>,
	Randy Dunlap <rdunlap@infradead.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Gleb Natapov <gleb@redhat.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	KVM <kvm@vger.kernel.org>
Subject: RE: [patch] x86, kvm: fix build failure with CONFIG_SMP disabled
Date: Thu, 18 Apr 2013 00:35:14 +0000	[thread overview]
Message-ID: <A9667DDFB95DB7438FA9D7D576C3D87E09A13B08@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1304171707090.24494@chino.kir.corp.google.com>

David Rientjes wrote on 2013-04-18:
> On Wed, 17 Apr 2013, Randy Dunlap wrote:
> 
>> On 04/17/13 16:12, David Rientjes wrote:
>>> The build fails when CONFIG_SMP is disabled:
>>> 
>>> 	arch/x86/kvm/vmx.c: In function 'vmx_deliver_posted_interrupt':
>>> 	arch/x86/kvm/vmx.c:3950:3: error: 'apic' undeclared (first use in
>>> this function)
>>> 
>>> Fix it by including the necessary header.
>> 
>> Sorry, i386 build still fails with the same error message plus this one:
>> 
>> ERROR: "apic" [arch/x86/kvm/kvm-intel.ko] undefined!
>> 
> 
> Ahh, that's because you don't have CONFIG_X86_LOCAL_APIC as you already
> mentioned.  So it looks like this error can manifest in two different ways
> and we got different reports.
> 
> This failure came from "KVM: VMX: Add the deliver posted interrupt
> algorithm", so adding Yang to the cc to specify the dependency this has on
> apic and how it can be protected without CONFIG_X86_LOCAL_APIC on i386.
How about the follow patch?

commit a49dd819f502c1029c5a857e87201ef25ec06ce6
Author: Yang Zhang <yang.z.zhang@Intel.com>
Date:   Wed Apr 17 05:34:07 2013 -0400

    KVM: x86: Don't sending posted interrupt if not config CONFIG_SMP

    In UP, posted interrupt logic will not work. So we should not send
    posted interrupt and let vcpu to pick the pending interrupt before
    vmentry.

    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>

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);
 }

Best regards,
Yang

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

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17  7:04 linux-next: Tree for Apr 17 Stephen Rothwell
     [not found] ` <20130417170450.5dd6e5f450de4d5bf197d997-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2013-04-17 18:06   ` linux-next: Tree for Apr 17 (infiniband/rdma) Randy Dunlap
     [not found]     ` <516EE4BD.3000200-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2013-04-17 18:13       ` Roland Dreier
2013-04-17 18:15     ` Or Gerlitz
2013-04-17 18:44       ` Nicholas A. Bellinger
2013-04-17 18:10 ` linux-next: Tree for Apr 17 (kvm) Randy Dunlap
2013-04-17 22:55   ` David Rientjes
2013-04-17 23:12     ` [patch] x86, kvm: fix build failure with CONFIG_SMP disabled David Rientjes
2013-04-18  0:02       ` Randy Dunlap
2013-04-18  0:09         ` David Rientjes
2013-04-18  0:35           ` Zhang, Yang Z [this message]
2013-04-18  0:47             ` Randy Dunlap
2013-04-18  0:50               ` Zhang, Yang Z

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=A9667DDFB95DB7438FA9D7D576C3D87E09A13B08@SHSMSX101.ccr.corp.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).