From patchwork Mon Jun 18 14:08:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 930934 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 418YNf3k6Fz9s2t for ; Tue, 19 Jun 2018 00:28:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F334CC21E85; Mon, 18 Jun 2018 14:16:22 +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 93EDEC21EA2; Mon, 18 Jun 2018 14:15:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9380AC21E38; Mon, 18 Jun 2018 14:10:03 +0000 (UTC) Received: from mail-oi0-f74.google.com (mail-oi0-f74.google.com [209.85.218.74]) by lists.denx.de (Postfix) with ESMTPS id 16E21C21E88 for ; Mon, 18 Jun 2018 14:10:00 +0000 (UTC) Received: by mail-oi0-f74.google.com with SMTP id 9-v6so9703215oin.12 for ; Mon, 18 Jun 2018 07:10:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=79kIsDzYq/Mm5KubILaXuPoLDzbN4m5DsA//9ugDs5c=; b=X9R26DeFsBtw5EPdKcIgANtDWVxi5UwSXAHAJYawHFcs1dBWyVjExl8G7LT65+MqSO i47oW0A/j2XK8Fy2aYpEU/8+XtyqsoeJgQm2ap2jhj9C6ujpiCQwKt+GCWIPv0FzxiCF 0JRI2uTymTAgAwHWz3FT4HZxaen2wJnawtFTqkWza/rjV9P7AyeHpcx5ZHNsgHwAQ/8E 4AlMUkmwsUdLlqPyrFgXijEspKndBfyjnXwuouiIS5e1we933u20rl1ljjoW9ldGzDjw qcfkJ8byBpaF9cjcwnD5OqYLrQdFQet15bCx/byVy9PY1++T7xbWRuJ8pNqYtx0Rh33L C2ag== X-Gm-Message-State: APt69E0Vc/BkFp3q4BbGE1QtJ7GQ902e+ZOWaoXqqLTlxrvRYLtWzOm+ Xckm9mYvfCt+p0yGegqEro2sC/0= X-Google-Smtp-Source: ADUXVKIPD4XhINpIyopvXFlcx3fbS8+svZf7Ci6IozULIbuQ+ZZy+8PrzhfuoQLkLjpAES5sXwdasyc= MIME-Version: 1.0 X-Received: by 2002:aca:fd45:: with SMTP id b66-v6mr5703999oii.125.1529330999089; Mon, 18 Jun 2018 07:09:59 -0700 (PDT) Date: Mon, 18 Jun 2018 08:08:32 -0600 In-Reply-To: <20180618140835.195901-1-sjg@chromium.org> Message-Id: <20180618140835.195901-28-sjg@chromium.org> References: <20180618140835.195901-1-sjg@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.244.gcf134e6275-goog From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH v8 27/30] 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: , 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 Signed-off-by: Simon Glass --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None 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 856caa4a40..7804adacd2 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -315,7 +315,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;