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:c06::241; helo=mail-io0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (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 B51C922684786 for ; Mon, 23 Apr 2018 23:16:06 -0700 (PDT) Received: by mail-io0-x241.google.com with SMTP id t23-v6so8392431ioc.10 for ; Mon, 23 Apr 2018 23:16:06 -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=vKeHTOJt4j48ispNhvWgVxQUP9mkEaYlGFeCpzfm5Og=; b=KbAafnn+5lNwzAPEZ/NapF1ApBwHEsEZLT42gis9Wk/rNqy9zr99jLyl1ULrXxJc6j 161AlTTE+oZmUy3xX/M3w0w2ktCHrleMtkkpoPmtb7N8tvPnQn4FOhNgn9KOJURy28e3 6zCBMjHpkbPutuUFVlhiOR95Y8PJJNWl4Tq5U= 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=vKeHTOJt4j48ispNhvWgVxQUP9mkEaYlGFeCpzfm5Og=; b=HRV/M0kFFw60OOH8uOC6YFbxJnSNFrpEMQ219WK3mTJkNJjZptPUcv6p3DDxOKIvpN rQ2YqqkiWU1vqTNzZSwfB5WW2uWNSOxZ45eK+/0KmIX5cQRSHz/Pcmj1wANqyeOXgTE1 oUXDfmlFkpN2Rzt8rLCbKyqU7jfBiuQyBSQCUZYDYyzvXoPOzI2Oicxr5cGGDhpfYC4Q 1w1L35z83TEiKYAtCpfsaE9sOVBpk/ZRjzu1vmjV1y2RuWMRFMN1jLPU7ecPeI3lrPlg w1hed3yqBobpN8TOocqiFV9Z6D1VEAk/wMvMk8q+AhMhcJ6zTwpaGpk5iyo1SiAel64I cbyA== X-Gm-Message-State: ALQs6tDCGaDmVisyTbbx5jGitEf2jsQ0nFnLOjgOWMRRNtX+HqL+MO4S jUdDUwPrmJrD7kpDvuRUNqNlBu0qRnmvrNup5wq1Vw== X-Google-Smtp-Source: AIpwx4/rcvCKreIVAiy/ooy7M1TX/amtzMErdqV2cMR5+fgGwrrsdvkb6jRp6Q5uTecDOrkJX2SlRmlleSxDUA5mjoU= X-Received: by 2002:a6b:545:: with SMTP id 66-v6mr24346857iof.173.1524550565344; Mon, 23 Apr 2018 23:16:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.67 with HTTP; Mon, 23 Apr 2018 23:16:04 -0700 (PDT) In-Reply-To: <20180424005048.26291-1-lersek@redhat.com> References: <20180424005048.26291-1-lersek@redhat.com> From: Ard Biesheuvel Date: Tue, 24 Apr 2018 08:16:04 +0200 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Julien Grall Subject: Re: [PATCH] ArmVirtPkg: use protocol-based DevicePathLib instance for most DXE modules X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 06:16:07 -0000 Content-Type: text/plain; charset="UTF-8" On 24 April 2018 at 02:50, Laszlo Ersek wrote: > Port OvmfPkg commit 5c3481b0b611e to ArmVirtPkg. Some explanation should > be in order (because 5c3481b0b611e doesn't offer any): > > - The UefiDevicePathLibDevicePathProtocol instance uses the Device Path > Utilities Protocol, produced by DevicePathDxe, for formatting and > parsing the textual device path representation. This allows for a > lighter weight lib instance that gets linked into several DXE modules. > In comparison, the more standalone UefiDevicePathLib instance includes > the formatting and parsing routines in every client module. > > - The DXE core needs DevicePathLib before it dispatches DevicePathDxe, so > it needs to stick with the standalone instance. > > - DevicePathDxe itself also needs the standalone instance, for > implementing the protocol. > > - The DXE-phase PCD driver, "MdeModulePkg/Universal/PCD/Dxe/Pcd.inf", > depends on DevicePathLib via UefiLib and DxeServicesLib at the least; so > with this update, it inherits a dependency on the protocol. In reverse, > DevicePathDxe depends on the PCD Protocol, via PcdLib. The cycle is > broken by using BasePcdLibNull in DevicePathDxe. That restricts it to > FixedAtBuild, Patch, and FeatureFlag PCDs, but that's fine. > > Example space savings (using ArmVirtQemu and the GCC5 toolchain): > - NOOPT: 187KB in FVMAIN, 12KB in FVMAIN_COMPACT > - DEBUG: 147KB in FVMAIN, 20KB in FVMAIN_COMPACT > - RELEASE: 123KB in FVMAIN, 17KB in FVMAIN_COMPACT > > Cc: Ard Biesheuvel > Cc: Julien Grall > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=940 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel > --- > > Notes: > Repo: https://github.com/lersek/edk2.git > Branch: armvirt_devpathlib > > ArmVirtPkg/ArmVirt.dsc.inc | 2 +- > ArmVirtPkg/ArmVirtQemu.dsc | 7 ++++++- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 7 ++++++- > ArmVirtPkg/ArmVirtXen.dsc | 7 ++++++- > 4 files changed, 19 insertions(+), 4 deletions(-) > > diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc > index cde514958da2..35bccb3dc1f4 100644 > --- a/ArmVirtPkg/ArmVirt.dsc.inc > +++ b/ArmVirtPkg/ArmVirt.dsc.inc > @@ -48,7 +48,7 @@ [LibraryClasses.common] > UefiLib|MdePkg/Library/UefiLib/UefiLib.inf > HobLib|ArmVirtPkg/Library/ArmVirtDxeHobLib/ArmVirtDxeHobLib.inf > UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf > - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf > UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf > DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf > DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 824070edc2a9..d74feb709cd1 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -243,6 +243,7 @@ [Components.common] > MdeModulePkg/Core/Dxe/DxeMain.inf { > > NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > } > MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { > > @@ -319,7 +320,11 @@ [Components.common] > # > # Bds > # > - MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { > + > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf > diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc > index 2368ba283bff..1e823aeab7c0 100644 > --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc > +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc > @@ -232,6 +232,7 @@ [Components.common] > MdeModulePkg/Core/Dxe/DxeMain.inf { > > NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > } > MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { > > @@ -308,7 +309,11 @@ [Components.common] > # > # Bds > # > - MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { > + > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf > diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc > index 175b56d10c8f..e0fb4b47cf63 100644 > --- a/ArmVirtPkg/ArmVirtXen.dsc > +++ b/ArmVirtPkg/ArmVirtXen.dsc > @@ -153,6 +153,7 @@ [Components.common] > MdeModulePkg/Core/Dxe/DxeMain.inf { > > NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > } > MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { > > @@ -205,7 +206,11 @@ [Components.common] > # > # Bds > # > - MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { > + > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > -- > 2.14.1.3.gb7cf6e02401b >