lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACGkMEuq=17Y6E6uSRdsRG8iuMrU6j9AeVS1s1EhnfHeoB+rkA@mail.gmail.com>
Date:   Sun, 29 Jan 2023 14:03:11 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     "Longpeng(Mike)" <longpeng2@...wei.com>
Cc:     mst@...hat.com, stefanha@...hat.com, sgarzare@...hat.com,
        arei.gonglei@...wei.com, yechuan@...wei.com,
        huangzhichao@...wei.com, virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, eperezma@...hat.com
Subject: Re: [PATCH v3 1/2] vdpa: support specify the pgprot of vq
 notification area

On Sun, Jan 29, 2023 at 10:51 AM Longpeng(Mike) <longpeng2@...wei.com> wrote:
>
> From: Longpeng <longpeng2@...wei.com>
>
> Adds get_vq_notification_pgprot operation to vdpa_config_ops to support
> specify the pgprot of vq norification area. It's an optional operation,
> the vdpa framework will treat the pgprot of vq notification area as
> noncached as default as usual.

Missing sob.

Other than this.

Acked-by: Jason Wang <jasowang@...hat.com>

Thanks

> ---
>  drivers/vhost/vdpa.c | 4 +++-
>  include/linux/vdpa.h | 9 +++++++++
>  2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 166044642fd5..036fe88425c8 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -1263,7 +1263,9 @@ static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
>
>         notify = ops->get_vq_notification(vdpa, index);
>
> -       vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> +       vma->vm_page_prot = ops->get_vq_notification_pgprot ?
> +               ops->get_vq_notification_pgprot(vdpa, index, vma->vm_page_prot) :
> +               pgprot_noncached(vma->vm_page_prot);
>         if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
>                             PFN_DOWN(notify.addr), PAGE_SIZE,
>                             vma->vm_page_prot))
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 6d0f5e4e82c2..07fcf5e6abc8 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -169,6 +169,12 @@ struct vdpa_map_file {
>   *                             @vdev: vdpa device
>   *                             @idx: virtqueue index
>   *                             Returns the notifcation area
> + * @get_vq_notification_pgprot:        Get the pgprot of the vq's notification area (optional)
> + *                             @vdev: vdpa device
> + *                             @idx: virtqueue index
> + *                             @prot: original page protection value of the
> + *                                    notification area
> + *                             Returns pgprot_t: the pgprot of the notification area
>   * @get_vq_irq:                        Get the irq number of a virtqueue (optional,
>   *                             but must implemented if require vq irq offloading)
>   *                             @vdev: vdpa device
> @@ -305,6 +311,9 @@ struct vdpa_config_ops {
>                                    struct netlink_ext_ack *extack);
>         struct vdpa_notification_area
>         (*get_vq_notification)(struct vdpa_device *vdev, u16 idx);
> +       pgprot_t (*get_vq_notification_pgprot)(struct vdpa_device *vdev,
> +                                              u16 idx,
> +                                              pgprot_t prot);
>         /* vq irq is not expected to be changed once DRIVER_OK is set */
>         int (*get_vq_irq)(struct vdpa_device *vdev, u16 idx);
>
> --
> 2.23.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