Skip to contentSkip to conversation

x86: don't allow KVM_CLOCK without HAVE_KVM

PATCH In review Randy Dunlap 2 participants 6 messages Mar 14, 2008 – Mar 27, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: don't allow KVM_CLOCK without HAVE_KVM

From: Randy Dunlap <[email protected]>

Make KVM_CLOCK depend on HAVE_KVM. Otherwise a Voyager build can fail with:

CC arch/x86/kernel/asm-offsets.s
In file included from include2/asm/irqflags.h:59,

                 from /local/linsrc/next-20080314/include/linux/irqflags.h:46,
                 from include2/asm/system.h:11,
                 from include2/asm/processor.h:21,
                 from include2/asm/atomic_32.h:5,
                 from include2/asm/atomic.h:2,
                 from /local/linsrc/next-20080314/include/linux/crypto.h:20,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets_32.c:7,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets.c:2:

include2/asm/paravirt.h: In function 'startup_ipi_hook':
include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: memory input 4 is not directly addressable make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[1]: *** [prepare0] Error 2
make: *** [sub-make] Error 2

---
 arch/x86/Kconfig |    1 +
 1 file changed, 1 insertion(+)
arch/x86/Kconfig +1 -0
@@ -370,6 +370,7 @@ config VMI
 config KVM_CLOCK
 	bool "KVM paravirtualized clock"
 	select PARAVIRT
+	depends on HAVE_KVM
 	help
 	  Turning on this option will allow you to run a paravirtualized clock
 	  when running over the KVM hypervisor. Instead of relying on a PIT

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

#1 lore raw
Quoted 15 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Make KVM_CLOCK depend on HAVE_KVM. Otherwise a Voyager build can fail with:

CC arch/x86/kernel/asm-offsets.s
In file included from include2/asm/irqflags.h:59,

                 from /local/linsrc/next-20080314/include/linux/irqflags.h:46,
                 from include2/asm/system.h:11,
                 from include2/asm/processor.h:21,
                 from include2/asm/atomic_32.h:5,
                 from include2/asm/atomic.h:2,
                 from /local/linsrc/next-20080314/include/linux/crypto.h:20,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets_32.c:7,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets.c:2:
Quoted 9 lines

include2/asm/paravirt.h: In function 'startup_ipi_hook':
include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: memory input 4 is not directly addressable make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[1]: *** [prepare0] Error 2
make: *** [sub-make] Error 2

Looks like it's a general paravirt vs voyager issue, nothing kvmclock specific about it. Wouldn't it be better to have voyager and paravirt mutually exclude each other, rather than every paravirt user?

HAVE_KVM is intended for the host, not the guest, btw.

Signature · 1 line
error compiling committee.c: too many arguments to function
#2 lore raw
Quoted 26 lines · On Sun, 16 Mar 2008 13:13:08 +0200 Avi Kivity wrote:
Quoted 15 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Make KVM_CLOCK depend on HAVE_KVM. Otherwise a Voyager build can fail with:

CC arch/x86/kernel/asm-offsets.s
In file included from include2/asm/irqflags.h:59,

                 from /local/linsrc/next-20080314/include/linux/irqflags.h:46,
                 from include2/asm/system.h:11,
                 from include2/asm/processor.h:21,
                 from include2/asm/atomic_32.h:5,
                 from include2/asm/atomic.h:2,
                 from /local/linsrc/next-20080314/include/linux/crypto.h:20,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets_32.c:7,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets.c:2:
Quoted 9 lines

include2/asm/paravirt.h: In function 'startup_ipi_hook':
include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: memory input 4 is not directly addressable make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[1]: *** [prepare0] Error 2
make: *** [sub-make] Error 2

Quoted 3 lines

Looks like it's a general paravirt vs voyager issue, nothing kvmclock specific about it. Wouldn't it be better to have voyager and paravirt mutually exclude each other, rather than every paravirt user?

They do generally mutually exclude each other. I think that the problem is just that dirty old "select PARAVIRT" in config KVM_CLOCK. PARAVIRT depends on !(X86_VISWS || X86_VOYAGER), but "select" doesn't care^W honor that. As Documentation/kbuild/kconfig-language.txt says:

"In general use select only for
non-visible symbols (no prompts anywhere) and for symbols with no dependencies. That will limit the usefulness but on the other hand avoid the illegal configurations all over. kconfig should one day warn about such things."

so changing the select to depends on would fix it, but that's the only fix that I know of.

Quoted 1 line

HAVE_KVM is intended for the host, not the guest, btw.

---
~Randy

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

#3 lore raw
Quoted 40 lines · Randy Dunlap
Quoted 27 lines · On Sun, 16 Mar 2008 13:13:08 +0200 Avi Kivity wrote:
Quoted 15 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Make KVM_CLOCK depend on HAVE_KVM. Otherwise a Voyager build can fail with:

CC arch/x86/kernel/asm-offsets.s
In file included from include2/asm/irqflags.h:59,

                 from /local/linsrc/next-20080314/include/linux/irqflags.h:46,
                 from include2/asm/system.h:11,
                 from include2/asm/processor.h:21,
                 from include2/asm/atomic_32.h:5,
                 from include2/asm/atomic.h:2,
                 from /local/linsrc/next-20080314/include/linux/crypto.h:20,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets_32.c:7,
                 from /local/linsrc/next-20080314/arch/x86/kernel/asm-offsets.c:2:
Quoted 10 lines

include2/asm/paravirt.h: In function 'startup_ipi_hook':
include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' include2/asm/paravirt.h:856: error: memory input 4 is not directly addressable make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[1]: *** [prepare0] Error 2
make: *** [sub-make] Error 2

Quoted 4 lines

Looks like it's a general paravirt vs voyager issue, nothing kvmclock specific about it. Wouldn't it be better to have voyager and paravirt mutually exclude each other, rather than every paravirt user?

They do generally mutually exclude each other. I think that the problem is just that dirty old "select PARAVIRT" in config KVM_CLOCK. PARAVIRT depends on !(X86_VISWS || X86_VOYAGER), but "select" doesn't care^W honor that. As Documentation/kbuild/kconfig-language.txt says:

Quoted 9 lines

"In general use select only for
non-visible symbols (no prompts anywhere) and for symbols with no dependencies. That will limit the usefulness but on the other hand avoid the illegal configurations all over. kconfig should one day warn about such things."

so changing the select to depends on would fix it, but that's the only fix that I know of.

A depends is horrible from the user point of view as it hides the feature completely if paravirt is not enabled. So your original workaround is probably best.

Or maybe
depends on PARAVIRT_CAPABLE
selects PARAVIRT

Where PARAVIRT_CAPABLE is a synonym for !(X86_REMOVE_ME || X86_TOTAL_SILLYNESS), so we don't have to repeat it everywhere.

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
#4 lore raw

PATCH v2 1/1 x86: don't allow KVM_CLOCK on Voyager or Visual WS

In reply to Randy Dunlap

From: Randy Dunlap <[email protected]>

Prevent failed randconfig builds with KVM_CLOCK being enabled on Voyager or VISWS.

build-rand9.out:  Using /local/linsrc/next-20080325 as source for kernel
build-rand9.out:                 from /local/linsrc/next-20080325/include/linux/irqflags.h:46,
build-rand9.out:                 from include2/asm/system.h:11,
build-rand9.out:                 from include2/asm/processor.h:21,
build-rand9.out:                 from include2/asm/atomic_32.h:5,
build-rand9.out:                 from include2/asm/atomic.h:2,
build-rand9.out:                 from /local/linsrc/next-20080325/include/linux/crypto.h:20,
build-rand9.out:                 from /local/linsrc/next-20080325/arch/x86/kernel/asm-offsets_32.c:7,
build-rand9.out:                 from /local/linsrc/next-20080325/arch/x86/kernel/asm-offsets.c:2:

build-rand9.out:include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' build-rand9.out:include2/asm/paravirt.h:856: error: 'struct pv_apic_ops' has no member named 'startup_ipi_hook' build-rand9.out:include2/asm/paravirt.h:856: error: memory input 4 is not directly addressable build-rand9.out:make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1

---
 arch/x86/Kconfig |    1 +
 1 file changed, 1 insertion(+)
arch/x86/Kconfig +1 -0
@@ -370,6 +370,7 @@ config VMI
 config KVM_CLOCK
 	bool "KVM paravirtualized clock"
 	select PARAVIRT
+	depends on !(X86_VISWS || X86_VOYAGER)
 	help
 	  Turning on this option will allow you to run a paravirtualized clock
 	  when running over the KVM hypervisor. Instead of relying on a PIT

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

#5 lore raw

Re: [kvm-devel] [PATCH v2] x86: don't allow KVM_CLOCK on Voyager or Visual WS

Quoted 6 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Prevent failed randconfig builds with KVM_CLOCK being enabled on Voyager or VISWS.

Applies, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function