All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Bezdeka <florian.bezdeka@siemens.com>
To: chensong <chensong@tj.kylinos.cn>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	xenomai@xenomai.org, henning.schild@siemens.com
Subject: Re: [PATCH 5/5] lib/cobalt/clock.c:dispatch clock_settime
Date: Fri, 13 Nov 2020 12:47:32 +0100	[thread overview]
Message-ID: <c745cfbd-ef39-fa61-190f-26826c4609ad@siemens.com> (raw)
In-Reply-To: <5FABB938.8080807@tj.kylinos.cn>

Hi all,

I reviewed all the timeset64 related patches.
Please note the comments below.

Did anyone look into testing yet? There are some combinations of kernel
and library versions we should look at and make sure they all behave as
expected. Maybe xenomai-images "project" could help here?

On 11.11.20 11:13, chensong via Xenomai wrote:
> 
> 
> On 2020年11月11日 17:43, Jan Kiszka wrote:
>> On 11.11.20 10:23, chensong wrote:
>>>
>>>
>>> On 2020年11月11日 15:29, Jan Kiszka wrote:
>>>> On 11.11.20 04:55, chensong wrote:
>>>>>
>>>>>
>>>>> On 2020年11月10日 18:24, Jan Kiszka wrote:
>>>>>>
>>>>>> On 03.11.20 04:05, chensong wrote:
>>>>>>> Regarding sizeof time_t, dispatch 32bit timespec to clock_settime
>>>>>>> and 64bit timespec to clock_settime64.
>>>>>>>
>>>>>>> Signed-off-by: chensong <chensong@tj.kylinos.cn>
>>>>>>> ---
>>>>>>>     lib/cobalt/clock.c | 6 +++++-
>>>>>>>     1 file changed, 5 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/lib/cobalt/clock.c b/lib/cobalt/clock.c
>>>>>>> index 11fd1aa..44b2f3f 100644
>>>>>>> --- a/lib/cobalt/clock.c
>>>>>>> +++ b/lib/cobalt/clock.c
>>>>>>> @@ -237,7 +237,11 @@ COBALT_IMPL(int, clock_settime, (clockid_t
>>>>>>> clock_id, const struct timespec *tp))
>>>>>>>     {
>>>>>>>         int ret;
>>>>>>>
>>>>>>> -    ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_settime, clock_id, tp);
>>>>>>> +    if (sizeof(time_t) > 4)
>>>>>>> +        ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_settime64,
>>>>>>> +                    clock_id, tp);
>>>>>>> +    else
>>>>>>> +        ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_settime, clock_id,
>>>>>>> tp);
>>>>>>
>>>>>> Maybe do a single
>>>>>>
>>>>>> XENOMAI_SYSCALL2(sizeof(time_t) > 4 ? sc_cobalt_clock_settime64
>>>>>>                                        : sc_cobalt_clock_settime,
>>>>>> ...)
>>>>>>
>>>>>> But we need ABI revision negotiation here. If a new lib is run on a
>>>>>> kernel that does not have settime64, things will fail (the other way
>>>>>> around is fine). We need to ensure that new userspace can check for
>>>>>> this
>>>>>> upfront while old userspace will happily run (hard requirement for
>>>>>> making these patches part of 3.1.x).
>>>>>>
>>>>>> Jan
>>>>>
>>>>> As far as my understanding, ABI revision negotiation happens in
>>>>> low_init
>>>>> already, it reminds userspace process that lib and kernel are not
>>>>> compatible at the first place. Therefore, it addresses the scenario
>>>>> you
>>>>> are talking about(new userspace, old kernel or the other way around).
>>>>>
>>>>
>>>> Ah, right. Perfect. Then also update those revisions make detection
>>>> work
>>>> as required.
>>>>
>>> ok, will do.
>>>
>>> XENOMAI_ABI_REV is defined in those files:
>>>
>>> ./kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h:25:#define
>>> XENOMAI_ABI_REV   17UL
>>> ./kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h:22:#define
>>> XENOMAI_ABI_REV   17UL
>>> ./kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h:25:#define
>>> XENOMAI_ABI_REV
>>>    1UL
>>> ./kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h:22:#define
>>>
>>> XENOMAI_ABI_REV   17UL
>>>
>>>
>>> increase them to 18UL?
>>>
>>> if you agree, i will submit a v2 for this one.
>>
>> We need to increase, yes, but we need to keep previous revision userland
>> working.

