From patchwork Fri Mar 31 09:59:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13195722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29B1BC6FD18 for ; Fri, 31 Mar 2023 10:00:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.516967.801919 (Exim 4.92) (envelope-from ) id 1piBYV-0001T2-7z; Fri, 31 Mar 2023 10:00:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 516967.801919; Fri, 31 Mar 2023 10:00:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1piBYV-0001Ss-4C; Fri, 31 Mar 2023 10:00:23 +0000 Received: by outflank-mailman (input) for mailman id 516967; Fri, 31 Mar 2023 10:00:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1piBYT-0000wE-FL for xen-devel@lists.xenproject.org; Fri, 31 Mar 2023 10:00:21 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d53bc2a4-cfaa-11ed-b464-930f4c7d94ae; Fri, 31 Mar 2023 12:00:16 +0200 (CEST) Received: from mail-co1nam11lp2175.outbound.protection.outlook.com (HELO NAM11-CO1-obe.outbound.protection.outlook.com) ([104.47.56.175]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 Mar 2023 06:00:07 -0400 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by DS7PR03MB5557.namprd03.prod.outlook.com (2603:10b6:5:2d3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22; Fri, 31 Mar 2023 10:00:05 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda%6]) with mapi id 15.20.6178.041; Fri, 31 Mar 2023 10:00:05 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d53bc2a4-cfaa-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1680256816; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=lYj38XyWiQWsj/xF0BWs/BuiMegSu0fDwGfxzapWfb4=; b=XdEdfZvGUQV0oeiBoDHnXcEHr8AW3VdNljkPbDd2VM1nyu3/TznCQp6k 0Pz1FygJ/I9ZPNSSnTmsOF/Ke7GqER1Mjq0QFJUHw4v81lBP/ZddVxvoF 5aETbcvrpLpSaOLPlA9K8PYGTzGrOAAQZ5HFA/UGpBRbEB7YZY+X6+guk I=; X-IronPort-RemoteIP: 104.47.56.175 X-IronPort-MID: 102606344 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:0TQopaP1jG0qD57vrR23lsFynXyQoLVcMsEvi/4bfWQNrUorhGEHn 2VKXjy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s=arcselector9901; d=microsoft.com; cv=none; b=igjDDLpU9rUeXuHFQN0gC7VKP+Mxmzg5imRcMyyrv6BFJ7pe2bKHOLDPiWaxs+x8sblVFXer9kgGHw+tMRpCl/Y69eW9ag7e8Zigha3wDbN1s5BJLOQ3eKuOX/9XK+Hg6dWk07/twjXl9f3MgkJzuYKqfFwfWGfGFFKuenBAOnOWEdwPiz52YqOROqncxVo8awomgApWihXiU5Tka+RBXTZ3N8F98fDEXi/zlWC9GwnKJ92fMtAfy2LWDYhsFjwj+DrjqFGko8OBkvCn1AZUqi9e/w5wFD1r51Yg9qLTOG6u2ttWt60X7OKSRB9sNcLocj7MqT7VDwSSlY3ZJa0VVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FtEAq5Ug7QXlXwnPC+8yAaWQRyQAyZNLb8vOr9AL0ng=; b=f9EpS/0FNO9XokSp7TGJff8wMiufzZRq2aVO9Wu3fqjTeYGO7Keb04y5hfS/sPuWdTvzM1NipZCKgLhSGZAk0WQjNsRCWuz+60BXznNuPQJXvOL7DjS/6/4PVah2PxLsWB1TK02eyXipRN/x58+9a7La7g1Gl0PdezZj7nKrg6AEOB8HkpfGjN+3f1SP9qpqciNKRNYhZiFGgjmm88IdHrcF9P/TanzPAVuF7qTEt/huo7sxoYgxHT88dEjzXbAbT+NGkQeWop5z26oUJBX/f3QuOj7EDWPaqbqaJIunskZWBRAn6nZfV8d0N9M1CHSVb0TL2viRic1Pzply7y0Auw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FtEAq5Ug7QXlXwnPC+8yAaWQRyQAyZNLb8vOr9AL0ng=; b=XqPGRGWQ5gjZq0yeO+pV5kaO8ur0v7qT+B3kzNVcmykiug+fC5VhqPzPNUufwrkqWYVX6BXVOIuCZFy8IfHbARpoDPJ/QL1E9fJTBHaYUVex7DPmlAIgDHmaarzrrz7H4Qax7OxeaGeS5E9wTMEnPG+UtGJc7UDiKHno3ynluC0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich Subject: [PATCH v2 1/3] efi: try to use the currently set GOP mode Date: Fri, 31 Mar 2023 11:59:44 +0200 Message-Id: <20230331095946.45024-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230331095946.45024-1-roger.pau@citrix.com> References: <20230331095946.45024-1-roger.pau@citrix.com> X-ClientProxiedBy: LO2P265CA0363.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::15) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|DS7PR03MB5557:EE_ X-MS-Office365-Filtering-Correlation-Id: 4648e4f9-f5e2-4994-af99-08db31ceb3f0 X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cIXg8mBMF5wDdBszW+QaDIsn8M8pvK7kR+/hWMIzsA2XrCbADcXno+RQ/DciTHdqWKBc17ezuMtQPi82i5LCAk3rtfNXx2KHiRrGz6QvXXRK5eUIe8QANj1nQrkwX6nn+xdBVQ4YIi1ougltgp6/EzAgXdE2iU6sHgpg/WXVJBDzAjb5PM4/blR+fXsX7QI1ugw7ar6mXefYTgSPnTH0HTGBzMUx8w46uiXp9s+pj1jMTobdwOvqVYJWFQ3FmQ7eQq6iTeznua/4N3/+xhYMR/Hydmz2Et1+2q3ibTltkNee/GTu7pav4xO3ju6Q3gmrPL2aIRmVbzz5//aU19XhMUvn4Bb6A5iwtAGZZDjQQECzmeDNI8h6YXtc7DaqzMK2L8kG0lo/dsgE7kQnmf2UOhHP0NRw852ea7RDUbTXIlJcPCG9e6pupnZCl57zgHl9LOgsFh7QBR5JP7HWyTAJeJboaZYss3VEf52hBUm8kc6qFegu016p6z5rMcH8xV9GB3K55NHO8kIhF+PVf1UpbdYc9CxhmnorEopdvugKj7Eofqynx1j5JutiaUKhPl8PR/LBPsPxlq01lcsFuy3L0zj70CuG8p6u0UIZsvJEPP4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199021)(478600001)(41300700001)(82960400001)(66556008)(66946007)(66476007)(83380400001)(2906002)(36756003)(54906003)(8676002)(316002)(4326008)(6512007)(86362001)(8936002)(186003)(26005)(6506007)(1076003)(6666004)(38100700002)(5660300002)(6916009)(6486002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kz1mfKz1yZfSsJsKMI3Jk/4wYxJf?= =?utf-8?q?j+Jrsm26S+7hnVh3D6tqI6hBhr6eYOC4L9DcM6Pc3UjNpTozp0Pxa1wWIZSCxTjhI?= =?utf-8?q?nZJ5C92aV3NlbAlr+q6uQZld8T6cCuWca7epEYADnCj4kYIgiVLQF8qCnP2q6B1Dz?= =?utf-8?q?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08ZtGDr/yjGnyiE2qesktDAeadljWS30zw/LWjpjIzvEljpCMrXfCWDsld8w?= =?utf-8?q?mngubrML1LoY0wxDfVvWg9tVHs2TdvXmGYi6CnT+hqOm3K1FFpY3DiKh0OJqKm6TS?= =?utf-8?q?We5snZWZIlMzLENWZCq2NsLSHJFq1WBZjabyr14zhedaWeOg4nLR7hAOPCD07bpyk?= =?utf-8?q?fX8Ema1b4PwmaCz8rKLq7bhbZ1C82kc+4/39NsnF+HLpD4jbKP4gihGjVTM16DHs9?= =?utf-8?q?V7wsST3VT3DAjNSEBsdSVN0uwJ4BVWw9gR440otjpQEEzcPr4SSPbs2GPOo2+27Ky?= =?utf-8?q?zs+WorbpiSfWoGfovumizxmx7uGxUMl3mM6trVqd2p0tXJqZwHImv+TRBDqpr744U?= =?utf-8?q?3xjMDXojPxv6xuH6/RSlSQ7uMxKf7j2C3+238E9XeiAm2yhYaGH2UvDJF6dwHKW/f?= =?utf-8?q?4VhLL7ba5N97Uw7NBNy4b2ToNPI69CBXtBljmG4qeDmCij2VKM0rsBpHxniEANujP?= =?utf-8?q?hf8KPXazuT99?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Es0Ljvs6tzutq4DzvVyXT7iFmMxp4RRmnNKZl9XFD4Ea7trIDoK1J1o8JTHf+0Tpg0IAUS3DiFF9WwpLTMsufy3Ln0jdRqR4Vh2MSjilY6UC89xogmYQyD5Hc84fIe6nGGC9iBRT0mNhLLM/JoRXYGg34QO7NkeBus1YxFjRnXgx5aii2FqvPlOAg+U+eOQn5rlaBeru9jLEYXDAwmYsQEocsFwqaSDsXUe019VLiYic8ejqeCkol79CI2GglBcZWK4suLrW8PYuVJZa8yBR2BRwcyWsQ/vhDPIHr7KRFzEOeOdVCAO8z0E8RoddDNICSBV2XMjdVYFbJIEw9b5wFeeRx+0BC//RVJZFwPdD+sTdqQ1+Br+B8wvKiJWkqlKa25zuOyZRvk04AnCaPA87BNhwLuMpux+UKAV7XHB29OtA8Bl6xDcttodzV+Ei9I3J9A0m1/qTPsYBV1kn/wUisMbmdJcUU0tIAS0+YemQjmIQ/Lo76uslACTvZIwX9czQjqaSKHcFDFuO+n11pPxbR9d6CvcRsq9ZHaF5A0KTwrYq6jIwLxQh8wnumeS7oQgs7wktUF9XUOLa1qkcAP2KbkYs9vuNaPyzF7zj10S58UyQcylNK8pMY/U5SRETn73eTC7ux1GZLXbc824JJaOigtUkf53Q9V1l9IJ4bXnc25MfZGEwxweouPmfpBYaxTcqX7Gehstlyv2QHvZ6VVINp6364kP+1Deq9LvsQUIUXRILQJhXLNLSrhFRf1SsGPOvdHvMemjGCya9vq1OzXFmu7MqVrmqNfiYoRsA2/rlkhf1hGbch8yvqM3n2q7Czf0W X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4648e4f9-f5e2-4994-af99-08db31ceb3f0 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 10:00:05.7970 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3RiHCddHh7SWdxVnnQM6KY3tBdGd7aTtWj9jYHERjV/IsInWUHiM3gVCOJV1K0RPiGM4VNZ1fEbydP1P7JrXDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5557 Modify efi_find_gop_mode() so that passing cols or rows as 0 is interpreted as a request to attempt to keep the currently set mode, and do so if the mode query for information is successful and the depth is supported. Signed-off-by: Roger Pau Monné --- Changes since v1: - Only update cols or rows if the value is 0. - Leave depth alone. --- xen/common/efi/boot.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index b69c83e354..766a2553be 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -930,6 +930,27 @@ static UINTN __init efi_find_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, UINTN gop_mode = ~0, info_size, size; unsigned int i; + if ( (!cols || !rows) && gop->Mode->Mode < gop->Mode->MaxMode ) + { + /* If no (valid) resolution suggested, try to use the current mode. */ + status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info); + if ( EFI_ERROR(status) ) + PrintErr(L"Invalid current graphics mode\r\n"); + else if ( mode_info->PixelFormat < PixelBltOnly ) + return gop->Mode->Mode; + else + { + /* + * Try to find a mode with the same resolution and a valid pixel + * format. + */ + if ( !cols ) + cols = mode_info->HorizontalResolution; + if ( !rows ) + rows = mode_info->VerticalResolution; + } + } + for ( i = size = 0; i < gop->Mode->MaxMode; ++i ) { unsigned int bpp = 0; From patchwork Fri Mar 31 09:59:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13195723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D55FBC6FD18 for ; Fri, 31 Mar 2023 10:00:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.516966.801909 (Exim 4.92) (envelope-from ) id 1piBYT-0001D5-UR; Fri, 31 Mar 2023 10:00:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 516966.801909; Fri, 31 Mar 2023 10:00:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1piBYT-0001Cw-R8; Fri, 31 Mar 2023 10:00:21 +0000 Received: by outflank-mailman (input) for mailman id 516966; Fri, 31 Mar 2023 10:00:20 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1piBYS-00016S-6I for xen-devel@lists.xenproject.org; Fri, 31 Mar 2023 10:00:20 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d585af4c-cfaa-11ed-85db-49a42c6b2330; Fri, 31 Mar 2023 12:00:17 +0200 (CEST) Received: from mail-bn7nam10lp2103.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.103]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 Mar 2023 06:00:13 -0400 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by DS7PR03MB5557.namprd03.prod.outlook.com (2603:10b6:5:2d3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22; Fri, 31 Mar 2023 10:00:11 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda%6]) with mapi id 15.20.6178.041; Fri, 31 Mar 2023 10:00:11 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d585af4c-cfaa-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1680256817; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=9mkcKgO6MSvhJxuRmV4lSgTE2Puli7Zu3o7kFqRJRFM=; b=arvx/i9OH84/udlX/Uha850v0+G/rJoABHNNR5kXttjyX89qQWKg+9BB FvBdPDC/H0eWy36+gA7ZS/pq+KMSaK4x3Xp5RbYn0N0YCNxOOqRfdxMJF JKMcpfn6Obel7DXso9bw6IOGZ6MpH+08AVTyAg+APZMLPi9vwGb2EXsRU w=; X-IronPort-RemoteIP: 104.47.70.103 X-IronPort-MID: 103834773 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:C0GeXqqVjJr7+AopzZDkwKhf3u5eBmI+ZBIvgKrLsJaIsI4StFCzt garIBnSMv+DZWOheY1wPovk90wCv5WBmIU1QQs6/ng2RC9Ho5uZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06WNwUmAWP6gR5weFzCBNVfrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXADQDVwq9tt2N+Y2YW+hFrcE4D/nVIYxK7xmMzRmBZRonabbqZvySoPV+g3I3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3j+CraYKOEjCJbZw9ckKwv GXJ8n6/GhgHHNee1SCE4jSngeqncSbTAdpJRObkqaEx6LGV7l5QWT80dVGnm6C8uBOkUopvK mYs3BN7+MDe82TuFLERRSaQsHOC+xIRRddUO+k78x2WjLrZ5R6DAWoJRSIHb8Yp3Oc0TzE30 l6Cn/vyGCdi9raSTBq16bO8vT60fy8PIgc/iTQsSAIE55zppt41hxeWFtJ7Svft1ZvyBC36x C2MoG4mnbIPgMUX1qK9u1fanzaroZuPRQkwjunKYl+YAspCTNbNT+SVBZLztJ6s8K7xooG9g UU5 IronPort-HdrOrdr: A9a23:UbRYyaBAvADCUuTlHel/55DYdb4zR+YMi2TDtnoBMCC9F/bzqy nAppQmPHPP+VEssRIb9+xoWpPwJE80nKQdieIs1NyZLW3bUQWTXedfBEjZrwEI2ReSygeQ78 hdWpk7L9vsDVd7h87m4A++Cb8bsbq62ZHtouHCz3hsRwl2a6dm9UNTDBqdGEEzZA5IA/MCZf ihDwN8xgadRQ== X-IronPort-AV: E=Sophos;i="5.98,307,1673931600"; d="scan'208";a="103834773" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CoCEJcampkBfI/QEd7vw+F+VBexzeRBeYbzAfGuP4Ax0wCpJ3SQT3XhwF3cbBKu8L1iR+B062VCGkmpXwGHYjD/AI1uDB/k9kczWF1+IumhpMFBvxbJGinaSUkyd6wS1Zou4kTFjNU8JN+n+x1P0lA1W4U/KnVv++h5WL4ghbLwk1Qg1Nx88Gm8Du1+sh27D4UqlBWuydHtUq5dHm6rPDkpS4eC/jmJHuu08TTe7B07VrUL/eZLAni4KKNxJhExg6GVmzrHmZnUdLz81ciCzf8XFKc/eZiScLIExcLs1h3uEYUyV7XBjRZivr/AMrQ0MP8HoTn8Z/ywZKFtIO4h3wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o57kufVo1caTCe7BHceGTpC82HwXX2FBnVVlDnpxb3M=; b=HUGRFUR2eYkm290iRRr7bMrgEeoicDPS6OkngqaV54TK1vk/ajOiwubJhmPOsLOPqfCNXhYoKpUvfhqVQZoFeTnNsesSBT4hEzotpiP04ebl63IuLoqzlK9nBvlGtQjw41i5+twU91PMuoul3/WywEEyqHHIYI9+b635mkuA4kw11YdtO42KT9Jtv30wmby1nRV3ZORkodxeW/UzvkaWtJKvCTG4ws62p5EFCWV26HLrlyQFj9rHIBSIUJjHOBWvW/rnhqgY7X4VL/uQavBD7R8jHgI6DsF2/IHtRfszMWNyhWTOD8xxpLFBDvpjP+XK1eL200jdWLFiLYRDQakseg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o57kufVo1caTCe7BHceGTpC82HwXX2FBnVVlDnpxb3M=; b=MBFxG5T7zEWGiRuRrC2CALpmnC56iPsi4CpgvWF7ESSqv1GoqV96g0ICiTX4+2oUm5pxqoGYdZr1qiLJd9SY3xX4ggXo8c4FAfeHTKb4oyx9saEwlyDV5JpBidFBClbS7rpDE9KwXSRa01DsA+AkrNrZ6hEm+5X3hHFGliuW5WA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH v2 2/3] multiboot2: parse console= and vga= options when setting GOP mode Date: Fri, 31 Mar 2023 11:59:45 +0200 Message-Id: <20230331095946.45024-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230331095946.45024-1-roger.pau@citrix.com> References: <20230331095946.45024-1-roger.pau@citrix.com> X-ClientProxiedBy: LO0P123CA0010.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:354::19) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|DS7PR03MB5557:EE_ X-MS-Office365-Filtering-Correlation-Id: c6d3d0c2-8ea0-40b9-c76d-08db31ceb757 X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ADrwufvB9naEiH9NGcz1cEKcidt3/8HWfv0dRMPPAgZiYIN+xbiTnGfe1hzp0/WxV87lNLSa+nN77ZthkBwLAFlX8JSmpWmhjw71r6AN389o5QYXB1TNykcwmcOm47dfKhS2VYBiyl/AdBChlu7dHnwv4TttqVe6jkStRIV1R0tVUc9dVdX85QnAWR1baGauSGgDPOB0C5Fgn67zIFL+J4a7Y+tPfrVh2/S5u2c6xaa0/ysw14nTsxIqHB63qg6dmrZpOo+xJ5iPsKUSBY0DQ3UD1/iDaH6RVzx+qWQg4Ua+8UKFZYvn9PWzn+f5nGmJjw5LcmR5FV2cogf4EHJRin0xz4d/0zdV8jc1jIdJ8Qeg0E832PlWhkNkJgBF977ogmWn028yvOgG29vdgcw7HHHG45JvnQuE4kx/I4AR39Xr/U9RiRj7xxa5QiSjyTdi0wsiGig3UCXQVrByIJk7YdYerGNlEG5rspfH8TMSZFotmFeahS5su2EI26hkk5k6b3wB/c32OlhKFNxlPeHo8iNmsHqHCETmNevHUdREvRahpsjJhf5ksZNjySnaP5xAfE6yG1I0yK/Okwg53nhJqTiobYOscgInA2Fd0jleMTs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199021)(478600001)(41300700001)(82960400001)(66556008)(66946007)(66476007)(83380400001)(2906002)(36756003)(54906003)(8676002)(316002)(4326008)(6512007)(86362001)(8936002)(186003)(26005)(6506007)(1076003)(6666004)(38100700002)(5660300002)(6916009)(6486002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8fAW5KXVcztw6rRv3lT2OguKgESr?= =?utf-8?q?Hwp5dEu3PNlSklJbJBcERTVWbLVj5FoDnPGA6BGgldrb+S71zcmIMeCt06tsBK7nJ?= =?utf-8?q?9OhASz7AmE4vxXMLvWu8popZI1XrbRhwSp9vQhnJuXWYewDBIxYvEBk2qFrQj/g2C?= =?utf-8?q?KKv21dmxO83JhmF7NgSS5YJNE7lX/S5EenoVOhreC1vDPZMo/uVragTVn8rPG83V3?= =?utf-8?q?kd7CjatJ7bUNAS2DmvR4crj7rUuaWb7UMlHA2AoHdk/upUhEZmB96fzZg3UjAoby2?= =?utf-8?q?sF7peYPNB677NT5nHstCMhXVpvfQaiixXLwVV3YqsAQLkQj0Itfxzcvp3+l9RCUXD?= =?utf-8?q?gBQYruzRhiz0xNMeWqR6Uz78Gr9GKGbts2YRFfjgbycBC5agXmat4451biCkcESO7?= =?utf-8?q?TNz2kava1opwRewGOQq2/WCVDaRNi4jtD1aCLBhJUo7PVtpG5tTL1xWtOdONNJ/Tl?= =?utf-8?q?j/Jjr8iBTDYeEmFMZ56y4fBHao8Y+gn/wU0hJuBdAQr1JkEW4gd6VBbm/mpaDPd70?= =?utf-8?q?SK/RQhY+ug9A7F0HiD53HDqBJaJ/17q7I8EZYVKkRUUqxgzpqILm8JQ9Axj8ylRtV?= =?utf-8?q?I0EMhcdaWSX9ILFPwBqpqJjo6L/V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qaQWYoMwFQsZCPCwSfzg4d?= =?utf-8?q?viQeHtXsA2cv?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Pshf/8AOXsgL1rV1TS7br85K/2P6yCMDwcL59t61oPIqb7HRvdaC2IGrOjQ1T2ZyyXrOHKakBDx1KBx6AkPrc/Ij8xqWEYop1JClWDkIm8wZRw+HH66hspl1ZGCTRELw01CMvdRpT8EeuoZ5LtSZ/OPkg5QOf8XCktk2ej7qjpKk/DiuFIvoPJSn46q3OUW6VorcVwEIXWnUWAoiWUfk/G6SBW3g3LSUMbKHg2AdmqkZNym5oNdlJzMAv8sSQ4nSLaKIIF3EVHPULMuBGga7hW8E0qeRafbKe7hfNySWPJGgo0Wj67D3lzP2Czo21ancFC58O1loz5QJm3No0YheAWTEm2d+gaB8G7UNTXXMAHy6T/OtABru2XGnrCifRKPQaUI3g9IZBqTvGr/nU7vU4lJQyBve6tt5Y7A1xiLtAuanKuWaQl/uyAq9QXMEmTEXkDmNw4okaC+PRQncUlAIgJz7SMJqLmKPInwzORQjICYbm5wshQIkOYDh5gcv59J4dbKm/DVaZbBK1L9aEYRXhVRnwjnb/BVHupPPFETjsZmyq0eTUhCHFVMKotP+8ktNQm1tY6L2j1EhjA83iUYMjkoxfh9Sh+YJJ4uh7OceCXLQcxVtnNwuFGu32OkJrlA2nJ9CYAoKlZ7qRbrg4D1U3mSRZDHgb0W8NXj0XoRW96+6zQn47t6m9BMx03xekEjtGMaMZekKVB++cOEQ+7ECwI8tkStz6WbJ8jHxt/avQmBClWL1oRD8N7GY7V5i1kHMGlhpzdnYsq0iW4hF6EjYC9AFnzJWQf4Farj0VM+m1h1Anwx9j28RLRCckCA95GiTXoHfNIOBUQ6F8+Nit+vWAQ== X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6d3d0c2-8ea0-40b9-c76d-08db31ceb757 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 10:00:11.3939 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1w9i5U+swFQ3Hp3iPXECrU+YCN7i4yZMOlD1F1umKlaZv5iuGyCYZiqEmN7AOCCjaa9vgdN5AeRyMSbzxCwDVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5557 Only set the GOP mode if vga is selected in the console option, otherwise just fetch the information from the current mode in order to make it available to dom0. Introduce support for passing the command line to the efi_multiboot2() helper, and parse the console= and vga= options if present. Add support for the 'gfx' and 'current' vga options, ignore the 'keep' option, and print a warning message about other options not being currently implemented. Signed-off-by: Roger Pau Monné --- Changes since v1: - Do not return the last occurrence of a command line. - Rearrange the code for assembly processing of the cmdline and use lea. - Merge patches handling console= and vga= together. --- xen/arch/x86/boot/head.S | 13 ++++- xen/arch/x86/efi/efi-boot.h | 80 ++++++++++++++++++++++++++++++- xen/arch/x86/x86_64/asm-offsets.c | 1 + 3 files changed, 90 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 0fb7dd3029..9d13eee50b 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -221,9 +221,10 @@ __efi64_mb2_start: jmp x86_32_switch .Lefi_multiboot2_proto: - /* Zero EFI SystemTable and EFI ImageHandle addresses. */ + /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */ xor %esi,%esi xor %edi,%edi + xor %edx,%edx /* Skip Multiboot2 information fixed part. */ lea (MB2_fixed_sizeof+MULTIBOOT2_TAG_ALIGN-1)(%rbx),%ecx @@ -261,6 +262,13 @@ __efi64_mb2_start: cmove MB2_efi64_ih(%rcx),%rdi je .Lefi_mb2_next_tag + /* Get command line from Multiboot2 information. */ + cmpl $MULTIBOOT2_TAG_TYPE_CMDLINE,MB2_tag_type(%rcx) + jne .Lno_cmdline + lea MB2_tag_string(%rcx),%rdx + jmp .Lefi_mb2_next_tag +.Lno_cmdline: + /* Is it the end of Multiboot2 information? */ cmpl $MULTIBOOT2_TAG_TYPE_END,MB2_tag_type(%rcx) je .Lrun_bs @@ -324,7 +332,8 @@ __efi64_mb2_start: /* * efi_multiboot2() is called according to System V AMD64 ABI: - * - IN: %rdi - EFI ImageHandle, %rsi - EFI SystemTable. + * - IN: %rdi - EFI ImageHandle, %rsi - EFI SystemTable, + * %rdx - MB2 cmdline */ call efi_multiboot2 diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index c94e53d139..f46c1f021e 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -786,7 +786,30 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable) static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size) { } -void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) +/* Return the next occurrence of opt in cmd. */ +static const char __init *get_option(const char *cmd, const char *opt) +{ + const char *s = cmd, *o = NULL; + + if ( !cmd || !opt ) + return NULL; + + while ( (s = strstr(s, opt)) != NULL ) + { + if ( s == cmd || *(s - 1) == ' ' ) + { + o = s + strlen(opt); + break; + } + + s += strlen(opt); + } + + return o; +} + +void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable, + const char *cmdline) { EFI_GRAPHICS_OUTPUT_PROTOCOL *gop; EFI_HANDLE gop_handle; @@ -807,7 +830,60 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable if ( gop ) { - gop_mode = efi_find_gop_mode(gop, 0, 0, 0); + const char *opt = NULL, *last = cmdline; + /* Default console selection is "com1,vga". */ + bool vga = true; + + /* For the console option the last occurrence is the enforced one. */ + while ( (last = get_option(last, "console=")) != NULL ) + opt = last; + + if ( opt ) + { + const char *s = strstr(opt, "vga"); + + if ( !s || s > strpbrk(opt, " ") ) + vga = false; + } + + if ( vga ) + { + unsigned int width = 0, height = 0, depth = 0; + bool keep_current = false; + + last = cmdline; + while ( (last = get_option(last, "vga=")) != NULL ) + { + if ( !strncmp(last, "gfx-", 4) ) + { + width = simple_strtoul(last + 4, &last, 10); + if ( *last == 'x' ) + height = simple_strtoul(last + 1, &last, 10); + if ( *last == 'x' ) + depth = simple_strtoul(last + 1, &last, 10); + /* Allow depth to be 0 or unset. */ + if ( !width || !height ) + width = height = depth = 0; + keep_current = false; + } + else if ( !strncmp(last, "current", 7) ) + keep_current = true; + else if ( !strncmp(last, "keep", 4) ) + { + /* Ignore. */ + } + else + { + /* Fallback to defaults if unimplemented. */ + width = height = depth = 0; + keep_current = false; + PrintStr(L"Warning: Cannot use selected vga option.\r\n"); + } + } + + if ( !keep_current ) + gop_mode = efi_find_gop_mode(gop, width, height, depth); + } efi_arch_edid(gop_handle); } diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c index 287dac101a..fbd6c54188 100644 --- a/xen/arch/x86/x86_64/asm-offsets.c +++ b/xen/arch/x86/x86_64/asm-offsets.c @@ -175,6 +175,7 @@ void __dummy__(void) OFFSET(MB2_mem_lower, multiboot2_tag_basic_meminfo_t, mem_lower); OFFSET(MB2_efi64_st, multiboot2_tag_efi64_t, pointer); OFFSET(MB2_efi64_ih, multiboot2_tag_efi64_ih_t, pointer); + OFFSET(MB2_tag_string, multiboot2_tag_string_t, string); BLANK(); OFFSET(DOMAIN_vm_assist, struct domain, vm_assist); From patchwork Fri Mar 31 09:59:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13195724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BE4DC77B60 for ; Fri, 31 Mar 2023 10:00:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.516968.801929 (Exim 4.92) (envelope-from ) id 1piBYW-0001k1-Nd; Fri, 31 Mar 2023 10:00:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 516968.801929; Fri, 31 Mar 2023 10:00:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1piBYW-0001jo-Js; Fri, 31 Mar 2023 10:00:24 +0000 Received: by outflank-mailman (input) for mailman id 516968; Fri, 31 Mar 2023 10:00:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1piBYU-00016S-OV for xen-devel@lists.xenproject.org; Fri, 31 Mar 2023 10:00:22 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d9272ac6-cfaa-11ed-85db-49a42c6b2330; Fri, 31 Mar 2023 12:00:21 +0200 (CEST) Received: from mail-bn7nam10lp2109.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.109]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 Mar 2023 06:00:20 -0400 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by DS7PR03MB5557.namprd03.prod.outlook.com (2603:10b6:5:2d3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22; Fri, 31 Mar 2023 10:00:18 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda%6]) with mapi id 15.20.6178.041; Fri, 31 Mar 2023 10:00:18 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d9272ac6-cfaa-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1680256821; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=M19Wr4/u1Hw5Q+a4Q004XZh/o2wNS/KY8iHSo/EjDL0=; b=D+YTWypyyUtvJijljEjf7jeGtZpWI+23BKZt0GqZPe4hmMLbSIYnpMuO Bp8Wtk044ch3EzbrPaCAGkAsQi5pw2MJC1AifnAEaF5XPisvKjm0YzvX4 vm4Fca4Ea2W19LXtLCghOi77+zyvk7TKYnm40KJtfPBny//t6OFwslpQa w=; X-IronPort-RemoteIP: 104.47.70.109 X-IronPort-MID: 103834789 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:V+H4LaholW2EJQ0My+4CBsaOX161RhEKZh0ujC45NGQN5FlHY01je htvXG3UOP+DNzfxKox0PITi/UMF68DVz4NrTVE9qyBnHn8b9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wb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4gEcpGgutiA2Hk13Y= X-IronPort-AV: E=Sophos;i="5.98,307,1673931600"; d="scan'208";a="103834789" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IwdbeT1NH9i3Wtr7pDMtL3YtuYKhn+nAOoYpLS0hBcw0jIFwzhIAahEGh6QuBC6BvouzqLByoiSpOkGSkP7mxTwKPzTpmlRgziv4Fiq/11RdZImzwJSe21QnSts1UI9ibx2+OWriBa4iYP7ti9NZpfz7Nf/oXA96VAY/13/qNab6sU98QTZFtvt1M54QO981P87PduSybCxFS65Y+2FtvSDapgCX+8dlFaUNHhS9WhIct9ZvxiMa0dnL8GnKRUQni8DPoOAcQAAQ/uvB0itwYJfjF77mfg80Jik6HvH3DnNIML14gO+M0i768LCfFRrNbIrbRT9afS5Uq9HkNnBSQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/gUHftM+0/IaXHuGHEEgkWb+8UwO8uBl34DbIg0DDU4=; b=j8OQDqtX4CkhVInjkrknSC9NTwC/sTk6OCaRBc7i+xsSh/z/gOWhzHVQhusPsoFJH6w2AA4etD3JaPNr3IycV5CA3y7ptowmtAu1uD/xLUl4lG9DDCOLTNp4trmr6nR+LzHIGAKFikV4dsv2CWu5laEuuJsRZxIlGtM267Y5iH7/v1HtsaPRMfc00+/b4Bfbn+ZtsiK/f4v+66vU9RxQYlKx9TJtRbEtX3zAPFwUjia0JSM5mjDz0DGrlSh4JNnPChSG7d2o4WsZwlNmiqRAAIqFPvI+6LQBhqb/GGR+/krcehoFSSkvbT9wElzX+CM8mHPRScySBlktoF+8fH+Gqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/gUHftM+0/IaXHuGHEEgkWb+8UwO8uBl34DbIg0DDU4=; b=VGtxQvYoC/y60qrlH8pkUaEVm//wbw4uD0Piy7u1XiFPPSbEPQMKeqDun7oKyRzJC8tqSWapfpEsKj6mBPWvcooDMJEwl1npO7eAaCPfBcfft7ID4S2crr8aLfUCV6v+DllSL9f3gC2iDFI3ZGnWNk4ZMdzkKIqMO6Ibc67Zzs4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH v2 3/3] multiboot2: do not set StdOut mode unconditionally Date: Fri, 31 Mar 2023 11:59:46 +0200 Message-Id: <20230331095946.45024-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230331095946.45024-1-roger.pau@citrix.com> References: <20230331095946.45024-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0650.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::20) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|DS7PR03MB5557:EE_ X-MS-Office365-Filtering-Correlation-Id: 58f99fb6-eafa-4949-a6f9-08db31cebb6d X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /OduDf4G3x34y19qsdGVmTgkLjflysEi391dwap/MpFAGMob2qV6H2KrD6xkRagutyvMmDaMFwc2eHqJsaG/mYCezwrA9+uF6FPqH2l6JAlyxG+80EqrE319dRXAW1W4Itnp5GDAv+i62lbwntdP0dU/xhKy+LUsnMyhn9+pQAzK8+M+mw6iJD3ISUUw8CCvIyiJEQbLXY/hIBp+lQ3g0ly2lUlla2QkFj6xj2GwG9WOwKdDjTZuybr9/oMJ3v0gVCCeQ4CO7SQPNOCM3yPG6kQI1ukaeZCyCj5FzoSDlF3ShCr4pbuQKPqhn6N13TL+a1xAxBOztaWYHhIk9ofCXLwGVDzDUZTmJxBWIeMFHWVvpVUlfY0QRVn4es+bKYUXe4PhyeUkKQg3dtrZ69N+c9Dg+DPeRDtvQYRMqvjV1fT8/PmNBVfbhM9hmDRmP3MI13WLg6CMpNA4n+XtPFMiwCHSxjQ9ig3wO6K4oTznOA3tl6BpoVDADNR9Nei8XbyI8oq32geJEmaP7IbS54MO1GjKdaVhuwW4gmN97QwjLkXXQXy2ZzQbKVxOiVQwg0n/AkAAD5Ml3pBtuGmxLffhNfbBpJhXWTl2u+ow69zcblk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199021)(478600001)(41300700001)(82960400001)(66556008)(66946007)(66476007)(83380400001)(2906002)(36756003)(54906003)(8676002)(316002)(4326008)(6512007)(86362001)(8936002)(186003)(26005)(6506007)(1076003)(6666004)(38100700002)(5660300002)(6916009)(6486002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?oqPsNoaCDY/89UBKR5oyW/6HA2pe?= =?utf-8?q?p6gsZpaClhSq/qcAKPAAQ/PL+PPWDGDuzn7Ir/U1G59IRPzHjWXY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15ylQ9qC+Wyrs0TCnIqE0/C10MajNnT5vwDOMSdTX93n/xa83tCDVnZFPWSRfptXjwOILSjLpJG0r7Jp/uAFBJJRzt/ScL8yAGcE8t/tp+Fue7pVDuI1FgOhArMmu5ac9Z0QSDypki4Mhh5jXkep/penRpQM6qDEZiMIhnv/ITSoYXAN6v/ns2pcSTNifbYdv5XkZiNn66y7kcmcw4bFIRiB2sgfCbTRdaqqtIEtwA09s2gngJ9UHcWanxmb0pGkQuoEFjsmbviMOLkLRX0/ztp+GyeSI05PzlOfyhOqPis5v41ZYXWL34EDN/5vBD9B0F1dIms3ls7tnqXBCvtp6zUxhR2S75quvhoDDFBl9aSaDNiNH8WzxQcY/jMQiQcpKJ6klN5knbSDXo7FTya8uWlF3AwPhDbFDDcrOwhHvtqpFALk7PTwgMQkZDQCRYa0SW7Ld5XluEe39vkPKLX7i2OI58378KBQeHsQGtC+Eqr1LXsAF4XBdNZ8I1YnGirwkMqvhTOp3Iuub2k92xJoi2LWDtUgU4FlQQ5glvtR7wC3BYA0HzYCDGHXmOAd7nCpVk51+gwvB5Sb3yGow0I4VeazIg== X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58f99fb6-eafa-4949-a6f9-08db31cebb6d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 10:00:18.3106 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: J4MikM2Pjn9vHBDui3VDQWCfTGOQ6NaCRzFR1EN7oBQzKsDhWNHVVWtw7KdEE3CpY3sOX4hsxXfNYJOvuAhETg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5557 Only initialize StdOut if there's no GOP available. This avoids forcefully switching StdOut to the maximum supported resolution, and thus very likely changing the GOP mode without having first parsed the command line options. Signed-off-by: Roger Pau Monné --- Changes since v1: - New in this version. --- xen/arch/x86/efi/efi-boot.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index f46c1f021e..42aa135446 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -820,12 +820,6 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable efi_init(ImageHandle, SystemTable); - efi_console_set_mode(); - - if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode, - &cols, &rows) == EFI_SUCCESS ) - efi_arch_console_init(cols, rows); - gop = efi_get_gop(&gop_handle); if ( gop ) @@ -887,6 +881,15 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable efi_arch_edid(gop_handle); } + else + { + /* If no GOP, init ConOut (StdOut) to the max supported size. */ + efi_console_set_mode(); + + if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode, + &cols, &rows) == EFI_SUCCESS ) + efi_arch_console_init(cols, rows); + } efi_arch_edd(); efi_arch_cpu();