mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
arm64: ptrace: Replace interrupts_enabled() with regs_irqs_disabled()
The generic entry code expects architecture code to provide regs_irqs_disabled(regs) function, but arm64 does not have this and provides interrupts_enabled(regs), which has the opposite polarity. In preparation for moving arm64 over to the generic entry code, relace arm64's interrupts_enabled() with regs_irqs_disabled() and update its callers under arch/arm64. For the moment, a definition of interrupts_enabled() is provided for the GICv3 driver. Once arch/arm implement regs_irqs_disabled(), this can be removed. Delete the fast_interrupts_enabled() macro as it is unused and we don't want any new users to show up. No functional changes. Reviewed-by: Ada Couprie Diaz <ada.coupriediaz@arm.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Suggested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
8f5ae30d69
commit
788b8f6af6
|
|
@ -128,7 +128,7 @@ static inline void local_daif_inherit(struct pt_regs *regs)
|
|||
{
|
||||
unsigned long flags = regs->pstate & DAIF_MASK;
|
||||
|
||||
if (interrupts_enabled(regs))
|
||||
if (!regs_irqs_disabled(regs))
|
||||
trace_hardirqs_on();
|
||||
|
||||
if (system_uses_irq_prio_masking())
|
||||
|
|
|
|||
|
|
@ -214,11 +214,12 @@ static inline void forget_syscall(struct pt_regs *regs)
|
|||
(regs)->pmr == GIC_PRIO_IRQON : \
|
||||
true)
|
||||
|
||||
#define interrupts_enabled(regs) \
|
||||
(!((regs)->pstate & PSR_I_BIT) && irqs_priority_unmasked(regs))
|
||||
static __always_inline bool regs_irqs_disabled(const struct pt_regs *regs)
|
||||
{
|
||||
return (regs->pstate & PSR_I_BIT) || !irqs_priority_unmasked(regs);
|
||||
}
|
||||
|
||||
#define fast_interrupts_enabled(regs) \
|
||||
(!((regs)->pstate & PSR_F_BIT))
|
||||
#define interrupts_enabled(regs) (!regs_irqs_disabled(regs))
|
||||
|
||||
static inline unsigned long user_stack_pointer(struct pt_regs *regs)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ enum ipi_vector {
|
|||
|
||||
static inline int xen_irqs_disabled(struct pt_regs *regs)
|
||||
{
|
||||
return !interrupts_enabled(regs);
|
||||
return regs_irqs_disabled(regs);
|
||||
}
|
||||
|
||||
#define xchg_xen_ulong(ptr, val) xchg((ptr), (val))
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ int apei_claim_sea(struct pt_regs *regs)
|
|||
return_to_irqs_enabled = !irqs_disabled_flags(arch_local_save_flags());
|
||||
|
||||
if (regs)
|
||||
return_to_irqs_enabled = interrupts_enabled(regs);
|
||||
return_to_irqs_enabled = !regs_irqs_disabled(regs);
|
||||
|
||||
/*
|
||||
* SEA can interrupt SError, mask it and describe this as an NMI so
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ static void send_user_sigtrap(int si_code)
|
|||
if (WARN_ON(!user_mode(regs)))
|
||||
return;
|
||||
|
||||
if (interrupts_enabled(regs))
|
||||
if (!regs_irqs_disabled(regs))
|
||||
local_irq_enable();
|
||||
|
||||
arm64_force_sig_fault(SIGTRAP, si_code, instruction_pointer(regs),
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ static __always_inline void __exit_to_kernel_mode(struct pt_regs *regs)
|
|||
{
|
||||
lockdep_assert_irqs_disabled();
|
||||
|
||||
if (interrupts_enabled(regs)) {
|
||||
if (!regs_irqs_disabled(regs)) {
|
||||
if (regs->exit_rcu) {
|
||||
trace_hardirqs_on_prepare();
|
||||
lockdep_hardirqs_on_prepare();
|
||||
|
|
@ -662,7 +662,7 @@ static void noinstr el1_interrupt(struct pt_regs *regs,
|
|||
{
|
||||
write_sysreg(DAIF_PROCCTX_NOIRQ, daif);
|
||||
|
||||
if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs))
|
||||
if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && regs_irqs_disabled(regs))
|
||||
__el1_pnmi(regs, handler);
|
||||
else
|
||||
__el1_irq(regs, handler);
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ unsigned long __kprobes do_sdei_event(struct pt_regs *regs,
|
|||
* If we interrupted the kernel with interrupts masked, we always go
|
||||
* back to wherever we came from.
|
||||
*/
|
||||
if (mode == kernel_mode && !interrupts_enabled(regs))
|
||||
if (mode == kernel_mode && regs_irqs_disabled(regs))
|
||||
return SDEI_EV_HANDLED;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user