Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Feb 2024 16:45:16 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: aace2b59a835 - stable/14 - arm64: Add a BTI landing pad to .mcount
Message-ID:  <202402191645.41JGjG4v095965@gitrepo.freebsd.org>

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

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

commit aace2b59a835bb6b90a134e370e6af63792f4a12
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-10-16 14:34:19 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-02-19 13:12:30 +0000

    arm64: Add a BTI landing pad to .mcount
    
    The .mcount function needs a BTI branch target. As we can't rely on
    asm.h being included use the hint version of a "bti c" instruction.
    This is a nop when BTI is not supported or not used.
    
    Reviewed by:    markj
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D42230
    
    (cherry picked from commit 0590ed0967e025e1d155da9e06509f3fe9686feb)
---
 sys/arm64/include/profile.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/arm64/include/profile.h b/sys/arm64/include/profile.h
index 3e4a34669360..8a61ff995d83 100644
--- a/sys/arm64/include/profile.h
+++ b/sys/arm64/include/profile.h
@@ -68,6 +68,8 @@ static void _mcount
 "	.globl	.mcount				\n"	\
 "	.mcount:				\n"	\
 "	.cfi_startproc				\n"	\
+	/* Allow this to work with BTI, see BTI_C in asm.h */ \
+"	hint	#34				\n"	\
 	/* Load the caller return address as frompc */	\
 "	ldr	x0, [x29, #8]			\n"	\
 	/* Use our return address as selfpc */		\



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