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

Re: [Xen-devel] Intercepting memory operations of a guest



At 01:15 -0500 on 07 Dec (1228612537), Sina Bahram wrote:
> #1: Is there anyway possible to trap/insert some code at/hook into, any
> modification of a PV guest's page table. Anything like a hypercall handler I
> can plugin to, a function or series of functions that always gets called,
> something I can provide a call back to, or anything else?

PV guest pagetable modifications are made through the MMU hypercalls in
arch/x86/mm.c, and the ptwr functions.  Eventually, I believer they all
call down to adjust_guest_l*e() or alloc_l*_table().  Or, you could
enable shadow pagetables and intercept shadow_set_l*e() and
sh_destroy_l*_shadow() in arch/x86/mm/shadow/multi.c

Intercepting those points doesn't catch _every_ change to a guest
pagetable but it is guaranteed to catch changes that could be seen by
the hardware MMU.
 
> Also, would such activities be easier or more difficult with hvm guests?

If you're using shadow mode, then the interception points would be the
same.  For hap (aka NPT/EPT) I can't think of an easy way to intercept
pagetable changes. 

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.