ANDROID: KVM: arm64: Ensure TCR_EL2.PS is configured correctly
When E2H=1, the TCR_EL2.{I}PS bits should be preserved from TCR_EL1
whereas when E2H=0 they should be computed based on MMFR0_EL1.PARANGE.
Replace the unconditional assembly logic in hyp-init.S (which corrupts
TCR_EL2.T1SZ when E2H=1) with additional logic in cpu_prepare_hyp_mode()
so that E2H (hVHE) is properly taken into account.
This is loosely based on parts of the upstream commit bd412e2a
("KVM: arm64: Use LPA2 page-tables for stage2 and hyp stage1") which
moved the PS computation into C as part of adding support for LPA2.
Bug: 395497376
Signed-off-by:
Will Deacon <willdeacon@google.com>
Change-Id: I11c0127b26da5439a3499f1fda800148fa52e08f
Loading
Please sign in to comment