From patchwork Mon Jun 18 15:23:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 139003 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4085059lji; Mon, 18 Jun 2018 08:27:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJRZdelIw+6So3qFa1cMAQDYolNmTc7wgvUiaqtq42oFknDsAl7Pi+99iA1YQeEAA6cdE4q X-Received: by 2002:aa7:c6c3:: with SMTP id b3-v6mr11513675eds.302.1529335625075; Mon, 18 Jun 2018 08:27:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529335625; cv=none; d=google.com; s=arc-20160816; b=d4vwh1eDdNvyfZNfewVPRClN5DCRSHKl6oe2/2qA9JtMVai52Emts9e60fGiJTSAHT JVwy7u8KwUWl1rIGC9/JOsNVSz0JD2pulDO4TscEfu/+SgkfjgxCLpjrxBTNVkJrWdCh NWM9W//p4s1ZOsYubVZEe2JXbdYeepuXaKW6nlHzU94yNpuy1oghJ77dKpOvmBzidXuM Vsman2g8pQEn1y2K2exALHr5l6s8rgXP3pyMy0ayDfb1zh7kyV5zHwZbfN5xpTqXhzl4 uvFnLR3JN4v4q0+PRb6BwK1oUX3ncOJ+7q50x9620WXydOu15qJeEZkDmjIkWHYN4alh 7emw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=lUY8nhYnWYnF4GKFYcy3Jz6Bm3iI6YSxpZIPv61qQtM=; b=apsSZSNMU5YFeUUQwFHQOLQDwzE+Iy662cTqH5dn5Kt4q/P2WOVJZo3Cfi7qvBd/ke 8jiE9Ft1U2kwMHGQzQc6xw2ToNl3umfBCmI2AIradmXCEDr6E88hDnB1BOaudkwUzFzQ StvBSpiP0x3NPrYecQB0Ah6NJ7UKr3y8+b8ScRCugpNbJ7JTzXmMe0k9jwyxIN/hfIFH vY2XfNmzjWUOhBCRA7la3AxoPDUC/lP29gy5tUrrNYjRvzpQ5rkfFhQMqoyAJXM9ucoy iGgkf5K+7cDqLql89ItLFlNqDIIA1y0ZyMZa3ObwyBniPHWs9/A3BLXXaYYyZXhddTJh Z8Dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 50-v6si5522002edz.449.2018.06.18.08.27.04; Mon, 18 Jun 2018 08:27:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id A04F8C21EF2; Mon, 18 Jun 2018 15:24:39 +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=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 40F56C21F16; Mon, 18 Jun 2018 15:23:22 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3538DC21E1D; Mon, 18 Jun 2018 15:23:17 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id C20D3C21DFA for ; Mon, 18 Jun 2018 15:23:17 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E74AEAF71; Mon, 18 Jun 2018 15:23:16 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Mon, 18 Jun 2018 17:23:02 +0200 Message-Id: <20180618152315.34233-9-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180618152315.34233-1-agraf@suse.de> References: <20180618152315.34233-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v4 08/21] efi_loader: efi_allocate_pages is too restrictive X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Heinrich Schuchardt When running on the sandbox the stack is not necessarily at a higher memory address than the highest free memory. There is no reason why the checking of the highest memory address should be more restrictive for EFI_ALLOCATE_ANY_PAGES than for EFI_ALLOCATE_MAX_ADDRESS. Signed-off-by: Heinrich Schuchardt [agraf: use -1ULL instead] Signed-off-by: Alexander Graf --- lib/efi_loader/efi_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index ec66af98ea..ce29bcc6a3 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -295,7 +295,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type, switch (type) { case EFI_ALLOCATE_ANY_PAGES: /* Any page */ - addr = efi_find_free_memory(len, gd->start_addr_sp); + addr = efi_find_free_memory(len, -1ULL); if (!addr) { r = EFI_NOT_FOUND; break;