From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32357 invoked from network); 24 May 2021 13:53:09 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 24 May 2021 13:53:09 -0000 Received: (qmail 6122 invoked by uid 550); 24 May 2021 13:53:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 6104 invoked from network); 24 May 2021 13:53:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qUntcLodqZ3ppDYlOYZdyLY1bTLyW/EsTQJXMcaQ3AA=; b=TtX126hPifShydEK6t4+UvJhESNiL2d4jMTs/9ss2Ar21Dur1VSqZUtepsjG7EqWB4 uvWBZ0OhlHoSiGT7wD8ixHpvSiyTTzzxz+MZbMMroWqhMoQD2Ob5S2Aq8+3YuONiJMfy 2fbp8HShZPZl0t1X4DwCrECzW47jiOtrjWG6uY/Ln9k82pVmCjatRHWRQcuVkX7J9S77 vF02DNzC3rReCy9niIlHJqMPaD8uxwCPP/pmxobQqEMBd5C6CyPegk4tbHH/qn2GA0wa j8Sjay7wjOg7R+vA6cDnrfrd4ALFsMkcjll/1suUXhjYOFW5oqHEgJ+rQJQfiMOV7Ivd qgDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qUntcLodqZ3ppDYlOYZdyLY1bTLyW/EsTQJXMcaQ3AA=; b=YHoyYp4w60o02lxfecFnSgvdgGBjWCROD0+M6gGbz7BM9PsRwLBuoL8AyxYZL4SUy+ sX5N8c237tx5HCA7Ghjp3trCdVn3by9aXvZjBa2rm5Q4Iq+aL6n5yhx/Sg4nJiUml8Im /nxE1hCvCO4bpWXA0xN27Sel8nlO+9vpAcFbSYfjXDwkOQFhset5MZsH2cSLDoEXnios a+9bPTTVHewuLnE1dCpji/UlT3jnK15W4VnjJ4sybHdlnROm3NtBQDv1Rb+dHsAt4PHs KHs8WGttfGne9VWqQ/3gWC1hcPv2mprnPUWlcwYEjoHAAzTEDRT9CjUFXK5lSCqhNzV+ GpNw== X-Gm-Message-State: AOAM532R3fcLYo2KRq+QTZKkeXN/AWK86S07+Ymipm913hv5StAJjBoR 286A6hYeyYsX4P6VBkLCtDz7gkWT5lhoVi4xJyUwOxB0RJ2exA== X-Google-Smtp-Source: ABdhPJwOxD+AbGVCTcWDx/CoBu+tn3bMCfIjPqeBEbG1/+MYYdRl0NoO2gTSYVlUU31blArkDnDrOVbmok3E4mav7Vg= X-Received: by 2002:a2e:8682:: with SMTP id l2mr17877898lji.298.1621864375376; Mon, 24 May 2021 06:52:55 -0700 (PDT) MIME-Version: 1.0 References: <20210510185837.GD2031@voyager> In-Reply-To: <20210510185837.GD2031@voyager> From: Martin Vajnar Date: Mon, 24 May 2021 15:52:44 +0200 Message-ID: To: musl@lists.openwall.com Cc: Markus Wichmann , Florian Weimer Content-Type: multipart/alternative; boundary="000000000000f7dea305c313b9b3" Subject: Re: [musl] Backwards kernel compatibility --000000000000f7dea305c313b9b3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C3=ADlatel Markus Wichmann n= apsal: > 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 old= er > > 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 usin= g > > 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 > --000000000000f7dea305c313b9b3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Markus,

sorry for the late rep= ly it was quite busy lately. You're describing exactly the issue, we ar= e facing in our project. We need to use old kernel which we have only in bi= nary form and have headers for it. At the same time we would like to have t= he latest musl running on it.

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

We see 2 options to approach this:
=C2=A01. remove the syscalls manually/alter the code to not invoke th= em (hacky)
=C2=A02. during musl compile time (maybe even configure-time)= , parse the supplied kernel headers and based on availability of syscalls u= se defines to steer the code execution (more universal)

Would the 2n= d case be something that musl community would be interested in, should we c= hoose to implement it for the project?


Regards,
Martin
<= br>
po 10. = 5. 2021 v=C2=A020:58 odes=C3=ADlatel 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 o= n 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&#= 39;s to
> select compatibility mode (--enable-kernel). Is there some means which=
> prevent invocation of unimplemented syscalls on older kernels when usi= ng
> 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
--000000000000f7dea305c313b9b3--