This is the start of the stable review cycle for the 4.19.68 release.
There are 85 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 Sat 24 Aug 2019 05:15:49 PM UTC.
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.19.68-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.68-rc1
Michal Simek <michal.simek(a)xilinx.com>
mmc: sdhci-of-arasan: Do now show error message in case of deffered probe
Maxim Mikityanskiy <maximmi(a)mellanox.com>
net/mlx5e: Use flow keys dissector to parse packets for ARFS
Huy Nguyen <huyn(a)mellanox.com>
net/mlx5e: Only support tx/rx pause setting for port owner
Ross Lagerwall <ross.lagerwall(a)citrix.com>
xen/netback: Reset nr_frags before freeing skb
Chris Packham <chris.packham(a)alliedtelesis.co.nz>
tipc: initialise addr_trail_end when setting node addresses
YueHaibing <yuehaibing(a)huawei.com>
team: Add vlan tx offload to hw_enc_features
Xin Long <lucien.xin(a)gmail.com>
sctp: fix the transport error_count check
zhengbin <zhengbin13(a)huawei.com>
sctp: fix memleak in sctp_send_reset_streams
Eric Dumazet <edumazet(a)google.com>
net/packet: fix race in tpacket_snd()
Wenwen Wang <wenwen(a)cs.uga.edu>
net/mlx4_en: fix a memory leak bug
Chen-Yu Tsai <wens(a)csie.org>
net: dsa: Check existence of .port_mdb_add callback before calling it
YueHaibing <yuehaibing(a)huawei.com>
bonding: Add vlan tx offload to hw_enc_features
Manish Chopra <manishc(a)marvell.com>
bnx2x: Fix VF's VLAN reconfiguration in reload.
Joerg Roedel <jroedel(a)suse.de>
iommu/amd: Move iommu_init_pci() to .init section
YueHaibing <yuehaibing(a)huawei.com>
Input: psmouse - fix build error of multiple definition
Dirk Morris <dmorris(a)metaloft.com>
netfilter: conntrack: Use consistent ct id hash calculation
Will Deacon <will(a)kernel.org>
arm64: ftrace: Ensure module ftrace trampoline is coherent with I-side
Mike Snitzer <snitzer(a)redhat.com>
dm: disable DISCARD if the underlying storage no longer supports it
Rodrigo Vivi <rodrigo.vivi(a)intel.com>
drm/i915/cfl: Add a new CFL PCI ID.
Tony Lindgren <tony(a)atomide.com>
USB: serial: option: Add Motorola modem UARTs
Bob Ham <bob.ham(a)puri.sm>
USB: serial: option: add the BroadMobi BM818 card
Yoshiaki Okamoto <yokamoto(a)allied-telesis.co.jp>
USB: serial: option: Add support for ZTE MF871A
Rogan Dawes <rogan(a)dawes.za.net>
USB: serial: option: add D-Link DWM-222 device ID
Oliver Neukum <oneukum(a)suse.com>
USB: CDC: fix sanity checks in CDC union parser
Oliver Neukum <oneukum(a)suse.com>
usb: cdc-acm: make sure a refcount is taken early enough
Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
usb: gadget: udc: renesas_usb3: Fix sysfs interface of "role"
Alan Stern <stern(a)rowland.harvard.edu>
USB: core: Fix races in character device registration and deregistraion
Jacopo Mondi <jacopo+renesas(a)jmondi.org>
iio: adc: max9611: Fix temperature reading in probe
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: dt3000: Fix rounding up of timer divisor
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: dt3000: Fix signed integer overflow 'divider * base'
Marc Zyngier <maz(a)kernel.org>
KVM: arm/arm64: Sync ICH_VMCR_EL2 back when about to block
Anders Roxell <anders.roxell(a)linaro.org>
arm64: KVM: regmap: Fix unexpected switch fall-through
Qian Cai <cai(a)lca.pw>
asm-generic: fix -Wtype-limits compiler warnings
YueHaibing <yuehaibing(a)huawei.com>
ocfs2: remove set but not used variable 'last_hash'
Yang Shi <yang.shi(a)linux.alibaba.com>
Revert "kmemleak: allow to coexist with fault injection"
Colin Ian King <colin.king(a)canonical.com>
drm/exynos: fix missing decrement of retry counter
Jeffrey Hugo <jeffrey.l.hugo(a)gmail.com>
drm: msm: Fix add_gpu_components
Jack Morgenstein <jackm(a)dev.mellanox.co.il>
IB/mad: Fix use-after-free in ib mad completion handling
Guy Levi <guyle(a)mellanox.com>
IB/mlx5: Fix MR registration flow to use UMR properly
Tony Luck <tony.luck(a)intel.com>
IB/core: Add mitigation for Spectre V1
Qian Cai <cai(a)lca.pw>
arm64/mm: fix variable 'pud' set but not used
Masami Hiramatsu <mhiramat(a)kernel.org>
arm64: unwind: Prohibit probing on return_address()
Qian Cai <cai(a)lca.pw>
arm64/efi: fix variable 'si' set but not used
Stephen Boyd <swboyd(a)chromium.org>
kbuild: Check for unknown options with cc-option usage in Kconfig and clang
Masahiro Yamada <yamada.masahiro(a)socionext.com>
kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules
Miquel Raynal <miquel.raynal(a)bootlin.com>
ata: libahci: do not complain in case of deferred probe
Wang Xiayang <xywang.sjtu(a)sjtu.edu.cn>
drm/amdgpu: fix a potential information leaking bug
Jia-Ju Bai <baijiaju1990(a)gmail.com>
scsi: qla2xxx: Fix possible fcport null-pointer dereferences
Don Brace <don.brace(a)microsemi.com>
scsi: hpsa: correct scsi command status issue after reset
Filipe Manana <fdmanana(a)suse.com>
Btrfs: fix deadlock between fiemap and transaction commits
YueHaibing <yuehaibing(a)huawei.com>
drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m
Kees Cook <keescook(a)chromium.org>
libata: zpodd: Fix small read overflow in zpodd_get_mech_type()
Numfor Mbiziwo-Tiapo <nums(a)google.com>
perf header: Fix use of unitialized value warning
Vince Weaver <vincent.weaver(a)maine.edu>
perf header: Fix divide by zero error if f_header.attr_size==0
Lucas Stach <l.stach(a)pengutronix.de>
irqchip/irq-imx-gpcv2: Forward irq type to parent
Nianyao Tang <tangnianyao(a)huawei.com>
irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail
YueHaibing <yuehaibing(a)huawei.com>
xen/pciback: remove set but not used variable 'old_state'
Geert Uytterhoeven <geert+renesas(a)glider.be>
clk: renesas: cpg-mssr: Fix reset control race condition
Chunyan Zhang <chunyan.zhang(a)unisoc.com>
clk: sprd: Select REGMAP_MMIO to avoid compile errors
Codrin Ciubotariu <codrin.ciubotariu(a)microchip.com>
clk: at91: generated: Truncate divisor to GENERATED_MAX_DIV + 1
Vincent Chen <vincent.chen(a)sifive.com>
riscv: Make __fstate_clean() work correctly.
Florian Westphal <fw(a)strlen.de>
netfilter: ebtables: also count base chain policies
Denis Kirjanov <kda(a)linux-powerpc.org>
net: usb: pegasus: fix improper read if get_registers() fail
Oliver Neukum <oneukum(a)suse.com>
Input: iforce - add sanity checks
Oliver Neukum <oneukum(a)suse.com>
Input: kbtab - sanity check for endpoint type
Hillf Danton <hdanton(a)sina.com>
HID: hiddev: do cleanup in failure of opening a device
Hillf Danton <hdanton(a)sina.com>
HID: hiddev: avoid opening a disconnected device
Oliver Neukum <oneukum(a)suse.com>
HID: holtek: test for sanity of intfdata
Hui Wang <hui.wang(a)canonical.com>
ALSA: hda - Let all conexant codec enter D3 when rebooting
Hui Wang <hui.wang(a)canonical.com>
ALSA: hda - Add a generic reboot_notify
Wenwen Wang <wenwen(a)cs.uga.edu>
ALSA: hda - Fix a memory leak bug
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda - Apply workaround for another AMD chip 1022:1487
Hui Peng <benquike(a)gmail.com>
ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit
Hui Peng <benquike(a)gmail.com>
ALSA: usb-audio: Fix a stack buffer overflow bug in check_input_term
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/realtek - Add quirk for HP Envy x360
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: add missing isync to the cpu_reset TLB code
Viresh Kumar <viresh.kumar(a)linaro.org>
cpufreq: schedutil: Don't skip freq update when limits change
Fabrice Gasnier <fabrice.gasnier(a)st.com>
Revert "pwm: Set class for exported channels in sysfs"
Isaac J. Manjarres <isaacm(a)codeaurora.org>
mm/usercopy: use memory range to be accessed for wraparound check
Miles Chen <miles.chen(a)mediatek.com>
mm/memcontrol.c: fix use after free in mem_cgroup_iter()
Yang Shi <yang.shi(a)linux.alibaba.com>
mm: mempolicy: handle vma with unmovable pages mapped correctly in mbind
Yang Shi <yang.shi(a)linux.alibaba.com>
mm: mempolicy: make the behavior consistent when MPOL_MF_MOVE* and MPOL_MF_STRICT were specified
Ralph Campbell <rcampbell(a)nvidia.com>
mm/hmm: fix bad subpage pointer in try_to_unmap_one
NeilBrown <neilb(a)suse.com>
seq_file: fix problem when seeking mid-record
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
sh: kernel: hw_breakpoint: Fix missing break in switch statement
-------------
Diffstat:
Makefile | 4 +-
arch/arm64/include/asm/efi.h | 6 +-
arch/arm64/include/asm/pgtable.h | 4 +-
arch/arm64/kernel/ftrace.c | 21 +++--
arch/arm64/kernel/return_address.c | 3 +
arch/arm64/kernel/stacktrace.c | 3 +
arch/arm64/kvm/regmap.c | 5 ++
arch/riscv/include/asm/switch_to.h | 2 +-
arch/sh/kernel/hw_breakpoint.c | 1 +
arch/xtensa/kernel/setup.c | 1 +
drivers/ata/libahci_platform.c | 3 +
drivers/ata/libata-zpodd.c | 2 +-
drivers/clk/at91/clk-generated.c | 2 +
drivers/clk/renesas/renesas-cpg-mssr.c | 16 +---
drivers/clk/sprd/Kconfig | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +-
drivers/gpu/drm/bridge/Kconfig | 1 +
drivers/gpu/drm/exynos/exynos_drm_scaler.c | 4 +-
drivers/gpu/drm/msm/msm_drv.c | 3 +-
drivers/hid/hid-holtek-kbd.c | 9 +-
drivers/hid/usbhid/hiddev.c | 12 +++
drivers/iio/adc/max9611.c | 2 +-
drivers/infiniband/core/mad.c | 20 ++---
drivers/infiniband/core/user_mad.c | 6 +-
drivers/infiniband/hw/mlx5/mr.c | 27 ++----
drivers/input/joystick/iforce/iforce-usb.c | 5 ++
drivers/input/mouse/trackpoint.h | 3 +-
drivers/input/tablet/kbtab.c | 6 +-
drivers/iommu/amd_iommu_init.c | 2 +-
drivers/irqchip/irq-gic-v3-its.c | 2 +-
drivers/irqchip/irq-imx-gpcv2.c | 1 +
drivers/md/dm-core.h | 1 +
drivers/md/dm-rq.c | 11 ++-
drivers/md/dm.c | 20 ++++-
drivers/mmc/host/sdhci-of-arasan.c | 3 +-
drivers/net/bonding/bond_main.c | 2 +
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 7 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 +
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 17 ++--
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 +-
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 97 +++++++-------------
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 3 +
drivers/net/team/team.c | 2 +
drivers/net/usb/pegasus.c | 2 +-
drivers/net/xen-netback/netback.c | 2 +
drivers/pwm/sysfs.c | 1 -
drivers/scsi/hpsa.c | 12 ++-
drivers/scsi/qla2xxx/qla_init.c | 2 +-
drivers/staging/comedi/drivers/dt3000.c | 8 +-
drivers/usb/class/cdc-acm.c | 12 +--
drivers/usb/core/file.c | 10 +--
drivers/usb/core/message.c | 4 +-
drivers/usb/gadget/udc/renesas_usb3.c | 5 +-
drivers/usb/serial/option.c | 10 +++
drivers/xen/xen-pciback/conf_space_capability.c | 3 +-
fs/btrfs/backref.c | 2 +-
fs/btrfs/transaction.c | 22 ++++-
fs/btrfs/transaction.h | 3 +
fs/ocfs2/xattr.c | 3 -
fs/seq_file.c | 2 +-
include/asm-generic/getorder.h | 50 +++++------
include/drm/i915_pciids.h | 1 +
include/kvm/arm_vgic.h | 1 +
kernel/sched/cpufreq_schedutil.c | 14 ++-
mm/kmemleak.c | 2 +-
mm/memcontrol.c | 39 +++++---
mm/mempolicy.c | 100 +++++++++++++++------
mm/rmap.c | 8 ++
mm/usercopy.c | 2 +-
net/bridge/netfilter/ebtables.c | 28 +++---
net/dsa/switch.c | 3 +
net/netfilter/nf_conntrack_core.c | 16 ++--
net/packet/af_packet.c | 7 ++
net/sctp/sm_sideeffect.c | 2 +-
net/sctp/stream.c | 1 +
net/tipc/addr.c | 1 +
scripts/Kconfig.include | 2 +-
scripts/Makefile.modpost | 2 +-
sound/pci/hda/hda_generic.c | 21 ++++-
sound/pci/hda/hda_generic.h | 1 +
sound/pci/hda/hda_intel.c | 3 +
sound/pci/hda/patch_conexant.c | 15 +---
sound/pci/hda/patch_realtek.c | 12 +--
sound/usb/mixer.c | 37 ++++++--
tools/perf/util/header.c | 9 +-
virt/kvm/arm/arm.c | 11 +++
virt/kvm/arm/vgic/vgic-v2.c | 9 +-
virt/kvm/arm/vgic/vgic-v3.c | 7 +-
virt/kvm/arm/vgic/vgic.c | 11 +++
virt/kvm/arm/vgic/vgic.h | 2 +
90 files changed, 551 insertions(+), 316 deletions(-)
If a program attempts to punch a hole on an inline data file, we need
to convert it to a normal file first.
This was detected using ext4/032 using the adv configuration. Simple
reproducer:
mke2fs -Fq -t ext4 -O inline_data /dev/vdc
mount /vdc
echo "" > /vdc/testfile
xfs_io -c 'truncate 33554432' /vdc/testfile
xfs_io -c 'fpunch 0 1048576' /vdc/testfile
umount /vdc
e2fsck -fy /dev/vdc
Cc: stable(a)vger.kernel.org
Signed-off-by: Theodore Ts'o <tytso(a)mit.edu>
---
fs/ext4/inode.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 2b1c58da8d1e..e567f0229d4e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4236,6 +4236,15 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
trace_ext4_punch_hole(inode, offset, length, 0);
+ ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
+ if (ext4_has_inline_data(inode)) {
+ down_write(&EXT4_I(inode)->i_mmap_sem);
+ ret = ext4_convert_inline_data(inode);
+ up_write(&EXT4_I(inode)->i_mmap_sem);
+ if (ret)
+ return ret;
+ }
+
/*
* Write out all dirty pages to avoid race conditions
* Then release them.
--
2.23.0
Before 32-bit support, pti_clone_pmds() always adds PMD_SIZE to addr.
This behavior changes after the 32-bit support: pti_clone_pgtable()
increases addr by PUD_SIZE for pud_none(*pud) case, and increases addr by
PMD_SIZE for pmd_none(*pmd) case. However, this is not accurate because
addr may not be PUD_SIZE/PMD_SIZE aligned.
Fix this issue by properly rounding up addr to next PUD_SIZE/PMD_SIZE
in these two cases.
The following explains how we debugged this issue:
We use huge page for hot text and thus reduces iTLB misses. As we
benchmark 5.2 based kernel (vs. 4.16 based), we found ~2.5x more
iTLB misses.
To figure out the issue, I use a debug patch that dumps page table for
a pid. The following are information from the workload pid.
For the 4.16 based kernel:
host-4.16 # grep "x pmd" /sys/kernel/debug/page_tables/dump_pid
0x0000000000600000-0x0000000000e00000 8M USR ro PSE x pmd
0xffffffff81a00000-0xffffffff81c00000 2M ro PSE x pmd
For the 5.2 based kernel before this patch:
host-5.2-before # grep "x pmd" /sys/kernel/debug/page_tables/dump_pid
0x0000000000600000-0x0000000000e00000 8M USR ro PSE x pmd
The 8MB text in pmd is from user space. 4.16 kernel has 1 pmd for the
irq entry table; while 4.16 kernel doesn't have it.
For the 5.2 based kernel after this patch:
host-5.2-after # grep "x pmd" /sys/kernel/debug/page_tables/dump_pid
0x0000000000600000-0x0000000000e00000 8M USR ro PSE x pmd
0xffffffff81000000-0xffffffff81e00000 14M ro PSE GLB x pmd
So after this patch, the 5.2 based kernel has 7 PMDs instead of 1 PMD
in 4.16 kernel. This further reduces iTLB miss rate
Cc: stable(a)vger.kernel.org # v4.19+
Fixes: 16a3fe634f6a ("x86/mm/pti: Clone kernel-image on PTE level for 32 bit")
Reviewed-by: Rik van Riel <riel(a)surriel.com>
Signed-off-by: Song Liu <songliubraving(a)fb.com>
Cc: Joerg Roedel <jroedel(a)suse.de>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Dave Hansen <dave.hansen(a)linux.intel.com>
Cc: Andy Lutomirski <luto(a)kernel.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
---
arch/x86/mm/pti.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c
index b196524759ec..1337494e22ef 100644
--- a/arch/x86/mm/pti.c
+++ b/arch/x86/mm/pti.c
@@ -330,13 +330,13 @@ pti_clone_pgtable(unsigned long start, unsigned long end,
pud = pud_offset(p4d, addr);
if (pud_none(*pud)) {
- addr += PUD_SIZE;
+ addr = round_up(addr + 1, PUD_SIZE);
continue;
}
pmd = pmd_offset(pud, addr);
if (pmd_none(*pmd)) {
- addr += PMD_SIZE;
+ addr = round_up(addr + 1, PMD_SIZE);
continue;
}
--
2.17.1
Currently, we don't call dma_set_max_seg_size() for i915 because we
intentionally do not limit the segment length that the device supports.
However, this results in a warning being emitted if we try to map
anything larger than SZ_64K on a kernel with CONFIG_DMA_API_DEBUG_SG
enabled:
[ 7.751926] DMA-API: i915 0000:00:02.0: mapping sg segment longer
than device claims to support [len=98304] [max=65536]
[ 7.751934] WARNING: CPU: 5 PID: 474 at kernel/dma/debug.c:1220
debug_dma_map_sg+0x20f/0x340
This was originally brought up on
https://bugs.freedesktop.org/show_bug.cgi?id=108517 , and the consensus
there was it wasn't really useful to set a limit (and that dma-debug
isn't really all that useful for i915 in the first place). Unfortunately
though, CONFIG_DMA_API_DEBUG_SG is enabled in the debug configs for
various distro kernels. Since a WARN_ON() will disable automatic problem
reporting (and cause any CI with said option enabled to start
complaining), we really should just fix the problem.
Note that as me and Chris Wilson discussed, the other solution for this
would be to make DMA-API not make such assumptions when a driver hasn't
explicitly set a maximum segment size. But, taking a look at the commit
which originally introduced this behavior, commit 78c47830a5cb
("dma-debug: check scatterlist segments"), there is an explicit mention
of this assumption and how it applies to devices with no segment size:
Conversely, devices which are less limited than the rather
conservative defaults, or indeed have no limitations at all
(e.g. GPUs with their own internal MMU), should be encouraged to
set appropriate dma_parms, as they may get more efficient DMA
mapping performance out of it.
So unless there's any concerns (I'm open to discussion!), let's just
follow suite and call dma_set_max_seg_size() with UINT_MAX as our limit
to silence any warnings.
Changes since v3:
* Drop patch for enabling CONFIG_DMA_API_DEBUG_SG in CI. It looks like
just turning it on causes the kernel to spit out bogus WARN_ONs()
during some igt tests which would otherwise require teaching igt to
disable the various DMA-API debugging options causing this. This is
too much work to be worth it, since DMA-API debugging is useless for
us. So, we'll just settle with this single patch to squelch WARN_ONs()
during driver load for users that have CONFIG_DMA_API_DEBUG_SG turned
on for some reason.
* Move dma_set_max_seg_size() call into i915_driver_hw_probe() - Chris
Wilson
Signed-off-by: Lyude Paul <lyude(a)redhat.com>
Reviewed-by: Chris Wilson <chris(a)chris-wilson.co.uk>
Cc: <stable(a)vger.kernel.org> # v4.18+
---
drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index b5b2a64753e6..020696726f9e 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1279,6 +1279,12 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
pci_set_master(pdev);
+ /*
+ * We don't have a max segment size, so set it to the max so sg's
+ * debugging layer doesn't complain
+ */
+ dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+
/* overlay on gen2 is broken and can't address above 1G */
if (IS_GEN(dev_priv, 2)) {
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(30));
--
2.21.0
Currently, we don't call dma_set_max_seg_size() for i915 because we
intentionally do not limit the segment length that the device supports.
However, this results in a warning being emitted if we try to map
anything larger than SZ_64K on a kernel with CONFIG_DMA_API_DEBUG_SG
enabled:
[ 7.751926] DMA-API: i915 0000:00:02.0: mapping sg segment longer
than device claims to support [len=98304] [max=65536]
[ 7.751934] WARNING: CPU: 5 PID: 474 at kernel/dma/debug.c:1220
debug_dma_map_sg+0x20f/0x340
This was originally brought up on
https://bugs.freedesktop.org/show_bug.cgi?id=108517 , and the consensus
there was it wasn't really useful to set a limit (and that dma-debug
isn't really all that useful for i915 in the first place). Unfortunately
though, CONFIG_DMA_API_DEBUG_SG is enabled in the debug configs for
various distro kernels. Since a WARN_ON() will disable automatic problem
reporting (and cause any CI with said option enabled to start
complaining), we really should just fix the problem.
Note that as me and Chris Wilson discussed, the other solution for this
would be to make DMA-API not make such assumptions when a driver hasn't
explicitly set a maximum segment size. But, taking a look at the commit
which originally introduced this behavior, commit 78c47830a5cb
("dma-debug: check scatterlist segments"), there is an explicit mention
of this assumption and how it applies to devices with no segment size:
Conversely, devices which are less limited than the rather
conservative defaults, or indeed have no limitations at all
(e.g. GPUs with their own internal MMU), should be encouraged to
set appropriate dma_parms, as they may get more efficient DMA
mapping performance out of it.
So unless there's any concerns (I'm open to discussion!), let's just
follow suite and call dma_set_max_seg_size() with UINT_MAX as our limit
to silence any warnings.
Signed-off-by: Lyude Paul <lyude(a)redhat.com>
Cc: Chris Wilson <chris(a)chris-wilson.co.uk>
Cc: <stable(a)vger.kernel.org> # v4.18+
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 0b81e0b64393..a1475039d182 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3152,6 +3152,11 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt)
if (ret)
return ret;
+ /* We don't have a max segment size, so set it to the max so sg's
+ * debugging layer doesn't complain
+ */
+ dma_set_max_seg_size(ggtt->vm.dma, UINT_MAX);
+
if ((ggtt->vm.total - 1) >> 32) {
DRM_ERROR("We never expected a Global GTT with more than 32bits"
" of address space! Found %lldM!\n",
--
2.21.0
Commit 871f1f2bcb01 ("platform/x86: intel_int0002_vgpio: Only implement
irq_set_wake on Bay Trail") removed the irq_set_wake method from the
struct irq_chip used on Cherry Trail, but it did not set
IRQCHIP_SKIP_SET_WAKE causing kernel/irq/manage.c: set_irq_wake_real()
to return -ENXIO.
This causes the kernel to no longer see PME events reported through the
INT0002 device as wakeup events. Which e.g. breaks wakeup by the (USB)
keyboard on many Cherry Trail 2-in-1 devices.
Cc: stable(a)vger.kernel.org
Fixes: 871f1f2bcb01 ("platform/x86: intel_int0002_vgpio: Only implement irq_set_wake on Bay Trail")
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
---
drivers/platform/x86/intel_int0002_vgpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c
index d9542c661ddc..9ea1a2a19f86 100644
--- a/drivers/platform/x86/intel_int0002_vgpio.c
+++ b/drivers/platform/x86/intel_int0002_vgpio.c
@@ -144,6 +144,7 @@ static struct irq_chip int0002_cht_irqchip = {
* No set_wake, on CHT the IRQ is typically shared with the ACPI SCI
* and we don't want to mess with the ACPI SCI irq settings.
*/
+ .flags = IRQCHIP_SKIP_SET_WAKE,
};
static const struct x86_cpu_id int0002_cpu_ids[] = {
--
2.22.0
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: b63f20a778c88b6a04458ed6ffc69da953d3a109
Gitweb: https://git.kernel.org/tip/b63f20a778c88b6a04458ed6ffc69da953d3a109
Author: Sean Christopherson <sean.j.christopherson(a)intel.com>
AuthorDate: Thu, 22 Aug 2019 14:11:22 -07:00
Committer: Thomas Gleixner <tglx(a)linutronix.de>
CommitterDate: Fri, 23 Aug 2019 17:38:13 +02:00
x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386
Use 'lea' instead of 'add' when adjusting %rsp in CALL_NOSPEC so as to
avoid clobbering flags.
KVM's emulator makes indirect calls into a jump table of sorts, where
the destination of the CALL_NOSPEC is a small blob of code that performs
fast emulation by executing the target instruction with fixed operands.
adcb_al_dl:
0x000339f8 <+0>: adc %dl,%al
0x000339fa <+2>: ret
A major motiviation for doing fast emulation is to leverage the CPU to
handle consumption and manipulation of arithmetic flags, i.e. RFLAGS is
both an input and output to the target of CALL_NOSPEC. Clobbering flags
results in all sorts of incorrect emulation, e.g. Jcc instructions often
take the wrong path. Sans the nops...
asm("push %[flags]; popf; " CALL_NOSPEC " ; pushf; pop %[flags]\n"
0x0003595a <+58>: mov 0xc0(%ebx),%eax
0x00035960 <+64>: mov 0x60(%ebx),%edx
0x00035963 <+67>: mov 0x90(%ebx),%ecx
0x00035969 <+73>: push %edi
0x0003596a <+74>: popf
0x0003596b <+75>: call *%esi
0x000359a0 <+128>: pushf
0x000359a1 <+129>: pop %edi
0x000359a2 <+130>: mov %eax,0xc0(%ebx)
0x000359b1 <+145>: mov %edx,0x60(%ebx)
ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK);
0x000359a8 <+136>: mov -0x10(%ebp),%eax
0x000359ab <+139>: and $0x8d5,%edi
0x000359b4 <+148>: and $0xfffff72a,%eax
0x000359b9 <+153>: or %eax,%edi
0x000359bd <+157>: mov %edi,0x4(%ebx)
For the most part this has gone unnoticed as emulation of guest code
that can trigger fast emulation is effectively limited to MMIO when
running on modern hardware, and MMIO is rarely, if ever, accessed by
instructions that affect or consume flags.
Breakage is almost instantaneous when running with unrestricted guest
disabled, in which case KVM must emulate all instructions when the guest
has invalid state, e.g. when the guest is in Big Real Mode during early
BIOS.
Fixes: 776b043848fd2 ("x86/retpoline: Add initial retpoline support")
Fixes: 1a29b5b7f347a ("KVM: x86: Make indirect calls in emulator speculation safe")
Signed-off-by: Sean Christopherson <sean.j.christopherson(a)intel.com>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz(a)infradead.org>
Cc: stable(a)vger.kernel.org
Link: https://lkml.kernel.org/r/20190822211122.27579-1-sean.j.christopherson@inte…
---
arch/x86/include/asm/nospec-branch.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 109f974..80bc209 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -192,7 +192,7 @@
" lfence;\n" \
" jmp 902b;\n" \
" .align 16\n" \
- "903: addl $4, %%esp;\n" \
+ "903: lea 4(%%esp), %%esp;\n" \
" pushl %[thunk_target];\n" \
" ret;\n" \
" .align 16\n" \