Skip to content
Commit 80ee7d74 authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker
Browse files

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: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
parent 09fd5390
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment