From patchwork Wed Nov 23 15:45:21 2022 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: 13053881 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 32404C4332F for ; Wed, 23 Nov 2022 15:46:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.447634.704091 (Exim 4.92) (envelope-from ) id 1oxrwb-0000Ly-5t; Wed, 23 Nov 2022 15:45:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 447634.704091; Wed, 23 Nov 2022 15:45:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oxrwb-0000LC-1C; Wed, 23 Nov 2022 15:45:49 +0000 Received: by outflank-mailman (input) for mailman id 447634; Wed, 23 Nov 2022 15:45:47 +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 1oxrwZ-0008Tc-RP for xen-devel@lists.xenproject.org; Wed, 23 Nov 2022 15:45:47 +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 e55031f1-6b45-11ed-91b6-6bf2151ebd3b; Wed, 23 Nov 2022 16:45:46 +0100 (CET) Received: from mail-mw2nam04lp2172.outbound.protection.outlook.com (HELO NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.172]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Nov 2022 10:45:45 -0500 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by DM4PR03MB6935.namprd03.prod.outlook.com (2603:10b6:8:47::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Wed, 23 Nov 2022 15:45:44 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1%7]) with mapi id 15.20.5834.015; Wed, 23 Nov 2022 15:45:44 +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: e55031f1-6b45-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1669218346; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=j0eqFRB2p2CzTLiPH9LllAVmtry5VuOqjlnAIGu853k=; b=T0zjxfqfPnY3WYRtRk0p8R0U9d60vJq73sdEMpKSRwadpIEjheviZmyz 3aO65y7+DBvEOB6VNXi3Ss7sUXXDq9HzdceGS2n8digoLiC0Evo5RKF98 PXDQw7JSvuI4eNL3lT06BJ+qBTwAnVQ7KFRbgv6RWNBnfFEqyhcs0NaH7 M=; X-IronPort-RemoteIP: 104.47.73.172 X-IronPort-MID: 85425901 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:5SFEIKPAZ0FZstLvrR2XlsFynXyQoLVcMsEvi/4bfWQNrUoihmNSy mZMW2uDO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8ZpzU H11yjCoomzufCyzRHRk0fV8pRtgdPkjvdTGcCWjcARCzP0ziKlfp5oVbGutC085Muv9FEput /RpApIBbU511rhOkWO5Tf90Qjp1zgjr1fk1F+jmHPm5ej0XigzBcZtjZ9QNkKx0TtpgPhMlI Zwm06JvZteCh3N2Az7+tjzThlv0m65u2Arn+I/h2FWFaEedLhSh4oC+149KuZIIAvKrKQcVM V+BsDV4/hbNXuccnDip2FqhOehW3widy32N3Qqi4iw6Xx7jXp5x0wXyIg0hXEb7q8wTJFC+q DtLrlovKsmdL5ZUYtNQMM6BeenAG3ERhzBdEiIJ078Ka0BM3XR77bq/bQO4v2wcpBg9up8pH 34aiIZiYcOQTOsNSXXt6c7sCwlAV/NEQgF8/supqSQ4dbHNf/W2S7qciFdryLvmYRaPiThYY fCBHtnOY6cEYLQI/c54+SHYeg1FZA/arxghj9pYSP4nuv7bqvXi8f8TNH/YJLQLBdMYBKNPp JEZkm/GPl9 X-IronPort-AV: E=Sophos;i="5.96,187,1665460800"; d="scan'208";a="85425901" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJ4a0y/tFxin3qYVu+bKWAq0oq4wM9wPjnLpNNYZjR6YzIz5+LCiL9Wi4fU8fdjco40x2U0F4CZ20MfWynzvNbHYsC7ECHnE2CnNkeSU0D4yMjCH3s7e0Jf5KaWKVJ9pHSCwqito5mCDkbTw9AipoiSFDXtZXmFMQHe0fviAUxwQZrmsva+WgWs9J/lsJ+4LPHp3vGLhPwRxLQZHphwcEjb43235/ehhqsn1rIgdB6+WZ8U1jeV6tv7Ngwi66CQThcTpgdta0ozDsi+dtjCaIBGaUeDfwhe6eEc4lO0CxANPpqj0kh/bldYaCq/9DuF8XiJ0JvjREvTudUNb5dCvxg== 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=OdFMrPR8EW2lv0Zu+hrAeX4u8IAlUd+YRN8dsbbLR0w=; b=hrVq7CLn6q281VG5Nl1ocisnoL4RR+HqREpD9w2QJjPfy7y3jQAbsnI/C69yshHd5Xc7sOSmmUwzdlzwoRh+e8j6PybGG/q3XBV1ZRvZU73W7+P6rRJ2BhLW4z8pzUwieX7uOGJeuef9jFN5pc5knhpw+Ifv6H5hNnNeU+JHxIr/rr3k5/G2O1P7g8EIj8pOtQ4sIOLpqr7ek4hXjlRz0UaB+UuwYcm2SC8VDoHarMTXkVE+4AUo8e88B95ULZ19oeXg6Wy0PPfa0GrOuHizPk40ln6fzxX8lddIlEBf5KtekqV5n2UByyAawdqFld7JVnDEJs9nOQVl5eK9X1wpdQ== 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=OdFMrPR8EW2lv0Zu+hrAeX4u8IAlUd+YRN8dsbbLR0w=; b=SmM12KcP/rDrmP4RRsaN168xiBbB87PoP4LKnN2eYmoNQoe26oItG9feFA01p3lUZlabWhIxSNWrHX2brarVUx9zRG+qGXXyLD/xgZ4IsQ7FkW58BJYRBawmaCWmyQo8lu6GgMFBKitZNAY6Aupe5OaTriLY+9vZHqMyZ7jJrWI= 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: marmarek@invisiblethingslab.com, Roger Pau Monne , Jan Beulich Subject: [PATCH 2/5] efi: only set a console mode if the current one is invalid Date: Wed, 23 Nov 2022 16:45:21 +0100 Message-Id: <20221123154525.63068-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221123154525.63068-1-roger.pau@citrix.com> References: <20221123154525.63068-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0643.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::10) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|DM4PR03MB6935:EE_ X-MS-Office365-Filtering-Correlation-Id: 11e88ea3-9595-4c58-4c31-08dacd69c82f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W1dpZhMnbvcp/o4BJH1sG9USCrFn8I6r6HZlSiRvjqc/2JsNlCqWM1MYBIWlTy6X6at1qRGQC+cvzJcL7g2E1Ik7c0yQdWLvC5Aa2qele5CDjWXg64pmrwjpViMk0P5w8Si1EJRSdkP57bVNKj8nxuhvSBxW/J0eYpegm0XKELXlSSHTnQkbE1oaItVO1ezdYYDNum3FbXY0KInc/i/ENeCidR+PKRHDX7efef/9J3r42Of24Q6LN3oDwTTY9F01wKiM61ZxIttaAMYSxXoyacoVySoo0PrE1c0T2y2+BV1FMxlahtfFnT5rPnmljEVDj4isZe4fdaslkHyn8VSxSO1ngO+gV0FfgN5bmKpCVTD10JVUPrabEnDgYhd4GrL1HYlaQTCGGbrsiEJHqi+iaSMh/jX78qmH+3M7fg1GmO8B7t+09wdXF1dYIUY9UVl5BeE1OhQkPnR3iIYozWCMUVB19Dwy5eS2Cmf1IV7kLSUvUYbzK5Vm5p/bXpHE9Q1DYEYd5ESg9Anz9sYRSgjL+WPqRsj/qRD/me3O7HM108t5qghiZqKFKSYFrTsN9+Z7MABgJHYMQeDwb6rgiYN8iSinXW6ZIvD7b3qoC6UYHc7kQRkqDEj5b1E6oc0zIU3TSKB3oqUbJPfH3retIQzQGw== 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:(13230022)(4636009)(136003)(376002)(39860400002)(396003)(346002)(366004)(451199015)(36756003)(86362001)(41300700001)(66556008)(66946007)(316002)(66476007)(4326008)(8676002)(82960400001)(38100700002)(6486002)(54906003)(6916009)(478600001)(4744005)(186003)(2906002)(5660300002)(8936002)(6506007)(2616005)(1076003)(26005)(6512007)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?G5RYba8HsrtxI6QIKNa/qHxVJHKy?= =?utf-8?q?eZBhyFvEepfDXaZJChm4qIbzBnKpozAsyf2FdTRz04Xux7u60/zvWTegogBrt3lc8?= =?utf-8?q?AvenCwUTyHnl/0eDvkPIiQIwdQax8NfoyWAYsXUrCJeTv85iY9fclpRQ6Q8+RUKFB?= =?utf-8?q?fbHgWQrzRcSnhmM6u3mzq5LatL6jDn1mrF50dex6JLnkzwMMp+hrWzxYMxugrQOzX?= =?utf-8?q?R6EsTncSD+VtcQs+61ZGpJHBU0IBa2vd/5KVVbj5LSuwf6Nd5khi+OOHXFsnVrtP9?= =?utf-8?q?qHadKoZkIL4xWdddLNrgoDaHvMXZxDd0RAlaJlobZY+MyNw4L7Ek+AxfTtT8e9JER?= =?utf-8?q?sKwOnL0vuXiio3MpXrs9uWN1naou6eMemw+zqDDKlPuBjGHPFG5SvLaDcVjtfC+CX?= =?utf-8?q?DezXTMr2pKkxyIfFiudPDPuu0VDrqRl8FyDAQbAbBak9gbQL025dGQ1Nie3kHyKc7?= =?utf-8?q?nlCfMnWIBR3NytRpOdCpFApiEpuSaIhj83D09eODWV/KSADYRBJeeZN3Y41ZxdsC2?= =?utf-8?q?NI31yW9ZXeDibUJhRmkC6NG7xNOG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ZYuLrQyzNLIJWuo= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11e88ea3-9595-4c58-4c31-08dacd69c82f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2022 15:45:44.1711 (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: 3GJU/zOriBRiTh0AE8G8o3GOpcn2XGN3AdFx4Ht8iBP1f9mSJUaoOi2SaGnjlmevoIcs6XOOAKc8yABYEYCC6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6935 Do not unconditionally set a mode in efi_console_set_mode(), do so only if the currently set mode is not valid. Signed-off-by: Roger Pau Monné --- xen/common/efi/boot.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index db0340c8e2..7e8a8b7857 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -799,6 +799,11 @@ static void __init efi_console_set_mode(void) UINTN cols, rows, size; unsigned int best, i; + /* Only set a mode if the current one is not valid. */ + if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode, &cols, &rows) == + EFI_SUCCESS ) + return; + for ( i = 0, size = 0, best = StdOut->Mode->Mode; i < StdOut->Mode->MaxMode; ++i ) {