public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Nico Boehr <nrb@linux.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org
Cc: frankja@linux.ibm.com, imbrenda@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH v1 4/4] s390x: add selftest for migration
Date: Mon, 11 Apr 2022 17:30:46 +0200	[thread overview]
Message-ID: <5073d0fc-1017-5be6-2ec5-2709be14c93c@redhat.com> (raw)
In-Reply-To: <20220411100750.2868587-5-nrb@linux.ibm.com>

On 11/04/2022 12.07, Nico Boehr wrote:
> Add a selftest to check we can do migration tests.
> 
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> ---
>   s390x/Makefile             |  1 +
>   s390x/selftest-migration.c | 27 +++++++++++++++++++++++++++
>   s390x/unittests.cfg        |  4 ++++
>   3 files changed, 32 insertions(+)
>   create mode 100644 s390x/selftest-migration.c
> 
> diff --git a/s390x/Makefile b/s390x/Makefile
> index 62e197cb93d7..2e43e323bcb5 100644
> --- a/s390x/Makefile
> +++ b/s390x/Makefile
> @@ -26,6 +26,7 @@ tests += $(TEST_DIR)/edat.elf
>   tests += $(TEST_DIR)/mvpg-sie.elf
>   tests += $(TEST_DIR)/spec_ex-sie.elf
>   tests += $(TEST_DIR)/firq.elf
> +tests += $(TEST_DIR)/selftest-migration.elf
>   
>   pv-tests += $(TEST_DIR)/pv-diags.elf
>   
> diff --git a/s390x/selftest-migration.c b/s390x/selftest-migration.c
> new file mode 100644
> index 000000000000..8884322a84ca
> --- /dev/null
> +++ b/s390x/selftest-migration.c
> @@ -0,0 +1,27 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Migration Selftest
> + *
> + * Copyright IBM Corp. 2022
> + *
> + * Authors:
> + *  Nico Boehr <nrb@linux.ibm.com>
> + */
> +#include <libcflat.h>
> +
> +int main(void)
> +{
> +	/* don't say migrate here otherwise we will migrate right away */
> +	report_prefix_push("selftest migration");
> +
> +	/* ask migrate_cmd to migrate (it listens for 'migrate') */
> +	puts("Please migrate me\n");
> +
> +	/* wait for migration to finish, we will read a newline */
> +	(void)getchar();
> +
> +	report_pass("Migrated");
> +
> +	report_prefix_pop();
> +	return report_summary();
> +}

Thanks for tackling this!

Having written powerpc/sprs.c in the past, I've got one question / request:

Could we turn this into a "real" test immediately? E.g. write a sane value 
to all control registers that are currently not in use by the k-u-t before 
migration, and then check whether the values are still in there after 
migration? Maybe also some vector registers and the "guarded storage control"?
... or is this rather something for a later update?

  Thomas


  parent reply	other threads:[~2022-04-11 15:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 10:07 [kvm-unit-tests PATCH v1 0/4] s390x: add migration test suport Nico Boehr
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 1/4] lib: s390x: add support for SCLP console read Nico Boehr
2022-04-12  8:02   ` Thomas Huth
2022-04-13 14:41     ` Nico Boehr
2022-04-12 15:32   ` Janosch Frank
2022-04-13 15:00     ` Nico Boehr
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 2/4] s390x: add support for migration tests Nico Boehr
2022-04-11 12:58   ` Claudio Imbrenda
2022-04-12  8:05   ` Thomas Huth
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 3/4] s390x: don't run migration tests under PV Nico Boehr
2022-04-11 12:58   ` Claudio Imbrenda
2022-04-12  8:06   ` Thomas Huth
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 4/4] s390x: add selftest for migration Nico Boehr
2022-04-11 12:49   ` Claudio Imbrenda
2022-04-12 11:49     ` Nico Boehr
2022-04-13  8:42       ` Claudio Imbrenda
2022-04-11 15:30   ` Thomas Huth [this message]
2022-04-12  7:41     ` Nico Boehr
2022-04-12  7:49       ` Thomas Huth
2022-04-13 14:32         ` Nico Boehr

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=5073d0fc-1017-5be6-2ec5-2709be14c93c@redhat.com \
    --to=thuth@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.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