]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arm64: pt_regs: swap 'unused' and 'pmr' fields
authorMark Rutland <mark.rutland@arm.com>
Thu, 17 Oct 2024 09:25:32 +0000 (10:25 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 17 Oct 2024 17:06:24 +0000 (18:06 +0100)
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 <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Puranjay Mohan <puranjay12@gmail.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20241017092538.1859841-5-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/ptrace.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/process.c

index e82e6e47ac9a486451a5b2ede394efaabc2b5c51..92531aeba53105b67775c022d4cffc7e6b415ecc 100644 (file)
@@ -163,11 +163,11 @@ struct pt_regs {
        };
        u64 orig_x0;
        s32 syscallno;
-       u32 unused;
+       u32 pmr;
 
        u64 sdei_ttbr1;
-       /* Only valid when ARM64_HAS_GIC_PRIO_MASKING is enabled. */
-       u64 pmr;
+       u64 unused;
+
        u64 stackframe[2];
 
        /* Only valid for some EL1 exceptions. */
index a84ce95ad96ce912899fc25f1ccd1149c329133a..fa6d6d5ca5e021a3ed8b80acfde16a1e55212fb0 100644 (file)
@@ -315,7 +315,7 @@ alternative_if_not ARM64_HAS_GIC_PRIO_MASKING
 alternative_else_nop_endif
 
        mrs_s   x20, SYS_ICC_PMR_EL1
-       str     x20, [sp, #S_PMR]
+       str     w20, [sp, #S_PMR]
        mov     x20, #GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET
        msr_s   SYS_ICC_PMR_EL1, x20
 
@@ -342,7 +342,7 @@ alternative_if_not ARM64_HAS_GIC_PRIO_MASKING
        b       .Lskip_pmr_restore\@
 alternative_else_nop_endif
 
-       ldr     x20, [sp, #S_PMR]
+       ldr     w20, [sp, #S_PMR]
        msr_s   SYS_ICC_PMR_EL1, x20
 
        /* Ensure priority change is seen by redistributor */
index 2951b5ba193784a03d59a9fdb60fb09a9a3cf154..c722c1be6fa592aeb0fe950c1bcee68e7040a86c 100644 (file)
@@ -227,7 +227,7 @@ void __show_regs(struct pt_regs *regs)
        printk("sp : %016llx\n", sp);
 
        if (system_uses_irq_prio_masking())
-               printk("pmr: %08llx\n", regs->pmr);
+               printk("pmr: %08x\n", regs->pmr);
 
        i = top_reg;