public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: linux-next: Tree for Apr 17 (kvm)
       [not found] <20130417170450.5dd6e5f450de4d5bf197d997@canb.auug.org.au>
@ 2013-04-17 18:10 ` Randy Dunlap
  2013-04-17 22:55   ` David Rientjes
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2013-04-17 18:10 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, KVM

On 04/17/13 00:04, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20130416:
> 


on i386, SMP is disabled, X86_UP_APIC is not enabled, but
CONFIG_KVM_APIC_ARCHITECTURE=y:

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)


-- 
~Randy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: linux-next: Tree for Apr 17 (kvm)
  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
  0 siblings, 1 reply; 8+ messages in thread
From: David Rientjes @ 2013-04-17 22:55 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, linux-next, linux-kernel, KVM

On Wed, 17 Apr 2013, Randy Dunlap wrote:

> On 04/17/13 00:04, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Changes since 20130416:
> > 
> 
> 
> on i386, SMP is disabled, X86_UP_APIC is not enabled, but
> CONFIG_KVM_APIC_ARCHITECTURE=y:
> 
> 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)
> 

Confirmed this happens on x86_64 as well, it seems that CONFIG_SMP=n is 
the key.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [patch] x86, kvm: fix build failure with CONFIG_SMP disabled
  2013-04-17 22:55   ` David Rientjes
@ 2013-04-17 23:12     ` David Rientjes
  2013-04-18  0:02       ` Randy Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: David Rientjes @ 2013-04-17 23:12 UTC (permalink / raw)
  To: Marcelo Tosatti, Gleb Natapov
  Cc: Randy Dunlap, Stephen Rothwell, x86, linux-next, linux-kernel,
	KVM

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.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 arch/x86/kvm/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -34,6 +34,7 @@
 #include "kvm_cache_regs.h"
 #include "x86.h"
 
+#include <asm/apic.h>
 #include <asm/io.h>
 #include <asm/desc.h>
 #include <asm/vmx.h>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] x86, kvm: fix build failure with CONFIG_SMP disabled
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2013-04-18  0:02 UTC (permalink / raw)
  To: David Rientjes
  Cc: Marcelo Tosatti, Gleb Natapov, Stephen Rothwell, x86, linux-next,
	linux-kernel, KVM

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!


> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
>  arch/x86/kvm/vmx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -34,6 +34,7 @@
>  #include "kvm_cache_regs.h"
>  #include "x86.h"
>  
> +#include <asm/apic.h>
>  #include <asm/io.h>
>  #include <asm/desc.h>
>  #include <asm/vmx.h>
> --


-- 
~Randy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [patch] x86, kvm: fix build failure with CONFIG_SMP disabled
  2013-04-18  0:02       ` Randy Dunlap
@ 2013-04-18  0:09         ` David Rientjes
  2013-04-18  0:35           ` Zhang, Yang Z
  0 siblings, 1 reply; 8+ messages in thread
From: David Rientjes @ 2013-04-18  0:09 UTC (permalink / raw)
  To: Randy Dunlap, Yang Zhang
  Cc: Marcelo Tosatti, Gleb Natapov, Stephen Rothwell, x86, linux-next,
	linux-kernel, KVM

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [patch] x86, kvm: fix build failure with CONFIG_SMP disabled
  2013-04-18  0:09         ` David Rientjes
@ 2013-04-18  0:35           ` Zhang, Yang Z
  2013-04-18  0:47             ` Randy Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: Zhang, Yang Z @ 2013-04-18  0:35 UTC (permalink / raw)
  To: David Rientjes, Randy Dunlap
  Cc: Marcelo Tosatti, Gleb Natapov, Stephen Rothwell, x86@kernel.org,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, KVM

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [patch] x86, kvm: fix build failure with CONFIG_SMP disabled
  2013-04-18  0:35           ` Zhang, Yang Z
@ 2013-04-18  0:47             ` Randy Dunlap
  2013-04-18  0:50               ` Zhang, Yang Z
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2013-04-18  0:47 UTC (permalink / raw)
  To: Zhang, Yang Z
  Cc: David Rientjes, Marcelo Tosatti, Gleb Natapov, Stephen Rothwell,
	x86@kernel.org, linux-next@vger.kernel.org,
	linux-kernel@vger.kernel.org, KVM

On 04/17/13 17:35, Zhang, Yang Z wrote:
> 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>

Missing Reported-by: and the patch does not apply cleanly (looks like
lots of spaces instead of tabs in it)... but it does build now after
massaging the patch.

Thanks.

Acked-by: Randy Dunlap <rdunlap@infradead.org>


> 
> 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
> 
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [patch] x86, kvm: fix build failure with CONFIG_SMP disabled
  2013-04-18  0:47             ` Randy Dunlap
@ 2013-04-18  0:50               ` Zhang, Yang Z
  0 siblings, 0 replies; 8+ messages in thread
From: Zhang, Yang Z @ 2013-04-18  0:50 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: David Rientjes, Marcelo Tosatti, Gleb Natapov, Stephen Rothwell,
	x86@kernel.org, linux-next@vger.kernel.org,
	linux-kernel@vger.kernel.org, KVM

Randy Dunlap wrote on 2013-04-18:
> On 04/17/13 17:35, Zhang, Yang Z wrote:
>> 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>
> 
> Missing Reported-by: and the patch does not apply cleanly (looks like
> lots of spaces instead of tabs in it)... but it does build now after
> massaging the patch.
Thanks.
Just copy it to you for a quick testing. I will resend a formal patch.

> Thanks.
> 
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
> 
> 
>> 
>> 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
>> 
>> 
> 
> 
> --
> ~Randy
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Best regards,
Yang

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-18  0:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20130417170450.5dd6e5f450de4d5bf197d997@canb.auug.org.au>
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
2013-04-18  0:47             ` Randy Dunlap
2013-04-18  0:50               ` Zhang, Yang Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox