[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 5/7] x86/boot: fold branches in video handling code


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 15 Sep 2021 15:26:00 +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=GFSJGrEWRuZxL/lqFamJoez8zlHu39Sdg/lvj6ulEMc=; b=gdsEEjka6fq55o2GToiY5wd11adRMDkXz6p10l+yuKWCvyv1rtDlfbbGi3IwJfPFsb24RpZD2uo2u4c+6CewjGRUq/HVCFkwV9ffLd9Vw1s3xsDYOPo9BObVzCw5Lk+tbTbnxxMc3blawTN5h6k4WP1QfNZfpWzjcqRzZ8J9j1VHWMrdYf94clamgygUHyMdyLycpq5JII0oh6n83rqDYKsK1ou5zlGo5mpf7hyUXNS/dxQBnNoBgGZkyZBuYPJilqP/515HPG/wiRyRt23ilqeT94KCf4UbIFtGFKjwWHg+N/7+Z6B0cyYfy/uZ3yIDF2odNSXN9iACbiFR+H5mEw==
  • 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==
  • 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, 15 Sep 2021 13:26:08 +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>

--- 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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.