Re: [kvm-unit-tests PATCH] s390x/selftest: Fix constraint of inline assembly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24.09.20 13:17, Thomas Huth wrote:
> 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.
> 
> Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
> ---
>  s390x/selftest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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);
>  }
>  
> 

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

-- 
Thanks,

David / dhildenb




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux