[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/18] ppc/spapr: re-assert IRQs during event-scan if there are pe
From: |
David Gibson |
Subject: |
[PULL 02/18] ppc/spapr: re-assert IRQs during event-scan if there are pending |
Date: |
Wed, 28 Oct 2020 01:17:19 +1100 |
From: Laurent Vivier <lvivier@redhat.com>
If we hotplug a CPU during the first second of the kernel boot,
the IRQ can be sent to the kernel while the RTAS event handler
is not installed. The event is queued, but the kernel doesn't
collect it and ignores the new CPU.
As the code relies on edge-triggered IRQ, we can re-assert it
during the event-scan RTAS call if there are still pending
events (as it is already done in check-exception).
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20201015210318.117386-1-lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr_events.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 1069d0197b..1add53547e 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -1000,10 +1000,22 @@ static void event_scan(PowerPCCPU *cpu,
SpaprMachineState *spapr,
target_ulong args,
uint32_t nret, target_ulong rets)
{
+ int i;
if (nargs != 4 || nret != 1) {
rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR);
return;
}
+
+ for (i = 0; i < EVENT_CLASS_MAX; i++) {
+ if (rtas_event_log_contains(EVENT_CLASS_MASK(i))) {
+ const SpaprEventSource *source =
+ spapr_event_sources_get_source(spapr->event_sources, i);
+
+ g_assert(source->enabled);
+ qemu_irq_pulse(spapr_qirq(spapr, source->irq));
+ }
+ }
+
rtas_st(rets, 0, RTAS_OUT_NO_ERRORS_FOUND);
}
--
2.26.2
- [PULL 00/18] ppc-for-5.2 queue 20201028, David Gibson, 2020/10/27
- [PULL 01/18] spapr: Clarify why DR connectors aren't user creatable, David Gibson, 2020/10/27
- [PULL 02/18] ppc/spapr: re-assert IRQs during event-scan if there are pending,
David Gibson <=
- [PULL 03/18] hw/net: move allocation to the heap due to very large stack frame, David Gibson, 2020/10/27
- [PULL 04/18] spapr: Move spapr_create_nvdimm_dr_connectors() to core machine code, David Gibson, 2020/10/27
- [PULL 07/18] spapr: Drop spapr_delete_vcpu() unused argument, David Gibson, 2020/10/27
- [PULL 06/18] spapr: Unrealize vCPUs with qdev_unrealize(), David Gibson, 2020/10/27
- [PULL 08/18] spapr: Make spapr_cpu_core_unrealize() idempotent, David Gibson, 2020/10/27
- [PULL 13/18] spapr: Pass &error_abort when getting some PC DIMM properties, David Gibson, 2020/10/27
- [PULL 09/18] spapr: Simplify spapr_cpu_core_realize() and spapr_cpu_core_unrealize(), David Gibson, 2020/10/27
- [PULL 11/18] spapr: Use appropriate getter for PC_DIMM_ADDR_PROP, David Gibson, 2020/10/27
- [PULL 14/18] spapr: Simplify error handling in spapr_memory_plug(), David Gibson, 2020/10/27
- [PULL 05/18] spapr: Fix leak of CPU machine specific data, David Gibson, 2020/10/27