From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::22b; helo=mail-it0-x22b.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (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 A29302034D8DE for ; Wed, 28 Feb 2018 06:57:46 -0800 (PST) Received: by mail-it0-x22b.google.com with SMTP id n7so3779619ita.5 for ; Wed, 28 Feb 2018 07:03:54 -0800 (PST) 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=NcohN2JoNgCkpVO3krY0RcQUwYqSJtSdDMEjXW03Ws4=; b=eFIqydXAKMli5ADgK/Y9DyMf8jUxLd5n/HXGDZJqFlN676yWuogSBnDn0ZMP12oHHX ndr2RSYRewkX4yP1j5d9LwXaU6+WLFj++yPOmqO6NwR6Y75l85HwyPObmk5HB74LnEI+ X2lH7pf/WMAIu/Ih3LDaBW8xgwEj75OVj44Tg= 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=NcohN2JoNgCkpVO3krY0RcQUwYqSJtSdDMEjXW03Ws4=; b=LmQd8tfpdjc4uUvIbbjevCEHpDxrNfIk8Wo5gOnZxv3bhieM5KY6W2LjDs3RrfGuPg m90035qkBCzGHn8g0nvNBiYXiRGOUQ5Fr8zH9B4RbrPtK54Hqc+/eBA5KREO6A+Okwtz TvMDCBEWrJhewTCzsDCQ1AQwu/yRzJNlf6mN9KcOfQakZMD+T+xvwquFnjsqcwR4mbNV HjLzMeJNmeeq7k8oD27KZT0dIkqp0kzbXFIU88hwtHAFOUelwiVAGj4zLK0fjiw699MI dW5CmJo+kx1l5VJ7Hc5alk9IWQxllK62IbYVC2ck3XCOMVrzg7bkKfyECR0f7A4vA1fh bKEA== X-Gm-Message-State: APf1xPCroW4fR1kN68QogBVamA1591r0UGu0rfN8RtK7eFQcuUS7GrCP HGzqtU/cqEIdKKBiWus6rbU8U/Lx278qjcMAWVgAAg== X-Google-Smtp-Source: AG47ELuNS8SEFGnAN49MF02Ou74IKU63RNhmlbPAkfr/fFZW5SJiPw5wA62wskM6NOB56k1JAbZrfn5Lik5nY9p7fHg= X-Received: by 10.36.90.5 with SMTP id v5mr21430513ita.138.1519830233238; Wed, 28 Feb 2018 07:03:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Wed, 28 Feb 2018 07:03:52 -0800 (PST) In-Reply-To: <20180228150311.h362ivdrpujqfh6w@bivouac.eciton.net> References: <20180102155034.13688-1-ard.biesheuvel@linaro.org> <20180228150311.h362ivdrpujqfh6w@bivouac.eciton.net> From: Ard Biesheuvel Date: Wed, 28 Feb 2018 15:03:52 +0000 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" , Vladimir Olovyannikov , Udit Kumar , Meenakshi Aggarwal Subject: Re: [PATCH] ArmPlatformPkg/MemoryInitPeiLib: mark primary FV region as boot services data X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 14:57:47 -0000 Content-Type: text/plain; charset="UTF-8" On 28 February 2018 at 15:03, Leif Lindholm wrote: > On Tue, Jan 02, 2018 at 03:50:34PM +0000, Ard Biesheuvel wrote: >> Commit 8ae5fc182941 ("ArmPlatformPkg/MemoryInitPeiLib: don't reserve >> primary FV in memory") deleted the code that removes the memory covering >> the primary firmware volume from the memory map. The assumption was that >> this is no longer necessary now that we no longer expose compression and >> PE/COFF loader library code from the PrePi module to DXE core. >> >> However, the FV is still declared, and so code may attempt to access it >> anyway, which may cause unexpected results depending on whether the >> memory has been reused for other purposes in the mean time. >> >> So reinstate the code that splits off the resource descriptor HOB that >> describes the firmware device, but this time, don't mark the memory as >> unusable, but create a memory allocation HOB that marks the region as >> boot services data. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Ard Biesheuvel > > So, this looks like a necessary fix. > However, there are many line-length violations below. > And it's not apparent how fixing that would make the code more > readable. > > So rather than asking for a rewrite - could you split the revert > from the modification? > Sure.