From: LL Subject: using debug registers in hypervisor to intercept access to a function inside HVM Date: Sat, 28 Jul 2012 16:41:30 -0700 (PDT) Message-ID: <1343518890.44766.YahooMailClassic@web121605.mail.ne1.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3619056095737113715==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============3619056095737113715== Content-Type: multipart/alternative; boundary="2053635335-280497635-1343518890=:44766" --2053635335-280497635-1343518890=:44766 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello, I'd like to be able to trap one particular system call invoked in an HVM Wi= ndows machine using the Xen hypervisor. I am familiar with Ether implementa= tion that traps all system calls but I am only interested in intercepting 1= system call so Ether mplementation would add unnecessary overhead. My solu= tion to the problem is to set DR01 with the address of the system call (obt= ained from the SSDT table) and to set DR07 with global flag, which will res= ult in INT1 exception. I looked at the vmx.c code and it apprear INT1 in my= setup should be trapped in the=A0 vmx_vmexit_handler() routine under "case= TRAP_debug". Unfortunately, I never get inside "case TRAP_debug". I tried = setting the DR0 and DR07 registers in the vmx_save_dr() routine as well as = on each CR3 context switch but no luck so far in trapping the system call. = What am I missing in my implementation? Thank you, Jenny --2053635335-280497635-1343518890=:44766 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

I'd like to be able to trap one= particular system call invoked in an HVM Windows machine using the Xen hyp= ervisor. I am familiar with Ether implementation that traps all system call= s but I am only interested in intercepting 1 system call so Ether mplementa= tion would add unnecessary overhead. My solution to the problem is to set D= R01 with the address of the system call (obtained from the SSDT table) and = to set DR07 with global flag, which will result in INT1 exception. I looked= at the vmx.c code and it apprear INT1 in my setup should be trapped in the=   vmx_vmexit_handler() routine under "case TRAP_debug". Unfortunately,= I never get inside "case TRAP_debug". I tried setting the DR0 and DR07 reg= isters in the vmx_save_dr() routine as well as on each CR3 context switch b= ut no luck so far in trapping the system call. What am I missing in my implementation?

Thank you,
Jenny


--2053635335-280497635-1343518890=:44766-- --===============3619056095737113715== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============3619056095737113715==--