Subject: Re: gas warning on mipsX_subr.S
To: None <port-mips@netbsd.org>
From: Alex Pelts <alexp@broadcom.com>
List: port-mips
Date: 02/25/2005 12:21:40
The "lw      k1, _C_LABEL(Sysmap)" will certainly generate at least 2 
cpu instructions. In this particular case there could be no effect if k1 
is  not used later after outofworld: label. Basically the first part of 
lw instruction will be executed regardless if branch is taken of not. It 
must be confirmed that k1 is not used at a later time.
Rather than do this I would agree with Eric and insert nop in there to 
remove the warning, or if possible rearrange instructions to place a 
real instruction in a delay slot.
While possibly harmless now, this could be a problem later if someone 
try to use k1 register. To confirm or deny this I need to see the code 
until k1 is used after the outofworld: label.

Thanks,
Alex

Martin Husemann wrote:
> On Fri, Feb 25, 2005 at 11:38:20AM -0800, Alex Pelts wrote:
> 
>>This is certainly not harmles at all. I would offer more insights but it 
>>would help to know which version of kernel are you trying to compile or 
>>the assembly snippet that generates warning.
> 
> 
> It is in current (sys/arch/mips/mipsX_subr.S), the lw after beq to outofworld:
> 
>         beq     k1, zero, outofworld            # No. Failing beyond. . .
>         lw      k1, _C_LABEL(Sysmap)
> 
> and
> 
> #else
>         beq     k1, zero, outofworld            # No. Failing beyond. . .
> #endif
>         lw      k1, _C_LABEL(Sysmap)
> 
> and the target:
> 
> outofworld:
>         /* eret to panic so shutdown can use K2.  Try to ensure valid $sp. */
>         la      a0, _C_LABEL(panic)
>         _MFC0   a2, MIPS_COP_0_EXC_PC
>         move    a1, sp
>         sll     k0, k0, PGSHIFT
>         _MTC0   a0, MIPS_COP_0_EXC_PC           # return to panic
>         COP0_SYNC
> ...
> 
> 
> Martin
> 
> 
>