From: Christian Borntraeger <borntraeger@de.ibm.com>
To: aliguori@us.ibm.com
Cc: Thomas Huth <thuth@linux.vnet.ibm.com>,
qemu-devel Developers <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
cornelia.huck@de.ibm.com
Subject: [Qemu-devel] [PATCH 6/8] s390x/kvm: Reworked/fixed handling of cc3 in kvm_handle_css_inst()
Date: Tue, 30 Jul 2013 16:23:13 +0200 [thread overview]
Message-ID: <1375194195-64390-7-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1375194195-64390-1-git-send-email-borntraeger@de.ibm.com>
From: Thomas Huth <thuth@linux.vnet.ibm.com>
Consolidated the setting of the condition code in kvm_handle_css_inst().
For the (unhandled) instructions EQBS and SQBS, we have to return
an operation exception instead of cc3. Also removed the is_ioinst()
function to avoid decoding the opcode twice.
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/kvm.c | 59 ++++++++++--------------------------------------------
1 file changed, 11 insertions(+), 48 deletions(-)
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index ab0e2b5..eff8d28 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -528,50 +528,19 @@ static int kvm_handle_css_inst(S390CPU *cpu, struct kvm_run *run,
no_cc = 1;
r = ioinst_handle_sal(env, env->regs[1]);
break;
- default:
- r = -1;
+ case PRIV_SIGA:
+ /* Not provided, set CC = 3 for subchannel not operational */
+ r = 3;
break;
+ default:
+ return -1;
}
- if (r >= 0) {
- if (!no_cc) {
- setcc(cpu, r);
- }
- r = 0;
- } else if (r < -1) {
- r = 0;
- }
- return r;
-}
-
-static int is_ioinst(uint8_t ipa0, uint8_t ipa1, uint8_t ipb)
-{
- int ret = 0;
- uint16_t ipa = (ipa0 << 8) | ipa1;
-
- switch (ipa) {
- case IPA0_B2 | PRIV_CSCH:
- case IPA0_B2 | PRIV_HSCH:
- case IPA0_B2 | PRIV_MSCH:
- case IPA0_B2 | PRIV_SSCH:
- case IPA0_B2 | PRIV_STSCH:
- case IPA0_B2 | PRIV_TPI:
- case IPA0_B2 | PRIV_SAL:
- case IPA0_B2 | PRIV_RSCH:
- case IPA0_B2 | PRIV_STCRW:
- case IPA0_B2 | PRIV_STCPS:
- case IPA0_B2 | PRIV_RCHP:
- case IPA0_B2 | PRIV_SCHM:
- case IPA0_B2 | PRIV_CHSC:
- case IPA0_B2 | PRIV_SIGA:
- case IPA0_B2 | PRIV_XSCH:
- case IPA0_B9 | PRIV_EQBS:
- case IPA0_EB | PRIV_SQBS:
- ret = 1;
- break;
+ if (r >= 0 && !no_cc) {
+ setcc(cpu, r);
}
- return ret;
+ return 0;
}
static int handle_priv(S390CPU *cpu, struct kvm_run *run,
@@ -587,15 +556,9 @@ static int handle_priv(S390CPU *cpu, struct kvm_run *run,
r = kvm_sclp_service_call(cpu, run, ipbh0);
break;
default:
- if (is_ioinst(ipa0, ipa1, ipb)) {
- r = kvm_handle_css_inst(cpu, run, ipa0, ipa1, ipb);
- if (r == -1) {
- setcc(cpu, 3);
- r = 0;
- }
- } else {
- DPRINTF("KVM: unknown PRIV: 0x%x\n", ipa1);
- r = -1;
+ r = kvm_handle_css_inst(cpu, run, ipa0, ipa1, ipb);
+ if (r == -1) {
+ DPRINTF("KVM: unhandled PRIV: 0x%x\n", ipa1);
}
break;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-07-30 14:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-30 14:23 [Qemu-devel] [PULLv2 0/8] s390 patch queue Christian Borntraeger
2013-07-30 14:23 ` [Qemu-devel] [PATCH 1/8] s390/sclpconsole: handle char layer busy conditions Christian Borntraeger
2013-07-30 14:23 ` [Qemu-devel] [PATCH 2/8] s390x/ioinst: Add missing alignment checks for IO instructions Christian Borntraeger
2013-07-30 14:23 ` [Qemu-devel] [PATCH 3/8] s390x/ioinst: Throw addressing exception when memory_map failed Christian Borntraeger
2013-07-30 14:23 ` [Qemu-devel] [PATCH 4/8] s390x/ioinst: Fixed alignment check in SCHM instruction Christian Borntraeger
2013-07-30 14:23 ` [Qemu-devel] [PATCH 5/8] s390x/ioinst: Fixed priority of operand exceptions Christian Borntraeger
2013-07-30 14:23 ` Christian Borntraeger [this message]
2013-07-30 14:23 ` [Qemu-devel] [PATCH 7/8] s390x/kvm: Remove redundant return code Christian Borntraeger
2013-07-30 14:23 ` [Qemu-devel] [PATCH 8/8] s390: Implement dump-guest-memory support for target s390x Christian Borntraeger
-- strict thread matches above, loose matches on Subject: below --
2013-07-29 10:05 [Qemu-devel] [PULL 0/3] s390 patch queue 2013-07-29 Alexander Graf
2013-07-29 14:00 ` [Qemu-devel] [PULL 0/8] s390 patch queue part 2 Christian Borntraeger
2013-07-29 14:00 ` [Qemu-devel] [PATCH 6/8] s390x/kvm: Reworked/fixed handling of cc3 in kvm_handle_css_inst() Christian Borntraeger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375194195-64390-7-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).