Displaying 20 results from an estimated 43 matches for "vdpa_notification_area".
2020 May 29
1
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...> }
>
> +static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
> +{
> + struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
> + struct vdpa_device *vdpa = v->vdpa;
> + const struct vdpa_config_ops *ops = vdpa->config;
> + struct vdpa_notification_area notify;
> + struct vm_area_struct *vma = vmf->vma;
> + u16 index = vma->vm_pgoff;
> +
> + notify = ops->get_vq_notification(vdpa, index);
> +
> + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> + if (remap_pfn_range(vma, v...
2020 Jun 10
1
[PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()
...pa.c
index 7580e34f76c10..a54b60d6623f0 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -818,7 +818,7 @@ static int vhost_vdpa_mmap(struct file *file, struct vm_area_struct *vma)
struct vdpa_device *vdpa = v->vdpa;
const struct vdpa_config_ops *ops = vdpa->config;
struct vdpa_notification_area notify;
- int index = vma->vm_pgoff;
+ unsigned long index = vma->vm_pgoff;
if (vma->vm_end - vma->vm_start != PAGE_SIZE)
return -EINVAL;
--
2.26.2
2020 May 29
12
[PATCH 0/6] vDPA: doorbell mapping
Hi all:
This series introduce basic functionality of doorbell mapping support
for vhost-vDPA. Userspace program may use mmap() to map a the doorbell
of a specific virtqueue into its address space. This is help to reudce
the syscall or vmexit overhead.
A new vdpa_config_ops was introduced to report the location of the
doorbell, vhost_vdpa may then choose to map the doorbell when:
- The doorbell
2020 May 29
12
[PATCH 0/6] vDPA: doorbell mapping
Hi all:
This series introduce basic functionality of doorbell mapping support
for vhost-vDPA. Userspace program may use mmap() to map a the doorbell
of a specific virtqueue into its address space. This is help to reudce
the syscall or vmexit overhead.
A new vdpa_config_ops was introduced to report the location of the
doorbell, vhost_vdpa may then choose to map the doorbell when:
- The doorbell
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
..._release(struct inode *inode, struct file *filep)
return 0;
}
+static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
+{
+ struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
+ struct vdpa_device *vdpa = v->vdpa;
+ const struct vdpa_config_ops *ops = vdpa->config;
+ struct vdpa_notification_area notify;
+ struct vm_area_struct *vma = vmf->vma;
+ u16 index = vma->vm_pgoff;
+
+ notify = ops->get_vq_notification(vdpa, index);
+
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+ if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
+ notify.addr >> PAGE...
2020 Jun 01
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...drivers/vhost/vdpa.c
742
743 static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
744 {
745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
746 struct vdpa_device *vdpa = v->vdpa;
747 const struct vdpa_config_ops *ops = vdpa->config;
748 struct vdpa_notification_area notify;
749 struct vm_area_struct *vma = vmf->vma;
750 u16 index = vma->vm_pgoff;
751
752 notify = ops->get_vq_notification(vdpa, index);
753
> 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
755 if (remap_pfn_range(vma, vmf->address &...
2020 Jun 01
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...drivers/vhost/vdpa.c
742
743 static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
744 {
745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
746 struct vdpa_device *vdpa = v->vdpa;
747 const struct vdpa_config_ops *ops = vdpa->config;
748 struct vdpa_notification_area notify;
749 struct vm_area_struct *vma = vmf->vma;
750 u16 index = vma->vm_pgoff;
751
752 notify = ops->get_vq_notification(vdpa, index);
753
> 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
755 if (remap_pfn_range(vma, vmf->address &...
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...gt;> ? +static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
>> +{
>> +??? struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
>> +??? struct vdpa_device *vdpa = v->vdpa;
>> +??? const struct vdpa_config_ops *ops = vdpa->config;
>> +??? struct vdpa_notification_area notify;
>> +??? struct vm_area_struct *vma = vmf->vma;
>> +??? u16 index = vma->vm_pgoff;
>> +
>> +??? notify = ops->get_vq_notification(vdpa, index);
>> +
>> +??? vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
>> +??? if (remap_pfn...
2020 Jun 02
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...ult_t vhost_vdpa_fault(struct vm_fault *vmf)
>> 744 {
>> 745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
>> 746 struct vdpa_device *vdpa = v->vdpa;
>> 747 const struct vdpa_config_ops *ops = vdpa->config;
>> 748 struct vdpa_notification_area notify;
>> 749 struct vm_area_struct *vma = vmf->vma;
>> 750 u16 index = vma->vm_pgoff;
>> 751
>> 752 notify = ops->get_vq_notification(vdpa, index);
>> 753
>> > 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_p...
2020 Jun 02
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...ult_t vhost_vdpa_fault(struct vm_fault *vmf)
>> 744 {
>> 745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
>> 746 struct vdpa_device *vdpa = v->vdpa;
>> 747 const struct vdpa_config_ops *ops = vdpa->config;
>> 748 struct vdpa_notification_area notify;
>> 749 struct vm_area_struct *vma = vmf->vma;
>> 750 u16 index = vma->vm_pgoff;
>> 751
>> 752 notify = ops->get_vq_notification(vdpa, index);
>> 753
>> > 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_p...
2023 Jan 29
1
[PATCH v3 2/2] vdpasim: support doorbell mapping
...u16 qid, pgprot_t prot)
> +{
> + /*
> + * We use normal RAM pages to emulate the vq notification area, so
> + * just keep the pgprot as it mmaped.
> + */
> + return prot;
> +}
> +
> +static struct vdpa_notification_area
> +vdpasim_get_vq_notification(struct vdpa_device *vdpa, u16 qid)
> +{
> + struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
> + struct vdpa_notification_area notify;
> +
> + notify.addr = virt_to_phys((void *)vdpasim->notify);
> + notify.size = PAGE_SIZE;...
2020 Jun 03
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...>>>> 744 {
>>>> 745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
>>>> 746 struct vdpa_device *vdpa = v->vdpa;
>>>> 747 const struct vdpa_config_ops *ops = vdpa->config;
>>>> 748 struct vdpa_notification_area notify;
>>>> 749 struct vm_area_struct *vma = vmf->vma;
>>>> 750 u16 index = vma->vm_pgoff;
>>>> 751
>>>> 752 notify = ops->get_vq_notification(vdpa, index);
>>>> 753
>>>> > 754 vma...
2020 Jun 03
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...>>>> 744 {
>>>> 745 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
>>>> 746 struct vdpa_device *vdpa = v->vdpa;
>>>> 747 const struct vdpa_config_ops *ops = vdpa->config;
>>>> 748 struct vdpa_notification_area notify;
>>>> 749 struct vm_area_struct *vma = vmf->vma;
>>>> 750 u16 index = vma->vm_pgoff;
>>>> 751
>>>> 752 notify = ops->get_vq_notification(vdpa, index);
>>>> 753
>>>> > 754 vma...
2020 Aug 05
2
[PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy
...; err = dev_set_name(&vdev->dev, "vdpa%u", vdev->index);
> if (err)
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 239db794357c..29b8296f1414 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -33,12 +33,14 @@ struct vdpa_notification_area {
> * @dma_dev: the actual device that is performing DMA
> * @config: the configuration ops for this device.
> * @index: device index
> + * @features_valid: were features initialized? for legacy guests
> */
> struct vdpa_device {
> struct device dev;
> st...
2020 Aug 05
2
[PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy
...; err = dev_set_name(&vdev->dev, "vdpa%u", vdev->index);
> if (err)
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 239db794357c..29b8296f1414 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -33,12 +33,14 @@ struct vdpa_notification_area {
> * @dma_dev: the actual device that is performing DMA
> * @config: the configuration ops for this device.
> * @index: device index
> + * @features_valid: were features initialized? for legacy guests
> */
> struct vdpa_device {
> struct device dev;
> st...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
>> +
>> + return vp_ioread16(&vp_vdpa->common->queue_size);
>> +}
>> +
>> +static u64 vp_vdpa_get_vq_state(struct vdpa_device *vdpa, u16 qid)
>> +{
>> + return 0;
>> +}
>> +
>> +static struct vdpa_notification_area
>> +vp_vdpa_get_vq_notification(struct vdpa_device *vdpa, u16 qid)
>> +{
>> + struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
>> + struct vdpa_notification_area notify;
>> +
>> + notify.addr = vp_vdpa->vring[qid].notify_pa;
>> + notify.size = vp_vdpa->not...
2020 Jun 10
2
[PATCH V3] vdpa: introduce virtio pci driver
...vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
>> +
>> + return vp_ioread16(&vp_vdpa->common->queue_size);
>> +}
>> +
>> +static u64 vp_vdpa_get_vq_state(struct vdpa_device *vdpa, u16 qid)
>> +{
>> + return 0;
>> +}
>> +
>> +static struct vdpa_notification_area
>> +vp_vdpa_get_vq_notification(struct vdpa_device *vdpa, u16 qid)
>> +{
>> + struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
>> + struct vdpa_notification_area notify;
>> +
>> + notify.addr = vp_vdpa->vring[qid].notify_pa;
>> + notify.size = vp_vdpa->not...
2020 Jul 16
0
[PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state
...IT(VQ_STATE_NOT_READY);
> state->avail_index = vrh->last_avail_idx;
> }
>
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 7b088bebffe8..bcefa30a3b2f 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -27,12 +27,21 @@ struct vdpa_notification_area {
> resource_size_t size;
> };
>
> +/**
> + * Bitmask describing the status of the vq
> + */
> +enum {
> + VQ_STATE_NOT_READY = 0,
> +};
> +
> /**
> * vDPA vq_state definition
> * @avail_index: available index
> + * @state: returned status f...
2020 Jul 28
0
[PATCH V4 3/6] vDPA: add get_vq_irq() in vdpa_config_ops
...since the function will return a u32.
Thanks
> * @get_vq_align: Get the virtqueue align requirement
> * for the device
> * @vdev: vdpa device
> @@ -178,6 +183,7 @@ struct vdpa_config_ops {
> u64 (*get_vq_state)(struct vdpa_device *vdev, u16 idx);
> struct vdpa_notification_area
> (*get_vq_notification)(struct vdpa_device *vdev, u16 idx);
> + u32 (*get_vq_irq)(struct vdpa_device *vdv, u16 idx);
>
> /* Device ops */
> u32 (*get_vq_align)(struct vdpa_device *vdev);
2020 Aug 03
0
[PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy
...dev->features_valid = false;
err = dev_set_name(&vdev->dev, "vdpa%u", vdev->index);
if (err)
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 239db794357c..29b8296f1414 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -33,12 +33,14 @@ struct vdpa_notification_area {
* @dma_dev: the actual device that is performing DMA
* @config: the configuration ops for this device.
* @index: device index
+ * @features_valid: were features initialized? for legacy guests
*/
struct vdpa_device {
struct device dev;
struct device *dma_dev;
const struct vdpa_confi...