From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hui Kang Subject: Intercept system call trap on Xen, Date: Tue, 7 Jun 2011 16:39:46 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0554580199==" Return-path: Content-Language: en-US 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 --===============0554580199== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CA13CC915DAFhkangcsstonybrookedu_" --_000_CA13CC915DAFhkangcsstonybrookedu_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, I have a question regarding intercepting the system call from a guest kerne= l on hypervisor. I am using xen-4.0.1 with a PV-guest. To disable the fast system call which bypasses the hypervisor, I first comm= ent out this lines in the file Xen/arch/x86/traps.c If (cur.vector =3D=3D 0x80) { /* init_int80_direct_trap(curr); */ } To verify this, when I boot the kernel, I add printk and see that init_int8= 0_direct_trap is not executed. Then in the function in the same file as above, do_guest_trap, I add a prin= tk to trap the system call from guest kernel Static void do_guest_trap=85 { If (trapnr =3D=3D 0x80) printk("System call from guest"); } However, when I run some program in the guest kernel to issue some system c= all, the hypervisor does not print out the message. Can anyone help on this= ? Thanks. - Hui --_000_CA13CC915DAFhkangcsstonybrookedu_ Content-Type: text/html; charset="Windows-1252" Content-ID: <02FB3918E1F3784396B488EA0C517754@cs.stonybrook.edu> Content-Transfer-Encoding: quoted-printable
Hi, 
I have a question regarding intercepting the system call from a guest = kernel on hypervisor. I am using xen-4.0.1 with a PV-guest. 
To disable the fast system call which bypasses the hypervisor, I first= comment out this lines in the file
Xen/arch/x86/traps.c
      If (cur.vector =3D=3D 0x80)
       {
 =    /* init_int80_direct= _trap(curr); */
}
To verify this, when I boot the kernel, I add printk and see that init= _int80_trap is not executed. 

Then in the function in the same file as above, do_guest_trap, I add a printk to trap the system call f= rom guest kernel

Static void do_guest_trap=85=
{
If (trapnr =3D=3D 0x80)
printk("System call from guest");
}

However, when I run some program in the guest kernel to issue some sys= tem call, the hypervisor does not print out the message. Can anyone help on= this? Thanks. 

- Hui

--_000_CA13CC915DAFhkangcsstonybrookedu_-- --===============0554580199== 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.xensource.com http://lists.xensource.com/xen-devel --===============0554580199==--