Re: [PATCH 20/30] microblaze_mmu_v1: uaccess MMU update

Arnd Bergmann
2009-04-29T15:57:49Z

On Wednesday 29 April 2009, Michal Simek wrote:
> For powerpc I found these tree references. Where is the __get_user_bad definition?

> arch/powerpc/include/asm/uaccess.h:216:extern long __get_user_bad(void);
> arch/powerpc/include/asm/uaccess.h:263:         (x) = __get_user_bad();                         \
> arch/powerpc/include/asm/uaccess.h:269: default: (x) = __get_user_bad();                        \
>

As I tried to explain, the whole point is that there is no definition
at all, just a declaration.
Normally, the compiler will discard the 'default:' case of get_user,
so the function is not called. However, if you pass a variable of
a length other than 1, 2, or 4, the compiler will generate a function
call to __get_user_bad in the object file. When you try to link
the kernel afterwards, you will get an error message like

Unknown symbol __get_user_bad" for drivers/foo/bar.o

which tells you that some function in drivers/foo/bar.c calls
get_user with an invalid argument.