From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 01/11] Add generic fixmap.h Date: Tue, 12 Nov 2013 14:46:40 +0100 Message-ID: <201311121446.40700.arnd@arndb.de> References: <1384262545-20875-1-git-send-email-msalter@redhat.com> <1384262545-20875-2-git-send-email-msalter@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384262545-20875-2-git-send-email-msalter@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Mark Salter Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, Michal Simek , James Hogan , Russell King , linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle , Richard Kuo , Benjamin Herrenschmidt , microblaze-uclinux@itee.uq.edu.au, Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-metag@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-Id: linux-arch.vger.kernel.org On Tuesday 12 November 2013, Mark Salter wrote: > Many architectures provide an asm/fixmap.h which defines support for > compile-time 'special' virtual mappings which need to be made before > paging_init() has run. This suport is also used for early ioremap > on x86. Much of this support is identical across the architectures. > This patch consolidates all of the common bits into asm-generic/fixmap.h > which is intended to be included from arch/*/include/asm/fixmap.h. Good idea, Acked-by: Arnd Bergmann On Tuesday 12 November 2013, Mark Salter wrote: > +static __always_inline unsigned long fix_to_virt(const unsigned int idx) > +{ > + /* > + * this branch gets completely eliminated after inlining, > + * except when someone tries to use fixaddr indices in an > + * illegal way. (such as mixing up address types or using > + * out-of-range indices). > + * > + * If it doesn't get removed, the linker will complain > + * loudly with a reasonably clear error message.. > + */ > + if (idx >= __end_of_fixed_addresses) > + __this_fixmap_does_not_exist(); > + You might be able to turn this into the more readable BUILD_BUG_ON(). Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de ([212.227.126.186]:56313 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752067Ab3KLNre (ORCPT ); Tue, 12 Nov 2013 08:47:34 -0500 From: Arnd Bergmann Subject: Re: [PATCH 01/11] Add generic fixmap.h Date: Tue, 12 Nov 2013 14:46:40 +0100 References: <1384262545-20875-1-git-send-email-msalter@redhat.com> <1384262545-20875-2-git-send-email-msalter@redhat.com> In-Reply-To: <1384262545-20875-2-git-send-email-msalter@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-ID: <201311121446.40700.arnd@arndb.de> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Mark Salter Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Russell King , linux-arm-kernel@lists.infradead.org, Richard Kuo , linux-hexagon@vger.kernel.org, James Hogan , linux-metag@vger.kernel.org, Michal Simek , microblaze-uclinux@itee.uq.edu.au, Ralf Baechle , linux-mips@linux-mips.org, Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org Message-ID: <20131112134640.ZY37y1kDE9OnvMLn2CyY64WetpqXGfFouMHP4qLPQKQ@z> On Tuesday 12 November 2013, Mark Salter wrote: > Many architectures provide an asm/fixmap.h which defines support for > compile-time 'special' virtual mappings which need to be made before > paging_init() has run. This suport is also used for early ioremap > on x86. Much of this support is identical across the architectures. > This patch consolidates all of the common bits into asm-generic/fixmap.h > which is intended to be included from arch/*/include/asm/fixmap.h. Good idea, Acked-by: Arnd Bergmann On Tuesday 12 November 2013, Mark Salter wrote: > +static __always_inline unsigned long fix_to_virt(const unsigned int idx) > +{ > + /* > + * this branch gets completely eliminated after inlining, > + * except when someone tries to use fixaddr indices in an > + * illegal way. (such as mixing up address types or using > + * out-of-range indices). > + * > + * If it doesn't get removed, the linker will complain > + * loudly with a reasonably clear error message.. > + */ > + if (idx >= __end_of_fixed_addresses) > + __this_fixmap_does_not_exist(); > + You might be able to turn this into the more readable BUILD_BUG_ON(). Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2B46B2C00E7 for ; Wed, 13 Nov 2013 00:47:49 +1100 (EST) From: Arnd Bergmann To: Mark Salter Subject: Re: [PATCH 01/11] Add generic fixmap.h Date: Tue, 12 Nov 2013 14:46:40 +0100 References: <1384262545-20875-1-git-send-email-msalter@redhat.com> <1384262545-20875-2-git-send-email-msalter@redhat.com> In-Reply-To: <1384262545-20875-2-git-send-email-msalter@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Message-Id: <201311121446.40700.arnd@arndb.de> Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, Michal Simek , James Hogan , Russell King , linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle , Richard Kuo , microblaze-uclinux@itee.uq.edu.au, Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-metag@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tuesday 12 November 2013, Mark Salter wrote: > Many architectures provide an asm/fixmap.h which defines support for > compile-time 'special' virtual mappings which need to be made before > paging_init() has run. This suport is also used for early ioremap > on x86. Much of this support is identical across the architectures. > This patch consolidates all of the common bits into asm-generic/fixmap.h > which is intended to be included from arch/*/include/asm/fixmap.h. Good idea, Acked-by: Arnd Bergmann On Tuesday 12 November 2013, Mark Salter wrote: > +static __always_inline unsigned long fix_to_virt(const unsigned int idx) > +{ > + /* > + * this branch gets completely eliminated after inlining, > + * except when someone tries to use fixaddr indices in an > + * illegal way. (such as mixing up address types or using > + * out-of-range indices). > + * > + * If it doesn't get removed, the linker will complain > + * loudly with a reasonably clear error message.. > + */ > + if (idx >= __end_of_fixed_addresses) > + __this_fixmap_does_not_exist(); > + You might be able to turn this into the more readable BUILD_BUG_ON(). Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Tue, 12 Nov 2013 14:46:40 +0100 Subject: [PATCH 01/11] Add generic fixmap.h In-Reply-To: <1384262545-20875-2-git-send-email-msalter@redhat.com> References: <1384262545-20875-1-git-send-email-msalter@redhat.com> <1384262545-20875-2-git-send-email-msalter@redhat.com> Message-ID: <201311121446.40700.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tuesday 12 November 2013, Mark Salter wrote: > Many architectures provide an asm/fixmap.h which defines support for > compile-time 'special' virtual mappings which need to be made before > paging_init() has run. This suport is also used for early ioremap > on x86. Much of this support is identical across the architectures. > This patch consolidates all of the common bits into asm-generic/fixmap.h > which is intended to be included from arch/*/include/asm/fixmap.h. Good idea, Acked-by: Arnd Bergmann On Tuesday 12 November 2013, Mark Salter wrote: > +static __always_inline unsigned long fix_to_virt(const unsigned int idx) > +{ > + /* > + * this branch gets completely eliminated after inlining, > + * except when someone tries to use fixaddr indices in an > + * illegal way. (such as mixing up address types or using > + * out-of-range indices). > + * > + * If it doesn't get removed, the linker will complain > + * loudly with a reasonably clear error message.. > + */ > + if (idx >= __end_of_fixed_addresses) > + __this_fixmap_does_not_exist(); > + You might be able to turn this into the more readable BUILD_BUG_ON(). Arnd