Skip to content

Commit 1454363

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: pt_regs: swap 'unused' and 'pmr' fields
In subsequent patches we'll want to add an additional u64 to struct pt_regs. To make space, this patch swaps the 'unused' and 'pmr' fields, as the 'pmr' value only requires bits[7:0] and can safely fit into a u32, which frees up a 64-bit unused field. The 'lockdep_hardirqs' and 'exit_rcu' fields should eventually be moved out of pt_regs and managed locally within entry-common.c, so I've left those as-is for the moment. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <[email protected]> Reviewed-by: Mark Brown <[email protected]> Reviewed-by: Miroslav Benes <[email protected]> Reviewed-by: Puranjay Mohan <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Kalesh Singh <[email protected]> Cc: Madhavan T. Venkataraman <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 00d9597 commit 1454363

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

arch/arm64/include/asm/ptrace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ struct pt_regs {
163163
};
164164
u64 orig_x0;
165165
s32 syscallno;
166-
u32 unused;
166+
u32 pmr;
167167

168168
u64 sdei_ttbr1;
169-
/* Only valid when ARM64_HAS_GIC_PRIO_MASKING is enabled. */
170-
u64 pmr;
169+
u64 unused;
170+
171171
u64 stackframe[2];
172172

173173
/* Only valid for some EL1 exceptions. */

arch/arm64/kernel/entry.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ alternative_if_not ARM64_HAS_GIC_PRIO_MASKING
315315
alternative_else_nop_endif
316316

317317
mrs_s x20, SYS_ICC_PMR_EL1
318-
str x20, [sp, #S_PMR]
318+
str w20, [sp, #S_PMR]
319319
mov x20, #GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET
320320
msr_s SYS_ICC_PMR_EL1, x20
321321

@@ -342,7 +342,7 @@ alternative_if_not ARM64_HAS_GIC_PRIO_MASKING
342342
b .Lskip_pmr_restore\@
343343
alternative_else_nop_endif
344344

345-
ldr x20, [sp, #S_PMR]
345+
ldr w20, [sp, #S_PMR]
346346
msr_s SYS_ICC_PMR_EL1, x20
347347

348348
/* Ensure priority change is seen by redistributor */

arch/arm64/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void __show_regs(struct pt_regs *regs)
227227
printk("sp : %016llx\n", sp);
228228

229229
if (system_uses_irq_prio_masking())
230-
printk("pmr: %08llx\n", regs->pmr);
230+
printk("pmr: %08x\n", regs->pmr);
231231

232232
i = top_reg;
233233

0 commit comments

Comments
 (0)