From patchwork Mon Dec 19 10:31:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 88451 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1084263qgi; Mon, 19 Dec 2016 02:31:43 -0800 (PST) X-Received: by 10.194.2.110 with SMTP id 14mr12738115wjt.206.1482143503482; Mon, 19 Dec 2016 02:31:43 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id tz15si17964114wjb.56.2016.12.19.02.31.43; Mon, 19 Dec 2016 02:31:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DB9B2B38B6; Mon, 19 Dec 2016 11:31:42 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K3tCbPHNhm-6; Mon, 19 Dec 2016 11:31:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F61EB38A1; Mon, 19 Dec 2016 11:31:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4EA6EB38AE for ; Mon, 19 Dec 2016 11:31:35 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RIPiVTvVfwzK for ; Mon, 19 Dec 2016 11:31:35 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by theia.denx.de (Postfix) with ESMTPS id 123E8B389C for ; Mon, 19 Dec 2016 11:31:28 +0100 (CET) Received: from pug.jp.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id uBJAV6AT021021; Mon, 19 Dec 2016 19:31:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com uBJAV6AT021021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1482143468; bh=KBPjGPIjzbu43/odN4mIS2bASqO3rjflzpgFETVn1Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=seCscYZhwnZQ2vdMQ0V5y1fG1MqHWb6MPKh4pJhtvF8MCww+7vBVtBH2cXaIgvAFX 1T331RGRoI9EbF5S1M3DuvHtc6Me3I8a6x5pHJrUeiTaRs4rvGDMJYaTtYRiAv657m NgpNLxLGxYD8F4uj3Njl6sspEpk/4widmGoRHZyOqYZ7pStfdT/fxtO8GGqxHMOfq1 0fBgxBJJDcInJc5quHc54j2LRVVuLysMwbtc7fAPY20I4DyByikC3C1U6B9bv9ydvv +pr/NC7sjuiUIRar+/6sW0Z4a54wnXMSfp4VIksgN9o0x98JSg35lvPQq7TqVRxZlR O6JqEEJa6wVZQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 19 Dec 2016 19:31:02 +0900 Message-Id: <1482143465-14584-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482143465-14584-1-git-send-email-yamada.masahiro@socionext.com> References: <1482143465-14584-1-git-send-email-yamada.masahiro@socionext.com> Cc: Fabio Estevam , Tom Rini , Albert Aribaud Subject: [U-Boot] [PATCH 1/3] ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "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 --- 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(-) -- 2.7.4 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot Reviewed-by: Fabio Estevam 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);