From: "Michael S. Tsirkin" <mst@redhat.com>
To: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Cc: tsoni@codeaurora.org, virtio-dev@lists.oasis-open.org,
konrad.wilk@oracle.com, jan.kiszka@siemens.com,
jasowang@redhat.com, christoffer.dall@arm.com,
virtualization@lists.linux-foundation.org,
alex.bennee@linaro.org, iommu@lists.linux-foundation.org,
stefano.stabellini@xilinx.com, will@kernel.org,
linux-kernel@vger.kernel.org, pratikp@codeaurora.org
Subject: Re: [PATCH 5/5] virtio: Add bounce DMA ops
Date: Tue, 28 Apr 2020 16:41:04 -0400 [thread overview]
Message-ID: <20200428163448-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200428174952.GA5097@quicinc.com>
On Tue, Apr 28, 2020 at 11:19:52PM +0530, Srivatsa Vaddagiri wrote:
> * Michael S. Tsirkin <mst@redhat.com> [2020-04-28 12:17:57]:
>
> > Okay, but how is all this virtio specific? For example, why not allow
> > separate swiotlbs for any type of device?
> > For example, this might make sense if a given device is from a
> > different, less trusted vendor.
>
> Is swiotlb commonly used for multiple devices that may be on different trust
> boundaries (and not behind a hardware iommu)?
Even a hardware iommu does not imply a 100% security from malicious
hardware. First lots of people use iommu=pt for performance reasons.
Second even without pt, unmaps are often batched, and sub-page buffers
might be used for DMA, so we are not 100% protected at all times.
> If so, then yes it sounds like a
> good application of multiple swiotlb pools.
>
> > All this can then maybe be hidden behind the DMA API.
>
> Won't we still need some changes to virtio to make use of its own pool (to
> bounce buffers)? Something similar to its own DMA ops proposed in this patch?
If you are doing this for all devices, you need to either find a way
to do this without chaning DMA ops, or by doing some automatic change
to all drivers.
> > > +void virtio_bounce_set_dma_ops(struct virtio_device *vdev)
> > > +{
> > > + if (!bounce_buf_paddr)
> > > + return;
> > > +
> > > + set_dma_ops(vdev->dev.parent, &virtio_dma_ops);
> >
> >
> > I don't think DMA API maintainers will be happy with new users
> > of set_dma_ops.
>
> Is there an alternate API that is more preffered?
all this is supposed to be part of DMA API itself. new drivers aren't
supposed to have custom DMA ops.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Cc: konrad.wilk@oracle.com, jasowang@redhat.com,
jan.kiszka@siemens.com, will@kernel.org,
stefano.stabellini@xilinx.com, iommu@lists.linux-foundation.org,
virtualization@lists.linux-foundation.org,
virtio-dev@lists.oasis-open.org, tsoni@codeaurora.org,
pratikp@codeaurora.org, christoffer.dall@arm.com,
alex.bennee@linaro.org, linux-kernel@vger.kernel.org
Subject: [virtio-dev] Re: [PATCH 5/5] virtio: Add bounce DMA ops
Date: Tue, 28 Apr 2020 16:41:04 -0400 [thread overview]
Message-ID: <20200428163448-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200428174952.GA5097@quicinc.com>
On Tue, Apr 28, 2020 at 11:19:52PM +0530, Srivatsa Vaddagiri wrote:
> * Michael S. Tsirkin <mst@redhat.com> [2020-04-28 12:17:57]:
>
> > Okay, but how is all this virtio specific? For example, why not allow
> > separate swiotlbs for any type of device?
> > For example, this might make sense if a given device is from a
> > different, less trusted vendor.
>
> Is swiotlb commonly used for multiple devices that may be on different trust
> boundaries (and not behind a hardware iommu)?
Even a hardware iommu does not imply a 100% security from malicious
hardware. First lots of people use iommu=pt for performance reasons.
Second even without pt, unmaps are often batched, and sub-page buffers
might be used for DMA, so we are not 100% protected at all times.
> If so, then yes it sounds like a
> good application of multiple swiotlb pools.
>
> > All this can then maybe be hidden behind the DMA API.
>
> Won't we still need some changes to virtio to make use of its own pool (to
> bounce buffers)? Something similar to its own DMA ops proposed in this patch?
If you are doing this for all devices, you need to either find a way
to do this without chaning DMA ops, or by doing some automatic change
to all drivers.
> > > +void virtio_bounce_set_dma_ops(struct virtio_device *vdev)
> > > +{
> > > + if (!bounce_buf_paddr)
> > > + return;
> > > +
> > > + set_dma_ops(vdev->dev.parent, &virtio_dma_ops);
> >
> >
> > I don't think DMA API maintainers will be happy with new users
> > of set_dma_ops.
>
> Is there an alternate API that is more preffered?
all this is supposed to be part of DMA API itself. new drivers aren't
supposed to have custom DMA ops.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Cc: konrad.wilk@oracle.com, jasowang@redhat.com,
jan.kiszka@siemens.com, will@kernel.org,
stefano.stabellini@xilinx.com, iommu@lists.linux-foundation.org,
virtualization@lists.linux-foundation.org,
virtio-dev@lists.oasis-open.org, tsoni@codeaurora.org,
pratikp@codeaurora.org, christoffer.dall@arm.com,
alex.bennee@linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] virtio: Add bounce DMA ops
Date: Tue, 28 Apr 2020 16:41:04 -0400 [thread overview]
Message-ID: <20200428163448-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200428174952.GA5097@quicinc.com>
On Tue, Apr 28, 2020 at 11:19:52PM +0530, Srivatsa Vaddagiri wrote:
> * Michael S. Tsirkin <mst@redhat.com> [2020-04-28 12:17:57]:
>
> > Okay, but how is all this virtio specific? For example, why not allow
> > separate swiotlbs for any type of device?
> > For example, this might make sense if a given device is from a
> > different, less trusted vendor.
>
> Is swiotlb commonly used for multiple devices that may be on different trust
> boundaries (and not behind a hardware iommu)?
Even a hardware iommu does not imply a 100% security from malicious
hardware. First lots of people use iommu=pt for performance reasons.
Second even without pt, unmaps are often batched, and sub-page buffers
might be used for DMA, so we are not 100% protected at all times.
> If so, then yes it sounds like a
> good application of multiple swiotlb pools.
>
> > All this can then maybe be hidden behind the DMA API.
>
> Won't we still need some changes to virtio to make use of its own pool (to
> bounce buffers)? Something similar to its own DMA ops proposed in this patch?
If you are doing this for all devices, you need to either find a way
to do this without chaning DMA ops, or by doing some automatic change
to all drivers.
> > > +void virtio_bounce_set_dma_ops(struct virtio_device *vdev)
> > > +{
> > > + if (!bounce_buf_paddr)
> > > + return;
> > > +
> > > + set_dma_ops(vdev->dev.parent, &virtio_dma_ops);
> >
> >
> > I don't think DMA API maintainers will be happy with new users
> > of set_dma_ops.
>
> Is there an alternate API that is more preffered?
all this is supposed to be part of DMA API itself. new drivers aren't
supposed to have custom DMA ops.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
next prev parent reply other threads:[~2020-04-28 20:41 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 11:39 [PATCH 0/5] virtio on Type-1 hypervisor Srivatsa Vaddagiri
2020-04-28 11:39 ` Srivatsa Vaddagiri
2020-04-28 11:39 ` [PATCH 1/5] swiotlb: Introduce concept of swiotlb_pool Srivatsa Vaddagiri
2020-04-28 11:39 ` Srivatsa Vaddagiri
2020-04-29 0:31 ` kbuild test robot
2020-04-29 0:31 ` kbuild test robot
2020-04-29 0:31 ` kbuild test robot
2020-04-29 0:31 ` kbuild test robot
2020-04-28 11:39 ` [PATCH 2/5] swiotlb: Allow for non-linear mapping between paddr and vaddr Srivatsa Vaddagiri
2020-04-28 11:39 ` Srivatsa Vaddagiri
2020-04-28 11:39 ` [PATCH 3/5] swiotlb: Add alloc and free APIs Srivatsa Vaddagiri
2020-04-28 11:39 ` Srivatsa Vaddagiri
2020-04-30 4:18 ` kbuild test robot
2020-04-30 4:18 ` kbuild test robot
2020-04-30 4:18 ` kbuild test robot
2020-04-30 4:18 ` kbuild test robot
2020-04-28 11:39 ` [PATCH 4/5] swiotlb: Add API to register new pool Srivatsa Vaddagiri
2020-04-28 11:39 ` Srivatsa Vaddagiri
2020-04-28 11:39 ` [PATCH 5/5] virtio: Add bounce DMA ops Srivatsa Vaddagiri
2020-04-28 11:39 ` Srivatsa Vaddagiri
2020-04-28 16:17 ` Michael S. Tsirkin
2020-04-28 16:17 ` Michael S. Tsirkin
2020-04-28 16:17 ` [virtio-dev] " Michael S. Tsirkin
2020-04-28 17:49 ` Srivatsa Vaddagiri
2020-04-28 17:49 ` Srivatsa Vaddagiri
2020-04-28 17:49 ` Srivatsa Vaddagiri
2020-04-28 20:41 ` Michael S. Tsirkin [this message]
2020-04-28 20:41 ` Michael S. Tsirkin
2020-04-28 20:41 ` [virtio-dev] " Michael S. Tsirkin
2020-04-28 23:04 ` Stefano Stabellini
2020-04-28 23:04 ` Stefano Stabellini
2020-04-29 4:09 ` Srivatsa Vaddagiri
2020-04-29 4:09 ` Srivatsa Vaddagiri
2020-04-29 2:22 ` Lu Baolu
2020-04-29 2:22 ` Lu Baolu
2020-04-29 4:57 ` Michael S. Tsirkin
2020-04-29 4:57 ` Michael S. Tsirkin
2020-04-29 4:57 ` [virtio-dev] " Michael S. Tsirkin
2020-04-29 5:42 ` Lu Baolu
2020-04-29 5:42 ` Lu Baolu
2020-04-29 6:50 ` Michael S. Tsirkin
2020-04-29 6:50 ` Michael S. Tsirkin
2020-04-29 6:50 ` [virtio-dev] " Michael S. Tsirkin
2020-04-29 7:01 ` Lu Baolu
2020-04-29 7:01 ` Lu Baolu
2020-04-29 9:44 ` Srivatsa Vaddagiri
2020-04-29 9:44 ` Srivatsa Vaddagiri
2020-04-29 9:52 ` Michael S. Tsirkin
2020-04-29 9:52 ` Michael S. Tsirkin
2020-04-29 9:52 ` [virtio-dev] " Michael S. Tsirkin
2020-04-29 10:09 ` Srivatsa Vaddagiri
2020-04-29 10:09 ` Srivatsa Vaddagiri
2020-04-29 10:20 ` Michael S. Tsirkin
2020-04-29 10:20 ` Michael S. Tsirkin
2020-04-29 10:20 ` [virtio-dev] " Michael S. Tsirkin
2020-04-29 10:26 ` Jan Kiszka
2020-04-29 10:26 ` Jan Kiszka
2020-04-29 10:26 ` [virtio-dev] " Jan Kiszka
2020-04-29 10:45 ` Michael S. Tsirkin
2020-04-29 10:45 ` Michael S. Tsirkin
2020-04-29 10:45 ` [virtio-dev] " Michael S. Tsirkin
2020-04-29 10:55 ` Jan Kiszka
2020-04-29 10:55 ` Jan Kiszka
2020-04-29 10:55 ` Jan Kiszka
2020-04-29 10:55 ` [virtio-dev] " Jan Kiszka
2020-04-29 10:34 ` Srivatsa Vaddagiri
2020-04-29 10:34 ` Srivatsa Vaddagiri
2020-04-30 15:20 ` Konrad Rzeszutek Wilk
2020-04-30 15:20 ` Konrad Rzeszutek Wilk
2020-04-30 15:20 ` Konrad Rzeszutek Wilk
2020-04-29 3:35 ` Srivatsa Vaddagiri
2020-04-29 3:35 ` Srivatsa Vaddagiri
2020-04-28 21:35 ` kbuild test robot
2020-04-28 21:35 ` kbuild test robot
2020-04-28 21:35 ` kbuild test robot
2020-04-28 21:35 ` kbuild test robot
2020-04-28 22:18 ` kbuild test robot
2020-04-28 22:18 ` kbuild test robot
2020-04-28 22:18 ` kbuild test robot
2020-04-28 22:18 ` kbuild test robot
2020-04-28 22:53 ` Stefano Stabellini
2020-04-28 22:53 ` Stefano Stabellini
2020-04-29 21:06 ` kbuild test robot
2020-04-29 21:06 ` kbuild test robot
2020-04-29 21:06 ` kbuild test robot
2020-04-29 21:06 ` kbuild test robot
2020-04-29 21:06 ` [RFC PATCH] virtio: virtio_pool can be static kbuild test robot
2020-04-29 21:06 ` kbuild test robot
2020-04-29 21:06 ` kbuild test robot
2020-04-29 21:06 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200428163448-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=christoffer.dall@arm.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jan.kiszka@siemens.com \
--cc=jasowang@redhat.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pratikp@codeaurora.org \
--cc=stefano.stabellini@xilinx.com \
--cc=tsoni@codeaurora.org \
--cc=vatsa@codeaurora.org \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.