All of lore.kernel.org
 help / color / mirror / Atom feed
From: LIU Zhiwei <baxiantai@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"LIU Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	qemu-devel@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>
Cc: Alistair.Francis@wdc.com, palmer@dabbelt.com,
	bin.meng@windriver.com, liweiwei@iscas.ac.cn,
	dbarboza@ventanamicro.com, qemu-riscv@nongnu.org
Subject: Re: [PATCH] linux-user/riscv: Use abi_ulong for target_ucontext
Date: Fri, 11 Aug 2023 11:17:37 +0800	[thread overview]
Message-ID: <ff7a949f-e2dc-8936-70cb-e11703936ca2@gmail.com> (raw)
In-Reply-To: <64635d96-26d9-a00c-cf2f-aa92d7162061@linaro.org>


On 2023/8/10 18:48, Philippe Mathieu-Daudé wrote:
> On 8/8/23 11:34, 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>
>> ---
>>   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..ff8634a272 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;
>
> Correct.
>
>> +    abi_ulong uc_link;
>
> Isn't it 'abi_ptr uc_link' instead?

Thanks, I think abi_ptr is better. As RISC-V doesn't has similar ABI as 
sparc32plus(64bit long but 32bit space address). It is also right here. 
And many arches  use the abi_ulong for uc_link, such as ARM.

I will send a v2 patch.

Zhiwei

>
>>       target_stack_t uc_stack;
>>       target_sigset_t uc_sigmask;
>>       uint8_t   __unused[1024 / 8 - sizeof(target_sigset_t)];
>
>


      reply	other threads:[~2023-08-11  3:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  9:34 [PATCH] linux-user/riscv: Use abi_ulong for target_ucontext LIU Zhiwei
2023-08-08 11:29 ` Daniel Henrique Barboza
2023-08-08 14:28 ` Richard Henderson
2023-08-10 10:48 ` Philippe Mathieu-Daudé
2023-08-11  3:17   ` LIU Zhiwei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff7a949f-e2dc-8936-70cb-e11703936ca2@gmail.com \
    --to=baxiantai@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=palmer@dabbelt.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.