All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Andre Przywara <andre.przywara@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Thomas Huth <thuth@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	kvm-ppc@vger.kernel.org, David Hildenbrand <david@redhat.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	cohuck@redhat.com, Claudio Imbrenda <imbrenda@linux.ibm.com>,
	linux-s390 <linux-s390@vger.kernel.org>,
	KVM <kvm@vger.kernel.org>,
	kvmarm@lists.cs.columbia.edu, maz@kernel.org,
	vivek.gautam@arm.com
Subject: Re: [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available
Date: Mon, 12 Jul 2021 10:12:29 -0700	[thread overview]
Message-ID: <442EEB37-C289-4CB5-8161-71A54A350FEE@gmail.com> (raw)
In-Reply-To: <20210712170745.wz2jewomlqchmhhb@gator>

[-- Attachment #1: Type: text/plain, Size: 2398 bytes --]



> On Jul 12, 2021, at 10:07 AM, Andrew Jones <drjones@redhat.com> wrote:
> 
> On Mon, Jul 12, 2021 at 05:51:55PM +0100, Andre Przywara wrote:
>> On Fri,  2 Jul 2021 17:31:18 +0100
>> Alexandru Elisei <alexandru.elisei@arm.com> wrote:
>> 
>> Hi,
>> 
>>> The arm64 tests can be run under kvmtool, which doesn't emulate a
>>> chr-testdev device. In preparation for adding run script support for
>>> kvmtool, print the test exit status so the scripts can pick it up and
>>> correctly mark the test as pass or fail.
>>> 
>>> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
>>> ---
>>> lib/chr-testdev.h |  1 +
>>> lib/arm/io.c      | 10 +++++++++-
>>> lib/chr-testdev.c |  5 +++++
>>> 3 files changed, 15 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/lib/chr-testdev.h b/lib/chr-testdev.h
>>> index ffd9a851aa9b..09b4b424670e 100644
>>> --- a/lib/chr-testdev.h
>>> +++ b/lib/chr-testdev.h
>>> @@ -11,4 +11,5 @@
>>>  */
>>> extern void chr_testdev_init(void);
>>> extern void chr_testdev_exit(int code);
>>> +extern bool chr_testdev_available(void);
>>> #endif
>>> diff --git a/lib/arm/io.c b/lib/arm/io.c
>>> index 343e10822263..9e62b571a91b 100644
>>> --- a/lib/arm/io.c
>>> +++ b/lib/arm/io.c
>>> @@ -125,7 +125,15 @@ extern void halt(int code);
>>> 
>>> void exit(int code)
>>> {
>>> -	chr_testdev_exit(code);
>>> +	if (chr_testdev_available()) {
>>> +		chr_testdev_exit(code);
>>> +	} else {
>>> +		/*
>>> +		 * Print the test return code in the format used by chr-testdev
>>> +		 * so the runner script can parse it.
>>> +		 */
>>> +		printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
>> 
>> It's more me being clueless here rather than a problem, but where does
>> this "EXIT: STATUS" line come from? In lib/chr-testdev.c I see "%dq",
>> so it this coming from QEMU (but I couldn't find it in there)?
>> 
>> But anyways the patch looks good and matches what PPC and s390 do.
> 
> I invented the 'EXIT: STATUS' format for PPC, which didn't/doesn't have an
> exit code testdev. Now that it has also been adopted by s390 I guess we've
> got a kvm-unit-tests standard to follow for arm :-)

I was unaware of this “standard” and I mistakenly used a different format
for x86, in case someone wants to fix it. [1]

[1] https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/commit/5747945371b47c51cb16187a26111d06f58f06b2

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Nadav Amit <nadav.amit@gmail.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Thomas Huth <thuth@redhat.com>,
	Janosch Frank <frankja@linux.ibm.com>, KVM <kvm@vger.kernel.org>,
	David Hildenbrand <david@redhat.com>,
	Andre Przywara <andre.przywara@arm.com>,
	cohuck@redhat.com, kvm-ppc@vger.kernel.org, vivek.gautam@arm.com,
	maz@kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available
Date: Mon, 12 Jul 2021 10:12:29 -0700	[thread overview]
Message-ID: <442EEB37-C289-4CB5-8161-71A54A350FEE@gmail.com> (raw)
In-Reply-To: <20210712170745.wz2jewomlqchmhhb@gator>


[-- Attachment #1.1: Type: text/plain, Size: 2398 bytes --]



> On Jul 12, 2021, at 10:07 AM, Andrew Jones <drjones@redhat.com> wrote:
> 
> On Mon, Jul 12, 2021 at 05:51:55PM +0100, Andre Przywara wrote:
>> On Fri,  2 Jul 2021 17:31:18 +0100
>> Alexandru Elisei <alexandru.elisei@arm.com> wrote:
>> 
>> Hi,
>> 
>>> The arm64 tests can be run under kvmtool, which doesn't emulate a
>>> chr-testdev device. In preparation for adding run script support for
>>> kvmtool, print the test exit status so the scripts can pick it up and
>>> correctly mark the test as pass or fail.
>>> 
>>> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
>>> ---
>>> lib/chr-testdev.h |  1 +
>>> lib/arm/io.c      | 10 +++++++++-
>>> lib/chr-testdev.c |  5 +++++
>>> 3 files changed, 15 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/lib/chr-testdev.h b/lib/chr-testdev.h
>>> index ffd9a851aa9b..09b4b424670e 100644
>>> --- a/lib/chr-testdev.h
>>> +++ b/lib/chr-testdev.h
>>> @@ -11,4 +11,5 @@
>>>  */
>>> extern void chr_testdev_init(void);
>>> extern void chr_testdev_exit(int code);
>>> +extern bool chr_testdev_available(void);
>>> #endif
>>> diff --git a/lib/arm/io.c b/lib/arm/io.c
>>> index 343e10822263..9e62b571a91b 100644
>>> --- a/lib/arm/io.c
>>> +++ b/lib/arm/io.c
>>> @@ -125,7 +125,15 @@ extern void halt(int code);
>>> 
>>> void exit(int code)
>>> {
>>> -	chr_testdev_exit(code);
>>> +	if (chr_testdev_available()) {
>>> +		chr_testdev_exit(code);
>>> +	} else {
>>> +		/*
>>> +		 * Print the test return code in the format used by chr-testdev
>>> +		 * so the runner script can parse it.
>>> +		 */
>>> +		printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
>> 
>> It's more me being clueless here rather than a problem, but where does
>> this "EXIT: STATUS" line come from? In lib/chr-testdev.c I see "%dq",
>> so it this coming from QEMU (but I couldn't find it in there)?
>> 
>> But anyways the patch looks good and matches what PPC and s390 do.
> 
> I invented the 'EXIT: STATUS' format for PPC, which didn't/doesn't have an
> exit code testdev. Now that it has also been adopted by s390 I guess we've
> got a kvm-unit-tests standard to follow for arm :-)

I was unaware of this “standard” and I mistakenly used a different format
for x86, in case someone wants to fix it. [1]

[1] https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/commit/5747945371b47c51cb16187a26111d06f58f06b2

[-- Attachment #1.2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Nadav Amit <nadav.amit@gmail.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Andre Przywara <andre.przywara@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Thomas Huth <thuth@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	kvm-ppc@vger.kernel.org, David Hildenbrand <david@redhat.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	cohuck@redhat.com, Claudio Imbrenda <imbrenda@linux.ibm.com>,
	linux-s390 <linux-s390@vger.kernel.org>,
	KVM <kvm@vger.kernel.org>,
	kvmarm@lists.cs.columbia.edu, maz@kernel.org,
	vivek.gautam@arm.com
Subject: Re: [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av
Date: Mon, 12 Jul 2021 17:12:29 +0000	[thread overview]
Message-ID: <442EEB37-C289-4CB5-8161-71A54A350FEE@gmail.com> (raw)
In-Reply-To: <20210712170745.wz2jewomlqchmhhb@gator>

[-- Attachment #1: Type: text/plain, Size: 2398 bytes --]



> On Jul 12, 2021, at 10:07 AM, Andrew Jones <drjones@redhat.com> wrote:
> 
> On Mon, Jul 12, 2021 at 05:51:55PM +0100, Andre Przywara wrote:
>> On Fri,  2 Jul 2021 17:31:18 +0100
>> Alexandru Elisei <alexandru.elisei@arm.com> wrote:
>> 
>> Hi,
>> 
>>> The arm64 tests can be run under kvmtool, which doesn't emulate a
>>> chr-testdev device. In preparation for adding run script support for
>>> kvmtool, print the test exit status so the scripts can pick it up and
>>> correctly mark the test as pass or fail.
>>> 
>>> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
>>> ---
>>> lib/chr-testdev.h |  1 +
>>> lib/arm/io.c      | 10 +++++++++-
>>> lib/chr-testdev.c |  5 +++++
>>> 3 files changed, 15 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/lib/chr-testdev.h b/lib/chr-testdev.h
>>> index ffd9a851aa9b..09b4b424670e 100644
>>> --- a/lib/chr-testdev.h
>>> +++ b/lib/chr-testdev.h
>>> @@ -11,4 +11,5 @@
>>>  */
>>> extern void chr_testdev_init(void);
>>> extern void chr_testdev_exit(int code);
>>> +extern bool chr_testdev_available(void);
>>> #endif
>>> diff --git a/lib/arm/io.c b/lib/arm/io.c
>>> index 343e10822263..9e62b571a91b 100644
>>> --- a/lib/arm/io.c
>>> +++ b/lib/arm/io.c
>>> @@ -125,7 +125,15 @@ extern void halt(int code);
>>> 
>>> void exit(int code)
>>> {
>>> -	chr_testdev_exit(code);
>>> +	if (chr_testdev_available()) {
>>> +		chr_testdev_exit(code);
>>> +	} else {
>>> +		/*
>>> +		 * Print the test return code in the format used by chr-testdev
>>> +		 * so the runner script can parse it.
>>> +		 */
>>> +		printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
>> 
>> It's more me being clueless here rather than a problem, but where does
>> this "EXIT: STATUS" line come from? In lib/chr-testdev.c I see "%dq",
>> so it this coming from QEMU (but I couldn't find it in there)?
>> 
>> But anyways the patch looks good and matches what PPC and s390 do.
> 
> I invented the 'EXIT: STATUS' format for PPC, which didn't/doesn't have an
> exit code testdev. Now that it has also been adopted by s390 I guess we've
> got a kvm-unit-tests standard to follow for arm :-)

I was unaware of this “standard” and I mistakenly used a different format
for x86, in case someone wants to fix it. [1]

[1] https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/commit/5747945371b47c51cb16187a26111d06f58f06b2

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-07-12 17:12 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 16:31 [kvm-unit-tests RFC PATCH 0/5] arm: Add kvmtool to the runner script Alexandru Elisei
2021-07-02 16:31 ` Alexandru Elisei
2021-07-02 16:31 ` Alexandru Elisei
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Alexandru Elisei
2021-07-02 16:31   ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not availa Alexandru Elisei
2021-07-02 16:31   ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Alexandru Elisei
2021-07-12 16:36   ` Andrew Jones
2021-07-12 16:36     ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av Andrew Jones
2021-07-12 16:36     ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Andrew Jones
2021-09-06 10:20     ` Alexandru Elisei
2021-09-06 10:20       ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av Alexandru Elisei
2021-09-06 10:20       ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Alexandru Elisei
2021-09-06 10:58       ` Andrew Jones
2021-09-06 10:58         ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av Andrew Jones
2021-09-06 10:58         ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Andrew Jones
2021-09-06 11:06         ` Alexandru Elisei
2021-09-06 11:06           ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av Alexandru Elisei
2021-09-06 11:06           ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Alexandru Elisei
2021-07-12 16:51   ` Andre Przywara
2021-07-12 16:51     ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av Andre Przywara
2021-07-12 16:51     ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Andre Przywara
2021-07-12 17:07     ` Andrew Jones
2021-07-12 17:07       ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av Andrew Jones
2021-07-12 17:07       ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Andrew Jones
2021-07-12 17:12       ` Nadav Amit [this message]
2021-07-12 17:12         ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not av Nadav Amit
2021-07-12 17:12         ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Nadav Amit
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 2/5] scripts: Rename run_qemu_status -> run_test_status Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-07-12 16:37   ` Andrew Jones
2021-07-12 16:37     ` Andrew Jones
2021-07-12 16:37     ` Andrew Jones
2021-07-13  7:45   ` Thomas Huth
2021-07-13  7:45     ` Thomas Huth
2021-07-13  7:45     ` Thomas Huth
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 3/5] run_tests.sh: Add kvmtool support Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-07-12 16:52   ` Andre Przywara
2021-07-12 16:52     ` Andre Przywara
2021-07-12 16:52     ` Andre Przywara
2021-09-06 10:28     ` Alexandru Elisei
2021-09-06 10:28       ` Alexandru Elisei
2021-09-06 10:28       ` Alexandru Elisei
2021-09-06 11:01       ` Andrew Jones
2021-09-06 11:01         ` Andrew Jones
2021-09-06 11:01         ` Andrew Jones
2021-09-06 11:07         ` Alexandru Elisei
2021-09-06 11:07           ` Alexandru Elisei
2021-09-06 11:07           ` Alexandru Elisei
2021-09-07 10:17   ` Andrew Jones
2021-09-07 10:17     ` Andrew Jones
2021-09-07 10:17     ` Andrew Jones
2021-09-08 14:33     ` Alexandru Elisei
2021-09-08 14:33       ` Alexandru Elisei
2021-09-08 14:33       ` Alexandru Elisei
2021-09-08 15:09       ` Andrew Jones
2021-09-08 15:09         ` Andrew Jones
2021-09-08 15:09         ` Andrew Jones
2021-09-08 15:46         ` Alexandru Elisei
2021-09-08 15:46           ` Alexandru Elisei
2021-09-08 15:46           ` Alexandru Elisei
2021-09-08 15:49           ` Andrew Jones
2021-09-08 15:49             ` Andrew Jones
2021-09-08 15:49             ` Andrew Jones
2021-09-09 11:33             ` Alexandru Elisei
2021-09-09 11:33               ` Alexandru Elisei
2021-09-09 11:33               ` Alexandru Elisei
2021-09-09 12:49               ` Andrew Jones
2021-09-09 12:49                 ` Andrew Jones
2021-09-09 12:49                 ` Andrew Jones
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 4/5] scripts: Generate kvmtool standalone tests Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-09-07 10:21   ` Andrew Jones
2021-09-07 10:21     ` Andrew Jones
2021-09-07 10:21     ` Andrew Jones
2021-09-08 15:37     ` Alexandru Elisei
2021-09-08 15:37       ` Alexandru Elisei
2021-09-08 15:37       ` Alexandru Elisei
2021-09-08 16:07       ` Andrew Jones
2021-09-08 16:07         ` Andrew Jones
2021-09-08 16:07         ` Andrew Jones
2021-09-09 11:11         ` Alexandru Elisei
2021-09-09 11:11           ` Alexandru Elisei
2021-09-09 11:11           ` Alexandru Elisei
2021-09-09 13:05           ` Andrew Jones
2021-09-09 13:05             ` Andrew Jones
2021-09-09 13:05             ` Andrew Jones
2021-09-09 13:47             ` Alexandru Elisei
2021-09-09 13:47               ` Alexandru Elisei
2021-09-09 13:47               ` Alexandru Elisei
2021-09-09 13:54               ` Andrew Jones
2021-09-09 13:54                 ` Andrew Jones
2021-09-09 13:54                 ` Andrew Jones
2021-09-09 14:42                 ` Alexandru Elisei
2021-09-09 14:42                   ` Alexandru Elisei
2021-09-09 14:42                   ` Alexandru Elisei
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 5/5] configure: Ignore --erratatxt when --target=kvmtool Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-07-02 16:31   ` Alexandru Elisei
2021-09-07 10:25   ` Andrew Jones
2021-09-07 10:25     ` Andrew Jones
2021-09-07 10:25     ` Andrew Jones
2021-09-08 16:13     ` Alexandru Elisei
2021-09-08 16:13       ` Alexandru Elisei
2021-09-08 16:13       ` Alexandru Elisei

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=442EEB37-C289-4CB5-8161-71A54A350FEE@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=drjones@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-s390@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vivek.gautam@arm.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.