[vbox-dev] Running Guest Ring 0 Code Natively

Sander van Leeuwen sandervl at innotek.de
Thu Nov 8 19:36:27 GMT 2007


You don't know exactly which code pages will be touched unless you 
emulate each instruction.
You can protect the pages you're interested in (e.g. make them not 
present), but that requires some
hacking to force EM to go to the recompiler.


Ryan Riley wrote:
> I've been staring at that for a while and I think I've realized I may
> be trying to go about this the wrong way.  Let me try a different
> question a different way.  I have a list of memory pages that, if
> executed from, need to be executed using the recompiler.  I want to
> ensure that any instructions off of those pages are never run in raw
> mode.
>
> The trouble I'm having is determining, before the call to
> VMMR3HwAccRunGC(), which instructions may be run in raw mode by that
> call.  I don't even need it to be exact, I just need to know if one of
> the pages in my list has the potential to have code executed off of
> it.
>
> Thanks
> Ryan
>
> On Nov 8, 2007 5:45 AM, Sander van Leeuwen <sandervl at innotek.de> wrote:
>   
>> We already have code in place which does exactly that. There are limits
>> as to how much you can scan though.
>> See /src/VBox/VMM/PATM/CSAM.cpp, CSAMR3CheckCodeEx. Called before
>> executing ring 0 code in
>> raw mode (/src/VBox/VMM/EM.cpp).
>>
>>
>> Ryan Riley wrote:
>>     
>>> I'm doing a small hack on VirtualBox for a local research project and
>>> was hoping someone could point me in the right direction for what I
>>> want to do.  Basically, before a piece of guest ring 0 code gets
>>> executed, I want to know what addresses may potentially get run.  I
>>> can do this fairly easily by setting pVM->fRawR0Enabled=false and
>>> hacking the recompiler to check each instruction before translating it
>>> (which is what I do now) but for performance reasons I would really
>>> like to scan the code right before execution and let it run natively
>>> if there are no problems.  Does anyone have any thoughts on where I
>>> could get started?
>>>
>>> Thanks
>>> Ryan
>>>
>>> _______________________________________________
>>> vbox-dev mailing list
>>> vbox-dev at virtualbox.org
>>> http://vbox.innotek.de/mailman/listinfo/vbox-dev
>>>
>>>       
>> --
>> Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
>>    Sander van Leeuwen
>>
>> innoTek GmbH
>> sandervl at innotek.de
>> http://www.innotek.de
>> Germany
>>
>>
>>
>> _______________________________________________
>> vbox-dev mailing list
>> vbox-dev at virtualbox.org
>> http://vbox.innotek.de/mailman/listinfo/vbox-dev
>>
>>     
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev
>   


-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
  Sander van Leeuwen

innoTek GmbH
http://www.innotek.de
Germany 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20071108/6c38ba47/attachment.html>


More information about the vbox-dev mailing list