qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Khem Raj <raj.khem@gmail.com>,
	qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>,
	Warner Losh <imp@bsdimp.com>
Subject: Re: [PATCH] linux-user: Replace __u64 with uint64_t
Date: Wed, 10 Nov 2021 16:18:56 +0100	[thread overview]
Message-ID: <cda72b6b-e34c-2c99-834a-5897f128a5ae@linaro.org> (raw)
In-Reply-To: <01900319-d1fc-b677-1f35-5ee2da5bc8a4@linaro.org>

On 11/10/21 4:12 PM, Richard Henderson wrote:
> On 11/10/21 10:25 AM, Richard Henderson wrote:
>> On 11/8/21 8:42 PM, Khem Raj wrote:
>>> uint64_t is available in all userspaces via compiler include stdint.h
>>> therefore use it instead of __u64 which is linux internal type, it fixes
>>> build on some platforms eg. aarch64 systems using musl C library
>>>
>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ---
>>>   linux-user/host/aarch64/hostdep.h | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
>>> index a8d41a21ad..34d934f665 100644
>>> --- a/linux-user/host/aarch64/hostdep.h
>>> +++ b/linux-user/host/aarch64/hostdep.h
>>> @@ -25,7 +25,7 @@ extern char safe_syscall_end[];
>>>   static inline void rewind_if_in_safe_syscall(void *puc)
>>>   {
>>>       ucontext_t *uc = puc;
>>> -    __u64 *pcreg = &uc->uc_mcontext.pc;
>>> +    uint64_t *pcreg = &uc->uc_mcontext.pc;
>>>       if (*pcreg > (uintptr_t)safe_syscall_start
>>>           && *pcreg < (uintptr_t)safe_syscall_end) {
>>
>> Queued to tcg-next, since that's where the original patch came from.
> 
> Dequeued.  We need something more, because on debian we now get:
> 
> ../linux-user/host/aarch64/hostdep.h:28:23: error: initialization of 'uint64_t *' {aka 
> 'long unsigned int *'} from incompatible pointer type 'long long unsigned int *' 
> [-Werror=incompatible-pointer-types]
>       uint64_t *pcreg = &uc->uc_mcontext.pc;
>                         ^
> cc1: all warnings being treated as errors
> 
> Perhaps we need to use __typeof() to get the correct pointer type?  Oh for c++11 auto 
> declarations... :-)

No, we need to not use a pointer at all and grab Warner's

   https://patchew.org/QEMU/20211108023738.42125-1-imp@bsdimp.com/

Even grabbing the first two patches of that series for 6.2 would fix this.


r~


  reply	other threads:[~2021-11-10 15:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 19:42 [PATCH] linux-user: Replace __u64 with uint64_t Khem Raj
2021-11-09  9:09 ` Philippe Mathieu-Daudé
2021-11-09 16:39 ` Warner Losh
2021-11-10  9:25 ` Richard Henderson
2021-11-10 15:12   ` Richard Henderson
2021-11-10 15:18     ` Richard Henderson [this message]
2021-11-10 16:03       ` Warner Losh
2021-11-10 16:31         ` Khem Raj
  -- strict thread matches above, loose matches on Subject: below --
2021-11-08 19:51 Khem Raj

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=cda72b6b-e34c-2c99-834a-5897f128a5ae@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=imp@bsdimp.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=raj.khem@gmail.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).