From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aclJz-0007Br-BD for qemu-devel@nongnu.org; Sun, 06 Mar 2016 21:55:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aclJy-0005B8-8V for qemu-devel@nongnu.org; Sun, 06 Mar 2016 21:54:59 -0500 Date: Mon, 7 Mar 2016 13:51:43 +1100 From: David Gibson Message-ID: <20160307025143.GC22546@voom.fritz.box> References: <1457074461-14285-1-git-send-email-bharata@linux.vnet.ibm.com> <1457074461-14285-3-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="L6iaP+gRLNZHKoI4" Content-Disposition: inline In-Reply-To: <1457074461-14285-3-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v1 02/10] exec: Do vmstate unregistration from cpu_exec_exit() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: mjrosato@linux.vnet.ibm.com, agraf@suse.de, thuth@redhat.com, pkrempa@redhat.com, ehabkost@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, armbru@redhat.com, borntraeger@de.ibm.com, qemu-ppc@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de, mdroth@linux.vnet.ibm.com --L6iaP+gRLNZHKoI4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 04, 2016 at 12:24:13PM +0530, Bharata B Rao wrote: > cpu_exec_init() does vmstate_register and register_savevm for the CPU dev= ice. > These need to be undone from cpu_exec_exit(). These changes are needed to > support CPU hot removal. >=20 > Signed-off-by: Bharata B Rao > --- > exec.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/exec.c b/exec.c > index 7c3f747..b8eeb54 100644 > --- a/exec.c > +++ b/exec.c > @@ -613,6 +613,8 @@ static void cpu_release_index(CPUState *cpu) > =20 > void cpu_exec_exit(CPUState *cpu) > { > + CPUClass *cc =3D CPU_GET_CLASS(cpu); > + > #if defined(CONFIG_USER_ONLY) > cpu_list_lock(); > #endif > @@ -630,6 +632,16 @@ void cpu_exec_exit(CPUState *cpu) > #if defined(CONFIG_USER_ONLY) > cpu_list_unlock(); > #endif > + > + if (cc->vmsd !=3D NULL) { > + vmstate_unregister(NULL, cc->vmsd, cpu); > + } > +#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY) > + unregister_savevm(NULL, "cpu", cpu->env_ptr); > +#endif > + if (qdev_get_vmsd(DEVICE(cpu)) =3D=3D NULL) { > + vmstate_unregister(NULL, &vmstate_cpu_common, cpu); > + } > } > =20 > void cpu_exec_init(CPUState *cpu, Error **errp) Looking at the current cpu_exec_init() I'm seeing the vmstate_register() calls which are balacned here, but not a register_savevm(). Is that due to a change in cpu_exec_init() since you first wrote this patch? --=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 --L6iaP+gRLNZHKoI4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW3Oy/AAoJEGw4ysog2bOScaQQAIbqL14GcUGhiMcldBLq0J48 7O1dMQtfECWUJtIuavoZmm+0neI+b+E0vkgZ9mMCKHyuCpMEv4pZP5Y/oW988m6+ wOy5VKjTPPNSIQxP7XZYJJtCbxLy3Iwa9w1sAhzI3VAJc5fTnlkjocpmctsDqJvP DUA1cUjyu6AonxVTXcZkQkF1iLfgPehEjV7Rdj31s1niqGy/wluu5RkcPvb23oGa GcEDvq0R52S/RLtAQ9Ro+1dv3DTLlTU4vsB3cAWPlH6B4+B9rJI0Ge8b8CnTSHL0 HMjbv9JeD3WZeMzX4qFW30rKLgmtlGGBKcyW6BSnfwZ7KJB1+VBh8ck0FT8XReqh dcSkBvIjgArLqi9zGXVwPLfD/3X2Prj8/1zSNZ1lbHlJuBIjhIuralEW+55RJ6v9 O20mcsyO6Pklwls5/Xx2FnnGrlNq7sOMJmBdaJ5LOr5SDRJY/NxwSA1XCJMn6z30 CcPuzgpmI768/4N4cvksTrk7iesaX21NSrsPayKnHMbpSt7cGqV55Dq8F9p1zo+W fzCCCYz/0vboI3i6H3axusmb4LlivwRYel8NVXX2bucLARemcMuRYMQVtzpy+uEl HoDWqlyZKNU4RuW7/VAADMcJZ5+yzej7JyREAVHEb4++a5M5qsO9iSz7kxcWPCTD b2onNbGJ0QNbffyzPyTs =skUT -----END PGP SIGNATURE----- --L6iaP+gRLNZHKoI4--