mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
s390x/ioinst: Rework memory access in MSCH instruction
Change the handler for MSCH to use the new logical memory access functions. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
parent
bffd09cd76
commit
14b4e13d4c
1 changed files with 7 additions and 13 deletions
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* I/O instructions for S/390
|
* I/O instructions for S/390
|
||||||
*
|
*
|
||||||
* Copyright 2012 IBM Corp.
|
* Copyright 2012, 2015 IBM Corp.
|
||||||
* Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
|
* Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
|
||||||
*
|
*
|
||||||
* This work is licensed under the terms of the GNU GPL, version 2 or (at
|
* This work is licensed under the terms of the GNU GPL, version 2 or (at
|
||||||
|
@ -144,11 +144,10 @@ void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
|
||||||
{
|
{
|
||||||
int cssid, ssid, schid, m;
|
int cssid, ssid, schid, m;
|
||||||
SubchDev *sch;
|
SubchDev *sch;
|
||||||
SCHIB *schib;
|
SCHIB schib;
|
||||||
uint64_t addr;
|
uint64_t addr;
|
||||||
int ret = -ENODEV;
|
int ret = -ENODEV;
|
||||||
int cc;
|
int cc;
|
||||||
hwaddr len = sizeof(*schib);
|
|
||||||
CPUS390XState *env = &cpu->env;
|
CPUS390XState *env = &cpu->env;
|
||||||
|
|
||||||
addr = decode_basedisp_s(env, ipb);
|
addr = decode_basedisp_s(env, ipb);
|
||||||
|
@ -156,20 +155,18 @@ void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
|
||||||
program_interrupt(env, PGM_SPECIFICATION, 2);
|
program_interrupt(env, PGM_SPECIFICATION, 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
schib = s390_cpu_physical_memory_map(env, addr, &len, 0);
|
if (s390_cpu_virt_mem_read(cpu, addr, &schib, sizeof(schib))) {
|
||||||
if (!schib || len != sizeof(*schib)) {
|
return;
|
||||||
program_interrupt(env, PGM_ADDRESSING, 2);
|
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid) ||
|
if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid) ||
|
||||||
!ioinst_schib_valid(schib)) {
|
!ioinst_schib_valid(&schib)) {
|
||||||
program_interrupt(env, PGM_OPERAND, 2);
|
program_interrupt(env, PGM_OPERAND, 2);
|
||||||
goto out;
|
return;
|
||||||
}
|
}
|
||||||
trace_ioinst_sch_id("msch", cssid, ssid, schid);
|
trace_ioinst_sch_id("msch", cssid, ssid, schid);
|
||||||
sch = css_find_subch(m, cssid, ssid, schid);
|
sch = css_find_subch(m, cssid, ssid, schid);
|
||||||
if (sch && css_subch_visible(sch)) {
|
if (sch && css_subch_visible(sch)) {
|
||||||
ret = css_do_msch(sch, schib);
|
ret = css_do_msch(sch, &schib);
|
||||||
}
|
}
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case -ENODEV:
|
case -ENODEV:
|
||||||
|
@ -186,9 +183,6 @@ void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setcc(cpu, cc);
|
setcc(cpu, cc);
|
||||||
|
|
||||||
out:
|
|
||||||
s390_cpu_physical_memory_unmap(env, schib, len, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copy_orb_from_guest(ORB *dest, const ORB *src)
|
static void copy_orb_from_guest(ORB *dest, const ORB *src)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue