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 'for-linus-5.13b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

- a fix for a boot regression when running as PV guest on hardware
without NX support

- a small series fixing a bug in the Xen pciback driver when
configuring a PCI card with multiple virtual functions

* tag 'for-linus-5.13b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen-pciback: reconfigure also from backend watch handler
xen-pciback: redo VF placement in the virtual topology
x86/Xen: swap NX determination and GDT setup on BSP

+29 -15
+4 -4
arch/x86/xen/enlighten_pv.c
··· 1273 1273 /* Get mfn list */ 1274 1274 xen_build_dynamic_phys_to_machine(); 1275 1275 1276 + /* Work out if we support NX */ 1277 + get_cpu_cap(&boot_cpu_data); 1278 + x86_configure_nx(); 1279 + 1276 1280 /* 1277 1281 * Set up kernel GDT and segment registers, mainly so that 1278 1282 * -fstack-protector code can be executed. 1279 1283 */ 1280 1284 xen_setup_gdt(0); 1281 - 1282 - /* Work out if we support NX */ 1283 - get_cpu_cap(&boot_cpu_data); 1284 - x86_configure_nx(); 1285 1285 1286 1286 /* Determine virtual and physical address sizes */ 1287 1287 get_cpu_address_sizes(&boot_cpu_data);
+8 -6
drivers/xen/xen-pciback/vpci.c
··· 70 70 struct pci_dev *dev, int devid, 71 71 publish_pci_dev_cb publish_cb) 72 72 { 73 - int err = 0, slot, func = -1; 73 + int err = 0, slot, func = PCI_FUNC(dev->devfn); 74 74 struct pci_dev_entry *t, *dev_entry; 75 75 struct vpci_dev_data *vpci_dev = pdev->pci_dev_data; 76 76 ··· 95 95 96 96 /* 97 97 * Keep multi-function devices together on the virtual PCI bus, except 98 - * virtual functions. 98 + * that we want to keep virtual functions at func 0 on their own. They 99 + * aren't multi-function devices and hence their presence at func 0 100 + * may cause guests to not scan the other functions. 99 101 */ 100 - if (!dev->is_virtfn) { 102 + if (!dev->is_virtfn || func) { 101 103 for (slot = 0; slot < PCI_SLOT_MAX; slot++) { 102 104 if (list_empty(&vpci_dev->dev_list[slot])) 103 105 continue; 104 106 105 107 t = list_entry(list_first(&vpci_dev->dev_list[slot]), 106 108 struct pci_dev_entry, list); 109 + if (t->dev->is_virtfn && !PCI_FUNC(t->dev->devfn)) 110 + continue; 107 111 108 112 if (match_slot(dev, t->dev)) { 109 113 dev_info(&dev->dev, "vpci: assign to virtual slot %d func %d\n", 110 - slot, PCI_FUNC(dev->devfn)); 114 + slot, func); 111 115 list_add_tail(&dev_entry->list, 112 116 &vpci_dev->dev_list[slot]); 113 - func = PCI_FUNC(dev->devfn); 114 117 goto unlock; 115 118 } 116 119 } ··· 126 123 slot); 127 124 list_add_tail(&dev_entry->list, 128 125 &vpci_dev->dev_list[slot]); 129 - func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn); 130 126 goto unlock; 131 127 } 132 128 }
+17 -5
drivers/xen/xen-pciback/xenbus.c
··· 359 359 return err; 360 360 } 361 361 362 - static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev) 362 + static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev, 363 + enum xenbus_state state) 363 364 { 364 365 int err = 0; 365 366 int num_devs; ··· 374 373 dev_dbg(&pdev->xdev->dev, "Reconfiguring device ...\n"); 375 374 376 375 mutex_lock(&pdev->dev_lock); 377 - /* Make sure we only reconfigure once */ 378 - if (xenbus_read_driver_state(pdev->xdev->nodename) != 379 - XenbusStateReconfiguring) 376 + if (xenbus_read_driver_state(pdev->xdev->nodename) != state) 380 377 goto out; 381 378 382 379 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, "num_devs", "%d", ··· 499 500 } 500 501 } 501 502 503 + if (state != XenbusStateReconfiguring) 504 + /* Make sure we only reconfigure once. */ 505 + goto out; 506 + 502 507 err = xenbus_switch_state(pdev->xdev, XenbusStateReconfigured); 503 508 if (err) { 504 509 xenbus_dev_fatal(pdev->xdev, err, ··· 528 525 break; 529 526 530 527 case XenbusStateReconfiguring: 531 - xen_pcibk_reconfigure(pdev); 528 + xen_pcibk_reconfigure(pdev, XenbusStateReconfiguring); 532 529 break; 533 530 534 531 case XenbusStateConnected: ··· 665 662 switch (xenbus_read_driver_state(pdev->xdev->nodename)) { 666 663 case XenbusStateInitWait: 667 664 xen_pcibk_setup_backend(pdev); 665 + break; 666 + 667 + case XenbusStateInitialised: 668 + /* 669 + * We typically move to Initialised when the first device was 670 + * added. Hence subsequent devices getting added may need 671 + * reconfiguring. 672 + */ 673 + xen_pcibk_reconfigure(pdev, XenbusStateInitialised); 668 674 break; 669 675 670 676 default: