Re: Assertion failure error in kernel vgic interrupt processing

nico.hacker nico.hacker at tom.com
Thu May 3 05:18:03 CEST 2018


<p>Hi,</p><p><br /></p>The previous test is not enough to cause error, this error is not related to peripherals, I have removed almost all peripheral drivers<br /><br />In the previous test, I added a delay operation before the vm2 start, so that vm1 completely up and then start vm2, this will greatly reduce the probability of the error. Now I removed this delay, vm1 and vm2 started simultaneously, then the error will occur frequently (about 1/10 probability). The error is generated when kernel processes vtimer interrupts. Under normal circumstances, after processing a vtimer interrupt, the vcpu thread will return to uvmm and then execute prepare_guest_entry(). This operation will eventually enter the kernel through the system call to set the state of vcpu thread, but when the error occurs, I find that the vcpu thread does not execute vcpu_resume, it processes two consecutive vtimer interrupts. As a result, the assertion fails. <br /><br />Is the kernel able to guarantee that the complete process of handling vgic and vtimer interrupts (including the process in uvmm) is not interrupted by a new interrupt? <br /><br />Here's my configuration:<br />-------------------------------------------------------------------------<br />uvmm.ned<br /><br />vmm.start_vm{<br />  id=1,<br />  mem=256,<br />  vbus=io_busses.vm_hw,<br />  bootargs=common_bootargs .. " ramdisk_size=9100 root=/dev/ram",<br />  kernel="rom/Image.gz",<br />  rd="rom/ramdisk-arm.rd",<br />  fdt="rom/virt-board.dtb",<br />  prio=nil, cpus=0x1<br />};<br /><br />vmm.start_vm{<br />  id=2,<br />  mem=256,<br />  vbus=io_busses.vm_nohw,<br />  bootargs=common_bootargs .. " ramdisk_size=9100 root=/dev/ram",<br />  kernel="rom/Image.gz",<br />  rd="rom/ramdisk-arm.rd",<br />  fdt="rom/virt-board.dtb",<br />  prio=nil, cpus=0x1<br />};<br />--------------------------------------------------------------------------<br />io.cfg<br /><br />-- vi:ft=lua<br /><br />local Res = Io.Res<br />local Hw = Io.Hw<br /><br />local add_children = Io.Dt.add_children<br /><br />add_children(Io.system_bus(), function()<br />  VGIC = Hw.Device(function()<br />    Property.hid = "arm-gicc";<br />    Resource.reg0 = Res.mmio(0x12006000, 0x12007fff);<br />    Property.flags = Io.Hw_device_DF_multi_vbus;<br />  end)<br /><br />  VM1_DEV = Hw.Device(function()<br />    Property.hid = "vm1_dev";<br />    Resource.reg0 = Res.mmio(0x70100000, 0x70100FFF); --UART<br />  end)<br /><br />  VM2_DEV = Hw.Device(function()<br />    Property.hid = "vm2_dev";<br />    Resource.reg0 = Res.mmio(0x70100000, 0x70100FFF); --UART<br />  end)<br />end)<br />----------------------------------------------------------------------------<br />vm_hw.vbus<br /><br />Io.add_vbusses<br />{<br />  vm_hw = Io.Vi.System_bus(function()<br />    VGIC = wrap(Io.system_bus():match("arm-gicc"));<br />    VM1_DEV = wrap(Io.system_bus():match("vm1_dev"));<br />  end);<br />}<br />----------------------------------------------------------------------------<br />vm_nohw.vbus<br /><br />Io.add_vbusses<br />{<br />  vm_nohw = Io.Vi.System_bus(function()<br />    VGIC = wrap(Io.system_bus():match("arm-gicc"));<br />    VM2_DEV = wrap(Io.system_bus():match("vm2_dev"));<br />  end);<br /><p>}</p><p>----------------------------------------------------------------------------</p><p><br /></p><p>Nico<br /><br /></p><span labeltype="reply">于  2018-04-11 05:59:58,Adam Lackorzynski<adam os="" inf="" tu-dresden="" de="">写道:</adam></span><blockquote style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid"><pre>On Mon Apr 09, 2018 at 22:26:38 +0800, nico wrote:
> Sorry, the last email did not specify this information. 
> I gave VM1 all the hardware resources, and it used eight cores. VM2 only has
> uart resources (also timer, gic resources), using a single core. I tried to
> give both VM1 and VM2 only the necessary hardware resources( uart, timer, gic),
> and that error won't happen.

Ok, that's interesting. So that means that some of the passed through
hardware is causing this. Would you be able to find out which device is
causing this, by selectively enabling/disabling devices?


Adam

> On 4/9/2018 06:28ï¼ Adam Lackorzynski<adam os="" inf="" tu-dresden="" de=""> wroteï¼ 
> 
>     Hi Nico,
> 
>     On Fri Mar 30, 2018 at 10:15:33 +0800, nico wrote:
> 
>         Hi Adam, I'm using an eight-core Cortex-A53 processor. The vm is
>         running 64bit Linux. It is recommended to start two or three vms, that
>         will be easier to reproduce this problem.
> 
> 
>     So, I tried several things but cannot reproduce this issue. I assume
>     this are single-core VMs only? Any hardware passed through?
>     Just trying to narrow it down...

_______________________________________________
l4-hackers mailing list
l4-hackers at os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers<span style="font-family:Times New Roman;"><span style="white-space: normal;">
</span></span></adam></pre></blockquote><div style="height:30px;"></div><div style="height:2px;width:298px;border-bottom:solid 2px #e5e5e5"></div><div style="height:20px;"></div><a target="_blank" style="background-image:url(http://r.g.tom.com/kwap/r/app/other/suixinyou.png);background-repeat:no-repeat;background-position:left center;font-size:14px;background-size: 20px;height: 39px;line-height: 39px;padding-left: 25px;display:block;color:#333333;text-decoration: none;" href="http://mail.tom.com/webmail-static/welcomesxy.html"  onmouseover="this.style.cssText='background-image:url(http://r.g.tom.com/kwap/r/app/other/suixinyou.png);background-repeat:no-repeat;background-position:left center;font-size:14px;background-size: 20px;height: 39px;line-height: 39px;padding-left: 27px;display:block;color:#4c4c4c; text-decoration:underline;'" onmouseout="this.style.cssText='background-image:url(http://r.g.tom.com/kwap/r/app/other/suixinyou.png);background-repeat:no-repeat;background-position:left center;font-size:14px;background-size: 20px;height: 39px;line-height: 39px;padding-left: 27px;display:block;color:#4c4c4c;text-decoration:none'">随心邮-在微信里收发邮件,及时省电又安心</a>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20180503/b60db191/attachment.htm>


More information about the l4-hackers mailing list