This is the start of the stable review cycle for the 5.4.138 release.
There are 40 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 Wed, 04 Aug 2021 13:43:24 +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.138-rc…
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.138-rc1
Oleksij Rempel <linux(a)rempel-privat.de>
can: j1939: j1939_session_deactivate(): clarify lifetime of session object
Lukasz Cieplicki <lukaszx.cieplicki(a)intel.com>
i40e: Add additional info to PHY type error
Arnaldo Carvalho de Melo <acme(a)redhat.com>
Revert "perf map: Fix dso->nsinfo refcounting"
Srikar Dronamraju <srikar(a)linux.vnet.ibm.com>
powerpc/pseries: Fix regression while building external modules
Shmuel Hazan <sh(a)tkos.co.il>
PCI: mvebu: Setup BAR0 in order to fix MSI
Dan Carpenter <dan.carpenter(a)oracle.com>
can: hi311x: fix a signedness bug in hi3110_cmd()
Wang Hai <wanghai38(a)huawei.com>
sis900: Fix missing pci_disable_device() in probe and remove
Wang Hai <wanghai38(a)huawei.com>
tulip: windbond-840: Fix missing pci_disable_device() in probe and remove
Marcelo Ricardo Leitner <marcelo.leitner(a)gmail.com>
sctp: fix return value check in __sctp_rcv_asconf_lookup
Dima Chumak <dchumak(a)nvidia.com>
net/mlx5e: Fix nullptr in mlx5e_hairpin_get_mdev()
Maor Gottlieb <maorg(a)nvidia.com>
net/mlx5: Fix flow table chaining
Pavel Skripkin <paskripkin(a)gmail.com>
net: llc: fix skb_over_panic
Jiapeng Chong <jiapeng.chong(a)linux.alibaba.com>
mlx4: Fix missing error code in mlx4_load_one()
Gilad Naaman <gnaaman(a)drivenets.com>
net: Set true network header for ECN decapsulation
Hoang Le <hoang.h.le(a)dektech.com.au>
tipc: fix sleeping in tipc accept routine
Jedrzej Jagielski <jedrzej.jagielski(a)intel.com>
i40e: Fix log TC creation failure when max num of queues is exceeded
Jedrzej Jagielski <jedrzej.jagielski(a)intel.com>
i40e: Fix queue-to-TC mapping on Tx
Arkadiusz Kubalewski <arkadiusz.kubalewski(a)intel.com>
i40e: Fix firmware LLDP agent related warning
Arkadiusz Kubalewski <arkadiusz.kubalewski(a)intel.com>
i40e: Fix logic of disabling queues
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_nat: allow to specify layer 4 protocol NAT only
Florian Westphal <fw(a)strlen.de>
netfilter: conntrack: adjust stop timestamp to real expiry value
Nguyen Dinh Phi <phind.uet(a)gmail.com>
cfg80211: Fix possible memory leak in function cfg80211_bss_update
Krzysztof Kozlowski <krzysztof.kozlowski(a)canonical.com>
nfc: nfcsim: fix use after free during module unload
Paul Jakma <paul(a)jakma.org>
NIU: fix incorrect error return, missed in previous revert
Jason Gerecke <killertofu(a)gmail.com>
HID: wacom: Re-enable touch by default for Cintiq 24HDT / 27QHDT
Pavel Skripkin <paskripkin(a)gmail.com>
can: esd_usb2: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: ems_usb: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: usb_8dev: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: mcba_usb_start(): add missing urb->transfer_dma initialization
Ziyang Xuan <william.xuanziyang(a)huawei.com>
can: raw: raw_setsockopt(): fix raw_rcv panic for sock UAF
Zhang Changzhong <zhangchangzhong(a)huawei.com>
can: j1939: j1939_xtp_rx_dat_one(): fix rxtimer value between consecutive TP.DT to 750ms
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: issue zeroout to EOF blocks
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: fix zero out valid data
Paolo Bonzini <pbonzini(a)redhat.com>
KVM: add missing compat KVM_CLEAR_DIRTY_LOG
Juergen Gross <jgross(a)suse.com>
x86/kvm: fix vcpu-id indexed array sizes
Hui Wang <hui.wang(a)canonical.com>
Revert "ACPI: resources: Add checks for ACPI IRQ override"
Goldwyn Rodrigues <rgoldwyn(a)suse.de>
btrfs: mark compressed range uptodate only if all bio succeed
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
btrfs: fix rw device counting in __btrfs_free_extra_devids
Jan Kiszka <jan.kiszka(a)siemens.com>
x86/asm: Ensure asm/proto.h can be included stand-alone
Cong Wang <xiyou.wangcong(a)gmail.com>
net_sched: check error pointer in tcf_dump_walker()
-------------
Diffstat:
Makefile | 4 +-
arch/powerpc/platforms/pseries/setup.c | 2 +-
arch/x86/include/asm/proto.h | 2 +
arch/x86/kvm/ioapic.c | 2 +-
arch/x86/kvm/ioapic.h | 4 +-
drivers/acpi/resource.c | 9 +-
drivers/hid/wacom_wac.c | 2 +-
drivers/net/can/spi/hi311x.c | 2 +-
drivers/net/can/usb/ems_usb.c | 14 ++-
drivers/net/can/usb/esd_usb2.c | 16 +++-
drivers/net/can/usb/mcba_usb.c | 2 +
drivers/net/can/usb/usb_8dev.c | 15 +++-
drivers/net/ethernet/dec/tulip/winbond-840.c | 7 +-
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 61 ++++++++-----
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 50 +++++++++++
drivers/net/ethernet/intel/i40e/i40e_txrx.h | 2 +
drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 33 ++++++-
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 ++-
drivers/net/ethernet/sis/sis900.c | 7 +-
drivers/net/ethernet/sun/niu.c | 3 +-
drivers/nfc/nfcsim.c | 3 +-
drivers/pci/controller/pci-mvebu.c | 16 +++-
fs/btrfs/compression.c | 2 +-
fs/btrfs/volumes.c | 1 +
fs/ocfs2/file.c | 103 +++++++++++++---------
include/net/llc_pdu.h | 31 +++++--
net/can/j1939/transport.c | 11 ++-
net/can/raw.c | 20 ++++-
net/ipv4/ip_tunnel.c | 2 +-
net/llc/af_llc.c | 10 ++-
net/llc/llc_s_ac.c | 2 +-
net/netfilter/nf_conntrack_core.c | 7 +-
net/netfilter/nft_nat.c | 4 +-
net/sched/act_api.c | 2 +
net/sctp/input.c | 2 +-
net/tipc/socket.c | 9 +-
net/wireless/scan.c | 6 +-
tools/perf/util/map.c | 2 -
virt/kvm/kvm_main.c | 28 ++++++
41 files changed, 375 insertions(+), 140 deletions(-)
This is the start of the stable review cycle for the 4.9.278 release.
There are 32 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 Wed, 04 Aug 2021 13:43:24 +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.9.278-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.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.9.278-rc1
Wang Hai <wanghai38(a)huawei.com>
sis900: Fix missing pci_disable_device() in probe and remove
Wang Hai <wanghai38(a)huawei.com>
tulip: windbond-840: Fix missing pci_disable_device() in probe and remove
Maor Gottlieb <maorg(a)nvidia.com>
net/mlx5: Fix flow table chaining
Pavel Skripkin <paskripkin(a)gmail.com>
net: llc: fix skb_over_panic
Jiapeng Chong <jiapeng.chong(a)linux.alibaba.com>
mlx4: Fix missing error code in mlx4_load_one()
Hoang Le <hoang.h.le(a)dektech.com.au>
tipc: fix sleeping in tipc accept routine
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_nat: allow to specify layer 4 protocol NAT only
Florian Westphal <fw(a)strlen.de>
netfilter: conntrack: adjust stop timestamp to real expiry value
Nguyen Dinh Phi <phind.uet(a)gmail.com>
cfg80211: Fix possible memory leak in function cfg80211_bss_update
Jan Kiszka <jan.kiszka(a)siemens.com>
x86/asm: Ensure asm/proto.h can be included stand-alone
Krzysztof Kozlowski <krzysztof.kozlowski(a)canonical.com>
nfc: nfcsim: fix use after free during module unload
Paul Jakma <paul(a)jakma.org>
NIU: fix incorrect error return, missed in previous revert
Pavel Skripkin <paskripkin(a)gmail.com>
can: esd_usb2: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: ems_usb: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: usb_8dev: fix memory leak
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: issue zeroout to EOF blocks
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: fix zero out valid data
Juergen Gross <jgross(a)suse.com>
x86/kvm: fix vcpu-id indexed array sizes
Russell King <rmk+kernel(a)armlinux.org.uk>
ARM: ensure the signal page contains defined contents
Matthew Wilcox <mawilcox(a)microsoft.com>
lib/string.c: add multibyte memset functions
Sudeep Holla <sudeep.holla(a)arm.com>
ARM: dts: versatile: Fix up interrupt controller node names
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: add lock nesting notation to hfs_find_init
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: fix high memory mapping in hfs_bnode_read
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: add missing clean-up in hfs_fill_super
Xin Long <lucien.xin(a)gmail.com>
sctp: move 198 addresses from unusable to private scope
Yang Yingliang <yangyingliang(a)huawei.com>
net/802/garp: fix memleak in garp_request_join()
Yang Yingliang <yangyingliang(a)huawei.com>
net/802/mrp: fix memleak in mrp_request_join()
Yang Yingliang <yangyingliang(a)huawei.com>
workqueue: fix UAF in pwq_unbound_release_workfn()
Miklos Szeredi <mszeredi(a)redhat.com>
af_unix: fix garbage collect vs MSG_PEEK
Jens Axboe <axboe(a)kernel.dk>
net: split out functions related to registering inflight socket files
Nathan Chancellor <nathan(a)kernel.org>
tipc: Fix backport of b77413446408fdd256599daf00d5be72b5f3e7c6
Nathan Chancellor <nathan(a)kernel.org>
iommu/amd: Fix backport of 140456f994195b568ecd7fc2287a34eadffef3ca
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/versatile-ab.dts | 5 +-
arch/arm/boot/dts/versatile-pb.dts | 2 +-
arch/arm/kernel/signal.c | 14 +-
arch/x86/include/asm/proto.h | 2 +
arch/x86/kvm/ioapic.c | 2 +-
arch/x86/kvm/ioapic.h | 4 +-
drivers/iommu/amd_iommu.c | 2 +-
drivers/net/can/usb/ems_usb.c | 14 +-
drivers/net/can/usb/esd_usb2.c | 16 ++-
drivers/net/can/usb/usb_8dev.c | 15 +-
drivers/net/ethernet/dec/tulip/winbond-840.c | 7 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 +-
drivers/net/ethernet/sis/sis900.c | 7 +-
drivers/net/ethernet/sun/niu.c | 3 +-
drivers/nfc/nfcsim.c | 3 +-
fs/hfs/bfind.c | 14 +-
fs/hfs/bnode.c | 25 +++-
fs/hfs/btree.h | 7 +
fs/hfs/super.c | 10 +-
fs/ocfs2/file.c | 103 ++++++++------
include/linux/string.h | 30 ++++
include/net/af_unix.h | 1 +
include/net/llc_pdu.h | 31 +++--
include/net/sctp/constants.h | 4 +-
kernel/workqueue.c | 20 ++-
lib/string.c | 66 +++++++++
net/802/garp.c | 14 ++
net/802/mrp.c | 14 ++
net/Makefile | 2 +-
net/llc/af_llc.c | 10 +-
net/llc/llc_s_ac.c | 2 +-
net/netfilter/nf_conntrack_core.c | 7 +-
net/netfilter/nft_nat.c | 4 +-
net/sctp/protocol.c | 3 +-
net/tipc/link.c | 2 +-
net/tipc/socket.c | 9 +-
net/unix/Kconfig | 5 +
net/unix/Makefile | 2 +
net/unix/af_unix.c | 115 ++++++----------
net/unix/garbage.c | 68 +--------
net/unix/scm.c | 161 ++++++++++++++++++++++
net/unix/scm.h | 10 ++
net/wireless/scan.c | 6 +-
45 files changed, 597 insertions(+), 259 deletions(-)
This is the start of the stable review cycle for the 4.4.278 release.
There are 26 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 Wed, 04 Aug 2021 13:43:24 +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.4.278-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.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 4.4.278-rc1
Wang Hai <wanghai38(a)huawei.com>
sis900: Fix missing pci_disable_device() in probe and remove
Wang Hai <wanghai38(a)huawei.com>
tulip: windbond-840: Fix missing pci_disable_device() in probe and remove
Pavel Skripkin <paskripkin(a)gmail.com>
net: llc: fix skb_over_panic
Jiapeng Chong <jiapeng.chong(a)linux.alibaba.com>
mlx4: Fix missing error code in mlx4_load_one()
Hoang Le <hoang.h.le(a)dektech.com.au>
tipc: fix sleeping in tipc accept routine
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_nat: allow to specify layer 4 protocol NAT only
Nguyen Dinh Phi <phind.uet(a)gmail.com>
cfg80211: Fix possible memory leak in function cfg80211_bss_update
Jan Kiszka <jan.kiszka(a)siemens.com>
x86/asm: Ensure asm/proto.h can be included stand-alone
Paul Jakma <paul(a)jakma.org>
NIU: fix incorrect error return, missed in previous revert
Pavel Skripkin <paskripkin(a)gmail.com>
can: esd_usb2: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: ems_usb: fix memory leak
Pavel Skripkin <paskripkin(a)gmail.com>
can: usb_8dev: fix memory leak
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: issue zeroout to EOF blocks
Junxiao Bi <junxiao.bi(a)oracle.com>
ocfs2: fix zero out valid data
Russell King <rmk+kernel(a)armlinux.org.uk>
ARM: ensure the signal page contains defined contents
Matthew Wilcox <mawilcox(a)microsoft.com>
lib/string.c: add multibyte memset functions
Sudeep Holla <sudeep.holla(a)arm.com>
ARM: dts: versatile: Fix up interrupt controller node names
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: add lock nesting notation to hfs_find_init
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: fix high memory mapping in hfs_bnode_read
Desmond Cheong Zhi Xi <desmondcheongzx(a)gmail.com>
hfs: add missing clean-up in hfs_fill_super
Xin Long <lucien.xin(a)gmail.com>
sctp: move 198 addresses from unusable to private scope
Yang Yingliang <yangyingliang(a)huawei.com>
net/802/garp: fix memleak in garp_request_join()
Yang Yingliang <yangyingliang(a)huawei.com>
net/802/mrp: fix memleak in mrp_request_join()
Yang Yingliang <yangyingliang(a)huawei.com>
workqueue: fix UAF in pwq_unbound_release_workfn()
Miklos Szeredi <mszeredi(a)redhat.com>
af_unix: fix garbage collect vs MSG_PEEK
Jens Axboe <axboe(a)kernel.dk>
net: split out functions related to registering inflight socket files
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/versatile-ab.dts | 5 +-
arch/arm/boot/dts/versatile-pb.dts | 2 +-
arch/arm/kernel/signal.c | 14 ++-
arch/x86/include/asm/proto.h | 2 +
drivers/net/can/usb/ems_usb.c | 14 ++-
drivers/net/can/usb/esd_usb2.c | 16 ++-
drivers/net/can/usb/usb_8dev.c | 15 ++-
drivers/net/ethernet/dec/tulip/winbond-840.c | 7 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 1 +
drivers/net/ethernet/sis/sis900.c | 7 +-
drivers/net/ethernet/sun/niu.c | 3 +-
fs/hfs/bfind.c | 14 ++-
fs/hfs/bnode.c | 25 ++++-
fs/hfs/btree.h | 7 ++
fs/hfs/super.c | 10 +-
fs/ocfs2/file.c | 103 ++++++++++-------
include/linux/string.h | 30 +++++
include/net/af_unix.h | 1 +
include/net/llc_pdu.h | 31 ++++--
include/net/sctp/constants.h | 4 +-
kernel/workqueue.c | 20 ++--
lib/string.c | 66 +++++++++++
net/802/garp.c | 14 +++
net/802/mrp.c | 14 +++
net/Makefile | 2 +-
net/llc/af_llc.c | 10 +-
net/llc/llc_s_ac.c | 2 +-
net/netfilter/nft_nat.c | 4 +-
net/sctp/protocol.c | 3 +-
net/tipc/socket.c | 9 +-
net/unix/Kconfig | 5 +
net/unix/Makefile | 2 +
net/unix/af_unix.c | 115 ++++++++-----------
net/unix/garbage.c | 68 +----------
net/unix/scm.c | 161 +++++++++++++++++++++++++++
net/unix/scm.h | 10 ++
net/wireless/scan.c | 6 +-
38 files changed, 579 insertions(+), 247 deletions(-)
From: Kan Liang <kan.liang(a)linux.intel.com>
A warning as below may be occasionally triggered in an ADL machine when
these conditions occur,
- Two perf record commands run one by one. Both record a PEBS event.
- Both runs on small cores.
- They have different adaptive PEBS configuration (PEBS_DATA_CFG).
[ 673.663291] WARNING: CPU: 4 PID: 9874 at
arch/x86/events/intel/ds.c:1743
setup_pebs_adaptive_sample_data+0x55e/0x5b0
[ 673.663348] RIP: 0010:setup_pebs_adaptive_sample_data+0x55e/0x5b0
[ 673.663357] Call Trace:
[ 673.663357] <NMI>
[ 673.663357] intel_pmu_drain_pebs_icl+0x48b/0x810
[ 673.663360] perf_event_nmi_handler+0x41/0x80
[ 673.663368] </NMI>
[ 673.663370] __perf_event_task_sched_in+0x2c2/0x3a0
Different from the big core, the small core requires the ACK right
before re-enabling counters in the NMI handler, otherwise a stale PEBS
record may be dumped into the later NMI handler, which trigger the
warning.
Add a new mid_ack flag to track the case. Add all PMI handler bits in
the struct x86_hybrid_pmu to track the bits for different types of PMUs.
Apply mid ACK for the small cores on an Alder Lake machine.
The existing hybrid() macro has a compile error when taking address of a
bit-field variable. Add a new macro hybrid_bit() to get the bit-field
value of a given PMU.
Fixes: f83d2f91d259 ("perf/x86/intel: Add Alder Lake Hybrid support")
Reported-by: Ammy Yi <ammy.yi(a)intel.com>
Tested-by: Ammy Yi <ammy.yi(a)intel.com>
Reviewed-by: Andi Kleen <ak(a)linux.intel.com>
Signed-off-by: Kan Liang <kan.liang(a)linux.intel.com>
Cc: stable(a)vger.kernel.org
---
The V1 patch set can be found at
https://lore.kernel.org/lkml/1625774073-153697-1-git-send-email-kan.liang@l…
Changes since v1:
- Introduce mid ACK. The early ACK in V1 may trigger other issue based
on the latest test result.
- Add comments regarding early, mid and late ACK.
arch/x86/events/intel/core.c | 23 +++++++++++++++--------
arch/x86/events/perf_event.h | 15 +++++++++++++++
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index d76be3b..511d1f9 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -2904,24 +2904,28 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
*/
static int intel_pmu_handle_irq(struct pt_regs *regs)
{
- struct cpu_hw_events *cpuc;
+ struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
+ bool late_ack = hybrid_bit(cpuc->pmu, late_ack);
+ bool mid_ack = hybrid_bit(cpuc->pmu, mid_ack);
int loops;
u64 status;
int handled;
int pmu_enabled;
- cpuc = this_cpu_ptr(&cpu_hw_events);
-
/*
* Save the PMU state.
* It needs to be restored when leaving the handler.
*/
pmu_enabled = cpuc->enabled;
/*
- * No known reason to not always do late ACK,
- * but just in case do it opt-in.
+ * In general, the early ACK is only applied for old platforms.
+ * For the big core starts from Haswell, the late ACK should be
+ * applied.
+ * For the small core after Tremont, we have to do the ACK right
+ * before re-enabling counters, which is in the middle of the
+ * NMI handler.
*/
- if (!x86_pmu.late_ack)
+ if (!late_ack && !mid_ack)
apic_write(APIC_LVTPC, APIC_DM_NMI);
intel_bts_disable_local();
cpuc->enabled = 0;
@@ -2958,6 +2962,8 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
goto again;
done:
+ if (mid_ack)
+ apic_write(APIC_LVTPC, APIC_DM_NMI);
/* Only restore PMU state when it's active. See x86_pmu_disable(). */
cpuc->enabled = pmu_enabled;
if (pmu_enabled)
@@ -2969,7 +2975,7 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
* have been reset. This avoids spurious NMIs on
* Haswell CPUs.
*/
- if (x86_pmu.late_ack)
+ if (late_ack)
apic_write(APIC_LVTPC, APIC_DM_NMI);
return handled;
}
@@ -6123,7 +6129,6 @@ __init int intel_pmu_init(void)
static_branch_enable(&perf_is_hybrid);
x86_pmu.num_hybrid_pmus = X86_HYBRID_NUM_PMUS;
- x86_pmu.late_ack = true;
x86_pmu.pebs_aliases = NULL;
x86_pmu.pebs_prec_dist = true;
x86_pmu.pebs_block = true;
@@ -6161,6 +6166,7 @@ __init int intel_pmu_init(void)
pmu = &x86_pmu.hybrid_pmu[X86_HYBRID_PMU_CORE_IDX];
pmu->name = "cpu_core";
pmu->cpu_type = hybrid_big;
+ pmu->late_ack = true;
if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) {
pmu->num_counters = x86_pmu.num_counters + 2;
pmu->num_counters_fixed = x86_pmu.num_counters_fixed + 1;
@@ -6186,6 +6192,7 @@ __init int intel_pmu_init(void)
pmu = &x86_pmu.hybrid_pmu[X86_HYBRID_PMU_ATOM_IDX];
pmu->name = "cpu_atom";
pmu->cpu_type = hybrid_small;
+ pmu->mid_ack = true;
pmu->num_counters = x86_pmu.num_counters;
pmu->num_counters_fixed = x86_pmu.num_counters_fixed;
pmu->max_pebs_events = x86_pmu.max_pebs_events;
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index ad87cb3..eec7ce8 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -655,6 +655,10 @@ struct x86_hybrid_pmu {
struct event_constraint *event_constraints;
struct event_constraint *pebs_constraints;
struct extra_reg *extra_regs;
+
+ unsigned int late_ack :1,
+ mid_ack :1,
+ enabled_ack :1;
};
static __always_inline struct x86_hybrid_pmu *hybrid_pmu(struct pmu *pmu)
@@ -685,6 +689,16 @@ extern struct static_key_false perf_is_hybrid;
__Fp; \
}))
+#define hybrid_bit(_pmu, _field) \
+({ \
+ bool __Fp = x86_pmu._field; \
+ \
+ if (is_hybrid() && (_pmu)) \
+ __Fp = hybrid_pmu(_pmu)->_field; \
+ \
+ __Fp; \
+})
+
enum hybrid_pmu_type {
hybrid_big = 0x40,
hybrid_small = 0x20,
@@ -754,6 +768,7 @@ struct x86_pmu {
/* PMI handler bits */
unsigned int late_ack :1,
+ mid_ack :1,
enabled_ack :1;
/*
* sysfs attrs
--
2.7.4