arm SMP fix

Ruslan Bukin br at bsdpad.com
Fri Nov 22 07:19:25 UTC 2013


On Fri, Nov 22, 2013 at 12:04:57AM +0000, Olivier Houchard wrote:
> Hi all,                                                                         
> 
> Attached is the first draft to a patch that fixes SMP for me, it seems to       
> work fine on my Pandaboard.                                                     
> The problem is, as it is currently implemented, curthread is basically          
> defined as get_pcpu()->pc_curthread. If we get interrupted between the moment   
> we got the struct pcpu, and the moment we derefence it to get the curthread 
> pointer, and migrated to another core, we would get the wrong curthread, and    
> that's not good.                                                                
> The proposed fix does the following :                                           
> - use the register we used to use for pcpu for curthread                        
> - get the pcpu address by reading the cpu id from the CPUID register, and       
> just use it as an index for the __pcpu array.                                   
>                                                                                 
> It breaks the KBI, which is unfortunate, but I think it is no big deal for      
> arm right now.                                                                  
>                                                                                 
> Any review, comment, and testing, even on UP boards, would be very welcome.     
>                                                                                 
> Regards,                                                                        
> 
> Olivier 

what type of media for root you used?

just a quick test on exynos5250

one time I booted OK with patch and SMP enabled,
two other attempts got panics
(probably during usb ethernet load)

http://pastebin.com/H129SMKX
http://pastebin.com/szkBjaT5

-Ruslan



More information about the freebsd-arm mailing list