Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] Always apply DABR changes on context switches

This patch removes the #ifdef CONFIG_PPC64 around setting the DABR.

The actual setting of the SPR inside of the set_dabr() function is dependent
on CONFIG_PPC64 || CONFIG_6xx but you can always provide a ppc_md hook to
override that. We should improve support for different HW breakpoints
facilities but this is a first step.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Benjamin Herrenschmidt and committed by
Paul Mackerras
791cc501 6d110da8

+7 -7
+7 -7
arch/powerpc/kernel/process.c
··· 219 219 } 220 220 #endif /* CONFIG_SMP */ 221 221 222 - #ifdef CONFIG_PPC_MERGE /* XXX for now */ 223 222 int set_dabr(unsigned long dabr) 224 223 { 224 + #ifdef CONFIG_PPC_MERGE /* XXX for now */ 225 225 if (ppc_md.set_dabr) 226 226 return ppc_md.set_dabr(dabr); 227 + #endif 227 228 229 + /* XXX should we have a CPU_FTR_HAS_DABR ? */ 230 + #if defined(CONFIG_PPC64) || defined(CONFIG_6xx) 228 231 mtspr(SPRN_DABR, dabr); 232 + #endif 229 233 return 0; 230 234 } 231 - #endif 232 235 233 236 #ifdef CONFIG_PPC64 234 237 DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array); 235 - static DEFINE_PER_CPU(unsigned long, current_dabr); 236 238 #endif 239 + 240 + static DEFINE_PER_CPU(unsigned long, current_dabr); 237 241 238 242 struct task_struct *__switch_to(struct task_struct *prev, 239 243 struct task_struct *new) ··· 303 299 304 300 #endif /* CONFIG_SMP */ 305 301 306 - #ifdef CONFIG_PPC64 /* for now */ 307 302 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) { 308 303 set_dabr(new->thread.dabr); 309 304 __get_cpu_var(current_dabr) = new->thread.dabr; 310 305 } 311 - #endif /* CONFIG_PPC64 */ 312 306 313 307 new_thread = &new->thread; 314 308 old_thread = &current->thread; ··· 475 473 476 474 discard_lazy_cpu_state(); 477 475 478 - #ifdef CONFIG_PPC64 /* for now */ 479 476 if (current->thread.dabr) { 480 477 current->thread.dabr = 0; 481 478 set_dabr(0); 482 479 } 483 - #endif 484 480 } 485 481 486 482 void