From: David Hildenbrand Subject: Re: [kvm-unit-tests PATCH v1 1/6] s390x: initial infrastructure Date: Tue, 16 May 2017 09:54:26 +0200 Message-ID: <42224dac-352b-a703-11ff-b3edfbcc581c@redhat.com> References: <20170512105830.10604-1-david@redhat.com> <20170512105830.10604-2-david@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Huth , Cornelia Huck To: Christian Borntraeger , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37190 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781AbdEPHyp (ORCPT ); Tue, 16 May 2017 03:54:45 -0400 In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 15.05.2017 11:19, Christian Borntraeger wrote: > Nice to see somebody doing this for s390x. > > > On 05/12/2017 12:58 PM, David Hildenbrand wrote: > [...] > >> diff --git a/s390x/Makefile b/s390x/Makefile >> new file mode 100644 >> index 0000000..f9468bb >> --- /dev/null >> +++ b/s390x/Makefile >> @@ -0,0 +1,32 @@ >> +all: test_cases >> + >> +test_cases: $(tests) >> + >> +CFLAGS += -std=gnu99 >> +CFLAGS += -ffreestanding >> +CFLAGS += -Wextra >> +CFLAGS += -I lib >> +CFLAGS += -O2 >> +CFLAGS += -msoft-float > > > If you enable the AFP register control bit in your startup code, you can probably > avoid the soft-float thing. > Looks like we can drop that completely. a) no floating point operations are used either way. b) adding a very basic division results in static void test_fp(void) { double a, b; b = 6.5; a = 2.0; b = b / a; report("test fp", b == 3.25); } (compiled with -O0) s390x/selftest.o: In function `test_fp': /home/dhildenb/git/kvm-unit-tests/s390x/selftest.c:21: undefined reference to `__divdf3' /home/dhildenb/git/kvm-unit-tests/s390x/selftest.c:23: undefined reference to `__eqdf2' So we would need a soft float lib (as we're using -nostdlib) c) dropping -msoft-float A DDB (DIVIDE long BFP) is generated. That seems to work under TCG without any exception. I assume the check for AFP-register control is missing. I assume, that test would not pass under KVM. For now I will simply drop -msoft-float. Thanks! -- Thanks, David