[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] Intercepting page access
Hi I am working in a research project I want to incercept pages access by guest virtual machine.My approach is setting higher priviledge in pages by setting changing the user/sypervisor priviledge bit in page table entry associated to this page. Here is the piece of code used void remove_access(l1_pgentry_t *pl1e){ l1_pgentry_t ol1e; l1_pgentry_t nl1e; unsigned int nmfn; if(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) == 0){ nl1e = ol1e; nmfn = l1e_get_pfn(ol1e); if(!(l1e_get_flags(ol1e)&_PAGE_GUEST_KERNEL)) { l1e_remove_flags(nl1e, _PAGE_USER);if(__copy_to_guest(pl1e, &nl1e, sizeof(nl1e)) != 0) printk("entry cannot be copied\n"); flush_tlb_all(); } }else printk("copy from user failed\n"); } the pointer pl1e is obtained when PTE is updated (in do_mm_update). in page fault handler (do_page_fault). I reset the access by this code void reset_access(l1_pgentry_t *pl1e, l1_pgentry_t ol1e) { l1_pgentry_t nl1e = ol1e; l1e_add_flags(nl1e, _PAGE_USER); __copy_to_guest(pl1e, &nl1e, sizeof(nl1e)); flush_tlb_all(); return; }but the problem is that my computer crash and it reboots. I don't know what is wrong with my code. I spend 2 weeks trying to solve this problem but I couldn't. Please I really need your help Thank you _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |