mte-dynamic-carveout/spec.md
Peter Collingbourne <[email protected]>
Evgenii Stepanov <[email protected]>
A Tag Block refers to 32 Data Pages together with 1 page of corresponding tag storage for the Data Pages (the Tag Page). The number of available Tag Blocks for a given DRAM size may be calculated as follows: (DRAM size / Page size / 33).
The goal is to allow an operating system running at EL1 to choose at runtime whether to use a Tag Block to store untagged data (Data Pages and Tag Page mapped as Normal memory) or to store tagged data (Data Pages mapped as Tagged Normal memory), and to freely switch between them.
If the hardware meets optional requirements for relocatable Tag Blocks, a hypervisor running at EL2 should be able to virtualize Tag Blocks without knowing whether EL1 is using the Tag Block for tagged or untagged data.
DC CIGVAC, Xt) over the Data Pages of a Tag Block followed by clean and
invalidate of data to Point of Coherency (DC CIVAC, Xt) over the Tag Page,
or a similar operation (referred to as a Tag Storage Clean operation),
will put the memory system into a state where neither of the following
can occur:
a. Writeback of cached tags to the Tag Page.
b. Writeback of cached data to the Tag Page, if the Tag Page was
previously used to store untagged data.This is a sketch of how operating system software may use the dynamic tag storage feature. It assumes a simple freelist-based page allocator.
This describes how a hypervisor may be built on top of a kernel supporting the dynamic tag storage feature.
Alternatively, a hypervisor may virtualize the dynamic tag storage feature, which would allow the guest to make use of unused tag storage, at the cost of requiring memory to be handed to the guest in Tag Block sized chunks, potentially requiring compaction: