linux-um archives
 help / color / mirror / Atom feed
* Re: [uml-devel] [PATCH] um: v3: Fix FP register size for XSTATE/XSAVE
@ 2017-07-12 15:11 Thomas Meyer
  2017-07-12 19:18 ` Richard Weinberger
  2017-07-12 19:53 ` Richard Weinberger
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Meyer @ 2017-07-12 15:11 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: user-mode-linux-devel

[-- Attachment #1: Type: text/html, Size: 2152 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 194 bytes --]

_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [uml-devel] [PATCH] um: v2: Fix FP register size for XSTATE/XSAVE
@ 2017-07-07 22:13 Richard Weinberger
  2017-07-09 22:33 ` [uml-devel] [PATCH] um: v3: " Thomas Meyer
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Weinberger @ 2017-07-07 22:13 UTC (permalink / raw)
  To: Thomas Meyer; +Cc: user-mode-linux-devel@lists.sourceforge.net

Thomas,

On Fri, Jul 7, 2017 at 11:01 PM, Thomas Meyer <thomas@m3y3r.de> 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 <thomas@m3y3r.de>
> ---
>  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

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-29 15:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 15:11 [uml-devel] [PATCH] um: v3: Fix FP register size for XSTATE/XSAVE Thomas Meyer
2017-07-12 19:18 ` Richard Weinberger
2017-07-17 20:59   ` Thomas Meyer
2017-07-12 19:53 ` Richard Weinberger
2017-07-29 15:03   ` [uml-devel] [PATCH] um: v4: " Thomas Meyer
  -- strict thread matches above, loose matches on Subject: below --
2017-07-07 22:13 [uml-devel] [PATCH] um: v2: " Richard Weinberger
2017-07-09 22:33 ` [uml-devel] [PATCH] um: v3: " Thomas Meyer
2017-07-10 19:06   ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox