Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 May 2021 19:29:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-arm@FreeBSD.org
Subject:   [Bug 256132] arm64 kernels with aarch32 support should claim support for armv6 in addition to armv7
Message-ID:  <bug-256132-7@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256132

            Bug ID: 256132
           Summary: arm64 kernels with aarch32 support should claim
                    support for armv6 in addition to armv7
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: fuz@fuz.su

If I read the value of the sysctl kern.supported_archs on an arm64 FreeBSD
13.0-RELEASE system, I get the output

    kern.supported_archs: aarch64 armv7

However, this list is incomplete.  Clearly, the kernel is also capable of
executing armv6 binaries.  This unfortunately means that Poudriere refuses =
to
install an armv6 jail on the system, making it difficult for me to test arm=
v6
ports.

It seems like this is the consequence of unfortunate programming.=20
sys/kern/kern_mib.c defines the sysctl like such:

---
#ifdef COMPAT_FREEBSD32
#define MACHINE_ARCHES  MACHINE_ARCH " " MACHINE_ARCH32
#else
#define MACHINE_ARCHES  MACHINE_ARCH
#endif
#endif

SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE,
    MACHINE_ARCHES, 0, "Supported architectures for binaries");
---

so if COMPAT_FREEBSD32 is enabled, the kernel claims support for exactly one
additional 32 bit architecture, which is clearly insufficient: (a) there ca=
n be
multiple supported 32 bit architectures and (b) support for 32 bit programs=
 may
depend on processor features.  For example, on arm64 not all cores support
executing 32 bit binaries, but the way the sysctl is set up, the kernel just
wrongly claims it can, probably failing only when execution is tried (I hav=
e no
such system to test this, but e.g. the Apple M1 chip is like this).  This s=
eems
quite unexpected.

Please fix the way kern.supported_archs is set up such that the list reflec=
ts
both armv6 and armv7 for arm64 cores and that only if the AArch32 execution
state is supported at all.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-256132-7>