Re: [PATCH 1/2] virtio-balloon: initialize all vq callbacks

2019-12-17 Thread Wei Wang
On 12/18/2019 01:19 PM, Michael S. Tsirkin wrote: On Wed, Dec 18, 2019 at 11:18:45AM +0800, Wei Wang wrote: On 12/18/2019 03:06 AM, Daniel Verkamp wrote: Ensure that elements of the array that correspond to unavailable features are set to NULL; previously, they would be left uninitialized.

Re: [PATCH 1/1] drivers/vhost : Removes unnecessary 'else' in vhost_copy_from_user

2019-12-17 Thread Jason Wang
On 2019/12/13 上午5:15, Leonardo Bras wrote: There is no need for this else statement, given that if block will return. This change is not supposed to change the output binary. It reduces identation level on most lines in this function, and also fixes an split string on vq_err(). Signed-off-by:

Re: [PATCH 2/2] virtio-pci: check name when counting MSI-X vectors

2019-12-17 Thread Michael S. Tsirkin
On Tue, Dec 17, 2019 at 11:06:10AM -0800, Daniel Verkamp wrote: > VQs without a name specified are not valid; they are skipped in the > later loop that assigns MSI-X vectors to queues, but the per_vq_vectors > loop above that counts the required number of vectors previously still > counted any

Re: [PATCH 1/2] virtio-balloon: initialize all vq callbacks

2019-12-17 Thread Michael S. Tsirkin
On Wed, Dec 18, 2019 at 11:18:45AM +0800, Wei Wang wrote: > On 12/18/2019 03:06 AM, Daniel Verkamp wrote: > > Ensure that elements of the array that correspond to unavailable > > features are set to NULL; previously, they would be left uninitialized. > > > > Since the corresponding names array

Re: [PATCH 1/2] virtio-balloon: initialize all vq callbacks

2019-12-17 Thread Wei Wang
On 12/18/2019 03:06 AM, Daniel Verkamp wrote: Ensure that elements of the array that correspond to unavailable features are set to NULL; previously, they would be left uninitialized. Since the corresponding names array elements were explicitly set to NULL, the uninitialized callback pointers

Re: [PATCH 1/2] virtio-balloon: initialize all vq callbacks

2019-12-17 Thread Daniel Verkamp
On Tue, Dec 17, 2019 at 12:05 PM Michael S. Tsirkin wrote: > > On Tue, Dec 17, 2019 at 11:06:09AM -0800, Daniel Verkamp wrote: > > Ensure that elements of the array that correspond to unavailable > > features are set to NULL; previously, they would be left uninitialized. > > > > Since the

Re: [PATCH 1/2] virtio-balloon: initialize all vq callbacks

2019-12-17 Thread Michael S. Tsirkin
On Tue, Dec 17, 2019 at 11:06:09AM -0800, Daniel Verkamp wrote: > Ensure that elements of the array that correspond to unavailable > features are set to NULL; previously, they would be left uninitialized. > > Since the corresponding names array elements were explicitly set to > NULL, the

Re: [PATCH 2/2] virtio-pci: check name when counting MSI-X vectors

2019-12-17 Thread Michael S. Tsirkin
On Tue, Dec 17, 2019 at 11:06:10AM -0800, Daniel Verkamp wrote: > VQs without a name specified are not valid; they are skipped in the > later loop that assigns MSI-X vectors to queues, but the per_vq_vectors > loop above that counts the required number of vectors previously still > counted any

[PATCH 1/2] virtio-balloon: initialize all vq callbacks

2019-12-17 Thread Daniel Verkamp
Ensure that elements of the array that correspond to unavailable features are set to NULL; previously, they would be left uninitialized. Since the corresponding names array elements were explicitly set to NULL, the uninitialized callback pointers would not actually be dereferenced; however, the

[PATCH 2/2] virtio-pci: check name when counting MSI-X vectors

2019-12-17 Thread Daniel Verkamp
VQs without a name specified are not valid; they are skipped in the later loop that assigns MSI-X vectors to queues, but the per_vq_vectors loop above that counts the required number of vectors previously still counted any queue with a non-NULL callback as needing a vector. Add a check to the

Re: [PATCH] virtio-balloon: request nvqs based on features

2019-12-17 Thread Daniel Verkamp
On Tue, Dec 17, 2019 at 1:11 AM Cornelia Huck wrote: > > On Mon, 16 Dec 2019 15:14:29 -0800 > Daniel Verkamp wrote: > > > After 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT"), > > the virtio-balloon device unconditionally specifies 4 virtqueues as the > > argument to

Re: [PATCH] virtio-balloon: request nvqs based on features

2019-12-17 Thread Michael S. Tsirkin
On Tue, Dec 17, 2019 at 10:11:08AM +0100, Cornelia Huck wrote: > On Mon, 16 Dec 2019 15:14:29 -0800 > Daniel Verkamp wrote: > > > After 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT"), > > the virtio-balloon device unconditionally specifies 4 virtqueues as the > > argument to

[PATCH 1/5] KVM: arm64: Document PV-lock interface

2019-12-17 Thread yezengruan
From: Zengruan Ye Introduce a paravirtualization interface for KVM/arm64 to obtain the vcpu is currently running or not. A hypercall interface is provided for the guest to interrogate the hypervisor's support for this interface and the location of the shared memory structures. Signed-off-by:

[PATCH 5/5] KVM: arm64: Support the vcpu preemption check

2019-12-17 Thread yezengruan
From: Zengruan Ye Support the vcpu_is_preempted() functionality under KVM/arm64. This will enhance lock performance on overcommitted hosts (more runnable vcpus than physical cpus in the system) as doing busy waits for preempted vcpus will hurt system performance far worse than early yielding.

[PATCH 2/5] KVM: arm64: Implement PV_LOCK_FEATURES call

2019-12-17 Thread yezengruan
From: Zengruan Ye This provides a mechanism for querying which paravirtualized lock features are available in this hypervisor. Also add the header file which defines the ABI for the paravirtualized lock features we're about to add. Signed-off-by: Zengruan Ye ---

[PATCH 0/5] KVM: arm64: vcpu preempted check support

2019-12-17 Thread yezengruan
From: Zengruan Ye This patch set aims to support the vcpu_is_preempted() functionality under KVM/arm64, which allowing the guest to obtain the vcpu is currently running or not. This will enhance lock performance on overcommitted hosts (more runnable vcpus than physical cpus in the system) as

[PATCH 3/5] KVM: arm64: Support pvlock preempted via shared structure

2019-12-17 Thread yezengruan
From: Zengruan Ye Implement the service call for configuring a shared structure between a vcpu and the hypervisor in which the hypervisor can tell the vcpu is running or not. The preempted field is zero if 1) some old KVM deos not support this filed. 2) the vcpu is not preempted. Other values

[PATCH 4/5] KVM: arm64: Add interface to support vcpu preempted check

2019-12-17 Thread yezengruan
From: Zengruan Ye This is to fix some lock holder preemption issues. Some other locks implementation do a spin loop before acquiring the lock itself. Currently kernel has an interface of bool vcpu_is_preempted(int cpu). It takes the cpu as parameter and return true if the cpu is preempted. Then

Re: [PATCH v2 2/5] iommu: arm: Use iommu_put_resv_regions_simple()

2019-12-17 Thread Will Deacon
On Mon, Dec 09, 2019 at 03:50:04PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Use the new standard function instead of open-coding it. > > Cc: Will Deacon > Cc: Robin Murphy > Signed-off-by: Thierry Reding > --- > drivers/iommu/arm-smmu-v3.c | 11 +-- >

Re: [PATCH v2 0/5] iommu: Implement iommu_put_resv_regions_simple()

2019-12-17 Thread Joerg Roedel
Hi Thierry On Mon, Dec 09, 2019 at 03:50:02PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Most IOMMU drivers only need to free the memory allocated for each > reserved region. Instead of open-coding the loop to do this in each > driver, extract the code into a common function that

Re: [PATCH] virtio-balloon: request nvqs based on features

2019-12-17 Thread Cornelia Huck
On Mon, 16 Dec 2019 15:14:29 -0800 Daniel Verkamp wrote: > After 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT"), > the virtio-balloon device unconditionally specifies 4 virtqueues as the > argument to find_vqs(), which means that 5 MSI-X vectors are required in > order to