* Re: initrd testing [possible solution]
2004-11-04 5:38 initrd testing [possible solution] Jurij Smakov
@ 2004-11-15 4:16 ` Jurij Smakov
2004-11-15 23:40 ` David S. Miller
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jurij Smakov @ 2004-11-15 4:16 UTC (permalink / raw)
To: sparclinux
On Thu, 4 Nov 2004, Jurij Smakov wrote:
[skipped]
> So, my conclusion is that __copy_1page is broken, at least under certain (yet
> undetermined) conditions. If that's really the case, it either should be
> fixed (requires knowledge of assembler, which I lack) or its use should be
> avoided whatsoever. The latter is easy to achieve by modifying the memcpy()
> definition in include/asm-sparc/string.h to call __memcpy instead.
As a followup: I have tried fiddling more with the memcpy() routine.
Insight from Rob Radez and comments in arch/sparc/lib/blockops.S suggest,
that __copy_1page assumes that the memory regions copied are aligned on a
double-word boundary. I have checked, that in the cramfs case it wasn't
true, the destination was not aligned on the double-word boundary. So, I
have implemented a simple workaround (see patch below), which together
with Bob Breuer's iommu.c fix [0] made 2.6.8 kernel to boot on my
machine (SS10 with Ross Hypersparc CPU)! I also confirm, that adding the
suggested fix to the srmmu.c also [1] breaks sunlance on my machine. With
that "fix" the line 'eth0: Memory error, status 88c3, addr 3713ba' is
displayed continuously during boot, when it comes to configuring network
interfaces. The successful patch for me is:
--- build-sparc32.orig/include/asm-sparc/string.h 2004-08-14 01:36:11.000000000 -0400
+++ build-sparc32/include/asm-sparc/string.h 2004-11-14 22:09:49.000000000 -0500
@@ -40,6 +40,9 @@
if(n <= 32) {
__builtin_memcpy(to, from, n);
+ } else if (((unsigned int) to & 7) != 0) {
+ /* Destination is not aligned on the double-word boundary */
+ __memcpy(to, from, n);
} else {
switch(n) {
case PAGE_SIZE:
--- build-sparc32.orig/arch/sparc/mm/iommu.c 2004-08-14 01:38:08.000000000 -0400
+++ build-sparc32/arch/sparc/mm/iommu.c 2004-11-14 22:10:09.000000000 -0500
@@ -173,6 +173,7 @@
}
iommu_viking_flush_iotlb(iopte0, npages);
+ flush_cache_all();
return busa0;
}
Note, that this patch is against the unpacked Debian kernel package's
build-sparc32 tree, so it may be fuzzy w/respect to the pristine kernel.
[0] http://marc.theaimsgroup.com/?l=linux-sparc&m\x110005632921213&w=2
[1] http://marc.theaimsgroup.com/?l=linux-sparc&m\x110014079917049&w=2
Best regards,
Jurij Smakov jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: initrd testing [possible solution]
2004-11-04 5:38 initrd testing [possible solution] Jurij Smakov
2004-11-15 4:16 ` Jurij Smakov
@ 2004-11-15 23:40 ` David S. Miller
2004-11-15 23:56 ` William Lee Irwin III
2004-11-16 2:11 ` Rob Radez
3 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2004-11-15 23:40 UTC (permalink / raw)
To: sparclinux
On Sun, 14 Nov 2004 23:16:40 -0500 (EST)
Jurij Smakov <jurij@wooyd.org> wrote:
> --- build-sparc32.orig/include/asm-sparc/string.h 2004-08-14 01:36:11.000000000 -0400
> +++ build-sparc32/include/asm-sparc/string.h 2004-11-14 22:09:49.000000000 -0500
> @@ -40,6 +40,9 @@
>
> if(n <= 32) {
> __builtin_memcpy(to, from, n);
> + } else if (((unsigned int) to & 7) != 0) {
> + /* Destination is not aligned on the double-word boundary */
> + __memcpy(to, from, n);
> } else {
> switch(n) {
> case PAGE_SIZE:
This patch is perfectly fine, good catch.
wli, you got this?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: initrd testing [possible solution]
2004-11-04 5:38 initrd testing [possible solution] Jurij Smakov
2004-11-15 4:16 ` Jurij Smakov
2004-11-15 23:40 ` David S. Miller
@ 2004-11-15 23:56 ` William Lee Irwin III
2004-11-16 2:11 ` Rob Radez
3 siblings, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2004-11-15 23:56 UTC (permalink / raw)
To: sparclinux
On Sun, 14 Nov 2004 23:16:40 -0500 (EST) Jurij Smakov <jurij@wooyd.org> wrote:
> > --- build-sparc32.orig/include/asm-sparc/string.h 2004-08-14 01:36:11.000000000 -0400
> > +++ build-sparc32/include/asm-sparc/string.h 2004-11-14 22:09:49.000000000 -0500
> > @@ -40,6 +40,9 @@
> >
> > if(n <= 32) {
> > __builtin_memcpy(to, from, n);
> > + } else if (((unsigned int) to & 7) != 0) {
> > + /* Destination is not aligned on the double-word boundary */
> > + __memcpy(to, from, n);
> > } else {
> > switch(n) {
> > case PAGE_SIZE:
On Mon, Nov 15, 2004 at 03:40:23PM -0800, David S. Miller wrote:
> This patch is perfectly fine, good catch.
> wli, you got this?
Absolutely.
-- wli
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: initrd testing [possible solution]
2004-11-04 5:38 initrd testing [possible solution] Jurij Smakov
` (2 preceding siblings ...)
2004-11-15 23:56 ` William Lee Irwin III
@ 2004-11-16 2:11 ` Rob Radez
3 siblings, 0 replies; 5+ messages in thread
From: Rob Radez @ 2004-11-16 2:11 UTC (permalink / raw)
To: sparclinux
On Mon, Nov 15, 2004 at 03:56:03PM -0800, William Lee Irwin III wrote:
> On Sun, 14 Nov 2004 23:16:40 -0500 (EST) Jurij Smakov <jurij@wooyd.org> wrote:
> > > --- build-sparc32.orig/include/asm-sparc/string.h 2004-08-14 01:36:11.000000000 -0400
> > > +++ build-sparc32/include/asm-sparc/string.h 2004-11-14 22:09:49.000000000 -0500
> > > @@ -40,6 +40,9 @@
> > >
> > > if(n <= 32) {
> > > __builtin_memcpy(to, from, n);
> > > + } else if (((unsigned int) to & 7) != 0) {
> > > + /* Destination is not aligned on the double-word boundary */
> > > + __memcpy(to, from, n);
> > > } else {
> > > switch(n) {
> > > case PAGE_SIZE:
>
> On Mon, Nov 15, 2004 at 03:40:23PM -0800, David S. Miller wrote:
> > This patch is perfectly fine, good catch.
> > wli, you got this?
>
> Absolutely.
I was looking at something like this; do we lose the benefit that comes
from knowing that n is a constant and if so, should we delete the
preprocessing macro that checks if n is constant?
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread