Skip to contentSkip to conversation

s390: fix cpustate rework fallout

PATCH Applied Christian Borntraeger 2 participants 4 messages Jul 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390: fix cpustate rework fallout

commit f17ec444c3d39f76bcd8b71c2c05d5754bfe333e
exec: Change cpu_memory_rw_debug() argument to CPUState

broke s390:

CC s390x-softmmu/hw/block/dataplane/virtio-blk.o
/home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_insert_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:384:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:385:9: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_remove_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:398:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:402:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’

Lets fix it up.

---
 target-s390x/kvm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
target-s390x/kvm.c +4 -8
index 3dfd19c..960b3cf 100644
@@ -345,12 +345,10 @@ void *kvm_arch_ram_alloc(ram_addr_t size)
 
 int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
 {
-    S390CPU *cpu = S390_CPU(cs);
-    CPUS390XState *env = &cpu->env;
     static const uint8_t diag_501[] = {0x83, 0x24, 0x05, 0x01};
 
-    if (cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&bp->saved_insn, 4, 0) ||
-        cpu_memory_rw_debug(env, bp->pc, (uint8_t *)diag_501, 4, 1)) {
+    if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_insn, 4, 0) ||
+        cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)diag_501, 4, 1)) {
         return -EINVAL;
     }
     return 0;
@@ -358,16 +356,14 @@ int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
 
 int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
 {
-    S390CPU *cpu = S390_CPU(cs);
-    CPUS390XState *env = &cpu->env;
     uint8_t t[4];
     static const uint8_t diag_501[] = {0x83, 0x24, 0x05, 0x01};
 
-    if (cpu_memory_rw_debug(env, bp->pc, t, 4, 0)) {
+    if (cpu_memory_rw_debug(cs, bp->pc, t, 4, 0)) {
         return -EINVAL;
     } else if (memcmp(t, diag_501, 4)) {
         return -EINVAL;
-    } else if (cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&bp->saved_insn, 1, 1)) {
+    } else if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_insn, 1, 1)) {
         return -EINVAL;
     }
 
Signature · 1 line
1.8.3.1
#1 lore raw

Am 26.07.2013 17:48, schrieb Christian Borntraeger:

Quoted 47 lines

commit f17ec444c3d39f76bcd8b71c2c05d5754bfe333e
exec: Change cpu_memory_rw_debug() argument to CPUState

broke s390:

CC s390x-softmmu/hw/block/dataplane/virtio-blk.o
/home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_insert_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:384:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:385:9: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_remove_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:398:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:402:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’

Quoted 6 lines

Lets fix it up.

---
 target-s390x/kvm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Ouch. I'm fairly certain that I tested something on ppc and s390x before sending the pull, must be some workflow problem then...

Do we need the full error in the commit message? I intend to send a pull tonight, where I would include this fix.

Cheers,
Andreas

Quoted 40 lines
target-s390x/kvm.c +4 -8
index 3dfd19c..960b3cf 100644
@@ -345,12 +345,10 @@ void *kvm_arch_ram_alloc(ram_addr_t size)
 
 int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
 {
-    S390CPU *cpu = S390_CPU(cs);
-    CPUS390XState *env = &cpu->env;
     static const uint8_t diag_501[] = {0x83, 0x24, 0x05, 0x01};
 
-    if (cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&bp->saved_insn, 4, 0) ||
-        cpu_memory_rw_debug(env, bp->pc, (uint8_t *)diag_501, 4, 1)) {
+    if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_insn, 4, 0) ||
+        cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)diag_501, 4, 1)) {
         return -EINVAL;
     }
     return 0;
@@ -358,16 +356,14 @@ int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
 
 int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
 {
-    S390CPU *cpu = S390_CPU(cs);
-    CPUS390XState *env = &cpu->env;
     uint8_t t[4];
     static const uint8_t diag_501[] = {0x83, 0x24, 0x05, 0x01};
 
-    if (cpu_memory_rw_debug(env, bp->pc, t, 4, 0)) {
+    if (cpu_memory_rw_debug(cs, bp->pc, t, 4, 0)) {
         return -EINVAL;
     } else if (memcmp(t, diag_501, 4)) {
         return -EINVAL;
-    } else if (cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&bp->saved_insn, 1, 1)) {
+    } else if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_insn, 1, 1)) {
         return -EINVAL;
     }
 
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#2 lore raw
Quoted 55 lines · Andreas Färber

Am 26.07.2013 17:48, schrieb Christian Borntraeger:

Quoted 47 lines

commit f17ec444c3d39f76bcd8b71c2c05d5754bfe333e
exec: Change cpu_memory_rw_debug() argument to CPUState

broke s390:

CC s390x-softmmu/hw/block/dataplane/virtio-blk.o
/home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_insert_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:384:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:385:9: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_remove_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:398:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:402:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’

Quoted 6 lines

Lets fix it up.

---
 target-s390x/kvm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
Quoted 5 lines

Ouch. I'm fairly certain that I tested something on ppc and s390x before sending the pull, must be some workflow problem then...

Do we need the full error in the commit message? I intend to send a pull tonight, where I would include this fix.

I dont mind if you shorten it

#3 lore raw

Am 26.07.2013 17:56, schrieb Christian Borntraeger:

Quoted 56 lines · Andreas Färber
Quoted 55 lines

Am 26.07.2013 17:48, schrieb Christian Borntraeger:

Quoted 53 lines

commit f17ec444c3d39f76bcd8b71c2c05d5754bfe333e
exec: Change cpu_memory_rw_debug() argument to CPUState

broke s390:

CC s390x-softmmu/hw/block/dataplane/virtio-blk.o
/home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_insert_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:384:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:385:9: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c: In function ‘kvm_arch_remove_sw_breakpoint’:
/home/cborntra/REPOS/qemu/target-s390x/kvm.c:398:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’ /home/cborntra/REPOS/qemu/target-s390x/kvm.c:402:5: error: passing argument 1 of ‘cpu_memory_rw_debug’ from incompatible pointer type [-Werror]
In file included from /home/cborntra/REPOS/qemu/target-s390x/cpu.h:40:0,
from
/home/cborntra/REPOS/qemu/include/qemu-common.h:116,

                 from /home/cborntra/REPOS/qemu/target-s390x/kvm.c:31:

/home/cborntra/REPOS/qemu/include/exec/cpu-all.h:491:5: note: expected ‘struct CPUState *’ but argument is of type ‘struct CPUS390XState *’

Lets fix it up.

---
 target-s390x/kvm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
Quoted 7 lines
Quoted 5 lines

Ouch. I'm fairly certain that I tested something on ppc and s390x before sending the pull, must be some workflow problem then...

Do we need the full error in the commit message? I intend to send a pull tonight, where I would include this fix.

I dont mind if you shorten it

Thanks, applied to qom-cpu (with edit):
https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg