Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138794
b: refs/heads/master
c: ce4e240
h: refs/heads/master
v: v3
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Mar 18, 2009
1 parent 9691858 commit 86e52e3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa4b57cc045d6134b9862b2873f9c8ba9ed53ffe
refs/heads/master: ce4e240c279a31096f74afa6584a62d64a1ba8c8
10 changes: 10 additions & 0 deletions trunk/arch/x86/include/asm/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ extern void native_apic_icr_write(u32 low, u32 id);
extern u64 native_apic_icr_read(void);

#ifdef CONFIG_X86_X2APIC
/*
* Make previous memory operations globally visible before
* sending the IPI through x2apic wrmsr. We need a serializing instruction or
* mfence for this.
*/
static inline void x2apic_wrmsr_fence(void)
{
asm volatile("mfence" : : : "memory");
}

static inline void native_apic_msr_write(u32 reg, u32 v)
{
if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kernel/apic/x2apic_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
unsigned long query_cpu;
unsigned long flags;

x2apic_wrmsr_fence();

local_irq_save(flags);
for_each_cpu(query_cpu, mask) {
__x2apic_send_IPI_dest(
Expand All @@ -73,6 +75,8 @@ static void
unsigned long query_cpu;
unsigned long flags;

x2apic_wrmsr_fence();

local_irq_save(flags);
for_each_cpu(query_cpu, mask) {
if (query_cpu == this_cpu)
Expand All @@ -90,6 +94,8 @@ static void x2apic_send_IPI_allbutself(int vector)
unsigned long query_cpu;
unsigned long flags;

x2apic_wrmsr_fence();

local_irq_save(flags);
for_each_online_cpu(query_cpu) {
if (query_cpu == this_cpu)
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kernel/apic/x2apic_phys.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
unsigned long query_cpu;
unsigned long flags;

x2apic_wrmsr_fence();

local_irq_save(flags);
for_each_cpu(query_cpu, mask) {
__x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu),
Expand All @@ -73,6 +75,8 @@ static void
unsigned long query_cpu;
unsigned long flags;

x2apic_wrmsr_fence();

local_irq_save(flags);
for_each_cpu(query_cpu, mask) {
if (query_cpu != this_cpu)
Expand All @@ -89,6 +93,8 @@ static void x2apic_send_IPI_allbutself(int vector)
unsigned long query_cpu;
unsigned long flags;

x2apic_wrmsr_fence();

local_irq_save(flags);
for_each_online_cpu(query_cpu) {
if (query_cpu == this_cpu)
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/x86/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
cpumask_andnot(to_cpumask(f->flush_cpumask),
cpumask, cpumask_of(smp_processor_id()));

/*
* Make the above memory operations globally visible before
* sending the IPI.
*/
smp_mb();
/*
* We have to send the IPI only to
* CPUs affected.
Expand Down

0 comments on commit 86e52e3

Please sign in to comment.