Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from torvalds:master #82

Merged
merged 88 commits into from
Aug 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
24633d9
perf/x86/intel/uncore: Add BW counters for GT, IA and IO breakdown
vaibhavk2 Aug 14, 2020
030a2c6
powerpc: Fix P10 PVR revision in /proc/cpuinfo for SMT4 cores
mikey Aug 3, 2020
781fa48
powerpc/perf: Add support for outputting extended regs in perf intr_regs
anjutsudhakar Aug 7, 2020
d735599
powerpc/perf: Add extended regs support for power10 platform
athira-rajeev Aug 7, 2020
327da00
powerpc: Add POWER10 raw mode cputable entry
maddy-kerneldev Aug 17, 2020
388692e
powerpc/kernel: Cleanup machine check function declarations
maddy-kerneldev Aug 17, 2020
1e4e4bc
powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled
kvaneesh Aug 17, 2020
fdc6edb
powerpc/fixmap: Fix the size of the early debug area
chleroy Aug 17, 2020
cf28f3b
bpf: Use get_file_rcu() instead of get_file() for task_file iterator
yonghong-song Aug 17, 2020
48d2f04
powerpc/kasan: Fix KASAN_SHADOW_START on BOOK3S_32
chleroy Aug 5, 2020
7bee31a
powerpc/32s: Fix is_module_segment() when MODULES_VADDR is defined
chleroy Aug 5, 2020
801980f
powerpc/pseries/hotplug-cpu: wait indefinitely for vCPU death
mdroth Aug 11, 2020
45bc609
EDAC/{i7core,sb,pnd2,skx}: Fix error event severity
aegl Jul 7, 2020
3fb1a96
libbpf: Fix build on ppc64le architecture
anakryiko Aug 18, 2020
8b61fba
macvlan: validate setting of multiple remote source MAC addresses
sipraga Aug 18, 2020
db06ea3
sfc: really check hash is valid before using it
ecree-solarflare Aug 18, 2020
9cbbc45
sfc: take correct lock in ef100_reset()
ecree-solarflare Aug 18, 2020
788f920
sfc: null out channel->rps_flow_id after freeing it
ecree-solarflare Aug 18, 2020
e6a4391
sfc: don't free_irq()s if they were never requested
ecree-solarflare Aug 18, 2020
ab97a28
Merge branch 'sfc-more-EF100-fixes'
davem330 Aug 18, 2020
3359564
cxgb4: Fix work request size calculation for loopback test
Aug 18, 2020
c650e04
cxgb4: Fix race between loopback and normal Tx path
Aug 18, 2020
5680790
Merge branch 'cxgb4-Fix-ethtool-selftest-flits-calculation'
davem330 Aug 18, 2020
989e4da
net: gianfar: Add of_node_put() before goto statement
Sylfrena Aug 18, 2020
eabe861
net: handle the return value of pskb_carve_frag_list() correctly
MiaoheLin Aug 15, 2020
0410d07
bonding: fix active-backup failover for current ARP slave
jiriwiesner Aug 16, 2020
4ef1a7c
ipv6: some fixes for ipv6_dev_find()
lxin Aug 17, 2020
840110a
ethtool: Fix preserving of wanted feature bits in netlink interface
Aug 17, 2020
2847bfe
ethtool: Account for hw_features in netlink interface
Aug 17, 2020
f01204e
ethtool: Don't omit the netlink reply if no features were changed
Aug 17, 2020
0df55a0
Merge branch 'ethtool-netlink-bug-fixes'
davem330 Aug 18, 2020
1734055
net: mscc: ocelot: remove duplicate "the the" phrase in Kconfig text
Aug 17, 2020
ad66411
net: ipv4: remove duplicate "the the" phrase in Kconfig text
Aug 17, 2020
e679654
bpf: Fix a rcu_sched stall issue with bpf task/task_file iterator
yonghong-song Aug 18, 2020
e60572b
bpf: Avoid visit same object multiple times
yonghong-song Aug 18, 2020
00fa1d8
bpftool: Handle EAGAIN error code properly in pids collection
yonghong-song Aug 18, 2020
63d4a4c
net: ena: Prevent reset after device destruction
ShayAgros Aug 19, 2020
8b147f6
net: ena: Change WARN_ON expression in ena_del_napi_in_range()
ShayAgros Aug 19, 2020
ccd143e
net: ena: Make missed_tx stat incremental
ShayAgros Aug 19, 2020
b4c8998
Merge branch 'Bug-fixes-for-ENA-ethernet-driver'
davem330 Aug 19, 2020
d1fb555
netlink: fix state reallocation in policy export
jmberg-intel Aug 19, 2020
957ff42
ptp: ptp_clockmatrix: use i2c_master_send for i2c write
Aug 18, 2020
9553b62
net: atlantic: Use readx_poll_timeout() for large timeout
Aug 18, 2020
cf96d97
net: gemini: Fix missing free_netdev() in error path of gemini_ethern…
Aug 19, 2020
e17a7c0
powerpc/powernv/pci: Fix possible crash when releasing DMA resources
fbarrat Aug 19, 2020
c8502eb
efi/x86: Mark kernel rodata non-executable for mixed mode
nivedita76 Jul 17, 2020
fb1201a
Documentation: efi: remove description of efi=old_map
ardbiesheuvel Aug 17, 2020
98086df
efi: add missed destroy_workqueue when efisubsys_init fails
Jul 20, 2020
1fd9717
efi/libstub: Stop parsing arguments at "--"
nivedita76 Jul 25, 2020
a37ca6a
efi/libstub: Handle NULL cmdline
nivedita76 Jul 29, 2020
8a8a323
efi/libstub: Handle unterminated cmdline
nivedita76 Aug 13, 2020
39ada88
efi/x86: Move 32-bit code into efi_32.c
ardbiesheuvel Aug 13, 2020
17899ea
powerpc/perf: Fix soft lockups due to missed interrupt accounting
athira-rajeev Aug 6, 2020
90a9b10
powerpc/pseries: Do not initiate shutdown when system is running on UPS
Aug 20, 2020
1e891e5
libbpf: Fix map index used in error message
tohojo Aug 19, 2020
fb73ed5
net: phy: mscc: Fix a couple of spelling mistakes "spcified" -> "spec…
Aug 20, 2020
3e659a8
sfc: fix build warnings on 32-bit
ecree-solarflare Aug 20, 2020
ce51f63
net/smc: Prevent kernel-infoleak in __smc_diag_dump()
peilin-ye Aug 20, 2020
51f6463
tools/resolve_btfids: Fix sections with wrong alignment
olsajiri Aug 19, 2020
5597432
selftests/bpf: Remove test_align leftovers
veruu Aug 19, 2020
c8a36f1
bpf: xdp: Fix XDP mode when no mode flags specified
anakryiko Aug 20, 2020
c210773
bpf: selftests: global_funcs: Check err_str before strstr
ykaliuta Aug 20, 2020
4d82054
hv_netvsc: Remove "unlikely" from netvsc_select_queue
haiyangz Aug 20, 2020
c3d897e
hv_netvsc: Fix the queue_mapping in netvsc_vf_xmit()
haiyangz Aug 20, 2020
e14fd8d
Merge branch 'hv_netvsc-Some-fixes-for-the-select_queue'
davem330 Aug 20, 2020
272502f
gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
Aug 19, 2020
41506bf
dt-bindings: net: renesas, ether: Improve schema validation
geertu Aug 19, 2020
ab921f3
net: sctp: Fix negotiation of the number of data streams.
david-laight Aug 19, 2020
eda814b
net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() e…
alaahl Aug 19, 2020
f6db909
tipc: call rcu_read_lock() in tipc_aead_encrypt_done()
lxin Aug 20, 2020
541cebb
powerpc/32s: Fix module loading failure when VMALLOC_END is over 0xf0…
chleroy Aug 21, 2020
64ef8f2
powerpc/perf/hv-24x7: Move cpumask file to top folder of hv-24x7 driver
kjain101 Aug 21, 2020
6a3ea3e
x86/entry/64: Do not use RDPID in paranoid entry to accomodate KVM
Aug 21, 2020
d88d59b
core/entry: Respect syscall number rewrites
KAGA-KOKO Aug 19, 2020
774d977
net: dsa: b53: check for timeout
Aug 21, 2020
b16fc09
bpf: Fix two typos in uapi/linux/bpf.h
tklauser Aug 21, 2020
4af7b32
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
davem330 Aug 21, 2020
eeaac36
net: nexthop: don't allow empty NHA_GROUP
Aug 22, 2020
a9ed4a6
epoll: Keep a reference on files added to the check list
Aug 19, 2020
52c4796
do_epoll_ctl(): clean the failure exits up a bit
Aug 22, 2020
f320ac6
Merge branch 'work.epoll' of git://git.kernel.org/pub/scm/linux/kerne…
torvalds Aug 23, 2020
9d045ed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
torvalds Aug 23, 2020
d9232cb
Merge tag 'edac_urgent_for_v5.9_rc2' of git://git.kernel.org/pub/scm/…
torvalds Aug 23, 2020
e99b250
Merge tag 'core-urgent-2020-08-23' of git://git.kernel.org/pub/scm/li…
torvalds Aug 23, 2020
10c091b
Merge tag 'efi-urgent-2020-08-23' of git://git.kernel.org/pub/scm/lin…
torvalds Aug 23, 2020
cea05c1
Merge tag 'perf-urgent-2020-08-23' of git://git.kernel.org/pub/scm/li…
torvalds Aug 23, 2020
550c212
Merge tag 'x86-urgent-2020-08-23' of git://git.kernel.org/pub/scm/lin…
torvalds Aug 23, 2020
cb95712
Merge tag 'powerpc-5.9-3' of git://git.kernel.org/pub/scm/linux/kerne…
torvalds Aug 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Description: read only
This sysfs interface exposes the number of cores per chip
present in the system.

What: /sys/devices/hv_24x7/interface/cpumask
What: /sys/devices/hv_24x7/cpumask
Date: July 2020
Contact: Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
Description: read only
Expand Down
5 changes: 1 addition & 4 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,7 @@
efi= [EFI]
Format: { "debug", "disable_early_pci_dma",
"nochunk", "noruntime", "nosoftreserve",
"novamap", "no_disable_early_pci_dma",
"old_map" }
"novamap", "no_disable_early_pci_dma" }
debug: enable misc debug output.
disable_early_pci_dma: disable the busmaster bit on all
PCI bridges while in the EFI boot stub.
Expand All @@ -1251,8 +1250,6 @@
novamap: do not call SetVirtualAddressMap().
no_disable_early_pci_dma: Leave the busmaster bit set
on all PCI bridges while in the EFI boot stub
old_map [X86-64]: switch to the old ioremap-based EFI
runtime services mapping. [Needs CONFIG_X86_UV=y]

efi_no_storage_paranoia [EFI; X86]
Using this parameter you can use more than 50% of
Expand Down
22 changes: 15 additions & 7 deletions Documentation/devicetree/bindings/net/renesas,ether.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ properties:
clocks:
maxItems: 1

pinctrl-0: true
power-domains:
maxItems: 1

resets:
maxItems: 1

