Skip to contentSkip to conversation

Linux 5.3.6

DISCUSSION Greg KH 1 participant 2 messages Oct 12, 2019 Stable branch

lore
Share & tools
lore

Greg KH

author maintainer
#0 lore raw

I'm announcing the release of the 5.3.6 kernel.

All users of the 5.3 kernel series must upgrade.

The updated 5.3.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.3.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                                              |    2 
 arch/arm/boot/dts/omap3-gta04.dtsi                    |    1 
 arch/mips/include/asm/cpu-features.h                  |   16 +
 arch/mips/include/asm/cpu.h                           |    4 
 arch/mips/kernel/cpu-probe.c                          |    6 
 arch/mips/kernel/proc.c                               |    4 
 arch/powerpc/include/asm/cputable.h                   |    5 
 arch/powerpc/include/asm/kvm_ppc.h                    |    1 
 arch/powerpc/include/asm/xive.h                       |    9 
 arch/powerpc/kernel/dt_cpu_ftrs.c                     |   32 ++
 arch/powerpc/kernel/head_32.S                         |    6 
 arch/powerpc/kernel/mce.c                             |   11 
 arch/powerpc/kernel/mce_power.c                       |   19 +
 arch/powerpc/kvm/book3s.c                             |    8 
 arch/powerpc/kvm/book3s_hv.c                          |   24 +
 arch/powerpc/kvm/book3s_hv_rm_mmu.c                   |   42 ++-
 arch/powerpc/kvm/book3s_hv_rmhandlers.S               |   38 ++-
 arch/powerpc/kvm/book3s_xive.c                        |   60 ++++
 arch/powerpc/kvm/book3s_xive.h                        |    2 
 arch/powerpc/kvm/book3s_xive_native.c                 |   23 +
 arch/powerpc/kvm/powerpc.c                            |    3 
 arch/powerpc/mm/book3s32/mmu.c                        |    9 
 arch/powerpc/mm/book3s64/hash_native.c                |   31 ++
 arch/powerpc/mm/book3s64/hash_utils.c                 |    9 
 arch/powerpc/mm/book3s64/radix_tlb.c                  |   84 +++++-
 arch/powerpc/mm/init_64.c                             |   17 +
 arch/powerpc/mm/kasan/kasan_init_32.c                 |   57 +++-
 arch/powerpc/mm/ptdump/ptdump.c                       |    2 
 arch/powerpc/platforms/powernv/opal.c                 |   11 
 arch/powerpc/platforms/powernv/pci-ioda-tce.c         |   18 +
 arch/powerpc/platforms/pseries/lpar.c                 |    8 
 arch/powerpc/sysdev/xive/common.c                     |   87 +++++-
 arch/powerpc/sysdev/xive/native.c                     |    7 
 arch/riscv/kernel/entry.S                             |    6 
 arch/s390/kernel/process.c                            |   22 +
 arch/s390/kernel/topology.c                           |    3 
 arch/s390/kvm/kvm-s390.c                              |    8 
 arch/x86/kvm/vmx/nested.c                             |    2 
 arch/x86/kvm/x86.c                                    |   38 +--
 arch/x86/purgatory/Makefile                           |    1 
 block/blk-mq-sched.c                                  |    2 
 block/blk.h                                           |    2 
 crypto/skcipher.c                                     |   42 +--
 drivers/block/nbd.c                                   |   39 ++-
 drivers/crypto/caam/caamalg_desc.c                    |    9 
 drivers/crypto/caam/caamalg_desc.h                    |    2 
 drivers/crypto/caam/error.c                           |    1 
 drivers/crypto/caam/qi.c                              |    5 
 drivers/crypto/caam/regs.h                            |    1 
 drivers/crypto/cavium/zip/zip_main.c                  |    3 
 drivers/crypto/ccree/cc_aead.c                        |    2 
 drivers/crypto/ccree/cc_fips.c                        |    8 
 drivers/crypto/qat/qat_common/adf_common_drv.h        |    2 
 drivers/devfreq/tegra-devfreq.c                       |   12 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c                |    3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c               |    3 
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c            |    2 
 drivers/gpu/drm/arm/malidp_hw.c                       |    3 
 drivers/gpu/drm/drm_atomic_uapi.c                     |    3 
 drivers/gpu/drm/drm_ioctl.c                           |    7 
 drivers/gpu/drm/i915/display/intel_display.c          |   12 
 drivers/gpu/drm/i915/display/intel_display.h          |    2 
 drivers/gpu/drm/i915/display/intel_dp.c               |  184 +++++++-------
 drivers/gpu/drm/i915/display/intel_dp.h               |    6 
 drivers/gpu/drm/i915/display/intel_dp_mst.c           |    2 
 drivers/gpu/drm/i915/gvt/scheduler.c                  |   28 +-
 drivers/gpu/drm/i915/i915_drv.h                       |    1 
 drivers/gpu/drm/i915/i915_gem_gtt.c                   |   12 
 drivers/gpu/drm/i915/i915_vgpu.c                      |    1 
 drivers/gpu/drm/msm/dsi/dsi_host.c                    |    8 
 drivers/gpu/drm/nouveau/dispnv50/disp.c               |    3 
 drivers/gpu/drm/omapdrm/dss/dss.c                     |    2 
 drivers/gpu/drm/radeon/radeon_drv.c                   |   31 ++
 drivers/gpu/drm/radeon/radeon_kms.c                   |   25 --
 drivers/hwtracing/coresight/coresight-etm4x.c         |   15 +
 drivers/i2c/busses/i2c-qcom-geni.c                    |   12 
 drivers/iommu/amd_iommu.c                             |    3 
 drivers/mmc/host/sdhci-of-esdhc.c                     |    7 
 drivers/mmc/host/sdhci-tegra.c                        |   48 ++-
 drivers/mmc/host/sdhci.c                              |   27 +-
 drivers/mmc/host/sdhci.h                              |    1 
 drivers/net/can/spi/mcp251x.c                         |   19 +
 drivers/net/dsa/microchip/ksz_common.h                |    2 
 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c |    6 
 drivers/net/ethernet/netronome/nfp/abm/cls.c          |   14 -
 drivers/net/ieee802154/atusb.c                        |    3 
 drivers/ntb/test/ntb_perf.c                           |    2 
 drivers/nvdimm/btt.c                                  |    8 
 drivers/nvdimm/bus.c                                  |    2 
 drivers/nvdimm/namespace_devs.c                       |    7 
 drivers/nvdimm/pfn_devs.c                             |    2 
 drivers/nvdimm/region.c                               |    4 
 drivers/nvdimm/region_devs.c                          |    4 
 drivers/nvdimm/security.c                             |    4 
 drivers/pci/controller/pci-hyperv.c                   |    2 
 drivers/pci/controller/vmd.c                          |   25 +-
 drivers/pci/pci.c                                     |    2 
 drivers/power/supply/sbs-battery.c                    |   27 +-
 drivers/pwm/pwm-stm32-lp.c                            |    6 
 drivers/s390/block/dasd_eckd.c                        |   81 ------
 drivers/s390/char/sclp_early.c                        |    2 
 drivers/s390/cio/ccwgroup.c                           |    2 
 drivers/s390/cio/css.c                                |    2 
 drivers/staging/erofs/dir.c                           |   11 
 drivers/staging/erofs/unzip_vle.c                     |   37 ++
 drivers/staging/erofs/zmap.c                          |    6 
 drivers/thermal/qcom/tsens-8960.c                     |    2 
 drivers/thermal/qcom/tsens-v0_1.c                     |   12 
 drivers/thermal/qcom/tsens-v1.c                       |    1 
 drivers/thermal/qcom/tsens.h                          |    1 
 drivers/thermal/thermal_core.c                        |    2 
 drivers/thermal/thermal_hwmon.c                       |    8 
 drivers/watchdog/aspeed_wdt.c                         |    4 
 drivers/watchdog/imx2_wdt.c                           |    4 
 drivers/xen/balloon.c                                 |    1 
 drivers/xen/pci.c                                     |   21 +
 drivers/xen/xenbus/xenbus_dev_frontend.c              |   20 +
 fs/9p/vfs_file.c                                      |    3 
 fs/btrfs/tests/btrfs-tests.c                          |    8 
 fs/ceph/caps.c                                        |    9 
 fs/ceph/inode.c                                       |    7 
 fs/ceph/mds_client.c                                  |    4 
 fs/fuse/cuse.c                                        |    1 
 fs/fuse/inode.c                                       |    7 
 fs/nfs/nfs4xdr.c                                      |    2 
 fs/nfs/pnfs.c                                         |    9 
 fs/statfs.c                                           |   17 -
 include/linux/memremap.h                              |    1 
 include/linux/sched/mm.h                              |    2 
 include/sound/soc-dapm.h                              |    2 
 include/trace/events/writeback.h                      |   38 +--
 include/uapi/linux/sched.h                            |    2 
 kernel/elfcore.c                                      |    1 
 kernel/locking/qspinlock_paravirt.h                   |    2 
 kernel/sched/core.c                                   |    4 
 kernel/sched/membarrier.c                             |    2 
 kernel/time/tick-broadcast-hrtimer.c                  |   57 ++--
 kernel/time/timer.c                                   |    8 
 kernel/trace/bpf_trace.c                              |   26 +-
 kernel/trace/trace_events_hist.c                      |    2 
 mm/usercopy.c                                         |    8 
 net/9p/client.c                                       |    1 
 net/mac80211/util.c                                   |   13 -
 net/netfilter/nf_tables_api.c                         |    7 
 net/netfilter/nft_lookup.c                            |    3 
 net/sunrpc/clnt.c                                     |   20 +
 net/sunrpc/sched.c                                    |    5 
 net/sunrpc/xprtrdma/transport.c                       |    4 
 net/sunrpc/xprtrdma/verbs.c                           |   26 +-
 net/wireless/nl80211.c                                |   41 +++
 net/wireless/reg.c                                    |    2 
 net/wireless/scan.c                                   |    7 
 net/wireless/wext-compat.c                            |    2 
 security/integrity/ima/ima_crypto.c                   |   10 
 sound/soc/codecs/sgtl5000.c                           |  224 +++++++++++++++---
 tools/lib/bpf/btf_dump.c                              |    1 
 tools/lib/traceevent/Makefile                         |    4 
 tools/lib/traceevent/event-parse.c                    |    3 
 tools/perf/Makefile.config                            |    2 
 tools/perf/arch/x86/util/unwind-libunwind.c           |    2 
 tools/perf/builtin-stat.c                             |    5 
 tools/perf/util/header.c                              |    2 
 tools/perf/util/probe-event.c                         |    1 
 tools/perf/util/stat.c                                |   17 +
 tools/perf/util/stat.h                                |    1 
 tools/testing/nvdimm/test/nfit_test.h                 |    4 
 tools/testing/selftests/bpf/progs/strobemeta.h        |    5 
 tools/testing/selftests/pidfd/Makefile                |    2 
 tools/testing/selftests/seccomp/seccomp_bpf.c         |    5 
 tools/testing/selftests/tpm2/Makefile                 |    1 
 170 files changed, 1614 insertions(+), 701 deletions(-)

Adrian Hunter (1):
mmc: sdhci: Let drivers define their DMA mask

Alexander Sverdlin (1):
crypto: qat - Silence smp_processor_id() warning

Alexey Kardashevskiy (1):
powerpc/powernv/ioda: Fix race in TCE level allocation

Allan Zhang (1):
bpf: Fix bpf_event_output re-entry issue

Anders Roxell (1):
drm: mali-dp: Mark expected switch fall-through

Andrei Dulea (1):
iommu/amd: Fix downgrading default page-sizes in alloc_pte()

Andrew Donnellan (1):
powerpc/powernv: Restrict OPAL symbol map to only be readable by root

Andrew Murray (1):
coresight: etm4x: Use explicit barriers on enable/disable

Andrii Nakryiko (2):
selftests/bpf: adjust strobemeta loop to satisfy latest clang
libbpf: fix false uninitialized variable warning

Aneesh Kumar K.V (6):
powerpc/book3s64/mm: Don't do tlbie fixup for some hardware revisions powerpc/book3s64/radix: Rename CPU_FTR_P9_TLBIE_BUG feature flag powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9 libnvdimm/altmap: Track namespace boundaries in altmap libnvdimm/region: Initialize bad block for volatile namespaces
libnvdimm: Fix endian conversion issues

Arnaldo Carvalho de Melo (1):
perf unwind: Fix libunwind build failure on i386 systems

Arvind Sankar (1):
x86/purgatory: Disable the stackleak GCC plugin for the purgatory

Balasubramani Vivekanandan (1):
tick: broadcast-hrtimer: Fix a race in bc_set_next

Balbir Singh (1):
powerpc/mce: Fix MCE handling for huge pages

Chengguang Xu (1):
9p: avoid attaching writeback_fid on mmap with type PRIVATE

Christophe Leroy (7):
powerpc/603: Fix handling of the DIRTY flag powerpc/32s: Fix boot failure with DEBUG_PAGEALLOC without KASAN. powerpc/ptdump: Fix addresses display on PPC32 powerpc/kasan: Fix parallel loading of modules. powerpc/kasan: Fix shadow area set up for modules. powerpc/mm: Add a helper to select PAGE_KERNEL_RO or PAGE_READONLY powerpc/mm: Fix an Oops in kasan_mmu_init()

Chuck Lever (2):
xprtrdma: Toggle XPRT_CONGESTED in xprtrdma's slot methods
xprtrdma: Send Queue size grows after a reconnect

Cédric Le Goater (1):
KVM: PPC: Book3S HV: XIVE: Free escalation interrupts before disabling the VP

Daniel Vetter (2):
drm/atomic: Reject FLIP_ASYNC unconditionally drm/atomic: Take the atomic toys away from X

Danielle Ratson (1):
mlxsw: spectrum_flower: Fail in case user specifies multiple mirror actions

Dave Jiang (1):
libnvdimm: prevent nvdimm from requesting key when security is disabled

David Hildenbrand (1):
xen/balloon: Set pages PageOffline() in balloon_add_region()

Dexuan Cui (1):

      PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it

Dmitry Osipenko (1):
PM / devfreq: tegra: Fix kHz to Hz conversion

Eric Sandeen (1):
vfs: Fix EOVERFLOW testing in put_compat_statfs64

Erqi Chen (1):
ceph: reconnect connection if session hang in opening state

Fabrice Gasnier (1):
pwm: stm32-lp: Add check in case requested period cannot be achieved

Felix Kuehling (1):
drm/amdgpu: Fix KFD-related kernel oops on Hawaii

Filipe Manana (1):
Btrfs: fix selftests failure due to uninitialized i_mode in test inodes

Florian Westphal (1):
netfilter: nf_tables: allow lookups in dynamic sets

Gao Xiang (5):
staging: erofs: fix an error handling in erofs_readdir()
staging: erofs: some compressed cluster should be submitted for corrupted images
staging: erofs: add two missing erofs_workgroup_put for corrupted images
staging: erofs: avoid endless loop of invalid lookback distance 0
staging: erofs: detect potential multiref due to corrupted images

Gautham R. Shenoy (1):
powerpc/pseries: Fix cpu_hotplug_lock acquisition in resize_hpt()

Gilad Ben-Yossef (2):
crypto: ccree - account for TEE not ready to report
crypto: ccree - use the full crypt length value

Greg Kroah-Hartman (1):

      Linux 5.3.6

H. Nikolaus Schaller (1):
DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again

Hans de Goede (1):
drm/radeon: Bail earlier when radeon.cik_/si_support=0 is passed

Heiko Carstens (1):

      KVM: s390: fix __insn32_query() inline assembly

Herbert Xu (1):
crypto: skcipher - Unmap pages after an external error

Horia Geantă (2):
crypto: caam/qi - fix error handling in ERN handler
crypto: caam - fix concurrency issue in givencrypt descriptor

Ido Schimmel (1):
thermal: Fix use-after-free when unregistering thermal zone device

Igor Druzhinin (1):
xen/pci: reserve MCFG areas earlier

Jan Höppner (1):
s390/dasd: Fix error handling during online processing

Jarkko Sakkinen (1):
selftests/tpm2: Add the missing TEST_FILES assignment

Jeff Layton (1):
ceph: fetch cap_gen under spinlock in ceph_add_cap

Jia-Ju Bai (1):
fs: nfs: Fix possible null-pointer dereferences in encode_attrs()

Jiaxun Yang (1):
MIPS: Treat Loongson Extensions as ASEs

Jiri Olsa (1):
perf tools: Fix segfault in cpu_cache_level__read()

Johan Hovold (1):
ieee802154: atusb: fix use-after-free at disconnect

Johannes Berg (4):
mac80211: keep BHs disabled while calling drv_tx_wake_queue()
nl80211: validate beacon head
cfg80211: validate SSID/MBSSID element ordering assumption
cfg80211: initialize on-stack chandefs

Jon Derrick (2):
PCI: vmd: Fix config addressing when using bus offsets
PCI: vmd: Fix shadow offsets to reflect spec changes

Juergen Gross (1):
xen/xenbus: fix self-deadlock after killing user process

KeMeng Shi (1):
sched/core: Fix migration to invalid CPU in __set_cpus_allowed_ptr()

Kees Cook (1):
usercopy: Avoid HIGHMEM pfn warning

Kevin Wang (1):
drm/amd/powerplay: change metrics update period from 1ms to 100ms

Lee Jones (1):
i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630

Li RongQing (1):
timer: Read jiffies once when forwarding base clk

Lu Shuaibing (1):
9p: Transport error uninitialized

Luis Henriques (1):
ceph: fix directories inode i_blkbits initialization

Lyude Paul (1):
drm/nouveau/kms/nv50-: Don't create MSTMs for eDP connectors

Maarten Lankhorst (1):
drm/i915/dp: Fix dsc bpp calculations, v5.

Marc Kleine-Budde (1):
can: mcp251x: mcp251x_hw_reset(): allow more time after a reset

Marek Vasut (1):
net: dsa: microchip: Always set regmap stride to 1

Masami Hiramatsu (1):

      perf probe: Fix to clear tev->nargs in clear_probe_trace_event()

Mathieu Desnoyers (2):
sched/membarrier: Call sync_core only before usermode for same mm sched/membarrier: Fix private expedited registration check

Michael Nosthoff (2):
power: supply: sbs-battery: use correct flags field
power: supply: sbs-battery: only return health when battery present

Mike Christie (1):
nbd: fix max number of supported devs

Miklos Szeredi (1):
fuse: fix request limit

Ming Lei (1):
blk-mq: move lockdep_assert_held() into elevator_exit

Nathan Chancellor (1):
libnvdimm/nfit_test: Fix acpi_handle redefinition

Navid Emamdoost (1):
nfp: abm: fix memory leak in nfp_abm_u32_knode_replace

Nicolin Chen (1):

      mmc: tegra: Implement ->set_dma_mask()

Oleksandr Suvorov (2):
ASoC: Define a set of DAPM pre/post-up events
ASoC: sgtl5000: Improve VAG power and mute control

Paul Mackerras (6):
KVM: PPC: Book3S: Enable XIVE native capability only if OPAL has required functions
KVM: PPC: Book3S HV: Don't push XIVE context when not using XIVE device
KVM: PPC: Book3S HV: Fix race in re-enabling XIVE escalation interrupts
KVM: PPC: Book3S HV: Check for MMU ready on piggybacked virtual cores
KVM: PPC: Book3S HV: Don't lose pending doorbell request on migration on P9 powerpc/xive: Implement get_irqchip_state method for XIVE to fix shutdown race

Philipp Rudo (1):
s390/sclp: Fix bit checked for has_sipl

Qian Cai (1):
include/trace/events/writeback.h: fix -Wstringop-truncation warnings

Rasmus Villemoes (1):
watchdog: imx2_wdt: fix min() calculation in imx2_wdt_set_timeout

Russell King (2):
mmc: sdhci: improve ADMA error reporting
mmc: sdhci-of-esdhc: set DMA snooping based on DMA coherence

Ryan Chen (1):
watchdog: aspeed: Add support for AST2600

Sanjay R Mehta (1):
ntb: point to right memory window index

Santosh Sivaraj (1):
powerpc/mce: Schedule work from irq_work

Sascha Hauer (2):
ima: always return negative code for error
ima: fix freeing ongoing ahash_request

Sean Christopherson (1):
KVM: nVMX: Fix consistency check on injected exception error code

Sean Paul (1):
drm/msm/dsi: Fix return value check for clk_get_parent

Seth Forshee (1):
sched: Add __ASSEMBLY__ guards around struct clone_args

Shuah Khan (1):
selftests: pidfd: Fix undefined reference to pthread_create()

Srikar Dronamraju (2):
perf stat: Fix a segmentation fault when using repeat forever perf stat: Reset previous counts on repeat with interval

Srinivas Kandagatla (1):
drivers: thermal: qcom: tsens: Fix memory leak from qfprom read

Stefan Haberland (1):
Revert "s390/dasd: Add discard support for ESE volumes"

Stefan Mavrodiev (1):
thermal_hwmon: Sanitize thermal_zone type

Steven Rostedt (VMware) (2):
tools lib traceevent: Fix "robust" test of do_generate_dynamic_list_file tools lib traceevent: Do not free tep->cmdlines in add_new_comm() on failure

Sumit Saxena (1):
PCI: Restore Resizable BAR size bits correctly for 1MB BARs

Thomas Huth (1):
KVM: s390: Test for bad access register and size at the start of S390_MEM_OP

Thomas Richter (1):
perf build: Add detection of java-11-openjdk-devel package

Tom Zanussi (1):
tracing: Make sure variable reference alias has correct var_ref_idx

Tomi Valkeinen (1):
drm/omap: fix max fclk divider for omap36xx

Trek (1):
drm/amdgpu: Check for valid number of registers to read

Trond Myklebust (3):
SUNRPC: RPC level errors should always set task->tk_rpc_status
pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors
SUNRPC: Don't try to parse incomplete RPC messages

Tycho Andersen (1):
selftests/seccomp: fix build on older kernels

Valdis Kletnieks (1):
kernel/elfcore.c: include proper prototypes

Vasily Gorbik (4):
s390/process: avoid potential reading of freed stack s390/topology: avoid firing events before kobjs are created s390/cio: avoid calling strlen on null pointer s390/cio: exclude subchannels with no parent from pseudo check

Vincent Chen (1):
riscv: Avoid interrupts being erroneously enabled in handle_exception()

Wanpeng Li (2):
KVM: X86: Fix userspace set invalid CR4
Revert "locking/pvqspinlock: Don't wait if vCPU is preempted"

Wei Yongjun (1):
crypto: cavium/zip - Add missing single_release()

Xiaolin Zhang (2):
drm/i915/gvt: update vgpu workload head pointer correctly drm/i915: to make vgpu ppgtt notificaiton as atomic operation

zhengbin (1):
fuse: fix memleak in cuse_channel_open

author maintainer
#1 lore raw
Makefile +1 -1
index bf03c110ed9b..d7469f0926a6 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 5
 PATCHLEVEL = 3
-SUBLEVEL = 5
+SUBLEVEL = 6
 EXTRAVERSION =
 NAME = Bobtail Squid
 
arch/arm/boot/dts/omap3-gta04.dtsi +1 -0
index b295f6fad2a5..954c216140ad 100644
@@ -120,6 +120,7 @@
 			spi-max-frequency = <100000>;
 			spi-cpol;
 			spi-cpha;
+			spi-cs-high;
 
 			backlight= <&backlight>;
 			label = "lcd";
arch/mips/include/asm/cpu-features.h +16 -0
index 6998a9796499..4e2bea8875f5 100644
@@ -397,6 +397,22 @@
 #define cpu_has_dsp3		__ase(MIPS_ASE_DSP3)
 #endif
 
+#ifndef cpu_has_loongson_mmi
+#define cpu_has_loongson_mmi		__ase(MIPS_ASE_LOONGSON_MMI)
+#endif
+
+#ifndef cpu_has_loongson_cam
+#define cpu_has_loongson_cam		__ase(MIPS_ASE_LOONGSON_CAM)
+#endif
+
+#ifndef cpu_has_loongson_ext
+#define cpu_has_loongson_ext		__ase(MIPS_ASE_LOONGSON_EXT)
+#endif
+
+#ifndef cpu_has_loongson_ext2
+#define cpu_has_loongson_ext2		__ase(MIPS_ASE_LOONGSON_EXT2)
+#endif
+
 #ifndef cpu_has_mipsmt
 #define cpu_has_mipsmt		__isa_lt_and_ase(6, MIPS_ASE_MIPSMT)
 #endif
arch/mips/include/asm/cpu.h +4 -0
index 290369fa44a4..1e3526efca1b 100644
@@ -433,5 +433,9 @@ enum cpu_type_enum {
 #define MIPS_ASE_MSA		0x00000100 /* MIPS SIMD Architecture */
 #define MIPS_ASE_DSP3		0x00000200 /* Signal Processing ASE Rev 3*/
 #define MIPS_ASE_MIPS16E2	0x00000400 /* MIPS16e2 */
+#define MIPS_ASE_LOONGSON_MMI	0x00000800 /* Loongson MultiMedia extensions Instructions */
+#define MIPS_ASE_LOONGSON_CAM	0x00001000 /* Loongson CAM */
+#define MIPS_ASE_LOONGSON_EXT	0x00002000 /* Loongson EXTensions */
+#define MIPS_ASE_LOONGSON_EXT2	0x00004000 /* Loongson EXTensions R2 */
 
 #endif /* _ASM_CPU_H */
arch/mips/kernel/cpu-probe.c +6 -0
index e654ffc1c8a0..e698a20017c1 100644
@@ -1573,6 +1573,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
 			__cpu_name[cpu] = "ICT Loongson-3";
 			set_elf_platform(cpu, "loongson3a");
 			set_isa(c, MIPS_CPU_ISA_M64R1);
+			c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM |
+				MIPS_ASE_LOONGSON_EXT);
 			break;
 		case PRID_REV_LOONGSON3B_R1:
 		case PRID_REV_LOONGSON3B_R2:
@@ -1580,6 +1582,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
 			__cpu_name[cpu] = "ICT Loongson-3";
 			set_elf_platform(cpu, "loongson3b");
 			set_isa(c, MIPS_CPU_ISA_M64R1);
+			c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM |
+				MIPS_ASE_LOONGSON_EXT);
 			break;
 		}
 
@@ -1946,6 +1950,8 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
 		decode_configs(c);
 		c->options |= MIPS_CPU_FTLB | MIPS_CPU_TLBINV | MIPS_CPU_LDPTE;
 		c->writecombine = _CACHE_UNCACHED_ACCELERATED;
+		c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM |
+			MIPS_ASE_LOONGSON_EXT | MIPS_ASE_LOONGSON_EXT2);
 		break;
 	default:
 		panic("Unknown Loongson Processor ID!");
arch/mips/kernel/proc.c +4 -0
index b2de408a259e..f8d36710cd58 100644
@@ -124,6 +124,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	if (cpu_has_eva)	seq_printf(m, "%s", " eva");
 	if (cpu_has_htw)	seq_printf(m, "%s", " htw");
 	if (cpu_has_xpa)	seq_printf(m, "%s", " xpa");
+	if (cpu_has_loongson_mmi)	seq_printf(m, "%s", " loongson-mmi");
+	if (cpu_has_loongson_cam)	seq_printf(m, "%s", " loongson-cam");
+	if (cpu_has_loongson_ext)	seq_printf(m, "%s", " loongson-ext");
+	if (cpu_has_loongson_ext2)	seq_printf(m, "%s", " loongson-ext2");
 	seq_printf(m, "\n");
 
 	if (cpu_has_mmips) {
arch/powerpc/include/asm/cputable.h +3 -2
index d05f0c28e515..f43ff5a00d38 100644
@@ -213,8 +213,9 @@ static inline void cpu_feature_keys_init(void) { }
 #define CPU_FTR_POWER9_DD2_1		LONG_ASM_CONST(0x0000080000000000)
 #define CPU_FTR_P9_TM_HV_ASSIST		LONG_ASM_CONST(0x0000100000000000)
 #define CPU_FTR_P9_TM_XER_SO_BUG	LONG_ASM_CONST(0x0000200000000000)
-#define CPU_FTR_P9_TLBIE_BUG		LONG_ASM_CONST(0x0000400000000000)
+#define CPU_FTR_P9_TLBIE_STQ_BUG	LONG_ASM_CONST(0x0000400000000000)
 #define CPU_FTR_P9_TIDR			LONG_ASM_CONST(0x0000800000000000)
+#define CPU_FTR_P9_TLBIE_ERAT_BUG	LONG_ASM_CONST(0x0001000000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -461,7 +462,7 @@ static inline void cpu_feature_keys_init(void) { }
 	    CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
 	    CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \
 	    CPU_FTR_TM_COMP | CPU_FTR_ARCH_300 | CPU_FTR_PKEY | \
-	    CPU_FTR_P9_TLBIE_BUG | CPU_FTR_P9_TIDR)
+	    CPU_FTR_P9_TLBIE_STQ_BUG | CPU_FTR_P9_TLBIE_ERAT_BUG | CPU_FTR_P9_TIDR)
 #define CPU_FTRS_POWER9_DD2_0 CPU_FTRS_POWER9
 #define CPU_FTRS_POWER9_DD2_1 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1)
 #define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
arch/powerpc/include/asm/kvm_ppc.h +1 -0
index 2484e6a8f5ca..8e8514efb124 100644
@@ -598,6 +598,7 @@ extern int kvmppc_xive_native_get_vp(struct kvm_vcpu *vcpu,
 				     union kvmppc_one_reg *val);
 extern int kvmppc_xive_native_set_vp(struct kvm_vcpu *vcpu,
 				     union kvmppc_one_reg *val);
+extern bool kvmppc_xive_native_supported(void);
 
 #else
 static inline int kvmppc_xive_set_xive(struct kvm *kvm, u32 irq, u32 server,
arch/powerpc/include/asm/xive.h +9 -0
index e4016985764e..818989e11678 100644
@@ -46,7 +46,15 @@ struct xive_irq_data {
 
 	/* Setup/used by frontend */
 	int target;
+	/*
+	 * saved_p means that there is a queue entry for this interrupt
+	 * in some CPU's queue (not including guest vcpu queues), even
+	 * if P is not set in the source ESB.
+	 * stale_p means that there is no queue entry for this interrupt
+	 * in some CPU's queue, even if P is set in the source ESB.
+	 */
 	bool saved_p;
+	bool stale_p;
 };
 #define XIVE_IRQ_FLAG_STORE_EOI	0x01
 #define XIVE_IRQ_FLAG_LSI	0x02
@@ -127,6 +135,7 @@ extern int xive_native_get_queue_state(u32 vp_id, uint32_t prio, u32 *qtoggle,
 extern int xive_native_set_queue_state(u32 vp_id, uint32_t prio, u32 qtoggle,
 				       u32 qindex);
 extern int xive_native_get_vp_state(u32 vp_id, u64 *out_state);
+extern bool xive_native_has_queue_state_support(void);
 
 #else
 
arch/powerpc/kernel/dt_cpu_ftrs.c +30 -2
index bd95318d2202..864cc55fa03c 100644
@@ -691,9 +691,37 @@ static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f)
 	return true;
 }
 
+/*
+ * Handle POWER9 broadcast tlbie invalidation issue using
+ * cpu feature flag.
+ */
+static __init void update_tlbie_feature_flag(unsigned long pvr)
+{
+	if (PVR_VER(pvr) == PVR_POWER9) {
+		/*
+		 * Set the tlbie feature flag for anything below
+		 * Nimbus DD 2.3 and Cumulus DD 1.3
+		 */
+		if ((pvr & 0xe000) == 0) {
+			/* Nimbus */
+			if ((pvr & 0xfff) < 0x203)
+				cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_STQ_BUG;
+		} else if ((pvr & 0xc000) == 0) {
+			/* Cumulus */
+			if ((pvr & 0xfff) < 0x103)
+				cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_STQ_BUG;
+		} else {
+			WARN_ONCE(1, "Unknown PVR");
+			cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_STQ_BUG;
+		}
+
+		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_ERAT_BUG;
+	}
+}
+
 static __init void cpufeatures_cpu_quirks(void)
 {
-	int version = mfspr(SPRN_PVR);
+	unsigned long version = mfspr(SPRN_PVR);
 
 	/*
 	 * Not all quirks can be derived from the cpufeatures device tree.
@@ -712,10 +740,10 @@ static __init void cpufeatures_cpu_quirks(void)
 
 	if ((version & 0xffff0000) == 0x004e0000) {
 		cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
-		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
 		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TIDR;
 	}
 
+	update_tlbie_feature_flag(version);
 	/*
 	 * PKEY was not in the initial base or feature node
 	 * specification, but it should become optional in the next
arch/powerpc/kernel/head_32.S +4 -2
index f255e22184b4..9e6f01abb31e 100644
@@ -557,9 +557,9 @@ DataStoreTLBMiss:
 	cmplw	0,r1,r3
 	mfspr	r2, SPRN_SPRG_PGDIR
 #ifdef CONFIG_SWAP
-	li	r1, _PAGE_RW | _PAGE_PRESENT | _PAGE_ACCESSED
+	li	r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED
 #else
-	li	r1, _PAGE_RW | _PAGE_PRESENT
+	li	r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT
 #endif
 	bge-	112f
 	lis	r2, (swapper_pg_dir - PAGE_OFFSET)@ha	/* if kernel address, use */
@@ -897,9 +897,11 @@ start_here:
 	bl	machine_init
 	bl	__save_cpu_setup
 	bl	MMU_init
+#ifdef CONFIG_KASAN
 BEGIN_MMU_FTR_SECTION
 	bl	MMU_init_hw_patch
 END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE)
+#endif
 
 /*
  * Go back to running unmapped so we can load up new values
arch/powerpc/kernel/mce.c +10 -1
index b18df633eae9..cff31d4a501f 100644
@@ -33,6 +33,7 @@ static DEFINE_PER_CPU(struct machine_check_event[MAX_MC_EVT],
 					mce_ue_event_queue);
 
 static void machine_check_process_queued_event(struct irq_work *work);
+static void machine_check_ue_irq_work(struct irq_work *work);
 void machine_check_ue_event(struct machine_check_event *evt);
 static void machine_process_ue_event(struct work_struct *work);
 
@@ -40,6 +41,10 @@ static struct irq_work mce_event_process_work = {
         .func = machine_check_process_queued_event,
 };
 
+static struct irq_work mce_ue_event_irq_work = {
+	.func = machine_check_ue_irq_work,
+};
+
 DECLARE_WORK(mce_ue_event_work, machine_process_ue_event);
 
 static void mce_set_error_info(struct machine_check_event *mce,
@@ -199,6 +204,10 @@ void release_mce_event(void)
 	get_mce_event(NULL, true);
 }
 
+static void machine_check_ue_irq_work(struct irq_work *work)
+{
+	schedule_work(&mce_ue_event_work);
+}
 
 /*
  * Queue up the MCE event which then can be handled later.
@@ -216,7 +225,7 @@ void machine_check_ue_event(struct machine_check_event *evt)
 	memcpy(this_cpu_ptr(&mce_ue_event_queue[index]), evt, sizeof(*evt));
 
 	/* Queue work to process this event later. */
-	schedule_work(&mce_ue_event_work);
+	irq_work_queue(&mce_ue_event_irq_work);
 }
 
 /*
arch/powerpc/kernel/mce_power.c +13 -6
index a814d2dfb5b0..714a98e0927f 100644
@@ -26,6 +26,7 @@
 unsigned long addr_to_pfn(struct pt_regs *regs, unsigned long addr)
 {
 	pte_t *ptep;
+	unsigned int shift;
 	unsigned long flags;
 	struct mm_struct *mm;
 
@@ -35,13 +36,18 @@ unsigned long addr_to_pfn(struct pt_regs *regs, unsigned long addr)
 		mm = &init_mm;
 
 	local_irq_save(flags);
-	if (mm == current->mm)
-		ptep = find_current_mm_pte(mm->pgd, addr, NULL, NULL);
-	else
-		ptep = find_init_mm_pte(addr, NULL);
+	ptep = __find_linux_pte(mm->pgd, addr, NULL, &shift);
 	local_irq_restore(flags);
+
 	if (!ptep || pte_special(*ptep))
 		return ULONG_MAX;
+
+	if (shift > PAGE_SHIFT) {
+		unsigned long rpnmask = (1ul << shift) - PAGE_SIZE;
+
+		return pte_pfn(__pte(pte_val(*ptep) | (addr & rpnmask)));
+	}
+
 	return pte_pfn(*ptep);
 }
 
@@ -344,7 +350,7 @@ static const struct mce_derror_table mce_p9_derror_table[] = {
   MCE_INITIATOR_CPU,   MCE_SEV_SEVERE, true },
 { 0, false, 0, 0, 0, 0, 0 } };
 
-static int mce_find_instr_ea_and_pfn(struct pt_regs *regs, uint64_t *addr,
+static int mce_find_instr_ea_and_phys(struct pt_regs *regs, uint64_t *addr,
 					uint64_t *phys_addr)
 {
 	/*
@@ -541,7 +547,8 @@ static int mce_handle_derror(struct pt_regs *regs,
 			 * kernel/exception-64s.h
 			 */
 			if (get_paca()->in_mce < MAX_MCE_DEPTH)
-				mce_find_instr_ea_and_pfn(regs, addr, phys_addr);
+				mce_find_instr_ea_and_phys(regs, addr,
+							   phys_addr);
 		}
 		found = 1;
 	}
arch/powerpc/kvm/book3s.c +5 -3
index 9524d92bc45d..d7fcdfa7fee4 100644
@@ -1083,9 +1083,11 @@ static int kvmppc_book3s_init(void)
 	if (xics_on_xive()) {
 		kvmppc_xive_init_module();
 		kvm_register_device_ops(&kvm_xive_ops, KVM_DEV_TYPE_XICS);
-		kvmppc_xive_native_init_module();
-		kvm_register_device_ops(&kvm_xive_native_ops,
-					KVM_DEV_TYPE_XIVE);
+		if (kvmppc_xive_native_supported()) {
+			kvmppc_xive_native_init_module();
+			kvm_register_device_ops(&kvm_xive_native_ops,
+						KVM_DEV_TYPE_XIVE);
+		}
 	} else
 #endif
 		kvm_register_device_ops(&kvm_xics_ops, KVM_DEV_TYPE_XICS);
arch/powerpc/kvm/book3s_hv.c +18 -6
index cde3f5a4b3e4..f8975c620f41 100644
@@ -1678,7 +1678,14 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		*val = get_reg_val(id, vcpu->arch.pspb);
 		break;
 	case KVM_REG_PPC_DPDES:
-		*val = get_reg_val(id, vcpu->arch.vcore->dpdes);
+		/*
+		 * On POWER9, where we are emulating msgsndp etc.,
+		 * we return 1 bit for each vcpu, which can come from
+		 * either vcore->dpdes or doorbell_request.
+		 * On POWER8, doorbell_request is 0.
+		 */
+		*val = get_reg_val(id, vcpu->arch.vcore->dpdes |
+				   vcpu->arch.doorbell_request);
 		break;
 	case KVM_REG_PPC_VTB:
 		*val = get_reg_val(id, vcpu->arch.vcore->vtb);
@@ -2860,7 +2867,7 @@ static void collect_piggybacks(struct core_info *cip, int target_threads)
 		if (!spin_trylock(&pvc->lock))
 			continue;
 		prepare_threads(pvc);
-		if (!pvc->n_runnable) {
+		if (!pvc->n_runnable || !pvc->kvm->arch.mmu_ready) {
 			list_del_init(&pvc->preempt_list);
 			if (pvc->runner == NULL) {
 				pvc->vcore_state = VCORE_INACTIVE;
@@ -2881,15 +2888,20 @@ static void collect_piggybacks(struct core_info *cip, int target_threads)
 	spin_unlock(&lp->lock);
 }
 
-static bool recheck_signals(struct core_info *cip)
+static bool recheck_signals_and_mmu(struct core_info *cip)
 {
 	int sub, i;
 	struct kvm_vcpu *vcpu;
+	struct kvmppc_vcore *vc;
 
-	for (sub = 0; sub < cip->n_subcores; ++sub)
-		for_each_runnable_thread(i, vcpu, cip->vc[sub])
+	for (sub = 0; sub < cip->n_subcores; ++sub) {
+		vc = cip->vc[sub];
+		if (!vc->kvm->arch.mmu_ready)
+			return true;
+		for_each_runnable_thread(i, vcpu, vc)
 			if (signal_pending(vcpu->arch.run_task))
 				return true;
+	}
 	return false;
 }
 
@@ -3119,7 +3131,7 @@ static noinline void kvmppc_run_core(struct kvmppc_vcore *vc)
 	local_irq_disable();
 	hard_irq_disable();
 	if (lazy_irq_pending() || need_resched() ||
-	    recheck_signals(&core_info) || !vc->kvm->arch.mmu_ready) {
+	    recheck_signals_and_mmu(&core_info)) {
 		local_irq_enable();
 		vc->vcore_state = VCORE_INACTIVE;
 		/* Unlock all except the primary vcore */
arch/powerpc/kvm/book3s_hv_rm_mmu.c +32 -10

54 lines not on this page · raw message

arch/powerpc/kvm/book3s_hv_rmhandlers.S +25 -13
index 337e64468d78..07181d0dfcb7 100644
@@ -942,6 +942,8 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_300)
 	ld	r11, VCPU_XIVE_SAVED_STATE(r4)
 	li	r9, TM_QW1_OS
 	lwz	r8, VCPU_XIVE_CAM_WORD(r4)
+	cmpwi	r8, 0
+	beq	no_xive
 	li	r7, TM_QW1_OS + TM_WORD2
 	mfmsr	r0
 	andi.	r0, r0, MSR_DR		/* in real mode? */
@@ -2831,29 +2833,39 @@ kvm_cede_prodded:
 kvm_cede_exit:
 	ld	r9, HSTATE_KVM_VCPU(r13)
 #ifdef CONFIG_KVM_XICS
-	/* Abort if we still have a pending escalation */
+	/* are we using XIVE with single escalation? */
+	ld	r10, VCPU_XIVE_ESC_VADDR(r9)
+	cmpdi	r10, 0
+	beq	3f
+	li	r6, XIVE_ESB_SET_PQ_00
+	/*
+	 * If we still have a pending escalation, abort the cede,
+	 * and we must set PQ to 10 rather than 00 so that we don't
+	 * potentially end up with two entries for the escalation
+	 * interrupt in the XIVE interrupt queue.  In that case
+	 * we also don't want to set xive_esc_on to 1 here in
+	 * case we race with xive_esc_irq().
+	 */
 	lbz	r5, VCPU_XIVE_ESC_ON(r9)
 	cmpwi	r5, 0
-	beq	1f
+	beq	4f
 	li	r0, 0
 	stb	r0, VCPU_CEDED(r9)
-1:	/* Enable XIVE escalation */
-	li	r5, XIVE_ESB_SET_PQ_00
+	li	r6, XIVE_ESB_SET_PQ_10
+	b	5f
+4:	li	r0, 1
+	stb	r0, VCPU_XIVE_ESC_ON(r9)
+	/* make sure store to xive_esc_on is seen before xive_esc_irq runs */
+	sync
+5:	/* Enable XIVE escalation */
 	mfmsr	r0
 	andi.	r0, r0, MSR_DR		/* in real mode? */
 	beq	1f
-	ld	r10, VCPU_XIVE_ESC_VADDR(r9)
-	cmpdi	r10, 0
-	beq	3f
-	ldx	r0, r10, r5
+	ldx	r0, r10, r6
 	b	2f
 1:	ld	r10, VCPU_XIVE_ESC_RADDR(r9)
-	cmpdi	r10, 0
-	beq	3f
-	ldcix	r0, r10, r5
+	ldcix	r0, r10, r6
 2:	sync
-	li	r0, 1
-	stb	r0, VCPU_XIVE_ESC_ON(r9)
 #endif /* CONFIG_KVM_XICS */
 3:	b	guest_exit_cont
 
arch/powerpc/kvm/book3s_xive.c +51 -9

91 lines not on this page · raw message

arch/powerpc/kvm/book3s_xive.h +2 -0
index 50494d0ee375..955b820ffd6d 100644
@@ -282,6 +282,8 @@ int kvmppc_xive_select_target(struct kvm *kvm, u32 *server, u8 prio);
 int kvmppc_xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio,
 				  bool single_escalation);
 struct kvmppc_xive *kvmppc_xive_get_device(struct kvm *kvm, u32 type);
+void xive_cleanup_single_escalation(struct kvm_vcpu *vcpu,
+				    struct kvmppc_xive_vcpu *xc, int irq);
 
 #endif /* CONFIG_KVM_XICS */
 #endif /* _KVM_PPC_BOOK3S_XICS_H */
arch/powerpc/kvm/book3s_xive_native.c +18 -5
index a998823f68a3..248c1ea9e788 100644
@@ -67,20 +67,28 @@ void kvmppc_xive_native_cleanup_vcpu(struct kvm_vcpu *vcpu)
 	xc->valid = false;
 	kvmppc_xive_disable_vcpu_interrupts(vcpu);
 
-	/* Disable the VP */
-	xive_native_disable_vp(xc->vp_id);
-
-	/* Free the queues & associated interrupts */
+	/* Free escalations */
 	for (i = 0; i < KVMPPC_XIVE_Q_COUNT; i++) {
 		/* Free the escalation irq */
 		if (xc->esc_virq[i]) {
+			if (xc->xive->single_escalation)
+				xive_cleanup_single_escalation(vcpu, xc,
+							xc->esc_virq[i]);
 			free_irq(xc->esc_virq[i], vcpu);
 			irq_dispose_mapping(xc->esc_virq[i]);
 			kfree(xc->esc_virq_names[i]);
 			xc->esc_virq[i] = 0;
 		}
+	}
+
+	/* Disable the VP */
+	xive_native_disable_vp(xc->vp_id);
+
+	/* Clear the cam word so guest entry won't try to push context */
+	vcpu->arch.xive_cam_word = 0;
 
-		/* Free the queue */
+	/* Free the queues */
+	for (i = 0; i < KVMPPC_XIVE_Q_COUNT; i++) {
 		kvmppc_xive_native_cleanup_queue(vcpu, i);
 	}
 
@@ -1171,6 +1179,11 @@ int kvmppc_xive_native_set_vp(struct kvm_vcpu *vcpu, union kvmppc_one_reg *val)
 	return 0;
 }
 
+bool kvmppc_xive_native_supported(void)
+{
+	return xive_native_has_queue_state_support();
+}
+
 static int xive_native_debug_show(struct seq_file *m, void *private)
 {
 	struct kvmppc_xive *xive = m->private;
arch/powerpc/kvm/powerpc.c +2 -1
index 3e566c2e6066..3a77bb643452 100644
@@ -561,7 +561,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		 * a POWER9 processor) and the PowerNV platform, as
 		 * nested is not yet supported.
 		 */
-		r = xive_enabled() && !!cpu_has_feature(CPU_FTR_HVMODE);
+		r = xive_enabled() && !!cpu_has_feature(CPU_FTR_HVMODE) &&
+			kvmppc_xive_native_supported();
 		break;
 #endif
 
arch/powerpc/mm/book3s32/mmu.c +9 -0
index e249fbf6b9c3..8d68f03bf5a4 100644
@@ -358,6 +358,15 @@ void __init MMU_init_hw(void)
 	hash_mb2 = hash_mb = 32 - LG_HPTEG_SIZE - lg_n_hpteg;
 	if (lg_n_hpteg > 16)
 		hash_mb2 = 16 - LG_HPTEG_SIZE;
+
+	/*
+	 * When KASAN is selected, there is already an early temporary hash
+	 * table and the switch to the final hash table is done later.
+	 */
+	if (IS_ENABLED(CONFIG_KASAN))
+		return;
+
+	MMU_init_hw_patch();
 }
 
 void __init MMU_init_hw_patch(void)
arch/powerpc/mm/book3s64/hash_native.c +27 -4
index 90ab4f31e2b3..523e42eb11da 100644
@@ -197,9 +197,32 @@ static inline unsigned long  ___tlbie(unsigned long vpn, int psize,
 	return va;
 }
 
