Skip to content

Commit ee51814

Browse files
committed
Merge tag 's390-5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Heiko Carstens: - fix reference counting for ap devices - fix paes selftest - fix pmd_deref()/pud_deref() so they can also handle large pages - remove unused vdso file and defines - update defconfigs - call rcu_cpu_starting() early in smp init code to avoid lockdep warnings - fix hotplug of PCI function missing bus * tag 's390-5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/pci: fix hot-plug of PCI function missing bus s390/smp: move rcu_cpu_starting() earlier s390/pkey: fix paes selftest failure with paes and pkey static build s390: update defconfigs s390/vdso: remove unused constants s390/vdso: remove empty unused file s390/mm: make pmd/pud_deref() large page aware s390/ap: fix ap devices reference counting
2 parents 41f1653 + 0b2ca2c commit ee51814

12 files changed

Lines changed: 85 additions & 66 deletions

File tree

arch/s390/configs/debug_defconfig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ CONFIG_CLEANCACHE=y
9393
CONFIG_FRONTSWAP=y
9494
CONFIG_CMA_DEBUG=y
9595
CONFIG_CMA_DEBUGFS=y
96+
CONFIG_CMA_AREAS=7
9697
CONFIG_MEM_SOFT_DIRTY=y
9798
CONFIG_ZSWAP=y
98-
CONFIG_ZSMALLOC=m
99+
CONFIG_ZSMALLOC=y
99100
CONFIG_ZSMALLOC_STAT=y
100101
CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
101102
CONFIG_IDLE_PAGE_TRACKING=y
@@ -378,15 +379,14 @@ CONFIG_NETLINK_DIAG=m
378379
CONFIG_CGROUP_NET_PRIO=y
379380
CONFIG_BPF_JIT=y
380381
CONFIG_NET_PKTGEN=m
381-
# CONFIG_NET_DROP_MONITOR is not set
382382
CONFIG_PCI=y
383383
# CONFIG_PCIEASPM is not set
384384
CONFIG_PCI_DEBUG=y
385385
CONFIG_HOTPLUG_PCI=y
386386
CONFIG_HOTPLUG_PCI_S390=y
387387
CONFIG_DEVTMPFS=y
388388
CONFIG_CONNECTOR=y
389-
CONFIG_ZRAM=m
389+
CONFIG_ZRAM=y
390390
CONFIG_BLK_DEV_LOOP=m
391391
CONFIG_BLK_DEV_CRYPTOLOOP=m
392392
CONFIG_BLK_DEV_DRBD=m
@@ -689,6 +689,7 @@ CONFIG_CRYPTO_TEST=m
689689
CONFIG_CRYPTO_DH=m
690690
CONFIG_CRYPTO_ECDH=m
691691
CONFIG_CRYPTO_ECRDSA=m
692+
CONFIG_CRYPTO_SM2=m
692693
CONFIG_CRYPTO_CURVE25519=m
693694
CONFIG_CRYPTO_GCM=y
694695
CONFIG_CRYPTO_CHACHA20POLY1305=m
@@ -709,7 +710,6 @@ CONFIG_CRYPTO_RMD160=m
709710
CONFIG_CRYPTO_RMD256=m
710711
CONFIG_CRYPTO_RMD320=m
711712
CONFIG_CRYPTO_SHA3=m
712-
CONFIG_CRYPTO_SM3=m
713713
CONFIG_CRYPTO_TGR192=m
714714
CONFIG_CRYPTO_WP512=m
715715
CONFIG_CRYPTO_AES_TI=m
@@ -753,6 +753,7 @@ CONFIG_CRYPTO_DES_S390=m
753753
CONFIG_CRYPTO_AES_S390=m
754754
CONFIG_CRYPTO_GHASH_S390=m
755755
CONFIG_CRYPTO_CRC32_S390=y
756+
CONFIG_CRYPTO_DEV_VIRTIO=m
756757
CONFIG_CORDIC=m
757758
CONFIG_CRC32_SELFTEST=y
758759
CONFIG_CRC4=m
@@ -829,6 +830,7 @@ CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m
829830
CONFIG_FAULT_INJECTION=y
830831
CONFIG_FAILSLAB=y
831832
CONFIG_FAIL_PAGE_ALLOC=y
833+
CONFIG_FAULT_INJECTION_USERCOPY=y
832834
CONFIG_FAIL_MAKE_REQUEST=y
833835
CONFIG_FAIL_IO_TIMEOUT=y
834836
CONFIG_FAIL_FUTEX=y

arch/s390/configs/defconfig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ CONFIG_KSM=y
8787
CONFIG_TRANSPARENT_HUGEPAGE=y
8888
CONFIG_CLEANCACHE=y
8989
CONFIG_FRONTSWAP=y
90+
CONFIG_CMA_AREAS=7
9091
CONFIG_MEM_SOFT_DIRTY=y
9192
CONFIG_ZSWAP=y
92-
CONFIG_ZSMALLOC=m
93+
CONFIG_ZSMALLOC=y
9394
CONFIG_ZSMALLOC_STAT=y
9495
CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
9596
CONFIG_IDLE_PAGE_TRACKING=y
@@ -371,15 +372,14 @@ CONFIG_NETLINK_DIAG=m
371372
CONFIG_CGROUP_NET_PRIO=y
372373
CONFIG_BPF_JIT=y
373374
CONFIG_NET_PKTGEN=m
374-
# CONFIG_NET_DROP_MONITOR is not set
375375
CONFIG_PCI=y
376376
# CONFIG_PCIEASPM is not set
377377
CONFIG_HOTPLUG_PCI=y
378378
CONFIG_HOTPLUG_PCI_S390=y
379379
CONFIG_UEVENT_HELPER=y
380380
CONFIG_DEVTMPFS=y
381381
CONFIG_CONNECTOR=y
382-
CONFIG_ZRAM=m
382+
CONFIG_ZRAM=y
383383
CONFIG_BLK_DEV_LOOP=m
384384
CONFIG_BLK_DEV_CRYPTOLOOP=m
385385
CONFIG_BLK_DEV_DRBD=m
@@ -680,6 +680,7 @@ CONFIG_CRYPTO_TEST=m
680680
CONFIG_CRYPTO_DH=m
681681
CONFIG_CRYPTO_ECDH=m
682682
CONFIG_CRYPTO_ECRDSA=m
683+
CONFIG_CRYPTO_SM2=m
683684
CONFIG_CRYPTO_CURVE25519=m
684685
CONFIG_CRYPTO_GCM=y
685686
CONFIG_CRYPTO_CHACHA20POLY1305=m
@@ -701,7 +702,6 @@ CONFIG_CRYPTO_RMD160=m
701702
CONFIG_CRYPTO_RMD256=m
702703
CONFIG_CRYPTO_RMD320=m
703704
CONFIG_CRYPTO_SHA3=m
704-
CONFIG_CRYPTO_SM3=m
705705
CONFIG_CRYPTO_TGR192=m
706706
CONFIG_CRYPTO_WP512=m
707707
CONFIG_CRYPTO_AES_TI=m
@@ -745,6 +745,7 @@ CONFIG_CRYPTO_DES_S390=m
745745
CONFIG_CRYPTO_AES_S390=m
746746
CONFIG_CRYPTO_GHASH_S390=m
747747
CONFIG_CRYPTO_CRC32_S390=y
748+
CONFIG_CRYPTO_DEV_VIRTIO=m
748749
CONFIG_CORDIC=m
749750
CONFIG_PRIME_NUMBERS=m
750751
CONFIG_CRC4=m

arch/s390/configs/zfcpdump_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ CONFIG_HZ_100=y
1717
# CONFIG_CHSC_SCH is not set
1818
# CONFIG_SCM_BUS is not set
1919
CONFIG_CRASH_DUMP=y
20-
# CONFIG_SECCOMP is not set
2120
# CONFIG_PFAULT is not set
2221
# CONFIG_S390_HYPFS_FS is not set
2322
# CONFIG_VIRTUALIZATION is not set
2423
# CONFIG_S390_GUEST is not set
24+
# CONFIG_SECCOMP is not set
2525
CONFIG_PARTITION_ADVANCED=y
2626
CONFIG_IBM_PARTITION=y
2727
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set

arch/s390/include/asm/pgtable.h

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -692,16 +692,6 @@ static inline int pud_large(pud_t pud)
692692
return !!(pud_val(pud) & _REGION3_ENTRY_LARGE);
693693
}
694694

695-
static inline unsigned long pud_pfn(pud_t pud)
696-
{
697-
unsigned long origin_mask;
698-
699-
origin_mask = _REGION_ENTRY_ORIGIN;
700-
if (pud_large(pud))
701-
origin_mask = _REGION3_ENTRY_ORIGIN_LARGE;
702-
return (pud_val(pud) & origin_mask) >> PAGE_SHIFT;
703-
}
704-
705695
#define pmd_leaf pmd_large
706696
static inline int pmd_large(pmd_t pmd)
707697
{
@@ -747,16 +737,6 @@ static inline int pmd_none(pmd_t pmd)
747737
return pmd_val(pmd) == _SEGMENT_ENTRY_EMPTY;
748738
}
749739

750-
static inline unsigned long pmd_pfn(pmd_t pmd)
751-
{
752-
unsigned long origin_mask;
753-
754-
origin_mask = _SEGMENT_ENTRY_ORIGIN;
755-
if (pmd_large(pmd))
756-
origin_mask = _SEGMENT_ENTRY_ORIGIN_LARGE;
757-
return (pmd_val(pmd) & origin_mask) >> PAGE_SHIFT;
758-
}
759-
760740
#define pmd_write pmd_write
761741
static inline int pmd_write(pmd_t pmd)
762742
{
@@ -1238,11 +1218,39 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
12381218
#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
12391219
#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
12401220

1241-
#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN)
1242-
#define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN)
12431221
#define p4d_deref(pud) (p4d_val(pud) & _REGION_ENTRY_ORIGIN)
12441222
#define pgd_deref(pgd) (pgd_val(pgd) & _REGION_ENTRY_ORIGIN)
12451223

1224+
static inline unsigned long pmd_deref(pmd_t pmd)
1225+
{
1226+
unsigned long origin_mask;
1227+
1228+
origin_mask = _SEGMENT_ENTRY_ORIGIN;
1229+
if (pmd_large(pmd))
1230+
origin_mask = _SEGMENT_ENTRY_ORIGIN_LARGE;
1231+
return pmd_val(pmd) & origin_mask;
1232+
}
1233+
1234+
static inline unsigned long pmd_pfn(pmd_t pmd)
1235+
{
1236+
return pmd_deref(pmd) >> PAGE_SHIFT;
1237+
}
1238+
1239+
static inline unsigned long pud_deref(pud_t pud)
1240+
{
1241+
unsigned long origin_mask;
1242+
1243+
origin_mask = _REGION_ENTRY_ORIGIN;
1244+
if (pud_large(pud))
1245+
origin_mask = _REGION3_ENTRY_ORIGIN_LARGE;
1246+
return pud_val(pud) & origin_mask;
1247+
}
1248+
1249+
static inline unsigned long pud_pfn(pud_t pud)
1250+
{
1251+
return pud_deref(pud) >> PAGE_SHIFT;
1252+
}
1253+
12461254
/*
12471255
* The pgd_offset function *always* adds the index for the top-level
12481256
* region/segment table. This is done to get a sequence like the

arch/s390/include/asm/vdso/vdso.h

Whitespace-only changes.

arch/s390/kernel/asm-offsets.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ int main(void)
6161
BLANK();
6262
OFFSET(__VDSO_GETCPU_VAL, vdso_per_cpu_data, getcpu_val);
6363
BLANK();
64-
/* constants used by the vdso */
65-
DEFINE(__CLOCK_REALTIME, CLOCK_REALTIME);
66-
DEFINE(__CLOCK_MONOTONIC, CLOCK_MONOTONIC);
67-
DEFINE(__CLOCK_REALTIME_COARSE, CLOCK_REALTIME_COARSE);
68-
DEFINE(__CLOCK_MONOTONIC_COARSE, CLOCK_MONOTONIC_COARSE);
69-
DEFINE(__CLOCK_THREAD_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID);
70-
DEFINE(__CLOCK_COARSE_RES, LOW_RES_NSEC);
71-
BLANK();
7264
/* idle data offsets */
7365
OFFSET(__CLOCK_IDLE_ENTER, s390_idle_data, clock_idle_enter);
7466
OFFSET(__CLOCK_IDLE_EXIT, s390_idle_data, clock_idle_exit);

arch/s390/kernel/smp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,13 +855,14 @@ void __init smp_detect_cpus(void)
855855

856856
static void smp_init_secondary(void)
857857
{
858-
int cpu = smp_processor_id();
858+
int cpu = raw_smp_processor_id();
859859

860860
S390_lowcore.last_update_clock = get_tod_clock();
861861
restore_access_regs(S390_lowcore.access_regs_save_area);
862862
set_cpu_flag(CIF_ASCE_PRIMARY);
863863
set_cpu_flag(CIF_ASCE_SECONDARY);
864864
cpu_init();
865+
rcu_cpu_starting(cpu);
865866
preempt_disable();
866867
init_cpu_timer();
867868
vtime_init();

arch/s390/pci/pci_event.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
101101
if (ret)
102102
break;
103103

104+
/* the PCI function will be scanned once function 0 appears */
105+
if (!zdev->zbus->bus)
106+
break;
107+
104108
pdev = pci_scan_single_device(zdev->zbus->bus, zdev->devfn);
105109
if (!pdev)
106110
break;

drivers/s390/crypto/ap_bus.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,10 @@ static int ap_device_probe(struct device *dev)
680680
{
681681
struct ap_device *ap_dev = to_ap_dev(dev);
682682
struct ap_driver *ap_drv = to_ap_drv(dev->driver);
683-
int card, queue, devres, drvres, rc;
683+
int card, queue, devres, drvres, rc = -ENODEV;
684+
685+
if (!get_device(dev))
686+
return rc;
684687

685688
if (is_queue_dev(dev)) {
686689
/*
@@ -697,7 +700,7 @@ static int ap_device_probe(struct device *dev)
697700
mutex_unlock(&ap_perms_mutex);
698701
drvres = ap_drv->flags & AP_DRIVER_FLAG_DEFAULT;
699702
if (!!devres != !!drvres)
700-
return -ENODEV;
703+
goto out;
701704
}
702705

703706
/* Add queue/card to list of active queues/cards */
@@ -718,6 +721,9 @@ static int ap_device_probe(struct device *dev)
718721
ap_dev->drv = NULL;
719722
}
720723

724+
out:
725+
if (rc)
726+
put_device(dev);
721727
return rc;
722728
}
723729

@@ -744,6 +750,8 @@ static int ap_device_remove(struct device *dev)
744750
hash_del(&to_ap_queue(dev)->hnode);
745751
spin_unlock_bh(&ap_queues_lock);
746752

753+
put_device(dev);
754+
747755
return 0;
748756
}
749757

@@ -1371,6 +1379,8 @@ static inline void ap_scan_domains(struct ap_card *ac)
13711379
__func__, ac->id, dom);
13721380
goto put_dev_and_continue;
13731381
}
1382+
/* get it and thus adjust reference counter */
1383+
get_device(dev);
13741384
if (decfg)
13751385
AP_DBF_INFO("%s(%d,%d) new (decfg) queue device created\n",
13761386
__func__, ac->id, dom);

drivers/s390/crypto/pkey_api.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ MODULE_DESCRIPTION("s390 protected key interface");
3535
#define PROTKEYBLOBBUFSIZE 256 /* protected key buffer size used internal */
3636
#define MAXAPQNSINLIST 64 /* max 64 apqns within a apqn list */
3737

38-
/* mask of available pckmo subfunctions, fetched once at module init */
39-
static cpacf_mask_t pckmo_functions;
40-
4138
/*
4239
* debug feature data and functions
4340
*/
@@ -91,6 +88,9 @@ static int pkey_clr2protkey(u32 keytype,
9188
const struct pkey_clrkey *clrkey,
9289
struct pkey_protkey *protkey)
9390
{
91+
/* mask of available pckmo subfunctions */
92+
static cpacf_mask_t pckmo_functions;
93+
9494
long fc;
9595
int keysize;
9696
u8 paramblock[64];
@@ -114,11 +114,13 @@ static int pkey_clr2protkey(u32 keytype,
114114
return -EINVAL;
115115
}
116116

117-
/*
118-
* Check if the needed pckmo subfunction is available.
119-
* These subfunctions can be enabled/disabled by customers
120-
* in the LPAR profile or may even change on the fly.
121-
*/
117+
/* Did we already check for PCKMO ? */
118+
if (!pckmo_functions.bytes[0]) {
119+
/* no, so check now */
120+
if (!cpacf_query(CPACF_PCKMO, &pckmo_functions))
121+
return -ENODEV;
122+
}
123+
/* check for the pckmo subfunction we need now */
122124
if (!cpacf_test_func(&pckmo_functions, fc)) {
123125
DEBUG_ERR("%s pckmo functions not available\n", __func__);
124126
return -ENODEV;
@@ -2058,23 +2060,23 @@ static struct miscdevice pkey_dev = {
20582060
*/
20592061
static int __init pkey_init(void)
20602062
{
2061-
cpacf_mask_t kmc_functions;
2063+
cpacf_mask_t func_mask;
20622064

20632065
/*
20642066
* The pckmo instruction should be available - even if we don't
20652067
* actually invoke it. This instruction comes with MSA 3 which
20662068
* is also the minimum level for the kmc instructions which
20672069
* are able to work with protected keys.
20682070
*/
2069-
if (!cpacf_query(CPACF_PCKMO, &pckmo_functions))
2071+
if (!cpacf_query(CPACF_PCKMO, &func_mask))
20702072
return -ENODEV;
20712073

20722074
/* check for kmc instructions available */
2073-
if (!cpacf_query(CPACF_KMC, &kmc_functions))
2075+
if (!cpacf_query(CPACF_KMC, &func_mask))
20742076
return -ENODEV;
2075-
if (!cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_128) ||
2076-
!cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_192) ||
2077-
!cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_256))
2077+
if (!cpacf_test_func(&func_mask, CPACF_KMC_PAES_128) ||
2078+
!cpacf_test_func(&func_mask, CPACF_KMC_PAES_192) ||
2079+
!cpacf_test_func(&func_mask, CPACF_KMC_PAES_256))
20782080
return -ENODEV;
20792081

20802082
pkey_debug_init();

0 commit comments

Comments
 (0)