* [PATCH] ARM: small correction to early_ioremap support
@ 2017-06-27 0:57 Doug Berger
2017-06-27 10:46 ` Ard Biesheuvel
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Doug Berger @ 2017-06-27 0:57 UTC (permalink / raw)
To: linux-arm-kernel
The fixmap pages need to be on the same pmd page for the current
implementation of arm early_fixmap. A build time bug check is
used to ensure that. However, the worst case fixmap range is
better represented by __end_of_fixed_addresses than by the value
__end_of_early_ioremap_region.
Fixes: 2937367b8a4b ("ARM: add support for generic early_ioremap/early_memremap")
Signed-off-by: Doug Berger <opendmb@gmail.com>
---
arch/arm/mm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 31af3cb59a60..74c0ed5c3b08 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -392,7 +392,7 @@ void __init early_fixmap_init(void)
* The early fixmap range spans multiple pmds, for which
* we are not prepared:
*/
- BUILD_BUG_ON((__fix_to_virt(__end_of_early_ioremap_region) >> PMD_SHIFT)
+ BUILD_BUG_ON((__fix_to_virt(__end_of_fixed_addresses) >> PMD_SHIFT)
!= FIXADDR_TOP >> PMD_SHIFT);
pmd = fixmap_pmd(FIXADDR_TOP);
--
2.13.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: small correction to early_ioremap support
2017-06-27 0:57 [PATCH] ARM: small correction to early_ioremap support Doug Berger
@ 2017-06-27 10:46 ` Ard Biesheuvel
2017-06-27 21:42 ` kbuild test robot
2017-06-28 2:44 ` Doug Berger
2 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-06-27 10:46 UTC (permalink / raw)
To: linux-arm-kernel
On 27 June 2017 at 00:57, Doug Berger <opendmb@gmail.com> wrote:
> The fixmap pages need to be on the same pmd page for the current
> implementation of arm early_fixmap. A build time bug check is
> used to ensure that. However, the worst case fixmap range is
> better represented by __end_of_fixed_addresses than by the value
> __end_of_early_ioremap_region.
>
> Fixes: 2937367b8a4b ("ARM: add support for generic early_ioremap/early_memremap")
> Signed-off-by: Doug Berger <opendmb@gmail.com>
> ---
> arch/arm/mm/mmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index 31af3cb59a60..74c0ed5c3b08 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -392,7 +392,7 @@ void __init early_fixmap_init(void)
> * The early fixmap range spans multiple pmds, for which
> * we are not prepared:
> */
> - BUILD_BUG_ON((__fix_to_virt(__end_of_early_ioremap_region) >> PMD_SHIFT)
> + BUILD_BUG_ON((__fix_to_virt(__end_of_fixed_addresses) >> PMD_SHIFT)
> != FIXADDR_TOP >> PMD_SHIFT);
>
> pmd = fixmap_pmd(FIXADDR_TOP);
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: small correction to early_ioremap support
2017-06-27 0:57 [PATCH] ARM: small correction to early_ioremap support Doug Berger
2017-06-27 10:46 ` Ard Biesheuvel
@ 2017-06-27 21:42 ` kbuild test robot
2017-06-28 2:44 ` Doug Berger
2 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2017-06-27 21:42 UTC (permalink / raw)
To: linux-arm-kernel
Hi Doug,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.12-rc7 next-20170627]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Doug-Berger/ARM-small-correction-to-early_ioremap-support/20170627-233123
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
All error/warnings (new ones prefixed by >>):
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from arch/arm/mm/mmu.c:10:
arch/arm/mm/mmu.c: In function 'early_fixmap_init':
>> include/linux/compiler.h:529:38: error: call to '__compiletime_assert_396' declared with attribute error: BUILD_BUG_ON failed: (__fix_to_virt(__end_of_fixed_addresses) >> PMD_SHIFT) != FIXADDR_TOP >> PMD_SHIFT
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^
include/linux/compiler.h:512:4: note: in definition of macro '__compiletime_assert'
prefix ## suffix(); \
^~~~~~
include/linux/compiler.h:529:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/bug.h:54:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/bug.h:78:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~~~~~~~~
>> arch/arm/mm/mmu.c:395:2: note: in expansion of macro 'BUILD_BUG_ON'
BUILD_BUG_ON((__fix_to_virt(__end_of_fixed_addresses) >> PMD_SHIFT)
^~~~~~~~~~~~
vim +/__compiletime_assert_396 +529 include/linux/compiler.h
9a8ab1c3 Daniel Santos 2013-02-21 523 *
9a8ab1c3 Daniel Santos 2013-02-21 524 * In tradition of POSIX assert, this macro will break the build if the
9a8ab1c3 Daniel Santos 2013-02-21 525 * supplied condition is *false*, emitting the supplied error message if the
9a8ab1c3 Daniel Santos 2013-02-21 526 * compiler has support to do so.
9a8ab1c3 Daniel Santos 2013-02-21 527 */
9a8ab1c3 Daniel Santos 2013-02-21 528 #define compiletime_assert(condition, msg) \
9a8ab1c3 Daniel Santos 2013-02-21 @529 _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
9a8ab1c3 Daniel Santos 2013-02-21 530
47933ad4 Peter Zijlstra 2013-11-06 531 #define compiletime_assert_atomic_type(t) \
47933ad4 Peter Zijlstra 2013-11-06 532 compiletime_assert(__native_word(t), \
:::::: The code at line 529 was first introduced by commit
:::::: 9a8ab1c39970a4938a72d94e6fd13be88a797590 bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG
:::::: TO: Daniel Santos <daniel.santos@pobox.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 41289 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170628/df29f012/attachment-0001.gz>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: small correction to early_ioremap support
2017-06-27 0:57 [PATCH] ARM: small correction to early_ioremap support Doug Berger
2017-06-27 10:46 ` Ard Biesheuvel
2017-06-27 21:42 ` kbuild test robot
@ 2017-06-28 2:44 ` Doug Berger
2 siblings, 0 replies; 4+ messages in thread
From: Doug Berger @ 2017-06-28 2:44 UTC (permalink / raw)
To: linux-arm-kernel
On 06/26/2017 05:57 PM, Doug Berger wrote:
> The fixmap pages need to be on the same pmd page for the current
> implementation of arm early_fixmap. A build time bug check is
> used to ensure that. However, the worst case fixmap range is
> better represented by __end_of_fixed_addresses than by the value
> __end_of_early_ioremap_region.
I see now that only the early_ioremap portion of the fixmap needs to be
on the same pmd page and not the entire collection of fixmap pages.
Therefore the check against __end_of_early_ioremap_region is the correct
choice for this build time check.
Please disregard this patch.
Sorry for the confusion,
Doug
>
> Fixes: 2937367b8a4b ("ARM: add support for generic early_ioremap/early_memremap")
> Signed-off-by: Doug Berger <opendmb@gmail.com>
> ---
> arch/arm/mm/mmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index 31af3cb59a60..74c0ed5c3b08 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -392,7 +392,7 @@ void __init early_fixmap_init(void)
> * The early fixmap range spans multiple pmds, for which
> * we are not prepared:
> */
> - BUILD_BUG_ON((__fix_to_virt(__end_of_early_ioremap_region) >> PMD_SHIFT)
> + BUILD_BUG_ON((__fix_to_virt(__end_of_fixed_addresses) >> PMD_SHIFT)
> != FIXADDR_TOP >> PMD_SHIFT);
>
> pmd = fixmap_pmd(FIXADDR_TOP);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-06-28 2:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-27 0:57 [PATCH] ARM: small correction to early_ioremap support Doug Berger
2017-06-27 10:46 ` Ard Biesheuvel
2017-06-27 21:42 ` kbuild test robot
2017-06-28 2:44 ` Doug Berger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).