[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 23/29] s390x/ioinst: Set condition code in ioinst_han
From: |
Christian Borntraeger |
Subject: |
[Qemu-devel] [PULL 23/29] s390x/ioinst: Set condition code in ioinst_handle_tsch() handler |
Date: |
Wed, 18 Feb 2015 21:22:17 +0100 |
From: Thomas Huth <address@hidden>
Move the setting of the condition code from kvm.c into the handler
function in ioinst.c itself, just like it has been done with the other
handlers already (TSCH has just not been changed yet since it is called
from a different dispatcher in kvm.c).
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: Jens Freimann <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
---
target-s390x/ioinst.c | 8 ++++----
target-s390x/ioinst.h | 2 +-
target-s390x/kvm.c | 9 ++-------
3 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index 23c2faf..8052886 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -336,13 +336,13 @@ void ioinst_handle_stsch(S390CPU *cpu, uint64_t reg1,
uint32_t ipb)
setcc(cpu, cc);
}
-int ioinst_handle_tsch(CPUS390XState *env, uint64_t reg1, uint32_t ipb)
+int ioinst_handle_tsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
{
+ CPUS390XState *env = &cpu->env;
int cssid, ssid, schid, m;
SubchDev *sch;
IRB *irb;
uint64_t addr;
- int ret = -ENODEV;
int cc;
hwaddr len = sizeof(*irb);
@@ -364,12 +364,12 @@ int ioinst_handle_tsch(CPUS390XState *env, uint64_t reg1,
uint32_t ipb)
}
sch = css_find_subch(m, cssid, ssid, schid);
if (sch && css_subch_visible(sch)) {
- ret = css_do_tsch(sch, irb);
+ cc = css_do_tsch(sch, irb);
/* 0 - status pending, 1 - not status pending */
- cc = ret;
} else {
cc = 3;
}
+ setcc(cpu, cc);
out:
s390_cpu_physical_memory_unmap(env, irb, sizeof(*irb), 1);
return cc;
diff --git a/target-s390x/ioinst.h b/target-s390x/ioinst.h
index 1efe16c..6746160 100644
--- a/target-s390x/ioinst.h
+++ b/target-s390x/ioinst.h
@@ -234,7 +234,7 @@ 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_tsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb);
void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb);
int ioinst_handle_tpi(CPUS390XState *env, uint32_t ipb);
void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2,
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index f65a1d2..d7c57d9 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -1338,19 +1338,14 @@ static int handle_intercept(S390CPU *cpu)
static int handle_tsch(S390CPU *cpu)
{
- CPUS390XState *env = &cpu->env;
CPUState *cs = CPU(cpu);
struct kvm_run *run = cs->kvm_run;
int ret;
cpu_synchronize_state(cs);
- ret = ioinst_handle_tsch(env, env->regs[1], run->s390_tsch.ipb);
- if (ret >= 0) {
- /* Success; set condition code. */
- setcc(cpu, ret);
- ret = 0;
- } else if (ret < -1) {
+ ret = ioinst_handle_tsch(cpu, cpu->env.regs[1], run->s390_tsch.ipb);
+ if (ret < 0) {
/*
* Failure.
* If an I/O interrupt had been dequeued, we have to reinject it.
--
1.9.3
- [Qemu-devel] [PULL 14/29] s390x/mmu: Renaming related to the ASCE confusion, (continued)
- [Qemu-devel] [PULL 14/29] s390x/mmu: Renaming related to the ASCE confusion, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 04/29] s390x/ipl: make s390x ipl device aware of migration, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 25/29] s390x/ioinst: Rework memory access in STCRW instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 01/29] s390x/ipl: always load the bios for ccw machine, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 05/29] s390x/mmu: Move mmu_translate() and friends to separate file, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 03/29] s390x/ipl: drop reipl parameters on resets, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 28/29] s390x/pci: Rework memory access in zpci instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 11/29] s390x/mmu: Fix exception types when checking the ASCEs, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 24/29] s390x/ioinst: Rework memory access in TSCH instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 17/29] s390x/kvm: Add function for injecting pgm access exceptions, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 23/29] s390x/ioinst: Set condition code in ioinst_handle_tsch() handler,
Christian Borntraeger <=
- [Qemu-devel] [PULL 06/29] s390x/mmu: Fix the check for the real-space designation bit, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 22/29] s390x/ioinst: Rework memory access in STSCH instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 10/29] s390x/mmu: Fix translation exception code in lowcore, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 26/29] s390x/ioinst: Rework memory access in CHSC instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 07/29] s390x/mmu: Fix the handling of the table levels, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 15/29] s390x/mmu: Check bit 52 in page table entry, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 29/29] s390x/helper: Remove s390_cpu_physical_memory_map, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 20/29] s390x/ioinst: Rework memory access in MSCH instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 27/29] s390x/ioinst: Rework memory access in TPI instruction, Christian Borntraeger, 2015/02/18
- Re: [Qemu-devel] [PULL 00/29] s390x guest reipl and page table handling, Peter Maydell, 2015/02/26