mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-15 20:46:41 +07:00
89f579ce99
When building the kernel with W=1 we get a lot of -Wmissing-prototypes warnings, which are trivial in nature and easy to fix - and which may mask some real future bugs if the prototypes get out of sync with the function definition. This patch fixes most of -Wmissing-prototypes warnings which are in the root directory of arch/x86/kernel, not including the subdirectories. These are the warnings fixed in this patch: arch/x86/kernel/signal.c:865:17: warning: no previous prototype for ‘sys32_x32_rt_sigreturn’ [-Wmissing-prototypes] arch/x86/kernel/signal_compat.c:164:6: warning: no previous prototype for ‘sigaction_compat_abi’ [-Wmissing-prototypes] arch/x86/kernel/traps.c:625:46: warning: no previous prototype for ‘sync_regs’ [-Wmissing-prototypes] arch/x86/kernel/traps.c:640:24: warning: no previous prototype for ‘fixup_bad_iret’ [-Wmissing-prototypes] arch/x86/kernel/traps.c:929:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes] arch/x86/kernel/irq.c:270:28: warning: no previous prototype for ‘smp_x86_platform_ipi’ [-Wmissing-prototypes] arch/x86/kernel/irq.c:301:16: warning: no previous prototype for ‘smp_kvm_posted_intr_ipi’ [-Wmissing-prototypes] arch/x86/kernel/irq.c:314:16: warning: no previous prototype for ‘smp_kvm_posted_intr_wakeup_ipi’ [-Wmissing-prototypes] arch/x86/kernel/irq.c:328:16: warning: no previous prototype for ‘smp_kvm_posted_intr_nested_ipi’ [-Wmissing-prototypes] arch/x86/kernel/irq_work.c:16:28: warning: no previous prototype for ‘smp_irq_work_interrupt’ [-Wmissing-prototypes] arch/x86/kernel/irqinit.c:79:13: warning: no previous prototype for ‘init_IRQ’ [-Wmissing-prototypes] arch/x86/kernel/quirks.c:672:13: warning: no previous prototype for ‘early_platform_quirks’ [-Wmissing-prototypes] arch/x86/kernel/tsc.c:1499:15: warning: no previous prototype for ‘calibrate_delay_is_known’ [-Wmissing-prototypes] arch/x86/kernel/process.c:653:13: warning: no previous prototype for ‘arch_post_acpi_subsys_init’ [-Wmissing-prototypes] arch/x86/kernel/process.c:717:15: warning: no previous prototype for ‘arch_randomize_brk’ [-Wmissing-prototypes] arch/x86/kernel/process.c:784:6: warning: no previous prototype for ‘do_arch_prctl_common’ [-Wmissing-prototypes] arch/x86/kernel/reboot.c:869:6: warning: no previous prototype for ‘nmi_panic_self_stop’ [-Wmissing-prototypes] arch/x86/kernel/smp.c:176:27: warning: no previous prototype for ‘smp_reboot_interrupt’ [-Wmissing-prototypes] arch/x86/kernel/smp.c:260:28: warning: no previous prototype for ‘smp_reschedule_interrupt’ [-Wmissing-prototypes] arch/x86/kernel/smp.c:281:28: warning: no previous prototype for ‘smp_call_function_interrupt’ [-Wmissing-prototypes] arch/x86/kernel/smp.c:291:28: warning: no previous prototype for ‘smp_call_function_single_interrupt’ [-Wmissing-prototypes] arch/x86/kernel/ftrace.c:840:6: warning: no previous prototype for ‘arch_ftrace_update_trampoline’ [-Wmissing-prototypes] arch/x86/kernel/ftrace.c:934:7: warning: no previous prototype for ‘arch_ftrace_trampoline_func’ [-Wmissing-prototypes] arch/x86/kernel/ftrace.c:946:6: warning: no previous prototype for ‘arch_ftrace_trampoline_free’ [-Wmissing-prototypes] arch/x86/kernel/crash.c:114:6: warning: no previous prototype for ‘crash_smp_send_stop’ [-Wmissing-prototypes] arch/x86/kernel/crash.c:351:5: warning: no previous prototype for ‘crash_setup_memmap_entries’ [-Wmissing-prototypes] arch/x86/kernel/crash.c:424:5: warning: no previous prototype for ‘crash_load_segments’ [-Wmissing-prototypes] arch/x86/kernel/machine_kexec_64.c:372:7: warning: no previous prototype for ‘arch_kexec_kernel_image_load’ [-Wmissing-prototypes] arch/x86/kernel/paravirt-spinlocks.c:12:16: warning: no previous prototype for ‘__native_queued_spin_unlock’ [-Wmissing-prototypes] arch/x86/kernel/paravirt-spinlocks.c:18:6: warning: no previous prototype for ‘pv_is_native_spin_unlock’ [-Wmissing-prototypes] arch/x86/kernel/paravirt-spinlocks.c:24:16: warning: no previous prototype for ‘__native_vcpu_is_preempted’ [-Wmissing-prototypes] arch/x86/kernel/paravirt-spinlocks.c:30:6: warning: no previous prototype for ‘pv_is_native_vcpu_is_preempted’ [-Wmissing-prototypes] arch/x86/kernel/kvm.c:258:1: warning: no previous prototype for ‘do_async_page_fault’ [-Wmissing-prototypes] arch/x86/kernel/jailhouse.c:200:6: warning: no previous prototype for ‘jailhouse_paravirt’ [-Wmissing-prototypes] arch/x86/kernel/check.c:91:13: warning: no previous prototype for ‘setup_bios_corruption_check’ [-Wmissing-prototypes] arch/x86/kernel/check.c:139:6: warning: no previous prototype for ‘check_for_bios_corruption’ [-Wmissing-prototypes] arch/x86/kernel/devicetree.c:32:13: warning: no previous prototype for ‘early_init_dt_scan_chosen_arch’ [-Wmissing-prototypes] arch/x86/kernel/devicetree.c:42:13: warning: no previous prototype for ‘add_dtb’ [-Wmissing-prototypes] arch/x86/kernel/devicetree.c:108:6: warning: no previous prototype for ‘x86_of_pci_init’ [-Wmissing-prototypes] arch/x86/kernel/devicetree.c:314:13: warning: no previous prototype for ‘x86_dtb_init’ [-Wmissing-prototypes] arch/x86/kernel/tracepoint.c:16:5: warning: no previous prototype for ‘trace_pagefault_reg’ [-Wmissing-prototypes] arch/x86/kernel/tracepoint.c:22:6: warning: no previous prototype for ‘trace_pagefault_unreg’ [-Wmissing-prototypes] arch/x86/kernel/head64.c:113:22: warning: no previous prototype for ‘__startup_64’ [-Wmissing-prototypes] arch/x86/kernel/head64.c:262:15: warning: no previous prototype for ‘__startup_secondary_64’ [-Wmissing-prototypes] arch/x86/kernel/head64.c:350:12: warning: no previous prototype for ‘early_make_pgtable’ [-Wmissing-prototypes] [ mingo: rewrote the changelog, fixed build errors. ] Signed-off-by: Yi Wang <wang.yi59@zte.com.cn> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: akataria@vmware.com Cc: akpm@linux-foundation.org Cc: andy.shevchenko@gmail.com Cc: anton@enomsg.org Cc: ard.biesheuvel@linaro.org Cc: bhe@redhat.com Cc: bhelgaas@google.com Cc: bp@alien8.de Cc: ccross@android.com Cc: devicetree@vger.kernel.org Cc: douly.fnst@cn.fujitsu.com Cc: dwmw@amazon.co.uk Cc: dyoung@redhat.com Cc: ebiederm@xmission.com Cc: frank.rowand@sony.com Cc: frowand.list@gmail.com Cc: ivan.gorinov@intel.com Cc: jailhouse-dev@googlegroups.com Cc: jan.kiszka@siemens.com Cc: jgross@suse.com Cc: jroedel@suse.de Cc: keescook@chromium.org Cc: kexec@lists.infradead.org Cc: konrad.wilk@oracle.com Cc: kvm@vger.kernel.org Cc: linux-efi@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: luto@kernel.org Cc: m.mizuma@jp.fujitsu.com Cc: namit@vmware.com Cc: oleg@redhat.com Cc: pasha.tatashin@oracle.com Cc: pbonzini@redhat.com Cc: prarit@redhat.com Cc: pravin.shedge4linux@gmail.com Cc: rajvi.jingar@intel.com Cc: rkrcmar@redhat.com Cc: robh+dt@kernel.org Cc: robh@kernel.org Cc: rostedt@goodmis.org Cc: takahiro.akashi@linaro.org Cc: thomas.lendacky@amd.com Cc: tony.luck@intel.com Cc: up2wing@gmail.com Cc: virtualization@lists.linux-foundation.org Cc: zhe.he@windriver.com Cc: zhong.weidong@zte.com.cn Link: http://lkml.kernel.org/r/1542852249-19820-1-git-send-email-wang.yi59@zte.com.cn Signed-off-by: Ingo Molnar <mingo@kernel.org>
171 lines
6.3 KiB
C
171 lines
6.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_X86_TRAPS_H
|
|
#define _ASM_X86_TRAPS_H
|
|
|
|
#include <linux/context_tracking_state.h>
|
|
#include <linux/kprobes.h>
|
|
|
|
#include <asm/debugreg.h>
|
|
#include <asm/siginfo.h> /* TRAP_TRACE, ... */
|
|
|
|
#define dotraplinkage __visible
|
|
|
|
asmlinkage void divide_error(void);
|
|
asmlinkage void debug(void);
|
|
asmlinkage void nmi(void);
|
|
asmlinkage void int3(void);
|
|
asmlinkage void overflow(void);
|
|
asmlinkage void bounds(void);
|
|
asmlinkage void invalid_op(void);
|
|
asmlinkage void device_not_available(void);
|
|
#ifdef CONFIG_X86_64
|
|
asmlinkage void double_fault(void);
|
|
#endif
|
|
asmlinkage void coprocessor_segment_overrun(void);
|
|
asmlinkage void invalid_TSS(void);
|
|
asmlinkage void segment_not_present(void);
|
|
asmlinkage void stack_segment(void);
|
|
asmlinkage void general_protection(void);
|
|
asmlinkage void page_fault(void);
|
|
asmlinkage void async_page_fault(void);
|
|
asmlinkage void spurious_interrupt_bug(void);
|
|
asmlinkage void coprocessor_error(void);
|
|
asmlinkage void alignment_check(void);
|
|
#ifdef CONFIG_X86_MCE
|
|
asmlinkage void machine_check(void);
|
|
#endif /* CONFIG_X86_MCE */
|
|
asmlinkage void simd_coprocessor_error(void);
|
|
|
|
#if defined(CONFIG_X86_64) && defined(CONFIG_XEN_PV)
|
|
asmlinkage void xen_divide_error(void);
|
|
asmlinkage void xen_xennmi(void);
|
|
asmlinkage void xen_xendebug(void);
|
|
asmlinkage void xen_xenint3(void);
|
|
asmlinkage void xen_overflow(void);
|
|
asmlinkage void xen_bounds(void);
|
|
asmlinkage void xen_invalid_op(void);
|
|
asmlinkage void xen_device_not_available(void);
|
|
asmlinkage void xen_double_fault(void);
|
|
asmlinkage void xen_coprocessor_segment_overrun(void);
|
|
asmlinkage void xen_invalid_TSS(void);
|
|
asmlinkage void xen_segment_not_present(void);
|
|
asmlinkage void xen_stack_segment(void);
|
|
asmlinkage void xen_general_protection(void);
|
|
asmlinkage void xen_page_fault(void);
|
|
asmlinkage void xen_spurious_interrupt_bug(void);
|
|
asmlinkage void xen_coprocessor_error(void);
|
|
asmlinkage void xen_alignment_check(void);
|
|
#ifdef CONFIG_X86_MCE
|
|
asmlinkage void xen_machine_check(void);
|
|
#endif /* CONFIG_X86_MCE */
|
|
asmlinkage void xen_simd_coprocessor_error(void);
|
|
#endif
|
|
|
|
dotraplinkage void do_divide_error(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_debug(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_nmi(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_int3(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_overflow(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_bounds(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_invalid_op(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_device_not_available(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_invalid_TSS(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_segment_not_present(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code);
|
|
#ifdef CONFIG_X86_64
|
|
dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code);
|
|
asmlinkage __visible notrace struct pt_regs *sync_regs(struct pt_regs *eregs);
|
|
asmlinkage __visible notrace
|
|
struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s);
|
|
void __init trap_init(void);
|
|
#endif
|
|
dotraplinkage void do_general_protection(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code);
|
|
dotraplinkage void do_spurious_interrupt_bug(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code);
|
|
dotraplinkage void do_alignment_check(struct pt_regs *regs, long error_code);
|
|
#ifdef CONFIG_X86_MCE
|
|
dotraplinkage void do_machine_check(struct pt_regs *regs, long error_code);
|
|
#endif
|
|
dotraplinkage void do_simd_coprocessor_error(struct pt_regs *regs, long error_code);
|
|
#ifdef CONFIG_X86_32
|
|
dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code);
|
|
#endif
|
|
dotraplinkage void do_mce(struct pt_regs *regs, long error_code);
|
|
|
|
static inline int get_si_code(unsigned long condition)
|
|
{
|
|
if (condition & DR_STEP)
|
|
return TRAP_TRACE;
|
|
else if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))
|
|
return TRAP_HWBKPT;
|
|
else
|
|
return TRAP_BRKPT;
|
|
}
|
|
|
|
extern int panic_on_unrecovered_nmi;
|
|
|
|
void math_emulate(struct math_emu_info *);
|
|
#ifndef CONFIG_X86_32
|
|
asmlinkage void smp_thermal_interrupt(struct pt_regs *regs);
|
|
asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
|
|
asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
|
|
#endif
|
|
|
|
extern void ist_enter(struct pt_regs *regs);
|
|
extern void ist_exit(struct pt_regs *regs);
|
|
extern void ist_begin_non_atomic(struct pt_regs *regs);
|
|
extern void ist_end_non_atomic(void);
|
|
|
|
#ifdef CONFIG_VMAP_STACK
|
|
void __noreturn handle_stack_overflow(const char *message,
|
|
struct pt_regs *regs,
|
|
unsigned long fault_address);
|
|
#endif
|
|
|
|
/* Interrupts/Exceptions */
|
|
enum {
|
|
X86_TRAP_DE = 0, /* 0, Divide-by-zero */
|
|
X86_TRAP_DB, /* 1, Debug */
|
|
X86_TRAP_NMI, /* 2, Non-maskable Interrupt */
|
|
X86_TRAP_BP, /* 3, Breakpoint */
|
|
X86_TRAP_OF, /* 4, Overflow */
|
|
X86_TRAP_BR, /* 5, Bound Range Exceeded */
|
|
X86_TRAP_UD, /* 6, Invalid Opcode */
|
|
X86_TRAP_NM, /* 7, Device Not Available */
|
|
X86_TRAP_DF, /* 8, Double Fault */
|
|
X86_TRAP_OLD_MF, /* 9, Coprocessor Segment Overrun */
|
|
X86_TRAP_TS, /* 10, Invalid TSS */
|
|
X86_TRAP_NP, /* 11, Segment Not Present */
|
|
X86_TRAP_SS, /* 12, Stack Segment Fault */
|
|
X86_TRAP_GP, /* 13, General Protection Fault */
|
|
X86_TRAP_PF, /* 14, Page Fault */
|
|
X86_TRAP_SPURIOUS, /* 15, Spurious Interrupt */
|
|
X86_TRAP_MF, /* 16, x87 Floating-Point Exception */
|
|
X86_TRAP_AC, /* 17, Alignment Check */
|
|
X86_TRAP_MC, /* 18, Machine Check */
|
|
X86_TRAP_XF, /* 19, SIMD Floating-Point Exception */
|
|
X86_TRAP_IRET = 32, /* 32, IRET Exception */
|
|
};
|
|
|
|
/*
|
|
* Page fault error code bits:
|
|
*
|
|
* bit 0 == 0: no page found 1: protection fault
|
|
* bit 1 == 0: read access 1: write access
|
|
* bit 2 == 0: kernel-mode access 1: user-mode access
|
|
* bit 3 == 1: use of reserved bit detected
|
|
* bit 4 == 1: fault was an instruction fetch
|
|
* bit 5 == 1: protection keys block access
|
|
*/
|
|
enum x86_pf_error_code {
|
|
X86_PF_PROT = 1 << 0,
|
|
X86_PF_WRITE = 1 << 1,
|
|
X86_PF_USER = 1 << 2,
|
|
X86_PF_RSVD = 1 << 3,
|
|
X86_PF_INSTR = 1 << 4,
|
|
X86_PF_PK = 1 << 5,
|
|
};
|
|
#endif /* _ASM_X86_TRAPS_H */
|