From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: peter.maydell@linaro.org
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com,
qemu-devel@nongnu.org, agraf@suse.de
Subject: [Qemu-devel] [PULL for-2.4 03/11] s390-ccw.img: Consume service interrupts
Date: Thu, 2 Jul 2015 09:42:17 +0200 [thread overview]
Message-ID: <1435822945-30232-4-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1435822945-30232-1-git-send-email-cornelia.huck@de.ibm.com>
From: Christian Borntraeger <borntraeger@de.ibm.com>
We have to consume the outstanding service interrupt after each
service call, otherwise a correct implementation will return
CC=2 on subsequent service calls.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
pc-bios/s390-ccw/s390-ccw.h | 1 +
pc-bios/s390-ccw/sclp-ascii.c | 1 +
pc-bios/s390-ccw/start.S | 32 ++++++++++++++++++++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index 9b3868b..5484c2a 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -47,6 +47,7 @@ typedef unsigned long long __u64;
/* start.s */
void disabled_wait(void);
+void consume_sclp_int(void);
/* main.c */
void virtio_panic(const char *string);
diff --git a/pc-bios/s390-ccw/sclp-ascii.c b/pc-bios/s390-ccw/sclp-ascii.c
index 761fb44..dc1c3e4 100644
--- a/pc-bios/s390-ccw/sclp-ascii.c
+++ b/pc-bios/s390-ccw/sclp-ascii.c
@@ -24,6 +24,7 @@ static int sclp_service_call(unsigned int command, void *sccb)
" srl %0,28"
: "=&d" (cc) : "d" (command), "a" (__pa(sccb))
: "cc", "memory");
+ consume_sclp_int();
if (cc == 3)
return -EIO;
if (cc == 2)
diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S
index 5d5df0d..b6dd8c2 100644
--- a/pc-bios/s390-ccw/start.S
+++ b/pc-bios/s390-ccw/start.S
@@ -28,6 +28,38 @@ disabled_wait:
larl %r1,disabled_wait_psw
lpswe 0(%r1)
+
+/*
+ * void consume_sclp_int(void)
+ *
+ * eats one sclp interrupt
+ */
+ .globl consume_sclp_int
+consume_sclp_int:
+ /* enable service interrupts in cr0 */
+ stctg 0,0,0(15)
+ oi 6(15), 0x2
+ lctlg 0,0,0(15)
+ /* prepare external call handler */
+ larl %r1, external_new_code
+ stg %r1, 0x1b8
+ larl %r1, external_new_mask
+ mvc 0x1b0(8),0(%r1)
+ /* load enabled wait PSW */
+ larl %r1, enabled_wait_psw
+ lpswe 0(%r1)
+
+external_new_code:
+ /* disable service interrupts in cr0 */
+ stctg 0,0,0(15)
+ ni 6(15), 0xfd
+ lctlg 0,0,0(15)
+ br 14
+
.align 8
disabled_wait_psw:
.quad 0x0002000180000000,0x0000000000000000
+enabled_wait_psw:
+ .quad 0x0302000180000000,0x0000000000000000
+external_new_mask:
+ .quad 0x0000000180000000
--
2.4.5
next prev parent reply other threads:[~2015-07-02 7:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-02 7:42 [Qemu-devel] [PULL for-2.4 00/11] s390x patches for 2.4 Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 01/11] virtio-ccw: complete handling of guest-initiated resets Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 02/11] css: mss/mcss-e vs. migration Cornelia Huck
2015-07-02 7:42 ` Cornelia Huck [this message]
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 04/11] s390-ccw.img: update Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 05/11] s390x/css: Add a callback for when subchannel gets disabled Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 06/11] s390x/virtio-ccw: add virtio set-revision call Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 07/11] s390x/virtio-ccw: support virtio-1 set_vq format Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 08/11] virtio-ccw: migrate ->revision Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 09/11] s390x/ipl: Fix boot if no bootindex was specified Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 10/11] s390x/gdb: synchronize cpu state after modifying acrs Cornelia Huck
2015-07-02 7:42 ` [Qemu-devel] [PULL for-2.4 11/11] s390x/migration: Introduce 2.4 machine Cornelia Huck
2015-07-02 9:44 ` [Qemu-devel] [PULL for-2.4 00/11] s390x patches for 2.4 Peter Maydell
2015-07-02 9:52 ` Cornelia Huck
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=1435822945-30232-4-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).