From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: kernel-janitors@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org
Subject: Re: [tip:x86:fpu 2/2] arch/x86/kernel/signal.c:626:4: error: implicit declaration of function '__setup_frame'
Date: Thu, 26 Jul 2012 10:48:04 -0700 [thread overview]
Message-ID: <1343324885.3696.527.camel@sbsiddha-desk.sc.intel.com> (raw)
In-Reply-To: <20120725232716.GB5758@localhost>
On Thu, 2012-07-26 at 07:27 +0800, Fengguang Wu wrote:
> Hi Suresh,
>
> Kernel build failed on
>
> tree: tip/x86/fpu x86/fpu
> head: 29221d4b89d4e50f05ade42ad3b22e92bb564ca4
> commit: 29221d4b89d4e50f05ade42ad3b22e92bb564ca4 [2/2] x86, fpu: Unify signal handling code paths for x86 and x86_64 kernels
> config: x86_64-randconfig-s003 (attached as .config)
>
> All related error/warning messages:
>
> arch/x86/kernel/signal.c: In function 'setup_rt_frame':
> arch/x86/kernel/signal.c:626:4: error: implicit declaration of function '__setup_frame' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> --
> arch/x86/kernel/xsave.c: In function 'save_fsave_header':
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: 'X86_FXSR_MAGIC' undeclared (first use in this function)
> arch/x86/kernel/xsave.c:145:7: note: each undeclared identifier is reported only once for each function it appears in
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c:145:7: error: dereferencing pointer to incomplete type
> arch/x86/kernel/xsave.c: In function 'save_user_xstate':
> arch/x86/kernel/xsave.c:209:15: warning: ignoring return value of '__clear_user', declared with attribute warn_unused_result [-Wunused-result]
>
Appended the patch for this. Thanks!
---
From: Suresh Siddha <suresh.b.siddha@intel.com>
Subject: x86, fpu: fix x86_64 build without CONFIG_IA32_EMULATION
Fengguang's automated build reported some compilation failures:
> arch/x86/kernel/signal.c: In function 'setup_rt_frame':
> arch/x86/kernel/signal.c:626:4: error: implicit declaration of function '__setup_frame'
> arch/x86/kernel/xsave.c: In function 'save_fsave_header':
> arch/x86/kernel/xsave.c:144:7: error: dereferencing pointer to incomplete type
> ...
Fix x86_64 kernel build without CONFIG_IA32_EMULATION.
Code saving fsave prefix is applicable only for CONFIG_X86_32 or
CONFIG_IA32_EMULATION. Use config_enabled() checks to remove the unnecessary
code compile-time for x86_64 kernels build without CONFIG_IA32_EMULATION.
Also while we are at this, fix a spurious warning:
> arch/x86/kernel/xsave.c:209:15: warning: ignoring return value of ‘__clear_user’, declared with attribute warn_unused_result
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
arch/x86/include/asm/fpu-internal.h | 2 +-
arch/x86/kernel/xsave.c | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h
index 35ad161..5779184 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -22,7 +22,7 @@
#include <asm/uaccess.h>
#include <asm/xsave.h>
-#ifdef CONFIG_IA32_EMULATION
+#ifdef CONFIG_X86_64
# include <asm/sigcontext32.h>
# include <asm/user32.h>
int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 2917e34..a23d100 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -205,8 +205,8 @@ static inline int save_user_xstate(struct xsave_struct __user *buf)
else
err = fsave_user((struct i387_fsave_struct __user *) buf);
- if (unlikely(err))
- __clear_user(buf, xstate_size);
+ if (unlikely(err) && __clear_user(buf, xstate_size))
+ err = -EFAULT;
return err;
}
@@ -236,6 +236,9 @@ int save_xstate_sig(void __user *buf, void __user *buf_fx, int size)
struct task_struct *tsk = current;
int ia32_fxstate = (buf != buf_fx);
+ ia32_fxstate &= (config_enabled(CONFIG_X86_32) ||
+ config_enabled(CONFIG_IA32_EMULATION));
+
if (!access_ok(VERIFY_WRITE, buf, size))
return -EACCES;
@@ -333,6 +336,9 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size)
u64 xstate_bv = 0;
int fx_only = 0;
+ ia32_fxstate &= (config_enabled(CONFIG_X86_32) ||
+ config_enabled(CONFIG_IA32_EMULATION));
+
if (!buf) {
drop_fpu(tsk);
return 0;
next parent reply other threads:[~2012-07-26 17:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120725232716.GB5758@localhost>
2012-07-26 17:48 ` Suresh Siddha [this message]
2012-08-08 22:34 ` H. Peter Anvin
2012-08-09 20:38 ` Suresh Siddha
2012-08-10 3:56 ` [tip:x86/fpu] x86, fpu: fix build issues with CONFIG_IA32_EMULATION, CONFIG_X86_X32_ABI tip-bot for Suresh Siddha
2012-09-18 23:59 ` [tip:x86/fpu] x86, signal: Cleanup ifdefs and is_ia32, is_x32 tip-bot for Suresh Siddha
2012-09-19 0:01 ` [tip:x86/fpu] x86, fpu: Unify signal handling code paths for x86 and x86_64 kernels tip-bot for Suresh Siddha
2012-07-24 23:05 [PATCH 0/3] x86, fpu signal handling code unification Suresh Siddha
2012-07-24 23:05 ` [PATCH 1/3] x86, signal: cleanup ifdefs and is_ia32, is_x32 Suresh Siddha
2012-07-25 21:55 ` [tip:x86/fpu] x86, signal: Cleanup " tip-bot for Suresh Siddha
2012-07-24 23:05 ` [PATCH 2/3] x86, fpu: consolidate inline asm routines for saving/restoring fpu state Suresh Siddha
2012-07-25 21:56 ` [tip:x86/fpu] x86, fpu: Consolidate inline asm routines for saving /restoring " tip-bot for Suresh Siddha
2012-09-19 0:00 ` tip-bot for Suresh Siddha
2012-09-25 22:58 ` [tip:x86/smap] x86, smap: Do not abuse the [f][x]rstor_checking() functions for user space tip-bot for H. Peter Anvin
2012-07-24 23:05 ` [PATCH 3/3] x86, fpu: unify signal handling code paths for x86 and x86_64 kernels Suresh Siddha
2012-07-25 21:57 ` [tip:x86/fpu] x86, fpu: Unify " tip-bot for Suresh Siddha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343324885.3696.527.camel@sbsiddha-desk.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=fengguang.wu@intel.com \
--cc=hpa@zytor.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®