This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1000525] New: Nios II CYGARC_HAL_SAVE_GP bug?


http://bugzilla.ecoscentric.com/show_bug.cgi?id=1000525

           Summary: Nios II CYGARC_HAL_SAVE_GP bug?
           Product: eCos
           Version: 2.0
          Platform: nios2_cyclone2_2c35_standard (Cyclone II with std
                    design)
        OS/Version: Nios II
            Status: UNCONFIRMED
          Severity: critical
          Priority: normal
         Component: HAL
        AssignedTo: jifl@ecoscentric.com
        ReportedBy: rob.duncan@designmagnitude.com
         QAContact: ecos-bugs@ecos.sourceware.org
             Class: ---


I have found what is apparently a bug in the implementation of the Nios II
CYGARC_HAL_SAVE_GP macro in eCosPro 2.0.81.  The current implementation uses
the movia pseudo-instruction.  This is actually two Nios II instructions: orhi
followed by addi.  The problem is that gp has an invalid value if an interrupt
occurs between this pair of instructions.  Any code that attempts to use a
global variable via this invalid GP will get bad results.

This bug can be hidden if the path through the interrupt code explicitly sets
gp again, which is what will happen if the application is running with Redboot
(or is Redboot).

I can fairly easily reproduce this bug by running the stress_threads test on a
configuration built with networking, while hitting it with a flood ping.

One simple workaround is to configure the system with
CYGSEM_HAL_COMMON_INTERRUPTS_FIXED_GP set to 0.  A real fix presumably will
require recoding CYGARC_HAL_SAVE_GP to use a temporary register to update gp
atomically.

Rob.


-- 
Configure bugmail: http://bugzilla.ecoscentric.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]