qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
@ 2020-03-13  0:28 Lirong Yuan
  2020-03-13 21:44 ` Laurent Vivier
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Lirong Yuan @ 2020-03-13  0:28 UTC (permalink / raw)
  To: qemu-devel, laurent; +Cc: qemu-trivial, riku.voipio, scw, jkz, Lirong Yuan

This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms:
https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h

Signed-off-by: Lirong Yuan <yuanzi@google.com>
---
 linux-user/mmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 8685f02e7e..e378033797 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
 }
 
 #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
+#ifdef TARGET_AARCH64
+# define TASK_UNMAPPED_BASE  0x5500000000
+#else
 # define TASK_UNMAPPED_BASE  (1ul << 38)
+#endif
 #else
 # define TASK_UNMAPPED_BASE  0x40000000
 #endif
-- 
2.25.1.481.gfbce0eb801-goog



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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-13  0:28 [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64 Lirong Yuan
@ 2020-03-13 21:44 ` Laurent Vivier
  2020-03-13 21:45 ` Laurent Vivier
  2020-03-14  3:06 ` Aleksandar Markovic
  2 siblings, 0 replies; 9+ messages in thread
From: Laurent Vivier @ 2020-03-13 21:44 UTC (permalink / raw)
  To: Lirong Yuan, qemu-devel; +Cc: qemu-trivial, jkz, riku.voipio, scw

Le 13/03/2020 à 01:28, Lirong Yuan a écrit :
> This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms:
> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
> 
> Signed-off-by: Lirong Yuan <yuanzi@google.com>
> ---
>  linux-user/mmap.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> index 8685f02e7e..e378033797 100644
> --- a/linux-user/mmap.c
> +++ b/linux-user/mmap.c
> @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
>  }
>  
>  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
> +#ifdef TARGET_AARCH64
> +# define TASK_UNMAPPED_BASE  0x5500000000
> +#else
>  # define TASK_UNMAPPED_BASE  (1ul << 38)
> +#endif
>  #else
>  # define TASK_UNMAPPED_BASE  0x40000000
>  #endif
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-13  0:28 [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64 Lirong Yuan
  2020-03-13 21:44 ` Laurent Vivier
@ 2020-03-13 21:45 ` Laurent Vivier
  2020-03-13 23:52   ` Lirong Yuan
  2020-03-14  3:06 ` Aleksandar Markovic
  2 siblings, 1 reply; 9+ messages in thread
From: Laurent Vivier @ 2020-03-13 21:45 UTC (permalink / raw)
  To: Lirong Yuan, qemu-devel; +Cc: qemu-trivial, jkz, riku.voipio, scw

Le 13/03/2020 à 01:28, Lirong Yuan a écrit :
> This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms:
> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
> 
> Signed-off-by: Lirong Yuan <yuanzi@google.com>
> ---
>  linux-user/mmap.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> index 8685f02e7e..e378033797 100644
> --- a/linux-user/mmap.c
> +++ b/linux-user/mmap.c
> @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
>  }
>  
>  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
> +#ifdef TARGET_AARCH64
> +# define TASK_UNMAPPED_BASE  0x5500000000
> +#else
>  # define TASK_UNMAPPED_BASE  (1ul << 38)
> +#endif
>  #else
>  # define TASK_UNMAPPED_BASE  0x40000000
>  #endif
> 

Applied to my linux-user branch.

Thanks,
Laurent


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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-13 21:45 ` Laurent Vivier
@ 2020-03-13 23:52   ` Lirong Yuan
  0 siblings, 0 replies; 9+ messages in thread
From: Lirong Yuan @ 2020-03-13 23:52 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: qemu-devel, qemu-trivial, Riku Voipio, Shu-Chun Weng, Josh Kunz

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

On Fri, Mar 13, 2020 at 2:45 PM Laurent Vivier <laurent@vivier.eu> wrote:

> Le 13/03/2020 à 01:28, Lirong Yuan a écrit :
> > This change updates TASK_UNMAPPED_BASE (the base address for guest
> programs) for aarch64. It is needed to allow qemu to work with Thread
> Sanitizer (TSan), which has specific boundary definitions for memory
> mappings on different platforms:
> >
> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
> >
> > Signed-off-by: Lirong Yuan <yuanzi@google.com>
> > ---
> >  linux-user/mmap.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> > index 8685f02e7e..e378033797 100644
> > --- a/linux-user/mmap.c
> > +++ b/linux-user/mmap.c
> > @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
> >  }
> >
> >  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
> > +#ifdef TARGET_AARCH64
> > +# define TASK_UNMAPPED_BASE  0x5500000000
> > +#else
> >  # define TASK_UNMAPPED_BASE  (1ul << 38)
> > +#endif
> >  #else
> >  # define TASK_UNMAPPED_BASE  0x40000000
> >  #endif
> >
>
> Applied to my linux-user branch.
>
> Thanks,
> Laurent
>

Great, thanks a lot! :)

