gdb: Consolidate 32bit-pkeys.xml and 64bit-pkeys.xml

1. Since 32bit-pkeys.xml and 64bit-pkeys.xml are identical, consolidate
them into a single keys.xml.
2. Enable PKU for x32 to fix:

$ gdbserver :123456 x32-program
...
.../gdbserver/regcache.cc:255: A problem internal to GDBserver has been detected
.
Unknown register pkru requested

on Tiger Lake.
This commit is contained in:
H.J. Lu
2022-02-24 07:34:01 -08:00
parent 5a0c4a06eb
commit 0653f01479
8 changed files with 12 additions and 38 deletions

View File

@@ -1578,14 +1578,16 @@ amd64_linux_read_description (uint64_t xcr0_features_bit, bool is_x32)
{
static target_desc *amd64_linux_tdescs \
[2/*AVX*/][2/*MPX*/][2/*AVX512*/][2/*PKRU*/] = {};
static target_desc *x32_linux_tdescs[2/*AVX*/][2/*AVX512*/] = {};
static target_desc *x32_linux_tdescs \
[2/*AVX*/][2/*AVX512*/][2/*PKRU*/] = {};
target_desc **tdesc;
if (is_x32)
{
tdesc = &x32_linux_tdescs[(xcr0_features_bit & X86_XSTATE_AVX) ? 1 : 0 ]
[(xcr0_features_bit & X86_XSTATE_AVX512) ? 1 : 0];
[(xcr0_features_bit & X86_XSTATE_AVX512) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_PKRU) ? 1 : 0];
}
else
{