Revert "Revert "ANDROID: KVM: arm64: Unmap S2MPU MMIO regions in MPT""

This reverts commit d52e3e4473.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I465cb99696ef1aba22a8cb575736b81773e47831
This commit is contained in:
Will Deacon
2022-07-07 15:51:44 +01:00
parent 5436ba5277
commit 31094eab00

View File

@@ -14,6 +14,7 @@
#include <linux/arm-smccc.h>
#include <nvhe/memory.h>
#include <nvhe/mem_protect.h>
#include <nvhe/mm.h>
#include <nvhe/spinlock.h>
#include <nvhe/trap_handler.h>
@@ -452,6 +453,11 @@ static int s2mpu_init(void)
*/
for_each_powered_s2mpu(dev)
initialize_with_mpt(dev, &kvm_hyp_host_mpt);
/* Prevent DMA to the S2MPU MMIO regions. */
for_each_s2mpu(dev)
s2mpu_host_stage2_set_owner(dev->pa, S2MPU_MMIO_SIZE, pkvm_hyp_id);
return 0;
}