xserver/hw/xfree86
Julian Pidancet 59b618227e x86emu: Correctly handle 0x66 prefix for some instructions
(Sorry for double posting)

I repost this patch because I havn't got any replies from maintainers
since I posted the initial patch back in March.

Some instructions are not emulated correctly by x86emu when they
are prefixed by the 0x66 opcode.
I've identified problems in the emulation of these intructions: ret,
enter, leave, iret and some forms of call.

Most of the time, the problem is that these instructions should push or
pop 32-bit values to/from the stack, instead of 16bit, when they are
prefixed by the 0x66 special opcode.

The SeaBIOS project aims to produce a complete legacy BIOS
implementation as well as a VGA option ROM, entirely written in C and
using the GCC compiler.

In 16bit code produced by the GCC compiler, the 0x66 prefix is used
almost everywhere. This patch is necessary to allow the SeaBIOS VGA
option ROM to function with Xorg when using the vesa driver.

SeaBIOS currently use postprocessing on the ROM assembly output to
replace the affected instruction with alternative unaffected instructions.
This is obviously not very elegant, and this fix in x86emu would be
more appropriate.

v2: - Decrement BP instead of EBP in accordance with the Intel Manual
    - Assign EIP instead of IP when poping the return address from the
    stack in 32-bit operand size mode in ret_far_IMM, ret_far, and iret
    - When poping EFLAGS from the stack in iret in 32-bit operand size
    mode, apply some mask to preserve Read-only flags.

v3: - Rebase

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2015-12-07 14:49:36 -05:00
..
common Revert "hw/xfree86: Use NotifyFd for device and other input fd wakeups" 2015-12-02 10:42:36 -05:00
ddc Convert hw/xfree86 to new *allocarray functions 2015-04-21 16:58:08 -07:00
dixmods Also dump passive grabs on XF86LogGrabInfo 2015-11-10 15:12:21 +10:00
doc xfree86: Hide some pre-randr mode validation details 2015-07-08 16:40:57 -04:00
dri debug output format fix in DRISwapContext() 2015-08-28 12:06:51 +01:00
dri2 DRI2: Sync radeonsi_pci_ids.h from Mesa 2015-10-27 10:47:25 -04:00
drivers modesetting: create entities for pci and old probe. (v2) 2015-12-07 11:20:26 +10:00
exa build: Remove stale miext/cw include paths 2015-10-27 13:46:13 -04:00
fbdevhw fbdevhw: Fix a const qualifier warning 2015-09-23 15:18:24 -04:00
glamor_egl glamor: Share code for put_image handling. 2014-06-15 23:20:09 +01:00
i2c Convert hw/xfree86 to new *allocarray functions 2015-04-21 16:58:08 -07:00
int10 int10: Fix error check for pci_device_map_legacy 2015-03-13 12:31:21 +10:00
loader Replace 'sun' with '__sun' 2015-11-30 11:51:22 -05:00
man Xorg.man: update to reflect -nolisten tcp becoming default 2015-10-28 14:16:20 -04:00
modes xfree86: Fix the 1792x1344-75 EST III mode 2015-09-23 13:18:22 -04:00
os-support Replace 'sun' with '__sun' 2015-11-30 11:51:22 -05:00
parser libxf86config: libxf86config_internal -> libxf86config 2015-09-23 14:29:21 -04:00
ramdac debug output format fix in TI.c 2015-08-28 12:06:39 +01:00
shadowfb Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
utils Add XNFcallocarray() to allow xnfcalloc() to check for overflow 2015-04-21 16:57:07 -07:00
vbe Convert hw/xfree86 to new *allocarray functions 2015-04-21 16:58:08 -07:00
vgahw Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
x86emu x86emu: Correctly handle 0x66 prefix for some instructions 2015-12-07 14:49:36 -05:00
.gitignore Xorg: Add Xorg.wrap to hw/xfree86/.gitignore 2014-04-18 11:39:16 +02:00
Makefile.am build: Remove stale miext/cw include paths 2015-10-27 13:46:13 -04:00
Xorg.sh.in xfree86: rename Xorg.bin to Xorg 2015-01-05 09:53:58 +10:00
sdksyms.sh vidmode: Hide implementation details 2015-07-08 16:40:58 -04:00
xorg-wrapper.c Xorg.wrap: activate libdrm based detection for KMS drivers 2015-12-03 11:05:37 -05:00
xorgconf.cpp xfree86: fix wrong DontZap documentation (#71113) 2014-05-24 20:02:56 +10:00