When CONFIG_DEBUG_FORCE_WEAK_PER_CPU is enabled it forces each per_cpu
object to use a unique name even if they are declared as static.
Commit 3d3eb5fb85 ("perf: add hotplug support") added two per_cpu
objects of the same name so arbitrarily pick one and rename it.
Fixes: 3d3eb5fb85 ("perf: add hotplug support")
Change-Id: Ic0dedbad44a18f63ba0051956668de9c7f3c54b8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
* refs/heads/tmp-26bf816:
Linux 4.19.18
ipmi: Don't initialize anything in the core until something uses it
ipmi:ssif: Fix handling of multi-part return messages
ipmi: Prevent use-after-free in deliver_response
ipmi: msghandler: Fix potential Spectre v1 vulnerabilities
ipmi: fix use-after-free of user->release_barrier.rda
Bluetooth: Fix unnecessary error message for HCI request completion
iwlwifi: mvm: Send LQ command as async when necessary
mm, proc: be more verbose about unstable VMA flags in /proc/<pid>/smaps
userfaultfd: clear flag if remap event not enabled
mm/swap: use nr_node_ids for avail_lists in swap_info_struct
mm/page-writeback.c: don't break integrity writeback on ->writepage() error
ocfs2: fix panic due to unrecovered local alloc
iomap: don't search past page end in iomap_is_partially_uptodate
scsi: megaraid: fix out-of-bound array accesses
scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()
ath10k: fix peer stats null pointer dereference
scsi: smartpqi: correct lun reset issues
scsi: mpt3sas: fix memory ordering on 64bit writes
IB/usnic: Fix potential deadlock
sysfs: Disable lockdep for driver bind/unbind files
ALSA: bebob: fix model-id of unit for Apogee Ensemble
Bluetooth: btusb: Add support for Intel bluetooth device 8087:0029
dm: Check for device sector overflow if CONFIG_LBDAF is not set
clocksource/drivers/integrator-ap: Add missing of_node_put()
quota: Lock s_umount in exclusive mode for Q_XQUOTA{ON,OFF} quotactls.
perf tools: Add missing open_memstream() prototype for systems lacking it
perf tools: Add missing sigqueue() prototype for systems lacking it
perf cs-etm: Correct packets swapping in cs_etm__flush()
dm snapshot: Fix excessive memory usage and workqueue stalls
tools lib subcmd: Don't add the kernel sources to the include path
perf stat: Avoid segfaults caused by negated options
dm kcopyd: Fix bug causing workqueue stalls
dm crypt: use u64 instead of sector_t to store iv_offset
x86/topology: Use total_cpus for max logical packages calculation
netfilter: ipt_CLUSTERIP: fix deadlock in netns exit routine
netfilter: ipt_CLUSTERIP: remove wrong WARN_ON_ONCE in netns exit routine
netfilter: ipt_CLUSTERIP: check MAC address when duplicate config is set
perf vendor events intel: Fix Load_Miss_Real_Latency on SKL/SKX
perf parse-events: Fix unchecked usage of strncpy()
perf svghelper: Fix unchecked usage of strncpy()
perf tests ARM: Disable breakpoint tests 32-bit
perf intel-pt: Fix error with config term "pt=0"
tty/serial: do not free trasnmit buffer page under port lock
btrfs: improve error handling of btrfs_add_link
btrfs: fix use-after-free due to race between replace start and cancel
btrfs: alloc_chunk: fix more DUP stripe size handling
btrfs: volumes: Make sure there is no overlap of dev extents at mount time
mmc: atmel-mci: do not assume idle after atmci_request_end
kconfig: fix memory leak when EOF is encountered in quotation
kconfig: fix file name and line number of warn_ignored_character()
bpf: relax verifier restriction on BPF_MOV | BPF_ALU
arm64: Fix minor issues with the dcache_by_line_op macro
clk: imx6q: reset exclusive gates on init
arm64: kasan: Increase stack size for KASAN_EXTRA
selftests: do not macro-expand failed assertion expressions
scsi: target/core: Make sure that target_wait_for_sess_cmds() waits long enough
scsi: target: use consistent left-aligned ASCII INQUIRY data
net: call sk_dst_reset when set SO_DONTROUTE
staging: erofs: fix use-after-free of on-stack `z_erofs_vle_unzip_io'
media: venus: core: Set dma maximum segment size
ASoC: use dma_ops of parent device for acp_audio_dma
media: firewire: Fix app_info parameter type in avc_ca{,_app}_info
powerpc/pseries/cpuidle: Fix preempt warning
powerpc/xmon: Fix invocation inside lock region
media: uvcvideo: Refactor teardown of uvc on USB disconnect
pstore/ram: Do not treat empty buffers as valid
clk: imx: make mux parent strings const
jffs2: Fix use of uninitialized delayed_work, lockdep breakage
efi/libstub: Disable some warnings for x86{,_64}
rxe: IB_WR_REG_MR does not capture MR's iova field
drm/amdgpu: Reorder uvd ring init before uvd resume
scsi: qedi: Check for session online before getting iSCSI TLV data.
ASoC: pcm3168a: Don't disable pcm3168a when CONFIG_PM defined
selinux: always allow mounting submounts
fpga: altera-cvp: fix probing for multiple FPGAs on the bus
usb: gadget: udc: renesas_usb3: add a safety connection way for forced_b_device
samples: bpf: fix: error handling regarding kprobe_events
clk: meson: meson8b: fix incorrect divider mapping in cpu_scale_table
drm/atomic-helper: Complete fake_commit->flip_done potentially earlier
arm64: perf: set suppress_bind_attrs flag to true
crypto: ecc - regularize scalar for scalar multiplication
MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur
x86/mce: Fix -Wmissing-prototypes warnings
ALSA: oxfw: add support for APOGEE duet FireWire
bpf: Allow narrow loads with offset > 0
serial: set suppress_bind_attrs flag only if builtin
writeback: don't decrement wb->refcnt if !wb->bdi
of: overlay: add missing of_node_put() after add new node to changeset
selftests/bpf: enable (uncomment) all tests in test_libbpf.sh
usb: typec: tcpm: Do not disconnect link for self powered devices
e1000e: allow non-monotonic SYSTIM readings
platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey
ixgbe: allow IPsec Tx offload in VEPA mode
drm/amdkfd: fix interrupt spin lock
drm/amd/display: Guard against null stream_state in set_crc_source
gpio: pl061: Move irq_chip definition inside struct pl061
netfilter: ipset: Allow matching on destination MAC address for mac and ipmac sets
net: clear skb->tstamp in bridge forwarding path
ipv6: Take rcu_read_lock in __inet6_bind for mapped addresses
r8169: Add support for new Realtek Ethernet
qmi_wwan: add MTU default to qmap network interface
net, skbuff: do not prefer skb allocation fails early
net: dsa: mv88x6xxx: mv88e6390 errata
mlxsw: spectrum_switchdev: Set PVID correctly during VLAN deletion
mlxsw: spectrum: Disable lag port TX before removing it
ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address
UPSTREAM: dm: do not allow readahead to limit IO size
UPSTREAM: ppp: Move PFC decompression to PPP generic layer
UPSTREAM: l2tp: Add protocol field decompression
Conflicts:
include/linux/swap.h
Change-Id: I72fecd7d04341015f9397afe60d8469d548b4cb6
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
Previous hotplug notifier was overwriting cpu online notifiers which
are needed by various drivers in the kernel. Instead create a new state
right after CPUHP_AP_NOTIFY_ONLINE just for perf.
Change-Id: Ie740315c621a176ceff3ca13f52a48716eef5782
[rananta@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
The change is a squash of the following four commits taken
from msm-4.14:
1) commit <b02d7648fbd1> ("enable perf to continue across
hotplug")
Currently perf hardware, software and tracepoint events are
deleted when a cpu is hotplugged out. This change restarts
the events after hotplug. In arm_pmu.c most of the code
for handline power collapse is reused for hotplug.
This change supercedes commit 1f0f95c5fe9e ("perf: add hotplug
support so that perf continues after hotplug") and uses the
new hotplug notification method.
2) commit <9768e7af40d6> ("disable perf_event_read during hotplug")
core.c should not allow perf_event_read access during hotplug.
DCVS may try to read events during hotplug startup or
shutdown. Set a flag to not allow access during hotplug.
3) commit <1fc690b7b8c6> ("perf: core: Avoid race condition when
releasing perf-events")
Before calling perf_event_release_kernel(), capture
the perf's pmus_mutex lock to prevent the CPU from going offline
during the operation.
4) commit <77257e46efea> ("perf: Manage CPU hotplug events at
core level")
the approach here is to achieve the hotplug management
at the perf-core level. The idea is to detach the event from the
context (perf_remove_from_context()), when the CPU is about to come
down and re-attach it back (perf_install_in_context()), when the CPU
comes back online. The approach involves removing the logic for
maintaining zombie events (PERF_EVENT_STATE_ZOMBIE) and let the
dormant list itself carry the events whose CPUs are offline.
Change-Id: I3738bdcaae2d2199ba3fb68ce77f637d867c5c14
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Enable the perf exclude_idle event attribute to avoid waking
possilby sleeping CPUS. The counter values are updated when CPU
enters idle. If the CPU is idle when perf reads the current
event value (of an exclude idle event) then the value from
when the CPU went idle is returned.
This commit supercedes the commits below. The context for the
commits below changed too much to enable cherry-picking.
commit 573979dee2a7 ("perf: Add support for exclude_idle attribute")
commit 54f6e4ae87be ("perf: Enable updating exclude_idle events
at idle")
commit 960dbb1751f3 ("perf: Skip permission checks on kernel owned
perf events")
Squashed commit:
Perf: arm64: enable idle_update at end of probe
Currently armv8pmu_idle_update is enabled before
arm_pmu_device_probe has completed. arm_pmu_device_probe
initializes some structures need by armv8pmu_idle_update.
armv8pmu_idle_update can get called before these structures
are complete leading to seg faults. Set a flag to prevent
armv8pmu_idle_update from trying to access these structures
until arm_pmu_device_probe is finished. Also move the call
to perf_event_cpu_hp_init after arm_pmu_device_probe so
that hotplug doesn't overwrite the flag.
Change-Id: Ib554c9fe106963ec1b42e72aeaf84fc73201bbb7
Signed-off-by: Patrick Fay <pfay@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
There is possibility of IRQ burst when back to back
performance monitor overflow interrupts raised.
Single interrupt line is used for all monitors on a CPU
and when multiple monitors are used simultaneously,
performance monitor overflow status register do no show
proper overflow status of each monitor. So add workaround
to disable all monitor overflow interrupts while handling
a monitor overflow interrupt.
Change-Id: I14a34b2258ddab19f8ed9a9e087129efd7b86ff4
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
[ckadabi: Resolved minor conflicts]
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
* origin/tmp-35a7f35:
Linux 4.19-rc8
KVM: vmx: hyper-v: don't pass EPT configuration info to vmx_hv_remote_flush_tlb()
ubifs: Fix WARN_ON logic in exit path
fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters()
mm/thp: fix call to mmu_notifier in set_pmd_migration_entry() v2
mm/mmap.c: don't clobber partially overlapping VMA with MAP_FIXED_NOREPLACE
ocfs2: fix a GCC warning
afs: Fix afs_server struct leak
MAINTAINERS: use the correct location for dt-bindings includes for mux
mux: adgs1408: use the correct MODULE_LICENSE
gfs2: Fix iomap buffered write support for journaled files (2)
arm64: perf: Reject stand-alone CHAIN events for PMUv3
arm64: Fix /proc/iomem for reserved but not memory regions
afs: Fix cell proc list
lib/bch: fix possible stack overrun
net: dsa: bcm_sf2: Call setup during switch resume
net: dsa: bcm_sf2: Fix unbind ordering
vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections
vmlinux.lds.h: Fix incomplete .text.exit discards
i2c: Fix kerneldoc for renamed i2c dma put function
blk-wbt: wake up all when we scale up, not down
net: phy: sfp: remove sfp_mutex's definition
r8169: set RX_MULTI_EN bit in RxConfig for 8168F-family chips
net: socionext: clear rx irq correctly
net/mlx4_core: Fix warnings during boot on driverinit param set failures
tipc: eliminate possible recursive locking detected by LOCKDEP
selftests: udpgso_bench.sh explicitly requires bash
selftests: rtnetlink.sh explicitly requires bash.
qmi_wwan: Added support for Gemalto's Cinterion ALASxx WWAN interface
tipc: queue socket protocol error messages into socket receive buffer
tipc: set link tolerance correctly in broadcast link
net: ipv4: don't let PMTU updates increase route MTU
net: ipv4: update fnhe_pmtu when first hop's MTU changes
net/ipv6: stop leaking percpu memory in fib6 info
rds: RDS (tcp) hangs on sendto() to unresponding address
dm linear: fix linear_end_io conditional definition
IB/mlx5: Unmap DMA addr from HCA before IOMMU
net: make skb_partial_csum_set() more robust against overflows
devlink: Add helper function for safely copy string param
devlink: Fix param cmode driverinit for string type
devlink: Fix param set handling for string type
samples: disable CONFIG_SAMPLES for UML
dm linear: eliminate linear_end_io call if CONFIG_DM_ZONED disabled
pinctrl: mcp23s08: fix irq and irqchip setup order
gpio: Assign gpio_irq_chip::parents to non-stack pointer
libertas: call into generic suspend code before turning off power
of: unittest: Disable interrupt node tests for old world MAC systems
mfd: cros-ec: copy the whole event in get_next_event_xfer
mm: Preserve _PAGE_DEVMAP across mprotect() calls
dm: fix report zone remapping to account for partition offset
dm cache: destroy migration_cache if cache target registration failed
net: ena: fix auto casting to boolean
net: ena: fix NULL dereference due to untimely napi initialization
net: ena: fix rare bug when failed restart/resume is followed by driver removal
net: ena: fix warning in rmmod caused by double iounmap
KVM: x86: support CONFIG_KVM_AMD=y with CONFIG_CRYPTO_DEV_CCP_DD=m
gfs2: Fix iomap buffered write support for journaled files
ARM: KVM: Correctly order SGI register entries in the cp15 array
mmc: block: avoid multiblock reads for the last sector in SPI mode
x86/mm: Avoid VLA in pgd_alloc()
mm, sched/numa: Remove remaining traces of NUMA rate-limiting
x86/intel_rdt: Fix out-of-bounds memory access in CBM tests
rxrpc: Fix the packet reception routine
rxrpc: Fix the rxrpc_tx_packet trace line
rxrpc: Fix connection-level abort handling
rxrpc: Only take the rwind and mtu values from latest ACK
filesystem-dax: Fix dax_layout_busy_page() livelock
rxrpc: Carry call state out of locked section in rxrpc_rotate_tx_window()
rxrpc: Don't check RXRPC_CALL_TX_LAST after calling rxrpc_rotate_tx_window()
rxrpc: Don't need to take the RCU read lock in the packet receiver
rxrpc: Use the UDP encap_rcv hook
sparc64: fix fall-through annotation
sparc32: fix fall-through annotation
sparc: vdso: clean-up vdso Makefile
oradax: remove redundant null check before kfree
sparc64: viohs: Remove VLA usage
sbus: Use of_get_child_by_name helper
sparc: Convert to using %pOFn instead of device_node.name
mach64: detect the dot clock divider correctly on sparc
net/smc: retain old name for diag_mode field
net/smc: use __aligned_u64 for 64-bit smc_diag fields
net: sched: cls_u32: fix hnode refcounting
udp: Unbreak modules that rely on external __skb_recv_udp() availability
percpu: stop leaking bitmap metadata blocks
Linux 4.19-rc7
xfs: fix data corruption w/ unaligned reflink ranges
xfs: fix data corruption w/ unaligned dedupe ranges
treewide: Replace more open-coded allocation size multiplications
mm: madvise(MADV_DODUMP): allow hugetlbfs pages
ocfs2: fix locking for res->tracking and dlm->tracking_list
mm/vmscan.c: fix int overflow in callers of do_shrink_slab()
mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly
mm/vmstat.c: fix outdated vmstat_text
proc: restrict kernel stack dumps to root
mm/hugetlb: add mmap() encodings for 32MB and 512MB page sizes
mm/migrate.c: split only transparent huge pages when allocation fails
ipc/shm.c: use ERR_CAST() for shm_lock() error return
mm/gup_benchmark: fix unsigned comparison to zero in __gup_benchmark_ioctl
mm, thp: fix mlocking THP page with migration enabled
ocfs2: fix crash in ocfs2_duplicate_clusters_by_page()
hugetlb: take PMD sharing into account when flushing tlb/caches
mm: migration: fix migration of huge PMD shared pages
net: mvpp2: Extract the correct ethtype from the skb for tx csum offload
ipv6: take rcu lock in rawv6_send_hdrinc()
ARC: clone syscall to setp r25 as thread pointer
net: sched: Add policy validation for tc attributes
rtnetlink: fix rtnl_fdb_dump() for ndmsg header
yam: fix a missing-check bug
net: bpfilter: Fix type cast and pointer warnings
net: cxgb3_main: fix a missing-check bug
Input: uinput - add a schedule point in uinput_inject_events()
Input: evdev - add a schedule point in evdev_write()
bpf: 32-bit RSH verification must truncate input before the ALU op
MIPS: memset: Fix CPU_DADDI_WORKAROUNDS `small_fixup' regression
perf record: Use unmapped IP for inline callchain cursors
vsprintf: Fix off-by-one bug in bstr_printf() processing dereferenced pointers
perf python: Use -Wno-redundant-decls to build with PYTHON=python3
rxrpc: Fix the data_ready handler
rxrpc: Fix some missed refs to init_net
powerpc/numa: Skip onlining a offline node in kdump path
powerpc: Don't print kernel instructions in show_user_instructions()
i2c: designware: Call i2c_dw_clk_rate() only when calculating timings
xfs: update ctime and remove suid before cloning files
xfs: zero posteof blocks when cloning above eof
xfs: refactor clonerange preparation into a separate helper
iommu/amd: Clear memory encryption mask from physical address
net: phy: phylink: fix SFP interface autodetection
be2net: don't flip hw_features when VXLANs are added/deleted
drm/nouveau/drm/nouveau: Grab runtime PM ref in nv50_mstc_detect()
net/packet: fix packet drop as of virtio gso
net: dsa: b53: Keep CPU port as tagged in all VLANs
openvswitch: load NAT helper
bnxt_en: get the reduced max_irqs by the ones used by RDMA
bnxt_en: free hwrm resources, if driver probe fails.
bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request
bnxt_en: Fix VNIC reservations on the PF.
Input: mousedev - add a schedule point in mousedev_write()
team: Forbid enslaving team device to itself
net/usb: cancel pending work when unbinding smsc75xx
cgroup: Fix dom_cgrp propagation when enabling threaded mode
dm cache: fix resize crash if user doesn't reload cache table
dm cache metadata: ignore hints array being too small during resize
PM / core: Clear the direct_complete flag on errors
mlxsw: spectrum: Delete RIF when VLAN device is removed
mlxsw: pci: Derive event type from event queue number
drm/amdkfd: Fix incorrect use of process->mm
drm/amd/display: Signal hw_done() after waiting for flip_done()
kvm: nVMX: fix entry with pending interrupt if APICv is enabled
ovl: fix format of setxattr debug
ovl: fix access beyond unterminated strings
KVM: VMX: hide flexpriority from guest when disabled at the module level
KVM: VMX: check for existence of secondary exec controls before accessing
x86/vdso: Fix vDSO syscall fallback asm constraint regression
ALSA: hda/realtek - Cannot adjust speaker's volume on Dell XPS 27 7760
KVM: PPC: Book3S HV: Avoid crash from THP collapse during radix page fault
ixgbe: check return value of napi_complete_done()
sctp: fix fall-through annotation
drm/i915: Handle incomplete Z_FINISH for compressed error states
media: v4l: event: Prevent freeing event subscriptions while accessed
locking/ww_mutex: Fix runtime warning in the WW mutex selftest
x86/cpu/amd: Remove unnecessary parentheses
x86/vdso: Only enable vDSO retpolines when enabled and supported
r8169: always autoneg on resume
ipv4: fix use-after-free in ip_cmsg_recv_dstaddr()
net: qualcomm: rmnet: Fix incorrect allocation flag in receive path
net: qualcomm: rmnet: Fix incorrect allocation flag in transmit
net: qualcomm: rmnet: Skip processing loopback packets
net: systemport: Fix wake-up interrupt race during resume
smb3: fix lease break problem introduced by compounding
cifs: only wake the thread for the very last PDU in a compound
cifs: add a warning if we try to to dequeue a deleted mid
smb2: fix missing files in root share directory listing
rtnl: limit IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES to 4096
bonding: fix warning message
inet: make sure to grab rcu_read_lock before using ireq->ireq_opt
Revert "serial: sh-sci: Allow for compressed SCIF address"
Revert "serial: sh-sci: Remove SCIx_RZ_SCIFA_REGTYPE"
Revert "serial: 8250_dw: Fix runtime PM handling"
RISCV: Fix end PFN for low memory
x86/tsc: Fix UV TSC initialization
x86/platform/uv: Provide is_early_uv_system()
nfp: avoid soft lockups under control message storm
declance: Fix continuation with the adapter identification message
net: fec: fix rare tx timeout
thunderbolt: Initialize after IOMMUs
thunderbolt: Do not handle ICM events after domain is stopped
powerpc/lib: fix book3s/32 boot failure due to code patching
bpf: don't accept cgroup local storage with zero value size
drm/cma-helper: Fix crash in fbdev error path
sched/numa: Migrate pages to local nodes quicker early in the lifetime of a task
mm, sched/numa: Remove rate-limiting of automatic NUMA balancing migration
MAINTAINERS: Remove dead path from LOCKING PRIMITIVES entry
drm: fix use-after-free read in drm_mode_create_lease_ioctl()
s390/cio: Fix how vfio-ccw checks pinned pages
sched/numa: Avoid task migration for small NUMA improvement
mm/migrate: Use spin_trylock() while resetting rate limit
sched/numa: Limit the conditions where scan period is reset
sched/numa: Reset scan rate whenever task moves across nodes
sched/numa: Pass destination CPU as a parameter to migrate_task_rq
sched/numa: Stop multiple tasks from moving to the CPU at the same time
perf/x86/amd/uncore: Set ThreadMask and SliceMask for L3 Cache perf events
perf/x86/intel/uncore: Fix PCI BDF address of M3UPI on SKX
perf/ring_buffer: Prevent concurent ring buffer access
perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded physical package ID 0
perf/core: Fix perf_pmu_unregister() locking
selftests/x86: Add clock_gettime() tests to test_vdso
r8169: fix network stalls due to missing bit TXCFG_AUTO_FIFO
x86/vdso: Fix asm constraints on vDSO syscall fallbacks
tun: napi flags belong to tfile
tun: initialize napi_mutex unconditionally
tun: remove unused parameters
bond: take rcu lock in netpoll_send_skb_on_dev
rtnetlink: Fail dump if target netnsid is invalid
Revert "openvswitch: Fix template leak in error cases."
tipc: ignore STATE_MSG on wrong link session
net: sched: act_ipt: check for underflow in __tcf_ipt_init()
usb: xhci-mtk: resume USB3 roothub first
xhci: Add missing CAS workaround for Intel Sunrise Point xHCI
usb: cdc_acm: Do not leak URB buffers
Input: i8042 - enable keyboard wakeups by default when s2idle is used
Input: xpad - add support for Xbox1 PDP Camo series gamepad
soc: fsl: qman_portals: defer probe after qman's probe
lib/xz: Put CRC32_POLY_LE in xz_private.h
tcp/dccp: fix lockdep issue when SYN is backlogged
PCI: mvebu: Fix PCI I/O mapping creation sequence
net/mlx5e: Set vlan masks for all offloaded TC rules
net/mlx5: E-Switch, Fix out of bound access when setting vport rate
net/mlx5e: Avoid unbounded peer devices when unpairing TC hairpin rules
drm/i915: Avoid compiler warning for maybe unused gu_misc_iir
drm/i915: Do not redefine the has_csr parameter.
MAINTAINERS: MIPS/LOONGSON2 ARCHITECTURE - Use the normal wildcard style
KVM: x86: fix L1TF's MMIO GFN calculation
tools/kvm_stat: cut down decimal places in update interval dialog
KVM: nVMX: Fix emulation of VM_ENTRY_LOAD_BNDCFGS
KVM: x86: Do not use kvm_x86_ops->mpx_supported() directly
KVM: nVMX: Do not expose MPX VMX controls when guest MPX disabled
arm64: KVM: Sanitize PSTATE.M when being set from userspace
arm64: KVM: Tighten guest core register access from userspace
cfg80211: fix use-after-free in reg_process_hint()
mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
cfg80211: fix wext-compat memory leak
drm/exynos: Use selected dma_dev default iommu domain instead of a fake one
i2c: i2c-scmi: fix for i2c_smbus_write_block_data
xfs: fix error handling in xfs_bmap_extents_to_btree
pstore/ram: Fix failure-path memory leak in ramoops_init
firmware: Always initialize the fw_priv list object
docs: fpga: document fpga manager flags
fpga: bridge: fix obvious function documentation error
tools: hv: fcopy: set 'error' in case an unknown operation was requested
fpga: do not access region struct after fpga_region_unregister
Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect()
netlink: fix typo in nla_parse_nested() comment
r8169: Disable clk during suspend / resume
qlcnic: fix Tx descriptor corruption on 82xx devices
tipc: fix failover problem
smsc95xx: Check for Wake-on-LAN modes
smsc75xx: Check for Wake-on-LAN modes
r8152: Check for supported Wake-on-LAN Modes
sr9800: Check for supported Wake-on-LAN modes
lan78xx: Check for supported Wake-on-LAN modes
ax88179_178a: Check for supported Wake-on-LAN modes
asix: Check for supported Wake-on-LAN modes
iomap: set page dirty after partial delalloc on mkwrite
xfs: remove invalid log recovery first/last cycle check
xfs: validate inode di_forkoff
xfs: skip delalloc COW blocks in xfs_reflink_end_cow
xfs: don't treat unknown di_flags2 as corruption in scrub
xfs: remove duplicated include from alloc.c
xfs: don't bring in extents in xfs_bmap_punch_delalloc_range
xfs: fix transaction leak in xfs_reflink_allocate_cow()
xfs: avoid lockdep false positives in xfs_trans_alloc
xfs: refactor xfs_buf_log_item reference count handling
xfs: clean up xfs_trans_brelse()
xfs: don't unlock invalidated buf on aborted tx commit
xfs: remove last of unnecessary xfs_defer_cancel() callers
xfs: don't crash the vfs on a garbage inline symlink
MAINTAINERS: Remove obsolete drivers/pci pattern from ACPI section
MIPS: Fix CONFIG_CMDLINE handling
MIPS: VDSO: Always map near top of user memory
ibmvnic: remove ndo_poll_controller
sfc-falcon: remove ndo_poll_controller
sfc: remove ndo_poll_controller
net: ena: remove ndo_poll_controller
qlogic: netxen: remove ndo_poll_controller
qlcnic: remove ndo_poll_controller
virtio_net: remove ndo_poll_controller
net: hns: remove ndo_poll_controller
ehea: remove ndo_poll_controller
hinic: remove ndo_poll_controller
netpoll: do not test NAPI_STATE_SCHED in poll_one_napi()
qed: Fix shmem structure inconsistency between driver and the mfw.
Update maintainers for bnx2/bnx2x/qlge/qlcnic drivers.
MAINTAINERS: change bridge maintainers
s390: qeth: Fix potential array overrun in cmd/rc lookup
s390: qeth_core_mpc: Use ARRAY_SIZE instead of reimplementing its function
mmc: slot-gpio: Fix debounce time to use miliseconds again
bpf: harden flags check in cgroup_storage_update_elem()
netfilter: xt_socket: check sk before checking for netns.
netfilter: avoid erronous array bounds warning
netfilter: nft_set_rbtree: add missing rb_erase() in GC routine
rxrpc: Fix error distribution
rxrpc: Fix transport sockopts to get IPv4 errors on an IPv6 socket
rxrpc: Make service call handling more robust
rxrpc: Improve up-front incoming packet checking
rxrpc: Emit BUSY packets when supposed to rather than ABORTs
rxrpc: Fix RTT gathering
rxrpc: Fix checks as to whether we should set up a new call
scsi: qedi: Initialize the stats mutex lock
crypto: qat - Fix KASAN stack-out-of-bounds bug in adf_probe()
crypto: mxs-dcp - Fix wait logic on chan threads
crypto: chelsio - Fix memory corruption in DMA Mapped buffers.
PCI: Reprogram bridge prefetch registers on resume
soc: fsl: qbman: add APIs to retrieve the probing status
perf report: Don't try to map ip to invalid map
rseq/selftests: fix parametrized test with -fpie
iwlwifi: 1000: set the TFD queue size
ieee802154: mcr20a: Replace magic number with constants
s390/cio: Refactor alloc of ccw_io_region
s390/cio: Convert ccw_io_region to pointer
rxrpc: Remove dup code from rxrpc_find_connection_rcu()
ieee802154: ca8210: remove redundant condition check before debugfs_remove
nl80211: Fix possible Spectre-v1 for CQM RSSI thresholds
net-tcp: /proc/sys/net/ipv4/tcp_probe_interval is a u32 not int
bnxt_en: Fix TX timeout during netpoll.
vxlan: fill ttl inherit info
net: phy: sfp: Fix unregistering of HWMON SFP device
qed: Avoid implicit enum conversion in qed_iwarp_parse_rx_pkt
qed: Avoid constant logical operation warning in qed_vf_pf_acquire
bonding: avoid possible dead-lock
bonding: pass link-local packets to bonding master also.
qed: Avoid implicit enum conversion in qed_roce_mode_to_flavor
qed: Fix mask parameter in qed_vf_prep_tunn_req_tlv
qed: Avoid implicit enum conversion in qed_set_tunn_cls_info
wimax/i2400m: fix spelling mistake "not unitialized" -> "uninitialized"
qed: fix spelling mistake "toogle" -> "toggle"
net: phy: fix WoL handling when suspending the PHY
net: core: add member wol_enabled to struct net_device
Revert "net: phy: fix WoL handling when suspending the PHY"
net: phy: fix WoL handling when suspending the PHY
net/ipv6: Remove extra call to ip6_convert_metrics for multipath case
mmc: core: Fix debounce time to use microseconds
video/fbdev/stifb: Fix spelling mistake in fall-through annotation
uvesafb: Fix URLs in the documentation
efifb: BGRT: Add nobgrt option
fbdev/omapfb: fix omapfb_memory_read infoleak
pxa168fb: prepare the clock
Bluetooth: SMP: fix crash in unpairing
mac80211_hwsim: do not omit multicast announce of first added radio
mac80211_hwsim: fix race in radio destruction from netlink notifier
mac80211_hwsim: fix locking when iterating radios during ns exit
nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT
cfg80211: fix reg_query_regdb_wmm kernel-doc
mac80211: allocate TXQs for active monitor interfaces
tipc: lock wakeup & inputq at tipc_link_reset()
tipc: reset bearer if device carrier not ok
ARM: dts: stm32: update SPI6 dmas property on stm32mp157c
soc: fsl: qe: Fix copy/paste bug in ucc_get_tdm_sync_shift()
soc: fsl: qbman: qman: avoid allocating from non existing gen_pool
ovl: make symbol 'ovl_aops' static
tipc: fix flow control accounting for implicit connect
net: hns: fix for unmapping problem when SMMU is on
xen-netback: handle page straddling in xenvif_set_hash_mapping()
xen-netback: validate queue numbers in xenvif_set_hash_mapping()
xen-netback: fix input validation in xenvif_set_hash_mapping()
net: macb: Clean 64b dma addresses if they are not detected
perf script python: Fix export-to-sqlite.py sample columns
perf script python: Fix export-to-postgresql.py occasional failure
i2c: i2c-isch: fix spelling mistake "unitialized" -> "uninitialized"
i2c: i2c-qcom-geni: Properly handle DMA safe buffers
ARM: dts: BCM63xx: Fix incorrect interrupt specifiers
arm64: hugetlb: Avoid unnecessary clearing in huge_ptep_set_access_flags
arm64: hugetlb: Fix handling of young ptes
KVM: x86: never trap MSR_KERNEL_GS_BASE
USB: serial: simple: add Motorola Tetra MTP6550 id
HID: intel-ish-hid: Enable Ice Lake mobile
HID: i2c-hid: Remove RESEND_REPORT_DESCR quirk and its handling
vfs: swap names of {do,vfs}_clone_file_range()
ovl: fix freeze protection bypass in ovl_clone_file_range()
ovl: fix freeze protection bypass in ovl_write_iter()
ovl: fix memory leak on unlink of indexed file
MAINTAINERS: update the Annapurna Labs maintainer email
ieee802154: remove unecessary condition check before debugfs_remove_recursive
ieee802154: Use kmemdup instead of duplicating it in ca8210_test_int_driver_write
crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic
netfilter: conntrack: get rid of double sizeof
netfilter: nft_osf: use enum nft_data_types for nft_validate_register_store
netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev
drm/i2c: tda9950: set MAX_RETRIES for errors only
drm/i2c: tda9950: fix timeout counter check
b43: fix DMA error related regression with proprietary firmware
s390/hibernate: fix error handling when suspend cpu != resume cpu
ALSA: hda: Fix the audio-component completion timeout
xfrm: validate template mode
ARM: dts: sun8i: drop A64 HDMI PHY fallback compatible from R40 DT
kbuild: allow to use GCC toolchain not in Clang search path
ftrace: Build with CPPFLAGS to get -Qunused-arguments
ARM: 8799/1: mm: fix pci_ioremap_io() offset check
ARM: 8787/1: wire up io_pgetevents syscall
gpiolib: Free the last requested descriptor
ARC: build: Don't set CROSS_COMPILE in arch's Makefile
sysfs: Do not return POSIX ACL xattrs via listxattr
dm raid: remove bogus const from decipher_sync_action() return type
dm mpath: fix attached_handler_name leak and dangling hw_handler_name pointer
mmc: sdhi: sys_dmac: check for all Gen3 types when whitelisting
dm thin metadata: fix __udivdi3 undefined on 32-bit
mt76x0: fix remove_interface
ARC: fix spelling mistake "entires" -> "entries"
USB: serial: option: add two-endpoints device-id flag
USB: serial: option: improve Quectel EP06 detection
HID: i2c-hid: disable runtime PM operations on hantick touchpad
ARC: build: Get rid of toolchain check
ARM: dts: at91: sama5d2_ptc_ek: fix nand pinctrl
ARM: dts: imx53-qsb: disable 1.2GHz OPP
xfrm: Fix NULL pointer dereference when skb_dst_force clears the dst_entry.
ARCv2: build: use mcpu=hs38 iso generic mcpu=archs
mac80211: fix TX status reporting for ieee80211s
mac80211: TDLS: fix skb queue/priority assignment
cfg80211: Address some corner cases in scan result channel updating
mac80211: fix pending queue hang due to TX_DROP
cfg80211: reg: Init wiphy_idx in regulatory_hint_core()
mac80211: Don't wake up from PS for offchannel TX
mac80211: Always report TX status
xfrm: reset crypto_done when iterating over multiple input xfrms
xfrm: reset transport header back to network header after all input transforms ahave been applied
xfrm6: call kfree_skb when skb is toobig
xfrm: Validate address prefix lengths in the xfrm selector.
[rishabhb@codeaurora.org: resolved some minor conflicts]
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Change-Id: Ic3fb7f2c090b32694426ab160416f6a59cca8126
It doesn't make sense for a perf event to be configured as a CHAIN event
in isolation, so extend the arm_pmu structure with a ->filter_match()
function to allow the backend PMU implementation to reject CHAIN events
early.
Cc: <stable@vger.kernel.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Preserves the bitfields of PMCR(AArch32)/PMCR_EL0(AArch64)
during PMU reset. Reset routine should write a 1 to PMCR.C and PMCR.P
fields only to reset the counters. Other fields should not be changed
as they could be set before PMU initialization and their value must
be preserved even after reset.
Change-Id: I835bf41f89a8a4691e996e6766aed4b4c8ef4368
Acked-by: Abhiroop Basak <abasak@qti.qualcomm.com>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
It is useful to get the running time of a thread. Doing so in an
efficient manner can be important for performance of user applications.
Avoiding system calls in `clock_gettime` when handling
CLOCK_THREAD_CPUTIME_ID is important. Other clocks are handled in the
VDSO, but CLOCK_THREAD_CPUTIME_ID falls back on the system call.
CLOCK_THREAD_CPUTIME_ID is not handled in the VDSO since it would have
costs associated with maintaining updated user space accessible time
offsets. These offsets have to be updated everytime the a thread is
scheduled/descheduled. However, for programs regularly checking the
running time of a thread, this is a performance improvement.
This patch takes a middle ground, and adds support for cap_user_time an
optional feature of the perf_event API. This way costs are only
incurred when the perf_event api is enabled. This is done the same way
as it is in x86.
Ultimately this allows calculating the thread running time in userspace
on aarch64 as follows (adapted from perf_event_open manpage):
u32 seq, time_mult, time_shift;
u64 running, count, time_offset, quot, rem, delta;
struct perf_event_mmap_page *pc;
pc = buf; // buf is the perf event mmaped page as documented in the API.
if (pc->cap_usr_time) {
do {
seq = pc->lock;
barrier();
running = pc->time_running;
count = readCNTVCT_EL0(); // Read ARM hardware clock.
time_offset = pc->time_offset;
time_mult = pc->time_mult;
time_shift = pc->time_shift;
barrier();
} while (pc->lock != seq);
quot = (count >> time_shift);
rem = count & (((u64)1 << time_shift) - 1);
delta = time_offset + quot * time_mult +
((rem * time_mult) >> time_shift);
running += delta;
// running now has the current nanosecond level thread time.
}
Summary of changes in the patch:
For aarch64 systems, make arch_perf_update_userpage update the timing
information stored in the perf_event page. Requiring the following
calculations:
- Calculate the appropriate time_mult, and time_shift factors to convert
ticks to nano seconds for the current clock frequency.
- Adjust the mult and shift factors to avoid shift factors of 32 bits.
(possibly unnecessary)
- The time_offset userspace should apply when doing calculations:
negative the current sched time (now), because time_running and
time_enabled fields of the perf_event page have just been updated.
Toggle bits to appropriate values:
- Enable cap_user_time
Signed-off-by: Michael O'Farrell <micpof@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Add support for 64bit event by using chained event counters
and 64bit cycle counters.
PMUv3 allows chaining a pair of adjacent 32-bit counters, effectively
forming a 64-bit counter. The low/even counter is programmed to count
the event of interest, and the high/odd counter is programmed to count
the CHAIN event, taken when the low/even counter overflows.
For CPU cycles, when 64bit mode is requested, the cycle counter
is used in 64bit mode. If the cycle counter is not available,
falls back to chaining.
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The arm64 PMU updates the event counters and reprograms the
counters in the overflow IRQ handler without disabling the
PMU. This could potentially cause skews in for group counters,
where the overflowed counters may potentially loose some event
counts, while they are reprogrammed. To prevent this, disable
the PMU while we process the counter overflows and enable it
right back when we are done.
This patch also moves the PMU stop/start routines to avoid a
forward declaration.
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The armpmu uses get_event_idx callback to allocate an event
counter for a given event, which marks the selected counter
as "used". Now, when we delete the counter, the arm_pmu goes
ahead and clears the "used" bit and then invokes the "clear_event_idx"
call back, which kind of splits the job between the core code
and the backend. To keep things tidy, mandate the implementation
of clear_event_idx() and add it for exisiting backends.
This will be useful for adding the chained event support, where
we leave the event idx maintenance to the backend.
Also, when an event is removed from the PMU, reset the hw.idx
to indicate that a counter is not allocated for this event,
to help the backends do better checks. This will be also used
for the chain counter support.
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Convert the {read/write}_counter APIs to handle 64bit values
to enable supporting chained event counters. The backends still
use 32bit values and we pass them 32bit values only. So in effect
there are no functional changes.
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Each PMU defines their max_period of the counter as the maximum
value that can be counted. Since all the PMU backends support
32bit counters by default, let us remove the redundant field.
No functional changes.
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The arm_pmu::handle_irq() callback has the same prototype as a generic
IRQ handler, taking the IRQ number and a void pointer argument which it
must convert to an arm_pmu pointer.
This means that all arm_pmu::handle_irq() take an IRQ number they never
use, and all must explicitly cast the void pointer to an arm_pmu
pointer.
Instead, let's change arm_pmu::handle_irq to take an arm_pmu pointer,
allowing these casts to be removed. The redundant IRQ number parameter
is also removed.
Suggested-by: Hoeun Ryu <hoeun.ryu@lge.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The ID_AA64DFR0_EL1.PMUVer field doesn't follow the usual ID registers
scheme. While value 0xf indicates a non-architected PMU is implemented,
values 0x1 to 0xe indicate an increasingly featureful architected PMU,
as if the field were unsigned.
For more details, see ARM DDI 0487C.a, D10.1.4, "Alternative ID scheme
used for the Performance Monitors Extension version".
Currently, we treat the field as signed, and erroneously bail out for
values 0x8 to 0xe. Let's correct that.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
bus access read/write events are not supported in A73, based on the
Cortex-A73 TRM r0p2, section 11.9 Events (pages 11-457 to 11-460).
Fixes: 5561b6c5e9 "arm64: perf: add support for Cortex-A73"
Acked-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The Cortex-A35 uses some implementation defined perf events.
The Cortex-A35 derives from the Cortex-A53 core, using the same event mapings
based on Cortex-A35 TRM r0p2, section C2.3 - Performance monitoring events
(pages C2-562 to C2-565).
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The Cortex-A73 uses some implementation defined perf events.
This patch sets up the necessary mapping for Cortex-A73.
Mappings are based on Cortex-A73 TRM r0p2, section 11.9 Events
(pages 11-457 to 11-460).
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Now that the event mapping code always looks into the PMUv3 events
before any extended mappings, the extended mappings can be reduced to
only those events that are not discoverable through the PMCEID registers.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Last level caches and node events were almost never connected in current
supported cores.
We connect last level caches to the actual last level within the core and
node events are connected to bus accesses.
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Rather than continue adding CPU-specific event maps, instead look up by
default in the PMUv3 event map and only fallback to the CPU-specific maps
if either the event isn't described by PMUv3, or it is described but
the PMCEID registers say that it is unsupported by the current CPU.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Currently:
$ perf stat -e cycles:u -e cycles:k true
Performance counter stats for 'true':
2,24,699 cycles:u
<not counted> cycles:k (0.00%)
0.000788087 seconds time elapsed
We can not count more than one cycle counter in one instance,because we
allow to map cycle counter into PMCCNTR_EL0 only. However, if I did not
miss anything then specification do not prohibit to use PMEVCNTR<n>_EL0
for cycle count as well.
Modify the code so that it still prefers to use PMCCNTR_EL0 for cycle
counter, however allow to use PMEVCNTR<n>_EL0 if PMCCNTR_EL0 is already
in use.
After this patch:
$ perf stat -e cycles:u -e cycles:k true
Performance counter stats for 'true':
2,17,310 cycles:u
7,40,009 cycles:k
0.000764149 seconds time elapsed
Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Perf has supported ARMv8.1 feature with 16-bit evtCount filed [see c210ae8
arm64: perf: Extend event mask for ARMv8.1], event config should be
extended to 16-bit too, otherwise, if use -e event_name whose event_code
is more than 0x3ff, pmu_config_term will return -EINVAL because function
pmu_format_max_value depends on event config.
This patch extends event config to 16-bit.
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
commit d98ecdaca2 ("arm64: perf: Count EL2 events if the kernel is
running in HYP") returns -EINVAL when perf system call perf_event_open is
called with exclude_hv != exclude_kernel. This change breaks applications
on VHE enabled ARMv8.1 platforms. The issue was observed with HHVM
application, which calls perf_event_open with exclude_hv = 1 and
exclude_kernel = 0.
There is no separate hypervisor privilege level when VHE is enabled, the
host kernel runs at EL2. So when VHE is enabled, we should ignore
exclude_hv from the application. This behaviour is consistent with PowerPC
where the exclude_hv is ignored when the hypervisor is not present and with
x86 where this flag is ignored.
Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
[will: added comment to justify the behaviour of exclude_hv]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Commit f1b36dcb5c ("arm64: pmuv3: handle !PMUv3 when probing") is
a little too restrictive, and prevents the use of of backwards
compatible PMUv3 extenstions, which have a PMUver value other than 1.
For instance, ARMv8.1 PMU extensions (as implemented by ThunderX2) are
reported with PMUver value 4.
Per the usual ID register principles, at least 0x1-0x7 imply a
PMUv3-compatible PMU. It's not currently clear whether 0x8-0xe imply the
same.
For the time being, treat the value as signed, and with 0x1-0x7 treated
as meaning PMUv3 is implemented. This may be relaxed by future patches.
Reported-by: Jayachandran C <jnair@caviumnetworks.com>
Tested-by: Jayachandran C <jnair@caviumnetworks.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Now that we have a framework to handle the ACPI bits, make the PMUv3
code use this. The framework is a little different to what was
originally envisaged, and we can drop some unused support code in the
process of moving over to it.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
[will: make armv8_pmu_driver_init static]
Signed-off-by: Will Deacon <will.deacon@arm.com>
When probing via ACPI, we won't know up-front whether a CPU has a PMUv3
compatible PMU. Thus we need to consult ID registers during probe time.
This patch updates our PMUv3 probing code to test for the presence of
PMUv3 functionality before touching an PMUv3-specific registers, and
before updating the struct arm_pmu with PMUv3 data.
When a PMUv3-compatible PMU is not present, probing will return -ENODEV.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
KVM calls kvm_pmu_set_counter_event_type() when PMCCFILTR is configured.
But this function can't deals with PMCCFILTR correctly because the evtCount
bits of PMCCFILTR, which is reserved 0, conflits with the SW_INCR event
type of other PMXEVTYPER<n> registers. To fix it, when eventsel == 0, this
function shouldn't return immediately; instead it needs to check further
if select_idx is ARMV8_PMU_CYCLE_IDX.
Another issue is that KVM shouldn't copy the eventsel bits of PMCCFILTER
blindly to attr.config. Instead it ought to convert the request to the
"cpu cycle" event type (i.e. 0x11).
To support this patch and to prevent duplicated definitions, a limited
set of ARMv8 perf event types were relocated from perf_event.c to
asm/perf_event.h.
Cc: stable@vger.kernel.org # 4.6+
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Wei Huang <wei@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Move the PMU name into a common header file so it may
be referenced by other users.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
ARMv8 machines can identify the micro/arch defined counters
that are available on a machine. Add all these counters to the
default armv8 perf map. At run-time disable the counters which
are not available on the given PMU.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
In preparation for ACPI support, add a pmu_probe_info table to
the arm_pmu_device_probe() call. This table gets used when
probing in the absence of a devicetree node for PMU.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
By using a common attr_groups array, the common arm_pmu code can set up
common files (e.g. cpumask) for us in subsequent patches.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The CHAIN event allows two 32-bit counters to be treated as a single
64-bit counter, under certain allocation restrictions on the PMU.
Whilst userspace could theoretically create CHAIN events using the raw
event syntax, we don't really want to advertise this in sysfs, since
it's useless in isolation. This patch removes the event from our /sys
entries.
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Broadcom Vulcan uses ARMv8 PMUv3 and supports most of
the ARMv8 recommended implementation defined events.
Added Vulcan events mapping for perf and perf_cache map.
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
The complete common architectural and micro-architectural
event number structure is filtered based on PMCEIDn_EL0 and
exposed to /sys using is_visibile function pointer in events
attribute_group.
To filter the events in is_visible function, pmceid based bitmap
is stored in arm_pmu structure and the id field from
perf_pmu_events_attr is used to check against the bitmap.
The function which derives event bitmap from PMCEIDn_EL0 is
executed in the cpus, which has the pmu being initialized,
for heterogeneous pmu support.
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
changed pmu register access to make use of <read/write>_sys_reg
from sysreg.h instead of accessing them directly.
Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Defined all the ARMv8 recommended implementation defined events
from J3 - "ARM recommendations for IMPLEMENTATION DEFINED event numbers"
in ARM DDI 0487A.g.
Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
changed all the common events name definition as per the document
ARM DDI 0487A.g
SoC specific event names follow the general naming style in
the file and doesn't reflect any document.
changed ARMV8_A53_PERFCTR_PREFETCH_LINEFILL to
ARMV8_A53_PERFCTR_PREF_LINEFILL to match with other SoC specific
event names which use _PREF_ style.
corrected typo l21 to l2i.
Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
To use the ARMv8 PMU related register defines from the KVM code, we move
the relevant definitions to asm/perf_event.h header file and rename them
with prefix ARMV8_PMU_. This allows us to get rid of kvm_perf_event.h.
Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Pull arm[64] perf updates from Will Deacon:
"I have another mixed bag of ARM-related perf patches here.
It's about 25% CPU and 75% interconnect, but with drivers/bus/
languishing without an obvious maintainer or tree, Olof and I agreed
to keep all of these PMU patches together. I suspect a whole load of
code from drivers/bus/arm-* can be moved under drivers/perf/, so
that's on the radar for the future.
Summary:
- Initial support for ARMv8.1 CPU PMUs
- Support for the CPU PMU in Cavium ThunderX
- CPU PMU support for systems running 32-bit Linux in secure mode
- Support for the system PMU in ARM CCI-550 (Cache Coherent Interconnect)"
* tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (26 commits)
drivers/perf: arm_pmu: avoid NULL dereference when not using devicetree
arm64: perf: Extend ARMV8_EVTYPE_MASK to include PMCR.LC
arm-cci: remove unused variable
arm-cci: don't return value from void function
arm-cci: make private functions static
arm-cci: CoreLink CCI-550 PMU driver
arm-cci500: Rearrange PMU driver for code sharing with CCI-550 PMU
arm-cci: CCI-500: Work around PMU counter writes
arm-cci: Provide hook for writing to PMU counters
arm-cci: Add helper to enable PMU without synchornising counters
arm-cci: Add routines to save/restore all counters
arm-cci: Get the status of a counter
arm-cci: write_counter: Remove redundant check
arm-cci: Delay PMU counter writes to pmu::pmu_enable
arm-cci: Refactor CCI PMU enable/disable methods
arm-cci: Group writes to counter
arm-cci: fix handling cpumask_any_but return value
arm-cci: simplify sysfs attr handling
drivers/perf: arm_pmu: implement CPU_PM notifier
arm64: dts: Add Cavium ThunderX specific PMU
...
Commit 7175f0591e ("arm64: perf: Enable PMCR long cycle counter bit")
added initial support for a 64-bit cycle counter enabled using PMCR.LC.
Unfortunately, that patch doesn't extend ARMV8_EVTYPE_MASK, so any
attempts to set the enable bit are ignored by armv8pmu_pmcr_write.
This patch extends the mask to include the new bit.
Signed-off-by: Will Deacon <will.deacon@arm.com>