From: gerg <gerg@snapgear.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-kernel@vger.kernel.org, David McCullough <davidm@snapgear.com>
Subject: Re: [PATCH]: uClinux (MMU-less) patches against 2.5.28
Date: Sat, 27 Jul 2002 01:08:51 +1000 [thread overview]
Message-ID: <3D416603.2000107@snapgear.com> (raw)
In-Reply-To: 9143.1027671559@redhat.com
David Woodhouse wrote:
> gerg@snapgear.com said:
>> You may have noticed some MAGIC_ROM_PTR patches in the mtd driver
>>code in this patch. This is to allow XIP for applications. We have
>>been support XIP for quite some time on uClinux, it works really well.
>
>>A problem we have experienced with MTD is that the nature of
>>asynchronous writing to FLASH does not play nice with apps runing XIP.
>> Any thoughts on how to deal with this?
>
> Other than burying my head in the sand and hoping that someone starts
> making dual-port flash? Sort of...
:-)
> XIP of the kernel makes it harder, of course -- writing to the chip you're
> running the _kernel_ from turns your entire text segment into status words,
> so really I can't see any alternative but to copy the flash manipulation
> routines into RAM, disable all interrupts, and get on with it.
Not at all unresonable. I don't think there is any other real
alternative if you want your kernel running from flash, and
you want to write to flash.
> If we're talking about XIP of just userspace pages, I have a vague plan for
> that which may be slightly more feasible. If it holds up to the cold light
> of day, perhaps you can help adjust it to work with uClinux.
>
> The plan is to hand out pages to be mapped into userspace (or indeed kernel
> space -- JFFS2 can speed up mounts this way too), but which get marked
> absent when the flash driver talks to the chip. If your applications then
> take a page fault, you can either suspend the operation or just make them
> wait till it's complete.
>
> The actual implementation of this should be relatively simple. We can
> provide a generic_mtd_vm_ops and the chip drivers just need to know about
> an extra state for 'mapped' and have a method to enter that state, and a
> callback for when they want to _leave_ that state. Oh, and a way to get the
> raw physical address for a given range of flash.
The MAGIC_ROM_PTR support in the uClinux patch adds a field to
the block_device_operations and file_operations structures that
allows getting at the physical address in flash.
> It occurs to me that this doesn't work too well without an MMU though. Got
> any better ideas? Could we disable entire processes when one of their pages
> is inaccessible?
Disabling processes that are known to be running direct from flash
sounds workable. (There is no real notion of separating pages under
uClinux - it is an all or nothing mapping. The text, data, bss, etc
are always a single contiguous region in the address space).
More generous lock that really required for general VM linux, but at
least the whole process model works for both VM and non-VM linux.
I would expect this avoids any potential loop/deadlock with pages
(going on the discussion in follow up emails anyway).
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Wizard EMAIL: gerg@snapgear.com
Snapgear Pty Ltd PHONE: +61 7 3279 1822
825 Stanley St, FAX: +61 7 3279 1820
Woolloongabba, QLD, 4102, Australia WEB: www.snapgear.com
next prev parent reply other threads:[~2002-07-26 15:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-25 6:56 [PATCH]: uClinux (MMU-less) patches against 2.5.28 Greg Ungerer
2002-07-25 14:52 ` David Woodhouse
2002-07-26 0:08 ` Greg Ungerer
2002-07-26 1:20 ` Greg Ungerer
2002-07-26 8:19 ` David Woodhouse
2002-07-26 10:39 ` Alan Cox
2002-07-26 9:39 ` David Woodhouse
2002-07-26 10:56 ` Alan Cox
2002-07-26 9:58 ` David Woodhouse
2002-07-26 14:50 ` Alan Cox
2002-07-26 14:03 ` David Woodhouse
2002-07-26 17:11 ` Alan Cox
2002-07-26 16:01 ` David Woodhouse
2002-07-26 17:27 ` Alan Cox
2002-07-26 16:27 ` David Woodhouse
2002-07-26 15:08 ` gerg [this message]
2002-07-26 15:45 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D416603.2000107@snapgear.com \
--to=gerg@snapgear.com \
--cc=davidm@snapgear.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox