Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Jason Wang
On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: > Even when we skip data decoding, MMIO is slightly slower > than port IO because it uses the page-tables, so the CPU > must do a pagewalk on each access. > > This overhead is normally masked by using the TLB cache: > but not so for KVM MMIO, wher

Re: [PATCH V3 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses

2015-08-31 Thread Jason Wang
On 09/01/2015 12:31 PM, Michael S. Tsirkin wrote: > On Tue, Sep 01, 2015 at 11:33:43AM +0800, Jason Wang wrote: >> >> On 08/31/2015 07:33 PM, Michael S. Tsirkin wrote: >>> On Mon, Aug 31, 2015 at 04:03:59PM +0800, Jason Wang wrote: >>>>> >>>>

Re: [PATCH RFC 1/3] vmx: allow ioeventfd for EPT violations

2015-08-31 Thread Jason Wang
On 09/01/2015 12:36 PM, Michael S. Tsirkin wrote: > On Tue, Sep 01, 2015 at 11:37:13AM +0800, Jason Wang wrote: >> > >> > >> > On 08/30/2015 05:12 PM, Michael S. Tsirkin wrote: >>> > > Even when we skip data decoding, MMIO is slightly slower >>

Re: [PATCH V3 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses

2015-09-01 Thread Jason Wang
On 09/01/2015 02:54 PM, Michael S. Tsirkin wrote: > On Tue, Sep 01, 2015 at 12:47:36PM +0800, Jason Wang wrote: >> >> On 09/01/2015 12:31 PM, Michael S. Tsirkin wrote: >>> On Tue, Sep 01, 2015 at 11:33:43AM +0800, Jason Wang wrote: >>>> On 08/31/2015 07:33 PM

[PATCH V4 4/4] kvm: add tracepoint for fast mmio

2015-09-10 Thread Jason Wang
Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- arch/x86/kvm/trace.h | 18 ++ arch/x86/kvm/vmx.c | 1 + arch/x86/kvm/x86.c | 1 + 3 files changed, 20 insertions(+) diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index 4eae7c3..ce4abe3 100644

[PATCH V4 3/4] kvm: fix zero length mmio searching

2015-09-10 Thread Jason Wang
zero length if an iodevice is zero length. Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- virt/kvm/kvm_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index d8db2f8f..d4c3b66 100644 --- a/virt/kvm

[PATCH V4 1/4] kvm: factor out core eventfd assign/deassign logic

2015-09-10 Thread Jason Wang
This patch factors out core eventfd assign/deassign logic and leave the argument checking and bus index selection to callers. Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- virt/kvm/eventfd.c | 83 -- 1 file changed, 49

[PATCH V4 0/4] Fast MMIO eventfd fixes

2015-09-10 Thread Jason Wang
. Changes from v1: - change ioeventfd_bus_from_flags() to return KVM_FAST_MMIO_BUS when needed to save lots of unnecessary changes. Jason Wang (4): kvm: factor out core eventfd assign/deassign logic kvm: fix double free for fast mmio eventfd kvm: fix zero length mmio searching kvm: add

[PATCH V4 2/4] kvm: fix double free for fast mmio eventfd

2015-09-10 Thread Jason Wang
01 10 00 00 RIP [] ioeventfd_release+0x28/0x60 [kvm] RSP Cc: Gleb Natapov Cc: Paolo Bonzini Cc: Michael S. Tsirkin Signed-off-by: Jason Wang --- virt/kvm/eventfd.c | 111 - 1 file changed, 59 insertions(+), 52 deletions(-) diff --git

Re: [PATCH V4 1/4] kvm: factor out core eventfd assign/deassign logic

2015-09-11 Thread Jason Wang
On 09/11/2015 03:39 PM, Cornelia Huck wrote: > On Fri, 11 Sep 2015 11:17:34 +0800 > Jason Wang wrote: > >> This patch factors out core eventfd assign/deassign logic and leave >> the argument checking and bus index selection to callers. >> >> Cc: Gleb Natapov &g

Re: [PATCH V4 2/4] kvm: fix double free for fast mmio eventfd

2015-09-11 Thread Jason Wang
On 09/11/2015 03:46 PM, Cornelia Huck wrote: > On Fri, 11 Sep 2015 11:17:35 +0800 > Jason Wang wrote: > >> We register wildcard mmio eventfd on two buses, one for KVM_MMIO_BUS >> and another is KVM_FAST_MMIO_BUS but with a single iodev >> instance. This will lead a

Re: [PATCH V4 3/4] kvm: fix zero length mmio searching

2015-09-11 Thread Jason Wang
On 09/11/2015 04:31 PM, Cornelia Huck wrote: > On Fri, 11 Sep 2015 10:26:41 +0200 > Paolo Bonzini wrote: > >> On 11/09/2015 05:17, Jason Wang wrote: >>> + int len = r2->len ? r1->len : 0; >>> + >>> if (r1->addr < r2->addr) >&

Re: [PATCH V4 0/4] Fast MMIO eventfd fixes

2015-09-11 Thread Jason Wang
On 09/11/2015 04:33 PM, Paolo Bonzini wrote: > > On 11/09/2015 10:15, Michael S. Tsirkin wrote: >> I think we should add a capability for fast mmio. >> This way, userspace can avoid crashing buggy kernels. > I agree. > > Paolo Right, then qemu will use datamatch eventfd if kenrel dost not have t

[PATCH V6 1/6] kvm: don't try to register to KVM_FAST_MMIO_BUS for non mmio eventfd

2015-09-14 Thread Jason Wang
We only want zero length mmio eventfd to be registered on KVM_FAST_MMIO_BUS. So check this explicitly when arg->len is zero to make sure this. Cc: sta...@vger.kernel.org Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- virt/kvm/eventfd.c | 4 ++-- 1 file changed, 2 inserti

[PATCH V6 0/6] Fast mmio eventfd fixes

2015-09-14 Thread Jason Wang
Changes from V2: - Tweak styles and comment suggested by Cornelia. Changes from v1: - change ioeventfd_bus_from_flags() to return KVM_FAST_MMIO_BUS when needed to save lots of unnecessary changes. Jason Wang (6): kvm: don't try to register to KVM_FAST_MMIO_BUS for non mmio eventfd kvm: fac

[PATCH V6 5/6] kvm: add tracepoint for fast mmio

2015-09-14 Thread Jason Wang
Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- arch/x86/kvm/trace.h | 18 ++ arch/x86/kvm/vmx.c | 1 + arch/x86/kvm/x86.c | 1 + 3 files changed, 20 insertions(+) diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index 4eae7c3..ce4abe3 100644

[PATCH V6 4/6] kvm: fix zero length mmio searching

2015-09-14 Thread Jason Wang
using zero length if an iodevice is zero length. Cc: sta...@vger.kernel.org Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- virt/kvm/kvm_main.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

[PATCH V6 2/6] kvm: factor out core eventfd assign/deassign logic

2015-09-14 Thread Jason Wang
This patch factors out core eventfd assign/deassign logic and leaves the argument checking and bus index selection to callers. Cc: sta...@vger.kernel.org Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- virt/kvm/eventfd.c | 85

[PATCH V6 3/6] kvm: fix double free for fast mmio eventfd

2015-09-14 Thread Jason Wang
00 01 10 00 00 RIP [] ioeventfd_release+0x28/0x60 [kvm] RSP Cc: sta...@vger.kernel.org Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- virt/kvm/eventfd.c | 43 +-- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/vi

[PATCH V6 6/6] kvm: add fast mmio capabilitiy

2015-09-14 Thread Jason Wang
Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Jason Wang --- Documentation/virtual/kvm/api.txt | 7 ++- include/uapi/linux/kvm.h | 1 + virt/kvm/kvm_main.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/virtual/kvm/api.txt b

[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()

2015-10-21 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 6 ++ drivers/vhost/vhost.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/vhost/vhost.c b/drivers/

[PATCH net-next RFC 2/2] vhost_net: basic polling support

2015-10-21 Thread Jason Wang
olled. busyloop_timeout = 50 gives us following improvement on TCP_RR test: size/session/+thu%/+normalize% 1/ 1/ +5%/ -20% 1/50/ +17%/ +3% Signed-off-by: Jason Wang --- drivers/vhost/net.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/vhost/

Re: [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()

2015-10-23 Thread Jason Wang
On 10/22/2015 04:38 PM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 01:27:28AM -0400, Jason Wang wrote: >> > This path introduces a helper which can give a hint for whether or not >> > there's a work queued in the work list. >> > >> > Signe

Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support

2015-10-23 Thread Jason Wang
On 10/22/2015 05:33 PM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 01:27:29AM -0400, Jason Wang wrote: >> This patch tries to poll for new added tx buffer for a while at the >> end of tx processing. The maximum time spent on polling were limited >> through a modul

Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support

2015-10-23 Thread Jason Wang
On 10/23/2015 12:16 AM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 08:46:33AM -0700, Rick Jones wrote: >> On 10/22/2015 02:33 AM, Michael S. Tsirkin wrote: >>> On Thu, Oct 22, 2015 at 01:27:29AM -0400, Jason Wang wrote: >>>> This patch tries to poll for n

[PATCH net-next rfc V2 2/2] vhost_net: basic polling support

2015-10-29 Thread Jason Wang
olled. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 54 + 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 9eda69e..30e6d3d 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/

[PATCH net-next rfc V2 0/2] basic busy polling support for vhost_net

2015-10-29 Thread Jason Wang
igure per VM through ioctl. Please review. Thanks Jason Wang (2): vhost: introduce vhost_has_work() vhost_net: basic polling support drivers/vhost/net.c | 54 +++ drivers/vhost/vhost.c | 7 +++ drivers/vhost/vhost.h | 1 + 3 files change

[PATCH net-next rfc V2 1/2] vhost: introduce vhost_has_work()

2015-10-29 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 7 +++ drivers/vhost/vhost.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/vhost/vhost.c b/drivers/

Re: [PATCH net-next rfc V2 0/2] basic busy polling support for vhost_net

2015-10-30 Thread Jason Wang
On 10/29/2015 04:45 PM, Jason Wang wrote: > Hi all: > > This series tries to add basic busy polling for vhost net. The idea is > simple: at the end of tx processing, busy polling for new tx added > descriptor and rx receive socket for a while. The maximum number of > time (in

Re: how to optimize virtio-vhost in 10G net

2015-02-14 Thread Jason Wang
On Sun, Feb 15, 2015 at 3:30 PM, Ding Xiao wrote: I am test virtio-vhost in 10G environment host info cpu E2680@2.7GHz memory 16G network intel 82599BE os centos 7 VM info cpu 4 memory 4G network using virtio vhost os centos 7 I using pktgen to send udp package, the result like follow 64b

[PATCH net] vhost_net: fix wrong iter offset when setting number of buffers

2015-02-15 Thread Jason Wang
el/git/davem/net") Cc: David S. Miller Cc: Al Viro Cc: Michael S. Tsirkin Signed-off-by: Jason Wang --- drivers/vhost/net.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 8dccca9..afa06d2 100644 --- a/drivers/vh

<    3   4   5   6   7   8