Do we really need to increase the ABI revision?
My understanding is, that once the kernel has been updated applications
using an old library will be locked out. I guess this is not allowed
when bumping the xenomai minor revision only.

I will come up with a small patch set that allows some feature detection
during runtime. That should help with the identification which syscall
should be used.

Would be glad if you both could have a look at it.

> 
> low_init will stop previous revision userland working once we increase it.
> 
>>
>>>
>>>>> what's more, do we or customers release lib without kernel. About
>>>>> y2038,
>>>>> vanilla kernel, glibc, libcobalt, xenomai, too many scenarios to be
>>>>> addressed, to complicated, we'd better simplify it if possible.
>>>>
>>>> Xenomai does not issue separate releases for the kernel part
>>>> implementing the syscalls and for the xenomai libs using them.
>>>>
>>>> However, applications may have been bundled with libs from previous
>>>> releases of *the same stable series*, and users can expect (bugs aside,
>>>> new features excluded) that their xenomai lib from, say, 3.1 will still
>>>> work with a core from 3.1.1.
> if XENOMAI_ABI_REV in lib is different with XENOMAI_ABI_REV in kernel,
> low_init will stop it running at the first place.
> 
> Even if it doesn't, old application, old lib, will go to clock_settime,
> i can't see any impact here.
> 
> chensong
> 
>>>>
>>>> Jan
>>>>
>>>
>>> In those cases, they will get "ABI mismatch, required xxx, provided
>>> xxx", user will realize they need new kernel with new lib.
>>>
>>> My point is, ignore those too old things. arnd Bergmann dropped
>>> something as well.
>>>
>>
>> We can't break the scenario described above. That's in fact in line with
>> what kernel and libc do, just that they also account for newer libc
>> running on older kernels (while we deny that).
>>
>> Jan
>>
> 
> 
> 
> 


-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


  reply	other threads:[~2020-11-13 11:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  3:05 [PATCH 5/5] lib/cobalt/clock.c:dispatch clock_settime chensong
2020-11-10 10:24 ` Jan Kiszka
2020-11-11  3:55   ` chensong
2020-11-11  7:29     ` Jan Kiszka
2020-11-11  9:23       ` chensong
2020-11-11  9:43         ` Jan Kiszka
2020-11-11 10:13           ` chensong
2020-11-13 11:47             ` Florian Bezdeka [this message]
2020-11-13 11:56               ` Jan Kiszka
2020-11-13 11:59                 ` [PATCH 0/3] Make offered kernel features accessible during florian.bezdeka
2020-11-13 12:00                   ` [PATCH 1/3] cobalt uapi: Introducing new feature flag for settime64 availability florian.bezdeka
2020-11-13 13:25                     ` Jan Kiszka
2020-11-13 16:18                       ` florian.bezdeka
2020-11-14  7:33                         ` Jan Kiszka
2020-11-14  6:57                     ` song
2020-11-14  7:32                       ` Jan Kiszka
2020-11-14  7:50                         ` song
2020-11-16 14:07                           ` [PATCH v2 0/3] Make offered kernel features accessible during florian.bezdeka
2020-11-16 14:07                             ` [PATCH v2 1/3] lib/cobalt: Rename cobalt_check_features to cobalt_arch_check_features florian.bezdeka
2020-11-16 14:07                             ` [PATCH v2 3/3] cobalt uapi: Introducing new feature flag for time64 availability florian.bezdeka
2020-12-11  6:41                               ` Jan Kiszka
2020-11-16 14:07                             ` [PATCH v2 2/3] lib/cobalt: Introduce generic feature initialization and check API florian.bezdeka
2020-11-17  4:31                               ` song
2020-11-17  8:29                                 ` florian.bezdeka
2020-11-17  8:43                                   ` song
2020-11-17 14:28                               ` Jan Kiszka
2020-11-13 12:00                   ` [PATCH 2/3] lib/cobalt: Rename cobalt_check_features to cobalt_arch_check_features florian.bezdeka
2020-11-13 12:00                   ` [PATCH 3/3] lib/cobalt: Introduce generic feature initialization and check API florian.bezdeka
2020-11-13 13:25                     ` Jan Kiszka
2020-11-13 16:10                       ` florian.bezdeka
2020-11-14  7:04               ` [PATCH 5/5] lib/cobalt/clock.c:dispatch clock_settime song

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=c745cfbd-ef39-fa61-190f-26826c4609ad@siemens.com \
    --to=florian.bezdeka@siemens.com \
    --cc=chensong@tj.kylinos.cn \
    --cc=henning.schild@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --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.