Re: [RFC for QEMU] virtio-balloon: Add option thp-order to set VIRTIO_BALLOON_F_THP_ORDER

2020-03-26 Thread Michael S. Tsirkin
On Tue, Mar 17, 2020 at 06:13:32PM +0800, teawater wrote: > > > > 2020年3月12日 16:25,Michael S. Tsirkin 写道: > > > > On Thu, Mar 12, 2020 at 03:49:55PM +0800, Hui Zhu wrote: > >> If the guest kernel has many fragmentation pages, use virtio_balloon > >> will split THP of QEMU when it calls MADV_DON

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread Michael S. Tsirkin
On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: > On 12.03.20 09:47, Michael S. Tsirkin wrote: > > On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: > >> 2. You are essentially stealing THPs in the guest. So the fastest > >> mapping (THP in guest and host) is gon

Re: [PATCH for Linux v2] virtio_balloon: Add VIRTIO_BALLOON_VQ_INFLATE_CONT to handle THP split issue

2020-03-26 Thread Michael S. Tsirkin
First, either QEMU or Linux version of any interface changes should be copied to the virtio TC. : On Mon, Mar 23, 2020 at 12:04:56AM +0800, Hui Zhu wrote: > The first version is in [1]. > According to the comments from Michael and David, I updated the patch. > 1. Added a separate vq inflate_cont

Re: [PATCH for QEMU v2] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_VQ_INFLATE_CONT

2020-03-26 Thread David Hildenbrand
> Am 26.03.2020 um 08:06 schrieb teawater : > > Ping. > On paid leave this week. Will try to have a look next week, but it could take a bit longer. Cheers > Thanks, > Hui > >> 2020年3月23日 00:04,Hui Zhu 写道: >> >> If the guest kernel has many fragmentation pages, use virtio_balloon >> will

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread Michael S. Tsirkin
On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: > On 12.03.20 09:47, Michael S. Tsirkin wrote: > > On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: > >> 2. You are essentially stealing THPs in the guest. So the fastest > >> mapping (THP in guest and host) is gon

Re: [PATCH for QEMU v2] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_VQ_INFLATE_CONT

2020-03-26 Thread Michael S. Tsirkin
On Mon, Mar 23, 2020 at 12:04:57AM +0800, Hui Zhu wrote: > If the guest kernel has many fragmentation pages, use virtio_balloon > will split THP of QEMU when it calls MADV_DONTNEED madvise to release > the balloon pages. > Set option cont-pages to on will open flags VIRTIO_BALLOON_VQ_INFLATE_CONT >

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread David Hildenbrand
> Am 26.03.2020 um 08:21 schrieb Michael S. Tsirkin : > > On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: >>> On 12.03.20 09:47, Michael S. Tsirkin wrote: >>> On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: 2. You are essentially stealing THPs in the g

[PATCH v2 3/3] iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE

2020-03-26 Thread Jean-Philippe Brucker
We don't currently support IOMMUs with a page granule larger than the system page size. The IOVA allocator has a BUG_ON() in this case, and VFIO has a WARN_ON(). Removing these obstacles ranges doesn't seem possible without major changes to the DMA API and VFIO. Some callers of iommu_map(), for ex

[PATCH v2 1/3] iommu/virtio: Fix sparse warning

2020-03-26 Thread Jean-Philippe Brucker
We copied the virtio_iommu_config from the virtio-iommu specification, which declares the fields using little-endian annotations (for example le32). Unfortunately this causes sparse to warn about comparison between little- and cpu-endian, because of the typecheck() in virtio_cread(): drivers/iommu

[PATCH v2 2/3] iommu/virtio: Fix freeing of incomplete domains

2020-03-26 Thread Jean-Philippe Brucker
Calling viommu_domain_free() on a domain that hasn't been finalised (not attached to any device, for example) can currently cause an Oops, because we attempt to call ida_free() on ID 0, which may either be unallocated or used by another domain. Only initialise the vdomain->viommu pointer, which de

[PATCH v2 0/3] iommu/virtio: Misc fixes

