Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+5 -7
+2 -2
arch/s390/kernel/perf_cpum_cf.c
··· 760 760 break; 761 761 762 762 case PERF_TYPE_HARDWARE: 763 - if (is_sampling_event(event)) /* No sampling support */ 764 - return -ENOENT; 765 763 ev = attr->config; 766 764 if (!attr->exclude_user && attr->exclude_kernel) { 767 765 /* ··· 857 859 unsigned int type = event->attr.type; 858 860 int err = -ENOENT; 859 861 862 + if (is_sampling_event(event)) /* No sampling support */ 863 + return err; 860 864 if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_RAW) 861 865 err = __hw_perf_event_init(event, type); 862 866 else if (event->pmu->type == type)
+2 -2
arch/s390/kernel/perf_pai_crypto.c
··· 285 285 /* PAI crypto PMU registered as PERF_TYPE_RAW, check event type */ 286 286 if (a->type != PERF_TYPE_RAW && event->pmu->type != a->type) 287 287 return -ENOENT; 288 - /* PAI crypto event must be in valid range */ 288 + /* PAI crypto event must be in valid range, try others if not */ 289 289 if (a->config < PAI_CRYPTO_BASE || 290 290 a->config > PAI_CRYPTO_BASE + paicrypt_cnt) 291 - return -EINVAL; 291 + return -ENOENT; 292 292 /* Allow only CRYPTO_ALL for sampling */ 293 293 if (a->sample_period && a->config != PAI_CRYPTO_BASE) 294 294 return -EINVAL;
+1 -1
arch/s390/kernel/perf_pai_ext.c
··· 265 265 event->hw.config_base = offsetof(struct paiext_cb, acc); 266 266 return 0; 267 267 } 268 - return -EINVAL; 268 + return -ENOENT; 269 269 } 270 270 271 271 /* Might be called on different CPU than the one the event is intended for. */
-2
arch/s390/mm/pgtable.c
··· 335 335 int nodat; 336 336 struct mm_struct *mm = vma->vm_mm; 337 337 338 - preempt_disable(); 339 338 pgste = ptep_xchg_start(mm, addr, ptep); 340 339 nodat = !!(pgste_val(pgste) & _PGSTE_GPS_NODAT); 341 340 old = ptep_flush_lazy(mm, addr, ptep, nodat); ··· 359 360 } else { 360 361 set_pte(ptep, pte); 361 362 } 362 - preempt_enable(); 363 363 } 364 364 365 365 static inline void pmdp_idte_local(struct mm_struct *mm,