qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] linux-user/riscv: Use abi type for target_ucontext
@ 2023-08-11  5:54 LIU Zhiwei
  2023-08-11 14:15 ` Philippe Mathieu-Daudé
  2023-08-11 14:35 ` Alistair Francis
  0 siblings, 2 replies; 3+ messages in thread
From: LIU Zhiwei @ 2023-08-11  5:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: richard.henderson, Alistair.Francis, palmer, bin.meng, liweiwei,
	dbarboza, qemu-riscv, philmd, LIU Zhiwei

We should not use types dependend on host arch for target_ucontext.
This bug is found when run rv32 applications.

Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
v2:
- Use abi_ptr instead of abi_ulong for uc_link. (Suggest by Philippe Mathieu-Daudé)
---
 linux-user/riscv/signal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/riscv/signal.c b/linux-user/riscv/signal.c
index eaa168199a..f989f7f51f 100644
--- a/linux-user/riscv/signal.c
+++ b/linux-user/riscv/signal.c
@@ -38,8 +38,8 @@ struct target_sigcontext {
 }; /* cf. riscv-linux:arch/riscv/include/uapi/asm/ptrace.h */
 
 struct target_ucontext {
-    unsigned long uc_flags;
-    struct target_ucontext *uc_link;
+    abi_ulong uc_flags;
+    abi_ptr uc_link;
     target_stack_t uc_stack;
     target_sigset_t uc_sigmask;
     uint8_t   __unused[1024 / 8 - sizeof(target_sigset_t)];
-- 
2.17.1



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

* Re: [PATCH v2] linux-user/riscv: Use abi type for target_ucontext
  2023-08-11  5:54 [PATCH v2] linux-user/riscv: Use abi type for target_ucontext LIU Zhiwei
@ 2023-08-11 14:15 ` Philippe Mathieu-Daudé
  2023-08-11 14:35 ` Alistair Francis
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-11 14:15 UTC (permalink / raw)
  To: LIU Zhiwei, qemu-devel
  Cc: richard.henderson, Alistair.Francis, palmer, bin.meng, liweiwei,
	dbarboza, qemu-riscv

On 11/8/23 07:54, LIU Zhiwei wrote:
> We should not use types dependend on host arch for target_ucontext.
> This bug is found when run rv32 applications.
> 
> Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
> v2:
> - Use abi_ptr instead of abi_ulong for uc_link. (Suggest by Philippe Mathieu-Daudé)
> ---
>   linux-user/riscv/signal.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




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

* Re: [PATCH v2] linux-user/riscv: Use abi type for target_ucontext
  2023-08-11  5:54 [PATCH v2] linux-user/riscv: Use abi type for target_ucontext LIU Zhiwei
  2023-08-11 14:15 ` Philippe Mathieu-Daudé
@ 2023-08-11 14:35 ` Alistair Francis
  1 sibling, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2023-08-11 14:35 UTC (permalink / raw)
  To: LIU Zhiwei
  Cc: qemu-devel, richard.henderson, Alistair.Francis, palmer, bin.meng,
	liweiwei, dbarboza, qemu-riscv, philmd

On Fri, Aug 11, 2023 at 1:57 AM LIU Zhiwei <zhiwei_liu@linux.alibaba.com> wrote:
>
> We should not use types dependend on host arch for target_ucontext.
> This bug is found when run rv32 applications.
>
> Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
> v2:
> - Use abi_ptr instead of abi_ulong for uc_link. (Suggest by Philippe Mathieu-Daudé)
> ---
>  linux-user/riscv/signal.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/linux-user/riscv/signal.c b/linux-user/riscv/signal.c
> index eaa168199a..f989f7f51f 100644
> --- a/linux-user/riscv/signal.c
> +++ b/linux-user/riscv/signal.c
> @@ -38,8 +38,8 @@ struct target_sigcontext {
>  }; /* cf. riscv-linux:arch/riscv/include/uapi/asm/ptrace.h */
>
>  struct target_ucontext {
> -    unsigned long uc_flags;
> -    struct target_ucontext *uc_link;
> +    abi_ulong uc_flags;
> +    abi_ptr uc_link;
>      target_stack_t uc_stack;
>      target_sigset_t uc_sigmask;
>      uint8_t   __unused[1024 / 8 - sizeof(target_sigset_t)];
> --
> 2.17.1
>
>


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

end of thread, other threads:[~2023-08-11 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11  5:54 [PATCH v2] linux-user/riscv: Use abi type for target_ucontext LIU Zhiwei
2023-08-11 14:15 ` Philippe Mathieu-Daudé
2023-08-11 14:35 ` Alistair Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).