Re: [PATCH net] vhost: net: switch to use data copy if pending DMAs exceed the limit

2014-02-25 Thread Jason Wang
On 02/26/2014 02:32 PM, Qin Chuanyu wrote: On 2014/2/26 13:53, Jason Wang wrote: On 02/25/2014 09:57 PM, Michael S. Tsirkin wrote: On Tue, Feb 25, 2014 at 02:53:58PM +0800, Jason Wang wrote: We used to stop the handling of tx when the number of pending DMAs exceeds VHOST_MAX_PEND. This is used

Re: [PATCH net] vhost: net: switch to use data copy if pending DMAs exceed the limit

2014-02-25 Thread Qin Chuanyu
On 2014/2/26 13:53, Jason Wang wrote: On 02/25/2014 09:57 PM, Michael S. Tsirkin wrote: On Tue, Feb 25, 2014 at 02:53:58PM +0800, Jason Wang wrote: We used to stop the handling of tx when the number of pending DMAs exceeds VHOST_MAX_PEND. This is used to reduce the memory occupation of both hos

Re: [PATCH] vhost: make vhost_zerocopy_callback more efficient by poll_queue base on vhost status

2014-02-25 Thread Jason Wang
- Original Message - > guest kick vhost base on vring flag status and get perfermance improved, > vhost_zerocopy_callback could do this in the same way, as > virtqueue_enable_cb need one more check after change the status of > avail_ring flags, vhost also do the same thing after vhost_ena

Re: [PATCH net] vhost: net: switch to use data copy if pending DMAs exceed the limit

2014-02-25 Thread Jason Wang
On 02/25/2014 09:57 PM, Michael S. Tsirkin wrote: On Tue, Feb 25, 2014 at 02:53:58PM +0800, Jason Wang wrote: We used to stop the handling of tx when the number of pending DMAs exceeds VHOST_MAX_PEND. This is used to reduce the memory occupation of both host and guest. But it was too aggressive

[PATCH] vhost: make vhost_zerocopy_callback more efficient by poll_queue base on vhost status

2014-02-25 Thread Qin Chuanyu
guest kick vhost base on vring flag status and get perfermance improved, vhost_zerocopy_callback could do this in the same way, as virtqueue_enable_cb need one more check after change the status of avail_ring flags, vhost also do the same thing after vhost_enable_notify test result list as below:

Re: KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty

2014-02-25 Thread Xiao Guangrong
On 02/26/2014 09:44 AM, Marcelo Tosatti wrote: > > emulator_cmpxchg_emulated writes to guest memory, therefore it should > updated the dirty bitmap accordingly. Reviewed-by: Xiao Guangrong -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vg

[uq/master PATCH] kvm-all: exit in case max vcpus exceeded

2014-02-25 Thread Marcelo Tosatti
Rather than fall back to TCG (so the user has to discover whats happening, in case of no access to qemu stdout/stderr). Signed-off-by: Marcelo Tosatti diff --git a/kvm-all.c b/kvm-all.c index 3937754..3f6841d 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1432,11 +1432,10 @@ int kvm_init(void)

Re: KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty

2014-02-25 Thread Marcelo Tosatti
On Tue, Feb 25, 2014 at 10:44:54PM -0300, Marcelo Tosatti wrote: > > emulator_cmpxchg_emulated writes to guest memory, therefore it should > updated the dirty bitmap accordingly. s/updated/update/ > > Signed-off-by: Marcelo Tosatti > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > in

KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty

2014-02-25 Thread Marcelo Tosatti
emulator_cmpxchg_emulated writes to guest memory, therefore it should updated the dirty bitmap accordingly. Signed-off-by: Marcelo Tosatti diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 39c28f09..29db96d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4394,6 +4394,7 @@

Re: [RFC v2 2/4] net: enables interface option to skip IP

2014-02-25 Thread Hannes Frederic Sowa
On Tue, Feb 25, 2014 at 04:18:17PM -0500, David Miller wrote: > From: Dan Williams > Date: Tue, 25 Feb 2014 15:07:00 -0600 > > > Also, disable_ipv4 signals *intent*, which is distinct from current > > state. > > > > Does an interface without an IPv4 address mean that the user wished it > > not t

Re: [RFC 0/6] vhost/scsi: Add T10 PI SGL passthrough support

2014-02-25 Thread Martin K. Petersen
> "nab" == Nicholas A Bellinger writes: nab> Mmm, at least for PI I don't think a residual field is necessary. nab> Any time the metadata is not fully read on outgoing WRITEs, or nab> written on incoming READs the next hop performing a VERIFY nab> operation will end up failing with a GUARD o

Re: KVM: MMU: drop read-only large sptes when creating lower level sptes

2014-02-25 Thread Marcelo Tosatti
On Tue, Feb 25, 2014 at 11:11:19PM +0800, Xiao Guangrong wrote: > > On Feb 25, 2014, at 9:13 PM, Marcelo Tosatti wrote: > > > On Tue, Feb 25, 2014 at 11:30:37AM +0800, Xiao Guangrong wrote: > >> On 02/25/2014 12:59 AM, Marcelo Tosatti wrote: > >>> > >>> Read-only large sptes can be created due

Re: [RFC v2 2/4] net: enables interface option to skip IP

2014-02-25 Thread David Miller
From: Dan Williams Date: Tue, 25 Feb 2014 15:07:00 -0600 > Also, disable_ipv4 signals *intent*, which is distinct from current > state. > > Does an interface without an IPv4 address mean that the user wished it > not to have one? > > Or does it mean that DHCP hasn't started yet (but is supposed

Re: [RFC v2 2/4] net: enables interface option to skip IP

2014-02-25 Thread Dan Williams
On Mon, 2014-02-24 at 18:04 -0500, David Miller wrote: > From: Dan Williams > Date: Mon, 24 Feb 2014 12:22:00 -0600 > > > In the future I expect more people will want to disable IPv4 as > > they move to IPv6. > > I definitely don't. > > I've been lightly following this conversation and I have t

Re: [RFC v2 2/4] net: enables interface option to skip IP

2014-02-25 Thread Paul Marks
On Mon, Feb 24, 2014 at 4:12 PM, David Miller wrote: > From: Ben Hutchings > Date: Tue, 25 Feb 2014 00:02:00 + > >> You can run an internal network, or access network, as v6-only with >> NAT64 and DNS64 at the border. I believe some mobile networks are doing >> this; it was also done on the

[PATCH 2/6] linux-headers: add new interfaces

2014-02-25 Thread Cornelia Huck
Per-vm capability enablement, adapter interrupt sources, irq routing on s390. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- linux-headers/asm-s390/kvm.h | 22 ++ linux-headers/linux/kvm.h| 16 2 files changed, 38 insertions(+) diff --git

[PATCH 5/7] KVM: s390: adapter interrupt sources

2014-02-25 Thread Cornelia Huck
Add a new interface to register/deregister sources of adapter interrupts identified by an unique id via the flic. Adapters may also be maskable and carry a list of pinned pages. These adapters will be used by irq routing later. Signed-off-by: Cornelia Huck --- Documentation/virtual/kvm/devices/

[PATCH 6/7] KVM: s390: irq routing for adapter interrupts.

2014-02-25 Thread Cornelia Huck
Introduce a new interrupt class for s390 adapter interrupts and enable irqfds for s390. This is depending on a new s390 specific vm capability, KVM_CAP_S390_IRQCHIP, that needs to be enabled by userspace. Signed-off-by: Cornelia Huck --- Documentation/virtual/kvm/api.txt | 21 ++

[PATCH 1/6] s390x/virtio-ccw: Adapter interrupt support.

2014-02-25 Thread Cornelia Huck
Handle the new CCW_CMD_SET_IND_ADAPTER command enabling adapter interrupts on guest request. When active, host->guest notifications will be handled via global_indicator -> queue indicators instead of queue indicators + subchannel I/O interrupt. Indicators for virtqueues may be present at an offset.

[PATCH 2/7] KVM: s390: virtio-ccw adapter interrupt support.

2014-02-25 Thread Cornelia Huck
Implement the new CCW_CMD_SET_IND_ADAPTER command and try to enable adapter interrupts for every device on the first startup. If the host does not support adapter interrupts, fall back to normal I/O interrupts. virtio-ccw adapter interrupts use the same isc as normal I/O subchannels and share a su

[PATCH 0/6] qemu: irqfds for s390x

2014-02-25 Thread Cornelia Huck
Hi, here's the companion patchset to "KVM: irqfds for s390", based on Christian's s390-next branch. Patch 1 adds support for adapter interrupts to virtio-ccw. This has been posted before, modulo some fixes. Patch 2 grabs the interfaces introduced by the kernel patchset. Will be replaced by a nor

[PATCH 1/7] s390/airq: add support for irq ranges

2014-02-25 Thread Cornelia Huck
From: Martin Schwidefsky Add airq_iv_alloc and airq_iv_free to allocate and free consecutive ranges of irqs from the interrupt vector. Signed-off-by: Martin Schwidefsky Signed-off-by: Cornelia Huck --- arch/s390/include/asm/airq.h | 14 +++-- drivers/s390/cio/airq.c | 66

[PATCH 4/7] KVM: Add per-vm capability enablement.

2014-02-25 Thread Cornelia Huck
Allow KVM_ENABLE_CAP to act on a vm as well as on a vcpu. This makes more sense when the caller wants to enable a vm-related capability. s390 will be the first user; wire it up. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- Documentation/virtual/kvm/api.txt |6 -- arch/s390

[PATCH 4/6] s390x: Add I/O adapter registration.

2014-02-25 Thread Cornelia Huck
Register an I/O adapter interrupt source for when virtio-ccw devices start using adapter interrupts. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/intc/s390_flic.c | 66 + hw/s390x/css.c| 51 +++

[PATCH 3/6] kvm: add kvm_enable_cap_{vm,vcpu}

2014-02-25 Thread Cornelia Huck
Provide helper functions for enabling capabilities (on a vcpu and on a vm). Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- include/sysemu/kvm.h |4 kvm-all.c| 19 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/sysemu/

[PATCH 5/6] s390x/virtio-ccw: reference-counted indicators

2014-02-25 Thread Cornelia Huck
Make code using the same indicators point to a single allocated structure that is freed when the last user goes away. This will be used by the irqfd code to unmap addresses after the last user is gone. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 80 +

[PATCH 6/6] s390x/virtio-ccw: Wire up irq routing and irqfds.

2014-02-25 Thread Cornelia Huck
Make use of the new s390 adapter irq routing support to enable real in-kernel irqfds for virtio-ccw with adapter interrupts. Note that s390 doesn't provide the common KVM_CAP_IRQCHIP capability, but rather needs KVM_CAP_S390_IRQCHIP to be enabled. This is to ensure backward compatibility. Reviewe

[PATCH 7/7] KVM: Bump KVM_MAX_IRQ_ROUTES for s390

2014-02-25 Thread Cornelia Huck
The maximum number for irq routes is currently 1024, which is a bit on the small size for s390: We support up to 4 x 64k virtual devices with up to 64 queues, and we need one route for each of the queues if we want to operate it via irqfd. Let's bump this to 4k on s390 for now, as this at least co

[PATCH 0/7] KVM: irqfds for s390

2014-02-25 Thread Cornelia Huck
Hi, here's my current patchset enabling irqfds for s390, based on current kvm/queue. It introduces adapter interrupts for virtio-ccw (these have been specced for virtio-1.0 in the virtio oasis standard that is currently under work). We use two-staged indicators for the queue indicator area (summa

[PATCH 3/7] KVM: eventfd: Fix lock order inversion.

2014-02-25 Thread Cornelia Huck
When registering a new irqfd, we call its ->poll method to collect any event that might have previously been pending so that we can trigger it. This is done under the kvm->irqfds.lock, which means the eventfd's ctx lock is taken under it. However, if we get a POLLHUP in irqfd_wakeup, we will be ca

Re: [PATCH] PPC: KVM: Introduce hypervisor call H_GET_TCE

2014-02-25 Thread Laurent Dufour
On 21/02/2014 16:57, Alexander Graf wrote: > > On 21.02.2014, at 16:31, Laurent Dufour wrote: > >> This fix introduces the H_GET_TCE hypervisor call which is basically the >> reverse of H_PUT_TCE, as defined in the Power Architecture Platform >> Requirements (PAPR). >> >> The hcall H_GET_TCE is

Re: KVM: MMU: drop read-only large sptes when creating lower level sptes

2014-02-25 Thread Xiao Guangrong
On Feb 25, 2014, at 9:13 PM, Marcelo Tosatti wrote: > On Tue, Feb 25, 2014 at 11:30:37AM +0800, Xiao Guangrong wrote: >> On 02/25/2014 12:59 AM, Marcelo Tosatti wrote: >>> >>> Read-only large sptes can be created due to read-only faults as >>> follows: >>> >>> - QEMU pagetable entry that maps

Re: [PATCH] kvm-unit-tests: Fix GCC's 4.8 labels as values for nVMX tests.

2014-02-25 Thread Jan Kiszka
On 2014-02-25 15:26, Paolo Bonzini wrote: > Il 24/02/2014 16:58, Jan Kiszka ha scritto: >> On 2014-02-24 16:25, Marius Vlad wrote: >>> Commit 3b1274463fa8d074dd3bc77efe25b59a4ddd491e uses GCCs extension >>> labels as values to handle exceptions, but GCC 4.8 ``mistakingly'' >>> uses the next body fu

Re: [PATCH 00/13] kvm-unit-tests: Various improvements for x86 tests

2014-02-25 Thread Paolo Bonzini
Il 04/01/2014 18:59, Jan Kiszka ha scritto: Highlights: - improved preemption timer and interrupt injection tests (obsoletes my two patches in vmx queue) - tests for IA32_APIC_BASE writes - test for unconditional IO exiting (VMX) - basic test of debug facilities (hw breakpoints etc.) Jan

Re: [PATCH] kvm-unit-tests: Fix GCC's 4.8 labels as values for nVMX tests.

2014-02-25 Thread Paolo Bonzini
Il 24/02/2014 16:58, Jan Kiszka ha scritto: On 2014-02-24 16:25, Marius Vlad wrote: Commit 3b1274463fa8d074dd3bc77efe25b59a4ddd491e uses GCCs extension labels as values to handle exceptions, but GCC 4.8 ``mistakingly'' uses the next body function as a jump label, for functions which do not retur

Re: KVM x86: Infinite loop on updating accessed bit in r/o page table

2014-02-25 Thread Paolo Bonzini
Il 25/02/2014 12:23, Jan Kiszka ha scritto: > even though OVMF sets the accessed/dirty bits so it's not exactly the same > scenario. > > Note that NPT simply does not support this. Page tables must be writable > in the NPT page tables, according to the AMD manual. We could still emulate the ins

Re: [PATCH net] vhost: net: switch to use data copy if pending DMAs exceed the limit

2014-02-25 Thread Michael S. Tsirkin
On Tue, Feb 25, 2014 at 02:53:58PM +0800, Jason Wang wrote: > We used to stop the handling of tx when the number of pending DMAs > exceeds VHOST_MAX_PEND. This is used to reduce the memory occupation > of both host and guest. But it was too aggressive in some cases, since > any delay or blocking of

