From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJKDv-00051d-UR for qemu-devel@nongnu.org; Mon, 18 Aug 2014 06:31:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJKDp-0003HO-Pg for qemu-devel@nongnu.org; Mon, 18 Aug 2014 06:31:35 -0400 Date: Mon, 18 Aug 2014 11:31:17 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20140818103116.GG2388@work-vm> References: <1408331933-11845-1-git-send-email-sam.mj@au1.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1408331933-11845-1-git-send-email-sam.mj@au1.ibm.com> Subject: Re: [Qemu-devel] [PATCH] spapr: Fix stale HTAB during live migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Mendoza-Jonas Cc: aik@ozlabs.ru, dgibson@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org * Samuel Mendoza-Jonas (sam.mj@au1.ibm.com) wrote: > If a guest reboots during a running migration, changes to the > hash page table are not necessarily updated on the destination. > Opening a new file descriptor to the HTAB forces the migration > handler to resend the entire table. >=20 > Signed-off-by: Samuel Mendoza-Jonas > --- > hw/ppc/spapr.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 3a6d26d..7733b37 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -997,6 +997,12 @@ static void spapr_reset_htab(sPAPREnvironment *spapr) > /* Kernel handles htab, we don't need to allocate one */ > spapr->htab_shift =3D shift; > kvmppc_kern_htab =3D true; > + > + /* Make sure readers are aware of the reset */ > + if (spapr->htab_fd > 0) { > + close(spapr->htab_fd); > + spapr->htab_fd =3D kvmppc_get_htab_fd(false); > + } If this function can be called during migration, then if we're unlucky can't that happen during a call to htab_save_iterate =66rom the migration thread? If so what would happen if that htab_save_iterate call was made just between the close() and the reopen? Dave > } else { > if (!spapr->htab) { > /* Allocate an htab if we don't yet have one */ > --=20 > 1.9.3 >=20 >=20 -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK