All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/6] s390: cleanups and fixes
@ 2013-09-03  7:58 Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 1/6] s390/kvm: Add check for priviledged SCLP handler Christian Borntraeger
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03  7:58 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Cornelia Huck, Christian Borntraeger, Jens Freimann,
	Andreas Färber, qemu-devel

Alex,

the next bunch of patches for s390. If there are no complaints, I will
send out a pull request soon.

---snip---

The following changes since commit 4ff78e0dbcd5c795962567fdc1b31e9e03c55b07:

  Merge remote-tracking branch 'luiz/queue/qmp' into staging (2013-08-30 12:26:04 -0500)

are available in the git repository at:


  git://github.com/borntraeger/qemu.git tags/s390-20130902

for you to fetch changes up to d66b1005d2ade6ce7854581aac6f3222f6dd7ea4:

  s390/ioinst: Moved the CC setting to the IO instruction handlers (2013-09-02 16:55:14 +0200)

----------------------------------------------------------------
This is a bunch of cleanups and fixes for the s390 architecture.

----------------------------------------------------------------
Christian Borntraeger (2):
      s390/dump: zero out padding bytes in notes sections
      s390/ipl: Update the s390-ccw.img rom

Cornelia Huck (1):
      s390/ipl: Fix waiting for virtio processing

Thomas Huth (3):
      s390/kvm: Add check for priviledged SCLP handler
      s390/cpu: Make setcc() function available to other files
      s390/ioinst: Moved the CC setting to the IO instruction handlers

 pc-bios/s390-ccw.img      | Bin 9432 -> 9336 bytes
 pc-bios/s390-ccw/virtio.c |   7 +--
 pc-bios/s390-ccw/virtio.h |   1 +
 target-s390x/arch_dump.c  |   1 +
 target-s390x/cpu.h        |  11 ++++-
 target-s390x/ioinst.c     | 110 +++++++++++++++++++++-------------------------
 target-s390x/ioinst.h     |  26 +++++------
 target-s390x/kvm.c        |  54 ++++++++---------------
 8 files changed, 96 insertions(+), 114 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 1/6] s390/kvm: Add check for priviledged SCLP handler
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
@ 2013-09-03  7:58 ` Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 2/6] s390/dump: zero out padding bytes in notes sections Christian Borntraeger
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03  7:58 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Thomas Huth, qemu-devel, Christian Borntraeger, Jens Freimann,
	Cornelia Huck, Andreas Färber

From: Thomas Huth <thuth@linux.vnet.ibm.com>

The SCLP instruction is priviledged, so we should make sure that
we generate an exception when it is called from the problem state.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target-s390x/kvm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 185c8f5..dc1ed56 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -448,6 +448,10 @@ static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
     int r = 0;
 
     cpu_synchronize_state(CPU(cpu));
+    if (env->psw.mask & PSW_MASK_PSTATE) {
+        enter_pgmcheck(cpu, PGM_PRIVILEGED);
+        return 0;
+    }
     sccb = env->regs[ipbh0 & 0xf];
     code = env->regs[(ipbh0 & 0xf0) >> 4];
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 2/6] s390/dump: zero out padding bytes in notes sections
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 1/6] s390/kvm: Add check for priviledged SCLP handler Christian Borntraeger
@ 2013-09-03  7:58 ` Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 3/6] s390/ipl: Fix waiting for virtio processing Christian Borntraeger
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03  7:58 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Cornelia Huck, Christian Borntraeger, Jens Freimann,
	Andreas Färber, qemu-devel

