Skip to contentSkip to conversation

s390x bugfixes for 2.2

PATCH In review Cornelia Huck 2 participants 4 messages Nov 3, 2014

lore
Share & tools
lore
#0 lore raw

cover s390x bugfixes for 2.2

Two small bugfixes for s390x; nothing earthshattering.

Frank Blaschka (1):
s390x/kvm: Fix opcode decoding for eb instruction handler

Thomas Huth (1):
s390x/kvm: Fix warning from sparse

 target-s390x/kvm.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 s390x/kvm: Fix opcode decoding for eb instruction handler

From: Frank Blaschka <[email protected]>

The second byte of the opcode is encoded in the lowest byte of the ipb field, not the lowest byte of the ipa field.

---
 target-s390x/kvm.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
target-s390x/kvm.c +4 -4
index 5b10a25..690cb71 100644
@@ -827,18 +827,18 @@ static int handle_b9(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
     return r;
 }
 
-static int handle_eb(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
+static int handle_eb(S390CPU *cpu, struct kvm_run *run, uint8_t ipbl)
 {
     int r = 0;
 
-    switch (ipa1) {
+    switch (ipbl) {
     case PRIV_EB_SQBS:
         /* just inject exception */
         r = -1;
         break;
     default:
         r = -1;
-        DPRINTF("KVM: unhandled PRIV: 0xeb%x\n", ipa1);
+        DPRINTF("KVM: unhandled PRIV: 0xeb%x\n", ipbl);
         break;
     }
 
@@ -1039,7 +1039,7 @@ static int handle_instruction(S390CPU *cpu, struct kvm_run *run)
         r = handle_b9(cpu, run, ipa1);
         break;
     case IPA0_EB:
-        r = handle_eb(cpu, run, ipa1);
+        r = handle_eb(cpu, run, run->s390_sieic.ipb & 0xff);
         break;
     case IPA0_DIAG:
         r = handle_diag(cpu, run, run->s390_sieic.ipb);
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 2/2 s390x/kvm: Fix warning from sparse

In reply to Cornelia Huck

From: Thomas Huth <[email protected]>

When running "sparse" with the s390x kvm.c code, it complains that "constant 0x00400f1d40330000 is so big it is long" - let's fix this by appending a proper suffix.

---
 target-s390x/kvm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-s390x/kvm.c +1 -1
index 690cb71..d247471 100644
@@ -1272,7 +1272,7 @@ void kvm_s390_crw_mchk(void)
     struct kvm_s390_irq irq = {
         .type = KVM_S390_MCHK,
         .u.mchk.cr14 = 1 << 28,
-        .u.mchk.mcic = 0x00400f1d40330000,
+        .u.mchk.mcic = 0x00400f1d40330000ULL,
     };
     kvm_s390_floating_interrupt(&irq);
 }
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] s390x/kvm: Fix opcode decoding for eb instruction handler

In reply to Cornelia Huck
Quoted 38 lines · On Mon, 3 Nov 2014 15:30:33 +0100 Cornelia Huck <[email protected]>…

From: Frank Blaschka <[email protected]>

The second byte of the opcode is encoded in the lowest byte of the ipb field, not the lowest byte of the ipa field.

---
 target-s390x/kvm.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
target-s390x/kvm.c +3 -3
index 5b10a25..690cb71 100644
@@ -827,18 +827,18 @@ static int handle_b9(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
     return r;
 }
 
-static int handle_eb(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
+static int handle_eb(S390CPU *cpu, struct kvm_run *run, uint8_t ipbl)
 {
     int r = 0;
 
-    switch (ipa1) {
+    switch (ipbl) {
     case PRIV_EB_SQBS:
         /* just inject exception */
         r = -1;
         break;
     default:
         r = -1;
-        DPRINTF("KVM: unhandled PRIV: 0xeb%x\n", ipa1);
+        DPRINTF("KVM: unhandled PRIV: 0xeb%x\n", ipbl);
         break;
     }
 

target-s390x/kvm.c static int handle_instruction(S390CPU *cpu, struct kvm_run *run) · line 1045

Quoted 8 lines
target-s390x/kvm.c +1 -1
@@ -1039,7 +1039,7 @@ static int handle_instruction(S390CPU *cpu, struct kvm_run *run)
         r = handle_b9(cpu, run, ipa1);
         break;
     case IPA0_EB:
-        r = handle_eb(cpu, run, ipa1);
+        r = handle_eb(cpu, run, run->s390_sieic.ipb & 0xff);
         break;
     case IPA0_DIAG:
         r = handle_diag(cpu, run, run->s390_sieic.ipb);

Looks right!