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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 's390-6.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Vasily Gorbik:

- Fix isolated VFs handling by verifying that a VF’s parent PF is
locally owned before registering it in an existing PCI domain

- Disable arch_test_bit() optimization for PROFILE_ALL_BRANCHES to
workaround gcc failure in handling __builtin_constant_p() in this
case

- Fix CHPID "configure" attribute caching in CIO by not updating the
cache when SCLP returns no data, ensuring consistent sysfs output

- Remove CONFIG_LSM from default configs and rely on defaults, which
enables BPF LSM hook

* tag 's390-6.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/pci: Fix handling of isolated VFs
s390/pci: Pull search for parent PF out of zpci_iov_setup_virtfn()
s390/bitops: Disable arch_test_bit() optimization for PROFILE_ALL_BRANCHES
s390/cio: Fix CHPID "configure" attribute caching
s390/configs: Remove CONFIG_LSM

+76 -19
-1
arch/s390/configs/debug_defconfig
··· 740 740 CONFIG_IMA_DEFAULT_HASH_SHA256=y 741 741 CONFIG_IMA_WRITE_POLICY=y 742 742 CONFIG_IMA_APPRAISE=y 743 - CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" 744 743 CONFIG_BUG_ON_DATA_CORRUPTION=y 745 744 CONFIG_CRYPTO_USER=m 746 745 # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
-1
arch/s390/configs/defconfig
··· 725 725 CONFIG_IMA_DEFAULT_HASH_SHA256=y 726 726 CONFIG_IMA_WRITE_POLICY=y 727 727 CONFIG_IMA_APPRAISE=y 728 - CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" 729 728 CONFIG_BUG_ON_DATA_CORRUPTION=y 730 729 CONFIG_CRYPTO_FIPS=y 731 730 CONFIG_CRYPTO_USER=m
-1
arch/s390/configs/zfcpdump_defconfig
··· 62 62 # CONFIG_INOTIFY_USER is not set 63 63 # CONFIG_MISC_FILESYSTEMS is not set 64 64 # CONFIG_NETWORK_FILESYSTEMS is not set 65 - CONFIG_LSM="yama,loadpin,safesetid,integrity" 66 65 # CONFIG_ZLIB_DFLTCC is not set 67 66 CONFIG_XZ_DEC_MICROLZMA=y 68 67 CONFIG_PRINTK_TIME=y
+5 -1
arch/s390/include/asm/bitops.h
··· 53 53 unsigned long mask; 54 54 int cc; 55 55 56 - if (__builtin_constant_p(nr)) { 56 + /* 57 + * With CONFIG_PROFILE_ALL_BRANCHES enabled gcc fails to 58 + * handle __builtin_constant_p() in some cases. 59 + */ 60 + if (!IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES) && __builtin_constant_p(nr)) { 57 61 addr = (const volatile unsigned char *)ptr; 58 62 addr += (nr ^ (BITS_PER_LONG - BITS_PER_BYTE)) / BITS_PER_BYTE; 59 63 mask = 1UL << (nr & (BITS_PER_BYTE - 1));
+20
arch/s390/pci/pci_bus.c
··· 331 331 return rc; 332 332 } 333 333 334 + static bool zpci_bus_is_isolated_vf(struct zpci_bus *zbus, struct zpci_dev *zdev) 335 + { 336 + struct pci_dev *pdev; 337 + 338 + pdev = zpci_iov_find_parent_pf(zbus, zdev); 339 + if (!pdev) 340 + return true; 341 + pci_dev_put(pdev); 342 + return false; 343 + } 344 + 334 345 int zpci_bus_device_register(struct zpci_dev *zdev, struct pci_ops *ops) 335 346 { 336 347 bool topo_is_tid = zdev->tid_avail; ··· 356 345 357 346 topo = topo_is_tid ? zdev->tid : zdev->pchid; 358 347 zbus = zpci_bus_get(topo, topo_is_tid); 348 + /* 349 + * An isolated VF gets its own domain/bus even if there exists 350 + * a matching domain/bus already 351 + */ 352 + if (zbus && zpci_bus_is_isolated_vf(zbus, zdev)) { 353 + zpci_bus_put(zbus); 354 + zbus = NULL; 355 + } 356 + 359 357 if (!zbus) { 360 358 zbus = zpci_bus_alloc(topo, topo_is_tid); 361 359 if (!zbus)
+42 -14
arch/s390/pci/pci_iov.c
··· 60 60 return 0; 61 61 } 62 62 63 - int zpci_iov_setup_virtfn(struct zpci_bus *zbus, struct pci_dev *virtfn, int vfn) 63 + /** 64 + * zpci_iov_find_parent_pf - Find the parent PF, if any, of the given function 65 + * @zbus: The bus that the PCI function is on, or would be added on 66 + * @zdev: The PCI function 67 + * 68 + * Finds the parent PF, if it exists and is configured, of the given PCI function 69 + * and increments its refcount. Th PF is searched for on the provided bus so the 70 + * caller has to ensure that this is the correct bus to search. This function may 71 + * be used before adding the PCI function to a zbus. 72 + * 73 + * Return: Pointer to the struct pci_dev of the parent PF or NULL if it not 74 + * found. If the function is not a VF or has no RequesterID information, 75 + * NULL is returned as well. 76 + */ 77 + struct pci_dev *zpci_iov_find_parent_pf(struct zpci_bus *zbus, struct zpci_dev *zdev) 64 78 { 65 - int i, cand_devfn; 66 - struct zpci_dev *zdev; 79 + int i, vfid, devfn, cand_devfn; 67 80 struct pci_dev *pdev; 68 - int vfid = vfn - 1; /* Linux' vfid's start at 0 vfn at 1*/ 69 - int rc = 0; 70 81 71 82 if (!zbus->multifunction) 72 - return 0; 73 - 74 - /* If the parent PF for the given VF is also configured in the 83 + return NULL; 84 + /* Non-VFs and VFs without RID available don't have a parent */ 85 + if (!zdev->vfn || !zdev->rid_available) 86 + return NULL; 87 + /* Linux vfid starts at 0 vfn at 1 */ 88 + vfid = zdev->vfn - 1; 89 + devfn = zdev->rid & ZPCI_RID_MASK_DEVFN; 90 + /* 91 + * If the parent PF for the given VF is also configured in the 75 92 * instance, it must be on the same zbus. 76 93 * We can then identify the parent PF by checking what 77 94 * devfn the VF would have if it belonged to that PF using the PF's ··· 102 85 if (!pdev) 103 86 continue; 104 87 cand_devfn = pci_iov_virtfn_devfn(pdev, vfid); 105 - if (cand_devfn == virtfn->devfn) { 106 - rc = zpci_iov_link_virtfn(pdev, virtfn, vfid); 107 - /* balance pci_get_slot() */ 108 - pci_dev_put(pdev); 109 - break; 110 - } 88 + if (cand_devfn == devfn) 89 + return pdev; 111 90 /* balance pci_get_slot() */ 112 91 pci_dev_put(pdev); 113 92 } 93 + } 94 + return NULL; 95 + } 96 + 97 + int zpci_iov_setup_virtfn(struct zpci_bus *zbus, struct pci_dev *virtfn, int vfn) 98 + { 99 + struct zpci_dev *zdev = to_zpci(virtfn); 100 + struct pci_dev *pdev_pf; 101 + int rc = 0; 102 + 103 + pdev_pf = zpci_iov_find_parent_pf(zbus, zdev); 104 + if (pdev_pf) { 105 + /* Linux' vfids start at 0 while zdev->vfn starts at 1 */ 106 + rc = zpci_iov_link_virtfn(pdev_pf, virtfn, zdev->vfn - 1); 107 + pci_dev_put(pdev_pf); 114 108 } 115 109 return rc; 116 110 }
+7
arch/s390/pci/pci_iov.h
··· 19 19 20 20 int zpci_iov_setup_virtfn(struct zpci_bus *zbus, struct pci_dev *virtfn, int vfn); 21 21 22 + struct pci_dev *zpci_iov_find_parent_pf(struct zpci_bus *zbus, struct zpci_dev *zdev); 23 + 22 24 #else /* CONFIG_PCI_IOV */ 23 25 static inline void zpci_iov_remove_virtfn(struct pci_dev *pdev, int vfn) {} 24 26 ··· 29 27 static inline int zpci_iov_setup_virtfn(struct zpci_bus *zbus, struct pci_dev *virtfn, int vfn) 30 28 { 31 29 return 0; 30 + } 31 + 32 + static inline struct pci_dev *zpci_iov_find_parent_pf(struct zpci_bus *zbus, struct zpci_dev *zdev) 33 + { 34 + return NULL; 32 35 } 33 36 #endif /* CONFIG_PCI_IOV */ 34 37 #endif /* __S390_PCI_IOV_h */
+2 -1
drivers/s390/cio/chp.c
··· 695 695 if (time_after(jiffies, chp_info_expires)) { 696 696 /* Data is too old, update. */ 697 697 rc = sclp_chp_read_info(&chp_info); 698 - chp_info_expires = jiffies + CHP_INFO_UPDATE_INTERVAL ; 698 + if (!rc) 699 + chp_info_expires = jiffies + CHP_INFO_UPDATE_INTERVAL; 699 700 } 700 701 mutex_unlock(&info_lock); 701 702