Pull arm64 fixes from Catalin Marinas: "arm64 and arm/perf fixes: - arm64 fix: debug exception unmasking on the CPU resume path - ARM PMU fixes: memory leak on error path and NULL pointer dereference" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1 drivers/perf: arm_pmu: Fix NULL pointer dereference during probe drivers/perf: arm_pmu: Fix leak in error path
Unified · Split
| @@ -100,7 +100,16 @@ ENTRY(cpu_do_resume) · 99 unmodified lines | |||
| 100 | 100 | ||
| 101 | msr tcr_el1, x8 | 101 | msr tcr_el1, x8 |
| 102 | msr vbar_el1, x9 | 102 | msr vbar_el1, x9 |
| 103 | |||
| 104 | /* | ||
| 105 | * __cpu_setup() cleared MDSCR_EL1.MDE and friends, before unmasking | ||
| 106 | * debug exceptions. By restoring MDSCR_EL1 here, we may take a debug | ||
| 107 | * exception. Mask them until local_dbg_restore() in cpu_suspend() | ||
| 108 | * resets them. | ||
| 109 | */ | ||
| 110 | disable_dbg | ||
| 103 | msr mdscr_el1, x10 | 111 | msr mdscr_el1, x10 |
| 112 | |||
| 104 | msr sctlr_el1, x12 | 113 | msr sctlr_el1, x12 |
| 105 | /* | 114 | /* |
| 106 | * Restore oslsr_el1 by writing oslar_el1 | 115 | * Restore oslsr_el1 by writing oslar_el1 |
| @@ -925,6 +925,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) · 924 unmodified lines | |||
| 925 | if (i > 0 && spi != using_spi) { | 925 | if (i > 0 && spi != using_spi) { |
| 926 | pr_err("PPI/SPI IRQ type mismatch for %s!\n", | 926 | pr_err("PPI/SPI IRQ type mismatch for %s!\n", |
| 927 | dn->name); | 927 | dn->name); |
| 928 | of_node_put(dn); | ||
| 928 | kfree(irqs); | 929 | kfree(irqs); |
| 929 | return -EINVAL; | 930 | return -EINVAL; |
| 930 | } | 931 | } |
| @@ -969,7 +970,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) · 38 unmodified lines | |||
| 969 | if (cpumask_weight(&pmu->supported_cpus) == 0) { | 970 | if (cpumask_weight(&pmu->supported_cpus) == 0) { |
| 970 | int irq = platform_get_irq(pdev, 0); | 971 | int irq = platform_get_irq(pdev, 0); |
| 971 | 972 | ||
| 972 | if (irq_is_percpu(irq)) { | 973 | if (irq >= 0 && irq_is_percpu(irq)) { |
| 973 | /* If using PPIs, check the affinity of the partition */ | 974 | /* If using PPIs, check the affinity of the partition */ |
| 974 | int ret; | 975 | int ret; |
| 975 | 976 | ||