veerasena reddy
2011-Jun-29 11:55 UTC
[Xen-devel] problem in accessing dom0 page from domU PVHVM guest
Hi, I could successfully access domU page from dom0 but when i tried accessing dom0 page from domU the grant table operations are successful but when i tried to print the contents of the mapped page, it crashes with page fault message "BUG: unable to handle kernel paging request at ffffc90000590000". Please find below the relevant domU module source and the crash dump. Can anyone please help me in fixing this? Thanks in Advance. Regards, VSR. ======= domU code ======= struct vm_struct *v_start; printk("\nxen: domU: init_module with gref = %d", gref); <<-- gref (grant reference is passed as a module parameter) // The following function reserves a range of kernel address space and // allocates pagetables to map that range. No actual mappings are created. v_start = *alloc_vm_area*(PAGE_SIZE); if (v_start == 0) { free_vm_area(v_start); printk("\nxen: dom0: could not allocate page"); return -EFAULT; } * gnttab_set_map_op*(&ops, (unsigned long)v_start->addr, * GNTMAP_host_map*, gref, 0); /* flags, ref, domID */ if (*HYPERVISOR_grant_table_op*(GNTTABOP_map_grant_ref, &ops, 1)) { printk("\nxen: domU: HYPERVISOR map grant ref failed"); return -EFAULT; } if (ops.status) { printk("\nxen: domU: HYPERVISOR map grant ref failed status %d", ops.status); } printk("\nxen: domU: shared_page = %p, handle = %x, status = %x", v_start->addr, ops.handle, ops.status); printk("\nContents of the mapped page "); for(i=0;i<=10;i++) { printk("%c", ((char*)(v_start->addr))[i]); <<<--- *crashes here* } ========= crash message (on DomU) ========root@PVHVM-domU:~/test_programs/page_share_interdomain# dmesg -c [16259.922417] xen: domU: init_module with gref = 9 <<<<<--- grant ref passes as module param [16259.928763] xen: domU: shared_page = ffffc90000590000, handle = 3, status = 0 <<<<<--- the status code shows SUCCESS [16259.928871] Contents of the mapped page <<<<<<<<<<--- trying to print the bytes in page; crash !!!! [16259.929126] BUG: unable to handle kernel paging request at ffffc90000590000 [16259.929130] IP: [<ffffffffa010b185>] init_module+0x155/0x17c [domu_share2] [16259.929144] PGD 3fd25067 PUD 3fd26067 PMD 3e667067 PTE 0 [16259.929178] Oops: 0000 [#3] SMP ========================== _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel