Skip to content

Commit c91c146

Browse files
committed
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
2 parents ade8ff3 + b4fa00f commit c91c146

File tree

14 files changed

+74
-33
lines changed

14 files changed

+74
-33
lines changed

arch/s390/configs/debug_defconfig

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ CONFIG_NUMA=y
5050
CONFIG_HZ_100=y
5151
CONFIG_CERT_STORE=y
5252
CONFIG_EXPOLINE=y
53-
# CONFIG_EXPOLINE_EXTERN is not set
5453
CONFIG_EXPOLINE_AUTO=y
5554
CONFIG_CHSC_SCH=y
5655
CONFIG_VFIO_CCW=m
@@ -95,6 +94,7 @@ CONFIG_BINFMT_MISC=m
9594
CONFIG_ZSWAP=y
9695
CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y
9796
CONFIG_ZSMALLOC_STAT=y
97+
CONFIG_SLAB_BUCKETS=y
9898
CONFIG_SLUB_STATS=y
9999
# CONFIG_COMPAT_BRK is not set
100100
CONFIG_MEMORY_HOTPLUG=y
@@ -426,6 +426,13 @@ CONFIG_DEVTMPFS_SAFE=y
426426
# CONFIG_FW_LOADER is not set
427427
CONFIG_CONNECTOR=y
428428
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
429436
CONFIG_BLK_DEV_LOOP=m
430437
CONFIG_BLK_DEV_DRBD=m
431438
CONFIG_BLK_DEV_NBD=m
@@ -486,6 +493,7 @@ CONFIG_DM_UEVENT=y
486493
CONFIG_DM_FLAKEY=m
487494
CONFIG_DM_VERITY=m
488495
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
496+
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=y
489497
CONFIG_DM_SWITCH=m
490498
CONFIG_DM_INTEGRITY=m
491499
CONFIG_DM_VDO=m
@@ -535,6 +543,7 @@ CONFIG_NLMON=m
535543
CONFIG_MLX4_EN=m
536544
CONFIG_MLX5_CORE=m
537545
CONFIG_MLX5_CORE_EN=y
546+
# CONFIG_NET_VENDOR_META is not set
538547
# CONFIG_NET_VENDOR_MICREL is not set
539548
# CONFIG_NET_VENDOR_MICROCHIP is not set
540549
# CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -695,6 +704,7 @@ CONFIG_NFSD=m
695704
CONFIG_NFSD_V3_ACL=y
696705
CONFIG_NFSD_V4=y
697706
CONFIG_NFSD_V4_SECURITY_LABEL=y
707+
# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
698708
CONFIG_CIFS=m
699709
CONFIG_CIFS_UPCALL=y
700710
CONFIG_CIFS_XATTR=y
@@ -740,7 +750,6 @@ CONFIG_CRYPTO_DH=m
740750
CONFIG_CRYPTO_ECDH=m
741751
CONFIG_CRYPTO_ECDSA=m
742752
CONFIG_CRYPTO_ECRDSA=m
743-
CONFIG_CRYPTO_SM2=m
744753
CONFIG_CRYPTO_CURVE25519=m
745754
CONFIG_CRYPTO_AES_TI=m
746755
CONFIG_CRYPTO_ANUBIS=m

arch/s390/configs/defconfig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ CONFIG_NUMA=y
4848
CONFIG_HZ_100=y
4949
CONFIG_CERT_STORE=y
5050
CONFIG_EXPOLINE=y
51-
# CONFIG_EXPOLINE_EXTERN is not set
5251
CONFIG_EXPOLINE_AUTO=y
5352
CONFIG_CHSC_SCH=y
5453
CONFIG_VFIO_CCW=m
@@ -89,6 +88,7 @@ CONFIG_BINFMT_MISC=m
8988
CONFIG_ZSWAP=y
9089
CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y
9190
CONFIG_ZSMALLOC_STAT=y
91+
CONFIG_SLAB_BUCKETS=y
9292
# CONFIG_COMPAT_BRK is not set
9393
CONFIG_MEMORY_HOTPLUG=y
9494
CONFIG_MEMORY_HOTREMOVE=y
@@ -416,6 +416,13 @@ CONFIG_DEVTMPFS_SAFE=y
416416
# CONFIG_FW_LOADER is not set
417417
CONFIG_CONNECTOR=y
418418
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
419426
CONFIG_BLK_DEV_LOOP=m
420427
CONFIG_BLK_DEV_DRBD=m
421428
CONFIG_BLK_DEV_NBD=m
@@ -476,6 +483,7 @@ CONFIG_DM_UEVENT=y
476483
CONFIG_DM_FLAKEY=m
477484
CONFIG_DM_VERITY=m
478485
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
486+
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING=y
479487
CONFIG_DM_SWITCH=m
480488
CONFIG_DM_INTEGRITY=m
481489
CONFIG_DM_VDO=m
@@ -525,6 +533,7 @@ CONFIG_NLMON=m
525533
CONFIG_MLX4_EN=m
526534
CONFIG_MLX5_CORE=m
527535
CONFIG_MLX5_CORE_EN=y
536+
# CONFIG_NET_VENDOR_META is not set
528537
# CONFIG_NET_VENDOR_MICREL is not set
529538
# CONFIG_NET_VENDOR_MICROCHIP is not set
530539
# CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -682,6 +691,7 @@ CONFIG_NFSD=m
682691
CONFIG_NFSD_V3_ACL=y
683692
CONFIG_NFSD_V4=y
684693
CONFIG_NFSD_V4_SECURITY_LABEL=y
694+
# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set
685695
CONFIG_CIFS=m
686696
CONFIG_CIFS_UPCALL=y
687697
CONFIG_CIFS_XATTR=y
@@ -726,7 +736,6 @@ CONFIG_CRYPTO_DH=m
726736
CONFIG_CRYPTO_ECDH=m
727737
CONFIG_CRYPTO_ECDSA=m
728738
CONFIG_CRYPTO_ECRDSA=m
729-
CONFIG_CRYPTO_SM2=m
730739
CONFIG_CRYPTO_CURVE25519=m
731740
CONFIG_CRYPTO_AES_TI=m
732741
CONFIG_CRYPTO_ANUBIS=m
@@ -767,6 +776,7 @@ CONFIG_CRYPTO_LZ4=m
767776
CONFIG_CRYPTO_LZ4HC=m
768777
CONFIG_CRYPTO_ZSTD=m
769778
CONFIG_CRYPTO_ANSI_CPRNG=m
779+
CONFIG_CRYPTO_JITTERENTROPY_OSR=1
770780
CONFIG_CRYPTO_USER_API_HASH=m
771781
CONFIG_CRYPTO_USER_API_SKCIPHER=m
772782
CONFIG_CRYPTO_USER_API_RNG=m

arch/s390/configs/zfcpdump_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ CONFIG_ZFCP=y
4949
# CONFIG_HVC_IUCV is not set
5050
# CONFIG_HW_RANDOM_S390 is not set
5151
# CONFIG_HMC_DRV is not set
52+
# CONFIG_S390_UV_UAPI is not set
5253
# CONFIG_S390_TAPE is not set
5354
# CONFIG_VMCP is not set
5455
# CONFIG_MONWRITER is not set

arch/s390/include/asm/perf_event.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct perf_sf_sde_regs {
4949
};
5050

5151
#define perf_arch_fetch_caller_regs(regs, __ip) do { \
52+
(regs)->psw.mask = 0; \
5253
(regs)->psw.addr = (__ip); \
5354
(regs)->gprs[15] = (unsigned long)__builtin_frame_address(0) - \
5455
offsetof(struct stack_frame, back_chain); \

arch/s390/kvm/diag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int __diag_page_ref_service(struct kvm_vcpu *vcpu)
7777
vcpu->stat.instruction_diagnose_258++;
7878
if (vcpu->run->s.regs.gprs[rx] & 7)
7979
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));
8181
if (rc)
8282
return kvm_s390_inject_prog_cond(vcpu, rc);
8383
if (parm.parm_version != 2 || parm.parm_len < 5 || parm.code != 0x258)

