From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 2080D21E74928 for ; Fri, 15 Sep 2017 03:10:43 -0700 (PDT) Received: by mail-wm0-x229.google.com with SMTP id i189so7023585wmf.1 for ; Fri, 15 Sep 2017 03:13:43 -0700 (PDT) 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=puo9XwvTv9/T4qL0OgZM3Lk3WjPHma0qjIp3w3c/was=; b=H1LXKHd7RBQMkTmm49LnfPk+ydQ+3mhjIbyfEtiO4lLsI3zws0lxFTD5wWc3hp9+zF Z7PfpYjGam9TfxSjg7ZNfIPhTm1PdXE5FQ3Pw5AhriNaA/xwF9USL7Wv4PowiPwaRopw 7k3bsgsODRcHYEPGw+JeiB3XhhpPgtm0LIYac= 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=puo9XwvTv9/T4qL0OgZM3Lk3WjPHma0qjIp3w3c/was=; b=pkO8temvuHs75b4B6u7FoOcsE9tAF/Eqi4H3YO7k2AHYYBgjGaKFTnFTteeq9+IvMA n4Kyw8gzW3hYid9CFMfRnNvjMPL4VkZFHbkVPWYrJf/uzXJcVwaMxC6Yarw2OaCqOYBn v/zsgh++iWcG3qk2tnrFe95jXDkMLFrhTru4tJLabx6ygpo1xhJQpDFOCD6Pk5531Vif oS03NCDVzsOP1V3+mXrB5k7hZKUqK7arXAG+025DkxTA3+tN+5zc9HJUUdUzxzQvnYPd x4ke8W2WmLSjdarqoIyZw3mxld+GxKae9u5MOgksGOLsSLsxj23le+kd4RYQ2lrjaeFx qECA== X-Gm-Message-State: AHPjjUiuhRWr9OUWpHdTPVyLXIUcolhvtnGL3JAsKmhDctpXXNtJHSdS xD1gm1v5betOe9jH X-Google-Smtp-Source: AOwi7QDJec0bcZnwm//T5KYktU27tzafWAI6QPu+8VpiyWrKdnms0J7+20kCA4YOJZK8/Hr6K4iE4A== X-Received: by 10.28.135.5 with SMTP id j5mr2526183wmd.21.1505470421083; Fri, 15 Sep 2017 03:13:41 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 69sm684855wmi.0.2017.09.15.03.13.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2017 03:13:39 -0700 (PDT) Date: Fri, 15 Sep 2017 11:13:38 +0100 From: Leif Lindholm To: Meenakshi Aggarwal Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, udit.kumar@nxp.com Message-ID: <20170915101338.agohuaoakeaokevb@bivouac.eciton.net> References: <1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.com> MIME-Version: 1.0 In-Reply-To: <1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH] RFC Inform UEFI memory to Linux X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2017 10:10:43 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 15, 2017 at 08:02:34PM +0530, Meenakshi Aggarwal wrote: > From: Udit Kumar > > While creating Hob list, ArmPlatformPkg is hiding UEFI memory. > whereas this memory can be used by OS. > > This patch, allows OS to use UEFI code area. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Meenakshi Aggarwal > Signed-off-by: Udit Kumar I will let Ard comment on the technical aspect, since you've been discussing this offline. However, there is something broken in your setup: the patch should look like this: --- iff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c index 2feb11f21d..d3fa894244 100644 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c @@ -150,7 +150,7 @@ MemoryPeim ( } else { // Create the System Memory HOB for the // firmware with the non-present attribute BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, - ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT, + ResourceAttributes, PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize)); @@ -161,7 +161,7 @@ MemoryPeim ( } else { // Create the System Memory HOB for the firmware // with the non-present attribute BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, - ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT, + ResourceAttributes, PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize)); --- I am guessing you have inadvertently modified the line terminations from CRLF to LF (the evidence gets stripped out by SMTP). Please resubmit with this addressed. / Leif > --- > ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 28 ++++++++++++------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c > index 2feb11f..ae6ebc4 100644 > --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c > +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c > @@ -147,24 +147,24 @@ MemoryPeim ( > if (PcdGet64 (PcdFdBaseAddress) == NextHob.ResourceDescriptor->PhysicalStart) { > if (SystemMemoryTop == FdTop) { > NextHob.ResourceDescriptor->ResourceAttribute = ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT; > - } else { > - // Create the System Memory HOB for the firmware with the non-present attribute > - BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, > - ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT, > - PcdGet64 (PcdFdBaseAddress), > - PcdGet32 (PcdFdSize)); > - > + } else { > + // Create the System Memory HOB for the firmware with the non-present attribute > + BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, > + ResourceAttributes, > + PcdGet64 (PcdFdBaseAddress), > + PcdGet32 (PcdFdSize)); > + > // Top of the FD is system memory available for UEFI > NextHob.ResourceDescriptor->PhysicalStart += PcdGet32(PcdFdSize); > NextHob.ResourceDescriptor->ResourceLength -= PcdGet32(PcdFdSize); > } > - } else { > - // Create the System Memory HOB for the firmware with the non-present attribute > - BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, > - ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT, > - PcdGet64 (PcdFdBaseAddress), > - PcdGet32 (PcdFdSize)); > - > + } else { > + // Create the System Memory HOB for the firmware with the non-present attribute > + BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, > + ResourceAttributes, > + PcdGet64 (PcdFdBaseAddress), > + PcdGet32 (PcdFdSize)); > + > // Update the HOB > NextHob.ResourceDescriptor->ResourceLength = PcdGet64 (PcdFdBaseAddress) - NextHob.ResourceDescriptor->PhysicalStart; > > -- > 1.9.1 >