diff options
Diffstat (limited to 'arch/powerpc/kernel/dbell.c')
| -rw-r--r-- | arch/powerpc/kernel/dbell.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c index d55c76c571f3..5712dd846263 100644 --- a/arch/powerpc/kernel/dbell.c +++ b/arch/powerpc/kernel/dbell.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Author: Kumar Gala <galak@kernel.crashing.org> * * Copyright 2009 Freescale Semiconductor Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. */ #include <linux/stddef.h> @@ -16,42 +12,36 @@ #include <linux/hardirq.h> #include <asm/dbell.h> +#include <asm/interrupt.h> #include <asm/irq_regs.h> +#include <asm/kvm_ppc.h> +#include <asm/trace.h> #ifdef CONFIG_SMP -void doorbell_setup_this_cpu(void) -{ - unsigned long tag = mfspr(SPRN_DOORBELL_CPUTAG) & PPC_DBELL_TAG_MASK; - - smp_muxed_ipi_set_data(smp_processor_id(), tag); -} - -void doorbell_cause_ipi(int cpu, unsigned long data) -{ - /* Order previous accesses vs. msgsnd, which is treated as a store */ - mb(); - ppc_msgsnd(PPC_DBELL_MSGTYPE, 0, data); -} -void doorbell_exception(struct pt_regs *regs) +DEFINE_INTERRUPT_HANDLER_ASYNC(doorbell_exception) { struct pt_regs *old_regs = set_irq_regs(regs); - irq_enter(); + trace_doorbell_entry(regs); + + ppc_msgsync(); - may_hard_irq_enable(); + if (should_hard_irq_enable(regs)) + do_hard_irq_enable(); - __get_cpu_var(irq_stat).doorbell_irqs++; + kvmppc_clear_host_ipi(smp_processor_id()); + __this_cpu_inc(irq_stat.doorbell_irqs); - smp_ipi_demux(); + smp_ipi_demux_relaxed(); /* already performed the barrier */ + + trace_doorbell_exit(regs); - irq_exit(); set_irq_regs(old_regs); } #else /* CONFIG_SMP */ -void doorbell_exception(struct pt_regs *regs) +DEFINE_INTERRUPT_HANDLER_ASYNC(doorbell_exception) { printk(KERN_WARNING "Received doorbell on non-smp system\n"); } #endif /* CONFIG_SMP */ - |
