/
usr
/
src
/
linux-headers-5.15.0-190
/
arch
/
powerpc
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-190/arch/powerpc/include/asm
mkdir
upload
Name
Size
Mode
Actions
book3s/
-
0755
rm
nohash/
-
0755
rm
vdso/
-
0755
rm
8xx_immap.h
14099
0644
edit
dl
rm
accounting.h
908
0644
edit
dl
rm
agp.h
525
0644
edit
dl
rm
archrandom.h
838
0644
edit
dl
rm
asm-compat.h
1882
0644
edit
dl
rm
asm-const.h
468
0644
edit
dl
rm
asm-offsets.h
35
0644
edit
dl
rm
asm-prototypes.h
5130
0644
edit
dl
rm
async_tx.h
908
0644
edit
dl
rm
atomic.h
14267
0644
edit
dl
rm
backlight.h
1115
0644
edit
dl
rm
barrier.h
3977
0644
edit
dl
rm
bitops.h
7913
0644
edit
dl
rm
bootx.h
1142
0644
edit
dl
rm
bpf_perf_event.h
233
0644
edit
dl
rm
btext.h
1006
0644
edit
dl
rm
bug.h
4090
0644
edit
dl
rm
cache.h
2888
0644
edit
dl
rm
cacheflush.h
3851
0644
edit
dl
rm
cell-pmu.h
3496
0644
edit
dl
rm
cell-regs.h
9799
0644
edit
dl
rm
checksum.h
5723
0644
edit
dl
rm
clocksource.h
185
0644
edit
dl
rm
cmpxchg.h
12280
0644
edit
dl
rm
code-patching-asm.h
397
0644
edit
dl
rm
code-patching.h
5443
0644
edit
dl
rm
compat.h
3304
0644
edit
dl
rm
context_tracking.h
245
0644
edit
dl
rm
copro.h
593
0644
edit
dl
rm
cpm.h
25
0644
edit
dl
rm
cpm1.h
21711
0644
edit
dl
rm
cpm2.h
49598
0644
edit
dl
rm
cpufeature.h
998
0644
edit
dl
rm
cpuidle.h
3407
0644
edit
dl
rm
cputable.h
23211
0644
edit
dl
rm
cputhreads.h
3856
0644
edit
dl
rm
cputime.h
3069
0644
edit
dl
rm
cpu_has_feature.h
1339
0644
edit
dl
rm
cpu_setup_power.h
507
0644
edit
dl
rm
crashdump-ppc64.h
624
0644
edit
dl
rm
current.h
680
0644
edit
dl
rm
dbdma.h
3809
0644
edit
dl
rm
dbell.h
4025
0644
edit
dl
rm
dcr-generic.h
930
0644
edit
dl
rm
dcr-mmio.h
1026
0644
edit
dl
rm
dcr-native.h
3859
0644
edit
dl
rm
dcr-regs.h
5846
0644
edit
dl
rm
dcr.h
2108
0644
edit
dl
rm
debug.h
1886
0644
edit
dl
rm
delay.h
3297
0644
edit
dl
rm
device.h
1016
0644
edit
dl
rm
disassemble.h
2189
0644
edit
dl
rm
dma-direct.h
391
0644
edit
dl
rm
dma.h
10725
0644
edit
dl
rm
drmem.h
2970
0644
edit
dl
rm
dtl.h
1515
0644
edit
dl
rm
dt_cpu_ftrs.h
756
0644
edit
dl
rm
edac.h
1105
0644
edit
dl
rm
eeh.h
15478
0644
edit
dl
rm
eeh_event.h
826
0644
edit
dl
rm
ehv_pic.h
963
0644
edit
dl
rm
elf.h
6283
0644
edit
dl
rm
elfnote.h
527
0644
edit
dl
rm
emergency-restart.h
43
0644
edit
dl
rm
emulated_ops.h
2072
0644
edit
dl
rm
epapr_hcalls.h
16827
0644
edit
dl
rm
exception-64e.h
5785
0644
edit
dl
rm
exception-64s.h
4350
0644
edit
dl
rm
exec.h
246
0644
edit
dl
rm
extable.h
1205
0644
edit
dl
rm
fadump-internal.h
4352
0644
edit
dl
rm
fadump.h
1095
0644
edit
dl
rm
fb.h
483
0644
edit
dl
rm
feature-fixups.h
9828
0644
edit
dl
rm
firmware.h
5327
0644
edit
dl
rm
fixmap.h
3723
0644
edit
dl
rm
floppy.h
5111
0644
edit
dl
rm
fsl_85xx_cache_sram.h
812
0644
edit
dl
rm
fsl_gtm.h
1203
0644
edit
dl
rm
fsl_hcalls.h
17615
0644
edit
dl
rm
fsl_lbc.h
10489
0644
edit
dl
rm
fsl_pamu_stash.h
411
0644
edit
dl
rm
fsl_pm.h
1183
0644
edit
dl
rm
fs_pd.h
1046
0644
edit
dl
rm
ftrace.h
3550
0644
edit
dl
rm
futex.h
2246
0644
edit
dl
rm
grackle.h
331
0644
edit
dl
rm
hardirq.h
948
0644
edit
dl
rm
head-64.h
5507
0644
edit
dl
rm
heathrow.h
2595
0644
edit
dl
rm
highmem.h
2079
0644
edit
dl
rm
hmi.h
971
0644
edit
dl
rm
hugetlb.h
2186
0644
edit
dl
rm
hvcall.h
21250
0644
edit
dl
rm
hvconsole.h
790
0644
edit
dl
rm
hvcserver.h
1473
0644
edit
dl
rm
hvsi.h
2850
0644
edit
dl
rm
hw_breakpoint.h
3735
0644
edit
dl
rm
hw_irq.h
11218
0644
edit
dl
rm
hydra.h
2948
0644
edit
dl
rm
i8259.h
361
0644
edit
dl
rm
ibmebus.h
2204
0644
edit
dl
rm
icswx.h
5090
0644
edit
dl
rm
ide.h
586
0644
edit
dl
rm
idle.h
2372
0644
edit
dl
rm
imc-pmu.h
3983
0644
edit
dl
rm
immap_cpm2.h
10749
0644
edit
dl
rm
inst.h
3683
0644
edit
dl
rm
interrupt.h
18353
0644
edit
dl
rm
io-defs.h
3164
0644
edit
dl
rm
io-workarounds.h
1313
0644
edit
dl
rm
io.h
31387
0644
edit
dl
rm
iommu.h
10283
0644
edit
dl
rm
io_event_irq.h
1746
0644
edit
dl
rm
ipic.h
3141
0644
edit
dl
rm
irq.h
1320
0644
edit
dl
rm
irqflags.h
1777
0644
edit
dl
rm
irq_work.h
213
0644
edit
dl
rm
isa-bridge.h
654
0644
edit
dl
rm
jump_label.h
1351
0644
edit
dl
rm
kasan.h
1396
0644
edit
dl
rm
Kbuild
286
0644
edit
dl
rm
kdebug.h
291
0644
edit
dl
rm
kdump.h
1399
0644
edit
dl
rm
kexec.h
4838
0644
edit
dl
rm
kexec_ranges.h
943
0644
edit
dl
rm
keylargo.h
11061
0644
edit
dl
rm
kfence.h
650
0644
edit
dl
rm
kgdb.h
2156
0644
edit
dl
rm
kprobes.h
2815
0644
edit
dl
rm
kup.h
3259
0644
edit
dl
rm
kvm_asm.h
4952
0644
edit
dl
rm
kvm_book3s.h
17220
0644
edit
dl
rm
kvm_book3s_32.h
816
0644
edit
dl
rm
kvm_book3s_64.h
18333
0644
edit
dl
rm
kvm_book3s_asm.h
3777
0644
edit
dl
rm
kvm_book3s_uvmem.h
2738
0644
edit
dl
rm
kvm_booke.h
2233
0644
edit
dl
rm
kvm_booke_hv_asm.h
1960
0644
edit
dl
rm
kvm_fpu.h
2199
0644
edit
dl
rm
kvm_guest.h
566
0644
edit
dl
rm
kvm_host.h
21966
0644
edit
dl
rm
kvm_para.h
752
0644
edit
dl
rm
kvm_ppc.h
36699
0644
edit
dl
rm
libata-portmap.h
249
0644
edit
dl
rm
linkage.h
501
0644
edit
dl
rm
livepatch.h
1140
0644
edit
dl
rm
local.h
3258
0644
edit
dl
rm
lppaca.h
5015
0644
edit
dl
rm
lv1call.h
18555
0644
edit
dl
rm
machdep.h
9630
0644
edit
dl
rm
macio.h
3985
0644
edit
dl
rm
mc146818rtc.h
736
0644
edit
dl
rm
mce.h
6396
0644
edit
dl
rm
mediabay.h
1375
0644
edit
dl
rm
membarrier.h
877
0644
edit
dl
rm
mem_encrypt.h
532
0644
edit
dl
rm
mman.h
1471
0644
edit
dl
rm
mmiowb.h
374
0644
edit
dl
rm
mmu.h
11244
0644
edit
dl
rm
mmu_context.h
9646
0644
edit
dl
rm
mmzone.h
1003
0644
edit
dl
rm
module.h
2284
0644
edit
dl
rm
module.lds.h
95
0644
edit
dl
rm
mpc5xxx.h
439
0644
edit
dl
rm
mpc6xx.h
143
0644
edit
dl
rm
mpc52xx.h
11100
0644
edit
dl
rm
mpc52xx_psc.h
10125
0644
edit
dl
rm
mpc85xx.h
2382
0644
edit
dl
rm
mpc5121.h
3863
0644
edit
dl
rm
mpc8260.h
742
0644
edit
dl
rm
mpic.h
14309
0644
edit
dl
rm
mpic_msgr.h
3441
0644
edit
dl
rm
mpic_timer.h
1183
0644
edit
dl
rm
msi_bitmap.h
867
0644
edit
dl
rm
nmi.h
579
0644
edit
dl
rm
nvram.h
2834
0644
edit
dl
rm
ohare.h
1684
0644
edit
dl
rm
opal-api.h
31680
0644
edit
dl
rm
opal.h
17843
0644
edit
dl
rm
paca.h
8783
0644
edit
dl
rm
page.h
10362
0644
edit
dl
rm
page_32.h
1626
0644
edit
dl
rm
page_64.h
2716
0644
edit
dl
rm
paravirt.h
3881
0644
edit
dl
rm
parport.h
956
0644
edit
dl
rm
pasemi_dma.h
23273
0644
edit
dl
rm
pci-bridge.h
9481
0644
edit
dl
rm
pci.h
3605
0644
edit
dl
rm
percpu.h
815
0644
edit
dl
rm
perf_event.h
1509
0644
edit
dl
rm
perf_event_fsl_emb.h
1252
0644
edit
dl
rm
perf_event_server.h
7104
0644
edit
dl
rm
pgalloc.h
2067
0644
edit
dl
rm
pgtable-be-types.h
2601
0644
edit
dl
rm
pgtable-types.h
1895
0644
edit
dl
rm
pgtable.h
4047
0644
edit
dl
rm
pkeys.h
4279
0644
edit
dl
rm
plpar_wrappers.h
10193
0644
edit
dl
rm
pmac_feature.h
13396
0644
edit
dl
rm
pmac_low_i2c.h
3100
0644
edit
dl
rm
pmac_pfunc.h
8237
0644
edit
dl
rm
pmc.h
1116
0644
edit
dl
rm
pmi.h
1177
0644
edit
dl
rm
pnv-ocxl.h
3069
0644
edit
dl
rm
pnv-pci.h
2432
0644
edit
dl
rm
powernv.h
454
0644
edit
dl
rm
ppc-opcode.h
31419
0644
edit
dl
rm
ppc-pci.h
2282
0644
edit
dl
rm
ppc4xx.h
328
0644
edit
dl
rm
ppc_asm.h
20530
0644
edit
dl
rm
probes.h
1542
0644
edit
dl
rm
processor.h
11898
0644
edit
dl
rm
prom.h
7324
0644
edit
dl
rm
ps3.h
15219
0644
edit
dl
rm
ps3av.h
23422
0644
edit
dl
rm
ps3gpu.h
1928
0644
edit
dl
rm
ps3stor.h
1408
0644
edit
dl
rm
pte-walk.h
2281
0644
edit
dl
rm
ptrace.h
10508
0644
edit
dl
rm
qspinlock.h
2064
0644
edit
dl
rm
qspinlock_paravirt.h
221
0644
edit
dl
rm
reg.h
64465
0644
edit
dl
rm
reg_8xx.h
2867
0644
edit
dl
rm
reg_a2.h
6128
0644
edit
dl
rm
reg_booke.h
33882
0644
edit
dl
rm
reg_fsl_emb.h
3961
0644
edit
dl
rm
rheap.h
2578
0644
edit
dl
rm
rio.h
424
0644
edit
dl
rm
rtas-types.h
2939
0644
edit
dl
rm
rtas.h
12574
0644
edit
dl
rm
runlatch.h
1184
0644
edit
dl
rm
seccomp.h
1043
0644
edit
dl
rm
sections.h
1982
0644
edit
dl
rm
secure_boot.h
476
0644
edit
dl
rm
security_features.h
3509
0644
edit
dl
rm
secvar.h
765
0644
edit
dl
rm
serial.h
473
0644
edit
dl
rm
setjmp.h
400
0644
edit
dl
rm
setup.h
2475
0644
edit
dl
rm
set_memory.h
1160
0644
edit
dl
rm
sfp-machine.h
12676
0644
edit
dl
rm
shmparam.h
206
0644
edit
dl
rm
signal.h
320
0644
edit
dl
rm
simple_spinlock.h
6662
0644
edit
dl
rm
simple_spinlock_types.h
481
0644
edit
dl
rm
slice.h
1121
0644
edit
dl
rm
smp.h
7804
0644
edit
dl
rm
smu.h
19789
0644
edit
dl
rm
sparsemem.h
843
0644
edit
dl
rm
spinlock.h
472
0644
edit
dl
rm
spinlock_types.h
382
0644
edit
dl
rm
spu.h
23963
0644
edit
dl
rm
spu_csa.h
6166
0644
edit
dl
rm
spu_info.h
272
0644
edit
dl
rm
spu_priv1.h
5186
0644
edit
dl
rm
sstep.h
4730
0644
edit
dl
rm
stackprotector.h
788
0644
edit
dl
rm
stacktrace.h
297
0644
edit
dl
rm
string.h
2522
0644
edit
dl
rm
svm.h
652
0644
edit
dl
rm
swab.h
173
0644
edit
dl
rm
swiotlb.h
374
0644
edit
dl
rm
switch_to.h
2966
0644
edit
dl
rm
synch.h
2067
0644
edit
dl
rm
syscall.h
3057
0644
edit
dl
rm
syscalls.h
2189
0644
edit
dl
rm
task_size_32.h
544
0644
edit
dl
rm
task_size_64.h
2390
0644
edit
dl
rm
tce.h
892
0644
edit
dl
rm
termios.h
653
0644
edit
dl
rm
thread_info.h
6166
0644
edit
dl
rm
time.h
2997
0644
edit
dl
rm
timex.h
463
0644
edit
dl
rm
tlb.h
2308
0644
edit
dl
rm
tlbflush.h
271
0644
edit
dl
rm
tm.h
624
0644
edit
dl
rm
topology.h
3536
0644
edit
dl
rm
trace.h
4695
0644
edit
dl
rm
trace_clock.h
372
0644
edit
dl
rm
tsi108.h
3264
0644
edit
dl
rm
tsi108_irq.h
3916
0644
edit
dl
rm
tsi108_pci.h
1191
0644
edit
dl
rm
types.h
822
0644
edit
dl
rm
uaccess.h
14288
0644
edit
dl
rm
udbg.h
2003
0644
edit
dl
rm
uic.h
403
0644
edit
dl
rm
ultravisor-api.h
941
0644
edit
dl
rm
ultravisor.h
2101
0644
edit
dl
rm
uninorth.h
8410
0644
edit
dl
rm
unistd.h
1445
0644
edit
dl
rm
uprobes.h
801
0644
edit
dl
rm
user.h
2192
0644
edit
dl
rm
vas.h
7580
0644
edit
dl
rm
vdso.h
1096
0644
edit
dl
rm
vdso_datapage.h
3570
0644
edit
dl
rm
vermagic.h
490
0644
edit
dl
rm
vga.h
1273
0644
edit
dl
rm
vio.h
4734
0644
edit
dl
rm
vmalloc.h
554
0644
edit
dl
rm
word-at-a-time.h
4878
0644
edit
dl
rm
xics.h
4539
0644
edit
dl
rm
xive-regs.h
5083
0644
edit
dl
rm
xive.h
5191
0644
edit
dl
rm
xmon.h
733
0644
edit
dl
rm
xor.h
1017
0644
edit
dl
rm
xor_altivec.h
683
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-190/arch/powerpc/include/asm/interrupt.h
(18353B)
/* SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _ASM_POWERPC_INTERRUPT_H #define _ASM_POWERPC_INTERRUPT_H /* BookE/4xx */ #define INTERRUPT_CRITICAL_INPUT 0x100 /* BookE */ #define INTERRUPT_DEBUG 0xd00 #ifdef CONFIG_BOOKE #define INTERRUPT_PERFMON 0x260 #define INTERRUPT_DOORBELL 0x280 #endif /* BookS/4xx/8xx */ #define INTERRUPT_MACHINE_CHECK 0x200 /* BookS/8xx */ #define INTERRUPT_SYSTEM_RESET 0x100 /* BookS */ #define INTERRUPT_DATA_SEGMENT 0x380 #define INTERRUPT_INST_SEGMENT 0x480 #define INTERRUPT_TRACE 0xd00 #define INTERRUPT_H_DATA_STORAGE 0xe00 #define INTERRUPT_HMI 0xe60 #define INTERRUPT_H_FAC_UNAVAIL 0xf80 #ifdef CONFIG_PPC_BOOK3S #define INTERRUPT_DOORBELL 0xa00 #define INTERRUPT_PERFMON 0xf00 #define INTERRUPT_ALTIVEC_UNAVAIL 0xf20 #endif /* BookE/BookS/4xx/8xx */ #define INTERRUPT_DATA_STORAGE 0x300 #define INTERRUPT_INST_STORAGE 0x400 #define INTERRUPT_EXTERNAL 0x500 #define INTERRUPT_ALIGNMENT 0x600 #define INTERRUPT_PROGRAM 0x700 #define INTERRUPT_SYSCALL 0xc00 #define INTERRUPT_TRACE 0xd00 /* BookE/BookS/44x */ #define INTERRUPT_FP_UNAVAIL 0x800 /* BookE/BookS/44x/8xx */ #define INTERRUPT_DECREMENTER 0x900 #ifndef INTERRUPT_PERFMON #define INTERRUPT_PERFMON 0x0 #endif /* 8xx */ #define INTERRUPT_SOFT_EMU_8xx 0x1000 #define INTERRUPT_INST_TLB_MISS_8xx 0x1100 #define INTERRUPT_DATA_TLB_MISS_8xx 0x1200 #define INTERRUPT_INST_TLB_ERROR_8xx 0x1300 #define INTERRUPT_DATA_TLB_ERROR_8xx 0x1400 #define INTERRUPT_DATA_BREAKPOINT_8xx 0x1c00 #define INTERRUPT_INST_BREAKPOINT_8xx 0x1d00 /* 603 */ #define INTERRUPT_INST_TLB_MISS_603 0x1000 #define INTERRUPT_DATA_LOAD_TLB_MISS_603 0x1100 #define INTERRUPT_DATA_STORE_TLB_MISS_603 0x1200 #ifndef __ASSEMBLY__ #include <linux/context_tracking.h> #include <linux/hardirq.h> #include <asm/cputime.h> #include <asm/ftrace.h> #include <asm/kprobes.h> #include <asm/runlatch.h> #ifdef CONFIG_PPC_BOOK3S_64 extern char __end_soft_masked[]; bool search_kernel_soft_mask_table(unsigned long addr); unsigned long search_kernel_restart_table(unsigned long addr); DECLARE_STATIC_KEY_FALSE(interrupt_exit_not_reentrant); static inline bool is_implicit_soft_masked(struct pt_regs *regs) { if (regs->msr & MSR_PR) return false; if (regs->nip >= (unsigned long)__end_soft_masked) return false; return search_kernel_soft_mask_table(regs->nip); } static inline void srr_regs_clobbered(void) { local_paca->srr_valid = 0; local_paca->hsrr_valid = 0; } #else static inline bool is_implicit_soft_masked(struct pt_regs *regs) { return false; } static inline void srr_regs_clobbered(void) { } #endif static inline void nap_adjust_return(struct pt_regs *regs) { #ifdef CONFIG_PPC_970_NAP if (unlikely(test_thread_local_flags(_TLF_NAPPING))) { /* Can avoid a test-and-clear because NMIs do not call this */ clear_thread_local_flags(_TLF_NAPPING); regs_set_return_ip(regs, (unsigned long)power4_idle_nap_return); } #endif } struct interrupt_state { }; static inline void booke_restore_dbcr0(void) { #ifdef CONFIG_PPC_ADV_DEBUG_REGS unsigned long dbcr0 = current->thread.debug.dbcr0; if (IS_ENABLED(CONFIG_PPC32) && unlikely(dbcr0 & DBCR0_IDM)) { mtspr(SPRN_DBSR, -1); mtspr(SPRN_DBCR0, global_dbcr0[smp_processor_id()]); } #endif } static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrupt_state *state) { #ifdef CONFIG_PPC32 if (!arch_irq_disabled_regs(regs)) trace_hardirqs_off(); if (user_mode(regs)) account_cpu_user_entry(); else kuap_save_and_lock(regs); #endif #ifdef CONFIG_PPC64 if (irq_soft_mask_set_return(IRQS_ALL_DISABLED) == IRQS_ENABLED) trace_hardirqs_off(); local_paca->irq_happened |= PACA_IRQ_HARD_DIS; if (user_mode(regs)) { CT_WARN_ON(ct_state() != CONTEXT_USER); user_exit_irqoff(); account_cpu_user_entry(); account_stolen_time(); } else { /* * CT_WARN_ON comes here via program_check_exception, * so avoid recursion. */ if (TRAP(regs) != INTERRUPT_PROGRAM) { CT_WARN_ON(ct_state() != CONTEXT_KERNEL); BUG_ON(is_implicit_soft_masked(regs)); } #ifdef CONFIG_PPC_BOOK3S /* Move this under a debugging check */ if (arch_irq_disabled_regs(regs)) BUG_ON(search_kernel_restart_table(regs->nip)); #endif } if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) BUG_ON(!arch_irq_disabled_regs(regs) && !(regs->msr & MSR_EE)); #endif booke_restore_dbcr0(); } /* * Care should be taken to note that interrupt_exit_prepare and * interrupt_async_exit_prepare do not necessarily return immediately to * regs context (e.g., if regs is usermode, we don't necessarily return to * user mode). Other interrupts might be taken between here and return, * context switch / preemption may occur in the exit path after this, or a * signal may be delivered, etc. * * The real interrupt exit code is platform specific, e.g., * interrupt_exit_user_prepare / interrupt_exit_kernel_prepare for 64s. * * However interrupt_nmi_exit_prepare does return directly to regs, because * NMIs do not do "exit work" or replay soft-masked interrupts. */ static inline void interrupt_exit_prepare(struct pt_regs *regs, struct interrupt_state *state) { } static inline void interrupt_async_enter_prepare(struct pt_regs *regs, struct interrupt_state *state) { #ifdef CONFIG_PPC_BOOK3S_64 if (cpu_has_feature(CPU_FTR_CTRL) && !test_thread_local_flags(_TLF_RUNLATCH)) __ppc64_runlatch_on(); #endif interrupt_enter_prepare(regs, state); irq_enter(); } static inline void interrupt_async_exit_prepare(struct pt_regs *regs, struct interrupt_state *state) { /* * Adjust at exit so the main handler sees the true NIA. This must * come before irq_exit() because irq_exit can enable interrupts, and * if another interrupt is taken before nap_adjust_return has run * here, then that interrupt would return directly to idle nap return. */ nap_adjust_return(regs); irq_exit(); interrupt_exit_prepare(regs, state); } struct interrupt_nmi_state { #ifdef CONFIG_PPC64 u8 irq_soft_mask; u8 irq_happened; u8 ftrace_enabled; u64 softe; #endif }; static inline bool nmi_disables_ftrace(struct pt_regs *regs) { /* Allow DEC and PMI to be traced when they are soft-NMI */ if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) { if (TRAP(regs) == INTERRUPT_DECREMENTER) return false; if (TRAP(regs) == INTERRUPT_PERFMON) return false; } if (IS_ENABLED(CONFIG_PPC_BOOK3E)) { if (TRAP(regs) == INTERRUPT_PERFMON) return false; } return true; } static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct interrupt_nmi_state *state) { #ifdef CONFIG_PPC64 state->irq_soft_mask = local_paca->irq_soft_mask; state->irq_happened = local_paca->irq_happened; state->softe = regs->softe; /* * Set IRQS_ALL_DISABLED unconditionally so irqs_disabled() does * the right thing, and set IRQ_HARD_DIS. We do not want to reconcile * because that goes through irq tracing which we don't want in NMI. */ local_paca->irq_soft_mask = IRQS_ALL_DISABLED; local_paca->irq_happened |= PACA_IRQ_HARD_DIS; if (!(regs->msr & MSR_EE) || is_implicit_soft_masked(regs)) { /* * Adjust regs->softe to be soft-masked if it had not been * reconcied (e.g., interrupt entry with MSR[EE]=0 but softe * not yet set disabled), or if it was in an implicit soft * masked state. This makes arch_irq_disabled_regs(regs) * behave as expected. */ regs->softe = IRQS_ALL_DISABLED; } /* Don't do any per-CPU operations until interrupt state is fixed */ if (nmi_disables_ftrace(regs)) { state->ftrace_enabled = this_cpu_get_ftrace_enabled(); this_cpu_set_ftrace_enabled(0); } #endif /* * Do not use nmi_enter() for pseries hash guest taking a real-mode * NMI because not everything it touches is within the RMA limit. * * Likewise, do not use it in real mode if percpu first chunk is not * embedded. With CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK enabled there * are chances where percpu allocation can come from vmalloc area. */ if ((!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !firmware_has_feature(FW_FEATURE_LPAR) || radix_enabled() || (mfmsr() & MSR_DR)) && !percpu_first_chunk_is_paged) nmi_enter(); } static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct interrupt_nmi_state *state) { if ((!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !firmware_has_feature(FW_FEATURE_LPAR) || radix_enabled() || (mfmsr() & MSR_DR)) && !percpu_first_chunk_is_paged) nmi_exit(); /* * nmi does not call nap_adjust_return because nmi should not create * new work to do (must use irq_work for that). */ #ifdef CONFIG_PPC64 #ifdef CONFIG_PPC_BOOK3S if (arch_irq_disabled_regs(regs)) { unsigned long rst = search_kernel_restart_table(regs->nip); if (rst) regs_set_return_ip(regs, rst); } #endif if (nmi_disables_ftrace(regs)) this_cpu_set_ftrace_enabled(state->ftrace_enabled); /* Check we didn't change the pending interrupt mask. */ WARN_ON_ONCE((state->irq_happened | PACA_IRQ_HARD_DIS) != local_paca->irq_happened); regs->softe = state->softe; local_paca->irq_happened = state->irq_happened; local_paca->irq_soft_mask = state->irq_soft_mask; #endif } /* * Don't use noinstr here like x86, but rather add NOKPROBE_SYMBOL to each * function definition. The reason for this is the noinstr section is placed * after the main text section, i.e., very far away from the interrupt entry * asm. That creates problems with fitting linker stubs when building large * kernels. */ #define interrupt_handler __visible noinline notrace __no_kcsan __no_sanitize_address /** * DECLARE_INTERRUPT_HANDLER_RAW - Declare raw interrupt handler function * @func: Function name of the entry point * @returns: Returns a value back to asm caller */ #define DECLARE_INTERRUPT_HANDLER_RAW(func) \ __visible long func(struct pt_regs *regs) /** * DEFINE_INTERRUPT_HANDLER_RAW - Define raw interrupt handler function * @func: Function name of the entry point * @returns: Returns a value back to asm caller * * @func is called from ASM entry code. * * This is a plain function which does no tracing, reconciling, etc. * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. * * raw interrupt handlers must not enable or disable interrupts, or * schedule, tracing and instrumentation (ftrace, lockdep, etc) would * not be advisable either, although may be possible in a pinch, the * trace will look odd at least. * * A raw handler may call one of the other interrupt handler functions * to be converted into that interrupt context without these restrictions. * * On PPC64, _RAW handlers may return with fast_interrupt_return. * * Specific handlers may have additional restrictions. */ #define DEFINE_INTERRUPT_HANDLER_RAW(func) \ static __always_inline long ____##func(struct pt_regs *regs); \ \ interrupt_handler long func(struct pt_regs *regs) \ { \ long ret; \ \ ret = ____##func (regs); \ \ return ret; \ } \ NOKPROBE_SYMBOL(func); \ \ static __always_inline long ____##func(struct pt_regs *regs) /** * DECLARE_INTERRUPT_HANDLER - Declare synchronous interrupt handler function * @func: Function name of the entry point */ #define DECLARE_INTERRUPT_HANDLER(func) \ __visible void func(struct pt_regs *regs) /** * DEFINE_INTERRUPT_HANDLER - Define synchronous interrupt handler function * @func: Function name of the entry point * * @func is called from ASM entry code. * * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. */ #define DEFINE_INTERRUPT_HANDLER(func) \ static __always_inline void ____##func(struct pt_regs *regs); \ \ interrupt_handler void func(struct pt_regs *regs) \ { \ struct interrupt_state state; \ \ interrupt_enter_prepare(regs, &state); \ \ ____##func (regs); \ \ interrupt_exit_prepare(regs, &state); \ } \ NOKPROBE_SYMBOL(func); \ \ static __always_inline void ____##func(struct pt_regs *regs) /** * DECLARE_INTERRUPT_HANDLER_RET - Declare synchronous interrupt handler function * @func: Function name of the entry point * @returns: Returns a value back to asm caller */ #define DECLARE_INTERRUPT_HANDLER_RET(func) \ __visible long func(struct pt_regs *regs) /** * DEFINE_INTERRUPT_HANDLER_RET - Define synchronous interrupt handler function * @func: Function name of the entry point * @returns: Returns a value back to asm caller * * @func is called from ASM entry code. * * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. */ #define DEFINE_INTERRUPT_HANDLER_RET(func) \ static __always_inline long ____##func(struct pt_regs *regs); \ \ interrupt_handler long func(struct pt_regs *regs) \ { \ struct interrupt_state state; \ long ret; \ \ interrupt_enter_prepare(regs, &state); \ \ ret = ____##func (regs); \ \ interrupt_exit_prepare(regs, &state); \ \ return ret; \ } \ NOKPROBE_SYMBOL(func); \ \ static __always_inline long ____##func(struct pt_regs *regs) /** * DECLARE_INTERRUPT_HANDLER_ASYNC - Declare asynchronous interrupt handler function * @func: Function name of the entry point */ #define DECLARE_INTERRUPT_HANDLER_ASYNC(func) \ __visible void func(struct pt_regs *regs) /** * DEFINE_INTERRUPT_HANDLER_ASYNC - Define asynchronous interrupt handler function * @func: Function name of the entry point * * @func is called from ASM entry code. * * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. */ #define DEFINE_INTERRUPT_HANDLER_ASYNC(func) \ static __always_inline void ____##func(struct pt_regs *regs); \ \ interrupt_handler void func(struct pt_regs *regs) \ { \ struct interrupt_state state; \ \ interrupt_async_enter_prepare(regs, &state); \ \ ____##func (regs); \ \ interrupt_async_exit_prepare(regs, &state); \ } \ NOKPROBE_SYMBOL(func); \ \ static __always_inline void ____##func(struct pt_regs *regs) /** * DECLARE_INTERRUPT_HANDLER_NMI - Declare NMI interrupt handler function * @func: Function name of the entry point * @returns: Returns a value back to asm caller */ #define DECLARE_INTERRUPT_HANDLER_NMI(func) \ __visible long func(struct pt_regs *regs) /** * DEFINE_INTERRUPT_HANDLER_NMI - Define NMI interrupt handler function * @func: Function name of the entry point * @returns: Returns a value back to asm caller * * @func is called from ASM entry code. * * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. */ #define DEFINE_INTERRUPT_HANDLER_NMI(func) \ static __always_inline long ____##func(struct pt_regs *regs); \ \ interrupt_handler long func(struct pt_regs *regs) \ { \ struct interrupt_nmi_state state; \ long ret; \ \ interrupt_nmi_enter_prepare(regs, &state); \ \ ret = ____##func (regs); \ \ interrupt_nmi_exit_prepare(regs, &state); \ \ return ret; \ } \ NOKPROBE_SYMBOL(func); \ \ static __always_inline long ____##func(struct pt_regs *regs) /* Interrupt handlers */ /* kernel/traps.c */ DECLARE_INTERRUPT_HANDLER_NMI(system_reset_exception); #ifdef CONFIG_PPC_BOOK3S_64 DECLARE_INTERRUPT_HANDLER_ASYNC(machine_check_exception_async); #endif DECLARE_INTERRUPT_HANDLER_NMI(machine_check_exception); DECLARE_INTERRUPT_HANDLER(SMIException); DECLARE_INTERRUPT_HANDLER(handle_hmi_exception); DECLARE_INTERRUPT_HANDLER(unknown_exception); DECLARE_INTERRUPT_HANDLER_ASYNC(unknown_async_exception); DECLARE_INTERRUPT_HANDLER_NMI(unknown_nmi_exception); DECLARE_INTERRUPT_HANDLER(instruction_breakpoint_exception); DECLARE_INTERRUPT_HANDLER(RunModeException); DECLARE_INTERRUPT_HANDLER(single_step_exception); DECLARE_INTERRUPT_HANDLER(program_check_exception); DECLARE_INTERRUPT_HANDLER(emulation_assist_interrupt); DECLARE_INTERRUPT_HANDLER(alignment_exception); DECLARE_INTERRUPT_HANDLER(StackOverflow); DECLARE_INTERRUPT_HANDLER(stack_overflow_exception); DECLARE_INTERRUPT_HANDLER(kernel_fp_unavailable_exception); DECLARE_INTERRUPT_HANDLER(altivec_unavailable_exception); DECLARE_INTERRUPT_HANDLER(vsx_unavailable_exception); DECLARE_INTERRUPT_HANDLER(facility_unavailable_exception); DECLARE_INTERRUPT_HANDLER(fp_unavailable_tm); DECLARE_INTERRUPT_HANDLER(altivec_unavailable_tm); DECLARE_INTERRUPT_HANDLER(vsx_unavailable_tm); DECLARE_INTERRUPT_HANDLER_NMI(performance_monitor_exception_nmi); DECLARE_INTERRUPT_HANDLER_ASYNC(performance_monitor_exception_async); DECLARE_INTERRUPT_HANDLER_RAW(performance_monitor_exception); DECLARE_INTERRUPT_HANDLER(DebugException); DECLARE_INTERRUPT_HANDLER(altivec_assist_exception); DECLARE_INTERRUPT_HANDLER(CacheLockingException); DECLARE_INTERRUPT_HANDLER(SPEFloatingPointException); DECLARE_INTERRUPT_HANDLER(SPEFloatingPointRoundException); DECLARE_INTERRUPT_HANDLER_NMI(WatchdogException); DECLARE_INTERRUPT_HANDLER(kernel_bad_stack); /* slb.c */ DECLARE_INTERRUPT_HANDLER_RAW(do_slb_fault); DECLARE_INTERRUPT_HANDLER(do_bad_slb_fault); /* hash_utils.c */ DECLARE_INTERRUPT_HANDLER(do_hash_fault); /* fault.c */ DECLARE_INTERRUPT_HANDLER(do_page_fault); DECLARE_INTERRUPT_HANDLER(do_bad_page_fault_segv); /* process.c */ DECLARE_INTERRUPT_HANDLER(do_break); /* time.c */ DECLARE_INTERRUPT_HANDLER_ASYNC(timer_interrupt); /* mce.c */ DECLARE_INTERRUPT_HANDLER_NMI(machine_check_early); DECLARE_INTERRUPT_HANDLER_NMI(hmi_exception_realmode); DECLARE_INTERRUPT_HANDLER_ASYNC(TAUException); /* irq.c */ DECLARE_INTERRUPT_HANDLER_ASYNC(do_IRQ); void __noreturn unrecoverable_exception(struct pt_regs *regs); void replay_system_reset(void); void replay_soft_interrupts(void); static inline void interrupt_cond_local_irq_enable(struct pt_regs *regs) { if (!arch_irq_disabled_regs(regs)) local_irq_enable(); } #endif /* __ASSEMBLY__ */ #endif /* _ASM_POWERPC_INTERRUPT_H */
Save
cmd:
run