Re: KVM: MMU: drop read-only large sptes when creating lower level sptes

2014-02-25 Thread Marcelo Tosatti
On Tue, Feb 25, 2014 at 11:30:37AM +0800, Xiao Guangrong wrote: > On 02/25/2014 12:59 AM, Marcelo Tosatti wrote: > > > > Read-only large sptes can be created due to read-only faults as > > follows: > > > > - QEMU pagetable entry that maps guest memory is read-only > > due to COW. > > - Guest rea

Re: KVM x86: Infinite loop on updating accessed bit in r/o page table

2014-02-25 Thread Jan Kiszka
On 2014-02-25 11:57, Paolo Bonzini wrote: > Il 24/02/2014 19:29, Jan Kiszka ha scritto: >> Hi, >> >> I noticed that KVM (with VMX at least) enters an inifite loop of >> vmentries and ept-violations when it has to set the accessed bit in a >> guest page table that is in read-only memory (namely: the

Re: KVM x86: Infinite loop on updating accessed bit in r/o page table

2014-02-25 Thread Paolo Bonzini
Il 24/02/2014 19:29, Jan Kiszka ha scritto: > Hi, > > I noticed that KVM (with VMX at least) enters an inifite loop of > vmentries and ept-violations when it has to set the accessed bit in a > guest page table that is in read-only memory (namely: the F-segment of > the BIOS). I don't think this is

Re: [PATCH] x86: kvm: fix unstable_tsc boot

2014-02-25 Thread Andrew Jones
On Mon, Feb 24, 2014 at 06:15:24PM -0300, Marcelo Tosatti wrote: > On Mon, Feb 24, 2014 at 04:42:29PM +0100, Andrew Jones wrote: > > When the tsc is marked unstable on the host it causes global clock > > updates to be requested each time a vcpu is loaded, nearly halting > > all progress on guests w

Re: [PATCH] vhost: make vhost_zerocopy_callback more efficient by poll_queue base on vhost status

2014-02-25 Thread Jason Wang
On 02/25/2014 04:56 PM, Qin Chuanyu wrote: > On 2014/2/25 16:13, Jason Wang wrote: >> On 02/25/2014 03:53 PM, Qin Chuanyu wrote: >>> On 2014/2/25 15:38, Jason Wang wrote: On 02/25/2014 02:55 PM, Qin Chuanyu wrote: > guest kick vhost base on vring flag status and get perfermance > impro

Re: [PATCH] vhost: make vhost_zerocopy_callback more efficient by poll_queue base on vhost status

2014-02-25 Thread Qin Chuanyu
On 2014/2/25 16:13, Jason Wang wrote: On 02/25/2014 03:53 PM, Qin Chuanyu wrote: On 2014/2/25 15:38, Jason Wang wrote: On 02/25/2014 02:55 PM, Qin Chuanyu wrote: guest kick vhost base on vring flag status and get perfermance improved, vhost_zerocopy_callback could do this in the same way, as v

Re: KVM: MMU: drop read-only large sptes when creating lower level sptes

2014-02-25 Thread Paolo Bonzini
Il 24/02/2014 17:59, Marcelo Tosatti ha scritto: Read-only large sptes can be created due to read-only faults as follows: - QEMU pagetable entry that maps guest memory is read-only due to COW. - Guest read faults such memory, COW is not broken, because it is a read-only fault. - Enable dirty lo

Re: [PATCH] vhost: make vhost_zerocopy_callback more efficient by poll_queue base on vhost status

2014-02-25 Thread Jason Wang
On 02/25/2014 03:53 PM, Qin Chuanyu wrote: > On 2014/2/25 15:38, Jason Wang wrote: >> On 02/25/2014 02:55 PM, Qin Chuanyu wrote: >>> guest kick vhost base on vring flag status and get perfermance >>> improved, >>> vhost_zerocopy_callback could do this in the same way, as >>> virtqueue_enable_cb nee