diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-04-09 19:48:38 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-04-09 19:48:38 +0000 |
commit | 6c5c2ff6b963e0fa73cd13d8c4a4eb9ca4559eaa (patch) | |
tree | 57f9ebcf98429226215ffbd74b5b6d7ee947a01c /sys/arch | |
parent | 8b4f54a41d2afcc8169b3830081f4599ae0dce2e (diff) |
So clang 13 miscompiles dev/usb/umass_scsi.c with the combination if -Oz
and -mbranch-protection=bti. So turn off the BTI protection in ramdisk
kernels for now.
ok deraadt@, miod@, phessler@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/arm64/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/arm64/conf/Makefile.arm64 | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c index edda6e8fe9a..beb0bd7f5c0 100644 --- a/sys/arch/arm64/arm64/pmap.c +++ b/sys/arch/arm64/arm64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.93 2023/03/27 19:02:47 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.94 2023/04/09 19:48:37 kettenis Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com> * @@ -1688,8 +1688,10 @@ pmap_pte_update(struct pte_desc *pted, uint64_t *pl3) else access_bits = ap_bits_user[pted->pted_pte & PROT_MASK]; +#ifndef SMALL_KERNEL if (pm == pmap_kernel()) access_bits |= ATTR_GP; +#endif pte = (pted->pted_pte & PTE_RPGN) | attr | access_bits | L3_P; *pl3 = access_bits ? pte : 0; diff --git a/sys/arch/arm64/conf/Makefile.arm64 b/sys/arch/arm64/conf/Makefile.arm64 index 6bd73a674f6..1719e3d045d 100644 --- a/sys/arch/arm64/conf/Makefile.arm64 +++ b/sys/arch/arm64/conf/Makefile.arm64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.arm64,v 1.45 2023/03/27 19:02:47 kettenis Exp $ +# $OpenBSD: Makefile.arm64,v 1.46 2023/04/09 19:48:37 kettenis Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -61,7 +61,7 @@ CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option CMACHFLAGS= -march=armv8-a+nofp+nosimd \ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer \ - -ffixed-x18 -mbranch-protection=bti + -ffixed-x18 CMACHFLAGS+= -ffreestanding ${NOPIE_FLAGS} SORTR= sort -R .if ${IDENT:M-DNO_PROPOLICE} @@ -70,6 +70,9 @@ CMACHFLAGS+= -fno-stack-protector .if ${IDENT:M-DSMALL_KERNEL} SORTR= cat COPTIMIZE?= -Oz +CMACHFLAGS+= -mbranch-protection=none +.else +CMACHFLAGS+= -mbranch-protection=bti .endif DEBUG?= -g |