From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>,
dgibson@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] test: port postcopy test to ppc64
Date: Tue, 26 Jul 2016 10:54:05 +0100 [thread overview]
Message-ID: <20160726095404.GA3609@work-vm> (raw)
In-Reply-To: <4ab69528-5fe7-1f44-078a-04af2a1985e6@redhat.com>
* Laurent Vivier (lvivier@redhat.com) wrote:
>
>
> On 26/07/2016 11:39, Laurent Vivier wrote:
> >
> >
> > On 26/07/2016 11:28, Thomas Huth wrote:
> >> On 26.07.2016 11:23, Laurent Vivier wrote:
> >>>
> >>>
> >>> On 23/07/2016 08:30, David Gibson wrote:
> >>>> On Fri, Jul 22, 2016 at 09:28:58AM +0200, Laurent Vivier wrote:
> >>>>>
> >>>>>
> >>>>> On 22/07/2016 08:43, David Gibson wrote:
> >>>>>> On Thu, Jul 21, 2016 at 06:47:56PM +0200, Laurent Vivier wrote:
> >>>>>>> As userfaultfd syscall is available on powerpc, migration
> >>>>>>> postcopy can be used.
> >>>>>>>
> >>>>>>> This patch adds the support needed to test this on powerpc,
> >>>>>>> instead of using a bootsector to run code to modify memory,
> >>>>>>> we use a FORTH script in "boot-command" property.
> >>>>>>>
> >>>>>>> As spapr machine doesn't support "-prom-env" argument
> >>>>>>> (the nvram is initialized by SLOF and not by QEMU),
> >>>>>>> "boot-command" is provided to SLOF via a file mapped nvram
> >>>>>>> (with "-drive file=...,if=pflash")
> >>>>>>>
> >>>>>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> >>>>>>> ---
> >>>>>>> v2: move FORTH script directly in sprintf()
> >>>>>>> use openbios_firmware_abi.h
> >>>>>>> remove useless "default" case
> >>>>>>>
> >>>>>>> tests/Makefile.include | 1 +
> >>>>>>> tests/postcopy-test.c | 116 +++++++++++++++++++++++++++++++++++++++++--------
> >>>>>>> 2 files changed, 98 insertions(+), 19 deletions(-)
> >>>>>>
> >>>>>> There's a mostly cosmetic problem with this. If you run make check
> >>>>>> for a ppc64 target on an x86 machine, you get:
> >>>>>>
> >>>>>> GTESTER check-qtest-ppc64
> >>>>>> "kvm" accelerator not found.
> >>>>>> "kvm" accelerator not found.
> >>>>>
> >>>>> I think this is because of "-machine accel=kvm:tcg", it tries to use kvm
> >>>>> and fall back to tcg.
> >>>>>
> >>>>> accel.c:
> >>>>>
> >>>>> 80 void configure_accelerator(MachineState *ms)
> >>>>> 81 {
> >>>>> ...
> >>>>> 100 acc = accel_find(buf);
> >>>>> 101 if (!acc) {
> >>>>> 102 fprintf(stderr, "\"%s\" accelerator not found.\n", buf);
> >>>>> 103 continue;
> >>>>> 104 }
> >>>>>
> >>>>> We can remove the "-machine" argument to use the default instead (tcg or
> >>>>> kvm).
> >>>>
> >>>> That sounds like a good option for a general test.
> >>>
> >>> In fact, we can't: we need to add a "-machine accel=XXXX" to our command
> >>> line to override the "-machine accel=qtest" provided by the qtest
> >>> framework. If we don't override it, the machine doesn't start.
> >>
> >> Would it work if you'd added some magic with "#ifdef CONFIG_KVM" here?
> >
> > I think it needs to be dynamic as the same binary test is used on x86 to
> > test x86 and ppc64, and vice-versa. I'm going to check if we have
> > something like "qtest_get_accel()"...
>
> Something like that should work:
>
> --- a/tests/postcopy-test.c
> +++ b/tests/postcopy-test.c
> @@ -380,12 +380,17 @@ static void test_migrate(void)
> tmpfs, bootpath, uri);
> } else if (strcmp(arch, "ppc64") == 0) {
> init_bootfile_ppc(bootpath);
> - cmd_src = g_strdup_printf("-machine accel=kvm:tcg -m 256M"
> +#ifdef _ARCH_PPC64
> +#define QEMU_CMD_ACCEL "-machine accel=kvm:tcg"
> +#else
> +#define QEMU_CMD_ACCEL "-machine accel=tcg"
> +#endif
> + cmd_src = g_strdup_printf(QEMU_CMD_ACCEL " -m 256M"
> " -name pcsource,debug-threads=on"
> " -serial file:%s/src_serial"
> " -drive file=%s,if=pflash,format=raw",
> tmpfs, bootpath);
> - cmd_dst = g_strdup_printf("-machine accel=kvm:tcg -m 256M"
> + cmd_dst = g_strdup_printf(QEMU_CMD_ACCEL " -m 256M"
> " -name pcdest,debug-threads=on"
> " -serial file:%s/dest_serial"
> " -incoming %s",
>
> Laurent
Is it worth the hastle to just get rid of the two warnings?
Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2016-07-26 9:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-21 16:47 [Qemu-devel] [PATCH v2] test: port postcopy test to ppc64 Laurent Vivier
2016-07-21 19:08 ` Dr. David Alan Gilbert
2016-07-21 20:57 ` Thomas Huth
2016-07-22 6:43 ` David Gibson
2016-07-22 7:28 ` Laurent Vivier
2016-07-23 6:30 ` David Gibson
2016-07-26 9:23 ` Laurent Vivier
2016-07-26 9:28 ` Thomas Huth
2016-07-26 9:39 ` Laurent Vivier
2016-07-26 9:53 ` Laurent Vivier
2016-07-26 9:54 ` Dr. David Alan Gilbert [this message]
2016-07-26 9:58 ` Laurent Vivier
2016-07-26 11:50 ` David Gibson
2016-07-26 10:02 ` Thomas Huth
2016-07-26 12:53 ` Laurent Vivier
2016-07-26 12:59 ` Laurent Vivier
2016-07-26 16:15 ` Laurent Vivier
2016-07-26 16:29 ` Laurent Vivier
2016-07-27 0:43 ` David Gibson
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=20160726095404.GA3609@work-vm \
--to=dgilbert@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=dgibson@redhat.com \
--cc=lvivier@redhat.com \
--cc=qemu-devel@nongnu.org \
--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;
as well as URLs for NNTP newsgroup(s).