Subject: Re: port-arm32/6012: kcopy does not work on arm32 with DIAGNOSTIC
To: Lennart Augustsson <augustss@cs.chalmers.se>
From: Mark Brinicombe <mark@causality.com>
List: port-arm32
Date: 08/24/1998 19:23:56
On Mon, 24 Aug 1998, Lennart Augustsson wrote:
> >Description:
> The kcopy() function in sys/arch/arm32/arm32/bcopyinout.S does
> not work with the DIAGNOSTIC option. The reason is that the
> common part of the copyinout routines check that curpcb is
> non-zero, but this is not necessary for kcopy().
> >How-To-Repeat:
> Try to do an uiomove() in kernel space in an interrupt context.
> >Fix:
> Move the test.
> >Audit-Trail:
> >Unformatted:
Hmm I am not clear on this ... I take it that the kcopy is failing due to
the DIAGNOSTIC check trapping curpcb being zero ?
kcopy should never be called with curpcb==0 which is the purpose of the
DIAGNOSTIC test. If curpcb == 0 then it is not possible for kcopy, copyi
or copyout to work correctly as a valid pcb is needed to set the
PCB_ONFAULT field in the pcb. If the test is moved and kcopy is called
with curpcb==NULL then the PCB_ONFAULT field for a pcb at 0x00000000 will
be written to which is incorrect. Looking at the i386 kcopy routine it
assumes that the curpcb will always be non-zero which means that
DIAGNOSTIC test for curpcb==0 is valid.
I suspect that the real question here why is curpcb == NULL
Thoughts ?
Cheers,
Mark