linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: mtmsrd not defined
@ 2010-08-22 22:09 Sean MacLennan
  2010-08-22 22:34 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 13+ messages in thread
From: Sean MacLennan @ 2010-08-22 22:09 UTC (permalink / raw)
  To: linuxppc-dev

Let's try a patch to get the ball rolling. 

ldstfp.S does not compile if mtmsrd not defined. But is it only defined
for BOOK3S_64. This defines mtmsrd to be mtmsr on all but BOOK3S_64.
This solves the compile problem... but I am not sure how to test it.

I am also not sure if this is the best place to define it. If the
mapping of mtmsrd to mtmsr is correct, maybe it should be in asm/reg.h?

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
---
diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
index f644863..df8a03b 100644
--- a/arch/powerpc/lib/ldstfp.S
+++ b/arch/powerpc/lib/ldstfp.S
@@ -17,6 +17,10 @@
 #include <asm/asm-offsets.h>
 #include <linux/errno.h>
 
+#ifndef CONFIG_PPC_BOOK3S_64
+#define mtmsrd mtmsr
+#endif
+
 #define STKFRM	(PPC_MIN_STKFRM + 16)
 
 	.macro	extab	instr,handler

Cheers,
   Sean

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-08-22 22:09 [PATCH] powerpc: mtmsrd not defined Sean MacLennan
@ 2010-08-22 22:34 ` Benjamin Herrenschmidt
  2010-08-22 22:48   ` Sean MacLennan
  0 siblings, 1 reply; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2010-08-22 22:34 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

On Sun, 2010-08-22 at 18:09 -0400, Sean MacLennan wrote:
> Let's try a patch to get the ball rolling. 
> 
> ldstfp.S does not compile if mtmsrd not defined. But is it only defined
> for BOOK3S_64. This defines mtmsrd to be mtmsr on all but BOOK3S_64.
> This solves the compile problem... but I am not sure how to test it.
> 
> I am also not sure if this is the best place to define it. If the
> mapping of mtmsrd to mtmsr is correct, maybe it should be in asm/reg.h?

I'd rather have a macro somewhere in ppc_asm.h (MTMSR ?) that does the
right thing. We might even already have one...

Cheers,
Ben.

> Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
> ---
> diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
> index f644863..df8a03b 100644
> --- a/arch/powerpc/lib/ldstfp.S
> +++ b/arch/powerpc/lib/ldstfp.S
> @@ -17,6 +17,10 @@
>  #include <asm/asm-offsets.h>
>  #include <linux/errno.h>
>  
> +#ifndef CONFIG_PPC_BOOK3S_64
> +#define mtmsrd mtmsr
> +#endif
> +
>  #define STKFRM	(PPC_MIN_STKFRM + 16)
>  
>  	.macro	extab	instr,handler
> 
> Cheers,
>    Sean
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-08-22 22:34 ` Benjamin Herrenschmidt
@ 2010-08-22 22:48   ` Sean MacLennan
  2010-08-31  4:37     ` Paul Mackerras
  2010-08-31 16:17     ` Kumar Gala
  0 siblings, 2 replies; 13+ messages in thread
From: Sean MacLennan @ 2010-08-22 22:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

On Mon, 23 Aug 2010 08:34:54 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> I'd rather have a macro somewhere in ppc_asm.h (MTMSR ?) that does the
> right thing. We might even already have one...

We do.... here is a new, improved patch.

Replace the BOOK3S_64 specific mtmsrd with the generic MTMSRD macro.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
---
diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
index f644863..ce818a5 100644
--- a/arch/powerpc/lib/ldstfp.S
+++ b/arch/pow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tmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -353,7 +353,7 @@ _GLOBAL(do_stxvd2x)
 	oris	r7,r6,MSR_VSX@h
 	cmpwi	cr7,r3,0
 	li	r8,STKFRM-16
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	STXVD2X(0,r1,r8)
@@ -365,7 +365,7 @@ _GLOBAL(do_stxvd2x)
 	LXVD2X(0,r1,r8)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM



Cheers,
   Sean

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-08-22 22:48   ` Sean MacLennan
@ 2010-08-31  4:37     ` Paul Mackerras
  2010-08-31 16:17     ` Kumar Gala
  1 sibling, 0 replies; 13+ messages in thread
From: Paul Mackerras @ 2010-08-31  4:37 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

On Sun, Aug 22, 2010 at 06:48:44PM -0400, Sean MacLennan wrote:

> Replace the BOOK3S_64 specific mtmsrd with the generic MTMSRD macro.
> 
> Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>

Acked-by: Paul Mackerras <paulus@samba.org>

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-08-22 22:48   ` Sean MacLennan
  2010-08-31  4:37     ` Paul Mackerras
@ 2010-08-31 16:17     ` Kumar Gala
  2010-08-31 17:46       ` Sean MacLennan
  1 sibling, 1 reply; 13+ messages in thread
From: Kumar Gala @ 2010-08-31 16:17 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev


On Aug 22, 2010, at 5:48 PM, Sean MacLennan wrote:

> On Mon, 23 Aug 2010 08:34:54 +1000
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> 
>> I'd rather have a macro somewhere in ppc_asm.h (MTMSR ?) that does the
>> right thing. We might even already have one...
> 
> We do.... here is a new, improved patch.
> 
> Replace the BOOK3S_64 specific mtmsrd with the generic MTMSRD macro.
> 
> Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
> ---

Can we add proper CONFIG_PPC_FPU into this file.

- k

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-08-31 16:17     ` Kumar Gala
@ 2010-08-31 17:46       ` Sean MacLennan
  2010-09-01  2:55         ` Sean MacLennan
  0 siblings, 1 reply; 13+ messages in thread
From: Sean MacLennan @ 2010-08-31 17:46 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

On Tue, 31 Aug 2010 11:17:17 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:

> Can we add proper CONFIG_PPC_FPU into this file.

If nobody beats me to it.... I can try this evening.

Cheers,
   Sean

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-08-31 17:46       ` Sean MacLennan
@ 2010-09-01  2:55         ` Sean MacLennan
  2010-09-01  6:45           ` Kumar Gala
  2010-09-01  8:02           ` Paul Mackerras
  0 siblings, 2 replies; 13+ messages in thread
From: Sean MacLennan @ 2010-09-01  2:55 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

On Tue, 31 Aug 2010 13:46:05 -0400
Sean MacLennan <smaclennan@pikatech.com> wrote:

> On Tue, 31 Aug 2010 11:17:17 -0500
> Kumar Gala <galak@kernel.crashing.org> wrote:
> 
> > Can we add proper CONFIG_PPC_FPU into this file.  
> 
> If nobody beats me to it.... I can try this evening.

I had to give up. Without the CONFIG_PPC_FPU it compiles fine for an
FPU less 44x. But with the CONFIG_PPC_FPU, I get the following errors:

arch/powerpc/lib/built-in.o: In function `__copy_tofrom_user':
arch/powerpc/lib/copy_32.S:(.kprobes.text+0xf8e): undefined reference to `do_lfs'
arch/powerpc/lib/copy_32.S:(.kprobes.text+0xf96): undefined reference to `do_lfs'
arch/powerpc/lib/copy_32.S:(.kprobes.text+0xfc2): undefined reference to `do_lfd'
arch/powerpc/lib/copy_32.S:(.kprobes.text+0xfca): undefined reference to `do_lfd'
arch/powerpc/lib/copy_32.S:(.kprobes.text+0xff6): undefined reference to `do_stfs'
arch/powerpc/lib/copy_32.S:(.kprobes.text+0xffe): undefined reference to `do_stfs'
arch/powerpc/lib/copy_32.S:(.kprobes.text+0x102a): undefined reference to `do_stfd'
arch/powerpc/lib/copy_32.S:(.kprobes.text+0x1032): undefined reference to `do_stfd'
make: *** [.tmp_vmlinux1] Error 1


Oops, sorry, it will say arch/powerpc/lib/copy32.S... I corrected that.
But I cannot find how copy_32.S is including those functions.

Cheers,
   Sean

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-09-01  2:55         ` Sean MacLennan
@ 2010-09-01  6:45           ` Kumar Gala
  2010-09-01  6:57             ` Sean MacLennan
  2010-09-01  8:02           ` Paul Mackerras
  1 sibling, 1 reply; 13+ messages in thread
From: Kumar Gala @ 2010-09-01  6:45 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev


On Aug 31, 2010, at 9:55 PM, Sean MacLennan wrote:

> On Tue, 31 Aug 2010 13:46:05 -0400
> Sean MacLennan <smaclennan@pikatech.com> wrote:
>=20
>> On Tue, 31 Aug 2010 11:17:17 -0500
>> Kumar Gala <galak@kernel.crashing.org> wrote:
>>=20
>>> Can we add proper CONFIG_PPC_FPU into this file. =20
>>=20
>> If nobody beats me to it.... I can try this evening.
>=20
> I had to give up. Without the CONFIG_PPC_FPU it compiles fine for an
> FPU less 44x. But with the CONFIG_PPC_FPU, I get the following errors:
>=20
> arch/powerpc/lib/built-in.o: In function `__copy_tofrom_user':
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0xf8e): undefined reference =
to `do_lfs'
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0xf96): undefined reference =
to `do_lfs'
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0xfc2): undefined reference =
to `do_lfd'
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0xfca): undefined reference =
to `do_lfd'
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0xff6): undefined reference =
to `do_stfs'
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0xffe): undefined reference =
to `do_stfs'
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0x102a): undefined reference =
to `do_stfd'
> arch/powerpc/lib/copy_32.S:(.kprobes.text+0x1032): undefined reference =
to `do_stfd'
> make: *** [.tmp_vmlinux1] Error 1
>=20
>=20
> Oops, sorry, it will say arch/powerpc/lib/copy32.S... I corrected =
that.
> But I cannot find how copy_32.S is including those functions.
>=20
> Cheers,
>   Sean

