From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS2sP-0003kE-Jl for qemu-devel@nongnu.org; Tue, 26 Jul 2016 09:58:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS2sO-0000GB-4L for qemu-devel@nongnu.org; Tue, 26 Jul 2016 09:58:29 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:39493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS2sN-0000EQ-Dx for qemu-devel@nongnu.org; Tue, 26 Jul 2016 09:58:28 -0400 Date: Tue, 26 Jul 2016 21:50:47 +1000 From: David Gibson Message-ID: <20160726115047.GM17429@voom.fritz.box> References: <1469119676-32373-1-git-send-email-lvivier@redhat.com> <20160722064311.GU15941@voom.fritz.box> <20160723063031.GZ15941@voom.fritz.box> <01797e6a-de08-4073-debe-fab7e4795b80@redhat.com> <8a0c41cc-ed63-befa-f78e-7319b3689655@redhat.com> <4ab69528-5fe7-1f44-078a-04af2a1985e6@redhat.com> <20160726095404.GA3609@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="F7w+4yMapWozG0Ib" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2] test: port postcopy test to ppc64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: "Dr. David Alan Gilbert" , Thomas Huth , dgibson@redhat.com, qemu-devel@nongnu.org --F7w+4yMapWozG0Ib Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 26, 2016 at 11:58:17AM +0200, Laurent Vivier wrote: >=20 >=20 > On 26/07/2016 11:54, Dr. David Alan Gilbert wrote: > > * 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=3D...,if=3Dpflash") > >>>>>>>>> > >>>>>>>>> Signed-off-by: Laurent Vivier > >>>>>>>>> --- > >>>>>>>>> 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 ch= eck > >>>>>>>> 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=3Dkvm:tcg", it tries t= o use kvm > >>>>>>> and fall back to tcg. > >>>>>>> > >>>>>>> accel.c: > >>>>>>> > >>>>>>> 80 void configure_accelerator(MachineState *ms) > >>>>>>> 81 { > >>>>>>> ... > >>>>>>> 100 acc =3D accel_find(buf); > >>>>>>> 101 if (!acc) { > >>>>>>> 102 fprintf(stderr, "\"%s\" accelerator not found= =2E\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=3DXXXX" to our = command > >>>>> line to override the "-machine accel=3Dqtest" 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" her= e? > >>> > >>> 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") =3D=3D 0) { > >> init_bootfile_ppc(bootpath); > >> - cmd_src =3D g_strdup_printf("-machine accel=3Dkvm:tcg -m 256M" > >> +#ifdef _ARCH_PPC64 > >> +#define QEMU_CMD_ACCEL "-machine accel=3Dkvm:tcg" > >> +#else > >> +#define QEMU_CMD_ACCEL "-machine accel=3Dtcg" > >> +#endif > >> + cmd_src =3D g_strdup_printf(QEMU_CMD_ACCEL " -m 256M" > >> " -name pcsource,debug-threads=3Don" > >> " -serial file:%s/src_serial" > >> " -drive file=3D%s,if=3Dpflash,form= at=3Draw", > >> tmpfs, bootpath); > >> - cmd_dst =3D g_strdup_printf("-machine accel=3Dkvm:tcg -m 256M" > >> + cmd_dst =3D g_strdup_printf(QEMU_CMD_ACCEL " -m 256M" > >> " -name pcdest,debug-threads=3Don" > >> " -serial file:%s/dest_serial" > >> " -incoming %s", > >> > >> Laurent > >=20 > > Is it worth the hastle to just get rid of the two warnings? >=20 > I don't know, it's why I'd like to have the opinion of David. I'm not really sure either. I do dislike leaving warnings as a rule, because for someone not familiar with the details of the test it may not be obvious whether a warning is harmless or not. --=20 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 --F7w+4yMapWozG0Ib Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXl06XAAoJEGw4ysog2bOSktoQAK6EqABRKni+sjKAEBr13Uaz W4K2cubbYn89lbGla+TjwP4Sn5S7BzayqcWRF/8puDqpeyEzR/K7gsgsfdprQxca YT4tihXOCiyRMVMhiMdHMY6/bS/J99ZGpnojLPsNSPjtncLmDQVfxr+9uyVVMuiH Wle25QEzZEPCVVA7JuJdUZeY8p8XIVExoWg8JBxTdxx9VS7mMYWSMoCb0hFtNjox dd3RGL/uEhYUKkekMy94JiX7XMCUALRCjTJOi0xgE7r9D5p0VXDAYJorc3aQ71aD i5UMZmXYugx99wbKDwR9WcHhWrHRvHRbxwH9qZdVuQLZd5WBU053Zk7xmkfb970e 9zV1Nm9S9u4oV937vQwyblVB4hOQEcq3/597OGP56A5bn94OtfwhdpPzjI7GZUQH M9n+VY+lpc6SHg2xGjO1/e2If9NwnEHO1mkRU+GzwWVG2Zo0BUKU3ggyFYc8qTc5 4GkyvncTUXTqH98On5SYoNsCn3KGZZHDFPzttoZd3FGPJN4H4YUQW8ajPBFhHwFj 5/RlA7VjUthMN/qwISyKbXsb7H4MwDT0ur+Uyzbo5Oq6cevbleguSOyU3SB2UrC1 dHhhyJ5doZxtdO+pvSdJHpNQJPNwTOx1EbwwtkxZAXWbBcjPQfzH+3co4Sd1Oy9X 8PYSfXDv35/79v1IlJEI =/7we -----END PGP SIGNATURE----- --F7w+4yMapWozG0Ib--