From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. Date: Thu, 23 May 2013 19:19:30 +0800 Message-ID: <519DFB42.7010509@asianux.com> References: <519DCBEF.3090208@asianux.com> <201305231139.38233.arnd@arndb.de> <20130523100409.GK18614@n2100.arm.linux.org.uk> <201305231259.43750.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <201305231259.43750.arnd-r2nGTMty4D4@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: uclinux-dist-devel-bounces-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org Errors-To: uclinux-dist-devel-bounces-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org To: Arnd Bergmann Cc: Linux-sh list , Catalin Marinas , Benjamin Herrenschmidt , Heiko Carstens , "paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org" , "H. Peter Anvin" , Michel Lespinasse , Hans-Christian Egtvedt , Linux-Arch , linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Russell King - ARM Linux , Yoshinori Sato , Richard Weinberger , Helge Deller , the arch/x86 maintainers , "James E.J. Bottomley" , "mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , Geert Uytterhoeven , Frederic Weisbecker List-Id: linux-arch.vger.kernel.org On 05/23/2013 06:59 PM, Arnd Bergmann wrote: > You don't just want to avoid the code for printing the bug message and > the invalid instruction, we also want the compiler to not emit the > function call or check the enum for unexpected values. The meaning of > BUG() is really that person writing that statement was sure it cannot > happen unless there is a bug in the kernel, which has likely already > corrupted data. Printing a diagnostic at this point is nice if someone > is there to look at it, but letting the kernel do further actions that > may be undefined is not going to make things worse. So I think neither unreachable() nor panic() are suitable for this condition. I guess 'CONFIG_BUG' is not belong to common features, now (and in the future), so it is not suitable still exist in "asm-generic/bug.h", need remove it firstly. And then let the specific architectures to implement their own BUG(), if they want some special features. SO most of arches can skip this issue. Thanks. -- Chen Gang Asianux Corporation From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. Date: Thu, 23 May 2013 19:19:30 +0800 Message-ID: <519DFB42.7010509@asianux.com> References: <519DCBEF.3090208@asianux.com> <201305231139.38233.arnd@arndb.de> <20130523100409.GK18614@n2100.arm.linux.org.uk> <201305231259.43750.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Linux-sh list , Catalin Marinas , Benjamin Herrenschmidt , Heiko Carstens , "paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org" , "H. Peter Anvin" , Michel Lespinasse , Hans-Christian Egtvedt , Linux-Arch , linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Russell King - ARM Linux , Yoshinori Sato , Richard Weinberger , Helge Deller , the arch/x86 maintainers , "James E.J. Bottomley" , "mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , Geert Uytterhoeven , Frederic Weisbecker Return-path: In-Reply-To: <201305231259.43750.arnd-r2nGTMty4D4@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclinux-dist-devel-bounces-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org On 05/23/2013 06:59 PM, Arnd Bergmann wrote: > You don't just want to avoid the code for printing the bug message and > the invalid instruction, we also want the compiler to not emit the > function call or check the enum for unexpected values. The meaning of > BUG() is really that person writing that statement was sure it cannot > happen unless there is a bug in the kernel, which has likely already > corrupted data. Printing a diagnostic at this point is nice if someone > is there to look at it, but letting the kernel do further actions that > may be undefined is not going to make things worse. So I think neither unreachable() nor panic() are suitable for this condition. I guess 'CONFIG_BUG' is not belong to common features, now (and in the future), so it is not suitable still exist in "asm-generic/bug.h", need remove it firstly. And then let the specific architectures to implement their own BUG(), if they want some special features. SO most of arches can skip this issue. Thanks. -- Chen Gang Asianux Corporation From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <519DFB42.7010509@asianux.com> Date: Thu, 23 May 2013 19:19:30 +0800 From: Chen Gang MIME-Version: 1.0 References: <519DCBEF.3090208@asianux.com> <201305231139.38233.arnd@arndb.de> <20130523100409.GK18614@n2100.arm.linux.org.uk> <201305231259.43750.arnd@arndb.de> In-Reply-To: <201305231259.43750.arnd@arndb.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. To: Arnd Bergmann Cc: Russell King - ARM Linux , Geert Uytterhoeven , =?UTF-8?B?SMOldmFyZCBTa2lubmVtb2Vu?= , Hans-Christian Egtvedt , Mike Frysinger , Yoshinori Sato , Richard Kuo , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , "paulus@samba.org" , Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com, Paul Mundt , Jeff Dike , Richard Weinberger , Thomas Gleixner , "mingo@redhat.com" , "H. Peter Anvin" , the arch/x86 maintainers , "Eric W. Biederman" , Serge Hallyn , Paul McKenney , Frederic Weisbecker , David Miller , Andrew Morton , Akinobu Mita , Catalin Marinas , Michel Lespinasse , Will Deacon , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "uclinux-dist-devel@blackfin.uclinux.org" , linux-hexagon@vger.kernel.org, Parisc List , "linuxppc-dev@lists.ozlabs.org" , linux-s390@vger.kernel.org, Linux-sh list , uml-devel , uml-user , Linux-Arch List-ID: On 05/23/2013 06:59 PM, Arnd Bergmann wrote: > You don't just want to avoid the code for printing the bug message and > the invalid instruction, we also want the compiler to not emit the > function call or check the enum for unexpected values. The meaning of > BUG() is really that person writing that statement was sure it cannot > happen unless there is a bug in the kernel, which has likely already > corrupted data. Printing a diagnostic at this point is nice if someone > is there to look at it, but letting the kernel do further actions that > may be undefined is not going to make things worse. So I think neither unreachable() nor panic() are suitable for this condition. I guess 'CONFIG_BUG' is not belong to common features, now (and in the future), so it is not suitable still exist in "asm-generic/bug.h", need remove it firstly. And then let the specific architectures to implement their own BUG(), if they want some special features. SO most of arches can skip this issue. Thanks. -- Chen Gang Asianux Corporation From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from intranet.asianux.com (intranet.asianux.com [58.214.24.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EDDAF2C0408 for ; Thu, 23 May 2013 21:20:28 +1000 (EST) Message-ID: <519DFB42.7010509@asianux.com> Date: Thu, 23 May 2013 19:19:30 +0800 From: Chen Gang MIME-Version: 1.0 To: Arnd Bergmann Subject: Re: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. References: <519DCBEF.3090208@asianux.com> <201305231139.38233.arnd@arndb.de> <20130523100409.GK18614@n2100.arm.linux.org.uk> <201305231259.43750.arnd@arndb.de> In-Reply-To: <201305231259.43750.arnd@arndb.de> Content-Type: text/plain; charset=UTF-8 Cc: Catalin Marinas , Linux-sh list , Heiko Carstens , "paulus@samba.org" , "H. Peter Anvin" , Michel Lespinasse , Hans-Christian Egtvedt , Linux-Arch , linux-s390@vger.kernel.org, Russell King - ARM Linux , Yoshinori Sato , Richard Weinberger , Helge Deller , the arch/x86 maintainers , "James E.J. Bottomley" , "mingo@redhat.com" , Geert Uytterhoeven , Frederic Weisbecker , Paul McKenney , =?UTF-8?B?SMOldmFyZCBTa2lubmVtb2Vu?= , Serge Hallyn , Mike Frysinger , uml-devel , Will Deacon , Jeff Dike , Akinobu Mita , uml-user , "uclinux-dist-devel@blackfin.uclinux.org" , Thomas Gleixner , "linux-arm-kernel@lists.infradead.org" , Parisc List , "linux-kernel@vger.kernel.org" , Richard Kuo , Paul Mundt , "Eric W. Biederman" , linux-hexagon@vger.kernel.org, Martin Schwidefsky , linux390@de.ibm.com, Andrew Morton , "linuxppc-dev@lists.ozlabs.org" , David Miller List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 05/23/2013 06:59 PM, Arnd Bergmann wrote: > You don't just want to avoid the code for printing the bug message and > the invalid instruction, we also want the compiler to not emit the > function call or check the enum for unexpected values. The meaning of > BUG() is really that person writing that statement was sure it cannot > happen unless there is a bug in the kernel, which has likely already > corrupted data. Printing a diagnostic at this point is nice if someone > is there to look at it, but letting the kernel do further actions that > may be undefined is not going to make things worse. So I think neither unreachable() nor panic() are suitable for this condition. I guess 'CONFIG_BUG' is not belong to common features, now (and in the future), so it is not suitable still exist in "asm-generic/bug.h", need remove it firstly. And then let the specific architectures to implement their own BUG(), if they want some special features. SO most of arches can skip this issue. Thanks. -- Chen Gang Asianux Corporation From mboxrd@z Thu Jan 1 00:00:00 1970 From: gang.chen@asianux.com (Chen Gang) Date: Thu, 23 May 2013 19:19:30 +0800 Subject: [PATCH] arch: configuration, deleting 'CONFIG_BUG' since always need it. In-Reply-To: <201305231259.43750.arnd@arndb.de> References: <519DCBEF.3090208@asianux.com> <201305231139.38233.arnd@arndb.de> <20130523100409.GK18614@n2100.arm.linux.org.uk> <201305231259.43750.arnd@arndb.de> Message-ID: <519DFB42.7010509@asianux.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 05/23/2013 06:59 PM, Arnd Bergmann wrote: > You don't just want to avoid the code for printing the bug message and > the invalid instruction, we also want the compiler to not emit the > function call or check the enum for unexpected values. The meaning of > BUG() is really that person writing that statement was sure it cannot > happen unless there is a bug in the kernel, which has likely already > corrupted data. Printing a diagnostic at this point is nice if someone > is there to look at it, but letting the kernel do further actions that > may be undefined is not going to make things worse. So I think neither unreachable() nor panic() are suitable for this condition. I guess 'CONFIG_BUG' is not belong to common features, now (and in the future), so it is not suitable still exist in "asm-generic/bug.h", need remove it firstly. And then let the specific architectures to implement their own BUG(), if they want some special features. SO most of arches can skip this issue. Thanks. -- Chen Gang Asianux Corporation