From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlT5s-0008N1-U9 for qemu-devel@nongnu.org; Mon, 03 Nov 2014 20:39:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlT5n-0006Fg-Ok for qemu-devel@nongnu.org; Mon, 03 Nov 2014 20:39:36 -0500 Received: from ozlabs.org ([103.22.144.67]:60216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlT5n-0006F8-Cu for qemu-devel@nongnu.org; Mon, 03 Nov 2014 20:39:31 -0500 Date: Tue, 4 Nov 2014 12:40:32 +1100 From: David Gibson Message-ID: <20141104014032.GF27321@voom.fritz.box> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-26-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ls2Gy6y7jbHLe9Od" Content-Disposition: inline In-Reply-To: <1412358473-31398-26-git-send-email-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 25/47] postcopy: OS support test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, lilei@linux.vnet.ibm.com, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com --Ls2Gy6y7jbHLe9Od Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 03, 2014 at 06:47:31PM +0100, Dr. David Alan Gilbert (git) wrot= e: > From: "Dr. David Alan Gilbert" >=20 > Provide a check to see if the OS we're running on has all the bits > needed for postcopy. >=20 > Creates postcopy-ram.c which will get most of the other helpers we need. >=20 > Signed-off-by: Dr. David Alan Gilbert > --- > Makefile.objs | 2 +- > include/migration/postcopy-ram.h | 19 +++++ > postcopy-ram.c | 160 +++++++++++++++++++++++++++++++++= ++++++ > savevm.c | 6 ++ > 4 files changed, 186 insertions(+), 1 deletion(-) > create mode 100644 include/migration/postcopy-ram.h > create mode 100644 postcopy-ram.c >=20 > diff --git a/Makefile.objs b/Makefile.objs > index 97db978..fa0a3a0 100644 > --- a/Makefile.objs > +++ b/Makefile.objs > @@ -54,7 +54,7 @@ common-obj-y +=3D qemu-file.o > common-obj-$(CONFIG_RDMA) +=3D migration-rdma.o > common-obj-y +=3D qemu-char.o #aio.o > common-obj-y +=3D block-migration.o > -common-obj-y +=3D page_cache.o xbzrle.o > +common-obj-y +=3D page_cache.o xbzrle.o postcopy-ram.o > =20 > common-obj-$(CONFIG_POSIX) +=3D migration-exec.o migration-unix.o migrat= ion-fd.o > =20 > diff --git a/include/migration/postcopy-ram.h b/include/migration/postcop= y-ram.h > new file mode 100644 > index 0000000..dcd1afa > --- /dev/null > +++ b/include/migration/postcopy-ram.h > @@ -0,0 +1,19 @@ > +/* > + * Postcopy migration for RAM > + * > + * Copyright 2013 Red Hat, Inc. and/or its affiliates > + * > + * Authors: > + * Dave Gilbert > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or la= ter. > + * See the COPYING file in the top-level directory. > + * > + */ > +#ifndef QEMU_POSTCOPY_RAM_H > +#define QEMU_POSTCOPY_RAM_H > + > +/* Return 0 if the host supports everything we need to do postcopy-ram */ > +int postcopy_ram_hosttest(void); Maybe postcopy_supported_by_host() would be a bit clearer? [snip] > +#ifdef HOST_X86_64 > + /* NOTE: These are Andrea's 3.15.0 world */ I thought the usual approach in qemu was to import the updated headers first in a separate patch, rather than embeddeding new defines. > +#ifndef MADV_USERFAULT > +#define MADV_USERFAULT 18 > +#define MADV_NOUSERFAULT 19 > +#endif > + > +#ifndef __NR_remap_anon_pages > +#define __NR_remap_anon_pages 321 > +#endif > + > +#ifndef __NR_userfaultfd > +#define __NR_userfaultfd 322 > +#endif > + > +#endif > + > +#ifndef USERFAULTFD_PROTOCOL > +#define USERFAULTFD_PROTOCOL (uint64_t)0xaa > +#endif > + > +#endif --=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 --Ls2Gy6y7jbHLe9Od Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUWC6QAAoJEGw4ysog2bOSuP8QALw+8UZWv+8XQWaB8uktHZSv hDjOgecXq45Lha2lhu3HwkBRbxy7YgbDH3y5wrwq1FRuF7PthatKVqc1euF+Fdky 1O6nxWVLrg+FF9NrNKJG0cZvw5jsTmjd8oT1gKnzc250PajUjGIDMeCpSd7408q8 EReC66VJI3S3eGTqDyNhXF/5Blc/Z+wfBg1gudtMvqrQqQue3Yetsj7HtOSclUGT urbUv2ac9n3t8598mLpzJcuBg8nVLqZFDPhnrfx/mFBN1XPrsktlm7T87bF3Mxrc UsMCUEQiVruu/1nTTEe4WJ1XKbM7vyWKWrAF3qcbr0nunY5YN2b8sbxuOcSoI0Yd 6HueDG9ldwaM2M78hnCFd9uGbd5H3C3psP3oLaDbNfKgMQMkdabNHpeSNGGO9/41 I9Kl9K0HNLi9gn935Jlu9pjyhDVLzmUZ5mmFodR+WecrcNXFzzyKjXlPVflRjPCz d8spD+tqIV1pJhpueD/f+dippcgIaXec+q9wt9pIoVYbAH1D8KbkESpyPXQZxZht 8duvulU8s5meSjJvU/1xg4PkmLAdOaoMpZFVXjmaLitzOMDQvLiUaqmpeyJBjtmF RfhUowFBJFiVDDPiwX1XI1dQZ1mN96zkJP2ENU0sHR1VLLZOJWvWfRMqaXtiLAyZ JBZ9cKLgA9ah09E4rWKZ =BWh0 -----END PGP SIGNATURE----- --Ls2Gy6y7jbHLe9Od--