Re: [Xen-devel] what's inside hypercall page?
What I want to do is predict how many instructions a hypercall entry of hypercall page (not hypercall handler) would execute before it finishes. Take HYPERVISOR_iret as an example, it precisely executes five instructions then call the hypercall handler, and it doesn't return so it just finish. But other hypercall entries expect a return value of syscall and might be interrupted during the execution, just as what you said about do_sched_up and do_xen_version, so it is hard to predict. Is there any solution to this problem? Just like syscall table, how can I predict how many instructions the syscall entries would execute before it actually go to the handler, thus accurately set traps to the syscall? > Subject: Re: [Xen-devel] what's inside hypercall page? > To: quizy_jo...@outlook.com; xen-de...@lists.xenproject.org > From: jgr...@suse.com > Date: Thu, 3 Mar 2016 06:28:06 +0100 > > On 03/03/16 01:56, quizyjones wrote: > >> do_sched_op is self explaining: it is used for scheduling of the vcpu. > >> A vcpu going to idle is using this hypercall. So any interrupt waking > >> the vcpu up will seem to occur very near to the hypercall. > > > >> do_xen_version is often used as a very fast way to execute the check > >> for pending events in the hypervisor (kind of polling). > > > >> do_multicall might run for a long time. So the hypervisor returns to > >> the caller from time to time setting IP to the hypercall. The caller > >> has the chance to react to interrupts and will then continue the > >> hypercall. > >> > >> > >> HTH, Juergen > > > > > > Thanks for the replying. Does that mean we cannot predict when will > > these two hypercalls finish? I want to set up an interval to monitor the > > instructions (one time monitor per hypercall), so as to reduce the > > performance cost. This requires an accurate prediction of instructions' > > execution so as to avoid missing hypercalls. Is that possible? The main > > problem is the execution of syscall (0x050f), as each hypercall behaves > > different, how can I predict where will it go after the syscall returns? > > You can't predict how long a hypercall will run, as this depends on multiple > factors, like the overall load of the host, values of parameters, ... > > A hypercall is by it's nature much more complicated than e.g. a simple > arithmetic operation. > > What exactly do you want to achieve? > > > Juergen > 自动判断中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语自动选择中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语有道翻译百度翻译必应翻译谷歌翻译谷歌翻译(国内)翻译朗读复制正在查询,请稍候……重试朗读复制复制朗读复制via 译 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] what's inside hypercall page?
> do_sched_op is self explaining: it is used for scheduling of the vcpu. > A vcpu going to idle is using this hypercall. So any interrupt waking > the vcpu up will seem to occur very near to the hypercall. > do_xen_version is often used as a very fast way to execute the check > for pending events in the hypervisor (kind of polling). > do_multicall might run for a long time. So the hypervisor returns to > the caller from time to time setting IP to the hypercall. The caller > has the chance to react to interrupts and will then continue the > hypercall. > > > HTH, Juergen Thanks for the replying. Does that mean we cannot predict when will these two hypercalls finish? I want to set up an interval to monitor the instructions (one time monitor per hypercall), so as to reduce the performance cost. This requires an accurate prediction of instructions' execution so as to avoid missing hypercalls. Is that possible? The main problem is the execution of syscall (0x050f), as each hypercall behaves different, how can I predict where will it go after the syscall returns? 自动判断中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语自动选择中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语有道翻译百度翻译必应翻译谷歌翻译谷歌翻译(国内)翻译朗读复制正在查询,请稍候……重试朗读复制复制朗读复制via 译 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] what's inside hypercall page?
After step by step monitoring, I get the following statistics about hypercall entries: numbers | hypercalls | executed bytes (offset to hypercall entry) 7755 24: 0 1 3 8 a c d 6374 23: 0 1 3 4 9 3281 25: 0 1 3 8 a c d 2979 13: 0 1 3 8 a c d 2475 17: 0 1 3 8 2253 17: a c d749 3: 0 1 3 8 a c d655 23: 0 1 3 4 9 0 1 3 4 9640 29: 0 1 3 8636 29: a c d445 23: 0 1 3 4 9 0 1 3 4 9 0 1 3 4 9433 23: 0 1 3 4 9 0 1 3 4 9 0 1 3 4 9 0 1 3 4 9414 24: 0 1 3 8 a c d 0 1 3 8 a c d274 13: 0 1 3 8 8 a c d129 17: d125 17: a c 112 29: a c d 0 1 3 8112 17: c d105 17: a 73 24: 0 1 3 8 a c d 0 1 3 8 a c d 0 1 3 8 a c d 67 17: 0 59 17: 8 a c d 54 17: 0 1 3 53 17: 0 1 50 17: 1 3 8 a c d 46 17: 3 8 a c d 21 3: 0 1 3 8 a c d 0 1 3 8 a c d 8 33: 0 1 3 8 a c d 7 17: 1 3 6 13: 0 1 3 8 8 8 a c d 5 29: d 5 23: 0 1 3 4 9 0 1 3 4 9 0 1 3 4 9 0 1 3 4 9 0 1 3 4 9 4 29: a c 4 17: 3 3 17: 8 a 3 17: 8 3 17: 3 8 3 17: 1 3 8 a c 3 17: 1 2 29: 0 1 3 8 a c d 2 17: 3 8 a 2 17: 1 3 8 a 2 17: 1 3 8 1 29: c 1 29: a 1 29: 3 8 a c d 1 29: 1 3 8 a c d 1 29: 0 1 1 29: 0 1 17: 3 8 a c From the above we can see that hypercall #17 and #29 are very irregular, with various combination occurs. Other hypercalls basically obey to the sequence of "0 1 3 8 a c d" which conforms to the content in hypercall_page_initialise function. HYPERCALL_iret is a special one as explained in the function, but it also conforms to its sequence of "0 1 3 4 9". So why would #17(do_xen_version) and #29(do_sched_op) performs irregular? They seem to be easily interrupted at any place of the hypercall entry. Besides, there is also some abnormals for #13(do_multicall) shown in bold. From: quizy_jo...@outlook.com To: xen-de...@lists.xenproject.org Date: Wed, 2 Mar 2016 12:44:16 + Subject: Re: [Xen-devel] what's inside hypercall page? For following hypercall page initialise code, where would the execution jumps at syscall? How can I predict what is the execution order of "pop %r11"? Is it the fifth instruction/step? I need the order to precisely set up hooks to monitor hypercalls. static void hypercall_page_initialise_ring3_kernel(void *hypercall_page){ char *p;int i; /* Fill in all the transfer points with template machine code. */for ( i = 0; i < (PAGE_SIZE / 32); i++ ){if ( i == __HYPERVISOR_iret ) continue; p = (char *)(hypercall_page + (i * 32));*(u8 *)(p+ 0) = 0x51; /* push %rcx */*(u16 *)(p+ 1) = 0x5341; /* push %r11 */*(u8 *)(p+ 3) = 0xb8;/* mov $,%eax */*(u32 *)(p+ 4) = i; *(u16 *)(p+ 8) = 0x050f; /* syscall */*(u16 *)(p+10) = 0x5b41; /* pop %r11 */*(u8 *)(p+12) = 0x59;/* pop %rcx */*(u8 *)(p+13) = 0xc3;/* ret */} /* * HYPERVISOR_iret is special because it doesn't return and expects a * special stack frame. Guests jump at this transfer point instead of * calling it. */p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32)); *(u8 *)(p+ 0) = 0x51;/* push %rcx */*(u16 *)(p+ 1) = 0x5341; /* push %r11 */*(u8 *)(p+ 3) = 0x50;/* push %rax */*(u8 *)(p+ 4) = 0xb8;/* mov $__HYPERVISOR_iret,%eax */*(u32 *)(p+ 5) = __HYPERVISOR_iret;*(u16 *)(p+ 9) = 0x050f; /* syscall */ 自动判断中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语自动选择中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语有道翻译百度翻译必应翻译谷歌翻译谷歌翻译(国内)翻译朗读复制正在查询,请稍候……重试朗读复制复制朗读复制via 译 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] what's inside hypercall page?
For following hypercall page initialise code, where would the execution jumps at syscall? How can I predict what is the execution order of "pop %r11"? Is it the fifth instruction/step? I need the order to precisely set up hooks to monitor hypercalls. static void hypercall_page_initialise_ring3_kernel(void *hypercall_page){ char *p;int i; /* Fill in all the transfer points with template machine code. */for ( i = 0; i < (PAGE_SIZE / 32); i++ ){if ( i == __HYPERVISOR_iret ) continue; p = (char *)(hypercall_page + (i * 32));*(u8 *)(p+ 0) = 0x51; /* push %rcx */*(u16 *)(p+ 1) = 0x5341; /* push %r11 */*(u8 *)(p+ 3) = 0xb8;/* mov $,%eax */*(u32 *)(p+ 4) = i; *(u16 *)(p+ 8) = 0x050f; /* syscall */*(u16 *)(p+10) = 0x5b41; /* pop %r11 */*(u8 *)(p+12) = 0x59;/* pop %rcx */*(u8 *)(p+13) = 0xc3;/* ret */} /* * HYPERVISOR_iret is special because it doesn't return and expects a * special stack frame. Guests jump at this transfer point instead of * calling it. */p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32)); *(u8 *)(p+ 0) = 0x51;/* push %rcx */*(u16 *)(p+ 1) = 0x5341; /* push %r11 */*(u8 *)(p+ 3) = 0x50;/* push %rax */*(u8 *)(p+ 4) = 0xb8;/* mov $__HYPERVISOR_iret,%eax */*(u32 *)(p+ 5) = __HYPERVISOR_iret;*(u16 *)(p+ 9) = 0x050f; /* syscall */ From: quizy_jo...@outlook.com To: xen-de...@lists.xenproject.org Date: Wed, 2 Mar 2016 03:50:55 + Subject: [Xen-devel] what's inside hypercall page? I've got the hypercall_page_initialize function as follows. As the size of each hypercall page entry is 32B and the initialize function only assigns value to the first 8B, is the remaining space empty or initialized afterwards? static void hypercall_page_initialise_ring1_kernel(void *hypercall_page){ char *p;int i; /* Fill in all the transfer points with template machine code. */ for ( i = 0; i < (PAGE_SIZE / 32); i++ ){if ( i == __HYPERVISOR_iret )continue; p = (char *)(hypercall_page + (i * 32));*(u8 *)(p+ 0) = 0xb8; /* mov $,%eax */*(u32 *)(p+ 1) = i;*(u16 *)(p+ 5) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int $xx */ //0x82cd*(u8 *)(p+ 7) = 0xc3;/* ret */} /* * HYPERVISOR_iret is special because it doesn't return and expects a * special stack frame. Guests jump at this transfer point instead of * calling it. */p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32)); *(u8 *)(p+ 0) = 0x50;/* push %eax */*(u8 *)(p+ 1) = 0xb8;/* mov $__HYPERVISOR_iret,%eax */*(u32 *)(p+ 2) = __HYPERVISOR_iret;*(u16 *)(p+ 6) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int $xx */ //0x82cd}自动判断中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语自动选择中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语有道翻译百度翻译必应翻译谷歌翻译谷歌翻译(国内)翻译朗读复制正在查询,请稍候……重试朗读复制复制朗读复制via 译 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] what's inside hypercall page?
I've got the hypercall_page_initialize function as follows. As the size of each hypercall page entry is 32B and the initialize function only assigns value to the first 8B, is the remaining space empty or initialized afterwards? static void hypercall_page_initialise_ring1_kernel(void *hypercall_page){ char *p;int i; /* Fill in all the transfer points with template machine code. */ for ( i = 0; i < (PAGE_SIZE / 32); i++ ){if ( i == __HYPERVISOR_iret )continue; p = (char *)(hypercall_page + (i * 32));*(u8 *)(p+ 0) = 0xb8; /* mov $,%eax */*(u32 *)(p+ 1) = i;*(u16 *)(p+ 5) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int $xx */ //0x82cd*(u8 *)(p+ 7) = 0xc3;/* ret */} /* * HYPERVISOR_iret is special because it doesn't return and expects a * special stack frame. Guests jump at this transfer point instead of * calling it. */p = (char *)(hypercall_page + (__HYPERVISOR_iret * 32)); *(u8 *)(p+ 0) = 0x50;/* push %eax */*(u8 *)(p+ 1) = 0xb8;/* mov $__HYPERVISOR_iret,%eax */*(u32 *)(p+ 2) = __HYPERVISOR_iret;*(u16 *)(p+ 6) = (HYPERCALL_VECTOR << 8) | 0xcd; /* int $xx */ //0x82cd}自动判断中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语自动选择中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语有道翻译百度翻译必应翻译谷歌翻译谷歌翻译(国内)翻译朗读复制正在查询,请稍候……重试朗读复制复制朗读复制via 译 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] [nested xen]how to correspond a cr3 to specific vm or pid?
Hello, recently I'm looking into the code of nested xen under /xen/arch/x86/mm/hap, here are some questions which I hope to get help from you. 1. About nested ept. Is the memory translation process like this: L2 VA --> L2 PT --> L2 PA --> L1 EPT --> L1 VA --> L1 PT --> L0 EPT --> MA? What's the corresponding libxc functions? And who manages the EPT? L0 XEN for L0 EPT and L1 XEN for L1 EPT? Or both managed by L0 XEN? 2. How can I can the execution context of a specific process in nested vm? For example, I can get context of the L1 XEN using xc_domain_hvm_getcontext (xch,domid, ctxt_buf, size) from dom0 of L0 XEN, but I don't know which nested vm it belongs, it is possible to directly obtain the pid of a specific process in L2 VM from L0? The questions might be a little confusing, I don't get a very clear understanding of nested xen, especially with the concept of dom0 involved. If you need more information, please feel free to let me know. Happy holiday and best wishes :)Dear sir, I'm a student at computer science from China. Recently I'm looking into the code of nested xen under /xen/arch/x86/mm/hap, here are some questions which I hope to get help from you. 1. About nested ept. Is the memory translation process like this: L2 VA --> L2 PT --> L2 PA --> L1 EPT --> L1 VA --> L1 PT --> L0 EPT --> MA? What's the corresponding libxc functions? And who manages the EPT? L0 XEN for L0 EPT and L1 XEN for L1 EPT? Or both managed by L0 XEN? 2. How can I can the execution context of a specific process in nested vm? For example, I can get context of the L1 XEN using xc_domain_hvm_getcontext (xch,domid, ctxt_buf, size) from dom0 of L0 XEN, but I don't know which nested vm it belongs, it is possible to directly obtain the pid of a specific process in L2 VM from L0? The questions might be a little confusing, I don't get a very clear understanding of nested xen, especially with the concept of dom0 involved. If you need more information, please feel free to let me know. Happy holiday and best wishes :)Dear sir, I'm a student at computer science from China. Recently I'm looking into the code of nested xen under /xen/arch/x86/mm/hap, here are some questions which I hope to get help from you. 1. About nested ept. Is the memory translation process like this: L2 VA --> L2 PT --> L2 PA --> L1 EPT --> L1 VA --> L1 PT --> L0 EPT --> MA? What's the corresponding libxc functions? And who manages the EPT? L0 XEN for L0 EPT and L1 XEN for L1 EPT? Or both managed by L0 XEN? 2. How can I can the execution context of a specific process in nested vm? For example, I can get context of the L1 XEN using xc_domain_hvm_getcontext (xch,domid, ctxt_buf, size) from dom0 of L0 XEN, but I don't know which nested vm it belongs, it is possible to directly obtain the pid of a specific process in L2 VM from L0? The questions might be a little confusing, I don't get a very clear understanding of nested xen, especially with the concept of dom0 involved. If you need more information, please feel free to let me know. Happy holiday and best wishes :)译 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] Debugging console
If you run with Debian and Grub 2 (which should be the case if you are running Squeeze), then you should edit /etc/default/grub as below:GRUB_CMDLINE_XEN="loglvl=all guest_loglvl=all com1=115200,8n1,0x3e8,5 console=com1,vga" GRUB_CMDLINE_LINUX="console=hvc0 earlyprintk=xen"The above setup of the serial device parameters are for a Supermicro X8STi-F motherboard, where IPMI SOL is configured for COM3 from the BIOS. Note that you need to use "com1=" option for Xen, even when the SOL is actually COM3. If you specify "com3=" for Xen the serial console won't work for some reason. When you are done with your grub config file, do:update-grub2to generate the /boot/grub/grub.cfg You can go http://wiki.xenproject.org/wiki/Xen_Serial_Console for a complete reference. In addition, if your guest is a HVM, then you should add serial="pty" into the config file to be able to use 'xl console' From: carl.patenaudepou...@mail.mcgill.ca Date: Mon, 28 Dec 2015 11:30:43 -0500 To: xen-devel@lists.xen.org Subject: [Xen-devel] Debugging console Hi all, We've got __HYPERVISOR_console_io working on our unikernel! The onlyissue is that it prints to `xl dmesg`. Is there a way to get it toprint to `xl console`? Best Carl Patenaude PoulinMcGill University ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] how to enable kdb for xen
No, it won't work on neither 4.4 nor 4.6 > Did it work with 4.6 as you asked for? > > >> Date: Fri, 18 Dec 2015 23:58:52 -0500 > >> Subject: Re: [Xen-devel] how to enable kdb for xen > >> From: ufimts...@gmail.com > >> To: quizy_jo...@outlook.com > >> CC: konrad.w...@oracle.com; elena.ufimts...@oracle.com; t...@xen.org; > >xen-devel@lists.xen.org > >> > >> On Fri, Dec 18, 2015 at 11:24 PM, quizyjones > ><quizy_jo...@outlook.com> wrote: > >> > Is there any progress? > >> > >> Hey > >> > >> I did look into this and I could not find the trace of what I have > >> done before. So I decided to ytu and port it to current version from > >> this Mukesh patch: > >> http://lists.xen.org/archives/html/xen-devel/2014-04/msg3.html > >> It looks like it applied without major issues, but I have not tested > >> it yet, but its in my plan for next week. > >> > >> Elena > >> > >> > > >> >> Date: Wed, 16 Dec 2015 09:42:47 -0500 > >> >> From: ufimts...@gmail.com > >> >> To: konrad.w...@oracle.com > >> >> CC: elena.ufimts...@oracle.com; quizy_jo...@outlook.com; > >t...@xen.org; > >> >> xen-devel@lists.xen.org > >> >> Subject: Re: [Xen-devel] how to enable kdb for xen > >> > > >> >> > >> >> On Wed, Dec 16, 2015 at 9:30 AM, Konrad Rzeszutek Wilk > >> >> <konrad.w...@oracle.com> wrote: > >> >> > On December 16, 2015 3:08:04 AM EST, quizyjones > >> >> > <quizy_jo...@outlook.com> wrote: > >> >> >>The version embedded with kdb only updates to 4.1.0. How can I > >use it > >> >> >>with xen 4.6? Or is there any other debuggers which can step in > >Xen? > >> >> > > >> >> > CCing Elena who poked at it some point. Not sure if she got it > >ported > >> >> > over though. > >> >> >> > >> >> >>From: quizy_jo...@outlook.com > >> >> >>To: xen-devel@lists.xen.org > >> >> >>Date: Wed, 16 Dec 2015 06:57:02 + > >> >> >>Subject: [Xen-devel] how to enable kdb for xen > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >>I tried to debug xen use kdb. After compiling xen with debug=y, > >is > >> >> >>there any further steps I should take? I can get console outputs > >start > >> >> >>with: Xen 4.4.1 (XEN) Xen version 4.4.1 (root@) (gcc > >> >> >>(Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4) debug=y Wed Dec 16 11:01:14 > >> >> >>.But I can't step into the boot procedure. The kdb seems not > >built > >> >> >>in and there is no kdb folder in /tools/debugger. How can I > >build > >> >> >>xen-4.4.1/xen-4.4.6 with kdb? > >> >> > >> >> Hey! > >> >> If I recall correctly, I did try to port kdb. Let me find out what > >> >> happened there. > >> >> > >> >> Elena > >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >>___ > >> >> >>Xen-devel mailing list > >> >> >>Xen-devel@lists.xen.org > >> >> >>http://lists.xen.org/xen-devel > >> >> >> > >> >> > >>> > >> >> >> > >> >> >>___ > >> >> >>Xen-devel mailing list > >> >> >>Xen-devel@lists.xen.org > >> >> >>http://lists.xen.org/xen-devel > >> >> > > >> >> > > >> >> > > >> >> > ___ > >> >> > Xen-devel mailing list > >> >> > Xen-devel@lists.xen.org > >> >> > http://lists.xen.org/xen-devel > >> >> > >> >> > >> >> > >> >> -- > >> >> Elena > >> >> > >> >> ___ > >> >> Xen-devel mailing list > >> >> Xen-devel@lists.xen.org > >> >> http://lists.xen.org/xen-devel > >> > >> > >> > >> -- > >> Elena > > > > > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel 译 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] what's the type of nested xen? HVM or PV?
Happy Holiday, guys. God tell me that I should work this out before celebrate ; )I create a HVM first, then compile Xen on it. The dom0 of this Xen is a PV. So is this nested xen a HVM or a PV? It's hard to differentiate when concerning to enable events as only HVM supports events. ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] how to enable kdb for xen
Hi, Elena. I tried to patch xen-4.4.1 with the patches at http://lists.xen.org/archives/html/xen-devel/2014-04/msg3.html. However, after the patching, when I make with kdb=y, it would interrupt for error: 'struct domain' has no member named 'is_paused_by_controller'. Does the patch really work with xen-4.4? > Date: Fri, 18 Dec 2015 23:58:52 -0500 > Subject: Re: [Xen-devel] how to enable kdb for xen > From: ufimts...@gmail.com > To: quizy_jo...@outlook.com > CC: konrad.w...@oracle.com; elena.ufimts...@oracle.com; t...@xen.org; > xen-devel@lists.xen.org > > On Fri, Dec 18, 2015 at 11:24 PM, quizyjones <quizy_jo...@outlook.com> wrote: > > Is there any progress? > > Hey > > I did look into this and I could not find the trace of what I have > done before. So I decided to ytu and port it to current version from > this Mukesh patch: > http://lists.xen.org/archives/html/xen-devel/2014-04/msg3.html > It looks like it applied without major issues, but I have not tested > it yet, but its in my plan for next week. > > Elena > > > > >> Date: Wed, 16 Dec 2015 09:42:47 -0500 > >> From: ufimts...@gmail.com > >> To: konrad.w...@oracle.com > >> CC: elena.ufimts...@oracle.com; quizy_jo...@outlook.com; t...@xen.org; > >> xen-devel@lists.xen.org > >> Subject: Re: [Xen-devel] how to enable kdb for xen > > > >> > >> On Wed, Dec 16, 2015 at 9:30 AM, Konrad Rzeszutek Wilk > >> <konrad.w...@oracle.com> wrote: > >> > On December 16, 2015 3:08:04 AM EST, quizyjones > >> > <quizy_jo...@outlook.com> wrote: > >> >>The version embedded with kdb only updates to 4.1.0. How can I use it > >> >>with xen 4.6? Or is there any other debuggers which can step in Xen? > >> > > >> > CCing Elena who poked at it some point. Not sure if she got it ported > >> > over though. > >> >> > >> >>From: quizy_jo...@outlook.com > >> >>To: xen-devel@lists.xen.org > >> >>Date: Wed, 16 Dec 2015 06:57:02 + > >> >>Subject: [Xen-devel] how to enable kdb for xen > >> >> > >> >> > >> >> > >> >> > >> >>I tried to debug xen use kdb. After compiling xen with debug=y, is > >> >>there any further steps I should take? I can get console outputs start > >> >>with: Xen 4.4.1 (XEN) Xen version 4.4.1 (root@) (gcc > >> >>(Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4) debug=y Wed Dec 16 11:01:14 > >> >>.But I can't step into the boot procedure. The kdb seems not built > >> >>in and there is no kdb folder in /tools/debugger. How can I build > >> >>xen-4.4.1/xen-4.4.6 with kdb? > >> > >> Hey! > >> If I recall correctly, I did try to port kdb. Let me find out what > >> happened there. > >> > >> Elena > >> > >> >> > >> >> > >> >> > >> >>___ > >> >>Xen-devel mailing list > >> >>Xen-devel@lists.xen.org > >> >>http://lists.xen.org/xen-devel > >> >> > >> >> > >> >> > >> >>___ > >> >>Xen-devel mailing list > >> >>Xen-devel@lists.xen.org > >> >>http://lists.xen.org/xen-devel > >> > > >> > > >> > > >> > ___ > >> > Xen-devel mailing list > >> > Xen-devel@lists.xen.org > >> > http://lists.xen.org/xen-devel > >> > >> > >> > >> -- > >> Elena > >> > >> ___ > >> Xen-devel mailing list > >> Xen-devel@lists.xen.org > >> http://lists.xen.org/xen-devel > > > > -- > Elena ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] how to enable kdb for xen
Besides of that, even when I compile the debuggers.hg version of xen-4.1.0 at http://xenbits.xensource.com/ext/debuggers.hg, it will interrupt for: gcc -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -DNDEBUG -nostdinc -fno-builtin -fno-common -Wredundant-decls -iwithprefix include -Werror -Wno-pointer-arith -pipe -I/home/john/debuggers.hg/xen/include -I/home/john/debuggers.hg/xen/include/asm-x86/mach-generic -I/home/john/debuggers.hg/xen/include/asm-x86/mach-default -msoft-float -fno-stack-protector -fno-exceptions -mno-red-zone -fpic -fno-asynchronous-unwind-tables -DGCC_HAS_VISIBILITY_ATTRIBUTE -g -D__XEN__ -DXEN_KDB_CONFIG -MMD -MF .cpupool.o.d -c cpupool.c -o cpupool.ocpupool.c: In function ‘cpupool_add_domain’:cpupool.c:331:9: error: variable ‘n_dom’ set but not used [-Werror=unused-but-set-variable] int n_dom; ^cpupool.c: In function ‘cpupool_rm_domain’:cpupool.c:356:9: error: variable ‘n_dom’ set but not used [-Werror=unused-but-set-variable] int n_dom; ^cpupool.c:355:9: error: variable ‘cpupool_id’ set but not used [-Werror=unused-but-set-variable] int cpupool_id; ^cc1: all warnings being treated as errorsmake[4]: *** [cpupool.o] Error 1make[4]: Leaving directory `/home/john/debuggers.hg/xen/common'make[3]: *** [/home/john/debuggers.hg/xen/common/built_in.o] Error 2make[3]: Leaving directory `/home/john/debuggers.hg/xen/arch/x86'make[2]: *** [/home/john/debuggers.hg/xen/xen] Error 2make[2]: Leaving directory `/home/john/debuggers.hg/xen'make[1]: *** [install] Error 2make[1]: Leaving directory `/home/john/debuggers.hg/xen'make: *** [install-xen] Error 2 Actually, the variables are all used in the function, I don't know why this happens. After removing -Werror option in Makefile, it still happens. From: quizy_jo...@outlook.com To: ufimts...@gmail.com Date: Thu, 24 Dec 2015 02:36:34 + CC: elena.ufimts...@oracle.com; xen-devel@lists.xen.org; t...@xen.org Subject: Re: [Xen-devel] how to enable kdb for xen Hi, Elena. I tried to patch xen-4.4.1 with the patches at http://lists.xen.org/archives/html/xen-devel/2014-04/msg3.html. However, after the patching, when I make with kdb=y, it would interrupt for error: 'struct domain' has no member named 'is_paused_by_controller'. Does the patch really work with xen-4.4? > Date: Fri, 18 Dec 2015 23:58:52 -0500 > Subject: Re: [Xen-devel] how to enable kdb for xen > From: ufimts...@gmail.com > To: quizy_jo...@outlook.com > CC: konrad.w...@oracle.com; elena.ufimts...@oracle.com; t...@xen.org; > xen-devel@lists.xen.org > > On Fri, Dec 18, 2015 at 11:24 PM, quizyjones <quizy_jo...@outlook.com> wrote: > > Is there any progress? > > Hey > > I did look into this and I could not find the trace of what I have > done before. So I decided to ytu and port it to current version from > this Mukesh patch: > http://lists.xen.org/archives/html/xen-devel/2014-04/msg3.html > It looks like it applied without major issues, but I have not tested > it yet, but its in my plan for next week. > > Elena > > > > >> Date: Wed, 16 Dec 2015 09:42:47 -0500 > >> From: ufimts...@gmail.com > >> To: konrad.w...@oracle.com > >> CC: elena.ufimts...@oracle.com; quizy_jo...@outlook.com; t...@xen.org; > >> xen-devel@lists.xen.org > >> Subject: Re: [Xen-devel] how to enable kdb for xen > > > >> > >> On Wed, Dec 16, 2015 at 9:30 AM, Konrad Rzeszutek Wilk > >> <konrad.w...@oracle.com> wrote: > >> > On December 16, 2015 3:08:04 AM EST, quizyjones > >> > <quizy_jo...@outlook.com> wrote: > >> >>The version embedded with kdb only updates to 4.1.0. How can I use it > >> >>with xen 4.6? Or is there any other debuggers which can step in Xen? > >> > > >> > CCing Elena who poked at it some point. Not sure if she got it ported > >> > over though. > >> >> > >> >>From: quizy_jo...@outlook.com > >> >>To: xen-devel@lists.xen.org > >> >>Date: Wed, 16 Dec 2015 06:57:02 + > >> >>Subject: [Xen-devel] how to enable kdb for xen > >> >> > >> >> > >> >> > >> >> > >> >>I tried to debug xen use kdb. After compiling xen with debug=y, is > >> >>there any further steps I should take? I can get console outputs start > >> >>with: Xen 4.4.1 (XEN) Xen version 4.4.1 (root@) (gcc > >> >>(Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4) debug=y Wed Dec 16 11:01:14 > >> >>.But I
[Xen-devel] EVTCHNOP failure while creating VM
This is the output when I tried to create a vm in a nested xen. I looked up into the source and found error -22 presents invalid arguments. What might be the cause? (XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(XEN) event_channel.c:272:d0 EVTCHNOP failure: domain 1, error -22(d1) HVM Loader(d1) Detected Xen v4.4.1(d1) Xenbus rings @0xfeffc000, event channel 3(d1) System requested SeaBIOS(d1) CPU speed is 1600 MHz(d1) Relocating guest memory for lowmem MMIO space disabled(XEN) irq.c:270: Dom1 PCI link 0 changed 0 -> 5(d1) PCI-ISA link 0 routed to IRQ5(XEN) irq.c:270: Dom1 PCI link 1 changed 0 -> 10(d1) PCI-ISA link 1 routed to IRQ10(XEN) irq.c:270: Dom1 PCI link 2 changed 0 -> 11(d1) PCI-ISA link 2 routed to IRQ11(XEN) irq.c:270: Dom1 PCI link 3 changed 0 -> 5(d1) PCI-ISA link 3 routed to IRQ5(d1) pci dev 01:3 INTA->IRQ10(d1) pci dev 02:0 INTA->IRQ11(d1) pci dev 04:0 INTA->IRQ5(d1) No RAM in high memory; setting high_mem resource base to 1(d1) pci dev 03:0 bar 10 size 00200: 0f008(d1) pci dev 02:0 bar 14 size 00100: 0f208(d1) pci dev 04:0 bar 30 size 4: 0f300(d1) pci dev 03:0 bar 30 size 1: 0f304(d1) pci dev 03:0 bar 14 size 01000: 0f305(d1) pci dev 02:0 bar 10 size 00100: 0c001(d1) pci dev 04:0 bar 10 size 00100: 0c101(d1) pci dev 04:0 bar 14 size 00100: 0f3051000(d1) pci dev 01:1 bar 20 size 00010: 0c201(d1) Multiprocessor initialisation:(d1) - CPU0 ... 46-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.(d1) Testing HVM environment:(d1) - REP INSB across page boundaries ... passed(d1) - GS base MSRs and SWAPGS ... passed(d1) Passed 2 of 2 tests(d1) Writing SMBIOS tables ...(d1) Loading SeaBIOS ...(d1) Creating MP tables ...(d1) Loading ACPI ...(d1) vm86 TSS at fc00a080(d1) BIOS map:(d1) 1-100d3: Scratch space(d1) e-f: Main BIOS(d1) E820 table:(d1) [00]: : - :000a: RAM(d1) HOLE: :000a - :000e(d1) [01]: :000e - :0010: RESERVED(d1) [02]: :0010 - :1f80: RAM(d1) HOLE: :1f80 - :fc00(d1) [03]: :fc00 - 0001:: RESERVED(d1) Invoking SeaBIOS ...(d1) SeaBIOS (version rel-1.7.3.1-0-g7d9cbe6-20151216_104417-ubuntu-hvm)(d1)(d1) Found Xen hypervisor signature at 4000(d1) xen: copy e820...(d1) Relocating init from 0x000e4161 to 0x1f7e2950 (size 54768)(d1) CPU Mhz=1600(d1) Found 7 PCI devices (max PCI bus is 00)(d1) Allocated Xen hypercall page at 1f7ff000(d1) Detected Xen v4.4.1(d1) xen: copy BIOS tables...(d1) Copying SMBIOS entry point from 0x00010010 to 0x000f1740(d1) Copying MPTABLE from 0xfc001130/fc001140 to 0x000f1660(d1) Copying PIR from 0x00010030 to 0x000f15e0(d1) Copying ACPI RSDP from 0x000100b0 to 0x000f15b0(d1) Using pmtimer, ioport 0xb008, freq 3579 kHz(d1) Scan for VGA option rom(d1) WARNING! Found unaligned PCI rom (vd=1013:00b8)(d1) Running option rom at c000:0003(XEN) stdvga.c:147:d1 entering stdvga and caching modes(d1) Turning on vga text mode console(d1) SeaBIOS (version rel-1.7.3.1-0-g7d9cbe6-20151216_104417-ubuntu-hvm)(d1) Machine UUID 71c7de52-a5ed-484b-9ebc-805378916ea9(d1) Found 0 lpt ports(d1) Found 0 serial ports(d1) ATA controller 1 at 1f0/3f4/c200 (irq 14 dev 9)(d1) ATA controller 2 at 170/374/c208 (irq 15 dev 9)(d1) ata0-0: QEMU HARDDISK ATA-7 Hard-Disk (5120 MiBytes)(d1) Searching bootorder for: /pci@i0cf8/*@1,1/drive@0/disk@0(d1) DVD/CD [ata1-0: QEMU DVD-ROM ATAPI-4 DVD/CD](d1) Searching bootorder for: /pci@i0cf8/*@1,1/drive@1/disk@0(d1) PS2 keyboard initialized(d1) All threads complete.(d1) Scan for option roms(d1) Running option rom at c900:0003(d1) pmm call arg1=1(d1) pmm
Re: [Xen-devel] how to enable kdb for xen
Is there any progress? > Date: Wed, 16 Dec 2015 09:42:47 -0500 > From: ufimts...@gmail.com > To: konrad.w...@oracle.com > CC: elena.ufimts...@oracle.com; quizy_jo...@outlook.com; t...@xen.org; > xen-devel@lists.xen.org > Subject: Re: [Xen-devel] how to enable kdb for xen > > On Wed, Dec 16, 2015 at 9:30 AM, Konrad Rzeszutek Wilk > <konrad.w...@oracle.com> wrote: > > On December 16, 2015 3:08:04 AM EST, quizyjones <quizy_jo...@outlook.com> > > wrote: > >>The version embedded with kdb only updates to 4.1.0. How can I use it > >>with xen 4.6? Or is there any other debuggers which can step in Xen? > > > > CCing Elena who poked at it some point. Not sure if she got it ported over > > though. > >> > >>From: quizy_jo...@outlook.com > >>To: xen-devel@lists.xen.org > >>Date: Wed, 16 Dec 2015 06:57:02 + > >>Subject: [Xen-devel] how to enable kdb for xen > >> > >> > >> > >> > >>I tried to debug xen use kdb. After compiling xen with debug=y, is > >>there any further steps I should take? I can get console outputs start > >>with:Xen 4.4.1(XEN) Xen version 4.4.1 (root@) (gcc > >>(Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4) debug=y Wed Dec 16 11:01:14 > >>.But I can't step into the boot procedure. The kdb seems not built > >>in and there is no kdb folder in /tools/debugger. How can I build > >>xen-4.4.1/xen-4.4.6 with kdb? > > Hey! > If I recall correctly, I did try to port kdb. Let me find out what > happened there. > > Elena > > >> > >> > >> > >>___ > >>Xen-devel mailing list > >>Xen-devel@lists.xen.org > >>http://lists.xen.org/xen-devel > >> > >> > >> > >>___ > >>Xen-devel mailing list > >>Xen-devel@lists.xen.org > >>http://lists.xen.org/xen-devel > > > > > > > > ___ > > Xen-devel mailing list > > Xen-devel@lists.xen.org > > http://lists.xen.org/xen-devel > > > > -- > Elena > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] xen panics when setting int3 traps
How can the techniques gdbsx uses be adapted to a real-time monitoring of nested hypercalls? I handled the breakpoints in L1 dom0, instead of the L1 xen itself, just like dom0 handles the interrupt of domU. So it's not letting the guest dealing with themselves, right? To: quizy_jo...@outlook.com; t...@xen.org From: andrew.coop...@citrix.com Date: Fri, 18 Dec 2015 15:31:18 + CC: george.dun...@eu.citrix.com; kevin.t...@intel.com; jun.nakaj...@intel.com; xen-devel@lists.xen.org Subject: Re: [Xen-devel] xen panics when setting int3 traps On 17/12/15 01:35, quizyjones wrote: Sorry for the late reply, there is something wrong in network which makes the email not delivered successfully. The inject method is by using xc_map_foreign_range to map the address of the nested xen and memcpy the trap to the specific location. If there is a problem, it should be the xc_map_foreign_range function, can it map L1 xen's memory to dom0 of L0 xen? It might mapping the memory of nested dom0 instead of the nested xen, as the error says that the max physical address is 0xff00 when I tried to operate on memory space of xen using xc_map_foreign_range. You cannot simply put breakpoints in the domain, as they will be handled by the domain itself. As you observe, Xen gets rightfully unhappy when it finds breapoints in its own virtual range. You need to follow the same actions as `gdbsx` (as an example) which registers itself as a debugger of the domain, and hooks breakpoints, rather than letting the guest deal with them in an unexpected manor. ~Andrew ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] xen panics when setting int3 traps
Sorry for the late reply, there is something wrong in network which makes the email not delivered successfully.The inject method is by using xc_map_foreign_range to map the address of the nested xen and memcpy the trap to the specific location. If there is a problem, it should be the xc_map_foreign_range function, can it map L1 xen's memory to dom0 of L0 xen? It might mapping the memory of nested dom0 instead of the nested xen, as the error says that the max physical address is 0xff00 when I tried to operate on memory space of xen using xc_map_foreign_range. > Since this is an L1 xen crash, the bug is probably in the code that > tried to inject the trap (vmi_write_8_pa() and callers). It's > interesting that both the L1 crashes were in unlock routines, but that > could be a coincidence. > > At 11:13 +0800 on 11 Dec (1449832424), quizy_jo...@outlook.com wrote: > > The reproduce method is a little complex. We rely on libvmi to translate > > virtual addess into physical address and inject traps. > > > > Goal: monitor all hypercalls of L1 xen (4.4.1) from dom0 of L0 xen (4.4.6) > > 1. obtain virtual address of hypercall handler (GVA) from xen-syms-4.4.1 > > file > > 2. use vmi_pagetable_lookup of libvmi api to translate GVA into guest > > physical address (GPA) > > 3. inject int3 into the first byte of GPA using libvmi api vmi_write_8_pa > > 4. listen on vmexit events caused by #BP > > The code of the above procedures is here. > > By running 'hvm10 nested-xen' and create/destroy any domains in nested-xen, > > you can reproduce the error. (nested-xen is the domain name of L1 xen) > > > > My doubt is whether the second step is right. I.E. How xen manages > > its own memory translations in nested virtualization? And does the > > L0 xen have privilege to write the memory of L1 xen? BTW, I'm using > > (v)EPT for nested xen. > > Yes, L0 Xen can write to L1 Xen's memory. Internally, Xen has an EPT > table for L1 Xen, and mainatins EPT tables that mirror the L1's EPT > tables (but with the extra translation) for the CPU to use when > running L2 guests. The code is in xen/arch/x86/mm/hap/nested_*. > > The next step is to log everything that goes on around that > vmi_write_8_pa() call, all the addresses it uses and what data it > changes, and also modify the L1 hypervisor to print the contents of > the target in a debug keyhandler, so you can check whether > vmi_write_8_pa() did what you expected. > > Cheers, > > Tim. > > > > > Jones > > > > From: Konrad Rzeszutek Wilk > > Date: 2015-12-11 10:17 > > To: quizy_jo...@outlook.com > > CC: xen-devel > > Subject: Re: [Xen-devel] xen panics when setting int3 traps > > On Fri, Dec 11, 2015 at 10:01:13AM +0800, quizy_jo...@outlook.com wrote: > > > Aslo reboot when destroy a VM. > > > > You need to give more context on how to reproduce this, and you should > > also CC the maintainers of the code. Please look in MAINTAINERS file. > > > > > > > > The logs from L1 Xen: > > > (XEN) [ Xen-4.4.1 x86_64 debug=n Not tainted ] > > > (XEN) CPU:0 > > > (XEN) RIP:e008:[] _spin_unlock+0x1b/0x30 > > > (XEN) RFLAGS: 00010202 CONTEXT: hypervisor > > > (XEN) rax: 82d0802f8320 rbx: 7f4b024a9004 rcx: > > > 0002 > > > (XEN) rdx: 82d0802b rsi: 0080 rdi: > > > 7c6ebdb0 > > > (XEN) rbp: 82d0802b7e48 rsp: 82d0802b7dc0 r8: > > > 0004 > > > (XEN) r9: 0002 r10: 82d0802284f0 r11: > > > 0282 > > > (XEN) r12: r13: 7fffd571aff0 r14: > > > 8300740a > > > (XEN) r15: cr0: 80050033 cr4: > > > 001526f0 > > > (XEN) cr3: 3afa cr2: 7c6ebdb0 > > > (XEN) ds: es: fs: gs: ss: e010 cs: e008 > > > (XEN) Xen stack trace from rsp=82d0802b7dc0: > > > (XEN)82d080103285 83007c6eb000 > > > 83007c6eb000 > > > (XEN)00010005 83007c6eb000 83007c6c1000 > > > 82d0802b7ec8 > > > (XEN)82d0802b 83007c6eb000 82e000fde500 > > > 0005 > > > (XEN) 83007ef28000 83007c6c1000 > > > 0007ef28 > > > (XEN)7ff3 00090003 01650001 > > > 0165f670 > > > (XEN)7fffd571b140 0001 7f4b02299557 > > > 0001 > > > (XEN) 7fffd571b0ac 7f4b01bf2018 > > > 0165f450 > > > (XEN)0001 0165f680 7f4b022a0515 > > > > > > (XEN) 0001 > > > 0033 > > > (XEN)83007c6c1000 8800442ebec0 88006bdb2490 > > > 7fffd571aff0 > > > (XEN)7fffd571aff0 82d08021aef9 > > > 7fffd571b140 > > > (XEN)0165f670 0165b050 0165f680 > > > 8800442ebec0 > > > (XEN)
Re: [Xen-devel] how to enable kdb for xen
Thanks a lot and looking forward to that. > Date: Wed, 16 Dec 2015 09:42:47 -0500 > Subject: Re: [Xen-devel] how to enable kdb for xen > From: ufimts...@gmail.com > To: konrad.w...@oracle.com > CC: quizy_jo...@outlook.com; xen-devel@lists.xen.org; > elena.ufimts...@oracle.com; t...@xen.org > > On Wed, Dec 16, 2015 at 9:30 AM, Konrad Rzeszutek Wilk > <konrad.w...@oracle.com> wrote: > > On December 16, 2015 3:08:04 AM EST, quizyjones <quizy_jo...@outlook.com> > > wrote: > >>The version embedded with kdb only updates to 4.1.0. How can I use it > >>with xen 4.6? Or is there any other debuggers which can step in Xen? > > > > CCing Elena who poked at it some point. Not sure if she got it ported over > > though. > >> > >>From: quizy_jo...@outlook.com > >>To: xen-devel@lists.xen.org > >>Date: Wed, 16 Dec 2015 06:57:02 + > >>Subject: [Xen-devel] how to enable kdb for xen > >> > >> > >> > >> > >>I tried to debug xen use kdb. After compiling xen with debug=y, is > >>there any further steps I should take? I can get console outputs start > >>with:Xen 4.4.1(XEN) Xen version 4.4.1 (root@) (gcc > >>(Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4) debug=y Wed Dec 16 11:01:14 > >>.But I can't step into the boot procedure. The kdb seems not built > >>in and there is no kdb folder in /tools/debugger. How can I build > >>xen-4.4.1/xen-4.4.6 with kdb? > > Hey! > If I recall correctly, I did try to port kdb. Let me find out what > happened there. > > Elena > > >> > >> > >> > >>___ > >>Xen-devel mailing list > >>Xen-devel@lists.xen.org > >>http://lists.xen.org/xen-devel > >> > >> > >> > >>___ > >>Xen-devel mailing list > >>Xen-devel@lists.xen.org > >>http://lists.xen.org/xen-devel > > > > > > > > ___ > > Xen-devel mailing list > > Xen-devel@lists.xen.org > > http://lists.xen.org/xen-devel > > > > -- > Elena ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] how to enable kdb for xen
I tried to debug xen use kdb. After compiling xen with debug=y, is there any further steps I should take? I can get console outputs start with:Xen 4.4.1(XEN) Xen version 4.4.1 (root@) (gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4) debug=y Wed Dec 16 11:01:14.But I can't step into the boot procedure. The kdb seems not built in and there is no kdb folder in /tools/debugger. How can I build xen-4.4.1/xen-4.4.6 with kdb? ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] how to obtain the context of nested xen?
In a multiple cpus machine where each vcpu is pinned at the corresponding physical cpu, a VM's context can be obtained through the cr3 of the corresponding vcpu. However, what if a nested xen is presented? Does the nested xen shared vcpus with the VMs on it or occupy a separate one? How can I know which vcpu/vcpu the nested xen is using? There is no document in detailing the cpu allocation strategy for xen itself, all I can find it about vcpu allocation and configuration for dom0 and domUs. ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] how can I debug nested xen?
I can debug xen using console connections. However, HVM nested xen seems to not support 'xl console'. Even though I set the console according to http://www.dedoimedo.com/computers/xen-console.html, it still cannot output xen related infomation. Any suggestions? ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] how does nested xen translate memory address?
Which routine xen uses when translate nested xen address ? The first one or the second? 1. nested vm -->EPT1 of L1 xen --> EPT0 of L0 xen --> machine address 2. nested vm --> EPT1 of L1 xen --> machine address Does the nested vm directly translate its virtual address by vEPT or through two EPT translations? ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] boot xen use legacy bios
Thanks for your reply. I've already changed to boot with the xen.efi directly without grub2. Now I can see all the cpu cores, but I can't use the mouse or keyboard. What's more, the memory seems to be problematic too. 'xl dmesg' shows : (XEN) Unknown cachability for MFNs 0x8-0x8(XEN) Unknown cachability for MFNs 0xfeda8-0xfedab(XEN) Initial low memory virq threshold set at 0x4000 pages.(XEN) HVM1 restore: bad CR4 0x1526f0(XEN) HVM1 restore: failed to load entry 2/0(d4) Relocating guest memory for lowmem MMIO space disabled(d4) No RAM in high memory; setting high_mem resource base to 1 Even though finally the domain 4 booted, using libxc api xc_domain_maximum_gpfn(xen->xchandle, xen->domainid) cannot get the max_gpfn. > Date: Mon, 30 Nov 2015 03:31:13 -0700 > From: jbeul...@suse.com > To: quizy_jo...@outlook.com > CC: xen-devel@lists.xen.org > Subject: Re: [Xen-devel] boot xen use legacy bios > > >>> On 29.11.15 at 12:26,wrote: > > I got the problem of multiple cores CPU cannot be fully used when using > > UEFI > > mode. It is suggested that I should be boot the xen in legacy mode. How is > > it > > done? > > For BIOSes that don't have a Legacy Support Module, booting in > non-EFI mode just won't work. See my other reply. For BIOSes > that do have an LSM, you may need to find the setup option to > turn it on if it's not on by default. > > But generally questions like this belong on xen-users, not xen-devel. > > Jan > > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] boot xen use legacy bios
Sorry, I thought they are due to same reason so I put them together. Maybe I should just solve them one by one. Full log is here paste.ubuntu.com/13571815/, if you need more information, please let me know. > Date: Mon, 30 Nov 2015 08:50:42 -0700 > From: jbeul...@suse.com > To: quizy_jo...@outlook.com > CC: xen-devel@lists.xen.org > Subject: Re: [Xen-devel] boot xen use legacy bios > On 30.11.15 at 16:36, wrote: > > First of all - please no HTML mails, just plain text. > >> Thanks for your reply. I've already changed to boot with the xen.efi >> directly >> without grub2. Now I can see all the cpu cores, but I can't use the mouse or >> keyboard. What's more, the memory seems to be problematic too. 'xl dmesg' >> shows : >> (XEN) Unknown cachability for MFNs 0x8-0x8(XEN) Unknown cachability >> for MFNs 0xfeda8-0xfedab(XEN) Initial low memory virq threshold set at >> 0x4000 >> pages. > > None of this can be analyzed without full logs. > >>(XEN) HVM1 restore: bad CR4 0x1526f0(XEN) HVM1 restore: failed to load >> entry 2/0(d4) Relocating guest memory for lowmem MMIO space disabled(d4) No >> RAM in high memory; setting high_mem resource base to 1 >> Even though finally the domain 4 booted, using libxc api >> xc_domain_maximum_gpfn(xen->xchandle, xen->domainid) cannot get the >> max_gpfn. > > And please don't merge multiple completely different issues in a > single thread (and for those secondary issues under a completely > misleading title). > > Jan > > > ___ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] xen can only detect one core of multiple cores cpu
I'm using a Intel E5-2603 v3 @ 1.60GHz CPU of 6 cores. However, the dom0 can only find one core. here are some information that may helps in analyzing. ~$ uname -aLinux storage 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux ~$ cat /proc/cpuinfoprocessor : 0vendor_id : GenuineIntelcpu family : 6model : 63model name : Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHzstepping: 2microcode : 0x27cpu MHz : 1600.035cache size : 15360 KBphysical id : 0siblings: 1core id : 0cpu cores : 1apicid : 0initial apicid : 0fpu : yesfpu_exception : yescpuid level : 15wp : yesflags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc eagerfpu pni pclmulqdq monitor est ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm arat epb xsaveopt pln pts dtherm fsgsbase bmi1 avx2 bmi2 ermsbogomips: 3200.07clflush size: 64cache_alignment : 64address sizes : 46 bits physical, 48 bits virtualpower management: The result of 'dmesg' is at http://paste.ubuntu.com/13544065/, 'xl dmesg' is at http://paste.ubuntu.com/13544201/There are errors related with ACPI, so I modified the /etc/default/grub and changed the GRUB_CMDLINE_LINUX_DEFAULT from null to "quiet splash acpi=force". After reboot, the ACPI errors of 'dmesg' disappears. But still exists for 'xl dmesg' and dom0 can only find one core. The new 'dmesg' and 'xl dmesg' result is at http://paste.ubuntu.com/13544610/ and http://paste.ubuntu.com/13544633/ I've also tried the solution at http://lists.xen.org/archives/html/xen-devel/2012-06/msg00087.html and add acpi_rsdp=0xbabfe000 , still fails. Other informations:xentop - 00:51:08 Xen 4.4.11 domains: 1 running, 0 blocked, 0 paused, 0 crashed, 0 dying, 0 shutdownMem: 33451548k total, 8752508k used, 24699040k freeCPUs: 1 @ 1600MHz NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR VBD_RSECT VBD_WSECT SSID Domain-0 -r 470.0 8388608 25.18388608 25.1 10000 000 0 02 ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel