aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@intel.com>2012-01-13 10:53:35 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-01-24 12:20:24 -0500
commit2113f4691663f033189bf43d7501c6d29cd685a5 (patch)
tree6e0ecc6096fd174470e41e7d08fdee925f79964d
parentcd9db80e5257682a7f7ab245a2459648b3c8d268 (diff)
xen: use this_cpu_xxx replace percpu_xxx funcs
percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace them for further code clean up. I don't know much of xen code. But, since the code is in x86 architecture, the percpu_xxx is exactly same as this_cpu_xxx serials functions. So, the change is safe. Signed-off-by: Alex Shi <alex.shi@intel.com> Acked-by: Christoph Lameter <cl@gentwo.org> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r--arch/x86/xen/enlighten.c6
-rw-r--r--arch/x86/xen/irq.c8
-rw-r--r--arch/x86/xen/mmu.c20
-rw-r--r--arch/x86/xen/multicalls.h2
-rw-r--r--arch/x86/xen/smp.c2
5 files changed, 19 insertions, 19 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 12eb07bfb267..312c9e3cb635 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -777,11 +777,11 @@ static DEFINE_PER_CPU(unsigned long, xen_cr0_value);
777 777
778static unsigned long xen_read_cr0(void) 778static unsigned long xen_read_cr0(void)
779{ 779{
780 unsigned long cr0 = percpu_read(xen_cr0_value); 780 unsigned long cr0 = this_cpu_read(xen_cr0_value);
781 781
782 if (unlikely(cr0 == 0)) { 782 if (unlikely(cr0 == 0)) {
783 cr0 = native_read_cr0(); 783 cr0 = native_read_cr0();
784 percpu_write(xen_cr0_value, cr0); 784 this_cpu_write(xen_cr0_value, cr0);
785 } 785 }
786 786
787 return cr0; 787 return cr0;
@@ -791,7 +791,7 @@ static void xen_write_cr0(unsigned long cr0)
791{ 791{
792 struct multicall_space mcs; 792 struct multicall_space mcs;
793 793
794 percpu_write(xen_cr0_value, cr0); 794 this_cpu_write(xen_cr0_value, cr0);
795 795
796 /* Only pay attention to cr0.TS; everything else is 796 /* Only pay attention to cr0.TS; everything else is
797 ignored. */ 797 ignored. */
diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c
index 8bbb465b6f0a..157337657971 100644
--- a/arch/x86/xen/irq.c
+++ b/arch/x86/xen/irq.c
@@ -26,7 +26,7 @@ static unsigned long xen_save_fl(void)
26 struct vcpu_info *vcpu; 26 struct vcpu_info *vcpu;
27 unsigned long flags; 27 unsigned long flags;
28 28
29 vcpu = percpu_read(xen_vcpu); 29 vcpu = this_cpu_read(xen_vcpu);
30 30
31 /* flag has opposite sense of mask */ 31 /* flag has opposite sense of mask */
32 flags = !vcpu->evtchn_upcall_mask; 32 flags = !vcpu->evtchn_upcall_mask;
@@ -50,7 +50,7 @@ static void xen_restore_fl(unsigned long flags)
50 make sure we're don't switch CPUs between getting the vcpu 50 make sure we're don't switch CPUs between getting the vcpu
51 pointer and updating the mask. */ 51 pointer and updating the mask. */
52 preempt_disable(); 52 preempt_disable();
53 vcpu = percpu_read(xen_vcpu); 53 vcpu = this_cpu_read(xen_vcpu);
54 vcpu->evtchn_upcall_mask = flags; 54 vcpu->evtchn_upcall_mask = flags;
55 preempt_enable_no_resched(); 55 preempt_enable_no_resched();
56 56
@@ -72,7 +72,7 @@ static void xen_irq_disable(void)
72 make sure we're don't switch CPUs between getting the vcpu 72 make sure we're don't switch CPUs between getting the vcpu
73 pointer and updating the mask. */ 73 pointer and updating the mask. */
74 preempt_disable(); 74 preempt_disable();
75 percpu_read(xen_vcpu)->evtchn_upcall_mask = 1; 75 this_cpu_read(xen_vcpu)->evtchn_upcall_mask = 1;
76 preempt_enable_no_resched(); 76 preempt_enable_no_resched();
77} 77}
78PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable); 78PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable);
@@ -86,7 +86,7 @@ static void xen_irq_enable(void)
86 the caller is confused and is trying to re-enable interrupts 86 the caller is confused and is trying to re-enable interrupts
87 on an indeterminate processor. */ 87 on an indeterminate processor. */
88 88
89 vcpu = percpu_read(xen_vcpu); 89 vcpu = this_cpu_read(xen_vcpu);
90 vcpu->evtchn_upcall_mask = 0; 90 vcpu->evtchn_upcall_mask = 0;
91 91
92 /* Doesn't matter if we get preempted here, because any 92 /* Doesn't matter if we get preempted here, because any
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 58a0e46c404d..1a309ee2331e 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1071,14 +1071,14 @@ static void drop_other_mm_ref(void *info)
1071 struct mm_struct *mm = info; 1071 struct mm_struct *mm = info;
1072 struct mm_struct *active_mm; 1072 struct mm_struct *active_mm;
1073 1073
1074 active_mm = percpu_read(cpu_tlbstate.active_mm); 1074 active_mm = this_cpu_read(cpu_tlbstate.active_mm);
1075 1075
1076 if (active_mm == mm && percpu_read(cpu_tlbstate.state) != TLBSTATE_OK) 1076 if (active_mm == mm && this_cpu_read(cpu_tlbstate.state) != TLBSTATE_OK)
1077 leave_mm(smp_processor_id()); 1077 leave_mm(smp_processor_id());
1078 1078
1079 /* If this cpu still has a stale cr3 reference, then make sure 1079 /* If this cpu still has a stale cr3 reference, then make sure
1080 it has been flushed. */ 1080 it has been flushed. */
1081 if (percpu_read(xen_current_cr3) == __pa(mm->pgd)) 1081 if (this_cpu_read(xen_current_cr3) == __pa(mm->pgd))
1082 load_cr3(swapper_pg_dir); 1082 load_cr3(swapper_pg_dir);
1083} 1083}
1084 1084
@@ -1185,17 +1185,17 @@ static void __init xen_pagetable_setup_done(pgd_t *base)
1185 1185
1186static void xen_write_cr2(unsigned long cr2) 1186static void xen_write_cr2(unsigned long cr2)
1187{ 1187{
1188 percpu_read(xen_vcpu)->arch.cr2 = cr2; 1188 this_cpu_read(xen_vcpu)->arch.cr2 = cr2;
1189} 1189}
1190 1190
1191static unsigned long xen_read_cr2(void) 1191static unsigned long xen_read_cr2(void)
1192{ 1192{
1193 return percpu_read(xen_vcpu)->arch.cr2; 1193 return this_cpu_read(xen_vcpu)->arch.cr2;
1194} 1194}
1195 1195
1196unsigned long xen_read_cr2_direct(void) 1196unsigned long xen_read_cr2_direct(void)
1197{ 1197{
1198 return percpu_read(xen_vcpu_info.arch.cr2); 1198 return this_cpu_read(xen_vcpu_info.arch.cr2);
1199} 1199}
1200 1200
1201static void xen_flush_tlb(void) 1201static void xen_flush_tlb(void)
@@ -1278,12 +1278,12 @@ static void xen_flush_tlb_others(const struct cpumask *cpus,
1278 1278
1279static unsigned long xen_read_cr3(void) 1279static unsigned long xen_read_cr3(void)
1280{ 1280{
1281 return percpu_read(xen_cr3); 1281 return this_cpu_read(xen_cr3);
1282} 1282}
1283 1283
1284static void set_current_cr3(void *v) 1284static void set_current_cr3(void *v)
1285{ 1285{
1286 percpu_write(xen_current_cr3, (unsigned long)v); 1286 this_cpu_write(xen_current_cr3, (unsigned long)v);
1287} 1287}
1288 1288
1289static void __xen_write_cr3(bool kernel, unsigned long cr3) 1289static void __xen_write_cr3(bool kernel, unsigned long cr3)
@@ -1306,7 +1306,7 @@ static void __xen_write_cr3(bool kernel, unsigned long cr3)
1306 xen_extend_mmuext_op(&op); 1306 xen_extend_mmuext_op(&op);
1307 1307
1308 if (kernel) { 1308 if (kernel) {
1309 percpu_write(xen_cr3, cr3); 1309 this_cpu_write(xen_cr3, cr3);
1310 1310
1311 /* Update xen_current_cr3 once the batch has actually 1311 /* Update xen_current_cr3 once the batch has actually
1312 been submitted. */ 1312 been submitted. */
@@ -1322,7 +1322,7 @@ static void xen_write_cr3(unsigned long cr3)
1322 1322
1323 /* Update while interrupts are disabled, so its atomic with 1323 /* Update while interrupts are disabled, so its atomic with
1324 respect to ipis */ 1324 respect to ipis */
1325 percpu_write(xen_cr3, cr3); 1325 this_cpu_write(xen_cr3, cr3);
1326 1326
1327 __xen_write_cr3(true, cr3); 1327 __xen_write_cr3(true, cr3);
1328 1328
diff --git a/arch/x86/xen/multicalls.h b/arch/x86/xen/multicalls.h
index dee79b78a90f..9c2e74f9096c 100644
--- a/arch/x86/xen/multicalls.h
+++ b/arch/x86/xen/multicalls.h
@@ -47,7 +47,7 @@ static inline void xen_mc_issue(unsigned mode)
47 xen_mc_flush(); 47 xen_mc_flush();
48 48
49 /* restore flags saved in xen_mc_batch */ 49 /* restore flags saved in xen_mc_batch */
50 local_irq_restore(percpu_read(xen_mc_irq_flags)); 50 local_irq_restore(this_cpu_read(xen_mc_irq_flags));
51} 51}
52 52
53/* Set up a callback to be called when the current batch is flushed */ 53/* Set up a callback to be called when the current batch is flushed */
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 041d4fe9dfe4..449f86897db3 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -76,7 +76,7 @@ static void __cpuinit cpu_bringup(void)
76 xen_setup_cpu_clockevents(); 76 xen_setup_cpu_clockevents();
77 77
78 set_cpu_online(cpu, true); 78 set_cpu_online(cpu, true);
79 percpu_write(cpu_state, CPU_ONLINE); 79 this_cpu_write(cpu_state, CPU_ONLINE);
80 wmb(); 80 wmb();
81 81
82 /* We can take interrupts now: we're officially "up". */ 82 /* We can take interrupts now: we're officially "up". */