From: Avi Kivity <avi@qumranet.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Anthony Liguori <aliguori@us.ibm.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH 0/7] KVM: Kernel-based Virtual Machine
Date: Sun, 22 Oct 2006 18:18:31 +0200 [thread overview]
Message-ID: <453B99D7.1050004@qumranet.com> (raw)
In-Reply-To: <200610221723.48646.arnd@arndb.de>
Arnd Bergmann wrote:
> On Sunday 22 October 2006 10:37, Avi Kivity wrote:
>
>> I like this. Since we plan to support multiple vcpus per vm, the fs
>> structure might look like:
>>
>> /kvm/my_vm
>> |
>> +----memory # mkdir to create memory slot.
>>
>
> Note that the way spufs does it, every directory is a reference-counted
> object. Currently that includes single contexts and groups of
> contexts that are supposed to be scheduled simultaneously.
>
> The trick is that we use the special 'spu_create' syscall to
> add a new object, while naming it, and return an open file
> descriptor to it. When that file descriptor gets closed, the
> object gets garbage-collected automatically.
>
Yes. Well, a single fd and ioctl()s do that as well.
>
> We ended up adding a lot more file than we initially planned,
> but the interface is really handy, especially if you want to
> create some procps-like tools for it.
>
>
I don't really see the need. The cell dsps are a shared resource, while
virtual machines are just another execution mode of an existing resource
- the main cpu, which has a sharing mechanism (the scheduler and
priorities).
>> | | # how to set size and offset?
>> | |
>> | +---0 # guest physical memory slot
>> | |
>> | +-- dirty_bitmap # read to get and atomically reset
>> | # the changed pages log
>>
>
> Have you thought about simply defining your guest to be a section
> of the processes virtual address space? That way you could use
> an anonymous mapping in the host as your guest address space, or
> even use a file backed mapping in order to make the state persistant
> over multiple runs. Or you could map the guest kernel into the
> guest real address space with a private mapping and share the
> text segment over multiple guests to save L2 and RAM.
>
I've thought of it but it can't work on i386 because guest physical
address space is larger than virtual address space on i386. So we
mmap("/dev/kvm") with file offsets corresponding to guest physical
addresses.
I still like that idea, since it allows using hugetlbfs and allowing
swapping. Perhaps we'll just accept the limitation that guests on i386
are limited.
>
>> |
>> |
>> +----cpu # mkdir/rmdir to create/remove vcpu
>> |
>>
>
> I'd recommend not allowing mkdir or similar operations, although
> it's not that far off. One option would be to let the user specify
> the number of CPUs at kvm_create() time, another option might
> be to allow kvm_create with a special flag or yet another syscall
> to create the vcpu objects.
>
Okay.
>
>> +----0
>> | |
>> | +--- irq # write to inject an irq
>> | |
>> | +--- regs # read/write to get/set registers
>> | |
>> | +--- debugger # write to set breakpoints/singlestep mode
>> |
>> +----1
>> [...]
>>
>> It's certainly a lot more code though, and requires new syscalls. Since
>> this is a little esoteric does it warrant new syscalls?
>>
>
> We've gone through a number of iterations on the spufs design regarding this,
> and in the end decided that the garbage-collecting property of spu_create
> was superior to any other option, and adding the spu_run syscall was then
> the logical step. BTW, one inspiration for spu_run came from sys_vm86, which
> as you are probably aware of is already doing a lot of what you do, just
> not for protected mode guests.
>
Yes, we're doing a sort of vmx86_64().
Thanks for the ideas, I'm certainly leaning towards a filesystem based
approach and I'll also reconsider the mapping (mmap() vi virtual address
space subsection).
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2006-10-22 16:18 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-19 13:45 Avi Kivity
2006-10-19 13:47 ` [PATCH 1/7] KVM: userspace interface Avi Kivity
2006-10-19 14:30 ` John Stoffel
2006-10-19 14:43 ` Avi Kivity
2006-10-19 23:26 ` Greg KH
2006-10-19 14:50 ` Alan Cox
2006-10-19 14:51 ` Avi Kivity
2006-10-19 15:25 ` John Stoffel
2006-10-19 18:49 ` Anthony Liguori
2006-10-19 19:10 ` Avi Kivity
2006-10-19 19:17 ` Anthony Liguori
2006-10-20 7:36 ` Avi Kivity
2006-10-20 15:33 ` Anthony Liguori
2006-10-22 8:10 ` Avi Kivity
2006-10-19 20:36 ` Alan Cox
2006-10-19 18:46 ` Anthony Liguori
2006-10-19 19:04 ` Avi Kivity
2006-10-19 19:09 ` Anthony Liguori
2006-10-19 19:26 ` Avi Kivity
2006-10-19 19:31 ` Anthony Liguori
2006-10-19 22:15 ` Alan Cox
2006-10-20 7:42 ` Avi Kivity
2006-10-20 15:35 ` Anthony Liguori
2006-10-19 20:10 ` Andi Kleen
2006-10-19 20:14 ` Jan Engelhardt
2006-10-20 7:16 ` Avi Kivity
2006-10-21 15:50 ` Arnd Bergmann
2006-10-22 8:19 ` Avi Kivity
2006-10-21 13:37 ` Steven Rostedt
2006-10-22 8:14 ` Avi Kivity
2006-10-19 13:48 ` [PATCH 2/7] KVM: Intel virtual mode extensions definitions Avi Kivity
2006-10-19 20:19 ` Jan Engelhardt
2006-10-19 21:54 ` Alan Cox
2006-10-20 7:17 ` Avi Kivity
2006-10-21 13:48 ` Steven Rostedt
2006-10-22 8:17 ` Avi Kivity
2006-10-19 13:49 ` [PATCH 3/7] KVM: kvm data structures Avi Kivity
2006-10-19 13:53 ` [PATCH 5/7] KVM: mmu virtualization Avi Kivity
2006-10-19 20:26 ` Jan Engelhardt
2006-10-20 7:24 ` Avi Kivity
2006-10-19 13:54 ` [PATCH 6/7] KVM: x86 emulator Avi Kivity
2006-10-19 13:56 ` [PATCH 7/7] KVM: plumbing Avi Kivity
2006-10-19 13:58 ` [PATCH 0/7] KVM: Kernel-based Virtual Machine Avi Kivity
2006-10-19 16:05 ` Andi Kleen
2006-10-19 16:09 ` Avi Kivity
2006-10-19 19:02 ` Anthony Liguori
2006-10-19 19:14 ` Avi Kivity
2006-10-19 19:28 ` Anthony Liguori
2006-10-20 7:37 ` Avi Kivity
2006-10-19 17:31 ` Muli Ben-Yehuda
2006-10-19 18:00 ` Avi Kivity
2006-10-19 18:12 ` Randy Dunlap
2006-10-19 18:14 ` Avi Kivity
2006-10-19 18:30 ` Randy.Dunlap
2006-10-21 16:16 ` Arnd Bergmann
2006-10-22 8:37 ` Avi Kivity
2006-10-22 15:23 ` Arnd Bergmann
2006-10-22 16:18 ` Avi Kivity [this message]
2006-10-22 16:51 ` Arnd Bergmann
2006-10-22 17:01 ` Avi Kivity
2006-10-22 17:06 ` Arnd Bergmann
2006-10-22 17:41 ` Avi Kivity
2006-10-22 17:47 ` Arnd Bergmann
2006-10-22 17:56 ` Christoph Hellwig
2006-10-22 18:00 ` Avi Kivity
2006-10-22 18:36 ` Arnd Bergmann
2006-10-22 18:41 ` Avi Kivity
2006-10-22 18:49 ` Arnd Bergmann
2006-10-22 18:55 ` Avi Kivity
2006-10-22 22:26 ` Andi Kleen
2006-10-23 22:29 ` Jeremy Fitzhardinge
2006-10-22 20:01 ` Alan Cox
2006-10-22 20:45 ` Roland Dreier
2006-10-23 0:29 ` Anthony Liguori
2006-10-25 16:42 ` Pavel Machek
2006-10-22 19:59 ` Alan Cox
2006-10-22 22:28 ` Andi Kleen
2006-10-23 0:27 ` Roland Dreier
2006-10-23 0:39 ` Andi Kleen
2006-10-23 0:51 ` Roland Dreier
2006-10-22 17:39 ` Anthony Liguori
2006-10-22 17:53 ` Arnd Bergmann
2006-10-22 19:56 ` Alan Cox
2006-10-23 7:42 ` Avi Kivity
2006-10-24 21:38 ` kvm_create() (was Re: [PATCH 0/7] KVM: Kernel-based Virtual Machine) Andy Isaacson
2006-10-19 18:55 ` [PATCH 0/7] KVM: Kernel-based Virtual Machine Anthony Liguori
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=453B99D7.1050004@qumranet.com \
--to=avi@qumranet.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=aliguori@us.ibm.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=muli@il.ibm.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
Powered by JetHome