From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::343; helo=mail-wm1-x343.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 7F2B521196238 for ; Wed, 19 Dec 2018 13:15:05 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id c126so7902109wmh.0 for ; Wed, 19 Dec 2018 13:15:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=s6beI4e/XV6zvtnuQJMKA9KkLGdbvd8UVPzCzy1TJV4=; b=WnoJtuIA7t9SL1XxIO6Or6S25e4PObKHEW1ZEnn9oN/Z4X/nmBM4DDhQtV03FtfzDm vgvob0212s/rwawc810oQCuoggimfVAEtYIgBhdAoB+XP5/4S2p6CEmiD/XOC0pgtHrZ TmwKJ2f7WTSmZw63sRLk06+bxS0GDWeAR/qmA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=s6beI4e/XV6zvtnuQJMKA9KkLGdbvd8UVPzCzy1TJV4=; b=cdVOoY3ue7wLM/+wIMxY5XZmCCM/PtqZ6+V+1QvFNfjLDztd4DDo1/TLXq1JZV9XVd UDQiWeOuKDezj9yydNb3SWuldBooKsTVqPKF2e6p3aWfr5+Rx/Furah0uZ23IF0Y9l0/ vEDTwfrPZ/fIC9k+JnIVSqRGAS031gAyjJjRgQwRy1wEY2g75YNs43WVmHpImZiCiKbU Eho0LtbPDjL0M3ReUYJuiF96bm6MbDsPVoDSSTAyO6CI17gT2Xa0JHXpBToW2Kzw0rqo 6ZK5DExqUZ3f1AV3swVAT02GsbD7MPDTtdLn1Om5mYiiB2IO5DsZq5qbL9SzLjgAr5+Z tG9A== X-Gm-Message-State: AA+aEWbhWr/DauJm3r71w5W/5by9+sQW3+V4FCRUuPqhZyE+Sa73+hax jTbBBbTkbEPcei94Mh0EiUv/Pg== X-Google-Smtp-Source: AFSGD/VXcuSPPvPkaoYVarjvgbQV2XK+ezB6jo/mQJQ4dOgZYq3e6kUJZDfknL7vtepvtGwZUTJZvg== X-Received: by 2002:a1c:282:: with SMTP id 124mr8422033wmc.113.1545254103831; Wed, 19 Dec 2018 13:15:03 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id l197sm15129003wma.44.2018.12.19.13.15.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Dec 2018 13:15:03 -0800 (PST) Date: Wed, 19 Dec 2018 21:15:01 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, Michael D Kinney , Liming Gao , Jian J Wang , Hao Wu , Laszlo Ersek , Eric Auger , Andrew Jones , Philippe Mathieu-Daude Message-ID: <20181219211501.b3nrdvmxbatmvwdm@bivouac.eciton.net> References: <20181219205640.4704-1-ard.biesheuvel@linaro.org> <20181219205640.4704-6-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20181219205640.4704-6-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH v2 5/6] ArmPlatformPkg/MemoryInitPeim: take MAX_ALLOC_ADDRESS into account X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 21:15:05 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 19, 2018 at 09:56:39PM +0100, Ard Biesheuvel wrote: > Limit the PEI memory region so it will not extend beyond what we can > address architecturally when running with 4 KB pages. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm > --- > ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c > index 389a2e6f1abd..010f93add76b 100644 > --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c > +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c > @@ -105,12 +105,12 @@ InitializeMemory ( > > // Ensure PcdSystemMemorySize has been set > ASSERT (PcdGet64 (PcdSystemMemorySize) != 0); > - ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ADDRESS); > + ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ALLOC_ADDRESS); > > SystemMemoryBase = (UINTN)PcdGet64 (PcdSystemMemoryBase); > SystemMemoryTop = SystemMemoryBase + PcdGet64 (PcdSystemMemorySize); > - if (SystemMemoryTop - 1 > MAX_ADDRESS) { > - SystemMemoryTop = (UINT64)MAX_ADDRESS + 1; > + if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) { > + SystemMemoryTop = (UINT64)MAX_ALLOC_ADDRESS + 1; > } > FdBase = (UINTN)PcdGet64 (PcdFdBaseAddress); > FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize); > -- > 2.19.2 >