Commit 4475d993 authored by David Brazdil's avatar David Brazdil
Browse files

ANDROID: KVM: arm64: Modify S2MPU MPT in 'host_stage2_set_owner'



The 'host_stage2_set_owner' callback indicates that a range of
PA-contiguous pages changed owner. With all devices owned by the host,
the driver sets the protection bits in the corresponding FMPT/SMPT to
either MPT_PROT_RW if owned by the host or MPT_PROT_NONE otherwise.

For each gigabyte region, the implementation will select between 1G and
4K/64K (depending on PAGE_SIZE) mappings and populate the L1ENTRY_ATTR
register or SMPT bitmap, respectivelly.

The driver never dynamically switches between two granularities which
both require a SMPT. This is because the L1ENTRY_ATTR and
L1ENTRY_L2TABLE_ADDR registers would need to be set atomically.

Test: builds, boots
Bug: 190463801
Signed-off-by: default avatarDavid Brazdil <dbrazdil@google.com>
Change-Id: I9d21df4c615e436285a08720216ac5119e1cfeef
parent f0e1de52
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment