WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Intercepting memory operations of a guest
From: "Sina Bahram" <sbahram@xxxxxxxxx>
Date: Mon, 8 Dec 2008 11:54:57 -0500
Delivery-date: Mon, 08 Dec 2008 08:55:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20081208101217.GQ25331@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Sina Bahram
References: <DD171F58596F42818CD66D989CA2EAD4@neutrino> <20081208101217.GQ25331@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AclZHXgP37niYN6ARJqszPOcW0XLNwANfn+Q
Hi Tim,

Thanks for your reply.

What do you mean by the statement that it won't catch "all changes" but only
those seen by the mmu?
 
Also, where can I read more about what enabling shadow page tables means for
pv guests?

The concept I want to implement is very similar, so I'd love to take
advantage of that, if I can.

Take care,
Sina

-----Original Message-----
From: Tim Deegan [mailto:Tim.Deegan@xxxxxxxxxx] 
Sent: Monday, December 08, 2008 5:12 AM
To: Sina Bahram
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: 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