Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2019 19:38:28 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r350764 - head/sys/arm64/arm64
Message-ID:  <CANCZdfocZ6DVm7ASgMia0owvx9EPs-8NuH=bQzRZ=BXpLraQqw@mail.gmail.com>
In-Reply-To: <20190808225947.GD1531@FreeBSD.org>
References:  <201908081748.x78Hm79V085760@repo.freebsd.org> <20190808225947.GD1531@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff <glebius@freebsd.org> wrote:

>   Hi,
>
> why do we need COMPAT_43 for arm64 at all? I can't imagine an
> application that would require this compatibility.
>
> A more general question is how far in the future are we going
> to carry COMPAT_43 for i386/amd64?
>

COMPAT_43 is a weird option. It's a combo of both sys calls and kernel
behavior modifications. Before we thinned the ABIs we supported, it was
necessary for them as well. The biggest behavior change is around signals.
It is weird to sort out and nobody has done the deep analysis to see what
is truly unused and what is there for compat with Linux and other SysV
systems...

Warner


On Thu, Aug 08, 2019 at 05:48:07PM +0000, Warner Losh wrote:
> W> Author: imp
> W> Date: Thu Aug  8 17:48:07 2019
> W> New Revision: 350764
> W> URL: https://svnweb.freebsd.org/changeset/base/350764
> W>
> W> Log:
> W>   Make arm64 32-bit mode compile with COMPAT_43
> W>
> W>   The COMPAT_43 option isn't quite like the other compat options, and
> arm64 makes
> W>   attempts to support it in 64-bit mode. In 32-bit compat mode,
> however, two
> W>   syscall implementations that COMPAT_FREEBSD32 assumes will be there
> are
> W>   missing. Provide implementations for these: ofreebsd32_sigreturn
> (which we'll
> W>   never encounter, so implement it as nosys as is done in kern_sig.c)
> and
> W>   ofreebsd32_getpagesize, where we'll always return 4096 since that's
> the only
> W>   PAGE_SIZE we support, similar to how the ia32 implementation does
> things.
> W>
> W>   Reviewed by: manu@
> W>   Differential Revision: https://reviews.freebsd.org/D21192
> W>
> W> Modified:
> W>   head/sys/arm64/arm64/freebsd32_machdep.c
> W>
> W> Modified: head/sys/arm64/arm64/freebsd32_machdep.c
> W>
> ==============================================================================
> W> --- head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug  8 17:30:51 2019
>       (r350763)
> W> +++ head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug  8 17:48:07 2019
>       (r350764)
> W> @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
> W>  #include <sys/syscallsubr.h>
> W>  #include <sys/ktr.h>
> W>  #include <sys/sysent.h>
> W> +#include <sys/sysproto.h>
> W>  #include <machine/armreg.h>
> W>  #ifdef VFP
> W>  #include <machine/vfp.h>
> W> @@ -410,3 +411,30 @@ freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi,
> sigs
> W>      mtx_lock(&psp->ps_mtx);
> W>
> W>  }
> W> +
> W> +#ifdef COMPAT_43
> W> +/*
> W> + * COMPAT_FREEBSD32 assumes we have this system call when COMPAT_43 is
> defined.
> W> + * FreeBSD/arm provies a similar getpagesize() syscall.
> W> + */
> W> +#define ARM32_PAGE_SIZE 4096
> W> +int
> W> +ofreebsd32_getpagesize(struct thread *td,
> W> +    struct ofreebsd32_getpagesize_args *uap)
> W> +{
> W> +
> W> +    td->td_retval[0] = ARM32_PAGE_SIZE;
> W> +    return (0);
> W> +}
> W> +
> W> +/*
> W> + * Mirror the osigreturn definition in kern_sig.c for !i386 platforms.
> This
> W> + * mirrors what's connected to the FreeBSD/arm syscall.
> W> + */
> W> +int
> W> +ofreebsd32_sigreturn(struct thread *td, struct
> ofreebsd32_sigreturn_args *uap)
> W> +{
> W> +
> W> +    return (nosys(td, (struct nosys_args *)uap));
> W> +}
> W> +#endif
> W> _______________________________________________
> W> svn-src-all@freebsd.org mailing list
> W> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> W> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
>
> --
> Gleb Smirnoff
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfocZ6DVm7ASgMia0owvx9EPs-8NuH=bQzRZ=BXpLraQqw>