From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 1914520945B61 for ; Fri, 15 Sep 2017 15:52:28 -0700 (PDT) Received: by mail-it0-x234.google.com with SMTP id w204so4073666itc.4 for ; Fri, 15 Sep 2017 15:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Q2nC63WaUT9/2z+KOprziWhyPSfiVgCnwsrq90gckRQ=; b=dg+bf4eJvkCFcvaisZjfSnf8J5gvmAZ2kk4yGo2RZTBGN0hZYgPnIm765h6LWmPHSY ti2LvIERmpCrzQdJ3UxreCJTYV6VJFzWDxBpT4Z/xHtkUgxLB6cRimwFTzJelStxoHYC npAbrSgvDzILYEmrPVxi1EeIlXZtrCScLvuOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Q2nC63WaUT9/2z+KOprziWhyPSfiVgCnwsrq90gckRQ=; b=cjqkLM5ntbC2V2N0xp/YyF9NZ4pvzvcKlrRJQX+/Q27m+5c+m6JcXZcD0DLphMaQmE 7fnM1GYJSUXBeQz01A07MrKj9T9pau0U+H8ViYoPRxNXFNkgLjLXXz4yPeAQ3ea+h7Ne TkA+/mY6ZPBTTfLTCfEqan8u+QmIWb9GZ680IDArGU+0rFE+w0VFwFJNKwjEbVElpQs+ 9VU5LkXw/ExgVsiPAkJv6CPFeU+LbOtPsIYOfESQETs2ilUYRiXBAfPctqNrknmF5VAx RMdAr4vyCuu+gqsYceXMVaWSaqF9CvXmET1pXeWLTbfFyYP5kJZuCjTOA8Vcz8Cp65on BVNw== X-Gm-Message-State: AHPjjUhUepISzAcQdn5XGCpP+bdTEDU46+SOJyZsIzt/RQ4gQAd7X0yV zx7UYyjPi2WKmta2o8qEwccT7Jvhk7EWaXblNuXTFg== X-Google-Smtp-Source: AOwi7QAYEuintYS5jyTcz018wRfqKM9PuC2EoTc6tOvGR+JuPjG7/+JDE+elHy/lFq91Gg4obbNTFBNE5WiOjO55vBs= X-Received: by 10.36.107.21 with SMTP id v21mr6757540itc.43.1505516127807; Fri, 15 Sep 2017 15:55:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.152.18 with HTTP; Fri, 15 Sep 2017 15:55:27 -0700 (PDT) In-Reply-To: <20170915101338.agohuaoakeaokevb@bivouac.eciton.net> References: <1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.com> <20170915101338.agohuaoakeaokevb@bivouac.eciton.net> From: Ard Biesheuvel Date: Fri, 15 Sep 2017 15:55:27 -0700 Message-ID: To: Leif Lindholm Cc: Meenakshi Aggarwal , "edk2-devel@lists.01.org" , Udit Kumar 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 22:52:28 -0000 Content-Type: text/plain; charset="UTF-8" On 15 September 2017 at 03:13, Leif Lindholm wrote: > 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. > Thanks for the patch. But please consider carefully what you're doing: in the original code, the entire DRAM region is added, and subsequently split up so the part that overlaps with the FD can be registered with different attributes. After your patch, we carefully isolate the region that overlaps the FD, and subsequently register it with the exact same attributes, which means we didn't have to isolate it in the first place. My point is really that you can just remove lines 124 - 189 instead.