PERFORCE change 135517 for review

Marcel Moolenaar xcllnt at mac.com
Sat Feb 16 15:29:17 PST 2008


On Feb 16, 2008, at 3:20 PM, Rafal Jaworowski wrote:

> Marcel Moolenaar wrote:
>>>>>>
>>>>>>   Save U-Boot's registers at startup and restore them when
>>>>>>   performing a syscall. This way we don't have to compile
>>>>>>   code specially to avoid using those registers. Otherwise
>>>>>>   we have to encode knowledge of those registers in at least
>>>>>>   4 makefiles and introduce a build knob to enable it all.
>>>>>>   This does not allow us to build everything with a single
>>>>>>   build world.
>>>>>>
>>>>>
>>>>> Hi Marcel,
>>>>>
>>>>> I'm not quite sure this is sufficient... I already had a similar
>>>>> save/restore
>>>>> in place, but there is some general problem with U-Boot that  
>>>>> leads to
>>>>> hangs
>>>>> (experienced):
>>>>
>>>> Interesting, I didn't see any such problems with 1.3.2-rc1.
>>>>
>>>
>>> Chances are it might not surface, depending on the regs usage  
>>> pattern,
>>> compiler etc., for example a -O0 build would usually hide this  
>>> issue,
>>> but in
>>> principle those regs are not exception/interrupt safe.
>>
>> Agreed. I didn't see it at -O2, BTW.
>>
>
> When I was looking at this it also did not always pop up (with -O2  
> too),
> although typically when loader(8) was executed and left idle for  
> some time it
> would hang sooner or later.
>
>> We can disable interrupts when not running in U-Boot, right?
>> The impact should be marginal...
>>
>
> Yes, this could be worked around like this, but with degraded  
> functionality:
> all timer-related calls from the API would not make sense, and  
> things like
> autoboot count down will not work. Even worse, the [polled]  
> networking might
> not work at all if decrementer was shut, as we'd not be able to time  
> out while
> waiting on the packet, status registers' change and so on. I think  
> this issue
> needs some further investigation and proper resolution.

We always call into U-Boot when we're waiting, so interrupts should be
enabled when it's important. This is the case when we wait for time to
pass, a key press or a network packet. In all those cases we shouldn't
be running for extensive amounts of time with interrupts disabled, so
we shouldn't lose too much precision, keys or packets.

I'll play with this and see if that statement is true...

-- 
Marcel Moolenaar
xcllnt at mac.com




More information about the p4-projects mailing list