4.9.83-stable review
Subsystems (8)
Greg Kroah-Hartman
maintainercover 4.9.83-stable review
This is the start of the stable review cycle for the 4.9.83 release. There are 77 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Feb 23 12:44:14 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.83-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.9.83-rc1
yinbo.zhu <[email protected]>
mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb
yinbo.zhu <[email protected]>
mmc: sdhci-of-esdhc: fix eMMC couldn't work after kexec
Arnd Bergmann <[email protected]>
media: r820t: fix r820t_write_reg for KASAN
Linus Walleij <[email protected]>
ARM: dts: Delete bogus reference to the charlcd
Matthias Brugger <[email protected]>
arm: dts: mt2701: Add reset-cells
Arnd Bergmann <[email protected]>
ARM: dts: s5pv210: add interrupt-parent for ohci
Bjorn Andersson <[email protected]>
arm64: dts: msm8916: Add missing #phy-cells
Arnd Bergmann <[email protected]>
ARM: pxa/tosa-bt: add MODULE_LICENSE tag
Arnd Bergmann <[email protected]>
ARM: dts: exynos: fix RTC interrupt for exynos5410
Linus Torvalds <[email protected]>
vfs: don't do RCU lookup of empty pathnames
Arnd Bergmann <[email protected]>
x86: fix build warnign with 32-bit PAE
Gustavo A. R. Silva <[email protected]>
x86/cpu: Change type of x86_cache_size variable to unsigned int
Dan Carpenter <[email protected]>
x86/spectre: Fix an error message
Jia Zhang <[email protected]>
x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
Rui Wang <[email protected]>
selftests/x86/mpx: Fix incorrect bounds with old _sigfault
Peter Zijlstra <[email protected]>
x86/speculation: Add <asm/msr-index.h> dependency
Will Deacon <[email protected]>
nospec: Move array_index_nospec() parameter checking into separate macro
Dan Williams <[email protected]>
x86/speculation: Fix up array_index_nospec_mask() asm constraint
Dominik Brodowski <[email protected]>
selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c
Dominik Brodowski <[email protected]>
selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c
Ingo Molnar <[email protected]>
selftests/x86/pkeys: Remove unused functions
Ingo Molnar <[email protected]>
x86/speculation: Clean up various Spectre related details
KarimAllah Ahmed <[email protected]>
X86/nVMX: Properly set spec_ctrl and pred_cmd before merging MSRs
David Woodhouse <[email protected]>
KVM/x86: Reduce retpoline performance impact in slot_handle_level_range(), by always inlining iterator helper methods
David Woodhouse <[email protected]>
x86/speculation: Correct Speculation Control microcode blacklist again
David Woodhouse <[email protected]>
x86/speculation: Update Speculation Control microcode blacklist
Geert Uytterhoeven <[email protected]>
compiler-gcc.h: Introduce __optimize function attribute
Dan Williams <[email protected]>
x86/entry/64/compat: Clear registers for compat syscalls, to reduce speculation attack surface
Viresh Kumar <[email protected]>
arm: spear13xx: Fix spics gpio controller's warning
Viresh Kumar <[email protected]>
arm: spear13xx: Fix dmas cells
Viresh Kumar <[email protected]>
arm: spear600: Add missing interrupt-parent of rtc
Arnd Bergmann <[email protected]>
ARM: dts: nomadik: add interrupt-parent for clcd
Patrice Chotard <[email protected]>
ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property
Arnd Bergmann <[email protected]>
ARM: lpc3250: fix uda1380 gpio numbers
Bjorn Andersson <[email protected]>
arm64: dts: msm8916: Correct ipc references for smsm
Eugene Syromiatnikov <[email protected]>
s390: fix handling of -1 in set{,fs}[gu]id16 syscalls
Gang He <[email protected]>
ocfs2: try a blocking lock before return AOP_TRUNCATED_PAGE
Bjorn Andersson <[email protected]>
PM / devfreq: Propagate error from devfreq_add_device()
Shilpasri G Bhat <[email protected]>
cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
Bart Van Assche <[email protected]>
RDMA/rxe: Fix a race condition related to the QP error state
Arnd Bergmann <[email protected]>
kselftest: fix OOM in memory compaction test
Jack Morgenstein <[email protected]>
IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports
Mike Marciniszyn <[email protected]>
IB/qib: Fix comparison error with qperf compare/swap test
Nicholas Piggin <[email protected]>
powerpc: fix build errors in stable tree
NeilBrown <[email protected]>
dm: correctly handle chained bios in dec_pending()
James Hogan <[email protected]>
usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT
Mikulas Patocka <[email protected]>
mvpp2: fix multicast address filter
Takashi Iwai <[email protected]>
ALSA: seq: Fix racy pool initializations
Lassi Ylikojola <[email protected]>
ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204
Jan-Marek Glogowski <[email protected]>
ALSA: hda/realtek: PCI quirk for Fujitsu U7x7
Kailang Yang <[email protected]>
ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform
Kirill Marinushkin <[email protected]>
ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute
Hui Wang <[email protected]>
ALSA: hda - Fix headset mic detection problem for two Dell machines
Stefan Agner <[email protected]>
mtd: nand: vf610: set correct ooblayout
Greg Kurz <[email protected]>
9p/trans_virtio: discard zero-length reply
Liu Bo <[email protected]>
Btrfs: fix unexpected -EEXIST when creating new inode
Liu Bo <[email protected]>
Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly
Liu Bo <[email protected]>
Btrfs: fix extent state leak from tree log
Liu Bo <[email protected]>
Btrfs: fix crash due to not cleaning up tree log block's dirty bits
Liu Bo <[email protected]>
Btrfs: fix deadlock in run_delalloc_nocow
David Disseldorp <[email protected]>
target/iscsi: avoid NULL dereference in CHAP auth error path
Larry Finger <[email protected]>
rtlwifi: rtl8821ae: Fix connection lost problem correctly
Nicolas Pitre <[email protected]>
console/dummy: leave .con_font_get set to NULL
Johan Hovold <[email protected]>
video: fbdev: atmel_lcdfb: fix display-timings lookup
Johan Hovold <[email protected]>
PCI: keystone: Fix interrupt-controller-node lookup
Corentin Labbe <[email protected]>
MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN
Jan H. Schönherr <[email protected]>
mm: Fix memory size alignment in devm_memremap_pages_release()
Arnd Bergmann <[email protected]>
mm: hide a #warning for COMPILE_TEST
Ernesto A. Fernández <[email protected]>
ext4: correct documentation for grpid mount option
Zhouyi Zhou <[email protected]>
ext4: save error to disk in __ext4_grp_locked_error()
Harshad Shirwadkar <[email protected]>
ext4: fix a race in the ext4 shutdown path
Tobin C. Harding <[email protected]>
jbd2: fix sphinx kernel-doc build warnings
Alexander Potapenko <[email protected]>
mbcache: initialize entry->e_referenced in mb_cache_entry_create()
Stewart Smith <[email protected]>
rtc-opal: Fix handling of firmware error codes, prevent busy loops
Julia Lawall <[email protected]>
drm/radeon: adjust tested variable
Alex Deucher <[email protected]>
drm/radeon: Add dpm quirk for Jet PRO (v2)
Steffen Weber <[email protected]>
scsi: smartpqi: allow static build ("built-in")
-------------
Diffstat:
Documentation/devicetree/bindings/dma/snps-dma.txt | 2 +- Documentation/filesystems/ext4.txt | 2 +- Makefile | 4 +- 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/mmc/host/sdhci-of-esdhc.c | 8 + drivers/mtd/nand/vf610_nfc.c | 6 +- drivers/net/ethernet/marvell/mvpp2.c | 11 +- drivers/net/ethernet/mellanox/mlx4/qp.c | 3 + .../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 + 110 files changed, 766 insertions(+), 417 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/77 scsi: smartpqi: allow static build ("built-in")
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Weber <[email protected]>
commit dc2db1dc5fb9ab3a43b305c2720fee5278dbee2a upstream.
If CONFIG_SCSI_SMARTPQI=y then don't build this driver as a module.
--- drivers/scsi/smartpqi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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
Greg Kroah-Hartman
maintainerPATCH 2/77 drm/radeon: Add dpm quirk for Jet PRO (v2)
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 239b5f64e12b1f09f506c164dff0374924782979 upstream.
Fixes stability issues.
v2: clamp sclk to 600 Mhz
--- drivers/gpu/drm/radeon/si_dpm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/radeon/si_dpm.c +5 -0
@@ -3029,6 +3029,11 @@ static void si_apply_state_adjust_rules( 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) ||
Greg Kroah-Hartman
maintainerPATCH 3/77 drm/radeon: adjust tested variable
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julia Lawall <[email protected]>
commit 3a61b527b4e1f285d21b6e9e623dc45cf8bb391f upstream.
Check the variable that was most recently initialized.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x, y, f, g, e, m;
statement S1,S2,S3,S4;
@@
x = f(...);
if (\(<+...x...+>\&e\)) S1 else S2
(
x = g(...);
|
m = g(...,&x,...);
|
y = g(...);
*if (e)
S3 else S4
)
// </smpl>
--- drivers/gpu/drm/radeon/radeon_uvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_uvd.c +1 -1
@@ -995,7 +995,7 @@ int radeon_uvd_calc_upll_dividers(struct/* 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 */
Greg Kroah-Hartman
maintainerPATCH 4/77 rtc-opal: Fix handling of firmware error codes, prevent busy loops
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stewart Smith <[email protected]>
commit 5b8b58063029f02da573120ef4dc9079822e3cda upstream.
According to the OPAL docs:
skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txt
skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this indicates either a transient or permanent error.
Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a permanent error particularly well, in that you could end up in a busy loop.
This was not too hard to trigger on an AMI BMC based OpenPOWER machine doing a continuous "ipmitool mc reset cold" to the BMC, the result of that being that we'd get stuck in an infinite loop in opal_get_rtc_time().
We now retry a few times before returning the error higher up the stack.
--- drivers/rtc/rtc-opal.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/rtc/rtc-opal.c +10 -2
@@ -58,6 +58,7 @@ static void tm_to_opal(struct rtc_time *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 devi 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 devistatic 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 devi 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 ;
Greg Kroah-Hartman
maintainerPATCH 5/77 mbcache: initialize entry->e_referenced in mb_cache_entry_create()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Potapenko <[email protected]>
commit 3876bbe27d04b848750d5310a37d6b76b593f648 upstream.
KMSAN reported use of uninitialized |entry->e_referenced| in a condition in mb_cache_shrink():
==================================================================
BUG: KMSAN: use of uninitialized memory in mb_cache_shrink+0x3b4/0xc50 fs/mbcache.c:287 CPU: 2 PID: 816 Comm: kswapd1 Not tainted 4.11.0-rc5+ #2877 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x172/0x1c0 lib/dump_stack.c:52 kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:927 __msan_warning_32+0x61/0xb0 mm/kmsan/kmsan_instr.c:469 mb_cache_shrink+0x3b4/0xc50 fs/mbcache.c:287 mb_cache_scan+0x67/0x80 fs/mbcache.c:321 do_shrink_slab mm/vmscan.c:397 [inline] shrink_slab+0xc3d/0x12d0 mm/vmscan.c:500 shrink_node+0x208f/0x2fd0 mm/vmscan.c:2603 kswapd_shrink_node mm/vmscan.c:3172 [inline] balance_pgdat mm/vmscan.c:3289 [inline] kswapd+0x160f/0x2850 mm/vmscan.c:3478 kthread+0x46c/0x5f0 kernel/kthread.c:230 ret_from_fork+0x29/0x40 arch/x86/entry/entry_64.S:430 chained origin: save_stack_trace+0x37/0x40 arch/x86/kernel/stacktrace.c:59 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:302 [inline] kmsan_save_stack mm/kmsan/kmsan.c:317 [inline] kmsan_internal_chain_origin+0x12a/0x1f0 mm/kmsan/kmsan.c:547 __msan_store_shadow_origin_1+0xac/0x110 mm/kmsan/kmsan_instr.c:257 mb_cache_entry_create+0x3b3/0xc60 fs/mbcache.c:95 ext4_xattr_cache_insert fs/ext4/xattr.c:1647 [inline] ext4_xattr_block_set+0x4c82/0x5530 fs/ext4/xattr.c:1022 ext4_xattr_set_handle+0x1332/0x20a0 fs/ext4/xattr.c:1252 ext4_xattr_set+0x4d2/0x680 fs/ext4/xattr.c:1306 ext4_xattr_trusted_set+0x8d/0xa0 fs/ext4/xattr_trusted.c:36 __vfs_setxattr+0x703/0x790 fs/xattr.c:149 __vfs_setxattr_noperm+0x27a/0x6f0 fs/xattr.c:180 vfs_setxattr fs/xattr.c:223 [inline] setxattr+0x6ae/0x790 fs/xattr.c:449 path_setxattr+0x1eb/0x380 fs/xattr.c:468 SYSC_lsetxattr+0x8d/0xb0 fs/xattr.c:490 SyS_lsetxattr+0x77/0xa0 fs/xattr.c:486 entry_SYSCALL_64_fastpath+0x13/0x94 origin: save_stack_trace+0x37/0x40 arch/x86/kernel/stacktrace.c:59 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:302 [inline] kmsan_internal_poison_shadow+0xb1/0x1a0 mm/kmsan/kmsan.c:198 kmsan_kmalloc+0x7f/0xe0 mm/kmsan/kmsan.c:337 kmem_cache_alloc+0x1c2/0x1e0 mm/slub.c:2766 mb_cache_entry_create+0x283/0xc60 fs/mbcache.c:86 ext4_xattr_cache_insert fs/ext4/xattr.c:1647 [inline] ext4_xattr_block_set+0x4c82/0x5530 fs/ext4/xattr.c:1022 ext4_xattr_set_handle+0x1332/0x20a0 fs/ext4/xattr.c:1252 ext4_xattr_set+0x4d2/0x680 fs/ext4/xattr.c:1306 ext4_xattr_trusted_set+0x8d/0xa0 fs/ext4/xattr_trusted.c:36 __vfs_setxattr+0x703/0x790 fs/xattr.c:149 __vfs_setxattr_noperm+0x27a/0x6f0 fs/xattr.c:180 vfs_setxattr fs/xattr.c:223 [inline] setxattr+0x6ae/0x790 fs/xattr.c:449 path_setxattr+0x1eb/0x380 fs/xattr.c:468 SYSC_lsetxattr+0x8d/0xb0 fs/xattr.c:490 SyS_lsetxattr+0x77/0xa0 fs/xattr.c:486 entry_SYSCALL_64_fastpath+0x13/0x94 ==================================================================
--- fs/mbcache.c | 1 + 1 file changed, 1 insertion(+)
fs/mbcache.c +1 -0
@@ -93,6 +93,7 @@ int mb_cache_entry_create(struct mb_cach 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) {
Greg Kroah-Hartman
maintainerPATCH 6/77 jbd2: fix sphinx kernel-doc build warnings
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tobin C. Harding <[email protected]>
commit f69120ce6c024aa634a8fc25787205e42f0ccbe6 upstream.
Sphinx emits various (26) warnings when building make target 'htmldocs'. Currently struct definitions contain duplicate documentation, some as kernel-docs and some as standard c89 comments. We can reduce duplication while cleaning up the kernel docs.
Move all kernel-docs to right above each struct member. Use the set of all existing comments (kernel-doc and c89). Add documentation for missing struct members and function arguments.
--- fs/jbd2/transaction.c | 5 include/linux/jbd2.h | 431 +++++++++++++++++++++++++++++++------------------- 2 files changed, 272 insertions(+), 164 deletions(-)
fs/jbd2/transaction.c +4 -1
@@ -488,8 +488,10 @@ void jbd2_journal_free_reserved(handle_tEXPORT_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 @@ error_out:* 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.
include/linux/jbd2.h +268 -163
651 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 7/77 ext4: fix a race in the ext4 shutdown path
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harshad Shirwadkar <[email protected]>
commit abbc3f9395c76d554a9ed27d4b1ebfb5d9b0e4ca upstream.
This patch fixes a race between the shutdown path and bio completion handling. In the ext4 direct io path with async io, after submitting a bio to the block layer, if journal starting fails, ext4_direct_IO_write() would bail out pretending that the IO failed. The caller would have had no way of knowing whether or not the IO was successfully submitted. So instead, we return -EIOCBQUEUED in this case. Now, the caller knows that the IO was submitted. The bio completion handler takes care of the error.
Tested: Ran the shutdown xfstest test 461 in loop for over 2 hours across 4 machines resulting in over 400 runs. Verified that the race didn't occur. Usually the race was seen in about 20-30 iterations.
--- fs/ext4/inode.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
fs/ext4/inode.c +12 -4
@@ -3526,10 +3526,18 @@ static ssize_t ext4_direct_IO_write(stru/* 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);
Greg Kroah-Hartman
maintainerPATCH 8/77 ext4: save error to disk in __ext4_grp_locked_error()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhouyi Zhou <[email protected]>
commit 06f29cc81f0350261f59643a505010531130eea0 upstream.
In the function __ext4_grp_locked_error(), __save_error_info() is called to save error info in super block block, but does not sync that information to disk to info the subsequence fsck after reboot.
This patch writes the error information to disk. After this patch, I think there is no obvious EXT4 error handle branches which leads to "Remounting filesystem read-only" will leave the disk partition miss the subsequence fsck.
--- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+)
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
Greg Kroah-Hartman
maintainerPATCH 9/77 ext4: correct documentation for grpid mount option
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ernesto A. Fernández <[email protected]>
commit 9f0372488cc9243018a812e8cfbf27de650b187b upstream.
The grpid option is currently described as being the same as nogrpid.
--- Documentation/filesystems/ext4.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/filesystems/ext4.txt +1 -1
@@ -233,7 +233,7 @@ data_err=ignore(*) Just print an error m 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.
Greg Kroah-Hartman
maintainerPATCH 10/77 mm: hide a #warning for COMPILE_TEST
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit af27d9403f5b80685b79c88425086edccecaf711 upstream.
We get a warning about some slow configurations in randconfig kernels:
mm/memory.c:83:2: error: #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. [-Werror=cpp]
The warning is reasonable by itself, but gets in the way of randconfig build testing, so I'm hiding it whenever CONFIG_COMPILE_TEST is set.
The warning was added in 2013 in commit 75980e97dacc ("mm: fold page->_last_nid into page->flags where possible").
--- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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
Greg Kroah-Hartman
maintainerPATCH 11/77 mm: Fix memory size alignment in devm_memremap_pages_release()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan H. Schönherr <[email protected]>
commit 10a0cd6e4932b5078215b1ec2c896597eec0eff9 upstream.
The functions devm_memremap_pages() and devm_memremap_pages_release() use different ways to calculate the section-aligned amount of memory. The latter function may use an incorrect size if the memory region is small but straddles a section border.
Use the same code for both.
--- kernel/memremap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/memremap.c +2 -1
@@ -245,7 +245,8 @@ static void devm_memremap_pages_release(/* 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 ();
Greg Kroah-Hartman
maintainerPATCH 13/77 PCI: keystone: Fix interrupt-controller-node lookup
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit eac56aa3bc8af3d9b9850345d0f2da9d83529134 upstream.
Fix child-node lookup during initialisation which was using the wrong OF-helper and ended up searching the whole device tree depth-first starting at the parent rather than just matching on its children.
To make things worse, the parent pci node could end up being prematurely freed as of_find_node_by_name() drops a reference to its first argument. Any matching child interrupt-controller node was also leaked.
--- drivers/pci/host/pci-keystone.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pci/host/pci-keystone.c +4 -1
@@ -181,7 +181,7 @@ static int ks_pcie_get_irq_controller_in }/* 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_in 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_inbreak ; } +of_node_put (*np_temp); +if (temp) { *num_irqs = temp;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 14/77 video: fbdev: atmel_lcdfb: fix display-timings lookup
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 9cb18db0701f6b74f0c45c23ad767b3ebebe37f6 upstream.
Fix child-node lookup during probe, which ended up searching the whole device tree depth-first starting at the parent rather than just matching on its children.
To make things worse, the parent display node was also prematurely freed.
Note that the display and timings node references are never put after a successful dt-initialisation so the nodes would leak on later probe deferrals and on driver unbind.
--- drivers/video/fbdev/atmel_lcdfb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/video/fbdev/atmel_lcdfb.c +7 -1
@@ -1119,7 +1119,7 @@ static int atmel_lcdfb_of_init(struct at 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 atfb_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:
Greg Kroah-Hartman
maintainerPATCH 15/77 console/dummy: leave .con_font_get set to NULL
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Pitre <[email protected]>
commit 724ba8b30b044aa0d94b1cd374fc15806cdd6f18 upstream.
When this method is set, the caller expects struct console_font fields to be properly initialized when it returns. Leave it unset otherwise nonsensical (leaked kernel stack) values are returned to user space.
--- drivers/video/console/dummycon.c | 1 - 1 file changed, 1 deletion(-)
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, };
Greg Kroah-Hartman
maintainerPATCH 17/77 target/iscsi: avoid NULL dereference in CHAP auth error path
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Disseldorp <[email protected]>
commit ce512d79d0466a604793addb6b769d12ee326822 upstream.
If chap_server_compute_md5() fails early, e.g. via CHAP_N mismatch, then crypto_free_shash() is called with a NULL pointer which gets dereferenced in crypto_shash_tfm().
--- drivers/target/iscsi/iscsi_target_auth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
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;
Greg Kroah-Hartman
maintainerPATCH 18/77 Btrfs: fix deadlock in run_delalloc_nocow
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <[email protected]>
commit e89166990f11c3f21e1649d760dd35f9e410321c upstream.
@cur_offset is not set back to what it should be (@cow_start) if btrfs_next_leaf() returns something wrong, and the range [cow_start, cur_offset) remains locked forever.
--- fs/btrfs/inode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/btrfs/inode.c +4 -1
@@ -1320,8 +1320,11 @@ next_slot: 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 ];
Greg Kroah-Hartman
maintainerPATCH 19/77 Btrfs: fix crash due to not cleaning up tree log blocks dirty bits
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <[email protected]>
commit 1846430c24d66e85cc58286b3319c82cd54debb2 upstream.
In cases that the whole fs flips into readonly status due to failures in critical sections, then log tree's blocks are still dirty, and this leads to a crash during umount time, the crash is about use-after-free,
umount
-> close_ctree
-> stop workers
-> iput(btree_inode)
-> iput_final
-> write_inode_now
-> ...
-> queue job on stop'd workers--- fs/btrfs/tree-log.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/btrfs/tree-log.c +9 -0
@@ -2463,6 +2463,9 @@ static noinline int walk_down_log_tree(s 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 +2545,9 @@ static noinline int walk_up_log_tree(str 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 +2624,9 @@ static int walk_log_tree(struct btrfs_trclean_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 !=
Greg Kroah-Hartman
maintainerPATCH 20/77 Btrfs: fix extent state leak from tree log
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <[email protected]>
commit 55237a5f2431a72435e3ed39e4306e973c0446b7 upstream.
It's possible that btrfs_sync_log() bails out after one of the two btrfs_write_marked_extents() which convert extent state's state bit into EXTENT_NEED_WAIT from EXTENT_DIRTY/EXTENT_NEW, however only EXTENT_DIRTY and EXTENT_NEW are searched by free_log_tree() so that those extent states with EXTENT_NEED_WAIT lead to memory leak.
--- fs/btrfs/tree-log.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/btrfs/tree-log.c +3 -2
@@ -3013,13 +3013,14 @@ static void free_log_tree(struct btrfs_twhile (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 ); }/*
Greg Kroah-Hartman
maintainerPATCH 21/77 Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <[email protected]>
commit e8f1bc1493855e32b7a2a019decc3c353d94daf6 upstream.
This regression is introduced in
commit 3d48d9810de4 ("btrfs: Handle uninitialised inode eviction").
There are two problems,
a) it is ->destroy_inode() that does the final free on inode, not ->evict_inode(),
b) clear_inode() must be called before ->evict_inode() returns.
This could end up hitting BUG_ON(inode->i_state != (I_FREEING | I_CLEAR)); in evict() because I_CLEAR is set in clear_inode().
--- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/inode.c +1 -1
@@ -5229,7 +5229,7 @@ void btrfs_evict_inode(struct inode *inotrace_btrfs_inode_evict (inode);if (!root) { -kmem_cache_free (btrfs_inode_cachep,BTRFS_I (inode)); +clear_inode (inode);return ; }
Greg Kroah-Hartman
maintainerPATCH 22/77 Btrfs: fix unexpected -EEXIST when creating new inode
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <[email protected]>
commit 900c9981680067573671ecc5cbfa7c5770be3a40 upstream.
The highest objectid, which is assigned to new inode, is decided at the time of initializing fs roots. However, in cases where log replay gets processed, the btree which fs root owns might be changed, so we have to search it again for the highest objectid, otherwise creating new inode would end up with -EEXIST.
--- fs/btrfs/tree-log.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
fs/btrfs/tree-log.c +18 -0
@@ -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: *
@@ -5661,6 +5662,23 @@ again: 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);
Greg Kroah-Hartman
maintainerPATCH 23/77 9p/trans_virtio: discard zero-length reply
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kurz <[email protected]>
commit 26d99834f89e76514076d9cd06f61e56e6a509b8 upstream.
When a 9p request is successfully flushed, the server is expected to just mark it as used without sending a 9p reply (ie, without writing data into the buffer). In this case, virtqueue_get_buf() will return len == 0 and we must not report a REQ_STATUS_RCVD status to the client, otherwise the client will erroneously assume the request has not been flushed.
--- net/9p/trans_virtio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/9p/trans_virtio.c +2 -1
@@ -160,7 +160,8 @@ static void req_done(struct virtqueue *vspin_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 ); } }
Greg Kroah-Hartman
maintainerPATCH 24/77 mtd: nand: vf610: set correct ooblayout
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Agner <[email protected]>
commit ea56fb282368ea08c2a313af6b55cb597aec4db1 upstream.
With commit 3cf32d180227 ("mtd: nand: vf610: switch to mtd_ooblayout_ops") the driver started to use the NAND cores default large page ooblayout. However, shortly after commit 6a623e076944 ("mtd: nand: add ooblayout for old hamming layout") changed the default layout to the old hamming layout, which is not what vf610_nfc is using. Specify the default large page layout explicitly.
--- drivers/mtd/nand/vf610_nfc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mtd/nand/vf610_nfc.c +2 -4
@@ -752,10 +752,8 @@ static int vf610_nfc_probe(struct platfoif (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 ;
Greg Kroah-Hartman
maintainerPATCH 25/77 ALSA: hda - Fix headset mic detection problem for two Dell machines
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Wang <[email protected]>
commit 3f2f7c553d077be6a30cb96b2976a2c940bf5335 upstream.
One of them has the codec of alc256 and the other one has the codec of alc289.
--- sound/pci/hda/patch_realtek.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/pci/hda/patch_realtek.c +9 -0
@@ -5994,6 +5994,11 @@ static const struct snd_hda_pin_quirk al {0x14, 0x90170110}, {0x21, 0x02211020}), SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x12, 0x90a60130}, + {0x14, 0x90170110}, + {0x14, 0x01011020}, + {0x21, 0x0221101f}), + SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, ALC256_STANDARD_PINS), SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, {0x12, 0x90a60130},
@@ -6049,6 +6054,10 @@ static const struct snd_hda_pin_quirk al {0x12, 0x90a60120}, {0x14, 0x90170110}, {0x21, 0x0321101f}), + SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, + {0x12, 0xb7a60130}, + {0x14, 0x90170110}, + {0x21, 0x04211020}), SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, ALC290_STANDARD_PINS, {0x15, 0x04211040},
Greg Kroah-Hartman
maintainerPATCH 26/77 ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill Marinushkin <[email protected]>
commit 447cae58cecd69392b74a4a42cd0ab9cabd816af upstream.
The layout of the UAC2 Control request and response varies depending on the request type. With the current implementation, only the Layout 2 Parameter Block (with the 2-byte sized RANGE attribute) is handled properly. For the Control requests with the 1-byte sized RANGE attribute (Bass Control, Mid Control, Tremble Control), the response is parsed incorrectly.
This commit:
* fixes the wLength field value in the request
* fixes parsing the range values from the response
--- sound/usb/mixer.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
sound/usb/mixer.c +11 -7
@@ -344,17 +344,20 @@ static int get_ctl_value_v2(struct usb_m 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 @@ error: 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 ; }
Greg Kroah-Hartman
maintainerPATCH 27/77 ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kailang Yang <[email protected]>
commit 61fcf8ece9b6b09450250c4ca40cc3b81a96a68d upstream.
Thinkpad Dock device support for ALC298 platform. It need to use SSID for the quirk table. Because IdeaPad also has ALC298 platform. Use verb for the quirk table will confuse.
--- sound/pci/hda/patch_realtek.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
sound/pci/hda/patch_realtek.c +42 -0
@@ -4455,6 +4455,28 @@ static void alc_fixup_tpt440_dock(struct } } +static void alc_fixup_tpt470_dock (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +static const struct hda_pintbl pincfgs[] = { + {0x17 ,0x21211010 },/* dock headphone */ + {0x19 ,0x21a11010 },/* dock mic */ + { } + }; +struct alc_spec *spec = codec->spec; + +if (action ==HDA_FIXUP_ACT_PRE_PROBE ) { + spec->parse_flags =HDA_PINCFG_NO_HP_FIXUP ; +/* Enable DOCK device */ +snd_hda_codec_write (codec,0x17 ,0 , +AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 ,0 ); +/* Enable DOCK device */ +snd_hda_codec_write (codec,0x19 ,0 , +AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 ,0 ); +snd_hda_apply_pincfgs (codec, pincfgs); + } +} +static void alc_shutup_dell_xps13 (struct hda_codec *codec) {struct alc_spec *spec = codec->spec;
@@ -4877,6 +4899,7 @@ enum {ALC292_FIXUP_TPT460 ,ALC298_FIXUP_SPK_VOLUME ,ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER , + ALC298_FIXUP_TPT470_DOCK, }; static const struct hda_fixup alc269_fixups[] = {
@@ -5568,6 +5591,12 @@ static const struct hda_fixup alc269_fix .chained = true, .chain_id =ALC255_FIXUP_DELL1_MIC_NO_PRESENCE }, + [ALC298_FIXUP_TPT470_DOCK] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_tpt470_dock, + .chained = true, + .chain_id =ALC293_FIXUP_LENOVO_SPK_NOISE + }, };static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -5729,8 +5758,16 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x17aa ,0x2218 ,"Thinkpad X1 Carbon 2nd" ,ALC292_FIXUP_TPT440_DOCK ),SND_PCI_QUIRK (0x17aa ,0x2223 ,"ThinkPad T550" ,ALC292_FIXUP_TPT440_DOCK ),SND_PCI_QUIRK (0x17aa ,0x2226 ,"ThinkPad X250" ,ALC292_FIXUP_TPT440_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x222d ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x222e ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ),SND_PCI_QUIRK (0x17aa ,0x2231 ,"Thinkpad T560" ,ALC292_FIXUP_TPT460 ),SND_PCI_QUIRK (0x17aa ,0x2233 ,"Thinkpad" ,ALC292_FIXUP_TPT460 ), +SND_PCI_QUIRK (0x17aa ,0x2245 ,"Thinkpad T470" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x2246 ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x2247 ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x224b ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x224c ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x224d ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ),SND_PCI_QUIRK (0x17aa ,0x30bb ,"ThinkCentre AIO" ,ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY ),SND_PCI_QUIRK (0x17aa ,0x30e2 ,"ThinkCentre AIO" ,ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY ), SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
@@ -5749,7 +5786,12 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x17aa ,0x5050 ,"Thinkpad T560p" ,ALC292_FIXUP_TPT460 ),SND_PCI_QUIRK (0x17aa ,0x5051 ,"Thinkpad L460" ,ALC292_FIXUP_TPT460 ),SND_PCI_QUIRK (0x17aa ,0x5053 ,"Thinkpad T460" ,ALC292_FIXUP_TPT460 ), +SND_PCI_QUIRK (0x17aa ,0x505d ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x505f ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x5062 ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ),SND_PCI_QUIRK (0x17aa ,0x5109 ,"Thinkpad" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ), +SND_PCI_QUIRK (0x17aa ,0x511e ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x511f ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ),SND_PCI_QUIRK (0x17aa ,0x3bf8 ,"Quanta FL1" ,ALC269_FIXUP_PCM_44K ),SND_PCI_QUIRK (0x17aa ,0x9e54 ,"LENOVO NB" ,ALC269_FIXUP_LENOVO_EAPD ), SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
Greg Kroah-Hartman
maintainerPATCH 28/77 ALSA: hda/realtek: PCI quirk for Fujitsu U7x7
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan-Marek Glogowski <[email protected]>
commit fdcc968a3b290407bcba9d4c90e2fba6d8d928f1 upstream.
These laptops have a combined jack to attach headsets, the U727 on the left, the U757 on the right, but a headsets microphone doesn't work. Using hdajacksensetest I found that pin 0x19 changed the present state when plugging the headset, in addition to 0x21, but didn't have the correct configuration (shown as "Not connected").
So this sets the configuration to the same values as the headphone pin 0x21 except for the device type microphone, which makes it work correctly. With the patch the configured pins for U727 are
Pin 0x12 (Internal Mic, Mobile-In): present = No Pin 0x14 (Internal Speaker): present = No Pin 0x19 (Black Mic, Left side): present = No Pin 0x1d (Internal Aux): present = No
Pin 0x21 (Black Headphone, Left side): present = No
--- sound/pci/hda/patch_realtek.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
sound/pci/hda/patch_realtek.c +19 -0
@@ -3130,6 +3130,19 @@ static void alc269_fixup_pincfg_no_hp_to spec->parse_flags =HDA_PINCFG_NO_HP_FIXUP ; } +static void alc269_fixup_pincfg_U7x7_headset_mic (struct hda_codec *codec, +const struct hda_fixup *fix, +int action) +{ +unsigned int cfg_headphone =snd_hda_codec_get_pincfg (codec,0x21 ); +unsigned int cfg_headset_mic =snd_hda_codec_get_pincfg (codec,0x19 ); + +if (cfg_headphone && cfg_headset_mic ==0x411111f0 ) +snd_hda_codec_set_pincfg (codec,0x19 , + (cfg_headphone & ~AC_DEFCFG_DEVICE ) | + (AC_JACK_MIC_IN <<AC_DEFCFG_DEVICE_SHIFT )); +} +static void alc269_fixup_hweq (struct hda_codec *codec,const struct hda_fixup *fix,int action) {
@@ -4819,6 +4832,7 @@ enum {ALC269_FIXUP_LIFEBOOK_EXTMIC ,ALC269_FIXUP_LIFEBOOK_HP_PIN ,ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT , + ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,ALC269_FIXUP_AMIC ,ALC269_FIXUP_DMIC , ALC269VB_FIXUP_AMIC,
@@ -5010,6 +5024,10 @@ static const struct hda_fixup alc269_fix .type = HDA_FIXUP_FUNC, .v.func = alc269_fixup_pincfg_no_hp_to_lineout, }, + [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc269_fixup_pincfg_U7x7_headset_mic, + }, [ALC269_FIXUP_AMIC] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) {
@@ -5733,6 +5751,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x10cf ,0x159f ,"Lifebook E780" ,ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT ),SND_PCI_QUIRK (0x10cf ,0x15dc ,"Lifebook T731" ,ALC269_FIXUP_LIFEBOOK_HP_PIN ),SND_PCI_QUIRK (0x10cf ,0x1757 ,"Lifebook E752" ,ALC269_FIXUP_LIFEBOOK_HP_PIN ), +SND_PCI_QUIRK (0x10cf ,0x1629 ,"Lifebook U7x7" , ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),SND_PCI_QUIRK (0x10cf ,0x1845 ,"Lifebook U904" ,ALC269_FIXUP_LIFEBOOK_EXTMIC ),SND_PCI_QUIRK (0x144d ,0xc109 ,"Samsung Ativ book 9 (NP900X3G)" ,ALC269_FIXUP_INV_DMIC ), SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
Greg Kroah-Hartman
maintainerPATCH 29/77 ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lassi Ylikojola <[email protected]>
commit 5e35dc0338d85ccebacf3f77eca1e5dea73155e8 upstream.
Add quirk to ensure a sync endpoint is properly configured. This patch is a fix for same symptoms on Behringer UFX1204 as patch from Albertto Aquirre on Dec 8 2016 for Axe-Fx II.
--- sound/usb/pcm.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/usb/pcm.c +9 -0
@@ -357,6 +357,15 @@ static int set_sync_ep_implicit_fb_quirk 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 ; + + alts = &iface->altsetting[1 ]; + goto add_sync_ep; } if (attr == USB_ENDPOINT_SYNC_ASYNC &&
Greg Kroah-Hartman
maintainerPATCH 30/77 ALSA: seq: Fix racy pool initializations
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit d15d662e89fc667b90cd294b0eb45694e33144da upstream.
ALSA sequencer core initializes the event pool on demand by invoking snd_seq_pool_init() when the first write happens and the pool is empty. Meanwhile user can reset the pool size manually via ioctl concurrently, and this may lead to UAF or out-of-bound accesses since the function tries to vmalloc / vfree the buffer.
A simple fix is to just wrap the snd_seq_pool_init() call with the recently introduced client->ioctl_mutex; as the calls for snd_seq_pool_init() from other side are always protected with this mutex, we can avoid the race.
--- sound/core/seq/seq_clientmgr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/core/seq/seq_clientmgr.c +6 -2
@@ -999,7 +999,7 @@ static ssize_t snd_seq_write(struct file {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/* 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);
Greg Kroah-Hartman
maintainerPATCH 31/77 mvpp2: fix multicast address filter
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 7ac8ff95f48cbfa609a060fd6a1e361dd62feeb3 upstream.
IPv6 doesn't work on the MacchiatoBIN board. It is caused by broken multicast address filter in the mvpp2 driver.
The driver loads doesn't load any multicast entries if "allmulti" is not set. This condition should be reversed.
The condition !netdev_mc_empty(dev) is useless (because netdev_for_each_mc_addr is nop if the list is empty).
This patch also fixes a possible overflow of the multicast list - if mvpp2_prs_mac_da_accept fails, we set the allmulti flag and retry.
--- drivers/net/ethernet/marvell/mvpp2.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/mvpp2.c +8 -3
@@ -5657,6 +5657,7 @@ static void mvpp2_set_rx_mode(struct netint 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/* 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; + } + } } }
Greg Kroah-Hartman
maintainerPATCH 32/77 usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <[email protected]>
commit ec897569ad7dbc6d595873a487c3fac23f463f76 upstream.
Move the Kconfig symbols USB_UHCI_BIG_ENDIAN_MMIO and USB_UHCI_BIG_ENDIAN_DESC out of drivers/usb/host/Kconfig, which is conditional upon USB && USB_SUPPORT, so that it can be freely selected by platform Kconfig symbols in architecture code.
For example once the MIPS_GENERIC platform selects are fixed in commit 2e6522c56552 ("MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN"), the MIPS 32r6_defconfig warns like so:
warning: (MIPS_GENERIC) selects USB_UHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT && USB)
warning: (MIPS_GENERIC) selects USB_UHCI_BIG_ENDIAN_DESC which has unmet direct dependencies (USB_SUPPORT && USB)
Patchwork: https://patchwork.linux-mips.org/patch/18559/
--- drivers/usb/Kconfig | 8 ++++++++ drivers/usb/host/Kconfig | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
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
Greg Kroah-Hartman
maintainerPATCH 33/77 dm: correctly handle chained bios in dec_pending()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 8dd601fa8317243be887458c49f6c29c2f3d719f upstream.
dec_pending() is given an error status (possibly 0) to be recorded against a bio. It can be called several times on the one 'struct dm_io', and it is careful to only assign a non-zero error to io->status. However when it then assigned io->status to bio->bi_status, it is not careful and could overwrite a genuine error status with 0.
This can happen when chained bios are in use. If a bio is chained beneath the bio that this dm_io is handling, the child bio might complete and set bio->bi_status before the dm_io completes.
This has been possible since chained bios were introduced in 3.14, and has become a lot easier to trigger with commit 18a25da84354 ("dm: ensure bio submission follows a depth-first tree walk") as that commit caused dm to start using chained bios itself.
A particular failure mode is that if a bio spans an 'error' target and a working target, the 'error' fragment will complete instantly and set the ->bi_status, and the other fragment will normally complete a little later, and will clear ->bi_status.
The fix is simply to only assign io_error to bio->bi_status when io_error is not zero.
--- drivers/md/dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/dm.c +2 -1
@@ -809,7 +809,8 @@ static void dec_pending(struct dm_io *io }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); } }
Greg Kroah-Hartman
maintainerPATCH 34/77 powerpc: fix build errors in stable tree
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Piggin <[email protected]>
This is just the first chunk of commit 222f20f140623ef6033491d0103ee0875fe87d35 upstream.
to fix a build error in the powerpc tree due to other backports happening (and this full patch not being backported).
--- arch/powerpc/kernel/entry_64.S | 5 +++++ 1 file changed, 5 insertions(+)
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.
Greg Kroah-Hartman
maintainerPATCH 35/77 IB/qib: Fix comparison error with qperf compare/swap test
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <[email protected]>
commit 87b3524cb5058fdc7c2afdb92bdb2e079661ddc4 upstream.
This failure exists with qib:
ver_rc_compare_swap:
mismatch, sequence 2, expected 123456789abcdef, got 0
The request builder was using the incorrect inlines to build the request header resulting in incorrect data in the atomic header.
Fix by using the appropriate inlines to create the request.
--- drivers/infiniband/hw/qib/qib_rc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/qib/qib_rc.c +3 -3
@@ -443,13 +443,13 @@ no_flow_control: 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);
Greg Kroah-Hartman
maintainerPATCH 36/77 IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jack Morgenstein <[email protected]>
commit 852f6927594d0d3e8632c889b2ab38cbc46476ad upstream.
Allocating steerable UD QPs depends on having at least one IB port, while releasing those QPs does not.
As a result, when there are only ETH ports, the IB (RoCE) driver requests releasing a qp range whose base qp is zero, with qp count zero.
When SR-IOV is enabled, and the VF driver is running on a VM over a hypervisor which treats such qp release calls as errors (rather than NOPs), we see lines in the VM message log like:
mlx4_core 0002:00:02.0: Failed to release qp range base:0 cnt:0
Fix this by adding a check for a zero count in mlx4_release_qp_range() (which thus treats releasing 0 qps as a nop), and eliminating the check for device managed flow steering when releasing steerable UD QPs. (Freeing ib_uc_qpns_bitmap unconditionally is also OK, since it remains NULL when steerable UD QPs are not allocated).
--- drivers/infiniband/hw/mlx4/main.c | 13 +++++-------- drivers/net/ethernet/mellanox/mlx4/qp.c | 3 +++ 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/infiniband/hw/mlx4/main.c +5 -8
@@ -2928,9 +2928,8 @@ err_steer_free_bitmap: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_d 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/net/ethernet/mellanox/mlx4/qp.c +3 -0
@@ -286,6 +286,9 @@ void mlx4_qp_release_range(struct mlx4_du64 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);
Greg Kroah-Hartman
maintainerPATCH 38/77 RDMA/rxe: Fix a race condition related to the QP error state
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 6f301e06de4cf9ab7303f5acd43e64fcd4aa04be upstream.
The following sequence:
* Change queue pair state into IB_QPS_ERR.
* Post a work request on the queue pair.
Triggers the following race condition in the rdma_rxe driver:
* rxe_qp_error() triggers an asynchronous call of rxe_completer(), the function that examines the QP send queue.
* rxe_post_send() posts a work request on the QP send queue.
If rxe_completer() runs prior to rxe_post_send(), it will drain the send queue and the driver will assume no further action is necessary. However, once we post the send to the send queue, because the queue is in error, no send completion will ever happen and the send will get stuck. In order to process the send, we need to make sure that rxe_completer() gets run after a send is posted to a queue pair in an error state. This patch ensures that happens.
--- drivers/infiniband/sw/rxe/rxe_verbs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/sw/rxe/rxe_verbs.c +2 -0
@@ -848,6 +848,8 @@ static int rxe_post_send_kernel(struct r (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; }
Greg Kroah-Hartman
maintainerPATCH 39/77 cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shilpasri G Bhat <[email protected]>
commit 3fa4680b860bf48b437d6a2c039789c4abe202ae upstream.
Some OpenPOWER boxes can have same pstate values for nominal and pmin pstates. In these boxes the current code will not initialize 'powernv_pstate_info.min' variable and result in erroneous CPU frequency reporting. This patch fixes this problem.
--- drivers/cpufreq/powernv-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
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; }
Greg Kroah-Hartman
maintainerPATCH 40/77 PM / devfreq: Propagate error from devfreq_add_device()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <[email protected]>
commit d1bf2d30728f310f72296b54f0651ecdb09cbb12 upstream.
Propagate the error of devfreq_add_device() in devm_devfreq_add_device() rather than statically returning ENOMEM. This makes it slightly faster to pinpoint the cause of a returned error.
--- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/devfreq/devfreq.c +1 -1
@@ -684,7 +684,7 @@ struct devfreq *devm_devfreq_add_device( devfreq =devfreq_add_device (dev, profile, governor_name, data);if (IS_ERR (devfreq)) {devres_free (ptr); -return ERR_PTR (-ENOMEM ); +return devfreq; } *ptr = devfreq;
Greg Kroah-Hartman
maintainerPATCH 41/77 ocfs2: try a blocking lock before return AOP_TRUNCATED_PAGE
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gang He <[email protected]>
commit ff26cc10aec128c3f86b5611fd5f59c71d49c0e3 upstream.
If we can't get inode lock immediately in the function ocfs2_inode_lock_with_page() when reading a page, we should not return directly here, since this will lead to a softlockup problem when the kernel is configured with CONFIG_PREEMPT is not set. 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 among multiple nodes, increase efficiency in case modifying the same file frequently from multiple nodes.
The softlockup crash (when set /proc/sys/kernel/softlockup_panic to 1) looks like:
Kernel panic - not syncing: softlockup: hung tasks
CPU: 0 PID: 885 Comm: multi_mmap Tainted: G L 4.12.14-6.1-default #1
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
<IRQ>
dump_stack+0x5c/0x82
panic+0xd5/0x21e
watchdog_timer_fn+0x208/0x210
__hrtimer_run_queues+0xcc/0x200
hrtimer_interrupt+0xa6/0x1f0
smp_apic_timer_interrupt+0x34/0x50
apic_timer_interrupt+0x96/0xa0
</IRQ>
RIP: 0010:unlock_page+0x17/0x30
RSP: 0000:ffffaf154080bc88 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff10
RAX: dead000000000100 RBX: fffff21e009f5300 RCX: 0000000000000004
RDX: dead0000000000ff RSI: 0000000000000202 RDI: fffff21e009f5300
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffaf154080bb00
R10: ffffaf154080bc30 R11: 0000000000000040 R12: ffff993749a39518
R13: 0000000000000000 R14: fffff21e009f5300 R15: fffff21e009f5300
ocfs2_inode_lock_with_page+0x25/0x30 [ocfs2]
ocfs2_readpage+0x41/0x2d0 [ocfs2]
filemap_fault+0x12b/0x5c0
ocfs2_fault+0x29/0xb0 [ocfs2]
__do_fault+0x1a/0xa0
__handle_mm_fault+0xbe8/0x1090
handle_mm_fault+0xaa/0x1f0
__do_page_fault+0x235/0x4b0
trace_do_page_fault+0x3c/0x110
async_page_fault+0x28/0x30
RIP: 0033:0x7fa75ded638e
RSP: 002b:00007ffd6657db18 EFLAGS: 00010287
RAX: 000055c7662fb700 RBX: 0000000000000001 RCX: 000055c7662fb700
RDX: 0000000000001770 RSI: 00007fa75e909000 RDI: 000055c7662fb700
RBP: 0000000000000003 R08: 000000000000000e R09: 0000000000000000
R10: 0000000000000483 R11: 00007fa75ded61b0 R12: 00007fa75e90a770
R13: 000000000000000e R14: 0000000000001770 R15: 0000000000000000About performance improvement, we can see the testing time is reduced, and CPU utilization decreases, the detailed data is as follows. I ran multi_mmap test case in ocfs2-test package in a three nodes cluster.
Before applying this patch:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2754 ocfs2te+ 20 0 170248 6980 4856 D 80.73 0.341 0:18.71 multi_mmap
1505 root rt 0 222236 123060 97224 S 2.658 6.015 0:01.44 corosync
5 root 20 0 0 0 0 S 1.329 0.000 0:00.19 kworker/u8:0
95 root 20 0 0 0 0 S 1.329 0.000 0:00.25 kworker/u8:1
2728 root 20 0 0 0 0 S 0.997 0.000 0:00.24 jbd2/sda1-33
2721 root 20 0 0 0 0 S 0.664 0.000 0:00.07 ocfs2dc-3C8CFD4
2750 ocfs2te+ 20 0 142976 4652 3532 S 0.664 0.227 0:00.28 mpirun ocfs2test@tb-node2:~>multiple_run.sh -i ens3 -k ~/linux-4.4.21-69.tar.gz -o ~/ocfs2mullog -C hacluster -s pcmk -n tb-node2,tb-node1,tb-node3 -d /dev/sda1 -b 4096 -c 32768 -t multi_mmap /mnt/shared Tests with "-b 4096 -C 32768"
Thu Dec 28 14:44:52 CST 2017
multi_mmap..................................................Passed.
Runtime 783 seconds.
After apply this patch:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2508 ocfs2te+ 20 0 170248 6804 4680 R 54.00 0.333 0:55.37 multi_mmap
155 root 20 0 0 0 0 S 2.667 0.000 0:01.20 kworker/u8:3
95 root 20 0 0 0 0 S 2.000 0.000 0:01.58 kworker/u8:1
2504 ocfs2te+ 20 0 142976 4604 3480 R 1.667 0.225 0:01.65 mpirun
5 root 20 0 0 0 0 S 1.000 0.000 0:01.36 kworker/u8:0
2482 root 20 0 0 0 0 S 1.000 0.000 0:00.86 jbd2/sda1-33
299 root 0 -20 0 0 0 S 0.333 0.000 0:00.13 kworker/2:1H
335 root 0 -20 0 0 0 S 0.333 0.000 0:00.17 kworker/1:1H
535 root 20 0 12140 7268 1456 S 0.333 0.355 0:00.34 haveged
1282 root rt 0 222284 123108 97224 S 0.333 6.017 0:01.33 corosync ocfs2test@tb-node2:~>multiple_run.sh -i ens3 -k ~/linux-4.4.21-69.tar.gz -o ~/ocfs2mullog -C hacluster -s pcmk -n tb-node2,tb-node1,tb-node3 -d /dev/sda1 -b 4096 -c 32768 -t multi_mmap /mnt/shared Tests with "-b 4096 -C 32768"
Thu Dec 28 15:04:12 CST 2017
multi_mmap..................................................Passed.
Runtime 487 seconds.
--- fs/ocfs2/dlmglue.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/ocfs2/dlmglue.c +9 -0
@@ -2485,6 +2485,15 @@ int ocfs2_inode_lock_with_page(struct in 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 ; }
Greg Kroah-Hartman
maintainerPATCH 42/77 s390: fix handling of -1 in set{,fs}[gu]id16 syscalls
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eugene Syromiatnikov <[email protected]>
commit 6dd0d2d22aa363fec075cb2577ba273ac8462e94 upstream.
For some reason, the implementation of some 16-bit ID system calls (namely, setuid16/setgid16 and setfsuid16/setfsgid16) used type cast instead of low2highgid/low2highuid macros for converting [GU]IDs, which led to incorrect handling of value of -1 (which ought to be considered invalid).
Discovered by strace test suite.
--- arch/s390/kernel/compat_linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/s390/kernel/compat_linux.c +4 -4
@@ -110,7 +110,7 @@ COMPAT_SYSCALL_DEFINE2(s390_setregid16, 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, 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, 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)
Greg Kroah-Hartman
maintainerPATCH 43/77 arm64: dts: msm8916: Correct ipc references for smsm
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <[email protected]>
commit 566bd8902e7fa20bd412ed753e09e89c1c96939c upstream.
SMSM is not symmetrical, the incoming bits from WCNSS are available at index 6, but the outgoing host id for WCNSS is 3. Further more, upstream references the base of APCS (in contrast to downstream), so the register offset of 8 must be included.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +2 -2
@@ -906,8 +906,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>;
Greg Kroah-Hartman
maintainerPATCH 44/77 ARM: lpc3250: fix uda1380 gpio numbers
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit ca32e0c4bf9ca4b87089c5a5ce945e5f2ec890da upstream.
dtc warns about obviously incorrect GPIO numbers for the audio codec on both lpc32xx boards:
arch/arm/boot/dts/lpc3250-phy3250.dtb: Warning (gpios_property): reset-gpio property size (12) too small for cell size 3 in /ahb/apb/i2c@400A0000/uda1380@18 arch/arm/boot/dts/lpc3250-phy3250.dtb: Warning (gpios_property): power-gpio property size (12) too small for cell size 3 in /ahb/apb/i2c@400A0000/uda1380@18 arch/arm/boot/dts/lpc3250-ea3250.dtb: Warning (gpios_property): reset-gpio property size (12) too small for cell size 3 in /ahb/apb/i2c@400A0000/uda1380@18 arch/arm/boot/dts/lpc3250-ea3250.dtb: Warning (gpios_property): power-gpio property size (12) too small for cell size 3 in /ahb/apb/i2c@400A0000/uda1380@18
It looks like the nodes are written for a different binding that combines the GPIO number into a single number rather than a bank/number pair. I found the right numbers on stackexchange.com, so this patch fixes the warning and has a reasonable chance of getting things to actually work.
--- arch/arm/boot/dts/lpc3250-ea3250.dts | 4 ++-- arch/arm/boot/dts/lpc3250-phy3250.dts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
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"; };
Greg Kroah-Hartman
maintainerPATCH 45/77 ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrice Chotard <[email protected]>
commit 7ac1f59c09a61e6af6622df6809e003b0af07f3d upstream.
The GPIO polarity is missing in the hdmi,hpd-gpio property, this fixes the following DT warnings:
arch/arm/boot/dts/stih410-b2120.dtb: Warning (gpios_property): hdmi,hpd-gpio property size (8) too small for cell size 2 in /soc/sti-display-subsystem/sti-hdmi@8d04000
arch/arm/boot/dts/stih407-b2120.dtb: Warning (gpios_property): hdmi,hpd-gpio property size (8) too small for cell size 2 in /soc/sti-display-subsystem/sti-hdmi@8d04000
arch/arm/boot/dts/stih410-b2260.dtb: Warning (gpios_property): hdmi,hpd-gpio property size (8) too small for cell size 2 in /soc/sti-display-subsystem/sti-hdmi@8d04000
[arnd: marked Cc:stable since this warning shows up with the latest dtc
by default, and is more likely to actually cause problems than the other patches from this series]
--- arch/arm/boot/dts/stih407.dtsi | 3 ++- arch/arm/boot/dts/stih410.dtsi | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
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>;
Greg Kroah-Hartman
maintainerPATCH 46/77 ARM: dts: nomadik: add interrupt-parent for clcd
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit e8bfa0422469cdfc86be3f525f621b1d44d2481b upstream.
The clcd device is lacking an interrupt-parent property, which makes the interrupt unusable and shows up as a warning with the latest dtc version:
arch/arm/boot/dts/ste-nomadik-s8815.dtb: Warning (interrupts_property): Missing interrupt-parent for /amba/clcd@10120000 arch/arm/boot/dts/ste-nomadik-nhk15.dtb: Warning (interrupts_property): Missing interrupt-parent for /amba/clcd@10120000
I looked up the old board files and found that this interrupt has the same irqchip as all the other on-chip device, it just needs one extra line.
--- arch/arm/boot/dts/ste-nomadik-stn8815.dtsi | 1 + 1 file changed, 1 insertion(+)
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";
Greg Kroah-Hartman
maintainerPATCH 47/77 arm: spear600: Add missing interrupt-parent of rtc
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <[email protected]>
commit 6ffb5b4f248fe53e0361b8cbc2a523b432566442 upstream.
The interrupt-parent of rtc was missing, add it.
--- arch/arm/boot/dts/spear600.dtsi | 1 + 1 file changed, 1 insertion(+)
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"; };
Greg Kroah-Hartman
maintainerPATCH 48/77 arm: spear13xx: Fix dmas cells
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <[email protected]>
commit cdd10409914184c7eee5ae3e11beb890c9c16c61 upstream.
The "dmas" cells for the designware DMA controller need to have only 3 properties apart from the phandle: request line, src master and destination master. But the commit 6e8887f60f60 updated it incorrectly while moving from platform code to DT. Fix it.
--- Documentation/devicetree/bindings/dma/snps-dma.txt | 2 +- arch/arm/boot/dts/spear1340.dtsi | 4 ++-- arch/arm/boot/dts/spear13xx.dtsi | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/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"; };
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"; };
Greg Kroah-Hartman
maintainerPATCH 49/77 arm: spear13xx: Fix spics gpio controllers warning
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <[email protected]>
commit f8975cb1b8a36d0839b6365235778dd9df1d04ca upstream.
This fixes the following warning by also sending the flags argument for gpio controllers:
Property 'cs-gpios', cell 6 is not a phandle reference in /ahb/apb/spi@e0100000
--- arch/arm/boot/dts/spear1310-evb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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";
Greg Kroah-Hartman
maintainerPATCH 50/77 x86/entry/64/compat: Clear registers for compat syscalls, to reduce speculation attack surface
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 6b8cf5cc9965673951f1ab3f0e3cf23d06e3e2ee upstream.
At entry userspace may have populated registers with values that could otherwise be useful in a speculative execution attack. Clear them to minimize the kernel's attack surface.
Originally-From: Andi Kleen <[email protected]>
--- arch/x86/entry/entry_64_compat.S | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
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 /*
Greg Kroah-Hartman
maintainerPATCH 51/77 compiler-gcc.h: Introduce __optimize function attribute
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit df5d45aa08f848b79caf395211b222790534ccc7 upstream.
Create a new function attribute __optimize, which allows to specify an optimization level on a per-function basis.
--- include/linux/compiler-gcc.h | 4 ++++ include/linux/compiler.h | 4 ++++ 2 files changed, 8 insertions(+)
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# 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
Greg Kroah-Hartman
maintainerPATCH 52/77 x86/speculation: Update Speculation Control microcode blacklist
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
commit 1751342095f0d2b36fa8114d8e12c5688c455ac4 upstream.
Intel have retroactively blessed the 0xc2 microcode on Skylake mobile and desktop parts, and the Gemini Lake 0x22 microcode is apparently fine too. We blacklisted the latter purely because it was present with all the other problematic ones in the 2018-01-08 release, but now it's explicitly listed as OK.
We still list 0x84 for the various Kaby Lake / Coffee Lake parts, as that appeared in one version of the blacklist and then reverted to 0x80 again. We can change it if 0x84 is actually announced to be safe.
--- arch/x86/kernel/cpu/intel.c | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/kernel/cpu/intel.c +0 -4
@@ -82,8 +82,6 @@ static const struct sku_microcode spectr { INTEL_FAM6_KABYLAKE_MOBILE, 0x09, 0x84 }, { 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 }, { INTEL_FAM6_BROADWELL_XEON_D, 0x02, 0x14 },
@@ -95,8 +93,6 @@ static const struct sku_microcode spectr { 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 },
Greg Kroah-Hartman
maintainerPATCH 54/77 KVM/x86: Reduce retpoline performance impact in slot_handle_level_range(), by always inlining iterator helper methods
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
commit 928a4c39484281f8ca366f53a1db79330d058401 upstream.
With retpoline, tight loops of "call this function for every XXX" are very much pessimised by taking a prediction miss *every* time. This one is by far the biggest contributor to the guest launch time with retpoline.
By marking the iterator slot_handle_…() functions always_inline, we can ensure that the indirect function call can be optimised away into a direct call and it actually generates slightly smaller code because some of the other conditionals can get optimised away too.
Performance is now pretty close to what we see with nospectre_v2 on the command line.
--- arch/x86/kvm/mmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
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,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, struc 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, s 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, 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) {
Greg Kroah-Hartman
maintainerPATCH 55/77 X86/nVMX: Properly set spec_ctrl and pred_cmd before merging MSRs
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: KarimAllah Ahmed <[email protected]>
commit 206587a9fb764d71f035dc7f6d3b6488f5d5b304 upstream.
These two variables should check whether SPEC_CTRL and PRED_CMD are supposed to be passed through to L2 guests or not. While msr_write_intercepted_l01 would return 'true' if it is not passed through.
So just invert the result of msr_write_intercepted_l01 to implement the correct semantics.
--- arch/x86/kvm/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx.c +2 -2
@@ -9606,8 +9606,8 @@ static inline bool nested_vmx_merge_msr_* 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)
Greg Kroah-Hartman
maintainerPATCH 56/77 x86/speculation: Clean up various Spectre related details
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ingo Molnar <[email protected]>
commit 21e433bdb95bdf3aa48226fd3d33af608437f293 upstream.
Harmonize all the Spectre messages so that a:
dmesg | grep -i spectre
... gives us most Spectre related kernel boot messages.
Also fix a few other details:
- clarify a comment about firmware speculation control
- s/KPTI/PTI
- remove various line-breaks that made the code uglier
--- arch/x86/kernel/cpu/bugs.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-)
arch/x86/kernel/cpu/bugs.c +11 -17
@@ -161,8 +161,7 @@ static enum spectre_v2_mitigation_cmd __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 __ }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" , mitigation_options[i].option);return SPECTRE_V2_CMD_AUTO ; } }
@@ -184,8 +182,7 @@ static enum spectre_v2_mitigation_cmd __ 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_mit 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 @@ retpoline_auto: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 @@ retpoline_auto: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 devicereturn 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" );
Greg Kroah-Hartman
maintainerPATCH 57/77 selftests/x86/pkeys: Remove unused functions
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ingo Molnar <[email protected]>
commit ce676638fe7b284132a7d7d5e7e7ad81bab9947e upstream.
This also gets rid of two build warnings:
protection_keys.c: In function ‘dumpit’:
protection_keys.c:419:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(1, buf, nr_read);
^~~~~~~~~~~~~~~~~~~~~~--- tools/testing/selftests/x86/protection_keys.c | 28 -------------------------- 1 file changed, 28 deletions(-)
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
Greg Kroah-Hartman
maintainerPATCH 58/77 selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dominik Brodowski <linux at dominikbrodowski.net>
commit 2cbc0d66de0480449c75636f55697c7ff3af61fc upstream.
On 64-bit builds, we should not rely on "int $0x80" working (it only does if CONFIG_IA32_EMULATION=y is enabled).
Without this patch, the move test may succeed, but the "int $0x80" causes a segfault, resulting in a false negative output of this self-test.
--- tools/testing/selftests/x86/test_mremap_vdso.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/testing/selftests/x86/test_mremap_vdso.c +4 -0
@@ -90,8 +90,12 @@ int main(int argc, char **argv, char **e 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman
maintainerPATCH 59/77 selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dominik Brodowski <linux at dominikbrodowski.net>
commit 4105c69703cdeba76f384b901712c9397b04e9c2 upstream.
On 64-bit builds, we should not rely on "int $0x80" working (it only does if CONFIG_IA32_EMULATION=y is enabled). To keep the "Set TF and check int80" test running on 64-bit installs with CONFIG_IA32_EMULATION=y enabled, build this test only if we can also build 32-bit binaries (which should be a good approximation for that).
--- tools/testing/selftests/x86/Makefile | 2 ++ tools/testing/selftests/x86/single_step_syscall.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)
tools/testing/selftests/x86/Makefile +2 -0
@@ -26,11 +26,13 @@ CAN_BUILD_X86_64 := $(shell ./check_cc.s 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/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
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman
maintainerPATCH 60/77 x86/speculation: Fix up array_index_nospec_mask() asm constraint
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit be3233fbfcb8f5acb6e3bcd0895c3ef9e100d470 upstream.
Allow the compiler to handle @size as an immediate value or memory directly rather than allocating a register.
--- arch/x86/include/asm/barrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/barrier.h +1 -1
@@ -39,7 +39,7 @@ static inline unsigned long array_index_ asm ("cmp %1,%2; sbb %0,%0;" :"=r" (mask) - :"r" (size),"r" (index) + :"g" (size),"r" (index) :"cc" );return mask; }
Greg Kroah-Hartman
maintainerPATCH 61/77 nospec: Move array_index_nospec() parameter checking into separate macro
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit 8fa80c503b484ddc1abbd10c7cb2ab81f3824a50 upstream.
For architectures providing their own implementation of array_index_mask_nospec() in asm/barrier.h, attempting to use WARN_ONCE() to complain about out-of-range parameters using WARN_ON() results in a mess of mutually-dependent include files.
Rather than unpick the dependencies, simply have the core code in nospec.h perform the checking for us.
--- include/linux/nospec.h | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-)
include/linux/nospec.h +21 -15
@@ -20,20 +20,6 @@ static inline unsigned long array_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 * into account the value of @index under speculation.
@@ -44,6 +30,26 @@ static inline unsigned long array_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 * * For a code sequence like:
@@ -61,7 +67,7 @@ static inline unsigned long array_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)); \
Greg Kroah-Hartman
maintainerPATCH 62/77 x86/speculation: Add <asm/msr-index.h> dependency
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
commit ea00f301285ea2f07393678cd2b6057878320c9d upstream.
Joe Konno reported a compile failure resulting from using an MSR without inclusion of <asm/msr-index.h>, and while the current code builds fine (by accident) this needs fixing for future patches.
--- arch/x86/include/asm/nospec-branch.h | 1 + 1 file changed, 1 insertion(+)
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__
Greg Kroah-Hartman
maintainerPATCH 63/77 selftests/x86/mpx: Fix incorrect bounds with old _sigfault
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rui Wang <[email protected]>
commit 961888b1d76d84efc66a8f5604b06ac12ac2f978 upstream.
For distributions with old userspace header files, the _sigfault structure is different. mpx-mini-test fails with the following error:
[root@Purley]# mpx-mini-test_64 tabletest
XSAVE is supported by HW & OS
XSAVE processor supported state mask: 0x2ff
XSAVE OS supported state mask: 0x2ff
BNDREGS: size: 64 user: 1 supervisor: 0 aligned: 0
BNDCSR: size: 64 user: 1 supervisor: 0 aligned: 0
starting mpx bounds table test
ERROR: siginfo bounds do not match shadow bounds for register 0Fix it by using the correct offset of _lower/_upper in _sigfault. RHEL needs this patch to work.
--- tools/testing/selftests/x86/mpx-mini-test.c | 32 ++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
tools/testing/selftests/x86/mpx-mini-test.c +30 -2
@@ -315,11 +315,39 @@ static inline void *__si_bounds_upper(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(sistatic inline void *__si_bounds_upper (siginfo_t *si) { -return (*__si_bounds_hack (si)) +sizeof (void *); +return *(__si_bounds_hack (si) +1 ); }#endif
Greg Kroah-Hartman
maintainerPATCH 64/77 x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Zhang <[email protected]>
commit b399151cb48db30ad1e0e93dd40d68c6d007b637 upstream.
x86_mask is a confusing name which is hard to associate with the processor's stepping.
Additionally, correct an indent issue in lib/cpu.c.
--- 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/processor.h | 2 +- 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/centaur.c | 4 ++-- arch/x86/kernel/cpu/common.c | 8 ++++---- arch/x86/kernel/cpu/cyrix.c | 2 +- arch/x86/kernel/cpu/intel.c | 18 +++++++++--------- arch/x86/kernel/cpu/microcode/intel.c | 4 ++-- arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/mtrr/main.c | 4 ++-- arch/x86/kernel/cpu/proc.c | 4 ++-- arch/x86/kernel/head_32.S | 4 ++-- arch/x86/kernel/mpparse.c | 2 +- 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/speedstep-centrino.c | 4 ++-- drivers/cpufreq/speedstep-lib.c | 6 +++--- drivers/crypto/padlock-aes.c | 2 +- drivers/edac/amd64_edac.c | 2 +- drivers/edac/mce_amd.c | 2 +- drivers/hwmon/coretemp.c | 6 +++--- drivers/hwmon/hwmon-vid.c | 2 +- drivers/hwmon/k10temp.c | 2 +- drivers/hwmon/k8temp.c | 2 +- drivers/video/fbdev/geode/video_gx.c | 2 +- 34 files changed, 69 insertions(+), 69 deletions(-)
arch/x86/events/intel/core.c +1 -1
@@ -3363,7 +3363,7 @@ static int intel_snb_pebs_broken(int cpubreak ;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_pmustatic __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_processoif (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/processor.h +1 -1
@@ -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 */
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_xreturn ; } -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_x/* 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_xreturn ; } -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_x* 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_x* 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_x* 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 cpuinf/* 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(struc/* 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 c }/* 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/centaur.c +2 -2
@@ -134,7 +134,7 @@ static void init_centaur(struct cpuinfo_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* - 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 +4 -4
@@ -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 ;
@@ -1146,7 +1146,7 @@ static void identify_cpu(struct cpuinfo_ c->loops_per_jiffy = loops_per_jiffy; c->x86_cache_size =-1 ; 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 *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_x8/* 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 +9 -9
@@ -105,7 +105,7 @@ static bool bad_spectre_microcode(structfor (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;
@@ -158,7 +158,7 @@ static void early_init_intel(struct cpui* 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 );
@@ -174,7 +174,7 @@ static void early_init_intel(struct cpui/* 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 ;/*
@@ -289,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 ; }
@@ -306,7 +306,7 @@ static void intel_smp_check(struct cpuin* 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
@@ -349,7 +349,7 @@ static void intel_workarounds(struct cpu* 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 );/*
@@ -367,7 +367,7 @@ static void intel_workarounds(struct cpu* 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" );
@@ -382,7 +382,7 @@ static void intel_workarounds(struct cpu* 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 );
@@ -601,7 +601,7 @@ static void init_intel(struct cpuinfo_x8case 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 +2 -2
@@ -1062,7 +1062,7 @@ static bool is_blacklisted(unsigned int*/ 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_microcodreturn 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);
arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -859,7 +859,7 @@ int generic_validate_add_page(unsigned l*/ 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 +2 -2
@@ -70,8 +70,8 @@ static int show_cpuinfo(struct seq_file 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)
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_defa 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/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 *rn/* 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(structif (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 cpufbreak ;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 cpufbreak ; 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 cpuf 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 cp#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/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 {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( 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( 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/edac/amd64_edac.c +1 -1
@@ -2719,7 +2719,7 @@ static struct amd64_family_type *per_famstruct 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 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/hwmon/coretemp.c +3 -3
@@ -269,13 +269,13 @@ static int adjust_tjmax(struct cpuinfo_xfor (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 in* 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_d* 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 *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/video/fbdev/geode/video_gx.c +1 -1
@@ -127,7 +127,7 @@ void gx_set_dclk_frequency(struct fb_infint 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 {
Greg Kroah-Hartman
maintainerPATCH 65/77 x86/spectre: Fix an error message
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 9de29eac8d2189424d81c0d840cd0469aa3d41c8 upstream.
If i = ARRAY_SIZE(mitigation_options) then we accidentally print garbage from one space beyond the end of the mitigation_options[] array.
--- arch/x86/kernel/cpu/bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/bugs.c +1 -1
@@ -173,7 +173,7 @@ static enum spectre_v2_mitigation_cmd __ }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 ; } }
Greg Kroah-Hartman
maintainerPATCH 66/77 x86/cpu: Change type of x86_cache_size variable to unsigned int
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
commit 24dbc6000f4b9b0ef5a9daecb161f1907733765a upstream.
Currently, x86_cache_size is of type int, which makes no sense as we will never have a valid cache size equal or less than 0. So instead of initializing this variable to -1, it can perfectly be initialized to 0 and use it as an unsigned variable instead.
Addresses-Coverity-ID: 1464429
--- arch/x86/include/asm/processor.h | 2 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/microcode/intel.c | 2 +- arch/x86/kernel/cpu/proc.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-)
arch/x86/include/asm/processor.h +1 -1
@@ -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/cpu/common.c +1 -1
@@ -1144,7 +1144,7 @@ static void identify_cpu(struct cpuinfo_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_stepping =0 ;/* So far unknown... */ c->x86_vendor_id[0 ] ='\0' ;/* Unset */
arch/x86/kernel/cpu/microcode/intel.c +1 -1
@@ -1132,7 +1132,7 @@ static struct microcode_ops microcode_instatic 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/proc.c +2 -2
@@ -87,8 +87,8 @@ static int show_cpuinfo(struct seq_file }/* 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);
Greg Kroah-Hartman
maintainerPATCH 67/77 x86: fix build warnign with 32-bit PAE
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
I ran into a 4.9 build warning in randconfig testing, starting with the KAISER patches:
arch/x86/kernel/ldt.c: In function 'alloc_ldt_struct':arch/x86/include/asm/pgtable_types.h:208:24: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
#define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX)
^
arch/x86/kernel/ldt.c:81:6: note: in expansion of macro '__PAGE_KERNEL'
__PAGE_KERNEL);
^~~~~~~~~~~~~I originally ran into this last year when the patches were part of linux-next, and tried to work around it by using the proper 'pteval_t' types consistently, but that caused additional problems.
This takes a much simpler approach, and makes the argument type of the dummy helper always 64-bit, which is wide enough for any page table layout and won't hurt since this call is just an empty stub anyway.
--- include/linux/kaiser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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 ; }
Greg Kroah-Hartman
maintainerPATCH 69/77 ARM: dts: exynos: fix RTC interrupt for exynos5410
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 5628a8ca14149ba4226e3bdce3a04c3b688435ad upstream.
According to the comment added to exynos_dt_pmu_match[] in commit 8b283c025443 ("ARM: exynos4/5: convert pmu wakeup to stacked domains"), the RTC is not able to wake up the system through the PMU on Exynos5410, unlike Exynos5420.
However, when the RTC DT node got added, it was a straight copy of the Exynos5420 node, which now causes a warning from dtc.
This removes the incorrect interrupt-parent, which should get the interrupt working and avoid the warning.
--- arch/arm/boot/dts/exynos5410.dtsi | 1 - 1 file changed, 1 deletion(-)
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"; };
Greg Kroah-Hartman
maintainerPATCH 70/77 ARM: pxa/tosa-bt: add MODULE_LICENSE tag
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 3343647813fdf0f2409fbf5816ee3e0622168079 upstream.
Without this tag, we get a build warning:
WARNING: modpost: missing MODULE_LICENSE() in arch/arm/mach-pxa/tosa-bt.o
For completeness, I'm also adding author and description fields.
--- arch/arm/mach-pxa/tosa-bt.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/mach-pxa/tosa-bt.c +4 -0
@@ -132,3 +132,7 @@ static struct platform_driver tosa_bt_dr }, };module_platform_driver (tosa_bt_driver); + +MODULE_LICENSE ("GPL" ); +MODULE_AUTHOR ("Dmitry Baryshkov" ); +MODULE_DESCRIPTION ("Bluetooth built-in chip control" );
Greg Kroah-Hartman
maintainerPATCH 71/77 arm64: dts: msm8916: Add missing #phy-cells
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <[email protected]>
commit b0ab681285aa66064f2de5b74191c0cabba381ff upstream.
Add a missing #phy-cells to the dsi-phy, to silence dtc warning.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/msm8916.dtsi +1 -0
@@ -796,6 +796,7 @@ "dsi_phy_regulator"; #clock-cells = <1>; + #phy-cells = <0>; clocks = <&gcc GCC_MDSS_AHB_CLK>; clock-names = "iface_clk";
Greg Kroah-Hartman
maintainerPATCH 72/77 ARM: dts: s5pv210: add interrupt-parent for ohci
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 5c1037196b9ee75897c211972de370ed1336ec8f upstream.
The ohci-hcd node has an interrupt number but no interrupt-parent, leading to a warning with current dtc versions:
arch/arm/boot/dts/s5pv210-aquila.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000 arch/arm/boot/dts/s5pv210-goni.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000 arch/arm/boot/dts/s5pv210-smdkc110.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000 arch/arm/boot/dts/s5pv210-smdkv210.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000 arch/arm/boot/dts/s5pv210-torbreck.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/ohci@ec300000
As seen from the related exynos dts files, the ohci and ehci controllers always share one interrupt number, and the number is the same here as well, so setting the same interrupt-parent is the reasonable solution here.
--- arch/arm/boot/dts/s5pv210.dtsi | 1 + 1 file changed, 1 insertion(+)
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>;
Greg Kroah-Hartman
maintainerPATCH 73/77 arm: dts: mt2701: Add reset-cells
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Brugger <[email protected]>
commit ae72e95b5e4ded145bfc6926ad9457b74e3af41a upstream.
The hifsys and ethsys needs the definition of the reset-cells property. Fix this.
--- arch/arm/boot/dts/mt2701.dtsi | 2 ++ 1 file changed, 2 insertions(+)
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 {
Greg Kroah-Hartman
maintainerPATCH 74/77 ARM: dts: Delete bogus reference to the charlcd
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit 586b2a4befad88cd87b372a1cea01e58c6811ea9 upstream.
The EB MP board probably has a character LCD but the board manual does not really state which IRQ it has assigned to this device. The invalid assignment was a mistake by me during submission of the DTSI where I was looking for the reference, didn't find it and didn't fill it in.
Delete this for now: it can probably be fixed but that requires access to the actual board for some trial-and-error experiments.
--- arch/arm/boot/dts/arm-realview-eb-mp.dtsi | 5 ----- 1 file changed, 5 deletions(-)
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>;
Greg Kroah-Hartman
maintainerPATCH 75/77 media: r820t: fix r820t_write_reg for KASAN
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 16c3ada89cff9a8c2a0eea34ffa1aa20af3f6008 upstream.
With CONFIG_KASAN, we get an overly long stack frame due to inlining the register access functions:
drivers/media/tuners/r820t.c: In function 'generic_set_freq.isra.7':drivers/media/tuners/r820t.c:1334:1: error: the frame size of 2880 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
This is caused by a gcc bug that has now been fixed in gcc-8. To work around the problem, we can pass the register data through a local variable that older gcc versions can optimize out as well.
--- drivers/media/tuners/r820t.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/media/tuners/r820t.c +8 -5
@@ -396,9 +396,11 @@ static int r820t_write(struct r820t_privreturn 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 rreturn -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)
Greg Kroah-Hartman
maintainerPATCH 76/77 mmc: sdhci-of-esdhc: fix eMMC couldnt work after kexec
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: yinbo.zhu <[email protected]>
commit 97618aca1440b5addc5c3d78659d3e176be23b80 upstream.
The bit eSDHC_TBCTL[TB_EN] couldn't be reset by eSDHC_SYSCTL[RSTA] which is used to reset for all. The driver should make sure it's cleared before card initialization, otherwise the initialization would fail.
--- drivers/mmc/host/sdhci-of-esdhc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mmc/host/sdhci-of-esdhc.c +4 -0
@@ -584,6 +584,10 @@ static void esdhc_init(struct platform_d pltfm_host =sdhci_priv (host); esdhc =sdhci_pltfm_priv (pltfm_host); + val =sdhci_readl (host,ESDHC_TBCTL ); + val &= ~ESDHC_TB_EN ; +sdhci_writel (host, val,ESDHC_TBCTL ); + host_ver =sdhci_readw (host,SDHCI_HOST_VERSION ); esdhc->vendor_ver = (host_ver &SDHCI_VENDOR_VER_MASK ) >>SDHCI_VENDOR_VER_SHIFT ;
Greg Kroah-Hartman
maintainerPATCH 77/77 mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: yinbo.zhu <[email protected]>
commit f2bc600008bd6f7f5d0b6b56238d14f95cd454d2 upstream.
When system wakes up from sleep on ls1046ardb, the SD operation fails with mmc error messages since ESDHC_TB_EN bit couldn't be cleaned by eSDHC_SYSCTL[RSTA]. It's proper to clean this bit in esdhc_reset() rather than in probe.
--- drivers/mmc/host/sdhci-of-esdhc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-of-esdhc.c +8 -4
@@ -489,10 +489,18 @@ static void esdhc_pltfm_set_bus_width(ststatic void esdhc_reset (struct sdhci_host *host,u8 mask) { +u32 val; +sdhci_reset (host, mask);sdhci_writel (host, host->ier,SDHCI_INT_ENABLE );sdhci_writel (host, host->ier,SDHCI_SIGNAL_ENABLE ); + +if (mask &SDHCI_RESET_ALL ) { + val =sdhci_readl (host,ESDHC_TBCTL ); + val &= ~ESDHC_TB_EN ; +sdhci_writel (host, val,ESDHC_TBCTL ); + } }#ifdef CONFIG_PM_SLEEP
@@ -584,10 +592,6 @@ static void esdhc_init(struct platform_d pltfm_host =sdhci_priv (host); esdhc =sdhci_pltfm_priv (pltfm_host); - val =sdhci_readl (host,ESDHC_TBCTL ); - val &= ~ESDHC_TB_EN ; -sdhci_writel (host, val,ESDHC_TBCTL ); - host_ver =sdhci_readw (host,SDHCI_HOST_VERSION ); esdhc->vendor_ver = (host_ver &SDHCI_VENDOR_VER_MASK ) >>SDHCI_VENDOR_VER_SHIFT ;
Greg Kroah-Hartman
maintainerPATCH 16/77 rtlwifi: rtl8821ae: Fix connection lost problem correctly
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit c713fb071edc0efc01a955f65a006b0e1795d2eb upstream.
There has been a coding error in rtl8821ae since it was first introduced, namely that an 8-bit register was read using a 16-bit read in _rtl8821ae_dbi_read(). This error was fixed with commit 40b368af4b75 ("rtlwifi: Fix alignment issues"); however, this change led to instability in the connection. To restore stability, this change was reverted in commit b8b8b16352cd ("rtlwifi: rtl8821ae: Fix connection lost problem").
Unfortunately, the unaligned access causes machine checks in ARM architecture, and we were finally forced to find the actual cause of the problem on x86 platforms. Following a suggestion from Pkshih <[email protected]>, it was found that increasing the ASPM L1 latency from 0 to 7 fixed the instability. This parameter was varied to see if a smaller value would work; however, it appears that 7 is the safest value. A new symbol is defined for this quantity, thus it can be easily changed if necessary.
--- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 5 +++-- drivers/net/wireless/realtek/rtlwifi/wifi.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +3 -2
@@ -1128,7 +1128,7 @@ static u8 _rtl8821ae_dbi_read(struct rtl }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_ } 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
Greg Kroah-Hartman
maintainerPATCH 37/77 kselftest: fix OOM in memory compaction test
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 4c1baad223906943b595a887305f2e8124821dad upstream.
Running the compaction_test sometimes results in out-of-memory failures. When I debugged this, it turned out that the code to reset the number of hugepages to the initial value is simply broken since we write into an open sysctl file descriptor multiple times without seeking back to the start.
Adding the lseek here fixes the problem.
--- tools/testing/selftests/vm/compaction_test.c | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/vm/compaction_test.c +2 -0
@@ -136,6 +136,8 @@ int check_compaction(unsigned long mem_fprintf ("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" );
Greg Kroah-Hartman
maintainerPATCH 12/77 MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Corentin Labbe <[email protected]>
commit 2e6522c565522a2e18409c315c49d78c8b74807b upstream.
MIPS_GENERIC selects some options conditional on BIG_ENDIAN which does not exist.
Replace BIG_ENDIAN with CPU_BIG_ENDIAN which is the correct kconfig name. Note that BMIPS_GENERIC does the same which confirms that this patch is needed.
Patchwork: https://patchwork.linux-mips.org/patch/18495/
--- arch/mips/Kconfig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
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,
Greg Kroah-Hartman
maintainerPATCH 68/77 vfs: dont do RCU lookup of empty pathnames
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit c0eb027e5aef70b71e5a38ee3e264dc0b497f343 upstream.
Normal pathname lookup doesn't allow empty pathnames, but using AT_EMPTY_PATH (with name_to_handle_at() or fstatat(), for example) you can trigger an empty pathname lookup.
And not only is the RCU lookup in that case entirely unnecessary (because we'll obviously immediately finalize the end result), it is actively wrong.
Why? An empth path is a special case that will return the original 'dirfd' dentry - and that dentry may not actually be RCU-free'd, resulting in a potential use-after-free if we were to initialize the path lazily under the RCU read lock and depend on complete_walk() finalizing the dentry.
Found by syzkaller and KASAN.
--- fs/namei.c | 3 +++ 1 file changed, 3 insertions(+)
fs/namei.c +3 -0
@@ -2138,6 +2138,9 @@ static const char *path_init(struct nameint 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 ;
Greg Kroah-Hartman
maintainerPATCH 53/77 x86/speculation: Correct Speculation Control microcode blacklist again
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
commit d37fc6d360a404b208547ba112e7dabb6533c7fc upstream.
Arjan points out that the Intel document only clears the 0xc2 microcode on *some* parts with CPUID 506E3 (INTEL_FAM6_SKYLAKE_DESKTOP stepping 3). For the Skylake H/S platform it's OK but for Skylake E3 which has the same CPUID it isn't (yet) cleared.
So removing it from the blacklist was premature. Put it back for now.
Also, Arjan assures me that the 0x84 microcode for Kaby Lake which was featured in one of the early revisions of the Intel document was never released to the public, and won't be until/unless it is also validated as safe. So those can change to 0x80 which is what all *other* versions of the doc have identified.
Once the retrospective testing of existing public microcodes is done, we should be back into a mode where new microcodes are only released in batches and we shouldn't even need to update the blacklist for those anyway, so this tweaking of the list isn't expected to be a thing which keeps happening.
--- arch/x86/kernel/cpu/intel.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
arch/x86/kernel/cpu/intel.c +6 -5
@@ -75,13 +75,14 @@ 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_DESKTOP ,0x03 ,0xc2 }, {INTEL_FAM6_BROADWELL_CORE ,0x04 ,0x28 }, {INTEL_FAM6_BROADWELL_GT3E ,0x01 ,0x1b }, {INTEL_FAM6_BROADWELL_XEON_D ,0x02 ,0x14 },
Re: [PATCH 4.9 77/77] mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb
In reply to Greg Kroah-HartmanQuoted 48 lines · Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: yinbo.zhu <[email protected]>
commit
f2bc600008bd6f7f5d0b6b56238d14f95cd454d2upstream.When system wakes up from sleep on ls1046ardb, the SD operation fails with mmc error messages since
ESDHC_TB_ENbit couldn't be cleaned by eSDHC_SYSCTL[RSTA]. It's proper to clean this bit inesdhc_reset()rather than in probe.Signed-off-by yinbo.zhu <[email protected]>Acked-by Yangbo Lu <[email protected]>Acked-by Adrian Hunter <[email protected]>Signed-off-by Ulf Hansson <[email protected]>Cc Rasmus Villemoes <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/mmc/host/sdhci-of-esdhc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)drivers/mmc/host/sdhci-of-esdhc.c +8
-0@@ -489,10 +489,18 @@ static void esdhc_pltfm_set_bus_width(ststatic void esdhc_reset (struct sdhci_host *host,u8 mask) { +u32 val; +sdhci_reset (host, mask);sdhci_writel (host, host->ier,SDHCI_INT_ENABLE );sdhci_writel (host, host->ier,SDHCI_SIGNAL_ENABLE ); + +if (mask &SDHCI_RESET_ALL ) { + val =sdhci_readl (host,ESDHC_TBCTL ); + val &= ~ESDHC_TB_EN ; +sdhci_writel (host, val,ESDHC_TBCTL ); + } }#ifdef CONFIG_PM_SLEEP
drivers/mmc/host/sdhci-of-esdhc.c static void esdhc_init(struct platform_d · line 597
Quoted 10 lines
drivers/mmc/host/sdhci-of-esdhc.c +0
-4@@ -584,10 +592,6 @@ static void esdhc_init(struct platform_d pltfm_host =sdhci_priv (host); esdhc =sdhci_pltfm_priv (pltfm_host); - val =sdhci_readl (host,ESDHC_TBCTL ); - val &= ~ESDHC_TB_EN ; -sdhci_writel (host, val,ESDHC_TBCTL ); - host_ver =sdhci_readw (host,SDHCI_HOST_VERSION ); esdhc->vendor_ver = (host_ver &SDHCI_VENDOR_VER_MASK ) >>SDHCI_VENDOR_VER_SHIFT ;
Found build failure on 4.9
Please take a look
CC net/sunrpc/svcauth.odrivers/mmc/host/sdhci-of-esdhc.c: In function 'esdhc_reset':drivers/mmc/host/sdhci-of-esdhc.c:500:27: error: 'ESDHC_TBCTL' undeclared (first use in this function)
val = sdhci_readl(host, ESDHC_TBCTL);
^~~~~~~~~~~drivers/mmc/host/sdhci-of-esdhc.c:500:27: note: each undeclared identifier is reported only once for each function it appears in drivers/mmc/host/sdhci-of-esdhc.c:501:11: error: 'ESDHC_TB_EN' undeclared (first use in this function)
val &= ~ESDHC_TB_EN;
^~~~~~~~~~~scripts/Makefile.build:293: recipe for target 'drivers/mmc/host/sdhci-of-esdhc.o' failed make[5]: *** [drivers/mmc/host/sdhci-of-esdhc.o] Error 1 make[5]: *** Waiting for unfinished jobs....
CC net/sunrpc/svcauth_unix.o CC drivers/pci/host-bridge.o CC net/sunrpc/addr.o CC net/compat.o CC drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.o
scripts/Makefile.build:544: recipe for target 'drivers/mmc/host' failed make[4]: *** [drivers/mmc/host] Error 2 scripts/Makefile.build:544: recipe for target 'drivers/mmc' failed make[3]: *** [drivers/mmc] Error 2
make[3]: *** Waiting for unfinished jobs....
- Naresh
Greg Kroah-Hartman
maintainerRe: [PATCH 4.9 77/77] mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb
Quoted 85 lines · Naresh Kamboju
Quoted 48 lines · Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: yinbo.zhu <[email protected]>
commit
f2bc600008bd6f7f5d0b6b56238d14f95cd454d2upstream.When system wakes up from sleep on ls1046ardb, the SD operation fails with mmc error messages since
ESDHC_TB_ENbit couldn't be cleaned by eSDHC_SYSCTL[RSTA]. It's proper to clean this bit inesdhc_reset()rather than in probe.Signed-off-by yinbo.zhu <[email protected]>Acked-by Yangbo Lu <[email protected]>Acked-by Adrian Hunter <[email protected]>Signed-off-by Ulf Hansson <[email protected]>Cc Rasmus Villemoes <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/mmc/host/sdhci-of-esdhc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)drivers/mmc/host/sdhci-of-esdhc.c +8
-0@@ -489,10 +489,18 @@ static void esdhc_pltfm_set_bus_width(ststatic void esdhc_reset (struct sdhci_host *host,u8 mask) { +u32 val; +sdhci_reset (host, mask);sdhci_writel (host, host->ier,SDHCI_INT_ENABLE );sdhci_writel (host, host->ier,SDHCI_SIGNAL_ENABLE ); + +if (mask &SDHCI_RESET_ALL ) { + val =sdhci_readl (host,ESDHC_TBCTL ); + val &= ~ESDHC_TB_EN ; +sdhci_writel (host, val,ESDHC_TBCTL ); + } }#ifdef CONFIG_PM_SLEEP drivers/mmc/host/sdhci-of-esdhc.c static void esdhc_init(struct platform_d · line 597
Quoted 10 lines
drivers/mmc/host/sdhci-of-esdhc.c +0
-4@@ -584,10 +592,6 @@ static void esdhc_init(struct platform_d pltfm_host =sdhci_priv (host); esdhc =sdhci_pltfm_priv (pltfm_host); - val =sdhci_readl (host,ESDHC_TBCTL ); - val &= ~ESDHC_TB_EN ; -sdhci_writel (host, val,ESDHC_TBCTL ); - host_ver =sdhci_readw (host,SDHCI_HOST_VERSION ); esdhc->vendor_ver = (host_ver &SDHCI_VENDOR_VER_MASK ) >>SDHCI_VENDOR_VER_SHIFT ;Found build failure on 4.9
Please take a lookCC
net/sunrpc/svcauth.odrivers/mmc/host/sdhci-of-esdhc.c: In function 'esdhc_reset':drivers/mmc/host/sdhci-of-esdhc.c:500:27: error: 'ESDHC_TBCTL' undeclared (first use in this function)val = sdhci_readl(host, ESDHC_TBCTL); ^~~~~~~~~~~
drivers/mmc/host/sdhci-of-esdhc.c:500:27: note: each undeclared identifier is reported only once for each function it appears indrivers/mmc/host/sdhci-of-esdhc.c:501:11: error: 'ESDHC_TB_EN' undeclared (first use in this function)val &= ~ESDHC_TB_EN; ^~~~~~~~~~~
scripts/Makefile.build:293: recipe for target 'drivers/mmc/host/sdhci-of-esdhc.o' failed make[5]: *** [drivers/mmc/host/sdhci-of-esdhc.o] Error 1 make[5]: *** Waiting for unfinished jobs....CC net/sunrpc/svcauth_unix.o CC drivers/pci/host-bridge.o CC net/sunrpc/addr.o CC net/compat.o CC drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.o
Quoted 5 lines
scripts/Makefile.build:544: recipe for target 'drivers/mmc/host' failed make[4]: *** [drivers/mmc/host] Error 2scripts/Makefile.build:544: recipe for target 'drivers/mmc' failed make[3]: *** [drivers/mmc] Error 2
make[3]: *** Waiting for unfinished jobs....
Ugh, you are right, I wonder how this passed my build tests...
Anyway, this and the next mmc patch are now dropped from the 4.9.y tree, thanks.
greg k-h
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.83 release. There are 77 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Fri Feb 23 12:44:14 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.83-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.
Results from Linaro’s test farm.
No regressions on arm64, arm and x86_64.
Summary
------------------------------------------------------------------------
kernel: 4.9.83-rc1
git repo:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.9.y
git commit: 47522c6fdb6a14f7661ce0d982bd28d623223d68 git describe: v4.9.82-76-g47522c6fdb6a
Test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-4.9-oe/build/v4.9.82-76-g47522c6fdb6a
No regressions (compared to build v4.9.82-78-g7c9512fbbfa4)
Boards, architectures and test suites:
-------------------------------------
hi6220-hikey - arm64
* boot - pass: 20,
* kselftest - skip: 24, pass: 41,
* libhugetlbfs - skip: 1, pass: 90,
* ltp-cap_bounds-tests - pass: 2,
* ltp-containers-tests - skip: 17, pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - skip: 2, pass: 61,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - skip: 1, pass: 21,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - skip: 4, pass: 10,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - skip: 151, pass: 999,
* ltp-timers-tests - skip: 1, pass: 12,
juno-r2 - arm64
* boot - pass: 20,
* kselftest - skip: 23, pass: 42,
* libhugetlbfs - skip: 1, pass: 90,
* ltp-cap_bounds-tests - pass: 2,
* ltp-containers-tests - skip: 17, pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - skip: 2, pass: 61,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - pass: 22,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - skip: 4, pass: 10,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - skip: 149, pass: 1001,
* ltp-timers-tests - skip: 1, pass: 12,
x15 - arm
* boot - pass: 20,
* kselftest - skip: 25, pass: 39,
* libhugetlbfs - skip: 1, pass: 87,
* ltp-cap_bounds-tests - pass: 2,
* ltp-containers-tests - skip: 17, pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - skip: 2, pass: 61,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - skip: 2, pass: 20,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - skip: 1, pass: 13,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - skip: 97, pass: 1053,
* ltp-timers-tests - skip: 1, pass: 12,
x86_64
* boot - pass: 20,
* kselftest - skip: 27, pass: 54,
* libhugetlbfs - skip: 1, pass: 90,
* ltp-cap_bounds-tests - pass: 2,
* ltp-containers-tests - skip: 17, pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - skip: 1, pass: 62,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - pass: 22,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - skip: 5, pass: 9,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - skip: 119, pass: 1031,
* ltp-timers-tests - skip: 1, pass: 12,
--
Linaro QA (beta)
https://qa-reports.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.83 release. There are 77 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Feb 23 12:44:14 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.83-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Michael Ellerman
reviewerRe: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
In reply to Greg Kroah-HartmanQuoted 8 lines · Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Piggin <[email protected]>
This is just the first chunk of commit
222f20f140623ef6033491d0103ee0875fe87d35upstream.
That should have been back ported in full?
Oh I see now Greg took my 4.4 series and applied it to 4.9 but this one didn't apply.
So I guess this patch is OK for now, but we do need a full back port of 222f20f to 4.9.
cheers
Quoted 28 lines
to fix a build error in the powerpc tree due to other backports happening (and this full patch not being backported).
Reported-by Guenter Roeck <[email protected]>Reported-by Yves-Alexis Perez <[email protected]>Cc Nicholas Piggin <[email protected]>Cc Michael Ellerman <[email protected]>Cc Yves-Alexis Perez <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/powerpc/kernel/entry_64.S | 5 +++++ 1 file changed, 5 insertions(+)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.
Greg Kroah-Hartman
maintainerRe: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
Quoted 11 lines · Michael Ellerman
Quoted 8 lines · Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Piggin <[email protected]>
This is just the first chunk of commit
222f20f140623ef6033491d0103ee0875fe87d35upstream.
Quoted 7 lines
That should have been back ported in full?
Oh I see now Greg took my 4.4 series and applied it to 4.9 but this one didn't apply.
So I guess this patch is OK for now, but we do need a full back port of 222f20f to 4.9.
Sure, that would be great to have, I'll gladly take those patches :)
thanks,
greg k-h
Re: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
In reply to Michael EllermanQuoted 2 lines · Michael Ellerman
So I guess this patch is OK for now, but we do need a full back port of 222f20f to 4.9.
Hi,
in the light of this, do you know the full status of protections against Meltdown on powerpc/ppc64el architecures on 4.9?
Regards,
Signature · 1 line
Yves-Alexis
Greg Kroah-Hartman
maintainerRe: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
Quoted 8 lines · Yves-Alexis Perez
Quoted 2 lines · Michael Ellerman
So I guess this patch is OK for now, but we do need a full back port of 222f20f to 4.9.
Hi,
in the light of this, do you know the full status of protections against Meltdown on powerpc/ppc64el architecures on 4.9?
Did you look at /sys/devices/system/cpu/vulnerabilities/ to see what the files there say?
thanks,
greg k-h
Re: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
Quoted 2 lines · Greg Kroah-Hartman
Did you look at
/sys/devices/system/cpu/vulnerabilities/to see what the files there say?
Unfortunately I don't have access to a powerpc box where I could run a new kernel and try it on. I'll check with our ppc porters and see if I can get access to something.
Regards,
Signature · 1 line
Yves-Alexis
Michael Ellerman
reviewerPATCH 1/3 powerpc/64s: Fix conversion of slb_miss_common to use RFI_TO_USER/KERNEL
In reply to Greg Kroah-HartmanThe back port of commit c7305645eb0c ("powerpc/64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL") missed a hunk needed to restore cr6.
--- arch/powerpc/kernel/exceptions-64s.S | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/exceptions-64s.S +1 -0
@@ -680,6 +680,7 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_RADIX) .machine push .machine "power4" mtcrf 0x80,r9 + mtcrf 0x02,r9 /* I/D indication is in cr6 */ mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */ .machine pop
Signature · 1 line
2.14.1
Michael Ellerman
reviewerPATCH 2/3 powerpc/64s: Simple RFI macro conversions
From: Nicholas Piggin <[email protected]>
commit 222f20f140623ef6033491d0103ee0875fe87d35 upstream.
This commit does simple conversions of rfi/rfid to the new macros that include the expected destination context. By simple we mean cases where there is a single well known destination context, and it's simply a matter of substituting the instruction for the appropriate macro.
--- arch/powerpc/include/asm/exception-64s.h | 2 +- arch/powerpc/kernel/entry_64.S | 14 +++++++++----- arch/powerpc/kernel/exceptions-64s.S | 22 +++++++++++----------- arch/powerpc/kernel/idle_book3s.S | 7 ++++--- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 7 +++---- arch/powerpc/kvm/book3s_rmhandlers.S | 7 +++++-- arch/powerpc/kvm/book3s_segment.S | 4 ++-- 7 files changed, 35 insertions(+), 28 deletions(-)
arch/powerpc/include/asm/exception-64s.h +1 -1
@@ -242,7 +242,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943) mtspr SPRN_##h##SRR0,r12; \ mfspr r12,SPRN_##h##SRR1; /* and SRR1 */ \ mtspr SPRN_##h##SRR1,r10; \ - h##rfid; \ + h##RFI_TO_KERNEL; \ b ./* prevent speculative execution */ #define EXCEPTION_PROLOG_PSERIES_1 (label, h) \ __EXCEPTION_PROLOG_PSERIES_1(label, h)
arch/powerpc/kernel/entry_64.S +9 -5
@@ -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.
@@ -396,8 +401,7 @@ tabort_syscall: mtmsrd r10, 1 mtspr SPRN_SRR0, r11 mtspr SPRN_SRR1, r12 - - rfid + RFI_TO_USER b . /* prevent speculative execution */ #endif
@@ -1073,7 +1077,7 @@ _GLOBAL(enter_rtas) mtspr SPRN_SRR0,r5 mtspr SPRN_SRR1,r6 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ rtas_return_loc:
@@ -1098,7 +1102,7 @@ rtas_return_loc: mtspr SPRN_SRR0,r3 mtspr SPRN_SRR1,r4 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ .align 3
@@ -1169,7 +1173,7 @@ _GLOBAL(enter_prom) LOAD_REG_IMMEDIATE(r12, MSR_SF | MSR_ISF | MSR_LE) andc r11,r11,r12 mtsrr1 r11 - rfid + RFI_TO_KERNEL #endif /* CONFIG_PPC_BOOK3E */ 1: /* Return from OF */
arch/powerpc/kernel/exceptions-64s.S +11 -11
@@ -244,7 +244,7 @@ BEGIN_FTR_SECTION LOAD_HANDLER(r12, machine_check_handle_early) 1: mtspr SPRN_SRR0,r12 mtspr SPRN_SRR1,r11 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ 2: /* Stack overflow. Stay on emergency stack and panic.
@@ -280,7 +280,7 @@ machine_check_pSeries_0: mtspr SPRN_SRR0,r12 mfspr r12,SPRN_SRR1 mtspr SPRN_SRR1,r10 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ TRAMP_KVM_SKIP(PACA_EXMC, 0x200)
@@ -446,7 +446,7 @@ EXC_COMMON_BEGIN(machine_check_handle_early) li r3,MSR_ME andc r10,r10,r3 /* Turn off MSR_ME */ mtspr SPRN_SRR1,r10 - rfid + RFI_TO_KERNEL b . 2: /*
@@ -464,7 +464,7 @@ EXC_COMMON_BEGIN(machine_check_handle_early) */ bl machine_check_queue_event MACHINE_CHECK_HANDLER_WINDUP - rfid + RFI_TO_USER_OR_KERNEL 9: /* Deliver the machine check to host kernel in V mode. */ MACHINE_CHECK_HANDLER_WINDUP
@@ -706,7 +706,7 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_RADIX) mtspr SPRN_SRR0,r10 ld r10,PACAKMSR(r13) mtspr SPRN_SRR1,r10 - rfid + RFI_TO_KERNEL b . EXC_COMMON_BEGIN(unrecov_slb)
@@ -893,7 +893,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \ mtspr SPRN_SRR0,r10 ; \ ld r10,PACAKMSR(r13) ; \ mtspr SPRN_SRR1,r10 ; \ - rfid ; \ + RFI_TO_KERNEL ; \ b . ; /* prevent speculative execution */ #define SYSCALL_PSERIES_3 \
@@ -901,7 +901,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \ 1: mfspr r12,SPRN_SRR1 ; \ xori r12,r12,MSR_LE ; \ mtspr SPRN_SRR1,r12 ; \ - rfid ; /* return to userspace */ \ + RFI_TO_USER ; /* return to userspace */ \ b . ; /* prevent speculative execution */ #if defined(CONFIG_RELOCATABLE)
@@ -1276,7 +1276,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR) ld r11,PACA_EXGEN+EX_R11(r13) ld r12,PACA_EXGEN+EX_R12(r13) ld r13,PACA_EXGEN+EX_R13(r13) - HRFID + HRFI_TO_UNKNOWN b . #endif
@@ -1350,7 +1350,7 @@ masked_##_H##interrupt: \ ld r10,PACA_EXGEN+EX_R10(r13); \ ld r11,PACA_EXGEN+EX_R11(r13); \ GET_SCRATCH0(r13); \ - ##_H##rfid; \ + ##_H##RFI_TO_KERNEL; \ b . /*
@@ -1372,7 +1372,7 @@ TRAMP_REAL_BEGIN(kvmppc_skip_interrupt) addi r13, r13, 4 mtspr SPRN_SRR0, r13 GET_SCRATCH0(r13) - rfid + RFI_TO_KERNEL b . TRAMP_REAL_BEGIN(kvmppc_skip_Hinterrupt)
@@ -1384,7 +1384,7 @@ TRAMP_REAL_BEGIN(kvmppc_skip_Hinterrupt) addi r13, r13, 4 mtspr SPRN_HSRR0, r13 GET_SCRATCH0(r13) - hrfid + HRFI_TO_KERNEL b . #endif
arch/powerpc/kernel/idle_book3s.S +4 -3
@@ -9,6 +9,7 @@ */ #include <linux/threads.h> +#include <asm/exception-64s.h> #include <asm/processor.h> #include <asm/page.h> #include <asm/cputable.h>
@@ -178,7 +179,7 @@ _GLOBAL(pnv_powersave_common) mtmsrd r6, 1 /* clear RI before setting SRR0/1 */ mtspr SPRN_SRR0, r5 mtspr SPRN_SRR1, r7 - rfid + RFI_TO_KERNEL .globl pnv_enter_arch207_idle_mode pnv_enter_arch207_idle_mode:
@@ -668,7 +669,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) mtcr r6 mtspr SPRN_SRR1,r4 mtspr SPRN_SRR0,r5 - rfid + RFI_TO_KERNEL /* * R3 here contains the value that will be returned to the caller
@@ -689,4 +690,4 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) mtcr r6 mtspr SPRN_SRR1,r4 mtspr SPRN_SRR0,r5 - rfid + RFI_TO_KERNEL
arch/powerpc/kvm/book3s_hv_rmhandlers.S +3 -4
@@ -65,7 +65,7 @@ _GLOBAL_TOC(kvmppc_hv_entry_trampoline) mtmsrd r0,1 /* clear RI in MSR */ mtsrr0 r5 mtsrr1 r6 - RFI + RFI_TO_KERNEL kvmppc_call_hv_entry: ld r4, HSTATE_KVM_VCPU(r13)
@@ -171,7 +171,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) mtsrr0 r8 mtsrr1 r7 beq cr1, 13f /* machine check */ - RFI + RFI_TO_KERNEL /* On POWER7, we have external interrupts set to use HSRR0/1 */ 11: mtspr SPRN_HSRR0, r8
@@ -1018,8 +1018,7 @@ BEGIN_FTR_SECTION END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) ld r0, VCPU_GPR(R0)(r4) ld r4, VCPU_GPR(R4)(r4) - - hrfid + HRFI_TO_GUEST b . secondary_too_late:
arch/powerpc/kvm/book3s_rmhandlers.S +5 -2
@@ -46,6 +46,9 @@ #define FUNC(name) name +#define RFI_TO_KERNEL RFI +#define RFI_TO_GUEST RFI + .macro INTERRUPT_TRAMPOLINE intno .global kvmppc_trampoline_\intno
@@ -141,7 +144,7 @@ kvmppc_handler_skip_ins: GET_SCRATCH0(r13) /* And get back into the code */ - RFI + RFI_TO_KERNEL #endif /*
@@ -164,6 +167,6 @@ _GLOBAL_TOC(kvmppc_entry_trampoline) ori r5, r5, MSR_EE mtsrr0 r7 mtsrr1 r6 - RFI + RFI_TO_KERNEL #include "book3s_segment.S"
arch/powerpc/kvm/book3s_segment.S +2 -2
@@ -156,7 +156,7 @@ no_dcbz32_on: PPC_LL r9, SVCPU_R9(r3) PPC_LL r3, (SVCPU_R3)(r3) - RFI + RFI_TO_GUEST kvmppc_handler_trampoline_enter_end:
@@ -389,5 +389,5 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) cmpwi r12, BOOK3S_INTERRUPT_DOORBELL beqa BOOK3S_INTERRUPT_DOORBELL - RFI + RFI_TO_KERNEL kvmppc_handler_trampoline_exit_end:
Signature · 1 line
2.14.1
Michael Ellerman
reviewerPATCH 3/3 powerpc/64s: Improve RFI L1-D cache flush fallback
In reply to Michael EllermanFrom: Nicholas Piggin <[email protected]>
commit bdcb1aefc5b3f7d0f1dc8b02673602bca2ff7a4b upstream.
The fallback RFI flush is used when firmware does not provide a way to flush the cache. It's a "displacement flush" that evicts useful data by displacing it with an uninteresting buffer.
The flush has to take care to work with implementation specific cache replacment policies, so the recipe has been in flux. The initial slow but conservative approach is to touch all lines of a congruence class, with dependencies between each load. It has since been determined that a linear pattern of loads without dependencies is sufficient, and is significantly faster.
Measuring the speed of a null syscall with RFI fallback flush enabled gives the relative improvement:
P8 - 1.83x
P9 - 1.75x
The flush also becomes simpler and more adaptable to different cache geometries.
--- arch/powerpc/include/asm/paca.h | 3 +- arch/powerpc/kernel/asm-offsets.c | 3 +- arch/powerpc/kernel/exceptions-64s.S | 76 +++++++++++++++++------------------- arch/powerpc/kernel/setup_64.c | 13 +----- 4 files changed, 39 insertions(+), 56 deletions(-)
arch/powerpc/include/asm/paca.h +1 -2
@@ -212,8 +212,7 @@ struct paca_struct {*/ u64 exrfi[13 ]__aligned(0x80) ;void *rfi_flush_fallback_area; -u64 l1d_flush_congruence; -u64 l1d_flush_sets; +u64 l1d_flush_size;#endif };
arch/powerpc/kernel/asm-offsets.c +1 -2
@@ -242,8 +242,7 @@ int main(void)DEFINE (PACA_IN_MCE , offsetof(struct paca_struct , in_mce));DEFINE (PACA_RFI_FLUSH_FALLBACK_AREA , offsetof(struct paca_struct , rfi_flush_fallback_area));DEFINE (PACA_EXRFI , offsetof(struct paca_struct , exrfi)); -DEFINE (PACA_L1D_FLUSH_CONGRUENCE , offsetof(struct paca_struct , l1d_flush_congruence)); -DEFINE (PACA_L1D_FLUSH_SETS , offsetof(struct paca_struct , l1d_flush_sets)); +DEFINE (PACA_L1D_FLUSH_SIZE , offsetof(struct paca_struct , l1d_flush_size));#endif DEFINE (PACAHWCPUID , offsetof(struct paca_struct , hw_cpu_id));DEFINE (PACAKEXECSTATE , offsetof(struct paca_struct , kexec_state));
arch/powerpc/kernel/exceptions-64s.S +36 -40
114 lines not on this page · raw message
arch/powerpc/kernel/setup_64.c +1 -12
@@ -745,19 +745,8 @@ static void init_fallback_flush(void)memset (l1d_flush_fallback_area,0 , l1d_size *2 );for_each_possible_cpu (cpu) { -/* -* The fallback flush is currently coded for 8-way -* associativity. Different associativity is possible, but it -* will be treated as 8-way and may not evict the lines as -* effectively. -* -* 128 byte lines are mandatory. -*/ -u64 c = l1d_size /8 ; - paca[cpu].rfi_flush_fallback_area = l1d_flush_fallback_area; - paca[cpu].l1d_flush_congruence = c; - paca[cpu].l1d_flush_sets = c /128 ; + paca[cpu].l1d_flush_size = l1d_size; } }
Signature · 1 line
2.14.1
Michael Ellerman
reviewerRe: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
In reply to Yves-Alexis PerezQuoted 8 lines · Yves-Alexis Perez
Quoted 2 lines · Michael Ellerman
So I guess this patch is OK for now, but we do need a full back port of 222f20f to 4.9.
Hi,
in the light of this, do you know the full status of protections against Meltdown on powerpc/ppc64el architecures on 4.9?
With the patches I just sent, for pseries and powernv, the mitigation should be in place. On machines with updated firmware we'll use the hardware-assisted L1 flush, otherwise we fallback to doing it in software.
cheers
Re: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
Quoted 4 lines · Michael Ellerman
With the patches I just sent, for pseries and powernv, the mitigation should be in place. On machines with updated firmware we'll use the hardware-assisted L1 flush, otherwise we fallback to doing it in software.
So as of 4.9.82 meltdown is *not* addressed on those arches, but it should be ok in 4.9.83 or 4.9.84 depending on when the patches are merged?
Regards,
Signature · 1 line
Yves-Alexis
Re: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
In reply to Yves-Alexis PerezQuoted 7 lines · Yves-Alexis Perez
Quoted 2 lines · Greg Kroah-Hartman
Did you look at
/sys/devices/system/cpu/vulnerabilities/to see what the files there say?Unfortunately I don't have access to a powerpc box where I could run a new kernel and try it on. I'll check with our ppc porters and see if I can get access to something.
So someone tried for me on Debian 4.9.82-1+deb9u2 on this hardware:
processor : 0
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
we have:
/sys/devices/system/cpu/vulnerabilities/meltdown:Mitigation: RFI Flush
Does this mean it's correctly enabled or do we still miss the various patches sent by Michael?
Regards,
Signature · 1 line
Yves-Alexis
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.83 release. There are 77 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Feb 23 12:44:14 UTC 2018. Anything received after that time might be too late.
Build results:
total: 145 pass: 145 fail: 0 Qemu test results: total: 126 pass: 126 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Nicholas Piggin
reviewerRe: [PATCH v4.4 backport 3/3] powerpc/64s: Improve RFI L1-D cache flush fallback
In reply to Michael EllermanQuoted 21 lines · On Thu, 22 Feb 2018 23:35:45 +1100 Michael Ellerman <[email protected]> wrote:
From: Nicholas Piggin <[email protected]>
commit
bdcb1aefc5b3f7d0f1dc8b02673602bca2ff7a4bupstream.The fallback RFI flush is used when firmware does not provide a way to flush the cache. It's a "displacement flush" that evicts useful data by displacing it with an uninteresting buffer.
The flush has to take care to work with implementation specific cache replacment policies, so the recipe has been in flux. The initial slow but conservative approach is to touch all lines of a congruence class, with dependencies between each load. It has since been determined that a linear pattern of loads without dependencies is sufficient, and is significantly faster.
Measuring the speed of a null syscall with RFI fallback flush enabled gives the relative improvement:
P8 - 1.83x
P9 - 1.75x
Quoted 6 lines
The flush also becomes simpler and more adaptable to different cache geometries.
Signed-off-by Nicholas Piggin <[email protected]>[mpe: Backport to 4.9]Signed-off-by Michael Ellerman <[email protected]>
Thanks for doing these. They all look okay to me.
Thanks,
Nick
Michael Ellerman
reviewerRe: [PATCH 4.9 34/77] powerpc: fix build errors in stable tree
In reply to Yves-Alexis PerezQuoted 8 lines · Yves-Alexis Perez
Quoted 4 lines · Michael Ellerman
With the patches I just sent, for pseries and powernv, the mitigation should be in place. On machines with updated firmware we'll use the hardware-assisted L1 flush, otherwise we fallback to doing it in software.
So as of 4.9.82 meltdown is *not* addressed on those arches, but it should be ok in 4.9.83 or 4.9.84 depending on when the patches are merged?
As of 4.9.82 *most* of the patches to do the mitigation have been merged.
One of them was missed, due to it not applying (because it was actually a back port to 4.4 that was sent) that is:
222f20f14062 ("powerpc/64s: Simple RFI macro conversions")
That patch adds calls to do the L1D cache flush when returning to user/guest, so it is important that it's missing, the mitigation is not fully effective without that patch.
However, 4.9.82 *does* have a backport of:
b8e90cb7bc04 ("powerpc/64: Convert the syscall exit path to use RFI_TO_USER/KERNEL")
So the syscall path is protected, which means any attack which uses syscalls is likely to fail.
Because the data the attack is trying to read has to be in the L1D, you can't write an attack that remains in userspace 100% of the time, you have to enter the kernel and have the kernel load the target data into the L1D for you. With the syscall flush in place you can't use a syscall for that, you have to trigger some other kernel entry/exit, eg. a page fault.
TLDR is with the syscall flush in place it's much harder to write an attack.
Greg has already released 4.9.83, so hopefully 4.9.84 will be fully protected.
Note also that 4.9.82/83 have a bug in the SLB miss handler that can lead to hangs in userspace, fixed by the first patch I sent.
cheers
Patch "powerpc/64s: Fix conversion of slb_miss_common to use RFI_TO_USER/KERNEL" has been added to the 4.9-stable tree
In reply to Michael EllermanThis is a note to let you know that I've just added the patch titled
powerpc/64s: Fix conversion of slb_miss_common to use RFI_TO_USER/KERNEL
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
powerpc-64s-fix-conversion-of-slb_miss_common-to-use-rfi_to_user-kernel.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Fri Feb 23 12:34:52 2018
From: Michael Ellerman <[email protected]>
Date: Thu, 22 Feb 2018 23:35:43 +1100
Subject: powerpc/64s: Fix conversion of slb_miss_common to use RFI_TO_USER/KERNEL
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Message-ID: <[email protected]>
From: Michael Ellerman <[email protected]>
The back port of commit c7305645eb0c ("powerpc/64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL") missed a hunk needed to restore cr6.
--- arch/powerpc/kernel/exceptions-64s.S | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/exceptions-64s.S +1 -0
@@ -680,6 +680,7 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_R .machine push .machine "power4" mtcrf 0x80,r9 + mtcrf 0x02,r9 /* I/D indication is in cr6 */ mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */ .machine pop
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/powerpc-64s-fix-conversion-of-slb_miss_common-to-use-rfi_to_user-kernel.patch queue-4.9/powerpc-perf-fix-oops-when-grouping-different-pmu-events.patch
Michael Ellerman
reviewerRe: [PATCH v4.4 backport 2/3] powerpc/64s: Simple RFI macro conversions
In reply to Michael EllermanQuoted 1 line · Michael Ellerman
Subject: [PATCH v4.4 backport 2/3] powerpc/64s: Simple RFI macro conversions
^
4.9Gah, sorry just realised these last two have "v4.4" in the subject, but it should be "4.9".
cheers
Re: [PATCH v4.4 backport 2/3] powerpc/64s: Simple RFI macro conversions
Quoted 7 lines · Michael Ellerman
Quoted 1 line · Michael Ellerman
Subject: [PATCH v4.4 backport 2/3] powerpc/64s: Simple RFI macro conversions
^ 4.9Gah, sorry just realised these last two have "v4.4" in the subject, but it should be "4.9".
Ah, good, I was wondering about that :)
I'll apply these after lunch...
greg k-h
Patch "powerpc/64s: Improve RFI L1-D cache flush fallback" has been added to the 4.9-stable tree
In reply to Michael EllermanThis is a note to let you know that I've just added the patch titled
powerpc/64s: Improve RFI L1-D cache flush fallback
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
powerpc-64s-improve-rfi-l1-d-cache-flush-fallback.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Fri Feb 23 16:15:43 2018
From: Michael Ellerman <[email protected]>
Date: Thu, 22 Feb 2018 23:35:45 +1100
Subject: powerpc/64s: Improve RFI L1-D cache flush fallback
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Message-ID: <[email protected]>
From: Nicholas Piggin <[email protected]>
commit bdcb1aefc5b3f7d0f1dc8b02673602bca2ff7a4b upstream.
The fallback RFI flush is used when firmware does not provide a way to flush the cache. It's a "displacement flush" that evicts useful data by displacing it with an uninteresting buffer.
The flush has to take care to work with implementation specific cache replacment policies, so the recipe has been in flux. The initial slow but conservative approach is to touch all lines of a congruence class, with dependencies between each load. It has since been determined that a linear pattern of loads without dependencies is sufficient, and is significantly faster.
Measuring the speed of a null syscall with RFI fallback flush enabled gives the relative improvement:
P8 - 1.83x
P9 - 1.75x
The flush also becomes simpler and more adaptable to different cache geometries.
--- arch/powerpc/include/asm/paca.h | 3 - arch/powerpc/kernel/asm-offsets.c | 3 - arch/powerpc/kernel/exceptions-64s.S | 76 ++++++++++++++++------------------- arch/powerpc/kernel/setup_64.c | 13 ----- 4 files changed, 39 insertions(+), 56 deletions(-)
arch/powerpc/include/asm/paca.h +1 -2
@@ -212,8 +212,7 @@ struct paca_struct {*/ u64 exrfi[13 ]__aligned(0x80) ;void *rfi_flush_fallback_area; -u64 l1d_flush_congruence; -u64 l1d_flush_sets; +u64 l1d_flush_size;#endif };
arch/powerpc/kernel/asm-offsets.c +1 -2
@@ -242,8 +242,7 @@ int main(void)DEFINE (PACA_IN_MCE , offsetof(struct paca_struct , in_mce));DEFINE (PACA_RFI_FLUSH_FALLBACK_AREA , offsetof(struct paca_struct , rfi_flush_fallback_area));DEFINE (PACA_EXRFI , offsetof(struct paca_struct , exrfi)); -DEFINE (PACA_L1D_FLUSH_CONGRUENCE , offsetof(struct paca_struct , l1d_flush_congruence)); -DEFINE (PACA_L1D_FLUSH_SETS , offsetof(struct paca_struct , l1d_flush_sets)); +DEFINE (PACA_L1D_FLUSH_SIZE , offsetof(struct paca_struct , l1d_flush_size));#endif DEFINE (PACAHWCPUID , offsetof(struct paca_struct , hw_cpu_id));DEFINE (PACAKEXECSTATE , offsetof(struct paca_struct , kexec_state));
arch/powerpc/kernel/exceptions-64s.S +36 -40
114 lines not on this page · raw message
arch/powerpc/kernel/setup_64.c +1 -12
@@ -745,19 +745,8 @@ static void init_fallback_flush(void)memset (l1d_flush_fallback_area,0 , l1d_size *2 );for_each_possible_cpu (cpu) { -/* -* The fallback flush is currently coded for 8-way -* associativity. Different associativity is possible, but it -* will be treated as 8-way and may not evict the lines as -* effectively. -* -* 128 byte lines are mandatory. -*/ -u64 c = l1d_size /8 ; - paca[cpu].rfi_flush_fallback_area = l1d_flush_fallback_area; - paca[cpu].l1d_flush_congruence = c; - paca[cpu].l1d_flush_sets = c /128 ; + paca[cpu].l1d_flush_size = l1d_size; } }
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/powerpc-64s-simple-rfi-macro-conversions.patch queue-4.9/powerpc-64s-improve-rfi-l1-d-cache-flush-fallback.patch queue-4.9/powerpc-64s-fix-conversion-of-slb_miss_common-to-use-rfi_to_user-kernel.patch queue-4.9/powerpc-perf-fix-oops-when-grouping-different-pmu-events.patch
Patch "powerpc/64s: Simple RFI macro conversions" has been added to the 4.9-stable tree
In reply to Michael EllermanThis is a note to let you know that I've just added the patch titled
powerpc/64s: Simple RFI macro conversions
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
powerpc-64s-simple-rfi-macro-conversions.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Fri Feb 23 16:14:29 2018
From: Michael Ellerman <[email protected]>
Date: Thu, 22 Feb 2018 23:35:44 +1100
Subject: powerpc/64s: Simple RFI macro conversions
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Message-ID: <[email protected]>
From: Nicholas Piggin <[email protected]>
commit 222f20f140623ef6033491d0103ee0875fe87d35 upstream.
This commit does simple conversions of rfi/rfid to the new macros that include the expected destination context. By simple we mean cases where there is a single well known destination context, and it's simply a matter of substituting the instruction for the appropriate macro.
--- arch/powerpc/include/asm/exception-64s.h | 2 +- arch/powerpc/kernel/entry_64.S | 9 ++++----- arch/powerpc/kernel/exceptions-64s.S | 22 +++++++++++----------- arch/powerpc/kernel/idle_book3s.S | 7 ++++--- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 7 +++---- arch/powerpc/kvm/book3s_rmhandlers.S | 7 +++++-- arch/powerpc/kvm/book3s_segment.S | 4 ++-- 7 files changed, 30 insertions(+), 28 deletions(-)
arch/powerpc/include/asm/exception-64s.h +1 -1
@@ -242,7 +242,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943) mtspr SPRN_##h##SRR0,r12; \ mfspr r12,SPRN_##h##SRR1; /* and SRR1 */ \ mtspr SPRN_##h##SRR1,r10; \ - h##rfid; \ + h##RFI_TO_KERNEL; \ b ./* prevent speculative execution */ #define EXCEPTION_PROLOG_PSERIES_1 (label, h) \ __EXCEPTION_PROLOG_PSERIES_1(label, h)
arch/powerpc/kernel/entry_64.S +4 -5
@@ -401,8 +401,7 @@ tabort_syscall: mtmsrd r10, 1 mtspr SPRN_SRR0, r11 mtspr SPRN_SRR1, r12 - - rfid + RFI_TO_USER b . /* prevent speculative execution */ #endif
@@ -1078,7 +1077,7 @@ _GLOBAL(enter_rtas) mtspr SPRN_SRR0,r5 mtspr SPRN_SRR1,r6 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ rtas_return_loc:
@@ -1103,7 +1102,7 @@ rtas_return_loc: mtspr SPRN_SRR0,r3 mtspr SPRN_SRR1,r4 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ .align 3
@@ -1174,7 +1173,7 @@ _GLOBAL(enter_prom) LOAD_REG_IMMEDIATE(r12, MSR_SF | MSR_ISF | MSR_LE) andc r11,r11,r12 mtsrr1 r11 - rfid + RFI_TO_KERNEL #endif /* CONFIG_PPC_BOOK3E */ 1: /* Return from OF */
arch/powerpc/kernel/exceptions-64s.S +11 -11
@@ -244,7 +244,7 @@ BEGIN_FTR_SECTION LOAD_HANDLER(r12, machine_check_handle_early) 1: mtspr SPRN_SRR0,r12 mtspr SPRN_SRR1,r11 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ 2: /* Stack overflow. Stay on emergency stack and panic.
@@ -280,7 +280,7 @@ machine_check_pSeries_0: mtspr SPRN_SRR0,r12 mfspr r12,SPRN_SRR1 mtspr SPRN_SRR1,r10 - rfid + RFI_TO_KERNEL b . /* prevent speculative execution */ TRAMP_KVM_SKIP(PACA_EXMC, 0x200)
@@ -446,7 +446,7 @@ EXC_COMMON_BEGIN(machine_check_handle_ea li r3,MSR_ME andc r10,r10,r3 /* Turn off MSR_ME */ mtspr SPRN_SRR1,r10 - rfid + RFI_TO_KERNEL b . 2: /*
@@ -464,7 +464,7 @@ EXC_COMMON_BEGIN(machine_check_handle_ea */ bl machine_check_queue_event MACHINE_CHECK_HANDLER_WINDUP - rfid + RFI_TO_USER_OR_KERNEL 9: /* Deliver the machine check to host kernel in V mode. */ MACHINE_CHECK_HANDLER_WINDUP
@@ -706,7 +706,7 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_R mtspr SPRN_SRR0,r10 ld r10,PACAKMSR(r13) mtspr SPRN_SRR1,r10 - rfid + RFI_TO_KERNEL b . EXC_COMMON_BEGIN(unrecov_slb)
@@ -893,7 +893,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) mtspr SPRN_SRR0,r10 ; \ ld r10,PACAKMSR(r13) ; \ mtspr SPRN_SRR1,r10 ; \ - rfid ; \ + RFI_TO_KERNEL ; \ b . ; /* prevent speculative execution */ #define SYSCALL_PSERIES_3 \
@@ -901,7 +901,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) 1: mfspr r12,SPRN_SRR1 ; \ xori r12,r12,MSR_LE ; \ mtspr SPRN_SRR1,r12 ; \ - rfid ; /* return to userspace */ \ + RFI_TO_USER ; /* return to userspace */ \ b . ; /* prevent speculative execution */ #if defined(CONFIG_RELOCATABLE)
@@ -1276,7 +1276,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR) ld r11,PACA_EXGEN+EX_R11(r13) ld r12,PACA_EXGEN+EX_R12(r13) ld r13,PACA_EXGEN+EX_R13(r13) - HRFID + HRFI_TO_UNKNOWN b . #endif
@@ -1350,7 +1350,7 @@ masked_##_H##interrupt: \ ld r10,PACA_EXGEN+EX_R10(r13); \ ld r11,PACA_EXGEN+EX_R11(r13); \ GET_SCRATCH0(r13); \ - ##_H##rfid; \ + ##_H##RFI_TO_KERNEL; \ b . /*
@@ -1372,7 +1372,7 @@ TRAMP_REAL_BEGIN(kvmppc_skip_interrupt) addi r13, r13, 4 mtspr SPRN_SRR0, r13 GET_SCRATCH0(r13) - rfid + RFI_TO_KERNEL b . TRAMP_REAL_BEGIN(kvmppc_skip_Hinterrupt)
@@ -1384,7 +1384,7 @@ TRAMP_REAL_BEGIN(kvmppc_skip_Hinterrupt) addi r13, r13, 4 mtspr SPRN_HSRR0, r13 GET_SCRATCH0(r13) - hrfid + HRFI_TO_KERNEL b . #endif
arch/powerpc/kernel/idle_book3s.S +4 -3
@@ -9,6 +9,7 @@ */ #include <linux/threads.h> +#include <asm/exception-64s.h> #include <asm/processor.h> #include <asm/page.h> #include <asm/cputable.h>
@@ -178,7 +179,7 @@ _GLOBAL(pnv_powersave_common) mtmsrd r6, 1 /* clear RI before setting SRR0/1 */ mtspr SPRN_SRR0, r5 mtspr SPRN_SRR1, r7 - rfid + RFI_TO_KERNEL .globl pnv_enter_arch207_idle_mode pnv_enter_arch207_idle_mode:
@@ -668,7 +669,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) mtcr r6 mtspr SPRN_SRR1,r4 mtspr SPRN_SRR0,r5 - rfid + RFI_TO_KERNEL /* * R3 here contains the value that will be returned to the caller
@@ -689,4 +690,4 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) mtcr r6 mtspr SPRN_SRR1,r4 mtspr SPRN_SRR0,r5 - rfid + RFI_TO_KERNEL
arch/powerpc/kvm/book3s_hv_rmhandlers.S +3 -4
@@ -65,7 +65,7 @@ _GLOBAL_TOC(kvmppc_hv_entry_trampoline) mtmsrd r0,1 /* clear RI in MSR */ mtsrr0 r5 mtsrr1 r6 - RFI + RFI_TO_KERNEL kvmppc_call_hv_entry: ld r4, HSTATE_KVM_VCPU(r13)
@@ -171,7 +171,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) mtsrr0 r8 mtsrr1 r7 beq cr1, 13f /* machine check */ - RFI + RFI_TO_KERNEL /* On POWER7, we have external interrupts set to use HSRR0/1 */ 11: mtspr SPRN_HSRR0, r8
@@ -1018,8 +1018,7 @@ BEGIN_FTR_SECTION END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) ld r0, VCPU_GPR(R0)(r4) ld r4, VCPU_GPR(R4)(r4) - - hrfid + HRFI_TO_GUEST b . secondary_too_late:
arch/powerpc/kvm/book3s_rmhandlers.S +5 -2
@@ -46,6 +46,9 @@ #define FUNC(name) name +#define RFI_TO_KERNEL RFI +#define RFI_TO_GUEST RFI + .macro INTERRUPT_TRAMPOLINE intno .global kvmppc_trampoline_\intno
@@ -141,7 +144,7 @@ kvmppc_handler_skip_ins: GET_SCRATCH0(r13) /* And get back into the code */ - RFI + RFI_TO_KERNEL #endif /*
@@ -164,6 +167,6 @@ _GLOBAL_TOC(kvmppc_entry_trampoline) ori r5, r5, MSR_EE mtsrr0 r7 mtsrr1 r6 - RFI + RFI_TO_KERNEL #include "book3s_segment.S"
arch/powerpc/kvm/book3s_segment.S +2 -2
@@ -156,7 +156,7 @@ no_dcbz32_on: PPC_LL r9, SVCPU_R9(r3) PPC_LL r3, (SVCPU_R3)(r3) - RFI + RFI_TO_GUEST kvmppc_handler_trampoline_enter_end:
@@ -389,5 +389,5 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) cmpwi r12, BOOK3S_INTERRUPT_DOORBELL beqa BOOK3S_INTERRUPT_DOORBELL - RFI + RFI_TO_KERNEL kvmppc_handler_trampoline_exit_end:
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/powerpc-64s-simple-rfi-macro-conversions.patch queue-4.9/powerpc-64s-improve-rfi-l1-d-cache-flush-fallback.patch queue-4.9/powerpc-64s-fix-conversion-of-slb_miss_common-to-use-rfi_to_user-kernel.patch queue-4.9/powerpc-perf-fix-oops-when-grouping-different-pmu-events.patch
Michael Ellerman
reviewerRe: [PATCH v4.4 backport 2/3] powerpc/64s: Simple RFI macro conversions
In reply to Greg KHQuoted 10 lines · Greg KH
Quoted 7 lines · Michael Ellerman
Quoted 1 line · Michael Ellerman
Subject: [PATCH v4.4 backport 2/3] powerpc/64s: Simple RFI macro conversions
^ 4.9Gah, sorry just realised these last two have "v4.4" in the subject, but it should be "4.9".
Ah, good, I was wondering about that :)
Sorry for the confusion, I need to automate generation of the patch subjects obviously :)
Quoted 1 line
I'll apply these after lunch...
Thanks.
cheers