mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Martin Vajnar <martin.vajnar@gmail.com>
To: musl@lists.openwall.com
Cc: Markus Wichmann <nullplan@gmx.net>, Florian Weimer <fweimer@redhat.com>
Subject: Re: [musl] Backwards kernel compatibility
Date: Mon, 24 May 2021 15:52:44 +0200	[thread overview]
Message-ID: <CAHHiRUQ8uh5_EY8eLyq3C1S=NLHjW9ytsDKk9mVTJ1k1j37ypg@mail.gmail.com> (raw)
In-Reply-To: <20210510185837.GD2031@voyager>

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]

Hi, Markus,

sorry for the late reply it was quite busy lately. You're describing
exactly the issue, we are facing in our project. We need to use old kernel
which we have only in binary form and have headers for it. At the same time
we would like to have the latest musl running on it.

The problem we encounter is that for unsupported (or better said, not
supported yet) syscalls we get performance overhead because of the ENOSYS.

We see 2 options to approach this:

 1. remove the syscalls manually/alter the code to not invoke them (hacky)
 2. during musl compile time (maybe even configure-time), parse the
supplied kernel headers and based on availability of syscalls use defines
to steer the code execution (more universal)

Would the 2nd case be something that musl community would be interested in,
should we choose to implement it for the project?


Regards,
Martin

po 10. 5. 2021 v 20:58 odesílatel Markus Wichmann <nullplan@gmx.net> napsal:

> On Mon, May 10, 2021 at 07:50:44AM +0200, Martin Vajnar wrote:
> > Hello guys,
> >
> > I'd like to ask, if it is generally supported to run recent musl on older
> > kernels? My primary concern is that there are new syscalls being added to
> > linux, while at the same time I do not see a switch similar to glibc's to
> > select compatibility mode (--enable-kernel). Is there some means which
> > prevent invocation of unimplemented syscalls on older kernels when using
> > musl?
> >
> > Best regards,
> > Martin Vajnar
>
> In general, musl tries to support all kernel versions from 2.6.0 on. If
> you call a newer system call on a kernel that doesn't support it, you
> will get ENOSYS back, but all algorithms implemented in the library will
> fall back to that smallest common denominator (and some things even
> further).
>
> There is no way to prevent calls to new system calls on older kernels,
> since the kernel already takes care of that.
>
> Ciao,
> Markus
>

[-- Attachment #2: Type: text/html, Size: 2392 bytes --]

  reply	other threads:[~2021-05-24 13:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10  5:50 Martin Vajnar
2021-05-10  6:46 ` Florian Weimer
2021-05-10 18:58 ` Markus Wichmann
2021-05-24 13:52   ` Martin Vajnar [this message]
2021-05-24 22:00     ` Rich Felker
2021-06-02  7:38       ` Martin Vajnar
2021-06-02 11:52         ` Arnd Bergmann
2021-06-02 14:56           ` Rich Felker
2021-06-02 16:01             ` Arnd Bergmann
2021-06-02 16:18               ` Arnd Bergmann
2021-06-09  7:03           ` Arnd Bergmann
2021-06-08 22:16       ` Martin Vajnar
2021-06-09  0:37         ` Rich Felker

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='CAHHiRUQ8uh5_EY8eLyq3C1S=NLHjW9ytsDKk9mVTJ1k1j37ypg@mail.gmail.com' \
    --to=martin.vajnar@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=musl@lists.openwall.com \
    --cc=nullplan@gmx.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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