* 4.9/tmp-75d78c7: Linux 4.9.35 brcmfmac: fix uninitialized warning in brcmf_usb_probe_phase2() jump label: fix passing kbuild_cflags when checking for asm goto support net: phy: fix marvell phy status reading spi: double time out tolerance dmaengine: bcm2835: Fix cyclic DMA period splitting net: phy: Initialize mdio clock at probe function rt2x00: avoid introducing a USB dependency in the rt2x00lib module usb: gadget: f_fs: avoid out of bounds access on comp_desc mtd: spi-nor: fix spansion quad enable of: Add check to of_scan_flat_dt() before accessing initial_boot_params rxrpc: Fix several cases where a padded len isn't checked in ticket decode drm/amdgpu: adjust default display clock drm/amdgpu/atom: fix ps allocation size for EnableDispPowerGating drm/radeon: add a quirk for Toshiba Satellite L20-183 drm/radeon: add a PX quirk for another K53TK variant iscsi-target: Reject immediate data underflow larger than SCSI transfer length iscsi-target: Fix delayed logout processing greater than SECONDS_FOR_LOGOUT_COMP target: Fix kref->refcount underflow in transport_cmd_finish_abort arm64/vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW time: Fix CLOCK_MONOTONIC_RAW sub-nanosecond accounting time: Fix clock->read(clock) race around clocksource changes brcmfmac: unbind all devices upon failure in firmware callback brcmfmac: use firmware callback upon failure to load brcmfmac: add parameter to pass error code in firmware callback Input: i8042 - add Fujitsu Lifebook AH544 to notimeout list powerpc/64s: Handle data breakpoints in Radix mode powerpc/kprobes: Pause function_graph tracing during jprobes handling signal: Only reschedule timers on signals timers have sent HID: Add quirk for Dell PIXART OEM mouse cxgb4: notify uP to route ctrlq compl to rdma rspq CIFS: Improve readdir verbosity KVM: PPC: Book3S HV: Context-switch EBB registers properly KVM: PPC: Book3S HV: Preserve userspace HTM state properly KVM: s390: gaccess: fix real-space designation asce handling for gmap shadows perf/x86/intel: Add 1G DTLB load/store miss support for SKL lib/cmdline.c: fix get_options() overflow while parsing ranges autofs: sanity check status reported with AUTOFS_DEV_IOCTL_FAIL powerpc/perf: Fix oops when kthread execs user process fs/exec.c: account for argv/envp pointers ALSA: pcm: Don't treat NULL chmap as a fatal error ALSA: firewire-lib: Fix stall of process context at packet error xen-blkback: don't leak stack data via response ring xen/blkback: fix disconnect while I/Os in flight clk: sunxi-ng: a31: Correct lcd1-ch1 clock register offset Revert "ANDROID: hardlockup: detect hard lockups without NMIs using secondary cpus" Revert "ANDROID: kernel/watchdog: fix unused variable warning" UPSTREAM: usb: gadget: f_fs: avoid out of bounds access on comp_desc Linux 4.9.34 mm: fix new crash in unmapped_area_topdown() Allow stack to grow up to address space limit mm: larger stack guard gap, between vmas alarmtimer: Rate limit periodic intervals crypto: Work around deallocated stack frame reference gcc bug on sparc. vTPM: Fix missing NULL check MIPS: .its targets depend on vmlinux MIPS: Fix bnezc/jialc return address calculation usb: dwc3: exynos fix axius clock error path to do cleanup usb: gadget: composite: Fix function used to free memory alarmtimer: Prevent overflow of relative timers genirq: Release resources in __setup_irq() error path sched/core: Idle_task_exit() shouldn't use switch_mm_irqs_off() iio: imu: inv_mpu6050: add accel lpf setting for chip >= MPU6500 swap: cond_resched in swap_cgroup_prepare() mm/memory-failure.c: use compound_head() flags for huge pages USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks USB: gadget: fix GPF in gadgetfs usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk usb: xhci: Fix USB 3.1 supported protocol parsing drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR() misc: mic: double free on ioctl error path ath10k: fix napi crash during rmmod when probe firmware fails usb: r8a66597-hcd: decrease timeout usb: r8a66597-hcd: select a different endpoint on timeout USB: gadget: dummy_hcd: fix hub-descriptor removable fields pvrusb2: reduce stack usage pvr2_eeprom_analyze() USB: usbip: fix nonconforming hub descriptor usb: core: fix potential memory leak in error path during hcd creation USB: hub: fix SS max number of ports usb: gadget: udc: renesas_usb3: lock for PN_ registers access usb: gadget: udc: renesas_usb3: fix deadlock by spinlock usb: gadget: udc: renesas_usb3: fix pm_runtime functions calling IB/mlx5: Fix kernel to user leak prevention logic iio: adc: ti_am335x_adc: allocating too much in probe iio: proximity: as3935: recalibrate RCO after resume iio: st_pressure: Fix data sign staging: iio: tsl2x7x_core: Fix standard deviation calculation staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data() mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode x86/mm/32: Set the '__vmalloc_start_set' flag in initmem_init() serial: sh-sci: Fix late enablement of AUTORTS serial: efm32: Fix parity management in 'efm32_uart_console_get_options()' drm/vc4: Fix OOPSes from trying to cache a partially constructed BO. drm/mediatek: fix mtk_hdmi_setup_vendor_specific_infoframe mistake mac80211: don't send SMPS action frame in AP mode when not needed mac80211: fix dropped counter in multiqueue RX mac80211: strictly check mesh address extension mode mac80211: fix IBSS presp allocation size mac80211: fix packet statistics for fast-RX mac80211: fix CSA in IBSS mode usb: musb: dsps: keep VBUS on for host-only mode drm/i915: Fix GVT-g PVINFO version compatibility check drm/amdgpu: Fix overflow of watermark calcs at > 4k resolutions. mac80211/wpa: use constant time memory comparison for MACs mac80211: don't look at the PM bit of BAR frames vb2: Fix an off by one error in 'vb2_plane_vaddr' cpufreq: conservative: Allow down_threshold to take values from 1 to 10 ila_xlat: add missing hash secret initialization can: gs_usb: fix memory leak in gs_cmd_reset() configfs: Fix race between create_link and configfs_rmdir fs: pass on flags in compat_writev ANDROID: sdcardfs: remove dead function open_flags_to_access_mode() ANDROID: android-base.cfg: split out arm64-specific configs Linux 4.9.33 sparc64: make string buffers large enough drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2. drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail s390/kvm: do not rely on the ILC on kvm host protection fauls xtensa: don't use linux IRQ #0 RDMA/qedr: Return max inline data in QP query result RDMA/qedr: Don't spam dmesg if QP is in error state RDMA/qedr: Don't reset QP when queues aren't flushed RDMA/qedr: Fix and simplify memory leak in PD alloc RDMA/qedr: Dispatch port active event from qedr_add netfilter: nft_log: restrict the log prefix length to 127 netfilter: nf_tables: fix set->nelems counting with no NLM_F_EXCL tipc: fix nametbl_lock soft lockup at node/link events tipc: add subscription refcount to avoid invalid delete tipc: fix connection refcount error tipc: ignore requests when the connection state is not CONNECTED ARCv2: smp-boot: wake_flag polling by non-Masters needs to be uncached ARC: smp-boot: Decouple Non masters waiting API from jump to entry point vhost/vsock: handle vhost_vq_init_access() error kernel/watchdog: prevent false hardlockup on overloaded system kernel/watchdog.c: move shared definitions to nmi.h kernel/watchdog.c: move hardlockup detector to separate file userfaultfd: fix SIGBUS resulting from false rwsem wakeups proc: add a schedule point in proc_pid_readdir() frv: add missing atomic64 operations frv: add atomic64_add_unless() romfs: use different way to generate fsid for BLOCK or MTD mn10300: fix build error of missing fpu_save() usb: musb: Fix external abort on non-linefetch for musb_irq_work() sctp: sctp_addr_id2transport should verify the addr before looking up assoc sctp: sctp gso should set feature with NETIF_F_SG when calling skb_segment bnxt_en: Fix RTNL lock usage on bnxt_get_port_module_status(). bnxt_en: Fix RTNL lock usage on bnxt_update_link(). bnxt_en: Enhance autoneg support. bnxt_en: Fix bnxt_reset() in the slow path task. net-next: ethernet: mediatek: change the compatible string r8152: avoid start_xmit to schedule napi when napi is disabled r8152: fix rtl8152_post_reset function r8152: re-schedule napi for tx r8152: check rx after napi is enabled r8152: avoid start_xmit to call napi_schedule during autosuspend nvmet-rdma: Fix missing dma sync to nvme data structures nfs: Fix "Don't increment lock sequence ID after NFS4ERR_MOVED" ravb: unmap descriptors when freeing rings drm/ast: Fixed system hanged if disable P2A drm/nouveau: Fix drm poll_helper handling drm/nouveau: Don't enabling polling twice on runtime resume drm/nouveau: Handle fbcon suspend/resume in seperate worker drm/nouveau: Rename acpi_work to hpd_work drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE gtp: add genl family modules alias net: phy: micrel: add support for KSZ8795 parisc, parport_gsc: Fixes for printk continuation lines net/mlx5: Return EOPNOTSUPP when failing to get steering name-space net/mlx5: E-Switch, Err when retrieving steering name-space fails drm/i915: Check for NULL i915_vma in intel_unpin_fb_obj() net: adaptec: starfire: add checks for dma mapping errors pinctrl: berlin-bg4ct: fix the value for "sd1a" of pin SCRD0_CRD_PRES drm: Don't race connector registration drm: prevent double-(un)registration for connectors cec: fix wrong last_la determination pinctrl: baytrail: Rectify debounce support (part 2) gianfar: synchronize DMA API usage by free_skb_rx_queue w/ gfar_new_page net/mlx4_core: Avoid command timeouts during VF driver device shutdown drm/nouveau/fence/g84-: protect against concurrent access to semaphore buffers drm/nouveau: prevent userspace from deleting client object ipv6: fix flow labels when the traffic class is non-0 FS-Cache: Initialise stores_lock in netfs cookie fscache: Clear outstanding writes when disabling a cookie fscache: Fix dead object requeue net: fix ndo_features_check/ndo_fix_features comment ordering net: phy: Fix PHY module checks and NULL deref in phy_attach_direct() net: phy: Fix lack of reference count on PHY driver ethtool: do not vzalloc(0) on registers dump log2: make order_base_2() behave correctly on const input value zero kasan: respect /proc/sys/kernel/traceoff_on_warning shmem: fix sleeping from atomic context jump label: pass kbuild_cflags when checking for asm goto support PM / runtime: Avoid false-positive warnings from might_sleep_if() ARM: defconfigs: make NF_CT_PROTO_SCTP and NF_CT_PROTO_UDPLITE built-in ipv6: Fix IPv6 packet loss in scenarios involving roaming + snooping switches vfio/spapr_tce: Set window when adding additional groups to container ipv6: addrconf: fix generation of new temporary addresses net: thunderx: Fix PHY autoneg for SGMII QLM mode kernel/ucount.c: mark user_header with kmemleak_ignore() powerpc/powernv: Properly set "host-ipi" on IPIs i2c: piix4: Fix request_region size i2c: piix4: Request the SMBUS semaphore inside the mutex sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications sierra_net: Skip validating irrelevant fields for IDLE LSIs net: hns: Fix the device being used for dma mapping during TX NET: mkiss: Fix panic ibmvnic: Initialize completion variables before starting work ibmvnic: Call napi_disable instead of napi_enable in failure path NET: Fix /proc/net/arp for AX.25 gfs2: Use rhashtable walk interface in glock_hash_walk tipc: Fix tipc_sk_reinit race conditions ipv6: Inhibit IPv4-mapped src address on the wire. ipv6: Handle IPv4-mapped src to in6addr_any dst. tcp: tcp_probe: use spin_lock_bh() net: xilinx_emaclite: fix receive buffer overflow net: xilinx_emaclite: fix freezes due to unordered I/O ibmvnic: Fix endian error when requesting device capabilities ibmvnic: Fix endian errors in error reporting output netfilter: nf_conntrack_sip: fix wrong memory initialisation partitions/msdos: FreeBSD UFS2 file systems are not recognized drm/i915: Prevent the system suspend complete optimization PCI/PM: Add needs_resume flag to avoid suspend complete optimization usb: gadget: f_fs: Fix possibe deadlock FROMLIST: Remove the redundant skb->dev initialization in ip6_fragment FROMLIST: bpf: Remove duplicate tcp_filter hook in ipv6 FROMLIST: ipv6: Initial skb->dev and skb->protocol in ip6_output FROMLIST: bpf: cgroup skb progs cannot access ld_abs/ind ANDROID: uid_sys_stats: check previous uid_entry before call find_or_register_uid Conflicts: drivers/usb/gadget/function/f_fs.c kernel/watchdog.c Change-Id: Ib91e6121cace8bcdc4dd8b1727792dd5bb6f1535 Signed-off-by: Kyle Yan <kyan@codeaurora.org>
162 lines
4.3 KiB
C
162 lines
4.3 KiB
C
/*
|
|
* linux/include/linux/nmi.h
|
|
*/
|
|
#ifndef LINUX_NMI_H
|
|
#define LINUX_NMI_H
|
|
|
|
#include <linux/sched.h>
|
|
#include <asm/irq.h>
|
|
|
|
/*
|
|
* The run state of the lockup detectors is controlled by the content of the
|
|
* 'watchdog_enabled' variable. Each lockup detector has its dedicated bit -
|
|
* bit 0 for the hard lockup detector and bit 1 for the soft lockup detector.
|
|
*
|
|
* 'watchdog_user_enabled', 'nmi_watchdog_enabled' and 'soft_watchdog_enabled'
|
|
* are variables that are only used as an 'interface' between the parameters
|
|
* in /proc/sys/kernel and the internal state bits in 'watchdog_enabled'. The
|
|
* 'watchdog_thresh' variable is handled differently because its value is not
|
|
* boolean, and the lockup detectors are 'suspended' while 'watchdog_thresh'
|
|
* is equal zero.
|
|
*/
|
|
#define NMI_WATCHDOG_ENABLED_BIT 0
|
|
#define SOFT_WATCHDOG_ENABLED_BIT 1
|
|
#define NMI_WATCHDOG_ENABLED (1 << NMI_WATCHDOG_ENABLED_BIT)
|
|
#define SOFT_WATCHDOG_ENABLED (1 << SOFT_WATCHDOG_ENABLED_BIT)
|
|
|
|
/**
|
|
* touch_nmi_watchdog - restart NMI watchdog timeout.
|
|
*
|
|
* If the architecture supports the NMI watchdog, touch_nmi_watchdog()
|
|
* may be used to reset the timeout - for code which intentionally
|
|
* disables interrupts for a long time. This call is stateless.
|
|
*/
|
|
#if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
|
|
#include <asm/nmi.h>
|
|
extern void touch_nmi_watchdog(void);
|
|
#else
|
|
static inline void touch_nmi_watchdog(void)
|
|
{
|
|
touch_softlockup_watchdog();
|
|
}
|
|
#endif
|
|
|
|
#if defined(CONFIG_HARDLOCKUP_DETECTOR)
|
|
extern void hardlockup_detector_disable(void);
|
|
#else
|
|
static inline void hardlockup_detector_disable(void) {}
|
|
#endif
|
|
|
|
/*
|
|
* Create trigger_all_cpu_backtrace() out of the arch-provided
|
|
* base function. Return whether such support was available,
|
|
* to allow calling code to fall back to some other mechanism:
|
|
*/
|
|
#ifdef arch_trigger_cpumask_backtrace
|
|
static inline bool trigger_all_cpu_backtrace(void)
|
|
{
|
|
#if defined(CONFIG_ARM64)
|
|
arch_trigger_all_cpu_backtrace();
|
|
else
|
|
arch_trigger_cpumask_backtrace(cpu_online_mask, false);
|
|
#endif
|
|
|
|
return true;
|
|
}
|
|
|
|
static inline bool trigger_allbutself_cpu_backtrace(void)
|
|
{
|
|
#if defined(CONFIG_ARM64)
|
|
arch_trigger_all_cpu_backtrace();
|
|
else
|
|
arch_trigger_cpumask_backtrace(cpu_online_mask, true);
|
|
#endif
|
|
|
|
return true;
|
|
}
|
|
|
|
static inline bool trigger_cpumask_backtrace(struct cpumask *mask)
|
|
{
|
|
arch_trigger_cpumask_backtrace(mask, false);
|
|
|
|
return true;
|
|
}
|
|
|
|
static inline bool trigger_single_cpu_backtrace(int cpu)
|
|
{
|
|
arch_trigger_cpumask_backtrace(cpumask_of(cpu), false);
|
|
|
|
return true;
|
|
}
|
|
|
|
/* generic implementation */
|
|
void nmi_trigger_cpumask_backtrace(const cpumask_t *mask,
|
|
bool exclude_self,
|
|
void (*raise)(cpumask_t *mask));
|
|
bool nmi_cpu_backtrace(struct pt_regs *regs);
|
|
|
|
#else
|
|
static inline bool trigger_all_cpu_backtrace(void)
|
|
{
|
|
return false;
|
|
}
|
|
static inline bool trigger_allbutself_cpu_backtrace(void)
|
|
{
|
|
return false;
|
|
}
|
|
static inline bool trigger_cpumask_backtrace(struct cpumask *mask)
|
|
{
|
|
return false;
|
|
}
|
|
static inline bool trigger_single_cpu_backtrace(int cpu)
|
|
{
|
|
return false;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_LOCKUP_DETECTOR
|
|
u64 hw_nmi_get_sample_period(int watchdog_thresh);
|
|
extern int nmi_watchdog_enabled;
|
|
extern int soft_watchdog_enabled;
|
|
extern int watchdog_user_enabled;
|
|
extern int watchdog_thresh;
|
|
extern unsigned long watchdog_enabled;
|
|
extern unsigned long *watchdog_cpumask_bits;
|
|
extern atomic_t watchdog_park_in_progress;
|
|
#ifdef CONFIG_SMP
|
|
extern int sysctl_softlockup_all_cpu_backtrace;
|
|
extern int sysctl_hardlockup_all_cpu_backtrace;
|
|
#else
|
|
#define sysctl_softlockup_all_cpu_backtrace 0
|
|
#define sysctl_hardlockup_all_cpu_backtrace 0
|
|
#endif
|
|
extern bool is_hardlockup(void);
|
|
struct ctl_table;
|
|
extern int proc_watchdog(struct ctl_table *, int ,
|
|
void __user *, size_t *, loff_t *);
|
|
extern int proc_nmi_watchdog(struct ctl_table *, int ,
|
|
void __user *, size_t *, loff_t *);
|
|
extern int proc_soft_watchdog(struct ctl_table *, int ,
|
|
void __user *, size_t *, loff_t *);
|
|
extern int proc_watchdog_thresh(struct ctl_table *, int ,
|
|
void __user *, size_t *, loff_t *);
|
|
extern int proc_watchdog_cpumask(struct ctl_table *, int,
|
|
void __user *, size_t *, loff_t *);
|
|
extern int lockup_detector_suspend(void);
|
|
extern void lockup_detector_resume(void);
|
|
#else
|
|
static inline int lockup_detector_suspend(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void lockup_detector_resume(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_HAVE_ACPI_APEI_NMI
|
|
#include <asm/nmi.h>
|
|
#endif
|
|
|
|
#endif
|