-static inline void fixup_tlbie(unsigned long vpn, int psize, int apsize, int ssize)
+static inline void fixup_tlbie_vpn(unsigned long vpn, int psize,
+				   int apsize, int ssize)
 {
-	if (cpu_has_feature(CPU_FTR_P9_TLBIE_BUG)) {
+	if (cpu_has_feature(CPU_FTR_P9_TLBIE_ERAT_BUG)) {
+		/* Radix flush for a hash guest */
+
+		unsigned long rb,rs,prs,r,ric;
+
+		rb = PPC_BIT(52); /* IS = 2 */
+		rs = 0;  /* lpid = 0 */
+		prs = 0; /* partition scoped */
+		r = 1;   /* radix format */
+		ric = 0; /* RIC_FLSUH_TLB */
+
+		/*
+		 * Need the extra ptesync to make sure we don't
+		 * re-order the tlbie
+		 */
+		asm volatile("ptesync": : :"memory");
+		asm volatile(PPC_TLBIE_5(%0, %4, %3, %2, %1)
+			     : : "r"(rb), "i"(r), "i"(prs),
+			       "i"(ric), "r"(rs) : "memory");
+	}
+
+
+	if (cpu_has_feature(CPU_FTR_P9_TLBIE_STQ_BUG)) {
 		/* Need the extra ptesync to ensure we don't reorder tlbie*/
 		asm volatile("ptesync": : :"memory");
 		___tlbie(vpn, psize, apsize, ssize);
@@ -283,7 +306,7 @@ static inline void tlbie(unsigned long vpn, int psize, int apsize,
 		asm volatile("ptesync": : :"memory");
 	} else {
 		__tlbie(vpn, psize, apsize, ssize);
-		fixup_tlbie(vpn, psize, apsize, ssize);
+		fixup_tlbie_vpn(vpn, psize, apsize, ssize);
 		asm volatile("eieio; tlbsync; ptesync": : :"memory");
 	}
 	if (lock_tlbie && !use_local)
@@ -856,7 +879,7 @@ static void native_flush_hash_range(unsigned long number, int local)
 		/*
 		 * Just do one more with the last used values.
 		 */
-		fixup_tlbie(vpn, psize, psize, ssize);
+		fixup_tlbie_vpn(vpn, psize, psize, ssize);
 		asm volatile("eieio; tlbsync; ptesync":::"memory");
 
 		if (lock_tlbie)
arch/powerpc/mm/book3s64/hash_utils.c +8 -1
index b8ad14bb1170..17b0885581e4 100644
@@ -34,6 +34,7 @@
 #include <linux/libfdt.h>
 #include <linux/pkeys.h>
 #include <linux/hugetlb.h>
+#include <linux/cpu.h>
 
 #include <asm/debugfs.h>
 #include <asm/processor.h>
@@ -1931,10 +1932,16 @@ static int hpt_order_get(void *data, u64 *val)
 
 static int hpt_order_set(void *data, u64 val)
 {
+	int ret;
+
 	if (!mmu_hash_ops.resize_hpt)
 		return -ENODEV;
 
-	return mmu_hash_ops.resize_hpt(val);
+	cpus_read_lock();
+	ret = mmu_hash_ops.resize_hpt(val);
+	cpus_read_unlock();
+
+	return ret;
 }
 
 DEFINE_DEBUGFS_ATTRIBUTE(fops_hpt_order, hpt_order_get, hpt_order_set, "%llu\n");
arch/powerpc/mm/book3s64/radix_tlb.c +74 -10

158 lines not on this page · raw message

arch/powerpc/mm/init_64.c +16 -1
index a44f6281ca3a..4e08246acd79 100644
@@ -172,6 +172,21 @@ static __meminit void vmemmap_list_populate(unsigned long phys,
 	vmemmap_list = vmem_back;
 }
 
+static bool altmap_cross_boundary(struct vmem_altmap *altmap, unsigned long start,
+				unsigned long page_size)
+{
+	unsigned long nr_pfn = page_size / sizeof(struct page);
+	unsigned long start_pfn = page_to_pfn((struct page *)start);
+
+	if ((start_pfn + nr_pfn) > altmap->end_pfn)
+		return true;
+
+	if (start_pfn < altmap->base_pfn)
+		return true;
+
+	return false;
+}
+
 int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 		struct vmem_altmap *altmap)
 {
@@ -194,7 +209,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 		 * fail due to alignment issues when using 16MB hugepages, so
 		 * fall back to system memory if the altmap allocation fail.
 		 */
-		if (altmap) {
+		if (altmap && !altmap_cross_boundary(altmap, start, page_size)) {
 			p = altmap_alloc_block_buf(page_size, altmap);
 			if (!p)
 				pr_debug("altmap block allocation failed, falling back to system memory");
arch/powerpc/mm/kasan/kasan_init_32.c +46 -11

100 lines not on this page · raw message

arch/powerpc/mm/ptdump/ptdump.c +1 -1
index 5d6111a9ee0e..74ff2bff4ea0 100644
@@ -27,7 +27,7 @@
 #include "ptdump.h"
 
 #ifdef CONFIG_PPC32
-#define KERN_VIRT_START	PAGE_OFFSET
+#define KERN_VIRT_START	0
 #endif
 
 /*
arch/powerpc/platforms/powernv/opal.c +7 -4
index aba443be7daa..d271accf224b 100644
@@ -705,7 +705,10 @@ static ssize_t symbol_map_read(struct file *fp, struct kobject *kobj,
 				       bin_attr->size);
 }
 
-static BIN_ATTR_RO(symbol_map, 0);
+static struct bin_attribute symbol_map_attr = {
+	.attr = {.name = "symbol_map", .mode = 0400},
+	.read = symbol_map_read
+};
 
 static void opal_export_symmap(void)
 {
@@ -722,10 +725,10 @@ static void opal_export_symmap(void)
 		return;
 
 	/* Setup attributes */
-	bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
-	bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
+	symbol_map_attr.private = __va(be64_to_cpu(syms[0]));
+	symbol_map_attr.size = be64_to_cpu(syms[1]);
 
-	rc = sysfs_create_bin_file(opal_kobj, &bin_attr_symbol_map);
+	rc = sysfs_create_bin_file(opal_kobj, &symbol_map_attr);
 	if (rc)
 		pr_warn("Error %d creating OPAL symbols file\n", rc);
 }
arch/powerpc/platforms/powernv/pci-ioda-tce.c +13 -5
index c75ec37bf0cd..a0b9c0c23ed2 100644
@@ -49,6 +49,9 @@ static __be64 *pnv_alloc_tce_level(int nid, unsigned int shift)
 	return addr;
 }
 
+static void pnv_pci_ioda2_table_do_free_pages(__be64 *addr,
+		unsigned long size, unsigned int levels);
+
 static __be64 *pnv_tce(struct iommu_table *tbl, bool user, long idx, bool alloc)
 {
 	__be64 *tmp = user ? tbl->it_userspace : (__be64 *) tbl->it_base;
@@ -58,9 +61,9 @@ static __be64 *pnv_tce(struct iommu_table *tbl, bool user, long idx, bool alloc)
 
 	while (level) {
 		int n = (idx & mask) >> (level * shift);
-		unsigned long tce;
+		unsigned long oldtce, tce = be64_to_cpu(READ_ONCE(tmp[n]));
 
-		if (tmp[n] == 0) {
+		if (!tce) {
 			__be64 *tmp2;
 
 			if (!alloc)
@@ -71,10 +74,15 @@ static __be64 *pnv_tce(struct iommu_table *tbl, bool user, long idx, bool alloc)
 			if (!tmp2)
 				return NULL;
 
-			tmp[n] = cpu_to_be64(__pa(tmp2) |
-					TCE_PCI_READ | TCE_PCI_WRITE);
+			tce = __pa(tmp2) | TCE_PCI_READ | TCE_PCI_WRITE;
+			oldtce = be64_to_cpu(cmpxchg(&tmp[n], 0,
+					cpu_to_be64(tce)));
+			if (oldtce) {
+				pnv_pci_ioda2_table_do_free_pages(tmp2,
+					ilog2(tbl->it_level_size) + 3, 1);
+				tce = oldtce;
+			}
 		}
-		tce = be64_to_cpu(tmp[n]);
 
 		tmp = __va(tce & ~(TCE_PCI_READ | TCE_PCI_WRITE));
 		idx &= ~mask;
arch/powerpc/platforms/pseries/lpar.c +6 -2
index 09bb878c21e0..4f76e5f30c97 100644
@@ -1413,7 +1413,10 @@ static int pseries_lpar_resize_hpt_commit(void *data)
 	return 0;
 }
 
-/* Must be called in user context */
+/*
+ * Must be called in process context. The caller must hold the
+ * cpus_lock.
+ */
 static int pseries_lpar_resize_hpt(unsigned long shift)
 {
 	struct hpt_resize_state state = {
@@ -1467,7 +1470,8 @@ static int pseries_lpar_resize_hpt(unsigned long shift)
 
 	t1 = ktime_get();
 
-	rc = stop_machine(pseries_lpar_resize_hpt_commit, &state, NULL);
+	rc = stop_machine_cpuslocked(pseries_lpar_resize_hpt_commit,
+				     &state, NULL);
 
 	t2 = ktime_get();
 
arch/powerpc/sysdev/xive/common.c +64 -23

191 lines not on this page · raw message

arch/powerpc/sysdev/xive/native.c +7 -0
index cf156aadefe9..ad8ee7dd7f57 100644
@@ -811,6 +811,13 @@ int xive_native_set_queue_state(u32 vp_id, u32 prio, u32 qtoggle, u32 qindex)
 }
 EXPORT_SYMBOL_GPL(xive_native_set_queue_state);
 
+bool xive_native_has_queue_state_support(void)
+{
+	return opal_check_token(OPAL_XIVE_GET_QUEUE_STATE) &&
+		opal_check_token(OPAL_XIVE_SET_QUEUE_STATE);
+}
+EXPORT_SYMBOL_GPL(xive_native_has_queue_state_support);
+
 int xive_native_get_vp_state(u32 vp_id, u64 *out_state)
 {
 	__be64 state;
arch/riscv/kernel/entry.S +5 -1
index bc7a56e1ca6f..9b60878a4469 100644
@@ -166,9 +166,13 @@ ENTRY(handle_exception)
 	move a0, sp /* pt_regs */
 	tail do_IRQ
 1:
-	/* Exceptions run with interrupts enabled */
+	/* Exceptions run with interrupts enabled or disabled
+	   depending on the state of sstatus.SR_SPIE */
+	andi t0, s1, SR_SPIE
+	beqz t0, 1f
 	csrs sstatus, SR_SIE
 
+1:
 	/* Handle syscalls */
 	li t0, EXC_SYSCALL
 	beq s4, t0, handle_syscall
arch/s390/kernel/process.c +16 -6
index 63873aa6693f..9f2727bf3cbe 100644
@@ -184,20 +184,30 @@ unsigned long get_wchan(struct task_struct *p)
 
 	if (!p || p == current || p->state == TASK_RUNNING || !task_stack_page(p))
 		return 0;
+
+	if (!try_get_task_stack(p))
+		return 0;
+
 	low = task_stack_page(p);
 	high = (struct stack_frame *) task_pt_regs(p);
 	sf = (struct stack_frame *) p->thread.ksp;
-	if (sf <= low || sf > high)
-		return 0;
+	if (sf <= low || sf > high) {
+		return_address = 0;
+		goto out;
+	}
 	for (count = 0; count < 16; count++) {
 		sf = (struct stack_frame *) sf->back_chain;
-		if (sf <= low || sf > high)
-			return 0;
+		if (sf <= low || sf > high) {
+			return_address = 0;
+			goto out;
+		}
 		return_address = sf->gprs[8];
 		if (!in_sched_functions(return_address))
-			return return_address;
+			goto out;
 	}
-	return 0;
+out:
+	put_task_stack(p);
+	return return_address;
 }
 
 unsigned long arch_align_stack(unsigned long sp)
arch/s390/kernel/topology.c +2 -1
index 2db6fb405a9a..3627953007ed 100644
@@ -311,7 +311,8 @@ int arch_update_cpu_topology(void)
 	on_each_cpu(__arch_update_dedicated_flag, NULL, 0);
 	for_each_online_cpu(cpu) {
 		dev = get_cpu_device(cpu);
-		kobject_uevent(&dev->kobj, KOBJ_CHANGE);
+		if (dev)
+			kobject_uevent(&dev->kobj, KOBJ_CHANGE);
 	}
 	return rc;
 }
arch/s390/kvm/kvm-s390.c +4 -4
index 39cff07bf2eb..7d955dbf9e6d 100644
@@ -332,7 +332,7 @@ static inline int plo_test_bit(unsigned char nr)
 	return cc == 0;
 }
 
-static inline void __insn32_query(unsigned int opcode, u8 query[32])
+static inline void __insn32_query(unsigned int opcode, u8 *query)
 {
 	register unsigned long r0 asm("0") = 0;	/* query function */
 	register unsigned long r1 asm("1") = (unsigned long) query;
@@ -340,9 +340,9 @@ static inline void __insn32_query(unsigned int opcode, u8 query[32])
 	asm volatile(
 		/* Parameter regs are ignored */
 		"	.insn	rrf,%[opc] << 16,2,4,6,0\n"
-		: "=m" (*query)
+		:
 		: "d" (r0), "a" (r1), [opc] "i" (opcode)
-		: "cc");
+		: "cc", "memory");
 }
 
 #define INSN_SORTL 0xb938
@@ -4257,7 +4257,7 @@ static long kvm_s390_guest_mem_op(struct kvm_vcpu *vcpu,
 	const u64 supported_flags = KVM_S390_MEMOP_F_INJECT_EXCEPTION
 				    | KVM_S390_MEMOP_F_CHECK_ONLY;
 
-	if (mop->flags & ~supported_flags)
+	if (mop->flags & ~supported_flags || mop->ar >= NUM_ACRS || !mop->size)
 		return -EINVAL;
 
 	if (mop->size > MEM_OP_MAX_SIZE)
arch/x86/kvm/vmx/nested.c +1 -1
index a3cba321b5c5..61aa9421e27a 100644
@@ -2584,7 +2584,7 @@ static int nested_check_vm_entry_controls(struct kvm_vcpu *vcpu,
 
 		/* VM-entry exception error code */
 		if (has_error_code &&
-		    vmcs12->vm_entry_exception_error_code & GENMASK(31, 15))
+		       vmcs12->vm_entry_exception_error_code & GENMASK(31, 16))
 			return -EINVAL;
 
 		/* VM-entry interruption-info field: reserved bits */
arch/x86/kvm/x86.c +21 -17
index 350adc83eb50..e5ccfb33dbea 100644
@@ -884,34 +884,42 @@ int kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
 }
 EXPORT_SYMBOL_GPL(kvm_set_xcr);
 
-int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
+static int kvm_valid_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
 {
-	unsigned long old_cr4 = kvm_read_cr4(vcpu);
-	unsigned long pdptr_bits = X86_CR4_PGE | X86_CR4_PSE | X86_CR4_PAE |
-				   X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_PKE;
-
 	if (cr4 & CR4_RESERVED_BITS)
-		return 1;
+		return -EINVAL;
 
 	if (!guest_cpuid_has(vcpu, X86_FEATURE_XSAVE) && (cr4 & X86_CR4_OSXSAVE))
-		return 1;
+		return -EINVAL;
 
 	if (!guest_cpuid_has(vcpu, X86_FEATURE_SMEP) && (cr4 & X86_CR4_SMEP))
-		return 1;
+		return -EINVAL;
 
 	if (!guest_cpuid_has(vcpu, X86_FEATURE_SMAP) && (cr4 & X86_CR4_SMAP))
-		return 1;
+		return -EINVAL;
 
 	if (!guest_cpuid_has(vcpu, X86_FEATURE_FSGSBASE) && (cr4 & X86_CR4_FSGSBASE))
-		return 1;
+		return -EINVAL;
 
 	if (!guest_cpuid_has(vcpu, X86_FEATURE_PKU) && (cr4 & X86_CR4_PKE))
-		return 1;
+		return -EINVAL;
 
 	if (!guest_cpuid_has(vcpu, X86_FEATURE_LA57) && (cr4 & X86_CR4_LA57))
-		return 1;
+		return -EINVAL;
 
 	if (!guest_cpuid_has(vcpu, X86_FEATURE_UMIP) && (cr4 & X86_CR4_UMIP))
+		return -EINVAL;
+
+	return 0;
+}
+
+int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
+{
+	unsigned long old_cr4 = kvm_read_cr4(vcpu);
+	unsigned long pdptr_bits = X86_CR4_PGE | X86_CR4_PSE | X86_CR4_PAE |
+				   X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_PKE;
+
+	if (kvm_valid_cr4(vcpu, cr4))
 		return 1;
 
 	if (is_long_mode(vcpu)) {
@@ -8598,10 +8606,6 @@ EXPORT_SYMBOL_GPL(kvm_task_switch);
 
 static int kvm_valid_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)
 {
-	if (!guest_cpuid_has(vcpu, X86_FEATURE_XSAVE) &&
-			(sregs->cr4 & X86_CR4_OSXSAVE))
-		return  -EINVAL;
-
 	if ((sregs->efer & EFER_LME) && (sregs->cr0 & X86_CR0_PG)) {
 		/*
 		 * When EFER.LME and CR0.PG are set, the processor is in
@@ -8620,7 +8624,7 @@ static int kvm_valid_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)
 			return -EINVAL;
 	}
 
-	return 0;
+	return kvm_valid_cr4(vcpu, sregs->cr4);
 }
 
 static int __set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)
arch/x86/purgatory/Makefile +1 -0
index 10fb42da0007..b81b5172cf99 100644
@@ -23,6 +23,7 @@ KCOV_INSTRUMENT := n
 
 PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel
 PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss
+PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN)
 
 # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
 # in turn leaves some undefined symbols like __fentry__ in purgatory and not
block/blk-mq-sched.c +0 -2
index c9d183d6c499..ca22afd47b3d 100644
@@ -555,8 +555,6 @@ void blk_mq_sched_free_requests(struct request_queue *q)
 	struct blk_mq_hw_ctx *hctx;
 	int i;
 
-	lockdep_assert_held(&q->sysfs_lock);
-
 	queue_for_each_hw_ctx(q, hctx, i) {
 		if (hctx->sched_tags)
 			blk_mq_free_rqs(q->tag_set, hctx->sched_tags, i);
block/blk.h +2 -0
index d5edfd73d45e..0685c45e3d96 100644
@@ -201,6 +201,8 @@ void elv_unregister_queue(struct request_queue *q);
 static inline void elevator_exit(struct request_queue *q,
 		struct elevator_queue *e)
 {
+	lockdep_assert_held(&q->sysfs_lock);
+
 	blk_mq_sched_free_requests(q);
 	__elevator_exit(q, e);
 }
crypto/skcipher.c +23 -19

83 lines not on this page · raw message

drivers/block/nbd.c +25 -14
index a69a90ad9208..0b727f7432f9 100644
@@ -108,6 +108,7 @@ struct nbd_device {
 	struct nbd_config *config;
 	struct mutex config_lock;
 	struct gendisk *disk;
+	struct workqueue_struct *recv_workq;
 
 	struct list_head list;
 	struct task_struct *task_recv;
@@ -138,7 +139,6 @@ static struct dentry *nbd_dbg_dir;
 
 static unsigned int nbds_max = 16;
 static int max_part = 16;
-static struct workqueue_struct *recv_workqueue;
 static int part_shift;
 
 static int nbd_dev_dbg_init(struct nbd_device *nbd);
@@ -1038,7 +1038,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg)
 		/* We take the tx_mutex in an error path in the recv_work, so we
 		 * need to queue_work outside of the tx_mutex.
 		 */
-		queue_work(recv_workqueue, &args->work);
+		queue_work(nbd->recv_workq, &args->work);
 
 		atomic_inc(&config->live_connections);
 		wake_up(&config->conn_wait);
@@ -1139,6 +1139,10 @@ static void nbd_config_put(struct nbd_device *nbd)
 		kfree(nbd->config);
 		nbd->config = NULL;
 
+		if (nbd->recv_workq)
+			destroy_workqueue(nbd->recv_workq);
+		nbd->recv_workq = NULL;
+
 		nbd->tag_set.timeout = 0;
 		nbd->disk->queue->limits.discard_granularity = 0;
 		nbd->disk->queue->limits.discard_alignment = 0;
@@ -1167,6 +1171,14 @@ static int nbd_start_device(struct nbd_device *nbd)
 		return -EINVAL;
 	}
 
+	nbd->recv_workq = alloc_workqueue("knbd%d-recv",
+					  WQ_MEM_RECLAIM | WQ_HIGHPRI |
+					  WQ_UNBOUND, 0, nbd->index);
+	if (!nbd->recv_workq) {
+		dev_err(disk_to_dev(nbd->disk), "Could not allocate knbd recv work queue.\n");
+		return -ENOMEM;
+	}
+
 	blk_mq_update_nr_hw_queues(&nbd->tag_set, config->num_connections);
 	nbd->task_recv = current;
 
@@ -1197,7 +1209,7 @@ static int nbd_start_device(struct nbd_device *nbd)
 		INIT_WORK(&args->work, recv_work);
 		args->nbd = nbd;
 		args->index = i;
-		queue_work(recv_workqueue, &args->work);
+		queue_work(nbd->recv_workq, &args->work);
 	}
 	nbd_size_update(nbd);
 	return error;
@@ -1217,8 +1229,10 @@ static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *b
 	mutex_unlock(&nbd->config_lock);
 	ret = wait_event_interruptible(config->recv_wq,
 					 atomic_read(&config->recv_threads) == 0);
-	if (ret)
+	if (ret) {
 		sock_shutdown(nbd);
+		flush_workqueue(nbd->recv_workq);
+	}
 	mutex_lock(&nbd->config_lock);
 	nbd_bdev_reset(bdev);
 	/* user requested, ignore socket errors */
@@ -1877,6 +1891,12 @@ static void nbd_disconnect_and_put(struct nbd_device *nbd)
 	nbd_disconnect(nbd);
 	nbd_clear_sock(nbd);
 	mutex_unlock(&nbd->config_lock);
+	/*
+	 * Make sure recv thread has finished, so it does not drop the last
+	 * config ref and try to destroy the workqueue from inside the work
+	 * queue.
+	 */
+	flush_workqueue(nbd->recv_workq);
 	if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
 			       &nbd->config->runtime_flags))
 		nbd_config_put(nbd);
@@ -2263,20 +2283,12 @@ static int __init nbd_init(void)
 
 	if (nbds_max > 1UL << (MINORBITS - part_shift))
 		return -EINVAL;
-	recv_workqueue = alloc_workqueue("knbd-recv",
-					 WQ_MEM_RECLAIM | WQ_HIGHPRI |
-					 WQ_UNBOUND, 0);
-	if (!recv_workqueue)
-		return -ENOMEM;
 
-	if (register_blkdev(NBD_MAJOR, "nbd")) {
-		destroy_workqueue(recv_workqueue);
+	if (register_blkdev(NBD_MAJOR, "nbd"))
 		return -EIO;
-	}
 
 	if (genl_register_family(&nbd_genl_family)) {
 		unregister_blkdev(NBD_MAJOR, "nbd");
-		destroy_workqueue(recv_workqueue);
 		return -EINVAL;
 	}
 	nbd_dbg_init();
@@ -2318,7 +2330,6 @@ static void __exit nbd_cleanup(void)
 
 	idr_destroy(&nbd_index_idr);
 	genl_unregister_family(&nbd_genl_family);
-	destroy_workqueue(recv_workqueue);
 	unregister_blkdev(NBD_MAJOR, "nbd");
 }
 
drivers/crypto/caam/caamalg_desc.c +9 -0
index 72531837571e..28ecef7a481c 100644
@@ -503,6 +503,7 @@ void cnstr_shdsc_aead_givencap(u32 * const desc, struct alginfo *cdata,
 			       const bool is_qi, int era)
 {
 	u32 geniv, moveiv;
+	u32 *wait_cmd;
 
 	/* Note: Context registers are saved. */
 	init_sh_desc_key_aead(desc, cdata, adata, is_rfc3686, nonce, era);
@@ -598,6 +599,14 @@ void cnstr_shdsc_aead_givencap(u32 * const desc, struct alginfo *cdata,
 
 	/* Will read cryptlen */
 	append_math_add(desc, VARSEQINLEN, SEQINLEN, REG0, CAAM_CMD_SZ);
+
+	/*
+	 * Wait for IV transfer (ofifo -> class2) to finish before starting
+	 * ciphertext transfer (ofifo -> external memory).
+	 */
+	wait_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL | JUMP_COND_NIFP);
+	set_jump_tgt_here(desc, wait_cmd);
+
 	append_seq_fifo_load(desc, 0, FIFOLD_CLASS_BOTH | KEY_VLF |
 			     FIFOLD_TYPE_MSG1OUT2 | FIFOLD_TYPE_LASTBOTH);
 	append_seq_fifo_store(desc, 0, FIFOST_TYPE_MESSAGE_DATA | KEY_VLF);
drivers/crypto/caam/caamalg_desc.h +1 -1
index da4a4ee60c80..706007624d82 100644
@@ -12,7 +12,7 @@
 #define DESC_AEAD_BASE			(4 * CAAM_CMD_SZ)
 #define DESC_AEAD_ENC_LEN		(DESC_AEAD_BASE + 11 * CAAM_CMD_SZ)
 #define DESC_AEAD_DEC_LEN		(DESC_AEAD_BASE + 15 * CAAM_CMD_SZ)
-#define DESC_AEAD_GIVENC_LEN		(DESC_AEAD_ENC_LEN + 7 * CAAM_CMD_SZ)
+#define DESC_AEAD_GIVENC_LEN		(DESC_AEAD_ENC_LEN + 8 * CAAM_CMD_SZ)
 #define DESC_QI_AEAD_ENC_LEN		(DESC_AEAD_ENC_LEN + 3 * CAAM_CMD_SZ)
 #define DESC_QI_AEAD_DEC_LEN		(DESC_AEAD_DEC_LEN + 3 * CAAM_CMD_SZ)
 #define DESC_QI_AEAD_GIVENC_LEN		(DESC_AEAD_GIVENC_LEN + 3 * CAAM_CMD_SZ)
drivers/crypto/caam/error.c +1 -0
index 4f0d45865aa2..95da6ae43482 100644
@@ -118,6 +118,7 @@ static const struct {
 	u8 value;
 	const char *error_text;
 } qi_error_list[] = {
+	{ 0x00, "No error" },
 	{ 0x1F, "Job terminated by FQ or ICID flush" },
 	{ 0x20, "FD format error"},
 	{ 0x21, "FD command format error"},
drivers/crypto/caam/qi.c +4 -1
index 0fe618e3804a..19a378bdf331 100644
@@ -163,7 +163,10 @@ static void caam_fq_ern_cb(struct qman_portal *qm, struct qman_fq *fq,
 	dma_unmap_single(drv_req->drv_ctx->qidev, qm_fd_addr(fd),
 			 sizeof(drv_req->fd_sgt), DMA_BIDIRECTIONAL);
 
-	drv_req->cbk(drv_req, -EIO);
+	if (fd->status)
+		drv_req->cbk(drv_req, be32_to_cpu(fd->status));
+	else
+		drv_req->cbk(drv_req, JRSTA_SSRC_QI);
 }
 
 static struct qman_fq *create_caam_req_fq(struct device *qidev,
drivers/crypto/caam/regs.h +1 -0
index 8591914d5c51..7c7ea8af6a48 100644
@@ -641,6 +641,7 @@ struct caam_job_ring {
 #define JRSTA_SSRC_CCB_ERROR        0x20000000
 #define JRSTA_SSRC_JUMP_HALT_USER   0x30000000
 #define JRSTA_SSRC_DECO             0x40000000
+#define JRSTA_SSRC_QI               0x50000000
 #define JRSTA_SSRC_JRERROR          0x60000000
 #define JRSTA_SSRC_JUMP_HALT_CC     0x70000000
 
drivers/crypto/cavium/zip/zip_main.c +3 -0
index a8447a3cf366..194624b4855b 100644
@@ -593,6 +593,7 @@ static const struct file_operations zip_stats_fops = {
 	.owner = THIS_MODULE,
 	.open  = zip_stats_open,
 	.read  = seq_read,
+	.release = single_release,
 };
 
 static int zip_clear_open(struct inode *inode, struct file *file)
@@ -604,6 +605,7 @@ static const struct file_operations zip_clear_fops = {
 	.owner = THIS_MODULE,
 	.open  = zip_clear_open,
 	.read  = seq_read,
+	.release = single_release,
 };
 
 static int zip_regs_open(struct inode *inode, struct file *file)
@@ -615,6 +617,7 @@ static const struct file_operations zip_regs_fops = {
 	.owner = THIS_MODULE,
 	.open  = zip_regs_open,
 	.read  = seq_read,
+	.release = single_release,
 };
 
 /* Root directory for thunderx_zip debugfs entry */
drivers/crypto/ccree/cc_aead.c +1 -1
index 7aa4cbe19a86..29bf397cf0c1 100644
@@ -236,7 +236,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err)
 			/* In case of payload authentication failure, MUST NOT
 			 * revealed the decrypted message --> zero its memory.
 			 */
-			cc_zero_sgl(areq->dst, areq_ctx->cryptlen);
+			cc_zero_sgl(areq->dst, areq->cryptlen);
 			err = -EBADMSG;
 		}
 	} else { /*ENCRYPT*/
drivers/crypto/ccree/cc_fips.c +7 -1
index 5ad3ffb7acaa..040e09c0e1af 100644
@@ -21,7 +21,13 @@ static bool cc_get_tee_fips_status(struct cc_drvdata *drvdata)
 	u32 reg;
 
 	reg = cc_ioread(drvdata, CC_REG(GPR_HOST));
-	return (reg == (CC_FIPS_SYNC_TEE_STATUS | CC_FIPS_SYNC_MODULE_OK));
+	/* Did the TEE report status? */
+	if (reg & CC_FIPS_SYNC_TEE_STATUS)
+		/* Yes. Is it OK? */
+		return (reg & CC_FIPS_SYNC_MODULE_OK);
+
+	/* No. It's either not in use or will be reported later */
+	return true;
 }
 
 /*
drivers/crypto/qat/qat_common/adf_common_drv.h +1 -1
index 5c4c0a253129..d78f8d5c89c3 100644
@@ -95,7 +95,7 @@ struct service_hndl {
 
 static inline int get_current_node(void)
 {
-	return topology_physical_package_id(smp_processor_id());
+	return topology_physical_package_id(raw_smp_processor_id());
 }
 
 int adf_service_register(struct service_hndl *service);
drivers/devfreq/tegra-devfreq.c +5 -7
index 35c38aad8b4f..cd15c96dd27f 100644
@@ -474,11 +474,11 @@ static int tegra_devfreq_target(struct device *dev, unsigned long *freq,
 {
 	struct tegra_devfreq *tegra = dev_get_drvdata(dev);
 	struct dev_pm_opp *opp;
-	unsigned long rate = *freq * KHZ;
+	unsigned long rate;
 
-	opp = devfreq_recommended_opp(dev, &rate, flags);
+	opp = devfreq_recommended_opp(dev, freq, flags);
 	if (IS_ERR(opp)) {
-		dev_err(dev, "Failed to find opp for %lu KHz\n", *freq);
+		dev_err(dev, "Failed to find opp for %lu Hz\n", *freq);
 		return PTR_ERR(opp);
 	}
 	rate = dev_pm_opp_get_freq(opp);
@@ -487,8 +487,6 @@ static int tegra_devfreq_target(struct device *dev, unsigned long *freq,
 	clk_set_min_rate(tegra->emc_clock, rate);
 	clk_set_rate(tegra->emc_clock, 0);
 
-	*freq = rate;
-
 	return 0;
 }
 
@@ -498,7 +496,7 @@ static int tegra_devfreq_get_dev_status(struct device *dev,
 	struct tegra_devfreq *tegra = dev_get_drvdata(dev);
 	struct tegra_devfreq_device *actmon_dev;
 
-	stat->current_frequency = tegra->cur_freq;
+	stat->current_frequency = tegra->cur_freq * KHZ;
 
 	/* To be used by the tegra governor */
 	stat->private_data = tegra;
@@ -553,7 +551,7 @@ static int tegra_governor_get_target(struct devfreq *devfreq,
 		target_freq = max(target_freq, dev->target_freq);
 	}
 
-	*freq = target_freq;
+	*freq = target_freq * KHZ;
 
 	return 0;
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -1
index 7850084a05e3..60655834d649 100644
@@ -143,7 +143,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 	/* ring tests don't use a job */
 	if (job) {
 		vm = job->vm;
-		fence_ctx = job->base.s_fence->scheduled.context;
+		fence_ctx = job->base.s_fence ?
+			job->base.s_fence->scheduled.context : 0;
 	} else {
 		vm = NULL;
 		fence_ctx = 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
index 0cf7e8606fd3..00beba533582 100644
@@ -662,6 +662,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 		if (sh_num == AMDGPU_INFO_MMR_SH_INDEX_MASK)
 			sh_num = 0xffffffff;
 
+		if (info->read_mmr_reg.count > 128)
+			return -EINVAL;
+
 		regs = kmalloc_array(info->read_mmr_reg.count, sizeof(*regs), GFP_KERNEL);
 		if (!regs)
 			return -ENOMEM;
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1 -1
index 9aaf2deff6e9..8bf9f541e7fe 100644
@@ -532,7 +532,7 @@ static int navi10_get_metrics_table(struct smu_context *smu,
 	struct smu_table_context *smu_table= &smu->smu_table;
 	int ret = 0;
 
-	if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + HZ / 1000)) {
+	if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + msecs_to_jiffies(100))) {
 		ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
 				(void *)smu_table->metrics_table, false);
 		if (ret) {
drivers/gpu/drm/arm/malidp_hw.c +2 -1
index 50af399d7f6f..380be66d4c6e 100644
@@ -385,6 +385,7 @@ int malidp_format_get_bpp(u32 fmt)
 		switch (fmt) {
 		case DRM_FORMAT_VUY101010:
 			bpp = 30;
+			break;
 		case DRM_FORMAT_YUV420_10BIT:
 			bpp = 15;
 			break;
@@ -1309,7 +1310,7 @@ static irqreturn_t malidp_se_irq(int irq, void *arg)
 			break;
 		case MW_RESTART:
 			drm_writeback_signal_completion(&malidp->mw_connector, 0);
-			/* fall through to a new start */
+			/* fall through - to a new start */
 		case MW_START:
 			/* writeback started, need to emulate one-shot mode */
 			hw->disable_memwrite(hwdev);
drivers/gpu/drm/drm_atomic_uapi.c +1 -2
index abe38bdf85ae..15be4667f26f 100644
@@ -1301,8 +1301,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
 	if (arg->reserved)
 		return -EINVAL;
 
-	if ((arg->flags & DRM_MODE_PAGE_FLIP_ASYNC) &&
-			!dev->mode_config.async_page_flip)
+	if (arg->flags & DRM_MODE_PAGE_FLIP_ASYNC)
 		return -EINVAL;
 
 	/* can't test and expect an event at the same time. */
drivers/gpu/drm/drm_ioctl.c +6 -1
index bd810454d239..d9de5cf8c09f 100644
@@ -336,7 +336,12 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
 	case DRM_CLIENT_CAP_ATOMIC:
 		if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
 			return -EOPNOTSUPP;
-		if (req->value > 1)
+		/* The modesetting DDX has a totally broken idea of atomic. */
+		if (current->comm[0] == 'X' && req->value == 1) {
+			pr_info("broken atomic modeset userspace detected, disabling atomic\n");
+			return -EOPNOTSUPP;
+		}
+		if (req->value > 2)
 			return -EINVAL;
 		file_priv->atomic = req->value;
 		file_priv->universal_planes = req->value;
drivers/gpu/drm/i915/display/intel_display.c +8 -4
index 592b92782fab..1e59a78e74bf 100644
@@ -7132,7 +7132,7 @@ static int ironlake_fdi_compute_config(struct intel_crtc *intel_crtc,
 	pipe_config->fdi_lanes = lane;
 
 	intel_link_compute_m_n(pipe_config->pipe_bpp, lane, fdi_dotclock,
-			       link_bw, &pipe_config->fdi_m_n, false);
+			       link_bw, &pipe_config->fdi_m_n, false, false);
 
 	ret = ironlake_check_fdi_lanes(dev, intel_crtc->pipe, pipe_config);
 	if (ret == -EDEADLK)
@@ -7379,11 +7379,15 @@ void
 intel_link_compute_m_n(u16 bits_per_pixel, int nlanes,
 		       int pixel_clock, int link_clock,
 		       struct intel_link_m_n *m_n,
-		       bool constant_n)
+		       bool constant_n, bool fec_enable)
 {
-	m_n->tu = 64;
+	u32 data_clock = bits_per_pixel * pixel_clock;
+
+	if (fec_enable)
+		data_clock = intel_dp_mode_to_fec_clock(data_clock);
 
-	compute_m_n(bits_per_pixel * pixel_clock,
+	m_n->tu = 64;
+	compute_m_n(data_clock,
 		    link_clock * nlanes * 8,
 		    &m_n->gmch_m, &m_n->gmch_n,
 		    constant_n);
drivers/gpu/drm/i915/display/intel_display.h +1 -1
index ee6b8194a459..868914c6d9b5 100644
@@ -351,7 +351,7 @@ struct intel_link_m_n {
 void intel_link_compute_m_n(u16 bpp, int nlanes,
 			    int pixel_clock, int link_clock,
 			    struct intel_link_m_n *m_n,
-			    bool constant_n);
+			    bool constant_n, bool fec_enable);
 bool is_ccs_modifier(u64 modifier);
 void lpt_disable_clkout_dp(struct drm_i915_private *dev_priv);
 u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/display/intel_dp.c +95 -89

214 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_dp.h +2 -4
index da70b1a41c83..c00e05894e35 100644
@@ -102,10 +102,6 @@ bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
 bool intel_dp_source_supports_hbr3(struct intel_dp *intel_dp);
 bool
 intel_dp_get_link_status(struct intel_dp *intel_dp, u8 *link_status);
-u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,
-				int mode_clock, int mode_hdisplay);
-u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp, int mode_clock,
-				int mode_hdisplay);
 
 bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
 bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp);
@@ -120,4 +116,6 @@ static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
 	return ~((1 << lane_count) - 1) & 0xf;
 }
 
+u32 intel_dp_mode_to_fec_clock(u32 mode_clock);
+
 #endif /* __INTEL_DP_H__ */
drivers/gpu/drm/i915/display/intel_dp_mst.c +1 -1
index 8aa6a31e8ad0..c42d487f4dff 100644
@@ -81,7 +81,7 @@ static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
 			       adjusted_mode->crtc_clock,
 			       crtc_state->port_clock,
 			       &crtc_state->dp_m_n,
-			       constant_n);
+			       constant_n, crtc_state->fec_enable);
 	crtc_state->dp_m_n.tu = slots;
 
 	return 0;
drivers/gpu/drm/i915/gvt/scheduler.c +15 -13
index 75baff657e43..10875b8a39a3 100644
@@ -1424,9 +1424,6 @@ static int prepare_mm(struct intel_vgpu_workload *workload)
 #define same_context(a, b) (((a)->context_id == (b)->context_id) && \
 		((a)->lrca == (b)->lrca))
 
-#define get_last_workload(q) \
-	(list_empty(q) ? NULL : container_of(q->prev, \
-	struct intel_vgpu_workload, list))
 /**
  * intel_vgpu_create_workload - create a vGPU workload
  * @vgpu: a vGPU
@@ -1446,7 +1443,7 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id,
 {
 	struct intel_vgpu_submission *s = &vgpu->submission;
 	struct list_head *q = workload_q_head(vgpu, ring_id);
-	struct intel_vgpu_workload *last_workload = get_last_workload(q);
+	struct intel_vgpu_workload *last_workload = NULL;
 	struct intel_vgpu_workload *workload = NULL;
 	struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
 	u64 ring_context_gpa;
@@ -1472,15 +1469,20 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id,
 	head &= RB_HEAD_OFF_MASK;
 	tail &= RB_TAIL_OFF_MASK;
 
-	if (last_workload && same_context(&last_workload->ctx_desc, desc)) {
-		gvt_dbg_el("ring id %d cur workload == last\n", ring_id);
-		gvt_dbg_el("ctx head %x real head %lx\n", head,
-				last_workload->rb_tail);
-		/*
-		 * cannot use guest context head pointer here,
-		 * as it might not be updated at this time
-		 */
-		head = last_workload->rb_tail;
+	list_for_each_entry_reverse(last_workload, q, list) {
+
+		if (same_context(&last_workload->ctx_desc, desc)) {
+			gvt_dbg_el("ring id %d cur workload == last\n",
+					ring_id);
+			gvt_dbg_el("ctx head %x real head %lx\n", head,
+					last_workload->rb_tail);
+			/*
+			 * cannot use guest context head pointer here,
+			 * as it might not be updated at this time
+			 */
+			head = last_workload->rb_tail;
+			break;
+		}
 	}
 
 	gvt_dbg_el("ring id %d begin a new workload\n", ring_id);
