@@ -75,6 +75,24 @@ static void noinstr exit_to_kernel_mode(struct pt_regs *regs)
75
75
}
76
76
}
77
77
78
+ asmlinkage void noinstr enter_from_user_mode (void )
79
+ {
80
+ lockdep_hardirqs_off (CALLER_ADDR0 );
81
+ CT_WARN_ON (ct_state () != CONTEXT_USER );
82
+ user_exit_irqoff ();
83
+ trace_hardirqs_off_finish ();
84
+ }
85
+
86
+ asmlinkage void noinstr exit_to_user_mode (void )
87
+ {
88
+ mte_check_tfsr_exit ();
89
+
90
+ trace_hardirqs_on_prepare ();
91
+ lockdep_hardirqs_on_prepare (CALLER_ADDR0 );
92
+ user_enter_irqoff ();
93
+ lockdep_hardirqs_on (CALLER_ADDR0 );
94
+ }
95
+
78
96
static void noinstr arm64_enter_nmi (struct pt_regs * regs )
79
97
{
80
98
regs -> lockdep_hardirqs = lockdep_hardirqs_enabled ();
@@ -105,6 +123,30 @@ static void noinstr arm64_exit_nmi(struct pt_regs *regs)
105
123
__nmi_exit ();
106
124
}
107
125
126
+ static void noinstr arm64_enter_el1_dbg (struct pt_regs * regs )
127
+ {
128
+ regs -> lockdep_hardirqs = lockdep_hardirqs_enabled ();
129
+
130
+ lockdep_hardirqs_off (CALLER_ADDR0 );
131
+ rcu_nmi_enter ();
132
+
133
+ trace_hardirqs_off_finish ();
134
+ }
135
+
136
+ static void noinstr arm64_exit_el1_dbg (struct pt_regs * regs )
137
+ {
138
+ bool restore = regs -> lockdep_hardirqs ;
139
+
140
+ if (restore ) {
141
+ trace_hardirqs_on_prepare ();
142
+ lockdep_hardirqs_on_prepare (CALLER_ADDR0 );
143
+ }
144
+
145
+ rcu_nmi_exit ();
146
+ if (restore )
147
+ lockdep_hardirqs_on (CALLER_ADDR0 );
148
+ }
149
+
108
150
static void noinstr enter_el1_irq_or_nmi (struct pt_regs * regs )
109
151
{
110
152
if (IS_ENABLED (CONFIG_ARM64_PSEUDO_NMI ) && !interrupts_enabled (regs ))
@@ -265,30 +307,6 @@ static void noinstr el1_undef(struct pt_regs *regs)
265
307
exit_to_kernel_mode (regs );
266
308
}
267
309
268
- static void noinstr arm64_enter_el1_dbg (struct pt_regs * regs )
269
- {
270
- regs -> lockdep_hardirqs = lockdep_hardirqs_enabled ();
271
-
272
- lockdep_hardirqs_off (CALLER_ADDR0 );
273
- rcu_nmi_enter ();
274
-
275
- trace_hardirqs_off_finish ();
276
- }
277
-
278
- static void noinstr arm64_exit_el1_dbg (struct pt_regs * regs )
279
- {
280
- bool restore = regs -> lockdep_hardirqs ;
281
-
282
- if (restore ) {
283
- trace_hardirqs_on_prepare ();
284
- lockdep_hardirqs_on_prepare (CALLER_ADDR0 );
285
- }
286
-
287
- rcu_nmi_exit ();
288
- if (restore )
289
- lockdep_hardirqs_on (CALLER_ADDR0 );
290
- }
291
-
292
310
static void noinstr el1_dbg (struct pt_regs * regs , unsigned long esr )
293
311
{
294
312
unsigned long far = read_sysreg (far_el1 );
@@ -382,24 +400,6 @@ asmlinkage void noinstr el1h_64_error_handler(struct pt_regs *regs)
382
400
arm64_exit_nmi (regs );
383
401
}
384
402
385
- asmlinkage void noinstr enter_from_user_mode (void )
386
- {
387
- lockdep_hardirqs_off (CALLER_ADDR0 );
388
- CT_WARN_ON (ct_state () != CONTEXT_USER );
389
- user_exit_irqoff ();
390
- trace_hardirqs_off_finish ();
391
- }
392
-
393
- asmlinkage void noinstr exit_to_user_mode (void )
394
- {
395
- mte_check_tfsr_exit ();
396
-
397
- trace_hardirqs_on_prepare ();
398
- lockdep_hardirqs_on_prepare (CALLER_ADDR0 );
399
- user_enter_irqoff ();
400
- lockdep_hardirqs_on (CALLER_ADDR0 );
401
- }
402
-
403
403
static void noinstr el0_da (struct pt_regs * regs , unsigned long esr )
404
404
{
405
405
unsigned long far = read_sysreg (far_el1 );
0 commit comments