[-- Attachment #2: Type: text/html, Size: 1905 bytes --]

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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-13  0:28 [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64 Lirong Yuan
  2020-03-13 21:44 ` Laurent Vivier
  2020-03-13 21:45 ` Laurent Vivier
@ 2020-03-14  3:06 ` Aleksandar Markovic
  2020-03-14 10:45   ` Laurent Vivier
  2 siblings, 1 reply; 9+ messages in thread
From: Aleksandar Markovic @ 2020-03-14  3:06 UTC (permalink / raw)
  To: Lirong Yuan
  Cc: QEMU Trivial, Riku Voipio, QEMU Developers, Laurent Vivier,
	Josh Kunz, Shu-Chun Weng

On Fri, Mar 13, 2020 at 1:28 AM Lirong Yuan <yuanzi@google.com> wrote:
>
> This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms:
> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
>
> Signed-off-by: Lirong Yuan <yuanzi@google.com>
> ---
>  linux-user/mmap.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> index 8685f02e7e..e378033797 100644
> --- a/linux-user/mmap.c
> +++ b/linux-user/mmap.c
> @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
>  }
>
>  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
> +#ifdef TARGET_AARCH64
> +# define TASK_UNMAPPED_BASE  0x5500000000

Hi, Lirong,

Can you point from which line of the file you linked to did you
arrive to the value 0x5500000000?

Second question: What about other targets?

Regards,
Aleksandar

> +#else
>  # define TASK_UNMAPPED_BASE  (1ul << 38)
> +#endif
>  #else
>  # define TASK_UNMAPPED_BASE  0x40000000
>  #endif
> --
> 2.25.1.481.gfbce0eb801-goog
>
>


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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-14  3:06 ` Aleksandar Markovic
@ 2020-03-14 10:45   ` Laurent Vivier
  2020-03-14 17:01     ` Aleksandar Markovic
  0 siblings, 1 reply; 9+ messages in thread
From: Laurent Vivier @ 2020-03-14 10:45 UTC (permalink / raw)
  To: Aleksandar Markovic, Lirong Yuan
  Cc: QEMU Trivial, Josh Kunz, Riku Voipio, QEMU Developers,
	Shu-Chun Weng

Le 14/03/2020 à 04:06, Aleksandar Markovic a écrit :
> On Fri, Mar 13, 2020 at 1:28 AM Lirong Yuan <yuanzi@google.com> wrote:
>>
>> This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms:
>> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
>>
>> Signed-off-by: Lirong Yuan <yuanzi@google.com>
>> ---
>>  linux-user/mmap.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
>> index 8685f02e7e..e378033797 100644
>> --- a/linux-user/mmap.c
>> +++ b/linux-user/mmap.c
>> @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
>>  }
>>
>>  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
>> +#ifdef TARGET_AARCH64
>> +# define TASK_UNMAPPED_BASE  0x5500000000
> 
> Hi, Lirong,
> 
> Can you point from which line of the file you linked to did you
> arrive to the value 0x5500000000?
> 
> Second question: What about other targets?

Personally, I prefer to not change the value for other targets if it is
not required by someone that had some problems with the current value.

It needs to be changed carefully and to be well tested after change.

Thanks,
Laurent


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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-14 10:45   ` Laurent Vivier
@ 2020-03-14 17:01     ` Aleksandar Markovic
  2020-03-14 17:34       ` Laurent Vivier
  0 siblings, 1 reply; 9+ messages in thread
From: Aleksandar Markovic @ 2020-03-14 17:01 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: QEMU Trivial, Riku Voipio, Lirong Yuan, QEMU Developers,
	Josh Kunz, Shu-Chun Weng

On Sat, Mar 14, 2020 at 11:45 AM Laurent Vivier <laurent@vivier.eu> wrote:
>
> Le 14/03/2020 à 04:06, Aleksandar Markovic a écrit :
> > On Fri, Mar 13, 2020 at 1:28 AM Lirong Yuan <yuanzi@google.com> wrote:
> >>
> >> This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms:
> >> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
> >>
> >> Signed-off-by: Lirong Yuan <yuanzi@google.com>
> >> ---
> >>  linux-user/mmap.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >>
> >> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> >> index 8685f02e7e..e378033797 100644
> >> --- a/linux-user/mmap.c
> >> +++ b/linux-user/mmap.c
> >> @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
> >>  }
> >>
> >>  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
> >> +#ifdef TARGET_AARCH64
> >> +# define TASK_UNMAPPED_BASE  0x5500000000
> >
> > Hi, Lirong,
> >
> > Can you point from which line of the file you linked to did you
> > arrive to the value 0x5500000000?
> >
> > Second question: What about other targets?
>
> Personally, I prefer to not change the value for other targets if it is
> not required by someone that had some problems with the current value.
>
> It needs to be changed carefully and to be well tested after change.
>

Sure, but again, from where " 0x5500000000" comes from?