drivers/gpu/drm/i915/i915_drv.h +1 -0
index fe7a6ec2c199..94b91a952699 100644
@@ -1073,6 +1073,7 @@ struct i915_frontbuffer_tracking {
 };
 
 struct i915_virtual_gpu {
+	struct mutex lock; /* serialises sending of g2v_notify command pkts */
 	bool active;
 	u32 caps;
 };
drivers/gpu/drm/i915/i915_gem_gtt.c +7 -5
index 7015a97b1097..6b702da7bba7 100644
@@ -1248,14 +1248,15 @@ static int gen8_init_scratch(struct i915_address_space *vm)
 	return ret;
 }
 
-static int gen8_ppgtt_notify_vgt(struct i915_ppgtt *ppgtt, bool create)
+static void gen8_ppgtt_notify_vgt(struct i915_ppgtt *ppgtt, bool create)
 {
-	struct i915_address_space *vm = &ppgtt->vm;
-	struct drm_i915_private *dev_priv = vm->i915;
+	struct drm_i915_private *dev_priv = ppgtt->vm.i915;
 	enum vgt_g2v_type msg;
 	int i;
 
-	if (i915_vm_is_4lvl(vm)) {
+	mutex_lock(&dev_priv->vgpu.lock);
+
+	if (i915_vm_is_4lvl(&ppgtt->vm)) {
 		const u64 daddr = px_dma(ppgtt->pd);
 
 		I915_WRITE(vgtif_reg(pdp[0].lo), lower_32_bits(daddr));
@@ -1275,9 +1276,10 @@ static int gen8_ppgtt_notify_vgt(struct i915_ppgtt *ppgtt, bool create)
 				VGT_G2V_PPGTT_L3_PAGE_TABLE_DESTROY);
 	}
 
+	/* g2v_notify atomically (via hv trap) consumes the message packet. */
 	I915_WRITE(vgtif_reg(g2v_notify), msg);
 
-	return 0;
+	mutex_unlock(&dev_priv->vgpu.lock);
 }
 
 static void gen8_free_scratch(struct i915_address_space *vm)
drivers/gpu/drm/i915/i915_vgpu.c +1 -0
index 724627afdedc..8b03c67f8e5b 100644
@@ -79,6 +79,7 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 	dev_priv->vgpu.caps = __raw_uncore_read32(uncore, vgtif_reg(vgt_caps));
 
 	dev_priv->vgpu.active = true;
+	mutex_init(&dev_priv->vgpu.lock);
 	DRM_INFO("Virtual GPU for Intel GVT-g detected.\n");
 }
 
drivers/gpu/drm/msm/dsi/dsi_host.c +4 -4
index aa35d18ab43c..02acb4338721 100644
@@ -421,15 +421,15 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
 	}
 
 	msm_host->byte_clk_src = clk_get_parent(msm_host->byte_clk);