2020-03-26 Thread Jean-Philippe Brucker
A collection of fixes for the virtio-iommu driver. It might be too late for v5.6 since they need more review. Patch 2 is new, the others were posted separately. Jean-Philippe Brucker (3): iommu/virtio: Fix sparse warning iommu/virtio: Fix freeing of incomplete domains iommu/virtio: Reject I

Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-26 Thread Michael S. Tsirkin
On Thu, Mar 26, 2020 at 08:54:04AM +0100, David Hildenbrand wrote: > > > > Am 26.03.2020 um 08:21 schrieb Michael S. Tsirkin : > > > > On Thu, Mar 12, 2020 at 09:51:25AM +0100, David Hildenbrand wrote: > >>> On 12.03.20 09:47, Michael S. Tsirkin wrote: > >>> On Thu, Mar 12, 2020 at 09:37:32AM +

Re: [PATCH v2 2/3] iommu/virtio: Fix freeing of incomplete domains

2020-03-26 Thread Robin Murphy
On 2020-03-26 9:35 am, Jean-Philippe Brucker wrote: Calling viommu_domain_free() on a domain that hasn't been finalised (not attached to any device, for example) can currently cause an Oops, because we attempt to call ida_free() on ID 0, which may either be unallocated or used by another domain.

Re: [PATCH v2 3/3] iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE

2020-03-26 Thread Robin Murphy
On 2020-03-26 9:35 am, Jean-Philippe Brucker wrote: We don't currently support IOMMUs with a page granule larger than the system page size. The IOVA allocator has a BUG_ON() in this case, and VFIO has a WARN_ON(). Removing these obstacles ranges doesn't seem possible without major changes to the

Re: [PATCH V8 9/9] virtio: Intel IFC VF driver for VDPA

2020-03-26 Thread Jason Gunthorpe
On Thu, Mar 26, 2020 at 01:50:53PM +0800, Jason Wang wrote: > > > + adapter->vdpa.dma_dev = dev; > > > + ret = vdpa_register_device(&adapter->vdpa); > > > + if (ret) { > > > + IFCVF_ERR(adapter->dev, "Failed to register ifcvf to vdpa bus"); > > > + goto err_msix; > > > + } > > > +

Re: [PATCH V8 9/9] virtio: Intel IFC VF driver for VDPA

2020-03-26 Thread Jason Wang
On 2020/3/26 下午8:17, Jason Gunthorpe wrote: On Thu, Mar 26, 2020 at 01:50:53PM +0800, Jason Wang wrote: + adapter->vdpa.dma_dev = dev; + ret = vdpa_register_device(&adapter->vdpa); + if (ret) { + IFCVF_ERR(adapter->dev, "Failed to register ifcvf to vdpa bus"); +

[PATCH V9 2/9] vhost: allow per device message handler

2020-03-26 Thread Jason Wang
This patch allow device to register its own message handler during vhost_dev_init(). vDPA device will use it to implement its own DMA mapping logic. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 3 ++- drivers/vhost/scsi.c | 2 +- drivers/vhost/vhost.c | 12 ++-- drivers/vhost

[PATCH V9 0/9] vDPA support

2020-03-26 Thread Jason Wang
Hi all: This is an update version of vDPA support in kernel. 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 devices are

[PATCH V9 1/9] vhost: refine vhost and vringh kconfig

2020-03-26 Thread Jason Wang
Currently, CONFIG_VHOST depends on CONFIG_VIRTUALIZATION. But vhost is not necessarily for VM since it's a generic userspace and kernel communication protocol. Such dependency may prevent archs without virtualization support from using vhost. To solve this, a dedicated vhost menu is created under

[PATCH V9 4/9] vringh: IOTLB support

2020-03-26 Thread Jason Wang
This patch implements the third memory accessor for vringh besides current kernel and userspace accessors. This idea is to allow vringh to do the address translation through an IOTLB which is implemented via vhost_map interval tree. Users should setup and IOVA to PA mapping in this IOTLB. This all

[PATCH V9 5/9] vDPA: introduce vDPA bus

2020-03-26 Thread Jason Wang
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 devices are usually implemented through PCIE with the following types: -

[PATCH V9 3/9] vhost: factor out IOTLB

2020-03-26 Thread Jason Wang
This patch factors out IOTLB into a dedicated module in order to be reused by other modules like vringh. User may choose to enable the automatic retiring by specifying VHOST_IOTLB_FLAG_RETIRE flag to fit for the case of vhost device IOTLB implementation. Signed-off-by: Jason Wang --- MAINTAINERS

[PATCH V9 8/9] vdpasim: vDPA device simulator

2020-03-26 Thread Jason Wang
This patch implements a software vDPA networking device. The datapath is implemented through vringh and workqueue. The device has an on-chip IOMMU which translates IOVA to PA. For kernel virtio drivers, vDPA simulator driver provides dma_ops. For vhost driers, set_map() methods of vdpa_config_ops i

[PATCH V9 9/9] virtio: Intel IFC VF driver for VDPA

2020-03-26 Thread Jason Wang
From: Zhu Lingshan This commit introduced two layers to drive IFC VF: (1) ifcvf_base layer, which handles IFC VF NIC hardware operations and configurations. (2) ifcvf_main layer, which complies to VDPA bus framework, implemented device operations for VDPA bus, handles device probe,

[PATCH V9 7/9] vhost: introduce vDPA-based backend

2020-03-26 Thread Jason Wang
From: Tiwei Bie This patch introduces a vDPA-based vhost backend. This backend is built on top of the same interface defined in virtio-vDPA and provides a generic vhost interface for userspace to accelerate the virtio devices in guest. This backend is implemented as a vDPA device driver on top o

[PATCH V9 6/9] virtio: introduce a vDPA based transport

2020-03-26 Thread Jason Wang
This patch introduces a vDPA transport for virtio. This is used to use kernel virtio driver to drive the vDPA device that is capable of populating virtqueue directly. A new virtio-vdpa driver will be registered to the vDPA bus, when a new virtio-vdpa device is probed, it will register the device w

Re: [PATCH 06/70] x86/umip: Factor out instruction fetch

2020-03-26 Thread Borislav Petkov
On Thu, Mar 19, 2020 at 10:13:03AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > Factor out the code to fetch the instruction from user-space to a helper > function. Add "No functional changes." here. > Signed-off-by: Joerg Roedel > --- > arch/x86/include/asm/insn-eval.h | 2 ++ > arch

Re: [PATCH 07/70] x86/umip: Factor out instruction decoding

2020-03-26 Thread Borislav Petkov
On Thu, Mar 19, 2020 at 10:13:04AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > Factor out the code used to decode an instruction with the correct > address and operand sizes to a helper function. As for the previous one: "No functional changes." -- Regards/Gruss, Boris. https://pe

Re: [PATCH v2 3/3] iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE

2020-03-26 Thread Auger Eric
Hi Jean, On 3/26/20 10:35 AM, Jean-Philippe Brucker wrote: > We don't currently support IOMMUs with a page granule larger than the > system page size. The IOVA allocator has a BUG_ON() in this case, and > VFIO has a WARN_ON(). > > Removing these obstacles ranges doesn't seem possible without majo

[PATCH AUTOSEL 5.5 10/28] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-26 Thread Sasha Levin
From: Gerd Hoffmann [ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] Shutdown of firmware framebuffer has a bunch of problems. Because of this the framebuffer region might still be reserved even after drm_fb_helper_remove_conflicting_pci_framebuffers() returned. Don't consider pci_

[PATCH AUTOSEL 4.19 05/15] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-26 Thread Sasha Levin
From: Gerd Hoffmann [ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] Shutdown of firmware framebuffer has a bunch of problems. Because of this the framebuffer region might still be reserved even after drm_fb_helper_remove_conflicting_pci_framebuffers() returned. Don't consider pci_

[PATCH AUTOSEL 5.4 06/19] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-26 Thread Sasha Levin
From: Gerd Hoffmann [ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] Shutdown of firmware framebuffer has a bunch of problems. Because of this the framebuffer region might still be reserved even after drm_fb_helper_remove_conflicting_pci_framebuffers() returned. Don't consider pci_

[PATCH AUTOSEL 4.14 03/10] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-26 Thread Sasha Levin
From: Gerd Hoffmann [ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] Shutdown of firmware framebuffer has a bunch of problems. Because of this the framebuffer region might still be reserved even after drm_fb_helper_remove_conflicting_pci_framebuffers() returned. Don't consider pci_

[PATCH AUTOSEL 4.9 2/7] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-26 Thread Sasha Levin
From: Gerd Hoffmann [ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] Shutdown of firmware framebuffer has a bunch of problems. Because of this the framebuffer region might still be reserved even after drm_fb_helper_remove_conflicting_pci_framebuffers() returned. Don't consider pci_

[PATCH AUTOSEL 4.4 2/4] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-26 Thread Sasha Levin
From: Gerd Hoffmann [ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] Shutdown of firmware framebuffer has a bunch of problems. Because of this the framebuffer region might still be reserved even after drm_fb_helper_remove_conflicting_pci_framebuffers() returned. Don't consider pci_