Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-18 Thread Avi Kivity
On 11/18/2010 03:58 AM, Sheng Yang wrote: On Wednesday 17 November 2010 21:58:00 Avi Kivity wrote: On 11/15/2010 11:15 AM, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-18 Thread Michael S. Tsirkin
On Thu, Nov 18, 2010 at 11:28:02AM +0200, Avi Kivity wrote: On 11/18/2010 03:58 AM, Sheng Yang wrote: On Wednesday 17 November 2010 21:58:00 Avi Kivity wrote: On 11/15/2010 11:15 AM, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-18 Thread Michael S. Tsirkin
On Wed, Nov 17, 2010 at 09:29:22AM +0800, Sheng Yang wrote: +#define KVM_MSIX_TYPE_ASSIGNED_DEV 1 + +#define KVM_MSIX_FLAG_MASKBIT(1 0) +#define KVM_MSIX_FLAG_QUERY_MASKBIT (1 0) + +struct kvm_msix_entry { + __u32 id; + __u32 type; Is type

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-18 Thread Sheng Yang
On Thu, Nov 18, 2010 at 5:28 PM, Avi Kivity a...@redhat.com wrote: On 11/18/2010 03:58 AM, Sheng Yang wrote: On Wednesday 17 November 2010 21:58:00 Avi Kivity wrote:  On 11/15/2010 11:15 AM, Sheng Yang wrote:    This patch enable per-vector mask for assigned devices using MSI-X.      

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-17 Thread Marcelo Tosatti
On Wed, Nov 17, 2010 at 09:29:22AM +0800, Sheng Yang wrote: + adev-msix_mask_bitmap); + memcpy(val, entry[addr % PCI_MSIX_ENTRY_SIZE / sizeof *entry], len); Division by zero? Not quite understand. You mean sizeof *entry or PCI_MSIX_ENTRY_SIZE? Both of them should

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-17 Thread Avi Kivity
On 11/15/2010 11:15 AM, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's MSI-X table address in MMIO, the other is for userspace to get information about mask bit. All the mask bit

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-17 Thread Sheng Yang
On Wednesday 17 November 2010 21:58:00 Avi Kivity wrote: On 11/15/2010 11:15 AM, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's MSI-X table address in MMIO, the other is for

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-17 Thread Michael S. Tsirkin
On Thu, Nov 18, 2010 at 09:58:55AM +0800, Sheng Yang wrote: +static int msix_mmio_write(struct kvm_io_device *this, gpa_t addr, int len, + const void *val) +{ + struct kvm_assigned_dev_kernel *adev = + container_of(this, struct

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-17 Thread Sheng Yang
On Thursday 18 November 2010 14:21:40 Michael S. Tsirkin wrote: On Thu, Nov 18, 2010 at 09:58:55AM +0800, Sheng Yang wrote: +static int msix_mmio_write(struct kvm_io_device *this, gpa_t addr, int len, + const void *val) +{ + struct

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-16 Thread Marcelo Tosatti
On Mon, Nov 15, 2010 at 05:15:32PM +0800, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's MSI-X table address in MMIO, the other is for userspace to get information about mask bit.

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-16 Thread Sheng Yang
On Wednesday 17 November 2010 03:45:22 Marcelo Tosatti wrote: On Mon, Nov 15, 2010 at 05:15:32PM +0800, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's MSI-X table address in

[PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-15 Thread Sheng Yang
This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's MSI-X table address in MMIO, the other is for userspace to get information about mask bit. All the mask bit operation are kept in kernel, in order to