[SRU][jammy/linux-aws][kinetic/linux-aws][PATCH 13/20] UBUNTU: SAUCE: Revert "xen: dont fiddle with event channel masking in suspend/resume"
Gerald Yang
gerald.yang at canonical.com
Wed Aug 17 08:51:42 UTC 2022
From: Anchal Agarwal <anchalag at amazon.com>
BugLink: https://bugs.launchpad.net/bugs/1968062
This reverts commit e91b2b1194335ca83d8a40fa4e0efd480bf2babe.
evtchn are supposed to be masked during resume however they are not
which causes special interrupts like PV spinlock to cause kernel
BUG() as its expects the IRQ to be masked. This causes instances
that are live migrated successfully to crash after few minutes.
Signed-off--by: Anchal Agarwal <anchalag at amazon.com>
Signed-off--by: Eduardo Valentin <eduval at amazon.com>
Reviewed-by: Frank van der Linden <fllinden at amazon.com>
Reviewed-by: Alakesh Haloi <alakeshh at amazon.com>
Reviewed-by: Vallish Vaidyeshwara <vallish at amazon.com>
CR: https://cr.amazon.com/r/8361544/
(cherry picked from commit 79435eaffd1695c8379e70e2f41ee41e4ad84ba9 amazon-5.15.y/mainline)
Signed-off-by: Gerald Yang <gerald.yang at canonical.com>
Signed-off-by: Matthew Ruffell <matthew.ruffell at canonical.com>
---
drivers/xen/events/events_base.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 36c683aee9d4..5883320002d0 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -540,6 +540,14 @@ static void bind_evtchn_to_cpu(evtchn_port_t evtchn, unsigned int cpu,
channels_on_cpu_inc(info);
}
+static void xen_evtchn_mask_all(void)
+{
+ evtchn_port_t evtchn;
+
+ for (evtchn = 0; evtchn < xen_evtchn_nr_channels(); evtchn++)
+ mask_evtchn(evtchn);
+}
+
/**
* notify_remote_via_irq - send event to remote end of event channel via irq
* @irq: irq of event channel to send event to
@@ -2104,6 +2112,7 @@ void xen_irq_resume(void)
struct irq_info *info;
/* New event-channel space is not 'live' yet. */
+ xen_evtchn_mask_all();
xen_evtchn_resume();
/* No IRQ <-> event-channel mappings. */
@@ -2253,7 +2262,6 @@ static int xen_evtchn_cpu_dead(unsigned int cpu)
void __init xen_init_IRQ(void)
{
int ret = -EINVAL;
- evtchn_port_t evtchn;
if (xen_fifo_events)
ret = xen_evtchn_fifo_init();
@@ -2273,8 +2281,7 @@ void __init xen_init_IRQ(void)
BUG_ON(!evtchn_to_irq);
/* No event channels are 'live' right now. */
- for (evtchn = 0; evtchn < xen_evtchn_nr_channels(); evtchn++)
- mask_evtchn(evtchn);
+ xen_evtchn_mask_all();
pirq_needs_eoi = pirq_needs_eoi_flag;
--
2.34.1
More information about the kernel-team
mailing list