s390/vtime: fix inline assembly clobber list
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 2 Feb 2021 15:45:37 +0000 (16:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 09:26:50 +0000 (10:26 +0100)
commit b29c5093820d333eef22f58cd04ec0d089059c39 upstream.

The stck/stckf instruction used within the inline assembly within
do_account_vtime() changes the condition code. This is not reflected
with the clobber list, and therefore might result in incorrect code
generation.

It seems unlikely that the compiler could generate incorrect code
considering the surrounding C code, but it must still be fixed.

Cc: <stable@vger.kernel.org>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/vtime.c

index c475ca49cfc6b43c02ab924e218e541a92b677b8..3e72f955bff7fd942835dc718b608cc61efd2123 100644 (file)
@@ -136,7 +136,8 @@ static int do_account_vtime(struct task_struct *tsk)
                "       stck    %1"     /* Store current tod clock value */
 #endif
                : "=Q" (S390_lowcore.last_update_timer),
-                 "=Q" (S390_lowcore.last_update_clock));
+                 "=Q" (S390_lowcore.last_update_clock)
+               : : "cc");
        clock = S390_lowcore.last_update_clock - clock;
        timer -= S390_lowcore.last_update_timer;