Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jul 2023 18:06:24 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 98e7f836e65e - stable/12 - Work around VNET and DPCPU related panics on aarch64
Message-ID:  <202307261806.36QI6O1b087625@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=98e7f836e65ee413cd0b383371a6aca0115084ed

commit 98e7f836e65ee413cd0b383371a6aca0115084ed
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-07-23 13:48:36 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-07-26 18:03:46 +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.
    
    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
    
    (cherry picked from commit 80e4ac2964a11edef456a15b77e43aadeaf273a2)
---
 sys/conf/kmod.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 610484ba7e36..f67be86eeb73 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -168,6 +168,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



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