All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] Broken Cache Flushing in arch/parisc/kernel/signal.c.??
@ 2002-11-13  7:44 Ryan Bradetich
  2002-11-13  7:52 ` Randolph Chung
  0 siblings, 1 reply; 4+ messages in thread
From: Ryan Bradetich @ 2002-11-13  7:44 UTC (permalink / raw)
  To: parisc-linux

Hello parisc-linux hackers,

I spent the evening tracking down why the serial mux failed to start
init and I kept getting the cow message on 2.5.47...and why it worked
for 2.5.46-pa7. After re-merging all the cvs commits in the last 4 days,
I finally tracked the problem down to this chunk of code from
arch/parisc/kernel/singal.c:

Index: arch/parisc/kernel/signal.c
===================================================================
RCS file: /var/cvs/linux-2.5/arch/parisc/kernel/signal.c,v
retrieving revision 1.6
diff -u -p -r1.6 signal.c
--- arch/parisc/kernel/signal.c	10 Nov 2002 19:39:16 -0000	1.6
+++ arch/parisc/kernel/signal.c	13 Nov 2002 07:38:58 -0000
@@ -308,8 +308,21 @@ setup_rt_frame(int sig, struct k_sigacti
 	}
 #endif
 
+#if CACHE_FLUSHING_IS_NOT_BROKEN
 	flush_icache_range((unsigned long) &frame->tramp[0],
 			   (unsigned long) &frame->tramp[4]);
+#else
+       /* It should *always* be cache line-aligned, but the compiler
+           sometimes screws up. */
+       asm volatile("fdc 0(%%sr3,%0)\n\t"
+                    "fdc %1(%%sr3,%0)\n\t"
+                    "sync\n\t"
+                    "fic 0(%%sr3,%0)\n\t"
+                    "fic %1(%%sr3,%0)\n\t"
+                    "sync\n\t"
+                    : : "r" (frame->tramp), "r" (L1_CACHE_BYTES));
+#endif
+
 	rp = (unsigned long) frame->tramp;
 
 	if (err)


This patch is needed to restore the functionality of the 2.5.46 kernel
so the Serial Mux, pdc console, etc will boot on the K460, etc.  I did
not want to re-commit this patch because it is ugly, and it would be
nice to figure out how to solve this problem properly.  

Any thoughts, suggestions, etc?

Thanks!

- Ryan

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

* Re: [parisc-linux] Broken Cache Flushing in arch/parisc/kernel/signal.c.??
  2002-11-13  7:44 [parisc-linux] Broken Cache Flushing in arch/parisc/kernel/signal.c.?? Ryan Bradetich
@ 2002-11-13  7:52 ` Randolph Chung
  2002-11-13 12:28   ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Randolph Chung @ 2002-11-13  7:52 UTC (permalink / raw)
  To: Ryan Bradetich; +Cc: parisc-linux

> +#if CACHE_FLUSHING_IS_NOT_BROKEN
>  	flush_icache_range((unsigned long) &frame->tramp[0],
>  			   (unsigned long) &frame->tramp[4]);
> +#else
> +       /* It should *always* be cache line-aligned, but the compiler
> +           sometimes screws up. */
> +       asm volatile("fdc 0(%%sr3,%0)\n\t"
> +                    "fdc %1(%%sr3,%0)\n\t"
> +                    "sync\n\t"
> +                    "fic 0(%%sr3,%0)\n\t"
> +                    "fic %1(%%sr3,%0)\n\t"
> +                    "sync\n\t"
> +                    : : "r" (frame->tramp), "r" (L1_CACHE_BYTES));
> +#endif
> +

<sigh>
this is partly my fault, since i thought we have unbroken cache flushing
and asked thibaut to check this in... now i see that the original code
flushes sr3 space, but flush_icache_range() flushes the kernel space...
oops!

perhaps we should just check the old code back in for now?

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

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

* Re: [parisc-linux] Broken Cache Flushing in arch/parisc/kernel/signal.c.??
  2002-11-13  7:52 ` Randolph Chung
@ 2002-11-13 12:28   ` Matthew Wilcox
  2002-11-13 19:27     ` Thibaut VARENE
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2002-11-13 12:28 UTC (permalink / raw)
  To: Randolph Chung; +Cc: Ryan Bradetich, parisc-linux

On Tue, Nov 12, 2002 at 11:52:34PM -0800, Randolph Chung wrote:
> this is partly my fault, since i thought we have unbroken cache flushing
> and asked thibaut to check this in... now i see that the original code
> flushes sr3 space, but flush_icache_range() flushes the kernel space...
> oops!
> 
> perhaps we should just check the old code back in for now?

Can we use
  void flush_icache_user_range(struct vm_area_struct *vma,
                        struct page *page, unsigned long addr, int len)
?  I'm not sure where we'd get the struct page from, though.

-- 
Revolutions do not require corporate support.

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

* Re: [parisc-linux] Broken Cache Flushing in arch/parisc/kernel/signal.c.??
  2002-11-13 12:28   ` Matthew Wilcox
@ 2002-11-13 19:27     ` Thibaut VARENE
  0 siblings, 0 replies; 4+ messages in thread
From: Thibaut VARENE @ 2002-11-13 19:27 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Randolph Chung, Ryan Bradetich, parisc-linux

Le mercredi, 13 nov 2002, =E0 13:28 Europe/Paris, Matthew Wilcox a =E9crit=
 :

> On Tue, Nov 12, 2002 at 11:52:34PM -0800, Randolph Chung wrote:
>> this is partly my fault, since i thought we have unbroken cache=20
>> flushing
>> and asked thibaut to check this in... now i see that the original =
code
>> flushes sr3 space, but flush_icache_range() flushes the kernel=20
>> space...
>> oops!
>>
>> perhaps we should just check the old code back in for now?
>
> Can we use
>   void flush_icache_user_range(struct vm_area_struct *vma,
>                         struct page *page, unsigned long addr, int =
len)
> ?  I'm not sure where we'd get the struct page from, though.

I reverted to the previous version until we find that out.
HTH,


Thibaut VARENE
The PA/Linux ESIEE Team
http://pateam.esiee.fr/=

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

end of thread, other threads:[~2002-11-13 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-13  7:44 [parisc-linux] Broken Cache Flushing in arch/parisc/kernel/signal.c.?? Ryan Bradetich
2002-11-13  7:52 ` Randolph Chung
2002-11-13 12:28   ` Matthew Wilcox
2002-11-13 19:27     ` Thibaut VARENE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.