On 27/07/2023 10:58, Jan-Marc Stranz wrote:
Hello Ralf!

Thank you very much for the explanations!

I wonder now that if the hypervisor now has to handle a very large page table, the timing behavior of an application in the guest cell will be negatively affected.

Of course, can be.


Could this then be optimized, e.g. using "huge pages"?

Yes. Depending on the alignment, Jailhouse will automatically try to map huge pages, if possible.

Is there a description for this?

See here for x86 paging mechanisms:

https://github.com/siemens/jailhouse/blob/master/hypervisor/arch/x86/paging.c#L134C4-L134C35

Besides 4k pages, you also have 2M and 1G pages. However, 1G pages require, that the physical and virtual address are 1G-aligned.

  Ralf



Thanks
Jan.

Ralf Ramsauer schrieb am Mittwoch, 26. Juli 2023 um 15:48:44 UTC+2:



    On 26/07/2023 14:41, Jan-Marc Stranz wrote:
     > Thanks for the tip to increase the memory area for the hypervisor!
     >
     > I have increased the memory area for the hypervisor from 6 MiB to
    9 MiB
     > and can now successfully start both guest cells with a size of
    512 MiB each.
     >
     > I don't know if there is a hint in the documentation for the
    hypervisor
     > "Jailhouse" (in the GIT repository).
     > If not, it would certainly be very helpful if this correlation
    (guest
     > cell size - required memory for hypervisor) is described
    somewhere (e.g.
     > in the file "Documentation/non-root-linux.txt").

    Patches welcome! I'd rather recommend to print a proper error
    message in
    the hypervisor that gives a pointer to this issue.

    Just a short explanation what happened: Jailhouse tries to map huge
    pages to minimise pressure on TLB. In your case, the area isn't aligned
    with huge pages, so Jailhouse must map tons of 4k-Pages to cover that
    memory region. Mapping those pages requires memory for page tables, and
    apparently, 6MiB weren't sufficient.

    Thanks
    Ralf

     >
     > Jan-Marc.
     >
     > Ralf Ramsauer schrieb am Mittwoch, 26. Juli 2023 um 13:12:02 UTC+2:
     >
     >
     >
     > On 26/07/2023 12:56, Jan-Marc Stranz wrote:
     > > Of course, I checked the configuration for the root cell with
     > "jailhouse
     > > config check".
     > > However, this is not changed at all while I change the
     > configuration for
     > > the guest cells.
     > >
     > > Also, everything is fine as long as I don't set the size for the
     > guest
     > > cell larger than 320 MiB in the guest cell configuration.
     > > This only uses about 62% of the memory area reserved for the
     > guest cells
     > > in the configuration for the root cell.
     > >
     > > I will follow up on the tip to increase the memory area for the
     > > hypervisor ( hypervisor_memory.size).
     > > So far, 6 MiB is reserved for the hypervisor itself.
     > > To what size should I increase this memory area?
     >
     > Just a bit more. Try 10 MiB or so.
     >
     > Ralf
     >
     > >
     > > However, to find the cause in the driver or hypervisor, I lack the
     > > necessary knowledge about the structure and relationships.
     > > So I have to rely on external help.
     > >
     > > Thanks a lot!
     > > Jan-Marc.
     > >
     > > --
     > > You received this message because you are subscribed to the Google
     > > Groups "Jailhouse" group.
     > > To unsubscribe from this group and stop receiving emails from it,
     > send
     > > an email to jailhouse-de...@googlegroups.com
     > > <mailto:jailhouse-de...@googlegroups.com>.
     > > To view this discussion on the web visit
     > >
     >
    https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com> 
<https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com>> 
<https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com?utm_medium=email&utm_source=footer
 
<https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com?utm_medium=email&utm_source=footer>
 
<https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com?utm_medium=email&utm_source=footer
 
<https://groups.google.com/d/msgid/jailhouse-dev/43f41f9d-0930-416b-a618-1955e237cc87n%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
     >
     > --
     > You received this message because you are subscribed to the Google
     > Groups "Jailhouse" group.
     > To unsubscribe from this group and stop receiving emails from it,
    send
     > an email to jailhouse-de...@googlegroups.com
     > <mailto:jailhouse-de...@googlegroups.com>.
     > To view this discussion on the web visit
     >
    
https://groups.google.com/d/msgid/jailhouse-dev/57a4477a-2c32-49ef-8ccc-e95e1d9fb815n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/57a4477a-2c32-49ef-8ccc-e95e1d9fb815n%40googlegroups.com>
 
<https://groups.google.com/d/msgid/jailhouse-dev/57a4477a-2c32-49ef-8ccc-e95e1d9fb815n%40googlegroups.com?utm_medium=email&utm_source=footer
 
<https://groups.google.com/d/msgid/jailhouse-dev/57a4477a-2c32-49ef-8ccc-e95e1d9fb815n%40googlegroups.com?utm_medium=email&utm_source=footer>>.

--
You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to jailhouse-dev+unsubscr...@googlegroups.com <mailto:jailhouse-dev+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/10922b18-30e5-414e-8d85-7e1f33f2f9fan%40googlegroups.com <https://groups.google.com/d/msgid/jailhouse-dev/10922b18-30e5-414e-8d85-7e1f33f2f9fan%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/8e9df4fc-0fb3-5149-aba6-d7f506e902af%40oth-regensburg.de.

Reply via email to