From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsQFv-0003Ol-0H for qemu-devel@nongnu.org; Sun, 15 Dec 2013 23:58:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsQFm-0006uV-9f for qemu-devel@nongnu.org; Sun, 15 Dec 2013 23:58:10 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:37290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsQFm-0006uH-3q for qemu-devel@nongnu.org; Sun, 15 Dec 2013 23:58:02 -0500 Received: by mail-pb0-f46.google.com with SMTP id md12so4922148pbc.5 for ; Sun, 15 Dec 2013 20:58:01 -0800 (PST) Message-ID: <52AE8851.30504@ozlabs.ru> Date: Mon, 16 Dec 2013 15:57:53 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1386282785-466-1-git-send-email-mdroth@linux.vnet.ibm.com> <1386282785-466-14-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1386282785-466-14-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 13/14] spapr_events: event-scan RTAS interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth , qemu-devel@nongnu.org Cc: agraf@suse.de, ncmike@ncultra.org, paulus@samba.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, qemu-ppc@nongnu.org On 12/06/2013 09:33 AM, Michael Roth wrote: > From: Tyrel Datwyler > > 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. > > 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(+) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 7079e4e..e7a249b 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -643,6 +643,7 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base, > refpoints, sizeof(refpoints)))); > > _FDT((fdt_property_cell(fdt, "rtas-error-log-max", RTAS_ERROR_LOG_MAX))); > + _FDT((fdt_property_cell(fdt, "rtas-event-scan-rate", RTAS_EVENT_SCAN_RATE))); > > _FDT((fdt_end_node(fdt))); > > diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c > index 9dfdbcf..69211c5 100644 > --- a/hw/ppc/spapr_events.c > +++ b/hw/ppc/spapr_events.c > @@ -453,10 +453,19 @@ static void check_exception(PowerPCCPU *cpu, sPAPREnvironment *spapr, > } > } > > +static void event_scan(PowerPCCPU *cpu, sPAPREnvironment *spapr, > + uint32_t token, uint32_t nargs, > + target_ulong args, > + uint32_t nret, target_ulong rets) > +{ > + rtas_st(rets, 0, 1); /* no error events found */ s/1/RTAS_OUT_NO_ERRORS_FOUND/ ? > +} > + > void spapr_events_init(sPAPREnvironment *spapr) > { > spapr->check_exception_irq = spapr_allocate_msi(0); > spapr->epow_notifier.notify = spapr_powerdown_req; > qemu_register_powerdown_notifier(&spapr->epow_notifier); > spapr_rtas_register("check-exception", check_exception); > + spapr_rtas_register("event-scan", event_scan); > } > diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h > index 9eef2ce..293375b 100644 > --- a/include/hw/ppc/spapr.h > +++ b/include/hw/ppc/spapr.h > @@ -445,6 +445,8 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, > > #define RTAS_ERROR_LOG_MAX 2048 > > +#define RTAS_EVENT_SCAN_RATE 1 > + > typedef struct sPAPRTCETable sPAPRTCETable; > > #define TYPE_SPAPR_TCE_TABLE "spapr-tce-table" > -- Alexey