From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH 1/2] KVM: s390: sthyi: fix sthyi inline assembly Date: Mon, 21 Aug 2017 15:07:59 +0200 Message-ID: <20170821150759.6e243678.cohuck@redhat.com> References: <1503318465-19013-1-git-send-email-borntraeger@de.ibm.com> <1503318465-19013-2-git-send-email-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1503318465-19013-2-git-send-email-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Christian Borntraeger Cc: KVM , Cornelia Huck , linux-s390 , Heiko Carstens List-ID: On Mon, 21 Aug 2017 14:27:44 +0200 Christian Borntraeger wrote: > From: Heiko Carstens > > 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: # 4.8+ > Reviewed-by: Janosch Frank > Signed-off-by: Heiko Carstens > Signed-off-by: Christian Borntraeger > --- > 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; > } > Reviewed-by: Cornelia Huck