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 6F2A5C433FE for ; Sat, 15 Oct 2022 19:06:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 023BC84DFC; Sat, 15 Oct 2022 21:05:59 +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="SV13xMXc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0A35084E22; Sat, 15 Oct 2022 21:05:58 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 A963284D5E for ; Sat, 15 Oct 2022 21:05:55 +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=1665860754; bh=Svn2fSeys/YeejSr3qvQlnAcuAfOTMjxWadEj/maQSI=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=SV13xMXcnWe84pgXAe9kzEkuHwJWQw4dKsmkOltvCkKVWMGqkvP9+WMbvhEkX1olb ILdwl1IBVIFP23O5WGlVQpB0xF2uPL3n6WrrUgWrJ7ufvRE/uvhVh0/gaL955mmXis k8syNZYjThRVPkisA5jO8bG5RH3tkrvF7IOTibpE= 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 1N2Dx8-1p8mC41d9i-013fsO; Sat, 15 Oct 2022 21:05:54 +0200 Message-ID: <3558da2e-3e66-0b66-cf77-29106653beec@gmx.de> Date: Sat, 15 Oct 2022 21:05:53 +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 Content-Language: en-US To: Simon Glass Cc: u-boot@lists.denx.de, Michal Suchanek References: <20221014205234.19385-1-msuchanek@suse.de> <1774657c-51cb-fde7-7f65-a76b8cdcd5f9@gmx.de> 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:9bNVpSu5oRq0LJOyStzAyNTlRAZP+WvDJYmweXK7CG1djWHSKBW Va7luoqIf48O82O120KUmIi3wk3TPpbKftmBcJH64VmHHoDCxcDqao0cyBVKafGPUuaCUQX ycLNProZjRd9lZ7AjxuTRa8Y7VCnel0P+l/Rmx7Xb8YVAweTNVG2JYfcSdAQFZSR0b1OtyE 2NbdaswgeF5F1/TYb2VFw== X-UI-Out-Filterresults: notjunk:1;V03:K0:p3OoVsqJOvk=:lVkrNxsgXDbUEDXovCOefs fLgiQP8YL1BZq7mNrtk8j+ydXIvaGplul0nZJRGlPU32QWQ2GJKQ8X+2y2fXsV/tpp59jfi8E Pl89KnCDGDUVBC7u3uZZcQbCw8yp+4vLafiNVllCxrwDGRnthr2u833hp2zgI4gRPG6kYM9FV GsjWxC4Omd+hZtI/+AKczP5yUYR1onHjyg04QcBlS+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Ia5yqXzncUB26uQo7rqNVqioEa44U8KtYDJTgMRMF1 04iNKfvkfHJPnV+/eUKWmmPdPN1J9vAMqgpd3wNYaDXq658+eO86mGwuKgJcxiJQE28tIqLu5 pLclWUSk3qGJCgP8JuwW5uJCEylxTyN8vlzZ/mGw9lafrsMh4AWVqjBoG4A2cXFXl45xWE6Pi FoG9aNlUtE6t4Zkx39cBbLkdJM4lReCUsaAZ8sG0EdCT9n8oLOVFlCCcQzDe649pO5W6liX13 CdQxRiFUJckQya3iCCIbUuQgUyGInREv66ClBjM4+Tiwf 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 20:39, Simon Glass wrote: > Hi Heinrich, > > On Sat, 15 Oct 2022 at 12:31, Heinrich Schuchardt w= rote: >> >> On 10/15/22 19:53, Simon Glass wrote: >>> Hi Michal, >>> >>> On Fri, 14 Oct 2022 at 14:53, Michal Suchanek wrot= e: >>>> >>>> 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 i= s >> what we currently test with sandbox_defconfig on Gitlab CI. >> >> My patch is ending up in the same behavior as Michal's patch except tha= t >> it allows to have 64bit phys_addr_t on ilp32. > > It needs to automatically default to 32 or 64 bit depending on the > host. If the user wants to fiddle with Kconfig to force it to the > other one, that should be possible to. > > It looks like your patch requires manual configuration, but perhaps I > just misunderstood it? __LP64__ is a symbol defined by the compiler when compiling for 64bit and not defined when compiling for 32bit systems. There is nothing manual about it. My patch uses this symbol to replace HOST_32BIT and HOST_64BIT. Michal's patch compiles a program tools/bits-per-long.c that ends up returning 64 on 64 bit systems (where __LP64__ is defined) and 32 on 32 bit systems (where __LP64__ is not defined) and then chooses HOST_32BIT and HOST_64BIT accordingly. This part of Michal's patch is not wrong. The solution is only overly complicated. What has to be chosen manually with both patches is PHYS_64BIT e.g. by selecting sandbox64_defconfig instead of sandbox_defconfig. Unfortunately Michal did not understand that PHYS_64BIT=3Dy, HOST_32BIT=3D= y is a necessary test scenario and introduced an invalid dependency. With my patch sandbox64_defconfig on a 32bit system uses 64bit phys_addr_t= . With Michal's patch sandbox64_defconfig on a 32bit system uses 32bit phys_addr_t. Best regards Heinrich