Re: 32 bits sparc, flags, and IDE

Jakub Jelinek (jj@sunsite.ms.mff.cuni.cz)
Mon, 12 Jul 1999 21:48:26 +0200


On Sun, Jul 11, 1999 at 11:08:07PM -0700, Pete Zaitcev wrote:
> Fellow hackers,
>
> I tried to bring up an IDE disk on 32 bits sparc and expirienced
> some difficulties. The code often saves flags in one procedure
> and restores them in other procedure. On sparc flags include
> a so called Current Window Pointer (CWP) and when you restore flags
> saved in other procedure, you screw your stack instanteniously.
>
> We need to resolve this somehow and I see two ways:
> a) outlaw what IDE code was doing (IDE maintained won't
> like that :).
> -or-
> b) change sparc asm in such way that it restores everything
> but CWP (hmm... got to mask interrupts first... also need
> to fix code which *expects* CWP to be updated).
>
> Neither seems desirable so I cannot commit ot any one.
> David Miller is on vacation I think... Jakub?
>
> Currently I "solved" the problem with a patch to IDE code
> and I can live with that. However I would appreciate if other
> developers never did this:

I'm afraid we'll have to go the latter way, because the same limitation is
for irqsafe spinlocks, rwlocks etc. %psr register is just badly designed,
fortunately Sun fixed this in v9. cli() already does a psr read and write,
save_flags(flags); cli(); takes even three psr accesses (but spinlocks use
save_and_cli()), so I guess we can take 4 more instructions (masking can be
done instead of the nops) in restore_flags. The IDE
save_flags/cli/restore_flags is on SMP far slower than those four insns
anyway.

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.3.10 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/