Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:

- Ensure that the compiler and linker versions are aligned so that ld
doesn't complain about not understanding a .note.gnu.property section
(emitted when pointer authentication is enabled).

- Force -mbranch-protection=none when the feature is not enabled, in
case a compiler may choose a different default value.

- Remove CONFIG_DEBUG_ALIGN_RODATA. It was never in defconfig and
rarely enabled.

- Fix checking 16-bit Thumb-2 instructions checking mask in the
emulation of the SETEND instruction (it could match the bottom half
of a 32-bit Thumb-2 instruction).

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: armv8_deprecated: Fix undef_hook mask for thumb setend
arm64: remove CONFIG_DEBUG_ALIGN_RODATA feature
arm64: Always force a branch protection mode when the compiler has one
arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch
init/kconfig: Add LD_VERSION Kconfig

+19 -32
+4 -1
arch/arm64/Kconfig
··· 1502 1502 default y 1503 1503 depends on !KVM || ARM64_VHE 1504 1504 depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC 1505 - depends on CC_IS_GCC || (CC_IS_CLANG && AS_HAS_CFI_NEGATE_RA_STATE) 1505 + # GCC 9.1 and later inserts a .note.gnu.property section note for PAC 1506 + # which is only understood by binutils starting with version 2.33.1. 1507 + depends on !CC_IS_GCC || GCC_VERSION < 90100 || LD_VERSION >= 233010000 1508 + depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE 1506 1509 depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS) 1507 1510 help 1508 1511 Pointer authentication (part of the ARMv8.3 Extensions) provides
-13
arch/arm64/Kconfig.debug
··· 52 52 53 53 If in doubt, say "Y". 54 54 55 - config DEBUG_ALIGN_RODATA 56 - depends on STRICT_KERNEL_RWX 57 - bool "Align linker sections up to SECTION_SIZE" 58 - help 59 - If this option is enabled, sections that may potentially be marked as 60 - read only or non-executable will be aligned up to the section size of 61 - the kernel. This prevents sections from being split into pages and 62 - avoids a potential TLB penalty. The downside is an increase in 63 - alignment and potentially wasted space. Turn on this option if 64 - performance is more important than memory pressure. 65 - 66 - If in doubt, say N. 67 - 68 55 config DEBUG_EFI 69 56 depends on EFI && DEBUG_INFO 70 57 bool "UEFI debugging"
+6 -1
arch/arm64/Makefile
··· 65 65 include/generated/asm-offsets.h)) 66 66 endif 67 67 68 + # Ensure that if the compiler supports branch protection we default it 69 + # off, this will be overridden if we are using branch protection. 70 + branch-prot-flags-y += $(call cc-option,-mbranch-protection=none) 71 + 68 72 ifeq ($(CONFIG_ARM64_PTR_AUTH),y) 69 73 branch-prot-flags-$(CONFIG_CC_HAS_SIGN_RETURN_ADDRESS) := -msign-return-address=all 70 74 branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET) := -mbranch-protection=pac-ret+leaf ··· 77 73 # we pass it only to the assembler. This option is utilized only in case of non 78 74 # integrated assemblers. 79 75 branch-prot-flags-$(CONFIG_AS_HAS_PAC) += -Wa,-march=armv8.3-a 80 - KBUILD_CFLAGS += $(branch-prot-flags-y) 81 76 endif 77 + 78 + KBUILD_CFLAGS += $(branch-prot-flags-y) 82 79 83 80 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) 84 81 KBUILD_CPPFLAGS += -mbig-endian
+1 -11
arch/arm64/include/asm/memory.h
··· 120 120 121 121 /* 122 122 * Alignment of kernel segments (e.g. .text, .data). 123 - */ 124 - #if defined(CONFIG_DEBUG_ALIGN_RODATA) 125 - /* 126 - * 4 KB granule: 1 level 2 entry 127 - * 16 KB granule: 128 level 3 entries, with contiguous bit 128 - * 64 KB granule: 32 level 3 entries, with contiguous bit 129 - */ 130 - #define SEGMENT_ALIGN SZ_2M 131 - #else 132 - /* 123 + * 133 124 * 4 KB granule: 16 level 3 entries, with contiguous bit 134 125 * 16 KB granule: 4 level 3 entries, without contiguous bit 135 126 * 64 KB granule: 1 level 3 entry 136 127 */ 137 128 #define SEGMENT_ALIGN SZ_64K 138 - #endif 139 129 140 130 /* 141 131 * Memory types available.
+1 -1
arch/arm64/kernel/armv8_deprecated.c
··· 601 601 }, 602 602 { 603 603 /* Thumb mode */ 604 - .instr_mask = 0x0000fff7, 604 + .instr_mask = 0xfffffff7, 605 605 .instr_val = 0x0000b650, 606 606 .pstate_mask = (PSR_AA32_T_BIT | PSR_AA32_MODE_MASK), 607 607 .pstate_val = (PSR_AA32_T_BIT | PSR_AA32_MODE_USR),
+3 -5
drivers/firmware/efi/libstub/arm64-stub.c
··· 75 75 76 76 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && phys_seed != 0) { 77 77 /* 78 - * If CONFIG_DEBUG_ALIGN_RODATA is not set, produce a 79 - * displacement in the interval [0, MIN_KIMG_ALIGN) that 80 - * doesn't violate this kernel's de-facto alignment 78 + * Produce a displacement in the interval [0, MIN_KIMG_ALIGN) 79 + * that doesn't violate this kernel's de-facto alignment 81 80 * constraints. 82 81 */ 83 82 u32 mask = (MIN_KIMG_ALIGN - 1) & ~(EFI_KIMG_ALIGN - 1); 84 - u32 offset = !IS_ENABLED(CONFIG_DEBUG_ALIGN_RODATA) ? 85 - (phys_seed >> 32) & mask : TEXT_OFFSET; 83 + u32 offset = (phys_seed >> 32) & mask; 86 84 87 85 /* 88 86 * With CONFIG_RANDOMIZE_TEXT_OFFSET=y, TEXT_OFFSET may not
+4
init/Kconfig
··· 16 16 default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC 17 17 default 0 18 18 19 + config LD_VERSION 20 + int 21 + default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh) 22 + 19 23 config CC_IS_CLANG 20 24 def_bool $(success,$(CC) --version | head -n 1 | grep -q clang) 21 25