* [PATCH] kvm-s390: Bugfix for handling of iscs.
@ 2013-02-07 12:20 Cornelia Huck
2013-02-07 12:20 ` [PATCH] KVM: s390: Fix " Cornelia Huck
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Cornelia Huck @ 2013-02-07 12:20 UTC (permalink / raw)
To: Marcelo Tosatti, Gleb Natapov
Cc: Christian Borntraeger, Carsten Otte, Alexander Graf,
Heiko Carstens, Martin Schwidefsky, KVM, linux-s390
Hi,
here's another kvm-s390 bugfix for kvm-next, this time fixing a
thinko in the I/O interrupt injection.
Please apply.
Cornelia Huck (1):
KVM: s390: Fix handling of iscs.
arch/s390/kvm/interrupt.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
--
1.7.12.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] KVM: s390: Fix handling of iscs.
2013-02-07 12:20 [PATCH] kvm-s390: Bugfix for handling of iscs Cornelia Huck
@ 2013-02-07 12:20 ` Cornelia Huck
2013-02-08 14:20 ` [PATCH] kvm-s390: Bugfix for " Christian Borntraeger
2013-02-11 8:50 ` Gleb Natapov
2 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2013-02-07 12:20 UTC (permalink / raw)
To: Marcelo Tosatti, Gleb Natapov
Cc: Christian Borntraeger, Carsten Otte, Alexander Graf,
Heiko Carstens, Martin Schwidefsky, KVM, linux-s390
There are two ways to express an interruption subclass:
- As a bitmask, as used in cr6.
- As a number, as used in the I/O interruption word.
Unfortunately, we have treated the I/O interruption word as if it
contained the bitmask as well, which went unnoticed so far as
- (not-yet-released) qemu made the same mistake, and
- Linux guest kernels don't check the isc value in the I/O interruption
word for subchannel interrupts.
Make sure that we treat the I/O interruption word correctly.
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
arch/s390/kvm/interrupt.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 9a12835..2f6ccb0 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -55,6 +55,13 @@ static int psw_interrupts_disabled(struct kvm_vcpu *vcpu)
return 1;
}
+static u64 int_word_to_isc_bits(u32 int_word)
+{
+ u8 isc = (int_word & 0x38000000) >> 27;
+
+ return (0x80 >> isc) << 24;
+}
+
static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
struct kvm_s390_interrupt_info *inti)
{
@@ -96,7 +103,8 @@ static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
if (psw_ioint_disabled(vcpu))
return 0;
- if (vcpu->arch.sie_block->gcr[6] & inti->io.io_int_word)
+ if (vcpu->arch.sie_block->gcr[6] &
+ int_word_to_isc_bits(inti->io.io_int_word))
return 1;
return 0;
default:
@@ -724,7 +732,8 @@ struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm,
list_for_each_entry(iter, &fi->list, list) {
if (!is_ioint(iter->type))
continue;
- if (cr6 && ((cr6 & iter->io.io_int_word) == 0))
+ if (cr6 &&
+ ((cr6 & int_word_to_isc_bits(iter->io.io_int_word)) == 0))
continue;
if (schid) {
if (((schid & 0x00000000ffff0000) >> 16) !=
@@ -811,11 +820,14 @@ int kvm_s390_inject_vm(struct kvm *kvm,
if (!is_ioint(inti->type))
list_add_tail(&inti->list, &fi->list);
else {
+ u64 isc_bits = int_word_to_isc_bits(inti->io.io_int_word);
+
/* Keep I/O interrupts sorted in isc order. */
list_for_each_entry(iter, &fi->list, list) {
if (!is_ioint(iter->type))
continue;
- if (iter->io.io_int_word <= inti->io.io_int_word)
+ if (int_word_to_isc_bits(iter->io.io_int_word)
+ <= isc_bits)
continue;
break;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm-s390: Bugfix for handling of iscs.
2013-02-07 12:20 [PATCH] kvm-s390: Bugfix for handling of iscs Cornelia Huck
2013-02-07 12:20 ` [PATCH] KVM: s390: Fix " Cornelia Huck
@ 2013-02-08 14:20 ` Christian Borntraeger
2013-02-11 8:50 ` Gleb Natapov
2 siblings, 0 replies; 4+ messages in thread
From: Christian Borntraeger @ 2013-02-08 14:20 UTC (permalink / raw)
To: Cornelia Huck
Cc: Marcelo Tosatti, Gleb Natapov, Carsten Otte, Alexander Graf,
Heiko Carstens, Martin Schwidefsky, KVM, linux-s390
On 07/02/13 13:20, Cornelia Huck wrote:
> Hi,
>
> here's another kvm-s390 bugfix for kvm-next, this time fixing a
> thinko in the I/O interrupt injection.
>
> Please apply.
>
> Cornelia Huck (1):
> KVM: s390: Fix handling of iscs.
>
> arch/s390/kvm/interrupt.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
Would be good if this could be queued for 3.9 together with the
other virtio-ccw patches to ensure that the first version of
virtio-ccw in Linus tree works as expected.
Thanks
Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm-s390: Bugfix for handling of iscs.
2013-02-07 12:20 [PATCH] kvm-s390: Bugfix for handling of iscs Cornelia Huck
2013-02-07 12:20 ` [PATCH] KVM: s390: Fix " Cornelia Huck
2013-02-08 14:20 ` [PATCH] kvm-s390: Bugfix for " Christian Borntraeger
@ 2013-02-11 8:50 ` Gleb Natapov
2 siblings, 0 replies; 4+ messages in thread
From: Gleb Natapov @ 2013-02-11 8:50 UTC (permalink / raw)
To: Cornelia Huck
Cc: Marcelo Tosatti, Christian Borntraeger, Carsten Otte,
Alexander Graf, Heiko Carstens, Martin Schwidefsky, KVM,
linux-s390
On Thu, Feb 07, 2013 at 01:20:51PM +0100, Cornelia Huck wrote:
> Hi,
>
> here's another kvm-s390 bugfix for kvm-next, this time fixing a
> thinko in the I/O interrupt injection.
>
> Please apply.
>
Thanks, applied.
> Cornelia Huck (1):
> KVM: s390: Fix handling of iscs.
>
> arch/s390/kvm/interrupt.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> --
> 1.7.12.4
--
Gleb.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-11 8:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-07 12:20 [PATCH] kvm-s390: Bugfix for handling of iscs Cornelia Huck
2013-02-07 12:20 ` [PATCH] KVM: s390: Fix " Cornelia Huck
2013-02-08 14:20 ` [PATCH] kvm-s390: Bugfix for " Christian Borntraeger
2013-02-11 8:50 ` Gleb Natapov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox