From nobody Fri Nov 29 17:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631712277; cv=pass; d=zohomail.com; s=zohoarc; b=geYr2CDUV5uXPzBaq9zR5bMmELFtJDbdyUnEWZ/+9h26afzINhXKZQIIvy/E/C6LlocETla+y5Z4gF+J+UKO8Axf14YILM+my6smIszwlEOUEVsP6il8H7IVYzVje7M/OKx2KvTGgFauIIV0jm2oGR4v6TFjHEA1Hfs+nwbV0xk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631712277; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vmvh23AF/QYwECie+A4cxpmvY3OAqvVGprF/crpbyog=; b=HgA+KtagZzZjjCD4EqkpbJqEveMo7bFLTHFsvgMIcg5HZdNxZTA5rQn/Ca33GQIXRMpJNt7KjZcjaeFr9hH/scIwVei47PcF+cSFBa8VNrrprSTsXQHwXQoMh29fJcayB032JzrvkQpwT2kWm+E8FHQBvdy4w8rrONH14w2UftE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631712277721311.4526033029621; Wed, 15 Sep 2021 06:24:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187598.336523 (Exim 4.92) (envelope-from ) id 1mQUtk-00068P-4K; Wed, 15 Sep 2021 13:24:24 +0000 Received: by outflank-mailman (output) from mailman id 187598.336523; Wed, 15 Sep 2021 13:24:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUtk-00068G-1B; Wed, 15 Sep 2021 13:24:24 +0000 Received: by outflank-mailman (input) for mailman id 187598; Wed, 15 Sep 2021 13:24:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUti-000684-Fg for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 13:24:22 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7a26eb15-bc4d-4ce0-9cc3-917bcdf9bc33; Wed, 15 Sep 2021 13:24:21 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2170.outbound.protection.outlook.com [104.47.17.170]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-25-_7mfDszgOBmVqh1jW8B5GA-1; Wed, 15 Sep 2021 15:24:19 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB4352.eurprd04.prod.outlook.com (2603:10a6:803:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Wed, 15 Sep 2021 13:24:18 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:24:18 +0000 Received: from [10.156.60.236] (37.24.206.209) by PR0P264CA0208.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 13:24:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7a26eb15-bc4d-4ce0-9cc3-917bcdf9bc33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631712260; 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=vmvh23AF/QYwECie+A4cxpmvY3OAqvVGprF/crpbyog=; b=DFrZWHNZtWLHQmtRtbEfKw+tHB3oXI0npL0gKD1OFwttXWyD6JyY7gNG6IZYlhKcppFj3c OvO9Eyh4Zpr8Ud1LYk71p2O3dBMYUoh0Bo4sSa3ejxwav6TMx6drNv7qR7bGI1r4c7f9jd DzOu1wVs5EgJEjPsiMM6oOiWt3A+Dqk= X-MC-Unique: _7mfDszgOBmVqh1jW8B5GA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ih1x9nB/MQE09L7Z/FeVoxuOL969/1TEiGBcgGI2OWNqRZ9c4dGf/3UiIcLbms+tddWrio5VnVwFy65g58h481xcvfBgQcBHdConT6PbSH9rN8hrtp/sbLCTthw1lZdk36IDto8Bqfw71JAg+lnKFzff1fRgCQF+XZ2Qp+c5JzMa1ZGwh8VhFN26m4TCfbUlg5O/ic0ZakuGkeQ+2ChZLde0MofFtJEo+/CCybtVIjCg9wzC+E8RoMhKBPUws9g8204aOVdQEXb1g/LYBASEUe9gnVk/yI06YuglsuO6Y7fG5mR9kS+C8B2ZOdUc6uZGrE1OHUzK3aWpGI8VcJYdug== 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; bh=vmvh23AF/QYwECie+A4cxpmvY3OAqvVGprF/crpbyog=; b=fAD8aYqNM8+WWnZWDcW9ZCBnDgwjUcCpvwP9m2wCkxswEABZJWgLHaoh/UjCuRzbyaYg0/rDBFlAXIVK/Fak1+t1Npdkb62LsGbsfg9Gyb7TZoYQnc53/OUid8Qa9Ea2q3+GAHFKDyoKJKYLjGH7TGT6dqXK25DEAwmtZteWYZKkD5bcJlCF8XL5fxJwBd6IGTmJEuZOFnCtUfe6jnPjNMTkCZQZkBPlZam5mn/1fkN/W6LyxOJ8e4emdvT5R1/JKNteA9mcgrqo70gL0Z45amJg1pM8kllhe2oNyWPfDvRaL0lDChJFFkt3oJMOGjmelEhlemvoR/raJkt3w8c/jA== 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: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH v2 1/7] x86/boot: make "vga=current" work with graphics modes From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Message-ID: <126bf1d2-64dc-ba0d-8133-27f29c942b0b@suse.com> Date: Wed, 15 Sep 2021 15:24:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PR0P264CA0208.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::28) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6496a335-2fe3-4390-ebd3-08d9784c1f06 X-MS-TrafficTypeDiagnostic: VI1PR04MB4352: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L7U4ZEBb903AOkmC2oHkfqAmh2jS2FaoxJPsRsnnxN4tKvPol1vmUm7LlZ+JGP9nA5SfBROBakKxU1dWxWnLrllx6t+gyjw36Cr2n2QGP8D2l9TT/o+8LjMV73Tqtd7cNbzxpsVhG/2mrjUQmnKlOWsbcqTjJ2EH5fp9py6qUMEEL75oaHk9GuSMYr3IEJlfL/13OXJR12RCLvraHS3xVbU4gf3I6sCB/zuhnVJZk8ZlPVj5DCZ9iUD0ZlnSEeAFo1TcPOYQI2KBt2dXzCZybYg+OIE3zARqKz7pVu7klefOyCqwNQ6xPnhdwHpzh38bSIVPIefWnVYB8ARFvXS0JCeTox6y9p/Ujgq2nNP6Y48VCDTaMnWiNzMmp5I5/FEB0EX7Ucm1Vxf+N/B4kRaWwxT3ctehVbas6lhdTZVQXbKyJw7kGLbntXxrrx2AUMhgFKZydviCIy+aJ+htvbXzb1t7tNipp9yrEMZveLdL9r2N+plTDK6bOCtJSfEbSWbz9fKTW+svHavNKb2JuS7iWMQXbniZnpQ9bOwKRsnu0OsZzPcxSXOlMYNHjItP1qEa35fLb1qph40CB8vvp1W4OMaaYxTfqiw3UoOfES/8XeXZd4hCd+kDpooP2Of8lUouU/8EnjdopUK5ehNDQAnf5qdD7+MW0Zqw3j6VFKZrHucRX46L1yEvrRH1nBMIVc3rhq1tERhyT/8HY68lBPhKD+MY1Hkexnt9bgso1CqS3c8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(366004)(396003)(376002)(31696002)(316002)(4326008)(16576012)(26005)(6486002)(38100700002)(8936002)(36756003)(956004)(66946007)(54906003)(66476007)(66556008)(5660300002)(2616005)(6916009)(8676002)(2906002)(186003)(86362001)(478600001)(83380400001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eUpYSlBYSXlMWGRXRUJGUjFJSjdZeEJJMERmNVhHL3BVUTVjWm02VGdEN21n?= =?utf-8?B?WFBqK201TXdLamtrOURyNVBaZVBwdXdTcXVpOWZXTzlPS3hEVCtSSWhJdE1h?= =?utf-8?B?Q0ErOTdtQ3FyTW0xK0J2RUc1dHJGRk5oYmI3ZDJlcHdNRFFUVmdnSG9zNktS?= =?utf-8?B?TDFrb0tkUTM0RmpWelZsQ3d3NDRIV05PaHhtOXMzeHpUdlVBWS9FSndyZTBS?= =?utf-8?B?aWFKRmlZNlRKYWFjeHdkV1NkZHNKdVZ3c0QzTHhYbWpFUWc2MFN1ZGZtcDJ2?= =?utf-8?B?SGdlWkEwQ1Yveks4TTc1a1Z3WTdDQUVDQ1JYSHRkMkFCdm5nMzJiVnBROWNy?= =?utf-8?B?TWFuMWN1UFpvc2lRMzN1c05Nb1Q3ZVowclZtdWNCRTU0ajAvVHhxb21UdDJi?= =?utf-8?B?WndxOS9hUUVldW9zczhDY0xwVTZ6TmM3dmE3U1pp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khBallHdnZ1Y1kvSzU4aGZ0VzZX?= =?utf-8?B?RC96NXpxVDZUQkFCZlVvb2dFQmZIYUYrcS8zZS9ha2hXNHdyRWEzZFdHM0U0?= =?utf-8?B?dm4xM0J5Y1FuSk1YTkVVZFdEVnlLcjlSdW9VSWVTRWxWWXNMaURlZnhZNjNU?= =?utf-8?B?TU9WN2d3cFd1Vmx6MmpKWVVhTWZXODZubWZiQzlrMTNDWllOSTlkV3l5R0dp?= =?utf-8?B?T1dEa3J1Nk5OOGhSSk16U0s2Y3lDT2ZEYzROd1RjNXEyN2dXVkFrTHJUdWVL?= =?utf-8?B?MmZXZ0FoOG4wQXlTTjlPVGE0cDg2Q29ibEh0azZLTHBMVmJYMElTLzlWb0kv?= =?utf-8?B?dmgzTExadXptd0ZCY1kwamVGUlFiOTB4bnFFNFBDNkpCclZvV2R6bGlXZFBa?= =?utf-8?Q?YYrzSaE8SYoQzAprelGnOSfJ/4RuzXQy3mVzHYc?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6496a335-2fe3-4390-ebd3-08d9784c1f06 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:24:18.3870 (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: YigxjAvzhojjwbvS7sTcgbNWWxCK6ftLBN7YUr7N1CEc2ofdEufzH6ka6A0Z8mnO2EvxKjnSw2QzIsf330ouiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4352 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631712279421100001 Content-Type: text/plain; charset="utf-8" GrUB2 can be told to leave the screen in the graphics mode it has been using (or any other one), via "set gfxpayload=3Dkeep" (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=3D" 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 --- I'm not convinced boot_vid_mode really needs setting here; I'm doing so mainly because setvesabysize also does. --- 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 being a color one.) --- 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 =20 @@ -693,6 +692,39 @@ vga_modes: .word VIDEO_80x60, 0x50,0x3c,0 # 80x60 vga_modes_end: =20 +# 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=3Doriginal mode table end From nobody Fri Nov 29 17:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631712322; cv=pass; d=zohomail.com; s=zohoarc; b=k+8eTC/R1xDAlm1z9oHMW0W3lO3+XqTn9DstRHxmNz/J9MB5PgZY7OhVC233ptU8naYqxKZU5z8VFOONZDZUZZ6DRvVrea/cyqyrhWYPSFpXAAiMIEE5nXpDHXM4c8eIeGOLY5WSZSKClKvwSCayteF1n61LkYJWHGbKxQXeCu8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631712322; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lVFjmh6RimoQpMTq+9aSlOOru1h888tl/hV8Nfxcv+U=; b=QDYeY1MW3GhMmiFKbQsz4IaLCMW3tEtGRAbEW6o5bZY7BuUC0tEQe1sKn2svaAPFYhPebfZ7MA1KJAr72I5dJL0tpSTWDS/96ibTiuZQO5EOPRulMGmxMxmtOPhzW2GQAcXzPOaK2MZsdFoTvLHHmkTg6LATbjLyT0GfPcWsqiA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631712322131778.2791785125238; Wed, 15 Sep 2021 06:25:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187605.336533 (Exim 4.92) (envelope-from ) id 1mQUuP-0006iu-Dv; Wed, 15 Sep 2021 13:25:05 +0000 Received: by outflank-mailman (output) from mailman id 187605.336533; Wed, 15 Sep 2021 13:25:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUuP-0006in-Am; Wed, 15 Sep 2021 13:25:05 +0000 Received: by outflank-mailman (input) for mailman id 187605; Wed, 15 Sep 2021 13:25:03 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUuN-0006iX-Gp for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 13:25:03 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 546d14db-1628-11ec-b51b-12813bfff9fa; Wed, 15 Sep 2021 13:25:02 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2054.outbound.protection.outlook.com [104.47.13.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-15-2zwv82RQO8y2_KMNFs9QPw-1; Wed, 15 Sep 2021 15:25:00 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB4352.eurprd04.prod.outlook.com (2603:10a6:803:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Wed, 15 Sep 2021 13:24:58 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:24:58 +0000 Received: from [10.156.60.236] (37.24.206.209) by FR0P281CA0063.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.9 via Frontend Transport; Wed, 15 Sep 2021 13:24:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 546d14db-1628-11ec-b51b-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631712301; 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=lVFjmh6RimoQpMTq+9aSlOOru1h888tl/hV8Nfxcv+U=; b=UoI5eWcTEuPelH+UjG/6jBbt0/fjMQV7be6GXemrRrjeoFMMMiDmfxm4zS/q+Yo7KcdvJG O/7Q00yFsEPYnCAvgWCHFX7SUGQlhpVM26QTMoVhirx5N9T1rYIKlB0KtD/ZXOKrP/IP9H I99y5Nrx/IK+bL94b+Aqs8sDrWzQTQE= X-MC-Unique: 2zwv82RQO8y2_KMNFs9QPw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c10jtRtCSc/aamTWBhR/uKwKGjDpCtEy7tA/aT8/f0t4I7XIBZ4ccs/DnJwxcSCCu/K232fsVOXCPNizv4V3pfBfOsLgfKxrNQQkL5zv4y2K9XM4FLt15rVUgZJX56e4xO8GsIz11ZCz8ccOfqoXuC94bm4jmd5oqfl/Qq9T8lUc+dRh+Z5X927S3/bNawVXWwGNsbSRUneTvpnb9xkA4n4RJnrAWUlUVpbo6Cc4kkLzKjEm92T9jXM7MOZNBueXlxQOd74uhCmreQrUVdEJ/RLcaz2eTHsRqV8vSjcjJlLnwAfEhVXEXhCYGErVbLuQ4bZkZ2DyggX0u5wLR9ttjA== 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; bh=lVFjmh6RimoQpMTq+9aSlOOru1h888tl/hV8Nfxcv+U=; b=KPY/lMCh8V7A0Kd972Y1gL4crxtgK6JJ8bqTj4o30pRNCjI18/tH9KHpSs/RDa6+6UCX8A2y4Ou6AA07yYp/LzsiHjOfa3ig94Q0lgFDwsnQMzrfK/YLD6reW0BEcM9c+XaQimhL+7jMogxJXwkjvnqBmrn2wfA1kWZDOw8UUHqAZu3WPCV+d+ZJ3O5qV+NZiODtnTvQOh76ZKrvE2A1tkyir8K9LrkckCGzQNvE4kTAyGFMsXxbZw9NWsRMfDjyHfuKkcx3K7272vyilndVdsjWfEULHSaaqt3zg9QEa8TBcSdQOg+KRK5cvv5xzXWalMwnwW3sGPOuJTTcpYtezA== 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: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH v2 2/7] x86/boot: obtain video info from boot loader From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Message-ID: Date: Wed, 15 Sep 2021 15:24:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR0P281CA0063.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::11) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1eaf84d3-140d-415f-ff02-08d9784c3704 X-MS-TrafficTypeDiagnostic: VI1PR04MB4352: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VAZ3eqvwgtXtQl2XGV/x/51BXeOhmq7cY2CYfvlwNPfbfNRxVEupdQfDTQ+BJLLaEBVgGxiQQHCihV/0GiN51Dl6vaqCyz0R3MB6xjjZJtjrb5v53aM8j4esn3recxyH/4Y1CUhgC7XJgRuSdT2P6lBxoTNrgTfqp00pSpMQmvnvXZ4EpcEMHAyXZjulVHyJHnu0wNXl8UuRCu3O7C4oGbPIbQu8+StRykYhHX4Fk8dvD9921bQxcSVznSy8xaCuTLNKKMMhPXEdWXrKCiaTEXCR4dGWuQHXsEsXlaP8mWZZixTCS9H6BvI4UMynWhE6mAMZ+BFolDexRoGrH185bZ6xN21a7jL8IIl6bIK2vV6TLXKWKPHoyDhsXVnNsdEmbaw025s5lQ2K4UWXu9293fTUmF6uuwAJ4cD2Nfjiraj8edbiOPhtq9Dx+A1jz1bt76EKytRArFxXaWSwKfJ9VYkPzopziJUtKzhJhy6tmC0Nnb5zmIRSEcfk3UNBRSQhWl+haCYwjP6gYGL8E/SYdDeTZOx/CqIp44MMdFGhtl2FJTBhxzFfrZJzDTTm+6wMBgvLUk792SLJAZvqXEAbTcr6fxz5e+exz6X310py6oqFK6MzQ2h/MEN9Oc1jMpNJkcMo4zWSV3v3492o6pmrHDtn17il6m9c7Bwz+Wa7PT3G/KCU/v2h4bicIKiuLQCw+kfgtN8G/YC8lYeWbG+qcUZVSUP5VDPCD+u7lZTRTzA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(366004)(396003)(376002)(31696002)(316002)(4326008)(16576012)(26005)(6486002)(38100700002)(8936002)(36756003)(956004)(66946007)(54906003)(66476007)(66556008)(5660300002)(2616005)(6916009)(8676002)(2906002)(186003)(86362001)(478600001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WWlTQzU2cVZQM1VGZHdtZThtdk14OG9JM0luQWtnVnRLTWQ0MVdjUjU1Wkp0?= =?utf-8?B?RVlCb1FZdlQvdGhVaUlqNmsrdmZ3L0JGU2h3RDN1UlE0aFFDSEJlZi9ucEVY?= =?utf-8?B?QlVrSWpOYjBhcklPSWVqZFZ5M2E1akxwUHFiZVUyV280WVpUTUY2d3pBMyto?= =?utf-8?B?RjFCdHdaQ2FXRHY5TG5CM2NYVmRkTWU1SUoyczlkRjM1MHlpZXhlMzZzdHBv?=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bjRxZ0g1dXBwT1FISXNPRStu?= =?utf-8?B?MlpuN0IwOGREWVdmSUo2TGR2RitXSlFuczZPOGxxWERQTTRFYlM2S2FlaWJn?= =?utf-8?B?N2lRMUVMRVZNM3ZXVDJrRDc2UkhDSHJDdllVTnpFZi9kNXA1T0cyTVpTTUh2?= =?utf-8?B?ekdvVXJEeHYxeEtyc1liaHUzV1pDUlc5OTluYW5HOXNnei9wWFdIblgvcWMw?= =?utf-8?B?WER0aTl2M2xXQ3BCODZaaW9SYUZiUkFqQWFlYTM5b1U4U1VQYWMxZ0VtRU4r?= =?utf-8?B?M2tLbUJpLzhPZ05ybCsxV2Jta1c4bGRqS3NvQWl4NGQxVW1KWExyZWpaNGoy?= =?utf-8?B?czN3NVlVY0ppbUFPQy9Zei9oTWE1WmhzZEp1d2hzYUtkNVgzVWt2aHJRNXVo?= =?utf-8?B?NVZiRzJiQ292TkgzZ3g2SFVzUkhhOG5mSjFGSXc4QXNnU2x5Uk1pdlJBQmU2?= =?utf-8?B?Zm1LUi9Yc2FkOERETFhlb3ljUmhEQ3ZoOUtQaGovL1RtdzN2YlE1ZC95OFI4?= =?utf-8?B?YWhzTmFmWUQ2L255bU9qbk5ZYVRYTUNNOXd4K011cFpzdzRkWGR0emZaRTNB?= =?utf-8?B?b083aUFxQUpDaVRkS2F5ekJONEVZcTU5ZUh5L1dTMDN0Uk1pMG05L3d3djU4?= =?utf-8?Q?5hgq6YLTvnzREtwqjE5NjgVbXp4+MOclBvwwQpD?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1eaf84d3-140d-415f-ff02-08d9784c3704 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:24:58.6197 (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: EEXiPZt9/9HCnCrR+vSUhr+qj6BhlyWEJowYkVfON7/N+Y5gt+P657Daf40ZvgSljybZzb/vAzZJGLXredBXWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4352 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631712323815100001 Content-Type: text/plain; charset="utf-8" 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=3D", but can instead inherit the one the bootloader may have established). Signed-off-by: Jan Beulich --- v2: New. --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -4,7 +4,7 @@ DEFS_H_DEPS =3D defs.h $(BASEDIR)/include/ =20 CMDLINE_DEPS =3D $(DEFS_H_DEPS) video.h =20 -RELOC_DEPS =3D $(DEFS_H_DEPS) \ +RELOC_DEPS =3D $(DEFS_H_DEPS) video.h \ $(BASEDIR)/include/generated/autoconf.h \ $(BASEDIR)/include/xen/kconfig.h \ $(BASEDIR)/include/xen/multiboot.h \ --- 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; =20 --- 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) =20 - mov sym_esi(trampoline_phys), %ecx - /* Get bottom-most low-memory stack address. */ + mov sym_esi(trampoline_phys), %ecx add $TRAMPOLINE_SPACE,%ecx =20 +#ifdef CONFIG_VIDEO + lea sym_esi(boot_vid_info), %edx +#else + xor %edx, %edx +#endif + /* Save Multiboot / PVH info struct (after relocation) for later u= se. */ + push %edx /* Boot video info to be filled from M= B2. */ push %ecx /* Bottom-most low-memory stack addres= s. */ 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 @@ =20 /* * This entry point is entered from xen/arch/x86/boot/head.S with: - * - 0x4(%esp) =3D MAGIC, - * - 0x8(%esp) =3D INFORMATION_ADDRESS, - * - 0xc(%esp) =3D TOPMOST_LOW_MEMORY_STACK_ADDRESS. + * - 0x04(%esp) =3D MAGIC, + * - 0x08(%esp) =3D INFORMATION_ADDRESS, + * - 0x0c(%esp) =3D TOPMOST_LOW_MEMORY_STACK_ADDRESS. + * - 0x10(%esp) =3D BOOT_VIDEO_INFO_ADDRESS. */ asm ( " .text \n" @@ -32,6 +33,39 @@ asm ( #include "../../../include/xen/kconfig.h" #include =20 +#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, me= mber)) =20 @@ -146,7 +180,7 @@ static multiboot_info_t *mbi_reloc(u32 m return mbi_out; } =20 -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 =3D _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 =3D NULL; memory_map_t *mmap_dst; multiboot_info_t *mbi_out; +#ifdef CONFIG_VIDEO + struct boot_video_info *video =3D NULL; +#endif u32 ptr; unsigned int i, mod_idx =3D 0; =20 @@ -254,17 +291,64 @@ static multiboot_info_t *mbi2_reloc(u32 ++mod_idx; break; =20 +#ifdef CONFIG_VIDEO + case MULTIBOOT2_TAG_TYPE_VBE: + if ( video_out ) + { + const struct vesa_ctrl_info *ci; + const struct vesa_mode_info *mi; + + video =3D _p(video_out); + ci =3D (void *)get_mb2_data(tag, vbe, vbe_control_info); + mi =3D (void *)get_mb2_data(tag, vbe, vbe_mode_info); + + if ( ci->version >=3D 0x0200 && (mi->attrib & 0x9b) =3D=3D= 0x9b ) + { + video->capabilities =3D ci->capabilities; + video->lfb_linelength =3D mi->bytes_per_line; + video->lfb_width =3D mi->width; + video->lfb_height =3D mi->height; + video->lfb_depth =3D mi->depth; + video->lfb_base =3D mi->base; + video->lfb_size =3D ci->mem_size; + video->colors =3D mi->colors; + video->vesa_attrib =3D mi->attrib; + } + + video->vesapm.seg =3D get_mb2_data(tag, vbe, vbe_interface= _seg); + video->vesapm.off =3D get_mb2_data(tag, vbe, vbe_interface= _off); + } + break; + + case MULTIBOOT2_TAG_TYPE_FRAMEBUFFER: + if ( (get_mb2_data(tag, framebuffer, framebuffer_type) !=3D + MULTIBOOT2_FRAMEBUFFER_TYPE_RGB) ) + { + video_out =3D 0; + video =3D NULL; + } + break; +#endif /* CONFIG_VIDEO */ + case MULTIBOOT2_TAG_TYPE_END: - return mbi_out; + goto end; /* Cannot "break;" here. */ =20 default: break; } =20 + end: + +#ifdef CONFIG_VIDEO + if ( video ) + video->orig_video_isVGA =3D 0x23; +#endif + return mbi_out; } =20 -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 =3D trampoline; =20 @@ -274,7 +358,7 @@ void * __stdcall reloc(u32 magic, u32 in return mbi_reloc(in); =20 case MULTIBOOT2_BOOTLOADER_MAGIC: - return mbi2_reloc(in); + return mbi2_reloc(in, video_info); =20 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 =20 +#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 @@ -515,35 +515,7 @@ static void __init setup_max_pdx(unsigne static struct e820map __initdata boot_e820; =20 #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 =20 --- 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; =20 +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 nobody Fri Nov 29 17:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631712337; cv=pass; d=zohomail.com; s=zohoarc; b=c9TvFLkI6rZ47yYwaugL1bWXZp1axlfwlSxaSzlCSY8qex8dYIN0pZKttV8aoJFXoCUoHCB1DLAoJYcrTQTet8Du4BEo4dKahLaIxcs6cDE8VCnOM/Cg9EyZopyr/3zM2RSMVsCceexuuRPuu75w2eo+bbMneNLZooy/VZhLYgU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631712337; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/VDoYITGSl1EhuEmr7q/46YlB0q7RVPdBu0DpYzl+Hk=; b=C6Y5E/zfwfKUIBUN8uAk27pu7RmxwRFZVWfjwmQRd4ZOfWAdTUC/PhlKmUlM6v4HmdBZbV+P9xu+tPguWlw+AmqcT7mKzME9uNHZZOlsOrWY3+zv3MNNJy98vUjmSb4J++IeAoN1hw8Z3GUSaneMLL2hC6Sa5cbs9jnHX93sXog= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631712337605448.00400460257265; Wed, 15 Sep 2021 06:25:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187609.336544 (Exim 4.92) (envelope-from ) id 1mQUuh-0007Cj-Pf; Wed, 15 Sep 2021 13:25:23 +0000 Received: by outflank-mailman (output) from mailman id 187609.336544; Wed, 15 Sep 2021 13:25:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUuh-0007Cc-Md; Wed, 15 Sep 2021 13:25:23 +0000 Received: by outflank-mailman (input) for mailman id 187609; Wed, 15 Sep 2021 13:25:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUug-0007CB-Ma for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 13:25:22 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0e84f385-7855-48db-bf06-9ed834f07ee0; Wed, 15 Sep 2021 13:25:21 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2171.outbound.protection.outlook.com [104.47.17.171]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-3-SdYf92MjM0uvDqMip3mpRg-1; Wed, 15 Sep 2021 15:25:19 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB4352.eurprd04.prod.outlook.com (2603:10a6:803:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Wed, 15 Sep 2021 13:25:18 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:25:18 +0000 Received: from [10.156.60.236] (37.24.206.209) by PR3PR09CA0029.eurprd09.prod.outlook.com (2603:10a6:102:b7::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 13:25:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 0e84f385-7855-48db-bf06-9ed834f07ee0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631712320; 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=/VDoYITGSl1EhuEmr7q/46YlB0q7RVPdBu0DpYzl+Hk=; b=BRplxwogbz8hyMhlkztT6U6Vtp5q56JxWNRD+F81jGAxRtqF7dzYDEv4DDEjUFDzkJARw9 dqzu/ghqtH4uJsh4XPJ5nufc+QziurWKN0O244UbvbLKdw1VIJ6lGR2DlbCuKh9hl1ejSg kRcpXteednMemq3RqBAeOQid9fA5C1w= X-MC-Unique: SdYf92MjM0uvDqMip3mpRg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XknlVbhfh2oaVramCtNzdgetx9vQx5mr7+VHnvEFWOg3xAxu77DZOPY0QmQ3AbKgsvns850zjEKDLYBdGCibc8/IYgi1ugarE6osReFers+qyAmR1MkPhBniY+133UEn6200fvCG7F/o6TICM79M4mXOvbWokoJjy3HztRTtE/3j+s+O3f5rDfJ8+MydYSXQASeoBYADz9Y4gNcBgDvqRvb8wfOCPQIcMIRGyvWjmzauYlsvm25vLqmO+fhsKpQv12SZ9RPoXFLo2RfPUOKhGZTSdT6ZuVBuw5B1hbRk117KLP3rCzfUNZqvdhvEVSO8mrk10pw4CC2T+WTASPC0bQ== 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; bh=/VDoYITGSl1EhuEmr7q/46YlB0q7RVPdBu0DpYzl+Hk=; b=TISPcPUTZLaz8b5ZBEqpSU/i//CcYiJQgvtQ7wadY2eoke2IJQftnznnmOj446+srLm0Lq7zoUqtlnfY24Jjll9L0Y3wAnsOLstB8dDjWUz+933oVfHFtuMVdqci8gW08f3+NFqJw/Weu1r7udpfJ1Gqsy+461Sc3VRWy4QoA2p3F0h99TlCGq1Vcet8T8SHm81iOZJFuGa5QmBspon9t4yCku3AGweGXEq5ODNeY05EdyVC+IOzgz29CyyQ5OQ/yP5lkk18Wysp4yGr88P3lIpqe1PMaRDIOsRHb4FTvkcdke1SAIurOGLMgtej0VPT2fDMKlHN+KEd9zA/Df3Wzw== 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: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH v2 3/7] x86/EFI: retrieve EDID From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Message-ID: <7c06c5e8-324a-e402-680d-131693a37ce3@suse.com> Date: Wed, 15 Sep 2021 15:25:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PR3PR09CA0029.eurprd09.prod.outlook.com (2603:10a6:102:b7::34) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8aa65c14-25b9-41c6-6a3e-08d9784c42a2 X-MS-TrafficTypeDiagnostic: VI1PR04MB4352: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T+wOxeSo8FIw3phuKg+zNSc8SQUVUAVUrMjuF1SPl0IIbYB/gFpRuevISorZqnVN++HU4MMRyewpucicxLhsm7IuiydCmAxvVcUFRxDNXkS2VPBsyA40vcWcd63QOEC7eoDvIPV+rjjumMprsoI9eX3O3UDaoVqwNpDAWuoWaDnUsOTexST8F5aXFJGKxnQYRnwAd2nKL49M3XnQznQrOn6x2UGDJn+xRZleBZttyhZzm1weEwsOtXoaQTNtXdSDa2BEYPMFNSpH35KsUngPI8WVOn3nodplHlOFQQDx+jbAHiGXaiM4VRaa+Rm7ornJVQUbByFrZNYTk+1S/YqRKTkGfJKkn2vvR8KDR0atjiHMtLYK2uUgH1tb02joA4i31tfW4R6+tqi6vPCg2mLr0G9GWhuBiU3cATwg1mkiKpXVv1NqDxpnywkXsb3yqqGIUyNU9St7FECKJw0lIEbjrurE3PrwPlurIykHZ0Hp5t2r60oNECuPcF5Uegeq/FduxGkToq0sRQAVVo+62J0qYQMoMFXYrzX2dAtf9PbOJRGmwvv4Kv/RGERq/N4Y4IVJqzp4M3lvfZNmGX2SAMJwZoSPvBsqN/QBdZLqYq2CSjZyzMqQvQnyq7AM+4RFDslRjv8GJGPl17YRZaofhgQxfvcm4ZGfozcYhUpAE6r0o5nImc5lHlqhdJhvC3Isn0OUi9U2zpDJLe4TGkYqjiclLVpYkQMiwhwega3jfsUo+e4zQGEB7OMcebLq7xbM4+fkRlCdMOCqSLA25I/qcWOsFw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(366004)(396003)(376002)(31696002)(316002)(4326008)(16576012)(26005)(6486002)(38100700002)(8936002)(36756003)(956004)(66946007)(54906003)(66476007)(66556008)(5660300002)(2616005)(6916009)(8676002)(2906002)(186003)(86362001)(478600001)(83380400001)(31686004)(21314003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cHBaeHorRFVaM1JYZCtHbzVJQ2xTaGN4V29lYVpEZFVhN2hQQnBGK2JUK1BI?= =?utf-8?B?bFkzNi9yRnBlTlhLelVDV1dvSXRGSEYvYWRham1ZazdSd3JGVW00eVMrcWJB?= =?utf-8?B?UEVzRDc2bTRpVVhCSnk5OUtaRnN2WXMxODQ2UGU3YXJ1M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RzkvMmt2R1NicjlJL01zaVBJQ1crR2drRjVucGlOcEZzdkNt?= =?utf-8?B?VjhGSEZ3c3kxMHFqNjZ5UXRXMi9SK0J6ZGkzK2xmZlZoUlVPcG53UURvLyt0?= =?utf-8?B?Tjk3NVA4bU5sRlVhVjRDa2phME02UlVoWHZyR1VsVzJQZTZuZ1ZQZnQ2d28v?= =?utf-8?B?MnZWcnFoNUEwSk5rVHY2UGlWcmpXQmtPcEI0ekpzZXFpWXZFOGZybHNXK2ly?= =?utf-8?B?ZkVURzVYaExDQWNSNUIvVGpocU9aYnhIVHVvNStTT2F4WEdaVUx4QTIydE41?= =?utf-8?B?WFVJMUJpeGMxbTErcWVqMzNscVh5OHE5YjlJUElCRmJxUUpiUWpKNCtZVzBD?= =?utf-8?B?d2ZJc3dvcmV2Q2JvVWxESTVXZzBab1dHc2RzZmp6NkxyT1c3K2lBYXpmeUtJ?= =?utf-8?B?TEMzZ29TN1lSb1diM1dQWVFqRmRlK2swREY2MEtMaWdYR2tiZmpBMm5hWFFT?= =?utf-8?B?VEx5OVRLVkhyazNsbHFEY1huOTh4Q1F4d0UvZ3BKTS9jdUlScTA2UVVlVmdF?= =?utf-8?B?am8raGtxYTQvRktpNjJDMUs1R0Z1Rnl5WWRZaG53b3UvOVVXVnZ6QW1UcElu?= =?utf-8?B?bEJUT0VIVm1HYXNKM2pUN1hnK0VyLzljb1E4OFlsM3dudXBLSXV2aHlhcnJH?= =?utf-8?B?MG5ycWc3c2V4TTJWVXNBRTlzYVJkMVVkcXdrZWJ6b3hhbjdmQU9ueTkxb0Zw?= =?utf-8?Q?iOr/B06AGBH2HempGW0ISsOvkE67OsvWdzyOcpd?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8aa65c14-25b9-41c6-6a3e-08d9784c42a2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:25:18.1323 (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: V8YPv2hWZef89OpHv4zLKa90/MBjP/4OXjVZ3N7eOK1MbYK+ZZPVqjWcFMhmvPjmoYsasyqElZyBbFilqZhT5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4352 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631712340010100001 Content-Type: text/plain; charset="utf-8" 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 --- 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. --- v2: New. --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -430,6 +430,10 @@ static void __init efi_arch_edd(void) { } =20 +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 =20 - cmpb $1, bootsym(opt_edid) # EDID disabled on cmdline (edid= =3Dno)? + 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=3Df= orce)? + jne .Lno_edid + +.Lcheck_edid: + cmpb $1, %al # EDID disabled on cmdline (edid= =3Dno)? je .Lno_edid =20 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 } =20 +#ifdef CONFIG_VIDEO +static bool __init copy_edid(const void *buf, unsigned int size) +{ + /* + * Be conservative - for both undersized and oversized blobs it is unc= lear + * what to actually do with them. The more that unlike the VESA BIOS + * interface we also have no associated "capabilities" value (which mi= ght + * carry a hint as to possible interpretation). + */ + if ( size !=3D ARRAY_SIZE(boot_edid_info) ) + return false; + + memcpy(boot_edid_info, buf, size); + boot_edid_caps =3D 0; + + return true; +} +#endif + +static void __init efi_arch_edid(EFI_HANDLE gop_handle) +{ +#ifdef CONFIG_VIDEO + static EFI_GUID __initdata active_guid =3D EFI_EDID_ACTIVE_PROTOCOL_GU= ID; + static EFI_GUID __initdata discovered_guid =3D EFI_EDID_DISCOVERED_PRO= TOCOL_GUID; + EFI_EDID_ACTIVE_PROTOCOL *active_edid; + EFI_EDID_DISCOVERED_PROTOCOL *discovered_edid; + EFI_STATUS status; + + status =3D efi_bs->OpenProtocol(gop_handle, &active_guid, + (void **)&active_edid, efi_ih, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if ( status =3D=3D EFI_SUCCESS && + copy_edid(active_edid->Edid, active_edid->SizeOfEdid) ) + return; + + status =3D efi_bs->OpenProtocol(gop_handle, &discovered_guid, + (void **)&discovered_edid, efi_ih, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if ( status =3D=3D 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 *Syste= mTable) { EFI_GRAPHICS_OUTPUT_PROTOCOL *gop; + EFI_HANDLE gop_handle; UINTN cols, gop_mode =3D ~0, rows; =20 __set_bit(EFI_BOOT, &efi_flags); @@ -742,11 +786,15 @@ void __init efi_multiboot2(EFI_HANDLE Im &cols, &rows) =3D=3D EFI_SUCCESS ) efi_arch_console_init(cols, rows); =20 - gop =3D efi_get_gop(); + gop =3D efi_get_gop(&gop_handle); =20 if ( gop ) + { gop_mode =3D efi_find_gop_mode(gop, 0, 0, 0); =20 + efi_arch_edid(gop_handle); + } + efi_arch_edd(); efi_arch_cpu(); =20 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -131,7 +131,7 @@ static bool match_guid(const EFI_GUID *g =20 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); @@ -747,7 +747,7 @@ static void __init efi_console_set_mode( StdOut->SetMode(StdOut, best); } =20 -static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void) +static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(EFI_HANDLE *gop_ha= ndle) { EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info; EFI_GRAPHICS_OUTPUT_PROTOCOL *gop =3D NULL; @@ -772,7 +772,10 @@ static EFI_GRAPHICS_OUTPUT_PROTOCOL __in continue; status =3D gop->QueryMode(gop, gop->Mode->Mode, &info_size, &mode_= info); if ( !EFI_ERROR(status) ) + { + *gop_handle =3D handles[i]; break; + } } if ( handles ) efi_bs->FreePool(handles); @@ -1219,6 +1222,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; =20 size =3D cols =3D rows =3D depth =3D 0; @@ -1227,7 +1231,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY &cols, &rows) =3D=3D EFI_SUCCESS ) efi_arch_console_init(cols, rows); =20 - gop =3D efi_get_gop(); + gop =3D efi_get_gop(&gop_handle); =20 /* Get the file system interface. */ dir_handle =3D get_parent_handle(loaded_image, &file_name); @@ -1364,12 +1368,15 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY dir_handle->Close(dir_handle); =20 if ( gop && !base_video ) + { gop_mode =3D efi_find_gop_mode(gop, cols, rows, depth); + + efi_arch_edid(gop_handle); + } } =20 efi_arch_edd(); =20 - /* XXX Collect EDID info. */ efi_arch_cpu(); =20 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, 0x= 66, 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, 0x= 79, 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, 0x= 0B, 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 =20 From nobody Fri Nov 29 17:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631712365; cv=pass; d=zohomail.com; s=zohoarc; b=kGzLhoSBNyEZ+id6h778e/VV0nrfKBF01CQTGYMcvsoOl6ZJO9Ifj4QLsaWEjoDXUnINQPc05yB8SioOg+JhhwkOQxF6Q6fQLU/ULizGBIM38Eo9cvj9Y8cnpbfd6F+RhY04bLmIsdejaudULVnc70Ge9TGukWTiwSlzR3b7E4c= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631712365; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+iOZotKkLcJY4CXebIky0sg+x0ejVE7dgfMqo24AelE=; b=MTzVZoRFrFAKdT9t5xQOT9XCwP8ImgUOoRda57RAbsOsixfCnV0X9K65ctBYeaWZ5t0SxMimNx+DL+SA1HA9E5sbKOJukdMSrddfvTdWh7ZuWyHQtbZ0kebwk1lq75yvimgOylf+n48H+z911XCfco9T4gS5Kqc1W6Wk48w9luM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631712365108324.8510522627813; Wed, 15 Sep 2021 06:26:05 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187621.336556 (Exim 4.92) (envelope-from ) id 1mQUv6-0007to-5a; Wed, 15 Sep 2021 13:25:48 +0000 Received: by outflank-mailman (output) from mailman id 187621.336556; Wed, 15 Sep 2021 13:25:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUv6-0007th-2F; Wed, 15 Sep 2021 13:25:48 +0000 Received: by outflank-mailman (input) for mailman id 187621; Wed, 15 Sep 2021 13:25:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUv4-0007pg-OY for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 13:25:46 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6cafeef0-1628-11ec-b51b-12813bfff9fa; Wed, 15 Sep 2021 13:25:42 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2111.outbound.protection.outlook.com [104.47.17.111]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-29-sU1tyMl4PJOKiOQMHaFUPA-1; Wed, 15 Sep 2021 15:25:40 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB4383.eurprd04.prod.outlook.com (2603:10a6:803:6b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 13:25:38 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:25:38 +0000 Received: from [10.156.60.236] (37.24.206.209) by PR3P193CA0033.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:51::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17 via Frontend Transport; Wed, 15 Sep 2021 13:25:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 6cafeef0-1628-11ec-b51b-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631712341; 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=J9a0+HBBNNPrmOxXSj9j3e38VTLqJouLFY04BeZ7O0+aGjG45v+LhnbCyz1AlelJMs0Fk5 zAERE4A1D/rOv2KHj50RNOx40ivA6TviMPb9+4auAD/aHo7bSq1VNMiL82HWAugEYKtihf UadfENeMURHD1/QL9Dt7nfpJFbU/P98= X-MC-Unique: sU1tyMl4PJOKiOQMHaFUPA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HjqLmfPJTlcT6Uq40v4YIkdeBsvCXYRr+SNip+0cff+Yj4E9YPoEuWcRjcyLTEEHHsE2l3vVO9Ryh8Nk+XZvyypp9WiJVvoPNyfdYQJDN821qic54FFrm2u+4JuEFMDrx9cLz4M5aIWe4eHNcpyPKotjYQlrV948BztXpv4Se4yGnfwL3YE80s+6AYd8UTPtfV6NLvu6l9R0itcwV/UvpMAUeLZSu2dmwqH8/z7Ru4b+34PpNFQkUG6XHba76THXbgwY6SA9qcYUvjJfeyVxH5NV9wXAFpDfaQvfZk01RCH1PA2U7ICDImb2muWAwfqE/cD/ZFVX+kCWhaAgJMkMSQ== 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; bh=+iOZotKkLcJY4CXebIky0sg+x0ejVE7dgfMqo24AelE=; b=mzST7ToNYe6I/VK1pRGOzGsiePTHMT03Q24GTE4axPv3GuXJK8ZCT6Jho2kqArpQMTjw2okltFH3DXg1zEXwjjk628Mvq0+b5L1ht6kYtW6fVb8RdN2NxkzSFUOLbp1uIJYk20RczXclysW5/m+XNSUfJb2fZbgWP3rJKR8XWZj6/6eXsx2qKGg+xyfx4eCfkbL417vgUn17lDLJamH06cDtRhLHLvOtZrOz7z845rcqMucQSP19h5pbMrQgCku/GgClZGEzkKKkh4yRLCvQDCADaMdbTWq90Fcmxf70Y+INRcTGQluG6SKMuxAQwMghnLBjr2pj75jA6uHl+4FXGg== 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: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH v2 4/7] x86/boot: simplify mode_table From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Message-ID: <855ba31d-45f1-7d98-68be-bb2f7f7d6a8a@suse.com> Date: Wed, 15 Sep 2021 15:25:36 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PR3P193CA0033.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:51::8) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83b45e39-a3c6-44fb-f1a3-08d9784c4ecf X-MS-TrafficTypeDiagnostic: VI1PR04MB4383: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OBwMWz9MYxasQAwJoxGRFgQgNkFWDlpWP/uqOGDeBWppJ56WFA/PPxjPDbfaZZL1Ot9WxU5Yfs/CbGcf1r60xJqLwsAuyfzBt95rCbzsHf0QGCtoSu7ELdQ0lBwcSXrbUvxFCzUvuRLdGTvRAIBwg+oIJboSPm2/+m62Xbgb5+oJat9FNnAM/JruoXYEkTy+GK7OHdJc3ol4ds2aseMr2WnpB/7c3aYAF0TNbLBycwkCr87bHOi60y5NKQMUeWDyaGvksz6SDYU2I8X6PdG2AZuIqdBCx0v3JCIbh/VqSeDBvvhmS4hwUcE6aYnUnBU+eKm9snLVQf+pWjdr8oJI+fHEd0yG/UBQ9t7EF8KNXqbPL/53/I3b0qeHP0oUoonc1/CudpG/3tkBqtYSWg6j05IZ3s/xuPjHab5dxqOlnEcKsBH3+sE3ApGahz/FfqktP+iy8HojppVPamq36s1W/bwA4J2ab7WaBdJLkYuvMUm11+/kuVkvBAg0c7xc/NJ8MqnbEZEmpTfh6Y8ara7UlQYoftWb5/7zSeLOP6pf1iGupFyOa21Bq45B3UN4A2hLiU5L4bJxpINGEeOi82C0ytXFc3onMLYMm2XQLoGgMcahS6z8WCCOkY4QnRJgAGPgOMgQtycvbrlS4VsATU+7sMn+sAJ0RqXaX7fAa1UNtczIpXkLr/dbudvgk+Y+EUnkpvSdm8klM6CDDMpVfG4GNQGv2yLdotkap8JCvikqZm8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(136003)(39860400002)(376002)(346002)(396003)(31686004)(36756003)(38100700002)(54906003)(956004)(16576012)(86362001)(4326008)(2616005)(31696002)(2906002)(478600001)(316002)(186003)(5660300002)(26005)(8936002)(66946007)(6486002)(6916009)(66556008)(8676002)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Skt5MHBYZUl2c3RsYmpKd1JXajdSNGtXNzNGZ0g0SUd1WTVqM1NucW5MNUFZ?= =?utf-8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6-44fb-f1a3-08d9784c4ecf X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:25:38.5493 (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: PEz26FYzzEFc8n3R0otP0Ke9u+Kbeq20Wt+drrsEH+JOMCQZyv58KrGrN0Si6WltoG/qScmJdFPpyMrT6u8JCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4383 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631712365551100001 Content-Type: text/plain; charset="utf-8" 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 --- 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 =20 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 =20 # 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 nobody Fri Nov 29 17:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631712382; cv=pass; d=zohomail.com; s=zohoarc; b=JJ4PDT8uzRoQMx0ZNte17GKdk9vTbM72TOM1WWeD8EsSyMBIbAo/sC+bN568fsCYfZTWMjDupaLh7I5o0qlnqfW5pd7FRdbiUC+Kl8JUpZ9OnwOXRR+qrV9jCOiwDvVYMcO4p+GRtVnrFfMEMUI/nyuMgK4SkRrhsXfZhgghAKs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631712382; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GFSJGrEWRuZxL/lqFamJoez8zlHu39Sdg/lvj6ulEMc=; b=avsJex7SQMpmG2qIR4kHGUTf8J4q4bzZdWB2OhR5Shcs+RPQVKvmznrkmsOsbjLghnJI25gJ0Tct/d835YMoan45mZbGezchWDW3OxFZoW5gFfAzExGSYQGOFbnNTlYDN4VUd5PGJSDRE3QFfoolxU7OEMsjcJcf0nxfoI0jO44= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631712382664871.820558259862; Wed, 15 Sep 2021 06:26:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187628.336567 (Exim 4.92) (envelope-from ) id 1mQUvQ-0008SK-EY; Wed, 15 Sep 2021 13:26:08 +0000 Received: by outflank-mailman (output) from mailman id 187628.336567; Wed, 15 Sep 2021 13:26: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 1mQUvQ-0008SB-B8; Wed, 15 Sep 2021 13:26:08 +0000 Received: by outflank-mailman (input) for mailman id 187628; Wed, 15 Sep 2021 13:26:07 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUvP-0008Ln-Cd for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 13:26:07 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 79e5257c-1628-11ec-b51c-12813bfff9fa; Wed, 15 Sep 2021 13:26:04 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2109.outbound.protection.outlook.com [104.47.17.109]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-12-lwp8FwXxNJSK1t9inH9vGw-1; Wed, 15 Sep 2021 15:26:02 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB4383.eurprd04.prod.outlook.com (2603:10a6:803:6b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 13:26:01 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:26:01 +0000 Received: from [10.156.60.236] (37.24.206.209) by PR0P264CA0119.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 13:26:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 79e5257c-1628-11ec-b51c-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631712363; 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=c7emvh79IgL9vkkDbGb3Aw9nWDSz/vo3UE1BiJ3CUa8IoQJh4SAP6ijMitWAhacyAKYEdD yUMkwuQp8sV/1iCryiS9TB7Ppd3HMFIFJmTc5Pr2z3F6NjIU9RHt8sq4qyZx9ge5mKxNlP WU+qFVWG6lrkB7x4v/xSLAq21CHmCLk= X-MC-Unique: lwp8FwXxNJSK1t9inH9vGw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WBE2crGkAU+iP16h0N3S+/TEH8kR9ZIAXR35k9nAW2YXHk2028Fx2IhbP9TkNy041Gchl/NPc31fiIWVr7Qzp454+SSScgqRP9+B5jAD3WOn1dEVVJL5kHocl8bW8nqGcdKbIBnndKKA5Dy8+aB6vkbHYMnCA+tP/iavOwrcPaJrCFxxg2djvfHcs99iOyLIBD/aJY6jsUGfA20flh1PGDAEpn6b2OgC3gnES9wI3bbg9wdU8fmDwNHAoemhVhJvH5Sjtd9doHXNpmyVM6XwszvaIVkUy752XfmtX3wVZYBrab+idJcCm2EWhENZKUk/2bZfSguESDtAlfW+peJAGQ== 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; bh=GFSJGrEWRuZxL/lqFamJoez8zlHu39Sdg/lvj6ulEMc=; b=gdsEEjka6fq55o2GToiY5wd11adRMDkXz6p10l+yuKWCvyv1rtDlfbbGi3IwJfPFsb24RpZD2uo2u4c+6CewjGRUq/HVCFkwV9ffLd9Vw1s3xsDYOPo9BObVzCw5Lk+tbTbnxxMc3blawTN5h6k4WP1QfNZfpWzjcqRzZ8J9j1VHWMrdYf94clamgygUHyMdyLycpq5JII0oh6n83rqDYKsK1ou5zlGo5mpf7hyUXNS/dxQBnNoBgGZkyZBuYPJilqP/515HPG/wiRyRt23ilqeT94KCf4UbIFtGFKjwWHg+N/7+Z6B0cyYfy/uZ3yIDF2odNSXN9iACbiFR+H5mEw== 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: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH v2 5/7] x86/boot: fold branches in video handling code From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Message-ID: <7a93f768-b416-1699-7db3-37e87f6d318b@suse.com> Date: Wed, 15 Sep 2021 15:26:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PR0P264CA0119.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::35) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a02da4d4-0116-4a6e-fd42-08d9784c5ca2 X-MS-TrafficTypeDiagnostic: VI1PR04MB4383: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eLSTnMvddxNo2NPOuDbjLV/xN/pN8BKMA/4Zm49LJAU3gEsekZrXlN7oDCgonsYkqhzN18sH+R1PiCpIV3QJMT0r8DSkV3u5THqjg+eq7bMMOruLVL4VgVI8iMpzntGegLhz2Vxf0bztG0vdPaceltyDMhwdazVw2js+8+XFdRDG8A2morzQ8FWfnpK1eLowt6vd3a4HUYD2pLkftTEw7JpTzGh8T3wh+Ar2p9t68+NWUwCW9kGgnco+ivE+Cggz/5vC1idEjA3ZGfUqGJLOLHuLz2cIpDhsiS9UADkKhpCEjYsVBGiVfZ6bEADPlCrPyDuD+5KOG0TkZbJ4yevzJLfUF55itfMbLruedoRFDUgryAdBKfrqC4Ie5+9VIR1lCpYFB9kTmOSO5/p/15tlafbFfqH2yTEGmeTu4/C3Mhpqe3GQ6irZ5vfhVwEd3nR3LpdVL0PLk/aTVN7p6dYWNUAhenOs1YLDbh1ovP0XWfJK7Kgd1R5xM+EVNfOf94s55qG5Xlc+mYTmz8Mbn9b/CgwJLLVHqrf+S8443kCmTNFOu8DQkA45f7hkC2h0FSG7fTfP58QDyDFQaWCIcNhEz1dGBu3zzLbBzgA59n5IPOxOZReXMK0wuSsgFQRCKHphPy03hr3jL1BKdD/omx04VTiLnww32mz5NJH5KG5XZVXpsxabf4395x1aSXsWyITA8TtVfaYdYNR00j7nH8VNOXjFWNE+m6vWQ1eyFpzn0k8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(136003)(39860400002)(376002)(346002)(396003)(31686004)(36756003)(38100700002)(54906003)(956004)(16576012)(86362001)(4326008)(2616005)(31696002)(2906002)(478600001)(316002)(186003)(5660300002)(26005)(8936002)(66946007)(6486002)(6916009)(83380400001)(66556008)(4744005)(8676002)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Zy9zOUI2ZEE0M3d4aWx6TG5JeW1nV0hKOTRjWmF1V2ZkemtNU0FoL1RFa3hD?= =?utf-8?B?azdPV3d6bi9naWFOR2lQT1NqMWJ2UGVzOFZuY1BIZlg2dkI4U0xUMVE2L0ZG?= =?utf-8?B?bVkxOHJpdGpyVDRFQVExTmcybkNSZ0txUzhVam9zVGRHOUJnZFRzYUpKOVdT?= =?utf-8?B?VDVtbUZJODNVdzZoYXkxZVI3RzJOVVowSmZWb3QvZ3p0ajdLNEUrSXJyOUx1?= =?utf-8?B?YWNQZFpPVXc2MitSVEpuUStwaUd1bmEvSWpFN0pWbjl4TEgwcXM5ai8wREVB?= =?utf-8?B?ZS9MRzB1S2Y2SkQvNStHZHlwUUgzRmd1WEZDSHBtVUlHen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ESDNzcGhyTEFDNklmZjhqcmc2dkJjVzREZnBXSTg2SEll?= =?utf-8?B?YjZITTRzNDY5TnVleE55MVRRcm0vYUdpKy8zNzVzdWRncm5ib0pUb2xwTm5Y?= =?utf-8?B?U1FCV0gvTVB3cFhoYmZzNmZCYS9WM2w1cUdOMm9HUmExb2RHcEtiL0ZIbExV?= =?utf-8?B?YXp5akFvK252OG12TWN4NVZaZTFkSG1ZRTJVbFMxV0kvanl6L05EZ1I3MW5t?= =?utf-8?B?RDg0b2hpOTl5aFlKMC9ZQmI0V3JRL0tzU0ttMmt4UTJEVDNzUUw5WDFCcmNB?= =?utf-8?B?Mlc4dkM2U1d5TzFRTk5TV2hVMFZWTUwyZTdTZHNCbFVEeEU1ZW1HQng5QS9D?= =?utf-8?B?YVZVNWVMVXJjam1aMkV4Y2txU0I3K0NmRFJkQUFiZTFXTGx1RlFlb1BHcm5Q?= =?utf-8?B?Uk5UNzMzZXhOcUdMS0VLUGMrYmNobjMyUWxrSjJPc2oyUmZsdko5UjA0dEZW?= =?utf-8?B?TlMxT0xuWm1BSEF4d1lGOUFkbkVVWWJBalB4Q1JQcTg3aXZQc1NETXJzbTdI?= =?utf-8?Q?bFcXPdWs6l1Q3qxSa40NC9BkIKVrF95iesTMkr+?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a02da4d4-0116-4a6e-fd42-08d9784c5ca2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:26:01.7268 (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: oIc/iplh4qIPU0P89eMXxK4meNZP96sf2Z88Njds/aZtdpaOHcxQFA8OHb6RvRjQ4gpUy3wTqzonIbf5Cj+Wfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4383 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631712383418100001 Content-Type: text/plain; charset="utf-8" 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 --- 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 =20 lmhx: xorw %bx, %bx # Else =3D> mode ID in hex lmhex: lodsb @@ -401,10 +400,8 @@ mode_set: cmpb $VIDEO_FIRST_VESA>>8, %ah jnc check_vesa =20 - orb %ah, %ah - jnz setbad - - jmp setmenu + testb %ah, %ah + jz setmenu =20 setbad: clc ret From nobody Fri Nov 29 17:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631712409; cv=pass; d=zohomail.com; s=zohoarc; b=mtM0oH0xYcQM8CNF0S8O8c5plLphhBzTeSON9yqg5GK5rij3Sx/WMURW43uKJqC5S/iUZ5V8LM1l2L47AFzmHsjTTD5zm8usBLz35NhpKGOi1kfTxtzzydwngx8d8KSlrVv65+XdutdSG8hesKJiqe9GK/RWOLZn5/w03/UI60k= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631712409; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=juBJGq4ZapzX50bKGD151YensGcEVFSl2L4HTOV0500=; b=iXXU9ohHxGRBmPeLcr/rZAQwejPfaR+BAK1pZl4Q8g/ZVc/LUon+Bc4cNR03/YPZg3O/d8V0jpxQAdACILK27wj27FzBZvxZGH25AXOikVuXBJrzZ+Gg+dxAy2xjSwX40aYsZfXYGLB2GbYWojIDaN2x9eejo+aCoQRjNFvkZ6o= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631712409118706.4053422949614; Wed, 15 Sep 2021 06:26:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187638.336578 (Exim 4.92) (envelope-from ) id 1mQUvp-0000kQ-RB; Wed, 15 Sep 2021 13:26:33 +0000 Received: by outflank-mailman (output) from mailman id 187638.336578; Wed, 15 Sep 2021 13:26:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUvp-0000kH-NS; Wed, 15 Sep 2021 13:26:33 +0000 Received: by outflank-mailman (input) for mailman id 187638; Wed, 15 Sep 2021 13:26:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUvn-0000hM-Rr for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 13:26:31 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c64716c6-913d-4a17-9d25-b71c7f5df692; Wed, 15 Sep 2021 13:26:30 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2112.outbound.protection.outlook.com [104.47.18.112]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-20-Te282JS8P-ipjAZzefVUmA-1; Wed, 15 Sep 2021 15:26:26 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB5327.eurprd04.prod.outlook.com (2603:10a6:803:5c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Wed, 15 Sep 2021 13:26:22 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:26:22 +0000 Received: from [10.156.60.236] (37.24.206.209) by FR3P281CA0062.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.9 via Frontend Transport; Wed, 15 Sep 2021 13:26:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: c64716c6-913d-4a17-9d25-b71c7f5df692 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631712389; 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=EoaUIVEMT1u5h5U6RUBEN0CRLlh/2tpTGZIiAtCpP2XfFOC7VDyPGXk4Cv+w/tJneER/4Z GO7SwA7N5JjMLxniwDpJpwugVbmOd0a2L0SJpfvqj2NQWaUDX7ZHMjJ+lzmmuz1YZFB8cn lqXqZeJEkHlBdHk+QmBwAWFdAets7Vk= X-MC-Unique: Te282JS8P-ipjAZzefVUmA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RRf6l3iHjaqWdxP6tpBPUBUjDy1cAfswlfIgtIO+WAYxoRsUHmktuHfG6zO4bxb7W5WzcAiW4wR256JzD6bHoOrPv7/lUtTHWv/EzoKKoU8lhNkRqVAU8oZr9854R7IFRBTWyCI/BbXJ8zjksXn7NzmvRMiv2iFLQkyMD4lKChHathqBXezEpVaNEGg2uChGJiY3HvEnuGvlZFf+hvNcgM3nCQcORDIfLIKhpW2pTlceck7kezy3YasKHt0IMWlVSUcil8oPKOrEMUmCAev/MnV4gGUKnbEhNRE8pi95845SIMrAyjfq+LKdO1gGxjS0y1+qVYlE1jtUQyH/Oe2umg== 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; bh=juBJGq4ZapzX50bKGD151YensGcEVFSl2L4HTOV0500=; b=dgQpvmqmrjMVrlsuiOlGbGA6Y7dYwHyGPqy+277Cq9hmHisjAiSfQhmOSEJyRDtzGX/eQDoONargnk7eY21Zi/XPVxAocUD7Hdebu1fZXLNP9D4PkzcXsOIhgf+zboyzdaB+GOBwMGqaNSBvVEfHA5SVNuFww41TBAE2AO10/0GzJu2YEvqDhiSAMgXfEpSAdraTBNbC9KazT1GeYp9hhcM8wL4ugj7lbo9L9Kd/DHIliukC0YrMlJ5He5Ecv7zHNbhiezglrecYwb5a7O6xKRWHjzWCoLG8XxEO9d0Ck0EK8p5/aI/pyjLylo3qAQAzyr8P4WgUv+gvOJwKwGd8uQ== 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: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH v2 6/7] x86/boot: fold/replace moves in video handling code From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Message-ID: <60ce3c64-53c2-9042-18d9-ff9e569fd4a2@suse.com> Date: Wed, 15 Sep 2021 15:26:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR3P281CA0062.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::11) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67564867-f239-4245-38d9-08d9784c68f0 X-MS-TrafficTypeDiagnostic: VI1PR04MB5327: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S5Ht2TRwz5P/eoFQfOSYAHcKk2ekUsJX5xFkUHbWoSPtYJHYSDSncBmQXpGhQDwR2jr9IZBbNhqSqyYEPahGMuulN7jeZXULDpM824XEK0pJkd85oTrCUFyE8TzKmZ/hAPCa8v7rW0FtDcekOO6pwHVntVZ4EHxTwaO8ghQ//vnfPCFYU2xMZo1SXCB9Crv9MG9yPyMrF/if2L7mmwg1xvdrZsGKeGJGplaVR7oR6L1It3d28sDgmohxBVJpiuVUrf2Dy69v2qZzyyEw6CXRJ0O6PX2GPxaEJELHMbmP5lHasC/E6Ld4H64o0ELabJ+QFve+XuooRAudPGE+i+4bPeeDdqEiUkbcMKlEg5PnU3+f74AmhWROIjk5pZvKozJt9wDIcC0GKYUrP4L3D88FWqXq7mZWyrZl6IqYYeJ1AIxfkbi3duk2cv/+UZpWsQGo8El52wqVK81qqpjm8cIWp4dCa2lXNSFu3rf2o2F0QeV7xjXlGI4kQ94jzJ7zjghd+W+9R+5RiaSM8V8ucb2dSqeqvEl1y9y8qmCmc4KDAWwCqVGGUv3ERE54LSd6/aEsx+JP7fpei0PD8zLy8yXpnLUoNAA7V7zKdTvs5SOHYKP8kMlXXNrxYc/l+tReSrMhawCsyRQghAJdRoaTBvH+eg+zS6MxE8tP2O6BuYm4JAP0E33KG1qH/AqJ6N8nhVL9v93bPlini/phF3zucvaKxGHUQlnHpyXU2V4VUWMujEY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(346002)(39860400002)(136003)(396003)(6486002)(316002)(66946007)(8676002)(2906002)(54906003)(478600001)(6916009)(8936002)(66476007)(66556008)(5660300002)(956004)(4326008)(86362001)(38100700002)(36756003)(31686004)(26005)(31696002)(186003)(16576012)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VW51cks4NE03bXlRbitwcmJ6QWtrUS9XYW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-CrossTenant-Network-Message-Id: 67564867-f239-4245-38d9-08d9784c68f0 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:26:22.3706 (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: 1SKC6uvzrGlXiwAwkpBGKsLb5EKv5Q2+lkOn9SInE94k4wAjqFikqs4rrrsRBR/RnCTuR21fC9/uUp9A8TNaTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5327 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631712411457100001 Content-Type: text/plain; charset="utf-8" Replace (mainly) MOV forms with shorter insns (or sequences thereof). Signed-off-by: Jan Beulich --- 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: =20 # 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) =20 # store mode capabilities @@ -144,14 +142,11 @@ mopar_gr: movl %eax, _param(PARAM_CAPABILITIES) =20 # switching the DAC to 8-bit is for <=3D 8 bpp only - movw _param(PARAM_LFB_DEPTH), %ax - cmpw $8, %ax + cmpw $8, _param(PARAM_LFB_DEPTH) jg dac_done =20 # get DAC switching capability - xorl %eax, %eax - movb 10(%di), %al - testb $1, %al + testb $1, 10(%di) jz dac_set =20 # attempt to switch DAC to 8-bit @@ -164,17 +159,17 @@ mopar_gr: =20 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) =20 # 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) =20 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 =20 # 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) =20 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 =20 From nobody Fri Nov 29 17:35:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631712428; cv=pass; d=zohomail.com; s=zohoarc; b=T0U8Gzrb+iiT4SHlRZEysEbmgWDp2GiTQbW+PQcfGTgYM2qUJFf7nuScRpOm9zqWU4NMm/APTL6DXVaDeNwCaWDw3E3ix80PHDjYs44z+KVP1grFSd/3m5SUJBH13HmjAQLpES+HmbHXS7QWRg0uqPWY2BRrt/9x3ykFFPqV6Ac= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631712428; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KNU533Nas71KGaxkrjt8Y4qhfH0SyWRPA/lY3YgjMd0=; b=cIK3UdhzCx1XSiFThpi2RE5hQAFsdZHKlQMDutuKMySTPBlQsUyWSay0n+Ej0VsPiIzba1Z0iAY5qgVBr2NCTnQnEpPbstntKqJ0oXW0bJ14qLpkjseMuQ4AVyHD2F4D5RTC7En7Cx9CpkKlRsE5XpyvN27vnwEmqqMKKF8yU4Y= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631712428073124.57935740106075; Wed, 15 Sep 2021 06:27:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187646.336589 (Exim 4.92) (envelope-from ) id 1mQUwB-0001Ha-3n; Wed, 15 Sep 2021 13:26:55 +0000 Received: by outflank-mailman (output) from mailman id 187646.336589; Wed, 15 Sep 2021 13:26:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUwB-0001HT-0i; Wed, 15 Sep 2021 13:26:55 +0000 Received: by outflank-mailman (input) for mailman id 187646; Wed, 15 Sep 2021 13:26:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQUw9-0001Ge-Ip for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 13:26:53 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 39e1bfec-14e6-450f-88d6-9d4ab6c63143; Wed, 15 Sep 2021 13:26:52 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2106.outbound.protection.outlook.com [104.47.18.106]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-22-m0u-xFKfPUS8eSUh7SStsg-1; Wed, 15 Sep 2021 15:26:50 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB5327.eurprd04.prod.outlook.com (2603:10a6:803:5c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Wed, 15 Sep 2021 13:26:50 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:26:50 +0000 Received: from [10.156.60.236] (37.24.206.209) by PR3P191CA0043.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:55::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16 via Frontend Transport; Wed, 15 Sep 2021 13:26:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 39e1bfec-14e6-450f-88d6-9d4ab6c63143 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631712411; 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=etd6icAyDgV0LsWvCl+WEd1BjTm3Qwv13LIdQUiFU6d4TBJQcn56hMZDQjJcKBcbH+ERAa bhpoH8jXVepYivBSVTERf2uFwhxTZHRM57A+s1F6K7tIs9jvwnO+8sRb/nTkMzr3c8qjLk Nc/aTSCbLFReFbKtj2MPOc/PPNZp5Wo= X-MC-Unique: m0u-xFKfPUS8eSUh7SStsg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dXJe1CvuUrpYq6H9KGPvpt7ar1/bkWERk3uEVIjMxjBmHUVj6nvvzFtntGfT0Tp1PPvEcn0cmPgK6jSgt0JlB5el1Sf/OuCgxgudJrwSqjLJ23w7XM3dYwEuYQY9F8eFEyHVbmfs/1GDLX5VoRkMjfgnh37hyYcYanI9Z3BbZ3XPFliXjEylSY3CQdFmj1fB27yUNsHRqZbt208AXrc54mz//s5HipHUAbxsGlO+/z819P1w2Bj1HUkPpDCZ/vaFdaT93ZRq0WhFpYL9Rux+cUeZBtkSSOsuklB1TdoFVW5ztTQILQyWNMyiFr6ToIizA8r738qfyvD8VRO/184fhw== 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; bh=KNU533Nas71KGaxkrjt8Y4qhfH0SyWRPA/lY3YgjMd0=; b=VXKsUlbkagqgre7uehe3Q/anitst+U/HBD0UfQ4TQLj3h1YUYeVCzCUvbHsjsCm0cMtJ/1PuFMObcka++nmec9XVvFw/ORLleZdDIE1kNTD/vja6gu1zz8qY++st5q1AIpwlKkyfyjn/w2LYZyEm/+/ypYHut8FqyR2yvxQEw5A28fDPD+rbJf0HEyKartI7PqoWjuxSfHqISAch95u/3knU2snw//+byS0RQA3bw5YEhOIacylkkGrYD8mv0Yu65GDtBDhu913lkORih5Hu/kP1yeN96Mhz+LN2UzNTE+TYXmm85J+Mw9u5tsHHEi7ZWgP1+DHoZwadZRfKq07O3Q== 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: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH v2 7/7] x86/boot: fold two MOVs into an ADD From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Message-ID: <85e26647-caef-9f18-eadc-452c4c4ce19e@suse.com> Date: Wed, 15 Sep 2021 15:26:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2dbcc7e4-58c5-5724-6434-51be8acfde35@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PR3P191CA0043.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:55::18) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c3a53a2-a77a-43df-c71c-08d9784c7965 X-MS-TrafficTypeDiagnostic: VI1PR04MB5327: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GA2UriHqqpe/KQL/aOg1PCWco+ZVmlKQS7s1utumEl49r3d6SHgOo4fyonfRBChk1/ppN7+FupO40aBMDo1wawQJYu4BYA0RMjPcc5i3VlhDTgtDgM4x5BH+COOmjndL5ovAM8AY8NMTVrzzKfl/4S//D4gdY7WQMMXUirPcH7w+oj5gj0wR+76L908hFW1bBD07Iaxalv0Ags7N9VQrtI/Qsg4nmLNCHNleFfYKOahSliG7W0YuHX9Km/S7zaRphkhcbJ42Q55zxp9NzKYLcxWWSmO/zafRCHYicIyeNwu52C/DjZAC1gaEUIRZ3mNNnOdRF+YRMfrICECBN6JqQSupUDjI75JusFzHBKuIwlyXqqtfKXdnFmHXPgBx9TehfJbYA4XAgIWiE45Lh7ijOzEujyFexmmurMuL6PCFsnh937Se/MXDEXdqpGUloSlVXmuwnor+AkUr1ssA7lv670+h+lgVfQ210LUk37R3Q/lkCNu0V8KOXwRqkPp+oOx0j0sxgERoW/lNIKYAmHzXZYZmiK00KsVnwcyh2J266uW/HJWpnLC+4rzvU4mdsvpuX2BnllynR+y66LWh+NXb7k7MjvFD43be5C2nL976io3V8WiQKlWuff+0L0+zXLziCHXe1xeiPKGihT0JXvSZqTEoVN8siL0Aa+0mCe4DDzv96EouZKYItLv3TaD3q+v/SeN4ApeqBWs95pDTpk4nk0qIZxbGPMSBzIj8AxGQ+FQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(346002)(39860400002)(136003)(396003)(6486002)(316002)(66946007)(8676002)(2906002)(54906003)(478600001)(6916009)(8936002)(66476007)(66556008)(5660300002)(956004)(4326008)(86362001)(38100700002)(4744005)(36756003)(31686004)(26005)(31696002)(186003)(16576012)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TGpKZEZrQjFWUm13OG9EZmFBQVFta2lPSjB6TGsyMWhrWnpzd2lNZ2szWU5h?= =?utf-8?B?cFhYWDlCM25seHVjS0p1RFRGVWNHTTVNeUMrS3c1aWozVkJqZWhrM0xiWmVs?= =?utf-8?B?bGtVV2U0RzlOTG1xdEI5TzYzdXdRNXdaK1hLUHExV0RqVmJrVzBoMkdZYnVj?= =?utf-8?B?QTlHQm44c0lUZHorSWMyWEJ3RkZLaXViYi9wWFd6TmxIbXlFQVJjQWtacTE4?= =?utf-8?B?ZWpac2dqTkZ4N05ubE5uU3RHaXBKVzU5ajFncisyYWIyeEdLT1VCeDdLNTBt?= =?utf-8?B?M3lhVmowZDBIK0dLa09udFJUMjBCSmp1QzNBWitCenVBZUgxOVZrTmN5NVhW?= =?utf-8?B?T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?utf-8?B?eDM2WXV2ZExEdEZwWDRweHhMV2plZVZ3NGJVeXJSMG8yaFMyK1M0MlVDVWJy?= =?utf-8?B?Z2FjNFgwTUh0YTNZRU1odXVCQXFLYVpSZjR1SzdFZWpiUFcrRGwvQnh5dGh0?= =?utf-8?B?bE91NEhvam9WOG4wTXBpdzl5RDlWNzRld2VaaGtXQnpROEV0bFVJOTZPZm1z?= =?utf-8?B?OVR2aWV6YWN3QzhKYTBLckdWL1dQT1E3LzhoOXEvL2c0bmZIL01UZnpJUVRz?= =?utf-8?B?ODh4RE9Db0YwcmsxZzBRNHdsaGt0TGtzSUpLQzZTSGhhMW1qMnFjaWZzVG5L?= =?utf-8?B?aGcySTkzaVZna0Exc3gzTkVTeVkwakl4ditIL2VYRldMVVI5NWVYTVVzSWxI?= =?utf-8?B?VURlc0lZaUxxSnBTNFV1dVBjLzFtV3Z6MkhGMDZPSjlyYWlOZnZuTFFUN09R?= =?utf-8?B?WExsOExxUGp1clNpNmRxbW9WMmhUcnpHU0x1LzJSMm9hNWFmWlEvdTZYL1Np?= =?utf-8?Q?jkNKXGE5fAENcyvai/g2CP77/ddXG0G/vmz2Tn9?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c3a53a2-a77a-43df-c71c-08d9784c7965 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:26:49.9786 (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: CvfVA7kYUob60b4OW2rkZk6C5mLHlr4hgDllW/ebIymETJ6FK/HBHpQqINK1Yl79tbh+grQlNZI+4ZkWUeWwYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5327 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631712430101100001 Content-Type: text/plain; charset="utf-8" There's no point going through %ax; the addition can be done directly in %di. Signed-off-by: Jan Beulich --- 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 ent= ries jae .Ldone =20 - 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 =20