mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-06 09:29:41 +00:00
a8b0ca17b8
The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Michael Cree <mcree@orcon.net.nz> Cc: Will Deacon <will.deacon@arm.com> Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com> Cc: Anton Blanchard <anton@samba.org> Cc: Eric B Munson <emunson@mgebm.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: David S. Miller <davem@davemloft.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Don Zickus <dzickus@redhat.com> Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
93 lines
2.4 KiB
C
93 lines
2.4 KiB
C
/*
|
|
* Copyright 2007 Sony Corporation
|
|
*
|
|
* 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; version 2 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program.
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef _ASM_POWERPC_EMULATED_OPS_H
|
|
#define _ASM_POWERPC_EMULATED_OPS_H
|
|
|
|
#include <asm/atomic.h>
|
|
#include <linux/perf_event.h>
|
|
|
|
|
|
#ifdef CONFIG_PPC_EMULATED_STATS
|
|
|
|
struct ppc_emulated_entry {
|
|
const char *name;
|
|
atomic_t val;
|
|
};
|
|
|
|
extern struct ppc_emulated {
|
|
#ifdef CONFIG_ALTIVEC
|
|
struct ppc_emulated_entry altivec;
|
|
#endif
|
|
struct ppc_emulated_entry dcba;
|
|
struct ppc_emulated_entry dcbz;
|
|
struct ppc_emulated_entry fp_pair;
|
|
struct ppc_emulated_entry isel;
|
|
struct ppc_emulated_entry mcrxr;
|
|
struct ppc_emulated_entry mfpvr;
|
|
struct ppc_emulated_entry multiple;
|
|
struct ppc_emulated_entry popcntb;
|
|
struct ppc_emulated_entry spe;
|
|
struct ppc_emulated_entry string;
|
|
struct ppc_emulated_entry unaligned;
|
|
#ifdef CONFIG_MATH_EMULATION
|
|
struct ppc_emulated_entry math;
|
|
#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
|
|
struct ppc_emulated_entry 8xx;
|
|
#endif
|
|
#ifdef CONFIG_VSX
|
|
struct ppc_emulated_entry vsx;
|
|
#endif
|
|
#ifdef CONFIG_PPC64
|
|
struct ppc_emulated_entry mfdscr;
|
|
struct ppc_emulated_entry mtdscr;
|
|
#endif
|
|
} ppc_emulated;
|
|
|
|
extern u32 ppc_warn_emulated;
|
|
|
|
extern void ppc_warn_emulated_print(const char *type);
|
|
|
|
#define __PPC_WARN_EMULATED(type) \
|
|
do { \
|
|
atomic_inc(&ppc_emulated.type.val); \
|
|
if (ppc_warn_emulated) \
|
|
ppc_warn_emulated_print(ppc_emulated.type.name); \
|
|
} while (0)
|
|
|
|
#else /* !CONFIG_PPC_EMULATED_STATS */
|
|
|
|
#define __PPC_WARN_EMULATED(type) do { } while (0)
|
|
|
|
#endif /* !CONFIG_PPC_EMULATED_STATS */
|
|
|
|
#define PPC_WARN_EMULATED(type, regs) \
|
|
do { \
|
|
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, \
|
|
1, regs, 0); \
|
|
__PPC_WARN_EMULATED(type); \
|
|
} while (0)
|
|
|
|
#define PPC_WARN_ALIGNMENT(type, regs) \
|
|
do { \
|
|
perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, \
|
|
1, regs, regs->dar); \
|
|
__PPC_WARN_EMULATED(type); \
|
|
} while (0)
|
|
|
|
#endif /* _ASM_POWERPC_EMULATED_OPS_H */
|