-	if (!msm_host->byte_clk_src) {
-		ret = -ENODEV;
+	if (IS_ERR(msm_host->byte_clk_src)) {
+		ret = PTR_ERR(msm_host->byte_clk_src);
 		pr_err("%s: can't find byte_clk clock. ret=%d\n", __func__, ret);
 		goto exit;
 	}
 
 	msm_host->pixel_clk_src = clk_get_parent(msm_host->pixel_clk);
-	if (!msm_host->pixel_clk_src) {
-		ret = -ENODEV;
+	if (IS_ERR(msm_host->pixel_clk_src)) {
+		ret = PTR_ERR(msm_host->pixel_clk_src);
 		pr_err("%s: can't find pixel_clk clock. ret=%d\n", __func__, ret);
 		goto exit;
 	}
drivers/gpu/drm/nouveau/dispnv50/disp.c +2 -1
index 5c36c75232e6..895a34a1a1ea 100644
@@ -1603,7 +1603,8 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
 			nv_encoder->aux = aux;
 		}
 
-		if ((data = nvbios_dp_table(bios, &ver, &hdr, &cnt, &len)) &&
+		if (nv_connector->type != DCB_CONNECTOR_eDP &&
+		    (data = nvbios_dp_table(bios, &ver, &hdr, &cnt, &len)) &&
 		    ver >= 0x40 && (nvbios_rd08(bios, data + 0x08) & 0x04)) {
 			ret = nv50_mstm_new(nv_encoder, &nv_connector->aux, 16,
 					    nv_connector->base.base.id,
drivers/gpu/drm/omapdrm/dss/dss.c +1 -1
index 5711b7a720e6..25b6a79dc385 100644
@@ -1090,7 +1090,7 @@ static const struct dss_features omap34xx_dss_feats = {
 
 static const struct dss_features omap3630_dss_feats = {
 	.model			=	DSS_MODEL_OMAP3,
-	.fck_div_max		=	32,
+	.fck_div_max		=	31,
 	.fck_freq_max		=	173000000,
 	.dss_fck_multiplier	=	1,
 	.parent_clk_name	=	"dpll4_ck",
drivers/gpu/drm/radeon/radeon_drv.c +31 -0
index 15d7bebe1729..5cc0fbb04ab1 100644
@@ -325,8 +325,39 @@ bool radeon_device_is_virtual(void);
 static int radeon_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
+	unsigned long flags = 0;
 	int ret;
 
+	if (!ent)
+		return -ENODEV; /* Avoid NULL-ptr deref in drm_get_pci_dev */
+
+	flags = ent->driver_data;
+
+	if (!radeon_si_support) {
+		switch (flags & RADEON_FAMILY_MASK) {
+		case CHIP_TAHITI:
+		case CHIP_PITCAIRN:
+		case CHIP_VERDE:
+		case CHIP_OLAND:
+		case CHIP_HAINAN:
+			dev_info(&pdev->dev,
+				 "SI support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+	if (!radeon_cik_support) {
+		switch (flags & RADEON_FAMILY_MASK) {
+		case CHIP_KAVERI:
+		case CHIP_BONAIRE:
+		case CHIP_HAWAII:
+		case CHIP_KABINI:
+		case CHIP_MULLINS:
+			dev_info(&pdev->dev,
+				 "CIK support disabled by module param\n");
+			return -ENODEV;
+		}
+	}
+
 	if (vga_switcheroo_client_probe_defer(pdev))
 		return -EPROBE_DEFER;
 
drivers/gpu/drm/radeon/radeon_kms.c +0 -25
index 07f7ace42c4b..e85c554eeaa9 100644
@@ -100,31 +100,6 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	struct radeon_device *rdev;
 	int r, acpi_status;
 
-	if (!radeon_si_support) {
-		switch (flags & RADEON_FAMILY_MASK) {
-		case CHIP_TAHITI:
-		case CHIP_PITCAIRN:
-		case CHIP_VERDE:
-		case CHIP_OLAND:
-		case CHIP_HAINAN:
-			dev_info(dev->dev,
-				 "SI support disabled by module param\n");
-			return -ENODEV;
-		}
-	}
-	if (!radeon_cik_support) {
-		switch (flags & RADEON_FAMILY_MASK) {
-		case CHIP_KAVERI:
-		case CHIP_BONAIRE:
-		case CHIP_HAWAII:
-		case CHIP_KABINI:
-		case CHIP_MULLINS:
-			dev_info(dev->dev,
-				 "CIK support disabled by module param\n");
-			return -ENODEV;
-		}
-	}
-
 	rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL);
 	if (rdev == NULL) {
 		return -ENOMEM;
drivers/hwtracing/coresight/coresight-etm4x.c +13 -2
index 7bcac8896fc1..67928ff19c71 100644
@@ -188,6 +188,13 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata)
 		dev_err(etm_dev,
 			"timeout while waiting for Idle Trace Status\n");
 
+	/*
+	 * As recommended by section 4.3.7 ("Synchronization when using the
+	 * memory-mapped interface") of ARM IHI 0064D
+	 */
+	dsb(sy);
+	isb();
+
 done:
 	CS_LOCK(drvdata->base);
 
@@ -453,8 +460,12 @@ static void etm4_disable_hw(void *info)
 	/* EN, bit[0] Trace unit enable bit */
 	control &= ~0x1;
 
-	/* make sure everything completes before disabling */
-	mb();
+	/*
+	 * Make sure everything completes before disabling, as recommended
+	 * by section 7.3.77 ("TRCVICTLR, ViewInst Main Control Register,
+	 * SSTATUS") of ARM IHI 0064D
+	 */
+	dsb(sy);
 	isb();
 	writel_relaxed(control, drvdata->base + TRCPRGCTLR);
 
drivers/i2c/busses/i2c-qcom-geni.c +8 -4
index a89bfce5388e..17abf60c94ae 100644
@@ -355,11 +355,13 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 {
 	dma_addr_t rx_dma;
 	unsigned long time_left;
-	void *dma_buf;
+	void *dma_buf = NULL;
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+
 	if (dma_buf)
 		geni_se_select_mode(se, GENI_SE_DMA);
 	else
@@ -394,11 +396,13 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 {
 	dma_addr_t tx_dma;
 	unsigned long time_left;
-	void *dma_buf;
+	void *dma_buf = NULL;
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+
 	if (dma_buf)
 		geni_se_select_mode(se, GENI_SE_DMA);
 	else
drivers/iommu/amd_iommu.c +2 -1
index e1259429ded2..3b1d7ae6f75e 100644
@@ -1490,6 +1490,7 @@ static u64 *alloc_pte(struct protection_domain *domain,
 		pte_level = PM_PTE_LEVEL(__pte);
 
 		if (!IOMMU_PTE_PRESENT(__pte) ||
+		    pte_level == PAGE_MODE_NONE ||
 		    pte_level == PAGE_MODE_7_LEVEL) {
 			page = (u64 *)get_zeroed_page(gfp);
 			if (!page)
@@ -1500,7 +1501,7 @@ static u64 *alloc_pte(struct protection_domain *domain,
 			/* pte could have been changed somewhere. */
 			if (cmpxchg64(pte, __pte, __npte) != __pte)
 				free_page((unsigned long)page);
-			else if (pte_level == PAGE_MODE_7_LEVEL)
+			else if (IOMMU_PTE_PRESENT(__pte))
 				domain->updated = true;
 
 			continue;
drivers/mmc/host/sdhci-of-esdhc.c +6 -1
index 4dd43b1adf2c..74de5e8c45c8 100644
@@ -495,7 +495,12 @@ static int esdhc_of_enable_dma(struct sdhci_host *host)
 		dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40));
 
 	value = sdhci_readl(host, ESDHC_DMA_SYSCTL);
-	value |= ESDHC_DMA_SNOOP;
+
+	if (of_dma_is_coherent(dev->of_node))
+		value |= ESDHC_DMA_SNOOP;
+	else
+		value &= ~ESDHC_DMA_SNOOP;
+
 	sdhci_writel(host, value, ESDHC_DMA_SYSCTL);
 	return 0;
 }
drivers/mmc/host/sdhci-tegra.c +28 -20

141 lines not on this page · raw message

drivers/mmc/host/sdhci.c +14 -13
index c66e66fbaeb4..e41ccb836538 100644
@@ -2857,6 +2857,7 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *intmask_p)
 static void sdhci_adma_show_error(struct sdhci_host *host)
 {
 	void *desc = host->adma_table;
+	dma_addr_t dma = host->adma_addr;
 
 	sdhci_dumpregs(host);
 
@@ -2864,18 +2865,21 @@ static void sdhci_adma_show_error(struct sdhci_host *host)
 		struct sdhci_adma2_64_desc *dma_desc = desc;
 
 		if (host->flags & SDHCI_USE_64_BIT_DMA)
-			DBG("%p: DMA 0x%08x%08x, LEN 0x%04x, Attr=0x%02x\n",
-			    desc, le32_to_cpu(dma_desc->addr_hi),
+			SDHCI_DUMP("%08llx: DMA 0x%08x%08x, LEN 0x%04x, Attr=0x%02x\n",
+			    (unsigned long long)dma,
+			    le32_to_cpu(dma_desc->addr_hi),
 			    le32_to_cpu(dma_desc->addr_lo),
 			    le16_to_cpu(dma_desc->len),
 			    le16_to_cpu(dma_desc->cmd));
 		else
-			DBG("%p: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n",
-			    desc, le32_to_cpu(dma_desc->addr_lo),
+			SDHCI_DUMP("%08llx: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n",
+			    (unsigned long long)dma,
+			    le32_to_cpu(dma_desc->addr_lo),
 			    le16_to_cpu(dma_desc->len),
 			    le16_to_cpu(dma_desc->cmd));
 
 		desc += host->desc_sz;
+		dma += host->desc_sz;
 
 		if (dma_desc->cmd & cpu_to_le16(ADMA2_END))
 			break;
@@ -2951,7 +2955,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
 			!= MMC_BUS_TEST_R)
 		host->data->error = -EILSEQ;
 	else if (intmask & SDHCI_INT_ADMA_ERROR) {
-		pr_err("%s: ADMA error\n", mmc_hostname(host->mmc));
+		pr_err("%s: ADMA error: 0x%08x\n", mmc_hostname(host->mmc),
+		       intmask);
 		sdhci_adma_show_error(host);
 		host->data->error = -EIO;
 		if (host->ops->adma_workaround)
@@ -3758,18 +3763,14 @@ int sdhci_setup_host(struct sdhci_host *host)
 		host->flags &= ~SDHCI_USE_ADMA;
 	}
 
-	/*
-	 * It is assumed that a 64-bit capable device has set a 64-bit DMA mask
-	 * and *must* do 64-bit DMA.  A driver has the opportunity to change
-	 * that during the first call to ->enable_dma().  Similarly
-	 * SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to
-	 * implement.
-	 */
 	if (sdhci_can_64bit_dma(host))
 		host->flags |= SDHCI_USE_64_BIT_DMA;
 
 	if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
-		ret = sdhci_set_dma_mask(host);
+		if (host->ops->set_dma_mask)
+			ret = host->ops->set_dma_mask(host);
+		else
+			ret = sdhci_set_dma_mask(host);
 
 		if (!ret && host->ops->enable_dma)
 			ret = host->ops->enable_dma(host);
drivers/mmc/host/sdhci.h +1 -0
index 902f855efe8f..8285498c0d8a 100644
@@ -622,6 +622,7 @@ struct sdhci_ops {
 
 	u32		(*irq)(struct sdhci_host *host, u32 intmask);
 
+	int		(*set_dma_mask)(struct sdhci_host *host);
 	int		(*enable_dma)(struct sdhci_host *host);
 	unsigned int	(*get_max_clock)(struct sdhci_host *host);
 	unsigned int	(*get_min_clock)(struct sdhci_host *host);
drivers/net/can/spi/mcp251x.c +14 -5
index 12358f06d194..5d6f8977df3f 100644
@@ -612,7 +612,7 @@ static int mcp251x_setup(struct net_device *net, struct spi_device *spi)
 static int mcp251x_hw_reset(struct spi_device *spi)
 {
 	struct mcp251x_priv *priv = spi_get_drvdata(spi);
-	u8 reg;
+	unsigned long timeout;
 	int ret;
 
 	/* Wait for oscillator startup timer after power up */
@@ -626,10 +626,19 @@ static int mcp251x_hw_reset(struct spi_device *spi)
 	/* Wait for oscillator startup timer after reset */
 	mdelay(MCP251X_OST_DELAY_MS);
 
-	reg = mcp251x_read_reg(spi, CANSTAT);
-	if ((reg & CANCTRL_REQOP_MASK) != CANCTRL_REQOP_CONF)
-		return -ENODEV;
-
+	/* Wait for reset to finish */
+	timeout = jiffies + HZ;
+	while ((mcp251x_read_reg(spi, CANSTAT) & CANCTRL_REQOP_MASK) !=
+	       CANCTRL_REQOP_CONF) {
+		usleep_range(MCP251X_OST_DELAY_MS * 1000,
+			     MCP251X_OST_DELAY_MS * 1000 * 2);
+
+		if (time_after(jiffies, timeout)) {
+			dev_err(&spi->dev,
+				"MCP251x didn't enter in conf mode after reset\n");
+			return -EBUSY;
+		}
+	}
 	return 0;
 }
 
drivers/net/dsa/microchip/ksz_common.h +1 -1
index 72ec250b9540..823f544add0a 100644
@@ -130,7 +130,7 @@ static inline void ksz_pwrite32(struct ksz_device *dev, int port, int offset,
 	{								\
 		.name = #width,						\
 		.val_bits = (width),					\
-		.reg_stride = (width) / 8,				\
+		.reg_stride = 1,					\
 		.reg_bits = (regbits) + (regalign),			\
 		.pad_bits = (regpad),					\
 		.max_register = BIT(regbits) - 1,			\
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +6 -0
index 202e9a246019..7c13656a8338 100644
@@ -21,6 +21,7 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
 					 struct netlink_ext_ack *extack)
 {
 	const struct flow_action_entry *act;
+	int mirror_act_count = 0;
 	int err, i;
 
 	if (!flow_action_has_entries(flow_action))
@@ -95,6 +96,11 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
 		case FLOW_ACTION_MIRRED: {
 			struct net_device *out_dev = act->dev;
 
+			if (mirror_act_count++) {
+				NL_SET_ERR_MSG_MOD(extack, "Multiple mirror actions per rule are not supported");
+				return -EOPNOTSUPP;
+			}
+
 			err = mlxsw_sp_acl_rulei_act_mirror(mlxsw_sp, rulei,
 							    block, out_dev,
 							    extack);
drivers/net/ethernet/netronome/nfp/abm/cls.c +10 -4
index 23ebddfb9532..9f8a1f69c0c4 100644
@@ -176,8 +176,10 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
 	u8 mask, val;
 	int err;
 
-	if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack))
+	if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack)) {
+		err = -EOPNOTSUPP;
 		goto err_delete;
+	}
 
 	tos_off = proto == htons(ETH_P_IP) ? 16 : 20;
 
@@ -198,14 +200,18 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
 		if ((iter->val & cmask) == (val & cmask) &&
 		    iter->band != knode->res->classid) {
 			NL_SET_ERR_MSG_MOD(extack, "conflict with already offloaded filter");
+			err = -EOPNOTSUPP;
 			goto err_delete;
 		}
 	}
 
 	if (!match) {
 		match = kzalloc(sizeof(*match), GFP_KERNEL);
-		if (!match)
-			return -ENOMEM;
+		if (!match) {
+			err = -ENOMEM;
+			goto err_delete;
+		}
+
 		list_add(&match->list, &alink->dscp_map);
 	}
 	match->handle = knode->handle;
@@ -221,7 +227,7 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
 
 err_delete:
 	nfp_abm_u32_knode_delete(alink, knode);
-	return -EOPNOTSUPP;
+	return err;
 }
 
 static int nfp_abm_setup_tc_block_cb(enum tc_setup_type type,
drivers/net/ieee802154/atusb.c +2 -1
index ceddb424f887..0dd0ba915ab9 100644
@@ -1137,10 +1137,11 @@ static void atusb_disconnect(struct usb_interface *interface)
 
 	ieee802154_unregister_hw(atusb->hw);
 
+	usb_put_dev(atusb->usb_dev);
+
 	ieee802154_free_hw(atusb->hw);
 
 	usb_set_intfdata(interface, NULL);
-	usb_put_dev(atusb->usb_dev);
 
 	pr_debug("%s done\n", __func__);
 }
drivers/ntb/test/ntb_perf.c +1 -1
index d028331558ea..e9b7c2dfc730 100644
@@ -1378,7 +1378,7 @@ static int perf_setup_peer_mw(struct perf_peer *peer)
 	int ret;
 
 	/* Get outbound MW parameters and map it */
-	ret = ntb_peer_mw_get_addr(perf->ntb, peer->gidx, &phys_addr,
+	ret = ntb_peer_mw_get_addr(perf->ntb, perf->gidx, &phys_addr,
 				   &peer->outbuf_size);
 	if (ret)
 		return ret;
drivers/nvdimm/btt.c +4 -4
index a8d56887ec88..3e9f45aec8d1 100644
@@ -392,9 +392,9 @@ static int btt_flog_write(struct arena_info *arena, u32 lane, u32 sub,
 	arena->freelist[lane].sub = 1 - arena->freelist[lane].sub;
 	if (++(arena->freelist[lane].seq) == 4)
 		arena->freelist[lane].seq = 1;
-	if (ent_e_flag(ent->old_map))
+	if (ent_e_flag(le32_to_cpu(ent->old_map)))
 		arena->freelist[lane].has_err = 1;
-	arena->freelist[lane].block = le32_to_cpu(ent_lba(ent->old_map));
+	arena->freelist[lane].block = ent_lba(le32_to_cpu(ent->old_map));
 
 	return ret;
 }
@@ -560,8 +560,8 @@ static int btt_freelist_init(struct arena_info *arena)
 		 * FIXME: if error clearing fails during init, we want to make
 		 * the BTT read-only
 		 */
-		if (ent_e_flag(log_new.old_map) &&
-				!ent_normal(log_new.old_map)) {
+		if (ent_e_flag(le32_to_cpu(log_new.old_map)) &&
+		    !ent_normal(le32_to_cpu(log_new.old_map))) {
 			arena->freelist[i].has_err = 1;
 			ret = arena_clear_freelist_error(arena, i);
 			if (ret)
drivers/nvdimm/bus.c +1 -1
index 798c5c4aea9c..bb3f20ebc276 100644
@@ -182,7 +182,7 @@ static int nvdimm_clear_badblocks_region(struct device *dev, void *data)
 	sector_t sector;
 
 	/* make sure device is a region */
-	if (!is_nd_pmem(dev))
+	if (!is_memory(dev))
 		return 0;
 
 	nd_region = to_nd_region(dev);
drivers/nvdimm/namespace_devs.c +4 -3
index a16e52251a30..102c9d5141ee 100644
@@ -1987,7 +1987,7 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region,
 		nd_mapping = &nd_region->mapping[i];
 		label_ent = list_first_entry_or_null(&nd_mapping->labels,
 				typeof(*label_ent), list);
-		label0 = label_ent ? label_ent->label : 0;
+		label0 = label_ent ? label_ent->label : NULL;
 
 		if (!label0) {
 			WARN_ON(1);
@@ -2322,8 +2322,9 @@ static struct device **scan_labels(struct nd_region *nd_region)
 			continue;
 
 		/* skip labels that describe extents outside of the region */
-		if (nd_label->dpa < nd_mapping->start || nd_label->dpa > map_end)
-			continue;
+		if (__le64_to_cpu(nd_label->dpa) < nd_mapping->start ||
+		    __le64_to_cpu(nd_label->dpa) > map_end)
+				continue;
 
 		i = add_namespace_resource(nd_region, nd_label, devs, count);
 		if (i < 0)
drivers/nvdimm/pfn_devs.c +2 -0
index cb98b8fe786e..b0f7832bae72 100644
@@ -618,9 +618,11 @@ static int __nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap)
 	struct nd_namespace_common *ndns = nd_pfn->ndns;
 	struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev);
 	resource_size_t base = nsio->res.start + start_pad;
+	resource_size_t end = nsio->res.end - end_trunc;
 	struct vmem_altmap __altmap = {
 		.base_pfn = init_altmap_base(base),
 		.reserve = init_altmap_reserve(base),
+		.end_pfn = PHYS_PFN(end),
 	};
 
 	memcpy(res, &nsio->res, sizeof(*res));
drivers/nvdimm/region.c +2 -2
index 37bf8719a2a4..0f6978e72e7c 100644
@@ -34,7 +34,7 @@ static int nd_region_probe(struct device *dev)
 	if (rc)
 		return rc;
 
-	if (is_nd_pmem(&nd_region->dev)) {
+	if (is_memory(&nd_region->dev)) {
 		struct resource ndr_res;
 
 		if (devm_init_badblocks(dev, &nd_region->bb))
@@ -123,7 +123,7 @@ static void nd_region_notify(struct device *dev, enum nvdimm_event event)
 		struct nd_region *nd_region = to_nd_region(dev);
 		struct resource res;
 
-		if (is_nd_pmem(&nd_region->dev)) {
+		if (is_memory(&nd_region->dev)) {
 			res.start = nd_region->ndr_start;
 			res.end = nd_region->ndr_start +
 				nd_region->ndr_size - 1;
drivers/nvdimm/region_devs.c +2 -2
index af30cbe7a8ea..47b48800fb75 100644
@@ -632,11 +632,11 @@ static umode_t region_visible(struct kobject *kobj, struct attribute *a, int n)
 	if (!is_memory(dev) && a == &dev_attr_dax_seed.attr)
 		return 0;
 
-	if (!is_nd_pmem(dev) && a == &dev_attr_badblocks.attr)
+	if (!is_memory(dev) && a == &dev_attr_badblocks.attr)
 		return 0;
 
 	if (a == &dev_attr_resource.attr) {
-		if (is_nd_pmem(dev))
+		if (is_memory(dev))
 			return 0400;
 		else
 			return 0;
drivers/nvdimm/security.c +4 -0
index a570f2263a42..5b7ea93edb93 100644
@@ -177,6 +177,10 @@ static int __nvdimm_security_unlock(struct nvdimm *nvdimm)
 			|| nvdimm->sec.state < 0)
 		return -EIO;
 
+	/* No need to go further if security is disabled */
+	if (nvdimm->sec.state == NVDIMM_SECURITY_DISABLED)
+		return 0;
+
 	if (test_bit(NDD_SECURITY_OVERWRITE, &nvdimm->flags)) {
 		dev_dbg(dev, "Security operation in progress.\n");
 		return -EBUSY;
drivers/pci/controller/pci-hyperv.c +1 -1
index 40b625458afa..2b53976cd9f9 100644
@@ -2701,8 +2701,8 @@ static int hv_pci_remove(struct hv_device *hdev)
 		/* Remove the bus from PCI's point of view. */
 		pci_lock_rescan_remove();
 		pci_stop_root_bus(hbus->pci_bus);
-		pci_remove_root_bus(hbus->pci_bus);
 		hv_pci_remove_slots(hbus);
+		pci_remove_root_bus(hbus->pci_bus);
 		pci_unlock_rescan_remove();
 		hbus->state = hv_pcibus_removed;
 	}
drivers/pci/controller/vmd.c +15 -10
index 4575e0c6dc4b..a35d3f3996d7 100644
@@ -31,6 +31,9 @@
 #define PCI_REG_VMLOCK		0x70
 #define MB2_SHADOW_EN(vmlock)	(vmlock & 0x2)
 
+#define MB2_SHADOW_OFFSET	0x2000
+#define MB2_SHADOW_SIZE		16
+
 enum vmd_features {
 	/*
 	 * Device may contain registers which hint the physical location of the
@@ -94,6 +97,7 @@ struct vmd_dev {
 	struct resource		resources[3];
 	struct irq_domain	*irq_domain;
 	struct pci_bus		*bus;
+	u8			busn_start;
 
 	struct dma_map_ops	dma_ops;
 	struct dma_domain	dma_domain;
@@ -440,7 +444,8 @@ static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
 				  unsigned int devfn, int reg, int len)
 {
 	char __iomem *addr = vmd->cfgbar +
-			     (bus->number << 20) + (devfn << 12) + reg;
+			     ((bus->number - vmd->busn_start) << 20) +
+			     (devfn << 12) + reg;
 
 	if ((addr - vmd->cfgbar) + len >=
 	    resource_size(&vmd->dev->resource[VMD_CFGBAR]))
@@ -563,7 +568,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 	unsigned long flags;
 	LIST_HEAD(resources);
 	resource_size_t offset[2] = {0};
-	resource_size_t membar2_offset = 0x2000, busn_start = 0;
+	resource_size_t membar2_offset = 0x2000;
 	struct pci_bus *child;
 
 	/*
@@ -576,7 +581,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 		u32 vmlock;
 		int ret;
 
-		membar2_offset = 0x2018;
+		membar2_offset = MB2_SHADOW_OFFSET + MB2_SHADOW_SIZE;
 		ret = pci_read_config_dword(vmd->dev, PCI_REG_VMLOCK, &vmlock);
 		if (ret || vmlock == ~0)
 			return -ENODEV;
@@ -588,9 +593,9 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 			if (!membar2)
 				return -ENOMEM;
 			offset[0] = vmd->dev->resource[VMD_MEMBAR1].start -
-						readq(membar2 + 0x2008);
+					readq(membar2 + MB2_SHADOW_OFFSET);
 			offset[1] = vmd->dev->resource[VMD_MEMBAR2].start -
-						readq(membar2 + 0x2010);
+					readq(membar2 + MB2_SHADOW_OFFSET + 8);
 			pci_iounmap(vmd->dev, membar2);
 		}
 	}
@@ -606,14 +611,14 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 		pci_read_config_dword(vmd->dev, PCI_REG_VMCONFIG, &vmconfig);
 		if (BUS_RESTRICT_CAP(vmcap) &&
 		    (BUS_RESTRICT_CFG(vmconfig) == 0x1))
-			busn_start = 128;
+			vmd->busn_start = 128;
 	}
 
 	res = &vmd->dev->resource[VMD_CFGBAR];
 	vmd->resources[0] = (struct resource) {
 		.name  = "VMD CFGBAR",
-		.start = busn_start,
-		.end   = busn_start + (resource_size(res) >> 20) - 1,
+		.start = vmd->busn_start,
+		.end   = vmd->busn_start + (resource_size(res) >> 20) - 1,
 		.flags = IORESOURCE_BUS | IORESOURCE_PCI_FIXED,
 	};
 
@@ -681,8 +686,8 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 	pci_add_resource_offset(&resources, &vmd->resources[1], offset[0]);
 	pci_add_resource_offset(&resources, &vmd->resources[2], offset[1]);
 
-	vmd->bus = pci_create_root_bus(&vmd->dev->dev, busn_start, &vmd_ops,
-				       sd, &resources);
+	vmd->bus = pci_create_root_bus(&vmd->dev->dev, vmd->busn_start,
+				       &vmd_ops, sd, &resources);
 	if (!vmd->bus) {
 		pci_free_resource_list(&resources);
 		irq_domain_remove(vmd->irq_domain);
drivers/pci/pci.c +1 -1
index 1f17da3dfeac..b97d9e10c9cc 100644
@@ -1443,7 +1443,7 @@ static void pci_restore_rebar_state(struct pci_dev *pdev)
 		pci_read_config_dword(pdev, pos + PCI_REBAR_CTRL, &ctrl);
 		bar_idx = ctrl & PCI_REBAR_CTRL_BAR_IDX;
 		res = pdev->resource + bar_idx;
-		size = order_base_2((resource_size(res) >> 20) | 1) - 1;
+		size = ilog2(resource_size(res)) - 20;
 		ctrl &= ~PCI_REBAR_CTRL_BAR_SIZE;
 		ctrl |= size << PCI_REBAR_CTRL_BAR_SHIFT;
 		pci_write_config_dword(pdev, pos + PCI_REBAR_CTRL, ctrl);
drivers/power/supply/sbs-battery.c +17 -10
index 048d205d7074..f8d74e9f7931 100644
@@ -314,17 +314,22 @@ static int sbs_get_battery_presence_and_health(
 {
 	int ret;
 
-	if (psp == POWER_SUPPLY_PROP_PRESENT) {
-		/* Dummy command; if it succeeds, battery is present. */
-		ret = sbs_read_word_data(client, sbs_data[REG_STATUS].addr);
-		if (ret < 0)
-			val->intval = 0; /* battery disconnected */
-		else
-			val->intval = 1; /* battery present */
-	} else { /* POWER_SUPPLY_PROP_HEALTH */
+	/* Dummy command; if it succeeds, battery is present. */
+	ret = sbs_read_word_data(client, sbs_data[REG_STATUS].addr);
+
+	if (ret < 0) { /* battery not present*/
+		if (psp == POWER_SUPPLY_PROP_PRESENT) {
+			val->intval = 0;
+			return 0;
+		}
+		return ret;
+	}
+
+	if (psp == POWER_SUPPLY_PROP_PRESENT)
+		val->intval = 1; /* battery present */
+	else /* POWER_SUPPLY_PROP_HEALTH */
 		/* SBS spec doesn't have a general health command. */
 		val->intval = POWER_SUPPLY_HEALTH_UNKNOWN;
-	}
 
 	return 0;
 }
@@ -620,12 +625,14 @@ static int sbs_get_property(struct power_supply *psy,
 	switch (psp) {
 	case POWER_SUPPLY_PROP_PRESENT:
 	case POWER_SUPPLY_PROP_HEALTH:
-		if (client->flags & SBS_FLAGS_TI_BQ20Z75)
+		if (chip->flags & SBS_FLAGS_TI_BQ20Z75)
 			ret = sbs_get_ti_battery_presence_and_health(client,
 								     psp, val);
 		else
 			ret = sbs_get_battery_presence_and_health(client, psp,
 								  val);
+
+		/* this can only be true if no gpio is used */
 		if (psp == POWER_SUPPLY_PROP_PRESENT)
 			return 0;
 		break;
drivers/pwm/pwm-stm32-lp.c +6 -0
index 2211a642066d..97a9afa191ee 100644
@@ -59,6 +59,12 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 	/* Calculate the period and prescaler value */
 	div = (unsigned long long)clk_get_rate(priv->clk) * state->period;
 	do_div(div, NSEC_PER_SEC);
+	if (!div) {
+		/* Clock is too slow to achieve requested period. */
+		dev_dbg(priv->chip.dev, "Can't reach %u ns\n",	state->period);
+		return -EINVAL;
+	}
+
 	prd = div;
 	while (div > STM32_LPTIM_MAX_ARR) {
 		presc++;
drivers/s390/block/dasd_eckd.c +11 -70

2 lines not on this page · raw message

drivers/s390/char/sclp_early.c +1 -1
index e71992a3c55f..cc5e84b80c69 100644

Lines of this file are not shown. View the raw message.

drivers/s390/cio/ccwgroup.c +1 -1
index c522e9313c50..ae66875a934d 100644

Lines of this file are not shown. View the raw message.

drivers/s390/cio/css.c +2 -0
index 22c55816100b..1fbfb0a93f5f 100644

Lines of this file are not shown. View the raw message.

drivers/staging/erofs/dir.c +9 -2
index dbf6a151886c..b11cecd0a21d 100644

Lines of this file are not shown. View the raw message.

drivers/staging/erofs/unzip_vle.c +27 -10
index f0dab81ff816..155cee68fed5 100644

Lines of this file are not shown. View the raw message.

drivers/staging/erofs/zmap.c +6 -0
index c2359321ca13..30e6d02d30de 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/qcom/tsens-8960.c +2 -0
index 8d9b721dadb6..e46a4e3f25c4 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/qcom/tsens-v0_1.c +10 -2
index 6f26fadf4c27..055647bcee67 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/qcom/tsens-v1.c +1 -0
index 10b595d4f619..870f502f2cb6 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/qcom/tsens.h +1 -0
index 2fd94997245b..b89083b61c38 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/thermal_core.c +1 -1
index 6bab66e84eb5..ebe15f2cf7fc 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/thermal_hwmon.c +6 -2
index 40c69a533b24..dd5d8ee37928 100644

Lines of this file are not shown. View the raw message.

drivers/watchdog/aspeed_wdt.c +3 -1
index cc71861e033a..5b64bc2e8788 100644

Lines of this file are not shown. View the raw message.

drivers/watchdog/imx2_wdt.c +2 -2
index 32af3974e6bb..8d019a961ccc 100644

Lines of this file are not shown. View the raw message.

drivers/xen/balloon.c +1 -0
index 4e11de6cde81..91cba70b69df 100644

Lines of this file are not shown. View the raw message.

drivers/xen/pci.c +15 -6
index 3eeb9bea7630..224df03ce42e 100644

Lines of this file are not shown. View the raw message.

drivers/xen/xenbus/xenbus_dev_frontend.c +18 -2
index 08adc590f631..597af455a522 100644

Lines of this file are not shown. View the raw message.

fs/9p/vfs_file.c +3 -0
index 4cc966a31cb3..fe7f0bd2048e 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/tests/btrfs-tests.c +7 -1
index 1e3ba4949399..814a918998ec 100644

Lines of this file are not shown. View the raw message.

fs/ceph/caps.c +7 -2
index ce0f5658720a..8fd530112810 100644

Lines of this file are not shown. View the raw message.

fs/ceph/inode.c +6 -1
index 18500edefc56..3b537e7038c7 100644

Lines of this file are not shown. View the raw message.

fs/ceph/mds_client.c +3 -1
index 920e9f048bd8..b11af7d8e8e9 100644

Lines of this file are not shown. View the raw message.

fs/fuse/cuse.c +1 -0
index bab7a0db81dd..f3b720884650 100644

Lines of this file are not shown. View the raw message.

fs/fuse/inode.c +5 -2
index 987877860c01..f3104db3de83 100644

Lines of this file are not shown. View the raw message.

fs/nfs/nfs4xdr.c +1 -1
index 46a8d636d151..ab07db0f07cd 100644

Lines of this file are not shown. View the raw message.

fs/nfs/pnfs.c +7 -2
index 4525d5acae38..0418b198edd3 100644

Lines of this file are not shown. View the raw message.

fs/statfs.c +4 -13
index eea7af6f2f22..2616424012ea 100644

Lines of this file are not shown. View the raw message.

include/linux/memremap.h +1 -0
index f8a5b2a19945..c70996fe48c8 100644

Lines of this file are not shown. View the raw message.

include/linux/sched/mm.h +2 -0
index 4a7944078cc3..8557ec664213 100644

Lines of this file are not shown. View the raw message.

include/sound/soc-dapm.h +2 -0
index c00a0b8ade08..6c6694160130 100644

Lines of this file are not shown. View the raw message.

include/trace/events/writeback.h +20 -18
index aa7f3aeac740..79095434c1be 100644

Lines of this file are not shown. View the raw message.

include/uapi/linux/sched.h +2 -0
index b3105ac1381a..851ff1feadd5 100644

Lines of this file are not shown. View the raw message.

kernel/elfcore.c +1 -0
index fc482c8e0bd8..57fb4dcff434 100644

Lines of this file are not shown. View the raw message.

kernel/locking/qspinlock_paravirt.h +1 -1
index 89bab079e7a4..e84d21aa0722 100644

Lines of this file are not shown. View the raw message.

kernel/sched/core.c +2 -2
index d38f007afea7..fffe790d98bb 100644

Lines of this file are not shown. View the raw message.

kernel/sched/membarrier.c +1 -1
index aa8d75804108..5110d91b1b0e 100644

Lines of this file are not shown. View the raw message.

kernel/time/tick-broadcast-hrtimer.c +29 -28

57 lines not on this page · raw message

kernel/time/timer.c +5 -3
index 343c7ba33b1c..7d63b7347066 100644

Lines of this file are not shown. View the raw message.

kernel/trace/bpf_trace.c +21 -5
index ca1255d14576..3e38a010003c 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_events_hist.c +2 -0
index ca6b0dff60c5..dd310d3b5843 100644

Lines of this file are not shown. View the raw message.

mm/usercopy.c +7 -1
index 98e924864554..660717a1ea5c 100644

Lines of this file are not shown. View the raw message.

net/9p/client.c +1 -0
index 9622f3e469f6..1d48afc7033c 100644

Lines of this file are not shown. View the raw message.

net/mac80211/util.c +8 -5
index ad1e58184c4e..21212faec6d0 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nf_tables_api.c +5 -2
index d47469f824a1..3b81323fa017 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nft_lookup.c +0 -3
index c0560bf3c31b..660bad688e2b 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/clnt.c +16 -4
index 7a75f34ad393..f7f78566be46 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/sched.c +4 -1
index 1f275aba786f..53934fe73a9d 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/xprtrdma/transport.c +3 -1
index 2ec349ed4770..f4763e8a6761 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/xprtrdma/verbs.c +14 -12
index 805b1f35e1ca..2bd9b4de0e32 100644

Lines of this file are not shown. View the raw message.

net/wireless/nl80211.c +38 -3

41 lines not on this page · raw message

net/wireless/reg.c +1 -1
index 327479ce69f5..36eba5804efe 100644

Lines of this file are not shown. View the raw message.

net/wireless/scan.c +6 -1
index d66e6d4b7555..27d76c4c5cea 100644

Lines of this file are not shown. View the raw message.

net/wireless/wext-compat.c +1 -1
index 46e4d69db845..b1f94730bde2 100644

Lines of this file are not shown. View the raw message.

security/integrity/ima/ima_crypto.c +9 -1
index d4c7b8e1b083..73044fc6a952 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/sgtl5000.c +194 -30

224 lines not on this page · raw message

tools/lib/bpf/btf_dump.c +1 -0
index 7065bb5b2752..e1357dbb16c2 100644

Lines of this file are not shown. View the raw message.

tools/lib/traceevent/Makefile +2 -2
index 86ce17a1f7fb..a39cdd0d890d 100644

Lines of this file are not shown. View the raw message.

tools/lib/traceevent/event-parse.c +1 -2
index b36b536a9fcb..13fd9fdf91e0 100644

Lines of this file are not shown. View the raw message.

tools/perf/Makefile.config +1 -1
index 89ac5a1f1550..3da374911852 100644

Lines of this file are not shown. View the raw message.

tools/perf/arch/x86/util/unwind-libunwind.c +1 -1
index 05920e3edf7a..47357973b55b 100644

Lines of this file are not shown. View the raw message.

tools/perf/builtin-stat.c +4 -1
index 352cf39d7c2f..8ec06bf3372c 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/header.c +1 -1
index bf7cf1249553..e95a2a26c40a 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/probe-event.c +1 -0
index 8394d48f8b32..3355c445abed 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/stat.c +17 -0
index db8a6cf336be..6ce66c272747 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/stat.h +1 -0
index 7032dd1eeac2..9cd0d9cff374 100644

Lines of this file are not shown. View the raw message.

tools/testing/nvdimm/test/nfit_test.h +1 -3
index 448d686da8b1..0bf5640f1f07 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/bpf/progs/strobemeta.h +4 -1
index 8a399bdfd920..067eb625d01c 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/pidfd/Makefile +1 -1
index 720b2d884b3c..e86141796444 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/seccomp/seccomp_bpf.c +5 -0
index 6ef7f16c4cf5..7f8b5c8982e3 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/tpm2/Makefile +1 -0
index 9dd848427a7b..bf401f725eef 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.