[PATCH] um: always use the internal copy of the FP registers

Benjamin Berg benjamin at sipsolutions.net
Fri Sep 13 06:17:52 PDT 2024


Hi,

On Fri, 2024-09-13 at 21:09 +0800, Tiwei Bie wrote:
> On 2024/9/13 16:22, Benjamin Berg wrote:
> > From: Benjamin Berg <benjamin.berg at intel.com>
> > [SNIP]
> > diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
> > index be2856af6d4c..ad798d40f8a4 100644
> > --- a/arch/um/kernel/process.c
> > +++ b/arch/um/kernel/process.c
> > @@ -290,8 +290,15 @@ unsigned long __get_wchan(struct task_struct *p)
> >  
> >  int elf_core_copy_task_fpregs(struct task_struct *t, elf_fpregset_t *fpu)
> >  {
> > -	int cpu = current_thread_info()->cpu;
> > +#ifdef CONFIG_X86_32
> > +	extern int have_fpx_regs;
> >  
> > -	return save_i387_registers(userspace_pid[cpu], (unsigned long *) fpu);
> > +	/* FIXME: A plain copy does not work on i386 with have_fpx_regs */
> > +	if (have_fpx_regs)
> > +		return -1;
> > +#endif
> > +	memcpy(fpu, &t->thread.regs.regs.fp, sizeof(*fpu));
> > +
> > +	return 0;
> >  }
> 
> This function is expected to return a boolean value which should be
> true on success.

Hah, of course. And there I was partially doing all of this because of
your patch fixing exactly that problem (and because the current code
cannot work in SECCOMP mode) …

Benjamin



More information about the linux-um mailing list