[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-users] intercept and capture fast system call of linux
Now I attach the code to my question hi all, I want to intercept and capture fast system call of linux. (1)I set GUEST_SYSENTER_EIP to 0xDDDDD0AE in vmx_vmexit_handler, and save the real value. in vmx_vmexit_handler() { .... //yandong return ... } inline void vmx_properly_set_trap_flag(struct domain *d) } /* force user supplied msr values on this guest */ (2)When a fast syscall come, I will caputue it in sh_page_fault. (3) Then I set the real GUEST_SYSENTER_EIP(c0103ef0, ia32_sysenter_target) to GUEST_RIP. static int sh_page_fault(struct vcpu *v, ... } But, I encounter Infinite loops as below. I always capture the same syscall. In sh_page_fault, I have successfully set c0103ef0 to GUEST_RIP.But I still capure a page fault , the GUEST_RIP is ddddd0ae. why? Thank you very much. (XEN) MIT SYSCALL 7 (XEN) MITCTL: sh_page_fault syscall real_rip ddddd0ae ddddd0ae (XEN) MITCTL: sh_page_fault syscall real_rip ddddd0ae (XEN) MITCTL: sh_page_fault syscall real_rip c0103ef0 (XEN) MITCTL:vmx_set_sysenter_msrs GUEST_SYSENTER_EIP ddddd0ae 60 (XEN) vmx_vmenter_helper MITCTL: sh_page_fault syscall real_rip c0103ef0 (XEN) TRAP_page_fault (XEN) MIT SYSCALL 7 (XEN) MITCTL: sh_page_fault syscall real_rip ddddd0ae ddddd0ae (XEN) MITCTL: sh_page_fault syscall real_rip ddddd0ae (XEN) MITCTL: sh_page_fault syscall real_rip c0103ef0 (XEN) MITCTL:vmx_set_sysenter_msrs GUEST_SYSENTER_EIP ddddd0ae 60 (XEN) vmx_vmenter_helper MITCTL: sh_page_fault syscall real_rip c0103ef0 (XEN) TRAP_page_fault (XEN) MIT SYSCALL 7 Best Regards Yes, I take the chance that 0xddddd0ae is unmapped within the p2m. Fast system call does not trap into xen. It use an instruction called sysenter. > -----ååéä----- > åää: "Ian Campbell" <ian.campbell@xxxxxxxxxx> > åéæé: 2014å2æ28æ ææä > æää: "éèä" <hanyandong@xxxxxxxxx> > æé: xen-users@xxxxxxxxxxxxxxxxxxx > äé: Re: [Xen-users] intercept and capture fast system call of linux > > On Fri, 2014-02-28 at 12:50 +0800, éèä wrote: > > hi, > > I want to intercept and capture fast system call of linux. > > (1)I set GUEST_SYSENTER_EIP to 0xDDDDD0AE in vmx_vmexit_handler, and > > save the real value. > > Are you taking the chance that 0xddddd0ae is unmapped within the p2m? Is > there not an explicit trap for syscalls in the VMCS? > > > (2)When a fast syscall come, I will caputue it in sh_page_fault. > > (3) Then I set the real GUEST_SYSENTER_EIP(c0103ef0, > > ia32_sysenter_target) to GUEST_RIP. > > Are you sure that setting GUEST_RIP is sufficient to cause the guest to > switch to that when you reenter? Is there nothing else you need to > change/update in order to simulate the affect of a syscall from the > guest PoV? > > You might find it helpful to publish your actual code so people can see > what you've actually done.. > > You might also want to post to the -devel list instead. > > Ian. > > > > _______________________________________________ > Xen-users mailing list > Xen-users@xxxxxxxxxxxxx > http://lists.xen.org/xen-users _______________________________________________ Xen-users mailing list Xen-users@xxxxxxxxxxxxx http://lists.xen.org/xen-users
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |