Michael S. Tsirkin | 1 Jul 2012 17:05
Picon
Favicon

[PATCH] apic: fix kvm build on UP without IOAPIC

On UP i386, when APIC is disabled
# CONFIG_X86_UP_APIC is not set
# CONFIG_PCI_IOAPIC is not set

code looking at apicdrivers never has any effect but it
still gets compiled in. In particular, this causes
build failures with kvm, but it generally bloats the kernel
unnecessarily.

Fix by defining both __apicdrivers and __apicdrivers_end
to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
that as the result any loop scanning __apicdrivers gets optimized out by
the compiler.

Warning: a .config with apic disabled doesn't seem to boot
for me (even without this patch). Still verifying why,
meanwhile this patch is compile-tested only.

Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
---

Note: if this patch makes sense, can x86 maintainers
please ACK applying it through the kvm tree, since that is
where we see the issue that it addresses?
Avi, Marcelo, maybe you can carry this in kvm/linux-next as a temporary
measure so that linux-next builds?

 arch/x86/include/asm/apic.h | 5 +++++
 1 file changed, 5 insertions(+)

(Continue reading)

Randy Dunlap | 1 Jul 2012 18:23

Re: [PATCH] apic: fix kvm build on UP without IOAPIC

On 07/01/2012 08:05 AM, Michael S. Tsirkin wrote:

> On UP i386, when APIC is disabled
> # CONFIG_X86_UP_APIC is not set
> # CONFIG_PCI_IOAPIC is not set
> 
> code looking at apicdrivers never has any effect but it
> still gets compiled in. In particular, this causes
> build failures with kvm, but it generally bloats the kernel
> unnecessarily.
> 
> Fix by defining both __apicdrivers and __apicdrivers_end
> to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> that as the result any loop scanning __apicdrivers gets optimized out by
> the compiler.
> 
> Warning: a .config with apic disabled doesn't seem to boot
> for me (even without this patch). Still verifying why,
> meanwhile this patch is compile-tested only.
> 
> Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>

Reported-by: Randy Dunlap <rdunlap <at> xenotime.net>
Acked-by: Randy Dunlap <rdunlap <at> xenotime.net>

Thanks.

> ---
> 
> Note: if this patch makes sense, can x86 maintainers
(Continue reading)

H. Peter Anvin | 1 Jul 2012 19:10
Favicon

Re: [PATCH] apic: fix kvm build on UP without IOAPIC

On 07/01/2012 08:05 AM, Michael S. Tsirkin wrote:
> On UP i386, when APIC is disabled
> # CONFIG_X86_UP_APIC is not set
> # CONFIG_PCI_IOAPIC is not set
>
> code looking at apicdrivers never has any effect but it
> still gets compiled in. In particular, this causes
> build failures with kvm, but it generally bloats the kernel
> unnecessarily.
>
> Fix by defining both __apicdrivers and __apicdrivers_end
> to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> that as the result any loop scanning __apicdrivers gets optimized out by
> the compiler.
>
> Warning: a .config with apic disabled doesn't seem to boot
> for me (even without this patch). Still verifying why,
> meanwhile this patch is compile-tested only.
>
> Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> ---
>
> Note: if this patch makes sense, can x86 maintainers
> please ACK applying it through the kvm tree, since that is
> where we see the issue that it addresses?
> Avi, Marcelo, maybe you can carry this in kvm/linux-next as a temporary
> measure so that linux-next builds?
>

I'm not happy about that as a workflow, but since you guys have an 
(Continue reading)

Ingo Molnar | 6 Jul 2012 13:13

Re: [PATCH] apic: fix kvm build on UP without IOAPIC


* H. Peter Anvin <hpa <at> zytor.com> wrote:

> On 07/01/2012 08:05 AM, Michael S. Tsirkin wrote:
> >On UP i386, when APIC is disabled
> ># CONFIG_X86_UP_APIC is not set
> ># CONFIG_PCI_IOAPIC is not set
> >
> >code looking at apicdrivers never has any effect but it
> >still gets compiled in. In particular, this causes
> >build failures with kvm, but it generally bloats the kernel
> >unnecessarily.
> >
> >Fix by defining both __apicdrivers and __apicdrivers_end
> >to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> >that as the result any loop scanning __apicdrivers gets optimized out by
> >the compiler.
> >
> >Warning: a .config with apic disabled doesn't seem to boot
> >for me (even without this patch). Still verifying why,
> >meanwhile this patch is compile-tested only.
> >
> >Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> >---
> >
> >Note: if this patch makes sense, can x86 maintainers
> >please ACK applying it through the kvm tree, since that is
> >where we see the issue that it addresses?
> >Avi, Marcelo, maybe you can carry this in kvm/linux-next as a temporary
> >measure so that linux-next builds?
(Continue reading)

Marcelo Tosatti | 6 Jul 2012 13:32
Picon
Favicon

Re: [PATCH] apic: fix kvm build on UP without IOAPIC

On Fri, Jul 06, 2012 at 01:13:14PM +0200, Ingo Molnar wrote:
> 
> * H. Peter Anvin <hpa <at> zytor.com> wrote:
> 
> > On 07/01/2012 08:05 AM, Michael S. Tsirkin wrote:
> > >On UP i386, when APIC is disabled
> > ># CONFIG_X86_UP_APIC is not set
> > ># CONFIG_PCI_IOAPIC is not set
> > >
> > >code looking at apicdrivers never has any effect but it
> > >still gets compiled in. In particular, this causes
> > >build failures with kvm, but it generally bloats the kernel
> > >unnecessarily.
> > >
> > >Fix by defining both __apicdrivers and __apicdrivers_end
> > >to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> > >that as the result any loop scanning __apicdrivers gets optimized out by
> > >the compiler.
> > >
> > >Warning: a .config with apic disabled doesn't seem to boot
> > >for me (even without this patch). Still verifying why,
> > >meanwhile this patch is compile-tested only.
> > >
> > >Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > >---
> > >
> > >Note: if this patch makes sense, can x86 maintainers
> > >please ACK applying it through the kvm tree, since that is
> > >where we see the issue that it addresses?
> > >Avi, Marcelo, maybe you can carry this in kvm/linux-next as a temporary
(Continue reading)

Ingo Molnar | 6 Jul 2012 16:12

Re: [PATCH] apic: fix kvm build on UP without IOAPIC


* Marcelo Tosatti <mtosatti <at> redhat.com> wrote:

> On Fri, Jul 06, 2012 at 01:13:14PM +0200, Ingo Molnar wrote:
> > 
> > * H. Peter Anvin <hpa <at> zytor.com> wrote:
> > 
> > > On 07/01/2012 08:05 AM, Michael S. Tsirkin wrote:
> > > >On UP i386, when APIC is disabled
> > > ># CONFIG_X86_UP_APIC is not set
> > > ># CONFIG_PCI_IOAPIC is not set
> > > >
> > > >code looking at apicdrivers never has any effect but it
> > > >still gets compiled in. In particular, this causes
> > > >build failures with kvm, but it generally bloats the kernel
> > > >unnecessarily.
> > > >
> > > >Fix by defining both __apicdrivers and __apicdrivers_end
> > > >to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> > > >that as the result any loop scanning __apicdrivers gets optimized out by
> > > >the compiler.
> > > >
> > > >Warning: a .config with apic disabled doesn't seem to boot
> > > >for me (even without this patch). Still verifying why,
> > > >meanwhile this patch is compile-tested only.
> > > >
> > > >Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > > >---
> > > >
> > > >Note: if this patch makes sense, can x86 maintainers
(Continue reading)

Michael S. Tsirkin | 8 Jul 2012 22:56
Picon
Favicon

Re: [PATCH] apic: fix kvm build on UP without IOAPIC

