qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Anton Johansson <anjo@rev.ng>, Brian Cain <brian.cain@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org, philmd@linaro.org,
	matheus.bernardino@oss.qualcomm.com, ale@rev.ng,
	marco.liebel@oss.qualcomm.com, ltaylorsimpson@gmail.com,
	alex.bennee@linaro.org, quic_mburton@quicinc.com,
	sid.manning@oss.qualcomm.com,
	"Alex Rønne Petersen" <alex@alexrp.com>,
	"Laurent Vivier" <laurent@vivier.eu>
Subject: Re: [PATCH 1/2] linux-user/hexagon: Fix sigcontext
Date: Wed, 8 Oct 2025 09:02:45 -0700	[thread overview]
Message-ID: <7bf3d8c5-df07-4cbd-ba62-4c7246a5f96b@linaro.org> (raw)
In-Reply-To: <37cyiiwd6ktmjvfue7t6ifw727p4pdl52wfpbuyll7aqsocxk7@6wro7hlwb6mc>

On 10/8/25 08:27, Anton Johansson wrote:
> On 08/10/25, Brian Cain wrote:
>> In order to correspond with the kernel, we've now (1) moved the
>> preds[] to the right offset and combined the representation as a single
>> ulong "p3_0", (2), added the cs{0,1} registers, (3) added a pad for 48
>> words, (4) added the user regs structure to an 8-byte aligned
>> target_sigcontext structure.
>>
>> Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
>> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
>> ---
>>   linux-user/hexagon/signal.c | 199 ++++++++++++++++++++----------------
>>   1 file changed, 111 insertions(+), 88 deletions(-)
>>
>> diff --git a/linux-user/hexagon/signal.c b/linux-user/hexagon/signal.c
>> index 492b51f155..6c3dbf91fa 100644
>> --- a/linux-user/hexagon/signal.c
>> +++ b/linux-user/hexagon/signal.c
>> @@ -23,7 +23,7 @@
>>   #include "signal-common.h"
>>   #include "linux-user/trace.h"
>>   
>> -struct target_sigcontext {
>> +struct target_user_regs_struct {
>>       target_ulong r0,  r1,  r2,  r3;
>>       target_ulong r4,  r5,  r6,  r7;
>>       target_ulong r8,  r9, r10, r11;
>> @@ -39,14 +39,21 @@ struct target_sigcontext {
>>       target_ulong m0;
>>       target_ulong m1;
>>       target_ulong usr;
>> +    target_ulong p3_0;
>>       target_ulong gp;
>>       target_ulong ugp;
>>       target_ulong pc;
>>       target_ulong cause;
>>       target_ulong badva;
>> -    target_ulong pred[NUM_PREGS];
>> +    target_ulong cs0;
>> +    target_ulong cs1;
>> +    target_ulong pad1;
>>   };
> 
> struct layout looks good assuming it must correspond to
> `arch/hexagon/include/uapi/asm/user.h`.  Add a `/* pad to 48 words */`
> comment to pad1, and static assert following the struct definition
> 
>    QEMU_BUILD_BUG_ON(sizeof(struct target_user_regs_struct) != 48*4);

As long as you're fixing things, all of these target_ulong should be abi_ulong, because 
user_regs_struct uses 'unsigned long'.


r~


  reply	other threads:[~2025-10-08 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08  1:47 [PATCH 1/2] linux-user/hexagon: Fix sigcontext Brian Cain
2025-10-08  1:47 ` [PATCH 2/2] tests/tcg/hexagon: Add cs{0,1} coverage Brian Cain
2025-10-08 15:03   ` Anton Johansson via
2025-10-08 21:51   ` ltaylorsimpson
2025-10-10 18:40     ` Brian Cain
2025-10-08 15:27 ` [PATCH 1/2] linux-user/hexagon: Fix sigcontext Anton Johansson via
2025-10-08 16:02   ` Richard Henderson [this message]
2025-10-08 21:46 ` ltaylorsimpson

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=7bf3d8c5-df07-4cbd-ba62-4c7246a5f96b@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ale@rev.ng \
    --cc=alex.bennee@linaro.org \
    --cc=alex@alexrp.com \
    --cc=anjo@rev.ng \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=laurent@vivier.eu \
    --cc=ltaylorsimpson@gmail.com \
    --cc=marco.liebel@oss.qualcomm.com \
    --cc=matheus.bernardino@oss.qualcomm.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_mburton@quicinc.com \
    --cc=sid.manning@oss.qualcomm.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 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).