Commit 4e893b5a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-6.4-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

 - a double free fix in the Xen pvcalls backend driver

 - a fix for a regression causing the MSI related sysfs entries to not
   being created in Xen PV guests

 - a fix in the Xen blkfront driver for handling insane input data
   better

* tag 'for-linus-6.4-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  x86/pci/xen: populate MSI sysfs entries
  xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()
  xen/blkfront: Only check REQ_FUA for writes
parents 957f3f8e 335b4223
...@@ -198,7 +198,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -198,7 +198,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
i++; i++;
} }
kfree(v); kfree(v);
return 0; return msi_device_populate_sysfs(&dev->dev);
error: error:
if (ret == -ENOSYS) if (ret == -ENOSYS)
...@@ -254,7 +254,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -254,7 +254,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
dev_dbg(&dev->dev, dev_dbg(&dev->dev,
"xen: msi --> pirq=%d --> irq=%d\n", pirq, irq); "xen: msi --> pirq=%d --> irq=%d\n", pirq, irq);
} }
return 0; return msi_device_populate_sysfs(&dev->dev);
error: error:
dev_err(&dev->dev, "Failed to create MSI%s! ret=%d!\n", dev_err(&dev->dev, "Failed to create MSI%s! ret=%d!\n",
...@@ -346,7 +346,7 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -346,7 +346,7 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
if (ret < 0) if (ret < 0)
goto out; goto out;
} }
ret = 0; ret = msi_device_populate_sysfs(&dev->dev);
out: out:
return ret; return ret;
} }
...@@ -394,6 +394,8 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev) ...@@ -394,6 +394,8 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev)
xen_destroy_irq(msidesc->irq + i); xen_destroy_irq(msidesc->irq + i);
msidesc->irq = 0; msidesc->irq = 0;
} }
msi_device_destroy_sysfs(&dev->dev);
} }
static void xen_pv_teardown_msi_irqs(struct pci_dev *dev) static void xen_pv_teardown_msi_irqs(struct pci_dev *dev)
......
...@@ -780,7 +780,8 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri ...@@ -780,7 +780,8 @@ static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *ri
ring_req->u.rw.handle = info->handle; ring_req->u.rw.handle = info->handle;
ring_req->operation = rq_data_dir(req) ? ring_req->operation = rq_data_dir(req) ?
BLKIF_OP_WRITE : BLKIF_OP_READ; BLKIF_OP_WRITE : BLKIF_OP_READ;
if (req_op(req) == REQ_OP_FLUSH || req->cmd_flags & REQ_FUA) { if (req_op(req) == REQ_OP_FLUSH ||
(req_op(req) == REQ_OP_WRITE && (req->cmd_flags & REQ_FUA))) {
/* /*
* Ideally we can do an unordered flush-to-disk. * Ideally we can do an unordered flush-to-disk.
* In case the backend onlysupports barriers, use that. * In case the backend onlysupports barriers, use that.
......
...@@ -325,8 +325,10 @@ static struct sock_mapping *pvcalls_new_active_socket( ...@@ -325,8 +325,10 @@ static struct sock_mapping *pvcalls_new_active_socket(
void *page; void *page;
map = kzalloc(sizeof(*map), GFP_KERNEL); map = kzalloc(sizeof(*map), GFP_KERNEL);
if (map == NULL) if (map == NULL) {
sock_release(sock);
return NULL; return NULL;
}
map->fedata = fedata; map->fedata = fedata;
map->sock = sock; map->sock = sock;
...@@ -418,10 +420,8 @@ static int pvcalls_back_connect(struct xenbus_device *dev, ...@@ -418,10 +420,8 @@ static int pvcalls_back_connect(struct xenbus_device *dev,
req->u.connect.ref, req->u.connect.ref,
req->u.connect.evtchn, req->u.connect.evtchn,
sock); sock);
if (!map) { if (!map)
ret = -EFAULT; ret = -EFAULT;
sock_release(sock);
}
out: out:
rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++);
...@@ -561,7 +561,6 @@ static void __pvcalls_back_accept(struct work_struct *work) ...@@ -561,7 +561,6 @@ static void __pvcalls_back_accept(struct work_struct *work)
sock); sock);
if (!map) { if (!map) {
ret = -EFAULT; ret = -EFAULT;
sock_release(sock);
goto out_error; goto out_error;
} }
......
...@@ -383,6 +383,13 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc); ...@@ -383,6 +383,13 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
void arch_teardown_msi_irq(unsigned int irq); void arch_teardown_msi_irq(unsigned int irq);
int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
void arch_teardown_msi_irqs(struct pci_dev *dev); void arch_teardown_msi_irqs(struct pci_dev *dev);
#endif /* CONFIG_PCI_MSI_ARCH_FALLBACKS */
/*
* Xen uses non-default msi_domain_ops and hence needs a way to populate sysfs
* entries of MSI IRQs.
*/
#if defined(CONFIG_PCI_XEN) || defined(CONFIG_PCI_MSI_ARCH_FALLBACKS)
#ifdef CONFIG_SYSFS #ifdef CONFIG_SYSFS
int msi_device_populate_sysfs(struct device *dev); int msi_device_populate_sysfs(struct device *dev);
void msi_device_destroy_sysfs(struct device *dev); void msi_device_destroy_sysfs(struct device *dev);
...@@ -390,7 +397,7 @@ void msi_device_destroy_sysfs(struct device *dev); ...@@ -390,7 +397,7 @@ void msi_device_destroy_sysfs(struct device *dev);
static inline int msi_device_populate_sysfs(struct device *dev) { return 0; } static inline int msi_device_populate_sysfs(struct device *dev) { return 0; }
static inline void msi_device_destroy_sysfs(struct device *dev) { } static inline void msi_device_destroy_sysfs(struct device *dev) { }
#endif /* !CONFIG_SYSFS */ #endif /* !CONFIG_SYSFS */
#endif /* CONFIG_PCI_MSI_ARCH_FALLBACKS */ #endif /* CONFIG_PCI_XEN || CONFIG_PCI_MSI_ARCH_FALLBACKS */
/* /*
* The restore hook is still available even for fully irq domain based * The restore hook is still available even for fully irq domain based
......
...@@ -542,7 +542,7 @@ static int msi_sysfs_populate_desc(struct device *dev, struct msi_desc *desc) ...@@ -542,7 +542,7 @@ static int msi_sysfs_populate_desc(struct device *dev, struct msi_desc *desc)
return ret; return ret;
} }
#ifdef CONFIG_PCI_MSI_ARCH_FALLBACKS #if defined(CONFIG_PCI_MSI_ARCH_FALLBACKS) || defined(CONFIG_PCI_XEN)
/** /**
* msi_device_populate_sysfs - Populate msi_irqs sysfs entries for a device * msi_device_populate_sysfs - Populate msi_irqs sysfs entries for a device
* @dev: The device (PCI, platform etc) which will get sysfs entries * @dev: The device (PCI, platform etc) which will get sysfs entries
...@@ -574,7 +574,7 @@ void msi_device_destroy_sysfs(struct device *dev) ...@@ -574,7 +574,7 @@ void msi_device_destroy_sysfs(struct device *dev)
msi_for_each_desc(desc, dev, MSI_DESC_ALL) msi_for_each_desc(desc, dev, MSI_DESC_ALL)
msi_sysfs_remove_desc(dev, desc); msi_sysfs_remove_desc(dev, desc);
} }
#endif /* CONFIG_PCI_MSI_ARCH_FALLBACK */ #endif /* CONFIG_PCI_MSI_ARCH_FALLBACK || CONFIG_PCI_XEN */
#else /* CONFIG_SYSFS */ #else /* CONFIG_SYSFS */
static inline int msi_sysfs_create_group(struct device *dev) { return 0; } static inline int msi_sysfs_create_group(struct device *dev) { return 0; }
static inline int msi_sysfs_populate_desc(struct device *dev, struct msi_desc *desc) { return 0; } static inline int msi_sysfs_populate_desc(struct device *dev, struct msi_desc *desc) { return 0; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment