NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-arm/54702: Support earmv6hf binary for COMPAT_NETBSD32 on aarch64



>Number:         54702
>Category:       port-arm
>Synopsis:       Support earmv6hf binary for COMPAT_NETBSD32 on aarch64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-arm-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 17 06:10:00 +0000 2019
>Originator:     Rin Okuyama
>Release:        9.99.17
>Organization:
Department of Physics, Meiji University
>Environment:
NetBSD rpi 9.99.17 NetBSD 9.99.17 (GENERIC64) #26: Sat Nov 16 08:24:23 JST 2019  rin@latipes:/build/src/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
Currently, earmv6hf binaries cannot run on COMPAT_NETBSD32 on aarch64
due to illegal instructions; ARMv6 instructions with cache operations
register (c7) were deprecated in ARMv7, and are not supported on ARMv8
with LP64 kernel.

This patch

	http://www.netbsd.org/~rin/aarch64_emul_armv6_20191113.patch

adds software emulation for such instructions. Also, ep_machine_arch
(default: earmv7hf) is copied from executables if present, as we do for
mips64; uname -p reports earmv6hf if it is built for earmv6hf.

With this patch, evbarm-earmv6hf-el userland works just fine on aarch64
kernel as far as I can see. Older earm architectures may be supported,
in principle, in a similar manner.

Some remarks:

Linux also emulates these instructions on arm64 kernel:

	https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/armv8_deprecated.c#L460

However, it just ignores "mcr p15, 0, <Rd>, c7, c5, 4"
(flush prefetch buffer). This patch emulates it by "isb".

The condition code in the instructions are neglected as in the same
manner as Linux does. I expect it is no problem in practice.
>How-To-Repeat:
Run binary compiled for earmv6hf on aarch64 kernel.
>Fix:
Described above.



Home | Main Index | Thread Index | Old Index