[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 27/36] xen/arch: add coloring support for Xen



Hi,

On 04/03/2022 19:47, Julien Grall wrote:
On 04/03/2022 17:46, Marco Solieri wrote:
From: Luca Miccio <lucmiccio@xxxxxxxxx>

Introduce a new implementation of setup_pagetables that uses coloring
logic in order to isolate Xen code using its color selection.
Page tables construction is essentially copied, except for the xenmap
table, where coloring logic is needed.  Given the absence of a contiguous
physical mapping, pointers to next level tables need to be manually
calculated.

The implementation of setup_pagetables() is not compliant to the Arm Arm. And I have plan to completely get rid of it.

The main part that is not compliant is switch_ttbr() because it keeps the MMU on. We should switch the MMU off, update the TTBR and then switch on the MMU. This implies that we need an identity mapping of the part of Xen that will run with MMU off.

I understand that rebuilding the page-tables and therefore switching the TTBR will be necessary for cache coloring. So before any new use, I would like the implementation of switch_ttbr() to be fixed.

What we will need to do is find space in the virtual layout that also match a physical address. With that in place, we could use the mapping to switch between TTBR.

I have posted an early RFC [1] to reshuffle the memory layout on Arm so we have space to for the identity mapping. I have also reworked switch_ttbr() to turn off/on the MMU before/after updating the TTBR.

The series should work on arm64. The arm32 effort requires a bit more effort as we have less virtual space.

I haven't killed setup_pagetables() yet so you have a base to write the cache coloring version. There may be also some tweak necessary for cache coloring (e.g. flush the instruction cache).

Cheers,

[1] https://lore.kernel.org/xen-devel/20220309112048.17377-1-julien@xxxxxxx/

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.