* Re: Mapping guest memory from another process?
[not found] <CAG4Ohu_ZxZodnVpA=ym0WdM++Bdhwkx8MUg69aQHG8kOfTUB=A@mail.gmail.com>
@ 2013-09-03 23:56 ` Cutter 409
2013-09-04 8:47 ` Stefan Hajnoczi
0 siblings, 1 reply; 5+ messages in thread
From: Cutter 409 @ 2013-09-03 23:56 UTC (permalink / raw)
To: kvm
Hello,
I'm working on a tool that needs the ability to map the physical
memory of a virtual machine into its own address space. With Xen, I
can simply call xc_map_foreign_pages().
Is there something similar for KVM? So far, I can only figure out how
to do it if I were the process that created the VM (then I could
mmap() the handle of the virtual machine). Is there a way for an
outside process to do this?
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mapping guest memory from another process?
2013-09-03 23:56 ` Mapping guest memory from another process? Cutter 409
@ 2013-09-04 8:47 ` Stefan Hajnoczi
[not found] ` <CAG4Ohu-6Rksa3UgirBAKBEuWst6gG2yc4EUWebfn2U=MU9FwnA@mail.gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-09-04 8:47 UTC (permalink / raw)
To: Cutter 409; +Cc: kvm
On Tue, Sep 03, 2013 at 07:56:33PM -0400, Cutter 409 wrote:
> I'm working on a tool that needs the ability to map the physical
> memory of a virtual machine into its own address space. With Xen, I
> can simply call xc_map_foreign_pages().
>
> Is there something similar for KVM? So far, I can only figure out how
> to do it if I were the process that created the VM (then I could
> mmap() the handle of the virtual machine). Is there a way for an
> outside process to do this?
You can get QEMU to do a shared mapping of a files as guest RAM using
-mem-path and -mem-prealloc, see man qemu.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mapping guest memory from another process?
[not found] ` <CAG4Ohu-6Rksa3UgirBAKBEuWst6gG2yc4EUWebfn2U=MU9FwnA@mail.gmail.com>
@ 2013-09-04 17:10 ` Cutter 409
2013-09-09 10:01 ` Paolo Bonzini
2013-09-09 9:33 ` Stefan Hajnoczi
1 sibling, 1 reply; 5+ messages in thread
From: Cutter 409 @ 2013-09-04 17:10 UTC (permalink / raw)
To: kvm
Thanks, I'll try that. Do you know of any way to get at the VCPU
structure from another process? I'm looking to have an event triggered
from the guest which will notify my application. In Xen I use an event
channel, and then I can call a function to retrieve the relevant VCPU
context.
On Wed, Sep 4, 2013 at 10:35 AM, Cutter 409 <cutter409@gmail.com> wrote:
> Thanks, I'll try that. Do you know of any way to get at the VCPU structure
> from another process? I'm looking to have an event triggered from the guest
> which will notify my application. In Xen I use an event channel, and then I
> can call a function to retrieve the relevant VCPU context.
>
>
> On Wed, Sep 4, 2013 at 4:47 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>>
>> On Tue, Sep 03, 2013 at 07:56:33PM -0400, Cutter 409 wrote:
>> > I'm working on a tool that needs the ability to map the physical
>> > memory of a virtual machine into its own address space. With Xen, I
>> > can simply call xc_map_foreign_pages().
>> >
>> > Is there something similar for KVM? So far, I can only figure out how
>> > to do it if I were the process that created the VM (then I could
>> > mmap() the handle of the virtual machine). Is there a way for an
>> > outside process to do this?
>>
>> You can get QEMU to do a shared mapping of a files as guest RAM using
>> -mem-path and -mem-prealloc, see man qemu.
>>
>> Stefan
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mapping guest memory from another process?
[not found] ` <CAG4Ohu-6Rksa3UgirBAKBEuWst6gG2yc4EUWebfn2U=MU9FwnA@mail.gmail.com>
2013-09-04 17:10 ` Cutter 409
@ 2013-09-09 9:33 ` Stefan Hajnoczi
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-09-09 9:33 UTC (permalink / raw)
To: Cutter 409; +Cc: kvm
On Wed, Sep 04, 2013 at 10:35:56AM -0400, Cutter 409 wrote:
> Thanks, I'll try that. Do you know of any way to get at the VCPU structure
> from another process? I'm looking to have an event triggered from the guest
> which will notify my application. In Xen I use an event channel, and then I
> can call a function to retrieve the relevant VCPU context.
At this point it might be worthwhile to describe what you're trying to
achieve.
I can think of two ways to get vcpu state from a third process: QMP
monitor or kvm.ko file descriptors. (Ignoring the possibility of using
the gdbstub.)
But the cleanest and best way depends on what exactly you are trying to
do.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mapping guest memory from another process?
2013-09-04 17:10 ` Cutter 409
@ 2013-09-09 10:01 ` Paolo Bonzini
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2013-09-09 10:01 UTC (permalink / raw)
To: Cutter 409; +Cc: kvm
Il 04/09/2013 19:10, Cutter 409 ha scritto:
> Thanks, I'll try that. Do you know of any way to get at the VCPU
> structure from another process? I'm looking to have an event triggered
> from the guest which will notify my application. In Xen I use an event
> channel, and then I can call a function to retrieve the relevant VCPU
> context.
I think you could use the ivshmem device.
http://lwn.net/Articles/380869/
To QEMU, your application would look like a shared memory server.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-09 10:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAG4Ohu_ZxZodnVpA=ym0WdM++Bdhwkx8MUg69aQHG8kOfTUB=A@mail.gmail.com>
2013-09-03 23:56 ` Mapping guest memory from another process? Cutter 409
2013-09-04 8:47 ` Stefan Hajnoczi
[not found] ` <CAG4Ohu-6Rksa3UgirBAKBEuWst6gG2yc4EUWebfn2U=MU9FwnA@mail.gmail.com>
2013-09-04 17:10 ` Cutter 409
2013-09-09 10:01 ` Paolo Bonzini
2013-09-09 9:33 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox