Skip to content

Commit 2fb4460

Browse files
ffainellirichardweinberger
authored andcommitted
um: Fix check for _xstate for older hosts
Commit 0a98764 ("um: Allow building and running on older hosts") attempted to check for PTRACE_{GET,SET}REGSET under the premise that these ptrace(2) parameters were directly linked with the presence of the _xstate structure. After Richard's commit 61e8d46 ("um: Correctly check for PTRACE_GETRESET/SETREGSET") which properly included linux/ptrace.h instead of asm/ptrace.h, we could get into the original build failure that I reported: arch/x86/um/user-offsets.c: In function 'foo': arch/x86/um/user-offsets.c:54: error: invalid application of 'sizeof' to incomplete type 'struct _xstate' On this particular host, we do have PTRACE_GETREGSET and PTRACE_SETREGSET defined in linux/ptrace.h, but not the structure _xstate that should be pulled from the following include chain: signal.h -> bits/sigcontext.h. Correctly fix this by checking for FP_XSTATE_MAGIC1 which is the correct way to see if struct _xstate is available or not on the host. Fixes: 61e8d46 ("um: Correctly check for PTRACE_GETRESET/SETREGSET") Fixes: 0a98764 ("um: Allow building and running on older hosts") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 14ccee7 commit 2fb4460

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/um/user-offsets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void foo(void)
5050
DEFINE(HOST_GS, GS);
5151
DEFINE(HOST_ORIG_AX, ORIG_EAX);
5252
#else
53-
#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET)
53+
#ifdef FP_XSTATE_MAGIC1
5454
DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long));
5555
#else
5656
DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));

0 commit comments

Comments
 (0)