The prstatus of an s390x dump contains several padding areas. Zero out
these bytes to make reading the notes section easier with a hexdump.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target-s390x/arch_dump.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target-s390x/arch_dump.c b/target-s390x/arch_dump.c
index 9d36116..5cbb53c 100644
--- a/target-s390x/arch_dump.c
+++ b/target-s390x/arch_dump.c
@@ -151,6 +151,7 @@ static int s390x_write_all_elf64_notes(const char *note_name,
     int ret = -1;
 
     for (nf = note_func; nf->note_contents_func; nf++) {
+        memset(&note, 0, sizeof(note));
         note.hdr.n_namesz = cpu_to_be32(sizeof(note.name));
         note.hdr.n_descsz = cpu_to_be32(nf->contents_size);
         strncpy(note.name, note_name, sizeof(note.name));
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 3/6] s390/ipl: Fix waiting for virtio processing
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 1/6] s390/kvm: Add check for priviledged SCLP handler Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 2/6] s390/dump: zero out padding bytes in notes sections Christian Borntraeger
@ 2013-09-03  7:58 ` Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 4/6] s390/ipl: Update the s390-ccw.img rom Christian Borntraeger
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03  7:58 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Cornelia Huck, Christian Borntraeger, Jens Freimann,
	Andreas Färber, qemu-devel

From: Cornelia Huck <cornelia.huck@de.ibm.com>

The guest side must not manipulate the index for the used buffers. Instead,
remember the state of the used buffer locally and wait until it has moved.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 pc-bios/s390-ccw/virtio.c | 7 ++++---
 pc-bios/s390-ccw/virtio.h | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 49f2d29..4d6e48f 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -123,6 +123,7 @@ static void vring_init(struct vring *vr, unsigned int num, void *p,
     /* We're running with interrupts off anyways, so don't bother */
     vr->used->flags = VRING_USED_F_NO_NOTIFY;
     vr->used->idx = 0;
+    vr->used_idx = 0;
 
     debug_print_addr("init vr", vr);
 }
@@ -150,8 +151,6 @@ static void vring_send_buf(struct vring *vr, void *p, int len, int flags)
     if (!(flags & VRING_DESC_F_NEXT)) {
         vr->avail->idx++;
     }
-
-    vr->used->idx = vr->next_idx;
 }
 
 static u64 get_clock(void)
@@ -180,7 +179,8 @@ static int vring_wait_reply(struct vring *vr, int timeout)
     struct subchannel_id schid = vr->schid;
     int r = 0;
 
-    while (vr->used->idx == vr->next_idx) {
+    /* Wait until the used index has moved. */
+    while (vr->used->idx == vr->used_idx) {
         vring_notify(schid);
         if (timeout && (get_second() >= target_second)) {
             r = 1;
@@ -189,6 +189,7 @@ static int vring_wait_reply(struct vring *vr, int timeout)
         yield();
     }
 
+    vr->used_idx = vr->used->idx;
     vr->next_idx = 0;
     vr->desc[0].len = 0;
     vr->desc[0].flags = 0;
diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h
index 86fdd57..772a63f 100644
--- a/pc-bios/s390-ccw/virtio.h
+++ b/pc-bios/s390-ccw/virtio.h
@@ -115,6 +115,7 @@ struct vring_used {
 struct vring {
     unsigned int num;
     int next_idx;
+    int used_idx;
     struct vring_desc *desc;
     struct vring_avail *avail;
     struct vring_used *used;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 4/6] s390/ipl: Update the s390-ccw.img rom
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
                   ` (2 preceding siblings ...)
  2013-09-03  7:58 ` [Qemu-devel] [PULL 3/6] s390/ipl: Fix waiting for virtio processing Christian Borntraeger
@ 2013-09-03  7:58 ` Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 5/6] s390/cpu: Make setcc() function available to other files Christian Borntraeger
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03  7:58 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Cornelia Huck, Christian Borntraeger, Jens Freimann,
	Andreas Färber, qemu-devel

Rebuild of the virtio-ccw rom containing these patches:
1. s390/ipl: Fix waiting for virtio processing

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 pc-bios/s390-ccw.img | Bin 9432 -> 9336 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
index 05fc7c2fae97caf222d9ccce88631d8a20ccd565..6727f0ca39d6bf6d114974d1535cb7ad9e56355f 100644
GIT binary patch
literal 9336
zcmeHNe{dA_6@R;TxjXK{v4jW*q_V;21c7)2s{HD>A$SH$af?BNb%tDW7jk3Bnad@O
zPJhsv*3e=bsVMfxc%z969j!Mhb)fC&j<t?L_|Z}Z+p#0<!qm>$x<J%OG274gySMqF
zGo5zEe>!vDncesOzVCbQ``+ih?{_zs{rW8%BcdqKcoS(h`kdiC>#xl76`L+x$*Dps
z$wLZFBOk_0w#c5BIPspfM-C+lp0qg*<#J5VWAkNByrw;Js6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TgtPC4(oRh&VU+h<&XTkm{66Sq4T
zZ3^#6=VA_Ze^=u2UB6<^e+T0>Rnc4qoZp$?Yk$VEKyRCJm6{p2_<mN3U)baKG)}zp
z94hrsv7U&RvsZl6-u~SQUIDF+-2)DF$>jBK{SWqMY{fc<dRDuJ4t4S3Q+%#2#UFO$
z4ypgOGr)JBDVMunoNmSK&cAMd$+2=?i6tMdKBxSi^m-}jU{L>=GmB5=V(i+}zX7q>
BZma+R

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 5/6] s390/cpu: Make setcc() function available to other files
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
                   ` (3 preceding siblings ...)
  2013-09-03  7:58 ` [Qemu-devel] [PULL 4/6] s390/ipl: Update the s390-ccw.img rom Christian Borntraeger
@ 2013-09-03  7:58 ` Christian Borntraeger
  2013-09-03  7:58 ` [Qemu-devel] [PULL 6/6] s390/ioinst: Moved the CC setting to the IO instruction handlers Christian Borntraeger
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03  7:58 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Thomas Huth, qemu-devel, Christian Borntraeger, Jens Freimann,
	Cornelia Huck, Andreas Färber

From: Thomas Huth <thuth@linux.vnet.ibm.com>

Moved the setcc() function to cpu.h so that it can be used by other
files, too. It now also does not modify the kvm state anymore since
this gets updated during kvm_arch_put_registers() anyway.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target-s390x/cpu.h | 11 +++++++++--
 target-s390x/kvm.c | 12 ------------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 8be5648..a2c077b 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -148,6 +148,7 @@ typedef struct CPUS390XState {
 } CPUS390XState;
 
 #include "cpu-qom.h"
+#include <sysemu/kvm.h>
 
 /* distinguish between 24 bit and 31 bit addressing */
 #define HIGH_ORDER_BIT 0x80000000
@@ -692,6 +693,14 @@ static inline const char *cc_name(int cc_op)
     return cc_names[cc_op];
 }
 
+static inline void setcc(S390CPU *cpu, uint64_t cc)
+{
+    CPUS390XState *env = &cpu->env;
+
+    env->psw.mask &= ~(3ull << 44);
+    env->psw.mask |= (cc & 3) << 44;
+}
+
 typedef struct LowCore
 {
     /* prefix area: defined by architecture */
@@ -1058,8 +1067,6 @@ void program_interrupt(CPUS390XState *env, uint32_t code, int ilen);
 void QEMU_NORETURN runtime_exception(CPUS390XState *env, int excp,
                                      uintptr_t retaddr);
 
-#include <sysemu/kvm.h>
-
 #ifdef CONFIG_KVM
 void kvm_s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id,
                            uint16_t subchannel_nr, uint32_t io_int_parm,
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index dc1ed56..3dff6be 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -427,18 +427,6 @@ static void enter_pgmcheck(S390CPU *cpu, uint16_t code)
     kvm_s390_interrupt(cpu, KVM_S390_PROGRAM_INT, code);
 }
 
-static inline void setcc(S390CPU *cpu, uint64_t cc)
-{
-    CPUS390XState *env = &cpu->env;
-    CPUState *cs = CPU(cpu);
-
-    cs->kvm_run->psw_mask &= ~(3ull << 44);
-    cs->kvm_run->psw_mask |= (cc & 3) << 44;
-
-    env->psw.mask &= ~(3ul << 44);
-    env->psw.mask |= (cc & 3) << 44;
-}
-
 static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
                                  uint16_t ipbh0)
 {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL 6/6] s390/ioinst: Moved the CC setting to the IO instruction handlers
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
                   ` (4 preceding siblings ...)
  2013-09-03  7:58 ` [Qemu-devel] [PULL 5/6] s390/cpu: Make setcc() function available to other files Christian Borntraeger
@ 2013-09-03  7:58 ` Christian Borntraeger
  2013-09-03 15:23 ` [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Alexander Graf
  2013-09-03 19:08 ` [Qemu-devel] [PULL] " Christian Borntraeger
  7 siblings, 0 replies; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03  7:58 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Thomas Huth, qemu-devel, Christian Borntraeger, Jens Freimann,
	Cornelia Huck, Andreas Färber

From: Thomas Huth <thuth@linux.vnet.ibm.com>

The IO instruction handlers now take care of setting the CC value on
their own, so that the confusing return code magic in kvm_handle_css_inst()
is not needed anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target-s390x/ioinst.c | 110 +++++++++++++++++++++++---------------------------
 target-s390x/ioinst.h |  26 ++++++------
 target-s390x/kvm.c    |  38 +++++++----------
 3 files changed, 77 insertions(+), 97 deletions(-)

diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index 85fd285..8d6363d 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -36,7 +36,7 @@ int ioinst_disassemble_sch_ident(uint32_t value, int *m, int *cssid, int *ssid,
     return 0;
 }
 
-int ioinst_handle_xsch(CPUS390XState *env, uint64_t reg1)
+void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
@@ -44,8 +44,8 @@ int ioinst_handle_xsch(CPUS390XState *env, uint64_t reg1)
     int cc;
 
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
-        program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        program_interrupt(&cpu->env, PGM_OPERAND, 2);
+        return;
     }
     trace_ioinst_sch_id("xsch", cssid, ssid, schid);
     sch = css_find_subch(m, cssid, ssid, schid);
@@ -66,11 +66,10 @@ int ioinst_handle_xsch(CPUS390XState *env, uint64_t reg1)
         cc = 1;
         break;
     }
-
-    return cc;
+    setcc(cpu, cc);
 }
 
-int ioinst_handle_csch(CPUS390XState *env, uint64_t reg1)
+void ioinst_handle_csch(S390CPU *cpu, uint64_t reg1)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
@@ -78,8 +77,8 @@ int ioinst_handle_csch(CPUS390XState *env, uint64_t reg1)
     int cc;
 
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
-        program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        program_interrupt(&cpu->env, PGM_OPERAND, 2);
+        return;
     }
     trace_ioinst_sch_id("csch", cssid, ssid, schid);
     sch = css_find_subch(m, cssid, ssid, schid);
@@ -91,10 +90,10 @@ int ioinst_handle_csch(CPUS390XState *env, uint64_t reg1)
     } else {
         cc = 0;
     }
-    return cc;
+    setcc(cpu, cc);
 }
 
-int ioinst_handle_hsch(CPUS390XState *env, uint64_t reg1)
+void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
@@ -102,8 +101,8 @@ int ioinst_handle_hsch(CPUS390XState *env, uint64_t reg1)
     int cc;
 
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
-        program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        program_interrupt(&cpu->env, PGM_OPERAND, 2);
+        return;
     }
     trace_ioinst_sch_id("hsch", cssid, ssid, schid);
     sch = css_find_subch(m, cssid, ssid, schid);
@@ -124,8 +123,7 @@ int ioinst_handle_hsch(CPUS390XState *env, uint64_t reg1)
         cc = 1;
         break;
     }
-
-    return cc;
+    setcc(cpu, cc);
 }
 
 static int ioinst_schib_valid(SCHIB *schib)
@@ -141,7 +139,7 @@ static int ioinst_schib_valid(SCHIB *schib)
     return 1;
 }
 
-int ioinst_handle_msch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
+void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
@@ -150,22 +148,21 @@ int ioinst_handle_msch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
     int ret = -ENODEV;
     int cc;
     hwaddr len = sizeof(*schib);
+    CPUS390XState *env = &cpu->env;
 
     addr = decode_basedisp_s(env, ipb);
     if (addr & 3) {
         program_interrupt(env, PGM_SPECIFICATION, 2);
-        return -EIO;
+        return;
     }
     schib = s390_cpu_physical_memory_map(env, addr, &len, 0);
     if (!schib || len != sizeof(*schib)) {
         program_interrupt(env, PGM_ADDRESSING, 2);
-        cc = -EIO;
         goto out;
     }
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid) ||
         !ioinst_schib_valid(schib)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        cc = -EIO;
         goto out;
     }
     trace_ioinst_sch_id("msch", cssid, ssid, schid);
@@ -187,9 +184,10 @@ int ioinst_handle_msch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
         cc = 1;
         break;
     }
+    setcc(cpu, cc);
+
 out:
     s390_cpu_physical_memory_unmap(env, schib, len, 0);
-    return cc;
 }
 
 static void copy_orb_from_guest(ORB *dest, const ORB *src)
@@ -213,7 +211,7 @@ static int ioinst_orb_valid(ORB *orb)
     return 1;
 }
 
-int ioinst_handle_ssch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
+void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
@@ -222,23 +220,22 @@ int ioinst_handle_ssch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
     int ret = -ENODEV;
     int cc;
     hwaddr len = sizeof(*orig_orb);
+    CPUS390XState *env = &cpu->env;
 
     addr = decode_basedisp_s(env, ipb);
     if (addr & 3) {
         program_interrupt(env, PGM_SPECIFICATION, 2);
-        return -EIO;
+        return;
     }
     orig_orb = s390_cpu_physical_memory_map(env, addr, &len, 0);
     if (!orig_orb || len != sizeof(*orig_orb)) {
         program_interrupt(env, PGM_ADDRESSING, 2);
-        cc = -EIO;
         goto out;
     }
     copy_orb_from_guest(&orb, orig_orb);
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid) ||
         !ioinst_orb_valid(&orb)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        cc = -EIO;
         goto out;
     }
     trace_ioinst_sch_id("ssch", cssid, ssid, schid);
@@ -260,38 +257,39 @@ int ioinst_handle_ssch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
         cc = 1;
         break;
     }
+    setcc(cpu, cc);
 
 out:
     s390_cpu_physical_memory_unmap(env, orig_orb, len, 0);
-    return cc;
 }
 
-int ioinst_handle_stcrw(CPUS390XState *env, uint32_t ipb)
+void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb)
 {
     CRW *crw;
     uint64_t addr;
     int cc;
     hwaddr len = sizeof(*crw);
+    CPUS390XState *env = &cpu->env;
 
     addr = decode_basedisp_s(env, ipb);
     if (addr & 3) {
         program_interrupt(env, PGM_SPECIFICATION, 2);
-        return -EIO;
+        return;
     }
     crw = s390_cpu_physical_memory_map(env, addr, &len, 1);
     if (!crw || len != sizeof(*crw)) {
         program_interrupt(env, PGM_ADDRESSING, 2);
-        cc = -EIO;
         goto out;
     }
     cc = css_do_stcrw(crw);
     /* 0 - crw stored, 1 - zeroes stored */
+    setcc(cpu, cc);
+
 out:
     s390_cpu_physical_memory_unmap(env, crw, len, 1);
-    return cc;
 }
 
-int ioinst_handle_stsch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
+void ioinst_handle_stsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
@@ -299,22 +297,21 @@ int ioinst_handle_stsch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
     int cc;
     SCHIB *schib;
     hwaddr len = sizeof(*schib);
+    CPUS390XState *env = &cpu->env;
 
     addr = decode_basedisp_s(env, ipb);
     if (addr & 3) {
         program_interrupt(env, PGM_SPECIFICATION, 2);
-        return -EIO;
+        return;
     }
     schib = s390_cpu_physical_memory_map(env, addr, &len, 1);
     if (!schib || len != sizeof(*schib)) {
         program_interrupt(env, PGM_ADDRESSING, 2);
-        cc = -EIO;
         goto out;
     }
 
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        cc = -EIO;
         goto out;
     }
     trace_ioinst_sch_id("stsch", cssid, ssid, schid);
@@ -336,9 +333,10 @@ int ioinst_handle_stsch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
             cc = 0;
         }
     }
+    setcc(cpu, cc);
+
 out:
     s390_cpu_physical_memory_unmap(env, schib, len, 1);
-    return cc;
 }
 
 int ioinst_handle_tsch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
@@ -575,7 +573,7 @@ static void ioinst_handle_chsc_unimplemented(ChscResp *res)
     res->param = 0;
 }
 
-int ioinst_handle_chsc(CPUS390XState *env, uint32_t ipb)
+void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb)
 {
     ChscReq *req;
     ChscResp *res;
@@ -584,7 +582,7 @@ int ioinst_handle_chsc(CPUS390XState *env, uint32_t ipb)
     uint16_t len;
     uint16_t command;
     hwaddr map_size = TARGET_PAGE_SIZE;
-    int ret = 0;
+    CPUS390XState *env = &cpu->env;
 
     trace_ioinst("chsc");
     reg = (ipb >> 20) & 0x00f;
@@ -592,19 +590,17 @@ int ioinst_handle_chsc(CPUS390XState *env, uint32_t ipb)
     /* Page boundary? */
     if (addr & 0xfff) {
         program_interrupt(env, PGM_SPECIFICATION, 2);
-        return -EIO;
+        return;
     }
     req = s390_cpu_physical_memory_map(env, addr, &map_size, 1);
     if (!req || map_size != TARGET_PAGE_SIZE) {
         program_interrupt(env, PGM_ADDRESSING, 2);
-        ret = -EIO;
         goto out;
     }
     len = be16_to_cpu(req->len);
     /* Length field valid? */
     if ((len < 16) || (len > 4088) || (len & 7)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        ret = -EIO;
         goto out;
     }
     memset((char *)req + len, 0, TARGET_PAGE_SIZE - len);
@@ -628,7 +624,6 @@ int ioinst_handle_chsc(CPUS390XState *env, uint32_t ipb)
 
 out:
     s390_cpu_physical_memory_unmap(env, req, map_size, 1);
-    return ret;
 }
 
 int ioinst_handle_tpi(CPUS390XState *env, uint32_t ipb)
@@ -666,18 +661,19 @@ out:
 #define SCHM_REG1_UPD(_reg) ((_reg & 0x0000000000000002) >> 1)
 #define SCHM_REG1_DCT(_reg) (_reg & 0x0000000000000001)
 
-int ioinst_handle_schm(CPUS390XState *env, uint64_t reg1, uint64_t reg2,
-                       uint32_t ipb)
+void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2,
+                        uint32_t ipb)
 {
     uint8_t mbk;
     int update;
     int dct;
+    CPUS390XState *env = &cpu->env;
 
     trace_ioinst("schm");
 
     if (SCHM_REG1_RES(reg1)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        return;
     }
 
     mbk = SCHM_REG1_MBK(reg1);
@@ -686,15 +682,13 @@ int ioinst_handle_schm(CPUS390XState *env, uint64_t reg1, uint64_t reg2,
 
     if (update && (reg2 & 0x000000000000001f)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        return;
     }
 
     css_do_schm(mbk, update, dct, update ? reg2 : 0);
-
-    return 0;
 }
 
-int ioinst_handle_rsch(CPUS390XState *env, uint64_t reg1)
+void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1)
 {
     int cssid, ssid, schid, m;
     SubchDev *sch;
@@ -702,8 +696,8 @@ int ioinst_handle_rsch(CPUS390XState *env, uint64_t reg1)
     int cc;
 
     if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
-        program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        program_interrupt(&cpu->env, PGM_OPERAND, 2);
+        return;
     }
     trace_ioinst_sch_id("rsch", cssid, ssid, schid);
     sch = css_find_subch(m, cssid, ssid, schid);
@@ -724,24 +718,23 @@ int ioinst_handle_rsch(CPUS390XState *env, uint64_t reg1)
         cc = 1;
         break;
     }
-
-    return cc;
-
+    setcc(cpu, cc);
 }
 
 #define RCHP_REG1_RES(_reg) (_reg & 0x00000000ff00ff00)
 #define RCHP_REG1_CSSID(_reg) ((_reg & 0x0000000000ff0000) >> 16)
 #define RCHP_REG1_CHPID(_reg) (_reg & 0x00000000000000ff)
-int ioinst_handle_rchp(CPUS390XState *env, uint64_t reg1)
+void ioinst_handle_rchp(S390CPU *cpu, uint64_t reg1)
 {
     int cc;
     uint8_t cssid;
     uint8_t chpid;
     int ret;
+    CPUS390XState *env = &cpu->env;
 
     if (RCHP_REG1_RES(reg1)) {
         program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        return;
     }
 
     cssid = RCHP_REG1_CSSID(reg1);
@@ -764,19 +757,16 @@ int ioinst_handle_rchp(CPUS390XState *env, uint64_t reg1)
     default:
         /* Invalid channel subsystem. */
         program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        return;
     }
-
-    return cc;
+    setcc(cpu, cc);
 }
 
 #define SAL_REG1_INVALID(_reg) (_reg & 0x0000000080000000)
-int ioinst_handle_sal(CPUS390XState *env, uint64_t reg1)
+void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1)
 {
     /* We do not provide address limit checking, so let's suppress it. */
     if (SAL_REG1_INVALID(reg1) || reg1 & 0x000000000000ffff) {
-        program_interrupt(env, PGM_OPERAND, 2);
-        return -EIO;
+        program_interrupt(&cpu->env, PGM_OPERAND, 2);
     }
-    return 0;
 }
diff --git a/target-s390x/ioinst.h b/target-s390x/ioinst.h
index 7bed291..613da49 100644
--- a/target-s390x/ioinst.h
+++ b/target-s390x/ioinst.h
@@ -214,20 +214,20 @@ typedef struct IOIntCode {
 
 int ioinst_disassemble_sch_ident(uint32_t value, int *m, int *cssid, int *ssid,
                                  int *schid);
-int ioinst_handle_xsch(CPUS390XState *env, uint64_t reg1);
-int ioinst_handle_csch(CPUS390XState *env, uint64_t reg1);
-int ioinst_handle_hsch(CPUS390XState *env, uint64_t reg1);
-int ioinst_handle_msch(CPUS390XState *env, uint64_t reg1, uint32_t ipb);
-int ioinst_handle_ssch(CPUS390XState *env, uint64_t reg1, uint32_t ipb);
-int ioinst_handle_stcrw(CPUS390XState *env, uint32_t ipb);
-int ioinst_handle_stsch(CPUS390XState *env, uint64_t reg1, uint32_t ipb);
+void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1);
+void ioinst_handle_csch(S390CPU *cpu, uint64_t reg1);
+void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1);
+void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
+void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
+void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb);
+void ioinst_handle_stsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
 int ioinst_handle_tsch(CPUS390XState *env, uint64_t reg1, uint32_t ipb);
-int ioinst_handle_chsc(CPUS390XState *env, uint32_t ipb);
+void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb);
 int ioinst_handle_tpi(CPUS390XState *env, uint32_t ipb);
-int ioinst_handle_schm(CPUS390XState *env, uint64_t reg1, uint64_t reg2,
-                       uint32_t ipb);
-int ioinst_handle_rsch(CPUS390XState *env, uint64_t reg1);
-int ioinst_handle_rchp(CPUS390XState *env, uint64_t reg1);
-int ioinst_handle_sal(CPUS390XState *env, uint64_t reg1);
+void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2,
+                        uint32_t ipb);
+void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1);
+void ioinst_handle_rchp(S390CPU *cpu, uint64_t reg1);
+void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1);
 
 #endif
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 3dff6be..f254b9b 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -455,8 +455,6 @@ static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
 static int kvm_handle_css_inst(S390CPU *cpu, struct kvm_run *run,
                                uint8_t ipa0, uint8_t ipa1, uint8_t ipb)
 {
-    int r = 0;
-    int no_cc = 0;
     CPUS390XState *env = &cpu->env;
     CPUState *cs = CPU(cpu);
 
@@ -470,69 +468,61 @@ static int kvm_handle_css_inst(S390CPU *cpu, struct kvm_run *run,
 
     switch (ipa1) {
     case PRIV_XSCH:
-        r = ioinst_handle_xsch(env, env->regs[1]);
+        ioinst_handle_xsch(cpu, env->regs[1]);
         break;
     case PRIV_CSCH:
-        r = ioinst_handle_csch(env, env->regs[1]);
+        ioinst_handle_csch(cpu, env->regs[1]);
         break;
     case PRIV_HSCH:
-        r = ioinst_handle_hsch(env, env->regs[1]);
+        ioinst_handle_hsch(cpu, env->regs[1]);
         break;
     case PRIV_MSCH:
-        r = ioinst_handle_msch(env, env->regs[1], run->s390_sieic.ipb);
+        ioinst_handle_msch(cpu, env->regs[1], run->s390_sieic.ipb);
         break;
     case PRIV_SSCH:
-        r = ioinst_handle_ssch(env, env->regs[1], run->s390_sieic.ipb);
+        ioinst_handle_ssch(cpu, env->regs[1], run->s390_sieic.ipb);
         break;
     case PRIV_STCRW:
-        r = ioinst_handle_stcrw(env, run->s390_sieic.ipb);
+        ioinst_handle_stcrw(cpu, run->s390_sieic.ipb);
         break;
     case PRIV_STSCH:
-        r = ioinst_handle_stsch(env, env->regs[1], run->s390_sieic.ipb);
+        ioinst_handle_stsch(cpu, env->regs[1], run->s390_sieic.ipb);
         break;
     case PRIV_TSCH:
         /* We should only get tsch via KVM_EXIT_S390_TSCH. */
         fprintf(stderr, "Spurious tsch intercept\n");
         break;
     case PRIV_CHSC:
-        r = ioinst_handle_chsc(env, run->s390_sieic.ipb);
+        ioinst_handle_chsc(cpu, run->s390_sieic.ipb);
         break;
     case PRIV_TPI:
         /* This should have been handled by kvm already. */
         fprintf(stderr, "Spurious tpi intercept\n");
         break;
     case PRIV_SCHM:
-        no_cc = 1;
-        r = ioinst_handle_schm(env, env->regs[1], env->regs[2],
-                               run->s390_sieic.ipb);
+        ioinst_handle_schm(cpu, env->regs[1], env->regs[2],
+                           run->s390_sieic.ipb);
         break;
     case PRIV_RSCH:
-        r = ioinst_handle_rsch(env, env->regs[1]);
+        ioinst_handle_rsch(cpu, env->regs[1]);
         break;
     case PRIV_RCHP:
-        r = ioinst_handle_rchp(env, env->regs[1]);
+        ioinst_handle_rchp(cpu, env->regs[1]);
         break;
     case PRIV_STCPS:
         /* We do not provide this instruction, it is suppressed. */
-        no_cc = 1;
-        r = 0;
         break;
     case PRIV_SAL:
-        no_cc = 1;
-        r = ioinst_handle_sal(env, env->regs[1]);
+        ioinst_handle_sal(cpu, env->regs[1]);
         break;
     case PRIV_SIGA:
         /* Not provided, set CC = 3 for subchannel not operational */
-        r = 3;
+        setcc(cpu, 3);
         break;
     default:
         return -1;
     }
 
-    if (r >= 0 && !no_cc) {
-        setcc(cpu, r);
-    }
-
     return 0;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL 0/6] s390: cleanups and fixes
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
                   ` (5 preceding siblings ...)
  2013-09-03  7:58 ` [Qemu-devel] [PULL 6/6] s390/ioinst: Moved the CC setting to the IO instruction handlers Christian Borntraeger
@ 2013-09-03 15:23 ` Alexander Graf
  2013-09-03 19:08 ` [Qemu-devel] [PULL] " Christian Borntraeger
  7 siblings, 0 replies; 11+ messages in thread
From: Alexander Graf @ 2013-09-03 15:23 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Cornelia Huck, Jens Freimann, Andreas Färber, qemu-devel

On 09/03/2013 09:58 AM, Christian Borntraeger wrote:
> Alex,
>
> the next bunch of patches for s390. If there are no complaints, I will
> send out a pull request soon.

Acked-by: Alexander Graf <agraf@suse.de>


Alex

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL] s390: cleanups and fixes
  2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
                   ` (6 preceding siblings ...)
  2013-09-03 15:23 ` [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Alexander Graf
@ 2013-09-03 19:08 ` Christian Borntraeger
  2013-09-12 15:21   ` Christian Borntraeger
  7 siblings, 1 reply; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-03 19:08 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: qemu-devel, Alexander Graf, Christian Borntraeger, Jens Freimann,
	Cornelia Huck, Andreas Färber

Anthony,


The following changes since commit 4ff78e0dbcd5c795962567fdc1b31e9e03c55b07:

  Merge remote-tracking branch 'luiz/queue/qmp' into staging (2013-08-30 12:26:04 -0500)

are available in the git repository at:


  git://github.com/borntraeger/qemu.git tags/s390-20130902

for you to fetch changes up to d66b1005d2ade6ce7854581aac6f3222f6dd7ea4:

  s390/ioinst: Moved the CC setting to the IO instruction handlers (2013-09-02 16:55:14 +0200)

----------------------------------------------------------------
This is a bunch of cleanups and fixes for the s390 architecture.
Series is
Acked-by: Alexander Graf <agraf@suse.de>

----------------------------------------------------------------
Christian Borntraeger (2):
      s390/dump: zero out padding bytes in notes sections
      s390/ipl: Update the s390-ccw.img rom

Cornelia Huck (1):
      s390/ipl: Fix waiting for virtio processing

Thomas Huth (3):
      s390/kvm: Add check for priviledged SCLP handler
      s390/cpu: Make setcc() function available to other files
      s390/ioinst: Moved the CC setting to the IO instruction handlers

 pc-bios/s390-ccw.img      | Bin 9432 -> 9336 bytes
 pc-bios/s390-ccw/virtio.c |   7 +--
 pc-bios/s390-ccw/virtio.h |   1 +
 target-s390x/arch_dump.c  |   1 +
 target-s390x/cpu.h        |  11 ++++-
 target-s390x/ioinst.c     | 110 +++++++++++++++++++++-------------------------
 target-s390x/ioinst.h     |  26 +++++------
 target-s390x/kvm.c        |  54 ++++++++---------------
 8 files changed, 96 insertions(+), 114 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL] s390: cleanups and fixes
  2013-09-03 19:08 ` [Qemu-devel] [PULL] " Christian Borntraeger
@ 2013-09-12 15:21   ` Christian Borntraeger
  2013-09-12 17:15     ` Anthony Liguori
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Borntraeger @ 2013-09-12 15:21 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: qemu-devel, Alexander Graf, Christian Borntraeger, Jens Freimann,
	Cornelia Huck, Andreas Färber

On 03/09/13 21:08, Christian Borntraeger wrote:
> Anthony,
> 
> 
> The following changes since commit 4ff78e0dbcd5c795962567fdc1b31e9e03c55b07:
> 
>   Merge remote-tracking branch 'luiz/queue/qmp' into staging (2013-08-30 12:26:04 -0500)
> 
> are available in the git repository at:
> 
> 
>   git://github.com/borntraeger/qemu.git tags/s390-20130902
> 
> for you to fetch changes up to d66b1005d2ade6ce7854581aac6f3222f6dd7ea4:
> 
>   s390/ioinst: Moved the CC setting to the IO instruction handlers (2013-09-02 16:55:14 +0200)
> 
> ----------------------------------------------------------------
> This is a bunch of cleanups and fixes for the s390 architecture.
> Series is
> Acked-by: Alexander Graf <agraf@suse.de>
> 


Ping?



> ----------------------------------------------------------------
> Christian Borntraeger (2):
>       s390/dump: zero out padding bytes in notes sections
>       s390/ipl: Update the s390-ccw.img rom
> 
> Cornelia Huck (1):
>       s390/ipl: Fix waiting for virtio processing
> 
> Thomas Huth (3):
>       s390/kvm: Add check for priviledged SCLP handler
>       s390/cpu: Make setcc() function available to other files
>       s390/ioinst: Moved the CC setting to the IO instruction handlers
> 
>  pc-bios/s390-ccw.img      | Bin 9432 -> 9336 bytes
>  pc-bios/s390-ccw/virtio.c |   7 +--
>  pc-bios/s390-ccw/virtio.h |   1 +
>  target-s390x/arch_dump.c  |   1 +
>  target-s390x/cpu.h        |  11 ++++-
>  target-s390x/ioinst.c     | 110 +++++++++++++++++++++-------------------------
>  target-s390x/ioinst.h     |  26 +++++------
>  target-s390x/kvm.c        |  54 ++++++++---------------
>  8 files changed, 96 insertions(+), 114 deletions(-)
> 
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL] s390: cleanups and fixes
  2013-09-12 15:21   ` Christian Borntraeger
@ 2013-09-12 17:15     ` Anthony Liguori
  0 siblings, 0 replies; 11+ messages in thread
