search for: vhost_vdpa_get_device_id

Displaying 18 results from an estimated 18 matches for "vhost_vdpa_get_device_id".

2023 Mar 21
1
[PATCH v3 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks
...>bind_mm(vdpa, v->vdev.mm); +} + +static void vhost_vdpa_unbind_mm(struct vhost_vdpa *v) +{ + struct vdpa_device *vdpa = v->vdpa; + const struct vdpa_config_ops *ops = vdpa->config; + + if (!vdpa->use_va || !ops->unbind_mm) + return; + + ops->unbind_mm(vdpa); +} + static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) { struct vdpa_device *vdpa = v->vdpa; @@ -709,6 +731,14 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep, case VHOST_VDPA_RESUME: r = vhost_vdpa_resume(v); break; + case VHOST_SET_OWNER: + r = vhost_dev_set_owner(d); + if (r) + bre...
2023 Mar 23
1
[PATCH v3 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks
...v) > +{ > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > + > + if (!vdpa->use_va || !ops->unbind_mm) > + return; > + > + ops->unbind_mm(vdpa); > +} > + > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > { > struct vdpa_device *vdpa = v->vdpa; > @@ -709,6 +731,14 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep, > case VHOST_VDPA_RESUME: > r = vhost_vdpa_resume(v); > break; >...
2020 Feb 05
0
[PATCH] vhost: introduce vDPA based backend
...> + > > +static void vhost_vdpa_reset(struct vhost_vdpa *v) > > +{ > > + struct vdpa_device *vdpa = v->vdpa; > > + const struct vdpa_config_ops *ops = vdpa->config; > > + > > + ops->set_status(vdpa, 0); > > +} > > + > > +static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > > +{ > > + struct vdpa_device *vdpa = v->vdpa; > > + const struct vdpa_config_ops *ops = vdpa->config; > > + u32 device_id; > > + > > + device_id = ops->get_device_id(vdpa); > > + > > + if (copy_to_use...
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...ch; > }; > > static DEFINE_IDA(vhost_vdpa_ida); > @@ -125,6 +128,7 @@ static void vhost_vdpa_reset(struct vhost_vdpa *v) > const struct vdpa_config_ops *ops = vdpa->config; > > ops->set_status(vdpa, 0); > + v->in_batch = 0; > } > > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, > > if (ops->dma_map) > r = ops->dma_map(vdpa, iova, size, pa, perm); > - else if (ops->set_map) > - r = ops->set_map(vdpa, dev->iotlb); > - else...
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...ch; > }; > > static DEFINE_IDA(vhost_vdpa_ida); > @@ -125,6 +128,7 @@ static void vhost_vdpa_reset(struct vhost_vdpa *v) > const struct vdpa_config_ops *ops = vdpa->config; > > ops->set_status(vdpa, 0); > + v->in_batch = 0; > } > > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, > > if (ops->dma_map) > r = ops->dma_map(vdpa, iova, size, pa, perm); > - else if (ops->set_map) > - r = ops->set_map(vdpa, dev->iotlb); > - else...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
...1); > + > + return IRQ_HANDLED; > +} > + > +static void vhost_vdpa_reset(struct vhost_vdpa *v) > +{ > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > + > + ops->set_status(vdpa, 0); > +} > + > +static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > +{ > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > + u32 device_id; > + > + device_id = ops->get_device_id(vdpa); > + > + if (copy_to_user(argp, &device_id, sizeof(device_id...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
...1); > + > + return IRQ_HANDLED; > +} > + > +static void vhost_vdpa_reset(struct vhost_vdpa *v) > +{ > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > + > + ops->set_status(vdpa, 0); > +} > + > +static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > +{ > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > + u32 device_id; > + > + device_id = ops->get_device_id(vdpa); > + > + if (copy_to_user(argp, &device_id, sizeof(device_id...
2020 Aug 05
0
[PATCH v3 20/38] vhost/vdpa: switch to new helpers
....c @@ -118,9 +118,8 @@ static irqreturn_t vhost_vdpa_config_cb(void *private) static void vhost_vdpa_reset(struct vhost_vdpa *v) { struct vdpa_device *vdpa = v->vdpa; - const struct vdpa_config_ops *ops = vdpa->config; - ops->set_status(vdpa, 0); + vdpa_reset(vdpa); } static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) @@ -196,7 +195,6 @@ static long vhost_vdpa_get_config(struct vhost_vdpa *v, struct vhost_vdpa_config __user *c) { struct vdpa_device *vdpa = v->vdpa; - const struct vdpa_config_ops *ops = vdpa->config; struct vhost_vdpa_config config; unsig...
2023 Feb 23
0
[PATCH v2 11/13] vdpa: block migration if dev does not have _F_SUSPEND
...ST_BACKEND_F_SUSPEND feature."); >>> + } >> >> I wonder why not let the device to decide? For networking device, we can >> live without suspend probably. >> > Right, but how can we know if this is a net device in init? I don't > think a switch (vhost_vdpa_get_device_id(dev)) is elegant. I meant the caller of vhost_vdpa_init() which is net_init_vhost_vdpa(). Thanks > > If the parent device does not need to be suspended i'd go with > exposing a suspend ioctl but do nothing in the parent device. After > that, it could even choose to return an er...
2020 Jun 29
1
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...vdpa_ida); > > > @@ -125,6 +128,7 @@ static void vhost_vdpa_reset(struct vhost_vdpa *v) > > > const struct vdpa_config_ops *ops = vdpa->config; > > > ops->set_status(vdpa, 0); > > > + v->in_batch = 0; > > > } > > > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > > > @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, > > > if (ops->dma_map) > > > r = ops->dma_map(vdpa, iova, size, pa, perm); > > > - else if (ops->set_map) > > > - r = ops-...
2020 Jun 18
0
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...t minor; struct eventfd_ctx *config_ctx; + int in_batch; }; static DEFINE_IDA(vhost_vdpa_ida); @@ -125,6 +128,7 @@ static void vhost_vdpa_reset(struct vhost_vdpa *v) const struct vdpa_config_ops *ops = vdpa->config; ops->set_status(vdpa, 0); + v->in_batch = 0; } static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, if (ops->dma_map) r = ops->dma_map(vdpa, iova, size, pa, perm); - else if (ops->set_map) - r = ops->set_map(vdpa, dev->iotlb); - else + else if (ops->set_map) { + i...
2020 Jun 29
0
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...E_IDA(vhost_vdpa_ida); >> @@ -125,6 +128,7 @@ static void vhost_vdpa_reset(struct vhost_vdpa *v) >> const struct vdpa_config_ops *ops = vdpa->config; >> >> ops->set_status(vdpa, 0); >> + v->in_batch = 0; >> } >> >> static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) >> @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, >> >> if (ops->dma_map) >> r = ops->dma_map(vdpa, iova, size, pa, perm); >> - else if (ops->set_map) >> - r = ops->set_map(vdpa,...
2020 Jun 18
6
[PATCH RFC 0/5] support batched IOTLB updating in vhost-vdpa
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is deisgend to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or
2020 Jul 01
5
[PATCH 0/5]
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is designed to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or
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 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
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 Aug 03
51
[PATCH v2 00/24] virtio: config space endian-ness cleanup
Config space endian-ness is currently a mess: fields are not tagged with the correct endian-ness so it's easy to make mistakes like instanciating config space in native endian-ness. The following patches adding sparse tagging are currently in my tree. Lightly tested. As a follow-up, I plan to add new APIs that handle modern config space in a more efficient way (bypassing the version check).