From patchwork Wed Nov 23 15:45:23 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: 13053885 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 0F30AC4332F for ; Wed, 23 Nov 2022 15:46:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.447636.704119 (Exim 4.92) (envelope-from ) id 1oxrwo-0001F9-R3; Wed, 23 Nov 2022 15:46:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 447636.704119; Wed, 23 Nov 2022 15:46:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oxrwo-0001Ew-N9; Wed, 23 Nov 2022 15:46:02 +0000 Received: by outflank-mailman (input) for mailman id 447636; Wed, 23 Nov 2022 15:46:01 +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 1oxrwn-0008Tb-7d for xen-devel@lists.xenproject.org; Wed, 23 Nov 2022 15:46:01 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ec1a544e-6b45-11ed-8fd2-01056ac49cbb; Wed, 23 Nov 2022 16:45:59 +0100 (CET) Received: from mail-mw2nam04lp2168.outbound.protection.outlook.com (HELO NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.168]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Nov 2022 10:45:56 -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:54 +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:54 +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: ec1a544e-6b45-11ed-8fd2-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1669218359; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=UrpvtpZaeWpkhTDTGxJ8y1lv9LpWbxzT4fLSQ71R7qo=; b=dfpAgKsqAdVSrmoHu6XQFg1DfI1Uk9Gj33/LjIe0PFz1FLkJnkvL1PUN d4Onv2ZVRIq99vJNMuE6JDQuP//IWN+vHVywOG8zKOZOEJOMJJGgrPzBN BADnvsu1WZfl7RMfKCdQRDyNph+1scfyKip7yySCZMgBuzaXCRp2mJiX1 Q=; X-IronPort-RemoteIP: 104.47.73.168 X-IronPort-MID: 85444277 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:jQqrQa46PrhZyfr1gISE9AxRtP7GchMFZxGqfqrLsTDasY5as4F+v mtND22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9Lbr9mOuIP6bQUADxsH7hDLqT+z8rb1HzWRwx9bClp0sP0f2F mAtza8yrSosvm9xBOZ/2jP765OkN+k5spfCNeKgs01LCyprgqzfoxuV5CLoThwiuCy71QBls XKvn4bTo9OwkKUWlvwjQrm2gHm3jprw3j+yWWAiX+mhcDiXjo1B+dImIocK3LimgIdleA59J gO83OStpJRAx+FtCPh5+LQXxUvskavu3ItncMaknQae4oDb716q5AZ4SpuYd49NRO/zLpiPP hlDcna6voTWVSGb0rBtm0q+9CoVmRbJGbyfmEy/uiulxRGlnFwyEUVgOYFmG0byZ47Q55Yo8 zZL6VBjth1P4ErRJM4IN1Ebdq8C2TLTx6JGnmVO07bGKYOPG+Ig4Lr4Y8y+PqhdPUzvdQPca z6IRNlXFMJCgHT4ZXk5uwIzvmNehTwYd3V8LAe23Aj0YeMAYYCMkW4OSITeoWb0rEi6/bgKo aO0aJtcoHexFTVaPd0NnXFKv9vwFklIbkoU4UAKiWzi/OODLHWncrmV9uWDIbRMF8fKxDC6z 04LXXOGPk= X-IronPort-AV: E=Sophos;i="5.96,187,1665460800"; d="scan'208";a="85444277" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/KeZbFRiSnLUe9BC3VTc4e3xSQQZ7b+SScNopmXXn9wYsyvVNcyhNHMEOzHpKl+QpA9sVjbzTt42jYI5+t6iPPkGHbcjxZx7M1iPpGKanj10SElI2zGAyOSS0fWCKabbKL655BEYuj8RXWKiXVibHQe4vuUOEP14w2GcCvoLb7Tcoln94DGduT/Vq+wZLiyMp19C/MgaCf3X9VziAw1xX9vNSht9DCJdArRvHun6iELfYSr4hmTYKnuEEzjgZM8MIq90I8dE/BxPs13G1brWWh9BvtP/3fDWSMIXjQWBf36D3enCrgmiZm6UEKKPDG1DntRV8SKoTlfSz2wQBDfhQ== 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=aga1YY/munjCHPbgajSJWWRT0kc52lET3HS0iDBN2nM=; b=BSCR+YFCYZJuoLaJPJB/nARdNDbWJQIedkq1UCRU1JkjlzAqdbNTt4Bmm1nsAWVsP+CpetyIAHN2yZwl7y0hsE8AkKiH2eeJbEDI3pKg/vFc0gjYpVK7pS6czK0EqlPU+fc/FWB/oueZ7SrYtoE2OvQJEVbGm/VjsBJdTEbNJNnJF9qaXcDUM6NyqrK9mYgb5oiQqWICs80AYkmI6SikqSLADiRJX3v19pVQSRZAaLjfWMFA4pRSr9euon992pdwITRkoDzLAIEUC7hFz1CEn/6ZeJ8gkTABuzeXW9l3XolVJNyJmfyW+zyAaF4dwsooF1Y0mCpV7DEha5Jt+yHBfA== 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=aga1YY/munjCHPbgajSJWWRT0kc52lET3HS0iDBN2nM=; b=Vz2pWkqEdIRaRUxNk7MknTJ9LFBteycWuRAkMN/qROtElL+9WyXm8z2Z+PcvY9mUkDHwAyqq4CwZtSHw/8PtpTRbfsrFV+A9fS3Y0XpuieBhn76EmZDIgUmzc7MAwvPbnYAmv/AWuzSuhUQRqenhGOPNyYe6cA4Nh5QQ3cVYYR8= 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 , Andrew Cooper , Wei Liu Subject: [PATCH 4/5] multiboot2: parse console= option when setting GOP mode Date: Wed, 23 Nov 2022 16:45:23 +0100 Message-Id: <20221123154525.63068-5-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: LO6P123CA0043.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2fe::17) 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: 57a06453-8767-4139-bfb7-08dacd69ce55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xFxqpbXkR9wGVTnTAAI7qL6lhGQX363BxkHt3GDRUDGiUD5e/x/A9DRVTu1ZHYHaFBOk3zTZkPLcYxwfuyksBsLrJznjeQUE3cD027LCnP6mp87FkHNcPvhRaDlWT4ct+izb8GTTqQjbyNfjpwa4VhiQFkjZZOUP3Ar/AbVterjaU0ciEmdDAZeEp3V+pAJOuMlhB1Bc7/rWMnszGDQw3XdBEryqriRt0dgOuvYMwkbkx4HFRd7a0suY136yxBniik+en7XGVXCN2WwV3v0gtIJ59bwunbbIdC1FgrD5vqsMeLFBtD6aUszZ8PqqVNLjBxlqBAQnhgKKdoZIGB2up967pQ3BVBGX4KAW/ZUTpTQgg+xPccbLLmMc030NY45BQkyMG1THm4LOJ6waOmWnmXXqP3QvweR0fbQK19c9D31qrhgMjeMD5e8HkBtzQoVxJkoOGF/yjkPsCdUaTRtP20VBWxHQ+JYxBRInLQnEtYLUIIl7SqAg9WRPQIy3BOGdkEX8Z25eWc8Xh98GAXXsxbpavNFhAOa8grAXz0GzrfejAYWi0EmdZ+sP5CdZlUe/jlo24ee5F+xTp97b67OkRnWB/dDBUlcseFhcbaPlws73VFMM14k+reorUnLljjRDB2kTKe+8In0kYVx6PbJ5Gw== 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)(83380400001)(54906003)(6916009)(478600001)(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?z9Yig/sq2dlRrnh1UrVpSjpgcuKw?= =?utf-8?q?1JTYtcyQVzDjMjbkZVwq3v7t+oCfjjXDJpEMfFLq1tMr8bIBqwtqBjoM+kF8LGNPh?= =?utf-8?q?eIN2I9wnEPwrqGR51qjvcs33CCHfn2AT1qPemj5G0t3R4kUR8yfRSEkzEe7lCaOi0?= =?utf-8?q?lcNBZvhZs/xcoJh2J8OlEbIZtKmNgAxEiMpQK5GTPRtEtVe0ieCnpwPAA/eqsmH6/?= =?utf-8?q?x/bKfsE0NRIyA2ZzUT3wy/pWo+z3SIHbPXhUGIiGQ8H2AzRGhu9kEfW6I5rMpSsU1?= =?utf-8?q?fWzSDik3z8gOBvBSxkri+Uu6UbL6Udg0cJnvAHbygZ+jfHq5mCZxGAcQPQV3Er/kE?= =?utf-8?q?CoMkYoxnFOQJLyRu+9ugDm50KsfH7q/tD9Ptc+ufOL/BjlMu0LxKolVDQaWApCbp0?= =?utf-8?q?CnhMeZU/7iSXlxo5jTzEX1o9dpJ6uHnIfwffjs8Mn1KVNuhAS9Nt6/Ufas66pXn8d?= =?utf-8?q?ByD9tgvEOAk9+ExkBD5Kx5iNEc+bGtNpOdN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ssVdUweXl+KTGaryj4WkW3OXFPNYhcJvfLUhGD7iNVR6igycD5310hHuaDfjRLkmKD45GVsQzn+J5/5YzbL8N7Qr0flLbSioFzMLr6NQuazt0uM/B7XU8Sz7rLe9 X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57a06453-8767-4139-bfb7-08dacd69ce55 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:54.5988 (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: 451QL4Jm0CowGmfOUnJRFhJRT1H84J+IRBNyWDzWiHtBv78TewFAytn6w26r8ssT5khRwZT4G5VkcPGGSsZqCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6935 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= option if present. Signed-off-by: Roger Pau Monné --- I'm unsure why the parsing of the multiboot2 tags is done in assembly, it could very well be done in efi_multiboot2() in C, but I don't want to switch that code now. --- xen/arch/x86/boot/head.S | 15 ++++++++++++-- xen/arch/x86/efi/efi-boot.h | 33 +++++++++++++++++++++++++++++-- xen/arch/x86/x86_64/asm-offsets.c | 1 + 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 0fb7dd3029..6920ad08d1 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 @@ -265,6 +266,15 @@ __efi64_mb2_start: cmpl $MULTIBOOT2_TAG_TYPE_END,MB2_tag_type(%rcx) je .Lrun_bs + /* + * Get command line from Multiboot2 information. + * Must be last parsed tag. + */ + cmpl $MULTIBOOT2_TAG_TYPE_CMDLINE,MB2_tag_type(%rcx) + jne .Lefi_mb2_next_tag + mov %rcx,%rdx + add $(MB2_tag_string),%rdx + .Lefi_mb2_next_tag: /* Go to next Multiboot2 information tag. */ add MB2_tag_size(%rcx),%ecx @@ -324,7 +334,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 27f928ed3c..695491a5b7 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -786,7 +786,22 @@ 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 last occurrence of opt in cmd. */ +static const char __init *get_option(const char *cmd, const char *opt) +{ + const char *s = cmd, *o = NULL; + + while ( (s = strstr(s, opt)) != NULL ) + { + s += strlen(opt); + o = s; + } + + 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 +822,21 @@ 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 = get_option(cmdline, "console="); + bool vga = false; + + if ( opt ) + { + const char *s = strstr(opt, "vga"); + + if ( s && s < strpbrk(opt, " \0")) + vga = true; + } + + if ( vga ) + { + gop_mode = efi_find_gop_mode(gop, 0, 0, 0); + } 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);