From nobody Fri May 3 10:41:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1521140596025718.9394088810797; Thu, 15 Mar 2018 12:03:16 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 34353223FCF42; Thu, 15 Mar 2018 11:56:50 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 174EE20956071 for ; Thu, 15 Mar 2018 11:56:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9470406803E; Thu, 15 Mar 2018 19:03:10 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-233.rdu2.redhat.com [10.10.121.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A253BDC4D; Thu, 15 Mar 2018 19:03:09 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 15 Mar 2018 20:02:54 +0100 Message-Id: <20180315190258.6580-2-lersek@redhat.com> In-Reply-To: <20180315190258.6580-1-lersek@redhat.com> References: <20180315190258.6580-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 15 Mar 2018 19:03:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 15 Mar 2018 19:03:10 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 1/5] ArmVirtPkg/PlatformBootManagerLib: return to "-kernel before boot devices" 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: , Cc: Xiang Zheng , Ard Biesheuvel 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" Move the TryRunningQemuKernel() call back to its original place. This improves the UEFI boot time for VMs that have "-kernel", many disks or NICs, and no "bootindex" properties. A well-known example is guestfish/libguestfs. For more info on the TryRunningQemuKernel() location, see the following commits: 23d04b58e27b, a78c4836ea0b, 158990b941e4. Cc: Ard Biesheuvel Cc: Xiang Zheng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Tested-by: Gabriel Somlo --- ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 16 ++++++++------= -- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVi= rtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 36e0eed2384a..5d5e51d8c870 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -667,31 +667,31 @@ PlatformBootManagerAfterConsole ( =20 // // Show the splash screen. // BootLogoEnableLogo (); =20 + // + // Process QEMU's -kernel command line option. The kernel booted this way + // will receive ACPI tables: in PlatformBootManagerBeforeConsole(), we + // connected any and all PCI root bridges, and then signaled the ACPI + // platform driver. + // + TryRunningQemuKernel (); + // // Connect the purported boot devices. // Status =3D ConnectDevicesFromQemu (); if (RETURN_ERROR (Status)) { // // Connect the rest of the devices. // EfiBootManagerConnectAll (); } =20 - // - // Process QEMU's -kernel command line option. Note that the kernel boot= ed - // this way should receive ACPI tables, which is why we connect all devi= ces - // first (see above) -- PCI enumeration blocks ACPI table installation, = if - // there is a PCI host. - // - TryRunningQemuKernel (); - // // Enumerate all possible boot options, then filter and reorder them bas= ed on // the QEMU configuration. // EfiBootManagerRefreshAllBootOption (); =20 --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 10:41:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1521140598143873.1936926304436; Thu, 15 Mar 2018 12:03:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9246B223FCF48; Thu, 15 Mar 2018 11:56:52 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 6553D20954B84 for ; Thu, 15 Mar 2018 11:56:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F1C8406803E; Thu, 15 Mar 2018 19:03:15 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-233.rdu2.redhat.com [10.10.121.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09117BDC4D; Thu, 15 Mar 2018 19:03:13 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 15 Mar 2018 20:02:55 +0100 Message-Id: <20180315190258.6580-3-lersek@redhat.com> In-Reply-To: <20180315190258.6580-1-lersek@redhat.com> References: <20180315190258.6580-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 15 Mar 2018 19:03:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 15 Mar 2018 19:03:15 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 2/5] OvmfPkg/PlatformBootManagerLib: wrap overlong lines in "BdsPlatform.c" 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: , Cc: Jordan Justen , Ard Biesheuvel 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" No functional changes. Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Tested-by: Gabriel Somlo --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 79 +++++++++++++---= ---- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index 5ef0e828900d..99b7db7cc05a 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -1,17 +1,17 @@ /** @file Platform BDS customizations. =20 Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e found at + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php =20 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. =20 **/ =20 #include "BdsPlatform.h" #include #include @@ -387,13 +387,14 @@ Returns: Status =3D gBS->InstallProtocolInterface (&Handle, &gEfiDxeSmmReadyToLockProtocolGuid, EFI_NATIVE_INTERFACE, NULL); ASSERT_EFI_ERROR (Status); =20 // - // Dispatch deferred images after EndOfDxe event and ReadyToLock install= ation. + // Dispatch deferred images after EndOfDxe event and ReadyToLock + // installation. // EfiBootManagerDispatchDeferredImages (); =20 PlatformInitializeConsole (gPlatformConsole); PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, GetFrontPageTimeoutFromQemu ()); @@ -467,25 +468,29 @@ Returns: } TempDevicePath =3D DevicePath; =20 // // Register Keyboard // - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gPnpPs2KeyboardDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode); =20 EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); =20 // // Register COM1 // DevicePath =3D TempDevicePath; gPnp16550ComPortDeviceNode.UID =3D 0; =20 - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gPnp16550ComPortDeviceNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gUartDeviceNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gTerminalTypeDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gPnp16550ComPortDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); =20 // // Print Device Path // DevPathStr =3D ConvertDevicePathToText (DevicePath, FALSE, FALSE); if (DevPathStr !=3D NULL) { @@ -506,15 +511,18 @@ Returns: // // Register COM2 // DevicePath =3D TempDevicePath; gPnp16550ComPortDeviceNode.UID =3D 1; =20 - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gPnp16550ComPortDeviceNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gUartDeviceNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gTerminalTypeDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gPnp16550ComPortDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); =20 // // Print Device Path // DevPathStr =3D ConvertDevicePathToText (DevicePath, FALSE, FALSE); if (DevPathStr !=3D NULL) { @@ -585,13 +593,14 @@ GetGopDevicePath ( ); if (!EFI_ERROR (Status)) { // // Add all the child handles as possible Console Device // for (Index =3D 0; Index < GopHandleCount; Index++) { - Status =3D gBS->HandleProtocol (GopHandleBuffer[Index], &gEfiDeviceP= athProtocolGuid, (VOID*)&TempDevicePath); + Status =3D gBS->HandleProtocol (GopHandleBuffer[Index], + &gEfiDevicePathProtocolGuid, (VOID*)&TempDevicePath); if (EFI_ERROR (Status)) { continue; } if (CompareMem ( PciDevicePath, TempDevicePath, @@ -604,14 +613,14 @@ GetGopDevicePath ( // In future, we could select all child handles to be console devi= ce // =20 *GopDevicePath =3D TempDevicePath; =20 // - // Delete the PCI device's path that added by GetPlugInPciVgaDevic= ePath() - // Add the integrity GOP device path. + // Delete the PCI device's path that added by + // GetPlugInPciVgaDevicePath(). Add the integrity GOP device path. // EfiBootManagerUpdateConsoleVariable (ConOutDev, NULL, PciDevicePat= h); EfiBootManagerUpdateConsoleVariable (ConOutDev, TempDevicePath, NU= LL); } } gBS->FreePool (GopHandleBuffer); @@ -697,14 +706,16 @@ Returns: (VOID*)&DevicePath ); if (EFI_ERROR (Status)) { return Status; } =20 - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gUartDeviceNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gTerminalTypeDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode); + DevicePath =3D AppendDevicePathNode (DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); =20 EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL); EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL); =20 return EFI_SUCCESS; @@ -814,13 +825,14 @@ VisitAllPciInstances ( ConOut, ConIn, ErrOut. =20 @param[in] Handle - Handle of PCI device instance @param[in] PciIo - PCI IO protocol instance @param[in] Pci - PCI Header register block =20 - @retval EFI_SUCCESS - PCI Device check and Console variable update succe= ssfully. + @retval EFI_SUCCESS - PCI Device check and Console variable update + successfully. @retval EFI_STATUS - PCI Device check or Console variable update fail. =20 **/ EFI_STATUS EFIAPI DetectAndPreparePlatformPciDevicePath ( @@ -888,13 +900,14 @@ DetectAndPreparePlatformPciDevicePath ( =20 /** Do platform specific PCI Device check and add them to ConOut, ConIn, Err= Out =20 @param[in] DetectVgaOnly - Only detect VGA device if it's TRUE. =20 - @retval EFI_SUCCESS - PCI Device check and Console variable update succe= ssfully. + @retval EFI_SUCCESS - PCI Device check and Console variable update + successfully. @retval EFI_STATUS - PCI Device check or Console variable update fail. =20 **/ EFI_STATUS DetectAndPreparePlatformPciDevicePaths ( BOOLEAN DetectVgaOnly @@ -925,18 +938,20 @@ Arguments: EFI_DEVICE_PATH_PROTOCOL *VarConout; EFI_DEVICE_PATH_PROTOCOL *VarConin; =20 // // Connect RootBridge // - GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout, = NULL); + GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout, + NULL); GetEfiGlobalVariable2 (EFI_CON_IN_VARIABLE_NAME, (VOID **) &VarConin, NU= LL); =20 if (VarConout =3D=3D NULL || VarConin =3D=3D NULL) { // - // Do platform specific PCI Device check and add them to ConOut, ConIn= , ErrOut + // Do platform specific PCI Device check and add them to ConOut, ConIn, + // ErrOut // DetectAndPreparePlatformPciDevicePaths (FALSE); =20 // // Have chance to connect the platform default console, // the platform default console is the minimum device group @@ -944,19 +959,22 @@ Arguments: // for (Index =3D 0; PlatformConsole[Index].DevicePath !=3D NULL; ++Index= ) { // // Update the console variable with the connect type // if ((PlatformConsole[Index].ConnectType & CONSOLE_IN) =3D=3D CONSOLE= _IN) { - EfiBootManagerUpdateConsoleVariable (ConIn, PlatformConsole[Index]= .DevicePath, NULL); + EfiBootManagerUpdateConsoleVariable (ConIn, + PlatformConsole[Index].DevicePath, NULL); } if ((PlatformConsole[Index].ConnectType & CONSOLE_OUT) =3D=3D CONSOL= E_OUT) { - EfiBootManagerUpdateConsoleVariable (ConOut, PlatformConsole[Index= ].DevicePath, NULL); + EfiBootManagerUpdateConsoleVariable (ConOut, + PlatformConsole[Index].DevicePath, NULL); } if ((PlatformConsole[Index].ConnectType & STD_ERROR) =3D=3D STD_ERRO= R) { - EfiBootManagerUpdateConsoleVariable (ErrOut, PlatformConsole[Index= ].DevicePath, NULL); + EfiBootManagerUpdateConsoleVariable (ErrOut, + PlatformConsole[Index].DevicePath, NULL); } } } else { // // Only detect VGA device and add them to ConOut // @@ -1234,13 +1252,16 @@ ConnectRecursivelyIfPciMassStorage ( // DevPathStr =3D ConvertDevicePathToText (DevicePath, FALSE, FALSE); if (DevPathStr !=3D NULL) { DEBUG(( EFI_D_INFO, "Found %s device: %s\n", - IS_CLASS1 (PciHeader, PCI_CLASS_MASS_STORAGE) ? L"Mass Storage" : = L"Xen", + (IS_CLASS1 (PciHeader, PCI_CLASS_MASS_STORAGE) ? + L"Mass Storage" : + L"Xen" + ), DevPathStr )); FreePool(DevPathStr); } =20 Status =3D gBS->ConnectController (Handle, NULL, NULL, TRUE); @@ -1528,13 +1549,14 @@ NotifyDevPath ( continue; } =20 // // Get the DevicePath protocol on that handle // - Status =3D gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (= VOID **)&DevPathNode); + Status =3D gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, + (VOID **)&DevPathNode); ASSERT_EFI_ERROR (Status); =20 while (!IsDevicePathEnd (DevPathNode)) { // // Find the handler to dump this device path node // @@ -1578,13 +1600,14 @@ InstallDevicePathCallback ( NULL, &mEfiDevPathNotifyReg ); } =20 /** - This function is called each second during the boot manager waits the ti= meout. + This function is called each second during the boot manager waits the + timeout. =20 @param TimeoutRemain The remaining timeout. **/ VOID EFIAPI PlatformBootManagerWaitCallback ( --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 10:41:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1521140601509449.1637506628756; Thu, 15 Mar 2018 12:03:21 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id ECFAD223FCF59; Thu, 15 Mar 2018 11:56:55 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 E3B1320954B84 for ; Thu, 15 Mar 2018 11:56:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97A9D813F699; Thu, 15 Mar 2018 19:03:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-233.rdu2.redhat.com [10.10.121.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 722E2BDC58; Thu, 15 Mar 2018 19:03:15 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 15 Mar 2018 20:02:56 +0100 Message-Id: <20180315190258.6580-4-lersek@redhat.com> In-Reply-To: <20180315190258.6580-1-lersek@redhat.com> References: <20180315190258.6580-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 15 Mar 2018 19:03:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 15 Mar 2018 19:03:17 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 3/5] OvmfPkg/PlatformBootManagerLib: rejuvenate old-style function comments 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: , Cc: Jordan Justen , Ard Biesheuvel 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" The old-style "Routine Description: ..." comments use the leftmost column and are placed between the parameter list and the function body. Therefore they cause git-diff to produce bogus hunk headers that fail to name the function being patched. Convert these comment blocks to the current edk2 style. While at it, clean them up too. For PlatformBootManagerBeforeConsole() and PlatformBootManagerAfterConsole(), copy the descriptions from the call sites in "MdeModulePkg/Universal/BdsDxe/BdsEntry.c". They are more detailed than the comments in the lib class header "MdeModulePkg/Include/Library/PlatformBootManagerLib.h"; ArmVirtPkg already uses these comments. No functional changes. Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Tested-by: Gabriel Somlo --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 172 ++++++++-------= ----- 1 file changed, 70 insertions(+), 102 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index 99b7db7cc05a..b155639f3c97 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -325,31 +325,30 @@ SaveS3BootScript ( VOID ); =20 // // BDS Platform Functions // +/** + Do the platform init, can be customized by OEM/IBV + + Possible things that can be done in PlatformBootManagerBeforeConsole: + + > Update console variable: 1. include hot-plug devices; + > 2. Clear ConIn and add SOL for AMT + > Register new Driver#### or Boot#### + > Register new Key####: e.g.: F12 + > Signal ReadyToLock event + > Authentication action: 1. connect Auth devices; + > 2. Identify auto logon user. +**/ VOID EFIAPI PlatformBootManagerBeforeConsole ( VOID ) -/*++ - -Routine Description: - - Platform Bds init. Include the platform firmware vendor, revision - and so crc check. - -Arguments: - -Returns: - - None. - ---*/ { EFI_HANDLE Handle; EFI_STATUS Status; RETURN_STATUS PcdStatus; =20 DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n")); @@ -426,34 +425,27 @@ ConnectRootBridge ( FALSE // Recursive ); return Status; } =20 =20 +/** + Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut. + + @param[in] DeviceHandle Handle of the LPC Bridge device. + + @retval EFI_SUCCESS Console devices on the LPC bridge have been added to + ConOut, ConIn, and ErrOut. + + @return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing + from DeviceHandle. +**/ EFI_STATUS PrepareLpcBridgeDevicePath ( IN EFI_HANDLE DeviceHandle ) -/*++ - -Routine Description: - - Add IsaKeyboard to ConIn, - add IsaSerial to ConOut, ConIn, ErrOut. - LPC Bridge: 06 01 00 - -Arguments: - - DeviceHandle - Handle of PCIIO protocol. - -Returns: - - EFI_SUCCESS - LPC bridge is added to ConOut, ConIn, and ErrO= ut. - EFI_STATUS - No LPC bridge is added. - ---*/ { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; CHAR16 *DevPathStr; =20 @@ -626,33 +618,26 @@ GetGopDevicePath ( gBS->FreePool (GopHandleBuffer); } =20 return EFI_SUCCESS; } =20 +/** + Add PCI display to ConOut. + + @param[in] DeviceHandle Handle of the PCI display device. + + @retval EFI_SUCCESS The PCI display device has been added to ConOut. + + @return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing + from DeviceHandle. +**/ EFI_STATUS PreparePciDisplayDevicePath ( IN EFI_HANDLE DeviceHandle ) -/*++ - -Routine Description: - - Add PCI VGA to ConOut. - PCI VGA: 03 00 00 - -Arguments: - - DeviceHandle - Handle of PCIIO protocol. - -Returns: - - EFI_SUCCESS - PCI VGA is added to ConOut. - EFI_STATUS - No PCI VGA device is added. - ---*/ { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; =20 DevicePath =3D NULL; @@ -671,33 +656,27 @@ Returns: =20 EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL); =20 return EFI_SUCCESS; } =20 -EFI_STATUS -PreparePciSerialDevicePath ( - IN EFI_HANDLE DeviceHandle - ) -/*++ - -Routine Description: - +/** Add PCI Serial to ConOut, ConIn, ErrOut. - PCI Serial: 07 00 02 =20 -Arguments: + @param[in] DeviceHandle Handle of the PCI serial device. =20 - DeviceHandle - Handle of PCIIO protocol. + @retval EFI_SUCCESS The PCI serial device has been added to ConOut, Con= In, + ErrOut. =20 -Returns: - - EFI_SUCCESS - PCI Serial is added to ConOut, ConIn, and ErrO= ut. - EFI_STATUS - No PCI Serial device is added. - ---*/ + @return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing + from DeviceHandle. +**/ +EFI_STATUS +PreparePciSerialDevicePath ( + IN EFI_HANDLE DeviceHandle + ) { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; =20 DevicePath =3D NULL; Status =3D gBS->HandleProtocol ( @@ -915,27 +894,23 @@ DetectAndPreparePlatformPciDevicePaths ( { mDetectVgaOnly =3D DetectVgaOnly; return VisitAllPciInstances (DetectAndPreparePlatformPciDevicePath); } =20 =20 +/** + Connect the predefined platform default console device. + + Always try to find and enable PCI display devices. + + @param[in] PlatformConsole Predefined platform default console device a= rray. +**/ VOID PlatformInitializeConsole ( IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole ) -/*++ - -Routine Description: - - Connect the predefined platform default console device. Always try to fi= nd - and enable the vga device if have. - -Arguments: - - PlatformConsole - Predefined platform default console device arr= ay. ---*/ { UINTN Index; EFI_DEVICE_PATH_PROTOCOL *VarConout; EFI_DEVICE_PATH_PROTOCOL *VarConin; =20 // @@ -1343,32 +1318,21 @@ PlatformBdsRestoreNvVarsFromHardDisk ( VisitingFileSystemInstance, NULL ); =20 } =20 +/** + Connect with predefined platform connect sequence. + + The OEM/IBV can customize with their own connect sequence. +**/ VOID PlatformBdsConnectSequence ( VOID ) -/*++ - -Routine Description: - - Connect with predefined platform connect sequence, - the OEM/IBV can customize with their own connect sequence. - -Arguments: - - None. - -Returns: - - None. - ---*/ { UINTN Index; RETURN_STATUS Status; =20 DEBUG ((EFI_D_INFO, "PlatformBdsConnectSequence\n")); =20 @@ -1428,26 +1392,30 @@ SaveS3BootScript ( (UINT32) sizeof Info, (EFI_PHYSICAL_ADDRESS)(UINTN) &Info); ASSERT_EFI_ERROR (Status); } =20 =20 +/** + Do the platform specific action after the console is ready + + Possible things that can be done in PlatformBootManagerAfterConsole: + + > Console post action: + > Dynamically switch output mode from 100x31 to 80x25 for certain sena= rino + > Signal console ready platform customized event + > Run diagnostics like memory testing + > Connect certain devices + > Dispatch aditional option roms + > Special boot: e.g.: USB boot, enter UI +**/ VOID EFIAPI PlatformBootManagerAfterConsole ( VOID ) -/*++ - -Routine Description: - - The function will execute with as the platform policy, current policy - is driven by boot mode. IBV/OEM can customize this code for their specif= ic - policy action. - ---*/ { EFI_BOOT_MODE BootMode; =20 DEBUG ((EFI_D_INFO, "PlatformBootManagerAfterConsole\n")); =20 if (PcdGetBool (PcdOvmfFlashVariablesEnable)) { --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 10:41:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1521140603538640.02331592717; Thu, 15 Mar 2018 12:03:23 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6109E223FCF5D; Thu, 15 Mar 2018 11:56:56 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 859BC223FCF56 for ; Thu, 15 Mar 2018 11:56:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 474374023113; Thu, 15 Mar 2018 19:03:19 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-233.rdu2.redhat.com [10.10.121.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 068F2C225F; Thu, 15 Mar 2018 19:03:17 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 15 Mar 2018 20:02:57 +0100 Message-Id: <20180315190258.6580-5-lersek@redhat.com> In-Reply-To: <20180315190258.6580-1-lersek@redhat.com> References: <20180315190258.6580-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 15 Mar 2018 19:03:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 15 Mar 2018 19:03:19 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 4/5] OvmfPkg/PlatformBootManagerLib: hoist PciAcpiInitialization() 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: , Cc: Jordan Justen , "Gabriel L. Somlo" , Ard Biesheuvel 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" PlatformBootManagerAfterConsole() <--------------------------------+ PlatformBdsConnectSequence() | ConnectDevicesFromQemu() / EfiBootManagerConnectAll() | PciAcpiInitialization() ---------------------------------+ TryRunningQemuKernel() Functionally this is a no-op: - PciAcpiInitialization() iterates over PciIo protocol instances, which are available just the same at the new call site. - The PCI interrupt line register exists only to inform system software (it doesn't affect hardware) and UEFI drivers don't use PCI interrupts anyway. (More background in commits 2e70cf8ade0d and 5218c27950c4.) This change will let us move TryRunningQemuKernel() between PciAcpiInitialization() and PlatformBdsConnectSequence() in the next patch. Cc: "Gabriel L. Somlo" Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Acked-by: Gabriel Somlo Reviewed-by: Ard Biesheuvel Tested-by: Gabriel Somlo --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index b155639f3c97..b624b8f22535 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -1356,14 +1356,12 @@ PlatformBdsConnectSequence ( // // Just use the simple policy to connect all devices // DEBUG ((DEBUG_INFO, "EfiBootManagerConnectAll\n")); EfiBootManagerConnectAll (); } - - PciAcpiInitialization (); } =20 /** Save the S3 boot script. =20 Note that DxeSmmReadyToLock must be signaled after this function returns; @@ -1443,12 +1441,17 @@ PlatformBootManagerAfterConsole ( =20 // // Logo show // BootLogoEnableLogo (); =20 + // + // Set PCI Interrupt Line registers and ACPI SCI_EN + // + PciAcpiInitialization (); + // // Perform some platform specific connect sequence // PlatformBdsConnectSequence (); =20 // --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri May 3 10:41:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152114060647864.86961857772155; Thu, 15 Mar 2018 12:03:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C06952253FB79; Thu, 15 Mar 2018 11:56:58 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 23ECF2253FB74 for ; Thu, 15 Mar 2018 11:56:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFEAC406E8D7; Thu, 15 Mar 2018 19:03:20 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-233.rdu2.redhat.com [10.10.121.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2E58BDC58; Thu, 15 Mar 2018 19:03:19 +0000 (UTC) X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 15 Mar 2018 20:02:58 +0100 Message-Id: <20180315190258.6580-6-lersek@redhat.com> In-Reply-To: <20180315190258.6580-1-lersek@redhat.com> References: <20180315190258.6580-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 15 Mar 2018 19:03:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 15 Mar 2018 19:03:20 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [PATCH 5/5] OvmfPkg/PlatformBootManagerLib: process "-kernel" before boot devices 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: , Cc: Jordan Justen , Ard Biesheuvel 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 improves the UEFI boot time for VMs that have "-kernel", many disks or NICs, and no "bootindex" properties. (Unlike in ArmVirt commit 23d04b58e27b, in OvmfPkg commit 52fba28994e9 we introduced TryRunningQemuKernel() right from the start *after* BdsLibConnectAll(). Therefore, unlike in patch 'ArmVirtPkg/PlatformBootManagerLib: return to "-kernel before boot devices"', we adopt the logic as new in this patch.) Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Tested-by: Gabriel Somlo --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index b624b8f22535..862fa6ebb4e5 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -1446,22 +1446,22 @@ PlatformBootManagerAfterConsole ( =20 // // Set PCI Interrupt Line registers and ACPI SCI_EN // PciAcpiInitialization (); =20 - // - // Perform some platform specific connect sequence - // - PlatformBdsConnectSequence (); - // // Process QEMU's -kernel command line option // TryRunningQemuKernel (); =20 + // + // Perform some platform specific connect sequence + // + PlatformBdsConnectSequence (); + EfiBootManagerRefreshAllBootOption (); =20 // // Register UEFI Shell // PlatformRegisterFvBootOption ( --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel