From: Christian Borntraeger <borntraeger@de.ibm.com>
To: KVM <kvm@vger.kernel.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
linux-s390 <linux-s390@vger.kernel.org>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: [PATCH 1/2] KVM: s390: sthyi: fix sthyi inline assembly
Date: Mon, 21 Aug 2017 14:27:44 +0200 [thread overview]
Message-ID: <1503318465-19013-2-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1503318465-19013-1-git-send-email-borntraeger@de.ibm.com>
From: Heiko Carstens <heiko.carstens@de.ibm.com>
The sthyi inline assembly misses register r3 within the clobber
list. The sthyi instruction will always write a return code to
register "R2+1", which in this case would be r3. Due to that we may
have register corruption and see host crashes or data corruption
depending on how gcc decided to allocate and use registers during
compile time.
Fixes: 95ca2cb57985 ("KVM: s390: Add sthyi emulation")
Cc: <stable@vger.kernel.org> # 4.8+
Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
arch/s390/kvm/sthyi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/kvm/sthyi.c b/arch/s390/kvm/sthyi.c
index 926b524..2773a2f 100644
--- a/arch/s390/kvm/sthyi.c
+++ b/arch/s390/kvm/sthyi.c
@@ -394,7 +394,7 @@ static int sthyi(u64 vaddr)
"srl %[cc],28\n"
: [cc] "=d" (cc)
: [code] "d" (code), [addr] "a" (addr)
- : "memory", "cc");
+ : "3", "memory", "cc");
return cc;
}
--
2.7.4
next prev parent reply other threads:[~2017-08-21 12:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-21 12:27 [PATCH 0/2] KVM: s390: two fixes for sthyi emulation (4.13) Christian Borntraeger
2017-08-21 12:27 ` Christian Borntraeger [this message]
2017-08-21 12:44 ` [PATCH 1/2] KVM: s390: sthyi: fix sthyi inline assembly David Hildenbrand
2017-08-21 13:07 ` Cornelia Huck
2017-08-21 12:27 ` [PATCH 2/2] KVM: s390: sthyi: fix specification exception detection Christian Borntraeger
2017-08-21 12:43 ` David Hildenbrand
2017-08-21 12:48 ` Christian Borntraeger
2017-08-21 13:09 ` 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=1503318465-19013-2-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.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