On 10/26/18 4:52 PM, Jakub Jelinek wrote:
> On Fri, Oct 26, 2018 at 09:48:54AM -0500, Bill Seurer wrote:
>> On 10/26/18 03:57, Jakub Jelinek wrote:
>>> On Thu, Oct 25, 2018 at 12:49:42PM +0200, Jakub Jelinek wrote:
>>>> On Thu, Oct 25, 2018 at 12:15:46PM +0200, marxin wrote:
>>>>> I've just finished my first merge from libsanitizer mainline. Overall it
>>>>> looks fine, apparently ABI hasn't changed and so that SONAME bump is not
>>>>> needed.
>>>>
>>>> Given the 6/7 patch, I think you need to bump libasan soname (it would be
>>>> weird to bump it on powerpc64* only).
>>>
>>> BTW, how can shadow offset be 1UL<<44 on powerpc64?  That seems like they
>>> don't want to support anything but very recent kernels.
>>> E.g. looking at Linux 3.4 arch/powerpc/include/asm/processor.h
>>> I see
>>> /* 64-bit user address space is 44-bits (16TB user VM) */
>>> #define TASK_SIZE_USER64 (0x0000100000000000UL)
>>> so, the new choice must be incompatible with lots of kernels out there.
>>> Move recent kernels have:
>>> #define TASK_SIZE_64TB  (0x0000400000000000UL)
>>> #define TASK_SIZE_128TB (0x0000800000000000UL)
>>> #define TASK_SIZE_512TB (0x0002000000000000UL)
>>> #define TASK_SIZE_1PB   (0x0004000000000000UL)
>>> #define TASK_SIZE_2PB   (0x0008000000000000UL)
>>> #define TASK_SIZE_4PB   (0x0010000000000000UL)
>>> but 4.15 still tops at 512TB, 4.10 has just 64TB as the only choice, 3.8 as
>>> well.
>>>
>>> CCing Bill as he made this change.
>>>
>>>     Jakub
>>>
>>
>> At the time for llvm the concern was to get it to work on newer kernels and
>> not worry (much) about the older ones.  I did spend some time trying to get
>> it to work for both.
> 
> Which exact task size doesn't work if shadow offset is 2TB and why?
> 
>       Jakub
> 

Just for the record: am I right that any system using 44 bit of VMA will fail 
because
anything + (1 << 44) will be out of process address space?

And I noticed that documentation in sanitizer_linux.cc is misleading:

...
uptr GetMaxVirtualAddress() {
#if (SANITIZER_NETBSD || SANITIZER_OPENBSD) && defined(__x86_64__)
  return 0x7f7ffffff000ULL;  // (0x00007f8000000000 - PAGE_SIZE)
#elif SANITIZER_WORDSIZE == 64
# if defined(__powerpc64__) || defined(__aarch64__)
  // On PowerPC64 we have two different address space layouts: 44- and 46-bit.
  // We somehow need to figure out which one we are using now and choose
  // one of 0x00000fffffffffffUL and 0x00003fffffffffffUL.
...

That should be adjusted.

Thanks,
Martin

Reply via email to