From patchwork Thu Mar 31 09:44:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796956 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 F179AC433EF for ; Thu, 31 Mar 2022 09:44:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296836.505406 (Exim 4.92) (envelope-from ) id 1nZrLm-000464-93; Thu, 31 Mar 2022 09:44:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296836.505406; Thu, 31 Mar 2022 09:44:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrLm-00045x-4h; Thu, 31 Mar 2022 09:44:18 +0000 Received: by outflank-mailman (input) for mailman id 296836; Thu, 31 Mar 2022 09:44:17 +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 1nZrLk-00045p-Uw for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:44:16 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 20c3e33f-b0d7-11ec-a405-831a346695d4; Thu, 31 Mar 2022 11:44:15 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2054.outbound.protection.outlook.com [104.47.13.54]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-29-_Zx8KvpfOFC4ipwVfs8MMg-1; Thu, 31 Mar 2022 11:44:14 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by AM6PR04MB4648.eurprd04.prod.outlook.com (2603:10a6:20b:1b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.23; Thu, 31 Mar 2022 09:44:12 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:44:12 +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: 20c3e33f-b0d7-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648719855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=voY3bdBFf59fNk/Uj9SHwXXjsrtdUHrNi408J4DKvGE=; b=PonIiyPJ8xi0RxPUAUFSHwbsdj9RaDI4hIYYidOa3l3PShAbfp7hf1HCAGTU7LsH+ONUQA WXL5Eh69gGSV32ap9qnBILC5ggQrtUcvSMaOFobtOvQndpHE34Trc4CAiJAM1aheZNSc2F /GAYLbfzxo4sVDtEk5Z/oGQ7MwF6KMg= X-MC-Unique: _Zx8KvpfOFC4ipwVfs8MMg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aGBB3IaIQaaAJTyc6pgLpim2uzkIORrZFszSuuPPQOKyCJKlyCr+rs+Kwvvaof6AYOMX0kR5xHk9ju685fxDoHVhPHAYVcr6sh46gJgpuRxc4UWHvFQjwekkXkTe9YbXPUb05f4le1m4RZToADDfvsgEJ3EXnFY+NnhWba2Tabj8JHXQKj0hv6kOb/212vFL9MzvGfI7RT6iLWG4tdC7ED5/t3kF/ugAe/aGIVf6y1E0iOKt4QmBHfmtqhpmeYSKBB8ngGA5pAY4wyu97BRVGczuvPwtdGjSuTBRLDzZLDQpmY+BtuzeCG+UsaimgxZEDVvFRfcL6rjPjM/Wt/1+WA== 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=voY3bdBFf59fNk/Uj9SHwXXjsrtdUHrNi408J4DKvGE=; b=XU0lJtzet8bNjEAwuuPC5HXgmkL7haDRzUJx3tnq9s1GYh2huYAbUTFSpIQzrZn+NyXqhqboTMncFJJpu1Sb+F2d6VrJkeHoekCbk1fVUtgNVr/2kxOc4OSgvdHhEueiRi4GxRI9pfJCOMp7tidf9ThvAYAyTFZ0myRIIfZZ1F8h9RoXztTEJQzGQfUE8Fg6w8xYWBVsJfTO8afIEOr8GU7uaE51fa97qBTeb//GURwYr4DtfPnw5nvcQiCudfkP0kJYZ7wFkph2BWsWncFY1cg2NdqJH09CxzoHR60Cbxc+3eUC3CXbEbaAugNc4TMLXYL5v5NvtBP1LNzNIkXV+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <3fb7f3e9-a6cf-4f8e-1141-100848b1bdd0@suse.com> Date: Thu, 31 Mar 2022 11:44:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 1/8] x86/boot: make "vga=current" work with graphics modes Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , "community.manager@xenproject.org" , Henry Wang References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AS9PR0301CA0059.eurprd03.prod.outlook.com (2603:10a6:20b:469::21) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ece3c8bd-43bc-4a8d-222f-08da12fb02c6 X-MS-TrafficTypeDiagnostic: AM6PR04MB4648:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 80A4EL+eI6t7xUX909/xDGhdfA3RNbvT8RSHhliLzKMd4lf4BEri2+v8JPRFGtqW+9f3Rvl9NyxIWH14TG+h1M6YNNkXAatL/KB5KRCegiDx4a6EKnK7yq79yO4j+vG0QOusFCcFDO5s5GfcQBZT5nAu3vnTgLHTbR8wcIKhIhhz7BEPpsbLNz6IiyASS+8d+QrBWHBtWkcqEjEBwqkfoZhYVyDqa4DTN4J9w+4AA5L+I1gJrvhYbgW6kK9kPwqbLT0UpOkvXoDGnrAuqJiC0SHijpCGhkymDGqSqPk+OR0usPZeTKBPg/Mx235IPRWcFy1Acq5+7/N0zmAPgZ/+SnBeNoOCtiSW4GybNzqtXAzlklaWjE78487WDueqLZ28ih0RjabjMBdkqgE2+GrUQSdhtilgyLH6BhgHWE69lO3hWxhlIyDdxg9Up+hi8EvHIONc2GxrxyCMzthDDgwtAyE2O+r1ILIdFewSBLW7p+WMiN8Y0oO1DxeBw4Lzi8Y4wnCYEOmKksO1rZHYYpWmrIpUgYmUhvNaEKeZV4AIFdab9HqL8NKT47al27X3s4cOqAx7+3CMA9U44VV0dZVhCbLPRXuJLILfXSf3s3QETvDw0sMlD5/PUzIWa1ooqxQPToBC1Fdp4tmGh6aK3drkW9CHgXdSimP91cmuu8OgnoQThm9yQ1PwyFcwJPglMJfk9GwmdmHDeOTjfE8fnjHg85r2lPsCLtEIoXBXPzvXpgQjj4QWFui6z9oh6ptE+ehspzFWI5DLOZuQIxKCXGX37EAiIGisSwxFDkMAWhzIoINL7ymZTlOCCaa4kgkT2LnBiI/Vk0vC73Q1rebKf1uxzw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(6916009)(316002)(2616005)(86362001)(31696002)(4326008)(26005)(5660300002)(54906003)(38100700002)(8676002)(8936002)(186003)(2906002)(36756003)(83380400001)(6512007)(66946007)(66556008)(66476007)(508600001)(6506007)(31686004)(6486002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?viunrIaSuODdOYJz1ejtTIf6+tPL?= =?utf-8?q?o3y8NY+7pFkW+Iue3ZV9unrmAR/gU1OjCBTrAZUjkMC3iBc7vsDbbRc+Ft9Z53VHV?= =?utf-8?q?49aRMFYn2Y7fSOduWBrCBWR6ptzf0LujwhXpp2qgGglQ0SQVmyHlcrl1y1Ur2C9/c?= =?utf-8?q?kKg/aEVloEGG6SUpWV5MsZ9wBY7h2nnoNjaKf7lkqBDPWIj2VUdAXIey/D79B3RiL?= =?utf-8?q?8AFDl7SjRMCahFzrpxflM+a4MfEAEBR/9nncgqoasRw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3rejfhTNvHOQCRR0xdbvI/FIWKCmU99LLCdGDa?= =?utf-8?q?7bJea9PkaTVLWsgqZaWMLJCDUPEH4vYIEGt/EkRR44OrRB6SRJxlGU1qCV33EU+OD?= =?utf-8?q?I6Eb7N7AChKOi8/NYnXYD07E9qenmr2uLdWcp16l7UDhgjDLtwEXQWcDPfC6HX3qo?= =?utf-8?q?91l5t34ab1oEIURq/FfnIdfeooiiRIhkDeuziwkQ9KrWEQK9s2svLfhNaol9qb90a?= =?utf-8?q?BnrAZ6NMeEtVaXljGn4xCwm1qo3zEYQHdu+VeqK5jDDynIBLya3ZdfcOif7SVFuyH?= =?utf-8?q?roChiC17prDdSxwadhTZmmZOd3NxkWmC4lv3QHxrtTJXyypZWBbA7+TQuR/uUghJI?= =?utf-8?q?9PdyNkLczmIdex5JBTwXdqsFxA29NS44vwgksUt/HaIKOeA1eGIv/vQgHghPLlnfk?= =?utf-8?q?LsfEYnkJAuXq0RXJkrTMz3kOaS8REToRFnXjC/TTSsAOluQtcrURxA6KxXdH7AWMd?= =?utf-8?q?7JmO86abw5kosVZF3e6VVY93aTVmtQsaAbcYkzFOw0ZUXL7N//Pe5mZ489lf8fcZd?= =?utf-8?q?qpc9LBpCq0vFDU+acRWW+1WXunZaXD9g=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: ece3c8bd-43bc-4a8d-222f-08da12fb02c6 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:44:12.0539 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EJqxkes8nz84/DSHiQjx0dY81P4ef8p15sbRNV4asNPyzpTS2UZeYxyv1f8HDLhJMdgUKdMPE9Tdw55OvOxBZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4648 GrUB2 can be told to leave the screen in the graphics mode it has been using (or any other one), via "set gfxpayload=keep" (or suitable variants thereof). In this case we can avoid doing another mode switch ourselves. This in particular avoids possibly setting the screen to a less desirable mode: On one of my test systems the set of modes reported available by the VESA BIOS depends on whether the interposed KVM switch has that machine set as the active one. If it's not active, only modes up to 1024x768 get reported, while when active 1280x1024 modes are also included. For things to always work with an explicitly specified mode (via the "vga=" option), that mode therefore needs be a 1024x768 one. For some reason this only works for me with "multiboot2" (and "module2"); "multiboot" (and "module") still forces the screen into text mode, despite my reading of the sources suggesting otherwise. For starters I'm limiting this to graphics modes; I do think this ought to also work for text modes, but - I can't tell whether GrUB2 can set any text mode other than 80x25 (I've only found plain "text" to be valid as a "gfxpayload" setting), - I'm uncertain whether supporting that is worth it, since I'm uncertain how many people would be running their systems/screens in text mode, - I'd like to limit the amount of code added to the realmode trampoline. For starters I'm also limiting mode information retrieval to raw BIOS accesses. This will allow things to work (in principle) also with other boot environments where a graphics mode can be left in place. The downside is that this then still is dependent upon switching back to real mode, so retrieving the needed information from multiboot info is likely going to be desirable down the road. Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné Acked-by: Henry Wang --- I'm not convinced boot_vid_mode really needs setting here; I'm doing so mainly because setvesabysize also does. --- v4: Add changelog entry. v2: Use 0x9b instead of 0x99 for attributes check: I think the value used by check_vesa also wants to be converted, to match vesa2's. (Perhaps the value wants to become a #define, albeit before doing so I'd question the requirement of the mode to be a color one.) --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog ## [unstable UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD +### Changed + - On x86 "vga=current" can now be used together with GrUB2's gfxpayload setting. Note that + this requires use of "multiboot2" (and "module2") as the GrUB commands loading Xen. + ### Removed / support downgraded - dropped support for the (x86-only) "vesa-mtrr" and "vesa-remap" command line options --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -575,7 +575,6 @@ set14: movw $0x1111, %ax movb $0x01, %ah # Define cursor scan lines 11-12 movw $0x0b0c, %cx int $0x10 -set_current: stc ret @@ -693,6 +692,39 @@ vga_modes: .word VIDEO_80x60, 0x50,0x3c,0 # 80x60 vga_modes_end: +# If the current mode is a VESA graphics one, obtain its parameters. +set_current: + leaw vesa_glob_info, %di + movw $0x4f00, %ax + int $0x10 + cmpw $0x004f, %ax + jne .Lsetc_done + + movw $0x4f03, %ax + int $0x10 + cmpw $0x004f, %ax + jne .Lsetc_done + + leaw vesa_mode_info, %di # Get mode information structure + movw %bx, %cx + movw $0x4f01, %ax + int $0x10 + cmpw $0x004f, %ax + jne .Lsetc_done + + movb (%di), %al # Check mode attributes + andb $0x9b, %al + cmpb $0x9b, %al + jne .Lsetc_done # Doh! No linear frame buffer + + movb $1, bootsym(graphic_mode) + movw %bx, bootsym(boot_vid_mode) + movw %bx, bootsym(video_mode) + +.Lsetc_done: + stc + ret + # Detect VESA modes. vesa_modes: movw %di, %bp # BP=original mode table end From patchwork Thu Mar 31 09:45:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796957 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 39F33C433F5 for ; Thu, 31 Mar 2022 09:45:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296841.505417 (Exim 4.92) (envelope-from ) id 1nZrMc-0004hN-M9; Thu, 31 Mar 2022 09:45:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296841.505417; Thu, 31 Mar 2022 09:45:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrMc-0004hG-J0; Thu, 31 Mar 2022 09:45:10 +0000 Received: by outflank-mailman (input) for mailman id 296841; Thu, 31 Mar 2022 09:45:09 +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 1nZrMb-00045p-C0 for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:45:09 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3ffe2257-b0d7-11ec-a405-831a346695d4; Thu, 31 Mar 2022 11:45:08 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2050.outbound.protection.outlook.com [104.47.14.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-34-cc--GB0mPdO8edoJe2G7cQ-1; Thu, 31 Mar 2022 11:45:05 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by AM6PR04MB4872.eurprd04.prod.outlook.com (2603:10a6:20b:e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.21; Thu, 31 Mar 2022 09:45:04 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:45:04 +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: 3ffe2257-b0d7-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648719907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ETCbNIJzLPkDjltdqaHsnx3bgSxxGyhUZegn+m7VW7s=; b=DEV74t5ThA16n7UEV02wmHM2xTfvePy+n8i2QcmlxYU2ZR96urpIz1ZVdYBC/+FIxJiRxo 8MFcFLpBSZOQQvCFNNW4svsc2i3Y9XT5uWKkxfs7Sl7XkoyOQYBcTnQOjoRyYieatGsJQQ k9KLWh2/CWQwER3atDkYC6Qyd3WzluA= X-MC-Unique: cc--GB0mPdO8edoJe2G7cQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nPSNShYPeNTBM70sgV242KuliwJZXFzDgjmCeTFOjdMkqCkJ+bVNqdlKP4NI4kc4IocJqFIyxo5CxRlrHS4AMy60KNm6MVXNdtYESf4Z/szAn1Rgw2Ip+ZoOIRoAF5H8WNrS+7XxQ9MR0f6WR8fqG0F1LellpsGm/q1zFDJaWdr9Mn9ZNin+efyvxmFBOGEpBjQZOyOEe70gNWpHfOYi4WEWRv8A3zYZQDkfQncozun/0fuxJen0pEj9kjAaYxaFzcpdns+VJk0yxQsLBjxKEEFyuf4IyqUqIdF13noSowbZnUKdF/I1Kqd2z05FlFjjXvW/HUz5S9EColab0FgGDQ== 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=ETCbNIJzLPkDjltdqaHsnx3bgSxxGyhUZegn+m7VW7s=; b=VQ2rId46MUo9qVGStwlcbx+W3VFT8i4oFkP3+dRbZkSVkd8xrenD4XLtYwcTHiSrpSUgMRRYdJFqEt4BOJzsDygPIWb+AgHnyt57Vt/nFW57XGeI6Oxk6jVdPYHHhwuZ24ppQOQFN8PcAjGlPvUQbLMFOUPcUzkOMqjKfdxaRaXLTOlv86n0HE9F+BtDzK3mf77EbBHOqoi4PEuFPcaiXEkf7/Y1nPFjiTxjGyAUk6y2mhn/JvygE5BpshqOYQ4/DeVQm67rD1O0GB94HIb/S9c5oLDCvgvTTzyxkYYqIukSffbQ+Kg/Ntyue6bah0QQ/WSzgHBLavszimdRa/sRcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <6fc25224-7985-73a6-8877-bc209f64bf8c@suse.com> Date: Thu, 31 Mar 2022 11:45:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 2/8] x86/boot: obtain video info from boot loader Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AS9PR0301CA0035.eurprd03.prod.outlook.com (2603:10a6:20b:469::15) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18c6fe6d-3178-46bf-5432-08da12fb21b7 X-MS-TrafficTypeDiagnostic: AM6PR04MB4872:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TP9uEOny0fAKHiNy/8F7hDU+H4IiZnus0ENZsFB9lPMap+HC/3RTiNM4xhLuyaiHxMJXBqNchChhn/SpGDFTBJzHie9n5umJXjK1qFR1wftJ5bg/Bj4CwaC0kjSv1bx6qQ+4RcMUT/Eogrz5V3StVVn0LHhgBtv94rR+XWd6rcEWR+X85K7I/HG5fRgBfK0yey4gq6xLTSwaSOXF7tPfpqigdDH5Py/9Tco/06OqUblR8ytjOknvaKnLBNXP3JmQGGTs2hZNn/Rf+jSTEHskW1tWGBSouwuvd1EPTzlGJtT7hlF/iIbqkZELvcIdRnDd46VsSa2HWWz7FHeXO3vJN+iml8RlIaD3NhyQijjmBqyinA1y2aTy08zpet7tTwL3Z8nf2472tG7urFsbw/TgeLLFkuBEJO8H0wVNmOTgHAl6VbzViFakdCAcpMKjcU+NQQdH6PABQoS9j5/50cumxEfo3HYI2HFFCy6AbsZ8r7bfeGeGeoLnxnWxEtY1joWi+YmhGW0bl7hNu7Cspf1g1CVR8cnNpT84mHC2+SM5uQBiqBcNmaJXREvYVB7dVKOnOgkfZ3tBv+vxA9Jn6Yqr80bXGKduHuZwTlIVWbBz3/ied1y66k3jiab3Rv8b5585HwNEih7cj+XOelePq/Tf4oSqVRf8DaQCsri2GQaFUWzFAOPTgLyJAXP3gYuxa/+dzBWsaCACZGwLyEaJh8GsfTeMN44NeQ9XzQ08kzzox9KYB5vIagk/YXcT5/RWw9nJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(6512007)(86362001)(8936002)(6506007)(31696002)(54906003)(8676002)(66946007)(4326008)(66556008)(6916009)(316002)(508600001)(6486002)(66476007)(38100700002)(5660300002)(26005)(186003)(36756003)(31686004)(2616005)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?umLPdR2VUNyda3F5Wu2GskC26s1D?= =?utf-8?q?HpM+ePckydAaY755TfZQ8SMSdK9qZuIDANl42VO7ccfny+h8/cH1Hnsm37MFooWcF?= =?utf-8?q?3A7fJEm4LurFGKdQjxHLw1u/bRZVTLiqF0m7ji1uhxyd2Eu+x6Q8hSWY8vcxhtpVe?= =?utf-8?q?k6Zh23wxlZhNoZMWc2tvlOwxZRlC6SPuAIO8sNXh/zm9xjSePVmMDEKbgLcgtYHk5?= =?utf-8?q?SPXUDF2tEK7dWII4yrBRfzqPtjzH+WzJLQGHtd2rPAcRabcddKXJ7cUYuBW3HO4RO?= =?utf-8?q?hAAdgS8BspWZynelywL086cZIWWMnNHysSgeqrd3y0yYjL8evjJwu3TY0yqzs0Jvh?= =?utf-8?q?PpMmv4BarE9U5QObzatoGNeEI6VZ5/njdjYCD9QaSVpdrcJY0wNMWvaNfSVcbZuPN?= =?utf-8?q?YF0/PZVZT7jaFdnM4Upo9HxRr7xyTIfnFxJExZ13mj+esXVli8LhyR18/DmVMbphy?= =?utf-8?q?DN+v+qnQmue7+BgEoZKNl75pVRnuiwcDZo+/hzOefgWOqnRWdLw5JLhmpmvANZMww?= =?utf-8?q?1+GESkchDDk+6us0gpuWD3YqKbazJj7KcEpV4XD8v0u/FO7SQR13lZ46VvcTEq6fH?= =?utf-8?q?8f4pguNbdeRNEJNA95EszG+yn12jECQODs6Wg/WVjrErdANm2kw3jtTM33NaUhQmY?= =?utf-8?q?q3RJXVVu//03osQBNEZHZVClUuasx5eTa5vMZyIMXkM35ZLIthygJjzsB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?= =?utf-8?q?1XJgFmPy/aHsKcE+kE6g373fimFZaXvGFYDn6vuSApAzguYKGtlj20fgOxDE1//+Q?= =?utf-8?q?EJEkO09iEoUt3NKaJVMGr3tONurl8yOA=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18c6fe6d-3178-46bf-5432-08da12fb21b7 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:45:04.0757 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KPM9OuvAHC+/LoM1pmWItF+hZbocw1jr35vHw2/dJL1/vLjouZbz0i9jzltGskog/P5I+wvDtNwCcM93XqVPZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4872 With MB2 the boot loader may provide this information, allowing us to obtain it without needing to enter real mode (assuming we don't need to set a new mode from "vga=", but can instead inherit the one the bootloader may have established). Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- v4: Re-base. v3: Re-base. v2: New. --- a/xen/arch/x86/boot/defs.h +++ b/xen/arch/x86/boot/defs.h @@ -53,6 +53,7 @@ typedef unsigned int u32; typedef unsigned long long u64; typedef unsigned int size_t; typedef u8 uint8_t; +typedef u16 uint16_t; typedef u32 uint32_t; typedef u64 uint64_t; --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -562,12 +562,18 @@ trampoline_setup: mov %esi, sym_esi(xen_phys_start) mov %esi, sym_esi(trampoline_xen_phys_start) - mov sym_esi(trampoline_phys), %ecx - /* Get bottom-most low-memory stack address. */ + mov sym_esi(trampoline_phys), %ecx add $TRAMPOLINE_SPACE,%ecx +#ifdef CONFIG_VIDEO + lea sym_esi(boot_vid_info), %edx +#else + xor %edx, %edx +#endif + /* Save Multiboot / PVH info struct (after relocation) for later use. */ + push %edx /* Boot video info to be filled from MB2. */ push %ecx /* Bottom-most low-memory stack address. */ push %ebx /* Multiboot / PVH information address. */ push %eax /* Magic number. */ --- a/xen/arch/x86/boot/reloc.c +++ b/xen/arch/x86/boot/reloc.c @@ -14,9 +14,10 @@ /* * This entry point is entered from xen/arch/x86/boot/head.S with: - * - 0x4(%esp) = MAGIC, - * - 0x8(%esp) = INFORMATION_ADDRESS, - * - 0xc(%esp) = TOPMOST_LOW_MEMORY_STACK_ADDRESS. + * - 0x04(%esp) = MAGIC, + * - 0x08(%esp) = INFORMATION_ADDRESS, + * - 0x0c(%esp) = TOPMOST_LOW_MEMORY_STACK_ADDRESS. + * - 0x10(%esp) = BOOT_VIDEO_INFO_ADDRESS. */ asm ( " .text \n" @@ -32,6 +33,39 @@ asm ( #include "../../../include/xen/kconfig.h" #include +#ifdef CONFIG_VIDEO +# include "video.h" + +/* VESA control information */ +struct __packed vesa_ctrl_info { + uint8_t signature[4]; + uint16_t version; + uint32_t oem_name; + uint32_t capabilities; + uint32_t mode_list; + uint16_t mem_size; + /* We don't use any further fields. */ +}; + +/* VESA 2.0 mode information */ +struct vesa_mode_info { + uint16_t attrib; + uint8_t window[14]; /* We don't use the individual fields. */ + uint16_t bytes_per_line; + uint16_t width; + uint16_t height; + uint8_t cell_width; + uint8_t cell_height; + uint8_t nr_planes; + uint8_t depth; + uint8_t memory[5]; /* We don't use the individual fields. */ + struct boot_video_colors colors; + uint8_t direct_color; + uint32_t base; + /* We don't use any further fields. */ +}; +#endif /* CONFIG_VIDEO */ + #define get_mb2_data(tag, type, member) (((multiboot2_tag_##type##_t *)(tag))->member) #define get_mb2_string(tag, type, member) ((u32)get_mb2_data(tag, type, member)) @@ -146,7 +180,7 @@ static multiboot_info_t *mbi_reloc(u32 m return mbi_out; } -static multiboot_info_t *mbi2_reloc(u32 mbi_in) +static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out) { const multiboot2_fixed_t *mbi_fix = _p(mbi_in); const multiboot2_memory_map_t *mmap_src; @@ -154,6 +188,9 @@ static multiboot_info_t *mbi2_reloc(u32 module_t *mbi_out_mods = NULL; memory_map_t *mmap_dst; multiboot_info_t *mbi_out; +#ifdef CONFIG_VIDEO + struct boot_video_info *video = NULL; +#endif u32 ptr; unsigned int i, mod_idx = 0; @@ -254,17 +291,64 @@ static multiboot_info_t *mbi2_reloc(u32 ++mod_idx; break; +#ifdef CONFIG_VIDEO + case MULTIBOOT2_TAG_TYPE_VBE: + if ( video_out ) + { + const struct vesa_ctrl_info *ci; + const struct vesa_mode_info *mi; + + video = _p(video_out); + ci = (void *)get_mb2_data(tag, vbe, vbe_control_info); + mi = (void *)get_mb2_data(tag, vbe, vbe_mode_info); + + if ( ci->version >= 0x0200 && (mi->attrib & 0x9b) == 0x9b ) + { + video->capabilities = ci->capabilities; + video->lfb_linelength = mi->bytes_per_line; + video->lfb_width = mi->width; + video->lfb_height = mi->height; + video->lfb_depth = mi->depth; + video->lfb_base = mi->base; + video->lfb_size = ci->mem_size; + video->colors = mi->colors; + video->vesa_attrib = mi->attrib; + } + + video->vesapm.seg = get_mb2_data(tag, vbe, vbe_interface_seg); + video->vesapm.off = get_mb2_data(tag, vbe, vbe_interface_off); + } + break; + + case MULTIBOOT2_TAG_TYPE_FRAMEBUFFER: + if ( (get_mb2_data(tag, framebuffer, framebuffer_type) != + MULTIBOOT2_FRAMEBUFFER_TYPE_RGB) ) + { + video_out = 0; + video = NULL; + } + break; +#endif /* CONFIG_VIDEO */ + case MULTIBOOT2_TAG_TYPE_END: - return mbi_out; + goto end; /* Cannot "break;" here. */ default: break; } + end: + +#ifdef CONFIG_VIDEO + if ( video ) + video->orig_video_isVGA = 0x23; +#endif + return mbi_out; } -void * __stdcall reloc(u32 magic, u32 in, u32 trampoline) +void *__stdcall reloc(uint32_t magic, uint32_t in, uint32_t trampoline, + uint32_t video_info) { alloc = trampoline; @@ -274,7 +358,7 @@ void * __stdcall reloc(u32 magic, u32 in return mbi_reloc(in); case MULTIBOOT2_BOOTLOADER_MAGIC: - return mbi2_reloc(in); + return mbi2_reloc(in, video_info); case XEN_HVM_START_MAGIC_VALUE: if ( IS_ENABLED(CONFIG_PVH_GUEST) ) --- a/xen/arch/x86/boot/video.h +++ b/xen/arch/x86/boot/video.h @@ -28,4 +28,45 @@ /* The "recalculate timings" flag */ #define VIDEO_RECALC 0x8000 +#ifndef __ASSEMBLY__ +struct boot_video_info { + uint8_t orig_x; /* 0x00 */ + uint8_t orig_y; /* 0x01 */ + uint8_t orig_video_mode; /* 0x02 */ + uint8_t orig_video_cols; /* 0x03 */ + uint8_t orig_video_lines; /* 0x04 */ + uint8_t orig_video_isVGA; /* 0x05 */ + uint16_t orig_video_points; /* 0x06 */ + + /* VESA graphic mode -- linear frame buffer */ + uint32_t capabilities; /* 0x08 */ + uint16_t lfb_linelength; /* 0x0c */ + uint16_t lfb_width; /* 0x0e */ + uint16_t lfb_height; /* 0x10 */ + uint16_t lfb_depth; /* 0x12 */ + uint32_t lfb_base; /* 0x14 */ + uint32_t lfb_size; /* 0x18 */ + union { + struct { + uint8_t red_size; /* 0x1c */ + uint8_t red_pos; /* 0x1d */ + uint8_t green_size; /* 0x1e */ + uint8_t green_pos; /* 0x1f */ + uint8_t blue_size; /* 0x20 */ + uint8_t blue_pos; /* 0x21 */ + uint8_t rsvd_size; /* 0x22 */ + uint8_t rsvd_pos; /* 0x23 */ + }; + struct boot_video_colors { + uint8_t rgbr[8]; + } colors; + }; + struct { + uint16_t seg; /* 0x24 */ + uint16_t off; /* 0x26 */ + } vesapm; + uint16_t vesa_attrib; /* 0x28 */ +}; +#endif /* __ASSEMBLY__ */ + #endif /* __BOOT_VIDEO_H__ */ --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -532,35 +532,7 @@ static void __init setup_max_pdx(unsigne static struct e820map __initdata boot_e820; #ifdef CONFIG_VIDEO -struct boot_video_info { - u8 orig_x; /* 0x00 */ - u8 orig_y; /* 0x01 */ - u8 orig_video_mode; /* 0x02 */ - u8 orig_video_cols; /* 0x03 */ - u8 orig_video_lines; /* 0x04 */ - u8 orig_video_isVGA; /* 0x05 */ - u16 orig_video_points; /* 0x06 */ - - /* VESA graphic mode -- linear frame buffer */ - u32 capabilities; /* 0x08 */ - u16 lfb_linelength; /* 0x0c */ - u16 lfb_width; /* 0x0e */ - u16 lfb_height; /* 0x10 */ - u16 lfb_depth; /* 0x12 */ - u32 lfb_base; /* 0x14 */ - u32 lfb_size; /* 0x18 */ - u8 red_size; /* 0x1c */ - u8 red_pos; /* 0x1d */ - u8 green_size; /* 0x1e */ - u8 green_pos; /* 0x1f */ - u8 blue_size; /* 0x20 */ - u8 blue_pos; /* 0x21 */ - u8 rsvd_size; /* 0x22 */ - u8 rsvd_pos; /* 0x23 */ - u16 vesapm_seg; /* 0x24 */ - u16 vesapm_off; /* 0x26 */ - u16 vesa_attrib; /* 0x28 */ -}; +# include "boot/video.h" extern struct boot_video_info boot_vid_info; #endif --- a/xen/include/xen/multiboot2.h +++ b/xen/include/xen/multiboot2.h @@ -158,6 +158,59 @@ typedef struct { multiboot2_memory_map_t entries[]; } multiboot2_tag_mmap_t; +typedef struct +{ + uint32_t type; + uint32_t size; + uint16_t vbe_mode; + uint16_t vbe_interface_seg; + uint16_t vbe_interface_off; + uint16_t vbe_interface_len; + uint8_t vbe_control_info[512]; + uint8_t vbe_mode_info[256]; +} multiboot2_tag_vbe_t; + +typedef struct +{ + uint8_t red; + uint8_t green; + uint8_t blue; +} multiboot2_color_t; + +typedef struct +{ + uint32_t type; + uint32_t size; + uint64_t framebuffer_addr; + uint32_t framebuffer_pitch; + uint32_t framebuffer_width; + uint32_t framebuffer_height; + uint8_t framebuffer_bpp; +#define MULTIBOOT2_FRAMEBUFFER_TYPE_INDEXED 0 +#define MULTIBOOT2_FRAMEBUFFER_TYPE_RGB 1 +#define MULTIBOOT2_FRAMEBUFFER_TYPE_EGA_TEXT 2 + uint8_t framebuffer_type; + uint16_t reserved; + + union + { + struct + { + uint16_t framebuffer_palette_num_colors; + multiboot2_color_t framebuffer_palette[]; + }; + struct + { + uint8_t framebuffer_red_field_position; + uint8_t framebuffer_red_mask_size; + uint8_t framebuffer_green_field_position; + uint8_t framebuffer_green_mask_size; + uint8_t framebuffer_blue_field_position; + uint8_t framebuffer_blue_mask_size; + }; + }; +} multiboot2_tag_framebuffer_t; + typedef struct { u32 type; u32 size; From patchwork Thu Mar 31 09:45:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796958 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 145C3C433EF for ; Thu, 31 Mar 2022 09:46:00 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296843.505427 (Exim 4.92) (envelope-from ) id 1nZrND-0005Gj-Vl; Thu, 31 Mar 2022 09:45:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296843.505427; Thu, 31 Mar 2022 09:45:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrND-0005Gc-Sp; Thu, 31 Mar 2022 09:45:47 +0000 Received: by outflank-mailman (input) for mailman id 296843; Thu, 31 Mar 2022 09:45:46 +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 1nZrNB-0005Fx-TD for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:45:46 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 55da7f19-b0d7-11ec-a405-831a346695d4; Thu, 31 Mar 2022 11:45:44 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2169.outbound.protection.outlook.com [104.47.17.169]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-25--BRcJu6zMqa_lHsaJYM9qQ-1; Thu, 31 Mar 2022 11:45:41 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by HE1PR0402MB2828.eurprd04.prod.outlook.com (2603:10a6:3:da::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.21; Thu, 31 Mar 2022 09:45:38 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:45:38 +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: 55da7f19-b0d7-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648719944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m25bQHGvRlZ6OFGo8TfnVKsBCikksi3mWW9OB5EgvG4=; b=IdtEel9lxtzZo3Tr3XuOr/kQ9jpt9d8SciuWJ8l9eytaqUV1bVLkx0Q8abI4+YOJxjsc/d fAp2nXPebAWmCJ19HzWVH9HFfPFax2Yl3hdtanLgnLq2bzWYBTrE1sLCWsEt0JmU0DkCoa OdO2Bl4MnrzVQGmQ/qJGJgMdzMY5UpU= X-MC-Unique: -BRcJu6zMqa_lHsaJYM9qQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Otxb3qpVgo1DpQ8T9p/IMyIl3QEWoRQ41nbycsk/XjZKqteODX+7MiKiKijsTObT3h/Ir5+bHp6+lhx1Pkg+HAUm1be/dBHobkZ2Bk4zfXgvDrJYz1GCZWanq4wGg8eI0hKea7dSwdCucFMFxeobSFaOZLPLiSUODqCItmPayHcs3brtUzLnDxrnqA5fhyI6GXHCJR0DlOmnraiOK9rjvdExHksLDwl4nuRszzVpeMJ+wKsZjoB4yQu6UEyS1Jf8tyq4u0d4qnK3tnI6mVhRgqsA9RYsYD3YUBdUM1TzGDxQlQWpHDHyo4qAQBguCGSJiCdrPxPXdSXZlEHC+XqJqg== 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=m25bQHGvRlZ6OFGo8TfnVKsBCikksi3mWW9OB5EgvG4=; b=bwSWXy4EPuTbO7Tysuv7vIPL7eSa+6oFiOrZ4S4FsV72g+tZRgp+JRr9k+0OOdGY3yazDcIw8Tgu7lQULslQ2lh7q/j2NCbXXxDWcShRV21fYFmDrkAMEtoGkJGkJFH+naa0vbRNvhEOmLGoVX+8LRzoyQW6ucHDkqtsPgvL5JiJ9nkuQ8Q4PC20TJ244s4awUxNcDaSyHyjPJ84vCGl9r8KwWEh1W4ukDG8Mm5ClVfSl8R2MopLwp5FOyUIqQhBjapxDJQ0etVsTlJtF11VYehF6tUWAsmAPvHVEBcasp2zitHuiYUXTzjy46+MljG63d7w7FevwClCWKn4RT38gQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Thu, 31 Mar 2022 11:45:36 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 3/8] x86/EFI: retrieve EDID Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AM6P191CA0033.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::46) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b44cde77-0441-4ee7-db06-08da12fb3657 X-MS-TrafficTypeDiagnostic: HE1PR0402MB2828:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EvMrlE7EOu69WZp2NY76Z7FrCpazd4T0hyEV7p8dPEDBE0weQ5Rpa9r7CscgtMGTLT79+y8qJGRVTuroNjzkY211zlRBT5ksciUM2BlspkJOPYBcQOI3ClTPCyinU5xQ24guKM6OqwUI1bh66Obx6TZfnUrz0q+RcZmB/0z6I95QItw+pLSEmuWQDfqGYb9p7VjKeM+zlBbo6BB9EsoetbXEhhKLujTNGFWgQVp+5JCIsZEgLHr7tQb+7oc+9gu+o9tUMtKFNxKax64QLnxMVLmoDQEof9Qz2kYf490PNe2Dv6tS8I4pNxW1RjPKt6BARIzmh2jEQTp26KtIlKNW7e7XkBbL2e1JDFeoojtPRMlp2kgF3tZcrC9T9M9Toqh3r4EuQGv6cUK251rhitXI88Gd5JRuoTfBvrvmo/36HPMJkh6+TvpEeltgC81KM1J2dq/iR10w78JmCmi5ll570fiM18dT0H2akI5CeXXFYwJcwOKFsi2OW6wabDbONaxyyhh3yV0Z8NC0lc92UUR7M1qLsDUpuNnvBc1kSaZSevCzKi7BZ0EwgGifKMFmeHw/FyMzWDAlT78eGi4rmTh5xgan4aawAmzWhyYrutf0qS8A2/AFEO+/VF74HaDeHYXmybQUR0ZEV77nyYIBZ41lyi85yGcWtcKWbsgTDgD50uDGuIxZjcCfvuRz9rHOmbgfmFLJGbPt5e5hBWqulJRgQXeOfbUJRb8iuHpRTKN0xi2enYsuOQRzpn0RtssWuYbuKLtDHjZIUeNKeqQkwUYcBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(83380400001)(8676002)(66946007)(86362001)(66556008)(4326008)(36756003)(6506007)(31686004)(2906002)(8936002)(66476007)(5660300002)(31696002)(54906003)(6916009)(508600001)(38100700002)(6486002)(186003)(6512007)(26005)(316002)(2616005)(21314003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6wKLofJk3ITPCNFYW/4Y/+X5H+E1?= =?utf-8?q?5BVUoi0rTj9P7PPivbCAm9CAK7Uu77ybYolqGaGx4ahXkCYY+njv1LtEX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4WRD?= =?utf-8?q?ypTgCledUoTi8b+GotQ27CMhNhJusgZCC1Am7SIFM/FJPDwjlKBvMs0H46xpWlwpq?= =?utf-8?q?JsCVIyKOb/u6bPmaF2bMnMblXwir7K1adjqjxPauOdvYQDyXAzhoQjJ97+ErK2Rwx?= =?utf-8?q?xNfuqIwOmttm3yEtKGEIqMLkYOUYSF+7U6l7X87DHpCl8bLdn/+35Uar0ifWCvOCj?= =?utf-8?q?H9S8BFvAvUIkTKcN1y5d3wKDo72/2vSDZEUB9d0p9xsDujJkQzq6sgPj96QpwMIk6?= =?utf-8?q?o/lJ6QfsNp3qqWZJRi2M8NdBqhJqAKuRkO7RpLzXlaGOCt4/wrMdiIPMc3SGzx1Vh?= =?utf-8?q?AsLjncLVCeKRjRWyD3K7uGbtLRw+WY/kDCx1Ra4cp+97+1xtdzi4IddTFB6NUfFSX?= =?utf-8?q?6Ojgoa3R5zd1UYen6jIzTQXmqLoBsLo7iBl6N3edT6z/kEGN2faVcZjlq4IMJ3XjD?= =?utf-8?q?MRr/Fi1JX4MtxwAIj5linwtC+DpeNVwGY5o0EUrXnSYy+9WFYc6psUM80VErmbRCN?= =?utf-8?q?R8iKk+jcfHa+LWxJeam4GIoA1V/2E5pfScRVUDWUEZfT53udB/5UiBcKGa+t8eKbU?= =?utf-8?q?JrPyN//+50GJko/FgnZd6aFEGsYEqAYNqEVVV80/HhQUyRszlZTmc9abq1UYpbs9l?= =?utf-8?q?/eGopt1X3QZM8hxQOd7FCuaEZmUnZpuS2slT404m0Cckn0mzD1Hqsv0cQ9Rf0t+d8?= =?utf-8?q?aKl3BAp+nogLW5rWbGt+YwgzQ6YZN1mA=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b44cde77-0441-4ee7-db06-08da12fb3657 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:45:38.5571 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w2SiAJFyLNHtoHm4FE1+i7FtICm1KO/9nMAKqUb9h4NPnZGpulkggZFloi3TC1Kl8lHck7Av/SCPSxpvZgwtYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB2828 When booting directly from EFI, obtaining this information from EFI is the only possible way. And even when booting with a boot loader interposed, it's more clean not to use legacy BIOS calls for this purpose. (The downside being that there are no "capabilities" that we can retrieve the EFI way.) To achieve this we need to propagate the handle used to obtain the EFI_GRAPHICS_OUTPUT_PROTOCOL instance for further obtaining an EFI_EDID_*_PROTOCOL instance, which has been part of the spec since 2.5. Signed-off-by: Jan Beulich Reviewed-by: Luca Fancellu Acked-by: Roger Pau Monné Acked-by: Roger Pau Monné Acked-by: Bertrand Marquis #arm --- Setting boot_edid_caps to zero isn't desirable, but arbitrarily setting one or both of the two low bits also doesn't seem appropriate. GrUB also checks an "agp-internal-edid" variable. As I haven't been able to find any related documentation, and as GrUB being happy about the variable being any size (rather than at least / precisely 128 bytes), I didn't follow that route. --- v3: Re-base. v2: New. --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -464,6 +464,10 @@ static void __init efi_arch_edd(void) { } +static void __init efi_arch_edid(EFI_HANDLE gop_handle) +{ +} + static void __init efi_arch_memory_setup(void) { } --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -922,7 +922,14 @@ store_edid: pushw %dx pushw %di - cmpb $1, bootsym(opt_edid) # EDID disabled on cmdline (edid=no)? + movb bootsym(opt_edid), %al + cmpw $0x1313, bootsym(boot_edid_caps) # Data already retrieved? + je .Lcheck_edid + cmpb $2, %al # EDID forced on cmdline (edid=force)? + jne .Lno_edid + +.Lcheck_edid: + cmpb $1, %al # EDID disabled on cmdline (edid=no)? je .Lno_edid leaw vesa_glob_info, %di --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -568,6 +568,49 @@ static void __init efi_arch_video_init(E #endif } +#ifdef CONFIG_VIDEO +static bool __init copy_edid(const void *buf, unsigned int size) +{ + /* + * Be conservative - for both undersized and oversized blobs it is unclear + * what to actually do with them. The more that unlike the VESA BIOS + * interface we also have no associated "capabilities" value (which might + * carry a hint as to possible interpretation). + */ + if ( size != ARRAY_SIZE(boot_edid_info) ) + return false; + + memcpy(boot_edid_info, buf, size); + boot_edid_caps = 0; + + return true; +} +#endif + +static void __init efi_arch_edid(EFI_HANDLE gop_handle) +{ +#ifdef CONFIG_VIDEO + static EFI_GUID __initdata active_guid = EFI_EDID_ACTIVE_PROTOCOL_GUID; + static EFI_GUID __initdata discovered_guid = EFI_EDID_DISCOVERED_PROTOCOL_GUID; + EFI_EDID_ACTIVE_PROTOCOL *active_edid; + EFI_EDID_DISCOVERED_PROTOCOL *discovered_edid; + EFI_STATUS status; + + status = efi_bs->OpenProtocol(gop_handle, &active_guid, + (void **)&active_edid, efi_ih, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if ( status == EFI_SUCCESS && + copy_edid(active_edid->Edid, active_edid->SizeOfEdid) ) + return; + + status = efi_bs->OpenProtocol(gop_handle, &discovered_guid, + (void **)&discovered_edid, efi_ih, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if ( status == EFI_SUCCESS ) + copy_edid(discovered_edid->Edid, discovered_edid->SizeOfEdid); +#endif +} + static void __init efi_arch_memory_setup(void) { unsigned int i; @@ -729,6 +772,7 @@ static void __init efi_arch_flush_dcache void __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { EFI_GRAPHICS_OUTPUT_PROTOCOL *gop; + EFI_HANDLE gop_handle; UINTN cols, gop_mode = ~0, rows; __set_bit(EFI_BOOT, &efi_flags); @@ -742,11 +786,15 @@ void __init efi_multiboot2(EFI_HANDLE Im &cols, &rows) == EFI_SUCCESS ) efi_arch_console_init(cols, rows); - gop = efi_get_gop(); + gop = efi_get_gop(&gop_handle); if ( gop ) + { gop_mode = efi_find_gop_mode(gop, 0, 0, 0); + efi_arch_edid(gop_handle); + } + efi_arch_edd(); efi_arch_cpu(); --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -118,7 +118,7 @@ static bool read_section(const EFI_LOADE static void efi_init(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable); static void efi_console_set_mode(void); -static EFI_GRAPHICS_OUTPUT_PROTOCOL *efi_get_gop(void); +static EFI_GRAPHICS_OUTPUT_PROTOCOL *efi_get_gop(EFI_HANDLE *gop_handle); static UINTN efi_find_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, UINTN cols, UINTN rows, UINTN depth); static void efi_tables(void); @@ -758,7 +758,7 @@ static void __init efi_console_set_mode( StdOut->SetMode(StdOut, best); } -static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void) +static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(EFI_HANDLE *gop_handle) { EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info; EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL; @@ -783,7 +783,10 @@ static EFI_GRAPHICS_OUTPUT_PROTOCOL __in continue; status = gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_info); if ( !EFI_ERROR(status) ) + { + *gop_handle = handles[i]; break; + } } if ( handles ) efi_bs->FreePool(handles); @@ -1222,6 +1225,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY if ( use_cfg_file ) { EFI_FILE_HANDLE dir_handle; + EFI_HANDLE gop_handle; UINTN depth, cols, rows, size; size = cols = rows = depth = 0; @@ -1230,7 +1234,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY &cols, &rows) == EFI_SUCCESS ) efi_arch_console_init(cols, rows); - gop = efi_get_gop(); + gop = efi_get_gop(&gop_handle); /* Get the file system interface. */ dir_handle = get_parent_handle(loaded_image, &file_name); @@ -1360,7 +1364,11 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY dir_handle->Close(dir_handle); if ( gop && !base_video ) + { gop_mode = efi_find_gop_mode(gop, cols, rows, depth); + + efi_arch_edid(gop_handle); + } } /* Get the number of boot modules specified on the DT or an error (<0) */ @@ -1387,7 +1395,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY efi_arch_edd(); - /* XXX Collect EDID info. */ efi_arch_cpu(); efi_tables(); --- a/xen/include/efi/efiprot.h +++ b/xen/include/efi/efiprot.h @@ -724,5 +724,52 @@ struct _EFI_GRAPHICS_OUTPUT_PROTOCOL { EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt; EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode; }; + +/* + * EFI EDID Discovered Protocol + * UEFI Specification Version 2.5 Section 11.9 + */ +#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \ + { 0x1C0C34F6, 0xD380, 0x41FA, { 0xA0, 0x49, 0x8a, 0xD0, 0x6C, 0x1A, 0x66, 0xAA} } + +typedef struct _EFI_EDID_DISCOVERED_PROTOCOL { + UINT32 SizeOfEdid; + UINT8 *Edid; +} EFI_EDID_DISCOVERED_PROTOCOL; + +/* + * EFI EDID Active Protocol + * UEFI Specification Version 2.5 Section 11.9 + */ +#define EFI_EDID_ACTIVE_PROTOCOL_GUID \ + { 0xBD8C1056, 0x9F36, 0x44EC, { 0x92, 0xA8, 0xA6, 0x33, 0x7F, 0x81, 0x79, 0x86} } + +typedef struct _EFI_EDID_ACTIVE_PROTOCOL { + UINT32 SizeOfEdid; + UINT8 *Edid; +} EFI_EDID_ACTIVE_PROTOCOL; + +/* + * EFI EDID Override Protocol + * UEFI Specification Version 2.5 Section 11.9 + */ +#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \ + { 0x48ECB431, 0xFB72, 0x45C0, { 0xA9, 0x22, 0xF4, 0x58, 0xFE, 0x04, 0x0B, 0xD5} } + +INTERFACE_DECL(_EFI_EDID_OVERRIDE_PROTOCOL); + +typedef +EFI_STATUS +(EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID) ( + IN struct _EFI_EDID_OVERRIDE_PROTOCOL *This, + IN EFI_HANDLE *ChildHandle, + OUT UINT32 *Attributes, + IN OUT UINTN *EdidSize, + IN OUT UINT8 **Edid); + +typedef struct _EFI_EDID_OVERRIDE_PROTOCOL { + EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid; +} EFI_EDID_OVERRIDE_PROTOCOL; + #endif From patchwork Thu Mar 31 09:48:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796959 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 D5386C433EF for ; Thu, 31 Mar 2022 09:49:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296851.505438 (Exim 4.92) (envelope-from ) id 1nZrQJ-00061N-IE; Thu, 31 Mar 2022 09:48:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296851.505438; Thu, 31 Mar 2022 09:48:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrQJ-00061G-FG; Thu, 31 Mar 2022 09:48:59 +0000 Received: by outflank-mailman (input) for mailman id 296851; Thu, 31 Mar 2022 09:48:58 +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 1nZrQI-00061A-Am for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:48:58 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c8b1afa1-b0d7-11ec-8fbc-03012f2f19d4; Thu, 31 Mar 2022 11:48:57 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2108.outbound.protection.outlook.com [104.47.18.108]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-22-vT_QhzW5OQ6fFsj6KKT39g-1; Thu, 31 Mar 2022 11:48:55 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.21; Thu, 31 Mar 2022 09:48:53 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:48:53 +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: c8b1afa1-b0d7-11ec-8fbc-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648720137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+iOZotKkLcJY4CXebIky0sg+x0ejVE7dgfMqo24AelE=; b=mSZ+pWlHMapCjOv8Z5jMUFOZ31LDjO8M+c1k1sGz5DM3c6l1URMMLAM4OaGm/lZYDXL/sx RlaVeNxrerz1JdNARauPanNZ6nGM73MD/0+Mxzz7iHepvnUeuyOUK8hhnRKkd0UQQ8PMB0 k/paZDVLiuQIlGTax664qcdGw+BlYhs= X-MC-Unique: vT_QhzW5OQ6fFsj6KKT39g-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cqsBu+6ePMeKPUKtlK+T6vluiV064gyg20OE+23C8O/tqo2sMVI2JTaqiCxoLzZ7uZHHl0khz5kobi+VWWpJzZphHspnbXlhudXNLwltSa8wp4axIPSj3sgMaapjs2Tsvk9qxbwRX4VE/6AZGVaBYjAuM+lsWUDFTtvTdBkpinlUl6aJVl0YIiBYWhCVGyU0i1X1QleG1aX3LgqYT+7uY7iV3x5P2DDfMBs4d/1Zwm3UOVRzBG1612bVGtTDPBjfHrilA7kZ5hmIgk7yN5jaSUuvozkb/RFh8ZXA7aLIklwxbGdTwxm7ieBs+Zfd65WBIM8m2wFsCOrsAdrYoh/g/w== 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=+iOZotKkLcJY4CXebIky0sg+x0ejVE7dgfMqo24AelE=; b=M0BjXn32/8ZRyQH0wWtsIVi6N28EeS6yHYI32DM239fiGn0cXprZqge/BE/aufuRvaX3B0aGYDSIsz3rM/Ot5pgOk34n4l08scdq8bxOXzjkKrVKRLZsfFjgm7rl4q7fNA8l6SxYJiomSqkPnY/ZC9ji3oxbhISSHiFrjCSFz/Nul2YuCdoxGCi/SyOgLsNRM0iD9b5G4ObEEi54OulC9uEh/mCEo5S/yPviqHBtGYGfceDp/nJYlYe6Oepa7EGtG34SuQzjmanJ6MqgVgDg6/N2Om7mpbDLpbqD1p4tHxdo7Km0Ng/GzCLNulnNSotyk9sK67UbEa2ENbLfKwRckQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Thu, 31 Mar 2022 11:48:51 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 4/8] x86/boot: simplify mode_table Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AS9PR04CA0066.eurprd04.prod.outlook.com (2603:10a6:20b:48b::19) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3ebcdac-364f-435a-3742-08da12fbaa48 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qUfHIdCNJkTPD82OeCwJKceR7ekoUcB7WoLUsRDPY2fskgk8Akw4gOXK8iRF9LPzUlZfLMVv4fR4qYVaUUJwaw7WmLeY3tELTzIj4hPIYM1G/pFHRH/X81MYj0zMRRMrDKFBI13zOsNIi6w4pu20V2uCwTHJkMjeaz2AtNFaIL2rsqKf5bKbUmZXR2BcbvSmG54Q9xLiVoz2PCiFFAfg14m2A/6o8SY05J6lfsxDhr6x9uIs1nrHV6nNEOLF5od9oRl4iQreRGIQsSLxRcbyGpxKHmt5TBFuVkDZGpruGrvJHoZDy+RfHBKcrHCsmFl4uzIoVRiV674nF1cUfJRNuJGBv/dzquJ/fOkP5dRXlgrizXieqgTlsNjUFQjEVf1GDxoIIuIaMyjLQLFCoItWxA+UMVu2/+1bMs/ATnjt72+jIN3blxmX1glBM70rEsEtC+gXof89exBzIG3porE1jXY9Ww5h79hmPPgOr6SjoE7/MHeRJZWZTYby/1yzBbLYU9/Zb1ooQroCTv4SP9jjnoI6wvVKavHNPIpj13ueNxw2PkWR3UzUfOS7aG2DD/FgW8CdiXLebqk/7cpBoHmi4zhG7v7uP3VTUZJbRnRCJVInRrcUDBBOMQ521Ax7pF4EhS6/0f/KBjeDAJWB/ECBjMQPwiZ3ByHqZYzddJNGnpatgvg3e4SqG+gsPKV0sfVUdxw8WuGTfHy9NN5N8XJeqst1gkW2NLyLi5tAT3YdgJF9zYDsJz0LFYvKeZLyjFiF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(6916009)(54906003)(316002)(66476007)(8676002)(6512007)(6506007)(66946007)(31696002)(86362001)(508600001)(6486002)(66556008)(38100700002)(2616005)(4326008)(5660300002)(26005)(186003)(8936002)(2906002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?epzlt0tvjh1BJEL6/odpwIo+hdZ2?= =?utf-8?q?H0jXr52YRb/vpOkI8bSsWRinNa/H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gaul6ep0goyV3ksXnaP2W?= =?utf-8?q?bqXV1xV/ttyvugh6n8DDQ/19s4IjsDZ7jRiS3JJUNNiGDmFdCE3vOAvZpVjH8ZyV+?= =?utf-8?q?knU1PH2tzRFi2ZrBwBCi9xnicBpyCcvRDiTT88CtJR6C9Z8NPdIxpDyV/3Dishl1o?= =?utf-8?q?Pn0AEbfbZCipUC2NTWqDbDKSybczNVGK63Z+zafkWys5YnSYaP5AuaXA4s6IY05Q/?= =?utf-8?q?Q0GFCarQb4uO49NJtVEtBgaxgflQIWp9LgbqXK8EPWjO4+rC3oB8nlAZK7BjEigk+?= =?utf-8?q?JSkMRRGDNwSVv5ACrXfCXlFpyqEUi159UP6CZro3Qs+F5LEp7j/L7KOkWYndYGAG3?= =?utf-8?q?bCbl+rug4RZ/EM3Qo2IhjBSKuP5/mBMoHGd3jv/lpuv8hJoB6E11FnUfmZ7TahjUX?= =?utf-8?q?mqFe5CZw62IetrS2eAm/gz5uzrEpE/rlYupHiCny/3MkqrtmtKIY+885ezsaDsC0S?= =?utf-8?q?WmiUGhxpzG38u7VoBeb51nGmDiu/NNDahvW1KJ3nODmzD8o7cT5J0/4+2duxhMa8q?= =?utf-8?q?bjw/FHiovO5jrdf5OOAF/LsHEr0RgCKbrBOtmTUcvYhAuSf6wg93TPkZqSCrX8BDb?= =?utf-8?q?tfY8exL4IT0G3dddG9sQfuNE4Sxp6qdudK7VI4F/CCWEgptsd3LSrvNfCrowrCGvS?= =?utf-8?q?sjfdXlGWYqlSZFvr5vBxT156pJJ9PgpZ4fWskLnfK9aL0Gz3xr/LtaxL7/axrPmHA?= =?utf-8?q?JGrkGiGlgj0XA5DqWudOlirIpexYk1Rg=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3ebcdac-364f-435a-3742-08da12fbaa48 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:48:53.3840 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zI9RqP+WY0dJJvIj1GogcqYMv9v7jimkfSPI8TNIF1/EU7r3de2T2f97UsYvPx8AtHOwcdHlLXBrI/TKFjRrGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 There's no point in writing 80x25 text mode information via multiple insns all storing immediate values. The data can simply be included first thing in the vga_modes table, allowing the already present REP MOVSB to take care of everything in one go. While touching this also correct a related but stale comment. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -655,8 +655,9 @@ outidx: outb %al, %dx # Build the table of video modes (stored after the setup.S code at the # `modelist' label. Each video mode record looks like: # .word MODE-ID (our special mode ID (see above)) -# .byte rows (number of rows) -# .byte columns (number of columns) +# .word rows (number of rows) +# .word columns (number of columns) +# .word 0 (color depth; gfx modes only) # Returns address of the end of the table in DI, the end is marked # with a ASK_VGA ID. mode_table: @@ -665,12 +666,6 @@ mode_table: jnz mtab1 leaw modelist, %di # Store standard modes: - movw $VIDEO_80x25,(%di) # The 80x25 mode (ALL) - movw $0x50,2(%di) - movw $0x19,4(%di) - movw $0x00,6(%di) - addw $8,%di - leaw bootsym(vga_modes), %si # All modes for std VGA movw $vga_modes_end-vga_modes, %cx rep movsb @@ -684,6 +679,7 @@ ret0: ret # Modes usable on all standard VGAs vga_modes: + .word VIDEO_80x25, 0x50,0x19,0 # 80x25 .word VIDEO_80x50, 0x50,0x32,0 # 80x50 .word VIDEO_80x43, 0x50,0x2b,0 # 80x43 .word VIDEO_80x28, 0x50,0x1c,0 # 80x28 From patchwork Thu Mar 31 09:49:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796960 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 1FED3C433F5 for ; Thu, 31 Mar 2022 09:49:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296854.505449 (Exim 4.92) (envelope-from ) id 1nZrQq-0006Xp-Qr; Thu, 31 Mar 2022 09:49:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296854.505449; Thu, 31 Mar 2022 09:49:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrQq-0006Xi-Nu; Thu, 31 Mar 2022 09:49:32 +0000 Received: by outflank-mailman (input) for mailman id 296854; Thu, 31 Mar 2022 09:49:31 +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 1nZrQp-00061A-5O for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:49:31 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id dc672d3a-b0d7-11ec-8fbc-03012f2f19d4; Thu, 31 Mar 2022 11:49:30 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2112.outbound.protection.outlook.com [104.47.18.112]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-23-9cWyOcaZPTeJwQBJ-cg6Jw-1; Thu, 31 Mar 2022 11:49:27 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by VI1PR04MB3264.eurprd04.prod.outlook.com (2603:10a6:802:11::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.16; Thu, 31 Mar 2022 09:49:26 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:49:26 +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: dc672d3a-b0d7-11ec-8fbc-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648720170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GFSJGrEWRuZxL/lqFamJoez8zlHu39Sdg/lvj6ulEMc=; b=aoBnjt6+glCRqKYvhWRwLixJ4A9ZW7DQtJeH7/BPfeZhmwrvJ8M1bRFRctzJHFI+iiEdY3 cSkryCGRxDc74iY0W/F1sQGrKQ9HJ/VJJLNWdbaEtU0N4VVBa5L12BgcQqxC7gSUEUAHDB Dywbaou16EJHj8ZVBcRNP+wWUQnDXDE= X-MC-Unique: 9cWyOcaZPTeJwQBJ-cg6Jw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6HKUaI6hAPF/qfzmEeIG6ashHBUg+9ou4depZltvtzFff8xmu7AOs0dAW8+LNrsKJyYIt/hr0ZX4Karux+QwICWEPbNqBM53krR96bLxz2oM7UazJ+TxcQ4eKV0EI+A2vxVwODXYN/aM3EiE+iuNidAjCtuKQBhsdRh3/OGLDneFksRgyS2ndHY63zQli4RVed6j9m4Rqnj+ZnMm+14aOkLQo8as6xsa57AiFmlwEtqYGKOGCCE2NzYzomWBpTuM+AXR/ELNIsd3iJyXyBjBXXJwakF91KXWETcRJF+5s7peCvwqOf9S0eWqRdWHe9mV5SKzGldeJSF8EU7vEW0cQ== 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=GFSJGrEWRuZxL/lqFamJoez8zlHu39Sdg/lvj6ulEMc=; b=PUNrxXtszns2zAt4EE89WeOv0ElhZIAfxDPx8qimtm9ciqTOsE9qlV/XI/EK3xA27v6aQ6FWiFOM+bJ+P27npkBc5BcQYcrwRSNtUE1HCZAcTC/SE+HkfDwyEgroHJY2CXCGsPZV4xYaCNqUfFjll0K1LAQWpju9pfHkMtgLpXvilnmpvrgN2ZSGciT0lVmShCTXHnVhAwniVUw2HiTKMf79Y/S31xx5Fi8iFpIr2eBLB3deWDY6Mekfe4AEkZh9LTtSMJwSwIHnhr7uNZLAh7VRW1wflZT80bBp04Y51a82k8+cr8gxFTExyAeTw/AluS9vXVyAVsEXoPNsvCNHVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <5e4ee27b-4904-b2bc-1650-df148b47387f@suse.com> Date: Thu, 31 Mar 2022 11:49:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 5/8] x86/boot: fold branches in video handling code Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AS9PR04CA0065.eurprd04.prod.outlook.com (2603:10a6:20b:48b::21) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8ca1b11-0074-4c80-8d31-08da12fbbe17 X-MS-TrafficTypeDiagnostic: VI1PR04MB3264:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N0vAaVsYAgOpWwNgby88QHYSw08UBgReEVbBDMQwPp+5w5tj8020q1xSbOo0SjmDAfJDTig8OPZClLtwNNnuXBlVb15dWF5dhfC+1eK8yPaZsX+1fuWsxo16pLx+yqVJQ+5Mc/6wcNWojbWC6tJ8p/Zm5Ur9f8+WAsv58So1USCTP9ExQaoUftuJqR6ddF92nguBipfhGBFP4PrQM2LBrXsfkdllSHVgVD695xC7bshTCXoojqp33kbz7+Lgpd8pUt5UMTgZOqCFU3HiLr9d/CkGucjBi/pjszM//pHXf7Hv05gNmRTy8mYfuxvn39KbGBNW5ytLle0F6ot1lv6FaM5tNaHP44BRE8GqbmuyVvoAWI2mv2cD+XW1mCIwB7JPlUFkyXgrtu7G92T3pyMllE7IBFwpuUiB2g81yUhe8F9wrcAMwNVqML0rHvnY9SXasDvfulH5z5UxsjxWhyEdqAfrQKfZmcp/GpjYVnODqmT2S3Tj5GjvExzI3X4Vxhc44IH8BBndvyuY2ZyKClCKjc2+Yg8JzAElnO3Hk8BE5dS7u++7sYGiuFg78E6FDCwTNtJ0zO76kJ9GCUhwLOTah0FM/R6/Jk0Oj8sHi2bqrtewFNexl4I7rmhUUr6QOahIdDYXYJkM6bbeT/WtPN+hq1FUtMGqBVCGlAIllT+sAvSCw/MDL8AXDHU3yooL2AKIO3O9iyHeJhjL/ID+uQbSu5AFXR+I1NqqxT8MJz2o637mDJ8VegxCtuqvtmLY4qQ5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(31696002)(54906003)(6506007)(2906002)(86362001)(4326008)(8676002)(66476007)(66556008)(66946007)(508600001)(6512007)(6916009)(31686004)(36756003)(316002)(6486002)(2616005)(38100700002)(186003)(26005)(4744005)(8936002)(5660300002)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?CCu65A6jbxC/nBX4J/H1byc2PDGW?= =?utf-8?q?niM+guRYpeOuuTcS4Fc32VL8mn3uGvXKIQ5/927ytQQeQod+XMKJc21phSfm/Tiu6?= =?utf-8?q?GBbpWhMoYkbjtPscIO7r2zwGM5z2BZ/XQLS6UDu1GPx07nJ4dI/wi7Ba8b+4p1x/M?= =?utf-8?q?yObdD79gtG0H9Cq7z1gbL4cBuhT+JZiYDSEJqeZwSFnu5LZmATwYm4BGvlI3vBs0r?= =?utf-8?q?Cz3d/h3AS9xB7+LJGFIrcDgN/v5tVPJUhYwSFKBzAg6QpkDdiI+YVzwj2oKjd+BfM?= =?utf-8?q?qtaJPnWQb4K55bmlU+RfAYkDTxRCpffByOUuNkiN/RULk2eNpsttj1tX54VtBQEX9?= =?utf-8?q?Gd8SyPVEZDLUip7axqueABjci0WY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kt2R5pYS3rZ5JUsfMsWg8f4bY?= =?utf-8?q?CGooUEcJCYDISmWdmUro9yxVTIfZZkis1SNII2QIrLu/PbLtks8zAv35HTgQ1137W?= =?utf-8?q?deD7PfJEKIaJIve3Hqz7L38Lui/VbABnAre752ozg/9em8dRK14UxF/P9UodTiyv4?= =?utf-8?q?88sfbcKb211kF3l0dc7iFl1HjzcnqskJXUdmLaomc0gQaK0tq4v7p5F+6l//8b6kE?= =?utf-8?q?9EWN3ff7Yrv4Z9yNEDGZ23VwR+4/F5DlNxz64TIbW0FVOV4rmZb2UXI4rpuFPRT8T?= =?utf-8?q?H48NokkZvKm89veJcW5BFOIqhKhaVwY14Pl4Yy+aiXUyD/BirARJWJL/AbzhgV34I?= =?utf-8?q?tvHRmfkr9Wd60r5a9yGLVDSRB+w/w9UzK9d/GcDWma2L+Qte1QDU9Ds+GTApj0pAb?= =?utf-8?q?Vf9Jv2P/cE8TNp1lCzypnD7m6odzx+9g=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8ca1b11-0074-4c80-8d31-08da12fbbe17 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:49:26.2902 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: J32NOlCrpnEaeGoxte9mf0E6ec6EiQnGqhRDXfbVS8bDRSDNZR6DC7Fo+G9AHhGhQlg17xcaNQ24rVJmFHhLoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3264 Using Jcc to branch around a JMP is necessary only in pre-386 code, where Jcc is limited to disp8. Use the opposite Jcc directly in two places. Since it's adjacent, also convert an ORB to TESTB. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -332,8 +332,7 @@ lment: movb $0, (%di) cmpw $0x656d, (%si) # 'me' jnz lmhx cmpw $0x756e, 2(%si) # 'nu' - jnz lmhx - jmp listm + jz listm lmhx: xorw %bx, %bx # Else => mode ID in hex lmhex: lodsb @@ -401,10 +400,8 @@ mode_set: cmpb $VIDEO_FIRST_VESA>>8, %ah jnc check_vesa - orb %ah, %ah - jnz setbad - - jmp setmenu + testb %ah, %ah + jz setmenu setbad: clc ret From patchwork Thu Mar 31 09:50:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796961 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 4EA92C433EF for ; Thu, 31 Mar 2022 09:50:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296857.505461 (Exim 4.92) (envelope-from ) id 1nZrRQ-0007m4-65; Thu, 31 Mar 2022 09:50:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296857.505461; Thu, 31 Mar 2022 09:50:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrRQ-0007lx-1R; Thu, 31 Mar 2022 09:50:08 +0000 Received: by outflank-mailman (input) for mailman id 296857; Thu, 31 Mar 2022 09:50:07 +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 1nZrRP-0007le-1H for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:50:07 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f190cfb4-b0d7-11ec-8fbc-03012f2f19d4; Thu, 31 Mar 2022 11:50:06 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2108.outbound.protection.outlook.com [104.47.17.108]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-19-Upvu56G9M9SPSt_Bp4NJDw-1; Thu, 31 Mar 2022 11:50:03 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by AS4PR04MB9650.eurprd04.prod.outlook.com (2603:10a6:20b:4cd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.22; Thu, 31 Mar 2022 09:50:02 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:50:02 +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: f190cfb4-b0d7-11ec-8fbc-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648720205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=juBJGq4ZapzX50bKGD151YensGcEVFSl2L4HTOV0500=; b=RClEyANyI7gWsL37BhRxyCrBl/h0O70WZ2eUoPmlLGxa+w8vC+gbclGy0SmLUss3Q03yag dtvCvQTku32+ab2u1f1zpjH1RbvHTR9L9IVUQjoY/eWSiEM4XS7tSmcDAkzYbIOjdS1b/5 XPxJRx/yyufOpQ7uYmg/4mH/bFO/KzQ= X-MC-Unique: Upvu56G9M9SPSt_Bp4NJDw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xqd+qw58Q/VJExivereJhYcTpxmmB2iJa5o2xUKA46HvNbv9m69CxCqcWey9a2tqXjzGg8BsJxSqrXJRh4pwNo5ZJqeLwYI8f6ofATmcb8yqzIDXsxzq2m5101YfDW0/N8cutkYcrqhClzMjkAURgYNXeYswNx9lYwAwSGntG10hgXYJY4Usx/8HqmoVHZjUelL48xIWWFnX41UqaskwcNdZmOLc9CIdKwyoWOlobaUZ886KUd9XXmzTCGi+WCkpc8LAFVw3vyiQBcCxRteQYOx6HM4jIHTqOt/t09rxzA/HgKrXIk3k4R7fXuyQH6nQNjrPZGcujQ4CHPe9JnUN6w== 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=juBJGq4ZapzX50bKGD151YensGcEVFSl2L4HTOV0500=; b=eF7JoghCr9UiYn0FMVy7CXJFqXKq41aj/uW3Z0ev74gutwzg2krTD0V3VI/w9eJKNVC3ogqWbzaH5XIWFU9K3MWGwMT3trjigHiUqFcDQ+GteM2Z5OnUHuuQ1jVSkvdKOvMb+Alj9oFbgu3FpVMhLXrDKWQ8mAo+aMhx88DHCg+xK1i5BhPZIIibHir/V2athC6KqBacTgaVryUE7fiPW7EjZiiiZrEYixOezChx1w9nR8s43Om48SQ37Rd62IW8hKmyOqNmlrmUYpleB5/rcC7CcXM+hKtKOJMJ3P6jsEI6yZMwQxLz+jGOUyaU6ZBUu3+6S2ls7HiQWKFXIgbLcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <8b66f631-18be-7819-7982-c56c03220595@suse.com> Date: Thu, 31 Mar 2022 11:50:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 6/8] x86/boot: fold/replace moves in video handling code Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AS8PR04CA0002.eurprd04.prod.outlook.com (2603:10a6:20b:310::7) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efc601af-a35c-4b40-466a-08da12fbd363 X-MS-TrafficTypeDiagnostic: AS4PR04MB9650:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x+DERFW5Zqkod6Cj5ofwWLSEL1c8gTPULkgcgEQJ2WJaLgjI0s5/WeW4Ng6OXKFKLs8biV5eo/uNoELq1KapeZyDsvDckMpnxv8iuB6Dti6Qv9C2BqG6Z5pvWoVXmHkzPV35NUrCddFnh/5F+mRLyOX4Jo7E19o8VnC49T4Bmko7qFmeeV9bej5DV6mjMCMKeeBT0RolV5a32B0ksf39+kKvDbry8qPLT0+t0Sl0AoT+invfgfrXv8rLeUPijYoB6ixoW4XQRzLkmefAJoKf5obw5hmLbMOezkO8Ib+yuvL/px0Y7IWQD6imbS/d6reVYs2d+PhVmxdBHZDPGzKk72xWh+xI819RVwsrh55bC2Jhr3mFNBqxIpntdyCTc9GIKsCm35SXgCnlPuRWXBhBqocE+hf4Wn2WNxF4j+axrbZQh1KaX8GngJJcNKr+iP8S2KMWSjCpub8O7AIwqf4suS0TLlTL1kLkul/wFnWEiJ5NHXOxPK+BC+rv5kTMaWubhfzt/3Ayiko1ikfsKXl8/Gc13v3DLGEFg3UNz/53LoPs18THiLXHaWHfSyNOQaZ3PVM6XlTGNLqz2hCVWVh6hG+4DN101IqmCd9PNgE/HMmfGiH7cNPCpfXs5EhriZw9URnABD+hC9zzgymuAPY0go6KOQBdiBzaZsyzaW7pEFFw/kNRrA21/z8ESrC/bU9bCLQikY5+tZhEakdq0/FuGuUskm6X1btKIJtKsiemmFWWqqbYPF3ttRRDPvoHqP0e X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(5660300002)(508600001)(66476007)(6916009)(26005)(36756003)(2616005)(66946007)(186003)(54906003)(316002)(8676002)(31696002)(86362001)(66556008)(8936002)(6486002)(4326008)(2906002)(6512007)(6506007)(31686004)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?0bIY5Zh6gHF3MM23/KfD3wFOlmP7?= =?utf-8?q?6lYddFGl4nWJHbbSabYJfPdHE6GGgQGjBE0HYHxFwBXxSdW5Jo04/JwbdWBWoDcit?= =?utf-8?q?KfYlUEDv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pzKYRJX/+hUN8W1II3FTBmPKLkqg7emhjUK6zMkwEg7ykmPdCUg9Gp3aQh3gyM?= =?utf-8?q?+YOjo4thzo+bKlLE3GUA84QrCuMByizHbalv8iLeNLQUF0PR/lqclyK4YeQa71kER?= =?utf-8?q?vU+ukHajUxSAKdz4Gqh3wxrEqsgB3V95x6kFKt5JCzAsO0g6GtvB3ZKY6K1RbrbAr?= =?utf-8?q?Ypg0jbSmTNiC7/EGwK+OOAzO4/Lx2qXaNjBwwJtbFQ9kV0VsGoFSoWwtUqijqVbd3?= =?utf-8?q?eR1SLdqpGeg0S79RdIoHr4tyxVykiFoWvVurKugebXE8J0pOjRLxk/2mLfC1PabjB?= =?utf-8?q?AP4N0rAKYzRhylGHcI9npl51GciPaE2eHJjL8/DmqaB5BpmSmFPpDetGM7eIuLz6G?= =?utf-8?q?wKk5sFY33HqoHm6bleqY1FUWsu/sEWWkyUTUfphvqxN+Inymia/zeIVREEcSnRt7R?= =?utf-8?q?pM4b+XYQ1CsrCYEdsxPFkd2GLbn8dP/0bdnuA7y5hDktZTlktjJ5Rcb73TkjuyA0F?= =?utf-8?q?cyt0RbTjqHNm8hWJl+hDAZXCqNuM7rdjSP3UcCXFt27F8c3/VQ0/sva/k7cSgMuR+?= =?utf-8?q?Jn+ccVqXT8aKt9B+ZcnxpXS3whNX3CKMjVY3GPpHsgxG+OpUvBin5MraVFtIebasx?= =?utf-8?q?Gd3CSta96xPReomDnRZCzo+a9UlXPtCbEmf0G7qeMhEoHargArEXndMULi8AXxzI4?= =?utf-8?q?5U8wQS8P/nKR7/YnHTIAzuD3pVJ+th/A=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: efc601af-a35c-4b40-466a-08da12fbd363 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:50:02.1748 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BKzQJXXLNLYMhdzrvC3bLnKcWKvUpeTDLHuAqcGV1MzaO4HPxIB3W1RsuzMHxWOYsQtJV/gMQa50nvqc/bn1QQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9650 Replace (mainly) MOV forms with shorter insns (or sequences thereof). Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- Of course there's more room for improvement. For example there look to be a number of LEAs which really could be MOVs. --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -121,8 +121,7 @@ mopar_gr: movw %ax, _param(PARAM_LFB_WIDTH) movw 20(%di), %ax movw %ax, _param(PARAM_LFB_HEIGHT) - movb 25(%di), %al - movb $0, %ah + movzbw 25(%di), %ax movw %ax, _param(PARAM_LFB_DEPTH) movl 40(%di), %eax movl %eax, _param(PARAM_LFB_BASE) @@ -135,8 +134,7 @@ mopar_gr: # get video mem size leaw vesa_glob_info, %di - xorl %eax, %eax - movw 18(%di), %ax + movzwl 18(%di), %eax movl %eax, _param(PARAM_LFB_SIZE) # store mode capabilities @@ -144,14 +142,11 @@ mopar_gr: movl %eax, _param(PARAM_CAPABILITIES) # switching the DAC to 8-bit is for <= 8 bpp only - movw _param(PARAM_LFB_DEPTH), %ax - cmpw $8, %ax + cmpw $8, _param(PARAM_LFB_DEPTH) jg dac_done # get DAC switching capability - xorl %eax, %eax - movb 10(%di), %al - testb $1, %al + testb $1, 10(%di) jz dac_set # attempt to switch DAC to 8-bit @@ -164,17 +159,17 @@ mopar_gr: dac_set: # set color size to DAC size - movb bootsym(dac_size), %al + movzbw bootsym(dac_size), %ax movb %al, _param(PARAM_LFB_COLORS+0) movb %al, _param(PARAM_LFB_COLORS+2) movb %al, _param(PARAM_LFB_COLORS+4) movb %al, _param(PARAM_LFB_COLORS+6) # set color offsets to 0 - movb $0, _param(PARAM_LFB_COLORS+1) - movb $0, _param(PARAM_LFB_COLORS+3) - movb $0, _param(PARAM_LFB_COLORS+5) - movb $0, _param(PARAM_LFB_COLORS+7) + movb %ah, _param(PARAM_LFB_COLORS+1) + movb %ah, _param(PARAM_LFB_COLORS+3) + movb %ah, _param(PARAM_LFB_COLORS+5) + movb %ah, _param(PARAM_LFB_COLORS+7) dac_done: # get protected mode interface information @@ -504,7 +499,8 @@ setvesabysize: call mode_table leaw modelist,%si 1: add $8,%si - cmpw $ASK_VGA,-8(%si) # End? + movw -8(%si),%bx + cmpw $ASK_VGA,%bx # End? je setbad movw -6(%si),%ax cmpw %ax,bootsym(vesa_size)+0 @@ -515,9 +511,7 @@ setvesabysize: movw -2(%si),%ax cmpw %ax,bootsym(vesa_size)+4 jne 1b - movw -8(%si),%ax - movw %ax,%bx - movw %ax,bootsym(boot_vid_mode) + movw %bx,bootsym(boot_vid_mode) jmp check_vesa # Table of routines for setting of the special modes. @@ -773,8 +767,7 @@ vesa2: pushw %cx movw %bx, 2(%di) movw 0x14(%di), %bx # Height movw %bx, 4(%di) - xorw %bx, %bx - movb 0x19(%di), %bl # Depth + movzbw 0x19(%di), %bx # Depth movw %bx, 6(%di) addw $8, %di # The mode is valid. Store it. @@ -901,8 +894,7 @@ gettime: movb %dh, %al # %dh contains the seconds andb $0x0f, %al movb %dh, %ah - movb $0x04, %cl - shrb %cl, %ah + shrb $4, %ah aad popw %cx ret @@ -959,8 +951,8 @@ store_edid: .Lforce_edid: movw $0x4f15, %ax # do VBE/DDC movw $0x01, %bx - movw $0x00, %cx - movw $0x00, %dx + xorw %cx, %cx + xorw %dx, %dx movw $bootsym(boot_edid_info), %di int $0x10 From patchwork Thu Mar 31 09:50:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796962 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 B654FC433EF for ; Thu, 31 Mar 2022 09:50:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296860.505472 (Exim 4.92) (envelope-from ) id 1nZrRm-0008PP-HV; Thu, 31 Mar 2022 09:50:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296860.505472; Thu, 31 Mar 2022 09:50:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrRm-0008PI-ET; Thu, 31 Mar 2022 09:50:30 +0000 Received: by outflank-mailman (input) for mailman id 296860; Thu, 31 Mar 2022 09:50:28 +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 1nZrRk-0006u5-Kp for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:50:28 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fe6241e3-b0d7-11ec-a405-831a346695d4; Thu, 31 Mar 2022 11:50:27 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2104.outbound.protection.outlook.com [104.47.17.104]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-9-JmfEzXE7Nzqk5lDZDet1DA-1; Thu, 31 Mar 2022 11:50:25 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by AS4PR04MB9650.eurprd04.prod.outlook.com (2603:10a6:20b:4cd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.22; Thu, 31 Mar 2022 09:50:23 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:50:23 +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: fe6241e3-b0d7-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648720227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fb7K4sY64D9J9sN6DhUdaWAIhUcQkX9yK1qzj7M9L8g=; b=Tfdlg0NRhiQKRxaNrdJu3fmKdo3DFNunPxHF+DXkmEZA3mqyT88CSZkmx+38KjaAtHLzIk 4gEVv6CZQ4EO+ZmP4qrAp2eK8hqpKSw+FoGmtG1VAb5Cdelz9LfXqpYjJxu5WgCjLz5qJC 5Si2ja8RG0zEo9vEZsuLHRvW5Jf8prU= X-MC-Unique: JmfEzXE7Nzqk5lDZDet1DA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g39uerfTZViCOSLz6tP14DhRz5jlE+hdNkDMHBhcy2xDEcPB8KlnE/XzL8PseLGBkGpLv3Bg3Zqya2a3v+P29RqJcJBbQ5gNkfnlGM5ks4bmSU/Q27N2f9P/8NuB2394ItYeCRq5GnySBQstpel+z4xjoEHaXKvyuCgQCx/OO2Kz2mguB09zgD31CWIZbfFhoXnG0laf6jCvgXivum4Qj3MK5gKIkVpVUZfmkt+CnbhjqVJ89knpauLDiTqrCUU6DBuQAHVrAJtUy8Mka9YUcQ2VBvrOIHmQ9zBK2J9zKF8oGlLvshD1eqKLF/w62lLbPvTV/FFj/In9Knjk6SptPg== 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=Fb7K4sY64D9J9sN6DhUdaWAIhUcQkX9yK1qzj7M9L8g=; b=I8cWiW3JEmt2My8XkAJA4YPPxrN6+Du4gDpW7e/vQT1yUMJBNl8qQLjxs4Rja2KJLn6Grc/BIVHbHpo77roMGSB0llbxjsaEW0usn5PumubPJhk5xu/YXFWKqpp7wCIh6EEcCPwGlrAqAX2L3ly7Rb/j2Nyx3K7W1w87L1vAT7hnRANWMSe6iegl3EGODvLqICDVoLn9fNHTM42Smj9aH7T+gnYmfuiFfFfqGbHORGEsRh1JQ6EflzzXWZQUnuaHedtbb+eXLTDQGloRXaTTEIni1faW/LgdCzGZh202MSB5aLtxRXEdEDHIenTFO2vTa9THXOGh5e2hWJRdZPj1wA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <48666252-a448-9c17-cacf-2788fe1a3c17@suse.com> Date: Thu, 31 Mar 2022 11:50:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 7/8] x86/boot: LEA -> MOV in video handling code Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AM6P192CA0070.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::47) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4a382e7-2e40-463a-81d4-08da12fbe067 X-MS-TrafficTypeDiagnostic: AS4PR04MB9650:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ndXqZvFoKFEKXFZVnCZfF31/dxoR1W/8g1Br4T34gEMr0vran/2qE61Gfm9dRzQa9BQw/L3bSMzWoJANlaZoszQOVN9YcYkLYcvuTIKZfvJAf/pLeVkieLTO1l1mtTvrQlWMr0ofkjiqTUqtLSHexGNRmcFWmeUwpLroTHEkfUsayUdMy+FtYSkl6zRDWl9IcvjH3t6JYv8d9DKuCXEFlAlvM+mbrlM4gPLvS2maAGtdQXMqiHo3btaQPeJIOnaE6uZU9KEqK+w9JuLL+j1Pr/LbeBdqSFhFNZC6bSqEMkwL09QRE0jOdp6WbZBQs8KuW05j1TsNTRI0nx1S6eHiqpA8ZsdNHQV229dM//Xa2F+RPCBoib924xI0rZv4i7t7FGOnu3PZX8PT9jneUJpx68kO9WzdPCH+8Zlf+Vb0IoFrPOeaTY0Bn99tsSPOG6x5jkjimcZF/MLGEDQH/EKgEhiB6WTLwpV0+VcDIkyZa2Jj+rojFP4NeU4mVa0tDtVtZAdMwJSL+NuujNk29WKOOBKkQvIdzkOOF4H3G6+g00X7bZPb1bNWPTabqJcIbtnc89QfqqApXz/w9IgWLi6VH43BzfDLPnjQy8bgOACjMKxy1jhrNvnuR5PWQcS5MXLrP0Xm30vIlrr7InFnrJsj9w70ayC8WDmL83mc7iUqc+Y4M2/PmLtq5Y25JixQsrfDwFEJjC94p4x62SZr/HhbloY/N7QaEN/lrvnFYdcF8VE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(5660300002)(508600001)(66476007)(6916009)(26005)(36756003)(2616005)(66946007)(186003)(54906003)(316002)(8676002)(31696002)(86362001)(66556008)(8936002)(6486002)(4326008)(2906002)(6512007)(6506007)(31686004)(38100700002)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DPQBjCe7rBVdf5p+OYjK9Sm/aAnQ?= =?utf-8?q?XYlXqqZgdB6IYlQ89KgtdZAwnc1vk52voijPksjYdWOANhaq3WuIH+dD0kGKTd3MU?= =?utf-8?q?SEGVqfr6cu5BFNniuNIWjG09lSDMbX863UMBtEreD0vi7JUq6chNiE+8AMP0elMJ6?= =?utf-8?q?0ojusgFGVLaQccHtpdBYaY8RPg1cp0e4JtErWzJlQ0g/C8xh9XuyU6+w12jhiTAdc?= =?utf-8?q?V5meJodgWuwvUYsKvRj8PnfX02JfgEwkiWIyZDCv+xzwuHLBBfJGWS/omxmgMWucZ?= =?utf-8?q?kcpZT5TR9qEiKd9LsLi1iyM/PAujmvN6T8fXz3LpwE5HB4pqQrcWxvtMObVcvtIA+?= =?utf-8?q?WoiD8hoT4vqq+RpDw3UpBf/P6wIiE0zUrs9H8gY6VUGHMa6zmCaTgMLKm9Us2ILNX?= =?utf-8?q?UBx318ewwSlMxpqLHIXAE5lN3Lef58pTB50fDUa73vTgvQ6ZS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=?utf-8?q?cKaGaBAplYS2yOHA9jJ6cKlZMT5dddukPkVmngGNVPraCbicLIvYG4+cuZdkWjwRr?= =?utf-8?q?3ng3GPe4cQbdwQa2IJxJejtj33uqE1n+OJ/r99A/ThYrkqMO0tlRWvqZ0XJAJ+nvh?= =?utf-8?q?5RtfzxWB4IUkUaVq8BMlBFW7BO5NSsXew6r8/vOKdQRgmaKoAXKScK8BhY4dO+9ey?= =?utf-8?q?D69WjeQnAatPOabVWrEyV/ZvFEqZRnmIRD07icdyUU94OTsjRdr6AtZwgGdco8Ef0?= =?utf-8?q?kaqTTwZH/I/pV5gaQkKJBEIrLhst9j7JRuxbCC20z+CNjv204do9J2RNrx3koeG/x?= =?utf-8?q?GftpRCLfLk93nRkhc2kV3Xtowf+HRgqw=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4a382e7-2e40-463a-81d4-08da12fbe067 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:50:23.8411 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iBpu9gf0yvNU54SvTOiJRfWsZvFHcPeiQF36/CvmmGhWaGf/+B0jWOKtleyVf6bCRSc4CICPq8BclmkpGG7OpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9650 Replace most LEA instances with (one byte shorter) MOV. Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- v4: New. --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -60,7 +60,7 @@ video: xorw %ax, %ax call mode_set # Set the mode jc vid1 - leaw bootsym(badmdt), %si # Invalid mode ID + movw $bootsym(badmdt), %si # Invalid mode ID call prtstr vid2: call mode_menu vid1: call store_edid @@ -113,7 +113,7 @@ mopar2: movb %al, _param(PARAM_VIDEO_ # Fetching of VESA frame buffer parameters mopar_gr: - leaw vesa_mode_info, %di + movw $vesa_mode_info, %di movb $0x23, _param(PARAM_HAVE_VGA) movw 16(%di), %ax movw %ax, _param(PARAM_LFB_LINELENGTH) @@ -133,7 +133,7 @@ mopar_gr: movw %ax, _param(PARAM_VESA_ATTRIB) # get video mem size - leaw vesa_glob_info, %di + movw $vesa_glob_info, %di movzwl 18(%di), %eax movl %eax, _param(PARAM_LFB_SIZE) @@ -189,7 +189,7 @@ no_pm: pushw %ds # The video mode menu mode_menu: - leaw bootsym(keymsg), %si # "Return/Space/Timeout" message + movw $bootsym(keymsg), %si # "Return/Space/Timeout" message call prtstr call flush nokey: call getkt @@ -206,22 +206,22 @@ nokey: call getkt defmd1: ret # No mode chosen? Default 80x25 listm: call mode_table # List mode table -listm0: leaw bootsym(name_bann), %si # Print adapter name +listm0: movw $bootsym(name_bann), %si # Print adapter name call prtstr movw bootsym(card_name), %si orw %si, %si jnz an2 - leaw bootsym(vga_name), %si + movw $bootsym(vga_name), %si jmp an1 an2: call prtstr - leaw bootsym(svga_name), %si + movw $bootsym(svga_name), %si an1: call prtstr - leaw bootsym(listhdr), %si # Table header + movw $bootsym(listhdr), %si # Table header call prtstr movb $0x30, %dl # DL holds mode number - leaw modelist, %si + movw $modelist, %si lm1: cmpw $ASK_VGA, (%si) # End? jz lm2 @@ -240,7 +240,7 @@ lm1: cmpw $ASK_VGA, (%si) testb $0xff,(%si) jnz 1f push %si - leaw bootsym(textmode), %si + movw $bootsym(textmode), %si call prtstr pop %si lodsw @@ -257,7 +257,7 @@ lm1: cmpw $ASK_VGA, (%si) cmpb $'z'+1, %dl jnz skip_bail - leaw bootsym(menu_bail_msg), %si + movw $bootsym(menu_bail_msg), %si call prtstr jmp lm2 @@ -266,13 +266,13 @@ skip_bail: jnz skip_pause push %si push %dx - leaw bootsym(menu_more_msg), %si # '' + movw $bootsym(menu_more_msg), %si # '' call prtstr call flush 1: call getkey cmpb $0x20, %al # SPACE ? jne 1b # yes - manual mode selection - leaw bootsym(crlft), %si + movw $bootsym(crlft), %si call prtstr pop %dx pop %si @@ -283,9 +283,9 @@ skip_pause: movb $'a', %dl jmp lm1 -lm2: leaw bootsym(prompt), %si # Mode prompt +lm2: movw $bootsym(prompt), %si # Mode prompt call prtstr - leaw bootsym(edit_buf), %di # Editor buffer + movw $bootsym(edit_buf), %di # Editor buffer lm3: call getkey cmpb $0x0d, %al # Enter? jz lment @@ -315,9 +315,9 @@ lmbs: cmpw $bootsym(edit_buf), %di jmp lm3 lment: movb $0, (%di) - leaw bootsym(crlft), %si + movw $bootsym(crlft), %si call prtstr - leaw bootsym(edit_buf), %si + movw $bootsym(edit_buf), %si cmpb $0, (%si) # Empty string = default mode jz lmdef @@ -373,7 +373,7 @@ mnusel: lodsb lmuse: call mode_set jc lmdef -lmbad: leaw bootsym(unknt), %si +lmbad: movw $bootsym(unknt), %si call prtstr jmp mode_menu lmdef: ret @@ -424,13 +424,13 @@ setmenu: jmp mode_set check_vesa: - leaw vesa_glob_info, %di + movw $vesa_glob_info, %di movw $0x4f00, %ax int $0x10 cmpw $0x004f, %ax jnz setbad - leaw vesa_mode_info, %di # Get mode information structure + movw $vesa_mode_info, %di # Get mode information structure leaw -VIDEO_FIRST_VESA(%bx), %cx movw $0x4f01, %ax int $0x10 @@ -497,7 +497,7 @@ inidx: outb %al, %dx setvesabysize: call mode_table - leaw modelist,%si + movw $modelist,%si 1: add $8,%si movw -8(%si),%bx cmpw $ASK_VGA,%bx # End? @@ -656,8 +656,8 @@ mode_table: orw %di, %di jnz mtab1 - leaw modelist, %di # Store standard modes: - leaw bootsym(vga_modes), %si # All modes for std VGA + movw $modelist, %di # Store standard modes: + movw $bootsym(vga_modes), %si # All modes for std VGA movw $vga_modes_end-vga_modes, %cx rep movsb @@ -665,7 +665,7 @@ mode_table: movw $ASK_VGA, (%di) # End marker movw %di, bootsym(mt_end) -mtab1: leaw modelist, %si # SI=mode list, DI=list end +mtab1: movw $modelist, %si # SI=mode list, DI=list end ret0: ret # Modes usable on all standard VGAs @@ -681,7 +681,7 @@ vga_modes_end: # If the current mode is a VESA graphics one, obtain its parameters. set_current: - leaw vesa_glob_info, %di + movw $vesa_glob_info, %di movw $0x4f00, %ax int $0x10 cmpw $0x004f, %ax @@ -692,7 +692,7 @@ set_current: cmpw $0x004f, %ax jne .Lsetc_done - leaw vesa_mode_info, %di # Get mode information structure + movw $vesa_mode_info, %di # Get mode information structure movw %bx, %cx movw $0x4f01, %ax int $0x10 @@ -715,7 +715,7 @@ set_current: # Detect VESA modes. vesa_modes: movw %di, %bp # BP=original mode table end - leaw vesa_glob_info, %di + movw $vesa_glob_info, %di movw $0x4f00, %ax # VESA Get card info call int $0x10 movw %di, %si @@ -772,7 +772,7 @@ vesa2: pushw %cx addw $8, %di # The mode is valid. Store it. vesan: loop vesa1 # Next mode. Limit exceeded => error -vesae: leaw bootsym(vesaer), %si +vesae: movw $bootsym(vesaer), %si call prtstr movw %bp, %di # Discard already found modes. vesar: popw %gs @@ -917,7 +917,7 @@ store_edid: cmpb $1, %al # EDID disabled on cmdline (edid=no)? je .Lno_edid - leaw vesa_glob_info, %di + movw $vesa_glob_info, %di movw $0x4f00, %ax int $0x10 cmpw $0x004f, %ax From patchwork Thu Mar 31 09:51:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12796963 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 08242C433F5 for ; Thu, 31 Mar 2022 09:51:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.296865.505482 (Exim 4.92) (envelope-from ) id 1nZrSP-0000dw-S1; Thu, 31 Mar 2022 09:51:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 296865.505482; Thu, 31 Mar 2022 09:51:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nZrSP-0000dp-Oi; Thu, 31 Mar 2022 09:51:09 +0000 Received: by outflank-mailman (input) for mailman id 296865; Thu, 31 Mar 2022 09:51:09 +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 1nZrSP-0007le-3q for xen-devel@lists.xenproject.org; Thu, 31 Mar 2022 09:51:09 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 16caed53-b0d8-11ec-8fbc-03012f2f19d4; Thu, 31 Mar 2022 11:51:08 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2106.outbound.protection.outlook.com [104.47.18.106]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-19-msc2Wdd7Oge5_8QbrcETMg-1; Thu, 31 Mar 2022 11:51:05 +0200 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by VI1PR04MB3264.eurprd04.prod.outlook.com (2603:10a6:802:11::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.16; Thu, 31 Mar 2022 09:51:04 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::914d:e08d:7798:8476%7]) with mapi id 15.20.5123.021; Thu, 31 Mar 2022 09:51:04 +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: 16caed53-b0d8-11ec-8fbc-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1648720268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KNU533Nas71KGaxkrjt8Y4qhfH0SyWRPA/lY3YgjMd0=; b=KF6ZgxS+cdxy+UEJJ31sOomnvaqF12AcerVo364qI9ehwhuDq3CvdvfM9UYWK74Qc9Gd6g R5bxIcDl7hjm7+XTu2c2dk6GO5PLDpV+Lywow3WoQd7CBPTEp6IUiZDnPDHfFrEME0SD5O iyxTPraBbHSICrT86FI1kaEBTxX3hNA= X-MC-Unique: msc2Wdd7Oge5_8QbrcETMg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iS4xA51Q/g66xdp9hQ9OYXU5ngFKeEzexBsTmf43SiSXGzW7SnmdmqKPz4ZwbY+ikTN64YWHw2B7jm2XkDSK+msXd9Ks9emlMD7BA3avfw7wG4CQdem8QQNcWGaSK9/eaborh0pevWUHUcyTUQ7rVRxmsEBTxipSSzw1Oy/+xg8YWoeEUubBgYMOP4fTmmkwsGuzfttKQPq8irV+8nZtVFRy+kHRAp1RfZ6uv8FzNEh4neWtaFB2YTMzVPSsTZgs80TxuMFUkCGUFseqN0DQTw0ELi9NYHQAI7iBcWhYcAOaXRVLNB3RbenQfH72p4gFMHFPVg+4W1V+W27RsEYucg== 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=KNU533Nas71KGaxkrjt8Y4qhfH0SyWRPA/lY3YgjMd0=; b=dgPc21xsJR4LFSzLJz7DVn/d+Ft+NR0sB8piw2DqABRaMB39ZSVw/ReQy5vCKoE/o0VTMAd5ZwSarQEccJaHbjs43X5PvClzKZ/grF9bIVuqqevEm4QDJacGwb5WODQJLM40FCxjsqae7tlyopPChJ/V+9fqkZ+Mrg4XsPmVHyTyrY3lLPnRUH7H2xdvKsN+kiEiX7ISdOvBUJ4KLc05NF+AJrNxX+LSGEH6+lYNWdSvhi3v2/Ym3zVcVcKyeNu8mBnRq0NTNT8/5Qvnf39uC3jaP8eEVFy+f9Iq5cmPnEfeFxCiXVUMJ5nAmGzslD90vrcyRh6TL6vG1KPLdDgJKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <294639f0-d959-59b4-b3db-78451d5acd9c@suse.com> Date: Thu, 31 Mar 2022 11:51:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH v4 8/8] x86/boot: fold two MOVs into an ADD Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> In-Reply-To: <819eb552-d49d-e98a-9524-8d30c1b93908@suse.com> X-ClientProxiedBy: AM5PR1001CA0033.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::46) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 582759d4-d117-4731-fac8-08da12fbf87b X-MS-TrafficTypeDiagnostic: VI1PR04MB3264:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UJjy2bW6y2cqgSk4boAj0awY/3NID1albUqJeBsbTs+6dYICUi/vHJFjlhNr90SguuxPCE0XF/wQpCbVIM3KhOmhjUOrN8CWJNrSiPFf839Sr4mvHedytSdHZ0/2oCi2O0OIVbhi/5OoEE5L1WbBAioneJt9EpQtSm8zipeIAcgQPJnN+ZN5KD/pXw1/jlBQtAbWkJpNjgIQyo83d3MsydnY1uG1aUZ424A8ur1DmwwB4a0OkX+7F3knRTvXiLd5isWjZfM6vlwQjpO2xuZ4M97cz9IjzJUVu0wruYj1BFQH1IzhCaCGhFpwOt+ap6zNK+3zz1ub/WC/WUZPhg3IFCndio78ySXjtI9lxA7LZuQGu9XcdDqXlYNGO9ZB2UREFO1KdpGNtzfRA3WXOpDaMnurzclNyz8LB4egJsVmUv+udr7WB6ouJM5CEnAUKBTDXgQG3TWi+qoxnqDY+tF4sg4bQAeVBzBinG3N/r5F74ofQE5oPYeW2s/SlASc3kpg9pEJynPoZpXstnLgWLefj5xv+EcomR3S4eKYEvg6KAoyyHFUJW5JaQH7VcNQjkipPzRMp2WuKoVb0sxOIdfXnzqzwG4SM1ZM75A11e7hGiMIVT/1UgZPiM+yJa8wmtrffr0DAKlZtZ8oMm5I37FKQCIXjhbzydoeC/H8Apt4XSD5gw4NMYsr1XY3nHWKLOfPa5YBjc0VgyGSY6vTqALYiyLgsVnz7ATIrWN1U6y55Ow= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(31696002)(54906003)(6506007)(2906002)(86362001)(4326008)(8676002)(66476007)(66556008)(66946007)(508600001)(6512007)(6916009)(31686004)(36756003)(316002)(6486002)(2616005)(38100700002)(186003)(26005)(4744005)(8936002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?pjj36zxt8wJTwcUkN3pXSh+Dlqno?= =?utf-8?q?AQa2FR29MFF1XC+04ZRaWKUDTpK7TKhA+XYxUzg8jc6NblyWLsg6z7XjkXD8w/iqi?= =?utf-8?q?7UqJC47lWXa0NvIXLQRou5yWoKM469QJlav4QipZtX125Z3rncHW/S1DpWa+u7Tsg?= =?utf-8?q?i5/H1aquQpAl9FPlVwJ8FcZyUC/XB6NPrWOZktH8jB8yYuVC9RV7gefHLYlyrMsiF?= =?utf-8?q?4XmIP8k8DqMlv9qdfWk4WIacVULwvvsqK8Bpkz8fgsaHj0sWuMkDa2+nP/HEgIsRI?= =?utf-8?q?HcdNtRT9XLY7bVLDCOmmmTpRk0Lek5D03Ye9aJGwpdHw6geTTYuoDYRaDLMBduVvP?= =?utf-8?q?TcyQgJeap4PA3KfG+u8A/RqnWyS6mmbBkG6rM2+MXaTbW9u39prG/wimdxvSL/V65?= =?utf-8?q?Vma8pWaKtueHN9/GobZ42Ky8Q1xpUtyYt/VkqyGiJL1DnlK70TDnd7hBidVI6sWGD?= =?utf-8?q?cjKAGeDUmt63V+KuvqJIwjAvTANC68g3b4BIXb1KzQ1EJPNP+6ouLJGNzj/L4gyjK?= =?utf-8?q?t9EI8IT/hjGfwhbdoszF+urwfaDuMoUbm7VFKy9Rql9rthMr4pzJodn3jRx4LTWSP?= =?utf-8?q?mEIidIdm2IlDK+s1yOpfWCmmU4BblUW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3xA0W2tkn0veQEsM3mqPHmLFUG95KAuYi9?= =?utf-8?q?NGd91rA7ABS50nPc6DGb4vxlxHSXNUTSGVkJRUYtSao5lYlVX2Wb6fzoBwPo7g0sF?= =?utf-8?q?82LKziNQ2ubqfPYmDboRK5UNM56gQuA9lNWwx8xWG+pHvYJ/nu+0YQUgiwtW76T97?= =?utf-8?q?mIIEe69mE3pWVOSUqUcKFbjvoVb8IlWg=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 582759d4-d117-4731-fac8-08da12fbf87b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 09:51:04.2874 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LhdWRiJg/t8CgflyBBmlQYCIyLWamVcIYDP2ND/1obgX6MzbsbU7PrCakvrhfst8Ht2efA/D12YPxgGIiV+DxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3264 There's no point going through %ax; the addition can be done directly in %di. Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné --- v2: New. --- a/xen/arch/x86/boot/mem.S +++ b/xen/arch/x86/boot/mem.S @@ -24,9 +24,7 @@ get_memory_map: cmpw $E820_BIOS_MAX, bootsym(bios_e820nr) # up to this many entries jae .Ldone - movw %di,%ax - addw $20,%ax - movw %ax,%di + addw $20,%di testl %ebx,%ebx # check to see if jnz 1b # %ebx is set to EOF