From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiA1j-0000S6-Ct for qemu-devel@nongnu.org; Mon, 21 Mar 2016 20:18:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiA1f-0000LD-6R for qemu-devel@nongnu.org; Mon, 21 Mar 2016 20:18:27 -0400 Date: Tue, 22 Mar 2016 11:15:49 +1100 From: David Gibson Message-ID: <20160322001549.GO23586@voom.redhat.com> References: <1458568928-3055-1-git-send-email-clg@fr.ibm.com> <1458568928-3055-2-git-send-email-clg@fr.ibm.com> <56F01EC9.4050202@redhat.com> <56F0268A.9030509@fr.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lLR1BQqf7txDtYcF" Content-Disposition: inline In-Reply-To: <56F0268A.9030509@fr.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH 1/2] target-ppc: migrate interrupt vectors address for spapr VM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: qemu-ppc@nongnu.org, Thomas Huth , Mark Cave-Ayland , qemu-devel@nongnu.org, Alexander Graf --lLR1BQqf7txDtYcF Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 21, 2016 at 05:51:22PM +0100, C=E9dric Le Goater wrote: > On 03/21/2016 05:18 PM, Thomas Huth wrote: > > On 21.03.2016 15:02, C=E9dric Le Goater wrote: > >> This address is changed by the linux kernel using the H_SET_MODE hcall > >> and needs to be migrated in order to restart a spapr VM running in > >> TCG. Other platforms should not be affected. > >> > >> Signed-off-by: C=E9dric Le Goater > >> --- > >> target-ppc/machine.c | 3 +++ > >> 1 file changed, 3 insertions(+) > >> > >> diff --git a/target-ppc/machine.c b/target-ppc/machine.c > >> index 692121e98319..a418d463db83 100644 > >> --- a/target-ppc/machine.c > >> +++ b/target-ppc/machine.c > >> @@ -553,6 +553,9 @@ const VMStateDescription vmstate_ppc_cpu =3D { > >> VMSTATE_UINTTL(env.hflags_nmsr, PowerPCCPU), > >> /* FIXME: access_type? */ > >> =20 > >> + /* Effective Address of interrupt vectors */ > >> + VMSTATE_UINTTL(env.excp_prefix, PowerPCCPU), > >> + > >> /* Sanity checking */ > >> VMSTATE_UINTTL_EQUAL(env.msr_mask, PowerPCCPU), > >> VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), > >=20 > > I'm really no expert with all this migration stuff, but don't you have > > to bump the version_id when you add new fields to the vmstate? > > ... and/or use VMSTATE_UINTTL_V() so that migration from older versions > > of QEMU to the current one also still works with KVM? For example, is it > > still possible to migrate from QEMU 2.5 to QEMU 2.6 in KVM if you only > > use VMSTATE_UINTTL without the _V suffix? >=20 > Yes. You are right. I think we need something like below. >=20 > Thanks, >=20 > C. >=20 >=20 > target-ppc: migrate interrupt vectors address for spapr VM >=20 > This address is changed by the linux kernel using the H_SET_MODE hcall > and needs to be migrated in order to restart a spapr VM running in > TCG. Other platforms should not be affected. >=20 > Signed-off-by: C=E9dric Le Goater > --- > target-ppc/machine.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > Index: qemu-dgibson-for-2.6.git/target-ppc/machine.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- qemu-dgibson-for-2.6.git.orig/target-ppc/machine.c > +++ qemu-dgibson-for-2.6.git/target-ppc/machine.c > @@ -522,7 +522,7 @@ static const VMStateDescription vmstate_ > =20 > const VMStateDescription vmstate_ppc_cpu =3D { > .name =3D "cpu", > - .version_id =3D 5, > + .version_id =3D 6, > .minimum_version_id =3D 5, > .minimum_version_id_old =3D 4, > .load_state_old =3D cpu_load_old, > @@ -553,6 +553,9 @@ const VMStateDescription vmstate_ppc_cpu > VMSTATE_UINTTL(env.hflags_nmsr, PowerPCCPU), > /* FIXME: access_type? */ > =20 > + /* Effective Address of interrupt vectors */ > + VMSTATE_UINTTL_V(env.excp_prefix, PowerPCCPU, 6), So, I dislike putting what's essentially emulator internal state (as opposed to architected state) into the migration stream if we can possibly avoid it. I think recalculating excp_prefix from the MSR on incoming migration is the correct approach here - I see that there are bugs with that in the other patch, but so far I'm not seeing a reason to migrate excp_prefix itself. > /* Sanity checking */ > VMSTATE_UINTTL_EQUAL(env.msr_mask, PowerPCCPU), > VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), >=20 >=20 > =20 > > Thomas > >=20 >=20 --=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 --lLR1BQqf7txDtYcF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW8I61AAoJEGw4ysog2bOSHLwP/1HxqSmOoLF4f5XIM6Mmjbod dwPdSd66KOSAd2AF0gwRMS78S/HuFyC3a5StZmLVmI4lrMgetKECxX2ilMLgiu1U uZdEtsxs/95patRcpu0Rgd3JFf9/9DFX6AHfJIU3VMTVN2YFO4STAnAvpdSjWx9N fqHX8Ma954mhS/DbPJIPdoheWJh2w9W5BxB+Fdm5CcPgFtMNEZVokgcvsNUN5/4U da+zOGjW757t4Hy702Op74BBbpMztGQAiQkbSqa6KPv2hiT8Jo1rTj7mo4TpSsuj oiVrHuHt8bSifaQOc1k1WJieraRVyQtgSohRr3VvbRKvUo48nRJvvBwPQpGoeUh8 sWBclQNy2j+3TxP7JEJeFKJOeJosWXYxJCrZP5Y+EaFxof/++9+f6LU0fa4WgdkG yKS8IzxPeobsxUQFu6+E8PPFyOObFolr5rZPDGJ0JmuRbuPQ6R2olIYLSGIDjOV3 RgukjMqhyW5973VAha5or8eZM34MOwsmod8cXnNf96WWjJ2stpHfCLRXPW+/Tf6C Sq1VCyRd2gryzNaqma5d3W7PZUb1rByOFZnzKmn4nNRSYIb9F6CMhZ2KNWFVXt0T FEo6slBe4vn8q8NY79LkEm3MWDRzMoKRwglxEHltGZZ+jPZQg3ClZ7xaBIP+V16D zbBnAKDNXnbaingXBqRe =us8Z -----END PGP SIGNATURE----- --lLR1BQqf7txDtYcF--