vhost,virtio,vdpa,firmware: bugfixes
bugfixes all over the place Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmVT1w0PHG1zdEByZWRo YXQuY29tAAoJECgfDbjSjVRpYXMH/AxTzofnpIJOvmY0QYLbBg3+wu0ml4X1pvJc Ia2pm5NZLTPucesw+AFM1q8YIiRX5mBRTmxtGLFzqiC+miAKPvMJK2hQe1jlNqgM 7zBb0jeHvURvo4rvDi8a2Xvf6T2ypGapBhmcNy7VtEugLrXGHGMMzjE3IS1/Zsbm AK70P0ujTpLZtp4TFy2qqZoaikijbAdHhu2GTo1KfFh3RcwSc1uhbrtoTHUQ42bw 0nXz8eLyuu9VmUryVgLy+j9pnS9KDMNhVCpjpVIHD4iI9L6sQVj8fwc/Bnxq8mh7 yDcagvcIK54M786cAmLWC+zQu7feMQ8FcC2zduJT+Yl2X4fX04E= =xFJf -----END PGP SIGNATURE----- Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost 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
This commit is contained in:
commit
372bed5fbb
8 changed files with 22 additions and 18 deletions
|
|
@ -131,7 +131,7 @@ config RASPBERRYPI_FIRMWARE
|
||||||
|
|
||||||
config FW_CFG_SYSFS
|
config FW_CFG_SYSFS
|
||||||
tristate "QEMU fw_cfg device support in 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
|
depends on HAS_IOPORT_MAP
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ static void fw_cfg_io_cleanup(void)
|
||||||
|
|
||||||
/* arch-specific ctrl & data register offsets are not available in ACPI, DT */
|
/* 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(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_CTRL_OFF 0x08
|
||||||
# define FW_CFG_DATA_OFF 0x00
|
# define FW_CFG_DATA_OFF 0x00
|
||||||
# define FW_CFG_DMA_OFF 0x10
|
# define FW_CFG_DMA_OFF 0x10
|
||||||
|
|
|
||||||
|
|
@ -437,7 +437,7 @@ static int vdpasim_blk_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
|
||||||
if (blk->shared_backend) {
|
if (blk->shared_backend) {
|
||||||
blk->buffer = shared_buffer;
|
blk->buffer = shared_buffer;
|
||||||
} else {
|
} else {
|
||||||
blk->buffer = kvmalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
|
blk->buffer = kvzalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!blk->buffer) {
|
if (!blk->buffer) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
|
@ -495,7 +495,7 @@ static int __init vdpasim_blk_init(void)
|
||||||
goto parent_err;
|
goto parent_err;
|
||||||
|
|
||||||
if (shared_backend) {
|
if (shared_backend) {
|
||||||
shared_buffer = kvmalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
|
shared_buffer = kvzalloc(VDPASIM_BLK_CAPACITY << SECTOR_SHIFT,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!shared_buffer) {
|
if (!shared_buffer) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
|
|
||||||
|
|
@ -1582,7 +1582,6 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
|
||||||
|
|
||||||
err:
|
err:
|
||||||
put_device(&v->dev);
|
put_device(&v->dev);
|
||||||
ida_simple_remove(&vhost_vdpa_ida, v->minor);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ void vp_del_vqs(struct virtio_device *vdev)
|
||||||
if (v != VIRTIO_MSI_NO_VECTOR) {
|
if (v != VIRTIO_MSI_NO_VECTOR) {
|
||||||
int irq = pci_irq_vector(vp_dev->pci_dev, v);
|
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);
|
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];
|
mask = vp_dev->msix_affinity_masks[info->msix_vector];
|
||||||
irq = pci_irq_vector(vp_dev->pci_dev, info->msix_vector);
|
irq = pci_irq_vector(vp_dev->pci_dev, info->msix_vector);
|
||||||
if (!cpu_mask)
|
if (!cpu_mask)
|
||||||
irq_set_affinity_hint(irq, NULL);
|
irq_update_affinity_hint(irq, NULL);
|
||||||
else {
|
else {
|
||||||
cpumask_copy(mask, cpu_mask);
|
cpumask_copy(mask, cpu_mask);
|
||||||
irq_set_affinity_hint(irq, mask);
|
irq_set_affinity_and_hint(irq, mask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -294,9 +294,10 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
|
||||||
|
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
mdev->common = vp_modern_map_capability(mdev, common,
|
mdev->common = vp_modern_map_capability(mdev, common,
|
||||||
sizeof(struct virtio_pci_common_cfg), 4,
|
sizeof(struct virtio_pci_common_cfg), 4, 0,
|
||||||
0, sizeof(struct virtio_pci_modern_common_cfg),
|
offsetofend(struct virtio_pci_modern_common_cfg,
|
||||||
&mdev->common_len, NULL);
|
queue_reset),
|
||||||
|
&mdev->common_len, NULL);
|
||||||
if (!mdev->common)
|
if (!mdev->common)
|
||||||
goto err_map_common;
|
goto err_map_common;
|
||||||
mdev->isr = vp_modern_map_capability(mdev, isr, sizeof(u8), 1,
|
mdev->isr = vp_modern_map_capability(mdev, isr, sizeof(u8), 1,
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,6 @@
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include <linux/virtio_pci.h>
|
#include <linux/virtio_pci.h>
|
||||||
|
|
||||||
struct virtio_pci_modern_common_cfg {
|
|
||||||
struct virtio_pci_common_cfg cfg;
|
|
||||||
|
|
||||||
__le16 queue_notify_data; /* read-write */
|
|
||||||
__le16 queue_reset; /* read-write */
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct virtio_pci_modern_device - info for modern PCI virtio
|
* struct virtio_pci_modern_device - info for modern PCI virtio
|
||||||
* @pci_dev: Ptr to the PCI device struct
|
* @pci_dev: Ptr to the PCI device struct
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,17 @@ struct virtio_pci_common_cfg {
|
||||||
__le32 queue_used_hi; /* read-write */
|
__le32 queue_used_hi; /* read-write */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Warning: do not use sizeof on this: use offsetofend for
|
||||||
|
* specific fields you need.
|
||||||
|
*/
|
||||||
|
struct virtio_pci_modern_common_cfg {
|
||||||
|
struct virtio_pci_common_cfg cfg;
|
||||||
|
|
||||||
|
__le16 queue_notify_data; /* read-write */
|
||||||
|
__le16 queue_reset; /* read-write */
|
||||||
|
};
|
||||||
|
|
||||||
/* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
|
/* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
|
||||||
struct virtio_pci_cfg_cap {
|
struct virtio_pci_cfg_cap {
|
||||||
struct virtio_pci_cap cap;
|
struct virtio_pci_cap cap;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue