arm64: RME: Don't access undelegated pgd raw
The UNDELEGATE guarantees that the returned page is scrubbed, but that
doesn't mean zeroed. With FEAT_MEC RMM scrubs the page using the Realm
MEC context, so reading it with the NS MEC context won't return zero.
When destroying the Realm, after undelegating the PGD we call
kvm_free_stage2_pgd() to free it. It calls kvm_pgtable_stage2_destroy()
which iterates over the PGD content to clear next level page tables. In
our case there is none because we already cleaned up the RTTs. Ensure
that kvm_pgtable_stage2_destroy() reads a valid empty PGD, instead of
poisoned data.
There is definitely a cleaner way to implement this.
Signed-off-by:
Jean-Philippe Brucker <jean-philippe@linaro.org>
Loading
Please register or sign in to comment