All of lore.kernel.org
 help / color / mirror / Atom feed
From: chensong <chensong@tj.kylinos.cn>
To: "florian.bezdeka@siemens.com" <florian.bezdeka@siemens.com>,
	"rpm@xenomai.org" <rpm@xenomai.org>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>,
	"jan.kiszka@siemens.com" <jan.kiszka@siemens.com>,
	"chensong@kylinos.cn" <chensong@kylinos.cn>
Subject: Re: [RFC PATCH v2 2/4] y2038: Adding sem_timedwait_time64
Date: Wed, 10 Mar 2021 17:46:10 +0800	[thread overview]
Message-ID: <60489562.3010809@tj.kylinos.cn> (raw)
In-Reply-To: <7a4aaa493fe5afbea25722bc2a04f7d91fc71275.camel@siemens.com>



On 2021年03月10日 15:51, florian.bezdeka--- via Xenomai wrote:
> On Tue, 2021-03-09 at 07:53 +0000, florian.bezdeka--- via Xenomai
> wrote:
>> On Mon, 2021-03-08 at 19:28 +0100, Jan Kiszka wrote:
>>> On 08.03.21 18:02, Florian Bezdeka wrote:
>>>> Implementation is heavily inspired by the sem_timedwait syscall,
>>>> but expecting time64 based timespec / timeout.
>>>>
>>>> [snip]
>>>> @@ -82,6 +83,28 @@ static inline int cobalt_strncpy_from_user(char *dst, const char __user *src,
>>>>   	return __xn_strncpy_from_user(dst, src, count);
>>>>   }
>>>>
>>>> +static inline int cobalt_get_timespec64(struct timespec64 *ts,
>>>> +				const struct __kernel_timespec __user *uts)
>>>> +{
>>>> +	struct __kernel_timespec kts;
>>>> +	int ret;
>>>> +
>>>> +	ret = cobalt_copy_from_user(&kts, uts, sizeof(kts));
>>>> +	if (ret)
>>>> +		return -EFAULT;
>>>> +
>>>> +	ts->tv_sec = kts.tv_sec;
>>>> +
>>>> +	/* Zero out the padding in compat mode */
>>>> +	if (in_compat_syscall())
>>>> +		kts.tv_nsec &= 0xFFFFFFFFUL;
>>>> +
>>>> +	/* In 32-bit mode, this drops the padding */
>>>> +	ts->tv_nsec = kts.tv_nsec;
>>>> +
>>>> +	return 0;
>>>> +}
>>>> +
>>>
>>> Why inline? But that question is likely obsolete when we can avoid the
>>> code duplication below.
>>
>> Inline can be removed. Something for v3. There will follow more calls
>> to that helper. All syscalls reading a struct timespec from userspace
>> will have to use it.
>>>>
>
> I was following the pattern of all the other struct timespec64 heplers
> introduced by Philippe here. So "static inline". Removing "inline" now
> throws some warnings (at least on gcc 10), because the function is
> unused in this file.
>
> So my question is now: Where should this function reside?
>
> Linux pattern: kernel/time/time.c (where get_timespec64 resides)
> Xenomai path would be kernel/cobalt/time.c
>
> This is the last thing I have to address. A non RFC series will follow
> afterwards, based on Philippe's tree.
>
> @Song: My hope was this series can be used as pattern, to start
> integration of all the other remaining parts. What do you think? Is
> that sufficient?

This series look good to me and i'm following it to work on my patches.

Song
> -
>




  reply	other threads:[~2021-03-10  9:46 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 15:18 [PATCH 1/5] cobalt/kernel: y2038: convert struct timeval to __kernel_old_timeval Philippe Gerum
2021-02-20 15:18 ` [PATCH 2/5] cobalt/kernel: y2038: convert struct timespec to timespec64 Philippe Gerum
2021-02-21  2:17   ` chensong
2021-02-21 15:27     ` Philippe Gerum
2021-02-22  1:04       ` chensong
2021-02-22  8:21       ` florian.bezdeka
2021-02-22  9:08         ` Philippe Gerum
2021-03-08 12:19           ` Jan Kiszka
2021-03-08 14:01             ` Philippe Gerum
2021-03-08 14:03               ` Jan Kiszka
2021-03-03 10:05   ` florian.bezdeka
2021-03-04  9:35     ` Philippe Gerum
2021-03-04  9:49       ` florian.bezdeka
2021-03-04  9:55         ` Philippe Gerum
2021-03-04  9:59           ` florian.bezdeka
2021-03-04 10:08           ` Philippe Gerum
2021-03-04 11:36             ` [y2038][RFC PATCH 0/2] Pattern for implementing y2038 syscalls Florian Bezdeka
2021-03-04 11:36               ` [y2038][RFC PATCH 1/2] y2038: Fixing the sem_timedwait syscall for 32 bit systems Florian Bezdeka
2021-03-04 15:11                 ` Philippe Gerum
2021-03-04 15:22                   ` florian.bezdeka
2021-03-04 15:42                     ` Philippe Gerum
2021-03-08 17:02                       ` [RFC PATCH v2 0/4] Pattern for implementing y2038 syscalls Florian Bezdeka
2021-03-08 17:02                         ` [RFC PATCH v2 1/4] y2038: Fixing the sem_timedwait syscall for 32 bit systems Florian Bezdeka
2021-03-08 17:12                           ` Jan Kiszka
2021-03-08 18:11                             ` florian.bezdeka
2021-03-08 18:22                               ` Jan Kiszka
2021-03-09  9:46                           ` Philippe Gerum
2021-03-09 11:08                             ` florian.bezdeka
2021-03-08 17:02                         ` [RFC PATCH v2 2/4] y2038: Adding sem_timedwait_time64 Florian Bezdeka
2021-03-08 18:28                           ` Jan Kiszka
2021-03-09  7:53                             ` florian.bezdeka
2021-03-10  7:51                               ` florian.bezdeka
2021-03-10  9:46                                 ` chensong [this message]
2021-03-08 17:02                         ` [RFC PATCH v2 3/4] y2038: Add tests for the sc_cobalt_sem_timedwait_time64 syscall Florian Bezdeka
2021-03-08 18:35                           ` Jan Kiszka
2021-03-09  8:00                             ` florian.bezdeka
2021-03-08 17:02                         ` [RFC PATCH v2 4/4] y2038: lib/cobalt: Add support of sc_cobalt_sem_timedwait_time64 Florian Bezdeka
2021-03-10 13:09                           ` [y2038][PATCH v3 0/4] Pattern for implementing y2038 syscalls Florian Bezdeka
2021-03-10 13:09                             ` [y2038][PATCH v3 1/4] y2038: Fixing the sem_timedwait syscall for 32 bit systems Florian Bezdeka
2021-03-10 13:09                             ` [y2038][PATCH v3 2/4] y2038: Adding sem_timedwait64 Florian Bezdeka
2021-03-10 13:09                             ` [y2038][PATCH v3 3/4] y2038: Add tests for the sc_cobalt_sem_timedwait64 syscall Florian Bezdeka
2021-03-10 13:09                             ` [y2038][PATCH v3 4/4] y2038: lib/cobalt: Add support of sc_cobalt_sem_timedwait64 Florian Bezdeka
2021-03-11  2:38                               ` chensong
2021-03-04 11:36               ` [y2038][RFC PATCH 2/2] y2038: Adding sem_timedwait_time64 Florian Bezdeka
2021-03-05  5:49                 ` chensong
2021-03-05  6:36                   ` florian.bezdeka
2021-03-05  7:42                     ` chensong
2021-03-05  7:53                       ` florian.bezdeka
2021-03-08 12:59             ` [PATCH 2/5] cobalt/kernel: y2038: convert struct timespec to timespec64 Jan Kiszka
2021-03-10 17:52             ` florian.bezdeka
2021-03-10 18:14               ` Philippe Gerum
2021-03-03 14:36   ` florian.bezdeka
2021-03-04  9:44     ` Philippe Gerum
2021-03-04  9:57       ` florian.bezdeka
2021-02-20 15:18 ` [PATCH 3/5] lib: y2038: convert to internal timespec type Philippe Gerum
2021-02-20 15:18 ` [PATCH 4/5] cobalt/kernel: y2038: convert struct itimerspec to itimerspec64 Philippe Gerum
2021-02-20 15:18 ` [PATCH 5/5] cobalt/kernel: y2038: convert struct timex to __kernel_timex Philippe Gerum

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=60489562.3010809@tj.kylinos.cn \
    --to=chensong@tj.kylinos.cn \
    --cc=chensong@kylinos.cn \
    --cc=florian.bezdeka@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.