All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-devel] [PATCH for-3.1] tests/cpu-plug-test: check CPU hotplug on ppc64 with KVM
Date: Fri, 27 Jul 2018 15:27:24 +1000	[thread overview]
Message-ID: <20180727052724.GJ3694@umbus.fritz.box> (raw)
In-Reply-To: <153252992640.319494.8451297710133862507.stgit@bahia.lan>

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

On Wed, Jul 25, 2018 at 04:45:26PM +0200, Greg Kurz wrote:
> Commit b585395b655 fixed a regression introduced by some recent changes
> in the XICS code, that was causing QEMU to crash instantly during CPU
> hotplug with KVM. This is typically the kind of bug we'd like our
> test suite to detect before it gets merged. Unfortunately, the current
> tests run with '-machine accel=qtest' and don't exercise KVM specific
> paths in QEMU.
> 
> This patch hence changes add_pseries_test_case() to launch QEMU with
> '-machine accel=kvm' if KVM is available.
> 
> A notable consequence is that the guest will execute SLOF, but for some
> reasons SLOF sometimes hits a program exception. This causes the guest
> to loop forever and the test to be stuck.  Since we don't need the guest
> to be truely running, let's pass -S to QEMU to avoid that.
> 
> Also disable machine capabilities that could be unavailable in KVM, eg,
> when using PR KVM.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

I'm pretty sure trying to change the accelerator on a qtest test just
doesn't make sense.  We'd need a different approach for testing cpu
hotplug against kvm & tcg backends.

> ---
>  tests/cpu-plug-test.c |   20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c
> index 5f39ba0df394..2107557809b7 100644
> --- a/tests/cpu-plug-test.c
> +++ b/tests/cpu-plug-test.c
> @@ -21,6 +21,7 @@ struct PlugTestData {
>      unsigned cores;
>      unsigned threads;
>      unsigned maxcpus;
> +    const char *extra_args;
>  };
>  typedef struct PlugTestData PlugTestData;
>  
> @@ -106,9 +107,10 @@ static void test_plug_with_device_add_coreid(gconstpointer data)
>      char *args;
>      unsigned int c;
>  
> -    args = g_strdup_printf("-machine %s -cpu %s "
> +    args = g_strdup_printf("-machine %s -cpu %s %s "
>                             "-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u",
>                             td->machine, td->cpu_model,
> +                           td->extra_args ? td->extra_args : "",
>                             td->sockets, td->cores, td->threads, td->maxcpus);
>      qtest_start(args);
>  
> @@ -195,10 +197,20 @@ static void add_pseries_test_case(const char *mname)
>          (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7)) {
>          return;
>      }
> -    data = g_new(PlugTestData, 1);
> +    data = g_new0(PlugTestData, 1);
>      data->machine = g_strdup(mname);
>      data->cpu_model = "power8_v2.0";
> -    data->device_model = g_strdup("power8_v2.0-spapr-cpu-core");
> +    if (!access("/sys/module/kvm_hv", F_OK) ||
> +        !access("/sys/module/kvm_pr", F_OK)) {
> +        data->cpu_model = "host";
> +        data->extra_args =
> +            "-machine accel=kvm "
> +            "-machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken "
> +            "-machine cap-htm=off "
> +            "-machine cap-hpt-max-page-size=64k "
> +            "-S";
> +    }
> +    data->device_model = g_strdup_printf("%s-spapr-cpu-core", data->cpu_model);
>      data->sockets = 2;
>      data->cores = 3;
>      data->threads = 1;
> @@ -221,7 +233,7 @@ static void add_s390x_test_case(const char *mname)
>          return;
>      }
>  
> -    data = g_new(PlugTestData, 1);
> +    data = g_new0(PlugTestData, 1);
>      data->machine = g_strdup(mname);
>      data->cpu_model = "qemu";
>      data->device_model = g_strdup("qemu-s390x-cpu");
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-07-27  5:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 14:45 Greg Kurz
2018-07-27  5:27 ` David Gibson [this message]
2018-07-27  7:54   ` Greg Kurz
2018-07-27  8:18     ` Thomas Huth
2018-07-27  9:00       ` Greg Kurz
2018-07-27 11:25         ` Thomas Huth
2018-07-27 12:03           ` Greg Kurz
2018-07-30  5:57     ` David Gibson
2018-07-30  8:41       ` Greg Kurz
2018-07-30  9:59         ` Greg Kurz
2018-07-31  3:27           ` David Gibson
2018-08-01 13:35             ` Greg Kurz
2018-07-31  3:25         ` David Gibson
2018-08-01 13:24           ` Greg Kurz
2018-08-02  4:08             ` David Gibson
2018-08-02  9:36             ` Igor Mammedov
2018-08-02 10:52               ` Greg Kurz

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=20180727052724.GJ3694@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --subject='Re: [Qemu-devel] [PATCH for-3.1] tests/cpu-plug-test: check CPU hotplug on ppc64 with KVM' \
    /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

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.