From: Anthony Liguori @ 2013-09-12 17:15 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Cornelia Huck, Jens Freimann, qemu-devel, Andreas Färber,
	Alexander Graf

On Thu, Sep 12, 2013 at 10:21 AM, Christian Borntraeger
<borntraeger@de.ibm.com> wrote:
> On 03/09/13 21:08, Christian Borntraeger wrote:
>> Anthony,
>>
>>
>> The following changes since commit 4ff78e0dbcd5c795962567fdc1b31e9e03c55b07:
>>
>>   Merge remote-tracking branch 'luiz/queue/qmp' into staging (2013-08-30 12:26:04 -0500)
>>
>> are available in the git repository at:
>>
>>
>>   git://github.com/borntraeger/qemu.git tags/s390-20130902
>>
>> for you to fetch changes up to d66b1005d2ade6ce7854581aac6f3222f6dd7ea4:
>>
>>   s390/ioinst: Moved the CC setting to the IO instruction handlers (2013-09-02 16:55:14 +0200)
>>
>> ----------------------------------------------------------------
>> This is a bunch of cleanups and fixes for the s390 architecture.
>> Series is
>> Acked-by: Alexander Graf <agraf@suse.de>
>>
>
>
> Ping?

The fact that you replied to the cover letter with another PULL
request made my scripts throw their hands up.

Please send a v2 pull request without the cover letter reply and I'll
process it.

Regards,

Anthony Liguori

>
>
>
>> ----------------------------------------------------------------
>> Christian Borntraeger (2):
>>       s390/dump: zero out padding bytes in notes sections
>>       s390/ipl: Update the s390-ccw.img rom
>>
>> Cornelia Huck (1):
>>       s390/ipl: Fix waiting for virtio processing
>>
>> Thomas Huth (3):
>>       s390/kvm: Add check for priviledged SCLP handler
>>       s390/cpu: Make setcc() function available to other files
>>       s390/ioinst: Moved the CC setting to the IO instruction handlers
>>
>>  pc-bios/s390-ccw.img      | Bin 9432 -> 9336 bytes
>>  pc-bios/s390-ccw/virtio.c |   7 +--
>>  pc-bios/s390-ccw/virtio.h |   1 +
>>  target-s390x/arch_dump.c  |   1 +
>>  target-s390x/cpu.h        |  11 ++++-
>>  target-s390x/ioinst.c     | 110 +++++++++++++++++++++-------------------------
>>  target-s390x/ioinst.h     |  26 +++++------
>>  target-s390x/kvm.c        |  54 ++++++++---------------
>>  8 files changed, 96 insertions(+), 114 deletions(-)
>>
>>
>>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-09-12 17:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-03  7:58 [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Christian Borntraeger
2013-09-03  7:58 ` [Qemu-devel] [PULL 1/6] s390/kvm: Add check for priviledged SCLP handler Christian Borntraeger
2013-09-03  7:58 ` [Qemu-devel] [PULL 2/6] s390/dump: zero out padding bytes in notes sections Christian Borntraeger
2013-09-03  7:58 ` [Qemu-devel] [PULL 3/6] s390/ipl: Fix waiting for virtio processing Christian Borntraeger
2013-09-03  7:58 ` [Qemu-devel] [PULL 4/6] s390/ipl: Update the s390-ccw.img rom Christian Borntraeger
2013-09-03  7:58 ` [Qemu-devel] [PULL 5/6] s390/cpu: Make setcc() function available to other files Christian Borntraeger
2013-09-03  7:58 ` [Qemu-devel] [PULL 6/6] s390/ioinst: Moved the CC setting to the IO instruction handlers Christian Borntraeger
2013-09-03 15:23 ` [Qemu-devel] [PULL 0/6] s390: cleanups and fixes Alexander Graf
2013-09-03 19:08 ` [Qemu-devel] [PULL] " Christian Borntraeger
2013-09-12 15:21   ` Christian Borntraeger
2013-09-12 17:15     ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.