From: Janosch Frank <frankja@linux.ibm.com>
To: Janis Schoetterl-Glausch <scgl@linux.vnet.ibm.com>,
Janis Schoetterl-Glausch <scgl@linux.ibm.com>,
Thomas Huth <thuth@redhat.com>
Cc: Pierre Morel <pmorel@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v2 1/2] s390x: Remove assert from arch_def.h
Date: Tue, 5 Oct 2021 15:56:45 +0200 [thread overview]
Message-ID: <9962f5a8-2fe9-fe61-73e3-f9bdbed102f4@linux.ibm.com> (raw)
In-Reply-To: <dd2b1cd2-6d97-0d3a-8db2-f33dcc35f226@linux.vnet.ibm.com>
On 10/5/21 15:51, Janis Schoetterl-Glausch wrote:
> On 10/5/21 2:51 PM, Janosch Frank wrote:
>> On 10/5/21 11:11, Janis Schoetterl-Glausch wrote:
>>> Do not use asserts in arch_def.h so it can be included by snippets.
>>> The caller in stsi.c does not need to be adjusted, returning -1 causes
>>> the test to fail.
>>>
>>> Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
>>
>> A few days ago I had a minute to investigate what needed to be added to be able to link the libcflat. Fortunately it wasn't a lot and I'll try to post it this week so this patch can hopefully be dropped.
>
> One could argue that cc being != 0 is part of the test and so should go through report() and not assert().
> Which happens naturally, since the caller will likely compare it to some positive expected value.
Yes, I can also live with that if you change the commit message then :)
>>
>>> ---
>>> lib/s390x/asm/arch_def.h | 5 +++--
>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
>>> index 302ef1f..4167e2b 100644
>>> --- a/lib/s390x/asm/arch_def.h
>>> +++ b/lib/s390x/asm/arch_def.h
>>> @@ -334,7 +334,7 @@ static inline int stsi(void *addr, int fc, int sel1, int sel2)
>>> return cc;
>>> }
>>> -static inline unsigned long stsi_get_fc(void)
>>> +static inline int stsi_get_fc(void)
>>> {
>>> register unsigned long r0 asm("0") = 0;
>>> register unsigned long r1 asm("1") = 0;
>>> @@ -346,7 +346,8 @@ static inline unsigned long stsi_get_fc(void)
>>> : "+d" (r0), [cc] "=d" (cc)
>>> : "d" (r1)
>>> : "cc", "memory");
>>> - assert(!cc);
>>> + if (cc != 0)
>>> + return -1;
>>> return r0 >> 28;
>>> }
>>>
>>
>
next prev parent reply other threads:[~2021-10-05 13:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211005091153.1863139-1-scgl@linux.ibm.com>
2021-10-05 9:11 ` [kvm-unit-tests PATCH v2 1/2] s390x: Remove assert from arch_def.h Janis Schoetterl-Glausch
2021-10-05 11:19 ` [kvm-unit-tests PATCH v2 1/2] [kvm-unit-tests PATCH v2 0/2] Test specification exception Janis Schoetterl-Glausch
2021-10-05 12:46 ` [kvm-unit-tests PATCH v2 1/2] s390x: Remove assert from arch_def.h Claudio Imbrenda
2021-10-05 12:51 ` Janosch Frank
2021-10-05 13:51 ` Janis Schoetterl-Glausch
2021-10-05 13:56 ` Janosch Frank [this message]
2021-10-05 9:11 ` [kvm-unit-tests PATCH v2 2/2] s390x: Add specification exception interception test Janis Schoetterl-Glausch
2021-10-05 13:09 ` Claudio Imbrenda
2021-10-05 14:12 ` Janis Schoetterl-Glausch
[not found] ` <d49ea774-2e3b-aea7-6c7a-9dd3cc744283@linux.ibm.com>
2021-10-05 14:34 ` Janis Schoetterl-Glausch
2021-10-05 16:52 ` Thomas Huth
2021-10-06 9:47 ` Janosch Frank
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=9962f5a8-2fe9-fe61-73e3-f9bdbed102f4@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pmorel@linux.ibm.com \
--cc=scgl@linux.ibm.com \
--cc=scgl@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox