[QA-TCP] How to send tcp small packages immediately?

2014-10-24 Thread Zhangjie (HZ)
Hi, I use netperf to test the performance of small tcp package, with TCP_NODELAY set : netperf -H 129.9.7.164 -l 100 -- -m 512 -D Among the packages I got by tcpdump, there is not only small packages, also lost of big ones (skb->len=65160). IP 129.9.7.186.60840 > 129.9.7.164.34607: tcp 65160

Re: [Qemu-trivial] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-24 Thread Michael Tokarev
On 10/13/2014 06:47 PM, Alexander Graf wrote: > On 13.10.14 16:36, Chen Gang wrote: >> strncat() will append additional '\0' to destination buffer, so need >> additional 1 byte for it, or may cause memory overflow, just like other >> area within QEMU have done. >> >> Signed-off-by: Chen Gang > >

Re: [Qemu-trivial] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-24 Thread Alexander Graf
> Am 24.10.2014 um 09:49 schrieb Michael Tokarev : > >> On 10/13/2014 06:47 PM, Alexander Graf wrote: >>> On 13.10.14 16:36, Chen Gang wrote: >>> strncat() will append additional '\0' to destination buffer, so need >>> additional 1 byte for it, or may cause memory overflow, just like other >>>

Re: [Qemu-trivial] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-24 Thread Chen Gang
On 10/24/14 15:49, Michael Tokarev wrote: > On 10/13/2014 06:47 PM, Alexander Graf wrote: >> On 13.10.14 16:36, Chen Gang wrote: >>> strncat() will append additional '\0' to destination buffer, so need >>> additional 1 byte for it, or may cause memory overflow, just like other >>> area within QEMU

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-24 Thread Cornelia Huck
On Fri, 24 Oct 2014 00:42:20 +0300 "Michael S. Tsirkin" wrote: > On Tue, Oct 07, 2014 at 04:39:56PM +0200, Cornelia Huck wrote: > > This patchset aims to get us some way to implement virtio-1 compliant > > and transitional devices in qemu. Branch available at > > > > git://github.com/cohuck/qemu

Re: [PATCH v12 09/11] pvqspinlock, x86: Add para-virtualization support

2014-10-24 Thread Peter Zijlstra
On Thu, Oct 16, 2014 at 02:10:38PM -0400, Waiman Long wrote: > +static inline void pv_init_node(struct mcs_spinlock *node) > +{ > + struct pv_qnode *pn = (struct pv_qnode *)node; > + > + BUILD_BUG_ON(sizeof(struct pv_qnode) > 5*sizeof(struct mcs_spinlock)); > + > + if (!pv_enabled()) >

Re: [PATCH v12 09/11] pvqspinlock, x86: Add para-virtualization support

2014-10-24 Thread Peter Zijlstra
On Thu, Oct 16, 2014 at 02:10:38PM -0400, Waiman Long wrote: > Since enabling paravirt spinlock will disable unlock function inlining, > a jump label can be added to the unlock function without adding patch > sites all over the kernel. But you don't have to. My patches allowed for the inline to r

Re: [PATCH v12 00/11] qspinlock: a 4-byte queue spinlock with PV support

2014-10-24 Thread Peter Zijlstra
On Thu, Oct 16, 2014 at 02:10:29PM -0400, Waiman Long wrote: > v11->v12: > - Based on PeterZ's version of the qspinlock patch >(https://lkml.org/lkml/2014/6/15/63). > - Incorporated many of the review comments from Konrad Wilk and >Paolo Bonzini. > - The pvqspinlock code is largely from

[RFC][PATCH] kvm: x86: vmx: move some vmx setting from vmx_init() to hardware_setup()

2014-10-24 Thread Tiejun Chen
Instead of vmx_init(), actually it would make reasonable sense to do anything specific to vmx hardware setting in vmx_x86_ops->hardware_setup(). Signed-off-by: Tiejun Chen --- arch/x86/kvm/vmx.c | 720 +++-- 1 file changed, 361 insertions(+), 359 d

Re: [RFC][PATCH] kvm: x86: vmx: move some vmx setting from vmx_init() to hardware_setup()

2014-10-24 Thread Paolo Bonzini
On 10/24/2014 11:18 AM, Tiejun Chen wrote: > Instead of vmx_init(), actually it would make reasonable sense to do > anything specific to vmx hardware setting in vmx_x86_ops->hardware_setup(). > > Signed-off-by: Tiejun Chen Please split this patch in multiple parts. It is quite hard to review

Re: [Qemu-devel] [PATCH] target-i386: add Intel AVX-512 support

2014-10-24 Thread Eduardo Habkost
On Fri, Oct 24, 2014 at 07:55:10AM +0200, Paolo Bonzini wrote: > > > On 10/24/2014 03:27 AM, Chao Peng wrote: > > On Thu, Oct 23, 2014 at 05:49:23PM -0200, Eduardo Habkost wrote: > >> On Thu, Oct 23, 2014 at 11:02:43AM +0800, Chao Peng wrote: > >> [...] > >>> @@ -707,6 +714,24 @@ typedef union {

Re: [Qemu-devel] [PATCH] target-i386: add Intel AVX-512 support

2014-10-24 Thread Paolo Bonzini
On 10/24/2014 01:12 PM, Eduardo Habkost wrote: >> > I think we can keep the macros. The actual cleanup would be to have a >> > single member for the 32 512-bit ZMM registers, instead of splitting >> > xmm/ymmh/zmmh/zmm_hi16. This will get rid of the YMM_* and ZMM_* >> > registers. However, we

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-24 Thread Cornelia Huck
On Fri, 24 Oct 2014 10:38:39 +0200 Cornelia Huck wrote: > On Fri, 24 Oct 2014 00:42:20 +0300 > "Michael S. Tsirkin" wrote: > > > On Tue, Oct 07, 2014 at 04:39:56PM +0200, Cornelia Huck wrote: > > > This patchset aims to get us some way to implement virtio-1 compliant > > > and transitional devi

Nic Bonding - throughput for guest

2014-10-24 Thread Stefan Bauer
Hi,   please CC me - I'm not subscribed to this list.   I'm looking  forward to bond the 2 Nics from my KVM Host (2 x 1GbE) to increase throughput for my guest.   Currently my guest has a e1000 nic attached.   Do i have to tune anything else so my kvm guest can operate with 2 x 1gbit (to diff

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-24 Thread Michael S. Tsirkin
On Fri, Oct 24, 2014 at 02:37:08PM +0200, Cornelia Huck wrote: > On Fri, 24 Oct 2014 10:38:39 +0200 > Cornelia Huck wrote: > > > On Fri, 24 Oct 2014 00:42:20 +0300 > > "Michael S. Tsirkin" wrote: > > > > > On Tue, Oct 07, 2014 at 04:39:56PM +0200, Cornelia Huck wrote: > > > > This patchset aims

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-24 Thread Michael S. Tsirkin
On Fri, Oct 24, 2014 at 10:38:39AM +0200, Cornelia Huck wrote: > On Fri, 24 Oct 2014 00:42:20 +0300 > "Michael S. Tsirkin" wrote: > > > On Tue, Oct 07, 2014 at 04:39:56PM +0200, Cornelia Huck wrote: > > > This patchset aims to get us some way to implement virtio-1 compliant > > > and transitional

[PATCH 12/14] KVM: x86: PREFETCH and HINT_NOP should have SrcMem flag

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit The decode phase of the x86 emulator assumes that every instruction with the ModRM flag, and which can be used with RIP-relative addressing, has either SrcMem or DstMem. This is not the case for several instructions - prefetch, hint-nop and clflush. Adding SrcMem|NoAccess for p

[PATCH 14/14] KVM: x86: Wrong assertion on paging_tmpl.h

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit Even after the recent fix, the assertion on paging_tmpl.h is triggered. Apparently, the assertion wants to check that the PAE is always set on long-mode, but does it in incorrect way. Note that the assertion is not enabled unless the code is debugged by defining MMU_DEBUG. Sign

[PATCH 10/14] KVM: emulate: avoid accessing NULL ctxt->memopp

2014-10-24 Thread Paolo Bonzini
A failure to decode the instruction can cause a NULL pointer access. This is fixed simply by moving the "done" label as close as possible to the return. This fixes CVE-2014-8481. Reported-by: Andy Lutomirski Cc: sta...@vger.kernel.org Fixes: 41061cdb98a0bec464278b4db8e894a3121671f5 Signed-off-by

[PATCH 13/14] kvm: fix excessive pages un-pinning in kvm_iommu_map error path.

2014-10-24 Thread Paolo Bonzini
From: Quentin Casasnovas The third parameter of kvm_unpin_pages() when called from kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin and not the page size. This error was facilitated with an inconsistent API: kvm_pin_pages() takes a size, but kvn_unpin_pages() takes a nu

[PATCH 11/14] KVM: x86: Emulator does not decode clflush well

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit Currently, all group15 instructions are decoded as clflush (e.g., mfence, xsave). In addition, the clflush instruction requires no prefix (66/f2/f3) would exist. If prefix exists it may encode a different instruction (e.g., clflushopt). Creating a group for clflush, and differe

[PATCH 09/14] KVM: x86: Decoding guest instructions which cross page boundary may fail

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit Once an instruction crosses a page boundary, the size read from the second page disregards the common case that part of the operand resides on the first page. As a result, fetch of long insturctions may fail, and thereby cause the decoding to fail as well. Cc: sta...@vger.kernel

[PATCH 06/14] KVM: x86: Handle errors when RIP is set during far jumps

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit Far jmp/call/ret may fault while loading a new RIP. Currently KVM does not handle this case, and may result in failed vm-entry once the assignment is done. The tricky part of doing so is that loading the new CS affects the VMCS/VMCB state, so if we fail during loading the new R

[PATCH 08/14] kvm: x86: don't kill guest on unknown exit reason

2014-10-24 Thread Paolo Bonzini
From: "Michael S. Tsirkin" KVM_EXIT_UNKNOWN is a kvm bug, we don't really know whether it was triggered by a priveledged application. Let's not kill the guest: WARN and inject #UD instead. Cc: sta...@vger.kernel.org Signed-off-by: Michael S. Tsirkin Signed-off-by: Paolo Bonzini --- arch/x86/

[PATCH 07/14] kvm: vmx: handle invvpid vm exit gracefully

2014-10-24 Thread Paolo Bonzini
From: Petr Matousek On systems with invvpid instruction support (corresponding bit in IA32_VMX_EPT_VPID_CAP MSR is set) guest invocation of invvpid causes vm exit, which is currently not handled and results in propagation of unknown exit to userspace. Fix this by installing an invvpid vm exit ha

[PATCH 03/14] KVM: x86: Improve thread safety in pit

2014-10-24 Thread Paolo Bonzini
From: Andy Honig There's a race condition in the PIT emulation code in KVM. In __kvm_migrate_pit_timer the pit_timer object is accessed without synchronization. If the race condition occurs at the wrong time this can crash the host kernel. This fixes CVE-2014-3611. Cc: sta...@vger.kernel.org

[PATCH 05/14] KVM: x86: Emulator fixes for eip canonical checks on near branches

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit Before changing rip (during jmp, call, ret, etc.) the target should be asserted to be canonical one, as real CPUs do. During sysret, both target rsp and rip should be canonical. If any of these values is noncanonical, a #GP exception should occur. The exception to this rule are

[PATCH 04/14] KVM: x86: Fix wrong masking on relative jump/call

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit Relative jumps and calls do the masking according to the operand size, and not according to the address size as the KVM emulator does today. This patch fixes KVM behavior. Cc: sta...@vger.kernel.org Signed-off-by: Nadav Amit Signed-off-by: Paolo Bonzini --- arch/x86/kvm/emul

[PATCH 00/14] KVM changes for 3.18-rc2

2014-10-24 Thread Paolo Bonzini
This is a pretty large update. I think it is roughly as big as what I usually had for the _whole_ rc period. There are a few bad bugs where the guest can OOPS or crash the host. We have also started looking at attack models for nested virtualization; bugs that usually result in the guest ring 0

[PATCH 02/14] KVM: x86: Prevent host from panicking on shared MSR writes.

2014-10-24 Thread Paolo Bonzini
From: Andy Honig The previous patch blocked invalid writes directly when the MSR is written. As a precaution, prevent future similar mistakes by gracefulling handle GPs caused by writes to shared MSRs. Cc: sta...@vger.kernel.org Signed-off-by: Andrew Honig [Remove parts obsoleted by Nadav's pa

[PATCH 01/14] KVM: x86: Check non-canonical addresses upon WRMSR

2014-10-24 Thread Paolo Bonzini
From: Nadav Amit Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is written to certain MSRs. The behavior is "almost" identical for AMD and Intel (ignoring MSRs that are not implemented in either architecture since they would anyhow #GP). However, IA32_SYSENTER_ESP and IA

Re: [QA-TCP] How to send tcp small packages immediately?

2014-10-24 Thread Rick Jones
On 10/24/2014 12:41 AM, Zhangjie (HZ) wrote: Hi, I use netperf to test the performance of small tcp package, with TCP_NODELAY set : netperf -H 129.9.7.164 -l 100 -- -m 512 -D Among the packages I got by tcpdump, there is not only small packages, also lost of big ones (skb->len=65160). IP 12

[GIT PULL] KVM changes for 3.18-rc2

2014-10-24 Thread Paolo Bonzini
Linus, The following changes since commit c3351dfabf5c78fb5ddc79d0f7b65ebd9e441337: Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending (2014-10-21 13:06:38 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm.gi

Re: Nic Bonding - throughput for guest

2014-10-24 Thread Brian Jackson
On Friday, October 24, 2014 02:37:28 PM Stefan Bauer wrote: > Hi, > > > please CC me - I'm not subscribed to this list. > > > I'm looking forward to bond the 2 Nics from my KVM Host (2 x 1GbE) to > increase throughput for my guest. > > > Currently my guest has a e1000 nic attached. That

Re: [PATCH 13/14] kvm: fix excessive pages un-pinning in kvm_iommu_map error path.

2014-10-24 Thread Quentin Casasnovas
On Fri, Oct 24, 2014 at 05:07:24PM +0200, Paolo Bonzini wrote: > From: Quentin Casasnovas > > The third parameter of kvm_unpin_pages() when called from > kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin > and not the page size. > This got assigned CVE-2014-8369. Quent

Re: [Qemu-devel] [PATCH] target-i386: add Intel AVX-512 support

2014-10-24 Thread Eduardo Habkost
On Thu, Oct 23, 2014 at 11:02:43AM +0800, Chao Peng wrote: > Add AVX512 feature bits, register definition and corresponding > xsave/vmstate support. > > Signed-off-by: Chao Peng > --- [...] > @@ -745,6 +829,9 @@ VMStateDescription vmstate_x86_cpu = { > }, { > .vmsd = &vmstat

Re: [Qemu-devel] [PATCH] target-i386: add Intel AVX-512 support

2014-10-24 Thread Eduardo Habkost
On Thu, Oct 23, 2014 at 04:34:46PM +0200, Paolo Bonzini wrote: > On 10/23/2014 05:02 AM, Chao Peng wrote: > > Add AVX512 feature bits, register definition and corresponding > > xsave/vmstate support. > > > > Signed-off-by: Chao Peng > > --- > > target-i386/cpu.c | 10 -- > > target-i38

Re: [PATCH 05/14] KVM: x86: Emulator fixes for eip canonical checks on near branches

2014-10-24 Thread Andy Lutomirski
On 10/24/2014 08:07 AM, Paolo Bonzini wrote: > From: Nadav Amit > > Before changing rip (during jmp, call, ret, etc.) the target should be > asserted > to be canonical one, as real CPUs do. During sysret, both target rsp and rip > should be canonical. If any of these values is noncanonical, a #

Re: [PATCH 08/14] kvm: x86: don't kill guest on unknown exit reason

2014-10-24 Thread Andy Lutomirski
On 10/24/2014 08:07 AM, Paolo Bonzini wrote: > From: "Michael S. Tsirkin" > > KVM_EXIT_UNKNOWN is a kvm bug, we don't really know whether it was > triggered by a priveledged application. Let's not kill the guest: WARN > and inject #UD instead. This scares me a bit. For guest CPL3, it's probabl

AW: Nic Bonding - throughput for guest

2014-10-24 Thread Stefan Bauer
Hi Brian, thank you for your answer! I will give it a try next week and will report. I want to serve files to different hosts. A single host can only reach the maximum speed from a single port. Thats how it is balanced with hash_policy layer3+4. Stefan -- To unsubscribe from this list: send th

Re: [PATCH v12 09/11] pvqspinlock, x86: Add para-virtualization support

2014-10-24 Thread Waiman Long
On 10/24/2014 04:47 AM, Peter Zijlstra wrote: On Thu, Oct 16, 2014 at 02:10:38PM -0400, Waiman Long wrote: +static inline void pv_init_node(struct mcs_spinlock *node) +{ + struct pv_qnode *pn = (struct pv_qnode *)node; + + BUILD_BUG_ON(sizeof(struct pv_qnode)> 5*sizeof(struct mcs_sp

Re: [PATCH 08/14] kvm: x86: don't kill guest on unknown exit reason

2014-10-24 Thread Paolo Bonzini
On 10/24/2014 07:57 PM, Andy Lutomirski wrote: > > KVM_EXIT_UNKNOWN is a kvm bug, we don't really know whether it was > > triggered by a priveledged application. Let's not kill the guest: WARN > > and inject #UD instead. > > This scares me a bit. For guest CPL3, it's probably okay. For guest > C

Re: [PATCH v12 09/11] pvqspinlock, x86: Add para-virtualization support

2014-10-24 Thread Peter Zijlstra
On Fri, Oct 24, 2014 at 04:53:27PM -0400, Waiman Long wrote: > The additional register pressure may just cause a few more register moves > which should be negligible in the overall performance . The additional > icache pressure, however, may have some impact on performance. I was trying > to balanc

Re: [PATCH 08/14] kvm: x86: don't kill guest on unknown exit reason

2014-10-24 Thread Andy Lutomirski
On Fri, Oct 24, 2014 at 2:54 PM, Paolo Bonzini wrote: > On 10/24/2014 07:57 PM, Andy Lutomirski wrote: >> > KVM_EXIT_UNKNOWN is a kvm bug, we don't really know whether it was >> > triggered by a priveledged application. Let's not kill the guest: WARN >> > and inject #UD instead. >> >> This scares