[uClinux-dev] XIP broken in 2.4.31-uc0 ? (fwd)

Erwin Authried eauth at softsys.co.at
Thu Oct 6 06:26:07 EDT 2005


Hi David,
it doesn't crash, I'm only getting those messages when an app is
started:

kernel BUG at mmap.c:1343!

BTW, I found that "is_in_rom()" is now only used on two places in the
whole kernel, in mmap.c and page_alloc2.c. Do you think that we can get
rid of this kludgy function alltogether?

Regards,
Erwin


Am Don, den 06.10.2005 schrieb David McCullough um 6:10:
> Erwin,
> 
> Can you back out the previous patches you have tried and get the latest
> updates from cvs for these files:
> 
> 	linux-2.4.x/mmnommu/mmap.c
> 	linux-2.4.x/fs/proc/nommu.c
> 	linux-2.4.x/lib/rbtree.c
> 	linux-2.4.x/fs/binfmt_flat.c
> 	linux-2.4.x/drivers/block/blkmem.c
> 
> Otherwise I have attached a patch just in case :-)
> 
> This should see XIP working without errors and fix various problems
> surrounding it and the VMA house keeping.  It is running ok for me on
> Xcopilot and the ARMulator.  Actually it was previously running for the
> simple "it boots test", unfortunately I didn't try much harder than that
> before pushing out 2.4.31 :-(
> 
> Cheers,
> Davidm
> 
> 
> Jivin Erwin Authried lays it down ...
> > Am Don, den 22.09.2005 schrieb Erwin Authried um 11:57:
> > > Am Mit, den 21.09.2005 schrieb Michael Leslie um 22:27:
> > > > Hi Erwin,
> > > > 
> > > > I sent Greg a couple of patches for this just recently, based on 
> > > > suggestions from Greg and David Howells. Part of the solution also 
> > > > required satisfying the requirements of MAGIC_ROM_PTR in the arch/ code.
> > > > 
> > > > I've attached the patches that got XIP going for me on Motorola 68VZ328.
> > > > They also seem _not_ to break non-XIP (I've tested on Coldfire).
> > > > 
> > > > I hope these help.
> > > > 
> > > > 
> > > > Regards,
> > > > 
> > > > Michael Leslie,
> > > > Arcturus Networks Inc.
> > > > 
> > > Hello Michael,
> > > 
> > > thanks a lot! The patch still doesn't solve the problem completely. Now
> > > I'm getting a alignment exception in put_vma when I invoke the
> > > application a second time. from the backtrace, the functions are:
> > > 
> > > sys_exit -> do_exit -> mmput -> exit_mmap -> put_vma
> > > 
> > > I verified that there's no problem when the load-to-ram flag is set. The
> > > same application works with XIP on an older kernel (2.4.27-uc1).
> > > 
> > > Regards,
> > > Erwin
> > > 
> > I found the reason for the problem now. The execption occured in kfree
> > that's called from put_vma, instead of in put_vma as reported before.
> > kfree crashed because it was called with the address of the
> > application's entry point in flash. 
> > The base address of romfs is calculated in blkmem.c, with
> > ioremap_nocache(). In most uclinux architectures, ioremap is just a 1:1
> > translation. In my case (w90n740), ioremap returns a pointer to
> > noncacheable memory, by setting Bit 31 in the address. I guess that this
> > causes  is_in_rom() to return false. At least, after removing the
> > ioremap_nocache line in blkmem.c, everything worked fine. 
> > But still, I have some doubts about blkmem:
> > 
> > * ioremap_nocache returns a pointer to memory fro non-cached access by
> > definition. That will slow down XIP execution considerably if ioremap
> > isn't a dummy macro.
> > 
> > * If blkmem isn't inside flash, kfree would try to free non-malloced
> > memory (just a guess, I haven't verified that) when the application
> > exits.
> > 
> > Regards,
> > Erwin
> > 
> > 




More information about the uClinux-dev mailing list