From: "Emre Can Sezer" Subject: HVM page table management Date: Mon, 20 Oct 2008 17:38:56 -0400 (EDT) Message-ID: <4095.152.14.92.134.1224538736.squirrel@webmail.ncsu.edu> References: <13a1c1400810200314h59707fd3r180aad12270babb1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi, As part of my research I'm trying to monitor how various LKM's within a guest kernel interact with each other and the base kernel. For this and some other reasons I would like to set page permissions to non-executable depending on who's code is running. I have a few areas I'm having difficulty with. I'd appreciate any help or pointers. I'm running a x86_64 HVM guest on Xen 3.2.2. For each LKM (guest kernel), I have a list of pages that belong to the LKM. I pass this information to Xen with the pfn's of the pages. So in Xen context these should be gfn's I guess. Is there an easy way to find the pte in the shadow page table associated with this guest page and modify it? Is there an easy way to tell whether a virtual address is in guest kernel or user space? It seems like guest_kernel_mode(v,r) in include/asm-x86/x86_64/regs.h is meant for PV guests and not for HVM. Is it possible to change permissions at lvl 2 page tables while keeping the lvl 1's intact? Do the permissions propagate from lvl 2 to lvl 1?=20 Finally, what's the lowest level I can set permissions on? Does the hardware check for permissions at lvl 4 or lvl 3? Thanks in advance, John