> Thanks,
> Laurent


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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-14 17:01     ` Aleksandar Markovic
@ 2020-03-14 17:34       ` Laurent Vivier
  2020-03-16 21:50         ` Lirong Yuan
  0 siblings, 1 reply; 9+ messages in thread
From: Laurent Vivier @ 2020-03-14 17:34 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: QEMU Trivial, Riku Voipio, Lirong Yuan, QEMU Developers,
	Josh Kunz, Shu-Chun Weng

Le 14/03/2020 à 18:01, Aleksandar Markovic a écrit :
> On Sat, Mar 14, 2020 at 11:45 AM Laurent Vivier <laurent@vivier.eu> wrote:
>>
>> Le 14/03/2020 à 04:06, Aleksandar Markovic a écrit :
>>> On Fri, Mar 13, 2020 at 1:28 AM Lirong Yuan <yuanzi@google.com> wrote:
>>>>
>>>> This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms:
>>>> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
>>>>
>>>> Signed-off-by: Lirong Yuan <yuanzi@google.com>
>>>> ---
>>>>  linux-user/mmap.c | 4 ++++
>>>>  1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
>>>> index 8685f02e7e..e378033797 100644
>>>> --- a/linux-user/mmap.c
>>>> +++ b/linux-user/mmap.c
>>>> @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
>>>>  }
>>>>
>>>>  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
>>>> +#ifdef TARGET_AARCH64
>>>> +# define TASK_UNMAPPED_BASE  0x5500000000
>>>
>>> Hi, Lirong,
>>>
>>> Can you point from which line of the file you linked to did you
>>> arrive to the value 0x5500000000?
>>>
>>> Second question: What about other targets?
>>
>> Personally, I prefer to not change the value for other targets if it is
>> not required by someone that had some problems with the current value.
>>
>> It needs to be changed carefully and to be well tested after change.
>>
> 
> Sure, but again, from where " 0x5500000000" comes from?

The URL is in the comment, but more precisely I guess:

 https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h#L164

Thanks,
Laurent



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

* Re: [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64
  2020-03-14 17:34       ` Laurent Vivier
@ 2020-03-16 21:50         ` Lirong Yuan
  0 siblings, 0 replies; 9+ messages in thread
From: Lirong Yuan @ 2020-03-16 21:50 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Aleksandar Markovic, QEMU Trivial, Riku Voipio, QEMU Developers,
	Josh Kunz, Shu-Chun Weng

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]

Thanks Laurent for the prompt responses! Yes that is exactly where the
value is taken from.

For anyone interested in detailed information of the change, here is the
previous discussion thread:
http://patchwork.ozlabs.org/patch/1242370/

Regards,
Lirong


On Sat, Mar 14, 2020 at 10:34 AM Laurent Vivier <laurent@vivier.eu> wrote:

> Le 14/03/2020 à 18:01, Aleksandar Markovic a écrit :
> > On Sat, Mar 14, 2020 at 11:45 AM Laurent Vivier <laurent@vivier.eu>
> wrote:
> >>
> >> Le 14/03/2020 à 04:06, Aleksandar Markovic a écrit :
> >>> On Fri, Mar 13, 2020 at 1:28 AM Lirong Yuan <yuanzi@google.com> wrote:
> >>>>
> >>>> This change updates TASK_UNMAPPED_BASE (the base address for guest
> programs) for aarch64. It is needed to allow qemu to work with Thread
> Sanitizer (TSan), which has specific boundary definitions for memory
> mappings on different platforms:
> >>>>
> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h
> >>>>
> >>>> Signed-off-by: Lirong Yuan <yuanzi@google.com>
> >>>> ---
> >>>>  linux-user/mmap.c | 4 ++++
> >>>>  1 file changed, 4 insertions(+)
> >>>>
> >>>> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> >>>> index 8685f02e7e..e378033797 100644
> >>>> --- a/linux-user/mmap.c
> >>>> +++ b/linux-user/mmap.c
> >>>> @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start,
> >>>>  }
> >>>>
> >>>>  #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64
> >>>> +#ifdef TARGET_AARCH64
> >>>> +# define TASK_UNMAPPED_BASE  0x5500000000
> >>>
> >>> Hi, Lirong,
> >>>
> >>> Can you point from which line of the file you linked to did you
> >>> arrive to the value 0x5500000000?
> >>>
> >>> Second question: What about other targets?
> >>
> >> Personally, I prefer to not change the value for other targets if it is
> >> not required by someone that had some problems with the current value.
> >>
> >> It needs to be changed carefully and to be well tested after change.
> >>
> >
> > Sure, but again, from where " 0x5500000000" comes from?
>
> The URL is in the comment, but more precisely I guess:
>
>
> https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h#L164
>
> Thanks,
> Laurent
>
>

[-- Attachment #2: Type: text/html, Size: 3708 bytes --]

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

end of thread, other threads:[~2020-03-16 21:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-13  0:28 [PATCH] linux-user: Update TASK_UNMAPPED_BASE for aarch64 Lirong Yuan
2020-03-13 21:44 ` Laurent Vivier
2020-03-13 21:45 ` Laurent Vivier
2020-03-13 23:52   ` Lirong Yuan
2020-03-14  3:06 ` Aleksandar Markovic
2020-03-14 10:45   ` Laurent Vivier
2020-03-14 17:01     ` Aleksandar Markovic
2020-03-14 17:34       ` Laurent Vivier
2020-03-16 21:50         ` Lirong Yuan

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).