From patchwork Thu Dec 8 15:33:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9466597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 921976071E for ; Thu, 8 Dec 2016 15:48:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84DD5285AC for ; Thu, 8 Dec 2016 15:48:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79C98285B2; Thu, 8 Dec 2016 15:48:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18EEE285AC for ; Thu, 8 Dec 2016 15:48:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cF0tn-0001Xh-Q4; Thu, 08 Dec 2016 15:46:19 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cF0tm-0001XQ-V4 for xen-devel@lists.xenproject.org; Thu, 08 Dec 2016 15:46:19 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id CB/49-08915-A4089485; Thu, 08 Dec 2016 15:46:18 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsXitHSDva5ng2e EwbNn+hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bh+0+YCl7JVZxs62BuYOyV6mLk5JAQ8Jc4 uOcqM4jNJmAgsWL6VUYQW0TAXmL2xz52EJtZQE/i3KKFrCC2sECsxN2v+5hAbBYBFYnL55rBe nkF7CS2XjjICjFTXmLh+SNgNZxA8eObP7OB2EICthKPb/5mhLDVJG4sXMYC0SsocXLmExaIXR ISB1+8YJ7AyDsLSWoWktQCRqZVjBrFqUVlqUW6hmZ6SUWZ6RkluYmZObqGBsZ6uanFxYnpqTm JScV6yfm5mxiBwcMABDsYV233PMQoycGkJMq7a4J7hBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ XpZ6zwghwaLU9NSKtMwcYBjDpCU4eJREeDVA0rzFBYm5xZnpEKlTjLocCyasfMokxJKXn5cqJ c7bDlIkAFKUUZoHNwIWU5cYZaWEeRmBjhLiKUgtys0sQZV/xSjOwagkzKsFMoUnM68EbtMroC OYgI6Yd8Md5IiSRISUVANj2NTv5YcOZ4adP8a90L3r1r51ZucunFvpsPKiqeeKoztfxd1/kt6 uG/TWNvhW7vLb01c5L4p6v7M5IV9s5xTN8q4pzPoNEpP28h73m7bf9cib1OtlM601H396+k85 3jzOpFjed9te0+KUtY/fJvGfPcNjE+jZ33DnjI/nqu0frWN4fT5t0eftVWIpzkg01GIuKk4EA Gcy22OkAgAA X-Env-Sender: prvs=143a4c3ea=anthony.perard@citrix.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1481211976!67629863!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64821 invoked from network); 8 Dec 2016 15:46:17 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 8 Dec 2016 15:46:17 -0000 X-IronPort-AV: E=Sophos;i="5.33,320,1477958400"; d="scan'208";a="402567029" From: Anthony PERARD To: , Date: Thu, 8 Dec 2016 15:33:38 +0000 Message-ID: <20161208153340.2285-13-anthony.perard@citrix.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161208153340.2285-1-anthony.perard@citrix.com> References: <20161208153340.2285-1-anthony.perard@citrix.com> MIME-Version: 1.0 Cc: Anthony PERARD Subject: [Xen-devel] [PATCH RFC 12/14] OvmfPkg/PlatformBootManagerLib: Use a Xen console for ConOut/ConIn X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP and add OvmfPkg/XenConsoleIo/XenConsoleIo to XenOvmf platform. It actually look for gEfiSerialIoProtocolGuid. --- .../Library/PlatformBootManagerLib/BdsPlatform.c | 33 ++++++++++++++++++++++ .../PlatformBootManagerLib.inf | 2 ++ OvmfPkg/XenOvmf.dsc | 4 +++ OvmfPkg/XenOvmf.fdf | 1 + 4 files changed, 40 insertions(+) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index bd64cc3..b8972f7 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -904,6 +904,31 @@ DetectAndPreparePlatformPciDevicePaths ( return VisitAllPciInstances (DetectAndPreparePlatformPciDevicePath); } +#include +EFI_STATUS +EFIAPI +add_serial ( + IN EFI_HANDLE DeviceHandle, + IN VOID *Instance, + IN VOID *Context + ) +{ + EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL; + + DevicePath = DevicePathFromHandle(DeviceHandle); + if (DevicePath == NULL) { + return EFI_NOT_FOUND; + } + + DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode); + DEBUG((EFI_D_ERROR, "%a %d: full path: %s\n", __FUNCTION__, __LINE__, + ConvertDevicePathToText(DevicePath, TRUE, FALSE) + )); + EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL); + EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); + EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL); + return EFI_SUCCESS; +} VOID PlatformInitializeConsole ( @@ -931,6 +956,14 @@ Arguments: GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout, NULL); GetEfiGlobalVariable2 (EFI_CON_IN_VARIABLE_NAME, (VOID **) &VarConin, NULL); + // do xen console + //VISIT_PCI_INSTANCE_CALLBACK CallBackFunction + VisitAllInstancesOfProtocol ( + &gEfiSerialIoProtocolGuid, + add_serial, + (VOID*)NULL + ); + if (VarConout == NULL || VarConin == NULL) { // // Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 4a6bece..74ab6b1 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -73,6 +73,8 @@ gEfiLoadedImageProtocolGuid # PROTOCOL SOMETIMES_PRODUCED gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED + gEfiSerialIoProtocolGuid + [Guids] gEfiXenInfoGuid gEfiEndOfDxeEventGroupGuid diff --git a/OvmfPkg/XenOvmf.dsc b/OvmfPkg/XenOvmf.dsc index 31a2185..8bce996 100644 --- a/OvmfPkg/XenOvmf.dsc +++ b/OvmfPkg/XenOvmf.dsc @@ -590,6 +590,10 @@ OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf OvmfPkg/XenBusDxe/XenBusDxe.inf OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf + OvmfPkg/XenConsoleIo/XenConsoleIo.inf { + + SerialPortLib|OvmfPkg/Library/XenConsoleSerialPortLib/XenConsoleSerialPortLib.inf + } MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf diff --git a/OvmfPkg/XenOvmf.fdf b/OvmfPkg/XenOvmf.fdf index f6876d7..a40d186 100644 --- a/OvmfPkg/XenOvmf.fdf +++ b/OvmfPkg/XenOvmf.fdf @@ -223,6 +223,7 @@ INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf INF OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf INF OvmfPkg/XenBusDxe/XenBusDxe.inf INF OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf +INF OvmfPkg/XenConsoleIo/XenConsoleIo.inf !if $(SECURE_BOOT_ENABLE) == TRUE INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf