Re: [PATCH V4 5/5] vdpasim: vDPA device simulator

2020-02-20 Thread Jason Wang
On 2020/2/20 下午11:12, Jason Gunthorpe wrote: On Thu, Feb 20, 2020 at 02:11:41PM +0800, Jason Wang wrote: +static void vdpasim_device_release(struct device *dev) +{ + struct vdpasim *vdpasim = dev_to_sim(dev); + + cancel_work_sync(&vdpasim->work); + kfree(vdpasim->buffer); +

Re: [PATCH V4 3/5] vDPA: introduce vDPA bus

2020-02-20 Thread Jason Wang
On 2020/2/20 下午11:14, Jason Gunthorpe wrote: On Thu, Feb 20, 2020 at 02:11:39PM +0800, Jason Wang wrote: vDPA device is a device that uses a datapath which complies with the virtio specifications with vendor specific control path. vDPA devices can be both physically located on the hardware or e

Re: [PATCH v2 3/4] drm/mgag200: Use simple encoder

2020-02-20 Thread Thomas Zimmermann
Hi Sam thanks for reviewing the patch set. Am 20.02.20 um 19:56 schrieb Sam Ravnborg: > Hi Thomas. > > On Tue, Feb 18, 2020 at 09:48:14AM +0100, Thomas Zimmermann wrote: >> The mgag200 driver uses an empty implementation for its encoder. Replace >> the code with the generic simple encoder. >> >>

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-20 Thread Jason Wang
On 2020/2/21 上午12:06, Halil Pasic wrote: Currently if one intends to run a memory protection enabled VM with virtio devices and linux as the guest OS, one needs to specify the VIRTIO_F_IOMMU_PLATFORM flag for each virtio device to make the guest linux use the DMA API, which in turn handles the m

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread Jason Wang
On 2020/2/21 上午10:59, David Gibson wrote: On Thu, Feb 20, 2020 at 05:13:09PM +0100, Christoph Hellwig wrote: On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 867c7ebd3f10..fafc8f924955 100644 --- a/drive

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread David Gibson
On Thu, Feb 20, 2020 at 05:17:48PM -0800, Ram Pai wrote: > On Thu, Feb 20, 2020 at 03:55:14PM -0500, Michael S. Tsirkin wrote: > > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > > Currently the advanced guest memory protection technologies (AMD SEV, > > > powerpc secure guest tech

Re: [PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM

2020-02-20 Thread Tyler Sanderson via Virtualization
Testing this patch is on my short-term TODO list, but I wasn't able to get to it this week. It is prioritized. In the meantime, I can anecdotally vouch that kernels before 4.19, the ones using the OOM notifier callback, have roughly 10x faster balloon inflation when pressuring the cache. So I anti

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread David Gibson
On Thu, Feb 20, 2020 at 05:13:09PM +0100, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > index 867c7ebd3f10..fafc8f924955 100644 > > --- a/drivers/virtio/virtio_ring.c > > +++ b

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-20 Thread David Gibson
On Thu, Feb 20, 2020 at 05:31:35PM +0100, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:23:20PM +0100, Christian Borntraeger wrote: > > >From a users perspective it makes absolutely perfect sense to use the > > bounce buffers when they are NEEDED. > > Forcing the user to specify iommu_plat

RE: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread Ram Pai
On Thu, Feb 20, 2020 at 03:55:14PM -0500, Michael S. Tsirkin wrote: > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > Currently the advanced guest memory protection technologies (AMD SEV, > > powerpc secure guest technology and s390 Protected VMs) abuse the > > VIRTIO_F_IOMMU_PLATF

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-20 Thread Michael S. Tsirkin
On Thu, Feb 20, 2020 at 05:06:04PM +0100, Halil Pasic wrote: > For vhost-net the feature VIRTIO_F_IOMMU_PLATFORM has the following side > effect The vhost code assumes it the addresses on the virtio descriptor > ring are not guest physical addresses but iova's, and insists on doing a > translation

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-20 Thread Michael S. Tsirkin
On Thu, Feb 20, 2020 at 05:06:04PM +0100, Halil Pasic wrote: > * This usage is not congruent with standardised semantics of > VIRTIO_F_IOMMU_PLATFORM. Guest memory protected is an orthogonal reason > for using DMA API in virtio (orthogonal with respect to what is > expressed by VIRTIO_F_IOMMU_PLAT

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread Michael S. Tsirkin
On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > Currently the advanced guest memory protection technologies (AMD SEV, > powerpc secure guest technology and s390 Protected VMs) abuse the > VIRTIO_F_IOMMU_PLATFORM flag to make virtio core use the DMA API, which > is in turn necessary,

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-20 Thread Michael S. Tsirkin
On Thu, Feb 20, 2020 at 05:06:04PM +0100, Halil Pasic wrote: > Currently if one intends to run a memory protection enabled VM with > virtio devices and linux as the guest OS, one needs to specify the > VIRTIO_F_IOMMU_PLATFORM flag for each virtio device to make the guest > linux use the DMA API, wh

Re: [PATCH] virtio: Work around frames incorrectly marked as gso

2020-02-20 Thread Anton Ivanov
On 20/02/2020 07:58, Michael S. Tsirkin wrote: On Thu, Feb 13, 2020 at 04:23:24PM +, Anton Ivanov wrote: On 13/02/2020 15:53, Michael S. Tsirkin wrote: On Thu, Feb 13, 2020 at 07:44:06AM -0800, Eric Dumazet wrote: On 2/13/20 2:00 AM, Michael S. Tsirkin wrote: On Wed, Feb 12, 2020 at 05:3

Re: [PATCH v2 4/4] drm/qxl: Use simple encoder

2020-02-20 Thread Sam Ravnborg
Hi Thomas. On Tue, Feb 18, 2020 at 09:48:15AM +0100, Thomas Zimmermann wrote: > The qxl driver uses an empty implementation for its encoder. Replace > the code with the generic simple encoder. > > v2: > * rebase onto new simple-encoder interface > > Signed-off-by: Thomas Zimmermann I look

Re: [PATCH v2 2/4] drm/ast: Use simple encoder

2020-02-20 Thread Sam Ravnborg
Hi Thomas. On Tue, Feb 18, 2020 at 09:48:13AM +0100, Thomas Zimmermann wrote: > The ast driver uses an empty implementation for its encoder. Replace > the code with the generic simple encoder. > > v2: > * rebase onto new simple-encoder interface > > Signed-off-by: Thomas Zimmermann >From

Re: [PATCH v2 3/4] drm/mgag200: Use simple encoder

2020-02-20 Thread Sam Ravnborg
Hi Thomas. On Tue, Feb 18, 2020 at 09:48:14AM +0100, Thomas Zimmermann wrote: > The mgag200 driver uses an empty implementation for its encoder. Replace > the code with the generic simple encoder. > > v2: > * rebase onto new simple-encoder interface > > Signed-off-by: Thomas Zimmermann >

Re: [PATCH v2 1/4] drm/simple-kms: Add drm_simple_encoder_{init, create}()

2020-02-20 Thread Sam Ravnborg
Hi Thomas. On Tue, Feb 18, 2020 at 09:48:12AM +0100, Thomas Zimmermann wrote: > This patch makes the internal encoder implementation of the simple > KMS helpers available to drivers. > > These simple-encoder helpers initialize an encoder with an empty > implementation. This covers the requirement

Re: [PATCH v2 1/4] drm/simple-kms: Add drm_simple_encoder_{init, create}()

2020-02-20 Thread Sam Ravnborg
Hi Thomas. On Tue, Feb 18, 2020 at 09:48:12AM +0100, Thomas Zimmermann wrote: > This patch makes the internal encoder implementation of the simple > KMS helpers available to drivers. > > These simple-encoder helpers initialize an encoder with an empty > implementation. This covers the requirement

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-20 Thread Christian Borntraeger
On 20.02.20 17:31, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:23:20PM +0100, Christian Borntraeger wrote: >> >From a users perspective it makes absolutely perfect sense to use the >> bounce buffers when they are NEEDED. >> Forcing the user to specify iommu_platform just because you n

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-20 Thread Christoph Hellwig
On Thu, Feb 20, 2020 at 05:23:20PM +0100, Christian Borntraeger wrote: > >From a users perspective it makes absolutely perfect sense to use the > bounce buffers when they are NEEDED. > Forcing the user to specify iommu_platform just because you need bounce > buffers > really feels wrong. And obvi

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-20 Thread Christian Borntraeger
On 20.02.20 17:11, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:06:05PM +0100, Halil Pasic wrote: >> Currently force_dma_unencrypted() is only used by the direct >> implementation of the DMA API, and thus resides in dma-direct.h. But >> there is nothing dma-direct specific about it: if

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread Christoph Hellwig
On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 867c7ebd3f10..fafc8f924955 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -243,6 +243,9 @@ static bool vring_use_dma

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-20 Thread Christoph Hellwig
On Thu, Feb 20, 2020 at 05:06:05PM +0100, Halil Pasic wrote: > Currently force_dma_unencrypted() is only used by the direct > implementation of the DMA API, and thus resides in dma-direct.h. But > there is nothing dma-direct specific about it: if one was -- for > whatever reason -- to implement cus

[PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-20 Thread Halil Pasic
Currently force_dma_unencrypted() is only used by the direct implementation of the DMA API, and thus resides in dma-direct.h. But there is nothing dma-direct specific about it: if one was -- for whatever reason -- to implement custom DMA ops that have to in the encrypted/protected scenarios dma-dir

[PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-20 Thread Halil Pasic
Currently if one intends to run a memory protection enabled VM with virtio devices and linux as the guest OS, one needs to specify the VIRTIO_F_IOMMU_PLATFORM flag for each virtio device to make the guest linux use the DMA API, which in turn handles the memory encryption/protection stuff if the gue

[PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread Halil Pasic
Currently the advanced guest memory protection technologies (AMD SEV, powerpc secure guest technology and s390 Protected VMs) abuse the VIRTIO_F_IOMMU_PLATFORM flag to make virtio core use the DMA API, which is in turn necessary, to make IO work with guest memory protection. But VIRTIO_F_IOMMU_PLA

Re: [PATCH V4 3/5] vDPA: introduce vDPA bus

2020-02-20 Thread Jason Gunthorpe
On Thu, Feb 20, 2020 at 02:11:39PM +0800, Jason Wang wrote: > vDPA device is a device that uses a datapath which complies with the > virtio specifications with vendor specific control path. vDPA devices > can be both physically located on the hardware or emulated by > software. vDPA hardware device

Re: [PATCH V4 5/5] vdpasim: vDPA device simulator

2020-02-20 Thread Jason Gunthorpe
On Thu, Feb 20, 2020 at 02:11:41PM +0800, Jason Wang wrote: > +static void vdpasim_device_release(struct device *dev) > +{ > + struct vdpasim *vdpasim = dev_to_sim(dev); > + > + cancel_work_sync(&vdpasim->work); > + kfree(vdpasim->buffer); > + vhost_iotlb_free(vdpasim->iommu); > +

Re: [PATCH V4 4/5] virtio: introduce a vDPA based transport

2020-02-20 Thread Jason Gunthorpe
On Thu, Feb 20, 2020 at 02:11:40PM +0800, Jason Wang wrote: > +static int virtio_vdpa_probe(struct vdpa_device *vdpa) > +{ > + const struct vdpa_config_ops *ops = vdpa->config; > + struct virtio_vdpa_device *vd_dev; > + int ret = -EINVAL; > + > + vd_dev = kzalloc(sizeof(*vd_dev), GF

Re: [RESEND PATCH v2 9/9] ath5k: Constify ioreadX() iomem argument (as in generic implementation)

2020-02-20 Thread Jiri Slaby
On 19. 02. 20, 18:50, Krzysztof Kozlowski wrote: > The ioreadX() helpers have inconsistent interface. On some architectures > void *__iomem address argument is a pointer to const, on some not. > > Implementations of ioreadX() do not modify the memory under the address > so they can be converted t

Re: [PATCH] virtio_balloon: Fix build error seen with CONFIG_BALLOON_COMPACTION=n

2020-02-20 Thread David Hildenbrand
> Am 20.02.2020 um 03:32 schrieb Guenter Roeck : > > 0day reports: > > drivers//virtio/virtio_balloon.c: In function 'virtballoon_probe': > drivers//virtio/virtio_balloon.c:960:1: error: >label 'out_del_vqs' defined but not used [-Werror=unused-label] > > This is seen with CONFIG_BALLOON_