From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buubz-0008W8-39 for qemu-devel@nongnu.org; Fri, 14 Oct 2016 01:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buubw-0003AH-L2 for qemu-devel@nongnu.org; Fri, 14 Oct 2016 01:00:49 -0400 Date: Fri, 14 Oct 2016 15:38:19 +1100 From: David Gibson Message-ID: <20161014043819.GI28562@umbus> References: <1476314039-9520-1-git-send-email-mdroth@linux.vnet.ibm.com> <1476314039-9520-8-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GBuTPvBEOL0MYPgd" Content-Disposition: inline In-Reply-To: <1476314039-9520-8-git-send-email-mdroth@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 07/11] 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, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, jallen@linux.vnet.ibm.com --GBuTPvBEOL0MYPgd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 12, 2016 at 06:13:55PM -0500, Michael Roth wrote: > This adds machine options of the form: >=20 > -machine pseries,legacy-hotplug-events=3Dtrue > -machine pseries,legacy-hotplug-events=3Dfalse >=20 > to denote whether or not we wish to force the use of "legacy" style > hotplug events, which are surfaced through EPOW interrupts instead of > a dedicated interrupt source, and lack certain features necessary, > mainly, for memory unplug support. >=20 > If false, QEMU will default to "legacy" style unless the guest > advertises support for the newer events via > ibm,client-architecture-support hcall during early boot. >=20 > For pseries-2.7 and earlier we default to true, for newer machine > types we default to false. >=20 > Signed-off-by: Michael Roth Hrm.. I think it would be a little clearer if you could find a wording such that both the internal variable and the external property have the same sense - i.e. get rid of the ! in the property getters / setters. > --- > hw/ppc/spapr.c | 31 +++++++++++++++++++++++++++++++ > include/hw/ppc/spapr.h | 1 + > include/hw/ppc/spapr_ovec.h | 1 + > 3 files changed, 33 insertions(+) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index f8cde92..d80a6fa 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1816,6 +1816,11 @@ static void ppc_spapr_init(MachineState *machine) > =20 > spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY); > =20 > + /* use dedicated HP event source if guest supports it */ > + 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; > @@ -2172,16 +2177,39 @@ 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_legacy_hotplug_events(Object *obj, Error **errp) > +{ > + sPAPRMachineState *spapr =3D SPAPR_MACHINE(obj); > + > + return !spapr->use_hotplug_event_source; > +} > + > +static void spapr_set_legacy_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, "legacy-hotplug-events", > + spapr_get_legacy_hotplug_events, > + spapr_set_legacy_hotplug_events, > + NULL); > + object_property_set_description(obj, "legacy-hotplug-events", > + "Use deprecated EPOW mechanism for h= otplug events", > + NULL); > } > =20 > static void spapr_machine_finalizefn(Object *obj) > @@ -2518,6 +2546,9 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", true); > =20 > static void spapr_machine_2_7_instance_options(MachineState *machine) > { > + sPAPRMachineState *spapr =3D SPAPR_MACHINE(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 27a3328..d1a4a14 100644 > --- a/include/hw/ppc/spapr.h > +++ b/include/hw/ppc/spapr.h > @@ -74,6 +74,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 --GBuTPvBEOL0MYPgd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYAGE7AAoJEGw4ysog2bOSF/AQAJa2Fc218LEq4jqSXca7g7Ef eDjnln7W1cE3Uipi6u93nnbLopbVNAU0pPQj3QGWJ1SM3Hman0ojmsa30IVlPX7Z 6FLbxFy455q3VSsGLobxmmdtS8sl9Q7y/v5Goj/JIta5IQu5bsm3ueChPqLdI3v6 PxGqgh8eHKcxPahgygC3Kh/1BOsjVBlR6knJY1xj16Wacq9BR+1nlh2tAL0c0wzg G1Ei+uh5fXtzB57jlxHdQnlSnIxqVxPT8HVcXgqvLHiVTVe2r/NT7jpytYQBflL+ GAS1Csv1bTh+846K6FKmhhtepoKND41LLzhuViw6fZi8ZxuHUZbPWQb8ccQGnEw9 vJBu3R7+3SAuaz2Pknq2Bj4l8zXOEVeSU9qqqEsSj2LQxcc/6Weu6RXJkMEbVN4p rzFzn/s/B6P6M3ip3Rg1EZ+DgytLmcF2ovDjRUMPZm8l9L2D+IZqdDVkE40/C5Yg AH02cgGwJMtlu00Vm9cudEy6QiYBqfw8xfsgP44i8xkmNwEoZ+bpI8QmsCFEjqW+ V1zndFIJA4/G2Is+27AEpanFjsEs22MUP+3Eh+2E36xlW8mEoShusVOaACt3RYAb aFd2AQbtswQEa4tjE4M6aWmQf5YAJsClx8tMe7GlKCFJF3rs4Dz/uUTtcpvhDpB8 hexOpX1A+5Xw0xx98FoY =oz3S -----END PGP SIGNATURE----- --GBuTPvBEOL0MYPgd--