[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v4 09/17] spapr_events: event-scan RTAS interface
From: |
Michael Roth |
Subject: |
[Qemu-ppc] [PATCH v4 09/17] spapr_events: event-scan RTAS interface |
Date: |
Tue, 23 Dec 2014 06:30:23 -0600 |
From: Tyrel Datwyler <address@hidden>
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 <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
---
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 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))));
_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)));
/*
* 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,
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 */
+}
+
void spapr_events_init(sPAPREnvironment *spapr)
{
spapr->check_exception_irq = 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
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"
--
1.9.1
- [Qemu-ppc] [PATCH v4 00/17] spapr: add support for pci hotplug, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 01/17] docs: add sPAPR hotplug/dynamic-reconfiguration documentation, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 04/17] spapr_rtas: add set-indicator RTAS interface, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 05/17] spapr_rtas: add get-sensor-state RTAS interface, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 03/17] spapr_rtas: add get/set-power-level RTAS interfaces, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 06/17] spapr: add rtas_st_buffer_direct() helper, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 02/17] spapr_drc: initial implementation of sPAPRDRConnector device, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 07/17] spapr_rtas: add ibm, configure-connector RTAS interface, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 08/17] spapr_events: re-use EPOW event infrastructure for hotplug events, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 09/17] spapr_events: event-scan RTAS interface,
Michael Roth <=
- [Qemu-ppc] [PATCH v4 11/17] spapr: introduce pseries-2.3 machine type, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 10/17] spapr_drc: add spapr_drc_populate_dt(), Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 12/17] spapr_pci: add dynamic-reconfiguration option for spapr-pci-host-bridge, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 13/17] spapr_pci: create DRConnectors for each PCI slot during PHB realize, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 14/17] spapr_pci: populate DRC dt entries for PHBs, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 16/17] spapr_pci: enable basic hotplug operations, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 15/17] pci: make pci_bar useable outside pci.c, Michael Roth, 2014/12/23
- [Qemu-ppc] [PATCH v4 17/17] spapr_pci: emit hotplug add/remove events during hotplug, Michael Roth, 2014/12/23