Commit 372bed5f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull virtio fixes from Michael Tsirkin:
 "Bugfixes all over the place"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  vhost-vdpa: fix use after free in vhost_vdpa_probe()
  virtio_pci: Switch away from deprecated irq_set_affinity_hint
  riscv, qemu_fw_cfg: Add support for RISC-V architecture
  vdpa_sim_blk: allocate the buffer zeroed
  virtio_pci: move structure to a header
parents c42d9eee e07754e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ config RASPBERRYPI_FIRMWARE

config FW_CFG_SYSFS
	tristate "QEMU fw_cfg device support in sysfs"
	depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || SPARC || X86)
	depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || RISCV || SPARC || X86)
	depends on HAS_IOPORT_MAP
	default n
	help
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ static void fw_cfg_io_cleanup(void)

/* arch-specific ctrl & data register offsets are not available in ACPI, DT */
#if !(defined(FW_CFG_CTRL_OFF) && defined(FW_CFG_DATA_OFF))
# if (defined(CONFIG_ARM) || defined(CONFIG_ARM64))
# if (defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_RISCV))
#  define FW_CFG_CTRL_OFF 0x08
#  define FW_CFG_DATA_OFF 0x00
#  define FW_CFG_DMA_OFF 0x10
+2 −2
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ static int vdpasim_blk_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
	if (blk->shared_backend) {
		blk->buffer = shared_buffer;
	} else {
		blk->buffer = kvmalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
		blk->buffer = kvzalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
				       GFP_KERNEL);
		if (!blk->buffer) {
			ret = -ENOMEM;
@@ -495,7 +495,7 @@ static int __init vdpasim_blk_init(void)
		goto parent_err;

	if (shared_backend) {
		shared_buffer = kvmalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
		shared_buffer = kvzalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
					 GFP_KERNEL);
		if (!shared_buffer) {
			ret = -ENOMEM;
+0 −1
Original line number Diff line number Diff line
@@ -1582,7 +1582,6 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)

err:
	put_device(&v->dev);
	ida_simple_remove(&vhost_vdpa_ida, v->minor);
	return r;
}

+3 −3
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ void vp_del_vqs(struct virtio_device *vdev)
			if (v != VIRTIO_MSI_NO_VECTOR) {
				int irq = pci_irq_vector(vp_dev->pci_dev, v);

				irq_set_affinity_hint(irq, NULL);
				irq_update_affinity_hint(irq, NULL);
				free_irq(irq, vq);
			}
		}
@@ -443,10 +443,10 @@ int vp_set_vq_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask)
		mask = vp_dev->msix_affinity_masks[info->msix_vector];
		irq = pci_irq_vector(vp_dev->pci_dev, info->msix_vector);
		if (!cpu_mask)
			irq_set_affinity_hint(irq, NULL);
			irq_update_affinity_hint(irq, NULL);
		else {
			cpumask_copy(mask, cpu_mask);
			irq_set_affinity_hint(irq, mask);
			irq_set_affinity_and_hint(irq, mask);
		}
	}
	return 0;
Loading