From mboxrd@z Thu Jan 1 00:00:00 1970 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 8AB81C433FE for ; Sat, 15 Oct 2022 18:31:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B7E084DE8; Sat, 15 Oct 2022 20:31:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de 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; secure) header.d=gmx.net header.i=@gmx.net header.b="Cl+9OTU6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2791A84DF1; Sat, 15 Oct 2022 20:31:25 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A53B18456E for ; Sat, 15 Oct 2022 20:31:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1665858681; bh=TaPPDl5pejkwq8cjzDGoS0YIqZ6rHccCRV92mfuIbiE=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=Cl+9OTU6ZmHqtGJYZoOrJkcig/EVPJc3rYQeB3T+15UC8c3Y9PVuzYDZ8YNwAlTjk iqB1B20WCYDy/N8qyIzCjuYd2wpeEdtPhvEGs9hQxjJ9djNg6ErFsswB9lMrS83BWm dcz0X7DbLlGY2Cgku96hq+fASBAHytgzJHXg+8eo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.94] ([84.118.157.2]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MVvPJ-1ocF0G1o2f-00Rs4b; Sat, 15 Oct 2022 20:31:21 +0200 Message-ID: <1774657c-51cb-fde7-7f65-a76b8cdcd5f9@gmx.de> Date: Sat, 15 Oct 2022 20:31:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v2] tests: Build correct sandbox configuration on 32bit To: Simon Glass Cc: u-boot@lists.denx.de, Michal Suchanek References: <20221014205234.19385-1-msuchanek@suse.de> Content-Language: en-US From: Heinrich Schuchardt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:dhP0ZmSJ8D1UYk1zUW2kwnvAYeXNb0BX7Yia/eGGRVvywRJWB8Z AZjrGtZLtJ0NuA7jhhIhZV2H6efEtrWCbv05zR9mieBPF6h4tn64Gq12oRtOuaVCgoJx0FY ahc84J1iZIv3ZBHp5EChYc2zVR+qCCn2CuqM0tg2/jIJeIkWcDj1f35JDwobeRx/gxQBvwK z1L/Rlw1I8ADUL3bh5pAg== X-UI-Out-Filterresults: notjunk:1;V03:K0:1zixX6MKepk=:i262YGgTFuXB7dzweUcPNZ Mx8Cw9cV4FiEeItqhUGK5l9Ug3PqPqUnrlCyKxJeGwh5HmdlLS0VEGePpAzYty6sLpPZHAUDx 6A42B/zStK/aQJTZ+ajZEHMrI+jjYIbBAUKlNgde1gqgV9N4JHKmHfrk3QVCdqLIYxr9+iWL6 B+WUqCPMbgl5fX37XpafVMCzWxU4qk0uTQ9LpPeSiG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MdZ4uRe7Qk7W7CRwApHZ7a3+1N1EsQUsWripUE965dJ1PJWqlpN6nnJ0mqzO/C7co7tT 2xS68FIDnFHF4SPvxCOTmxYCGPOMXwt9ka6Zqj0Wn6Ox9QzrSo1tVrwjt/swc8OhyzxOh2BbQ O8oRGoRiP4GD3X9k3kS73cc8AuzRbUwz+etmNOSoEXsq4Aj/N9yA+fhX/RyCigr1bq4NXLFYB kRYUdgpAi3dbe8O/x2jAmbrdZSs8GnAc0Gn2EGo67oYYmqfbtWaOtQyElvY1gxJpFINjAJd5N 1fvZRaZO093YVkvPSicx6hVIgEwRMLGoNEiDoJI4WkZXC 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.6 at phobos.denx.de X-Virus-Status: Clean On 10/15/22 19:53, Simon Glass wrote: > Hi Michal, > > On Fri, 14 Oct 2022 at 14:53, Michal Suchanek wrote: >> >> Currently sandbox configuration defautls to 64bit and there is no >> automation for building 32bit sandbox on 32bit hosts. >> >> Use _LP64 macro as heuristic for detecting 64bit targets. >> >> Signed-off-by: Michal Suchanek >> --- >> >> Changes in v2: >> simplify and move detection to kconfig >> >> --- >> arch/sandbox/Kconfig | 18 +++--------------- >> scripts/Kconfig.include | 4 ++++ >> 2 files changed, 7 insertions(+), 15 deletions(-) > > Reviewed-by: Simon Glass > > My only question is whether we can allow building the 32-bit version > on a 64-bit machine? That would need a separate option I think, to > say: > > I don't want you to automatically determine HOST_32/64BIT. Instead, > use 32 (or 64). > > This is along the lines of what Heinrich is saying, except that I > strongly feel that we must do the right thing by default, as your > patch does. The whole point of phys_addr_t and phys_size_t is that it can be 64bit or 32bit on ilp32. With this patch we cannot build with CONFIG_PHYS_64BIT=3Dy on ilp32 and that is bad. 32 bit phys_addr_t on lp64 is irrelevant for actual hardware but this is what we currently test with sandbox_defconfig on Gitlab CI. My patch is ending up in the same behavior as Michal's patch except that it allows to have 64bit phys_addr_t on ilp32. > >> >> diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig >> index 852a7c8bf2..35508c6b29 100644 >> --- a/arch/sandbox/Kconfig >> +++ b/arch/sandbox/Kconfig >> @@ -13,7 +13,7 @@ config SYS_CPU >> config SANDBOX64 >> bool "Use 64-bit addresses" >> select PHYS_64BIT >> - select HOST_64BIT >> + depends on HOST_64BIT This line is utterly wrong. Best regards Heinrich >> >> config SANDBOX_RAM_SIZE_MB >> int "RAM size in MiB" >> @@ -41,23 +41,11 @@ config SYS_CONFIG_NAME >> default "sandbox_spl" if SANDBOX_SPL >> default "sandbox" if !SANDBOX_SPL >> >> -choice >> - prompt "Run sandbox on 32/64-bit host" >> - default HOST_64BIT >> - help >> - Sandbox can be built on 32-bit and 64-bit hosts. >> - The default is to build on a 64-bit host and run >> - on a 64-bit host. If you want to run sandbox on >> - a 32-bit host, change it here. >> - >> config HOST_32BIT >> - bool "32-bit host" >> - depends on !PHYS_64BIT >> + def_bool ! $(cc-define,_LP64) >> >> config HOST_64BIT >> - bool "64-bit host" >> - >> -endchoice >> + def_bool $(cc-define,_LP64) >> >> config SANDBOX_CRASH_RESET >> bool "Reset on crash" >> diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include >> index dad5583451..b7598ca5d9 100644 >> --- a/scripts/Kconfig.include >> +++ b/scripts/Kconfig.include >> @@ -22,6 +22,10 @@ success =3D $(if-success,$(1),y,n) >> # Return y if the compiler supports , n otherwise >> cc-option =3D $(success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/= null) >> >> +# $(cc-define,) >> +# Return y if the compiler defines , n otherwise >> +cc-define =3D $(success,$(CC) -dM -E -x c /dev/null | grep -q '^#defin= e \<$(1)\>') >> + >> # $(ld-option,) >> # Return y if the linker supports , n otherwise >> ld-option =3D $(success,$(LD) -v $(1)) >> -- >> 2.37.3 >> > > Regards, > SImon