aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-05-19 14:21:21 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-05-19 14:21:21 +0000
commit4cba4fc75cb2bdd67fe5ddc71248ba741dee1911 (patch)
treec5eb9e6c96039a7061c3d545c9359f4aebd1f4fb /xen
parent74a3bae43b0d35ffbed59f01dbedb2079aab488a (diff)
downloadxen-4cba4fc75cb2bdd67fe5ddc71248ba741dee1911.tar.gz
xen-4cba4fc75cb2bdd67fe5ddc71248ba741dee1911.tar.bz2
xen-4cba4fc75cb2bdd67fe5ddc71248ba741dee1911.zip
bitkeeper revision 1.914 (40ab6d61x-o8a0EkAPFPNgH58cGauQ)
More TLB flush fixes.
Diffstat (limited to 'xen')
-rw-r--r--xen/arch/i386/flushtlb.c3
-rw-r--r--xen/arch/i386/setup.c4
-rw-r--r--xen/arch/i386/smp.c8
-rw-r--r--xen/common/softirq.c2
-rw-r--r--xen/include/xen/interrupt.h3
5 files changed, 14 insertions, 6 deletions
diff --git a/xen/arch/i386/flushtlb.c b/xen/arch/i386/flushtlb.c
index 8712682d36..c53f52161c 100644
--- a/xen/arch/i386/flushtlb.c
+++ b/xen/arch/i386/flushtlb.c
@@ -9,6 +9,7 @@
#include <xen/config.h>
#include <xen/sched.h>
+#include <xen/interrupt.h>
#include <asm/flushtlb.h>
u32 tlbflush_clock;
@@ -24,7 +25,7 @@ void tlb_clocktick(void)
#ifdef CONFIG_SMP
if ( unlikely(((y = ny+1) & TLBCLOCK_EPOCH_MASK) == 0) )
{
- new_tlbflush_clock_period();
+ raise_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ);
y = tlbflush_clock;
break;
}
diff --git a/xen/arch/i386/setup.c b/xen/arch/i386/setup.c
index 06193aeb6b..1772a7afc4 100644
--- a/xen/arch/i386/setup.c
+++ b/xen/arch/i386/setup.c
@@ -345,6 +345,10 @@ void __init start_of_day(void)
memguard_guard_range(cpu0_stack, PAGE_SIZE);
#endif
+ open_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ,
+ (void *)new_tlbflush_clock_period,
+ NULL);
+
if ( opt_watchdog )
nmi_watchdog = NMI_LOCAL_APIC;
diff --git a/xen/arch/i386/smp.c b/xen/arch/i386/smp.c
index 363d61626e..e79385c278 100644
--- a/xen/arch/i386/smp.c
+++ b/xen/arch/i386/smp.c
@@ -288,11 +288,13 @@ void flush_tlb_mask(unsigned long mask)
}
}
+/*
+ * NB. Must be called with no locks held and interrupts enabled.
+ * (e.g., softirq context).
+ */
void new_tlbflush_clock_period(void)
{
- /* Avoid deadlock because we might be reentering a flush_lock region. */
- if ( unlikely(!spin_trylock(&flush_lock)) )
- return;
+ spin_lock(&flush_lock);
/* Someone may acquire the lock and execute the flush before us. */
if ( ((tlbflush_clock+1) & TLBCLOCK_EPOCH_MASK) != 0 )
diff --git a/xen/common/softirq.c b/xen/common/softirq.c
index d400406239..3924fbf56e 100644
--- a/xen/common/softirq.c
+++ b/xen/common/softirq.c
@@ -61,7 +61,7 @@ inline void cpu_raise_softirq(unsigned int cpu, unsigned int nr)
void raise_softirq(unsigned int nr)
{
- cpu_raise_softirq(smp_processor_id(), nr);
+ __cpu_raise_softirq(smp_processor_id(), nr);
}
void open_softirq(int nr, void (*action)(struct softirq_action*), void *data)
diff --git a/xen/include/xen/interrupt.h b/xen/include/xen/interrupt.h
index a55e70269f..884c14d13a 100644
--- a/xen/include/xen/interrupt.h
+++ b/xen/include/xen/interrupt.h
@@ -42,7 +42,8 @@ enum
AC_TIMER_SOFTIRQ,
TASKLET_SOFTIRQ,
BLKDEV_RESPONSE_SOFTIRQ,
- NET_TX_SOFTIRQ
+ NET_TX_SOFTIRQ,
+ NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ
};
/* softirq mask and active fields moved to irq_cpustat_t in