Skip to content

Commit e59a039

Browse files
committed
Merge tag 's390-6.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Alexander Gordeev: - ptep_modify_prot_start() may be called in a loop, which might lead to the preempt_count overflow due to the unnecessary preemption disabling. Do not disable preemption to prevent the overflow - Events of type PERF_TYPE_HARDWARE are not tested for sampling and return -EOPNOTSUPP eventually. Instead, deny all sampling events by CPUMF counter facility and return -ENOENT to allow other PMUs to be tried - The PAI PMU driver returns -EINVAL if an event out of its range. That aborts a search for an alternative PMU driver. Instead, return -ENOENT to allow other PMUs to be tried * tag 's390-6.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/cpum_cf: Deny all sampling events by counter PMU s390/pai: Deny all events not handled by this PMU s390/mm: Prevent possible preempt_count overflow
2 parents a1228f0 + ce97123 commit e59a039

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

arch/s390/kernel/perf_cpum_cf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,6 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
760760
break;
761761

762762
case PERF_TYPE_HARDWARE:
763-
if (is_sampling_event(event)) /* No sampling support */
764-
return -ENOENT;
765763
ev = attr->config;
766764
if (!attr->exclude_user && attr->exclude_kernel) {
767765
/*
@@ -859,6 +857,8 @@ static int cpumf_pmu_event_init(struct perf_event *event)
859857
unsigned int type = event->attr.type;
860858
int err = -ENOENT;
861859

860+
if (is_sampling_event(event)) /* No sampling support */
861+
return err;
862862
if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_RAW)
863863
err = __hw_perf_event_init(event, type);
864864
else if (event->pmu->type == type)

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ static int paicrypt_event_init(struct perf_event *event)
285285
/* PAI crypto PMU registered as PERF_TYPE_RAW, check event type */
286286
if (a->type != PERF_TYPE_RAW && event->pmu->type != a->type)
287287
return -ENOENT;
288-
/* PAI crypto event must be in valid range */
288+
/* PAI crypto event must be in valid range, try others if not */
289289
if (a->config < PAI_CRYPTO_BASE ||
290290
a->config > PAI_CRYPTO_BASE + paicrypt_cnt)
291-
return -EINVAL;
291+
return -ENOENT;
292292
/* Allow only CRYPTO_ALL for sampling */
293293
if (a->sample_period && a->config != PAI_CRYPTO_BASE)
294294
return -EINVAL;

arch/s390/kernel/perf_pai_ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int paiext_event_valid(struct perf_event *event)
265265
event->hw.config_base = offsetof(struct paiext_cb, acc);
266266
return 0;
267267
}
268-
return -EINVAL;
268+
return -ENOENT;
269269
}
270270

271271
/* Might be called on different CPU than the one the event is intended for. */

arch/s390/mm/pgtable.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ pte_t ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr,
335335
int nodat;
336336
struct mm_struct *mm = vma->vm_mm;
337337

338-
preempt_disable();
339338
pgste = ptep_xchg_start(mm, addr, ptep);
340339
nodat = !!(pgste_val(pgste) & _PGSTE_GPS_NODAT);
341340
old = ptep_flush_lazy(mm, addr, ptep, nodat);
@@ -360,7 +359,6 @@ void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr,
360359
} else {
361360
set_pte(ptep, pte);
362361
}
363-
preempt_enable();
364362
}
365363

366364
static inline void pmdp_idte_local(struct mm_struct *mm,

0 commit comments

Comments
 (0)