x86emu: fix jump_near_IMM to handle DATA: flag correctly
commit170d19c2ad516c146762b8cf597ededa467495fc
authorStefan Reinauer <reinauer@chromium.org>
Thu, 26 Jul 2012 22:48:17 +0000 (26 15:48 -0700)
committerPatrick Georgi <patrick@georgi-clan.de>
Thu, 2 Aug 2012 12:43:12 +0000 (2 14:43 +0200)
tree1c360ade548d4abde8ea0d1de78fd21c72dc3bc7
parent3b69578cd2a138b8fa1260a0dd1fa943cba113cd
x86emu: fix jump_near_IMM to handle DATA: flag correctly

Before (data flag ignored -> broken):
66                  DATA:
e944f1              JMP       1ff6

After (fixed):
66                  DATA:
e944f1ffff          JMP       00001ff8

This subtle difference in the length of decoded instruction meant
that the VBE call jumped to the routine setting AX=0x14F (VBE Failed)
instead of the routine that set AX=0x4F (VBE success).

The ability to run the same code in vm86 significantly aided the
debugging of this issue. Those X.org developers who would like to drop
vm86 better take special care towards _all_ vesa bugs, as those will
expose further issues.

Imported from:
http://cgit.freedesktop.org/xorg/xserver/commit/hw/xfree86/x86emu?id=cc2c73ddcb4370a7c3ad439cda4da825156c26c9
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Change-Id: Id08ead9b17468cf19ede45508e5dcc50e45b5acf
Signed-off-by: Luc Verhaegen <libv@skynet.be>
Tested-by: Luc Verhaegen <libv@skynet.be>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-on: http://review.coreboot.org/1365
Tested-by: build bot (Jenkins)
Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
src/devices/oprom/x86emu/ops.c