From patchwork Thu Feb 21 10:15:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 158888 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp306669jaa; Thu, 21 Feb 2019 02:15:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IZw59f06iDmT6sF7gkQzq3VBf2+b+FtQeWuwLe4MpPYL9xxLiD3DKM33MH3SIsaDiUT7Kzb X-Received: by 2002:a81:3154:: with SMTP id x81mr30674075ywx.29.1550744122678; Thu, 21 Feb 2019 02:15:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550744122; cv=none; d=google.com; s=arc-20160816; b=vcOIt/U+kqUMbjnZxwvkF82WDqgOM8y2f+LuuerMeYOMpCMhnQsfqfMQGToDXL2W4W scgPqxBS0mN2GUpPqUm0mpJQkqsRqZahPSzIknJH2UrPJ/wDFKW9JYLJPVPBfj7CqR3l s5B7YRRoOzli87fX9TEel+BYyNyZJMipcgpNAnnlDsFb957cWTBF+g76+6MULUM7Bn2J foEo5RXPxPHS7Qxhf+gu+2TlPVme4HjAzISwO+P2zAwlQh2B5TIVjM2UkDCcWAnnoA72 3K09CE/gS6fHH0GyOsp1b7gdls3A/7LoXg2JUKyWcyQ4wrqkNZkBYXAcIl+TJ/6ElD2z Ukzw== 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:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature; bh=0wIMbsFCwYRckX06e/uXLUUJLbZ78xOuUwuBl8q6W1s=; b=oGPsU0O6ksAVwqXrulZ1k6TO0d4rCNf8DIGzNO8pyRxxxktzW4j4edKeIUD4DteYXd bC9ag7C4lfGClRS+q7uJsh1zCAgzN4ALTOxmlmP1xGdyuZIKTzC07NQE9KS5ZRYuaYNK YEaUAI2dz4X8b6ZphRQH4WXisHtQv+KQCu7PNNbAHt+zSrARQaJmGGjItLxDStXJCsmU BYbtNZkRl0nM2GtMLDbOac+dlMvZcFyS+ZjFZi451gMGcvipypbu2gwTQXk3YekMVxVr 6uP/B2hR2seNlv6425EbT694xUvYo7FA0bn7u+klQo4pNadUOU/ibkgRZ8o11Dbx5WzS n1jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OM00QfRL; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f38si12828830ybi.388.2019.02.21.02.15.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Feb 2019 02:15:22 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OM00QfRL; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:57616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwlNy-0000qW-7F for patch@linaro.org; Thu, 21 Feb 2019 05:15:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwlNs-0000qK-Du for grub-devel@gnu.org; Thu, 21 Feb 2019 05:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwlNq-0000Qn-PV for grub-devel@gnu.org; Thu, 21 Feb 2019 05:15:16 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:51672) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwlNq-0000NW-CC for grub-devel@gnu.org; Thu, 21 Feb 2019 05:15:14 -0500 Received: by mail-wm1-x342.google.com with SMTP id n19so9609886wmi.1 for ; Thu, 21 Feb 2019 02:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=2RCwj9BFu88xo18B/6myQDAr5p4KHcr3/6bkbgYRaqE=; b=OM00QfRL49eZlAmH9ogNp4g0gazZVw93ELf68mBQvAxO9oEf2SdrCFpQld7scBPpdv xOtbNcT9exO2RtdRYbPAJVgw24o3AnlbdQc3ppQaSdGt5mROCQoMGlw9tffwD+kpmHwO E1amR16XmaeeJpHCu2g5LUjgVKNxfMRBr0r2yUyzwoiYe0egTLsKYOl2076qyi9U0vVU wpGrj4IVxoyl20JSHcucPAGsMW6JDu8truj5JlrUXUZKkwzZySRcFrDntFWQTfDLdFeA emW7d0iWkr6KqDIVBF9PMyegVMrU9w+mZ5pr/NE2hoMEdrTzhS7tsxXkKLoPEfnPlBrh vJzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2RCwj9BFu88xo18B/6myQDAr5p4KHcr3/6bkbgYRaqE=; b=rVMEknZqr/hFGXkDIt4sYRnJunxb9xFTu75r64qbWmo7aEa/jG9qW1OuoSBP4MBVa0 p+N4eKijtkQLciQslJC2qkYN2Od1mAuQjuaXUyenfcJs+Y2FHSCNE7il9ADh/r5b2ldp t8ihlJcwAn/DSZVSudSBjfUrQZLFp9FEEsGTsnqyi2NZNM04SfaTentUWgE5VDYkTLPH CK5qbWDqtasZSXLy9tpI7gG+WJbsfCidhImazR5e3n6hgKHV5dzwndL61zD2TotN7zMS cbfYQUL076mTAywg5sVXkB08sKHy7fRWdDKOMd96T6XZpZ3zvxHnFkHZdDeH7sMd+DeE L8Vg== X-Gm-Message-State: AHQUAuZYHLuf9zBPa+ex9Dk4vp/zjOaFiHil9hMNbXYMcnBknGqXr7eM j4UW/KraqzPmZrVzkoAOiOHPpvhpmVY= X-Received: by 2002:a1c:d049:: with SMTP id h70mr9759792wmg.81.1550744109784; Thu, 21 Feb 2019 02:15:09 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id c18sm27199577wre.32.2019.02.21.02.15.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 02:15:09 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH] arm64/efi: fix grub_efi_get_ram_base() Date: Thu, 21 Feb 2019 10:15:08 +0000 Message-Id: <20190221101508.17399-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: Steve McIntyre <93sam@debian.org>, Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" grub_efi_get_ram_base() looks for the lowest available RAM address by traversing the memory map, comparing lowest address found so far. Due to a brain glitch, that "so far" was initialized to GRUB_UINT_MAX - completely preventing boot on systems without RAM below 4GB. Change the initial value to GRUB_EFI_MAX_USABLE_ADDRESS, as originally intended. Reported-by: Steve McIntyre <93sam@debian.org> Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Tested-by: Steve McIntyre <93sam@debian.org> Reviewed-by: Daniel Kiper diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index 42ad7c570..cfe9764b7 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -653,7 +653,7 @@ grub_efi_get_ram_base(grub_addr_t *base_addr) if (ret < 1) return GRUB_ERR_BUG; - for (desc = memory_map, *base_addr = GRUB_UINT_MAX; + for (desc = memory_map, *base_addr = GRUB_EFI_MAX_USABLE_ADDRESS; (grub_addr_t) desc < ((grub_addr_t) memory_map + memory_map_size); desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) if (desc->attribute & GRUB_EFI_MEMORY_WB)