mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
MIPS: signal: Remove FP context support when CONFIG_MIPS_FP_SUPPORT=n
When CONFIG_MIPS_FP_SUPPORT=n we don't support floating point, so there's no need to save & restore floating point context around signals. This prepares us for the removal of FP context from struct task_struct later. Since MSA context is a superset of FP context support for it similarly needs to be removed when MSA/FP support is disabled. Signed-off-by: Paul Burton <paul.burton@mips.com> Patchwork: https://patchwork.linux-mips.org/patch/21009/ Cc: linux-mips@linux-mips.org
This commit is contained in:
parent
6c79759eca
commit
4eec81d7d8
1 changed files with 34 additions and 5 deletions
|
@ -62,6 +62,8 @@ struct rt_sigframe {
|
||||||
struct ucontext rs_uc;
|
struct ucontext rs_uc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_MIPS_FP_SUPPORT
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Thread saved context copy to/from a signal context presumed to be on the
|
* Thread saved context copy to/from a signal context presumed to be on the
|
||||||
* user stack, and therefore accessed with appropriate macros from uaccess.h.
|
* user stack, and therefore accessed with appropriate macros from uaccess.h.
|
||||||
|
@ -104,6 +106,20 @@ static int copy_fp_from_sigcontext(void __user *sc)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* !CONFIG_MIPS_FP_SUPPORT */
|
||||||
|
|
||||||
|
static int copy_fp_to_sigcontext(void __user *sc)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int copy_fp_from_sigcontext(void __user *sc)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* !CONFIG_MIPS_FP_SUPPORT */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wrappers for the assembly _{save,restore}_fp_context functions.
|
* Wrappers for the assembly _{save,restore}_fp_context functions.
|
||||||
*/
|
*/
|
||||||
|
@ -142,6 +158,8 @@ static inline void __user *sc_to_extcontext(void __user *sc)
|
||||||
return &uc->uc_extcontext;
|
return &uc->uc_extcontext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_CPU_HAS_MSA
|
||||||
|
|
||||||
static int save_msa_extcontext(void __user *buf)
|
static int save_msa_extcontext(void __user *buf)
|
||||||
{
|
{
|
||||||
struct msa_extcontext __user *msa = buf;
|
struct msa_extcontext __user *msa = buf;
|
||||||
|
@ -195,9 +213,6 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size)
|
||||||
unsigned int csr;
|
unsigned int csr;
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
if (!IS_ENABLED(CONFIG_CPU_HAS_MSA))
|
|
||||||
return SIGSYS;
|
|
||||||
|
|
||||||
if (size != sizeof(*msa))
|
if (size != sizeof(*msa))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -234,6 +249,20 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* !CONFIG_CPU_HAS_MSA */
|
||||||
|
|
||||||
|
static int save_msa_extcontext(void __user *buf)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int restore_msa_extcontext(void __user *buf, unsigned int size)
|
||||||
|
{
|
||||||
|
return SIGSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* !CONFIG_CPU_HAS_MSA */
|
||||||
|
|
||||||
static int save_extcontext(void __user *buf)
|
static int save_extcontext(void __user *buf)
|
||||||
{
|
{
|
||||||
int sz;
|
int sz;
|
||||||
|
@ -880,7 +909,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
|
||||||
user_enter();
|
user_enter();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#if defined(CONFIG_SMP) && defined(CONFIG_MIPS_FP_SUPPORT)
|
||||||
static int smp_save_fp_context(void __user *sc)
|
static int smp_save_fp_context(void __user *sc)
|
||||||
{
|
{
|
||||||
return raw_cpu_has_fpu
|
return raw_cpu_has_fpu
|
||||||
|
@ -908,7 +937,7 @@ static int signal_setup(void)
|
||||||
(offsetof(struct rt_sigframe, rs_uc.uc_extcontext) -
|
(offsetof(struct rt_sigframe, rs_uc.uc_extcontext) -
|
||||||
offsetof(struct rt_sigframe, rs_uc.uc_mcontext)));
|
offsetof(struct rt_sigframe, rs_uc.uc_mcontext)));
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#if defined(CONFIG_SMP) && defined(CONFIG_MIPS_FP_SUPPORT)
|
||||||
/* For now just do the cpu_has_fpu check when the functions are invoked */
|
/* For now just do the cpu_has_fpu check when the functions are invoked */
|
||||||
save_fp_context = smp_save_fp_context;
|
save_fp_context = smp_save_fp_context;
|
||||||
restore_fp_context = smp_restore_fp_context;
|
restore_fp_context = smp_restore_fp_context;
|
||||||
|
|
Loading…
Reference in a new issue