Skip to content

Commit 51595e3

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull more arm64 updates from Catalin Marinas: "A mix of fixes and clean-ups that turned up too late for the first pull request: - Restore terminal stack frame records. Their previous removal caused traces which cross secondary_start_kernel to terminate one entry too late, with a spurious "0" entry. - Fix boot warning with pseudo-NMI due to the way we manipulate the PMR register. - ACPI fixes: avoid corruption of interrupt mappings on watchdog probe failure (GTDT), prevent unregistering of GIC SGIs. - Force SPARSEMEM_VMEMMAP as the only memory model, it saves with having to test all the other combinations. - Documentation fixes and updates: tagged address ABI exceptions on brk/mmap/mremap(), event stream frequency, update booting requirements on the configuration of traps" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: kernel: Update the stale comment arm64: Fix the documented event stream frequency arm64: entry: always set GIC_PRIO_PSR_I_SET during entry arm64: Explicitly document boot requirements for SVE arm64: Explicitly require that FPSIMD instructions do not trap arm64: Relax booting requirements for configuration of traps arm64: cpufeatures: use min and max arm64: stacktrace: restore terminal records arm64/vdso: Discard .note.gnu.property sections in vDSO arm64: doc: Add brk/mmap/mremap() to the Tagged Address ABI Exceptions psci: Remove unneeded semicolon ACPI: irq: Prevent unregistering of GIC SGIs ACPI: GTDT: Don't corrupt interrupt mappings on watchdow probe failure arm64: Show three registers per line arm64: remove HAVE_DEBUG_BUGVERBOSE arm64: alternative: simplify passing alt_region arm64: Force SPARSEMEM_VMEMMAP as the only memory management model arm64: vdso32: drop -no-integrated-as flag
2 parents 2059c40 + c76fba3 commit 51595e3

File tree

23 files changed

+87
-92
lines changed

23 files changed

+87
-92
lines changed

Documentation/arm64/booting.rst

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,40 @@ Before jumping into the kernel, the following conditions must be met:
277277

278278
- SCR_EL3.FGTEn (bit 27) must be initialised to 0b1.
279279

280+
For CPUs with Advanced SIMD and floating point support:
281+
282+
- If EL3 is present:
283+
284+
- CPTR_EL3.TFP (bit 10) must be initialised to 0b0.
285+
286+
- If EL2 is present and the kernel is entered at EL1:
287+
288+
- CPTR_EL2.TFP (bit 10) must be initialised to 0b0.
289+
290+
For CPUs with the Scalable Vector Extension (FEAT_SVE) present:
291+
292+
- if EL3 is present:
293+
294+
- CPTR_EL3.EZ (bit 8) must be initialised to 0b1.
295+
296+
- ZCR_EL3.LEN must be initialised to the same value for all CPUs the
297+
kernel is executed on.
298+
299+
- If the kernel is entered at EL1 and EL2 is present:
300+
301+
- CPTR_EL2.TZ (bit 8) must be initialised to 0b0.
302+
303+
- CPTR_EL2.ZEN (bits 17:16) must be initialised to 0b11.
304+
305+
- ZCR_EL2.LEN must be initialised to the same value for all CPUs the
306+
kernel will execute on.
307+
280308
The requirements described above for CPU mode, caches, MMUs, architected
281309
timers, coherency and system registers apply to all CPUs. All CPUs must
282-
enter the kernel in the same exception level.
310+
enter the kernel in the same exception level. Where the values documented
311+
disable traps it is permissible for these traps to be enabled so long as
312+
those traps are handled transparently by higher exception levels as though
313+
the values documented were set.
283314

284315
The boot loader is expected to enter the kernel on each CPU in the
285316
following manner:

Documentation/arm64/elf_hwcaps.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ HWCAP_ASIMD
7474

7575
HWCAP_EVTSTRM
7676
The generic timer is configured to generate events at a frequency of
77-
approximately 100KHz.
77+
approximately 10KHz.
7878

7979
HWCAP_AES
8080
Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0001.

Documentation/arm64/tagged-address-abi.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ ABI relaxation:
113113

114114
- ``shmat()`` and ``shmdt()``.
115115

116+
- ``brk()`` (since kernel v5.6).
117+
118+
- ``mmap()`` (since kernel v5.6).
119+
120+
- ``mremap()``, the ``new_address`` argument (since kernel v5.6).
121+
116122
Any attempt to use non-zero tagged pointers may result in an error code
117123
being returned, a (fatal) signal being raised, or other modes of
118124
failure.

