From: Hollis Blanchard Date: Fri, 06 Mar 2009 23:01:10 +0000 Subject: Re: How is code passed for KVM_RUN? Message-Id: <1236380470.26866.61.camel@slate.austin.ibm.com> List-Id: References: <7d08b87d0903061447n611fd716v517ebffa2745b24e@mail.gmail.com> In-Reply-To: <7d08b87d0903061447n611fd716v517ebffa2745b24e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Fri, 2009-03-06 at 17:47 -0500, Christoffer Dall wrote: > Hi. > > We are a small group trying to port KVM to ARM and taking inspiration > in the work done for PowerPC. > > We are just beginning to understand KVM, so bear with us for noob > questions. We are willing to put a lot of work into this though. Sounds like fun. > When going through the code in booke_interrupts.S, I can see that the > execution of code is performed by the rfi instruction, which jumps to > the location stored in the vcpu struct, but I cannot see how the > actual code to run is ever loaded in that place. > > I have tried going through the userspace code as well, but I am unsure > if loading the code for execution happens through mmap, a page fault > signal or ...? Guest code is just copied into place by userspace. Probably the easiest example of this is in user/main-ppc.c, which just loads a flat binary. (Qemu has loaders for ELF and uImages.) Userspace allocates memory, then tells the kernel where that is (look for memslot registration). -- Hollis Blanchard IBM Linux Technology Center