linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches
@ 2020-02-24 18:34 Vineet Gupta
  2020-02-25  0:59 ` Alistair Francis
  2020-02-25  9:27 ` Florian Weimer
  0 siblings, 2 replies; 12+ messages in thread
From: Vineet Gupta @ 2020-02-24 18:34 UTC (permalink / raw)
  To: libc-alpha, arnd; +Cc: alistair23, Vineet Gupta, linux-snps-arc, lukma

This provides better out-of-box support for 32-bit arches with 64-bit
time_t

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 sysdeps/unix/sysv/linux/generic/sysdep.h | 48 ++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
index 23defce7c3e1..27b0079a2a71 100644
--- a/sysdeps/unix/sysv/linux/generic/sysdep.h
+++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <bits/wordsize.h>
+#include <bits/timesize.h>
 #include <kernel-features.h>
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/unix/sysv/linux/sysdep.h>
@@ -33,3 +34,50 @@
 #define __NR_pread __NR_pread64
 #define __NR_pwrite __NR_pwrite64
 #endif
+
+/* Override syscalls for asm-generic ABIs with 64-bit time.  */
+#if __WORDSIZE == 32 && __TIMESIZE == 64
+
+# undef __NR_futex
+# define __NR_futex __NR_futex_time64
+
+# undef __NR_rt_sigtimedwait
+# define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64
+
+# undef __NR_ppoll
+# define __NR_ppoll __NR_ppoll_time64
+
+# undef __NR_utimensat
+# define __NR_utimensat __NR_utimensat_time64
+
+# undef __NR_pselect6
+# define __NR_pselect6 __NR_pselect6_time64
+
+# undef __NR_recvmmsg
+# define __NR_recvmmsg __NR_recvmmsg_time64
+
+# undef __NR_semtimedop
+# define __NR_semtimedop __NR_semtimedop_time64
+
+# undef __NR_mq_timedreceive
+# define __NR_mq_timedreceive __NR_mq_timedreceive_time64
+
+# undef __NR_mq_timedsend
+# define __NR_mq_timedsend __NR_mq_timedsend_time64
+
+# undef __NR_clock_getres
+# define __NR_clock_getres __NR_clock_getres_time64
+
+# undef __NR_timerfd_settime
+# define __NR_timerfd_settime __NR_timerfd_settime64
+
+# undef __NR_timerfd_gettime
+# define __NR_timerfd_gettime __NR_timerfd_gettime64
+
+# undef __NR_sched_rr_get_interval
+# define __NR_sched_rr_get_interval __NR_sched_rr_get_interval_time64
+
+# undef __NR_clock_adjtime
+# define __NR_clock_adjtime __NR_clock_adjtime64
+
+#endif
-- 
2.20.1


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches
  2020-02-24 18:34 [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches Vineet Gupta
@ 2020-02-25  0:59 ` Alistair Francis
  2020-02-25  1:16   ` Vineet Gupta
  2020-02-25  9:27 ` Florian Weimer
  1 sibling, 1 reply; 12+ messages in thread
From: Alistair Francis @ 2020-02-25  0:59 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: arcml, GNU C Library, Lukasz Majewski, Arnd Bergmann

On Mon, Feb 24, 2020 at 10:34 AM Vineet Gupta
<Vineet.Gupta1@synopsys.com> wrote:
>
> This provides better out-of-box support for 32-bit arches with 64-bit
> time_t
>
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> ---
>  sysdeps/unix/sysv/linux/generic/sysdep.h | 48 ++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
>
> diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
> index 23defce7c3e1..27b0079a2a71 100644
> --- a/sysdeps/unix/sysv/linux/generic/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
> @@ -17,6 +17,7 @@
>     <https://www.gnu.org/licenses/>.  */
>
>  #include <bits/wordsize.h>
> +#include <bits/timesize.h>
>  #include <kernel-features.h>
>  #include <sysdeps/unix/sysdep.h>
>  #include <sysdeps/unix/sysv/linux/sysdep.h>
> @@ -33,3 +34,50 @@
>  #define __NR_pread __NR_pread64
>  #define __NR_pwrite __NR_pwrite64
>  #endif
> +
> +/* Override syscalls for asm-generic ABIs with 64-bit time.  */
> +#if __WORDSIZE == 32 && __TIMESIZE == 64
> +
> +# undef __NR_futex
> +# define __NR_futex __NR_futex_time64

I think you should do what RV32 does and wrap these in ifndef's

Alistair

> +
> +# undef __NR_rt_sigtimedwait
> +# define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64
> +
> +# undef __NR_ppoll
> +# define __NR_ppoll __NR_ppoll_time64
> +
> +# undef __NR_utimensat
> +# define __NR_utimensat __NR_utimensat_time64
> +
> +# undef __NR_pselect6
> +# define __NR_pselect6 __NR_pselect6_time64
> +
> +# undef __NR_recvmmsg
> +# define __NR_recvmmsg __NR_recvmmsg_time64
> +
> +# undef __NR_semtimedop
> +# define __NR_semtimedop __NR_semtimedop_time64
> +
> +# undef __NR_mq_timedreceive
> +# define __NR_mq_timedreceive __NR_mq_timedreceive_time64
> +
> +# undef __NR_mq_timedsend
> +# define __NR_mq_timedsend __NR_mq_timedsend_time64
> +
> +# undef __NR_clock_getres
> +# define __NR_clock_getres __NR_clock_getres_time64
> +
> +# undef __NR_timerfd_settime
> +# define __NR_timerfd_settime __NR_timerfd_settime64
> +
> +# undef __NR_timerfd_gettime
> +# define __NR_timerfd_gettime __NR_timerfd_gettime64
> +
> +# undef __NR_sched_rr_get_interval
> +# define __NR_sched_rr_get_interval __NR_sched_rr_get_interval_time64
> +
> +# undef __NR_clock_adjtime
> +# define __NR_clock_adjtime __NR_clock_adjtime64
> +
> +#endif
> --
> 2.20.1
>

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches
  2020-02-25  0:59 ` Alistair Francis
@ 2020-02-25  1:16   ` Vineet Gupta
  0 siblings, 0 replies; 12+ messages in thread
From: Vineet Gupta @ 2020-02-25  1:16 UTC (permalink / raw)
  To: Alistair Francis; +Cc: arcml, GNU C Library, Lukasz Majewski, Arnd Bergmann

On 2/24/20 4:59 PM, Alistair Francis wrote:
>> +/* Override syscalls for asm-generic ABIs with 64-bit time.  */
>> +#if __WORDSIZE == 32 && __TIMESIZE == 64
>> +
>> +# undef __NR_futex
>> +# define __NR_futex __NR_futex_time64
> I think you should do what RV32 does and wrap these in ifndef's

ARC asm-generic ABI is different from the ones newer arches have. For us the these
syscalls already exist and the idea is to replace them with the 64-bit variants
which requires #undef.

-Vineet
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches
  2020-02-24 18:34 [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches Vineet Gupta
  2020-02-25  0:59 ` Alistair Francis
@ 2020-02-25  9:27 ` Florian Weimer
  2020-03-11 18:44   ` Vineet Gupta
  2020-03-12 18:33   ` [PATCH v2] Force 64-bit time based syscalls for TIMESIZE==64 Vineet Gupta
  1 sibling, 2 replies; 12+ messages in thread
From: Florian Weimer @ 2020-02-25  9:27 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: alistair23, linux-snps-arc, libc-alpha, lukma, arnd

* Vineet Gupta:

> +/* Override syscalls for asm-generic ABIs with 64-bit time.  */
> +#if __WORDSIZE == 32 && __TIMESIZE == 64
> +
> +# undef __NR_futex
> +# define __NR_futex __NR_futex_time64
> +
> +# undef __NR_rt_sigtimedwait
> +# define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64

I'm not totally unsympathetic to this in principle, but I think if we
start messing more with the system call numbers in this way, we should
move away from the __NR_ prefixes and use our own constant names.

Otherwise, the results could be very confusing, especially if there are
exceptions to this exception and we need the original system call number
after all.

Thanks,
Florian


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches
  2020-02-25  9:27 ` Florian Weimer
@ 2020-03-11 18:44   ` Vineet Gupta
  2020-03-12 18:33   ` [PATCH v2] Force 64-bit time based syscalls for TIMESIZE==64 Vineet Gupta
  1 sibling, 0 replies; 12+ messages in thread
From: Vineet Gupta @ 2020-03-11 18:44 UTC (permalink / raw)
  To: Florian Weimer; +Cc: alistair23, linux-snps-arc, libc-alpha, lukma, arnd

Hi Florian,

On 2/25/20 1:27 AM, Florian Weimer wrote:
> * Vineet Gupta:
> 
>> +/* Override syscalls for asm-generic ABIs with 64-bit time.  */
>> +#if __WORDSIZE == 32 && __TIMESIZE == 64
>> +
>> +# undef __NR_futex
>> +# define __NR_futex __NR_futex_time64
>> +
>> +# undef __NR_rt_sigtimedwait
>> +# define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64
> 
> I'm not totally unsympathetic to this in principle, but I think if we
> start messing more with the system call numbers in this way, we should
> move away from the __NR_ prefixes and use our own constant names.
> 
> Otherwise, the results could be very confusing, especially if there are
> exceptions to this exception and we need the original system call number
> after all.

OK I understand that redef could get messy. How about simple #undef of the 32-bit
syscalls so they are not available in general and rely on generic code to fallback
and DRT.

Do note that this is mostly a "preventive" fix (for single exception see below)
and new arches will hopefully not trip here as they won't have the 32-bit syscalls
to begin with. It is applicable to arches with slightly older version of the
asm-generic ABI. And for same reasons I can even move those into ARC sysdep.h -
what would you recommend.

FWIW the only relevant piece here is futex which generic lll code expects
__NR_futex and we need to undef/redef to 64-bit variant (either here or in ARCH
specific sysdep.h for RV32 and ARC) so having that part atleast in generic code
will help future ports avoid the copy/paste.

Thx,
-Vineet
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* [PATCH v2] Force 64-bit time based syscalls for TIMESIZE==64
  2020-02-25  9:27 ` Florian Weimer
  2020-03-11 18:44   ` Vineet Gupta
@ 2020-03-12 18:33   ` Vineet Gupta
  2020-03-31 21:47     ` [PATCH v3] Make any 32-bit time based syscalls unavailable " Vineet Gupta
  1 sibling, 1 reply; 12+ messages in thread
From: Vineet Gupta @ 2020-03-12 18:33 UTC (permalink / raw)
  To: libc-alpha; +Cc: Vineet Gupta, linux-snps-arc

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
Changes since v1
  - don't redirect these to 64-bit variants
---
 sysdeps/unix/sysv/linux/generic/sysdep.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
index 40b4b955ca1b..21facbad818a 100644
--- a/sysdeps/unix/sysv/linux/generic/sysdep.h
+++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <bits/wordsize.h>
+#include <bits/timesize.h>
 #include <kernel-features.h>
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/unix/sysv/linux/sysdep.h>
@@ -25,3 +26,25 @@
 #ifdef __NR_llseek
 # define __NR__llseek __NR_llseek
 #endif
+
+#if __WORDSIZE == 32 && __TIMESIZE == 64
+
+/* Don't provide 32-bit time syscalls.
+   Older variants of asm-generic ABIs can provide those (e.g. ARC).  */
+
+# undef __NR_futex
+# undef __NR_rt_sigtimedwait
+# undef __NR_ppoll
+# undef __NR_utimensat
+# undef __NR_pselect6
+# undef __NR_recvmmsg
+# undef __NR_semtimedop
+# undef __NR_mq_timedreceive
+# undef __NR_mq_timedsend
+# undef __NR_clock_getres
+# undef __NR_timerfd_settime
+# undef __NR_timerfd_gettime
+# undef __NR_sched_rr_get_interval
+# undef __NR_clock_adjtime
+
+#endif
-- 
2.20.1


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* [PATCH v3] Make any 32-bit time based syscalls unavailable for TIMESIZE==64
  2020-03-12 18:33   ` [PATCH v2] Force 64-bit time based syscalls for TIMESIZE==64 Vineet Gupta
@ 2020-03-31 21:47     ` Vineet Gupta
  2020-04-06 18:54       ` Vineet Gupta
  0 siblings, 1 reply; 12+ messages in thread
From: Vineet Gupta @ 2020-03-31 21:47 UTC (permalink / raw)
  To: libc-alpha
  Cc: Stepan Golosunov, Vineet Gupta, linux-snps-arc, Alistair Francis

From: Vineet Gupta via Libc-alpha <libc-alpha@sourceware.org>

An older asm-generic syscall ABI may have kernel provide 32-bit
time syscalls, so undef them to not mix 32/64 in 64-bit time regime.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
Changes since v2
  - Made x32 safe

Changes since v1
  - don't redirect these to 64-bit variants
---
 sysdeps/unix/sysv/linux/generic/sysdep.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
index 40b4b955ca1b..b83e17e1c9d1 100644
--- a/sysdeps/unix/sysv/linux/generic/sysdep.h
+++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <bits/wordsize.h>
+#include <bits/timesize.h>
 #include <kernel-features.h>
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/unix/sysv/linux/sysdep.h>
@@ -25,3 +26,26 @@
 #ifdef __NR_llseek
 # define __NR__llseek __NR_llseek
 #endif
+
+#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+
+/* Don't provide 32-bit time syscalls even if the kernel ABI provides
+   them (Older variants of asm-generic ABIs e.g. ARC).  */
+
+# undef __NR_futex
+# undef __NR_rt_sigtimedwait
+# undef __NR_ppoll
+# undef __NR_utimensat
+# undef __NR_pselect6
+# undef __NR_recvmmsg
+# undef __NR_semtimedop
+# undef __NR_mq_timedreceive
+# undef __NR_mq_timedsend
+# undef __NR_clock_getres
+# undef __NR_timerfd_settime
+# undef __NR_timerfd_gettime
+# undef __NR_sched_rr_get_interval
+# undef __NR_clock_adjtime
+
+#endif
-- 
2.20.1


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH v3] Make any 32-bit time based syscalls unavailable for TIMESIZE==64
  2020-03-31 21:47     ` [PATCH v3] Make any 32-bit time based syscalls unavailable " Vineet Gupta
@ 2020-04-06 18:54       ` Vineet Gupta
  2020-04-13 21:12         ` Vineet Gupta
  0 siblings, 1 reply; 12+ messages in thread
From: Vineet Gupta @ 2020-04-06 18:54 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stepan Golosunov, linux-snps-arc, Alistair Francis

On 3/31/20 2:47 PM, Vineet Gupta via Libc-alpha wrote:
> From: Vineet Gupta via Libc-alpha <libc-alpha@sourceware.org>
> 
> An older asm-generic syscall ABI may have kernel provide 32-bit
> time syscalls, so undef them to not mix 32/64 in 64-bit time regime.
> 
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

ping !

> ---
> Changes since v2
>   - Made x32 safe
> 
> Changes since v1
>   - don't redirect these to 64-bit variants
> ---
>  sysdeps/unix/sysv/linux/generic/sysdep.h | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
> index 40b4b955ca1b..b83e17e1c9d1 100644
> --- a/sysdeps/unix/sysv/linux/generic/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
> @@ -17,6 +17,7 @@
>     <https://www.gnu.org/licenses/>.  */
>  
>  #include <bits/wordsize.h>
> +#include <bits/timesize.h>
>  #include <kernel-features.h>
>  #include <sysdeps/unix/sysdep.h>
>  #include <sysdeps/unix/sysv/linux/sysdep.h>
> @@ -25,3 +26,26 @@
>  #ifdef __NR_llseek
>  # define __NR__llseek __NR_llseek
>  #endif
> +
> +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
> +     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
> +
> +/* Don't provide 32-bit time syscalls even if the kernel ABI provides
> +   them (Older variants of asm-generic ABIs e.g. ARC).  */
> +
> +# undef __NR_futex
> +# undef __NR_rt_sigtimedwait
> +# undef __NR_ppoll
> +# undef __NR_utimensat
> +# undef __NR_pselect6
> +# undef __NR_recvmmsg
> +# undef __NR_semtimedop
> +# undef __NR_mq_timedreceive
> +# undef __NR_mq_timedsend
> +# undef __NR_clock_getres
> +# undef __NR_timerfd_settime
> +# undef __NR_timerfd_gettime
> +# undef __NR_sched_rr_get_interval
> +# undef __NR_clock_adjtime
> +
> +#endif
> 

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH v3] Make any 32-bit time based syscalls unavailable for TIMESIZE==64
  2020-04-06 18:54       ` Vineet Gupta
@ 2020-04-13 21:12         ` Vineet Gupta
  2020-04-18  0:28           ` Vineet Gupta
  0 siblings, 1 reply; 12+ messages in thread
From: Vineet Gupta @ 2020-04-13 21:12 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stepan Golosunov, linux-snps-arc, Alistair Francis

On 4/6/20 11:54 AM, Vineet Gupta wrote:
> On 3/31/20 2:47 PM, Vineet Gupta via Libc-alpha wrote:
>> From: Vineet Gupta via Libc-alpha <libc-alpha@sourceware.org>
>>
>> An older asm-generic syscall ABI may have kernel provide 32-bit
>> time syscalls, so undef them to not mix 32/64 in 64-bit time regime.
>>
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> 
> ping !

ping ^2 !


> 
>> ---
>> Changes since v2
>>   - Made x32 safe
>>
>> Changes since v1
>>   - don't redirect these to 64-bit variants
>> ---
>>  sysdeps/unix/sysv/linux/generic/sysdep.h | 24 ++++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>
>> diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
>> index 40b4b955ca1b..b83e17e1c9d1 100644
>> --- a/sysdeps/unix/sysv/linux/generic/sysdep.h
>> +++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
>> @@ -17,6 +17,7 @@
>>     <https://www.gnu.org/licenses/>.  */
>>  
>>  #include <bits/wordsize.h>
>> +#include <bits/timesize.h>
>>  #include <kernel-features.h>
>>  #include <sysdeps/unix/sysdep.h>
>>  #include <sysdeps/unix/sysv/linux/sysdep.h>
>> @@ -25,3 +26,26 @@
>>  #ifdef __NR_llseek
>>  # define __NR__llseek __NR_llseek
>>  #endif
>> +
>> +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
>> +     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
>> +
>> +/* Don't provide 32-bit time syscalls even if the kernel ABI provides
>> +   them (Older variants of asm-generic ABIs e.g. ARC).  */
>> +
>> +# undef __NR_futex
>> +# undef __NR_rt_sigtimedwait
>> +# undef __NR_ppoll
>> +# undef __NR_utimensat
>> +# undef __NR_pselect6
>> +# undef __NR_recvmmsg
>> +# undef __NR_semtimedop
>> +# undef __NR_mq_timedreceive
>> +# undef __NR_mq_timedsend
>> +# undef __NR_clock_getres
>> +# undef __NR_timerfd_settime
>> +# undef __NR_timerfd_gettime
>> +# undef __NR_sched_rr_get_interval
>> +# undef __NR_clock_adjtime
>> +
>> +#endif
>>

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH v3] Make any 32-bit time based syscalls unavailable for TIMESIZE==64
  2020-04-13 21:12         ` Vineet Gupta
@ 2020-04-18  0:28           ` Vineet Gupta
  2020-04-18 16:50             ` Florian Weimer
  0 siblings, 1 reply; 12+ messages in thread
From: Vineet Gupta @ 2020-04-18  0:28 UTC (permalink / raw)
  To: Joseph Myers, libc-alpha; +Cc: linux-snps-arc

On 4/13/20 2:12 PM, Vineet Gupta via Libc-alpha wrote:
> On 4/6/20 11:54 AM, Vineet Gupta wrote:
>> On 3/31/20 2:47 PM, Vineet Gupta via Libc-alpha wrote:
>>> From: Vineet Gupta via Libc-alpha <libc-alpha@sourceware.org>
>>>
>>> An older asm-generic syscall ABI may have kernel provide 32-bit
>>> time syscalls, so undef them to not mix 32/64 in 64-bit time regime.
>>>
>>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
>>
>> ping !
> 
> ping ^2 !

If this is not suitable for common code, I'd still like to add this as part of ARC
port to safe guard against future snafus.

>>> ---
>>> Changes since v2
>>>   - Made x32 safe
>>>
>>> Changes since v1
>>>   - don't redirect these to 64-bit variants
>>> ---
>>>  sysdeps/unix/sysv/linux/generic/sysdep.h | 24 ++++++++++++++++++++++++
>>>  1 file changed, 24 insertions(+)
>>>
>>> diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
>>> index 40b4b955ca1b..b83e17e1c9d1 100644
>>> --- a/sysdeps/unix/sysv/linux/generic/sysdep.h
>>> +++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
>>> @@ -17,6 +17,7 @@
>>>     <https://www.gnu.org/licenses/>.  */
>>>  
>>>  #include <bits/wordsize.h>
>>> +#include <bits/timesize.h>
>>>  #include <kernel-features.h>
>>>  #include <sysdeps/unix/sysdep.h>
>>>  #include <sysdeps/unix/sysv/linux/sysdep.h>
>>> @@ -25,3 +26,26 @@
>>>  #ifdef __NR_llseek
>>>  # define __NR__llseek __NR_llseek
>>>  #endif
>>> +
>>> +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \
>>> +     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
>>> +
>>> +/* Don't provide 32-bit time syscalls even if the kernel ABI provides
>>> +   them (Older variants of asm-generic ABIs e.g. ARC).  */
>>> +
>>> +# undef __NR_futex
>>> +# undef __NR_rt_sigtimedwait
>>> +# undef __NR_ppoll
>>> +# undef __NR_utimensat
>>> +# undef __NR_pselect6
>>> +# undef __NR_recvmmsg
>>> +# undef __NR_semtimedop
>>> +# undef __NR_mq_timedreceive
>>> +# undef __NR_mq_timedsend
>>> +# undef __NR_clock_getres
>>> +# undef __NR_timerfd_settime
>>> +# undef __NR_timerfd_gettime
>>> +# undef __NR_sched_rr_get_interval
>>> +# undef __NR_clock_adjtime
>>> +
>>> +#endif
>>>
> 

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH v3] Make any 32-bit time based syscalls unavailable for TIMESIZE==64
  2020-04-18  0:28           ` Vineet Gupta
@ 2020-04-18 16:50             ` Florian Weimer
  2020-04-22 23:01               ` Vineet Gupta
  0 siblings, 1 reply; 12+ messages in thread
From: Florian Weimer @ 2020-04-18 16:50 UTC (permalink / raw)
  To: Vineet Gupta via Libc-alpha; +Cc: Vineet Gupta, linux-snps-arc, Joseph Myers

* Vineet Gupta via Libc-alpha:

> On 4/13/20 2:12 PM, Vineet Gupta via Libc-alpha wrote:
>> On 4/6/20 11:54 AM, Vineet Gupta wrote:
>>> On 3/31/20 2:47 PM, Vineet Gupta via Libc-alpha wrote:
>>>> From: Vineet Gupta via Libc-alpha <libc-alpha@sourceware.org>
>>>>
>>>> An older asm-generic syscall ABI may have kernel provide 32-bit
>>>> time syscalls, so undef them to not mix 32/64 in 64-bit time regime.
>>>>
>>>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
>>>
>>> ping !
>> 
>> ping ^2 !
>
> If this is not suitable for common code, I'd still like to add this
> as part of ARC port to safe guard against future snafus.

Have you tried to add the #undefs to fixup-asm-unistd.h?
See sysdeps/unix/sysv/linux/arm/fixup-asm-unistd.h for an example.

I have not tried if #undefs work there, but they should.  If not, we
can fix that.

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

* Re: [PATCH v3] Make any 32-bit time based syscalls unavailable for TIMESIZE==64
  2020-04-18 16:50             ` Florian Weimer