pinctrl-names: true
phy-mode: true

phy-handle: true

renesas,no-ether-link:
type: boolean
Expand All @@ -74,6 +80,11 @@ properties:
specify when the Ether LINK signal is active-low instead of normal
active-high

patternProperties:
"^ethernet-phy@[0-9a-f]$":
type: object
$ref: ethernet-phy.yaml#

required:
- compatible
- reg
Expand All @@ -83,7 +94,8 @@ required:
- '#address-cells'
- '#size-cells'
- clocks
- pinctrl-0

additionalProperties: false

examples:
# Lager board
Expand All @@ -99,8 +111,6 @@ examples:
clocks = <&mstp8_clks R8A7790_CLK_ETHER>;
phy-mode = "rmii";
phy-handle = <&phy1>;
pinctrl-0 = <&ether_pins>;
pinctrl-names = "default";
renesas,ether-link-active-low;
#address-cells = <1>;
#size-cells = <0>;
Expand All @@ -109,7 +119,5 @@ examples:
reg = <1>;
interrupt-parent = <&irqc0>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <&phy1_pins>;
pinctrl-names = "default";
};
};
5 changes: 5 additions & 0 deletions arch/powerpc/include/asm/cputable.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

#ifndef __ASSEMBLY__

/*
* Added to include __machine_check_early_realmode_* functions
*/
#include <asm/mce.h>

/* This structure can grow, it's real size is used by head.S code
* via the mkdefs mechanism.
*/
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/fixmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum fixed_addresses {
FIX_HOLE,
/* reserve the top 128K for early debugging purposes */
FIX_EARLY_DEBUG_TOP = FIX_HOLE,
FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+(ALIGN(SZ_128, PAGE_SIZE)/PAGE_SIZE)-1,
FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+(ALIGN(SZ_128K, PAGE_SIZE)/PAGE_SIZE)-1,
#ifdef CONFIG_HIGHMEM
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
Expand Down
9 changes: 8 additions & 1 deletion arch/powerpc/include/asm/kasan.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@
#ifndef __ASSEMBLY__

#include <asm/page.h>
#include <linux/sizes.h>

#define KASAN_SHADOW_SCALE_SHIFT 3

#if defined(CONFIG_PPC_BOOK3S_32) && defined(CONFIG_MODULES) && defined(CONFIG_STRICT_KERNEL_RWX)
#define KASAN_KERN_START ALIGN_DOWN(PAGE_OFFSET - SZ_256M, SZ_256M)
#else
#define KASAN_KERN_START PAGE_OFFSET
#endif

#define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
(PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
(KASAN_KERN_START >> KASAN_SHADOW_SCALE_SHIFT))

#define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)

Expand Down
7 changes: 7 additions & 0 deletions arch/powerpc/include/asm/mce.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ struct mce_error_info {
#define MCE_EVENT_RELEASE true
#define MCE_EVENT_DONTRELEASE false

struct pt_regs;
struct notifier_block;

extern void save_mce_event(struct pt_regs *regs, long handled,
struct mce_error_info *mce_err, uint64_t nip,
uint64_t addr, uint64_t phys_addr);
Expand All @@ -225,5 +228,9 @@ int mce_register_notifier(struct notifier_block *nb);
int mce_unregister_notifier(struct notifier_block *nb);
#ifdef CONFIG_PPC_BOOK3S_64
void flush_and_reload_slb(void);
long __machine_check_early_realmode_p7(struct pt_regs *regs);
long __machine_check_early_realmode_p8(struct pt_regs *regs);
long __machine_check_early_realmode_p9(struct pt_regs *regs);
long __machine_check_early_realmode_p10(struct pt_regs *regs);
#endif /* CONFIG_PPC_BOOK3S_64 */
#endif /* __ASM_PPC64_MCE_H__ */
3 changes: 3 additions & 0 deletions arch/powerpc/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ static inline bool is_sier_available(void) { return false; }

/* To support perf_regs sier update */
extern bool is_sier_available(void);
/* To define perf extended regs mask value */
extern u64 PERF_REG_EXTENDED_MASK;
#define PERF_REG_EXTENDED_MASK PERF_REG_EXTENDED_MASK
#endif
5 changes: 5 additions & 0 deletions arch/powerpc/include/asm/perf_event_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ struct power_pmu {
int *blacklist_ev;
/* BHRB entries in the PMU */
int bhrb_nr;
/*
* set this flag with `PERF_PMU_CAP_EXTENDED_REGS` if
* the pmu supports extended perf regs capability
*/
int capabilities;
};

/*
Expand Down
20 changes: 19 additions & 1 deletion arch/powerpc/include/uapi/asm/perf_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ enum perf_event_powerpc_regs {
PERF_REG_POWERPC_DSISR,
PERF_REG_POWERPC_SIER,
PERF_REG_POWERPC_MMCRA,
PERF_REG_POWERPC_MAX,
/* Extended registers */
PERF_REG_POWERPC_MMCR0,
PERF_REG_POWERPC_MMCR1,
PERF_REG_POWERPC_MMCR2,
PERF_REG_POWERPC_MMCR3,
PERF_REG_POWERPC_SIER2,
PERF_REG_POWERPC_SIER3,
/* Max regs without the extended regs */
PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1,
};

#define PERF_REG_PMU_MASK ((1ULL << PERF_REG_POWERPC_MAX) - 1)

/* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300 */
#define PERF_REG_PMU_MASK_300 (((1ULL << (PERF_REG_POWERPC_MMCR2 + 1)) - 1) - PERF_REG_PMU_MASK)
/* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31 */
#define PERF_REG_PMU_MASK_31 (((1ULL << (PERF_REG_POWERPC_SIER3 + 1)) - 1) - PERF_REG_PMU_MASK)

#define PERF_REG_MAX_ISA_300 (PERF_REG_POWERPC_MMCR2 + 1)
#define PERF_REG_MAX_ISA_31 (PERF_REG_POWERPC_SIER3 + 1)
#endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
22 changes: 19 additions & 3 deletions arch/powerpc/kernel/cputable.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ extern void __setup_cpu_power9(unsigned long offset, struct cpu_spec* spec);
extern void __restore_cpu_power9(void);
extern void __setup_cpu_power10(unsigned long offset, struct cpu_spec* spec);
extern void __restore_cpu_power10(void);
extern long __machine_check_early_realmode_p7(struct pt_regs *regs);
extern long __machine_check_early_realmode_p8(struct pt_regs *regs);
extern long __machine_check_early_realmode_p9(struct pt_regs *regs);
#endif /* CONFIG_PPC64 */
#if defined(CONFIG_E500)
extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
Expand Down Expand Up @@ -542,6 +539,25 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check_early = __machine_check_early_realmode_p9,
.platform = "power9",
},
{ /* Power10 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x00800000,
.cpu_name = "POWER10 (raw)",
.cpu_features = CPU_FTRS_POWER10,
.cpu_user_features = COMMON_USER_POWER10,
.cpu_user_features2 = COMMON_USER2_POWER10,
.mmu_features = MMU_FTRS_POWER10,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 6,
.pmc_type = PPC_PMC_IBM,
.oprofile_cpu_type = "ppc64/power10",
.oprofile_type = PPC_OPROFILE_INVALID,
.cpu_setup = __setup_cpu_power10,
.cpu_restore = __restore_cpu_power10,
.machine_check_early = __machine_check_early_realmode_p10,
.platform = "power10",
},
{ /* Cell Broadband Engine */
.pvr_mask = 0xffff0000,
.pvr_value = 0x00700000,
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/kernel/dt_cpu_ftrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ struct dt_cpu_feature {
* Set up the base CPU
*/

extern long __machine_check_early_realmode_p8(struct pt_regs *regs);
extern long __machine_check_early_realmode_p9(struct pt_regs *regs);
extern long __machine_check_early_realmode_p10(struct pt_regs *regs);

static int hv_mode;

static struct {
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
min = pvr & 0xFF;
break;
case 0x004e: /* POWER9 bits 12-15 give chip type */
case 0x0080: /* POWER10 bit 12 gives SMT8/4 */
maj = (pvr >> 8) & 0x0F;
min = pvr & 0xFF;
break;
Expand Down
9 changes: 8 additions & 1 deletion arch/powerpc/mm/book3s32/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,17 @@ static bool is_module_segment(unsigned long addr)
{
if (!IS_ENABLED(CONFIG_MODULES))
return false;
#ifdef MODULES_VADDR
if (addr < ALIGN_DOWN(MODULES_VADDR, SZ_256M))
return false;
if (addr > ALIGN(MODULES_END, SZ_256M) - 1)
return false;
#else
if (addr < ALIGN_DOWN(VMALLOC_START, SZ_256M))
return false;
if (addr >= ALIGN(VMALLOC_END, SZ_256M))
if (addr > ALIGN(VMALLOC_END, SZ_256M) - 1)
return false;
#endif
return true;
}

Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/mm/book3s64/hash_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,10 @@ void hash__early_init_mmu_secondary(void)
&& cpu_has_feature(CPU_FTR_HVMODE))
tlbiel_all();

if (IS_ENABLED(CONFIG_PPC_MEM_KEYS) && mmu_has_feature(MMU_FTR_PKEY))
#ifdef CONFIG_PPC_MEM_KEYS
if (mmu_has_feature(MMU_FTR_PKEY))
mtspr(SPRN_UAMOR, default_uamor);
#endif
}
#endif /* CONFIG_SMP */

Expand Down
5 changes: 5 additions & 0 deletions arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -2141,6 +2141,10 @@ static void record_and_restart(struct perf_event *event, unsigned long val,

if (perf_event_overflow(event, &data, regs))
power_pmu_stop(event, 0);
} else if (period) {
/* Account for interrupt in case of invalid SIAR */
if (perf_event_account_interrupt(event))
power_pmu_stop(event, 0);
}
}

Expand Down Expand Up @@ -2323,6 +2327,7 @@ int register_power_pmu(struct power_pmu *pmu)
pmu->name);

power_pmu.attr_groups = ppmu->attr_groups;
power_pmu.capabilities |= (ppmu->capabilities & PERF_PMU_CAP_EXTENDED_REGS);

#ifdef MSR_HV
/*
Expand Down
11 changes: 10 additions & 1 deletion arch/powerpc/perf/hv-24x7.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,22 @@ static struct bin_attribute *if_bin_attrs[] = {
NULL,
};

static struct attribute *cpumask_attrs[] = {
&dev_attr_cpumask.attr,
NULL,
};

static struct attribute_group cpumask_attr_group = {
.attrs = cpumask_attrs,
};

static struct attribute *if_attrs[] = {
&dev_attr_catalog_len.attr,
&dev_attr_catalog_version.attr,
&dev_attr_domains.attr,
&dev_attr_sockets.attr,
&dev_attr_chipspersocket.attr,
&dev_attr_coresperchip.attr,
&dev_attr_cpumask.attr,
NULL,
};

Expand All @@ -1151,6 +1159,7 @@ static const struct attribute_group *attr_groups[] = {
&event_desc_group,
&event_long_desc_group,
&if_group,
&cpumask_attr_group,
NULL,
};

Expand Down
44 changes: 41 additions & 3 deletions arch/powerpc/perf/perf_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
#include <asm/ptrace.h>
#include <asm/perf_regs.h>

u64 PERF_REG_EXTENDED_MASK;

#define PT_REGS_OFFSET(id, r) [id] = offsetof(struct pt_regs, r)

#define REG_RESERVED (~((1ULL << PERF_REG_POWERPC_MAX) - 1))
#define REG_RESERVED (~(PERF_REG_EXTENDED_MASK | PERF_REG_PMU_MASK))

static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = {
PT_REGS_OFFSET(PERF_REG_POWERPC_R0, gpr[0]),
Expand Down Expand Up @@ -69,10 +71,36 @@ static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = {
PT_REGS_OFFSET(PERF_REG_POWERPC_MMCRA, dsisr),
};

/* Function to return the extended register values */
static u64 get_ext_regs_value(int idx)
{
switch (idx) {
case PERF_REG_POWERPC_MMCR0:
return mfspr(SPRN_MMCR0);
case PERF_REG_POWERPC_MMCR1:
return mfspr(SPRN_MMCR1);
case PERF_REG_POWERPC_MMCR2:
return mfspr(SPRN_MMCR2);
#ifdef CONFIG_PPC64
case PERF_REG_POWERPC_MMCR3:
return mfspr(SPRN_MMCR3);
case PERF_REG_POWERPC_SIER2:
return mfspr(SPRN_SIER2);
case PERF_REG_POWERPC_SIER3:
return mfspr(SPRN_SIER3);
#endif
default: return 0;
}
}

u64 perf_reg_value(struct pt_regs *regs, int idx)
{
if (WARN_ON_ONCE(idx >= PERF_REG_POWERPC_MAX))
return 0;
u64 perf_reg_extended_max = PERF_REG_POWERPC_MAX;

if (cpu_has_feature(CPU_FTR_ARCH_31))
perf_reg_extended_max = PERF_REG_MAX_ISA_31;
else if (cpu_has_feature(CPU_FTR_ARCH_300))
perf_reg_extended_max = PERF_REG_MAX_ISA_300;

if (idx == PERF_REG_POWERPC_SIER &&
(IS_ENABLED(CONFIG_FSL_EMB_PERF_EVENT) ||
Expand All @@ -85,6 +113,16 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
IS_ENABLED(CONFIG_PPC32)))
return 0;

if (idx >= PERF_REG_POWERPC_MAX && idx < perf_reg_extended_max)
return get_ext_regs_value(idx);

/*
* If the idx is referring to value beyond the
* supported registers, return 0 with a warning
*/
if (WARN_ON_ONCE(idx >= perf_reg_extended_max))
return 0;

return regs_get_register(regs, pt_regs_offset[idx]);
}

Expand Down
Loading