For what defconfig setup do you get the errors above?

- k=

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-09-01  6:45           ` Kumar Gala
@ 2010-09-01  6:57             ` Sean MacLennan
  0 siblings, 0 replies; 13+ messages in thread
From: Sean MacLennan @ 2010-09-01  6:57 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

On Wed, 1 Sep 2010 01:45:46 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:

> For what defconfig setup do you get the errors above?

44x/ebony_defconfig

Then enable KPROBES (or XMON).

Then put an #ifdef CONFIG_PPC_FPU in ldstfp.S.

Cheers,
   Sean

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-09-01  2:55         ` Sean MacLennan
  2010-09-01  6:45           ` Kumar Gala
@ 2010-09-01  8:02           ` Paul Mackerras
  2010-09-01 13:01             ` Kumar Gala
  2010-09-01 16:40             ` Sean MacLennan
  1 sibling, 2 replies; 13+ messages in thread
From: Paul Mackerras @ 2010-09-01  8:02 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

On Tue, Aug 31, 2010 at 10:55:25PM -0400, Sean MacLennan wrote:

> I had to give up. Without the CONFIG_PPC_FPU it compiles fine for an
> FPU less 44x. But with the CONFIG_PPC_FPU, I get the following errors:

Ah, those references would be from arch/powerpc/lib/sstep.c.  Evidently
we need #ifdef CONFIG_PPC_FPU around the emulation of the floating-point
loads and stores.

Do we do any in-kernel emulation of floating-point operations with
CONFIG_PPC_FPU turned off?

Paul.

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-09-01  8:02           ` Paul Mackerras
@ 2010-09-01 13:01             ` Kumar Gala
  2010-09-01 17:21               ` Sean MacLennan
  2010-09-01 16:40             ` Sean MacLennan
  1 sibling, 1 reply; 13+ messages in thread
From: Kumar Gala @ 2010-09-01 13:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Sean MacLennan


On Sep 1, 2010, at 3:02 AM, Paul Mackerras wrote:

> On Tue, Aug 31, 2010 at 10:55:25PM -0400, Sean MacLennan wrote:
>=20
>> I had to give up. Without the CONFIG_PPC_FPU it compiles fine for an
>> FPU less 44x. But with the CONFIG_PPC_FPU, I get the following =
errors:
>=20
> Ah, those references would be from arch/powerpc/lib/sstep.c.  =
Evidently
> we need #ifdef CONFIG_PPC_FPU around the emulation of the =
floating-point
> loads and stores.
>=20
> Do we do any in-kernel emulation of floating-point operations with
> CONFIG_PPC_FPU turned off?

I'm not aware of any.  I haven't looked at the Program Check exception =
path to know if we'd handle emulation gracefully or not for =
!CONFIG_PPC_FPU.

- k=

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-09-01  8:02           ` Paul Mackerras
  2010-09-01 13:01             ` Kumar Gala
@ 2010-09-01 16:40             ` Sean MacLennan
  1 sibling, 0 replies; 13+ messages in thread
From: Sean MacLennan @ 2010-09-01 16:40 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

On Wed, 1 Sep 2010 18:02:14 +1000
Paul Mackerras <paulus@samba.org> wrote:

> Ah, those references would be from arch/powerpc/lib/sstep.c.
> Evidently we need #ifdef CONFIG_PPC_FPU around the emulation of the
> floating-point loads and stores.

I tried that yesterday and it didn't help, although maybe I forgot to
mask out a few. I will check again.

Cheers,
   Sean

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

* Re: [PATCH] powerpc: mtmsrd not defined
  2010-09-01 13:01             ` Kumar Gala
@ 2010-09-01 17:21               ` Sean MacLennan
  0 siblings, 0 replies; 13+ messages in thread
From: Sean MacLennan @ 2010-09-01 17:21 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras

Ok, I didn't catch all the cases the first time :( Since the errors
seemed to come from copy_32.S, I didn't spend much time on sstep.c.

Here is an updated patch the fixes the mtmsrd problem and maps out the
floating point.

Cheers,
   Sean

Replace the BOOK3S_64 specific mtmsrd with the generic MTMSRD macro.
Only enable ldstfp when CONFIG_PPC_FPU is set.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
---
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S
index 74a7f41..55f19f9 100644
--- a/arch/powerpc/lib/copy_32.S
+++ b/arch/powerpc/lib/copy_32.S
@@ -62,7 +62,7 @@
 
 	.text
 	.stabs	"arch/powerpc/lib/",N_SO,0,0,0f
-	.stabs	"copy32.S",N_SO,0,0,0f
+	.stabs	"copy_32.S",N_SO,0,0,0f
 0:
 
 CACHELINE_BYTES = L1_CACHE_BYTES
diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
index f644863..6a85380 100644
--- a/arch/powerpc/lib/ldstfp.S
+++ b/arch/powerpc/lib/ldstfp.S
@@ -17,6 +17,8 @@
 #include <asm/asm-offsets.h>
 #include <linux/errno.h>
 
+#ifdef CONFIG_PPC_FPU
+
 #define STKFRM	(PPC_MIN_STKFRM + 16)
 
 	.macro	extab	instr,handler
@@ -81,7 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	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -353,7 +355,7 @@ _GLOBAL(do_stxvd2x)
 	oris	r7,r6,MSR_VSX@h
 	cmpwi	cr7,r3,0
 	li	r8,STKFRM-16
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	STXVD2X(0,r1,r8)
@@ -365,7 +367,7 @@ _GLOBAL(do_stxvd2x)
 	LXVD2X(0,r1,r8)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -373,3 +375,5 @@ _GLOBAL(do_stxvd2x)
 	extab	2b,3b
 
 #endif /* CONFIG_VSX */
+
+#endif	/* CONFIG_PPC_FPU */
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index e0a9858..ae5189a 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -30,6 +30,7 @@ extern char system_call_common[];
 #define XER_OV		0x40000000U
 #define XER_CA		0x20000000U
 
+#ifdef CONFIG_PPC_FPU
 /*
  * Functions in ldstfp.S
  */
@@ -41,6 +42,7 @@ extern int do_lvx(int rn, unsigned long ea);
 extern int do_stvx(int rn, unsigned long ea);
 extern int do_lxvd2x(int rn, unsigned long ea);
 extern int do_stxvd2x(int rn, unsigned long ea);
+#endif
 
 /*
  * Determine whether a conditional branch instruction would branch.
@@ -290,6 +292,7 @@ static int __kprobes write_mem(unsigned long val, unsigned long ea, int nb,
 	return write_mem_unaligned(val, ea, nb, regs);
 }
 
+#ifdef CONFIG_PPC_FPU
 /*
  * Check the address and alignment, and call func to do the actual
  * load or store.
@@ -351,6 +354,7 @@ static int __kprobes do_fp_store(int rn, int (*func)(int, unsigned long),
 	}
 	return err;
 }
+#endif
 
 #ifdef CONFIG_ALTIVEC
 /* For Altivec/VMX, no need to worry about alignment */
@@ -1393,6 +1397,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 				regs->gpr[rd] = byterev_4(val);
 			goto ldst_done;
 
+#ifdef CONFIG_PPC_CPU
 		case 535:	/* lfsx */
 		case 567:	/* lfsux */
 			if (!(regs->msr & MSR_FP))
@@ -1424,6 +1429,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 			ea = xform_ea(instr, regs, u);
 			err = do_fp_store(rd, do_stfd, ea, 8, regs);
 			goto ldst_done;
+#endif
 
 #ifdef __powerpc64__
 		case 660:	/* stdbrx */
@@ -1534,6 +1540,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 		} while (++rd < 32);
 		goto instr_done;
 
+#ifdef CONFIG_PPC_FPU
 	case 48:	/* lfs */
 	case 49:	/* lfsu */
 		if (!(regs->msr & MSR_FP))
@@ -1565,6 +1572,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 		ea = dform_ea(instr, regs);
 		err = do_fp_store(rd, do_stfd, ea, 8, regs);
 		goto ldst_done;
+#endif
 
 #ifdef __powerpc64__
 	case 58:	/* ld[u], lwa */

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

end of thread, other threads:[~2010-09-01 17:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-22 22:09 [PATCH] powerpc: mtmsrd not defined Sean MacLennan
2010-08-22 22:34 ` Benjamin Herrenschmidt
2010-08-22 22:48   ` Sean MacLennan
2010-08-31  4:37     ` Paul Mackerras
2010-08-31 16:17     ` Kumar Gala
2010-08-31 17:46       ` Sean MacLennan
2010-09-01  2:55         ` Sean MacLennan
2010-09-01  6:45           ` Kumar Gala
2010-09-01  6:57             ` Sean MacLennan
2010-09-01  8:02           ` Paul Mackerras
2010-09-01 13:01             ` Kumar Gala
2010-09-01 17:21               ` Sean MacLennan
2010-09-01 16:40             ` Sean MacLennan

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).