From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzDAq-0003V4-6u for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:38:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzDAn-0006My-Ur for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:38:36 -0400 Date: Wed, 26 Oct 2016 11:25:27 +1100 From: David Gibson Message-ID: <20161026002527.GN11052@umbus.fritz.box> References: <1477370856-8940-1-git-send-email-mdroth@linux.vnet.ibm.com> <1477370856-8940-7-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mzDsWmoYTs+XRn5Z" Content-Disposition: inline In-Reply-To: <1477370856-8940-7-git-send-email-mdroth@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 06/10] spapr: add hotplug interrupt machine options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: qemu-devel@nongnu.org, nfont@linux.vnet.ibm.com, qemu-ppc@nongnu.org, jallen@linux.vnet.ibm.com, bharata@linux.vnet.ibm.com --mzDsWmoYTs+XRn5Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 24, 2016 at 11:47:32PM -0500, Michael Roth wrote: > This adds machine options of the form: >=20 > -machine pseries,modern-hotplug-events=3Dtrue > -machine pseries,modern-hotplug-events=3Dfalse >=20 > If false, QEMU will force the use of "legacy" style hotplug events, > which are surfaced through EPOW events instead of a dedicated > hot plug event source, and lack certain features necessary, mainly, > for memory unplug support. >=20 > If true, QEMU will enable support for "modern" dedicated hot plug > event source. Note that we will still default to "legacy" style unless > the guest advertises support for the "modern" hotplug events via > ibm,client-architecture-support hcall during early boot. >=20 > For pseries-2.7 and earlier we default to false, for newer machine > types we default to true. >=20 > Signed-off-by: Michael Roth I think this either needs to go after the next patch, or be merged with it. As it stands, after this patch, you're advertising availability of the new mechanism without having actually implemented it. > --- > hw/ppc/spapr.c | 33 +++++++++++++++++++++++++++++++++ > include/hw/ppc/spapr.h | 1 + > include/hw/ppc/spapr_ovec.h | 1 + > 3 files changed, 35 insertions(+) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 828072a..a3ea140 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1789,6 +1789,11 @@ static void ppc_spapr_init(MachineState *machine) > =20 > spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY); > =20 > + /* advertise support for dedicated HP event source to guests */ > + if (spapr->use_hotplug_event_source) { > + spapr_ovec_set(spapr->ov5, OV5_HP_EVT); > + } > + > /* init CPUs */ > if (machine->cpu_model =3D=3D NULL) { > machine->cpu_model =3D kvm_enabled() ? "host" : smc->tcg_default= _cpu; > @@ -2138,16 +2143,41 @@ static void spapr_set_kvm_type(Object *obj, const= char *value, Error **errp) > spapr->kvm_type =3D g_strdup(value); > } > =20 > +static bool spapr_get_modern_hotplug_events(Object *obj, Error **errp) > +{ > + sPAPRMachineState *spapr =3D SPAPR_MACHINE(obj); > + > + return spapr->use_hotplug_event_source; > +} > + > +static void spapr_set_modern_hotplug_events(Object *obj, bool value, > + Error **errp) > +{ > + sPAPRMachineState *spapr =3D SPAPR_MACHINE(obj); > + > + spapr->use_hotplug_event_source =3D value; > +} > + > static void spapr_machine_initfn(Object *obj) > { > sPAPRMachineState *spapr =3D SPAPR_MACHINE(obj); > =20 > spapr->htab_fd =3D -1; > + spapr->use_hotplug_event_source =3D true; > object_property_add_str(obj, "kvm-type", > spapr_get_kvm_type, spapr_set_kvm_type, NULL= ); > object_property_set_description(obj, "kvm-type", > "Specifies the KVM virtualization mo= de (HV, PR)", > NULL); > + object_property_add_bool(obj, "modern-hotplug-events", > + spapr_get_modern_hotplug_events, > + spapr_set_modern_hotplug_events, > + NULL); > + object_property_set_description(obj, "modern-hotplug-events", > + "Use dedicated hotplug event mechani= sm in" > + " place of standard EPOW events when= possible" > + " (required for memory hot-unplug su= pport)", > + NULL); > } > =20 > static void spapr_machine_finalizefn(Object *obj) > @@ -2594,7 +2624,10 @@ static void phb_placement_2_7(sPAPRMachineState *s= papr, uint32_t index, > =20 > static void spapr_machine_2_7_instance_options(MachineState *machine) > { > + sPAPRMachineState *spapr =3D SPAPR_MACHINE(machine); > + > spapr_machine_2_8_instance_options(machine); > + spapr->use_hotplug_event_source =3D false; > } > =20 > static void spapr_machine_2_7_class_options(MachineClass *mc) > diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h > index b6f9f1b..851f536 100644 > --- a/include/hw/ppc/spapr.h > +++ b/include/hw/ppc/spapr.h > @@ -80,6 +80,7 @@ struct sPAPRMachineState { > uint32_t check_exception_irq; > Notifier epow_notifier; > QTAILQ_HEAD(, sPAPREventLogEntry) pending_events; > + bool use_hotplug_event_source; > =20 > /* Migration state */ > int htab_save_index; > diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h > index 47fa04c..92167c6 100644 > --- a/include/hw/ppc/spapr_ovec.h > +++ b/include/hw/ppc/spapr_ovec.h > @@ -45,6 +45,7 @@ typedef struct sPAPROptionVector sPAPROptionVector; > /* option vector 5 */ > #define OV5_DRCONF_MEMORY OV_BIT(2, 2) > #define OV5_FORM1_AFFINITY OV_BIT(5, 0) > +#define OV5_HP_EVT OV_BIT(6, 5) > =20 > /* interfaces */ > sPAPROptionVector *spapr_ovec_new(void); --=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 --mzDsWmoYTs+XRn5Z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYD/f0AAoJEGw4ysog2bOSGd8QAND545W7lY/FD07UOQZXTrph b3oycu9MQduGIbjOOZLHYeycYaB7xKlZ3QmoJ2+TZOqvRYZPIXptpHenlCd2JfKT sngAbfqfUGGs9lOphAtQJzM/uuR2bc+hQFCvJtN0sZ99ZY9kteS8zHlykkCkc4Ox LIBCAso4THGpU0DBs7A5nBIS+AvBPyVncj7Ecb4qTDciYOLtKnXd7zKnyP73SAAa ck7WMfUBE9kAzEtckmtY0omXw3fYyKapDLJmX6We18H/GNafH09Wlv7/VuCaMhwc 9Ia+yfZZv2+3EQ0XO0STQvingDpl9wtX4pAZonEqxDWeNYT5mMsI+L8UAV35pRih 6bhLGXstKKf7Bs94NIi4bnbeBvT0ov2u5EvhMEcMj0SPrcb4wvrh0qVdBG0IOnER iuRNWJ/M/SJEPnvAqzrLmBmO5g86xaU2TD269W2mbwlmKIV7iLGl5VSGOoJFZNXk Uueg+NEc2eQNpRT/9Q1BqmGxZ+lS6FtvZpSInG47q+W5TcmdlUM4NQeICr/rGPVX PlZIknVyHW4l54Zf+HJn+6y9AgVksnzaFnkz9B98JDfIaXuD64Ax4sdYEFMy7jfB hZmYtEvQ2D62MHdspVsa3GAKXNAtbhWuYq+eKL4XUZoK/PBdLjch7saUBcDjehD1 XdZ2d4NJnL13E/76Tjt6 =FOu3 -----END PGP SIGNATURE----- --mzDsWmoYTs+XRn5Z--