Re: Problems Building Bluetooth with K6 and CONFIG_REGPARM
On Thu, Sep 08, 2005 at 12:49:17PM -0400, Brian Gerst wrote: > Horms wrote: > >Hi Andy, > > > >that does indeed seem to be a problem. I have narrowed it down to > >a combination of using K6 and CONFIG_REGPARM. Hunting around a bit > >I found this http://my.execpc.com/~geezer/osd/gotchas/, which > >suggests the problem is that the asm in question tries to add a register > >to the clobber list which is not available. This makes sense, > >I guess REGPARM is using edx, so inline assembly can't. > > > >I've CCed the bluetooth maintainers and lkml, hopefully someone there > >will have some input on how to resolve this problem, as inline assembly > >isn't my strong point and the problem seems to manifest in Linus' current > >git tree. > > > >The relevant code is the following call to BUILDIO(b,b,char) towards the > >bottom of include/asm/io.h > > > >BUILDIO is as follows, and I am guessing it is the "Nd"(port) and > >possibley "d"(port) portions that are problematic. > > Sounds like a compiler bug, especially since changing the CPU type fixes > it. What version of GCC? I definately think it is compiler related, I was using Debian's GCC 4.0.1-6. I could try with 3.3 or soemthing like that if you like. The problem was easily reproducable with 4.0.1 and a K6+CONFIG_REGPARM config. -- Horms - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Problems Building Bluetooth with K6 and CONFIG_REGPARM
Horms wrote: Hi Andy, that does indeed seem to be a problem. I have narrowed it down to a combination of using K6 and CONFIG_REGPARM. Hunting around a bit I found this http://my.execpc.com/~geezer/osd/gotchas/, which suggests the problem is that the asm in question tries to add a register to the clobber list which is not available. This makes sense, I guess REGPARM is using edx, so inline assembly can't. I've CCed the bluetooth maintainers and lkml, hopefully someone there will have some input on how to resolve this problem, as inline assembly isn't my strong point and the problem seems to manifest in Linus' current git tree. The relevant code is the following call to BUILDIO(b,b,char) towards the bottom of include/asm/io.h BUILDIO is as follows, and I am guessing it is the "Nd"(port) and possibley "d"(port) portions that are problematic. Sounds like a compiler bug, especially since changing the CPU type fixes it. What version of GCC? -- Brian Gerst - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Problems Building Bluetooth with K6 and CONFIG_REGPARM
Hi Andy, that does indeed seem to be a problem. I have narrowed it down to a combination of using K6 and CONFIG_REGPARM. Hunting around a bit I found this http://my.execpc.com/~geezer/osd/gotchas/, which suggests the problem is that the asm in question tries to add a register to the clobber list which is not available. This makes sense, I guess REGPARM is using edx, so inline assembly can't. I've CCed the bluetooth maintainers and lkml, hopefully someone there will have some input on how to resolve this problem, as inline assembly isn't my strong point and the problem seems to manifest in Linus' current git tree. The relevant code is the following call to BUILDIO(b,b,char) towards the bottom of include/asm/io.h BUILDIO is as follows, and I am guessing it is the "Nd"(port) and possibley "d"(port) portions that are problematic. #define BUILDIO(bwl,bw,type) \ static inline void out##bwl##_local(unsigned type value, int port) { \ __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \ } \ static inline unsigned type in##bwl##_local(int port) { \ unsigned type value; \ __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port)); \ return value; \ } \ static inline void out##bwl##_local_p(unsigned type value, int port) { \ out##bwl##_local(value, port); \ slow_down_io(); \ } \ static inline unsigned type in##bwl##_local_p(int port) { \ unsigned type value = in##bwl##_local(port); \ slow_down_io(); \ return value; \ } \ __BUILDIO(bwl,bw,type) \ static inline void out##bwl##_p(unsigned type value, int port) { \ out##bwl(value, port); \ slow_down_io(); \ } \ static inline unsigned type in##bwl##_p(int port) { \ unsigned type value = in##bwl(port); \ slow_down_io(); \ return value; \ } \ static inline void outs##bwl(int port, const void *addr, unsigned long count) { \ __asm__ __volatile__("rep; outs" #bwl : "+S"(addr), "+c"(count) : "d"(port)); \ } \ static inline void ins##bwl(int port, void *addr, unsigned long count) { \ __asm__ __volatile__("rep; ins" #bwl : "+D"(addr), "+c"(count) : "d"(port)); \ } -- Horms On Sat, Sep 03, 2005 at 10:49:48AM -0700, [EMAIL PROTECTED] wrote: > Package: linux-source-2.6.12 > Version: 2.6.12-5 > Severity: normal > > # make-kpkg --initrd --append-to-version=-ahrairah --revision=ahrairah.1 > kernel-image modules-image > > CC [M] drivers/bluetooth/bfusb.o > CC [M] drivers/bluetooth/dtl1_cs.o > drivers/bluetooth/dtl1_cs.c: In function 'dtl1_write': > include/asm/io.h:377: error: can't find a register in class 'DREG' while > reloading 'asm' > make[3]: *** [drivers/bluetooth/dtl1_cs.o] Error 1 > make[2]: *** [drivers/bluetooth] Error 2 > make[1]: *** [drivers] Error 2 > make[1]: Leaving directory `/usr/src/linux-source-2.6.12' > make: *** [stamp-build] Error 2 > > Change CPU type to K7 and it builds successfully. > > > -- System Information: > Debian Release: testing/unstable > APT prefers testing > APT policy: (500, 'testing'), (100, 'unstable'), (99, 'experimental') > Architecture: i386 (i686) > Shell: /bin/sh linked to /bin/bash > Kernel: Linux 2.6.12.local > Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) > > Versions of packages linux-source-2.6.12 depends on: > ii binutils 2.16.1-2 The GNU assembler, linker and > bina > ii bzip2 1.0.2-8high-quality block-sorting file > co > ii coreutils [fileutils] 5.2.1-2ubuntu0 The GNU core utilities > > Versions of packages linux-source-2.6.12 recommends: > ii gcc 4:4.0.1-3 The GNU C compiler > ii libc6-dev [libc-dev] 2.3.5-4GNU C Library: Development > Librari > ii make 3.80-9 The GNU version of the "make" > util > > -- no debconf information > # > # Automatically generated make config: don't edit > # Linux kernel version: 2.6.12-ahrairah > # Sat Sep 3 09:11:09 2005 > # > CONFIG_X86=y > CONFIG_MMU=y > CONFIG_UID16=y > CONFIG_GENERIC_ISA_DMA=y > CONFIG_GENERIC_IOMAP=y > > # > # Code maturity level options > # > CONFIG_EXPERIMENTAL=y > CONFIG_CLEAN_COMPILE=y > CONFIG_BROKEN_ON_SMP=y > CONFIG_LOCK_KERNEL=y > CONFIG_INIT_ENV_ARG_LIMIT=32 > > # > # General setup > # > CONFIG_LOCALVERSION="" > CONFIG_SWAP=y > CONFIG_SYSVIPC=y > CONFIG_POSIX_MQUEUE=y > CONFIG_BSD_PROCESS_ACCT=y > CONFIG_BSD_PROCESS_ACCT_V3=y > CONFIG_SYSCTL=y > CONFIG_AUDIT=y > CONFIG_AUDITSYSCALL=y > CONFIG_HOTPLUG=y > CONFIG_KOBJECT_UEVENT=y > # CONFIG_IKCONFIG is not set > CONFIG_EMBEDDED=y > # CONFIG_KALLSYMS is not set > CONFIG_PRINTK=y > CONFIG_BUG=y > CONFIG_BASE_FULL=y > CONFIG_FUTEX=y > CONFIG_EPOLL=y > # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set > CONFIG_SHMEM=y > CONFIG_CC_ALIGN_FUNCTIONS=0 > CONFIG_CC_ALIGN_LABELS=0 > CONFIG_CC_ALIGN_LOOPS=0 > CONFIG_CC_ALIGN_JUMPS=0 > # CONFIG_TINY_SHMEM is not set > CONFIG_BASE_SMALL=0 >
Problems Building Bluetooth with K6 and CONFIG_REGPARM
Hi Andy, that does indeed seem to be a problem. I have narrowed it down to a combination of using K6 and CONFIG_REGPARM. Hunting around a bit I found this http://my.execpc.com/~geezer/osd/gotchas/, which suggests the problem is that the asm in question tries to add a register to the clobber list which is not available. This makes sense, I guess REGPARM is using edx, so inline assembly can't. I've CCed the bluetooth maintainers and lkml, hopefully someone there will have some input on how to resolve this problem, as inline assembly isn't my strong point and the problem seems to manifest in Linus' current git tree. The relevant code is the following call to BUILDIO(b,b,char) towards the bottom of include/asm/io.h BUILDIO is as follows, and I am guessing it is the Nd(port) and possibley d(port) portions that are problematic. #define BUILDIO(bwl,bw,type) \ static inline void out##bwl##_local(unsigned type value, int port) { \ __asm__ __volatile__(out #bwl % #bw 0, %w1 : : a(value), Nd(port)); \ } \ static inline unsigned type in##bwl##_local(int port) { \ unsigned type value; \ __asm__ __volatile__(in #bwl %w1, % #bw 0 : =a(value) : Nd(port)); \ return value; \ } \ static inline void out##bwl##_local_p(unsigned type value, int port) { \ out##bwl##_local(value, port); \ slow_down_io(); \ } \ static inline unsigned type in##bwl##_local_p(int port) { \ unsigned type value = in##bwl##_local(port); \ slow_down_io(); \ return value; \ } \ __BUILDIO(bwl,bw,type) \ static inline void out##bwl##_p(unsigned type value, int port) { \ out##bwl(value, port); \ slow_down_io(); \ } \ static inline unsigned type in##bwl##_p(int port) { \ unsigned type value = in##bwl(port); \ slow_down_io(); \ return value; \ } \ static inline void outs##bwl(int port, const void *addr, unsigned long count) { \ __asm__ __volatile__(rep; outs #bwl : +S(addr), +c(count) : d(port)); \ } \ static inline void ins##bwl(int port, void *addr, unsigned long count) { \ __asm__ __volatile__(rep; ins #bwl : +D(addr), +c(count) : d(port)); \ } -- Horms On Sat, Sep 03, 2005 at 10:49:48AM -0700, [EMAIL PROTECTED] wrote: Package: linux-source-2.6.12 Version: 2.6.12-5 Severity: normal # make-kpkg --initrd --append-to-version=-ahrairah --revision=ahrairah.1 kernel-image modules-image CC [M] drivers/bluetooth/bfusb.o CC [M] drivers/bluetooth/dtl1_cs.o drivers/bluetooth/dtl1_cs.c: In function 'dtl1_write': include/asm/io.h:377: error: can't find a register in class 'DREG' while reloading 'asm' make[3]: *** [drivers/bluetooth/dtl1_cs.o] Error 1 make[2]: *** [drivers/bluetooth] Error 2 make[1]: *** [drivers] Error 2 make[1]: Leaving directory `/usr/src/linux-source-2.6.12' make: *** [stamp-build] Error 2 Change CPU type to K7 and it builds successfully. -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (500, 'testing'), (100, 'unstable'), (99, 'experimental') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.12.local Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages linux-source-2.6.12 depends on: ii binutils 2.16.1-2 The GNU assembler, linker and bina ii bzip2 1.0.2-8high-quality block-sorting file co ii coreutils [fileutils] 5.2.1-2ubuntu0 The GNU core utilities Versions of packages linux-source-2.6.12 recommends: ii gcc 4:4.0.1-3 The GNU C compiler ii libc6-dev [libc-dev] 2.3.5-4GNU C Library: Development Librari ii make 3.80-9 The GNU version of the make util -- no debconf information # # Automatically generated make config: don't edit # Linux kernel version: 2.6.12-ahrairah # Sat Sep 3 09:11:09 2005 # CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION= CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_SYSCTL=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y
Re: Problems Building Bluetooth with K6 and CONFIG_REGPARM
Horms wrote: Hi Andy, that does indeed seem to be a problem. I have narrowed it down to a combination of using K6 and CONFIG_REGPARM. Hunting around a bit I found this http://my.execpc.com/~geezer/osd/gotchas/, which suggests the problem is that the asm in question tries to add a register to the clobber list which is not available. This makes sense, I guess REGPARM is using edx, so inline assembly can't. I've CCed the bluetooth maintainers and lkml, hopefully someone there will have some input on how to resolve this problem, as inline assembly isn't my strong point and the problem seems to manifest in Linus' current git tree. The relevant code is the following call to BUILDIO(b,b,char) towards the bottom of include/asm/io.h BUILDIO is as follows, and I am guessing it is the Nd(port) and possibley d(port) portions that are problematic. Sounds like a compiler bug, especially since changing the CPU type fixes it. What version of GCC? -- Brian Gerst - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Problems Building Bluetooth with K6 and CONFIG_REGPARM
On Thu, Sep 08, 2005 at 12:49:17PM -0400, Brian Gerst wrote: Horms wrote: Hi Andy, that does indeed seem to be a problem. I have narrowed it down to a combination of using K6 and CONFIG_REGPARM. Hunting around a bit I found this http://my.execpc.com/~geezer/osd/gotchas/, which suggests the problem is that the asm in question tries to add a register to the clobber list which is not available. This makes sense, I guess REGPARM is using edx, so inline assembly can't. I've CCed the bluetooth maintainers and lkml, hopefully someone there will have some input on how to resolve this problem, as inline assembly isn't my strong point and the problem seems to manifest in Linus' current git tree. The relevant code is the following call to BUILDIO(b,b,char) towards the bottom of include/asm/io.h BUILDIO is as follows, and I am guessing it is the Nd(port) and possibley d(port) portions that are problematic. Sounds like a compiler bug, especially since changing the CPU type fixes it. What version of GCC? I definately think it is compiler related, I was using Debian's GCC 4.0.1-6. I could try with 3.3 or soemthing like that if you like. The problem was easily reproducable with 4.0.1 and a K6+CONFIG_REGPARM config. -- Horms - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/