From 24e68cb0bca57d6c8b64064661a653be73c0253b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 26 Feb 2002 18:08:54 +0000 Subject: [PATCH] Make peter's commit compatible with interrupt-enabled critical_enter() and exit(), which has already solved the problem in regards to deadlocked IPI's. --- sys/amd64/amd64/pmap.c | 4 ++-- sys/i386/i386/pmap.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index ba3ee22c27d9..8dfacaaa9e0c 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -575,7 +575,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) * interrupts disabled here. * XXX we may need to hold schedlock to get a coherent pm_active */ - if (td->td_critnest == 1) + if (td->td_critnest == 1 && td->td_savecrit != (critical_t)-1) cpu_critical_exit(td->td_savecrit); if (pmap->pm_active == -1 || pmap->pm_active == all_cpus) { invlpg(va); /* global */ @@ -609,7 +609,7 @@ pmap_invalidate_all(pmap_t pmap) * interrupts disabled here. * XXX we may need to hold schedlock to get a coherent pm_active */ - if (td->td_critnest == 1) + if (td->td_critnest == 1 && td->td_savecrit != (critical_t)-1) cpu_critical_exit(td->td_savecrit); if (pmap->pm_active == -1 || pmap->pm_active == all_cpus) { invltlb(); /* global */ diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index ba3ee22c27d9..8dfacaaa9e0c 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -575,7 +575,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) * interrupts disabled here. * XXX we may need to hold schedlock to get a coherent pm_active */ - if (td->td_critnest == 1) + if (td->td_critnest == 1 && td->td_savecrit != (critical_t)-1) cpu_critical_exit(td->td_savecrit); if (pmap->pm_active == -1 || pmap->pm_active == all_cpus) { invlpg(va); /* global */ @@ -609,7 +609,7 @@ pmap_invalidate_all(pmap_t pmap) * interrupts disabled here. * XXX we may need to hold schedlock to get a coherent pm_active */ - if (td->td_critnest == 1) + if (td->td_critnest == 1 && td->td_savecrit != (critical_t)-1) cpu_critical_exit(td->td_savecrit); if (pmap->pm_active == -1 || pmap->pm_active == all_cpus) { invltlb(); /* global */