All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>, kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Cornelia Huck" <cornelia.huck@de.ibm.com>
Subject: Re: [kvm-unit-tests PATCH v1 1/6] s390x: initial infrastructure
Date: Tue, 16 May 2017 10:21:57 +0200	[thread overview]
Message-ID: <91a8c763-793f-e1d0-8d4a-94eaf8b6f892@redhat.com> (raw)
In-Reply-To: <8ad42ff1-5131-efd4-c39a-cd524df49e48@de.ibm.com>

On 16.05.2017 09:58, Christian Borntraeger wrote:
> On 05/16/2017 09:54 AM, David Hildenbrand wrote:
>> 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.
> 
> This will allow gcc to spill/fill into floating point registers, which are
> not all available without afp-register control. It will probably work because
> the gr->fpr move will not be used for -march=z900, but I suggest to not rely
> on that.
> 

Good point, so enabling AFP sounds right. And that should be valid on
any z/Architecture system (base feature set).

Thanks!

-- 

Thanks,

David

  reply	other threads:[~2017-05-16  8:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 10:58 [kvm-unit-tests PATCH v1 0/6] s390x: basic test infrastructure David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 1/6] s390x: initial infrastructure David Hildenbrand
2017-05-15  9:19   ` Christian Borntraeger
2017-05-16  7:54     ` David Hildenbrand
2017-05-16  7:58       ` Christian Borntraeger
2017-05-16  8:21         ` David Hildenbrand [this message]
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 2/6] s390x: basic self test David Hildenbrand
2017-05-16 13:35   ` Radim Krčmář
2017-05-16 19:16     ` David Hildenbrand
2017-05-17 13:12       ` Radim Krčmář
2017-05-17 16:50         ` David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 3/6] s390x: copy sclp.h and sclp-ascii.c from QEMU David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 4/6] s390x: compile sclp-ascii.c David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 5/6] s390x: wire up sclp console output David Hildenbrand
2017-05-12 10:58 ` [kvm-unit-tests PATCH v1 6/6] MAINTAINERS: add s390x maintainers David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91a8c763-793f-e1d0-8d4a-94eaf8b6f892@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.