* [PULL 1/2] KVM: s390: Removing untriggerable BUG_ONs
2014-03-17 11:13 [PULL 0/2] KVM: s390: last patches for next Christian Borntraeger
@ 2014-03-17 11:13 ` Christian Borntraeger
2014-03-17 11:14 ` [PULL 2/2] KVM: s390: Optimize ucontrol path Christian Borntraeger
2014-03-17 11:22 ` [PULL 0/2] KVM: s390: last patches for next Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Christian Borntraeger @ 2014-03-17 11:13 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Gleb Natapov, KVM, linux-s390, Cornelia Huck, Martin Schwidefsky,
Heiko Carstens, Dominik Dingel, Christian Borntraeger
From: Dominik Dingel <dingel@linux.vnet.ibm.com>
The BUG_ON in kvm-s390.c is unreachable, as we get the vcpu per common code,
which itself does this from the private_data field of the file descriptor,
and there is no KVM_UNCREATE_VCPU.
The __{set,unset}_cpu_idle BUG_ONs are not triggerable because the vcpu
creation code already checks against KVM_MAX_VCPUS.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
arch/s390/kvm/interrupt.c | 2 --
arch/s390/kvm/kvm-s390.c | 2 --
2 files changed, 4 deletions(-)
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 1d0f9d5..79d2e4f 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -114,14 +114,12 @@ static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
static void __set_cpu_idle(struct kvm_vcpu *vcpu)
{
- BUG_ON(vcpu->vcpu_id > KVM_MAX_VCPUS - 1);
atomic_set_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags);
set_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask);
}
static void __unset_cpu_idle(struct kvm_vcpu *vcpu)
{
- BUG_ON(vcpu->vcpu_id > KVM_MAX_VCPUS - 1);
atomic_clear_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags);
clear_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask);
}
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 9136f8d..6268357 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -949,8 +949,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
- BUG_ON(kvm_get_vcpu(vcpu->kvm, vcpu->vcpu_id) == NULL);
-
switch (kvm_run->exit_reason) {
case KVM_EXIT_S390_SIEIC:
case KVM_EXIT_UNKNOWN:
--
1.8.4.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PULL 2/2] KVM: s390: Optimize ucontrol path
2014-03-17 11:13 [PULL 0/2] KVM: s390: last patches for next Christian Borntraeger
2014-03-17 11:13 ` [PULL 1/2] KVM: s390: Removing untriggerable BUG_ONs Christian Borntraeger
@ 2014-03-17 11:14 ` Christian Borntraeger
2014-03-17 11:22 ` [PULL 0/2] KVM: s390: last patches for next Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Christian Borntraeger @ 2014-03-17 11:14 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Gleb Natapov, KVM, linux-s390, Cornelia Huck, Martin Schwidefsky,
Heiko Carstens, Christian Borntraeger, stable
Since commit 7c470539c95630c1f2a10f109e96f249730b75eb
(s390/kvm: avoid automatic sie reentry) we will run through the C code
of KVM on host interrupts instead of just reentering the guest. This
will result in additional ucontrol exits (at least HZ per second). Let
handle a 0 intercept in the kernel and dont return to userspace,
even if in ucontrol mode.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
CC: stable@vger.kernel.org
---
arch/s390/kvm/kvm-s390.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 6268357..7337c57 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -896,7 +896,8 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
if (rc == 0) {
if (kvm_is_ucontrol(vcpu->kvm))
- rc = -EOPNOTSUPP;
+ /* Don't exit for host interrupts. */
+ rc = vcpu->arch.sie_block->icptcode ? -EOPNOTSUPP : 0;
else
rc = kvm_handle_sie_intercept(vcpu);
}
--
1.8.4.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PULL 0/2] KVM: s390: last patches for next
2014-03-17 11:13 [PULL 0/2] KVM: s390: last patches for next Christian Borntraeger
2014-03-17 11:13 ` [PULL 1/2] KVM: s390: Removing untriggerable BUG_ONs Christian Borntraeger
2014-03-17 11:14 ` [PULL 2/2] KVM: s390: Optimize ucontrol path Christian Borntraeger
@ 2014-03-17 11:22 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-03-17 11:22 UTC (permalink / raw)
To: Christian Borntraeger
Cc: Gleb Natapov, KVM, linux-s390, Cornelia Huck, Martin Schwidefsky,
Heiko Carstens
Il 17/03/2014 12:13, Christian Borntraeger ha scritto:
> Paolo,
>
> here are two patches that are targetted against kvm/next for 3.15.
> One is a bugfix for a performance regression of the ucontrol path,
> but we can handle that via stable. No need to force that into 3.14.0
> The other patch removes some BUG_ONs in inner loops that cant be
> triggered anyway. Patches are against kvm/next
>
> Christian
>
>
> The following changes since commit 8fbb1daf3e8254afc17fc4490b69db00920197ae:
>
> Merge branch 'kvm-ppc-fix' into HEAD (2014-03-14 16:06:30 +0100)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git tags/kvm-s390-20140317
>
> for you to fetch changes up to 2955c83f72801245afd0fe5c560cc75b82bea9aa:
>
> KVM: s390: Optimize ucontrol path (2014-03-17 11:06:51 +0100)
>
> ----------------------------------------------------------------
> Two patches:
> - one regression fix for reducing the amount of ucontrol userspace exits
> - get rid of BUG_ONs in hot inner loops
>
> ----------------------------------------------------------------
> Christian Borntraeger (1):
> KVM: s390: Optimize ucontrol path
>
> Dominik Dingel (1):
> KVM: s390: Removing untriggerable BUG_ONs
>
> arch/s390/kvm/interrupt.c | 2 --
> arch/s390/kvm/kvm-s390.c | 5 ++---
> 2 files changed, 2 insertions(+), 5 deletions(-)
>
Applied, thanks!
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread