<div dir="ltr"><div dir="ltr">Hi Jan,<div><br></div><div>Thanks for the confirmation to proceed on project proposal.</div><div><br></div><div>Also, I tried installing Jailhouse on my VM after enabling VT-x/EPT and IOMMU for my VM(Guest OS- Ubuntu 18.04) on VMware fusion hypervisor with MacOS on the host side.</div><div>However,  Jailhouse hardware check was failed because of missing <b>Preemption timer and Virtualize APIC access</b>, could you please suggest, if this is hardware limitation?  Is there any workaround here?</div><div>My laptop's processor is Intel quad-core i7.</div><div><br></div><div><div><img src="cid:ii_k8fa90it0" alt="image.png" width="449" height="334" style="margin-right: 0px;"><br></div></div><div><br></div><div>Also, could you please suggest, if I can talk to you through an IRC or slack channel since it is a bit hard to communicate over email every time.</div><div><br></div><div>Thanks,</div><div>Prakhar</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 30, 2020 at 6:15 AM Jan Kiszka <<a href="mailto:jan.kiszka@web.de">jan.kiszka@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 30.03.20 10:02, PRAKHAR BANSAL wrote:<br>
> Hi Jan,<br>
><br>
> On Sat, Mar 28, 2020 at 4:12 AM Jan Kiszka <<a href="mailto:jan.kiszka@web.de" target="_blank">jan.kiszka@web.de</a><br>
> <mailto:<a href="mailto:jan.kiszka@web.de" target="_blank">jan.kiszka@web.de</a>>> wrote:<br>
><br>
>     On 28.03.20 08:47, PRAKHAR BANSAL wrote:<br>
>      > Hi Jan,<br>
>      ><br>
>      > Thanks for the reply!<br>
>      ><br>
>      > I was only considering the command-line tool "code" for reference<br>
>     to the<br>
>      > Jailhouse kernel API(ioctl calls) because I didn't find a<br>
>     documentation<br>
>      > of the Jailhouse kernel APIs.<br>
><br>
>     Right, the IOCTL API is not documented so far. It is currently only used<br>
>     inside the Jailhouse project. This needs to be formalized when there<br>
>     shall be external users like a libvirt driver.<br>
><br>
>     That might be a nice small contribution task: Create some<br>
>     Documentation/driver-interfaces.md that describes the IOCTLs along with<br>
>     their parameter structures and that also includes the current<br>
>     sysfs-entries.txt as a section. Then send this as patch here. I'll help<br>
>     out when details are not clear from reading the code.<br>
><br>
> Sure. I will do that.<br>
><br>
>      ><br>
>      > For the second part as you mentioned that Jailhouse can only create<br>
>      > cells with the constraints defined in the root cell configuration. I<br>
>      > have a few questions regarding that.<br>
>      ><br>
>      > 1. Is there a way to know if Jailhouse is enabled on the host and get<br>
>      > the root cell configuration(s) from Jailhouse through an API?<br>
>     This can<br>
>      > be used while binding the libvirt to the Jailhouse hypervisor.<br>
><br>
>     Look at<br>
>     <a href="https://github.com/siemens/jailhouse/blob/master/Documentation/sysfs-entries.txt" rel="noreferrer" target="_blank">https://github.com/siemens/jailhouse/blob/master/Documentation/sysfs-entries.txt</a><br>
>     for what is reported as runtime information. Full configurations can't<br>
>     be read back at this point. This might be reconsidered in the light of<br>
>     [1], but I wouldn't plat for that yet.<br>
><br>
><br>
> Ok, sure. I am looking into it.<br>
><br>
><br>
>      ><br>
>      > 2. If Jailhouse is not enabled(again can we know this using some API)<br>
>      > then, can libvirt enable/disable Jailhouse during the libvirt<br>
>     binding of<br>
>      > the Jailhouse driver with a given set of Jailhouse cell<br>
>     configurations<br>
>      > describing a complete partitioned system?<br>
><br>
>     With the API above and a given configuration set, yes. The config set<br>
>     would have to be provided to the libvirt driver in some to-be-defined<br>
>     way (e.g. /etc/libvirt/jailhouse.conf -> /etc/libvirt/jailhouse/*.cell).<br>
><br>
> Cool, got it. Thanks!<br>
><br>
>      ><br>
>      > 3. I was wondering, as you mentioned that libvirt driver should check<br>
>      > for mismatch of the cell configuration with the root cell<br>
>     configuration,<br>
>      > the question is, isn't that done by Jailhouse itself? If yes, then<br>
>      > libvirt can just pass on the cell creation requests to Jailhouse and<br>
>      > return the response to the user as it is, rather than driver<br>
>     doing any<br>
>      > such mismatch check.<br>
><br>
>     With matching I'm referring to a libvirt user request like "create a<br>
>     domain with 2 CPUs", while there are no cells left that have more than<br>
>     one CPU. Or "give the domain 1G RAM", and you need to find an available<br>
>     cell with that much memory. Those are simple examples. A request that<br>
>     states "connect the domain to the host network A" implies that a cell<br>
>     has a shared-memory link to, say, the root cell that can be configured<br>
>     to bridge this. But let's keep that for later and start as simple as<br>
>     possible.<br>
><br>
><br>
> Do I need to match the libvirt user-requested cell config with only root<br>
> cells or with all cells present at that time?<br>
<br>
With all non-root cells - the root cell will be occupied already (it<br>
runs libvirt e.g.).<br>
<br>
><br>
> I wanted to request you for a favor for the proposal as the deadline is<br>
> approaching. Could I prepare a proposal for this project based on our<br>
> discussion here and improve it later based on feedback comments after<br>
> the deadline? I understand that I got late in starting on the project<br>
> search and selection.<br>
<br>
Sure, please go ahead.<br>
<br>
Jan<br>
<br>
><br>
> Thanks,<br>
> Prakhar<br>
><br>
><br>
>     Jan<br>
><br>
>     [1]<br>
>     <a href="https://groups.google.com/d/msgid/jailhouse-dev/CADiTV-1QiRhSWZnw%2BkHhJMO-BoA4sAcOmTkQE7ZWbHkGh3Jexw%40mail.gmail.com" rel="noreferrer" target="_blank">https://groups.google.com/d/msgid/jailhouse-dev/CADiTV-1QiRhSWZnw%2BkHhJMO-BoA4sAcOmTkQE7ZWbHkGh3Jexw%40mail.gmail.com</a><br>
><br>
>      ><br>
>      > -Prakhar<br>
>      ><br>
>      > On Thu, Mar 26, 2020 at 1:49 AM Jan Kiszka <<a href="mailto:jan.kiszka@web.de" target="_blank">jan.kiszka@web.de</a><br>
>     <mailto:<a href="mailto:jan.kiszka@web.de" target="_blank">jan.kiszka@web.de</a>><br>
>      > <mailto:<a href="mailto:jan.kiszka@web.de" target="_blank">jan.kiszka@web.de</a> <mailto:<a href="mailto:jan.kiszka@web.de" target="_blank">jan.kiszka@web.de</a>>>> wrote:<br>
>      ><br>
>      >     Hi Prakhar,<br>
>      ><br>
>      >     On 25.03.20 05:36, PRAKHAR BANSAL wrote:<br>
>      >      > Hi Jan,<br>
>      >      ><br>
>      >      > Thanks for the reply. I looked deeper into the libvirt and<br>
>     Jailhouse<br>
>      >      > source code and found following two things that seem<br>
>     relevant to the<br>
>      >      > project I am interested in.<br>
>      >      ><br>
>      >      > - Libvirt driver interface at [libvirt.git]<br>
>      >      > <<a href="https://libvirt.org/git/?p=libvirt.git;a=tree;hb=HEAD" rel="noreferrer" target="_blank">https://libvirt.org/git/?p=libvirt.git;a=tree;hb=HEAD</a>> / src<br>
>      >      ><br>
>     <<a href="https://libvirt.org/git/?p=libvirt.git;a=tree;f=src;hb=HEAD" rel="noreferrer" target="_blank">https://libvirt.org/git/?p=libvirt.git;a=tree;f=src;hb=HEAD</a>> /<br>
>      >     driver.h<br>
>      >      ><br>
>      ><br>
>       <<a href="https://libvirt.org/git/?p=libvirt.git;a=blob_plain;f=src/driver.h;hb=HEAD" rel="noreferrer" target="_blank">https://libvirt.org/git/?p=libvirt.git;a=blob_plain;f=src/driver.h;hb=HEAD</a>><br>
>      >      > - Jailhouse tool, which is using the ioctl API of the<br>
>     Jailhouse,<br>
>      >      > available at<br>
>      >      ><br>
>     <a href="https://github.com/siemens/jailhouse/blob/master/tools/jailhouse.c" rel="noreferrer" target="_blank">https://github.com/siemens/jailhouse/blob/master/tools/jailhouse.c</a>.<br>
>      >      ><br>
>      >      > With the help of the above two, it looks like, a libvirt<br>
>     driver<br>
>      >     for the<br>
>      >      > Jailhouse can be implemented. Let me know if I am moving<br>
>     in the right<br>
>      >      > direction so far.<br>
>      ><br>
>      >       From the Jailhouse perspective, it is important to not<br>
>     consider the<br>
>      >     command line tool an interface anymore (like in the first<br>
>     prototype) but<br>
>      >     build on top of the Linux driver API (ioctls, sysfs). There<br>
>     is already a<br>
>      >     Python library which started to abstract this interface for<br>
>      >     Jailhouse-internal use cases. However, I strongly suspect<br>
>     libvirt will<br>
>      >     rather want a native binding.<br>
>      ><br>
>      >      ><br>
>      >      > I have been looking at the other libvirt driver<br>
>     implementations for<br>
>      >      > hypervisors like HyperV and VMware to understand their<br>
>     implementation<br>
>      >      > and learn from there.<br>
>      ><br>
>      >     As Jailhouse is a static partitioning hypervisor without<br>
>     abstraction of<br>
>      >     the underlying hardware, your starting point for the libvirt<br>
>     binding<br>
>      >     should be a given set of Jailhouse cell configurations<br>
>     describing a<br>
>      >     complete partitioned system. So rather than instantiating on<br>
>     demand a<br>
>      >     domain (Jailhouse cell) with, say, a network adapter, the<br>
>     driver should<br>
>      >     match a user request for a domain against the configuration<br>
>     set and use<br>
>      >     what is there - or report the mismatch. What it could<br>
>     organize, though,<br>
>      >     is interconnecting cells that have a (preconfigured) virtual<br>
>     network<br>
>      >     link to the root cell.<br>
>      ><br>
>      >     Due to this different concept, there will be no 1:1 mapping for<br>
>      >     commodity hypervisor drivers to the Jailhouse scenario.<br>
>     Still, studying<br>
>      >     what they do is useful and needed in order to understand what<br>
>     "normally"<br>
>      >     happens and find a reasonable translation. This is probably<br>
>     the most<br>
>      >     challenging part of the project.<br>
>      ><br>
>      >     Jan<br>
>      ><br>
><br>
<br>
</blockquote></div>