search for: vdpasim_set_features

Displaying 20 results from an estimated 22 matches for "vdpasim_set_features".

2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...h_random_addr(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa) > static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) > { > struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + struct virtio_net_config *config = &vdpasim->config; > > /* DMA mapping must be done by driver */ > if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) &...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...h_random_addr(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa) > static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) > { > struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + struct virtio_net_config *config = &vdpasim->config; > > /* DMA mapping must be done by driver */ > if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) &...
2020 Jul 16
1
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...> > More ideas? > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > > Can we do the endian conversion in set_config/get_config()? > > Thanks That is problematic at least from static checking point of view. It would be reasonable to do it in vdpasim_set_features, except legacy guests might not set features at all. So my proposal is: - set config in vdpasim_set_features - document that this is where devices should initialize config - vdpa core will maintain a "features set" flag, if get/set config is called without set features, core will call s...
2020 Aug 03
0
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...om_addr(config->mac); + eth_random_addr(vdpasim->config.mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa) static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) { struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + struct virtio_net_config *config = &vdpasim->config; /* DMA mapping must be done by driver */ if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) @@ -455,6 +470,12 @@ static int vdpa...
2020 Aug 05
0
[PATCH v3 22/38] vdpa_sim: fix endian-ness of config space
...om_addr(config->mac); + eth_random_addr(vdpasim->config.mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa) static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) { struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + struct virtio_net_config *config = &vdpasim->config; /* DMA mapping must be done by driver */ if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) @@ -455,6 +470,14 @@ static int vdpa...
2020 Aug 05
0
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...r(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > > @@ -448,6 +462,7 @@ static u64 vdpasim_get_features(struct vdpa_device *vdpa) > > static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) > > { > > struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > > + struct virtio_net_config *config = &vdpasim->config; > > /* DMA mapping must be done by driver */ > > if (!(features & (1ULL << VIRTIO_F_ACC...
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
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
2020 Jun 24
1
[PATCH] virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM
...u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) | (1ULL << VIRTIO_F_VERSION_1) | - (1ULL << VIRTIO_F_IOMMU_PLATFORM); + (1ULL << VIRTIO_F_ACCESS_PLATFORM); /* State of each vdpasim device */ struct vdpasim { @@ -450,7 +450,7 @@ static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) struct vdpasim *vdpasim = vdpa_to_sim(vdpa); /* DMA mapping must be done by driver */ - if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) + if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) return -EINVAL; vdpasim->f...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...->vqs[idx]; + struct vringh *vrh = &vq->vring; + + return vrh->last_avail_idx; +} + +static u16 vdpasim_get_vq_align(struct vdpa_device *vdpa) +{ + return VDPASIM_QUEUE_ALIGN; +} + +static u64 vdpasim_get_features(struct vdpa_device *vdpa) +{ + return vdpasim_features; +} + +static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) +{ + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + + /* DMA mapping must be done by driver */ + if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) + return -EINVAL; + + vdpasim->features = features & vdpasim_features; + + return 0; +} + +...
2020 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
...->vqs[idx]; + struct vringh *vrh = &vq->vring; + + return vrh->last_avail_idx; +} + +static u16 vdpasim_get_vq_align(struct vdpa_device *vdpa) +{ + return VDPASIM_QUEUE_ALIGN; +} + +static u64 vdpasim_get_features(struct vdpa_device *vdpa) +{ + return vdpasim_features; +} + +static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) +{ + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + + /* DMA mapping must be done by driver */ + if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) + return -EINVAL; + + vdpasim->features = features & vdpasim_features; + + return 0; +} + +...
2020 Jun 24
0
[PATCH v2 1/2] virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM
...u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) | (1ULL << VIRTIO_F_VERSION_1) | - (1ULL << VIRTIO_F_IOMMU_PLATFORM); + (1ULL << VIRTIO_F_ACCESS_PLATFORM); /* State of each vdpasim device */ struct vdpasim { @@ -450,7 +450,7 @@ static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) struct vdpasim *vdpasim = vdpa_to_sim(vdpa); /* DMA mapping must be done by driver */ - if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) + if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) return -EINVAL; vdpasim->f...
2020 Feb 10
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...rn vrh->last_avail_idx; > +} > + > +static u16 vdpasim_get_vq_align(struct vdpa_device *vdpa) > +{ > + return VDPASIM_QUEUE_ALIGN; > +} > + > +static u64 vdpasim_get_features(struct vdpa_device *vdpa) > +{ > + return vdpasim_features; > +} > + > +static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) > +{ > + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + > + /* DMA mapping must be done by driver */ > + if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) > + return -EINVAL; > + > + vdpasim->features = features &amp...
2020 Jun 24
4
[PATCH v2 0/2] virtio: modernize DMA quirks
Use generic names for the quirks to make it clear it is not just about the IOMMU, it's about DMA access in general. changes from v1: added patch 2 Michael S. Tsirkin (2): virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM virtio: virtio_has_iommu_quirk -> virtio_has_dma_quirk arch/um/drivers/virtio_uml.c | 2 +- drivers/gpu/drm/virtio/virtgpu_object.c | 2
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).
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
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 Feb 10
9
[PATCH V2 0/5] vDPA support
Hi all: This is an updated version of kernel support for vDPA device. Various changes were made based on the feedback since last verion. One major change is to drop the sysfs API and leave the management interface for future development, and introudce the incremental DMA bus operations. Please see changelog for more information. The work on vhost, IFCVF (intel VF driver for vDPA) and qemu is
2020 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
Hi All: This series tries to add the support for control virtqueue in vDPA. Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. When used by vhost-vDPA bus driver for VM, the control virtqueue should be shadowed via userspace VMM (Qemu) instead of being assigned directly to Guest. This is
2020 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
Hi All: This series tries to add the support for control virtqueue in vDPA. Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. When used by vhost-vDPA bus driver for VM, the control virtqueue should be shadowed via userspace VMM (Qemu) instead of being assigned directly to Guest. This is