DragonFly BSD
DragonFly kernel List (threaded) for 2013-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [GSOC] Implement hardware nested page table support for vkernels


From: Mihai Carabas <mihai.carabas@xxxxxxxxx>
Date: Mon, 22 Jul 2013 11:48:00 +0300

--e89a8f643358e077b104e215bb6c
Content-Type: text/plain; charset=ISO-8859-1

Hello,

This week I've managed to enter and execute instructions in the VMX
non-root context (GUEST context). Also I've developed the logic of
entering/leaving the GUEST context. I had to handle all the pending
interrupts and the ASTs in order to let run other processes between my
vmlaunch-es (running a simple infinite loop and that system acts ok - it
remains interactive).

I also begin treating VMEXIT conditions,. Until now I handled the hardware
interrupts and exceptions. I enabled all exception types in the bitmap
exception of the VMCS (like page-faults, undefined instructions, etc). The
page-faults of the guest and the faults due to system call execution. Now
I'm able to execute system calls in guest context. A write(1, "test",4)
prints to console just ok.

The system calls exception are generated by disabling the EFER_SCE in GUEST
context, rising an UD exception (execution of ASM syscall raise UD if SCE
is disabled). Right now I consider the syscall ASM instruction the only one
that can throw UD exception. I have to create a mechanism to identify the
instruction that raised the UD by copying the instruction from the GUEST
memory and decode it using the DragonFly debugger code (I will reuse chunks
from there).

I have some problems with the stack mapping (I get some wierd page-faults
at address 0 when accessing the stack - I missed something about the stack
growing I guess). I will investigate this issue in order to go further and
run the vkernel process in the GUEST context.

The next week I will start running the vkernel and implement other VMexit
conditions (more will come like execution of instruction cpuid).

Thanks,
Mihai

--e89a8f643358e077b104e215bb6c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello,<div><br></div><div>This week I&#39;ve managed to en=
ter and execute instructions in the VMX non-root context (GUEST context). A=
lso I&#39;ve developed the logic of entering/leaving the GUEST context. I h=
ad to handle all the pending interrupts and the ASTs in order to let run ot=
her processes between my vmlaunch-es (running a simple infinite loop and th=
at system acts ok - it remains interactive).</div>
<div><br></div><div>I also begin treating VMEXIT conditions,. Until now I h=
andled the hardware interrupts and exceptions. I enabled all exception type=
s in the bitmap exception of the VMCS (like page-faults, undefined instruct=
ions, etc). The page-faults of the guest and the faults due to system call =
execution. Now I&#39;m able to execute system calls in guest context. A wri=
te(1, &quot;test&quot;,4) prints to console just ok.</div>
<div><br></div><div>The system calls exception are generated by disabling t=
he EFER_SCE in GUEST context, rising an UD exception (execution of ASM sysc=
all raise UD if SCE is disabled). Right now I consider the syscall ASM inst=
ruction the only one that can throw UD exception. I have to create a mechan=
ism to identify the instruction that raised the UD by copying the instructi=
on from the GUEST memory and decode it using the DragonFly debugger code (I=
 will reuse chunks from there).</div>
<div><br></div><div>I have some problems with the stack mapping (I get some=
 wierd page-faults at address 0 when accessing the stack - I missed somethi=
ng about the stack growing I guess). I will investigate this issue in order=
 to go further and run the vkernel process in the GUEST context.</div>
<div><br></div><div>The next week I will start running the vkernel and impl=
ement other VMexit conditions (more will come like execution of instruction=
 cpuid).</div><div><br></div><div>Thanks,</div><div>Mihai</div></div>

--e89a8f643358e077b104e215bb6c--



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]