gem5/src/arch/x86/isa/insts/general_purpose
Jason Lowe-Power 153e5879c6 x86: Fix implicit stack addressing in 64-bit mode
When in 64-bit mode, if the stack is accessed implicitly by an instruction
the alternate address prefix should be ignored if present.

This patch adds an extra flag to the ldstop which signifies when the
address override should be ignored. Then, for all of the affected
instructions, this patch adds two options to the ld and st opcode to use
the current stack addressing mode for all addresses and to ignore the
AddressSizeFlagBit.  Finally, this patch updates the x86 TLB to not
truncate the address if it is in 64-bit mode and the IgnoreAddrSizeFlagBit
is set.

This fixes a problem when calling __libc_start_main with a binary that is
linked with a recent version of ld. This version of ld uses the address
override prefix (0x67) on the call instruction instead of a nop.

Note: This has not been tested in compatibility mode and only the call
instruction with the address override prefix has been tested.

See [1] page 9 (pdf page 45)

For instructions that are affected see [1] page 519 (pdf page 555).

[1] http://support.amd.com/TechDocs/24594.pdf

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2017-02-10 11:19:34 -05:00
..
arithmetic X86: Fix the IMUL_R_P_I macroop. 2012-04-29 02:26:34 -07:00
compare_and_test arch: Use shared_ptr for all Faults 2014-10-16 05:49:51 -04:00
control_transfer x86: Fix implicit stack addressing in 64-bit mode 2017-02-10 11:19:34 -05:00
data_conversion copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
data_transfer x86: Fix implicit stack addressing in 64-bit mode 2017-02-10 11:19:34 -05:00
flags X86: Replace the stupd microop with a store/update sequence. 2011-02-02 19:56:38 -08:00
input_output X86: Add memory fence to I/O instructions 2012-01-09 20:13:31 -06:00
rotate_and_shift copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
string copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
__init__.py copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
cache_and_memory_management.py copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
load_effective_address.py copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
load_segment_registers.py copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
logical.py x86: Add microop for fence 2011-11-03 22:52:21 -05:00
no_operation.py copyright: Change HP copyright on x86 code to be more friendly 2010-05-23 22:44:15 -07:00
semaphores.py x86: revamp cmpxchg8b/cmpxchg16b implementation 2016-02-06 17:21:20 -08:00
system_calls.py style: remove trailing whitespace 2016-02-06 17:21:18 -08:00