search for: vdpasim_cr

Displaying 20 results from an estimated 37 matches for "vdpasim_cr".

2020 Jul 15
2
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
VDPA sim stores config space as native endian, but that is wrong: modern guests expect LE. I coded up the following to fix it up, but it is wrong too: vdpasim_create is called before guest features are known. So what should we do? New ioctl to specify the interface used? More ideas? Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(...
2020 Jul 15
2
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
VDPA sim stores config space as native endian, but that is wrong: modern guests expect LE. I coded up the following to fix it up, but it is wrong too: vdpasim_create is called before guest features are known. So what should we do? New ioctl to specify the interface used? More ideas? Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...6(vdpasim_is_little_endian(vdpasim), val); > +} > + > static struct vdpasim *vdpasim_dev; > > static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) > @@ -306,7 +324,6 @@ static const struct vdpa_config_ops vdpasim_net_config_ops; > > static struct vdpasim *vdpasim_create(void) > { > - struct virtio_net_config *config; > struct vdpasim *vdpasim; > struct device *dev; > int ret = -ENOMEM; > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > if (!vdpasim->buffer) > goto err_iommu; > > - config =...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...6(vdpasim_is_little_endian(vdpasim), val); > +} > + > static struct vdpasim *vdpasim_dev; > > static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) > @@ -306,7 +324,6 @@ static const struct vdpa_config_ops vdpasim_net_config_ops; > > static struct vdpasim *vdpasim_create(void) > { > - struct virtio_net_config *config; > struct vdpasim *vdpasim; > struct device *dev; > int ret = -ENOMEM; > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > if (!vdpasim->buffer) > goto err_iommu; > > - config =...
2023 Mar 21
3
[PATCH v3 5/8] vdpa_sim: make devices agnostic for work management
...work_func_t work_fn; + void (*work_fn)(struct vdpasim *vdpasim); void (*get_config)(struct vdpasim *vdpasim, void *config); void (*set_config)(struct vdpasim *vdpasim, const void *config); int (*get_stats)(struct vdpasim *vdpasim, u16 idx, @@ -78,6 +78,7 @@ struct vdpasim { struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *attr, const struct vdpa_dev_set_config *config); +void vdpasim_schedule_work(struct vdpasim *vdpasim); /* TODO: cross-endian support */ static inline bool vdpasim_is_little_endian(struct vdpasim *vdpasim) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/dr...
2020 Feb 11
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
On Mon, Feb 10, 2020 at 11:56:08AM +0800, Jason Wang wrote: > + > +static struct vdpasim *vdpasim_create(void) > +{ > + struct vdpasim *vdpasim; > + struct virtio_net_config *config; > + struct vdpa_device *vdpa; > + struct device *dev; > + int ret = -ENOMEM; > + > + vdpasim = kzalloc(sizeof(*vdpasim), GFP_KERNEL); > + if (!vdpasim) > + goto err_vdpa_alloc; > + &g...
2020 Jul 16
1
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...ul 15, 2020 at 10:02:32PM +0800, Jason Wang wrote: > > On 2020/7/15 ??9:58, Michael S. Tsirkin wrote: > > VDPA sim stores config space as native endian, but that > > is wrong: modern guests expect LE. > > I coded up the following to fix it up, but it is wrong too: > > vdpasim_create is called before guest features are known. > > > > So what should we do? New ioctl to specify the interface used? > > More ideas? > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > > Can we do the endian conversion in set_config/ge...
2020 Apr 05
4
[PATCH] vdpa-sim: depend on HAS_DMA
set_dma_ops isn't available on all architectures: make ARCH=um ... drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create': >> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'? +[-Werror=implicit-function-declaration] set_dma_ops(dev, &vdpasim_dma_ops); ^~~~~~~~~~~ set_groups Signed-off-by: Michael...
2020 Apr 05
4
[PATCH] vdpa-sim: depend on HAS_DMA
set_dma_ops isn't available on all architectures: make ARCH=um ... drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create': >> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'? +[-Werror=implicit-function-declaration] set_dma_ops(dev, &vdpasim_dma_ops); ^~~~~~~~~~~ set_groups Signed-off-by: Michael...
2023 Jan 29
1
[PATCH v3 2/2] vdpasim: support doorbell mapping
...OTIFY_DEFVAL) != VDPASIM_NOTIFY_DEFVAL) > + schedule_work(&vdpasim->work); > + > +out: > + schedule_delayed_work(&vdpasim->notify_work, > + msecs_to_jiffies(VDPASIM_VRING_POLL_PERIOD)); > +} > + > struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr, > const struct vdpa_dev_set_config *config) > { > @@ -287,6 +311,13 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr, > set_dma_ops(dev, &vdpasim_dma_ops); > vdpasim->vdpa...
2023 Apr 04
9
[PATCH v5 0/9] vdpa_sim: add support for user VA
This series adds support for the use of user virtual addresses in the vDPA simulator devices. The main reason for this change is to lift the pinning of all guest memory. Especially with virtio devices implemented in software. The next step would be to generalize the code in vdpa-sim to allow the implementation of in-kernel software devices. Similar to vhost, but using vDPA so we can reuse the
2020 Jul 15
0
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
On 2020/7/15 ??9:58, Michael S. Tsirkin wrote: > VDPA sim stores config space as native endian, but that > is wrong: modern guests expect LE. > I coded up the following to fix it up, but it is wrong too: > vdpasim_create is called before guest features are known. > > So what should we do? New ioctl to specify the interface used? > More ideas? > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> Can we do the endian conversion in set_config/get_config()? Thanks > > > --- &...
2020 Aug 10
1
[PATCH] vdpa_sim: init iommu lock
...dpa_sim/vdpa_sim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index df3224b138ee..604d9d25ca47 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -358,6 +358,7 @@ static struct vdpasim *vdpasim_create(void) INIT_WORK(&vdpasim->work, vdpasim_work); spin_lock_init(&vdpasim->lock); + spin_lock_init(&vdpasim->iommu_lock); dev = &vdpasim->vdpa.dev; dev->coherent_dma_mask = DMA_BIT_MASK(64); -- MST
2020 Aug 03
0
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...dpasim, u16 val) +{ + return __cpu_to_virtio16(vdpasim_is_little_endian(vdpasim), val); +} + static struct vdpasim *vdpasim_dev; static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) @@ -306,7 +324,6 @@ static const struct vdpa_config_ops vdpasim_net_config_ops; static struct vdpasim *vdpasim_create(void) { - struct virtio_net_config *config; struct vdpasim *vdpasim; struct device *dev; int ret = -ENOMEM; @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) if (!vdpasim->buffer) goto err_iommu; - config = &vdpasim->config; - config->mtu = 1500; - conf...
2020 Aug 05
0
[PATCH v3 22/38] vdpa_sim: fix endian-ness of config space
...dpasim, u16 val) +{ + return __cpu_to_virtio16(vdpasim_is_little_endian(vdpasim), val); +} + static struct vdpasim *vdpasim_dev; static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) @@ -306,7 +324,6 @@ static const struct vdpa_config_ops vdpasim_net_config_ops; static struct vdpasim *vdpasim_create(void) { - struct virtio_net_config *config; struct vdpasim *vdpasim; struct device *dev; int ret = -ENOMEM; @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) if (!vdpasim->buffer) goto err_iommu; - config = &vdpasim->config; - config->mtu = 1500; - conf...
2023 Mar 02
8
[PATCH v2 0/8] vdpa_sim: add support for user VA
v2: - rebased on Linus' tree, commit ae3419fbac84 ("vc_screen: don't clobber return value in vcs_read") - removed `struct task_struct *owner` param (unused for now, maybe ?useful to support cgroups) [Jason] - add unbind_mm callback [Jason] - call the new unbind_mm callback during the release [Jason] - avoid to call bind_mm callback after the reset, since the device ?is not
2020 Aug 05
0
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...ittle_endian(vdpasim), val); > > +} > > + > > static struct vdpasim *vdpasim_dev; > > static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) > > @@ -306,7 +324,6 @@ static const struct vdpa_config_ops vdpasim_net_config_ops; > > static struct vdpasim *vdpasim_create(void) > > { > > - struct virtio_net_config *config; > > struct vdpasim *vdpasim; > > struct device *dev; > > int ret = -ENOMEM; > > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > > if (!vdpasim->buffer) > >...
2023 Mar 21
5
[PATCH v3 0/8] vdpa_sim: add support for user VA
This series adds support for the use of user virtual addresses in the vDPA simulator devices. The main reason for this change is to lift the pinning of all guest memory. Especially with virtio devices implemented in software. The next step would be to generalize the code in vdpa-sim to allow the implementation of in-kernel software devices. Similar to vhost, but using vDPA so we can reuse the
2023 Apr 07
2
[PATCH 0/2] vdpa_sim_blk: support shared backend
This series is mainly for testing live migration between 2 vdpa_sim_blk devices. The first patch is preparation and moves the buffer allocation into devices, the second patch adds the `shared_buffer_mutex` parameter to vdpa_sim_blk to use the same ramdisk for all devices. Tested with QEMU v8.0.0-rc2 in this way: modprobe vhost_vdpa modprobe vdpa_sim_blk shared_backend=true vdpa dev add mgmtdev
2023 Mar 23
1
[PATCH v3 8/8] vdpa_sim: add support for user VA
...+ return; > + kthread_use_mm(mm); > + } > > vdpasim->dev_attr.work_fn(vdpasim); > + > + if (mm) { > + kthread_unuse_mm(mm); > + mmput(mm); > + } > } > > struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr, > @@ -162,7 +210,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr, > vdpa = __vdpa_alloc_device(NULL, ops, > dev_attr->ngroups, dev_attr->nas, >...