From patchwork Thu Jun 14 16:33:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138583 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2339420lji; Thu, 14 Jun 2018 09:37:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwF26Dbei85+Yjudzw0SaGztBfNb1f1CrjgHJEOGSt19887fPRFYJb/1Z8HK7n3EcGWHdz X-Received: by 2002:a50:9793:: with SMTP id e19-v6mr3223751edb.58.1528994271891; Thu, 14 Jun 2018 09:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528994271; cv=none; d=google.com; s=arc-20160816; b=xKuM1vyx9B+mt9wNycunw9tA4YQ9SVxd5h38KuSxLnlJuJDgPWwXhoWsb8uOi/NHSv BuuUo6S05vAr4YaPgbRvpUgoceSbbYF04i68GDgLjMabjdCIuKq5h03bzn51r8to+rYg fzuWyf4w27rTqE9Wa/pXPEze5TQiCSCtCM/OjPOYLIUPsmyb2w+7sI4poDBgCxfSBZf3 mnfNY61y4QPUb02kAZoaj+GGQwJKnjVMH3CeGrBckLrNVfyq3uHPGTkpbV9AX4vm52N0 XagpRkuFem2HwzitwrNumi218Ref2Uyy+j5fY+jzhg5S3fgznPpiy42Bllh4uyzo4WiZ O79w== 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=i53Hy0Iw+MJYUBCDSAaWIV2UjqrLpH1wNbmtbadPbI6ucE4OIiRitoxtZmm4y4GR2E OG1lSgKOxdlnsTZ0C5wtjy8iXNm50neYTMgdAC/v9C2OSUJS+MMHhnRC14kbr9F3WClP E4G05QHbQPGtGL9fw8EqPqqnWveMBJmJxRZFKwXLmksF6YLiNLvBQMOIlZuaIsYIPs9X hzRGNCdefh4zFySk6gD6j1RKXjzGEoOuc8Kb8gM6//+V7N2wIxea2yXlGSaHL1Do1ak/ FIlv9wLOXvVwE7baHpkZ5KibgFiQ3rG3GoYAgAQffxcv8iMBTWgkP2H5s2v5q3tMKu++ Pivw== 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 k8-v6si526874edd.246.2018.06.14.09.37.51; Thu, 14 Jun 2018 09:37:51 -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 7E25EC21CB6; Thu, 14 Jun 2018 16:35:37 +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 EEBECC21EBB; Thu, 14 Jun 2018 16:33:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5282CC21D74; Thu, 14 Jun 2018 16:33:35 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 8805EC21DCA for ; Thu, 14 Jun 2018 16:33:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BD037AF7D; Thu, 14 Jun 2018 16:33:34 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 18:33:31 +0200 Message-Id: <20180614163334.46827-9-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180614163334.46827-1-agraf@suse.de> References: <20180614163334.46827-1-agraf@suse.de> Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH 08/11] 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;