public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@karaya.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Allow UML kernel to run in a separate host address space
Date: Sat, 28 Dec 2002 15:24:41 -0500	[thread overview]
Message-ID: <200212282024.PAA03372@ccure.karaya.com> (raw)
In-Reply-To: Your message of "Sat, 28 Dec 2002 11:34:03 PST." <Pine.LNX.4.44.0212281131480.2812-100000@home.transmeta.com>

torvalds@transmeta.com said:
> Pulled, but that /proc/mm crap has to go (it wasn't in this patch, or
> I  would have rejected it).  

Which is exactly why it's not in that patch.  I realize that it's a lousy
interface - I'm putting it out there because I don't really have any better 
ideas and I'm hoping other people do.

The next iteration of that patch will turn /proc/mm into /dev/mm, but that's
not really a great improvement.  It just improves things around the edges a
little.

> What are the semantics the host code wants/needs, 

1 - Multiple address spaces per process
2 - Ability to make a child switch between address spaces
3 - Ability to manipulate a child's address space (i.e. mmap, munmap, mprotect
on an address space which is not current->mm)

> and how can we
> implement a sane generic mechanism that doesn't involve opening magic
> files? 

Beats me.  My first suggestion was to add another file descriptor argument
to mmap et al which would represent the address space to be modified.  Alan
didn't like that idea too much.

That still requires getting the descriptor from somewhere.  The obvious
alternative to opening a magic file is a system call, new_mm() or something.

BTW, there is some attraction to being able to open /proc/<pid>/mm and getting
a handle on that process' address space.  UML doesn't need this, but I bet
there are people who could figure out how to put it to good use.

So, here are the alternatives that I know of.  Sane replacements are craved.

Creating a new, empty address space -
	open /proc/mm (current UML host patch)
or	system call new_mm()

Switch a child from one address to another -
	PTRACE_SWITCH_MM (current UML host patch)

Manipulate a child's address space -
	write a request struct to a /proc/mm fd (current UML host patch)
or	add another fd to the mmap et al calls

Some obvious extensions to this (which UML doesn't need)
	switch yourself from one address space to another
	open and change another process' existing address space - if we're
going with system calls instead of magic files, then get_mm(pid) would suffice
for the open.

				Jeff


  reply	other threads:[~2002-12-28 20:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-28 15:47 [PATCH] Allow UML kernel to run in a separate host address space Jeff Dike
2002-12-28 19:34 ` Linus Torvalds
2002-12-28 20:24   ` Jeff Dike [this message]
2002-12-28 20:50     ` Linus Torvalds
2002-12-28 23:37       ` Jeff Dike
2002-12-29  4:13         ` Linus Torvalds
2002-12-29  5:12           ` Jeff Dike
2002-12-29  0:59       ` Daniel Jacobowitz
2002-12-29  4:03     ` Jeremy Fitzhardinge
2002-12-29  5:12       ` Jeff Dike
  -- strict thread matches above, loose matches on Subject: below --
2002-12-17 23:24 Jeff Dike

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=200212282024.PAA03372@ccure.karaya.com \
    --to=jdike@karaya.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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