All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] ARM: fix the Kconfig misconversion of CONFIG_USE_ARCH_MEMCPY/MEMSET
@ 2016-12-19 10:31 Masahiro Yamada
  2016-12-19 10:31 ` [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-12-19 10:31 UTC (permalink / raw)
  To: u-boot




Masahiro Yamada (3):
  ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
  common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET)
  README: remove description about CONFIG_USE_ARCH_MEMCPY/SET

 README                        | 6 ------
 arch/arm/Kconfig              | 4 ++--
 arch/arm/include/asm/string.h | 4 ++--
 common/init/board_init.c      | 4 +---
 4 files changed, 5 insertions(+), 13 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
  2016-12-19 10:31 [U-Boot] [PATCH 0/3] ARM: fix the Kconfig misconversion of CONFIG_USE_ARCH_MEMCPY/MEMSET Masahiro Yamada
@ 2016-12-19 10:31 ` Masahiro Yamada
  2016-12-19 11:31   ` Fabio Estevam
                     ` (2 more replies)
  2016-12-19 10:31 ` [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET) Masahiro Yamada
  2016-12-19 10:31 ` [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET Masahiro Yamada
  2 siblings, 3 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-12-19 10:31 UTC (permalink / raw)
  To: u-boot

Commit be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to
Kconfig") is misconversion.

The original logic in include/configs/uniphier.h was as follows:

  #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
  #define CONFIG_USE_ARCH_MEMSET
  #define CONFIG_USE_ARCH_MEMCPY
  #endif

This means those configs were enabled when building U-Boot proper,
but disabled when building SPL.  Likewise for Tegra.

Now "depends on !SPL" prevents any boards with SPL support
from reaching these options.  This changed the behavior for
UniPhier and Tegra SoC family.

Please notice these two options only control the U-Boot proper
build.  As you see arch/arm/Makefile, ARM-specific memset/memcpy
are never compiled for SPL.  So, __HAVE_ARCH_MEMCPY/MEMSET should
not set for SPL.

Fixes: be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

I am restoring the original behavior for now.
But, I have been wondering if we could remove these options entirely.

As you see scripts/config_whitelist.txt, we still have 8000 options.
As I stated before, it is a crazy idea to move all of them as they are.

We should refactor the code, and we should delete options
if they turned out unneeded.

I think CONFIG_USE_ARCH_MEMSET/MEMCPY are questionable ones.

U-Boot supports arch-optimized memcpy/memset
for ARC, ARM (only 32bit), Blackfin, PowerPC, and x86.

Strange enough, only ARM 32bit uses CONFIG_USE_ARCH_MEMSET/MEMCPY
to make it user-configurable.
(Other architectures always turn on the optimized variants if supported)

Even more strangely, those two options enable/disable
ARM-specific memcpy/memset for the U-Boot full image.
(Please note they are never compiled for SPL)

The U-Boot full image generally does not have strong memory
footprint constraint.  So, if we talk about the image size,
it shouldn't hurt to enable ARM-optimized memcpy/set all the time.


 arch/arm/Kconfig              | 4 ++--
 arch/arm/include/asm/string.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 587f288..6820479 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -129,7 +129,7 @@ config ENABLE_ARM_SOC_BOOT0_HOOK
 config USE_ARCH_MEMCPY
 	bool "Use an assembly optimized implementation of memcpy"
 	default y if CPU_V7
-	depends on !ARM64 && !SPL
+	depends on !ARM64
 	help
 	  Enable the generation of an optimized version of memcpy.
 	  Such implementation may be faster under some conditions
@@ -138,7 +138,7 @@ config USE_ARCH_MEMCPY
 config USE_ARCH_MEMSET
 	bool "Use an assembly optimized implementation of memset"
 	default y if CPU_V7
-	depends on !ARM64 && !SPL
+	depends on !ARM64
 	help
 	  Enable the generation of an optimized version of memset.
 	  Such implementation may be faster under some conditions
diff --git a/arch/arm/include/asm/string.h b/arch/arm/include/asm/string.h
index c6dfb25..11eaa34 100644
--- a/arch/arm/include/asm/string.h
+++ b/arch/arm/include/asm/string.h
@@ -14,7 +14,7 @@ extern char * strrchr(const char * s, int c);
 #undef __HAVE_ARCH_STRCHR
 extern char * strchr(const char * s, int c);
 
-#ifdef CONFIG_USE_ARCH_MEMCPY
+#if CONFIG_IS_ENABLED(USE_ARCH_MEMCPY)
 #define __HAVE_ARCH_MEMCPY
 #endif
 extern void * memcpy(void *, const void *, __kernel_size_t);
@@ -26,7 +26,7 @@ extern void * memmove(void *, const void *, __kernel_size_t);
 extern void * memchr(const void *, int, __kernel_size_t);
 
 #undef __HAVE_ARCH_MEMZERO
-#ifdef CONFIG_USE_ARCH_MEMSET
+#if CONFIG_IS_ENABLED(USE_ARCH_MEMSET)
 #define __HAVE_ARCH_MEMSET
 #endif
 extern void * memset(void *, int, __kernel_size_t);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET)
  2016-12-19 10:31 [U-Boot] [PATCH 0/3] ARM: fix the Kconfig misconversion of CONFIG_USE_ARCH_MEMCPY/MEMSET Masahiro Yamada
  2016-12-19 10:31 ` [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra Masahiro Yamada
@ 2016-12-19 10:31 ` Masahiro Yamada
  2016-12-19 11:31   ` Fabio Estevam
  2016-12-19 22:02   ` Tom Rini
  2016-12-19 10:31 ` [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET Masahiro Yamada
  2 siblings, 2 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-12-19 10:31 UTC (permalink / raw)
  To: u-boot

CONFIG_USE_ARCH_MEMSET controls nothing about SPL.  (it is effective
only on U-Boot proper building of ARM).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 common/init/board_init.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/common/init/board_init.c b/common/init/board_init.c
index ef01a9a..a2edb4e 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -15,9 +15,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * It isn't trivial to figure out whether memcpy() exists. The arch-specific
  * memcpy() is not normally available in SPL due to code size.
  */
-#if !defined(CONFIG_SPL_BUILD) || \
-		(defined(CONFIG_SPL_LIBGENERIC_SUPPORT) && \
-		!defined(CONFIG_USE_ARCH_MEMSET))
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBGENERIC_SUPPORT)
 #define _USE_MEMCPY
 #endif
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET
  2016-12-19 10:31 [U-Boot] [PATCH 0/3] ARM: fix the Kconfig misconversion of CONFIG_USE_ARCH_MEMCPY/MEMSET Masahiro Yamada
  2016-12-19 10:31 ` [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra Masahiro Yamada
  2016-12-19 10:31 ` [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET) Masahiro Yamada
@ 2016-12-19 10:31 ` Masahiro Yamada
  2016-12-19 11:32   ` Fabio Estevam
                     ` (2 more replies)
  2 siblings, 3 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-12-19 10:31 UTC (permalink / raw)
  To: u-boot

These options are now described in the Kconfig help.  We do not want
to maintain duplicated documentation.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 README | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/README b/README
index 25cad2f..0bd6e6c 100644
--- a/README
+++ b/README
@@ -4593,12 +4593,6 @@ Low Level (hardware related) configuration options:
 		addressable memory. This option causes some memory accesses
 		to be mapped through map_sysmem() / unmap_sysmem().
 
-- CONFIG_USE_ARCH_MEMCPY
-  CONFIG_USE_ARCH_MEMSET
-		If these options are used a optimized version of memcpy/memset will
-		be used if available. These functions may be faster under some
-		conditions but may increase the binary size.
-
 - CONFIG_X86_RESET_VECTOR
 		If defined, the x86 reset vector code is included. This is not
 		needed when U-Boot is running from Coreboot.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
  2016-12-19 10:31 ` [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra Masahiro Yamada
@ 2016-12-19 11:31   ` Fabio Estevam
  2016-12-19 21:59   ` Tom Rini
  2016-12-27 23:03   ` [U-Boot] [U-Boot, " Tom Rini
  2 siblings, 0 replies; 15+ messages in thread
From: Fabio Estevam @ 2016-12-19 11:31 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 8:31 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Commit be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to
> Kconfig") is misconversion.
>
> The original logic in include/configs/uniphier.h was as follows:
>
>   #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
>   #define CONFIG_USE_ARCH_MEMSET
>   #define CONFIG_USE_ARCH_MEMCPY
>   #endif
>
> This means those configs were enabled when building U-Boot proper,
> but disabled when building SPL.  Likewise for Tegra.
>
> Now "depends on !SPL" prevents any boards with SPL support
> from reaching these options.  This changed the behavior for
> UniPhier and Tegra SoC family.
>
> Please notice these two options only control the U-Boot proper
> build.  As you see arch/arm/Makefile, ARM-specific memset/memcpy
> are never compiled for SPL.  So, __HAVE_ARCH_MEMCPY/MEMSET should
> not set for SPL.
>
> Fixes: be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig")
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET)
  2016-12-19 10:31 ` [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET) Masahiro Yamada
@ 2016-12-19 11:31   ` Fabio Estevam
  2016-12-19 22:02   ` Tom Rini
  1 sibling, 0 replies; 15+ messages in thread
From: Fabio Estevam @ 2016-12-19 11:31 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 8:31 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> CONFIG_USE_ARCH_MEMSET controls nothing about SPL.  (it is effective
> only on U-Boot proper building of ARM).
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET
  2016-12-19 10:31 ` [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET Masahiro Yamada
@ 2016-12-19 11:32   ` Fabio Estevam
  2016-12-19 22:01   ` Tom Rini
  2016-12-29 22:37   ` [U-Boot] [U-Boot, " Tom Rini
  2 siblings, 0 replies; 15+ messages in thread
From: Fabio Estevam @ 2016-12-19 11:32 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 8:31 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> These options are now described in the Kconfig help.  We do not want
> to maintain duplicated documentation.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
  2016-12-19 10:31 ` [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra Masahiro Yamada
  2016-12-19 11:31   ` Fabio Estevam
@ 2016-12-19 21:59   ` Tom Rini
  2016-12-20  4:39     ` Masahiro Yamada
  2016-12-27 23:03   ` [U-Boot] [U-Boot, " Tom Rini
  2 siblings, 1 reply; 15+ messages in thread
From: Tom Rini @ 2016-12-19 21:59 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 07:31:02PM +0900, Masahiro Yamada wrote:
> Commit be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to
> Kconfig") is misconversion.
> 
> The original logic in include/configs/uniphier.h was as follows:
> 
>   #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
>   #define CONFIG_USE_ARCH_MEMSET
>   #define CONFIG_USE_ARCH_MEMCPY
>   #endif
> 
> This means those configs were enabled when building U-Boot proper,
> but disabled when building SPL.  Likewise for Tegra.
> 
> Now "depends on !SPL" prevents any boards with SPL support
> from reaching these options.  This changed the behavior for
> UniPhier and Tegra SoC family.
> 
> Please notice these two options only control the U-Boot proper
> build.  As you see arch/arm/Makefile, ARM-specific memset/memcpy
> are never compiled for SPL.  So, __HAVE_ARCH_MEMCPY/MEMSET should
> not set for SPL.
> 
> Fixes: be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig")
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Ah, oops, thanks for spotting that one.

> ---
> 
> I am restoring the original behavior for now.
> But, I have been wondering if we could remove these options entirely.

We cannot.  That was my first attempt and we have a handful of active (I
checked) boards with tiny enough SPL constraints that switching to the
optimized memcpy/memset push them over size limit and they do not have a
"something" to disable to gain the space back.  So I went with asking
for asking for a conversion to enable by default these options as widely
as possible as it's a good thing by and (no pun intended) large.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161219/ade17d95/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET
  2016-12-19 10:31 ` [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET Masahiro Yamada
  2016-12-19 11:32   ` Fabio Estevam
@ 2016-12-19 22:01   ` Tom Rini
  2016-12-29 22:37   ` [U-Boot] [U-Boot, " Tom Rini
  2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-12-19 22:01 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 07:31:04PM +0900, Masahiro Yamada wrote:

> These options are now described in the Kconfig help.  We do not want
> to maintain duplicated documentation.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161219/4e57e5a0/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET)
  2016-12-19 10:31 ` [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET) Masahiro Yamada
  2016-12-19 11:31   ` Fabio Estevam
@ 2016-12-19 22:02   ` Tom Rini
  2016-12-20  4:33     ` Masahiro Yamada
  1 sibling, 1 reply; 15+ messages in thread
From: Tom Rini @ 2016-12-19 22:02 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 07:31:03PM +0900, Masahiro Yamada wrote:

> CONFIG_USE_ARCH_MEMSET controls nothing about SPL.  (it is effective
> only on U-Boot proper building of ARM).

That's not true.  We have these functions available to SPL and use them
there by default now (as it's a speed win and we want out of SPL ASAP).

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161219/b674cdcc/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET)
  2016-12-19 22:02   ` Tom Rini
@ 2016-12-20  4:33     ` Masahiro Yamada
  0 siblings, 0 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-12-20  4:33 UTC (permalink / raw)
  To: u-boot

Hi Tom.

2016-12-20 7:02 GMT+09:00 Tom Rini <trini@konsulko.com>:
> On Mon, Dec 19, 2016 at 07:31:03PM +0900, Masahiro Yamada wrote:
>
>> CONFIG_USE_ARCH_MEMSET controls nothing about SPL.  (it is effective
>> only on U-Boot proper building of ARM).
>
> That's not true.  We have these functions available to SPL and use them
> there by default now (as it's a speed win and we want out of SPL ASAP).
>

This is not clear to me.

How can you make the optimized memset available to SPL?

As far as see arch/arm/lib/Makefile,
memset.o is only compiled (if CONFIG_USE_ARCH_MEMSET is defined)
for the U-Boot full image.


ifndef CONFIG_SPL_BUILD
ifdef CONFIG_ARM64
obj-y   += relocate_64.o
else
obj-y   += relocate.o
endif

obj-$(CONFIG_CPU_V7M) += cmd_boot.o
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
obj-$(CONFIG_CMD_BOOTI) += bootm.o
obj-$(CONFIG_CMD_BOOTM) += bootm.o
obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o
obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
else
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
endif









-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
  2016-12-19 21:59   ` Tom Rini
@ 2016-12-20  4:39     ` Masahiro Yamada
  2016-12-20 13:39       ` Tom Rini
  0 siblings, 1 reply; 15+ messages in thread
From: Masahiro Yamada @ 2016-12-20  4:39 UTC (permalink / raw)
  To: u-boot

2016-12-20 6:59 GMT+09:00 Tom Rini <trini@konsulko.com>:
> On Mon, Dec 19, 2016 at 07:31:02PM +0900, Masahiro Yamada wrote:
>> Commit be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to
>> Kconfig") is misconversion.
>>
>> The original logic in include/configs/uniphier.h was as follows:
>>
>>   #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
>>   #define CONFIG_USE_ARCH_MEMSET
>>   #define CONFIG_USE_ARCH_MEMCPY
>>   #endif
>>
>> This means those configs were enabled when building U-Boot proper,
>> but disabled when building SPL.  Likewise for Tegra.
>>
>> Now "depends on !SPL" prevents any boards with SPL support
>> from reaching these options.  This changed the behavior for
>> UniPhier and Tegra SoC family.
>>
>> Please notice these two options only control the U-Boot proper
>> build.  As you see arch/arm/Makefile, ARM-specific memset/memcpy
>> are never compiled for SPL.  So, __HAVE_ARCH_MEMCPY/MEMSET should
>> not set for SPL.
>>
>> Fixes: be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig")
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Ah, oops, thanks for spotting that one.
>
>> ---
>>
>> I am restoring the original behavior for now.
>> But, I have been wondering if we could remove these options entirely.
>
> We cannot.  That was my first attempt and we have a handful of active (I
> checked) boards with tiny enough SPL constraints that switching to the
> optimized memcpy/memset push them over size limit and they do not have a
> "something" to disable to gain the space back.  So I went with asking
> for asking for a conversion to enable by default these options as widely
> as possible as it's a good thing by and (no pun intended) large.


Perhaps, I may be missing something, but I could not understand
why you were talking about SPL size constraints.


As far as I understood arch/arm/lib/Makefile,
arch/arm/lib/memset.o is never compiled for SPL
in the first place.

I believe CONFIG_USE_ARCH_MEMSET has no impact to SPL.



ifndef CONFIG_SPL_BUILD
ifdef CONFIG_ARM64
obj-y   += relocate_64.o
else
obj-y   += relocate.o
endif

obj-$(CONFIG_CPU_V7M) += cmd_boot.o
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
obj-$(CONFIG_CMD_BOOTI) += bootm.o
obj-$(CONFIG_CMD_BOOTM) += bootm.o
obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o
obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
else
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
endif






-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
  2016-12-20  4:39     ` Masahiro Yamada
@ 2016-12-20 13:39       ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-12-20 13:39 UTC (permalink / raw)
  To: u-boot

On Tue, Dec 20, 2016 at 01:39:40PM +0900, Masahiro Yamada wrote:
> 2016-12-20 6:59 GMT+09:00 Tom Rini <trini@konsulko.com>:
> > On Mon, Dec 19, 2016 at 07:31:02PM +0900, Masahiro Yamada wrote:
> >> Commit be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to
> >> Kconfig") is misconversion.
> >>
> >> The original logic in include/configs/uniphier.h was as follows:
> >>
> >>   #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
> >>   #define CONFIG_USE_ARCH_MEMSET
> >>   #define CONFIG_USE_ARCH_MEMCPY
> >>   #endif
> >>
> >> This means those configs were enabled when building U-Boot proper,
> >> but disabled when building SPL.  Likewise for Tegra.
> >>
> >> Now "depends on !SPL" prevents any boards with SPL support
> >> from reaching these options.  This changed the behavior for
> >> UniPhier and Tegra SoC family.
> >>
> >> Please notice these two options only control the U-Boot proper
> >> build.  As you see arch/arm/Makefile, ARM-specific memset/memcpy
> >> are never compiled for SPL.  So, __HAVE_ARCH_MEMCPY/MEMSET should
> >> not set for SPL.
> >>
> >> Fixes: be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig")
> >> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> >
> > Ah, oops, thanks for spotting that one.
> >
> >> ---
> >>
> >> I am restoring the original behavior for now.
> >> But, I have been wondering if we could remove these options entirely.
> >
> > We cannot.  That was my first attempt and we have a handful of active (I
> > checked) boards with tiny enough SPL constraints that switching to the
> > optimized memcpy/memset push them over size limit and they do not have a
> > "something" to disable to gain the space back.  So I went with asking
> > for asking for a conversion to enable by default these options as widely
> > as possible as it's a good thing by and (no pun intended) large.
> 
> 
> Perhaps, I may be missing something, but I could not understand
> why you were talking about SPL size constraints.
> 
> 
> As far as I understood arch/arm/lib/Makefile,
> arch/arm/lib/memset.o is never compiled for SPL
> in the first place.
> 
> I believe CONFIG_USE_ARCH_MEMSET has no impact to SPL.

Because, blarg, oversight.  We want these available to SPL because it
fixes problems (due to non-optimized memset being so slow) on some
platforms and otherwise is a speed win.  I had been testing changes to
move this all globally over, and found the size problems there.

But... at this point, no, I shouldn't also pull in making these
functions be in SPL as I had intended, I should be good and correct that
part in v2017.03.  And take your Kconfig fix as-is, as it's correct.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161220/d4b47053/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [U-Boot, 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
  2016-12-19 10:31 ` [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra Masahiro Yamada
  2016-12-19 11:31   ` Fabio Estevam
  2016-12-19 21:59   ` Tom Rini
@ 2016-12-27 23:03   ` Tom Rini
  2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-12-27 23:03 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 07:31:02PM +0900, Masahiro Yamada wrote:

> Commit be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to
> Kconfig") is misconversion.
> 
> The original logic in include/configs/uniphier.h was as follows:
> 
>   #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
>   #define CONFIG_USE_ARCH_MEMSET
>   #define CONFIG_USE_ARCH_MEMCPY
>   #endif
> 
> This means those configs were enabled when building U-Boot proper,
> but disabled when building SPL.  Likewise for Tegra.
> 
> Now "depends on !SPL" prevents any boards with SPL support
> from reaching these options.  This changed the behavior for
> UniPhier and Tegra SoC family.
> 
> Please notice these two options only control the U-Boot proper
> build.  As you see arch/arm/Makefile, ARM-specific memset/memcpy
> are never compiled for SPL.  So, __HAVE_ARCH_MEMCPY/MEMSET should
> not set for SPL.
> 
> Fixes: be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig")
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161227/8ded5198/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [U-Boot, 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET
  2016-12-19 10:31 ` [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET Masahiro Yamada
  2016-12-19 11:32   ` Fabio Estevam
  2016-12-19 22:01   ` Tom Rini
@ 2016-12-29 22:37   ` Tom Rini
  2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-12-29 22:37 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 19, 2016 at 07:31:04PM +0900, Masahiro Yamada wrote:

> These options are now described in the Kconfig help.  We do not want
> to maintain duplicated documentation.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161229/a3b280e5/attachment.sig>

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-12-29 22:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 10:31 [U-Boot] [PATCH 0/3] ARM: fix the Kconfig misconversion of CONFIG_USE_ARCH_MEMCPY/MEMSET Masahiro Yamada
2016-12-19 10:31 ` [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra Masahiro Yamada
2016-12-19 11:31   ` Fabio Estevam
2016-12-19 21:59   ` Tom Rini
2016-12-20  4:39     ` Masahiro Yamada
2016-12-20 13:39       ` Tom Rini
2016-12-27 23:03   ` [U-Boot] [U-Boot, " Tom Rini
2016-12-19 10:31 ` [U-Boot] [PATCH 2/3] common/init: remove meaningless defined(CONFIG_USE_ARCH_MEMSET) Masahiro Yamada
2016-12-19 11:31   ` Fabio Estevam
2016-12-19 22:02   ` Tom Rini
2016-12-20  4:33     ` Masahiro Yamada
2016-12-19 10:31 ` [U-Boot] [PATCH 3/3] README: remove description about CONFIG_USE_ARCH_MEMCPY/SET Masahiro Yamada
2016-12-19 11:32   ` Fabio Estevam
2016-12-19 22:01   ` Tom Rini
2016-12-29 22:37   ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.