|
From: Richard W. <ric...@gm...> - 2017-07-07 22:13:45
|
Thomas, On Fri, Jul 7, 2017 at 11:01 PM, Thomas Meyer <th...@m3...> wrote: > Hard code max size. Taken from > https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/common/x86-xstate.h > > Signed-off-by: Thomas Meyer <th...@m3...> > --- > arch/um/os-Linux/skas/process.c | 22 ++++++++++++++++++---- > arch/x86/um/os-Linux/registers.c | 16 +++++++++++----- > arch/x86/um/user-offsets.c | 2 +- > 3 files changed, 30 insertions(+), 10 deletions(-) > > diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c > index 03b3c4cc7735..1a7cce387950 100644 > --- a/arch/um/os-Linux/skas/process.c > +++ b/arch/um/os-Linux/skas/process.c > @@ -91,19 +91,25 @@ extern unsigned long current_stub_stack(void); > static void get_skas_faultinfo(int pid, struct faultinfo *fi) > { > int err; > - unsigned long fpregs[FP_SIZE]; > + void * fpregs; > + > + fpregs = malloc(FP_SIZE * sizeof(unsigned long)); > + if(fpregs == NULL) { > + printk(UM_KERN_ERR "cannot alloc memory for save_fp_registers!"); > + goto errout; > + } Having a malloc() here is rather expensive. I suggest to allocate a buffer in userspace() that can be used in get_skas_faultinfo(). Thanks, //richard -- Thanks, //richard |