[PATCH 8/8] KVM: s390: Make KVM_HVA_ERR_BAD usable on s390

2013-07-26 Thread Christian Borntraeger
s. Signed-off-by: Dominik Dingel Signed-off-by: Christian Borntraeger --- arch/s390/include/asm/kvm_host.h | 8 include/linux/kvm_host.h | 8 2 files changed, 16 insertions(+) diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 3238d4

[PATCH 6/8] KVM: s390: Fix sparse warnings in priv.c

2013-07-26 Thread Christian Borntraeger
From: Thomas Huth sparse complained about the missing UL postfix for long constants. Signed-off-by: Thomas Huth Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/kvm/priv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/s390/kvm

[PATCH 5/8] KVM: s390: declare virtual HW facilities

2013-07-26 Thread Christian Borntraeger
or virtual facilites has been added as well. Signed-off-by: Michael Mueller Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 23 +++ arch/s390/kvm/kvm-s390.h | 3 +++ arch/s390/kvm/priv.c | 11 --- 3 files changed, 22 insertions(+), 15 deletions(-) di

[PATCH 7/8] KVM: s390: Add helper function for setting condition code

2013-07-26 Thread Christian Borntraeger
From: Thomas Huth Introduced a helper function for setting the CC in the guest PSW to improve the readability of the code. Signed-off-by: Thomas Huth Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.h | 7 +++ arch/s390/kvm/priv.c | 15 ++- 2 files changed

[PATCH/RFC 2/5] KVM: s390: move finalization of SIGP STOP orders to kvm_s390_vcpu_stop

2014-07-10 Thread Christian Borntraeger
te to STOPPED while holding the local irq lock. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/intercept.c | 31 --- arch/s390/kvm/kvm-s390.c | 8 2

[PATCH/RFC 0/5] KVM: s390: Let user space control the cpu states

2014-07-10 Thread Christian Borntraeger
Paolo, here is a preview of a rework of CPU state on s390x. Since we extend MP_STATE I wanted to send an RFC upfront. I will wait for some feedback and send a proper pull request in the next week: - This series enables the "KVM_SET_MP_STATE" ioctl on s390 to make the cpu state settable by u

[PATCH/RFC 3/5] KVM: s390: remove __cpu_is_stopped and expose is_vcpu_stopped

2014-07-10 Thread Christian Borntraeger
(). Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 7 +-- arch/s390/kvm/kvm-s390.h | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b

[PATCH/RFC 0/5] s390x/kvm: track the logical cpu state in QEMU and propagate it to kvm

2014-07-10 Thread Christian Borntraeger
This is the qemu part of kernel series "Let user space control the cpu states" Christian Borntraeger (1): update linux headers with with cpustate changes David Hildenbrand (4): s390x/kvm: introduce proper states for s390 cpus s390x/kvm: proper use of the cpu states OPERATING a

[PATCH/RFC 1/5] KVM: s390: allow only one SIGP STOP (AND STORE STATUS) at a time

2014-07-10 Thread Christian Borntraeger
VCPU state change (to avoid race conditions). Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/sigp.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/s390/kvm/sigp.c

[PATCH/RFC 4/5] KVM: prepare for KVM_(S|G)ET_MP_STATE on other architectures

2014-07-10 Thread Christian Borntraeger
s390. Fix a spelling error (KVM_SET_MP_STATE vs. KVM_SET_MPSTATE) on the way. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- Documentation/virtual/kvm/api.txt | 21 - include/uapi/linux

[PATCH/RFC 2/5] s390x/kvm: introduce proper states for s390 cpus

2014-07-10 Thread Christian Borntraeger
Borntraeger Signed-off-by: Christian Borntraeger [folded Jason's patch into David's patch to avoid add/remove same lines] --- hw/s390x/s390-virtio.c | 32 target-s390x/cpu.c | 43 +++ target-s390x/cpu.

[PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-10 Thread Christian Borntraeger
d-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- target-s390x/cpu.c | 6 ++ target-s390x/kvm.c | 5 + 2 files changed, 11 insertions(+) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index c5ab98f..1d32f

[PATCH/RFC 3/5] s390x/kvm: proper use of the cpu states OPERATING and STOPPED

2014-07-10 Thread Christian Borntraeger
oper cpu state synchronization with the kvm part, we need to track the real logical state of a cpu. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- hw/s390x/ipl.c

[PATCH/RFC 5/5] s390x/kvm: propagate s390 cpu state to kvm

2014-07-10 Thread Christian Borntraeger
by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- target-s390x/cpu.c | 3 +++ target-s390x/cpu.h | 5 + target-s390x/kvm.c | 33 + trace-events | 1 + 4 files changed, 42 insertions(+) diff --git a/target-s390x/cpu.c

[PATCH/RFC 5/5] KVM: s390: implement KVM_(S|G)ET_MP_STATE for user space state control

2014-07-10 Thread Christian Borntraeger
KVM_SET_MP_STATE, we can disable manual changing of the VCPU state and trust user space to do the right thing. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- Documentation/virtual/kvm/api.txt | 10 -- arch/s390

[PATCH/RFC 1/5] update linux headers with with cpustate changes

2014-07-10 Thread Christian Borntraeger
Will do a proper headers sync when ready Signed-off-by: Christian Borntraeger --- linux-headers/linux/kvm.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index f5d2c38..9b584da 100644 --- a/linux-headers/linux

[GIT PULL 0/5] KVM: s390: Let user space control the cpu states

2014-07-15 Thread Christian Borntraeger
Paolo, The following changes since commit 9f6226a762c7ae02f6a23a3d4fc552dafa57ea23: arch: x86: kvm: x86.c: Cleaning up variable is set more than once (2014-06-30 16:52:04 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git tags/k

[GIT PULL 1/5] KVM: s390: allow only one SIGP STOP (AND STORE STATUS) at a time

2014-07-15 Thread Christian Borntraeger
VCPU state change (to avoid race conditions). Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/sigp.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/s390/kvm/sigp.c

[GIT PULL 4/5] KVM: prepare for KVM_(S|G)ET_MP_STATE on other architectures

2014-07-15 Thread Christian Borntraeger
s390. Fix a spelling error (KVM_SET_MP_STATE vs. KVM_SET_MPSTATE) on the way. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- Documentation/virtual/kvm/api.txt | 21 - include/uapi/linux

[GIT PULL 3/5] KVM: s390: remove __cpu_is_stopped and expose is_vcpu_stopped

2014-07-15 Thread Christian Borntraeger
(). Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 7 +-- arch/s390/kvm/kvm-s390.h | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b

[GIT PULL 2/5] KVM: s390: move finalization of SIGP STOP orders to kvm_s390_vcpu_stop

2014-07-15 Thread Christian Borntraeger
te to STOPPED while holding the local irq lock. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/intercept.c | 31 --- arch/s390/kvm/kvm-s390.c | 8 2

[GIT PULL 5/5] KVM: s390: implement KVM_(S|G)ET_MP_STATE for user space state control

2014-07-15 Thread Christian Borntraeger
KVM_SET_MP_STATE, we can disable manual changing of the VCPU state and trust user space to do the right thing. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- Documentation/virtual/kvm/api.txt | 10 -- arch/s390

Re: [GIT PULL 0/5] KVM: s390: Let user space control the cpu states

2014-07-21 Thread Christian Borntraeger
On 18/07/14 16:49, Paolo Bonzini wrote: > Il 15/07/2014 15:27, Christian Borntraeger ha scritto: >> Paolo, >> >> The following changes since commit 9f6226a762c7ae02f6a23a3d4fc552dafa57ea23: >> >> arch: x86: kvm: x86.c: Cleaning up variable is set more than on

[GIT PULL 9/9] KVM: s390: add ipte to trace event decoding

2014-07-21 Thread Christian Borntraeger
IPTE intercept can happen, let's decode that. Signed-off-by: Christian Borntraeger Acked-by: Cornelia Huck --- arch/s390/include/uapi/asm/sie.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/include/uapi/asm/sie.h b/arch/s390/include/uapi/asm/sie.h index 5d9cc19..d4096fd 1

[GIT PULL 7/9] KVM: s390: document KVM_CAP_S390_IRQCHIP

2014-07-21 Thread Christian Borntraeger
From: Cornelia Huck Let's document that this is a capability that may be enabled per-vm. Signed-off-by: Cornelia Huck Reviewed-by: David Hildenbrand Signed-off-by: Christian Borntraeger --- Documentation/virtual/kvm/api.txt | 9 + 1 file changed, 9 insertions(+) diff --

[GIT PULL 6/9] KVM: document target of capability enablement

2014-07-21 Thread Christian Borntraeger
From: Cornelia Huck Capabilities can be enabled on a vcpu or (since recently) on a vm. Document this and note for the existing capabilites whether they are per-vcpu or per-vm. Signed-off-by: Cornelia Huck Reviewed-by: David Hildenbrand Signed-off-by: Christian Borntraeger --- Documentation

[GIT PULL 1/9] KVM: s390: cleanup handle_wait by reusing kvm_vcpu_block

2014-07-21 Thread Christian Borntraeger
, so no checks are lost. The flag "timer_due" can be removed - kvm_cpu_has_pending_timer() tests whether the timer is pending, thus the vcpu is correctly woken up. Signed-off-by: David Hildenbrand Acked-by: Christian Borntraeger Acked-by: Cornelia Huck Signed-off-by: Christian B

[GIT PULL 5/9] KVM: s390: remove the tasklet used by the hrtimer

2014-07-21 Thread Christian Borntraeger
From: David Hildenbrand We can get rid of the tasklet used for waking up a VCPU in the hrtimer code but wakeup the VCPU directly. Signed-off-by: David Hildenbrand Reviewed-by: Christian Borntraeger Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/include/asm

[GIT PULL 2/9] KVM: s390: remove _bh locking from local_int.lock

2014-07-21 Thread Christian Borntraeger
From: David Hildenbrand local_int.lock is not used in a bottom-half handler anymore, therefore we can turn it into an ordinary spin_lock at all occurrences. Signed-off-by: David Hildenbrand Reviewed-by: Christian Borntraeger Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger

[GIT PULL 8/9] KVM: s390: advertise KVM_CAP_S390_IRQCHIP

2014-07-21 Thread Christian Borntraeger
From: Cornelia Huck We should advertise all capabilities, including those that can be enabled. Signed-off-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/kvm/kvm

[GIT PULL 3/9] KVM: s390: remove _bh locking from start_stop_lock

2014-07-21 Thread Christian Borntraeger
From: David Hildenbrand The start_stop_lock is no longer acquired when in atomic context, therefore we can convert it into an ordinary spin_lock. Signed-off-by: David Hildenbrand Reviewed-by: Christian Borntraeger Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390

[GIT PULL 0/9] KVM: s390: Fixes and cleanups for 3.17

2014-07-21 Thread Christian Borntraeger
Christian Borntraeger (1): KVM: s390: add ipte to trace event decoding Cornelia Huck (3): KVM: document target of capability enablement KVM: s390: document KVM_CAP_S390_IRQCHIP KVM: s390: advertise KVM_CAP_S390_IRQCHIP David Hildenbrand (5): KVM: s390

[GIT PULL 4/9] KVM: s390: move vcpu wakeup code to a central point

2014-07-21 Thread Christian Borntraeger
chedules after schedule() in some scenarios. The wakeup code doesn't require the local_int.lock to be held. Signed-off-by: David Hildenbrand Reviewed-by: Christian Borntraeger Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 24 +++--

Re: [GIT PULL 8/9] KVM: s390: advertise KVM_CAP_S390_IRQCHIP

2014-07-22 Thread Christian Borntraeger
On 22/07/14 10:32, Paolo Bonzini wrote: > Il 21/07/2014 21:14, Christian Borntraeger ha scritto: >> From: Cornelia Huck >> >> We should advertise all capabilities, including those that can >> be enabled. >> >> Signed-off-by: Cornelia Huck >> Acke

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-29 Thread Christian Borntraeger
On 28/07/14 16:22, Alexander Graf wrote: > > On 28.07.2014, at 16:16, David Hildenbrand wrote: > >>> >>> On 10.07.14 15:10, Christian Borntraeger wrote: >>>> From: David Hildenbrand >>>> >>>> If a cpu is stopped, it must never be a

[GIT PULL 2/2] KVM: s390: rework broken SIGP STOP interrupt handling

2014-07-31 Thread Christian Borntraeger
ildenbrand Reviewed-by: Christian Borntraeger Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger [some additional patch description] --- arch/s390/kvm/interrupt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 1be3d8d..9252

[GIT PULL 1/2] KVM: s390: Fix memory leak on busy SIGP stop

2014-07-31 Thread Christian Borntraeger
commit 7dfc63cf977447e09b1072911c22564f900fc578 (KVM: s390: allow only one SIGP STOP (AND STORE STATUS) at a time) introduced a memory leak if a sigp stop is already pending. Free the allocated inti structure. Signed-off-by: Christian Borntraeger Reviewed-by: David Hildenbrand --- arch/s390

[GIT PULL 0/2] KVM: s390: Fixes for kvm/next (3.17)

2014-07-31 Thread Christian Borntraeger
Linux as a guest. So no need for cc stable Christian Borntraeger (1): KVM: s390: Fix memory leak on busy SIGP stop David Hildenbrand (1): KVM: s390: rework broken SIGP STOP interrupt handling arch/s390/kvm/interrupt.c | 3

[PATCH/RFC] KVM: perf/stat: Properly show submicrosecond times

2014-07-31 Thread Christian Borntraeger
For lots of exits the min time (and sometimes max) is 0 or 1. Lets increase the accurancy similar to what the average field alread does. Cc: Paolo Bonzini Cc: Jiri Olsa Cc: David Ahern Cc: Arnaldo Carvalho de Melo Signed-off-by: Christian Borntraeger --- tools/perf/builtin-kvm.c | 8

[RFC] increase perf kvm stat accuracy

2014-07-31 Thread Christian Borntraeger
On my s390 kvm system most of the kvm exits are in the range of 0 or 1 microseconds. Can we increase the accuracy by 2 additional digits? Opinions? Christian Borntraeger (1): KVM: perf/stat: Properly show submicrosecond times tools/perf/builtin-kvm.c | 8 1 file changed, 4

[PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-05 Thread Christian Borntraeger
of yielding, so let's update the pid only in the KVM_RUN ioctl. In addition, don't do a synchronize_rcu on startup (pid == 0). This speeds up guest boot time on s390 noticably for some configs, e.g. HZ=100, no full state tracking, 64 guest cpus 32 host cpus. Signed-off-by: Christian B

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-07 Thread Christian Borntraeger
On 07/08/14 10:21, Raghavendra K T wrote: > On 08/05/2014 08:14 PM, Christian Borntraeger wrote: >> We currently track the pid of the task that runs the VCPU in >> vcpu_load. Since we call vcpu_load for all kind of ioctls on a >> CPU, this causes hickups due to synchron

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 07/08/14 15:40, Paolo Bonzini wrote: > Il 07/08/2014 11:59, Christian Borntraeger ha scritto: >> Paolo, >> >> are you willing to apply to kvm/queue? > > I asked a question, but anyway... not until the end of the merge window > and my small vacation. :) > >

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 07/08/14 15:39, Paolo Bonzini wrote: > Il 05/08/2014 16:44, Christian Borntraeger ha scritto: >> We currently track the pid of the task that runs the VCPU in >> vcpu_load. Since we call vcpu_load for all kind of ioctls on a >> CPU, this causes hickups due to synchron

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 19/08/14 11:27, Paolo Bonzini wrote: > Il 19/08/2014 10:38, Christian Borntraeger ha scritto: >>>> The patch may be okay, but I'm worried that it might be hiding a bug in >>>> QEMU. >> On s390 we call "KVM_S390_INITIAL_RESET" from several reset f

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 19/08/14 11:53, Paolo Bonzini wrote: > Il 19/08/2014 11:47, Christian Borntraeger ha scritto: >> On 19/08/14 11:27, Paolo Bonzini wrote: >>> Il 19/08/2014 10:38, Christian Borntraeger ha scritto: >>>>>> The patch may be okay, but I'm worried that it migh

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 19/08/14 12:03, Paolo Bonzini wrote: > Il 19/08/2014 11:59, Christian Borntraeger ha scritto: >> Its only for the interrupts that are cpu local (like pending IPIs). >> In addition, we would do that only for the reset case (with an >> interface that can be used for

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 19/08/14 12:31, Paolo Bonzini wrote: > Il 19/08/2014 12:09, Christian Borntraeger ha scritto: >>> I'm not sure, this does seem like a workaround for another >>> limitation after all... Gleb? >> >> Yes. We want to get rid of KVM_S390_INITIAL_RESET in QEMU.

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 18/08/14 07:02, Wanpeng Li wrote: > Hi Christian, > On Tue, Aug 05, 2014 at 04:44:14PM +0200, Christian Borntraeger wrote: >> We currently track the pid of the task that runs the VCPU in >> vcpu_load. Since we call vcpu_load for all kind of ioctls on a >> CPU, th

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 19/08/14 14:14, David Hildenbrand wrote: >> Il 19/08/2014 13:28, David Hildenbrand ha scritto: >>> Looking at the code, kvm_cpu_synchronize_state() seems to do these ioctls in >>> the vcpu thread (e.g. comming from cpu_synchronize_all_states()), any >>> reasons >>> why kvm_cpu_synchronize_post_

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-19 Thread Christian Borntraeger
On 19/08/14 16:23, David Hildenbrand wrote: >> On 19/08/14 14:14, David Hildenbrand wrote: Il 19/08/2014 13:28, David Hildenbrand ha scritto: > Looking at the code, kvm_cpu_synchronize_state() seems to do these ioctls > in > the vcpu thread (e.g. comming from cpu_synchronize_all_s

[PATCH] KVM: avoid unnecessary synchronize_rcu

2014-08-19 Thread Christian Borntraeger
We dont have to wait for a grace period if there is no oldpid that we are going to free. putpid also checks for NULL, so this patch only fences synchronize_rcu. Signed-off-by: Christian Borntraeger --- virt/kvm/kvm_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl

2014-08-20 Thread Christian Borntraeger
On 20/08/14 01:22, Wanpeng Li wrote: > On Tue, Aug 19, 2014 at 04:04:03PM +0200, Christian Borntraeger wrote: >> On 18/08/14 07:02, Wanpeng Li wrote: >>> Hi Christian, >>> On Tue, Aug 05, 2014 at 04:44:14PM +0200, Christian Borntraeger wrote: >>>> We curren

Re: [PATCH 1/9] KVM: add kvm_arch_sched_in

2014-08-20 Thread Christian Borntraeger
On 19/08/14 22:35, Radim Krčmář wrote: > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -3123,6 +3123,8 @@ static void kvm_sched_in(struct preempt_notifier *pn, > int cpu) > if (vcpu->preempted) > vcpu->preempted = false; > > + kvm_arch_sched_in(vcpu, cpu); >

Re: [PATCH] vhost: Add polling mode

2014-08-20 Thread Christian Borntraeger
On 10/08/14 10:30, Razya Ladelsky wrote: > From: Razya Ladelsky > Date: Thu, 31 Jul 2014 09:47:20 +0300 > Subject: [PATCH] vhost: Add polling mode > > When vhost is waiting for buffers from the guest driver (e.g., more packets to > send in vhost-net's transmit queue), it normally goes to sleep an

Re: [PATCH] KVM: avoid unnecessary synchronize_rcu

2014-08-25 Thread Christian Borntraeger
On 19/08/14 16:45, Christian Borntraeger wrote: > We dont have to wait for a grace period if there is no oldpid that > we are going to free. putpid also checks for NULL, so this patch > only fences synchronize_rcu. > > Signed-off-by: Christian Borntraeger > --- > vi

Re: [PATCH] KVM: avoid unnecessary synchronize_rcu

2014-08-25 Thread Christian Borntraeger
On 25/08/14 10:24, Christian Borntraeger wrote: > On 19/08/14 16:45, Christian Borntraeger wrote: >> We dont have to wait for a grace period if there is no oldpid that >> we are going to free. putpid also checks for NULL, so this patch >> only fences synchronize_rcu. >>

[GIT PULL 2/2] KVM: s390/mm: try a cow on read only pages for key ops

2014-08-25 Thread Christian Borntraeger
The PFMF instruction handler blindly wrote the storage key even if the page was mapped R/O in the host. Lets try a COW before continuing and bail out in case of errors. Signed-off-by: Christian Borntraeger Reviewed-by: Dominik Dingel Cc: sta...@vger.kernel.org --- arch/s390/mm/pgtable.c | 10

[GIT PULL 0/2] KVM: s390: Fixes for 3.17

2014-08-25 Thread Christian Borntraeger
malicious user to change the storage key of read-only pages Christian Borntraeger (2): KVM: s390: Fix user triggerable bug in dead code KVM: s390/mm: try a cow on read only pages for key ops arch/s390/kvm/kvm-s390.c | 13

[GIT PULL 1/2] KVM: s390: Fix user triggerable bug in dead code

2014-08-25 Thread Christian Borntraeger
structure. Unfortunately, this allows userspace to trigger a kernel BUG. Let's just remove this switch statement. Signed-off-by: Christian Borntraeger Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Cc: sta...@vger.kernel.org --- arch/s390/kvm/kvm-s390.c | 13 - 1 file ch

Re: [GIT PULL 0/2] KVM: s390: Fixes for 3.17

2014-08-25 Thread Christian Borntraeger
On 25/08/14 15:42, Paolo Bonzini wrote: > Il 25/08/2014 15:10, Christian Borntraeger ha scritto: >> Paolo, >> >> the following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9: >> >> Linux 3.17-rc1 (2014-08-16 10:40:26 -0600) >> >> are av

[GIT PULL 04/15] KVM: s390: clear kvm_dirty_regs when dropping to user space

2014-08-26 Thread Christian Borntraeger
From: David Hildenbrand We should make sure that all kvm_dirty_regs bits are cleared before dropping to user space. Until now, some would remain pending. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 6

[GIT PULL 00/15] KVM: s390: Features and fixes for next (3.18)

2014-08-26 Thread Christian Borntraeger
pport gmap page tables with less than 5 levels. ---- Christian Borntraeger (1): KVM: s390: no special machine check delivery David Hildenbrand (4): KVM: clarify the idea of kvm_dirty_regs KVM: s390: clear kvm_dirty

[GIT PULL 02/15] KVM: s390: factor out get_ilc() function

2014-08-26 Thread Christian Borntraeger
From: Jens Freimann Let's make this a reusable function. Signed-off-by: Jens Freimann Acked-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 41 + 1 file changed, 21 inser

[GIT PULL 10/15] KVM: s390/mm: readd address parameter to pgste_ipte_notify

2014-08-26 Thread Christian Borntraeger
From: Martin Schwidefsky Revert git commit 1b7fd6952063 ("remove unecessary parameter from pgste_ipte_notify") Signed-off-by: Martin Schwidefsky Signed-off-by: Christian Borntraeger --- arch/s390/include/asm/pgtable.h | 17 + 1 file changed, 9 insertions(+), 8

[GIT PULL 15/15] KVM: s390/mm: remove outdated gmap data structures

2014-08-26 Thread Christian Borntraeger
From: Martin Schwidefsky The radix tree rework removed all code that uses the gmap_rmap and gmap_pgtable data structures. Remove these outdated definitions. Signed-off-by: Martin Schwidefsky Signed-off-by: Christian Borntraeger --- arch/s390/include/asm/pgtable.h | 23

[GIT PULL 09/15] KVM: s390: don't use kvm lock in interrupt injection code

2014-08-26 Thread Christian Borntraeger
ned-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index e2f6240..ba89bbb 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -991,7 +991,6 @@ int kvm_s390_i

[GIT PULL 06/15] KVM: s390: synchronize more registers with kvm_run

2014-08-26 Thread Christian Borntraeger
helper routines. Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/include/uapi/asm/kvm.h | 10 +++ arch/s390/kvm/kvm-s390.c | 60 ++-- 2 files changed

[GIT PULL 13/15] KVM: s390/mm: use radix trees for guest to host mappings

2014-08-26 Thread Christian Borntraeger
invalidation in the gmap shadow page table. As the radix tree can only store one pointer, each host segment may only be mapped to exactly one guest location. Signed-off-by: Martin Schwidefsky Signed-off-by: Christian Borntraeger --- arch/s390/include/asm/pgalloc.h | 8 +- arch/s390/include/asm

[GIT PULL 05/15] KVM: s390: no special machine check delivery

2014-08-26 Thread Christian Borntraeger
The load PSW handler does not have to inject pending machine checks. This can wait until the CPU runs the generic interrupt injection code. Signed-off-by: Christian Borntraeger Reviewed-by: Cornelia Huck --- arch/s390/kvm/interrupt.c | 56 --- arch

[GIT PULL 03/15] KVM: clarify the idea of kvm_dirty_regs

2014-08-26 Thread Christian Borntraeger
From: David Hildenbrand This patch clarifies that kvm_dirty_regs are just a hint to the kernel and that the kernel might just ignore some flags and sync the values (like done for acrs and gprs now). Signed-off-by: David Hildenbrand Reviewed-by: Cornelia Huck Signed-off-by: Christian

[GIT PULL 07/15] KVM: s390: implement KVM_REQ_TLB_FLUSH and make use of it

2014-08-26 Thread Christian Borntraeger
Reviewed-by: Cornelia Huck Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 10 -- arch/s390/kvm/kvm-s390.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index

[GIT PULL 08/15] KVM: s390: return -EFAULT if lowcore is not mapped during irq delivery

2014-08-26 Thread Christian Borntraeger
eturn code of guest memory access routines used in interrupt delivery all the way back to the KVM_RUN ioctl. Signed-off-by: Jens Freimann Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c

[GIT PULL 14/15] KVM: s390/mm: support gmap page tables with less than 5 levels

2014-08-26 Thread Christian Borntraeger
From: Martin Schwidefsky Add an addressing limit to the gmap address spaces and only allocate the page table levels that are needed for the given limit. The limit is fixed and can not be changed after a gmap has been created. Signed-off-by: Martin Schwidefsky Signed-off-by: Christian

[GIT PULL 01/15] KVM: s390: add defines for pfault init delivery code

2014-08-26 Thread Christian Borntraeger
From: Jens Freimann Get rid of open coded values for pfault init. Signed-off-by: Jens Freimann Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/s390/kvm/interrupt.c b

[GIT PULL 12/15] KVM: s390/mm: cleanup gmap function arguments, variable names

2014-08-26 Thread Christian Borntraeger
. Signed-off-by: Martin Schwidefsky Reviewed-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/include/asm/pgtable.h | 14 ++--- arch/s390/kvm/diag.c| 8 +-- arch/s390/kvm/interrupt.c | 2 +- arch/s390/kvm/kvm-s390.c| 4 +- arch/s390/kvm/priv.c

[GIT PULL 11/15] KVM: s390/mm: readd address parameter to gmap_do_ipte_notify

2014-08-26 Thread Christian Borntraeger
From: Martin Schwidefsky Revert git commit c3a23b9874c1 ("remove unnecessary parameter from gmap_do_ipte_notify"). Signed-off-by: Martin Schwidefsky Signed-off-by: Christian Borntraeger --- arch/s390/include/asm/pgtable.h | 4 ++-- arch/s390/mm/pgtable.c | 3 ++- 2 files

Re: [GIT PULL 00/15] KVM: s390: Features and fixes for next (3.18)

2014-08-26 Thread Christian Borntraeger
On 26/08/14 13:40, Paolo Bonzini wrote: > Il 26/08/2014 10:28, Christian Borntraeger ha scritto: >> 2. We use KVM_REQ_TLB_FLUSH instead of open coding tlb flushes > > Why is this needed? It seems slower than what you are replacing. > > Supporting KVM_REQ_TLB_FLUSH is usef

Re: [GIT PULL 2/2] KVM: s390/mm: try a cow on read only pages for key ops

2014-08-27 Thread Christian Borntraeger
On 27/08/14 05:06, Ben Hutchings wrote: > On Mon, 2014-08-25 at 15:10 +0200, Christian Borntraeger wrote: >> The PFMF instruction handler blindly wrote the storage key even if >> the page was mapped R/O in the host. Lets try a COW before continuing >> and bail out in case of

[PATCH] KVM: s390/mm: fix up indentation of set_guest_storage_key

2014-08-27 Thread Christian Borntraeger
commit ab3f285f227f ("KVM: s390/mm: try a cow on read only pages for key ops")' misaligned a code block. Let's fixup the indentation. Reported-by: Ben Hutchings Signed-off-by: Christian Borntraeger --- arch/s390/mm/pgtable.c | 12 ++-- 1 file changed, 6 insert

Re: [PATCH] KVM: forward declare structs in kvm_types.h

2014-08-29 Thread Christian Borntraeger
On 29/08/14 14:01, Paolo Bonzini wrote: > Opaque KVM structs are useful for prototypes in asm/kvm_host.h, to avoid > "'struct foo' declared inside parameter list" warnings (and consequent > breakage due to conflicting types). > > Move them from individual files to a generic place in linux/kvm_type

Re: [Qemu-devel] [question] virtio-blk performance degradationhappened with virito-serial

2014-09-01 Thread Christian Borntraeger
On 01/09/14 14:52, Zhang Haoyu wrote: Hi, all I start a VM with virtio-serial (default ports number: 31), and found that virtio-blk performance degradation happened, about 25%, this problem can be reproduced 100%. without virtio-serial: 4k-read-random 1186 IOPS

Re: [Qemu-devel] [question] virtio-blk performance degradationhappened with virito-serial

2014-09-01 Thread Christian Borntraeger
On 01/09/14 15:12, Paolo Bonzini wrote: > Il 01/09/2014 15:09, Christian Borntraeger ha scritto: >> This is just wild guessing: >> If virtio-blk and virtio-serial share an IRQ, the guest operating system has >> to check each virtqueue for activity. Maybe there is some ineffi

Re: [Qemu-devel] [question] virtio-blk performance degradationhappened with virito-serial

2014-09-01 Thread Christian Borntraeger
On 01/09/14 15:29, Paolo Bonzini wrote: > Il 01/09/2014 15:22, Christian Borntraeger ha scritto: >>>> If virtio-blk and virtio-serial share an IRQ, the guest operating system >>>> has to check each virtqueue for activity. Maybe there is some inefficiency >>>&g

Re: [Qemu-devel] [question] virtio-blk performance degradationhappened with virito-serial

2014-09-01 Thread Christian Borntraeger
On 01/09/14 16:03, Christian Borntraeger wrote: > On 01/09/14 15:29, Paolo Bonzini wrote: >> Il 01/09/2014 15:22, Christian Borntraeger ha scritto: >>>>> If virtio-blk and virtio-serial share an IRQ, the guest operating system >>>>> has to check each virt

Re: [PATCH v3 0/5] KVM: optimize userspace exits with a new ioctl

2015-09-02 Thread Christian Borntraeger
Am 14.08.2015 um 12:08 schrieb Radim Krčmář: > v3: > * acked by Christian [1/5] > * use ioctl argument directly (unsigned long as flags) [4/5] > * precisely #ifdef arch-specific ioctls [5/5] > v2: > * move request_exits debug counter patch right after introduction of >KVM_REQ_EXIT [3/5] >

Re: KVM memory slots limit on powerpc

2015-09-04 Thread Christian Borntraeger
Am 04.09.2015 um 11:35 schrieb Thomas Huth: > > Hi all, > > now that we get memory hotplugging for the spapr machine on qemu-ppc, > too, it seems like we easily can hit the amount of KVM-internal memory > slots now ("#define KVM_USER_MEM_SLOTS 32" in > arch/powerpc/include/asm/kvm_host.h). For e

Re: [Qemu-ppc] KVM memory slots limit on powerpc

2015-09-04 Thread Christian Borntraeger
Am 04.09.2015 um 12:04 schrieb Alexander Graf: > > > On 04.09.15 11:59, Christian Borntraeger wrote: >> Am 04.09.2015 um 11:35 schrieb Thomas Huth: >>> >>> Hi all, >>> >>> now that we get memory hotplugging for the spapr machine on qemu-ppc,

Re: [Qemu-ppc] KVM memory slots limit on powerpc

2015-09-08 Thread Christian Borntraeger
Am 08.09.2015 um 08:05 schrieb Thomas Huth: > On 07/09/15 16:31, Igor Mammedov wrote: >> On Fri, 4 Sep 2015 12:04:41 +0200 >> Alexander Graf wrote: >> >>> >>> >>> On 04.09.15 11:59, Christian Borntraeger wrote: >>>> Am 04.09.2015 um 11:

Re: [PATCH v7 0/3] KVM: Dynamic Halt-Polling

2015-09-09 Thread Christian Borntraeger
Am 03.09.2015 um 16:07 schrieb Wanpeng Li: > v6 -> v7: > * explicit signal (set a bool) > * fix the tracepoint > > v5 -> v6: > * fix wait_ns and poll_ns > > v4 -> v5: > * set base case 10us and max poll time 500us > * handle short/long halt, idea from David, many thanks David > > v3 -> v

Re: [PATCH v7 0/3] KVM: Dynamic Halt-Polling

2015-09-10 Thread Christian Borntraeger
Am 10.09.2015 um 03:55 schrieb Wanpeng Li: > On 9/9/15 9:39 PM, Christian Borntraeger wrote: >> Am 03.09.2015 um 16:07 schrieb Wanpeng Li: >>> v6 -> v7: >>> * explicit signal (set a bool) >>> * fix the tracepoint >>> >>> v5 -> v6: &

Re: linux-next: Tree for Sep 10

2015-09-10 Thread Christian Borntraeger
Am 10.09.2015 um 06:02 schrieb Stephen Rothwell: > Hi all, > > Please do not add material for v4.4 until after v4.3-rc1 is out. > [...] > The kvm tree still had its build failure for which I reverted a commit. [..] > Merging kvm/linux-next (2cbd78244fb2 KVM: trace kvm_halt_poll_ns grow/shrink) >

Re: [PATCH] KVM: fix polling for guest halt continued even if disable it

2015-09-15 Thread Christian Borntraeger
This patch fix it by reset vcpu->halt_poll_ns in order to stop polling > when polling is disabled. > > Reported-by: Christian Borntraeger > Signed-off-by: Wanpeng Li > --- > virt/kvm/kvm_main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a

[4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-15 Thread Christian Borntraeger
Tejun, commit d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes some noticably hickups when starting several kvm guests (which libvirt will move into cgroups - each vcpu thread and each i/o thread) When you now start lo

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-15 Thread Christian Borntraeger
Am 15.09.2015 um 15:05 schrieb Peter Zijlstra: > On Tue, Sep 15, 2015 at 02:05:14PM +0200, Christian Borntraeger wrote: >> Tejun, >> >> >> commit d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14 (sched, cgroup: replace >> signal_struct->group_rwsem with a global

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-15 Thread Christian Borntraeger
Am 15.09.2015 um 18:42 schrieb Paolo Bonzini: > > > On 15/09/2015 15:36, Christian Borntraeger wrote: >> I am wondering why the old code behaved in such fatal ways. Is there >> some interaction between waiting for a reschedule in the >> synchronize_sched writer

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-16 Thread Christian Borntraeger
Am 16.09.2015 um 03:24 schrieb Tejun Heo: > Hello, Paul. > > On Tue, Sep 15, 2015 at 04:38:18PM -0700, Paul E. McKenney wrote: >> Well, the decision as to what is too big for -stable is owned by the >> -stable maintainers, not by me. > > Is it tho? Usually the subsystem maintainer knows the best

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-16 Thread Christian Borntraeger
Am 16.09.2015 um 10:32 schrieb Paolo Bonzini: > > > On 15/09/2015 19:38, Paul E. McKenney wrote: >> Excellent points! >> >> Other options in such situations include the following: >> >> oRework so that the code uses call_rcu*() instead of *_expedited(). >> >> oMaintain a per-task or per-C

Re: [PATCH] KVM: add halt_attempted_poll to VCPU stats

2015-09-16 Thread Christian Borntraeger
empted polling compared to the successful polls. > > Cc: Christian Borntraeger Cc: David Matlack > Signed-off-by: Paolo Bonzini Acked-by: Christian Borntraeger yes, this will help to detect some bad cases, but not all. PS: upstream maintenance keeps me really busy at the moment

Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem) causes regression for libvirt/kvm

2015-09-16 Thread Christian Borntraeger
Am 16.09.2015 um 09:44 schrieb Christian Borntraeger: > Am 16.09.2015 um 03:24 schrieb Tejun Heo: >> Hello, Paul. >> >> On Tue, Sep 15, 2015 at 04:38:18PM -0700, Paul E. McKenney wrote: >>> Well, the decision as to what is too big for -stable is owned by the >

<    1   2   3   4   5   6   7   8   9   10   >