From patchwork Tue Jan 13 15:13:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 43018 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B1C5320DE8 for ; Tue, 13 Jan 2015 15:13:45 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id q1sf2005118lam.2 for ; Tue, 13 Jan 2015 07:13:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:reply-to:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=QEDryBgbznnal6WDP/7HX2S1tc+HaFSt22gjkLNTjV0=; b=jpczMSSvc6uitfcP++U8IL7ewbB8jwEHGhK98dL2J6+jpRn3fhvW+/GbbAs8f9nNOD iOPK3pmqIQTGNBBCkJ3CDlwjM9s5TQYhwYiPeiVKoBj/nnlV9ed2jbFtV/rQQVRTeCty zaAeMUYwqyzX4uNjgfu1l3tS3il9E4XIRVpMYMvvXEfX+eyYNtHEmyEP0FtaFYSdaXTp 2wJGudtTl152METbBgsg6Eh3B53zJz+bLPGf8f3NjOIF4tvL6Gr1YXSmfrnk1z11OysM jY9Kuq9cj/zXN0752QmroV8QehQOzijUHk3XwAz5YZZvtF9mHOTTHF76l6d08I+gIb1/ zktQ== X-Gm-Message-State: ALoCoQnBgDpB9MvjRcubmrnKz3DHcxthtdtC6DrvoPVv3dRFZWFG6B6elXBKYnDMI/vAE9kHAQNX X-Received: by 10.112.84.226 with SMTP id c2mr1859216lbz.5.1421162024645; Tue, 13 Jan 2015 07:13:44 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.67 with SMTP id g3ls7166lab.25.gmail; Tue, 13 Jan 2015 07:13:44 -0800 (PST) X-Received: by 10.112.8.69 with SMTP id p5mr42576180lba.97.1421162024500; Tue, 13 Jan 2015 07:13:44 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id z5si24499504lbo.84.2015.01.13.07.13.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:13:44 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gf13so3125968lab.7 for ; Tue, 13 Jan 2015 07:13:44 -0800 (PST) X-Received: by 10.152.115.146 with SMTP id jo18mr43345924lab.9.1421162024375; Tue, 13 Jan 2015 07:13:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1411676lbb; Tue, 13 Jan 2015 07:13:43 -0800 (PST) X-Received: by 10.50.35.195 with SMTP id k3mr21718827igj.11.1421162022699; Tue, 13 Jan 2015 07:13:42 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id bb8si14310645icc.98.2015.01.13.07.13.41 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:13:42 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YB39v-00060b-VC; Tue, 13 Jan 2015 15:13:31 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YB39u-00060V-KD for edk2-devel@lists.sourceforge.net; Tue, 13 Jan 2015 15:13:30 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.173 as permitted sender) client-ip=74.125.82.173; envelope-from=ard.biesheuvel@linaro.org; helo=mail-we0-f173.google.com; Received: from mail-we0-f173.google.com ([74.125.82.173]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YB39t-0001F9-57 for edk2-devel@lists.sourceforge.net; Tue, 13 Jan 2015 15:13:30 +0000 Received: by mail-we0-f173.google.com with SMTP id q58so3484182wes.4 for ; Tue, 13 Jan 2015 07:13:23 -0800 (PST) X-Received: by 10.180.74.146 with SMTP id t18mr40448505wiv.62.1421162003103; Tue, 13 Jan 2015 07:13:23 -0800 (PST) Received: from ards-macbook-pro.local ([197.130.61.210]) by mx.google.com with ESMTPSA id gl11sm26067062wjc.40.2015.01.13.07.13.21 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 07:13:22 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net Date: Tue, 13 Jan 2015 15:13:17 +0000 Message-Id: <1421161997-19958-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1YB39t-0001F9-57 Subject: [edk2] [PATCH] DxeCore: set EFI_MEMORY_RUNTIME where appropriate on internal memory map X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The function CoreTerminateMemoryMap() performs some final sanity checks on the runtime regions in the memory map before allowing ExitBootServices() to complete. Unfortunately, it does so by testing the EFI_MEMORY_RUNTIME bit in the Attribute field, which is never set anywhere in the code. Fix it by setting the bit where appropriate in CoreAddRange(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/Dxe/Mem/Page.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index fa84e2612526..3abf934933d8 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -240,6 +240,10 @@ CoreAddRange ( } } + if (mMemoryTypeStatistics[Type].Runtime) { + Attribute |= EFI_MEMORY_RUNTIME; + } + // // Add descriptor //