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 CAFE8207DF44C for ; Fri, 27 Apr 2018 15:36:57 -0700 (PDT) Received: by mail-wr0-x244.google.com with SMTP id u18-v6so3074462wrg.3 for ; Fri, 27 Apr 2018 15:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:mime-version:thread-index:date:message-id:subject:to:cc; bh=ay3Cx3RjY21uaJcIUe7peHy2eVIQmrdoZ2Yd3fFMm+I=; b=HSFUw3wagjmutCJ3QHEFCv22FaY/4XtTSPgYZ+pibvb7FBLiu7jaeX3TRs2Wflgt9c zuvuRUChb4DaowjSd5ndzNEgC+JVC80ts+8mDLaM/im/xlUqQdQrtbZ0XdCSSNGcRrKT tKpqCtEDvISvLyJNJ7tCPFF9tM7MHyIw+bVjo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:thread-index:date:message-id :subject:to:cc; bh=ay3Cx3RjY21uaJcIUe7peHy2eVIQmrdoZ2Yd3fFMm+I=; b=eMbYTDH7RzwB+bxYyJ9TxpFAR5VEDJ35TA48HqtV8BWjQtXO1IYPadWuxjR0KwI0AU kqwKaz7BIKd/mV/Nl1skHvsGiHt+oTX+hqrGaJgI8yzpXoNGPqHfLbDOPidlL9Hp5+Uj WS2QZ7cey6Im4KupJplfTbnpBE+EVmAXUg/0dK33KUR65K57EQBO/OT9dspM0gIKvi7J COv9iNbhjOHM3sJwAPL3PX4FH30Ju9T9PZAXNtfI/nd5KQeWZelP/rtRXMonJZHReU4G 7tpPF5S/I/IdpuWixbz/yo3UYO7L2ypMqvbHZ1eYA0/s3pXV2VjMtMyPh3avxNXYv7Qf 5zvQ== X-Gm-Message-State: ALQs6tClsLAAIqo4Wdv4nMMlaytnf+ZI1vUXoosvriBEB6SDAON3+291 keoKipgIec1P9igY/0nA0zGzeQ4jiSA7gGXZ+SxkjboJ X-Google-Smtp-Source: AB8JxZrbPYcT+LClRJmvyoiqrIS8WPp7b/JlJT0K9fv6IwtG5gNVPH/0tqyY/E+eD1nnNz8n1F2lyjH21A1FzXScOkM= X-Received: by 2002:adf:9287:: with SMTP id 7-v6mr2905223wrn.67.1524868615578; Fri, 27 Apr 2018 15:36:55 -0700 (PDT) From: Roman Bacik MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdPeeD2X5lozriIeROSZfjcXQsgfBg== Date: Fri, 27 Apr 2018 15:36:54 -0700 Message-ID: <5c98a4850c0352b6f6fbc557d8731a88@mail.gmail.com> To: edk2-devel@lists.01.org Cc: Ruiyu Ni , Vladimir Olovyannikov Subject: [PATCH] [PATCH v1] 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: Fri, 27 Apr 2018 22:36:58 -0000 Content-Type: text/plain; charset="UTF-8" When BottomUp search is used the MaxAddress is incorrectly chosen to be BaseAddress instead of EndAddress. 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