Skip to content

Commit 48055fb

Browse files
committed
Merge branch 'for-next/entry' into for-next/core
* for-next/entry: arm64: el2_setup.h: Make __init_el2_fgt labels consistent, again arm64: Update comment regarding values in __boot_cpu_mode arm64/mm: Re-organise setting up FEAT_S1PIE registers PIRE0_EL1 and PIR_EL1 arm64: enable PREEMPT_LAZY
2 parents b5b6910 + 8083499 commit 48055fb

File tree

7 files changed

+24
-29
lines changed

7 files changed

+24
-29
lines changed

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ config ARM64
4242
select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
4343
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
4444
select ARCH_HAS_NONLEAF_PMD_YOUNG if ARM64_HAFT
45+
select ARCH_HAS_PREEMPT_LAZY
4546
select ARCH_HAS_PTDUMP
4647
select ARCH_HAS_PTE_DEVMAP
4748
select ARCH_HAS_PTE_SPECIAL

arch/arm64/include/asm/el2_setup.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,21 @@
204204
orr x0, x0, #(1 << 62)
205205

206206
.Lskip_spe_fgt_\@:
207+
208+
.Lset_debug_fgt_\@:
207209
msr_s SYS_HDFGRTR_EL2, x0
208210
msr_s SYS_HDFGWTR_EL2, x0
209211

210212
mov x0, xzr
211213
mrs x1, id_aa64pfr1_el1
212214
ubfx x1, x1, #ID_AA64PFR1_EL1_SME_SHIFT, #4
213-
cbz x1, .Lskip_debug_fgt_\@
215+
cbz x1, .Lskip_sme_fgt_\@
214216

215217
/* Disable nVHE traps of TPIDR2 and SMPRI */
216218
orr x0, x0, #HFGxTR_EL2_nSMPRI_EL1_MASK
217219
orr x0, x0, #HFGxTR_EL2_nTPIDR2_EL0_MASK
218220

219-
.Lskip_debug_fgt_\@:
221+
.Lskip_sme_fgt_\@:
220222
mrs_s x1, SYS_ID_AA64MMFR3_EL1
221223
ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4
222224
cbz x1, .Lskip_pie_fgt_\@
@@ -237,12 +239,14 @@
237239
/* GCS depends on PIE so we don't check it if PIE is absent */
238240
mrs_s x1, SYS_ID_AA64PFR1_EL1
239241
ubfx x1, x1, #ID_AA64PFR1_EL1_GCS_SHIFT, #4
240-
cbz x1, .Lset_fgt_\@
242+
cbz x1, .Lskip_gce_fgt_\@
241243

242244
/* Disable traps of access to GCS registers at EL0 and EL1 */
243245
orr x0, x0, #HFGxTR_EL2_nGCS_EL1_MASK
244246
orr x0, x0, #HFGxTR_EL2_nGCS_EL0_MASK
245247

248+
.Lskip_gce_fgt_\@:
249+
246250
.Lset_fgt_\@:
247251
msr_s SYS_HFGRTR_EL2, x0
248252
msr_s SYS_HFGWTR_EL2, x0

arch/arm64/include/asm/thread_info.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ void arch_setup_new_exec(void);
5959

6060
#define TIF_SIGPENDING 0 /* signal pending */
6161
#define TIF_NEED_RESCHED 1 /* rescheduling necessary */
62-
#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
63-
#define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */
64-
#define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */
65-
#define TIF_MTE_ASYNC_FAULT 5 /* MTE Asynchronous Tag Check Fault */
66-
#define TIF_NOTIFY_SIGNAL 6 /* signal notifications exist */
62+
#define TIF_NEED_RESCHED_LAZY 2 /* Lazy rescheduling needed */
63+
#define TIF_NOTIFY_RESUME 3 /* callback before returning to user */
64+
#define TIF_FOREIGN_FPSTATE 4 /* CPU's FP state is not current's */
65+
#define TIF_UPROBE 5 /* uprobe breakpoint or singlestep */
66+
#define TIF_MTE_ASYNC_FAULT 6 /* MTE Asynchronous Tag Check Fault */
67+
#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */
6768
#define TIF_SYSCALL_TRACE 8 /* syscall trace active */
6869
#define TIF_SYSCALL_AUDIT 9 /* syscall auditing */
6970
#define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */
@@ -85,6 +86,7 @@ void arch_setup_new_exec(void);
8586

