Linux 4.9.83
Greg KH
maintainerI'm announcing the release of the 4.9.83 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/devicetree/bindings/dma/snps-dma.txt | 2 Documentation/filesystems/ext4.txt | 2 Makefile | 2 arch/arm/boot/dts/arm-realview-eb-mp.dtsi | 5 arch/arm/boot/dts/exynos5410.dtsi | 1 arch/arm/boot/dts/lpc3250-ea3250.dts | 4 arch/arm/boot/dts/lpc3250-phy3250.dts | 4 arch/arm/boot/dts/mt2701.dtsi | 2 arch/arm/boot/dts/s5pv210.dtsi | 1 arch/arm/boot/dts/spear1310-evb.dts | 2 arch/arm/boot/dts/spear1340.dtsi | 4 arch/arm/boot/dts/spear13xx.dtsi | 6 arch/arm/boot/dts/spear600.dtsi | 1 arch/arm/boot/dts/ste-nomadik-stn8815.dtsi | 1 arch/arm/boot/dts/stih407.dtsi | 3 arch/arm/boot/dts/stih410.dtsi | 3 arch/arm/mach-pxa/tosa-bt.c | 4 arch/arm64/boot/dts/qcom/msm8916.dtsi | 5 arch/mips/Kconfig | 12 arch/powerpc/kernel/entry_64.S | 5 arch/s390/kernel/compat_linux.c | 8 arch/x86/entry/entry_64_compat.S | 30 + arch/x86/events/intel/core.c | 2 arch/x86/events/intel/lbr.c | 2 arch/x86/events/intel/p6.c | 2 arch/x86/include/asm/acpi.h | 2 arch/x86/include/asm/barrier.h | 2 arch/x86/include/asm/nospec-branch.h | 1 arch/x86/include/asm/processor.h | 4 arch/x86/kernel/amd_nb.c | 2 arch/x86/kernel/asm-offsets_32.c | 2 arch/x86/kernel/cpu/amd.c | 26 - arch/x86/kernel/cpu/bugs.c | 28 - arch/x86/kernel/cpu/centaur.c | 4 arch/x86/kernel/cpu/common.c | 10 arch/x86/kernel/cpu/cyrix.c | 2 arch/x86/kernel/cpu/intel.c | 31 - arch/x86/kernel/cpu/microcode/intel.c | 6 arch/x86/kernel/cpu/mtrr/generic.c | 2 arch/x86/kernel/cpu/mtrr/main.c | 4 arch/x86/kernel/cpu/proc.c | 8 arch/x86/kernel/head_32.S | 4 arch/x86/kernel/mpparse.c | 2 arch/x86/kvm/mmu.c | 10 arch/x86/kvm/vmx.c | 4 arch/x86/lib/cpu.c | 2 drivers/char/hw_random/via-rng.c | 2 drivers/cpufreq/acpi-cpufreq.c | 2 drivers/cpufreq/longhaul.c | 6 drivers/cpufreq/p4-clockmod.c | 2 drivers/cpufreq/powernow-k7.c | 2 drivers/cpufreq/powernv-cpufreq.c | 4 drivers/cpufreq/speedstep-centrino.c | 4 drivers/cpufreq/speedstep-lib.c | 6 drivers/crypto/padlock-aes.c | 2 drivers/devfreq/devfreq.c | 2 drivers/edac/amd64_edac.c | 2 drivers/edac/mce_amd.c | 2 drivers/gpu/drm/radeon/radeon_uvd.c | 2 drivers/gpu/drm/radeon/si_dpm.c | 5 drivers/hwmon/coretemp.c | 6 drivers/hwmon/hwmon-vid.c | 2 drivers/hwmon/k10temp.c | 2 drivers/hwmon/k8temp.c | 2 drivers/infiniband/hw/mlx4/main.c | 13 drivers/infiniband/hw/qib/qib_rc.c | 6 drivers/infiniband/sw/rxe/rxe_verbs.c | 2 drivers/md/dm.c | 3 drivers/media/tuners/r820t.c | 13 drivers/mtd/nand/vf610_nfc.c | 6 drivers/net/ethernet/marvell/mvpp2.c | 11 drivers/net/ethernet/mellanox/mlx4/qp.c | 3 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 5 drivers/net/wireless/realtek/rtlwifi/wifi.h | 1 drivers/pci/host/pci-keystone.c | 5 drivers/rtc/rtc-opal.c | 12 drivers/scsi/smartpqi/Makefile | 2 drivers/target/iscsi/iscsi_target_auth.c | 3 drivers/usb/Kconfig | 8 drivers/usb/host/Kconfig | 8 drivers/video/console/dummycon.c | 1 drivers/video/fbdev/atmel_lcdfb.c | 8 drivers/video/fbdev/geode/video_gx.c | 2 fs/btrfs/inode.c | 7 fs/btrfs/tree-log.c | 32 + fs/ext4/inode.c | 16 fs/ext4/super.c | 1 fs/jbd2/transaction.c | 5 fs/mbcache.c | 1 fs/namei.c | 3 fs/ocfs2/dlmglue.c | 9 include/linux/compiler-gcc.h | 4 include/linux/compiler.h | 4 include/linux/jbd2.h | 431 ++++++++++++-------- include/linux/kaiser.h | 2 include/linux/nospec.h | 36 - kernel/memremap.c | 3 mm/memory.c | 2 net/9p/trans_virtio.c | 3 sound/core/seq/seq_clientmgr.c | 8 sound/pci/hda/patch_realtek.c | 70 +++ sound/usb/mixer.c | 18 sound/usb/pcm.c | 9 tools/testing/selftests/vm/compaction_test.c | 2 tools/testing/selftests/x86/Makefile | 2 tools/testing/selftests/x86/mpx-mini-test.c | 32 + tools/testing/selftests/x86/protection_keys.c | 28 - tools/testing/selftests/x86/single_step_syscall.c | 5 tools/testing/selftests/x86/test_mremap_vdso.c | 4 109 files changed, 757 insertions(+), 416 deletions(-)
Alex Deucher (1):
drm/radeon: Add dpm quirk for Jet PRO (v2)
Alexander Potapenko (1):
mbcache: initialize entry->e_referenced in mb_cache_entry_create()
Arnd Bergmann (9):
mm: hide a #warning for COMPILE_TEST
kselftest: fix OOM in memory compaction test
ARM: lpc3250: fix uda1380 gpio numbers
ARM: dts: nomadik: add interrupt-parent for clcd
x86: fix build warnign with 32-bit PAE
ARM: dts: exynos: fix RTC interrupt for exynos5410
ARM: pxa/tosa-bt: add MODULE_LICENSE tag
ARM: dts: s5pv210: add interrupt-parent for ohci
media: r820t: fix r820t_write_reg for KASAN
Bart Van Assche (1):
RDMA/rxe: Fix a race condition related to the QP error state
Bjorn Andersson (3):
PM / devfreq: Propagate error from devfreq_add_device()
arm64: dts: msm8916: Correct ipc references for smsm
arm64: dts: msm8916: Add missing #phy-cells
Corentin Labbe (1):
MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN
Dan Carpenter (1):
x86/spectre: Fix an error message
Dan Williams (2):
x86/entry/64/compat: Clear registers for compat syscalls, to reduce speculation attack surface x86/speculation: Fix up array_index_nospec_mask() asm constraint
David Disseldorp (1):
target/iscsi: avoid NULL dereference in CHAP auth error path
David Woodhouse (3):
x86/speculation: Update Speculation Control microcode blacklist
x86/speculation: Correct Speculation Control microcode blacklist again
KVM/x86: Reduce retpoline performance impact in slot_handle_level_range(), by always inlining iterator helper methods
Dominik Brodowski (2):
selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c
selftests/x86: Do not rely on "int $0x80" in single_step_syscall.cErnesto A. Fernández (1):
ext4: correct documentation for grpid mount option
Eugene Syromiatnikov (1):
s390: fix handling of -1 in set{,fs}[gu]id16 syscalls
Gang He (1):
ocfs2: try a blocking lock before return AOP_TRUNCATED_PAGE
Geert Uytterhoeven (1):
compiler-gcc.h: Introduce __optimize function attribute
Greg Kroah-Hartman (1):
Linux 4.9.83
Greg Kurz (1):
9p/trans_virtio: discard zero-length reply
Gustavo A. R. Silva (1):
x86/cpu: Change type of x86_cache_size variable to unsigned int
Harshad Shirwadkar (1):
ext4: fix a race in the ext4 shutdown path
Hui Wang (1):
ALSA: hda - Fix headset mic detection problem for two Dell machines
Ingo Molnar (2):
x86/speculation: Clean up various Spectre related details selftests/x86/pkeys: Remove unused functions
Jack Morgenstein (1):
IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports
James Hogan (1):
usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT
Jan H. Schönherr (1):
mm: Fix memory size alignment in devm_memremap_pages_release()
Jan-Marek Glogowski (1):
ALSA: hda/realtek: PCI quirk for Fujitsu U7x7
Jia Zhang (1):
x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
Johan Hovold (2):
PCI: keystone: Fix interrupt-controller-node lookup
video: fbdev: atmel_lcdfb: fix display-timings lookup
Julia Lawall (1):
drm/radeon: adjust tested variable
Kailang Yang (1):
ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform
KarimAllah Ahmed (1):
X86/nVMX: Properly set spec_ctrl and pred_cmd before merging MSRs
Kirill Marinushkin (1):
ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute
Larry Finger (1):
rtlwifi: rtl8821ae: Fix connection lost problem correctly
Lassi Ylikojola (1):
ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204
Linus Torvalds (1):
vfs: don't do RCU lookup of empty pathnames
Linus Walleij (1):
ARM: dts: Delete bogus reference to the charlcd
Liu Bo (5):
Btrfs: fix deadlock in run_delalloc_nocow
Btrfs: fix crash due to not cleaning up tree log block's dirty bits
Btrfs: fix extent state leak from tree log
Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly
Btrfs: fix unexpected -EEXIST when creating new inode
Matthias Brugger (1):
arm: dts: mt2701: Add reset-cells
Mike Marciniszyn (1):
IB/qib: Fix comparison error with qperf compare/swap test
Mikulas Patocka (1):
mvpp2: fix multicast address filter
NeilBrown (1):
dm: correctly handle chained bios in dec_pending()
Nicholas Piggin (1):
powerpc: fix build errors in stable tree
Nicolas Pitre (1):
console/dummy: leave .con_font_get set to NULL
Patrice Chotard (1):
ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property
Peter Zijlstra (1):
x86/speculation: Add <asm/msr-index.h> dependency
Rui Wang (1):
selftests/x86/mpx: Fix incorrect bounds with old _sigfault
Shilpasri G Bhat (1):
cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
Stefan Agner (1):
mtd: nand: vf610: set correct ooblayout
Steffen Weber (1):
scsi: smartpqi: allow static build ("built-in")
Stewart Smith (1):
rtc-opal: Fix handling of firmware error codes, prevent busy loops
Takashi Iwai (1):
ALSA: seq: Fix racy pool initializations
Tobin C. Harding (1):
jbd2: fix sphinx kernel-doc build warnings
Viresh Kumar (3):
arm: spear600: Add missing interrupt-parent of rtc
arm: spear13xx: Fix dmas cells
arm: spear13xx: Fix spics gpio controller's warning
Will Deacon (1):
nospec: Move array_index_nospec() parameter checking into separate macro
Zhouyi Zhou (1):
ext4: save error to disk in __ext4_grp_locked_error()
Greg KH
maintainerDocumentation/devicetree/bindings/dma/snps-dma.txt +1 -1
@@ -63,6 +63,6 @@ Example: interrupts = <0 35 0x4>; status = "disabled"; dmas = <&dmahost 12 0 1>, - <&dmahost 13 0 1 0>; + <&dmahost 13 1 0>; dma-names = "rx", "rx"; };
Documentation/filesystems/ext4.txt +1 -1
@@ -233,7 +233,7 @@ data_err=ignore(*) Just print an error message if an error occurs data_err=abort Abort the journal if an error occurs in a file data buffer in ordered mode. -grpid Give objects the same group ID as their creator. +grpid New objects have the group ID of their parent. bsdgroups nogrpid (*) New objects have the group ID of their creator.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 82 +SUBLEVEL = 83 EXTRAVERSION = NAME = Roaring Lionus
arch/arm/boot/dts/arm-realview-eb-mp.dtsi +0 -5
@@ -150,11 +150,6 @@ interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>; }; -&charlcd { - interrupt-parent = <&intc>; - interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; -}; - &serial0 { interrupt-parent = <&intc>; interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/exynos5410.dtsi +0 -1
@@ -274,7 +274,6 @@ &rtc { clocks = <&clock CLK_RTC>; clock-names = "rtc"; - interrupt-parent = <&pmu_system_controller>; status = "disabled"; };
arch/arm/boot/dts/lpc3250-ea3250.dts +2 -2
@@ -156,8 +156,8 @@ uda1380: uda1380@18 { compatible = "nxp,uda1380"; reg = <0x18>; - power-gpio = <&gpio 0x59 0>; - reset-gpio = <&gpio 0x51 0>; + power-gpio = <&gpio 3 10 0>; + reset-gpio = <&gpio 3 2 0>; dac-clk = "wspll"; };
arch/arm/boot/dts/lpc3250-phy3250.dts +2 -2
@@ -81,8 +81,8 @@ uda1380: uda1380@18 { compatible = "nxp,uda1380"; reg = <0x18>; - power-gpio = <&gpio 0x59 0>; - reset-gpio = <&gpio 0x51 0>; + power-gpio = <&gpio 3 10 0>; + reset-gpio = <&gpio 3 2 0>; dac-clk = "wspll"; };
arch/arm/boot/dts/mt2701.dtsi +2 -0
@@ -197,12 +197,14 @@ compatible = "mediatek,mt2701-hifsys", "syscon"; reg = <0 0x1a000000 0 0x1000>; #clock-cells = <1>; + #reset-cells = <1>; }; ethsys: syscon@1b000000 { compatible = "mediatek,mt2701-ethsys", "syscon"; reg = <0 0x1b000000 0 0x1000>; #clock-cells = <1>; + #reset-cells = <1>; }; bdpsys: syscon@1c000000 {
arch/arm/boot/dts/s5pv210.dtsi +1 -0
@@ -463,6 +463,7 @@ compatible = "samsung,exynos4210-ohci"; reg = <0xec300000 0x100>; interrupts = <23>; + interrupt-parent = <&vic1>; clocks = <&clocks CLK_USB_HOST>; clock-names = "usbhost"; #address-cells = <1>;
arch/arm/boot/dts/spear1310-evb.dts +1 -1
@@ -349,7 +349,7 @@ spi0: spi@e0100000 { status = "okay"; num-cs = <3>; - cs-gpios = <&gpio1 7 0>, <&spics 0>, <&spics 1>; + cs-gpios = <&gpio1 7 0>, <&spics 0 0>, <&spics 1 0>; stmpe610@0 { compatible = "st,stmpe610";
arch/arm/boot/dts/spear1340.dtsi +2 -2
@@ -141,8 +141,8 @@ reg = <0xb4100000 0x1000>; interrupts = <0 105 0x4>; status = "disabled"; - dmas = <&dwdma0 0x600 0 0 1>, /* 0xC << 11 */ - <&dwdma0 0x680 0 1 0>; /* 0xD << 7 */ + dmas = <&dwdma0 12 0 1>, + <&dwdma0 13 1 0>; dma-names = "tx", "rx"; };
arch/arm/boot/dts/spear13xx.dtsi +3 -3
@@ -100,7 +100,7 @@ reg = <0xb2800000 0x1000>; interrupts = <0 29 0x4>; status = "disabled"; - dmas = <&dwdma0 0 0 0 0>; + dmas = <&dwdma0 0 0 0>; dma-names = "data"; };
@@ -288,8 +288,8 @@ #size-cells = <0>; interrupts = <0 31 0x4>; status = "disabled"; - dmas = <&dwdma0 0x2000 0 0 0>, /* 0x4 << 11 */ - <&dwdma0 0x0280 0 0 0>; /* 0x5 << 7 */ + dmas = <&dwdma0 4 0 0>, + <&dwdma0 5 0 0>; dma-names = "tx", "rx"; };
arch/arm/boot/dts/spear600.dtsi +1 -0
@@ -194,6 +194,7 @@ rtc@fc900000 { compatible = "st,spear600-rtc"; reg = <0xfc900000 0x1000>; + interrupt-parent = <&vic0>; interrupts = <10>; status = "disabled"; };
arch/arm/boot/dts/ste-nomadik-stn8815.dtsi +1 -0
@@ -749,6 +749,7 @@ reg = <0x10120000 0x1000>; interrupt-names = "combined"; interrupts = <14>; + interrupt-parent = <&vica>; clocks = <&clcdclk>, <&hclkclcd>; clock-names = "clcdclk", "apb_pclk"; status = "disabled";
arch/arm/boot/dts/stih407.dtsi +2 -1
@@ -8,6 +8,7 @@ */ #include "stih407-clock.dtsi" #include "stih407-family.dtsi" +#include <dt-bindings/gpio/gpio.h> / { soc { sti-display-subsystem {
@@ -122,7 +123,7 @@ <&clk_s_d2_quadfs 0>, <&clk_s_d2_quadfs 1>; - hdmi,hpd-gpio = <&pio5 3>; + hdmi,hpd-gpio = <&pio5 3 GPIO_ACTIVE_LOW>; reset-names = "hdmi"; resets = <&softreset STIH407_HDMI_TX_PHY_SOFTRESET>; ddc = <&hdmiddc>;
arch/arm/boot/dts/stih410.dtsi +2 -1
@@ -9,6 +9,7 @@ #include "stih410-clock.dtsi" #include "stih407-family.dtsi" #include "stih410-pinctrl.dtsi" +#include <dt-bindings/gpio/gpio.h> / { aliases { bdisp0 = &bdisp0;
@@ -213,7 +214,7 @@ <&clk_s_d2_quadfs 0>, <&clk_s_d2_quadfs 1>; - hdmi,hpd-gpio = <&pio5 3>; + hdmi,hpd-gpio = <&pio5 3 GPIO_ACTIVE_LOW>; reset-names = "hdmi"; resets = <&softreset STIH407_HDMI_TX_PHY_SOFTRESET>; ddc = <&hdmiddc>;
arch/arm/mach-pxa/tosa-bt.c +4 -0
@@ -132,3 +132,7 @@ static struct platform_driver tosa_bt_driver = { }, };module_platform_driver (tosa_bt_driver); + +MODULE_LICENSE ("GPL" ); +MODULE_AUTHOR ("Dmitry Baryshkov" ); +MODULE_DESCRIPTION ("Bluetooth built-in chip control" );
arch/arm64/boot/dts/qcom/msm8916.dtsi +3 -2
@@ -796,6 +796,7 @@ "dsi_phy_regulator"; #clock-cells = <1>; + #phy-cells = <0>; clocks = <&gcc GCC_MDSS_AHB_CLK>; clock-names = "iface_clk";
@@ -906,8 +907,8 @@ #address-cells = <1>; #size-cells = <0>; - qcom,ipc-1 = <&apcs 0 13>; - qcom,ipc-6 = <&apcs 0 19>; + qcom,ipc-1 = <&apcs 8 13>; + qcom,ipc-3 = <&apcs 8 19>; apps_smsm: apps@0 { reg = <0>;
arch/mips/Kconfig +6 -6
@@ -112,12 +112,12 @@ config MIPS_GENERIC select SYS_SUPPORTS_MULTITHREADING select SYS_SUPPORTS_RELOCATABLE select SYS_SUPPORTS_SMARTMIPS - select USB_EHCI_BIG_ENDIAN_DESC if BIG_ENDIAN - select USB_EHCI_BIG_ENDIAN_MMIO if BIG_ENDIAN - select USB_OHCI_BIG_ENDIAN_DESC if BIG_ENDIAN - select USB_OHCI_BIG_ENDIAN_MMIO if BIG_ENDIAN - select USB_UHCI_BIG_ENDIAN_DESC if BIG_ENDIAN - select USB_UHCI_BIG_ENDIAN_MMIO if BIG_ENDIAN + select USB_EHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN + select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN + select USB_OHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN + select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN + select USB_UHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN + select USB_UHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN select USE_OF help Select this to build a kernel which aims to support multiple boards,
arch/powerpc/kernel/entry_64.S +5 -0
@@ -39,6 +39,11 @@ #include <asm/tm.h> #include <asm/ppc-opcode.h> #include <asm/export.h> +#ifdef CONFIG_PPC_BOOK3S +#include <asm/exception-64s.h> +#else +#include <asm/exception-64e.h> +#endif /* * System calls.
arch/s390/kernel/compat_linux.c +4 -4
@@ -110,7 +110,7 @@ COMPAT_SYSCALL_DEFINE2(s390_setregid16, u16, rgid, u16, egid) COMPAT_SYSCALL_DEFINE1(s390_setgid16, u16, gid) { -return sys_setgid ((gid_t )gid); +return sys_setgid (low2highgid (gid)); }COMPAT_SYSCALL_DEFINE2 (s390_setreuid16, u16, ruid, u16, euid)
@@ -120,7 +120,7 @@ COMPAT_SYSCALL_DEFINE2(s390_setreuid16, u16, ruid, u16, euid) COMPAT_SYSCALL_DEFINE1(s390_setuid16, u16, uid) { -return sys_setuid ((uid_t )uid); +return sys_setuid (low2highuid (uid)); }COMPAT_SYSCALL_DEFINE3 (s390_setresuid16, u16, ruid, u16, euid, u16, suid)
@@ -173,12 +173,12 @@ COMPAT_SYSCALL_DEFINE3(s390_getresgid16, u16 __user *, rgidp, COMPAT_SYSCALL_DEFINE1(s390_setfsuid16, u16, uid) { -return sys_setfsuid ((uid_t )uid); +return sys_setfsuid (low2highuid (uid)); } COMPAT_SYSCALL_DEFINE1(s390_setfsgid16, u16, gid) { -return sys_setfsgid ((gid_t )gid); +return sys_setfsgid (low2highgid (gid)); }static int groups16_to_user (u16 __user *grouplist,struct group_info *group_info)
arch/x86/entry/entry_64_compat.S +30 -0
@@ -83,15 +83,25 @@ ENTRY(entry_SYSENTER_compat) pushq %rcx /* pt_regs->cx */ pushq $-ENOSYS /* pt_regs->ax */ pushq $0 /* pt_regs->r8 = 0 */ + xorq %r8, %r8 /* nospec r8 */ pushq $0 /* pt_regs->r9 = 0 */ + xorq %r9, %r9 /* nospec r9 */ pushq $0 /* pt_regs->r10 = 0 */ + xorq %r10, %r10 /* nospec r10 */ pushq $0 /* pt_regs->r11 = 0 */ + xorq %r11, %r11 /* nospec r11 */ pushq %rbx /* pt_regs->rbx */ + xorl %ebx, %ebx /* nospec rbx */ pushq %rbp /* pt_regs->rbp (will be overwritten) */ + xorl %ebp, %ebp /* nospec rbp */ pushq $0 /* pt_regs->r12 = 0 */ + xorq %r12, %r12 /* nospec r12 */ pushq $0 /* pt_regs->r13 = 0 */ + xorq %r13, %r13 /* nospec r13 */ pushq $0 /* pt_regs->r14 = 0 */ + xorq %r14, %r14 /* nospec r14 */ pushq $0 /* pt_regs->r15 = 0 */ + xorq %r15, %r15 /* nospec r15 */ cld /*
@@ -209,15 +219,25 @@ ENTRY(entry_SYSCALL_compat) pushq %rbp /* pt_regs->cx (stashed in bp) */ pushq $-ENOSYS /* pt_regs->ax */ pushq $0 /* pt_regs->r8 = 0 */ + xorq %r8, %r8 /* nospec r8 */ pushq $0 /* pt_regs->r9 = 0 */ + xorq %r9, %r9 /* nospec r9 */ pushq $0 /* pt_regs->r10 = 0 */ + xorq %r10, %r10 /* nospec r10 */ pushq $0 /* pt_regs->r11 = 0 */ + xorq %r11, %r11 /* nospec r11 */ pushq %rbx /* pt_regs->rbx */ + xorl %ebx, %ebx /* nospec rbx */ pushq %rbp /* pt_regs->rbp (will be overwritten) */ + xorl %ebp, %ebp /* nospec rbp */ pushq $0 /* pt_regs->r12 = 0 */ + xorq %r12, %r12 /* nospec r12 */ pushq $0 /* pt_regs->r13 = 0 */ + xorq %r13, %r13 /* nospec r13 */ pushq $0 /* pt_regs->r14 = 0 */ + xorq %r14, %r14 /* nospec r14 */ pushq $0 /* pt_regs->r15 = 0 */ + xorq %r15, %r15 /* nospec r15 */ /* * User mode is traced as though IRQs are on, and SYSENTER
@@ -320,15 +340,25 @@ ENTRY(entry_INT80_compat) pushq %rcx /* pt_regs->cx */ pushq $-ENOSYS /* pt_regs->ax */ pushq $0 /* pt_regs->r8 = 0 */ + xorq %r8, %r8 /* nospec r8 */ pushq $0 /* pt_regs->r9 = 0 */ + xorq %r9, %r9 /* nospec r9 */ pushq $0 /* pt_regs->r10 = 0 */ + xorq %r10, %r10 /* nospec r10 */ pushq $0 /* pt_regs->r11 = 0 */ + xorq %r11, %r11 /* nospec r11 */ pushq %rbx /* pt_regs->rbx */ + xorl %ebx, %ebx /* nospec rbx */ pushq %rbp /* pt_regs->rbp */ + xorl %ebp, %ebp /* nospec rbp */ pushq %r12 /* pt_regs->r12 */ + xorq %r12, %r12 /* nospec r12 */ pushq %r13 /* pt_regs->r13 */ + xorq %r13, %r13 /* nospec r13 */ pushq %r14 /* pt_regs->r14 */ + xorq %r14, %r14 /* nospec r14 */ pushq %r15 /* pt_regs->r15 */ + xorq %r15, %r15 /* nospec r15 */ cld /*
arch/x86/events/intel/core.c +1 -1
@@ -3363,7 +3363,7 @@ static int intel_snb_pebs_broken(int cpu)break ;case INTEL_FAM6_SANDYBRIDGE_X : -switch (cpu_data (cpu).x86_mask) { +switch (cpu_data (cpu).x86_stepping) {case 6 : rev =0x618 ;break ;case 7 : rev =0x70c ;break ; }
arch/x86/events/intel/lbr.c +1 -1
@@ -1131,7 +1131,7 @@ void __init intel_pmu_lbr_init_atom(void)* on PMU interrupt */ if (boot_cpu_data.x86_model ==28 - && boot_cpu_data.x86_mask <10 ) { + && boot_cpu_data.x86_stepping <10 ) {pr_cont ("LBR disabled due to erratum" );return ; }
arch/x86/events/intel/p6.c +1 -1
@@ -233,7 +233,7 @@ static __initconst const struct x86_pmu p6_pmu = {static __init void p6_pmu_rdpmc_quirk (void ) { -if (boot_cpu_data.x86_mask <9 ) { +if (boot_cpu_data.x86_stepping <9 ) {/* * PPro erratum 26; fixed in stepping 9 and above. */
arch/x86/include/asm/acpi.h +1 -1
@@ -92,7 +92,7 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)if (boot_cpu_data.x86 ==0x0F && boot_cpu_data.x86_vendor ==X86_VENDOR_AMD && boot_cpu_data.x86_model <=0x05 && - boot_cpu_data.x86_mask <0x0A ) + boot_cpu_data.x86_stepping <0x0A )return 1 ;else if (amd_e400_c1e_detected)return 1 ;
arch/x86/include/asm/barrier.h +1 -1
@@ -39,7 +39,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, asm ("cmp %1,%2; sbb %0,%0;" :"=r" (mask) - :"r" (size),"r" (index) + :"g" (size),"r" (index) :"cc" );return mask; }
arch/x86/include/asm/nospec-branch.h +1 -0
@@ -6,6 +6,7 @@#include <asm/alternative.h> #include <asm/alternative-asm.h> #include <asm/cpufeatures.h> +#include <asm/msr-index.h> #ifdef __ASSEMBLY__
arch/x86/include/asm/processor.h +2 -2
@@ -88,7 +88,7 @@ struct cpuinfo_x86 {__u8 x86;/* CPU family */ __u8 x86_vendor;/* CPU vendor */ __u8 x86_model; -__u8 x86_mask; +__u8 x86_stepping;#ifdef CONFIG_X86_32 char wp_works_ok;/* It doesn't on 386's */
@@ -113,7 +113,7 @@ struct cpuinfo_x86 {char x86_vendor_id[16 ];char x86_model_id[64 ];/* in KB - valid for CPUS which support this call: */ -int x86_cache_size; +unsigned int x86_cache_size;int x86_cache_alignment;/* In bytes */ /* Cache QoS architectural values: */ int x86_cache_max_rmid;/* max index */
arch/x86/kernel/amd_nb.c +1 -1
@@ -105,7 +105,7 @@ int amd_cache_northbridges(void)if (boot_cpu_data.x86 ==0x10 && boot_cpu_data.x86_model >=0x8 && (boot_cpu_data.x86_model >0x9 || - boot_cpu_data.x86_mask >=0x1 )) + boot_cpu_data.x86_stepping >=0x1 )) amd_northbridges.flags |=AMD_NB_L3_INDEX_DISABLE ;if (boot_cpu_data.x86 ==0x15 )
arch/x86/kernel/asm-offsets_32.c +1 -1
@@ -20,7 +20,7 @@ void foo(void)OFFSET (CPUINFO_x86, cpuinfo_x86, x86);OFFSET (CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);OFFSET (CPUINFO_x86_model, cpuinfo_x86, x86_model); -OFFSET (CPUINFO_x86_mask, cpuinfo_x86, x86_mask); +OFFSET (CPUINFO_x86_stepping, cpuinfo_x86, x86_stepping);OFFSET (CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);OFFSET (CPUINFO_x86_capability, cpuinfo_x86, x86_capability);OFFSET (CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
arch/x86/kernel/cpu/amd.c +13 -13
@@ -118,7 +118,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)return ; } -if (c->x86_model ==6 && c->x86_mask ==1 ) { +if (c->x86_model ==6 && c->x86_stepping ==1 ) {const int K6_BUG_LOOP =1000000 ;int n;void (*f_vide)(void );
@@ -147,7 +147,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)/* K6 with old style WHCR */ if (c->x86_model <8 || - (c->x86_model ==8 && c->x86_mask <8 )) { + (c->x86_model ==8 && c->x86_stepping <8 )) {/* We can only write allocate on the low 508Mb */ if (mbytes >508 ) mbytes =508 ;
@@ -166,7 +166,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)return ; } -if ((c->x86_model ==8 && c->x86_mask >7 ) || +if ((c->x86_model ==8 && c->x86_stepping >7 ) || c->x86_model ==9 || c->x86_model ==13 ) {/* The more serious chips .. */
@@ -219,7 +219,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c)* are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx * As per AMD technical note 27212 0.2 */ -if ((c->x86_model ==8 && c->x86_mask >=1 ) || (c->x86_model >8 )) { +if ((c->x86_model ==8 && c->x86_stepping >=1 ) || (c->x86_model >8 )) {rdmsr (MSR_K7_CLK_CTL , l, h);if ((l &0xfff00000 ) !=0x20000000 ) { pr_info("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
@@ -239,12 +239,12 @@ static void init_amd_k7(struct cpuinfo_x86 *c)* but they are not certified as MP capable. */ /* Athlon 660/661 is valid. */ -if ((c->x86_model ==6 ) && ((c->x86_mask ==0 ) || - (c->x86_mask ==1 ))) +if ((c->x86_model ==6 ) && ((c->x86_stepping ==0 ) || + (c->x86_stepping ==1 )))return ;/* Duron 670 is valid */ -if ((c->x86_model ==7 ) && (c->x86_mask ==0 )) +if ((c->x86_model ==7 ) && (c->x86_stepping ==0 ))return ;/*
@@ -254,8 +254,8 @@ static void init_amd_k7(struct cpuinfo_x86 *c)* See http://www.heise.de/newsticker/data/jow-18.10.01-000 for * more. */ -if (((c->x86_model ==6 ) && (c->x86_mask >=2 )) || - ((c->x86_model ==7 ) && (c->x86_mask >=1 )) || +if (((c->x86_model ==6 ) && (c->x86_stepping >=2 )) || + ((c->x86_model ==7 ) && (c->x86_stepping >=1 )) || (c->x86_model >7 ))if (cpu_has (c,X86_FEATURE_MP ))return ;
@@ -569,7 +569,7 @@ static void early_init_amd(struct cpuinfo_x86 *c)/* Set MTRR capability flag if appropriate */ if (c->x86 ==5 )if (c->x86_model ==13 || c->x86_model ==9 || - (c->x86_model ==8 && c->x86_mask >=8 )) + (c->x86_model ==8 && c->x86_stepping >=8 ))set_cpu_cap (c,X86_FEATURE_K6_MTRR );#endif #if defined(CONFIG_X86_LOCAL_APIC ) && defined(CONFIG_PCI )
@@ -834,11 +834,11 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)/* AMD errata T13 (order #21922) */ if ((c->x86 ==6 )) {/* Duron Rev A0 */ -if (c->x86_model ==3 && c->x86_mask ==0 ) +if (c->x86_model ==3 && c->x86_stepping ==0 ) size =64 ;/* Tbird rev A1/A2 */ if (c->x86_model ==4 && - (c->x86_mask ==0 || c->x86_mask ==1 )) + (c->x86_stepping ==0 || c->x86_stepping ==1 )) size =256 ; }return size;
@@ -975,7 +975,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) }/* OSVW unavailable or ID unknown, match family-model-stepping range */ - ms = (cpu->x86_model <<4 ) | cpu->x86_mask; + ms = (cpu->x86_model <<4 ) | cpu->x86_stepping;while ((range = *erratum++)) if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) && (ms >= AMD_MODEL_RANGE_START(range)) &&
arch/x86/kernel/cpu/bugs.c +11 -17
@@ -161,8 +161,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)if (cmdline_find_option_bool (boot_command_line,"nospectre_v2" ))return SPECTRE_V2_CMD_NONE ;else { - ret =cmdline_find_option (boot_command_line,"spectre_v2" , arg, -sizeof (arg)); + ret =cmdline_find_option (boot_command_line,"spectre_v2" , arg,sizeof (arg));if (ret <0 )return SPECTRE_V2_CMD_AUTO ;
@@ -174,8 +173,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void) }if (i >=ARRAY_SIZE (mitigation_options)) { -pr_err ("unknown option (%s). Switching to AUTO select\n" , - mitigation_options[i].option); +pr_err ("unknown option (%s). Switching to AUTO select\n" , arg);return SPECTRE_V2_CMD_AUTO ; } }
@@ -184,8 +182,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void) cmd == SPECTRE_V2_CMD_RETPOLINE_AMD || cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC) && !IS_ENABLED(CONFIG_RETPOLINE)) { -pr_err ("%s selected but not compiled in. Switching to AUTO select\n" , - mitigation_options[i].option); +pr_err ("%s selected but not compiled in. Switching to AUTO select\n" , mitigation_options[i].option);return SPECTRE_V2_CMD_AUTO ; }
@@ -255,14 +252,14 @@ static void __init spectre_v2_select_mitigation(void) goto retpoline_auto;break ; } -pr_err ("kernel not compiled with retpoline; no mitigation available!" ); +pr_err ("Spectre mitigation: kernel not compiled with retpoline; no mitigation available!" );return ; retpoline_auto:if (boot_cpu_data.x86_vendor ==X86_VENDOR_AMD ) { retpoline_amd:if (!boot_cpu_has (X86_FEATURE_LFENCE_RDTSC )) { -pr_err ("LFENCE not serializing. Switching to generic retpoline\n" ); +pr_err ("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n" ); goto retpoline_generic; } mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_AMD :
@@ -280,7 +277,7 @@ static void __init spectre_v2_select_mitigation(void)pr_info ("%s\n" , spectre_v2_strings[mode]);/* -* If neither SMEP or KPTI are available, there is a risk of +* If neither SMEP nor PTI are available, there is a risk of * hitting userspace addresses in the RSB after a context switch * from a shallow call stack to a deeper one. To prevent this fill * the entire RSB, even when using IBRS.
@@ -294,21 +291,20 @@ static void __init spectre_v2_select_mitigation(void)if ((!boot_cpu_has (X86_FEATURE_KAISER ) && !boot_cpu_has (X86_FEATURE_SMEP )) ||is_skylake_era ()) {setup_force_cpu_cap (X86_FEATURE_RSB_CTXSW ); -pr_info ("Filling RSB on context switch\n" ); +pr_info ("Spectre v2 mitigation: Filling RSB on context switch\n" ); }/* Initialize Indirect Branch Prediction Barrier if supported */ if (boot_cpu_has (X86_FEATURE_IBPB )) {setup_force_cpu_cap (X86_FEATURE_USE_IBPB ); -pr_info ("Enabling Indirect Branch Prediction Barrier\n" ); +pr_info ("Spectre v2 mitigation: Enabling Indirect Branch Prediction Barrier\n" ); } }#undef pr_fmt#ifdef CONFIG_SYSFS -ssize_t cpu_show_meltdown (struct device *dev, -struct device_attribute *attr,char *buf) +ssize_t cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) {if (!boot_cpu_has_bug (X86_BUG_CPU_MELTDOWN ))return sprintf (buf,"Not affected\n" );
@@ -317,16 +313,14 @@ ssize_t cpu_show_meltdown(struct device *dev,return sprintf (buf,"Vulnerable\n" ); } -ssize_t cpu_show_spectre_v1 (struct device *dev, -struct device_attribute *attr,char *buf) +ssize_t cpu_show_spectre_v1 (struct device *dev,struct device_attribute *attr,char *buf) {if (!boot_cpu_has_bug (X86_BUG_SPECTRE_V1 ))return sprintf (buf,"Not affected\n" );return sprintf (buf,"Mitigation: __user pointer sanitization\n" ); } -ssize_t cpu_show_spectre_v2 (struct device *dev, -struct device_attribute *attr,char *buf) +ssize_t cpu_show_spectre_v2 (struct device *dev,struct device_attribute *attr,char *buf) {if (!boot_cpu_has_bug (X86_BUG_SPECTRE_V2 ))return sprintf (buf,"Not affected\n" );
arch/x86/kernel/cpu/centaur.c +2 -2
@@ -134,7 +134,7 @@ static void init_centaur(struct cpuinfo_x86 *c)clear_cpu_cap (c,X86_FEATURE_TSC );break ;case 8 : -switch (c->x86_mask) { +switch (c->x86_stepping) {default : name ="2" ;break ;
@@ -209,7 +209,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)* - Note, it seems this may only be in engineering samples. */ if ((c->x86 ==6 ) && (c->x86_model ==9 ) && - (c->x86_mask ==1 ) && (size ==65 )) + (c->x86_stepping ==1 ) && (size ==65 )) size -=1 ;return size; }
arch/x86/kernel/cpu/common.c +5 -5
@@ -699,7 +699,7 @@ void cpu_detect(struct cpuinfo_x86 *c)cpuid (0x00000001 , &tfms, &misc, &junk, &cap0); c->x86 =x86_family (tfms); c->x86_model =x86_model (tfms); - c->x86_mask =x86_stepping (tfms); + c->x86_stepping =x86_stepping (tfms);if (cap0 & (1 <<19 )) { c->x86_clflush_size = ((misc >>8 ) &0xff ) *8 ;
@@ -1144,9 +1144,9 @@ static void identify_cpu(struct cpuinfo_x86 *c)int i; c->loops_per_jiffy = loops_per_jiffy; - c->x86_cache_size =-1 ; + c->x86_cache_size =0 ; c->x86_vendor =X86_VENDOR_UNKNOWN ; - c->x86_model = c->x86_mask =0 ;/* So far unknown... */ + c->x86_model = c->x86_stepping =0 ;/* So far unknown... */ c->x86_vendor_id[0 ] ='\0' ;/* Unset */ c->x86_model_id[0 ] ='\0' ;/* Unset */ c->x86_max_cores =1 ;
@@ -1391,8 +1391,8 @@ void print_cpu_info(struct cpuinfo_x86 *c)pr_cont (" (family: 0x%x, model: 0x%x" , c->x86, c->x86_model); -if (c->x86_mask || c->cpuid_level >=0 ) -pr_cont (", stepping: 0x%x)\n" , c->x86_mask); +if (c->x86_stepping || c->cpuid_level >=0 ) +pr_cont (", stepping: 0x%x)\n" , c->x86_stepping);else pr_cont (")\n" );
arch/x86/kernel/cpu/cyrix.c +1 -1
@@ -212,7 +212,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)/* common case step number/rev -- exceptions handled below */ c->x86_model = (dir1 >>4 ) +1 ; - c->x86_mask = dir1 &0xf ; + c->x86_stepping = dir1 &0xf ;/* Now cook; the original recipe is by Channing Corn, from Cyrix. * We do the same thing for each generation: we work out
arch/x86/kernel/cpu/intel.c +14 -17
@@ -75,14 +75,13 @@ struct sku_microcode {u32 microcode; };static const struct sku_microcode spectre_bad_microcodes[] = { - {INTEL_FAM6_KABYLAKE_DESKTOP ,0x0B ,0x84 }, - {INTEL_FAM6_KABYLAKE_DESKTOP ,0x0A ,0x84 }, - {INTEL_FAM6_KABYLAKE_DESKTOP ,0x09 ,0x84 }, - {INTEL_FAM6_KABYLAKE_MOBILE ,0x0A ,0x84 }, - {INTEL_FAM6_KABYLAKE_MOBILE ,0x09 ,0x84 }, + {INTEL_FAM6_KABYLAKE_DESKTOP ,0x0B ,0x80 }, + {INTEL_FAM6_KABYLAKE_DESKTOP ,0x0A ,0x80 }, + {INTEL_FAM6_KABYLAKE_DESKTOP ,0x09 ,0x80 }, + {INTEL_FAM6_KABYLAKE_MOBILE ,0x0A ,0x80 }, + {INTEL_FAM6_KABYLAKE_MOBILE ,0x09 ,0x80 }, {INTEL_FAM6_SKYLAKE_X ,0x03 ,0x0100013e }, {INTEL_FAM6_SKYLAKE_X ,0x04 ,0x0200003c }, - {INTEL_FAM6_SKYLAKE_MOBILE ,0x03 ,0xc2 }, {INTEL_FAM6_SKYLAKE_DESKTOP ,0x03 ,0xc2 }, {INTEL_FAM6_BROADWELL_CORE ,0x04 ,0x28 }, {INTEL_FAM6_BROADWELL_GT3E ,0x01 ,0x1b },
@@ -95,8 +94,6 @@ static const struct sku_microcode spectre_bad_microcodes[] = { { INTEL_FAM6_HASWELL_X, 0x02, 0x3b }, { INTEL_FAM6_HASWELL_X, 0x04, 0x10 }, { INTEL_FAM6_IVYBRIDGE_X, 0x04, 0x42a }, -/* Updated in the 20180108 release; blacklist until we know otherwise */ - { INTEL_FAM6_ATOM_GEMINI_LAKE, 0x01, 0x22 },/* Observed in the wild */ { INTEL_FAM6_SANDYBRIDGE_X, 0x06, 0x61b }, { INTEL_FAM6_SANDYBRIDGE_X, 0x07, 0x712 },
@@ -108,7 +105,7 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)for (i =0 ; i <ARRAY_SIZE (spectre_bad_microcodes); i++) {if (c->x86_model == spectre_bad_microcodes[i].model && - c->x86_mask == spectre_bad_microcodes[i].stepping) + c->x86_stepping == spectre_bad_microcodes[i].stepping)return (c->microcode <= spectre_bad_microcodes[i].microcode); }return false;
@@ -161,7 +158,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)* need the microcode to have already been loaded... so if it is * not, recommend a BIOS update and disable large pages. */ -if (c->x86 ==6 && c->x86_model ==0x1c && c->x86_mask <=2 && +if (c->x86 ==6 && c->x86_model ==0x1c && c->x86_stepping <=2 && c->microcode <0x20e ) {pr_warn ("Atom PSE erratum detected, BIOS microcode update recommended\n" );clear_cpu_cap (c,X86_FEATURE_PSE );
@@ -177,7 +174,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)/* CPUID workaround for 0F33/0F34 CPU */ if (c->x86 ==0xF && c->x86_model ==0x3 - && (c->x86_mask ==0x3 || c->x86_mask ==0x4 )) + && (c->x86_stepping ==0x3 || c->x86_stepping ==0x4 )) c->x86_phys_bits =36 ;/*
@@ -292,7 +289,7 @@ int ppro_with_ram_bug(void)if (boot_cpu_data.x86_vendor ==X86_VENDOR_INTEL && boot_cpu_data.x86 ==6 && boot_cpu_data.x86_model ==1 && - boot_cpu_data.x86_mask <8 ) { + boot_cpu_data.x86_stepping <8 ) {pr_info ("Pentium Pro with Errata#50 detected. Taking evasive action.\n" );return 1 ; }
@@ -309,7 +306,7 @@ static void intel_smp_check(struct cpuinfo_x86 *c)* Mask B, Pentium, but not Pentium MMX */ if (c->x86 ==5 && - c->x86_mask >=1 && c->x86_mask <=4 && + c->x86_stepping >=1 && c->x86_stepping <=4 && c->x86_model <=3 ) {/* * Remember we have B step Pentia with bugs
@@ -352,7 +349,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until * model 3 mask 3 */ -if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) <0x633 ) +if ((c->x86<<8 | c->x86_model<<4 | c->x86_stepping) <0x633 )clear_cpu_cap (c,X86_FEATURE_SEP );/*
@@ -370,7 +367,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)* P4 Xeon erratum 037 workaround. * Hardware prefetcher may cause stale data to be loaded into the cache. */ -if ((c->x86 ==15 ) && (c->x86_model ==1 ) && (c->x86_mask ==1 )) { +if ((c->x86 ==15 ) && (c->x86_model ==1 ) && (c->x86_stepping ==1 )) {if (msr_set_bit (MSR_IA32_MISC_ENABLE ,MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT ) >0 ) {pr_info ("CPU: C0 stepping P4 Xeon detected.\n" );
@@ -385,7 +382,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)* Specification Update"). */ if (boot_cpu_has (X86_FEATURE_APIC ) && (c->x86<<8 | c->x86_model<<4 ) ==0x520 && - (c->x86_mask <0x6 || c->x86_mask ==0xb )) + (c->x86_stepping <0x6 || c->x86_stepping ==0xb ))set_cpu_bug (c,X86_BUG_11AP );
@@ -604,7 +601,7 @@ static void init_intel(struct cpuinfo_x86 *c)case 6 :if (l2 ==128 ) p ="Celeron (Mendocino)" ; -else if (c->x86_mask ==0 || c->x86_mask ==5 ) +else if (c->x86_stepping ==0 || c->x86_stepping ==5 ) p ="Celeron-A" ;break ;
arch/x86/kernel/cpu/microcode/intel.c +3 -3
@@ -1062,7 +1062,7 @@ static bool is_blacklisted(unsigned int cpu)*/ if (c->x86 ==6 && c->x86_model ==INTEL_FAM6_BROADWELL_X && - c->x86_mask ==0x01 && + c->x86_stepping ==0x01 && llc_size_per_core >2621440 && c->microcode <0x0b000021 ) {pr_err_once ("Erratum BDF90: late loading with revision < 0x0b000021 (0x%x) disabled.\n" , c->microcode);
@@ -1085,7 +1085,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,return UCODE_NFOUND ;sprintf (name,"intel-ucode/%02x-%02x-%02x" , - c->x86, c->x86_model, c->x86_mask); + c->x86, c->x86_model, c->x86_stepping);if (request_firmware_direct (&firmware, name, device)) {pr_debug ("data file %s load failed\n" , name);
@@ -1132,7 +1132,7 @@ static struct microcode_ops microcode_intel_ops = {static int __init calc_llc_size_per_core (struct cpuinfo_x86 *c) { -u64 llc_size = c->x86_cache_size *1024 ; +u64 llc_size = c->x86_cache_size *1024ULL ;do_div (llc_size, c->x86_max_cores);
arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -859,7 +859,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size,*/ if (is_cpu (INTEL ) && boot_cpu_data.x86 ==6 && boot_cpu_data.x86_model ==1 && - boot_cpu_data.x86_mask <=7 ) { + boot_cpu_data.x86_stepping <=7 ) {if (base & ((1 << (22 -PAGE_SHIFT )) -1 )) {pr_warn ("mtrr: base(0x%lx000) is not 4 MiB aligned\n" , base);return -EINVAL ;
arch/x86/kernel/cpu/mtrr/main.c +2 -2
@@ -699,8 +699,8 @@ void __init mtrr_bp_init(void)if (boot_cpu_data.x86_vendor ==X86_VENDOR_INTEL && boot_cpu_data.x86 ==0xF && boot_cpu_data.x86_model ==0x3 && - (boot_cpu_data.x86_mask ==0x3 || - boot_cpu_data.x86_mask ==0x4 )) + (boot_cpu_data.x86_stepping ==0x3 || + boot_cpu_data.x86_stepping ==0x4 )) phys_addr =36 ; size_or_mask =SIZE_OR_MASK_BITS (phys_addr);
arch/x86/kernel/cpu/proc.c +4 -4
@@ -70,8 +70,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) c->x86_model, c->x86_model_id[0] ? c->x86_model_id : "unknown"); -if (c->x86_mask || c->cpuid_level >=0 ) -seq_printf (m,"stepping\t: %d\n" , c->x86_mask); +if (c->x86_stepping || c->cpuid_level >=0 ) +seq_printf (m,"stepping\t: %d\n" , c->x86_stepping);else seq_puts (m,"stepping\t: unknown\n" );if (c->microcode)
@@ -87,8 +87,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) }/* Cache size */ -if (c->x86_cache_size >=0 ) -seq_printf (m,"cache size\t: %d KB\n" , c->x86_cache_size); +if (c->x86_cache_size) +seq_printf (m,"cache size\t: %u KB\n" , c->x86_cache_size);show_cpuinfo_core (m, c, cpu);show_cpuinfo_misc (m, c);
arch/x86/kernel/head_32.S +2 -2
@@ -35,7 +35,7 @@ #define X86 new_cpu_data+CPUINFO_x86 #define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor #define X86_MODEL new_cpu_data+CPUINFO_x86_model -#define X86_MASK new_cpu_data+CPUINFO_x86_mask +#define X86_STEPPING new_cpu_data+CPUINFO_x86_stepping #define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math #define X86_CPUID new_cpu_data+CPUINFO_cpuid_level #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
@@ -441,7 +441,7 @@ enable_paging: shrb $4,%al movb %al,X86_MODEL andb $0x0f,%cl # mask mask revision - movb %cl,X86_MASK + movb %cl,X86_STEPPING movl %edx,X86_CAPABILITY is486:
arch/x86/kernel/mpparse.c +1 -1
@@ -406,7 +406,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) processor.apicver = mpc_default_type >4 ?0x10 :0x01 ; processor.cpuflag =CPU_ENABLED ; processor.cpufeature = (boot_cpu_data.x86 <<8 ) | - (boot_cpu_data.x86_model <<4 ) | boot_cpu_data.x86_mask; + (boot_cpu_data.x86_model <<4 ) | boot_cpu_data.x86_stepping; processor.featureflag = boot_cpu_data.x86_capability[CPUID_1_EDX ]; processor.reserved[0 ] =0 ; processor.reserved[1 ] =0 ;
arch/x86/kvm/mmu.c +5 -5
@@ -4640,7 +4640,7 @@ void kvm_mmu_uninit_vm(struct kvm *kvm)typedef bool (*slot_level_handler ) (struct kvm *kvm,struct kvm_rmap_head *rmap_head);/* The caller should hold mmu-lock before calling this function. */ -static bool +static __always_inline boolslot_handle_level_range (struct kvm *kvm,struct kvm_memory_slot *memslot,slot_level_handler fn,int start_level,int end_level,gfn_t start_gfn,gfn_t end_gfn,bool lock_flush_tlb)
@@ -4670,7 +4670,7 @@ slot_handle_level_range(struct kvm *kvm, struct kvm_memory_slot *memslot,return flush; } -static bool +static __always_inline boolslot_handle_level (struct kvm *kvm,struct kvm_memory_slot *memslot,slot_level_handler fn,int start_level,int end_level,bool lock_flush_tlb)
@@ -4681,7 +4681,7 @@ slot_handle_level(struct kvm *kvm, struct kvm_memory_slot *memslot, lock_flush_tlb); } -static bool +static __always_inline boolslot_handle_all_level (struct kvm *kvm,struct kvm_memory_slot *memslot,slot_level_handler fn,bool lock_flush_tlb) {
@@ -4689,7 +4689,7 @@ slot_handle_all_level(struct kvm *kvm, struct kvm_memory_slot *memslot, PT_MAX_HUGEPAGE_LEVEL, lock_flush_tlb); } -static bool +static __always_inline boolslot_handle_large_level (struct kvm *kvm,struct kvm_memory_slot *memslot,slot_level_handler fn,bool lock_flush_tlb) {
@@ -4697,7 +4697,7 @@ slot_handle_large_level(struct kvm *kvm, struct kvm_memory_slot *memslot, PT_MAX_HUGEPAGE_LEVEL, lock_flush_tlb); } -static bool +static __always_inline boolslot_handle_leaf (struct kvm *kvm,struct kvm_memory_slot *memslot,slot_level_handler fn,bool lock_flush_tlb) {
arch/x86/kvm/vmx.c +2 -2
@@ -9606,8 +9606,8 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu,* updated to reflect this when L1 (or its L2s) actually write to * the MSR. */ -bool pred_cmd =msr_write_intercepted_l01 (vcpu,MSR_IA32_PRED_CMD ); -bool spec_ctrl =msr_write_intercepted_l01 (vcpu,MSR_IA32_SPEC_CTRL ); +bool pred_cmd = !msr_write_intercepted_l01 (vcpu,MSR_IA32_PRED_CMD ); +bool spec_ctrl = !msr_write_intercepted_l01 (vcpu,MSR_IA32_SPEC_CTRL );if (!nested_cpu_has_virt_x2apic_mode (vmcs12) && !pred_cmd && !spec_ctrl)
arch/x86/lib/cpu.c +1 -1
@@ -18,7 +18,7 @@ unsigned int x86_model(unsigned int sig) {unsigned int fam, model; - fam =x86_family (sig); + fam =x86_family (sig); model = (sig >>4 ) &0xf ;
drivers/char/hw_random/via-rng.c +1 -1
@@ -166,7 +166,7 @@ static int via_rng_init(struct hwrng *rng)/* Enable secondary noise source on CPUs where it is present. */ /* Nehemiah stepping 8 and higher */ -if ((c->x86_model ==9 ) && (c->x86_mask >7 )) +if ((c->x86_model ==9 ) && (c->x86_stepping >7 )) lo |=VIA_NOISESRC2 ;/* Esther */
drivers/cpufreq/acpi-cpufreq.c +1 -1
@@ -648,7 +648,7 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)if (c->x86_vendor ==X86_VENDOR_INTEL ) {if ((c->x86 ==15 ) && (c->x86_model ==6 ) && - (c->x86_mask ==8 )) { + (c->x86_stepping ==8 )) {pr_info ("Intel(R) Xeon(R) 7100 Errata AL30, processors may lock up on frequency changes: disabling acpi-cpufreq\n" );return -ENODEV ; }
drivers/cpufreq/longhaul.c +3 -3
@@ -775,7 +775,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)break ;case 7 : -switch (c->x86_mask) { +switch (c->x86_stepping) {case 0 : longhaul_version =TYPE_LONGHAUL_V1 ; cpu_model =CPU_SAMUEL2 ;
@@ -787,7 +787,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)break ; case 1 ... 15: longhaul_version =TYPE_LONGHAUL_V2 ; -if (c->x86_mask <8 ) { +if (c->x86_stepping <8 ) { cpu_model =CPU_SAMUEL2 ; cpuname ="C3 'Samuel 2' [C5B]" ; }else {
@@ -814,7 +814,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) numscales =32 ;memcpy (mults, nehemiah_mults,sizeof (nehemiah_mults));memcpy (eblcr, nehemiah_eblcr,sizeof (nehemiah_eblcr)); -switch (c->x86_mask) { +switch (c->x86_stepping) { case 0 ... 1: cpu_model =CPU_NEHEMIAH ; cpuname ="C3 'Nehemiah A' [C5XLOE]" ;
drivers/cpufreq/p4-clockmod.c +1 -1
@@ -168,7 +168,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)#endif /* Errata workaround */ - cpuid = (c->x86 <<8 ) | (c->x86_model <<4 ) | c->x86_mask; + cpuid = (c->x86 <<8 ) | (c->x86_model <<4 ) | c->x86_stepping;switch (cpuid) {case 0x0f07 :case 0x0f0a :
drivers/cpufreq/powernow-k7.c +1 -1
@@ -131,7 +131,7 @@ static int check_powernow(void)return 0 ; } -if ((c->x86_model ==6 ) && (c->x86_mask ==0 )) { +if ((c->x86_model ==6 ) && (c->x86_stepping ==0 )) {pr_info ("K7 660[A0] core detected, enabling errata workarounds\n" ); have_a0 =1 ; }
drivers/cpufreq/powernv-cpufreq.c +2 -2
@@ -260,9 +260,9 @@ static int init_powernv_pstates(void)if (id == pstate_max) powernv_pstate_info.max = i; -else if (id == pstate_nominal) +if (id == pstate_nominal) powernv_pstate_info.nominal = i; -else if (id == pstate_min) +if (id == pstate_min) powernv_pstate_info.min = i; }
drivers/cpufreq/speedstep-centrino.c +2 -2
@@ -37,7 +37,7 @@ struct cpu_id {__u8 x86;/* CPU family */ __u8 x86_model;/* model */ -__u8 x86_mask;/* stepping */ +__u8 x86_stepping;/* stepping */ };enum {
@@ -277,7 +277,7 @@ static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c, {if ((c->x86 == x->x86) && (c->x86_model == x->x86_model) && - (c->x86_mask == x->x86_mask)) + (c->x86_stepping == x->x86_stepping))return 1 ;return 0 ; }
drivers/cpufreq/speedstep-lib.c +3 -3
@@ -272,9 +272,9 @@ unsigned int speedstep_detect_processor(void) ebx =cpuid_ebx (0x00000001 ); ebx &=0x000000FF ; -pr_debug ("ebx value is %x, x86_mask is %x\n" , ebx, c->x86_mask); +pr_debug ("ebx value is %x, x86_stepping is %x\n" , ebx, c->x86_stepping); -switch (c->x86_mask) { +switch (c->x86_stepping) {case 4 :/* * B-stepping [M-P4-M]
@@ -361,7 +361,7 @@ unsigned int speedstep_detect_processor(void) msr_lo, msr_hi);if ((msr_hi & (1 <<18 )) && (relaxed_check ?1 : (msr_hi & (3 <<24 )))) { -if (c->x86_mask ==0x01 ) { +if (c->x86_stepping ==0x01 ) {pr_debug ("early PIII version\n" );return SPEEDSTEP_CPU_PIII_C_EARLY ; }else
drivers/crypto/padlock-aes.c +1 -1
@@ -531,7 +531,7 @@ static int __init padlock_init(void) printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n"); -if (c->x86 ==6 && c->x86_model ==15 && c->x86_mask ==2 ) { +if (c->x86 ==6 && c->x86_model ==15 && c->x86_stepping ==2 ) { ecb_fetch_blocks =MAX_ECB_FETCH_BLOCKS ; cbc_fetch_blocks =MAX_CBC_FETCH_BLOCKS ; printk(KERN_NOTICE PFX "VIA Nano stepping 2 detected: enabling workaround.\n");
drivers/devfreq/devfreq.c +1 -1
@@ -684,7 +684,7 @@ struct devfreq *devm_devfreq_add_device(struct device *dev, devfreq =devfreq_add_device (dev, profile, governor_name, data);if (IS_ERR (devfreq)) {devres_free (ptr); -return ERR_PTR (-ENOMEM ); +return devfreq; } *ptr = devfreq;
drivers/edac/amd64_edac.c +1 -1
@@ -2719,7 +2719,7 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)struct amd64_family_type *fam_type =NULL ; pvt->ext_model = boot_cpu_data.x86_model >>4 ; - pvt->stepping = boot_cpu_data.x86_mask; + pvt->stepping = boot_cpu_data.x86_stepping; pvt->model = boot_cpu_data.x86_model; pvt->fam = boot_cpu_data.x86;
drivers/edac/mce_amd.c +1 -1
@@ -948,7 +948,7 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) pr_emerg(HW_ERR "CPU:%d (%x:%x:%x) MC%d_STATUS[%s|%s|%s|%s|%s", m->extcpu, - c->x86, c->x86_model, c->x86_mask, + c->x86, c->x86_model, c->x86_stepping, m->bank, ((m->status & MCI_STATUS_OVER) ? "Over" : "-"), ((m->status & MCI_STATUS_UC) ? "UE" :
drivers/gpu/drm/radeon/radeon_uvd.c +1 -1
@@ -995,7 +995,7 @@ int radeon_uvd_calc_upll_dividers(struct radeon_device *rdev,/* calc dclk divider with current vco freq */ dclk_div =radeon_uvd_calc_upll_post_div (vco_freq, dclk, pd_min, pd_even); -if (vclk_div > pd_max) +if (dclk_div > pd_max)break ;/* vco is too big, it has to stop */ /* calc score with current vco freq */
drivers/gpu/drm/radeon/si_dpm.c +5 -0
@@ -3029,6 +3029,11 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, max_sclk =75000 ; max_mclk =80000 ; } +if ((rdev->pdev->revision ==0xC3 ) || + (rdev->pdev->device ==0x6665 )) { + max_sclk =60000 ; + max_mclk =80000 ; + } }else if (rdev->family ==CHIP_OLAND ) { if ((rdev->pdev->revision == 0xC7) || (rdev->pdev->revision == 0x80) ||
drivers/hwmon/coretemp.c +3 -3
@@ -269,13 +269,13 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)for (i =0 ; i <ARRAY_SIZE (tjmax_model_table); i++) {const struct tjmax_model *tm = &tjmax_model_table[i];if (c->x86_model == tm->model && - (tm->mask ==ANY || c->x86_mask == tm->mask)) + (tm->mask ==ANY || c->x86_stepping == tm->mask))return tm->tjmax; }/* Early chips have no MSR for TjMax */ -if (c->x86_model ==0xf && c->x86_mask <4 ) +if (c->x86_model ==0xf && c->x86_stepping <4 ) usemsr_ee =0 ;if (c->x86_model >0xe && usemsr_ee) {
@@ -426,7 +426,7 @@ static int chk_ucode_version(unsigned int cpu)* Readings might stop update when processor visited too deep sleep, * fixed for stepping D0 (6EC). */ -if (c->x86_model ==0xe && c->x86_mask <0xc && c->microcode <0x39 ) { +if (c->x86_model ==0xe && c->x86_stepping <0xc && c->microcode <0x39 ) {pr_err ("Errata AE18 not fixed, update BIOS or microcode of the CPU!\n" );return -ENODEV ; }
drivers/hwmon/hwmon-vid.c +1 -1
@@ -293,7 +293,7 @@ u8 vid_which_vrm(void)if (c->x86 <6 )/* Any CPU with family lower than 6 */ return 0 ;/* doesn't have VID */ - vrm_ret =find_vrm (c->x86, c->x86_model, c->x86_mask, c->x86_vendor); + vrm_ret =find_vrm (c->x86, c->x86_model, c->x86_stepping, c->x86_vendor);if (vrm_ret ==134 ) vrm_ret =get_via_model_d_vrm ();if (vrm_ret ==0 )
drivers/hwmon/k10temp.c +1 -1
@@ -179,7 +179,7 @@ static bool has_erratum_319(struct pci_dev *pdev)* and AM3 formats, but that's the best we can do. */ return boot_cpu_data.x86_model <4 || - (boot_cpu_data.x86_model ==4 && boot_cpu_data.x86_mask <=2 ); + (boot_cpu_data.x86_model ==4 && boot_cpu_data.x86_stepping <=2 ); } static int k10temp_probe(struct pci_dev *pdev,
drivers/hwmon/k8temp.c +1 -1
@@ -187,7 +187,7 @@ static int k8temp_probe(struct pci_dev *pdev,return -ENOMEM ; model = boot_cpu_data.x86_model; - stepping = boot_cpu_data.x86_mask; + stepping = boot_cpu_data.x86_stepping;/* feature available since SH-C0, exclude older revisions */ if ((model == 4 && stepping == 0) ||
drivers/infiniband/hw/mlx4/main.c +5 -8
@@ -2928,9 +2928,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)kfree (ibdev->ib_uc_qpns_bitmap); err_steer_qp_release: -if (ibdev->steering_support ==MLX4_STEERING_MODE_DEVICE_MANAGED ) -mlx4_qp_release_range (dev, ibdev->steer_qpn_base, - ibdev->steer_qpn_count); +mlx4_qp_release_range (dev, ibdev->steer_qpn_base, + ibdev->steer_qpn_count); err_counter:for (i =0 ; i < ibdev->num_ports; ++i)mlx4_ib_delete_counters_table (ibdev, &ibdev->counters_table[i]);
@@ -3035,11 +3034,9 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr) ibdev->iboe.nb.notifier_call =NULL ; } -if (ibdev->steering_support ==MLX4_STEERING_MODE_DEVICE_MANAGED ) { -mlx4_qp_release_range (dev, ibdev->steer_qpn_base, - ibdev->steer_qpn_count); -kfree (ibdev->ib_uc_qpns_bitmap); - } +mlx4_qp_release_range (dev, ibdev->steer_qpn_base, + ibdev->steer_qpn_count); +kfree (ibdev->ib_uc_qpns_bitmap);iounmap (ibdev->uar_map);for (p =0 ; p < ibdev->num_ports; ++p)
drivers/infiniband/hw/qib/qib_rc.c +3 -3
@@ -443,13 +443,13 @@ int qib_make_rc_req(struct rvt_qp *qp, unsigned long *flags) qp->s_state =OP (COMPARE_SWAP );put_ib_ateth_swap (wqe->atomic_wr.swap, &ohdr->u.atomic_eth); -put_ib_ateth_swap (wqe->atomic_wr.compare_add, - &ohdr->u.atomic_eth); +put_ib_ateth_compare (wqe->atomic_wr.compare_add, + &ohdr->u.atomic_eth); }else { qp->s_state =OP (FETCH_ADD );put_ib_ateth_swap (wqe->atomic_wr.compare_add, &ohdr->u.atomic_eth); -put_ib_ateth_swap (0 , &ohdr->u.atomic_eth); +put_ib_ateth_compare (0 , &ohdr->u.atomic_eth); }put_ib_ateth_vaddr (wqe->atomic_wr.remote_addr, &ohdr->u.atomic_eth);
drivers/infiniband/sw/rxe/rxe_verbs.c +2 -0
@@ -848,6 +848,8 @@ static int rxe_post_send_kernel(struct rxe_qp *qp, struct ib_send_wr *wr, (queue_count (qp->sq.queue) >1 );rxe_run_task (&qp->req.task, must_sched); +if (unlikely (qp->req.state ==QP_STATE_ERROR )) +rxe_run_task (&qp->comp.task,1 );return err; }
drivers/md/dm.c +2 -1
@@ -809,7 +809,8 @@ static void dec_pending(struct dm_io *io, int error) }else {/* done with normal IO or empty flush */ trace_block_bio_complete (md->queue, bio, io_error); - bio->bi_error = io_error; +if (io_error) + bio->bi_error = io_error;bio_endio (bio); } }
drivers/media/tuners/r820t.c +8 -5
@@ -396,9 +396,11 @@ static int r820t_write(struct r820t_priv *priv, u8 reg, const u8 *val,return 0 ; } -static int r820t_write_reg (struct r820t_priv *priv,u8 reg,u8 val) +static inline int r820t_write_reg (struct r820t_priv *priv,u8 reg,u8 val) { -return r820t_write (priv, reg, &val,1 ); +u8 tmp = val;/* work around GCC PR81715 with asan-stack=1 */ + +return r820t_write (priv, reg, &tmp,1 ); }static int r820t_read_cache_reg (struct r820t_priv *priv,int reg)
@@ -411,17 +413,18 @@ static int r820t_read_cache_reg(struct r820t_priv *priv, int reg)return -EINVAL ; } -static int r820t_write_reg_mask (struct r820t_priv *priv,u8 reg,u8 val, +static inline int r820t_write_reg_mask (struct r820t_priv *priv,u8 reg,u8 val,u8 bit_mask) { +u8 tmp = val;int rc =r820t_read_cache_reg (priv, reg);if (rc <0 )return rc; - val = (rc & ~bit_mask) | (val & bit_mask); + tmp = (rc & ~bit_mask) | (tmp & bit_mask); -return r820t_write (priv, reg, &val,1 ); +return r820t_write (priv, reg, &tmp,1 ); }static int r820t_read (struct r820t_priv *priv,u8 reg,u8 *val,int len)
drivers/mtd/nand/vf610_nfc.c +2 -4
@@ -752,10 +752,8 @@ static int vf610_nfc_probe(struct platform_device *pdev)if (mtd->oobsize >64 ) mtd->oobsize =64 ; -/* -* mtd->ecclayout is not specified here because we're using the -* default large page ECC layout defined in NAND core. -*/ +/* Use default large page ECC layout defined in NAND core */ +mtd_set_ooblayout (mtd, &nand_ooblayout_lp_ops);if (chip->ecc.strength ==32 ) { nfc->ecc_mode =ECC_60_BYTE ; chip->ecc.bytes =60 ;
drivers/net/ethernet/marvell/mvpp2.c +8 -3
@@ -5657,6 +5657,7 @@ static void mvpp2_set_rx_mode(struct net_device *dev)int id = port->id;bool allmulti = dev->flags &IFF_ALLMULTI ; +retry:mvpp2_prs_mac_promisc_set (priv, id, dev->flags &IFF_PROMISC );mvpp2_prs_mac_multi_set (priv, id,MVPP2_PE_MAC_MC_ALL , allmulti);mvpp2_prs_mac_multi_set (priv, id,MVPP2_PE_MAC_MC_IP6 , allmulti);
@@ -5664,9 +5665,13 @@ static void mvpp2_set_rx_mode(struct net_device *dev)/* Remove all port->id's mcast enries */ mvpp2_prs_mcast_del_all (priv, id); -if (allmulti && !netdev_mc_empty (dev)) { -netdev_for_each_mc_addr (ha, dev) -mvpp2_prs_mac_da_accept (priv, id, ha->addr, true); +if (!allmulti) { +netdev_for_each_mc_addr (ha, dev) { +if (mvpp2_prs_mac_da_accept (priv, id, ha->addr, true)) { + allmulti = true; + goto retry; + } + } } }
drivers/net/ethernet/mellanox/mlx4/qp.c +3 -0
@@ -286,6 +286,9 @@ void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt)u64 in_param =0 ;int err; +if (!cnt) +return ; +if (mlx4_is_mfunc (dev)) {set_param_l (&in_param, base_qpn);set_param_h (&in_param, cnt);
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +3 -2
@@ -1128,7 +1128,7 @@ static u8 _rtl8821ae_dbi_read(struct rtl_priv *rtlpriv, u16 addr) }if (0 == tmp) { read_addr =REG_DBI_RDATA + addr %4 ; - ret =rtl_read_word (rtlpriv, read_addr); + ret =rtl_read_byte (rtlpriv, read_addr); }return ret; }
@@ -1170,7 +1170,8 @@ static void _rtl8821ae_enable_aspm_back_door(struct ieee80211_hw *hw) } tmp =_rtl8821ae_dbi_read (rtlpriv,0x70f ); -_rtl8821ae_dbi_write (rtlpriv,0x70f , tmp |BIT (7 )); +_rtl8821ae_dbi_write (rtlpriv,0x70f , tmp |BIT (7 ) | +ASPM_L1_LATENCY <<3 ); tmp =_rtl8821ae_dbi_read (rtlpriv,0x719 );_rtl8821ae_dbi_write (rtlpriv,0x719 , tmp |BIT (3 ) |BIT (4 ));
drivers/net/wireless/realtek/rtlwifi/wifi.h +1 -0
@@ -99,6 +99,7 @@#define RTL_USB_MAX_RX_COUNT 100#define QBSS_LOAD_SIZE 5#define MAX_WMMELE_LENGTH 64 +#define ASPM_L1_LATENCY 7#define TOTAL_CAM_ENTRY 32
drivers/pci/host/pci-keystone.c +4 -1
@@ -181,7 +181,7 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie, }/* interrupt controller is in a child node */ - *np_temp =of_find_node_by_name (np_pcie, controller); + *np_temp =of_get_child_by_name (np_pcie, controller);if (!(*np_temp)) {dev_err (dev,"Node for %s is absent\n" , controller);return -EINVAL ;
@@ -190,6 +190,7 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie, temp =of_irq_count (*np_temp);if (!temp) {dev_err (dev,"No IRQ entries in %s\n" , controller); +of_node_put (*np_temp);return -EINVAL ; }
@@ -207,6 +208,8 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie,break ; } +of_node_put (*np_temp); +if (temp) { *num_irqs = temp;return 0 ;
drivers/rtc/rtc-opal.c +10 -2
@@ -58,6 +58,7 @@ static void tm_to_opal(struct rtc_time *tm, u32 *y_m_d, u64 *h_m_s_ms)static int opal_get_rtc_time (struct device *dev,struct rtc_time *tm) {long rc =OPAL_BUSY ; +int retries =10 ;u32 y_m_d;u64 h_m_s_ms;__be32 __y_m_d;
@@ -67,8 +68,11 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm) rc =opal_rtc_read (&__y_m_d, &__h_m_s_ms);if (rc ==OPAL_BUSY_EVENT )opal_poll_events (NULL ); -else +else if (retries-- && (rc ==OPAL_HARDWARE + || rc ==OPAL_INTERNAL_ERROR ))msleep (10 ); +else if (rc !=OPAL_BUSY && rc !=OPAL_BUSY_EVENT ) +break ; }if (rc !=OPAL_SUCCESS )
@@ -84,6 +88,7 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm)static int opal_set_rtc_time (struct device *dev,struct rtc_time *tm) {long rc =OPAL_BUSY ; +int retries =10 ;u32 y_m_d =0 ;u64 h_m_s_ms =0 ;
@@ -92,8 +97,11 @@ static int opal_set_rtc_time(struct device *dev, struct rtc_time *tm) rc =opal_rtc_write (y_m_d, h_m_s_ms);if (rc ==OPAL_BUSY_EVENT )opal_poll_events (NULL ); -else +else if (retries-- && (rc ==OPAL_HARDWARE + || rc ==OPAL_INTERNAL_ERROR ))msleep (10 ); +else if (rc !=OPAL_BUSY && rc !=OPAL_BUSY_EVENT ) +break ; }return rc ==OPAL_SUCCESS ?0 : -EIO ;
drivers/scsi/smartpqi/Makefile +1 -1
@@ -1,3 +1,3 @@ ccflags-y += -I. -obj-m += smartpqi.o +obj-$(CONFIG_SCSI_SMARTPQI) += smartpqi.o smartpqi-objs := smartpqi_init.o smartpqi_sis.o smartpqi_sas_transport.o
drivers/target/iscsi/iscsi_target_auth.c +2 -1
@@ -413,7 +413,8 @@ static int chap_server_compute_md5( auth_ret =0 ; out:kzfree (desc); -crypto_free_shash (tfm); +if (tfm) +crypto_free_shash (tfm);kfree (challenge);kfree (challenge_binhex);return auth_ret;
drivers/usb/Kconfig +8 -0
@@ -19,6 +19,14 @@ config USB_EHCI_BIG_ENDIAN_MMIO config USB_EHCI_BIG_ENDIAN_DESC bool +config USB_UHCI_BIG_ENDIAN_MMIO + bool + default y if SPARC_LEON + +config USB_UHCI_BIG_ENDIAN_DESC + bool + default y if SPARC_LEON + menuconfig USB_SUPPORT bool "USB support" depends on HAS_IOMEM
drivers/usb/host/Kconfig +0 -8
@@ -628,14 +628,6 @@ config USB_UHCI_PLATFORM bool default y if ARCH_VT8500 -config USB_UHCI_BIG_ENDIAN_MMIO - bool - default y if SPARC_LEON - -config USB_UHCI_BIG_ENDIAN_DESC - bool - default y if SPARC_LEON - config USB_FHCI_HCD tristate "Freescale QE USB Host Controller support" depends on OF_GPIO && QE_GPIO && QUICC_ENGINE
drivers/video/console/dummycon.c +0 -1
@@ -67,7 +67,6 @@ const struct consw dummy_con = { .con_switch = DUMMY, .con_blank = DUMMY, .con_font_set = DUMMY, - .con_font_get = DUMMY, .con_font_default = DUMMY, .con_font_copy = DUMMY, };
drivers/video/fbdev/atmel_lcdfb.c +7 -1
@@ -1119,7 +1119,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) goto put_display_node; } - timings_np =of_find_node_by_name (display_np,"display-timings" ); + timings_np =of_get_child_by_name (display_np,"display-timings" );if (!timings_np) {dev_err (dev,"failed to find display-timings node\n" ); ret = -ENODEV ;
@@ -1140,6 +1140,12 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)fb_add_videomode (&fb_vm, &info->modelist); } +/* +* FIXME: Make sure we are not referencing any fields in display_np +* and timings_np and drop our references to them before returning to +* avoid leaking the nodes on probe deferral and driver unbind. +*/ +return 0 ; put_timings_node:
drivers/video/fbdev/geode/video_gx.c +1 -1
@@ -127,7 +127,7 @@ void gx_set_dclk_frequency(struct fb_info *info)int timeout =1000 ;/* Rev. 1 Geode GXs use a 14 MHz reference clock instead of 48 MHz. */ -if (cpu_data (0 ).x86_mask ==1 ) { +if (cpu_data (0 ).x86_stepping ==1 ) { pll_table = gx_pll_table_14MHz; pll_table_len =ARRAY_SIZE (gx_pll_table_14MHz); }else {
fs/btrfs/inode.c +5 -2
@@ -1320,8 +1320,11 @@ static noinline int run_delalloc_nocow(struct inode *inode, leaf = path->nodes[0 ];if (path->slots[0 ] >=btrfs_header_nritems (leaf)) { ret =btrfs_next_leaf (root, path); -if (ret <0 ) +if (ret <0 ) { +if (cow_start != (u64)-1 ) + cur_offset = cow_start; goto error; + }if (ret >0 )break ; leaf = path->nodes[0 ];
@@ -5226,7 +5229,7 @@ void btrfs_evict_inode(struct inode *inode)trace_btrfs_inode_evict (inode);if (!root) { -kmem_cache_free (btrfs_inode_cachep,BTRFS_I (inode)); +clear_inode (inode);return ; }
fs/btrfs/tree-log.c +30 -2
@@ -28,6 +28,7 @@#include "hash.h" #include "compression.h" #include "qgroup.h" +#include "inode-map.h" /* magic values for the inode_only field in btrfs_log_inode: *
@@ -2463,6 +2464,9 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, next);btrfs_wait_tree_block_writeback (next);btrfs_tree_unlock (next); + }else { +if (test_and_clear_bit (EXTENT_BUFFER_DIRTY , &next->bflags)) +clear_extent_buffer_dirty (next); } WARN_ON(root_owner !=
@@ -2542,6 +2546,9 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans, next);btrfs_wait_tree_block_writeback (next);btrfs_tree_unlock (next); + }else { +if (test_and_clear_bit (EXTENT_BUFFER_DIRTY , &next->bflags)) +clear_extent_buffer_dirty (next); }WARN_ON (root_owner !=BTRFS_TREE_LOG_OBJECTID );
@@ -2618,6 +2625,9 @@ static int walk_log_tree(struct btrfs_trans_handle *trans,clean_tree_block (trans, log->fs_info, next);btrfs_wait_tree_block_writeback (next);btrfs_tree_unlock (next); + }else { +if (test_and_clear_bit (EXTENT_BUFFER_DIRTY , &next->bflags)) +clear_extent_buffer_dirty (next); } WARN_ON(log->root_key.objectid !=
@@ -3004,13 +3014,14 @@ static void free_log_tree(struct btrfs_trans_handle *trans,while (1 ) { ret =find_first_extent_bit (&log->dirty_log_pages, -0 , &start, &end,EXTENT_DIRTY |EXTENT_NEW , +0 , &start, &end, +EXTENT_DIRTY |EXTENT_NEW |EXTENT_NEED_WAIT ,NULL );if (ret)break ;clear_extent_bits (&log->dirty_log_pages, start, end, -EXTENT_DIRTY |EXTENT_NEW ); +EXTENT_DIRTY |EXTENT_NEW |EXTENT_NEED_WAIT ); }/*
@@ -5651,6 +5662,23 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) path); } +if (!ret && wc.stage ==LOG_WALK_REPLAY_ALL ) { +struct btrfs_root *root = wc.replay_dest; + +btrfs_release_path (path); + +/* +* We have just replayed everything, and the highest +* objectid of fs roots probably has changed in case +* some inode_item's got replayed. +* +* root->objectid_mutex is not acquired as log replay +* could only happen during mount. +*/ + ret =btrfs_find_highest_objectid (root, + &root->highest_objectid); + } + key.offset = found_key.offset -1 ; wc.replay_dest->log_root =NULL ;free_extent_buffer (log->node);
fs/ext4/inode.c +12 -4
@@ -3526,10 +3526,18 @@ static ssize_t ext4_direct_IO_write(struct kiocb *iocb, struct iov_iter *iter)/* Credits for sb + inode write */ handle =ext4_journal_start (inode,EXT4_HT_INODE ,2 );if (IS_ERR (handle)) { -/* This is really bad luck. We've written the data -* but cannot extend i_size. Bail out and pretend -* the write failed... */ - ret =PTR_ERR (handle); +/* +* We wrote the data but cannot extend +* i_size. Bail out. In async io case, we do +* not return error here because we have +* already submmitted the corresponding +* bio. Returning error here makes the caller +* think that this IO is done and failed +* resulting in race with bio's completion +* handler. +*/ +if (!ret) + ret =PTR_ERR (handle);if (inode->i_nlink)ext4_orphan_del (NULL , inode);
fs/ext4/super.c +1 -0
@@ -720,6 +720,7 @@ __acquires(bitlock) }ext4_unlock_group (sb, grp); +ext4_commit_super (sb,1 );ext4_handle_error (sb);/* * We only get here in the ERRORS_RO case; relocking the group
fs/jbd2/transaction.c +4 -1
@@ -488,8 +488,10 @@ void jbd2_journal_free_reserved(handle_t *handle)EXPORT_SYMBOL (jbd2_journal_free_reserved);/** -* int jbd2_journal_start_reserved(handle_t *handle) - start reserved handle +* int jbd2_journal_start_reserved() - start reserved handle * @handle: handle to start +* @type: for handle statistics +* @line_no: for handle statistics * * Start handle that has been previously reserved with jbd2_journal_reserve(). * This attaches @handle to the running transaction (or creates one if there's
@@ -619,6 +621,7 @@ int jbd2_journal_extend(handle_t *handle, int nblocks)* int jbd2_journal_restart() - restart a handle . * @handle: handle to restart * @nblocks: nr credits requested +* @gfp_mask: memory allocation flags (for start_this_handle) * * Restart a handle for a multi-transaction filesystem * operation.
fs/mbcache.c +1 -0
@@ -93,6 +93,7 @@ int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, u32 key, entry->e_key = key; entry->e_block = block; entry->e_reusable = reusable; + entry->e_referenced =0 ; head =mb_cache_entry_head (cache, key);hlist_bl_lock (head);hlist_bl_for_each_entry (dup, dup_node, head, e_hash_list) {
fs/namei.c +3 -0
@@ -2138,6 +2138,9 @@ static const char *path_init(struct nameidata *nd, unsigned flags)int retval =0 ;const char *s = nd->name->name; +if (!*s) + flags &= ~LOOKUP_RCU ; + nd->last_type =LAST_ROOT ;/* if there are only slashes... */ nd->flags = flags |LOOKUP_JUMPED |LOOKUP_PARENT ; nd->depth =0 ;
fs/ocfs2/dlmglue.c +9 -0
@@ -2485,6 +2485,15 @@ int ocfs2_inode_lock_with_page(struct inode *inode, ret =ocfs2_inode_lock_full (inode, ret_bh, ex,OCFS2_LOCK_NONBLOCK );if (ret == -EAGAIN ) {unlock_page (page); +/* +* If we can't get inode lock immediately, we should not return +* directly here, since this will lead to a softlockup problem. +* The method is to get a blocking lock and immediately unlock +* before returning, this can avoid CPU resource waste due to +* lots of retries, and benefits fairness in getting lock. +*/ +if (ocfs2_inode_lock (inode, ret_bh, ex) ==0 ) +ocfs2_inode_unlock (inode, ex); ret =AOP_TRUNCATED_PAGE ; }
include/linux/compiler-gcc.h +4 -0
@@ -187,6 +187,10 @@#endif /* __CHECKER__ */ #endif /* GCC_VERSION >= 40300 */ +#if GCC_VERSION >=40400 +#define __optimize (level) __attribute__((__optimize__(level))) +#endif /* GCC_VERSION >= 40400 */ +#if GCC_VERSION >=40500 #ifndef __CHECKER__
include/linux/compiler.h +4 -0
@@ -469,6 +469,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s# define __native_word (t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))#endif +#ifndef __optimize +# define __optimize (level) +#endif +/* Compile time object size, -1 for unknown */ #ifndef __compiletime_object_size# define __compiletime_object_size (obj) -1
include/linux/jbd2.h +268 -163
651 lines not on this page · raw message
include/linux/kaiser.h +1 -1
@@ -32,7 +32,7 @@ static inline void kaiser_init(void) { }static inline int kaiser_add_mapping (unsigned long addr, -unsigned long size,unsigned long flags) +unsigned long size,u64 flags) {return 0 ; }
include/linux/nospec.h +21 -15
@@ -19,20 +19,6 @@static inline unsigned long array_index_mask_nospec (unsigned long index,unsigned long size) { -/* -* Warn developers about inappropriate array_index_nospec() usage. -* -* Even if the CPU speculates past the WARN_ONCE branch, the -* sign bit of @index is taken into account when generating the -* mask. -* -* This warning is compiled out when the compiler can infer that -* @index and @size are less than LONG_MAX. -*/ -if (WARN_ONCE (index >LONG_MAX || size >LONG_MAX , -"array_index_nospec() limited to range of [0, LONG_MAX]\n" )) -return 0 ; -/* * Always calculate and emit the mask even if the compiler * thinks the mask is not needed. The compiler does not take
@@ -43,6 +29,26 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, }#endif +/* +* Warn developers about inappropriate array_index_nospec() usage. +* +* Even if the CPU speculates past the WARN_ONCE branch, the +* sign bit of @index is taken into account when generating the +* mask. +* +* This warning is compiled out when the compiler can infer that +* @index and @size are less than LONG_MAX. +*/ +#define array_index_mask_nospec_check (index, size) \ +({ \ + if (WARN_ONCE(index > LONG_MAX || size > LONG_MAX, \ + "array_index_nospec() limited to range of [0, LONG_MAX]\n")) \ + _mask = 0; \ + else \ + _mask = array_index_mask_nospec(index, size); \ + _mask; \ +}) +/* * array_index_nospec - sanitize an array index after a bounds check *
@@ -61,7 +67,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, ({ \ typeof(index) _i = (index); \ typeof(size) _s = (size); \ - unsigned long _mask = array_index_mask_nospec(_i, _s); \ + unsigned long _mask = array_index_mask_nospec_check(_i, _s); \ \ BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \ BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \
kernel/memremap.c +2 -1
@@ -245,7 +245,8 @@ static void devm_memremap_pages_release(struct device *dev, void *data)/* pages are dead and unused, undo the arch mapping */ align_start = res->start & ~(SECTION_SIZE -1 ); - align_size =ALIGN (resource_size (res),SECTION_SIZE ); + align_size =ALIGN (res->start +resource_size (res),SECTION_SIZE ) + - align_start;lock_device_hotplug ();mem_hotplug_begin ();
mm/memory.c +1 -1
@@ -75,7 +75,7 @@#include "internal.h" -#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS +#if defined(LAST_CPUPID_NOT_IN_PAGE_FLAGS ) && !defined(CONFIG_COMPILE_TEST )#warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid.#endif
net/9p/trans_virtio.c +2 -1
@@ -160,7 +160,8 @@ static void req_done(struct virtqueue *vq)spin_unlock_irqrestore (&chan->lock, flags);/* Wakeup if anyone waiting for VirtIO ring space. */ wake_up (chan->vc_wq); -p9_client_cb (chan->client, req,REQ_STATUS_RCVD ); +if (len) +p9_client_cb (chan->client, req,REQ_STATUS_RCVD ); } }
sound/core/seq/seq_clientmgr.c +6 -2
@@ -999,7 +999,7 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, {struct snd_seq_client *client = file->private_data;int written =0 , len; -int err = -EINVAL ; +int err;struct snd_seq_event event;if (!(snd_seq_file_flags (file) &SNDRV_SEQ_LFLG_OUTPUT ))
@@ -1014,11 +1014,15 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,/* allocate the pool now if the pool is not allocated yet */ if (client->pool->size >0 && !snd_seq_write_pool_allocated (client)) { -if (snd_seq_pool_init (client->pool) <0 ) +mutex_lock (&client->ioctl_mutex); + err =snd_seq_pool_init (client->pool); +mutex_unlock (&client->ioctl_mutex); +if (err <0 )return -ENOMEM ; }/* only process whole events */ + err = -EINVAL ;while (count >=sizeof (struct snd_seq_event )) {/* Read in the event header from the user */ len =sizeof (event);
sound/pci/hda/patch_realtek.c +70 -0
139 lines not on this page · raw message
sound/usb/mixer.c +11 -7
@@ -344,17 +344,20 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret) { struct snd_usb_audio *chip = cval->head.mixer->chip; -unsigned char buf[4 +3 *sizeof (__u32)];/* enough space for one range */ +/* enough space for one range */ +unsigned char buf[sizeof (__u16) +3 *sizeof (__u32)];unsigned char *val; -int idx =0 , ret, size; +int idx =0 , ret, val_size, size;__u8 bRequest; + val_size =uac2_ctl_value_size (cval->val_type); +if (request ==UAC_GET_CUR ) { bRequest =UAC2_CS_CUR ; - size =uac2_ctl_value_size (cval->val_type); + size = val_size; }else { bRequest =UAC2_CS_RANGE ; - size =sizeof (buf); + size =sizeof (__u16) +3 * val_size; }memset (buf,0 ,sizeof (buf));
@@ -387,16 +390,17 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, val = buf +sizeof (__u16);break ;case UAC_GET_MAX : - val = buf +sizeof (__u16) *2 ; + val = buf +sizeof (__u16) + val_size;break ;case UAC_GET_RES : - val = buf +sizeof (__u16) *3 ; + val = buf +sizeof (__u16) + val_size *2 ;break ;default :return -EINVAL ; } - *value_ret =convert_signed_value (cval,snd_usb_combine_bytes (val,sizeof (__u16))); + *value_ret =convert_signed_value (cval, +snd_usb_combine_bytes (val, val_size));return 0 ; }
sound/usb/pcm.c +9 -0
@@ -352,6 +352,15 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, ep =0x86 ; iface =usb_ifnum_to_if (dev,2 ); +if (!iface || iface->num_altsetting ==0 ) +return -EINVAL ; + + alts = &iface->altsetting[1 ]; + goto add_sync_ep; +case USB_ID (0x1397 ,0x0002 ): + ep =0x81 ; + iface =usb_ifnum_to_if (dev,1 ); +if (!iface || iface->num_altsetting ==0 )return -EINVAL ;
tools/testing/selftests/vm/compaction_test.c +2 -0
@@ -136,6 +136,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)printf ("No of huge pages allocated = %d\n" , (atoi (nr_hugepages))); +lseek (fd,0 ,SEEK_SET ); +if (write (fd, initial_nr_hugepages,strlen (initial_nr_hugepages)) !=strlen (initial_nr_hugepages)) {perror ("Failed to write value to /proc/sys/vm/nr_hugepages\n" );
tools/testing/selftests/x86/Makefile +2 -0
@@ -26,11 +26,13 @@ CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) ifeq ($(CAN_BUILD_I386),1) all: all_32 TEST_PROGS += $(BINARIES_32) +EXTRA_CFLAGS += -DCAN_BUILD_32 endif ifeq ($(CAN_BUILD_X86_64),1) all: all_64 TEST_PROGS += $(BINARIES_64) +EXTRA_CFLAGS += -DCAN_BUILD_64 endif all_32: $(BINARIES_32)
tools/testing/selftests/x86/mpx-mini-test.c +30 -2
@@ -315,11 +315,39 @@ static inline void *__si_bounds_upper(siginfo_t *si) return si->si_upper; }#else + +/* +* This deals with old version of _sigfault in some distros: +* + +old _sigfault: +struct { +void *si_addr; +} _sigfault; + +new _sigfault: +struct { +void __user *_addr; +int _trapno; +short _addr_lsb; +union { +struct { +void __user *_lower; +void __user *_upper; +} _addr_bnd; +__u32 _pkey; +}; +} _sigfault; +* +*/ +static inline void **__si_bounds_hack (siginfo_t *si) {void *sigfault = &si->_sifields._sigfault;void *end_sigfault = sigfault +sizeof (si->_sifields._sigfault); -void **__si_lower = end_sigfault; +int *trapno = (int *)end_sigfault; +/* skip _trapno and _addr_lsb */ +void **__si_lower = (void **)(trapno +2 );return __si_lower; }
@@ -331,7 +359,7 @@ static inline void *__si_bounds_lower(siginfo_t *si)static inline void *__si_bounds_upper (siginfo_t *si) { -return (*__si_bounds_hack (si)) +sizeof (void *); +return *(__si_bounds_hack (si) +1 ); }#endif
tools/testing/selftests/x86/protection_keys.c +0 -28
@@ -381,34 +381,6 @@ pid_t fork_lazy_child(void)return forkret; } -void davecmp (void *_a,void *_b,int len) -{ -int i; -unsigned long *a = _a; -unsigned long *b = _b; - -for (i =0 ; i < len /sizeof (*a); i++) { -if (a[i] == b[i]) -continue ; - -dprintf3 ("[%3d]: a: %016lx b: %016lx\n" , i, a[i], b[i]); - } -} - -void dumpit (char *f) -{ -int fd =open (f,O_RDONLY ); -char buf[100 ]; -int nr_read; - -dprintf2 ("maps fd: %d\n" , fd); -do { - nr_read =read (fd, &buf[0 ],sizeof (buf)); -write (1 , buf, nr_read); - }while (nr_read >0 ); -close (fd); -} -#define PKEY_DISABLE_ACCESS 0x1#define PKEY_DISABLE_WRITE 0x2
tools/testing/selftests/x86/single_step_syscall.c +4 -1
@@ -119,7 +119,9 @@ static void check_result(void)int main () { +#ifdef CAN_BUILD_32 int tmp; +#endif sethandler (SIGTRAP , sigtrap,0 );
@@ -139,12 +141,13 @@ int main() : : "c" (post_nop) : "r11");check_result ();#endif - +#ifdef CAN_BUILD_32 printf ("[RUN]\tSet TF and check int80\n" );set_eflags (get_eflags () |X86_EFLAGS_TF ); asmvolatile ("int $0x80" :"=a" (tmp) :"a" (SYS_getpid) : INT80_CLOBBERS);check_result (); +#endif /* * This test is particularly interesting if fast syscalls use
tools/testing/selftests/x86/test_mremap_vdso.c +4 -0
@@ -90,8 +90,12 @@ int main(int argc, char **argv, char **envp) vdso_size +=PAGE_SIZE ; } +#ifdef __i386__/* Glibc is likely to explode now - exit with raw syscall */ asmvolatile ("int $0x80" : :"a" (__NR_exit),"b" (!!ret)); +#else /* __x86_64__ */ +syscall (SYS_exit, ret); +#endif }else {int status;