From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrD43-0002ck-BS for qemu-devel@nongnu.org; Wed, 19 Nov 2014 16:45:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrD41-0006rG-An for qemu-devel@nongnu.org; Wed, 19 Nov 2014 16:45:27 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:50261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrD40-0006qy-UY for qemu-devel@nongnu.org; Wed, 19 Nov 2014 16:45:25 -0500 Date: Thu, 20 Nov 2014 08:17:22 +1100 From: David Gibson Message-ID: <20141119211722.GK2867@voom.redhat.com> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-33-git-send-email-dgilbert@redhat.com> <20141105064954.GC26255@voom.redhat.com> <20141119185938.GR2355@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Jtds+vpI57xq70EV" Content-Disposition: inline In-Reply-To: <20141119185938.GR2355@work-vm> Subject: Re: [Qemu-devel] [PATCH v4 32/47] postcopy: ram_enable_notify to switch on userfault List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com --Jtds+vpI57xq70EV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 19, 2014 at 06:59:38PM +0000, Dr. David Alan Gilbert wrote: > * David Gibson (david@gibson.dropbear.id.au) wrote: > > On Fri, Oct 03, 2014 at 06:47:38PM +0100, Dr. David Alan Gilbert (git) = wrote: > > > From: "Dr. David Alan Gilbert" > > >=20 > > > Signed-off-by: Dr. David Alan Gilbert > > > --- > > > include/migration/migration.h | 2 ++ > > > include/migration/postcopy-ram.h | 6 +++++ > > > postcopy-ram.c | 49 ++++++++++++++++++++++++++++++= +++++++++- > > > savevm.c | 9 ++++++++ > > > 4 files changed, 65 insertions(+), 1 deletion(-) > > >=20 > > > diff --git a/include/migration/migration.h b/include/migration/migrat= ion.h > > > index be63c89..b01cc17 100644 > > > --- a/include/migration/migration.h > > > +++ b/include/migration/migration.h > > > @@ -87,6 +87,8 @@ struct MigrationIncomingState { > > > POSTCOPY_RAM_INCOMING_END > > > } postcopy_ram_state; > > > =20 > > > + /* For the kernel to send us notifications */ > > > + int userfault_fd; > > > QEMUFile *return_path; > > > QemuMutex rp_mutex; /* We send replies from multiple thr= eads */ > > > PostcopyPMI postcopy_pmi; > > > diff --git a/include/migration/postcopy-ram.h b/include/migration/pos= tcopy-ram.h > > > index 8f237a2..413b670 100644 > > > --- a/include/migration/postcopy-ram.h > > > +++ b/include/migration/postcopy-ram.h > > > @@ -19,6 +19,12 @@ > > > int postcopy_ram_hosttest(void); > > > =20 > > > /* > > > + * Make all of RAM sensitive to accesses to areas that haven't yet b= een written > > > + * and wire up anything necessary to deal with it. > > > + */ > > > +int postcopy_ram_enable_notify(MigrationIncomingState *mis); > > > + > > > +/* > > > * Initialise postcopy-ram, setting the RAM to a state where we can = go into > > > * postcopy later; must be called prior to any precopy. > > > * called from arch_init's similarly named ram_postcopy_incoming_init > > > diff --git a/postcopy-ram.c b/postcopy-ram.c > > > index 8eccf26..925ac77 100644 > > > --- a/postcopy-ram.c > > > +++ b/postcopy-ram.c > > > @@ -485,9 +485,51 @@ int postcopy_ram_incoming_cleanup(MigrationIncom= ingState *mis) > > > return 0; > > > } > > > =20 > > > +/* > > > + * Mark the given area of RAM as requiring notification to unwritten= areas > > > + * Used as a callback on qemu_ram_foreach_block. > > > + * host_addr: Base of area to mark > > > + * offset: Offset in the whole ram arena > > > + * length: Length of the section > > > + * opaque: Unused > >=20 > > ^^^^^^ > > This appears to be wrong - opaque is used to find the MIS. >=20 > Fixed. >=20 > >=20 > > > + * Returns 0 on success > > > + */ > > > +static int postcopy_ram_sensitise_area(const char *block_name, void = *host_addr, > > > + ram_addr_t offset, ram_addr_t= length, > > > + void *opaque) > > > +{ > > > + MigrationIncomingState *mis =3D opaque; > > > + uint64_t tokern[2]; > >=20 > > "tokern"? >=20 > Now "to_kernel" Ah! I thought it was just mispelled "token". --=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 --Jtds+vpI57xq70EV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUbQjiAAoJEGw4ysog2bOS3ecP/3x9C5TMMHxVs3p97005i1rt DWETvnymuCCVc2VTaGNbhNP8ctBoPvtGDKVpicdUM9jNnxWrBDVEQE0SyJuPdOac 4Kb3F064JWHX0H45vwc1hJZaMS9UDyHPXu1gvKkc/RbuFMRy1qCoYSSTkcBUIz6k 1mbg1vXXkj7Ber0PaQZvK6KQnEcoaEqNYf2BNxzbjvAin7B9yjW25X22XQwQnHvN i8opuB7xEqYokyGnWYO8/kA/ysHTISNHOZw/KeX3AXLlh81lyCAALgZbqMeh/ApZ 7iBtQfxU1KJbKaglOfqRdIFHiLsRnVOLU5CkgRD2FvfpdYNHIqqMOzBVH1ex3CH2 DYeEZplf8Gecmm2zeh1ceayWKY/ri/mdbZJTZR4I8+Ws/MffggcEqJ/4g+dqW8NU 4WNT9mIlR31xb3DzrHc1iAqCZ+BYQ5j5yUj8xVO8GvjlvZfV9qiaj3X5XK1Sqe9G OZti2KP2tmohoxzi18UqniOKVKyQHzhPRu07L7VlYafnRrmLj1bg7Au1K6OLXb+Q qx9pmoJ7L881qwoer6Q/Nu+6mIFAS1ezPxoVR22VTK4Zq4YgcWYaFqAQg5O2kCj9 GPbQESqQm10XEQ/jTZ1ed97tyebMigk4rn9xtEW1y9inetlSKRv6PBb54wYpxYrf 1Vrk7hyOKG2i1i53WYcS =vNum -----END PGP SIGNATURE----- --Jtds+vpI57xq70EV--