BDI and 85xx
FYI
Edson had to patch this in to get BDI to work on 85xx with 2.6.14.
Makefile renamed from home/edson/linux-2.6.14/Makefile +1 -1
@@ -524,7 +524,7 @@ endif ifdef CONFIG_DEBUG_INFO -CFLAGS += -g +CFLAGS += -g -ggdb endif include $(srctree)/arch/$(ARCH)/Makefile
ppc/kernel/head_fsl_booke.S renamed from home/edson/linux-2.6.14/arch/ppc/kernel/head_fsl_booke.S +12 -0
@@ -187,6 +187,10 @@ xori r6,r4,1 slwi r6,r6,5 /* setup new context with other address space */ +#if defined(CONFIG_BDI_SWITCH) + mfmsr r9 + rlwimi r6,r9,0,22,22 /* preserve MSR[DE] */ +#endif bl 1f /* Find our address */ 1: mflr r9 rlwimi r7,r9,0,20,31
@@ -238,6 +242,10 @@ /* 7. Jump to KERNELBASE mapping */ lis r7,MSR_KERNEL@h ori r7,r7,MSR_KERNEL@l +#if defined(CONFIG_BDI_SWITCH) + mfmsr r9 + rlwimi r7,r9,0,22,22 /* preserve MSR[DE] */ +#endif bl 1f /* Find our address */ 1: mflr r9 rlwimi r6,r9,0,20,31
@@ -371,6 +379,10 @@ ori r4,r4,start_kernel@l lis r3,MSR_KERNEL@h ori r3,r3,MSR_KERNEL@l +#if defined(CONFIG_BDI_SWITCH) + mfmsr r5 + rlwimi r3,r5,0,22,22 /* preserve MSR[DE] */ +#endif mtspr SPRN_SRR0,r4 mtspr SPRN_SRR1,r3 rfi /* change context and jump to start_kernel */
ppc/kernel/process.c renamed from home/edson/linux-2.6.14/arch/ppc/kernel/process.c +4 -0
@@ -473,6 +473,10 @@ regs->nip = nip; regs->gpr[1 ] = sp; regs->msr =MSR_USER ; +#if (defined(CONFIG_BOOKE ) && defined(CONFIG_BDI_SWITCH )) +/* propagate the debug enable bit for BDI support */ + regs->msr |= (mfmsr () &MSR_DE ); +#endif if (last_task_used_math == current) last_task_used_math =NULL ;if (last_task_used_altivec == current)
Quoted 1 line · Marcelo Tosatti
Edson had to patch this in to get BDI to work on 85xx with 2.6.14.
How about we just change MSR_KERNEL and MSR_USER
in the include file #define instead of all of this run-time code? Or, change the code so it preserves DE in general, so we don't need a special kernel configuration just for the BDI?
The original reason I did the BDI_SWITCH was due to the overhead of tracking user PTE switches in the context switch code. I don't like the way this has been overloaded to mean "BDI general operation." We should be able to attach a BDI2000 to any kernel configuration and always get kernel debugging capability. The BDI_SWITCH was to enable the extra feature (with some overhead) of debugging into user applications, it never should have affected any kernel debug operation.
It's unfortunate that Book-E is such a PITA for debuggers, but let's please find a better way of using these features. Separate kernel configurations to enable hardware debugging isn't acceptable.
Thanks.
-- Dan