Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37034C7EE21 for ; Thu, 4 May 2023 22:53:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6DDBB85CC7; Fri, 5 May 2023 00:51:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="UClHh9XZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 898D785CB5; Fri, 5 May 2023 00:51:24 +0200 (CEST) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4B591857D5 for ; Fri, 5 May 2023 00:51:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-76372a83c8eso23912939f.3 for ; Thu, 04 May 2023 15:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1683240681; x=1685832681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f1HmEawRMqGD17BJTwj2JhSUY+oFv1oiYzuZowOqPxM=; b=UClHh9XZqtR3oKXV5m4A7zEs950anC5jVFSyOkRTPWs4Hyj6pBiCk2Mc0vAhODWHRn wr3/Bh9ha5W/gLVEKKZ7rH7GhlPA9jgqCTeiyTTujuhrlpcgJbd3tyO7mxZCh57xS3Ri ahHHkZZ1ztPvUBqbk0LgKLWgYKxQNk6lT8NPw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683240681; x=1685832681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f1HmEawRMqGD17BJTwj2JhSUY+oFv1oiYzuZowOqPxM=; b=IzsmNuc+TdnBLkn8Ql7r2reL40W5SPbwk/0v9DoGClPG0pncWfRJxolFPan3MWW39J wrN2hYmeWWS/HCGPBgak0PUi7XaEYyNdEMPnk2SSm9fIUA7OFpAQOhkFsmlZkGUKmEs7 LFY3fcIlTlNyPcQhToaV0iLusv+KPTp4hTvZQjTmOeUbQnchw9h7uK2cRPqLaeHMEUgl jfy7rC3VrSs7yKmdv4Sx1ULCG4UZsGJp1cKn/mZ+Mek15KujG0tOqxgJqXVrzFKjw3RY GqVQMywDdjYlNEDtMOZ8t7Qk+LkwlT59Ca0+4tAJeVFH882jWNQOAroYJcoZuMicbhRy r2hw== X-Gm-Message-State: AC+VfDxlXttyOrreVMTjKAw1uDI0IiXsP6XhoByynLGDZBcJqhmRJPLj YZpg4byI6oBjJvpTYMBqKX94o0OEPL+rJNeoAKw= X-Google-Smtp-Source: ACHHUZ4HBoKBzv0/QsQIEGG7msExeeQJb055IF0LoQyqfdDKCUYD7yled5QiTmET4Ad1OsqCofaXaA== X-Received: by 2002:a6b:c40a:0:b0:751:d1a9:964f with SMTP id y10-20020a6bc40a000000b00751d1a9964fmr255059ioa.17.1683240680872; Thu, 04 May 2023 15:51:20 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:b5a:9fa0:3da:54ec]) by smtp.gmail.com with ESMTPSA id a26-20020a02735a000000b00414559b3ae8sm166458jae.103.2023.05.04.15.51.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 15:51:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v3 08/17] x86: Tidy up availability of string functions Date: Thu, 4 May 2023 16:50:52 -0600 Message-ID: <20230504225101.2366414-9-sjg@chromium.org> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog In-Reply-To: <20230504225101.2366414-1-sjg@chromium.org> References: <20230504225101.2366414-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean For now, just enable the fast-but-large string functions in 32-boot U-Boot proper only. Avoid using them in SPL. We cannot use then in 64-bit builds since we only have 32-bit assembly. Reviewed-by: Bin Meng Signed-off-by: Simon Glass --- Changes in v3: - Fix 'boot' typo arch/x86/include/asm/string.h | 6 +++++- arch/x86/lib/Makefile | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h index c15b264a5c0..5c49b0f009b 100644 --- a/arch/x86/include/asm/string.h +++ b/arch/x86/include/asm/string.h @@ -14,7 +14,11 @@ extern char *strrchr(const char *s, int c); #undef __HAVE_ARCH_STRCHR extern char *strchr(const char *s, int c); -#ifdef CONFIG_X86_64 +/* + * Our assembly routines do not work on in 64-bit mode and we don't do a lot of + * copying in SPL, so code size is more important there. + */ +#if defined(CONFIG_SPL_BUILD) || !IS_ENABLED(CONFIG_X86_32BIT_INIT) #undef __HAVE_ARCH_MEMCPY extern void *memcpy(void *, const void *, __kernel_size_t); diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index a6f22441474..b0612ae6dd5 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -10,7 +10,9 @@ obj-y += bios.o obj-y += bios_asm.o obj-y += bios_interrupts.o endif -obj-y += string.o +endif +ifndef CONFIG_SPL_BUILD +obj-$(CONFIG_X86_32BIT_INIT) += string.o endif ifndef CONFIG_SPL_BUILD obj-$(CONFIG_CMD_BOOTM) += bootm.o -- 2.40.1.521.gf1e218fcd8-goog