Bug
Harry
Harry
Offline
0
I'm a beginner, but I want to use xen hypervisor to help me to do something. To intercept the system call, I've modified the traps.c.

void __cpuinit init_traps(void)
{
/* Setup Hyp vector base */
WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);

/* Setup hypervisor traps */
WRITE_SYSREG(HCR_TGE|HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM|HCR_TWI|HCR_TSC|
HCR_TAC, HCR_EL2);
isb();
}

I added the HCR_TGE in the init_traps as a arguement of the WRITE_SYSREG to intercept the system call.

I added a case in the do_trap_hypervisor as follows:
case HSR_EC_SVC32:
printk("HSR_EC_SVC32\n");
do_system_trap(regs);
break;

in the function do_system_trap, there only some print.

But when I execute it, there is a kernel panic as follows:

(XEN) HSR_EC_SVC32
(XEN) systemcall_num=e0 target is 0x36
(XEN) HSR_EC_SVC32
(XEN) systemcall_num=f0005 target is 0x36
[ 5.192804] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 5.192804]
[ 5.208293] CPU: 1 PID: 1 Comm: init Not tainted 3.15.0-rc5+ #84
[ 5.217451] [<80017dc4>] (unwind_backtrace) from [<800138f8>] (show_stack+0x20/0x24)
[ 5.230058] [<800138f8>] (show_stack) from [<807864a4>] (dump_stack+0x70/0xc0)
[ 5.241631] [<807864a4>] (dump_stack) from [<80781030>] (panic+0x9c/0x204)
[ 5.252506] [<80781030>] (panic) from [<8002c900>] (do_exit+0x86c/0x9f0)
[ 5.263032] [<8002c900>] (do_exit) from [<8002cbc0>] (do_group_exit+0x4c/0xcc)
[ 5.274605] [<8002cbc0>] (do_group_exit) from [<8003b5dc>] (get_signal_to_deliver+0x37c/0x71c)
[ 5.288951] [<8003b5dc>] (get_signal_to_deliver) from [<80780aec>] (do_signal+0xb4/0x380)
[ 5.302429] [<80780aec>] (do_signal) from [<800131a8>] (do_work_pending+0x8c/0xe0)
[ 5.314695] [<800131a8>] (do_work_pending) from [<8000f680>] (work_pending+0xc/0x20)
[ 5.327336] CPU0: stopping
[ 5.330080] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.15.0-rc5+ #84
[ 5.340090] [<80017dc4>] (unwind_backtrace) from [<800138f8>] (show_stack+0x20/0x24)
[ 5.352697] [<800138f8>] (show_stack) from [<807864a4>] (dump_stack+0x70/0xc0)
[ 5.364267] [<807864a4>] (dump_stack) from [<80015e34>] (handle_IPI+0x1c4/0x204)
[ 5.376191] [<80015e34>] (handle_IPI) from [<80008624>] (gic_handle_irq+0x74/0x7c)
[ 5.388448] [<80008624>] (gic_handle_irq) from [<800144c0>] (__irq_svc+0x40/0x70)
[ 5.400532] Exception stack(0x80b49f08 to 0x80b49f50)
[ 5.407757] 9f00: ffffffed 00000000 00000001 00000000 00000000 00000000
[ 5.421228] 9f20: ffffffed 80ae7848 8078f4ac 80baa024 80b50550 80b49f5c 80b49f60 80b49f50
[ 5.434705] 9f40: 80010b50 80010b54 60000113 ffffffff
[ 5.441938] [<800144c0>] (__irq_svc) from [<80010b54>] (arch_cpu_idle+0x38/0x40)
[ 5.453858] [<80010b54>] (arch_cpu_idle) from [<800698f4>] (cpu_startup_entry+0x178/0x548)
[ 5.467516] [<800698f4>] (cpu_startup_entry) from [<8077dc90>] (rest_init+0x80/0x98)
[ 5.480131] [<8077dc90>] (rest_init) from [<80a96c18>] (start_kernel+0x404/0x46c)
[ 5.492221] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 5.492221]

I can know after two times to the hypervisor, there is a kernel panic.

I use the xen-4.4, and run it on the arndale5250, dom0 is a Android, although the Android can't totally work.

Thanks,
Responses (1)
  • Accepted Answer

    Monday, August 11 2014, 01:34 PM - #permalink
    0
    Hey Harry,

    Since this question deals with modifying the code, I strongly suggest taking this to the xen-devel mailing list. You will need the eyes of developers on this one and xen-devel is the place where they hang out. We don't get too many developers who stop by this forum, as we try to focus on more basic questions here.

    You can find information about using xen-devel here:

    http://www.xenproject.org/help/mailing-list.html

    Russ
    The reply is currently minimized Show
Your Reply