From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD42e-0006C9-Pd for qemu-devel@nongnu.org; Sun, 18 Jan 2015 23:34:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YD42a-0007BH-P3 for qemu-devel@nongnu.org; Sun, 18 Jan 2015 23:34:19 -0500 Date: Mon, 19 Jan 2015 15:34:30 +1100 From: David Gibson Message-ID: <20150119043430.GS5297@voom.fritz.box> References: <1419337831-16552-1-git-send-email-mdroth@linux.vnet.ibm.com> <1419337831-16552-10-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IQvoI1rdlCKiYEYW" Content-Disposition: inline In-Reply-To: <1419337831-16552-10-git-send-email-mdroth@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v4 09/17] spapr_events: event-scan RTAS interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, ncmike@ncultra.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, bharata.rao@gmail.com, nfont@linux.vnet.ibm.com --IQvoI1rdlCKiYEYW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 23, 2014 at 06:30:23AM -0600, Michael Roth wrote: > From: Tyrel Datwyler >=20 > We don't actually rely on this interface to surface hotplug events, and > instead rely on the similar-but-interrupt-driven check-exception RTAS > interface used for EPOW events. However, the existence of this interface > is needed to ensure guest kernels initialize the event-reporting > interfaces which will in turn be used by userspace tools to handle these > events, so we implement this interface as a stub. I dislike the idea of implementing a stub only, since if we do fully implement it someday, the guest won't have an easy way of determining if it has a real implementation or the stub. > Signed-off-by: Tyrel Datwyler > Signed-off-by: Michael Roth > --- > hw/ppc/spapr.c | 1 + > hw/ppc/spapr_events.c | 9 +++++++++ > include/hw/ppc/spapr.h | 2 ++ > 3 files changed, 12 insertions(+) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 1bc5773..a611616 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -541,6 +541,7 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base, > refpoints, sizeof(refpoints)))); > =20 > _FDT((fdt_property_cell(fdt, "rtas-error-log-max", RTAS_ERROR_LOG_MA= X))); > + _FDT((fdt_property_cell(fdt, "rtas-event-scan-rate", RTAS_EVENT_SCAN= _RATE))); It'd be nice if a comment or the commit message described the units of this property. > /* > * According to PAPR, rtas ibm,os-term does not guarantee a return > diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c > index ebbf3a4..434a75d 100644 > --- a/hw/ppc/spapr_events.c > +++ b/hw/ppc/spapr_events.c > @@ -445,6 +445,14 @@ static void check_exception(PowerPCCPU *cpu, sPAPREn= vironment *spapr, > } > } > =20 > +static void event_scan(PowerPCCPU *cpu, sPAPREnvironment *spapr, > + uint32_t token, uint32_t nargs, > + target_ulong args, > + uint32_t nret, target_ulong rets) > +{ You should at least validate nargs and nret. > + rtas_st(rets, 0, 1); /* no error events found */ > +} > + > void spapr_events_init(sPAPREnvironment *spapr) > { > spapr->check_exception_irq =3D xics_alloc(spapr->icp, 0, 0, false); > @@ -452,4 +460,5 @@ void spapr_events_init(sPAPREnvironment *spapr) > qemu_register_powerdown_notifier(&spapr->epow_notifier); > spapr_rtas_register(RTAS_CHECK_EXCEPTION, "check-exception", > check_exception); > + spapr_rtas_register(RTAS_EVENT_SCAN, "event-scan", event_scan); > } > diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h > index 4d50e74..973193d 100644 > --- a/include/hw/ppc/spapr.h > +++ b/include/hw/ppc/spapr.h > @@ -453,6 +453,8 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rt= as_addr, > =20 > #define RTAS_ERROR_LOG_MAX 2048 > =20 > +#define RTAS_EVENT_SCAN_RATE 1 > + > typedef struct sPAPRTCETable sPAPRTCETable; > =20 > #define TYPE_SPAPR_TCE_TABLE "spapr-tce-table" --=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 --IQvoI1rdlCKiYEYW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUvIlWAAoJEGw4ysog2bOS6RAP/AwU/jUDF3VfExdqP11V8sAC yS8B4QIyDlm+z4hWSBHMhRMgckU84ihVyI2oaPf3bsw/VFp4ikZFI6qde1Z3e7PO /3YNRsBIB+IAAoLrIrR6G/qINzMebd5b6qd4AHK5D8PO77EyD5L6CXFuT9fHGJry RTrH/E27fo2hXn1UfRhZ2X7JTZI8LVEIFnpVNUslnXVJs26E29x61RTkvveaVqIJ UJJ7Gho/dKh0RIiMF1Pv0KZix0IVxBzRb6IffgXQs5/FbHTG3Ql3G0rwvE/WgmbD SYvc92u7iFd5dCVyf7pTja54ak2ZmIP47QJ47XTVvGxW4D0sZq/dUMSvBQ1vPFgo 8oY6ZsGPJsdxzlKg4R4QOfjk3tBh0/6FL6yMjY7K53dF5fVVS+ApDmJwfB/yg1d5 lbXVHy05LjJwMprVExTvp/HaI5ohPUXiQjmQmk4O8cCc+WE8Us3axg1adWtKvXem zxCBgAo7reh0gxtWu3Pmy/UrAwWtH261Fx+LyR6kGl2oe1zBLezqJPqaTLZFuulW MtiV6sN0uSwWkC6W3L18JjUIx8tlo5jfem8VIzumOK7K3mipp1H7b7wMB9o5KASU QTxxzRrc2Ax9yBOjQKpsmB6+Tm0N3FFkwscHHPWLJwcz8YnRniK2If6f23PJrCLS VnG7tSMohz7WitXBKBAB =eCYa -----END PGP SIGNATURE----- --IQvoI1rdlCKiYEYW--