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

Merge tag 's390-4.20-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 updates from Martin Schwidefsky:

- Add two missing kfree calls on error paths in the vfio-ccw code

- Make sure that all data structures of a mediated vfio-ccw device are
initialized before registering it

- Fix a sparse warning in vfio-ccw

- A followup patch for the pgtable_bytes accounting, the page table
downgrade for compat processes missed a mm_dec_nr_pmds()

- Reject sampling requests in the PMU init function of the CPU
measurement counter facility

- With the vfio AP driver an AP queue needs to be reset on every device
probe as the alternative driver could have modified the device state

* tag 's390-4.20-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/mm: correct pgtable_bytes on page table downgrade
s390/zcrypt: reinit ap queue state machine during device probe
s390/cpum_cf: Reject request for sampling in event initialization
s390/cio: Fix cleanup when unsupported IDA format is used
s390/cio: Fix cleanup of pfn_array alloc failure
vfio: ccw: Register mediated device once all structures are initialized
s390/cio: make vfio_ccw_io_region static

+32 -14
+2
arch/s390/kernel/perf_cpum_cf.c
··· 346 346 break; 347 347 348 348 case PERF_TYPE_HARDWARE: 349 + if (is_sampling_event(event)) /* No sampling support */ 350 + return -ENOENT; 349 351 ev = attr->config; 350 352 /* Count user space (problem-state) only */ 351 353 if (!attr->exclude_user && attr->exclude_kernel) {
+1
arch/s390/mm/pgalloc.c
··· 131 131 } 132 132 133 133 pgd = mm->pgd; 134 + mm_dec_nr_pmds(mm); 134 135 mm->pgd = (pgd_t *) (pgd_val(*pgd) & _REGION_ENTRY_ORIGIN); 135 136 mm->context.asce_limit = _REGION3_SIZE; 136 137 mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
+4 -2
drivers/s390/cio/vfio_ccw_cp.c
··· 387 387 * orb specified one of the unsupported formats, we defer 388 388 * checking for IDAWs in unsupported formats to here. 389 389 */ 390 - if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw)) 390 + if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw)) { 391 + kfree(p); 391 392 return -EOPNOTSUPP; 393 + } 392 394 393 395 if ((!ccw_is_chain(ccw)) && (!ccw_is_tic(ccw))) 394 396 break; ··· 530 528 531 529 ret = pfn_array_alloc_pin(pat->pat_pa, cp->mdev, ccw->cda, ccw->count); 532 530 if (ret < 0) 533 - goto out_init; 531 + goto out_unpin; 534 532 535 533 /* Translate this direct ccw to a idal ccw. */ 536 534 idaws = kcalloc(ret, sizeof(*idaws), GFP_DMA | GFP_KERNEL);
+5 -5
drivers/s390/cio/vfio_ccw_drv.c
··· 22 22 #include "vfio_ccw_private.h" 23 23 24 24 struct workqueue_struct *vfio_ccw_work_q; 25 - struct kmem_cache *vfio_ccw_io_region; 25 + static struct kmem_cache *vfio_ccw_io_region; 26 26 27 27 /* 28 28 * Helpers ··· 134 134 if (ret) 135 135 goto out_free; 136 136 137 - ret = vfio_ccw_mdev_reg(sch); 138 - if (ret) 139 - goto out_disable; 140 - 141 137 INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo); 142 138 atomic_set(&private->avail, 1); 143 139 private->state = VFIO_CCW_STATE_STANDBY; 140 + 141 + ret = vfio_ccw_mdev_reg(sch); 142 + if (ret) 143 + goto out_disable; 144 144 145 145 return 0; 146 146
+4 -4
drivers/s390/crypto/ap_bus.c
··· 775 775 drvres = ap_drv->flags & AP_DRIVER_FLAG_DEFAULT; 776 776 if (!!devres != !!drvres) 777 777 return -ENODEV; 778 + /* (re-)init queue's state machine */ 779 + ap_queue_reinit_state(to_ap_queue(dev)); 778 780 } 779 781 780 782 /* Add queue/card to list of active queues/cards */ ··· 809 807 struct ap_device *ap_dev = to_ap_dev(dev); 810 808 struct ap_driver *ap_drv = ap_dev->drv; 811 809 810 + if (is_queue_dev(dev)) 811 + ap_queue_remove(to_ap_queue(dev)); 812 812 if (ap_drv->remove) 813 813 ap_drv->remove(ap_dev); 814 814 ··· 1448 1444 aq->ap_dev.device.parent = &ac->ap_dev.device; 1449 1445 dev_set_name(&aq->ap_dev.device, 1450 1446 "%02x.%04x", id, dom); 1451 - /* Start with a device reset */ 1452 - spin_lock_bh(&aq->lock); 1453 - ap_wait(ap_sm_event(aq, AP_EVENT_POLL)); 1454 - spin_unlock_bh(&aq->lock); 1455 1447 /* Register device */ 1456 1448 rc = device_register(&aq->ap_dev.device); 1457 1449 if (rc) {
+1
drivers/s390/crypto/ap_bus.h
··· 254 254 void ap_queue_remove(struct ap_queue *aq); 255 255 void ap_queue_suspend(struct ap_device *ap_dev); 256 256 void ap_queue_resume(struct ap_device *ap_dev); 257 + void ap_queue_reinit_state(struct ap_queue *aq); 257 258 258 259 struct ap_card *ap_card_create(int id, int queue_depth, int raw_device_type, 259 260 int comp_device_type, unsigned int functions);
+15
drivers/s390/crypto/ap_queue.c
··· 718 718 { 719 719 ap_flush_queue(aq); 720 720 del_timer_sync(&aq->timeout); 721 + 722 + /* reset with zero, also clears irq registration */ 723 + spin_lock_bh(&aq->lock); 724 + ap_zapq(aq->qid); 725 + aq->state = AP_STATE_BORKED; 726 + spin_unlock_bh(&aq->lock); 721 727 } 722 728 EXPORT_SYMBOL(ap_queue_remove); 729 + 730 + void ap_queue_reinit_state(struct ap_queue *aq) 731 + { 732 + spin_lock_bh(&aq->lock); 733 + aq->state = AP_STATE_RESET_START; 734 + ap_wait(ap_sm_event(aq, AP_EVENT_POLL)); 735 + spin_unlock_bh(&aq->lock); 736 + } 737 + EXPORT_SYMBOL(ap_queue_reinit_state);
-1
drivers/s390/crypto/zcrypt_cex2a.c
··· 196 196 struct ap_queue *aq = to_ap_queue(&ap_dev->device); 197 197 struct zcrypt_queue *zq = aq->private; 198 198 199 - ap_queue_remove(aq); 200 199 if (zq) 201 200 zcrypt_queue_unregister(zq); 202 201 }
-1
drivers/s390/crypto/zcrypt_cex2c.c
··· 251 251 struct ap_queue *aq = to_ap_queue(&ap_dev->device); 252 252 struct zcrypt_queue *zq = aq->private; 253 253 254 - ap_queue_remove(aq); 255 254 if (zq) 256 255 zcrypt_queue_unregister(zq); 257 256 }
-1
drivers/s390/crypto/zcrypt_cex4.c
··· 275 275 struct ap_queue *aq = to_ap_queue(&ap_dev->device); 276 276 struct zcrypt_queue *zq = aq->private; 277 277 278 - ap_queue_remove(aq); 279 278 if (zq) 280 279 zcrypt_queue_unregister(zq); 281 280 }