From fd75e4d264d305347647a29ae2dab56c9f3967c9 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sun, 22 Oct 2017 14:56:12 -0700 Subject: uml: Add 4.9 kernel patches 102-pseudo-random-mac.patch required an update to the new style asynchronous crypto Signed-off-by: Florian Fainelli --- ...-um-Fix-check-for-_xstate-for-older-hosts.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch (limited to 'target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch') diff --git a/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch new file mode 100644 index 0000000000..b31ca4191b --- /dev/null +++ b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch @@ -0,0 +1,46 @@ +From 2fb44600fe784449404c6639de26af8361999ec7 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 18 Jul 2017 16:43:47 -0700 +Subject: [PATCH] um: Fix check for _xstate for older hosts + +Commit 0a987645672e ("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 61e8d462457f ("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: 61e8d462457f ("um: Correctly check for PTRACE_GETRESET/SETREGSET") +Fixes: 0a987645672e ("um: Allow building and running on older hosts") +Signed-off-by: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/x86/um/user-offsets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/um/user-offsets.c ++++ b/arch/x86/um/user-offsets.c +@@ -50,7 +50,7 @@ void foo(void) + DEFINE(HOST_GS, GS); + DEFINE(HOST_ORIG_AX, ORIG_EAX); + #else +-#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) ++#ifdef FP_XSTATE_MAGIC1 + DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long)); + #else + DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long)); -- cgit v1.2.3