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

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

Pull s390 fixes from Heiko Carstens:

- Fix PCI error recovery by handling error events correctly

- Fix CCA crypto card behavior within protected execution environment

- Two KVM commits which fix virtual vs physical address handling bugs
in KVM pfault handling

- Fix return code handling in pckmo_key2protkey()

- Deactivate sclp console as late as possible so that outstanding
messages appear on the console instead of being dropped on reboot

- Convert newlines to CRLF instead of LFCR for the sclp vt220 driver,
as required by the vt220 specification

- Initialize also psw mask in perf_arch_fetch_caller_regs() to make
sure that user_mode(regs) will return false

- Update defconfigs

* tag 's390-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390: Update defconfigs
s390: Initialize psw mask in perf_arch_fetch_caller_regs()
s390/sclp_vt220: Convert newlines to CRLF instead of LFCR
s390/sclp: Deactivate sclp after all its users
s390/pkey_pckmo: Return with success for valid protected key types
KVM: s390: Change virtual to physical address access in diag 0x258 handler
KVM: s390: gaccess: Check if guest address is in memslot
s390/ap: Fix CCA crypto card behavior within protected execution environment
s390/pci: Handle PCI error codes other than 0x3a

+74 -33
+11 -2
arch/s390/configs/debug_defconfig
··· 50 50 CONFIG_HZ_100=y 51 51 CONFIG_CERT_STORE=y 52 52 CONFIG_EXPOLINE=y 53 - # CONFIG_EXPOLINE_EXTERN is not set 54 53 CONFIG_EXPOLINE_AUTO=y 55 54 CONFIG_CHSC_SCH=y 56 55 CONFIG_VFIO_CCW=m ··· 94 95 CONFIG_ZSWAP=y 95 96 CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y 96 97 CONFIG_ZSMALLOC_STAT=y 98 + CONFIG_SLAB_BUCKETS=y 97 99 CONFIG_SLUB_STATS=y 98 100 # CONFIG_COMPAT_BRK is not set 99 101 CONFIG_MEMORY_HOTPLUG=y ··· 426 426 # CONFIG_FW_LOADER is not set 427 427 CONFIG_CONNECTOR=y 428 428 CONFIG_ZRAM=y 429 + CONFIG_ZRAM_BACKEND_LZ4=y 430 + CONFIG_ZRAM_BACKEND_LZ4HC=y 431 + CONFIG_ZRAM_BACKEND_ZSTD=y 432 + CONFIG_ZRAM_BACKEND_DEFLATE=y 433 + CONFIG_ZRAM_BACKEND_842=y 434 + CONFIG_ZRAM_BACKEND_LZO=y 435 + CONFIG_ZRAM_DEF_COMP_DEFLATE=y 429 436 CONFIG_BLK_DEV_LOOP=m 430 437 CONFIG_BLK_DEV_DRBD=m 431 438 CONFIG_BLK_DEV_NBD=m ··· 493 486 CONFIG_DM_FLAKEY=m 494 487 CONFIG_DM_VERITY=m 495 488 CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y 489 + CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=y 496 490 CONFIG_DM_SWITCH=m 497 491 CONFIG_DM_INTEGRITY=m 498 492 CONFIG_DM_VDO=m ··· 543 535 CONFIG_MLX4_EN=m 544 536 CONFIG_MLX5_CORE=m 545 537 CONFIG_MLX5_CORE_EN=y 538 + # CONFIG_NET_VENDOR_META is not set 546 539 # CONFIG_NET_VENDOR_MICREL is not set 547 540 # CONFIG_NET_VENDOR_MICROCHIP is not set 548 541 # CONFIG_NET_VENDOR_MICROSEMI is not set ··· 704 695 CONFIG_NFSD_V3_ACL=y 705 696 CONFIG_NFSD_V4=y 706 697 CONFIG_NFSD_V4_SECURITY_LABEL=y 698 + # CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set 707 699 CONFIG_CIFS=m 708 700 CONFIG_CIFS_UPCALL=y 709 701 CONFIG_CIFS_XATTR=y ··· 750 740 CONFIG_CRYPTO_ECDH=m 751 741 CONFIG_CRYPTO_ECDSA=m 752 742 CONFIG_CRYPTO_ECRDSA=m 753 - CONFIG_CRYPTO_SM2=m 754 743 CONFIG_CRYPTO_CURVE25519=m 755 744 CONFIG_CRYPTO_AES_TI=m 756 745 CONFIG_CRYPTO_ANUBIS=m
+12 -2
arch/s390/configs/defconfig
··· 48 48 CONFIG_HZ_100=y 49 49 CONFIG_CERT_STORE=y 50 50 CONFIG_EXPOLINE=y 51 - # CONFIG_EXPOLINE_EXTERN is not set 52 51 CONFIG_EXPOLINE_AUTO=y 53 52 CONFIG_CHSC_SCH=y 54 53 CONFIG_VFIO_CCW=m ··· 88 89 CONFIG_ZSWAP=y 89 90 CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y 90 91 CONFIG_ZSMALLOC_STAT=y 92 + CONFIG_SLAB_BUCKETS=y 91 93 # CONFIG_COMPAT_BRK is not set 92 94 CONFIG_MEMORY_HOTPLUG=y 93 95 CONFIG_MEMORY_HOTREMOVE=y ··· 416 416 # CONFIG_FW_LOADER is not set 417 417 CONFIG_CONNECTOR=y 418 418 CONFIG_ZRAM=y 419 + CONFIG_ZRAM_BACKEND_LZ4=y 420 + CONFIG_ZRAM_BACKEND_LZ4HC=y 421 + CONFIG_ZRAM_BACKEND_ZSTD=y 422 + CONFIG_ZRAM_BACKEND_DEFLATE=y 423 + CONFIG_ZRAM_BACKEND_842=y 424 + CONFIG_ZRAM_BACKEND_LZO=y 425 + CONFIG_ZRAM_DEF_COMP_DEFLATE=y 419 426 CONFIG_BLK_DEV_LOOP=m 420 427 CONFIG_BLK_DEV_DRBD=m 421 428 CONFIG_BLK_DEV_NBD=m ··· 483 476 CONFIG_DM_FLAKEY=m 484 477 CONFIG_DM_VERITY=m 485 478 CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y 479 + CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=y 486 480 CONFIG_DM_SWITCH=m 487 481 CONFIG_DM_INTEGRITY=m 488 482 CONFIG_DM_VDO=m ··· 533 525 CONFIG_MLX4_EN=m 534 526 CONFIG_MLX5_CORE=m 535 527 CONFIG_MLX5_CORE_EN=y 528 + # CONFIG_NET_VENDOR_META is not set 536 529 # CONFIG_NET_VENDOR_MICREL is not set 537 530 # CONFIG_NET_VENDOR_MICROCHIP is not set 538 531 # CONFIG_NET_VENDOR_MICROSEMI is not set ··· 691 682 CONFIG_NFSD_V3_ACL=y 692 683 CONFIG_NFSD_V4=y 693 684 CONFIG_NFSD_V4_SECURITY_LABEL=y 685 + # CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set 694 686 CONFIG_CIFS=m 695 687 CONFIG_CIFS_UPCALL=y 696 688 CONFIG_CIFS_XATTR=y ··· 736 726 CONFIG_CRYPTO_ECDH=m 737 727 CONFIG_CRYPTO_ECDSA=m 738 728 CONFIG_CRYPTO_ECRDSA=m 739 - CONFIG_CRYPTO_SM2=m 740 729 CONFIG_CRYPTO_CURVE25519=m 741 730 CONFIG_CRYPTO_AES_TI=m 742 731 CONFIG_CRYPTO_ANUBIS=m ··· 776 767 CONFIG_CRYPTO_LZ4HC=m 777 768 CONFIG_CRYPTO_ZSTD=m 778 769 CONFIG_CRYPTO_ANSI_CPRNG=m 770 + CONFIG_CRYPTO_JITTERENTROPY_OSR=1 779 771 CONFIG_CRYPTO_USER_API_HASH=m 780 772 CONFIG_CRYPTO_USER_API_SKCIPHER=m 781 773 CONFIG_CRYPTO_USER_API_RNG=m
+1
arch/s390/configs/zfcpdump_defconfig
··· 49 49 # CONFIG_HVC_IUCV is not set 50 50 # CONFIG_HW_RANDOM_S390 is not set 51 51 # CONFIG_HMC_DRV is not set 52 + # CONFIG_S390_UV_UAPI is not set 52 53 # CONFIG_S390_TAPE is not set 53 54 # CONFIG_VMCP is not set 54 55 # CONFIG_MONWRITER is not set
+1
arch/s390/include/asm/perf_event.h
··· 49 49 }; 50 50 51 51 #define perf_arch_fetch_caller_regs(regs, __ip) do { \ 52 + (regs)->psw.mask = 0; \ 52 53 (regs)->psw.addr = (__ip); \ 53 54 (regs)->gprs[15] = (unsigned long)__builtin_frame_address(0) - \ 54 55 offsetof(struct stack_frame, back_chain); \
+1 -1
arch/s390/kvm/diag.c
··· 77 77 vcpu->stat.instruction_diagnose_258++; 78 78 if (vcpu->run->s.regs.gprs[rx] & 7) 79 79 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); 80 - rc = read_guest(vcpu, vcpu->run->s.regs.gprs[rx], rx, &parm, sizeof(parm)); 80 + rc = read_guest_real(vcpu, vcpu->run->s.regs.gprs[rx], &parm, sizeof(parm)); 81 81 if (rc) 82 82 return kvm_s390_inject_prog_cond(vcpu, rc); 83 83 if (parm.parm_version != 2 || parm.parm_len < 5 || parm.code != 0x258)
+4
arch/s390/kvm/gaccess.c
··· 828 828 const gfn_t gfn = gpa_to_gfn(gpa); 829 829 int rc; 830 830 831 + if (!gfn_to_memslot(kvm, gfn)) 832 + return PGM_ADDRESSING; 831 833 if (mode == GACC_STORE) 832 834 rc = kvm_write_guest_page(kvm, gfn, data, offset, len); 833 835 else ··· 987 985 gra += fragment_len; 988 986 data += fragment_len; 989 987 } 988 + if (rc > 0) 989 + vcpu->arch.pgm.code = rc; 990 990 return rc; 991 991 } 992 992
+8 -6
arch/s390/kvm/gaccess.h
··· 405 405 * @len: number of bytes to copy 406 406 * 407 407 * Copy @len bytes from @data (kernel space) to @gra (guest real address). 408 - * It is up to the caller to ensure that the entire guest memory range is 409 - * valid memory before calling this function. 410 408 * Guest low address and key protection are not checked. 411 409 * 412 - * Returns zero on success or -EFAULT on error. 410 + * Returns zero on success, -EFAULT when copying from @data failed, or 411 + * PGM_ADRESSING in case @gra is outside a memslot. In this case, pgm check info 412 + * is also stored to allow injecting into the guest (if applicable) using 413 + * kvm_s390_inject_prog_cond(). 413 414 * 414 415 * If an error occurs data may have been copied partially to guest memory. 415 416 */ ··· 429 428 * @len: number of bytes to copy 430 429 * 431 430 * Copy @len bytes from @gra (guest real address) to @data (kernel space). 432 - * It is up to the caller to ensure that the entire guest memory range is 433 - * valid memory before calling this function. 434 431 * Guest key protection is not checked. 435 432 * 436 - * Returns zero on success or -EFAULT on error. 433 + * Returns zero on success, -EFAULT when copying to @data failed, or 434 + * PGM_ADRESSING in case @gra is outside a memslot. In this case, pgm check info 435 + * is also stored to allow injecting into the guest (if applicable) using 436 + * kvm_s390_inject_prog_cond(). 437 437 * 438 438 * If an error occurs data may have been copied partially to kernel space. 439 439 */
+9 -8
arch/s390/pci/pci_event.c
··· 280 280 goto no_pdev; 281 281 282 282 switch (ccdf->pec) { 283 - case 0x003a: /* Service Action or Error Recovery Successful */ 283 + case 0x002a: /* Error event concerns FMB */ 284 + case 0x002b: 285 + case 0x002c: 286 + break; 287 + case 0x0040: /* Service Action or Error Recovery Failed */ 288 + case 0x003b: 289 + zpci_event_io_failure(pdev, pci_channel_io_perm_failure); 290 + break; 291 + default: /* PCI function left in the error state attempt to recover */ 284 292 ers_res = zpci_event_attempt_error_recovery(pdev); 285 293 if (ers_res != PCI_ERS_RESULT_RECOVERED) 286 294 zpci_event_io_failure(pdev, pci_channel_io_perm_failure); 287 - break; 288 - default: 289 - /* 290 - * Mark as frozen not permanently failed because the device 291 - * could be subsequently recovered by the platform. 292 - */ 293 - zpci_event_io_failure(pdev, pci_channel_io_frozen); 294 295 break; 295 296 } 296 297 pci_dev_put(pdev);
+2 -1
drivers/s390/char/sclp.c
··· 1195 1195 } 1196 1196 1197 1197 static struct notifier_block sclp_reboot_notifier = { 1198 - .notifier_call = sclp_reboot_event 1198 + .notifier_call = sclp_reboot_event, 1199 + .priority = INT_MIN, 1199 1200 }; 1200 1201 1201 1202 static ssize_t con_pages_show(struct device_driver *dev, char *buf)
+2 -2
drivers/s390/char/sclp_vt220.c
··· 319 319 buffer = (void *) ((addr_t) sccb + sccb->header.length); 320 320 321 321 if (convertlf) { 322 - /* Perform Linefeed conversion (0x0a -> 0x0a 0x0d)*/ 322 + /* Perform Linefeed conversion (0x0a -> 0x0d 0x0a)*/ 323 323 for (from=0, to=0; 324 324 (from < count) && (to < sclp_vt220_space_left(request)); 325 325 from++) { ··· 328 328 /* Perform conversion */ 329 329 if (c == 0x0a) { 330 330 if (to + 1 < sclp_vt220_space_left(request)) { 331 - ((unsigned char *) buffer)[to++] = c; 332 331 ((unsigned char *) buffer)[to++] = 0x0d; 332 + ((unsigned char *) buffer)[to++] = c; 333 333 } else 334 334 break; 335 335
+1 -2
drivers/s390/crypto/ap_bus.c
··· 1864 1864 } 1865 1865 /* if no queue device exists, create a new one */ 1866 1866 if (!aq) { 1867 - aq = ap_queue_create(qid, ac->ap_dev.device_type); 1867 + aq = ap_queue_create(qid, ac); 1868 1868 if (!aq) { 1869 1869 AP_DBF_WARN("%s(%d,%d) ap_queue_create() failed\n", 1870 1870 __func__, ac->id, dom); 1871 1871 continue; 1872 1872 } 1873 - aq->card = ac; 1874 1873 aq->config = !decfg; 1875 1874 aq->chkstop = chkstop; 1876 1875 aq->se_bstate = hwinfo.bs;
+1 -1
drivers/s390/crypto/ap_bus.h
··· 272 272 int ap_test_config_ctrl_domain(unsigned int domain); 273 273 274 274 void ap_queue_init_reply(struct ap_queue *aq, struct ap_message *ap_msg); 275 - struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type); 275 + struct ap_queue *ap_queue_create(ap_qid_t qid, struct ap_card *ac); 276 276 void ap_queue_prepare_remove(struct ap_queue *aq); 277 277 void ap_queue_remove(struct ap_queue *aq); 278 278 void ap_queue_init_state(struct ap_queue *aq);
+20 -8
drivers/s390/crypto/ap_queue.c
··· 22 22 * some AP queue helper functions 23 23 */ 24 24 25 + static inline bool ap_q_supported_in_se(struct ap_queue *aq) 26 + { 27 + return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; 28 + } 29 + 25 30 static inline bool ap_q_supports_bind(struct ap_queue *aq) 26 31 { 27 32 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; ··· 1109 1104 kfree(aq); 1110 1105 } 1111 1106 1112 - struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type) 1107 + struct ap_queue *ap_queue_create(ap_qid_t qid, struct ap_card *ac) 1113 1108 { 1114 1109 struct ap_queue *aq; 1115 1110 1116 1111 aq = kzalloc(sizeof(*aq), GFP_KERNEL); 1117 1112 if (!aq) 1118 1113 return NULL; 1114 + aq->card = ac; 1119 1115 aq->ap_dev.device.release = ap_queue_device_release; 1120 1116 aq->ap_dev.device.type = &ap_queue_type; 1121 - aq->ap_dev.device_type = device_type; 1122 - // add optional SE secure binding attributes group 1123 - if (ap_sb_available() && is_prot_virt_guest()) 1117 + aq->ap_dev.device_type = ac->ap_dev.device_type; 1118 + /* in SE environment add bind/associate attributes group */ 1119 + if (ap_is_se_guest() && ap_q_supported_in_se(aq)) 1124 1120 aq->ap_dev.device.groups = ap_queue_dev_sb_attr_groups; 1125 1121 aq->qid = qid; 1126 1122 spin_lock_init(&aq->lock); ··· 1202 1196 } 1203 1197 1204 1198 /* SE guest's queues additionally need to be bound */ 1205 - if (ap_q_needs_bind(aq) && 1206 - !(aq->se_bstate == AP_BS_Q_USABLE || 1207 - aq->se_bstate == AP_BS_Q_USABLE_NO_SECURE_KEY)) 1208 - rc = false; 1199 + if (ap_is_se_guest()) { 1200 + if (!ap_q_supported_in_se(aq)) { 1201 + rc = false; 1202 + goto unlock_and_out; 1203 + } 1204 + if (ap_q_needs_bind(aq) && 1205 + !(aq->se_bstate == AP_BS_Q_USABLE || 1206 + aq->se_bstate == AP_BS_Q_USABLE_NO_SECURE_KEY)) 1207 + rc = false; 1208 + } 1209 1209 1210 1210 unlock_and_out: 1211 1211 spin_unlock_bh(&aq->lock);
+1
drivers/s390/crypto/pkey_pckmo.c
··· 324 324 memcpy(protkey, t->protkey, t->len); 325 325 *protkeylen = t->len; 326 326 *protkeytype = t->keytype; 327 + rc = 0; 327 328 break; 328 329 } 329 330 case TOKVER_CLEAR_KEY: {