From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756392AbbGPVy3 (ORCPT ); Thu, 16 Jul 2015 17:54:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36265 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751559AbbGPVy2 (ORCPT ); Thu, 16 Jul 2015 17:54:28 -0400 Date: Thu, 16 Jul 2015 14:54:26 -0700 From: Andrew Morton To: Sudip Mukherjee Cc: David Howells , linux-kernel@vger.kernel.org, Ananth N Mavinakayanahalli , Anil S Keshavamurthy , Masami Hiramatsu Subject: Re: [PATCH v2 1/7] mn10300: fix build failure Message-Id: <20150716145426.c144a3419c20d60835888965@linux-foundation.org> In-Reply-To: <1434629873-11668-2-git-send-email-sudipm.mukherjee@gmail.com> References: <1434629873-11668-1-git-send-email-sudipm.mukherjee@gmail.com> <1434629873-11668-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Jun 2015 17:47:47 +0530 Sudip Mukherjee wrote: > allmodconfig build fails with the error: > invalid use of undefined type 'struct kprobe_ctlblk' > > just declared the two basic structures after checking the struct in other > architectures. > > --- a/arch/mn10300/include/asm/kprobes.h > +++ b/arch/mn10300/include/asm/kprobes.h > @@ -47,4 +47,16 @@ extern int kprobe_exceptions_notify(struct notifier_block *self, > > extern void arch_remove_kprobe(struct kprobe *p); > > +struct prev_kprobe { > + struct kprobe *kp; > + unsigned long status; > +}; > + > +struct kprobe_ctlblk { > + unsigned int kprobe_status; > + struct pt_regs jprobe_saved_regs; > + char jprobes_stack[MAX_STACK_SIZE]; > + struct prev_kprobe prev_kprobe; > +}; > + > #endif /* _ASM_KPROBES_H */ Look: akpm3:/usr/src/linux-4.2-rc2> grep -rl kprobe_ctlblk . ./arch/ia64/include/asm/kprobes.h ./arch/ia64/kernel/kprobes.c ./arch/tile/include/asm/kprobes.h ./arch/tile/kernel/kprobes.c ./arch/mips/include/asm/kprobes.h ./arch/mips/kernel/kprobes.c ./arch/arc/include/asm/kprobes.h ./arch/arc/kernel/kprobes.c ./arch/sparc/include/asm/kprobes.h ./arch/sparc/kernel/kprobes.c ./arch/powerpc/include/asm/kprobes.h ./arch/powerpc/kernel/kprobes.c ./arch/avr32/include/asm/kprobes.h ./arch/sh/include/asm/kprobes.h ./arch/sh/kernel/kprobes.c ./arch/arm/probes/kprobes/core.c ./arch/arm/probes/kprobes/opt-arm.c ./arch/arm/include/asm/kprobes.h ./arch/s390/include/asm/kprobes.h ./arch/s390/kernel/kprobes.c ./arch/x86/include/asm/kprobes.h ./arch/x86/kernel/kprobes/core.c ./arch/x86/kernel/kprobes/ftrace.c ./arch/x86/kernel/kprobes/common.h ./arch/x86/kernel/kprobes/opt.c ./include/linux/kprobes.h mn10300 doesn't use kprobe_ctlblk (or prev_kprobe). Nor does the core kernel kprobes code. So these are arch-specific things and shouldn't be referenced from include/linux/kprobes.h at all. I think - I didn't look super-closely at it. So an appropriate fix for this would be to move the references to prev_kprobe/kprobe_ctlblk out of include/linux/kprobes.h and into asm/kprobes.h. Presumably via include/asm-generic/kprobes.h in some fashion. Have you tested this patch on mn10300? Does kprobes actually work on mn10300? Perhaps not, and the solution here is to disable kprobes on that arch until someone fixes it all up. Please resend any mn10300 fixes which you still have pending. Please be a bit more sparing in the cc's when doing so ;)