[{"id":1769883,"web_url":"http://patchwork.ozlabs.org/comment/1769883/","msgid":"<0ddb1a1f-b1e2-5da1-1fd8-22a2a44d59f9@gmx.de>","list_archive_url":null,"date":"2017-09-18T06:12:12","subject":"Re: [U-Boot] [PATCH 06/16] efi: sandbox: Adjust memory setup for\n\tsandbox","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"content":"On 09/18/2017 12:59 AM, Simon Glass wrote:\n> With sandbox the U-Boot code is not mapped into the sandbox memory range\n> so does not need to be excluded when allocating EFI memory. Update the EFI\n> memory init code to take account of that.\n> \n> Signed-off-by: Simon Glass <sjg@chromium.org>\n> ---\n> \n>  lib/efi_loader/efi_memory.c | 28 ++++++++++++++++------------\n>  1 file changed, 16 insertions(+), 12 deletions(-)\n> \n> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\n> index ad3d277be6..c1a080e2e9 100644\n> --- a/lib/efi_loader/efi_memory.c\n> +++ b/lib/efi_loader/efi_memory.c\n> @@ -459,18 +459,22 @@ int efi_memory_init(void)\n>  \n>  \tefi_add_known_memory();\n>  \n> -\t/* Add U-Boot */\n> -\tuboot_start = (gd->start_addr_sp - uboot_stack_size) & ~EFI_PAGE_MASK;\n> -\tuboot_pages = (gd->ram_top - uboot_start) >> EFI_PAGE_SHIFT;\n> -\tefi_add_memory_map(uboot_start, uboot_pages, EFI_LOADER_DATA, false);\n> -\n> -\t/* Add Runtime Services */\n> -\truntime_start = (ulong)&__efi_runtime_start & ~EFI_PAGE_MASK;\n> -\truntime_end = (ulong)&__efi_runtime_stop;\n> -\truntime_end = (runtime_end + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;\n> -\truntime_pages = (runtime_end - runtime_start) >> EFI_PAGE_SHIFT;\n> -\tefi_add_memory_map(runtime_start, runtime_pages,\n> -\t\t\t   EFI_RUNTIME_SERVICES_CODE, false);\n> +\tif (!IS_ENABLED(CONFIG_SANDBOX)) {\n\nWe need the memory maps for:\nGetMemoryMap\nExitBootServices\n\nIn efi_init_memory_init you define 8 MB memory starting at\n0x0000000000000000 as available:\nram_start 0\nstart 0\npages 8000\n\nI suggest you override efi_init_memory_init using malloc to assign at\nleast 128 MB contiguous memory with alignment EFI_PAGE_SIZE.\n\nRegards\n\nHeinrich\n\n> +\t\t/* Add U-Boot */\n> +\t\tuboot_start = (gd->start_addr_sp - uboot_stack_size) &\n> +\t\t\t\t~EFI_PAGE_MASK;\n> +\t\tuboot_pages = (gd->ram_top - uboot_start) >> EFI_PAGE_SHIFT;\n> +\t\tefi_add_memory_map(uboot_start, uboot_pages, EFI_LOADER_DATA,\n> +\t\t\t\t   false);\n> +\n> +\t\t/* Add Runtime Services */\n> +\t\truntime_start = (ulong)&__efi_runtime_start & ~EFI_PAGE_MASK;\n> +\t\truntime_end = (ulong)&__efi_runtime_stop;\n> +\t\truntime_end = (runtime_end + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;\n> +\t\truntime_pages = (runtime_end - runtime_start) >> EFI_PAGE_SHIFT;\n> +\t\tefi_add_memory_map(runtime_start, runtime_pages,\n> +\t\t\t\t   EFI_RUNTIME_SERVICES_CODE, false);\n> +\t}\n>  \n>  #ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER\n>  \t/* Request a 32bit 64MB bounce buffer region */\n>","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 3xwbJb5PrSz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 16:12:30 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 0943CC21F0B; Mon, 18 Sep 2017 06:12:23 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id F20BEC21D57;\n\tMon, 18 Sep 2017 06:12:20 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 331EAC21D57; Mon, 18 Sep 2017 06:12:20 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.20])\n\tby lists.denx.de (Postfix) with ESMTPS id D51ACC21D19\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 06:12:19 +0000 (UTC)","from [192.168.123.58] ([84.118.154.110]) by mail.gmx.com (mrgmx103\n\t[212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0MPUFR-1dpAS60KW1-004mNg; Mon, 18 Sep 2017 08:12:15 +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, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0","To":"Simon Glass <sjg@chromium.org>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","References":"<20170917225927.117917-1-sjg@chromium.org>\n\t<20170917225927.117917-7-sjg@chromium.org>","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Message-ID":"<0ddb1a1f-b1e2-5da1-1fd8-22a2a44d59f9@gmx.de>","Date":"Mon, 18 Sep 2017 08:12:12 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170917225927.117917-7-sjg@chromium.org>","Content-Language":"en-US","X-Provags-ID":"V03:K0:gol+kd8cESm4o35pRwO6p8X7+5e6xDlqt/H9KzB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X1dNsXV5kwGfBvXPmZB\n\tq8lIihMeAeP+l22z87Cgz1bOZOArBtioUjHwflbHaO62MDyUQs=","Cc":"Andy Shevchenko <andriy.shevchenko@linux.intel.com>","Subject":"Re: [U-Boot] [PATCH 06/16] efi: sandbox: Adjust memory setup for\n\tsandbox","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":1815661,"web_url":"http://patchwork.ozlabs.org/comment/1815661/","msgid":"<CAPnjgZ1Jn1z4+W2tsXg8SdJA0V=ZMdXUkFs_EL+JZA9doHVcAQ@mail.gmail.com>","list_archive_url":null,"date":"2017-12-04T22:45:10","subject":"Re: [U-Boot] [PATCH 06/16] efi: sandbox: Adjust memory setup for\n\tsandbox","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Heinrich,\n\nOn 18 September 2017 at 00:12, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:\n> On 09/18/2017 12:59 AM, Simon Glass wrote:\n>> With sandbox the U-Boot code is not mapped into the sandbox memory range\n>> so does not need to be excluded when allocating EFI memory. Update the EFI\n>> memory init code to take account of that.\n>>\n>> Signed-off-by: Simon Glass <sjg@chromium.org>\n>> ---\n>>\n>>  lib/efi_loader/efi_memory.c | 28 ++++++++++++++++------------\n>>  1 file changed, 16 insertions(+), 12 deletions(-)\n>>\n>> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\n>> index ad3d277be6..c1a080e2e9 100644\n>> --- a/lib/efi_loader/efi_memory.c\n>> +++ b/lib/efi_loader/efi_memory.c\n>> @@ -459,18 +459,22 @@ int efi_memory_init(void)\n>>\n>>       efi_add_known_memory();\n>>\n>> -     /* Add U-Boot */\n>> -     uboot_start = (gd->start_addr_sp - uboot_stack_size) & ~EFI_PAGE_MASK;\n>> -     uboot_pages = (gd->ram_top - uboot_start) >> EFI_PAGE_SHIFT;\n>> -     efi_add_memory_map(uboot_start, uboot_pages, EFI_LOADER_DATA, false);\n>> -\n>> -     /* Add Runtime Services */\n>> -     runtime_start = (ulong)&__efi_runtime_start & ~EFI_PAGE_MASK;\n>> -     runtime_end = (ulong)&__efi_runtime_stop;\n>> -     runtime_end = (runtime_end + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;\n>> -     runtime_pages = (runtime_end - runtime_start) >> EFI_PAGE_SHIFT;\n>> -     efi_add_memory_map(runtime_start, runtime_pages,\n>> -                        EFI_RUNTIME_SERVICES_CODE, false);\n>> +     if (!IS_ENABLED(CONFIG_SANDBOX)) {\n>\n> We need the memory maps for:\n> GetMemoryMap\n> ExitBootServices\n>\n> In efi_init_memory_init you define 8 MB memory starting at\n> 0x0000000000000000 as available:\n> ram_start 0\n> start 0\n> pages 8000\n>\n> I suggest you override efi_init_memory_init using malloc to assign at\n> least 128 MB contiguous memory with alignment EFI_PAGE_SIZE.\n\nDo you mean outside the sandbox memory region? Sandbox works by having\na memory region from which all allocation comes.\n\nRegards,\nSimon","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"S8n1DHtY\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"J3EgqXQ4\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3yrKk11Tg4z9s74\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Dec 2017 09:46:32 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 8AE76C21E4D; Mon,  4 Dec 2017 22:46:09 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id DE2D4C21FF0;\n\tMon,  4 Dec 2017 22:46:05 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 81835C21D79; Mon,  4 Dec 2017 22:45:35 +0000 (UTC)","from mail-qt0-f194.google.com (mail-qt0-f194.google.com\n\t[209.85.216.194])\n\tby lists.denx.de (Postfix) with ESMTPS id 28954C2208E\n\tfor <u-boot@lists.denx.de>; Mon,  4 Dec 2017 22:45:32 +0000 (UTC)","by mail-qt0-f194.google.com with SMTP id g10so24843963qtj.12\n\tfor <u-boot@lists.denx.de>; Mon, 04 Dec 2017 14:45:32 -0800 (PST)","by 10.140.100.167 with HTTP; Mon, 4 Dec 2017 14:45:10 -0800 (PST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=J/jw7U0GWUftoqvwZOkK/Uk22ah0Q0rWQx2mjHgRuEY=;\n\tb=S8n1DHtYXPOAdF/hsCHeHQFES3LGsv4vpXgSLp9afjagWmkrPmL7mRCQBLSjAnDPwy\n\tsY7RvJ5awQogRIzPGAuPIpnxZqJLfGw22jSpfaMbG8F3qrVN5Ligkf67EQF9oEaFz1Nn\n\t1wpVzTQD/3XiWadj+cy31DPtqF4zzXN2l00wdWbyLvGb5FcF/PpC/un4xohAycZKJzXR\n\tJGB5rDC8ulgBf/Uc58wSxPYysdA8B9LN23oQ9EFMXe6afF4qd7NofMmbVNpjNKvj4gXL\n\tqv1midxY8/WyrDJrE33bPmRoNH8Le7hUu3/Hc/dGjrAyJsU3JuuhbvL3W9ZllUEwSLdP\n\tJO2w==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=J/jw7U0GWUftoqvwZOkK/Uk22ah0Q0rWQx2mjHgRuEY=;\n\tb=J3EgqXQ4wqIdYXffWQqbxAKLNMo/cAMgWJPXvzqgUKaJ2EuZEmO0Ov9NJPr+sdiyGh\n\t6aQXgnPbFEKLQn/b4S1Hj23v2UHzqRmP8kT873W4X5AstsIqjyzLDDBp+IIZRCWjqRoV\n\t3a+tCAUzagtkmJ1cwPeXmr2CjAiJNM5aHovLA="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=J/jw7U0GWUftoqvwZOkK/Uk22ah0Q0rWQx2mjHgRuEY=;\n\tb=Mfpbf+rSZy+lRLg5Z2PO7ewLo6aNYa1Qe4qSAdR4rk8OJ23ECRlTMytnrxuVOleiBy\n\tQoMs+uzbmnFwo2RNFeDEOTBX2k+jff01OybhGKyzl5SLKA+1mql02YhokXiHGS3aR6F0\n\ts+UKEds0du2gq1dnwhgaGzNFZhKFQUpI4VfZbdf6wQ0hcaZF5nMFQNNRG2ACl8QQ3UgG\n\tqXKl24UAEL5vw+x8RFwsBd7XzWjEZjqrJ8p1aX4PZINTdZ3XzL/p339GGv/+MDq7vbeH\n\tIUAzjBTT+vNMc3z0rh+gIm7x0iyNaefahIrgReJrDRFtflgH60tMZFOkBdqAQiQgke7C\n\t3IhQ==","X-Gm-Message-State":"AKGB3mK8LLZN5zsyAtOsxpNs0aJ579DTWrqEO9sIp9PIa0KSxJawFf17\n\tHgReCYIStltix9cIhjW7tl2frwpfJ/y2eG3jiOepRg==","X-Google-Smtp-Source":"AGs4zMb6Xupu+K0rsp+HkoXTJQkG+HHYYs3a8rFK9ydmcKYh+RnMaNTIUWgQ3hsq0JLGHi+i0NyK3G05u90jmtkSrSY=","X-Received":"by 10.200.22.210 with SMTP id y18mr319950qtk.38.1512427530820;\n\tMon, 04 Dec 2017 14:45:30 -0800 (PST)","MIME-Version":"1.0","In-Reply-To":"<0ddb1a1f-b1e2-5da1-1fd8-22a2a44d59f9@gmx.de>","References":"<20170917225927.117917-1-sjg@chromium.org>\n\t<20170917225927.117917-7-sjg@chromium.org>\n\t<0ddb1a1f-b1e2-5da1-1fd8-22a2a44d59f9@gmx.de>","From":"Simon Glass <sjg@chromium.org>","Date":"Mon, 4 Dec 2017 15:45:10 -0700","X-Google-Sender-Auth":"GZGxjW49z6xD6B1on6ftnKnums8","Message-ID":"<CAPnjgZ1Jn1z4+W2tsXg8SdJA0V=ZMdXUkFs_EL+JZA9doHVcAQ@mail.gmail.com>","To":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>,\n\tAlexander Graf <agraf@suse.de>, \n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>","Subject":"Re: [U-Boot] [PATCH 06/16] efi: sandbox: Adjust memory setup for\n\tsandbox","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>"}}]