Branch: refs/heads/wip/cache-coloring
  Home:   https://github.com/siemens/jailhouse
  Commit: 9459c6054bf008062ac3492fd9b8cbc4e64b6c03
      
https://github.com/siemens/jailhouse/commit/9459c6054bf008062ac3492fd9b8cbc4e64b6c03
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    A hypervisor/include/jailhouse/coloring.h
    M include/jailhouse/cell-config.h

  Log Message:
  -----------
  hypervisor: introduce a common cache coloring interface

Add fundamental primitives to implement support for cache coloring.
The latter is performed by exploiting the mapping of memories flagged as
JAILHOUSE_MEM_COLORED and defined in the inmates' configurations (no
root-cell or hypervisor itself supported yet).
The interface defines the basic functions that have to be implemented in
order to support coloring for a specific architecture.

Define three main functions:
- coloring_paging_init: calculate which bit range in the address is useful
  for cache coloring, assuming it limited by the page size and the LLC
  way size as happens on arm;
- next_colored: calculate the next physical page address that conforms
  to a given colors selection and to the bits calculated in the previous
  function;
- coloring_cell_init: initialize cell colors assignement depending on its
  configuration;

LLC way size is required for coloring to work and it can be explicitly
defined in the root cell configuration. Add a helper function that
probes the way size from hardware if the llc_way_size is not set in the
root cell configuration.

Finally, define a function used to calculate the physical end address of
a given memory that is flagged as colored.

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>


  Commit: 4f9415aabda58f8d9b687d70bfa299809e659707
      
https://github.com/siemens/jailhouse/commit/4f9415aabda58f8d9b687d70bfa299809e659707
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hypervisor/include/jailhouse/paging.h
    M hypervisor/paging.c

  Log Message:
  -----------
  hypervisor: implement paging_create/destroy_colored

Add functions for colored page creation and destruction and initialize
coloring on the platform.

The story of the life of a coloring page can be summarized as follows.

1. Bits in the address that are useful for defining colors are computed,
   and used for all mappings. The page size used to obtain the lower limit
   is assumed to be aligned with the `PAGE_SIZE` constant defaulting at
   4KiB, and also as the unit for the mapping operation, even when
   consecutive pages would be possible.

2. The colored regions can then mapped with a new paging function and
   destructed with the old one, because `paging_destroy*` acts on virtual
   addresses while coloring happens on the physical ones.
   Paging_create has to handle the remap to root_cell too when e.g.
   destroying cells.

3. The colored unmap function is instead used only when destroying the
   root cell mapping, since we assume that the root cell uses a 1:1 mapping
   for memory regions.

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>


  Commit: f793a572bd9de1ee701780a627334628e49df646
      
https://github.com/siemens/jailhouse/commit/f793a572bd9de1ee701780a627334628e49df646
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M driver/Makefile
    M driver/cell.h
    M driver/main.c
    M include/jailhouse/cell-config.h

  Log Message:
  -----------
  driver: introduce col_load_address for colored binaries loading

Currently Jailhouse loads inmate's binaries by mapping its memory region
to the root cell. When coloring is enabled this operation becomes
not trivial. To avoid logic duplication in the driver module,
use a special memory space when loading to colored regions. This
convenient memory space starts from a fixed address defined by
`col_loads_address` and will be mapped by the hypervisor using the same
size and coloring configuration as the inmate.
Since there could be platforms with different memory space layouts, the
choice of `col_loads_address` has to be done accordingly.
Allow the user to set this value in the root-cell configuration and set
the default to 16 GiB. The latter has been empirically choosen as default
value.

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>
Acked-by: Angelo Ruocco <[email protected]>


  Commit: 2467d0380cf1aa775e997219540c7ca9493c6167
      
https://github.com/siemens/jailhouse/commit/2467d0380cf1aa775e997219540c7ca9493c6167
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hypervisor/arch/arm-common/include/asm/cell.h
    A hypervisor/arch/arm-common/include/asm/coloring.h
    M hypervisor/arch/arm-common/mmu_cell.c

  Log Message:
  -----------
  hypervisor, arm-common: add initial support for cache coloring

Use a bitmask array with fixed size for the cell's color assignment.
The largest amount of shared last-level segment cache equipping an Arm v8
cluster for the embedded segment (i.e. Cortex A5?, A7?), which contains
up to 8 cores, is 8 MiB with 16-ways associativity.
Now, assuming the coloring algorithm to be the same as we support, i.e.
smallest granularity with 4 KiB pages, we compute that up to 128 colors
available.
For this reason set the amount of colors supported to 128.

