diff options
author | John Baldwin <jhb@FreeBSD.org> | 2023-08-28 14:18:19 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2023-08-28 14:18:19 -0700 |
commit | d39b60f2e036f4af7224adf06c2d70bb3f8f71f3 (patch) | |
tree | ad8db1687a23ec30749888e39c20c58a469f871b /gdb/target.h | |
parent | b8a175b415454df6a039ba0b5d2ff13c3c180275 (diff) | |
download | gdb-d39b60f2e036f4af7224adf06c2d70bb3f8f71f3.zip gdb-d39b60f2e036f4af7224adf06c2d70bb3f8f71f3.tar.gz gdb-d39b60f2e036f4af7224adf06c2d70bb3f8f71f3.tar.bz2 |
x86: Add an x86_xsave_layout structure to handle variable XSAVE layouts.
The standard layout of the XSAVE extended state area consists of three
regions. The first 512 bytes (legacy region) match the layout of the
FXSAVE instruction including floating point registers, MMX registers,
and SSE registers. The next 64 bytes (XSAVE header) contains a header
with a fixed layout. The final region (extended region) contains zero
or more optional state components. Examples of these include the
upper 128 bits of YMM registers for AVX.
These optional state components generally have an
architecturally-fixed size, but they are not assigned architectural
offsets in the extended region. Instead, processors provide
additional CPUID leafs describing the size and offset of each
component in the "standard" layout for a given CPU. (There is also a
"compact" format which uses an alternate layout, but existing OS's
currently export the "standard" layout when exporting XSAVE data via
ptrace() and core dumps.)
To date, GDB has assumed the layout used on current Intel processors
for state components in the extended region and hardcoded those
offsets in the tables in i387-tdep.c and i387-fp.cc. However, this
fails on recent AMD processors which use a different layout.
Specifically, AMD Zen3 and later processors do not leave space for the
MPX register set in between the AVX and AVX512 register sets.
To rectify this, add an x86_xsave_layout structure which contains the
total size of the XSAVE extended state area as well as the offset of
each known optional state component.
Subsequent commits will modify XSAVE parsing in both gdb and gdbserver
to use x86_xsave_layout.
Co-authored-by: Aleksandar Paunovic <aleksandar.paunovic@intel.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/target.h')
0 files changed, 0 insertions, 0 deletions