ipipe: Protect ioremap_page_range also against IRQ usage by APEI
PATCH 1/1 ipipe: Protect ioremap_page_range also against IRQ usage by APEI
Commit 261a3fdbae added a check to prevent NMI invocation of the range pinning function. But APEI may also call ioremap_page_range from timer IRQ context. Therefore we need to extend the check.
This addresses lockups seen on long-running systems with APEI GHES enabled.
---
Jeroen, Niels, this should truly and safely fix the issue. Please give it a try!
lib/ioremap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/ioremap.c +2 -2
@@ -88,9 +88,9 @@ int ioremap_page_range(unsigned long addr,break ; }while (pgd++, addr = next, addr != end); -/* APEI may invoke this for temporarily remapping pages in NMI +/* APEI may invoke this for temporarily remapping pages in IRQ or NMI * context - nothing we can and need to propagate globally. */ -if (!in_nmi ()) { +if (!(in_irq () ||in_nmi ())) {__ipipe_pin_range_globally (start, end);flush_cache_vmap (start, end); }
Signature · 1 line
2.1.4
Jan,
Quoted 2 lines
Jeroen, Niels, this should truly and safely fix the issue. Please give it a try!
I've been away for a couple of days. The moment the crash I reported occurred was right before I left so I didn't have time to look into it myself at all. But looking at what you found to (hopefully) fix it, I doubt I could have contributed much...
Anyway, the test rig is now running the patch with nothing else changed (CONFIG_ACPI_APEI_GHES=y; APEI can't be disabled in BIOS). We'll let it sit for a week.
Thanks,
Jeroen.
Quoted 22 lines
lib/ioremap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/ioremap.c +2
-3@@ -88,9 +88,9 @@ int ioremap_page_range(unsigned long addr,break ; }while (pgd++, addr = next, addr != end); -/* APEI may invoke this for temporarily remapping pages in NMI +/* APEI may invoke this for temporarily remapping pages in IRQ or NMI * context - nothing we can and need to propagate globally. */ -if (!in_nmi ()) { +if (!(in_irq () ||in_nmi ())) {__ipipe_pin_range_globally (start, end);flush_cache_vmap (start, end); } --2.1.4