Re: ILP32 for ARM64: testing with glibc testsuite

2016-12-05 Thread Andreas Schwab
On Dez 05 2016, "Zhangjian (Bamvor)" <bamvor.zhangj...@huawei.com> wrote:

> Is there some progresses on it? We could collabrate to fix those issues.

All the elf/nptl/rt fails should be fixed by the recent binutils fixes.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 17/18] arm64:ilp32: add vdso-ilp32 and use for signal return

2016-08-17 Thread Andreas Schwab
On Aug 17 2016, Yury Norov <yno...@caviumnetworks.com> wrote:

> diff --git a/arch/arm64/kernel/vdso/gettimeofday.S 
> b/arch/arm64/kernel/vdso/gettimeofday.S
> index e00b467..143b39e 100644
> --- a/arch/arm64/kernel/vdso/gettimeofday.S
> +++ b/arch/arm64/kernel/vdso/gettimeofday.S
> @@ -25,6 +25,16 @@
>  #define NSEC_PER_SEC_LO160xca00
>  #define NSEC_PER_SEC_HI160x3b9a
>  
> +#ifdef __LP64__
> +#define PTR_REG(n)   x##n
> +#define OFFSET(n)n
> +#define DELOUSE(n)
> +#else
> +#define PTR_REG(n)   w##n
> +#define OFFSET(n)COMPAT_##n
> +#define DELOUSE(n)   mov w##n, w##n
> +#endif
> +
>  vdso_data.reqx6
>  seqcnt   .reqw7
>  w_tmp.reqw8
> @@ -136,6 +146,8 @@ x_tmp .reqx8
>  /* int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz); */
>  ENTRY(__kernel_gettimeofday)
>   .cfi_startproc
> + DELOUSE(0)
> + DELOUSE(1)
>   adr vdso_data, _vdso_data
>   /* If tv is NULL, skip to the timezone code. */
>   cbz x0, 2f
> @@ -160,7 +172,7 @@ ENTRY(__kernel_gettimeofday)
>   mov x13, #1000
>   lsl x13, x13, x12
>   udivx11, x11, x13
> - stp x10, x11, [x0, #TVAL_TV_SEC]
> + stp PTR_REG(10), PTR_REG(11), [x0, #OFFSET(TVAL_TV_SEC)]
>  2:
>   /* If tz is NULL, return 0. */
>   cbz x1, 3f
> @@ -182,6 +194,7 @@ ENDPROC(__kernel_gettimeofday)
>  /* int __kernel_clock_gettime(clockid_t clock_id, struct timespec *tp); */
>  ENTRY(__kernel_clock_gettime)
>   .cfi_startproc
> + DELOUSE(1)
>   cmp w0, #JUMPSLOT_MAX
>   b.hisyscall
>   adr vdso_data, _vdso_data
> @@ -297,6 +310,7 @@ ENDPROC(__kernel_clock_gettime)
>  /* int __kernel_clock_getres(clockid_t clock_id, struct timespec *res); */
>  ENTRY(__kernel_clock_getres)
>   .cfi_startproc
> + DELOUSE(1)
>   cmp w0, #CLOCK_REALTIME
>   ccmpw0, #CLOCK_MONOTONIC, #0x4, ne
>   ccmpw0, #CLOCK_MONOTONIC_RAW, #0x4, ne
> @@ -311,7 +325,7 @@ ENTRY(__kernel_clock_getres)
>   ldr x2, 6f
>  2:
>   cbz w1, 3f
> - stp xzr, x2, [x1]
> + stp PTR_REG(zr), PTR_REG(2), [x1]
>  
>  3:   /* res == NULL. */
>   mov w0, wzr

I think this is missing:

diff --git a/arch/arm64/kernel/vdso/gettimeofday.S 
b/arch/arm64/kernel/vdso/gettimeofday.S
index 143b39e..b463c5a 100644
--- a/arch/arm64/kernel/vdso/gettimeofday.S
+++ b/arch/arm64/kernel/vdso/gettimeofday.S
@@ -129,7 +129,7 @@ x_tmp   .reqx8
.if \shift == 1
lsr x11, x11, x12
    .endif
-   stp x10, x11, [x1, #TSPEC_TV_SEC]
+   stp PTR_REG(10), PTR_REG(11), [x1, #OFFSET(TSPEC_TV_SEC)]
mov x0, xzr
ret
.endm
-- 
2.9.3


Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 01/19] compat ABI: use non-compat openat and open_by_handle_at variants

2016-06-27 Thread Andreas Schwab
Yury Norov <yno...@caviumnetworks.com> writes:

> The only difference is that non-compat version forces O_LARGEFILE,
> and it should be the default behaviour for all architectures, as
> we don't support 32-bit off_t. The only exception is tile32, that
> continues with compat version of syscalls.
>
> Signed-off-by: Yury Norov <yno...@caviumnetworks.com>
> Acked-by: Arnd Bergmann <a...@arndb.de>
> Acked-by: Chris Metcalf <cmetc...@ezchip.com> [for tile]
> ---
>  arch/tile/kernel/compat.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c
> index 4912084..489ae19 100644
> --- a/arch/tile/kernel/compat.c
> +++ b/arch/tile/kernel/compat.c
> @@ -94,6 +94,9 @@ COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned 
> int, offset_high,
>  #define compat_sys_readahead sys32_readahead
>  #define sys_llseek compat_sys_llseek
>  
> +#define sys_openat   compat_sys_openat
> +#define sys_open_by_handle_atcompat_sys_open_by_handle_at
> +
>  /* Call the assembly trampolines where necessary. */
>  #define compat_sys_rt_sigreturn _compat_sys_rt_sigreturn
>  #define sys_clone _sys_clone

This is a no-op.  Did you mean to add this?  Without that the testsuite
of tar fails on ILP32.

diff --git a/include/uapi/asm-generic/unistd.h 
b/include/uapi/asm-generic/unistd.h
index a26415b..4dcc38d 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -178,7 +178,7 @@ __SYSCALL(__NR_fchownat, sys_fchownat)
 #define __NR_fchown 55
 __SYSCALL(__NR_fchown, sys_fchown)
 #define __NR_openat 56
-__SC_COMP(__NR_openat, sys_openat, compat_sys_openat)
+__SYSCALL(__NR_openat, sys_openat)
 #define __NR_close 57
 __SYSCALL(__NR_close, sys_close)
 #define __NR_vhangup 58
@@ -676,8 +676,7 @@ __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
 #define __NR_name_to_handle_at 264
 __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
 #define __NR_open_by_handle_at 265
-__SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \
- compat_sys_open_by_handle_at)
+__SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at)
 #define __NR_clock_adjtime 266
 __SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime)
 #define __NR_syncfs 267
