Re: git: 80e4ac2964a1 - main - Work around VNET and DPCPU related panics on aarch64
Date: Sun, 23 Jul 2023 22:48:00 UTC
On 23 Jul 2023, at 23:38, Dimitry Andric <dim@FreeBSD.org> wrote: > > The branch main has been updated by dim: > > URL: https://cgit.FreeBSD.org/src/commit/?id=80e4ac2964a11edef456a15b77e43aadeaf273a2 > > commit 80e4ac2964a11edef456a15b77e43aadeaf273a2 > Author: Dimitry Andric <dim@FreeBSD.org> > AuthorDate: 2023-07-23 13:48:36 +0000 > Commit: Dimitry Andric <dim@FreeBSD.org> > CommitDate: 2023-07-23 22:35:04 +0000 > > Work around VNET and DPCPU related panics on aarch64 > > lld >= 14 and recent GNU ld can relax adrp+add and adrp+ldr > instructions, which breaks VNET and DPCPU when used in modules. Thanks for committing the workaround. This will need some kind of EN for 13.2 given LLVM 14 was merged in time for that and arm64 is a Tier 1 architecture in 13. There perhaps also needs to be some serious thought into our testing and release procedures given we allowed a Tier 1 architecture to have VNET and DPCU be totally broken in a point release for any kernel module. Especially when the bug was known, open against -CURRENT and triaged all before the MFC to stable/13; there needs to be better tracking of toolchain release blockers. Jess > Until VNET and DPCPU can be fixed to deal with these relaxed > instructions, disable linker relaxation for now. > > PR: 264094 > Reviewed by: markj > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D41156 > --- > sys/conf/kmod.mk | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk > index a83d64eb8bf7..be571c2bcf10 100644 > --- a/sys/conf/kmod.mk > +++ b/sys/conf/kmod.mk > @@ -170,6 +170,13 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer > CFLAGS+= -fPIC > .endif > > +.if ${MACHINE_CPUARCH} == "aarch64" > +# https://bugs.freebsd.org/264094 > +# lld >= 14 and recent GNU ld can relax adrp+add and adrp+ldr instructions, > +# which breaks VNET. > +LDFLAGS+= --no-relax > +.endif > + > # Temporary workaround for PR 196407, which contains the fascinating details. > # Don't allow clang to use fpu instructions or registers in kernel modules. > .if ${MACHINE_CPUARCH} == arm