s390: cleanups and fixes
cover s390: cleanups and fixes
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
----------------------------------------------------------------
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(-)
PATCH 1/6 s390/kvm: Add check for priviledged SCLP handler
From: Thomas Huth <[email protected]>
The SCLP instruction is priviledged, so we should make sure that we generate an exception when it is called from the problem state.
--- target-s390x/kvm.c | 4 ++++ 1 file changed, 4 insertions(+)
target-s390x/kvm.c +4 -0
@@ -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 ];
Signature · 1 line
1.8.3.1
PATCH 2/6 s390/dump: zero out padding bytes in notes sections
In reply to Christian BorntraegerThe prstatus of an s390x dump contains several padding areas. Zero out these bytes to make reading the notes section easier with a hexdump.
--- target-s390x/arch_dump.c | 1 + 1 file changed, 1 insertion(+)
target-s390x/arch_dump.c +1 -0
@@ -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 (¬e,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));
Signature · 1 line
1.8.3.1
PATCH 3/6 s390/ipl: Fix waiting for virtio processing
In reply to Christian BorntraegerFrom: Cornelia Huck <[email protected]>
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.
--- pc-bios/s390-ccw/virtio.c | 7 ++++--- pc-bios/s390-ccw/virtio.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-)
pc-bios/s390-ccw/virtio.c +4 -3
@@ -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 ;
pc-bios/s390-ccw/virtio.h +1 -0
@@ -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;
Signature · 1 line
1.8.3.1
PATCH 4/6 s390/ipl: Update the s390-ccw.img rom
In reply to Christian BorntraegerRebuild of the virtio-ccw rom containing these patches:
1. s390/ipl: Fix waiting for virtio processing
--- pc-bios/s390-ccw.img | Bin 9432 -> 9336 bytes 1 file changed, 0 insertions(+), 0 deletions(-)
pc-bios/s390-ccw.img binary +0 -0
Signature · 1 line
1.8.3.1
PATCH 5/6 s390/cpu: Make setcc() function available to other files
In reply to Christian BorntraegerFrom: Thomas Huth <[email protected]>
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.
--- target-s390x/cpu.h | 11 +++++++++-- target-s390x/kvm.c | 12 ------------ 2 files changed, 9 insertions(+), 14 deletions(-)
target-s390x/cpu.h +9 -2
@@ -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,
target-s390x/kvm.c +0 -12
@@ -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) {
Signature · 1 line
1.8.3.1
PATCH 6/6 s390/ioinst: Moved the CC setting to the IO instruction handlers
In reply to Christian BorntraegerFrom: Thomas Huth <[email protected]>
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.
--- target-s390x/ioinst.c | 110 +++++++++++++++++++++++--------------------------- target-s390x/ioinst.h | 26 ++++++------ target-s390x/kvm.c | 38 +++++++---------- 3 files changed, 77 insertions(+), 97 deletions(-)
target-s390x/ioinst.c +50 -60
@@ -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 ; }
target-s390x/ioinst.h +13 -13
@@ -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
target-s390x/kvm.c +14 -24
@@ -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 ; }
Signature · 1 line
1.8.3.1