| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XenPPC] [PATCH] Handshake with secondary processors (take 2)
 On Aug 10, 2006, at 10:09 PM, Amos Waterland wrote: Take two. ok, I think we need a take three... Note that the processors on a JS20 are noticably slower to handshake than those on a JS21. I had to rid of the hard-coded 1024 timebase ticks and replace it with calculating five seconds from the timebase frequency, as the timeout logic was firing on my JS20 blade. What should we do about CPUs that successfully start but take too long to ack, not sure where they'll end up. 
This is prolly overkill but perhaps we shoud:
  boot_of.c (in psuedo)
        *ack = cpuid;
        do { ... } while (*ack == 0)
  exceptions.S:
        spin_start:
                /* Our physical cpu number is passed in r3.  */
                LOADADDR(r4, __spin_ack)
        1:
                ldw r5, 0(r4)
                cmpw r6,r3,r5
                beq r6, 2f
                sync
                b 1b
        2:      li r5, 0
                stw r5, 0(r4)
                sync
        barrier:
                b .
Or am I just being paranoid?
Anyway... useful comments below.
-JX
diff -r 058f2e27476d xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.c Mon Aug 07 17:49:16 2006 -0500 +++ b/xen/arch/powerpc/boot_of.c Thu Aug 10 21:56:18 2006 -0400 @@ -30,6 +30,9 @@ #include <asm/io.h> #include "exceptions.h" #include "of-devtree.h" ++/* Secondary processors use this for handshaking with main processor. */+volatile unsigned int __spin_ack; This volatile does not help you since you don't actually use __spin_ack directly, see below. 
 You needed this cast because gcc complained that you were going to lose a qualifier, right. Gcc is correct (as usual) and what you really want is to make sure that "ack" is volatile _not_ __spin_ack. 
So this should be:
        unsigned int volatile *ack = &__spin_ack;
Note: the mb() stuf may not require the volatile at all, but I'm ok  
with using it, you do however need the mb() for its "sync" properties.
We have privately discussed the fact that there is a bug in of_start_cpu() that will cause it to always return OF_FAILURE. Once that is fixed, please put in code that checks for success for OF on this method. ++ /* We will give the secondary processor five seconds to reply. */ _______________________________________________ Xen-ppc-devel mailing list Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ppc-devel 
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |