[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] x86/boot: fold branches in video handling code
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 8 Sep 2021 15:24:12 +0200
- 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
- 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=J7205OxPodD00LxNwAZNGY+4ROFN3Gj6YfOBp01MwvY=; b=iHAbpLehg3Bgaj2ZoRxL1VyG2NTeRLgGeVT5BUVofh7yUWW6J3aD4Z3E5xCa+idoXUGTSgVV18h6CEkBnxAwBDHQQzNtFY/n2L2O1UpYZkXWysmENsBzXjhRXQ/ZIM0YTjJE9IJKFxTG2VfBsbJQYs18+oG+JTFELNo+1C3iKrInItHhFpmObB7th1qBf4jty5/BDDKNkw8f4ocqhIDeTxa2OQx7u77Dz7c+lMbaSV5JbktFbD1yH5ZhJZt7bGfN3tsancPHiGsyUdBzFHVqIZOP1TFCJcyVqYWoWq8GYKzFkLwDB1+mQyd92cvTbDM1K+JD2WY0Hdq+DhXv5lZhJQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VIP/5zXDu66XxYAvSMmlJnEGwVejDrOAIIVPvE7yTQLlg+b9bpEhWm6S23eYH/AbEU3U+UAlfpw33Hv0ocvGWPx5n+uGDkUUeB/8R+apkkwNzAdPVYx/w4XwBdZZxQyDuePkL3tQzta8Mgicgz2Dmak55mKDRvvJPysAbh/nTTImp4Ma2rSnJNdvViuI0iEWOgTwIZUj+b8w5S3cEj2Dbi7gLfm2Vg3G2T7MfXOeh1qsO4JRMUP24EZj4+EWrS6VZuz0gdtboXR7HouSJd0ffNS/9rreDMOiXTnqR093akGDgpxc9moEitBs/rsVEzh10p8VdjO/nnvm8zqb+YoVDg==
- Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Wed, 08 Sep 2021 13:24:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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 <jbeulich@xxxxxxxx>
---
This is an easy change reducing the overall trampoline size a little.
We're pretty close to needing a 4th page, which I'd prefer to avoid for
as long as we can.
--- a/xen/arch/x86/boot/video.S
+++ b/xen/arch/x86/boot/video.S
@@ -332,8 +332,7 @@ lment: movb $0, (%di)
cmpw $0x656d, (%si) # 'me'
jnz lmhx
cmpw $0x756e, 2(%si) # 'nu'
- jnz lmhx
- jmp listm
+ jz listm
lmhx: xorw %bx, %bx # Else => mode ID in hex
lmhex: lodsb
@@ -401,10 +400,8 @@ mode_set:
cmpb $VIDEO_FIRST_VESA>>8, %ah
jnc check_vesa
- orb %ah, %ah
- jnz setbad
-
- jmp setmenu
+ testb %ah, %ah
+ jz setmenu
setbad: clc
ret
|