-- 
2.9.0


Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 08/19] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)

2016-06-21 Thread Andreas Schwab
"Zhangjian (Bamvor)" <bamvor.zhangj...@huawei.com> writes:

>> @@ -78,9 +79,9 @@
>>
>>   #ifdef CONFIG_COMPAT
>>   #define TASK_SIZE_32   UL(0x1)
>> -#define TASK_SIZE   (test_thread_flag(TIF_32BIT) ? \
>> +#define TASK_SIZE   (is_compat_task() ? \
>>  TASK_SIZE_32 : TASK_SIZE_64)
>> -#define TASK_SIZE_OF(tsk)   (test_tsk_thread_flag(tsk, TIF_32BIT) ? \
>> +#define TASK_SIZE_OF(tsk)   (is_compat_thread(tsk) ? \
> It should be
> +#define TASK_SIZE_OF(tsk)  (is_compat_thread(task_thread_info(tsk)) ? \
> is_compat_thread takes "struct thread_info *thread" while TASK_SIZE_OF takes
> "struct task_struct *tsk"tsk.

If that doesn't throw an error does that mean that TASK_SIZE_OF is
unused?

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 18/19] arm64:ilp32: add vdso-ilp32 and use for signal return

2016-06-20 Thread Andreas Schwab
Yury Norov <yno...@caviumnetworks.com> writes:

> diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
> index 2a0de6f..e48ea34 100644
> --- a/arch/arm64/kernel/vdso.c
> +++ b/arch/arm64/kernel/vdso.c
> @@ -40,6 +40,12 @@ extern char vdso_start, vdso_end;
>  static unsigned long vdso_pages;
>  static struct page **vdso_pagelist;
>  
> +#ifdef CONFIG_ARM64_ILP32
> +extern char vdso_ilp32_start, vdso_ilp32_end;
> +static unsigned long vdso_ilp32_pages;
> +static struct page **vdso_ilp32_pagelist;
> +#endif
> +
>  /*
>   * The vDSO data page.
>   */
> @@ -110,24 +116,29 @@ int aarch32_setup_vectors_page(struct linux_binprm 
> *bprm, int uses_interp)
>  }
>  #endif /* CONFIG_AARCH32_EL0 */
>  
> -static struct vm_special_mapping vdso_spec[2];
> -
> -static int __init vdso_init(void)
> +static int __init vdso_init_common(char *vdso_start, char *vdso_end,

Using the same name for the parameter as for the global variable is
dangerous 

> +   unsigned long *vdso_pagesp,
> +   struct page ***vdso_pagelistp,
> +   struct vm_special_mapping* vdso_spec)
>  {
>   int i;
> + unsigned long vdso_pages;
> + struct page **vdso_pagelist;
>  
> - if (memcmp(_start, "\177ELF", 4)) {
> + if (memcmp(vdso_start, "\177ELF", 4)) {

... because forgetting to remove & can be fatal, and your compiler may
not even warn you.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC6 PATCH v6 00/21] ILP32 for ARM64

2016-05-17 Thread Andreas Schwab
Joseph Myers <jos...@codesourcery.com> writes:

> On Tue, 17 May 2016, Arnd Bergmann wrote:
>
>> I think it has become easier to override now and we just need to
>> update sysdeps/unix/sysv/linux/generic/bits/typesizes.h to set
>> 
>> #define __INO64_T_TYPE  __UQUAD_TYPE
>> #define __OFF64_T_TYPE  __UQUAD_TYPE
>> #define __OFF_T_MATCHES_OFF64_T1
>> #define __INO_T_MATCHES_INO64_T1
>> 
>> for new architectures (obviously not the ones that already use the
>> 32-bit types). I haven't tries this, so there may be other things
>> that are required.
>
> I think more than that would be needed to get struct stat to match and get 
> things aliased for that (which is presumably desirable).

Looking at sysdeps/unix/sysv/linux/generic/bits/stat.h, there is at
least blkcnt_t that differs between stat and stat64.  And you probably
want to alias statfs and statfs64 as well, ie. fs{blk,fil}cnt_t.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html