[{"id":1758930,"web_url":"http://patchwork.ozlabs.org/comment/1758930/","msgid":"<c27bed51-7497-94cb-ad65-fa6d58843549@suse.de>","list_archive_url":null,"date":"2017-08-28T23:30:15","subject":"Re: [U-Boot] [PATCH 1/1] efi_loader: bootefi hello should use\n\tloadaddr","submitter":{"id":1212,"url":"http://patchwork.ozlabs.org/api/people/1212/","name":"Alexander Graf","email":"agraf@suse.de"},"content":"On 28.08.17 18:54, Heinrich Schuchardt wrote:\n> Command 'bootefi hello' currently uses CONFIG_SYS_LOAD_ADDR\n> as loading address.\n> \n> qemu machines have by default 128 MiB RAM.\n> CONFIG_SYS_LOAD_ADDR for x86 is 0x20000000 (512 MiB).\n> This causes 'bootefi hello' to fail.\n> \n> We should use the environment variable loadaddr if available.\n> It defaults to 0x1000000 (16 MiB) on qemu_x86.\n> \n> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n> ---\n>   cmd/bootefi.c | 6 +++++-\n>   1 file changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/cmd/bootefi.c b/cmd/bootefi.c\n> index 47771f87cc..a3768158a2 100644\n> --- a/cmd/bootefi.c\n> +++ b/cmd/bootefi.c\n> @@ -300,7 +300,11 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])\n>   \tif (!strcmp(argv[1], \"hello\")) {\n>   \t\tulong size = __efi_hello_world_end - __efi_hello_world_begin;\n>   \n> -\t\taddr = CONFIG_SYS_LOAD_ADDR;\n> +\t\tsaddr = env_get(\"loadaddr\");\n> +\t\tif (saddr)\n> +\t\t\taddr = simple_strtoul(saddr, NULL, 16);\n> +\t\telse\n> +\t\t\taddr = CONFIG_SYS_LOAD_ADDR;\n\nI'm not terribly happy about that logic. Ideally I would want to have it \nload to *one* explicit address, not multiple ones.\n\nMaybe we could just always memalign() a region?\n\nAlternatively if we can not use memalign, I would rather drop the \nCONFIG_SYS_LOAD_ADDR branch and *only* rely on loadaddr.\n\n\nAlex","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xh7L54tvdz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 09:30:37 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 306D4C22558; Mon, 28 Aug 2017 23:30:23 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id A7F36C222D3;\n\tMon, 28 Aug 2017 23:30:20 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 38B7AC222D3; Mon, 28 Aug 2017 23:30:17 +0000 (UTC)","from mx1.suse.de (mx2.suse.de [195.135.220.15])\n\tby lists.denx.de (Postfix) with ESMTPS id 80833C2254A\n\tfor <u-boot@lists.denx.de>; Mon, 28 Aug 2017 23:30:16 +0000 (UTC)","from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id 0BF51AE99;\n\tMon, 28 Aug 2017 23:30:16 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED\n\tautolearn=unavailable autolearn_force=no version=3.4.0","X-Virus-Scanned":"by amavisd-new at test-mx.suse.de","To":"Heinrich Schuchardt <xypron.glpk@gmx.de>","References":"<20170828165430.6139-1-xypron.glpk@gmx.de>","From":"Alexander Graf <agraf@suse.de>","Message-ID":"<c27bed51-7497-94cb-ad65-fa6d58843549@suse.de>","Date":"Tue, 29 Aug 2017 01:30:15 +0200","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0)\n\tGecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170828165430.6139-1-xypron.glpk@gmx.de>","Content-Language":"en-US","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH 1/1] efi_loader: bootefi hello should use\n\tloadaddr","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1759049,"web_url":"http://patchwork.ozlabs.org/comment/1759049/","msgid":"<8f2ac139-96a2-d054-df3b-00a801988602@gmx.de>","list_archive_url":null,"date":"2017-08-29T05:56:22","subject":"Re: [U-Boot] [PATCH 1/1] efi_loader: bootefi hello should use\n\tloadaddr","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"content":"On 08/29/2017 01:30 AM, Alexander Graf wrote:\n> \n> \n> On 28.08.17 18:54, Heinrich Schuchardt wrote:\n>> Command 'bootefi hello' currently uses CONFIG_SYS_LOAD_ADDR\n>> as loading address.\n>>\n>> qemu machines have by default 128 MiB RAM.\n>> CONFIG_SYS_LOAD_ADDR for x86 is 0x20000000 (512 MiB).\n>> This causes 'bootefi hello' to fail.\n>>\n>> We should use the environment variable loadaddr if available.\n>> It defaults to 0x1000000 (16 MiB) on qemu_x86.\n>>\n>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n>> ---\n>>   cmd/bootefi.c | 6 +++++-\n>>   1 file changed, 5 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/cmd/bootefi.c b/cmd/bootefi.c\n>> index 47771f87cc..a3768158a2 100644\n>> --- a/cmd/bootefi.c\n>> +++ b/cmd/bootefi.c\n>> @@ -300,7 +300,11 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag,\n>> int argc, char * const argv[])\n>>       if (!strcmp(argv[1], \"hello\")) {\n>>           ulong size = __efi_hello_world_end - __efi_hello_world_begin;\n>>   -        addr = CONFIG_SYS_LOAD_ADDR;\n>> +        saddr = env_get(\"loadaddr\");\n>> +        if (saddr)\n>> +            addr = simple_strtoul(saddr, NULL, 16);\n>> +        else\n>> +            addr = CONFIG_SYS_LOAD_ADDR;\n> \n> I'm not terribly happy about that logic. Ideally I would want to have it\n> load to *one* explicit address, not multiple ones.\n> \n> Maybe we could just always memalign() a region?\n> \n> Alternatively if we can not use memalign, I would rather drop the\n> CONFIG_SYS_LOAD_ADDR branch and *only* rely on loadaddr.\n> \n> \n> Alex\n> \n\nA user might have deleted loadaddr from the environment.\nIf we do not fallback to CONFIG_SYS_LOAD_ADDR we would have to create an\nerror message saying that we cannot do without loadaddr.\n\nShall I adjust the patch in this way?\n\nBest regards\n\nHeinrich","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhJQN4p89z9t3F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 16:19:55 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 6AF26C21F0D; Tue, 29 Aug 2017 06:07:10 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id CC4E9C21DD9;\n\tTue, 29 Aug 2017 06:07:04 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid AFD7FC21DAE; Tue, 29 Aug 2017 05:56:31 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.22])\n\tby lists.denx.de (Postfix) with ESMTPS id 0D4BDC21EA1\n\tfor <u-boot@lists.denx.de>; Tue, 29 Aug 2017 05:56:30 +0000 (UTC)","from [192.168.123.31] ([84.118.154.110]) by mail.gmx.com (mrgmx101\n\t[212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0LnTjW-1dJacP3onG-00hgMD; Tue, 29 Aug 2017 07:56:28 +0200"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","To":"Alexander Graf <agraf@suse.de>","References":"<20170828165430.6139-1-xypron.glpk@gmx.de>\n\t<c27bed51-7497-94cb-ad65-fa6d58843549@suse.de>","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Message-ID":"<8f2ac139-96a2-d054-df3b-00a801988602@gmx.de>","Date":"Tue, 29 Aug 2017 07:56:22 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<c27bed51-7497-94cb-ad65-fa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6a3brq7TN9vpnZlUa49pgJXYrV28PL2/9\n\tF1Rono8srp0V+W40fEOYTARQaVT1zzHY34PUnh6uDczFTcbC5nqV/m1NdroBatmlB+dLWX0ti\n\t66qkPegFURHT72F6w0nBxKb6K5G5Gl/54vmywK49u9WHoglxmo=","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH 1/1] efi_loader: bootefi hello should use\n\tloadaddr","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1759277,"web_url":"http://patchwork.ozlabs.org/comment/1759277/","msgid":"<6d5ee853-5bf2-874f-3bd1-089731ebe04d@suse.de>","list_archive_url":null,"date":"2017-08-29T11:22:32","subject":"Re: [U-Boot] [PATCH 1/1] efi_loader: bootefi hello should use\n\tloadaddr","submitter":{"id":1212,"url":"http://patchwork.ozlabs.org/api/people/1212/","name":"Alexander Graf","email":"agraf@suse.de"},"content":"On 08/29/2017 07:56 AM, Heinrich Schuchardt wrote:\n> On 08/29/2017 01:30 AM, Alexander Graf wrote:\n>>\n>> On 28.08.17 18:54, Heinrich Schuchardt wrote:\n>>> Command 'bootefi hello' currently uses CONFIG_SYS_LOAD_ADDR\n>>> as loading address.\n>>>\n>>> qemu machines have by default 128 MiB RAM.\n>>> CONFIG_SYS_LOAD_ADDR for x86 is 0x20000000 (512 MiB).\n>>> This causes 'bootefi hello' to fail.\n>>>\n>>> We should use the environment variable loadaddr if available.\n>>> It defaults to 0x1000000 (16 MiB) on qemu_x86.\n>>>\n>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n>>> ---\n>>>    cmd/bootefi.c | 6 +++++-\n>>>    1 file changed, 5 insertions(+), 1 deletion(-)\n>>>\n>>> diff --git a/cmd/bootefi.c b/cmd/bootefi.c\n>>> index 47771f87cc..a3768158a2 100644\n>>> --- a/cmd/bootefi.c\n>>> +++ b/cmd/bootefi.c\n>>> @@ -300,7 +300,11 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag,\n>>> int argc, char * const argv[])\n>>>        if (!strcmp(argv[1], \"hello\")) {\n>>>            ulong size = __efi_hello_world_end - __efi_hello_world_begin;\n>>>    -        addr = CONFIG_SYS_LOAD_ADDR;\n>>> +        saddr = env_get(\"loadaddr\");\n>>> +        if (saddr)\n>>> +            addr = simple_strtoul(saddr, NULL, 16);\n>>> +        else\n>>> +            addr = CONFIG_SYS_LOAD_ADDR;\n>> I'm not terribly happy about that logic. Ideally I would want to have it\n>> load to *one* explicit address, not multiple ones.\n>>\n>> Maybe we could just always memalign() a region?\n>>\n>> Alternatively if we can not use memalign, I would rather drop the\n>> CONFIG_SYS_LOAD_ADDR branch and *only* rely on loadaddr.\n>>\n>>\n>> Alex\n>>\n> A user might have deleted loadaddr from the environment.\n> If we do not fallback to CONFIG_SYS_LOAD_ADDR we would have to create an\n> error message saying that we cannot do without loadaddr.\n>\n> Shall I adjust the patch in this way?\n\nNo, let's do it the same way as booti / bootz. Just use the global \nload_addr variable.\n\n\nAlex","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhSRx0y1bz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 22:21:48 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 8A583C22005; Tue, 29 Aug 2017 12:15:00 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 17BFCC220A1;\n\tTue, 29 Aug 2017 12:14:56 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 74199C21F46; Tue, 29 Aug 2017 11:22:33 +0000 (UTC)","from mx1.suse.de (mx2.suse.de [195.135.220.15])\n\tby lists.denx.de (Postfix) with ESMTPS id 62826C21FF3\n\tfor <u-boot@lists.denx.de>; Tue, 29 Aug 2017 11:22:33 +0000 (UTC)","from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id BC986ADAA;\n\tTue, 29 Aug 2017 11:22:32 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED\n\tautolearn=unavailable autolearn_force=no version=3.4.0","X-Virus-Scanned":"by amavisd-new at test-mx.suse.de","To":"Heinrich Schuchardt <xypron.glpk@gmx.de>","References":"<20170828165430.6139-1-xypron.glpk@gmx.de>\n\t<c27bed51-7497-94cb-ad65-fa6d58843549@suse.de>\n\t<8f2ac139-96a2-d054-df3b-00a801988602@gmx.de>","From":"Alexander Graf <agraf@suse.de>","Message-ID":"<6d5ee853-5bf2-874f-3bd1-089731ebe04d@suse.de>","Date":"Tue, 29 Aug 2017 13:22:32 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.6.0","MIME-Version":"1.0","In-Reply-To":"<8f2ac139-96a2-d054-df3b-00a801988602@gmx.de>","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH 1/1] efi_loader: bootefi hello should use\n\tloadaddr","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]