From: Jan Beulich Date: Mon, 9 Jul 2018 08:51:33 +0000 (+0200) Subject: x86: reduce IRQs disabled section in flush_area_local() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3663 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8b77e779caa4b03961dc56abb1079fa6d77c60b9;p=xen.git x86: reduce IRQs disabled section in flush_area_local() Only the pre_flush() / post_flush() section actually needs to run with interrupts disabled. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c index 797c5d52cc..0d550f9e93 100644 --- a/xen/arch/x86/flushtlb.c +++ b/xen/arch/x86/flushtlb.c @@ -76,7 +76,13 @@ static void post_flush(u32 t) static void do_tlb_flush(void) { - u32 t = pre_flush(); + unsigned long flags; + u32 t; + + /* This non-reentrant function is sometimes called in interrupt context. */ + local_irq_save(flags); + + t = pre_flush(); if ( use_invpcid ) invpcid_flush_all(); @@ -89,6 +95,8 @@ static void do_tlb_flush(void) } post_flush(t); + + local_irq_restore(flags); } void switch_cr3_cr4(unsigned long cr3, unsigned long cr4) @@ -147,10 +155,6 @@ void switch_cr3_cr4(unsigned long cr3, unsigned long cr4) unsigned int flush_area_local(const void *va, unsigned int flags) { unsigned int order = (flags - 1) & FLUSH_ORDER_MASK; - unsigned long irqfl; - - /* This non-reentrant function is sometimes called in interrupt context. */ - local_irq_save(irqfl); if ( flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL) ) { @@ -218,8 +222,6 @@ unsigned int flush_area_local(const void *va, unsigned int flags) } } - local_irq_restore(irqfl); - if ( flags & FLUSH_ROOT_PGTBL ) get_cpu_info()->root_pgt_changed = true;