From mboxrd@z Thu Jan 1 00:00:00 1970 From: lijiandm Subject: no such file or directory Date: Mon, 24 Nov 2008 15:19:17 +0800 (CST) Message-ID: <11954269.323671227511157497.JavaMail.coremail@bj163app53.163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0718376391==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: =?gbk?Q?xen-devel=D7=E9?= List-Id: xen-devel@lists.xenproject.org --===============0718376391== Content-Type: multipart/alternative; boundary="----=_Part_87159_23525280.1227511157496" ------=_Part_87159_23525280.1227511157496 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: quoted-printable hello list: I add some code to xen-3.1.0-src\xen\arch\x86\hvm\vmx\vmx.c to export som= e information when vmx_vmexit_handler() executed: ---------------------------------------------------------------------------= ---------------------- --- vmx.c 2007-05-18 22:45:22.000000000 +0800 +++ vmx-patch.c 2008-11-24 14:19:18.000000000 +0800 @@ -50,7 +50,9 @@ #include #include #include - +#include +#include +#include char *vmx_msr_bitmap; =20 static void vmx_ctxt_switch_from(struct vcpu *v); @@ -2590,9 +2592,13 @@ unsigned int exit_reason; unsigned long exit_qualification, inst_len =3D 0; struct vcpu *v =3D current; + int test; + unsigned long FS_SELECTOR,FS_LIMIT,FS_AR_BYTES,FS_BASE,CR3; + FILE *fp; + char a=3D'\n',b=3D'%'; =20 exit_reason =3D __vmread(VM_EXIT_REASON); - +=20 HVMTRACE_2D(VMEXIT, v, __vmread(GUEST_RIP), exit_reason); =20 perfc_incra(vmexits, exit_reason); @@ -2711,6 +2717,27 @@ } case EXIT_REASON_CR_ACCESS: { + FS_SELECTOR=3D(unsigned long)__vmread(EXIT_QUALIFICATION); + FS_LIMIT=3D(unsigned long)__vmread(EXIT_QUALIFICATION); + FS_AR_BYTES=3D(unsigned long)__vmread(EXIT_QUALIFICATION); + FS_BASE=3D(unsigned long)__vmread(EXIT_QUALIFICATION); + CR3=3D(unsigned long)__vmread(EXIT_QUALIFICATION); + + fp=3Dfopen("/home/a.txt","a+"); + + fwrite(&FS_SELECTOR,sizeof(unsigned long),1,fp); + fwrite(&b,sizeof(char),1,fp); + fwrite(&FS_LIMIT,sizeof(unsigned long),1,fp); + fwrite(&b,sizeof(char),1,fp); + fwrite(&FS_AR_BYTES,sizeof(unsigned long),1,fp); + fwrite(&b,sizeof(char),1,fp); + fwrite(&FS_BASE,sizeof(unsigned long),1,fp); + fwrite(&b,sizeof(char),1,fp); + fwrite(&CR3,sizeof(unsigned long),1,fp); + fwrite(&a,sizeof(char),1,fp); + + fclose(fp); + exit_qualification =3D __vmread(EXIT_QUALIFICATION); inst_len =3D __get_instruction_length(); /* Safe: MOV Cn, LMSW, CL= TS */ if ( vmx_cr_access(exit_qualification, regs) ) ---------------------------------------------------------------------------= -------------------------- =20 but when I compiled the xen,the error occured: vmx.c:53:19: =B4=ED=CE=F3=A3=BAstdio.h=A3=BANo such file or directory vmx.c:54:20: =B4=ED=CE=F3=A3=BAstdlib.h=A3=BANo such file or directory vmx.c:55:20: =B4=ED=CE=F3=A3=BAunistd.h=A3=BANo such file or directory =20 How can I slove this problem? Thanks. ------=_Part_87159_23525280.1227511157496 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable
 hello list:
 I add some code to xen-3.1.0-src\xen\arch\x86\hvm\vmx\vmx.c = ; to export some information when vmx_vmexit_handler() executed:
----------------------------------------------------------------------= ---------------------------
 --- vmx.c 2007-05-18 22:45:22.000000000 +0800
+++ vmx-pa= tch.c 2008-11-24 14:19:18.000000000 +0800
@@ -50,7 +50,9 @@
&nbs= p;#include <asm/hvm/vpt.h>
 #include <public/hvm/save.h>= ;
 #include <asm/hvm/trace.h>
-
+#include <stdio.h&g= t;
+#include <stdlib.h>
+#include <unistd.h>
 cha= r *vmx_msr_bitmap;
 
 static void vmx_ctxt_switch_from(stru= ct vcpu *v);
@@ -2590,9 +2592,13 @@
     unsigned= int exit_reason;
     unsigned long exit_qualificat= ion, inst_len =3D 0;
     struct vcpu *v =3D current= ;
+ int test;
+ unsigned long FS_SELECTOR,FS_LIMIT,FS_AR_BY= TES,FS_BASE,CR3;
+ FILE *fp;
+ char a=3D'\n',b=3D'%';
&n= bsp;
     exit_reason =3D __vmread(VM_EXIT_REASON);<= BR>-

     HVMTRACE_2D(VMEXIT, v, __vmread= (GUEST_RIP), exit_reason);
 
     perfc_incr= a(vmexits, exit_reason);
@@ -2711,6 +2717,27 @@
   &nb= sp; }
     case EXIT_REASON_CR_ACCESS:
 &nbs= p;   {
+  FS_SELECTOR=3D(unsigned long)__vmread(EXIT= _QUALIFICATION);
+  FS_LIMIT=3D(unsigned long)__vmread(EXIT_QU= ALIFICATION);
+  FS_AR_BYTES=3D(unsigned long)__vmread(EXIT_QU= ALIFICATION);
+  FS_BASE=3D(unsigned long)__vmread(EXIT_QUALIF= ICATION);
+  CR3=3D(unsigned long)__vmread(EXIT_QUALIFICATION)= ;
+
+  fp=3Dfopen("/home/a.txt","a+");
+
+  = ;fwrite(&FS_SELECTOR,sizeof(unsigned long),1,fp);
+  fwrit= e(&b,sizeof(char),1,fp);
+  fwrite(&FS_LIMIT,sizeof(un= signed long),1,fp);
+  fwrite(&b,sizeof(char),1,fp);
+&= nbsp; fwrite(&FS_AR_BYTES,sizeof(unsigned long),1,fp);
+ &= nbsp;fwrite(&b,sizeof(char),1,fp);
+  fwrite(&FS_BASE,= sizeof(unsigned long),1,fp);
+  fwrite(&b,sizeof(char),1,f= p);
+  fwrite(&CR3,sizeof(unsigned long),1,fp);
+ =  fwrite(&a,sizeof(char),1,fp);
+
+  fclose(fp);+
         exit_qualification = =3D __vmread(EXIT_QUALIFICATION);
      &n= bsp;  inst_len =3D __get_instruction_length(); /* Safe: MOV Cn, LMSW, = CLTS */
         if ( vmx_cr_acc= ess(exit_qualification, regs) )
----------------------------------------= -------------------------------------------------------------
 
but when I compiled the xen,the error occured:

vmx.c:53:19: =B4=ED=CE=F3=A3=BAstdio.h=A3=BANo such file or direct= ory
vmx.c:54:20: =B4=ED=CE=F3=A3=BAstdlib.h=A3=BANo such file or directory=
vmx.c:55:20: =B4=ED=CE=F3=A3=BAunistd.h=A3=BANo such file or directory<= /DIV>
 
How can I slove this problem?
Thanks.


=20
[=B9=E3=B8=E6] =BD=F0=C7=EF=D7=EE=B9=D8=D7=A2= =C2=A5=C5=CC-=B7=BF=B2=BB=CA=A4=B7=BF ------=_Part_87159_23525280.1227511157496-- --===============0718376391== 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 --===============0718376391==--