linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* BDI and 85xx
@ 2005-11-07 11:24 Marcelo Tosatti
  2005-11-07 17:17 ` Dan Malek
  0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Tosatti @ 2005-11-07 11:24 UTC (permalink / raw)
  To: linux-ppc-embedded; +Cc: Edson Seabra

FYI

Edson had to patch this in to get BDI to work on 85xx with 2.6.14.

--- /home/edson/linux-2.6.14/Makefile	2005-10-27 17:02:08.000000000 -0700
+++ Makefile	2005-11-02 10:32:00.000000000 -0800
@@ -524,7 +524,7 @@
 endif
 
 ifdef CONFIG_DEBUG_INFO
-CFLAGS		+= -g
+CFLAGS		+= -g -ggdb
 endif
 
 include $(srctree)/arch/$(ARCH)/Makefile
--- /home/edson/linux-2.6.14/arch/ppc/kernel/head_fsl_booke.S	2005-10-27 17:02:08.000000000 -0700
+++ arch/ppc/kernel/head_fsl_booke.S	2005-11-02 19:59:21.000000000 -0800
@@ -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 */
--- /home/edson/linux-2.6.14/arch/ppc/kernel/process.c	2005-10-27 17:02:08.000000000 -0700
+++ arch/ppc/kernel/process.c	2005-11-02 19:33:12.000000000 -0800
@@ -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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BDI and 85xx
  2005-11-07 11:24 BDI and 85xx Marcelo Tosatti
@ 2005-11-07 17:17 ` Dan Malek
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Malek @ 2005-11-07 17:17 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Edson Seabra, linux-ppc-embedded


On Nov 7, 2005, at 6:24 AM, Marcelo Tosatti wrote:

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-07 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-07 11:24 BDI and 85xx Marcelo Tosatti
2005-11-07 17:17 ` Dan Malek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).