Commit aaf248848db50 ("perf/x86/msr: Add AMD IRPERF (Instructions
Retired) performance counter") added support for access to the
free-running counter via 'perf -e msr/irperf/', but when exercised,
we always get a 0 count:
BEFORE:
$ sudo perf stat -e instructions,msr/irperf/ true
Performance counter stats for 'true':
624,833 instructions
0 msr/irperf/
Simply set its enable bit - HWCR bit 30 - to make it start counting.
Enablement is restricted to all machines advertising IRPERF capability,
except those susceptible to an erratum that makes the IRPERF return
bad values.
That erratum occurs in Family 17h models 00-1fh [1], but not in F17h
models 20h and above [2].
AFTER (on a family 17h model 31h machine):
$ sudo perf stat -e instructions,msr/irperf/ true
Performance counter stats for 'true':
621,690 instructions
622,490 msr/irperf/
[1] Revision Guide for AMD Family 17h Models 00h-0Fh Processors
[2] Revision Guide for AMD Family 17h Models 30h-3Fh Processors
The revision guides are available from the bugzilla Link below.
Cc: Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
Cc: Andi Kleen <ak(a)linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme(a)kernel.org>
Cc: Babu Moger <babu.moger(a)amd.com>
Cc: Borislav Petkov <bp(a)alien8.de>
Cc: Fenghua Yu <fenghua.yu(a)intel.com>
Cc: Frank van der Linden <fllinden(a)amazon.com>
Cc: H. Peter Anvin <hpa(a)zytor.com>
Cc: Huang Rui <ray.huang(a)amd.com>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: Janakarajan Natarajan <Janakarajan.Natarajan(a)amd.com>
Cc: Jan Beulich <jbeulich(a)suse.com>
Cc: Jiaxun Yang <jiaxun.yang(a)flygoat.com>
Cc: Jiri Olsa <jolsa(a)redhat.com>
Cc: Josh Poimboeuf <jpoimboe(a)redhat.com>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Luwei Kang <luwei.kang(a)intel.com>
Cc: Martin Liška <mliska(a)suse.cz>
Cc: Matt Fleming <matt(a)codeblueprint.co.uk>
Cc: Michael Petlan <mpetlan(a)redhat.com>
Cc: Namhyung Kim <namhyung(a)kernel.org>
Cc: Paolo Bonzini <pbonzini(a)redhat.com>
Cc: Pawan Gupta <pawan.kumar.gupta(a)linux.intel.com>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit(a)amd.com>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Tom Lendacky <thomas.lendacky(a)amd.com>
Cc: x86(a)kernel.org
Cc: linux-kernel(a)vger.kernel.org
Cc: stable(a)vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
Fixes: aaf248848db50 ("perf/x86/msr: Add AMD IRPERF (Instructions Retired) performance counter")
Signed-off-by: Kim Phillips <kim.phillips(a)amd.com>
---
v3: Removed null stalled cycles per insn from perf example output,
since it got fixed, also address comments from Borislav Petkov:
https://lkml.org/lkml/2020/2/11/395
- rephrase commit text to not say "this patch".
- uploaded both rev. guides (and all public F17h PPRs)
to a new "Add AMD x86 documents for future reference"
bug, and reference that in a Link: tag.
- rename X86_BUG_AMD_E1054 -> X86_BUG_IRPERF
- add a full stop to a sentence in a comment
v2 got resent, adding Michael Petlan to cc. Original v2:
https://lore.kernel.org/lkml/20200121171232.28839-2-kim.phillips@amd.com/
v2: Based on Andi Kleen's review:
https://lore.kernel.org/lkml/20200116040324.GI302770@tassilo.jf.intel.com/
Add an amd_erratum_1054 and use cpu_has_bug infrastructure
instead of open-coding the {family,model} check.
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/msr-index.h | 2 ++
arch/x86/kernel/cpu/amd.c | 17 +++++++++++++++++
3 files changed, 20 insertions(+)
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index f3327cb56edf..8979d6fcc79c 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -404,5 +404,6 @@
#define X86_BUG_SWAPGS X86_BUG(21) /* CPU is affected by speculation through SWAPGS */
#define X86_BUG_TAA X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */
#define X86_BUG_ITLB_MULTIHIT X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
+#define X86_BUG_IRPERF X86_BUG(24) /* CPU is affected by Instructions Retired counter Erratum 1054 */
#endif /* _ASM_X86_CPUFEATURES_H */
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index ebe1685e92dd..d5e517d1c3dd 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -512,6 +512,8 @@
#define MSR_K7_HWCR 0xc0010015
#define MSR_K7_HWCR_SMMLOCK_BIT 0
#define MSR_K7_HWCR_SMMLOCK BIT_ULL(MSR_K7_HWCR_SMMLOCK_BIT)
+#define MSR_K7_HWCR_IRPERF_EN_BIT 30
+#define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT)
#define MSR_K7_FID_VID_CTL 0xc0010041
#define MSR_K7_FID_VID_STATUS 0xc0010042
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index ac83a0fef628..deebc728e2aa 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -28,6 +28,7 @@
static const int amd_erratum_383[];
static const int amd_erratum_400[];
+static const int amd_erratum_1054[];
static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum);
/*
@@ -694,6 +695,9 @@ static void early_init_amd(struct cpuinfo_x86 *c)
if (cpu_has_amd_erratum(c, amd_erratum_400))
set_cpu_bug(c, X86_BUG_AMD_E400);
+ if (cpu_has_amd_erratum(c, amd_erratum_1054))
+ set_cpu_bug(c, X86_BUG_IRPERF);
+
early_detect_mem_encrypt(c);
/* Re-enable TopologyExtensions if switched off by BIOS */
@@ -972,6 +976,15 @@ static void init_amd(struct cpuinfo_x86 *c)
/* AMD CPUs don't reset SS attributes on SYSRET, Xen does. */
if (!cpu_has(c, X86_FEATURE_XENPV))
set_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
+
+ /*
+ * Turn on the Instructions Retired free counter on machines not
+ * susceptible to erratum #1054 "Instructions Retired Performance
+ * Counter May Be Inaccurate".
+ */
+ if (cpu_has(c, X86_FEATURE_IRPERF) &&
+ !cpu_has_bug(c, X86_BUG_IRPERF))
+ msr_set_bit(MSR_K7_HWCR, MSR_K7_HWCR_IRPERF_EN_BIT);
}
#ifdef CONFIG_X86_32
@@ -1099,6 +1112,10 @@ static const int amd_erratum_400[] =
static const int amd_erratum_383[] =
AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0, 0, 0xff, 0xf));
+/* #1054: Instructions Retired Performance Counter May Be Inaccurate */
+static const int amd_erratum_1054[] =
+ AMD_OSVW_ERRATUM(0, AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf));
+
static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
{
--
2.25.0
This is the start of the stable review cycle for the 5.5.5 release.
There are 80 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu, 20 Feb 2020 19:03:19 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.5-rc1.…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.5.5-rc1
Michał Mirosław <mirq-linux(a)rere.qmqm.pl>
mmc: core: Rework wp-gpio handling
Michał Mirosław <mirq-linux(a)rere.qmqm.pl>
gpio: add gpiod_toggle_active_low()
Trond Myklebust <trondmy(a)gmail.com>
NFSv4: Add accounting for the number of active delegations held
Jens Axboe <axboe(a)kernel.dk>
io-wq: add support for inheriting ->fs
Chengguang Xu <cgxu519(a)mykernel.net>
ext4: choose hardlimit when softlimit is larger than hardlimit in ext4_statfs_project()
Chris Wilson <chris(a)chris-wilson.co.uk>
drm/i915/pmu: Correct the rc6 offset upon enabling
Jernej Skrabec <jernej.skrabec(a)siol.net>
Revert "drm/sun4i: drv: Allow framebuffer modifiers in mode config"
Trond Myklebust <trondmy(a)gmail.com>
NFSv4: Ensure the delegation cred is pinned when we call delegreturn
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1 make cachethis=no for writes
Kim Phillips <kim.phillips(a)amd.com>
perf stat: Don't report a null stalled cycles per insn metric
Oliver Upton <oupton(a)google.com>
KVM: nVMX: Handle pending #DB when injecting INIT VM-exit
Oliver Upton <oupton(a)google.com>
KVM: x86: Mask off reserved bit from #DB exception payload
Marc Zyngier <maz(a)kernel.org>
arm64: dts: fast models: Fix FVP PCI interrupt-map property
Xiubo Li <xiubli(a)redhat.com>
ceph: noacl mount option is effectively ignored
Petr Pavlu <petr.pavlu(a)suse.com>
cifs: fix mount option display for sec=krb5i
Sara Sharon <sara.sharon(a)intel.com>
mac80211: fix quiet mode activation in action frames
Mike Jones <michael-a1.jones(a)analog.com>
hwmon: (pmbus/ltc2978) Fix PMBus polling of MFR_COMMON definitions.
Kan Liang <kan.liang(a)linux.intel.com>
perf/x86/intel: Fix inaccurate period in context switch for auto-reload
Stephen Boyd <swboyd(a)chromium.org>
spmi: pmic-arb: Set lockdep class for hierarchical irq domains
Johannes Berg <johannes.berg(a)intel.com>
mac80211: use more bits for ack_frame_id
Qais Yousef <qais.yousef(a)arm.com>
sched/uclamp: Reject negative values in cpu_uclamp_write()
Luca Weiss <luca(a)z3ntu.xyz>
Input: ili210x - fix return value of is_visible function
Nathan Chancellor <natechancellor(a)gmail.com>
s390/time: Fix clk type in get_tod_clock
Leon Romanovsky <leon(a)kernel.org>
RDMA/core: Fix protection fault in get_pkey_idx_qp_list
Zhu Yanjun <yanjunz(a)mellanox.com>
RDMA/rxe: Fix soft lockup problem due to using tasklets in softirq
Kamal Heib <kamalheib1(a)gmail.com>
RDMA/hfi1: Fix memory leak in _dev_comp_vect_mappings_create
Krishnamraju Eraparaju <krishna2(a)chelsio.com>
RDMA/iw_cxgb4: initiate CLOSE when entering TERM
Avihai Horon <avihaih(a)mellanox.com>
RDMA/core: Fix invalid memory access in spec_filter_size
Yonatan Cohen <yonatanc(a)mellanox.com>
IB/umad: Fix kernel crash while unloading ib_umad
Kaike Wan <kaike.wan(a)intel.com>
IB/rdmavt: Reset all QPs when the device is shut down
Mike Marciniszyn <mike.marciniszyn(a)intel.com>
IB/hfi1: Close window for pq and request coliding
Kaike Wan <kaike.wan(a)intel.com>
IB/hfi1: Acquire lock to release TID entries when user file is closed
Mark Zhang <markz(a)mellanox.com>
IB/mlx5: Return failure when rts2rts_qp_counters_set_id is not supported
Colin Ian King <colin.king(a)canonical.com>
drivers: ipmi: fix off-by-one bounds check that leads to a out-of-bounds write
Yi Zhang <yi.zhang(a)redhat.com>
nvme: fix the parameter order for nvme_get_log in nvme_get_fw_slot_info
Marek Behún <marek.behun(a)nic.cz>
bus: moxtet: fix potential stack buffer overflow
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu:/navi10: use the ODCAP enum to index the caps array
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: update smu_v11_0_pptable.h
Boris Brezillon <boris.brezillon(a)collabora.com>
drm/panfrost: Make sure the shrinker does not reclaim referenced BOs
José Roberto de Souza <jose.souza(a)intel.com>
drm/mst: Fix possible NULL pointer dereference in drm_dp_mst_process_up_req()
Daniel Vetter <daniel.vetter(a)ffwll.ch>
drm/vgem: Close use-after-free race in vgem_gem_create
Christian Borntraeger <borntraeger(a)de.ibm.com>
s390/uv: Fix handling of length extensions
Harald Freudenberger <freude(a)linux.ibm.com>
s390/pkey: fix missing length of protected key on return
Kim Phillips <kim.phillips(a)amd.com>
perf/x86/amd: Add missing L2 misses event spec to AMD Family 17h's event map
Sean Christopherson <sean.j.christopherson(a)intel.com>
KVM: x86/mmu: Fix struct guest_walker arrays for 5-level paging
Sean Christopherson <sean.j.christopherson(a)intel.com>
KVM: nVMX: Use correct root level for nested EPT shadow page tables
Robert Richter <rrichter(a)marvell.com>
EDAC/mc: Fix use-after-free and memleaks during device removal
Robert Richter <rrichter(a)marvell.com>
EDAC/sysfs: Remove csrow objects on errors
zhangyi (F) <yi.zhang(a)huawei.com>
jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer
zhangyi (F) <yi.zhang(a)huawei.com>
jbd2: move the clearing of b_modified flag to the journal_unmap_buffer()
Ronnie Sahlberg <lsahlber(a)redhat.com>
cifs: make sure we do not overflow the max EA buffer size
Chuck Lever <chuck.lever(a)oracle.com>
xprtrdma: Fix DMA scatter-gather list mapping imbalance
Tejun Heo <tj(a)kernel.org>
cgroup: init_tasks shouldn't be linked to the root cgroup
Will Deacon <will(a)kernel.org>
arm64: ssbs: Fix context-switch when SSBS is present on all CPUs
Paul Thomas <pthomas8589(a)gmail.com>
gpio: xilinx: Fix bug where the wrong GPIO register is written to
Krzysztof Kozlowski <krzk(a)kernel.org>
ARM: npcm: Bring back GPIOLIB support
David Sterba <dsterba(a)suse.com>
btrfs: log message when rw remount is attempted with unclean tree-log
David Sterba <dsterba(a)suse.com>
btrfs: print message when tree-log replay starts
Wenwen Wang <wenwen(a)cs.uga.edu>
btrfs: ref-verify: fix memory leaks
Filipe Manana <fdmanana(a)suse.com>
Btrfs: fix race between using extent maps and merging them
Theodore Ts'o <tytso(a)mit.edu>
ext4: improve explanation of a mount failure caused by a misconfigured kernel
Shijie Luo <luoshijie1(a)huawei.com>
ext4: add cond_resched() to ext4_protect_reserved_inode
Jan Kara <jack(a)suse.cz>
ext4: fix checksum errors with indexed dirs
Theodore Ts'o <tytso(a)mit.edu>
ext4: fix support for inode sizes > 1024 bytes
Andreas Dilger <adilger(a)dilger.ca>
ext4: don't assume that mmp_nodename/bdevname have NUL
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPICA: Introduce acpi_any_gpe_status_set()
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPI: PM: s2idle: Avoid possible race related to the EC GPE
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPI: EC: Fix flushing of pending work
Arvind Sankar <nivedita(a)alum.mit.edu>
ALSA: usb-audio: Apply sample rate quirk for Audioengine D1
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/realtek - Fix silent output on MSI-GL73
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek - Add more codec supported Headset Button
Takashi Iwai <tiwai(a)suse.de>
ALSA: pcm: Fix double hw_free calls
Takashi Iwai <tiwai(a)suse.de>
ALSA: usb-audio: Fix UAC2/3 effect unit parsing
Alexander Tsoy <alexander(a)tsoy.me>
ALSA: usb-audio: Add clock validity quirk for Denon MC7000/MCX8000
Benjamin Tissoires <benjamin.tissoires(a)redhat.com>
Input: synaptics - remove the LEN0049 dmi id from topbuttonpad list
Gaurav Agrawal <agrawalgaurav(a)gnome.org>
Input: synaptics - enable SMBus on ThinkPad L470
Lyude Paul <lyude(a)redhat.com>
Input: synaptics - switch T470s to RMI4 by default
Jens Axboe <axboe(a)kernel.dk>
io_uring: retry raw bdev writes if we hit -EOPNOTSUPP
Pavel Begunkov <asml.silence(a)gmail.com>
io_uring: fix deferred req iovec leak
-------------
Diffstat:
Makefile | 4 +-
arch/arm/mach-npcm/Kconfig | 2 +-
arch/arm64/boot/dts/arm/fvp-base-revc.dts | 8 +-
arch/arm64/kernel/process.c | 7 ++
arch/s390/boot/uv.c | 3 +-
arch/s390/include/asm/timex.h | 2 +-
arch/x86/events/amd/core.c | 1 +
arch/x86/events/intel/ds.c | 2 +
arch/x86/kvm/mmu/paging_tmpl.h | 2 +-
arch/x86/kvm/vmx/nested.c | 28 +++++++
arch/x86/kvm/vmx/vmx.c | 3 +
arch/x86/kvm/x86.c | 8 ++
drivers/acpi/acpica/achware.h | 2 +
drivers/acpi/acpica/evxfgpe.c | 32 ++++++++
drivers/acpi/acpica/hwgpe.c | 71 +++++++++++++++++
drivers/acpi/ec.c | 44 ++++++-----
drivers/acpi/sleep.c | 50 ++++++++----
drivers/bus/moxtet.c | 2 +-
drivers/char/ipmi/ipmb_dev_int.c | 2 +-
drivers/edac/edac_mc.c | 12 +--
drivers/edac/edac_mc_sysfs.c | 18 +----
drivers/gpio/gpio-xilinx.c | 5 +-
drivers/gpio/gpiolib-of.c | 4 -
drivers/gpio/gpiolib.c | 11 +++
.../gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h | 46 +++++++----
drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 22 +++---
drivers/gpu/drm/drm_dp_mst_topology.c | 3 +-
drivers/gpu/drm/i915/i915_pmu.c | 12 +++
drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
drivers/gpu/drm/panfrost/panfrost_gem.h | 6 ++
drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c | 3 +
drivers/gpu/drm/panfrost/panfrost_job.c | 7 +-
drivers/gpu/drm/sun4i/sun4i_drv.c | 1 -
drivers/gpu/drm/vgem/vgem_drv.c | 9 ++-
drivers/hwmon/pmbus/ltc2978.c | 4 +-
drivers/infiniband/core/security.c | 24 +++---
drivers/infiniband/core/user_mad.c | 5 +-
drivers/infiniband/core/uverbs_cmd.c | 15 ++--
drivers/infiniband/hw/cxgb4/cm.c | 4 +
drivers/infiniband/hw/cxgb4/qp.c | 4 +-
drivers/infiniband/hw/hfi1/affinity.c | 2 +
drivers/infiniband/hw/hfi1/file_ops.c | 52 ++++++++-----
drivers/infiniband/hw/hfi1/hfi.h | 5 +-
drivers/infiniband/hw/hfi1/user_exp_rcv.c | 5 +-
drivers/infiniband/hw/hfi1/user_sdma.c | 17 ++--
drivers/infiniband/hw/mlx5/qp.c | 9 ++-
drivers/infiniband/sw/rdmavt/qp.c | 84 ++++++++++++--------
drivers/infiniband/sw/rxe/rxe_comp.c | 8 +-
drivers/input/mouse/synaptics.c | 4 +-
drivers/input/touchscreen/ili210x.c | 2 +-
drivers/mmc/core/host.c | 11 +--
drivers/mmc/core/slot-gpio.c | 3 +
drivers/mmc/host/pxamci.c | 8 +-
drivers/mmc/host/sdhci-esdhc-imx.c | 3 +-
drivers/nvme/host/core.c | 2 +-
drivers/s390/crypto/pkey_api.c | 2 +-
drivers/spmi/spmi-pmic-arb.c | 4 +
fs/btrfs/disk-io.c | 1 +
fs/btrfs/extent_map.c | 11 +++
fs/btrfs/ref-verify.c | 5 ++
fs/btrfs/super.c | 2 +
fs/ceph/super.c | 8 +-
fs/cifs/cifsfs.c | 6 +-
fs/cifs/smb2ops.c | 35 ++++++++-
fs/ext4/block_validity.c | 1 +
fs/ext4/dir.c | 14 ++--
fs/ext4/ext4.h | 5 +-
fs/ext4/inode.c | 12 +++
fs/ext4/mmp.c | 12 +--
fs/ext4/namei.c | 7 ++
fs/ext4/super.c | 55 +++++++------
fs/io-wq.c | 8 ++
fs/io-wq.h | 4 +-
fs/io_uring.c | 53 +++++--------
fs/jbd2/commit.c | 46 ++++++-----
fs/jbd2/transaction.c | 10 ++-
fs/nfs/delegation.c | 47 +++++++----
fs/nfs/nfs4proc.c | 2 +-
include/acpi/acpixf.h | 1 +
include/linux/gpio/consumer.h | 7 ++
include/linux/suspend.h | 2 +-
include/net/mac80211.h | 11 ++-
kernel/cgroup/cgroup.c | 13 ++--
kernel/power/suspend.c | 9 ++-
kernel/sched/core.c | 2 +-
net/mac80211/cfg.c | 2 +-
net/mac80211/mlme.c | 8 +-
net/mac80211/tx.c | 2 +-
net/sunrpc/xprtrdma/frwr_ops.c | 13 ++--
sound/core/pcm_native.c | 3 +-
sound/pci/hda/patch_realtek.c | 4 +
sound/usb/clock.c | 91 +++++++++++++++-------
sound/usb/clock.h | 4 +-
sound/usb/format.c | 3 +-
sound/usb/mixer.c | 12 ++-
sound/usb/quirks.c | 1 +
tools/perf/util/stat-shadow.c | 6 --
97 files changed, 842 insertions(+), 406 deletions(-)
This is the start of the stable review cycle for the 5.4.21 release.
There are 66 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu, 20 Feb 2020 19:03:19 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.21-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.21-rc1
Michał Mirosław <mirq-linux(a)rere.qmqm.pl>
mmc: core: Rework wp-gpio handling
Michał Mirosław <mirq-linux(a)rere.qmqm.pl>
gpio: add gpiod_toggle_active_low()
Sean Christopherson <sean.j.christopherson(a)intel.com>
KVM: x86/mmu: Fix struct guest_walker arrays for 5-level paging
Chengguang Xu <cgxu519(a)mykernel.net>
ext4: choose hardlimit when softlimit is larger than hardlimit in ext4_statfs_project()
zhangyi (F) <yi.zhang(a)huawei.com>
jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer
zhangyi (F) <yi.zhang(a)huawei.com>
jbd2: move the clearing of b_modified flag to the journal_unmap_buffer()
Jernej Skrabec <jernej.skrabec(a)siol.net>
Revert "drm/sun4i: drv: Allow framebuffer modifiers in mode config"
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1 make cachethis=no for writes
Kim Phillips <kim.phillips(a)amd.com>
perf stat: Don't report a null stalled cycles per insn metric
Oliver Upton <oupton(a)google.com>
KVM: x86: Mask off reserved bit from #DB exception payload
Marc Zyngier <maz(a)kernel.org>
arm64: dts: fast models: Fix FVP PCI interrupt-map property
Petr Pavlu <petr.pavlu(a)suse.com>
cifs: fix mount option display for sec=krb5i
Sara Sharon <sara.sharon(a)intel.com>
mac80211: fix quiet mode activation in action frames
Mike Jones <michael-a1.jones(a)analog.com>
hwmon: (pmbus/ltc2978) Fix PMBus polling of MFR_COMMON definitions.
Kan Liang <kan.liang(a)linux.intel.com>
perf/x86/intel: Fix inaccurate period in context switch for auto-reload
Stephen Boyd <swboyd(a)chromium.org>
spmi: pmic-arb: Set lockdep class for hierarchical irq domains
Qais Yousef <qais.yousef(a)arm.com>
sched/uclamp: Reject negative values in cpu_uclamp_write()
Nathan Chancellor <natechancellor(a)gmail.com>
s390/time: Fix clk type in get_tod_clock
Leon Romanovsky <leon(a)kernel.org>
RDMA/core: Fix protection fault in get_pkey_idx_qp_list
Zhu Yanjun <yanjunz(a)mellanox.com>
RDMA/rxe: Fix soft lockup problem due to using tasklets in softirq
Kamal Heib <kamalheib1(a)gmail.com>
RDMA/hfi1: Fix memory leak in _dev_comp_vect_mappings_create
Krishnamraju Eraparaju <krishna2(a)chelsio.com>
RDMA/iw_cxgb4: initiate CLOSE when entering TERM
Avihai Horon <avihaih(a)mellanox.com>
RDMA/core: Fix invalid memory access in spec_filter_size
Yonatan Cohen <yonatanc(a)mellanox.com>
IB/umad: Fix kernel crash while unloading ib_umad
Kaike Wan <kaike.wan(a)intel.com>
IB/rdmavt: Reset all QPs when the device is shut down
Mike Marciniszyn <mike.marciniszyn(a)intel.com>
IB/hfi1: Close window for pq and request coliding
Kaike Wan <kaike.wan(a)intel.com>
IB/hfi1: Acquire lock to release TID entries when user file is closed
Mark Zhang <markz(a)mellanox.com>
IB/mlx5: Return failure when rts2rts_qp_counters_set_id is not supported
Colin Ian King <colin.king(a)canonical.com>
drivers: ipmi: fix off-by-one bounds check that leads to a out-of-bounds write
Yi Zhang <yi.zhang(a)redhat.com>
nvme: fix the parameter order for nvme_get_log in nvme_get_fw_slot_info
Marek Behún <marek.behun(a)nic.cz>
bus: moxtet: fix potential stack buffer overflow
Boris Brezillon <boris.brezillon(a)collabora.com>
drm/panfrost: Make sure the shrinker does not reclaim referenced BOs
Daniel Vetter <daniel.vetter(a)ffwll.ch>
drm/vgem: Close use-after-free race in vgem_gem_create
Christian Borntraeger <borntraeger(a)de.ibm.com>
s390/uv: Fix handling of length extensions
Harald Freudenberger <freude(a)linux.ibm.com>
s390/pkey: fix missing length of protected key on return
Kim Phillips <kim.phillips(a)amd.com>
perf/x86/amd: Add missing L2 misses event spec to AMD Family 17h's event map
Sean Christopherson <sean.j.christopherson(a)intel.com>
KVM: nVMX: Use correct root level for nested EPT shadow page tables
Robert Richter <rrichter(a)marvell.com>
EDAC/mc: Fix use-after-free and memleaks during device removal
Robert Richter <rrichter(a)marvell.com>
EDAC/sysfs: Remove csrow objects on errors
Ronnie Sahlberg <lsahlber(a)redhat.com>
cifs: make sure we do not overflow the max EA buffer size
Chuck Lever <chuck.lever(a)oracle.com>
xprtrdma: Fix DMA scatter-gather list mapping imbalance
Will Deacon <will(a)kernel.org>
arm64: ssbs: Fix context-switch when SSBS is present on all CPUs
Paul Thomas <pthomas8589(a)gmail.com>
gpio: xilinx: Fix bug where the wrong GPIO register is written to
Krzysztof Kozlowski <krzk(a)kernel.org>
ARM: npcm: Bring back GPIOLIB support
David Sterba <dsterba(a)suse.com>
btrfs: log message when rw remount is attempted with unclean tree-log
David Sterba <dsterba(a)suse.com>
btrfs: print message when tree-log replay starts
Wenwen Wang <wenwen(a)cs.uga.edu>
btrfs: ref-verify: fix memory leaks
Filipe Manana <fdmanana(a)suse.com>
Btrfs: fix race between using extent maps and merging them
Theodore Ts'o <tytso(a)mit.edu>
ext4: improve explanation of a mount failure caused by a misconfigured kernel
Shijie Luo <luoshijie1(a)huawei.com>
ext4: add cond_resched() to ext4_protect_reserved_inode
Jan Kara <jack(a)suse.cz>
ext4: fix checksum errors with indexed dirs
Theodore Ts'o <tytso(a)mit.edu>
ext4: fix support for inode sizes > 1024 bytes
Andreas Dilger <adilger(a)dilger.ca>
ext4: don't assume that mmp_nodename/bdevname have NUL
Alexander Tsoy <alexander(a)tsoy.me>
ALSA: usb-audio: Add clock validity quirk for Denon MC7000/MCX8000
Saurav Girepunje <saurav.girepunje(a)gmail.com>
ALSA: usb-audio: sound: usb: usb true/false for bool return type
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPICA: Introduce acpi_any_gpe_status_set()
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPI: PM: s2idle: Avoid possible race related to the EC GPE
Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
ACPI: EC: Fix flushing of pending work
Arvind Sankar <nivedita(a)alum.mit.edu>
ALSA: usb-audio: Apply sample rate quirk for Audioengine D1
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/realtek - Fix silent output on MSI-GL73
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek - Add more codec supported Headset Button
Takashi Iwai <tiwai(a)suse.de>
ALSA: usb-audio: Fix UAC2/3 effect unit parsing
Benjamin Tissoires <benjamin.tissoires(a)redhat.com>
Input: synaptics - remove the LEN0049 dmi id from topbuttonpad list
Gaurav Agrawal <agrawalgaurav(a)gnome.org>
Input: synaptics - enable SMBus on ThinkPad L470
Lyude Paul <lyude(a)redhat.com>
Input: synaptics - switch T470s to RMI4 by default
-------------
Diffstat:
Makefile | 4 +-
arch/arm/mach-npcm/Kconfig | 2 +-
arch/arm64/boot/dts/arm/fvp-base-revc.dts | 8 +-
arch/arm64/kernel/process.c | 7 ++
arch/s390/boot/uv.c | 3 +-
arch/s390/include/asm/timex.h | 2 +-
arch/x86/events/amd/core.c | 1 +
arch/x86/events/intel/ds.c | 2 +
arch/x86/kvm/paging_tmpl.h | 2 +-
arch/x86/kvm/vmx/vmx.c | 3 +
arch/x86/kvm/x86.c | 8 ++
drivers/acpi/acpica/achware.h | 2 +
drivers/acpi/acpica/evxfgpe.c | 32 ++++++++
drivers/acpi/acpica/hwgpe.c | 71 +++++++++++++++++
drivers/acpi/ec.c | 44 ++++++-----
drivers/acpi/sleep.c | 50 ++++++++----
drivers/bus/moxtet.c | 2 +-
drivers/char/ipmi/ipmb_dev_int.c | 2 +-
drivers/edac/edac_mc.c | 12 +--
drivers/edac/edac_mc_sysfs.c | 18 +----
drivers/gpio/gpio-xilinx.c | 5 +-
drivers/gpio/gpiolib-of.c | 4 -
drivers/gpio/gpiolib.c | 11 +++
drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
drivers/gpu/drm/panfrost/panfrost_gem.h | 6 ++
drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c | 3 +
drivers/gpu/drm/panfrost/panfrost_job.c | 7 +-
drivers/gpu/drm/sun4i/sun4i_drv.c | 1 -
drivers/gpu/drm/vgem/vgem_drv.c | 9 ++-
drivers/hwmon/pmbus/ltc2978.c | 4 +-
drivers/infiniband/core/security.c | 24 +++---
drivers/infiniband/core/user_mad.c | 5 +-
drivers/infiniband/core/uverbs_cmd.c | 15 ++--
drivers/infiniband/hw/cxgb4/cm.c | 4 +
drivers/infiniband/hw/cxgb4/qp.c | 4 +-
drivers/infiniband/hw/hfi1/affinity.c | 2 +
drivers/infiniband/hw/hfi1/file_ops.c | 52 ++++++++-----
drivers/infiniband/hw/hfi1/hfi.h | 5 +-
drivers/infiniband/hw/hfi1/user_exp_rcv.c | 5 +-
drivers/infiniband/hw/hfi1/user_sdma.c | 17 ++--
drivers/infiniband/hw/mlx5/qp.c | 9 ++-
drivers/infiniband/sw/rdmavt/qp.c | 84 ++++++++++++--------
drivers/infiniband/sw/rxe/rxe_comp.c | 8 +-
drivers/input/mouse/synaptics.c | 4 +-
drivers/mmc/core/host.c | 11 +--
drivers/mmc/core/slot-gpio.c | 3 +
drivers/mmc/host/pxamci.c | 8 +-
drivers/mmc/host/sdhci-esdhc-imx.c | 3 +-
drivers/nvme/host/core.c | 2 +-
drivers/s390/crypto/pkey_api.c | 2 +-
drivers/spmi/spmi-pmic-arb.c | 4 +
fs/btrfs/disk-io.c | 1 +
fs/btrfs/extent_map.c | 11 +++
fs/btrfs/ref-verify.c | 5 ++
fs/btrfs/super.c | 2 +
fs/cifs/cifsfs.c | 6 +-
fs/cifs/smb2ops.c | 35 ++++++++-
fs/ext4/block_validity.c | 1 +
fs/ext4/dir.c | 14 ++--
fs/ext4/ext4.h | 5 +-
fs/ext4/inode.c | 12 +++
fs/ext4/mmp.c | 12 +--
fs/ext4/namei.c | 7 ++
fs/ext4/super.c | 55 +++++++------
fs/jbd2/commit.c | 46 ++++++-----
fs/jbd2/transaction.c | 10 ++-
fs/nfs/nfs4proc.c | 2 +-
include/acpi/acpixf.h | 1 +
include/linux/gpio/consumer.h | 7 ++
include/linux/suspend.h | 2 +-
kernel/power/suspend.c | 9 ++-
kernel/sched/core.c | 2 +-
net/mac80211/mlme.c | 8 +-
net/sunrpc/xprtrdma/frwr_ops.c | 13 ++--
sound/pci/hda/patch_realtek.c | 4 +
sound/usb/clock.c | 99 ++++++++++++++++--------
sound/usb/clock.h | 4 +-
sound/usb/format.c | 3 +-
sound/usb/mixer.c | 12 ++-
sound/usb/quirks.c | 1 +
tools/perf/util/stat-shadow.c | 6 --
81 files changed, 678 insertions(+), 314 deletions(-)
This is the start of the stable review cycle for the 4.19.105 release.
There are 38 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu, 20 Feb 2020 19:03:19 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.105-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.105-rc1
Sean Christopherson <sean.j.christopherson(a)intel.com>
KVM: x86/mmu: Fix struct guest_walker arrays for 5-level paging
zhangyi (F) <yi.zhang(a)huawei.com>
jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer
zhangyi (F) <yi.zhang(a)huawei.com>
jbd2: move the clearing of b_modified flag to the journal_unmap_buffer()
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1 make cachethis=no for writes
Mike Jones <michael-a1.jones(a)analog.com>
hwmon: (pmbus/ltc2978) Fix PMBus polling of MFR_COMMON definitions.
Kan Liang <kan.liang(a)linux.intel.com>
perf/x86/intel: Fix inaccurate period in context switch for auto-reload
Nathan Chancellor <natechancellor(a)gmail.com>
s390/time: Fix clk type in get_tod_clock
Leon Romanovsky <leon(a)kernel.org>
RDMA/core: Fix protection fault in get_pkey_idx_qp_list
Zhu Yanjun <yanjunz(a)mellanox.com>
RDMA/rxe: Fix soft lockup problem due to using tasklets in softirq
Kamal Heib <kamalheib1(a)gmail.com>
RDMA/hfi1: Fix memory leak in _dev_comp_vect_mappings_create
Avihai Horon <avihaih(a)mellanox.com>
RDMA/core: Fix invalid memory access in spec_filter_size
Kaike Wan <kaike.wan(a)intel.com>
IB/rdmavt: Reset all QPs when the device is shut down
Mike Marciniszyn <mike.marciniszyn(a)intel.com>
IB/hfi1: Close window for pq and request coliding
Kaike Wan <kaike.wan(a)intel.com>
IB/hfi1: Acquire lock to release TID entries when user file is closed
Yi Zhang <yi.zhang(a)redhat.com>
nvme: fix the parameter order for nvme_get_log in nvme_get_fw_slot_info
Kim Phillips <kim.phillips(a)amd.com>
perf/x86/amd: Add missing L2 misses event spec to AMD Family 17h's event map
Sean Christopherson <sean.j.christopherson(a)intel.com>
KVM: nVMX: Use correct root level for nested EPT shadow page tables
Will Deacon <will(a)kernel.org>
arm64: ssbs: Fix context-switch when SSBS is present on all CPUs
Krzysztof Kozlowski <krzk(a)kernel.org>
ARM: npcm: Bring back GPIOLIB support
David Sterba <dsterba(a)suse.com>
btrfs: log message when rw remount is attempted with unclean tree-log
David Sterba <dsterba(a)suse.com>
btrfs: print message when tree-log replay starts
Wenwen Wang <wenwen(a)cs.uga.edu>
btrfs: ref-verify: fix memory leaks
Filipe Manana <fdmanana(a)suse.com>
Btrfs: fix race between using extent maps and merging them
Theodore Ts'o <tytso(a)mit.edu>
ext4: improve explanation of a mount failure caused by a misconfigured kernel
Shijie Luo <luoshijie1(a)huawei.com>
ext4: add cond_resched() to ext4_protect_reserved_inode
Jan Kara <jack(a)suse.cz>
ext4: fix checksum errors with indexed dirs
Theodore Ts'o <tytso(a)mit.edu>
ext4: fix support for inode sizes > 1024 bytes
Andreas Dilger <adilger(a)dilger.ca>
ext4: don't assume that mmp_nodename/bdevname have NUL
Alexander Tsoy <alexander(a)tsoy.me>
ALSA: usb-audio: Add clock validity quirk for Denon MC7000/MCX8000
Saurav Girepunje <saurav.girepunje(a)gmail.com>
ALSA: usb-audio: sound: usb: usb true/false for bool return type
Suzuki K Poulose <suzuki.poulose(a)arm.com>
arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag cleanly
Suzuki K Poulose <suzuki.poulose(a)arm.com>
arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly
Arvind Sankar <nivedita(a)alum.mit.edu>
ALSA: usb-audio: Apply sample rate quirk for Audioengine D1
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/realtek - Fix silent output on MSI-GL73
Takashi Iwai <tiwai(a)suse.de>
ALSA: usb-audio: Fix UAC2/3 effect unit parsing
Benjamin Tissoires <benjamin.tissoires(a)redhat.com>
Input: synaptics - remove the LEN0049 dmi id from topbuttonpad list
Gaurav Agrawal <agrawalgaurav(a)gnome.org>
Input: synaptics - enable SMBus on ThinkPad L470
Lyude Paul <lyude(a)redhat.com>
Input: synaptics - switch T470s to RMI4 by default
-------------
Diffstat:
Makefile | 4 +-
arch/arm/mach-npcm/Kconfig | 2 +-
arch/arm64/kernel/cpufeature.c | 52 +++++++++++++---
arch/arm64/kernel/fpsimd.c | 20 ++++++-
arch/arm64/kernel/process.c | 7 +++
arch/arm64/kvm/hyp/switch.c | 10 +++-
arch/s390/include/asm/timex.h | 2 +-
arch/x86/events/amd/core.c | 1 +
arch/x86/events/intel/ds.c | 2 +
arch/x86/kvm/paging_tmpl.h | 2 +-
arch/x86/kvm/vmx/vmx.c | 3 +
drivers/hwmon/pmbus/ltc2978.c | 4 +-
drivers/infiniband/core/security.c | 24 +++-----
drivers/infiniband/core/uverbs_cmd.c | 15 +++--
drivers/infiniband/hw/hfi1/affinity.c | 2 +
drivers/infiniband/hw/hfi1/file_ops.c | 52 +++++++++-------
drivers/infiniband/hw/hfi1/hfi.h | 5 +-
drivers/infiniband/hw/hfi1/user_exp_rcv.c | 5 +-
drivers/infiniband/hw/hfi1/user_sdma.c | 17 ++++--
drivers/infiniband/sw/rdmavt/qp.c | 84 +++++++++++++++-----------
drivers/infiniband/sw/rxe/rxe_comp.c | 8 +--
drivers/input/mouse/synaptics.c | 4 +-
drivers/nvme/host/core.c | 2 +-
fs/btrfs/disk-io.c | 1 +
fs/btrfs/extent_map.c | 11 ++++
fs/btrfs/ref-verify.c | 5 ++
fs/btrfs/super.c | 2 +
fs/ext4/block_validity.c | 1 +
fs/ext4/dir.c | 14 +++--
fs/ext4/ext4.h | 5 +-
fs/ext4/inode.c | 12 ++++
fs/ext4/mmp.c | 12 ++--
fs/ext4/namei.c | 7 +++
fs/ext4/super.c | 32 +++++-----
fs/jbd2/commit.c | 46 +++++++-------
fs/jbd2/transaction.c | 10 ++--
fs/nfs/nfs4proc.c | 2 +-
sound/pci/hda/patch_realtek.c | 1 +
sound/usb/clock.c | 99 +++++++++++++++++++++----------
sound/usb/clock.h | 4 +-
sound/usb/format.c | 3 +-
sound/usb/mixer.c | 12 +++-
sound/usb/quirks.c | 1 +
43 files changed, 405 insertions(+), 202 deletions(-)
We need to make sure that the DRM driver is fully registered before
allowing the panel to be attached. Otherwise, we may trigger a hotplug
event before sun4i_framebuffer_init() sets up drm->mode_config.funcs,
causing a NULL pointer dereference.
Fixes: 1a2703bd7356 ("drm/sun4i: dsi: Allow binding the host without a panel")
Signed-off-by: Samuel Holland <samuel(a)sholland.org>
---
This fixes a bug in my previous patch series, that I didn't catch until
it was already merged.
---
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
index 9aa78c73873c..9cc1bb69fcda 100644
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
@@ -970,7 +970,7 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,
if (IS_ERR(panel))
return PTR_ERR(panel);
- if (!dsi->drm)
+ if (!dsi->drm || !dsi->drm->registered)
return -EPROBE_DEFER;
dsi->panel = panel;
--
2.24.1
After a treclaim, we expect to be in non-transactional state. If we don't clear
the current thread's MSR[TS] before we get preempted, then
tm_recheckpoint_new_task() will recheckpoint and we get rescheduled in
suspended transaction state.
When handling a signal caught in transactional state, handle_rt_signal64()
calls get_tm_stackpointer() that treclaims the transaction using
tm_reclaim_current() but without clearing the thread's MSR[TS]. This can cause
the TM Bad Thing exception below if later we pagefault and get preempted trying
to access the user's sigframe, using __put_user(). Afterwards, when we are
rescheduled back into do_page_fault() (but now in suspended state since the
thread's MSR[TS] was not cleared), upon executing 'rfid' after completion of
the page fault handling, the exception is raised because a transition from
suspended to non-transactional state is invalid.
Unexpected TM Bad Thing exception at c00000000000de44 (msr 0x8000000302a03031) tm_scratch=800000010280b033
Oops: Unrecoverable exception, sig: 6 [#1]
LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
Modules linked in: nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6_tables ip_tables nft_compat ip_set nf_tables nfnetlink xts vmx_crypto sg virtio_balloon
r_mod cdrom virtio_net net_failover virtio_blk virtio_scsi failover dm_mirror dm_region_hash dm_log dm_mod
CPU: 25 PID: 15547 Comm: a.out Not tainted 5.4.0-rc2 #32
NIP: c00000000000de44 LR: c000000000034728 CTR: 0000000000000000
REGS: c00000003fe7bd70 TRAP: 0700 Not tainted (5.4.0-rc2)
MSR: 8000000302a03031 <SF,VEC,VSX,FP,ME,IR,DR,LE,TM[SE]> CR: 44000884 XER: 00000000
CFAR: c00000000000dda4 IRQMASK: 0
PACATMSCRATCH: 800000010280b033
GPR00: c000000000034728 c000000f65a17c80 c000000001662800 00007fffacf3fd78
GPR04: 0000000000001000 0000000000001000 0000000000000000 c000000f611f8af0
GPR08: 0000000000000000 0000000078006001 0000000000000000 000c000000000000
GPR12: c000000f611f84b0 c00000003ffcb200 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20: 0000000000000000 0000000000000000 0000000000000000 c000000f611f8140
GPR24: 0000000000000000 00007fffacf3fd68 c000000f65a17d90 c000000f611f7800
GPR28: c000000f65a17e90 c000000f65a17e90 c000000001685e18 00007fffacf3f000
NIP [c00000000000de44] fast_exception_return+0xf4/0x1b0
LR [c000000000034728] handle_rt_signal64+0x78/0xc50
Call Trace:
[c000000f65a17c80] [c000000000034710] handle_rt_signal64+0x60/0xc50 (unreliable)
[c000000f65a17d30] [c000000000023640] do_notify_resume+0x330/0x460
[c000000f65a17e20] [c00000000000dcc4] ret_from_except_lite+0x70/0x74
Instruction dump:
7c4ff120 e8410170 7c5a03a6 38400000 f8410060 e8010070 e8410080 e8610088
60000000 60000000 e8810090 e8210078 <4c000024> 48000000 e8610178 88ed0989
---[ end trace 93094aa44b442f87 ]---
The simplified sequence of events that triggers the above exception is:
... # userspace in NON-TRANSACTIONAL state
tbegin # userspace in TRANSACTIONAL state
signal delivery # kernelspace in SUSPENDED state
handle_rt_signal64()
get_tm_stackpointer()
treclaim # kernelspace in NON-TRANSACTIONAL state
__put_user()
page fault happens. We will never get back here because of the TM Bad Thing exception.
page fault handling kicks in and we voluntarily preempt ourselves
do_page_fault()
__schedule()
__switch_to(other_task)
our task is rescheduled and we recheckpoint because the thread's MSR[TS] was not cleared
__switch_to(our_task)
switch_to_tm()
tm_recheckpoint_new_task()
trechkpt # kernelspace in SUSPENDED state
The page fault handling resumes, but now we are in suspended transaction state
do_page_fault() completes
rfid <----- trying to get back where the page fault happened (we were non-transactional back then)
TM Bad Thing # illegal transition from suspended to non-transactional
This patch fixes that issue by clearing the current thread's MSR[TS] just after
treclaim in get_tm_stackpointer() so that we stay in non-transactional state in
case we are preempted. In order to make treclaim and clearing the thread's
MSR[TS] atomic from a preemption perspective when CONFIG_PREEMPT is set,
preempt_disable/enable() is used. It's also necessary to save the previous
value of the thread's MSR before get_tm_stackpointer() is called so that it can
be exposed to the signal handler later in setup_tm_sigcontexts() to inform the
userspace MSR at the moment of the signal delivery.
Found with tm-signal-context-force-tm kernel selftest.
v3: Subject and comment improvements.
v2: Fix build failure when tm is disabled.
Fixes: 2b0a576d15e0 ("powerpc: Add new transactional memory state to the signal context")
Cc: stable(a)vger.kernel.org # v3.9
Signed-off-by: Gustavo Luiz Duarte <gustavold(a)linux.ibm.com>
---
arch/powerpc/kernel/signal.c | 16 ++++++++++++++--
arch/powerpc/kernel/signal_32.c | 28 ++++++++++++++--------------
arch/powerpc/kernel/signal_64.c | 22 ++++++++++------------
3 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index e6c30cee6abf..76d99bc111dc 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -200,14 +200,26 @@ unsigned long get_tm_stackpointer(struct task_struct *tsk)
* normal/non-checkpointed stack pointer.
*/
+ unsigned long ret = tsk->thread.regs->gpr[1];
+
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
BUG_ON(tsk != current);
if (MSR_TM_ACTIVE(tsk->thread.regs->msr)) {
+ preempt_disable();
tm_reclaim_current(TM_CAUSE_SIGNAL);
if (MSR_TM_TRANSACTIONAL(tsk->thread.regs->msr))
- return tsk->thread.ckpt_regs.gpr[1];
+ ret = tsk->thread.ckpt_regs.gpr[1];
+
+ /* If we treclaim, we must clear the current thread's TM bits
+ * before re-enabling preemption. Otherwise we might be
+ * preempted and have the live MSR[TS] changed behind our back
+ * (tm_recheckpoint_new_task() would recheckpoint). Besides, we
+ * enter the signal handler in non-transactional state.
+ */
+ tsk->thread.regs->msr &= ~MSR_TS_MASK;
+ preempt_enable();
}
#endif
- return tsk->thread.regs->gpr[1];
+ return ret;
}
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 98600b276f76..1b090a76b444 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -489,19 +489,11 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
*/
static int save_tm_user_regs(struct pt_regs *regs,
struct mcontext __user *frame,
- struct mcontext __user *tm_frame, int sigret)
+ struct mcontext __user *tm_frame, int sigret,
+ unsigned long msr)
{
- unsigned long msr = regs->msr;
-
WARN_ON(tm_suspend_disabled);
- /* Remove TM bits from thread's MSR. The MSR in the sigcontext
- * just indicates to userland that we were doing a transaction, but we
- * don't want to return in transactional state. This also ensures
- * that flush_fp_to_thread won't set TIF_RESTORE_TM again.
- */
- regs->msr &= ~MSR_TS_MASK;
-
/* Save both sets of general registers */
if (save_general_regs(¤t->thread.ckpt_regs, frame)
|| save_general_regs(regs, tm_frame))
@@ -912,6 +904,10 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
int sigret;
unsigned long tramp;
struct pt_regs *regs = tsk->thread.regs;
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+ /* Save the thread's msr before get_tm_stackpointer() changes it */
+ unsigned long msr = regs->msr;
+#endif
BUG_ON(tsk != current);
@@ -944,13 +940,13 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
tm_frame = &rt_sf->uc_transact.uc_mcontext;
- if (MSR_TM_ACTIVE(regs->msr)) {
+ if (MSR_TM_ACTIVE(msr)) {
if (__put_user((unsigned long)&rt_sf->uc_transact,
&rt_sf->uc.uc_link) ||
__put_user((unsigned long)tm_frame,
&rt_sf->uc_transact.uc_regs))
goto badframe;
- if (save_tm_user_regs(regs, frame, tm_frame, sigret))
+ if (save_tm_user_regs(regs, frame, tm_frame, sigret, msr))
goto badframe;
}
else
@@ -1369,6 +1365,10 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset,
int sigret;
unsigned long tramp;
struct pt_regs *regs = tsk->thread.regs;
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+ /* Save the thread's msr before get_tm_stackpointer() changes it */
+ unsigned long msr = regs->msr;
+#endif
BUG_ON(tsk != current);
@@ -1402,9 +1402,9 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset,
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
tm_mctx = &frame->mctx_transact;
- if (MSR_TM_ACTIVE(regs->msr)) {
+ if (MSR_TM_ACTIVE(msr)) {
if (save_tm_user_regs(regs, &frame->mctx, &frame->mctx_transact,
- sigret))
+ sigret, msr))
goto badframe;
}
else
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 117515564ec7..84ed2e77ef9c 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -192,7 +192,8 @@ static long setup_sigcontext(struct sigcontext __user *sc,
static long setup_tm_sigcontexts(struct sigcontext __user *sc,
struct sigcontext __user *tm_sc,
struct task_struct *tsk,
- int signr, sigset_t *set, unsigned long handler)
+ int signr, sigset_t *set, unsigned long handler,
+ unsigned long msr)
{
/* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
* process never used altivec yet (MSR_VEC is zero in pt_regs of
@@ -207,12 +208,11 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc,
elf_vrreg_t __user *tm_v_regs = sigcontext_vmx_regs(tm_sc);
#endif
struct pt_regs *regs = tsk->thread.regs;
- unsigned long msr = tsk->thread.regs->msr;
long err = 0;
BUG_ON(tsk != current);
- BUG_ON(!MSR_TM_ACTIVE(regs->msr));
+ BUG_ON(!MSR_TM_ACTIVE(msr));
WARN_ON(tm_suspend_disabled);
@@ -222,13 +222,6 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc,
*/
msr |= tsk->thread.ckpt_regs.msr & (MSR_FP | MSR_VEC | MSR_VSX);
- /* Remove TM bits from thread's MSR. The MSR in the sigcontext
- * just indicates to userland that we were doing a transaction, but we
- * don't want to return in transactional state. This also ensures
- * that flush_fp_to_thread won't set TIF_RESTORE_TM again.
- */
- regs->msr &= ~MSR_TS_MASK;
-
#ifdef CONFIG_ALTIVEC
err |= __put_user(v_regs, &sc->v_regs);
err |= __put_user(tm_v_regs, &tm_sc->v_regs);
@@ -824,6 +817,10 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
unsigned long newsp = 0;
long err = 0;
struct pt_regs *regs = tsk->thread.regs;
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+ /* Save the thread's msr before get_tm_stackpointer() changes it */
+ unsigned long msr = regs->msr;
+#endif
BUG_ON(tsk != current);
@@ -841,7 +838,7 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
err |= __put_user(0, &frame->uc.uc_flags);
err |= __save_altstack(&frame->uc.uc_stack, regs->gpr[1]);
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
- if (MSR_TM_ACTIVE(regs->msr)) {
+ if (MSR_TM_ACTIVE(msr)) {
/* The ucontext_t passed to userland points to the second
* ucontext_t (for transactional state) with its uc_link ptr.
*/
@@ -849,7 +846,8 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
err |= setup_tm_sigcontexts(&frame->uc.uc_mcontext,
&frame->uc_transact.uc_mcontext,
tsk, ksig->sig, NULL,
- (unsigned long)ksig->ka.sa.sa_handler);
+ (unsigned long)ksig->ka.sa.sa_handler,
+ msr);
} else
#endif
{
--
2.21.1
From: Pratham Pratap <prathampratap(a)codeaurora.org>
If scatter-gather operation is allowed, a large USB request is split
into multiple TRBs. For preparing TRBs for sg list, driver iterates
over the list and creates TRB for each sg and mark the chain bit to
false for the last sg. The current IOMMU driver is clubbing the list
of sgs which shares a page boundary into one and giving it to USB driver.
With this the number of sgs mapped it not equal to the the number of sgs
passed. Because of this USB driver is not marking the chain bit to false
since it couldn't iterate to the last sg. This patch addresses this issue
by marking the chain bit to false if it is the last mapped sg.
At a practical level, this patch resolves USB transfer stalls
seen with adb on dwc3 based db845c, pixel3 and other qcom
hardware after functionfs gadget added scatter-gather support
around v4.20.
Credit also to Anurag Kumar Vulisha <anurag.kumar.vulisha(a)xilinx.com>
who implemented a very similar fix to this issue.
Cc: Felipe Balbi <balbi(a)kernel.org>
Cc: Yang Fei <fei.yang(a)intel.com>
Cc: Thinh Nguyen <thinhn(a)synopsys.com>
Cc: Tejas Joglekar <tejas.joglekar(a)synopsys.com>
Cc: Andrzej Pietrasiewicz <andrzej.p(a)collabora.com>
Cc: Jack Pham <jackp(a)codeaurora.org>
Cc: Todd Kjos <tkjos(a)google.com>
Cc: Greg KH <gregkh(a)linuxfoundation.org>
Cc: Linux USB List <linux-usb(a)vger.kernel.org>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Pratham Pratap <prathampratap(a)codeaurora.org>
[jstultz: Slight tweak to remove sg_is_last() usage, reworked
commit message, minor comment tweak]
Signed-off-by: John Stultz <john.stultz(a)linaro.org>
---
drivers/usb/dwc3/gadget.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 1b8014ab0b25..10aa511051e8 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1071,7 +1071,14 @@ static void dwc3_prepare_one_trb_sg(struct dwc3_ep *dep,
unsigned int rem = length % maxp;
unsigned chain = true;
- if (sg_is_last(s))
+ /*
+ * IOMMU driver is coalescing the list of sgs which shares a
+ * page boundary into one and giving it to USB driver. With
+ * this the number of sgs mapped it not equal to the the number
+ * of sgs passed. Mark the chain bit to false if it is the last
+ * mapped sg.
+ */
+ if ((i == remaining - 1))
chain = false;
if (rem && usb_endpoint_dir_out(dep->endpoint.desc) && !chain) {
--
2.17.1
Hello,
We ran automated tests on a recent commit from this kernel tree:
Kernel repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Commit: 70464966e42b - Linux 5.4.21-rc1
The results of these automated tests are provided below.
Overall result: PASSED
Merge: OK
Compile: OK
Tests: OK
All kernel binaries, config files, and logs are available for download here:
https://cki-artifacts.s3.us-east-2.amazonaws.com/index.html?prefix=dataware…
Please reply to this email if you have any questions about the tests that we
ran or if you have any suggestions on how to make future tests more effective.
,-. ,-.
( C ) ( K ) Continuous
`-',-.`-' Kernel
( I ) Integration
`-'
______________________________________________________________________________
Compile testing
---------------
We compiled the kernel for 3 architectures:
aarch64:
make options: -j30 INSTALL_MOD_STRIP=1 targz-pkg
ppc64le:
make options: -j30 INSTALL_MOD_STRIP=1 targz-pkg
x86_64:
make options: -j30 INSTALL_MOD_STRIP=1 targz-pkg
Hardware testing
----------------
We booted each kernel and ran the following tests:
aarch64:
Host 1:
✅ Boot test
✅ Podman system integration test - as root
✅ Podman system integration test - as user
✅ LTP
✅ Loopdev Sanity
✅ Memory function: memfd_create
✅ AMTU (Abstract Machine Test Utility)
✅ Networking bridge: sanity
✅ Ethernet drivers sanity
✅ Networking MACsec: sanity
✅ Networking socket: fuzz
✅ Networking sctp-auth: sockopts test
✅ Networking: igmp conformance test
✅ Networking route: pmtu
✅ Networking route_func - local
✅ Networking route_func - forward
✅ Networking TCP: keepalive test
✅ Networking UDP: socket
✅ Networking tunnel: geneve basic test
✅ Networking tunnel: gre basic
✅ L2TP basic test
✅ Networking tunnel: vxlan basic
✅ Networking ipsec: basic netns - transport
✅ Networking ipsec: basic netns - tunnel
✅ audit: audit testsuite test
✅ httpd: mod_ssl smoke sanity
✅ tuned: tune-processes-through-perf
✅ ALSA PCM loopback test
✅ ALSA Control (mixer) Userspace Element test
✅ storage: SCSI VPD
✅ trace: ftrace/tracer
🚧 ✅ CIFS Connectathon
🚧 ✅ POSIX pjd-fstest suites
🚧 ✅ jvm - DaCapo Benchmark Suite
🚧 ✅ jvm - jcstress tests
🚧 ✅ Memory function: kaslr
🚧 ✅ LTP: openposix test suite
🚧 ✅ Networking vnic: ipvlan/basic
🚧 ✅ iotop: sanity
🚧 ✅ Usex - version 1.9-29
🚧 ✅ storage: dm/common
Host 2:
✅ Boot test
✅ xfstests - ext4
✅ xfstests - xfs
✅ selinux-policy: serge-testsuite
✅ lvm thinp sanity
✅ storage: software RAID testing
✅ stress: stress-ng
🚧 ✅ IPMI driver test
🚧 ✅ IPMItool loop stress test
🚧 ✅ Storage blktests
ppc64le:
Host 1:
✅ Boot test
✅ Podman system integration test - as root
✅ Podman system integration test - as user
✅ LTP
✅ Loopdev Sanity
✅ Memory function: memfd_create
✅ AMTU (Abstract Machine Test Utility)
✅ Networking bridge: sanity
✅ Ethernet drivers sanity
✅ Networking MACsec: sanity
✅ Networking socket: fuzz
✅ Networking sctp-auth: sockopts test
✅ Networking route: pmtu
✅ Networking route_func - local
✅ Networking route_func - forward
✅ Networking TCP: keepalive test
✅ Networking UDP: socket
✅ Networking tunnel: geneve basic test
✅ Networking tunnel: gre basic
✅ L2TP basic test
✅ Networking tunnel: vxlan basic
✅ Networking ipsec: basic netns - tunnel
✅ audit: audit testsuite test
✅ httpd: mod_ssl smoke sanity
✅ tuned: tune-processes-through-perf
✅ ALSA PCM loopback test
✅ ALSA Control (mixer) Userspace Element test
✅ trace: ftrace/tracer
🚧 ✅ CIFS Connectathon
🚧 ✅ POSIX pjd-fstest suites
🚧 ✅ jvm - DaCapo Benchmark Suite
🚧 ✅ jvm - jcstress tests
🚧 ✅ Memory function: kaslr
🚧 ✅ LTP: openposix test suite
🚧 ✅ Networking vnic: ipvlan/basic
🚧 ✅ iotop: sanity
🚧 ✅ Usex - version 1.9-29
🚧 ❌ storage: dm/common
Host 2:
✅ Boot test
✅ xfstests - ext4
✅ xfstests - xfs
✅ selinux-policy: serge-testsuite
✅ lvm thinp sanity
✅ storage: software RAID testing
🚧 ✅ IPMI driver test
🚧 ✅ IPMItool loop stress test
🚧 ✅ Storage blktests
x86_64:
Host 1:
✅ Boot test
✅ Podman system integration test - as root
✅ Podman system integration test - as user
✅ LTP
✅ Loopdev Sanity
✅ Memory function: memfd_create
✅ AMTU (Abstract Machine Test Utility)
✅ Networking bridge: sanity
✅ Ethernet drivers sanity
✅ Networking MACsec: sanity
✅ Networking socket: fuzz
✅ Networking sctp-auth: sockopts test
✅ Networking: igmp conformance test
✅ Networking route: pmtu
✅ Networking route_func - local
✅ Networking route_func - forward
✅ Networking TCP: keepalive test
✅ Networking UDP: socket
✅ Networking tunnel: geneve basic test
✅ Networking tunnel: gre basic
✅ L2TP basic test
✅ Networking tunnel: vxlan basic
✅ Networking ipsec: basic netns - transport
✅ Networking ipsec: basic netns - tunnel
✅ audit: audit testsuite test
✅ httpd: mod_ssl smoke sanity
✅ tuned: tune-processes-through-perf
✅ pciutils: sanity smoke test
✅ ALSA PCM loopback test
✅ ALSA Control (mixer) Userspace Element test
✅ storage: SCSI VPD
✅ trace: ftrace/tracer
🚧 ✅ CIFS Connectathon
🚧 ✅ POSIX pjd-fstest suites
🚧 ✅ jvm - DaCapo Benchmark Suite
🚧 ✅ jvm - jcstress tests
🚧 ✅ Memory function: kaslr
🚧 ✅ LTP: openposix test suite
🚧 ✅ Networking vnic: ipvlan/basic
🚧 ✅ iotop: sanity
🚧 ✅ Usex - version 1.9-29
🚧 ✅ storage: dm/common
Host 2:
✅ Boot test
✅ Storage SAN device stress - megaraid_sas
Host 3:
⚡ Internal infrastructure issues prevented one or more tests (marked
with ⚡⚡⚡) from running on this architecture.
This is not the fault of the kernel that was tested.
✅ Boot test
✅ xfstests - ext4
✅ xfstests - xfs
✅ selinux-policy: serge-testsuite
✅ lvm thinp sanity
✅ storage: software RAID testing
✅ stress: stress-ng
🚧 ✅ IOMMU boot test
🚧 ✅ IPMI driver test
🚧 ✅ IPMItool loop stress test
🚧 ⚡⚡⚡ Storage blktests
Host 4:
✅ Boot test
✅ Storage SAN device stress - mpt3sas driver
Test sources: https://github.com/CKI-project/tests-beaker
💚 Pull requests are welcome for new tests or improvements to existing tests!
Waived tests
------------
If the test run included waived tests, they are marked with 🚧. Such tests are
executed but their results are not taken into account. Tests are waived when
their results are not reliable enough, e.g. when they're just introduced or are
being fixed.
Testing timeout
---------------
We aim to provide a report within reasonable timeframe. Tests that haven't
finished running yet are marked with ⏱.