2002-11-11 17:52:43

by Andy Pfiffer

[permalink] [raw]
Subject: Re: kexec (was: [lkcd-devel] Re: What's left over.)

On Thu, 2002-11-07 at 21:36, Rob Landley wrote:

> It strikes me that "load a blob of data into physical memory and keep it there
> until further notice" is actually relatively generic mechanism, and something
> there might be other reasons for root or various devices to do. (DSPs that
> want their firmware in system ram? 3D models and textures for an onboard
> video card?) If I'm wrong, would somebody be kind enough to tell me why?
>
> Rob


Yes, that is rather generic -- somewhat like a variable-sized ramdisk.

I think the key difference is that the ramdisk wants to hold blobs of
data that will be accessed from user-mode by read & write.

A "blob of bytes" for kexec, and maybe for a few other uses, wants to be
accessed (perhaps a page at a time) by pointers while in kernel space.

I'm not so sure of the generality, though. It's my guess that there
many special-case requirements that might make it difficult to become
useful infrastructure (eg, maybe the DSP on a soundcard needs it to be
4M aligned and contiguous, or the texture memory for the video card
wants to be able to walk a data structure that only it knows about).

Andy





2002-11-11 18:21:10

by Eric W. Biederman

[permalink] [raw]
Subject: Re: kexec (was: [lkcd-devel] Re: What's left over.)

Andy Pfiffer <[email protected]> writes:

> On Thu, 2002-11-07 at 21:36, Rob Landley wrote:
>
> > It strikes me that "load a blob of data into physical memory and keep it there
>
> > until further notice" is actually relatively generic mechanism, and something
>
> > there might be other reasons for root or various devices to do. (DSPs that
> > want their firmware in system ram? 3D models and textures for an onboard
> > video card?) If I'm wrong, would somebody be kind enough to tell me why?
> >
> > Rob
>
>
> Yes, that is rather generic -- somewhat like a variable-sized ramdisk.
>
> I think the key difference is that the ramdisk wants to hold blobs of
> data that will be accessed from user-mode by read & write.

kexec at least at the end, and probably for earlier for handling
panics wants code to be in a very specific location in ram.

If you want to hook the functionality behind in behind kexec_load,
when say KEXEC_FIXED is passed as a flag, go ahead. There is enough
other setup to jump to the code loaded into memory that "load a blob
of data into physical memory and keep it there" is not a sufficient
interface.

In the general case I using some kind of scatter gather list seems
the most polite way to go.

Eric