From mboxrd@z Thu Jan 1 00:00:00 1970 From: gmate.amit@gmail.com (Kumar amit mehta) Date: Wed, 20 Mar 2013 00:07:57 -0700 Subject: kernel build error In-Reply-To: <20130320065643.GB6275@gmail.com> References: <20130317152819.GA12313@gmail.com> <20130319052827.GA2874@gmail.com> <20130320065643.GB6275@gmail.com> Message-ID: <20130320070757.GC6275@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Tue, Mar 19, 2013 at 11:56:44PM -0700, Kumar amit mehta wrote: > On Tue, Mar 19, 2013 at 09:43:11PM +0700, Mulyadi Santosa wrote: > > Hi ... > > > > On Tue, Mar 19, 2013 at 12:28 PM, Kumar amit mehta wrote: > > > grep for copy_from_user_overflow gives me this: > > > > > > amit at ubuntu:~/linux-next/linux-next$ grep -ri copy_from_user_overflow * > > > arch/s390/include/asm/uaccess.h:extern void copy_from_user_overflow(void) > > > arch/s390/include/asm/uaccess.h: copy_from_user_overflow(); > > > arch/tile/include/asm/uaccess.h:extern void copy_from_user_overflow(void) > > > arch/tile/include/asm/uaccess.h: copy_from_user_overflow(); > > > arch/parisc/include/asm/uaccess.h:extern void copy_from_user_overflow(void) > > > arch/parisc/include/asm/uaccess.h: copy_from_user_overflow(); > > > arch/x86/include/asm/uaccess_32.h:extern void copy_from_user_overflow(void) > > > arch/x86/include/asm/uaccess_32.h: copy_from_user_overflow(); > > > drivers/vfio/pci/vfio_pci_config.c: * with count of 1/2/4 and hits > > > copy_from_user_overflow without this. > > > lib/usercopy.c:void copy_from_user_overflow(void) > > > > > > IMHO, I think uaccess_32.h is what you need here. > > > > I draw that conclusion after checking this line: > > http://lxr.linux.no/#linux+v3.8.3/arch/x86/include/asm/uaccess_32.h#L194 > > > > I might be wrong, so feel free to test first > > > Actually the above header file is supposed to get included, based on the > architecture only. > > > #ifdef CONFIG_X86_32 > # include > #else > # include > #endif > > > > amit at ubuntu:~/linux-next/linux-next$ grep -w CONFIG_X86_32 .config > CONFIG_X86_32=y > > > CPU arch on my machine: > amit at ubuntu:~/linux-next/linux-next$ uname -m > i686 > > Based on this observation, I think, I do not need to include the uaccess_32.h > in any of those files. > I forgot that 'uname -m' will return me the kernel version and _not_ the CPU architecture. The CPU on my machine seem to be 64 bit (/proc/cpuinfo|grep flags shows 'lm'). So my understanding is that I've a 32 bit kernel running on a 64 bit machine.