@ 2020-04-22 23:01               ` Vineet Gupta
  0 siblings, 0 replies; 12+ messages in thread
From: Vineet Gupta @ 2020-04-22 23:01 UTC (permalink / raw)
  To: Florian Weimer; +Cc: linux-snps-arc, Joseph Myers

On 4/18/20 9:50 AM, Florian Weimer wrote:
> * Vineet Gupta via Libc-alpha:
> 
>>
>> If this is not suitable for common code, I'd still like to add this
>> as part of ARC port to safe guard against future snafus.
> 
> Have you tried to add the #undefs to fixup-asm-unistd.h?
> See sysdeps/unix/sysv/linux/arm/fixup-asm-unistd.h for an example.
> 
> I have not tried if #undefs work there, but they should.  If not, we
> can fix that.

undef works great in arc/fixup-asm-unistd.h
Thx for the hint !

-Vineet

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

end of thread, other threads:[~2020-04-22 23:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 18:34 [PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches Vineet Gupta
2020-02-25  0:59 ` Alistair Francis
2020-02-25  1:16   ` Vineet Gupta
2020-02-25  9:27 ` Florian Weimer
2020-03-11 18:44   ` Vineet Gupta
2020-03-12 18:33   ` [PATCH v2] Force 64-bit time based syscalls for TIMESIZE==64 Vineet Gupta
2020-03-31 21:47     ` [PATCH v3] Make any 32-bit time based syscalls unavailable " Vineet Gupta
2020-04-06 18:54       ` Vineet Gupta
2020-04-13 21:12         ` Vineet Gupta
2020-04-18  0:28           ` Vineet Gupta
2020-04-18 16:50             ` Florian Weimer
2020-04-22 23:01               ` Vineet Gupta

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