From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=roman.bacik@broadcom.com; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6B1752033D1B7 for ; Wed, 2 May 2018 11:01:45 -0700 (PDT) Received: by mail-wr0-x244.google.com with SMTP id c14-v6so14954022wrd.4 for ; Wed, 02 May 2018 11:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=DSYWzAod0VkLxECXe5t8b62X0YIu2mGSuubdvwhhM/g=; b=Y7a4vBp8TehzfjLJToVGCnlx1oUV/fC20FqETfZXjdBQnc25XAiaiNHPwRdITXE2qe bbPSYDk9X7Bk4WfJnsC26JlEnlDE4jtCJFMA2/P4OsADvjHXEJ7QNlLEMb/pTuqJnI23 9jtzUYdzziYGNgKgcY5IOp/GFh+i7hr/rjmWg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=DSYWzAod0VkLxECXe5t8b62X0YIu2mGSuubdvwhhM/g=; b=A9THAVcInKkGrLnZBo33XcxQHw4p4wN8kMlxvJ+zqirvqI15qws7b8Eh6nLLZpg4oS TjTLzWBwa5drtKnmeynOj0+Vr7G/qq57jhskH08rlmWzSrQ//c6Y0A8L9RdP0KtcDDh8 xXJKQK6d7bg7tLAWciv9uNhaKVUSo0m5xfcDUvJH8IhKHraeXHBeGajAZoDOiGbAikVb PtUhmR60x3lnc5hPIVaMUpWHqO5Fl/DYiKxItQDRrpo55bZrPuN2Hl3p/HoI9q2h3z5b fLVtXzd5JONjY6cUjq1wZZ7f9zAh0kDUVZ41oh27AaSJW0f8pI2FdJGcbm5ZWEclg+59 UQKA== X-Gm-Message-State: ALQs6tCABk91TLK29fS4XncshYSKUyRjuenqflgqUsbQ+/KCU6sLBhG8 QJeNCU3PnX4YQGMDXpiablvtltICEIYhEX6AVNdy/lFJzTw= X-Google-Smtp-Source: AB8JxZolNrwQMjRvjNNF1LscJFLTw3wuSexZ83Wuy4MqGe+49PAZEIwyj5ufdhq9ifu/fHHVs3SkY1xzd58Fl8ft0Gc= X-Received: by 2002:adf:9d8c:: with SMTP id p12-v6mr15155223wre.14.1525284103398; Wed, 02 May 2018 11:01:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.210.68 with HTTP; Wed, 2 May 2018 11:01:02 -0700 (PDT) From: Roman Bacik Date: Wed, 2 May 2018 11:01:02 -0700 Message-ID: To: edk2-devel@lists.01.org Cc: Ruiyu Ni , Vladimir Olovyannikov Subject: [PATCH v2] MdeModulePkg/Core: Fix MaxAddress in Gcd X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2018 18:01:45 -0000 Content-Type: text/plain; charset="UTF-8" When BottomUp search is used the MaxAddress is incorrectly chosen to be the BaseAddress instead of the EndAddress. Cc: Ruiyu Ni Cc: Vladimir Olovyannikov Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Roman Bacik --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index e17e98230b79..9eeb2bd74599 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -1170,8 +1170,8 @@ CoreAllocateSpace ( // // Compute the maximum address to use in the search algorithm // - if (GcdAllocateType == EfiGcdAllocateMaxAddressSearchBottomUp || - GcdAllocateType == EfiGcdAllocateMaxAddressSearchTopDown ) { + if (GcdAllocateType == EfiGcdAllocateMaxAddressSearchTopDown || + GcdAllocateType == EfiGcdAllocateAnySearchTopDown ) { MaxAddress = *BaseAddress; } else { MaxAddress = Entry->EndAddress; -- 1.9.1