diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-05-25 11:36:26 -0700 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2017-07-05 23:31:28 +0200 |
commit | 0a987645672ebde7844a9c0732a5a25f3d4bb6c6 (patch) | |
tree | 838f821a1b4a2ba33219fabac4913ad0a00180f4 /arch/x86/um/user-offsets.c | |
parent | f44f1e7da7c8e3f4575d5d61c4df978496903fcc (diff) | |
download | linux-stable-0a987645672ebde7844a9c0732a5a25f3d4bb6c6.tar.gz linux-stable-0a987645672ebde7844a9c0732a5a25f3d4bb6c6.tar.bz2 linux-stable-0a987645672ebde7844a9c0732a5a25f3d4bb6c6.zip |
um: Allow building and running on older hosts
Commit a78ff1112263 ("um: add extended processor state save/restore
support") and b6024b21fec8 ("um: extend fpstate to _xstate to support
YMM registers") forced the use of the x86 FP _xstate and
PTRACE_GETREGSET/SETREGSET. On older hosts, we would neither be able to
build UML nor run it anymore with these two commits applied because we
don't have definitions for struct _xstate nor these two ptrace requests.
We can determine at build time which fp context structure to check
against, just like we can keep using the old i387 fp save/restore if
PTRACE_GETRESET/SETREGSET are not defined.
Fixes: a78ff1112263 ("um: add extended processor state save/restore support")
Fixes: b6024b21fec8 ("um: extend fpstate to _xstate to support YMM registers")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/x86/um/user-offsets.c')
-rw-r--r-- | arch/x86/um/user-offsets.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/um/user-offsets.c b/arch/x86/um/user-offsets.c index cb3c22370cf5..8af0fb5d2780 100644 --- a/arch/x86/um/user-offsets.c +++ b/arch/x86/um/user-offsets.c @@ -50,7 +50,11 @@ void foo(void) DEFINE(HOST_GS, GS); DEFINE(HOST_ORIG_AX, ORIG_EAX); #else +#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long)); +#else + DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long)); +#endif DEFINE_LONGS(HOST_BX, RBX); DEFINE_LONGS(HOST_CX, RCX); DEFINE_LONGS(HOST_DI, RDI); |