From: Greg Kroah-Hartman Date: Tue, 3 Nov 2020 16:17:53 +0000 (+0100) Subject: update some 5.4 xen patches X-Git-Tag: v4.14.204~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b329e5de79d071f34f51028eb62662377bff3d8a;p=thirdparty%2Fkernel%2Fstable-queue.git update some 5.4 xen patches --- diff --git a/queue-5.4/xen-events-add-a-new-late-eoi-evtchn-framework.patch b/queue-5.4/xen-events-add-a-new-late-eoi-evtchn-framework.patch index f6c630f50ce..db14cd7a792 100644 --- a/queue-5.4/xen-events-add-a-new-late-eoi-evtchn-framework.patch +++ b/queue-5.4/xen-events-add-a-new-late-eoi-evtchn-framework.patch @@ -260,7 +260,7 @@ Signed-off-by: Greg Kroah-Hartman int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id) -@@ -1643,6 +1745,21 @@ static struct irq_chip xen_dynamic_chip +@@ -1642,6 +1744,21 @@ static struct irq_chip xen_dynamic_chip .irq_mask_ack = mask_ack_dynirq, .irq_set_affinity = set_affinity_irq, diff --git a/queue-5.4/xen-events-avoid-removing-an-event-channel-while-handling-it.patch b/queue-5.4/xen-events-avoid-removing-an-event-channel-while-handling-it.patch index a989813aee8..ec664257cba 100644 --- a/queue-5.4/xen-events-avoid-removing-an-event-channel-while-handling-it.patch +++ b/queue-5.4/xen-events-avoid-removing-an-event-channel-while-handling-it.patch @@ -38,9 +38,10 @@ Reviewed-by: Stefano Stabellini Reviewed-by: Wei Liu Signed-off-by: Greg Kroah-Hartman + --- - drivers/xen/events/events_base.c | 41 ++++++++++++++++++++++++++++++++++----- - 1 file changed, 36 insertions(+), 5 deletions(-) + drivers/xen/events/events_base.c | 40 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 35 insertions(+), 5 deletions(-) --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -151,12 +152,11 @@ Signed-off-by: Greg Kroah-Hartman do { vcpu_info->evtchn_upcall_pending = 0; -@@ -1248,6 +1277,8 @@ static void __xen_evtchn_do_upcall(void) - __this_cpu_write(xed_nesting_count, 0); +@@ -1249,6 +1278,7 @@ static void __xen_evtchn_do_upcall(void) } while (count != 1 || vcpu_info->evtchn_upcall_pending); -+ read_unlock(&evtchn_rwlock); -+ out: ++ read_unlock(&evtchn_rwlock); put_cpu(); + } diff --git a/queue-5.4/xen-events-defer-eoi-in-case-of-excessive-number-of-events.patch b/queue-5.4/xen-events-defer-eoi-in-case-of-excessive-number-of-events.patch index d77aad764d1..85bf86eeca2 100644 --- a/queue-5.4/xen-events-defer-eoi-in-case-of-excessive-number-of-events.patch +++ b/queue-5.4/xen-events-defer-eoi-in-case-of-excessive-number-of-events.patch @@ -39,16 +39,16 @@ Signed-off-by: Greg Kroah-Hartman --- Documentation/admin-guide/kernel-parameters.txt | 8 + drivers/xen/events/events_2l.c | 7 - drivers/xen/events/events_base.c | 188 +++++++++++++++++++++++- + drivers/xen/events/events_base.c | 189 +++++++++++++++++++++++- drivers/xen/events/events_fifo.c | 30 +-- drivers/xen/events/events_internal.h | 14 + - 5 files changed, 215 insertions(+), 32 deletions(-) + 5 files changed, 216 insertions(+), 32 deletions(-) --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -5457,6 +5457,14 @@ - improve timer resolution at the expense of processing - more timer interrupts. +@@ -5462,6 +5462,14 @@ + as generic guest with no PV drivers. Currently support + XEN HVM, KVM, HYPER_V and VMWARE guest. + xen.event_eoi_delay= [XEN] + How long to delay EOI handling in case of event @@ -58,9 +58,9 @@ Signed-off-by: Greg Kroah-Hartman + After which time (jiffies) the event handling loop + should start to delay EOI handling. Default is 2. + - nopv= [X86,XEN,KVM,HYPER_V,VMWARE] - Disables the PV optimizations forcing the guest to run - as generic guest with no PV drivers. Currently support + xirc2ps_cs= [NET,PCMCIA] + Format: + ,,,,,[,[,[,]]] --- a/drivers/xen/events/events_2l.c +++ b/drivers/xen/events/events_2l.c @@ -161,7 +161,7 @@ static inline xen_ulong_t active_evtchns @@ -188,14 +188,14 @@ Signed-off-by: Greg Kroah-Hartman evtchn = info->evtchn; - if (!VALID_EVTCHN(evtchn)) + if (!VALID_EVTCHN(evtchn) || !list_empty(&info->eoi_list)) - return; - ++ return; ++ + cpu = info->eoi_cpu; + if (info->eoi_time && info->irq_epoch == per_cpu(irq_epoch, cpu)) { + lateeoi_list_add(info); -+ return; + return; + } -+ + + info->eoi_time = 0; unmask_evtchn(evtchn); } @@ -348,20 +348,21 @@ Signed-off-by: Greg Kroah-Hartman BUG_ON(!irqs_disabled()); -@@ -1383,6 +1554,12 @@ static void __xen_evtchn_do_upcall(void) +@@ -1383,6 +1554,13 @@ static void __xen_evtchn_do_upcall(void) + out: read_unlock(&evtchn_rwlock); - out: + /* + * Increment irq_epoch only now to defer EOIs only for + * xen_irq_lateeoi() invocations occurring from inside the loop + * above. + */ + __this_cpu_inc(irq_epoch); - ++ put_cpu(); } -@@ -1830,9 +2007,6 @@ void xen_callback_vector(void) + +@@ -1829,9 +2007,6 @@ void xen_callback_vector(void) void xen_callback_vector(void) {} #endif @@ -371,7 +372,7 @@ Signed-off-by: Greg Kroah-Hartman static bool fifo_events = true; module_param(fifo_events, bool, 0); -@@ -1840,6 +2014,8 @@ static int xen_evtchn_cpu_prepare(unsign +@@ -1839,6 +2014,8 @@ static int xen_evtchn_cpu_prepare(unsign { int ret = 0; @@ -380,7 +381,7 @@ Signed-off-by: Greg Kroah-Hartman if (evtchn_ops->percpu_init) ret = evtchn_ops->percpu_init(cpu); -@@ -1866,6 +2042,8 @@ void __init xen_init_IRQ(void) +@@ -1865,6 +2042,8 @@ void __init xen_init_IRQ(void) if (ret < 0) xen_evtchn_2l_init(); diff --git a/queue-5.4/xen-events-use-a-common-cpu-hotplug-hook-for-event-channels.patch b/queue-5.4/xen-events-use-a-common-cpu-hotplug-hook-for-event-channels.patch index e4722fc3ff3..9a5572db046 100644 --- a/queue-5.4/xen-events-use-a-common-cpu-hotplug-hook-for-event-channels.patch +++ b/queue-5.4/xen-events-use-a-common-cpu-hotplug-hook-for-event-channels.patch @@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman #ifdef CONFIG_X86 #include -@@ -1835,6 +1836,26 @@ void xen_callback_vector(void) {} +@@ -1834,6 +1835,26 @@ void xen_callback_vector(void) {} static bool fifo_events = true; module_param(fifo_events, bool, 0); @@ -63,7 +63,7 @@ Signed-off-by: Greg Kroah-Hartman void __init xen_init_IRQ(void) { int ret = -EINVAL; -@@ -1845,6 +1866,10 @@ void __init xen_init_IRQ(void) +@@ -1844,6 +1865,10 @@ void __init xen_init_IRQ(void) if (ret < 0) xen_evtchn_2l_init();