On Fri, Jul 06, 2012 at 04:12:23PM +0200, Ingo Molnar wrote:
> 
> * Marcelo Tosatti <mtosatti <at> redhat.com> wrote:
> 
> > On Fri, Jul 06, 2012 at 01:13:14PM +0200, Ingo Molnar wrote:
> > > 
> > > * H. Peter Anvin <hpa <at> zytor.com> wrote:
> > > 
> > > > On 07/01/2012 08:05 AM, Michael S. Tsirkin wrote:
> > > > >On UP i386, when APIC is disabled
> > > > ># CONFIG_X86_UP_APIC is not set
> > > > ># CONFIG_PCI_IOAPIC is not set
> > > > >
> > > > >code looking at apicdrivers never has any effect but it
> > > > >still gets compiled in. In particular, this causes
> > > > >build failures with kvm, but it generally bloats the kernel
> > > > >unnecessarily.
> > > > >
> > > > >Fix by defining both __apicdrivers and __apicdrivers_end
> > > > >to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> > > > >that as the result any loop scanning __apicdrivers gets optimized out by
> > > > >the compiler.
> > > > >
> > > > >Warning: a .config with apic disabled doesn't seem to boot
> > > > >for me (even without this patch). Still verifying why,
> > > > >meanwhile this patch is compile-tested only.
> > > > >
> > > > >Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> > > > >---
> > > > >
(Continue reading)

Ingo Molnar | 9 Jul 2012 11:24

Re: [PATCH] apic: fix kvm build on UP without IOAPIC


* Michael S. Tsirkin <mst <at> redhat.com> wrote:

> On Fri, Jul 06, 2012 at 04:12:23PM +0200, Ingo Molnar wrote:
> > 
> > * Marcelo Tosatti <mtosatti <at> redhat.com> wrote:
> > 
> > > On Fri, Jul 06, 2012 at 01:13:14PM +0200, Ingo Molnar wrote:
> > > > 
> > > > * H. Peter Anvin <hpa <at> zytor.com> wrote:
> > > > 
> > > > > On 07/01/2012 08:05 AM, Michael S. Tsirkin wrote:
> > > > > >On UP i386, when APIC is disabled
> > > > > ># CONFIG_X86_UP_APIC is not set
> > > > > ># CONFIG_PCI_IOAPIC is not set
> > > > > >
> > > > > >code looking at apicdrivers never has any effect but it
> > > > > >still gets compiled in. In particular, this causes
> > > > > >build failures with kvm, but it generally bloats the kernel
> > > > > >unnecessarily.
> > > > > >
> > > > > >Fix by defining both __apicdrivers and __apicdrivers_end
> > > > > >to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> > > > > >that as the result any loop scanning __apicdrivers gets optimized out by
> > > > > >the compiler.
> > > > > >
> > > > > >Warning: a .config with apic disabled doesn't seem to boot
> > > > > >for me (even without this patch). Still verifying why,
> > > > > >meanwhile this patch is compile-tested only.
> > > > > >
(Continue reading)

Marcelo Tosatti | 3 Jul 2012 20:55
Picon
Favicon

Re: [PATCH] apic: fix kvm build on UP without IOAPIC

On Sun, Jul 01, 2012 at 06:05:06PM +0300, Michael S. Tsirkin wrote:
> On UP i386, when APIC is disabled
> # CONFIG_X86_UP_APIC is not set
> # CONFIG_PCI_IOAPIC is not set
> 
> code looking at apicdrivers never has any effect but it
> still gets compiled in. In particular, this causes
> build failures with kvm, but it generally bloats the kernel
> unnecessarily.
> 
> Fix by defining both __apicdrivers and __apicdrivers_end
> to be NULL when CONFIG_X86_LOCAL_APIC is unset: I verified
> that as the result any loop scanning __apicdrivers gets optimized out by
> the compiler.
> 
> Warning: a .config with apic disabled doesn't seem to boot
> for me (even without this patch). Still verifying why,
> meanwhile this patch is compile-tested only.
> 
> Signed-off-by: Michael S. Tsirkin <mst <at> redhat.com>
> ---
> 
> Note: if this patch makes sense, can x86 maintainers
> please ACK applying it through the kvm tree, since that is
> where we see the issue that it addresses?
> Avi, Marcelo, maybe you can carry this in kvm/linux-next as a temporary
> measure so that linux-next builds?

Applied, thanks.

(Continue reading)


Gmane