From nobody Sat May 4 23:56:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 149690496815116.892832201363035; Wed, 7 Jun 2017 23:56:08 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 668FB20945540; Wed, 7 Jun 2017 23:54:49 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8156321967BF0 for ; Wed, 7 Jun 2017 23:54:48 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 07 Jun 2017 23:55:57 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.9.14]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jun 2017 23:55:54 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,313,1493708400"; d="scan'208";a="865773790" From: Liming Gao To: edk2-devel@lists.01.org Date: Thu, 8 Jun 2017 14:55:37 +0800 Message-Id: <1496904940-11364-2-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1496904940-11364-1-git-send-email-liming.gao@intel.com> References: <1496904940-11364-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [PATCH staging][BaseToolsOpt 1/4] BaseTools: Merge multiple drivers into one for size and link performance 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Update BaseTools to support the multiple driver combination. The merge style reuses the library instance syntax in package.dsc file. The below example is to combine VirtioGpu and QemuVideoDxe driver into one driver. VirtioGpu dri= ver entry point will be executed first, QemuVideoDxe entry point will run last. [Components] OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf { NULL|OvmfPkg/VirtioGpuDxe/VirtioGpu.inf } Notes: When try combining some drivers, the compile failure may happen, because the same function name are used in the different drivers. Those drivers are required to be clean up first, then be combined. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao --- BaseTools/Source/Python/AutoGen/GenC.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index 67aaef7..6579457 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1359,10 +1359,17 @@ def CreateLibraryDestructorCode(Info, AutoGenC, Aut= oGenH): def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH): if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']: return + =20 + ModuleEntryPointList =3D [] + for Lib in Info.DependentLibraryList: + if len (Lib.ModuleEntryPointList) > 0: + ModuleEntryPointList =3D ModuleEntryPointList + Lib.ModuleEntr= yPointList + ModuleEntryPointList =3D ModuleEntryPointList + Info.Module.ModuleEntr= yPointList + =20 # # Module Entry Points # - NumEntryPoints =3D len(Info.Module.ModuleEntryPointList) + NumEntryPoints =3D len(ModuleEntryPointList) if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification: PiSpecVersion =3D Info.Module.Specification['PI_SPECIFICATION_VERS= ION'] else: @@ -1372,7 +1379,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGe= nH): else: UefiSpecVersion =3D '0x00000000' Dict =3D { - 'Function' : Info.Module.ModuleEntryPointList, + 'Function' : ModuleEntryPointList, 'PiSpecVersion' : PiSpecVersion + 'U', 'UefiSpecVersion': UefiSpecVersion + 'U' } @@ -1385,7 +1392,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGe= nH): AUTOGEN_ERROR, '%s must have exactly one entry point' % Info.ModuleType, File=3Dstr(Info), - ExtraData=3D ", ".join(Info.Module.ModuleEntryPointList) + ExtraData=3D ", ".join(ModuleEntryPointList) ) if Info.ModuleType =3D=3D 'PEI_CORE': AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict)) @@ -1430,11 +1437,18 @@ def CreateModuleEntryPointCode(Info, AutoGenC, Auto= GenH): def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH): if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']: return + + ModuleUnloadImageList =3D [] + for Lib in Info.DependentLibraryList: + if len (Lib.ModuleUnloadImageList) > 0: + ModuleUnloadImageList =3D ModuleUnloadImageList + Lib.ModuleUn= loadImageList + ModuleUnloadImageList =3D ModuleUnloadImageList + Info.Module.ModuleUn= loadImageList + # # Unload Image Handlers # - NumUnloadImage =3D len(Info.Module.ModuleUnloadImageList) - Dict =3D {'Count':str(NumUnloadImage) + 'U', 'Function':Info.Module.Mo= duleUnloadImageList} + NumUnloadImage =3D len(ModuleUnloadImageList) + Dict =3D {'Count':str(NumUnloadImage) + 'U', 'Function':ModuleUnloadIm= ageList} if NumUnloadImage < 2: AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dic= t)) else: --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 23:56:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496904965375789.6391010735389; Wed, 7 Jun 2017 23:56:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DDE2920945543; Wed, 7 Jun 2017 23:54:49 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 909EB20945533 for ; Wed, 7 Jun 2017 23:54:48 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 07 Jun 2017 23:55:57 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.9.14]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jun 2017 23:55:55 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,313,1493708400"; d="scan'208";a="865773791" From: Liming Gao To: edk2-devel@lists.01.org Date: Thu, 8 Jun 2017 14:55:38 +0800 Message-Id: <1496904940-11364-3-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1496904940-11364-1-git-send-email-liming.gao@intel.com> References: <1496904940-11364-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [PATCH staging][BaseToolsOpt 2/4] OvmfPkg: Update QemuVideo and VirtioGpuDxe to use NULL as DriverBindingHandle 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To combine two drivers into one, they can't share ImageHandle as DriverBindingHandle. So, update their code to use NULL as DriverBindingHand= le. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao --- OvmfPkg/QemuVideoDxe/Driver.c | 2 +- OvmfPkg/VirtioGpuDxe/DriverBinding.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c index fc8025e..ce66c02 100644 --- a/OvmfPkg/QemuVideoDxe/Driver.c +++ b/OvmfPkg/QemuVideoDxe/Driver.c @@ -954,7 +954,7 @@ InitializeQemuVideo ( ImageHandle, SystemTable, &gQemuVideoDriverBinding, - ImageHandle, + NULL, &gQemuVideoComponentName, &gQemuVideoComponentName2 ); diff --git a/OvmfPkg/VirtioGpuDxe/DriverBinding.c b/OvmfPkg/VirtioGpuDxe/Dr= iverBinding.c index 33c1ad3..908bd1d 100644 --- a/OvmfPkg/VirtioGpuDxe/DriverBinding.c +++ b/OvmfPkg/VirtioGpuDxe/DriverBinding.c @@ -839,6 +839,6 @@ VirtioGpuEntryPoint ( ) { return EfiLibInstallDriverBindingComponentName2 (ImageHandle, SystemTabl= e, - &mDriverBinding, ImageHandle, NULL /* ComponentName */, + &mDriverBinding, NULL, NULL /* ComponentName */, &mComponentName2); } --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 23:56:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496904984043182.83320311293517; Wed, 7 Jun 2017 23:56:24 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 206E120945546; Wed, 7 Jun 2017 23:54:50 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 976712094553C for ; Wed, 7 Jun 2017 23:54:48 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 07 Jun 2017 23:55:57 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.9.14]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jun 2017 23:55:55 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,313,1493708400"; d="scan'208";a="865773793" From: Liming Gao To: edk2-devel@lists.01.org Date: Thu, 8 Jun 2017 14:55:39 +0800 Message-Id: <1496904940-11364-4-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1496904940-11364-1-git-send-email-liming.gao@intel.com> References: <1496904940-11364-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [PATCH staging][BaseToolsOpt 3/4] OvmfPkg: Combine QemuVideoDxe and VirtioGpuDxe to one driver 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is an example to show the driver combination in Platform.dsc. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao --- OvmfPkg/OvmfPkgIa32X64.dsc | 6 ++++-- OvmfPkg/OvmfPkgIa32X64.fdf | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index e1e386c..9858d33 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -678,8 +678,10 @@ MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf =20 - OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf - OvmfPkg/VirtioGpuDxe/VirtioGpu.inf + OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf { + + NULL|OvmfPkg/VirtioGpuDxe/VirtioGpu.inf + } =20 # # ISA Support diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index f6ed418..adad890 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -349,7 +349,7 @@ INF RuleOverride=3DCSM OvmfPkg/Csm/Csm16/Csm16.inf !endif =20 INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf -INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf +#INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf INF OvmfPkg/PlatformDxe/Platform.inf =20 !if $(SMM_REQUIRE) =3D=3D TRUE --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 23:56:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496904970069194.20910889429604; Wed, 7 Jun 2017 23:56:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 53FC02094554A; Wed, 7 Jun 2017 23:54:51 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9FF912094553D for ; Wed, 7 Jun 2017 23:54:48 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 07 Jun 2017 23:55:57 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.9.14]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jun 2017 23:55:56 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,313,1493708400"; d="scan'208";a="865773797" From: Liming Gao To: edk2-devel@lists.01.org Date: Thu, 8 Jun 2017 14:55:40 +0800 Message-Id: <1496904940-11364-5-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1496904940-11364-1-git-send-email-liming.gao@intel.com> References: <1496904940-11364-1-git-send-email-liming.gao@intel.com> Subject: [edk2] [PATCH staging][BaseToolsOpt 4/4] Update Readme.MD to include multiple driver combination. 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao --- Readme.MD | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.MD b/Readme.MD index a436dd5..b5646be 100644 --- a/Readme.MD +++ b/Readme.MD @@ -15,6 +15,7 @@ identified to be optimized. POC code will be added in thi= s branch for evaluation In Ubuntu 14.04 GCC5, OvmfPkgIa32X64 GenFds build time can be reduced f= rom 6s to 4s. 2) Support to merge multiple drivers into one. It should save the link tim= e. But, it doesn't save much in the multiple build.=20 Besides, this feature can save the image size when the image is not com= pressed, such as PEI images. + POC code has been added. One example in OvmfPkgIa32X64.dsc is added to = show how to combine more than drivers into single one. 3) Reduce the extra copy actions in build process. 4) Analyze cProfile data and enhance the parser logic. https://bugzilla.ti= anocore.org/show_bug.cgi?id=3D42 =20 --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel