|
From: | Richard Henderson |
Subject: | Re: [PATCH v18 02/13] linux-user: Add LoongArch signal support |
Date: | Tue, 21 Jun 2022 07:12:16 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 |
On 6/20/22 20:56, gaosong wrote:
My understanding is that the struct exctx need lock_user_struct/unlock_user_struct, then we can use __get/__put the struct extctx.This is missing lock_user/unlock_user somewhere. You can't use the double-underscore __get/__put_user without having done that.
No, extctx does not exist in target memory. It is purely local to the signal implementation as a way of tracking the layout.
This is why I suggested statically allocating the extra pieces of the signal frame *on write*. You obviously cannot rely on the signal frame being identical on signal return -- the guest is allowed to create any valid context to give to rt_sigreturn.I don’t know if my understanding is correct, we can put the exctx or target_fpu_context into target_rt_sigframe, like this: struct target_rt_sigframe { struct target_siginfo rs_info; struct target_ucontext rs_uc; struct extctx_layout rs_ext; };
No. You need to look at what the code in setup_extcontext does. It allocates two sctx_info and one fpu_context on the stack. Thus the structure would look like struct target_rt_sigframe { struct target_siginfo rs_info; struct target_ucontext rs_uc; struct sctx_info rs_fpu_info QEMU_ALIGNED(16); struct target_fp_context rs_fpu; struct sctx_info rs_end_info QEMU_ALIGNED(16); }; r~
[Prev in Thread] | Current Thread | [Next in Thread] |