diff mbox series

[kvm-unit-tests,PULL,10/11] s390x/selftest: Fix constraint of inline assembly

Message ID 20200928174958.26690-11-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,PULL,01/11] runtime.bash: remove outdated comment | expand

Commit Message

Thomas Huth Sept. 28, 2020, 5:49 p.m. UTC
Clang on s390x compains:

/home/thuth/devel/kvm-unit-tests/s390x/selftest.c:39:15: error:
 %r0 used in an address
        asm volatile("  stg %0,0(%0)\n" : : "r"(-1L));
                     ^
<inline asm>:1:13: note: instantiated into assembly here
                stg %r0,0(%r0)
                          ^

Right it is. We should not use address register 0 for STG.
Thus let's use the "a" constraint to avoid register 0 here.

Message-Id: <20200924111746.131633-1-thuth@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 s390x/selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/s390x/selftest.c b/s390x/selftest.c
index 4c16646..eaf5b18 100644
--- a/s390x/selftest.c
+++ b/s390x/selftest.c
@@ -36,7 +36,7 @@  static void test_pgm_int(void)
 	check_pgm_int_code(PGM_INT_CODE_OPERATION);
 
 	expect_pgm_int();
-	asm volatile("	stg %0,0(%0)\n" : : "r"(-1L));
+	asm volatile("	stg %0,0(%0)\n" : : "a"(-1L));
 	check_pgm_int_code(PGM_INT_CODE_ADDRESSING);
 }