arch/s390/kvm/gaccess.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,8 @@ static int access_guest_page(struct kvm *kvm, enum gacc_mode mode, gpa_t gpa,
828828
const gfn_t gfn = gpa_to_gfn(gpa);
829829
int rc;
830830

831+
if (!gfn_to_memslot(kvm, gfn))
832+
return PGM_ADDRESSING;
831833
if (mode == GACC_STORE)
832834
rc = kvm_write_guest_page(kvm, gfn, data, offset, len);
833835
else
@@ -985,6 +987,8 @@ int access_guest_real(struct kvm_vcpu *vcpu, unsigned long gra,
985987
gra += fragment_len;
986988
data += fragment_len;
987989
}
990+
if (rc > 0)
991+
vcpu->arch.pgm.code = rc;
988992
return rc;
989993
}
990994

arch/s390/kvm/gaccess.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,12 @@ int read_guest_abs(struct kvm_vcpu *vcpu, unsigned long gpa, void *data,
405405
* @len: number of bytes to copy
406406
*
407407
* 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.
410408
* Guest low address and key protection are not checked.
411409
*
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().
413414
*
414415
* If an error occurs data may have been copied partially to guest memory.
415416
*/
@@ -428,11 +429,12 @@ int write_guest_real(struct kvm_vcpu *vcpu, unsigned long gra, void *data,
428429
* @len: number of bytes to copy
429430
*
430431
* Copy @len bytes from @gra (guest real address) to @data (kernel space).
431-
* It is up to the caller to ensure that the entire guest memory range is
432-
* valid memory before calling this function.
433432
* Guest key protection is not checked.
434433
*
435-
* Returns zero on success or -EFAULT on error.
434+
* Returns zero on success, -EFAULT when copying to @data failed, or
435+
* PGM_ADRESSING in case @gra is outside a memslot. In this case, pgm check info
436+
* is also stored to allow injecting into the guest (if applicable) using
437+
* kvm_s390_inject_prog_cond().
436438
*
437439
* If an error occurs data may have been copied partially to kernel space.
438440
*/

arch/s390/pci/pci_event.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,19 @@ static void __zpci_event_error(struct zpci_ccdf_err *ccdf)
280280
goto no_pdev;
281281

282282
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 */
284292
ers_res = zpci_event_attempt_error_recovery(pdev);
285293
if (ers_res != PCI_ERS_RESULT_RECOVERED)
286294
zpci_event_io_failure(pdev, pci_channel_io_perm_failure);
287295
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-
break;
295296
}
296297
pci_dev_put(pdev);
297298
no_pdev:

drivers/s390/char/sclp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,8 @@ sclp_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
11951195
}
11961196

11971197
static struct notifier_block sclp_reboot_notifier = {
1198-
.notifier_call = sclp_reboot_event
1198+
.notifier_call = sclp_reboot_event,
1199+
.priority = INT_MIN,
11991200
};
12001201

12011202
static ssize_t con_pages_show(struct device_driver *dev, char *buf)

drivers/s390/char/sclp_vt220.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ sclp_vt220_add_msg(struct sclp_vt220_request *request,
319319
buffer = (void *) ((addr_t) sccb + sccb->header.length);
320320

321321
if (convertlf) {
322-
/* Perform Linefeed conversion (0x0a -> 0x0a 0x0d)*/
322+
/* Perform Linefeed conversion (0x0a -> 0x0d 0x0a)*/
323323
for (from=0, to=0;
324324
(from < count) && (to < sclp_vt220_space_left(request));
325325
from++) {
@@ -328,8 +328,8 @@ sclp_vt220_add_msg(struct sclp_vt220_request *request,
328328
/* Perform conversion */
329329
if (c == 0x0a) {
330330
if (to + 1 < sclp_vt220_space_left(request)) {
331-
((unsigned char *) buffer)[to++] = c;
332331
((unsigned char *) buffer)[to++] = 0x0d;
332+
((unsigned char *) buffer)[to++] = c;
333333
} else
334334
break;
335335

0 commit comments

Comments
 (0)