Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356919
b: refs/heads/master
c: 79fd50c
h: refs/heads/master
i:
  356917: 62fe3b2
  356915: 013691f
  356911: 9f3b355
v: v3
  • Loading branch information
Cornelia Huck authored and Gleb Natapov committed Feb 11, 2013
1 parent b2987f3 commit 72b8582
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24db2734ad8123b6858ca98d690483ecdcceebb5
refs/heads/master: 79fd50c67f91136add9726fb7719b57a66c6f763
18 changes: 15 additions & 3 deletions trunk/arch/s390/kvm/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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) !=
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 72b8582

Please sign in to comment.