unicorn/qemu/target/i386
Andrew Oates efa10a2286
target-i386: Fix lcall/ljmp to call gate in IA-32e mode
Currently call gates are always treated as 32-bit gates. In IA-32e mode
(either compatibility or 64-bit submode), system segment descriptors are
always 64-bit. Treating them as 32-bit has the expected unfortunate
effect: only the lower 32 bits of the offset are loaded, the stack
pointer is truncated, a bad new stack pointer is loaded from the TSS (if
switching privilege levels), etc.

This change adds support for 64-bit call gate to the lcall and ljmp
instructions. Additionally, there should be a check for non-canonical
stack pointers, but I've omitted that since there doesn't seem to be
checks for non-canonical addresses in this code elsewhere.

I've left the raise_exception_err_ra lines unwapped at 80 columns to
match the style in the rest of the file.

Backports commit 0aca060526d3ff9632aaed66e8611814580c13de from qemu
2018-08-25 03:30:13 -04:00
..
arch_memory_mapping.c target/i386: enable A20 automatically in system management mode 2018-03-03 14:33:09 -05:00
bpt_helper.c target/i386/bpt_helper: Perform comparison pass with qemu 2018-03-12 13:28:50 -04:00
cc_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cc_helper_template.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cpu-qom.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
cpu.c i386: Disable TOPOEXT by default on "-cpu host" 2018-08-17 14:34:02 -04:00
cpu.h i386: Add CPUID bit for WBNOINVD 2018-08-17 14:29:10 -04:00
excp_helper.c target/i386/excp_helper: remove unnecessary comment 2018-03-12 13:16:53 -04:00
fpu_helper.c target/i386/fpu_helper: Perform comparison pass against qemu 2018-03-12 13:15:51 -04:00
helper.c icount: fix cpu_restore_state_from_tb for non-tb-exit cases 2018-04-11 20:05:40 -04:00
helper.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
int_helper.c Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
Makefile.objs target/i386: add the CONFIG_TCG into Makefiles 2018-03-03 21:57:22 -05:00
mem_helper.c target-i386: Add NPT support 2018-07-03 19:52:56 -04:00
misc_helper.c i386: implement MSR_SMI_COUNT for TCG 2018-08-02 21:27:08 -04:00
mpx_helper.c target/i386: move cpu_sync_bndcs_hflags() function 2018-03-03 21:41:26 -05:00
ops_sse.h target/i386: fix phminposuw in-place operation 2018-03-04 23:59:26 -05:00
ops_sse_header.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
seg_helper.c target-i386: Fix lcall/ljmp to call gate in IA-32e mode 2018-08-25 03:30:13 -04:00
shift_helper_template.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
smm_helper.c i386: implement MSR_SMI_COUNT for TCG 2018-08-02 21:27:08 -04:00
svm.h target-i386: Add NPT support 2018-07-03 19:52:56 -04:00
svm_helper.c target-i386: Add NPT support 2018-07-03 19:52:56 -04:00
TODO Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
topology.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00
translate.c target-i386: Allow interrupt injection after STGI 2018-07-03 01:29:43 -04:00
unicorn.c pc: Don't use QEMUMachine anymore 2018-03-09 14:22:43 -05:00
unicorn.h Move target-* CPU file into a target/ folder 2018-03-01 22:50:58 -05:00