8687
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
8788
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
89+
#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
8890
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
8991
#define _TIF_FOREIGN_FPSTATE (1 << TIF_FOREIGN_FPSTATE)
9092
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
@@ -100,10 +102,10 @@ void arch_setup_new_exec(void);
100102
#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
101103
#define _TIF_TSC_SIGSEGV (1 << TIF_TSC_SIGSEGV)
102104

103-
#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
105+
#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY | \
104106
_TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
105107
_TIF_UPROBE | _TIF_MTE_ASYNC_FAULT | \
106-
_TIF_NOTIFY_SIGNAL)
108+
_TIF_NOTIFY_SIGNAL | _TIF_SIGPENDING)
107109

108110
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
109111
_TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \

arch/arm64/include/asm/virt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
* __boot_cpu_mode records what mode CPUs were booted in.
6868
* A correctly-implemented bootloader must start all CPUs in the same mode:
6969
* In this case, both 32bit halves of __boot_cpu_mode will contain the
70-
* same value (either 0 if booted in EL1, BOOT_CPU_MODE_EL2 if booted in EL2).
70+
* same value (either BOOT_CPU_MODE_EL1 if booted in EL1, BOOT_CPU_MODE_EL2 if
71+
* booted in EL2).
7172
*
7273
* Should the bootloader fail to do this, the two values will be different.
7374
* This allows the kernel to flag an error when the secondaries have come up.

arch/arm64/kernel/asm-offsets.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,7 @@ int main(void)
182182
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
183183
DEFINE(FTRACE_OPS_DIRECT_CALL, offsetof(struct ftrace_ops, direct_call));
184184
#endif
185+
DEFINE(PIE_E0_ASM, PIE_E0);
186+
DEFINE(PIE_E1_ASM, PIE_E1);
185187
return 0;
186188
}

arch/arm64/kernel/entry-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags)
132132
do {
133133
local_irq_enable();
134134

135-
if (thread_flags & _TIF_NEED_RESCHED)
135+
if (thread_flags & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY))
136136
schedule();
137137

138138
if (thread_flags & _TIF_UPROBE)

arch/arm64/mm/proc.S

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -512,26 +512,11 @@ alternative_else_nop_endif
512512
ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4
513513
cbz x1, .Lskip_indirection
514514

515-
/*
516-
* The PROT_* macros describing the various memory types may resolve to
517-
* C expressions if they include the PTE_MAYBE_* macros, and so they
518-
* can only be used from C code. The PIE_E* constants below are also
519-
* defined in terms of those macros, but will mask out those
520-
* PTE_MAYBE_* constants, whether they are set or not. So #define them
521-
* as 0x0 here so we can evaluate the PIE_E* constants in asm context.
522-
*/
523-
524-
#define PTE_MAYBE_NG 0
525-
#define PTE_MAYBE_SHARED 0
526-
527-
mov_q x0, PIE_E0
515+
mov_q x0, PIE_E0_ASM
528516
msr REG_PIRE0_EL1, x0
529-
mov_q x0, PIE_E1
517+
mov_q x0, PIE_E1_ASM
530518
msr REG_PIR_EL1, x0
531519

532-
#undef PTE_MAYBE_NG
533-
#undef PTE_MAYBE_SHARED
534-
535520
orr tcr2, tcr2, TCR2_EL1_PIE
536521
msr REG_TCR2_EL1, x0
537522

0 commit comments

Comments
 (0)