arch/arm64/Kconfig

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ config ARM64
170170
select HAVE_CMPXCHG_DOUBLE
171171
select HAVE_CMPXCHG_LOCAL
172172
select HAVE_CONTEXT_TRACKING
173-
select HAVE_DEBUG_BUGVERBOSE
174173
select HAVE_DEBUG_KMEMLEAK
175174
select HAVE_DMA_CONTIGUOUS
176175
select HAVE_DYNAMIC_FTRACE
@@ -1061,15 +1060,7 @@ source "kernel/Kconfig.hz"
10611060
config ARCH_SPARSEMEM_ENABLE
10621061
def_bool y
10631062
select SPARSEMEM_VMEMMAP_ENABLE
1064-
1065-
config ARCH_SPARSEMEM_DEFAULT
1066-
def_bool ARCH_SPARSEMEM_ENABLE
1067-
1068-
config ARCH_SELECT_MEMORY_MODEL
1069-
def_bool ARCH_SPARSEMEM_ENABLE
1070-
1071-
config ARCH_FLATMEM_ENABLE
1072-
def_bool !NUMA
1063+
select SPARSEMEM_VMEMMAP
10731064

10741065
config HW_PERF_EVENTS
10751066
def_bool y

arch/arm64/include/asm/daifflags.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ static inline void local_daif_inherit(struct pt_regs *regs)
131131
if (interrupts_enabled(regs))
132132
trace_hardirqs_on();
133133

134+
if (system_uses_irq_prio_masking())
135+
gic_write_pmr(regs->pmr_save);
136+
134137
/*
135138
* We can't use local_daif_restore(regs->pstate) here as
136139
* system_has_prio_mask_debugging() won't restore the I bit if it can

arch/arm64/include/asm/kernel-pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
* has a direct correspondence, and needs to appear sufficiently aligned
137137
* in the virtual address space.
138138
*/
139-
#if defined(CONFIG_SPARSEMEM_VMEMMAP) && ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS
139+
#if ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS
140140
#define ARM64_MEMSTART_ALIGN (1UL << SECTION_SIZE_BITS)
141141
#else
142142
#define ARM64_MEMSTART_ALIGN (1UL << ARM64_MEMSTART_SHIFT)

arch/arm64/include/asm/memory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static inline void *phys_to_virt(phys_addr_t x)
345345
*/
346346
#define ARCH_PFN_OFFSET ((unsigned long)PHYS_PFN_OFFSET)
347347

348-
#if !defined(CONFIG_SPARSEMEM_VMEMMAP) || defined(CONFIG_DEBUG_VIRTUAL)
348+
#if defined(CONFIG_DEBUG_VIRTUAL)
349349
#define page_to_virt(x) ({ \
350350
__typeof__(x) __page = x; \
351351
void *__addr = __va(page_to_phys(__page)); \
@@ -365,7 +365,7 @@ static inline void *phys_to_virt(phys_addr_t x)
365365
u64 __addr = VMEMMAP_START + (__idx * sizeof(struct page)); \
366366
(struct page *)__addr; \
367367
})
368-
#endif /* !CONFIG_SPARSEMEM_VMEMMAP || CONFIG_DEBUG_VIRTUAL */
368+
#endif /* CONFIG_DEBUG_VIRTUAL */
369369

370370
#define virt_addr_valid(addr) ({ \
371371
__typeof__(addr) __addr = __tag_reset(addr); \

arch/arm64/include/asm/sparsemem.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#ifndef __ASM_SPARSEMEM_H
66
#define __ASM_SPARSEMEM_H
77

8-
#ifdef CONFIG_SPARSEMEM
98
#define MAX_PHYSMEM_BITS CONFIG_ARM64_PA_BITS
109

1110
/*
@@ -27,6 +26,4 @@
2726
#define SECTION_SIZE_BITS 27
2827
#endif /* CONFIG_ARM64_64K_PAGES */
2928

30-
#endif /* CONFIG_SPARSEMEM*/
31-
3229
#endif

arch/arm64/kernel/alternative.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,10 @@ static void clean_dcache_range_nopatch(u64 start, u64 end)
133133
} while (cur += d_size, cur < end);
134134
}
135135

136-
static void __nocfi __apply_alternatives(void *alt_region, bool is_module,
137-
unsigned long *feature_mask)
136+
static void __nocfi __apply_alternatives(struct alt_region *region, bool is_module,
137+
unsigned long *feature_mask)
138138
{
139139
struct alt_instr *alt;
140-
struct alt_region *region = alt_region;
141140
__le32 *origptr, *updptr;
142141
alternative_cb_t alt_cb;
143142

arch/arm64/kernel/cpufeature.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include <linux/sort.h>
6969
#include <linux/stop_machine.h>
7070
#include <linux/types.h>
71+
#include <linux/minmax.h>
7172
#include <linux/mm.h>
7273
#include <linux/cpu.h>
7374
#include <linux/kasan.h>
@@ -694,14 +695,14 @@ static s64 arm64_ftr_safe_value(const struct arm64_ftr_bits *ftrp, s64 new,
694695
ret = ftrp->safe_val;
695696
break;
696697
case FTR_LOWER_SAFE:
697-
ret = new < cur ? new : cur;
698+
ret = min(new, cur);
698699
break;
699700
case FTR_HIGHER_OR_ZERO_SAFE:
700701
if (!cur || !new)
701702
break;
702703
fallthrough;
703704
case FTR_HIGHER_SAFE:
704-
ret = new > cur ? new : cur;
705+
ret = max(new, cur);
705706
break;
706707
default:
707708
BUG();

0 commit comments

Comments
 (0)