Colored regions defined by the flag JAILHOUSE_MEM_COLORED are mapped
using the "colored" version of paging_create when needed.
The colored version of paging_destroy is used only when unmapping from
the root cell since we are assuming a 1:1 mapping for it.

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>


  Commit: 2f45f3f8fc7d609e5d48b94d547b7f20f30bf01a
      
https://github.com/siemens/jailhouse/commit/2f45f3f8fc7d609e5d48b94d547b7f20f30bf01a
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hypervisor/control.c

  Log Message:
  -----------
  hypervisor: introduce color_root_cell_management

The usual life cycle of an inmate is divided in 4 phases: creation,
loading, starting and destruction. The most crucial phase for coloring
is the loading one because Jailhouse relies on Linux and its driver
module for loading binaries. In order to avoid exposing the coloring
logic outside the hypervisor, use a separate memory for loading binaries
to colored regions.
During creation and destruction phases there is no functional change:
the memory is mapped and unmapped using coloring functions as they
should since we are handling colored regions.
During loading phase a special colored mapping is created. The latter
has the same physical start and coloring logic as the cell's memory but
virtually starts at col_load_address.
This will expose a virtually contiguous memory region that will be used
by the driver to load binaries. During starting phase this special
memory is destroyed.

Add the missing CELL_CREATE state and introduce a management function
that handles the colored scenario for all the above phases.

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>


  Commit: 168b94dd6b4989d838967aeb2f936c02d2b04077
      
https://github.com/siemens/jailhouse/commit/168b94dd6b4989d838967aeb2f936c02d2b04077
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M driver/cell.c

  Log Message:
  -----------
  driver: handle loading to colored regions

Do not use the memory physical address start when loading into colored
regions. Map the memory starting at col_load_address instead.
That region has been mapped by Jailhouse with the same color
configuration as the inmate and exposed as a virtually contiguous space.

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>


  Commit: 98904b5ba9e0c32b57e485cd811e977a15266cb3
      
https://github.com/siemens/jailhouse/commit/98904b5ba9e0c32b57e485cd811e977a15266cb3
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M hypervisor/arch/arm64/Kbuild
    A hypervisor/arch/arm64/coloring.c

  Log Message:
  -----------
  hypervisor, arm64: add cache coloring support

Implement all the functions needed by the coloring interface for the
arm64 architecture.
Coloring selection is retrieved by the jailhouse_cache structure(s) in
cell's configuration. Each structure defines a color range that will be
mapped to the corresponding color bitmask. The configuration is
cell-wide and will be used with all the memory regions flagged with
JAILHOUSE_MEM_COLORED.
If no color selection is provided by the user and coloring is enabled,
use all the available colors on the platform.

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>
Acked-by: Angelo Ruocco <[email protected]>


  Commit: b7343ca1e1df197d399e1a27c157425ddc0b750a
      
https://github.com/siemens/jailhouse/commit/b7343ca1e1df197d399e1a27c157425ddc0b750a
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    A configs/arm64/zynqmp-zcu102-inmate-demo-col.c
    A configs/arm64/zynqmp-zcu102-linux-demo-col.c

  Log Message:
  -----------
  configs: add colored cell configuations for ZCU102

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>


  Commit: f9099f71eacbf3fa3491b0ed2551a8caf4654702
      
https://github.com/siemens/jailhouse/commit/f9099f71eacbf3fa3491b0ed2551a8caf4654702
  Author: Luca Miccio <[email protected]>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    A Documentation/cache-coloring.md

  Log Message:
  -----------
  Documentation: add description and usage of cache coloring support

Signed-off-by: Luca Miccio <[email protected]>
Signed-off-by: Marco Solieri <[email protected]>


  Commit: 403ec70f3c53915ad3411b2ead5801ac5d1fa325
      
https://github.com/siemens/jailhouse/commit/403ec70f3c53915ad3411b2ead5801ac5d1fa325
  Author: Jan Kiszka <[email protected]>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M configs/arm64/qemu-arm64-linux-demo.c
    M configs/arm64/qemu-arm64.c
    M driver/cell.c
    M driver/cell.h
    M driver/main.c
    M driver/main.h
    M hypervisor/arch/arm-common/mmu_cell.c
    M hypervisor/control.c
    M hypervisor/paging.c
    A include/jailhouse/cache-coloring.h
    M include/jailhouse/cell-config.h
    M pyjailhouse/config_parser.py

  Log Message:
  -----------
  hacks

Likely broken, definitely for qemu-arm64.


Compare: 
https://github.com/siemens/jailhouse/compare/7442735e0862...403ec70f3c53

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/siemens/jailhouse/push/refs/heads/wip/cache-coloring/744273-403ec7%40github.com.

Reply via email to