Re: [next:master 452/458] undefined reference to `__bad_size_call_parameter'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 7 Mar 2014 11:07:45 -0600 (CST) Christoph Lameter <cl@xxxxxxxxx> wrote:

> On Thu, 6 Mar 2014, Andrew Morton wrote:
> 
> > On Thu, 06 Mar 2014 22:48:11 +0800 kbuild test robot
> > <fengguang.wu@xxxxxxxxx> wrote:
> > This has me stumped - the same code
> >
> > 	p = __this_cpu_read(current_kprobe);
> >
> > works OK elsewhere in that file.  I'm suspecting a miscompile - it's
> > not unknown for gcc to screw up when we use this trick.
> >
> > I can reproduce it with gcc-3.4.5 for sh.
> 
> This is again the autoconversion not applying because current_kprobe is
> probably a pointer. __bad_size_call_parameter is failure because reads
> from structures larger than word size are not supported.
> 

But there are two instances of

	__this_cpu_read(current_kprobe);

in arch/sh/kernel/kprobes.c.  One generates the bad_size thing and one
does not.

> p = this_cpu_ptr(&current_kprobe);
> 
> would fix it.

This compiles:

--- a/arch/sh/kernel/kprobes.c~a
+++ a/arch/sh/kernel/kprobes.c
@@ -511,7 +511,7 @@ int __kprobes kprobe_exceptions_notify(s
 				if (kprobe_handler(args->regs)) {
 					ret = NOTIFY_STOP;
 				} else {
-					p = __this_cpu_read(current_kprobe);
+					p = *this_cpu_ptr(&current_kprobe);
 					if (p->break_handler &&
 					    p->break_handler(p, args->regs))
 						ret = NOTIFY_STOP;

But still generates a reference to __bad_size_call_parameter.

As does this:

--- a/arch/sh/kernel/kprobes.c~a
+++ a/arch/sh/kernel/kprobes.c
@@ -249,7 +249,7 @@ static int __kprobes kprobe_handler(stru
 			kcb->kprobe_status = KPROBE_REENTER;
 			return 1;
 		} else {
-			p = __this_cpu_read(current_kprobe);
+			p = *this_cpu_ptr(&current_kprobe);
 			if (p->break_handler && p->break_handler(p, regs)) {
 				goto ss_probe;
 			}
@@ -511,7 +511,7 @@ int __kprobes kprobe_exceptions_notify(s
 				if (kprobe_handler(args->regs)) {
 					ret = NOTIFY_STOP;
 				} else {
-					p = __this_cpu_read(current_kprobe);
+					p = *this_cpu_ptr(&current_kprobe);
 					if (p->break_handler &&
 					    p->break_handler(p, args->regs))
 						ret = NOTIFY_STOP;
_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]