ANDROID: KVM: arm64: Fix KVM_HOST_S2_DEFAULT_MMIO_PTE encoding
Commit b489c53001
("ANDROID: KVM: arm64: Allow setting {P,U}XN in
stage-2 PTEs") changed KVM_PTE_LEAF_ATTR_HI_S2_XN to refer to the XN
field of the pte (i.e. bits 54:53) instead of just bit 54 and forgot
to update KVM_HOST_S2_DEFAULT_MMIO_PTE in the process.
Consequently, coalescing will fail to apply to default MMIO ptes and
may inadvertently trigger for ptes marked as UXN. Fix the mask.
Cc: Quentin Perret <qperret@google.com>
Cc: Sebastian Ene <sebastianene@google.com>
Bug: 308395502
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I4f85eae7ccee008a1161e09739c1fd4f3e1b6e2b
This commit is contained in:
parent
5418491fa5
commit
9e4f6e1ef8
@ -234,7 +234,7 @@ enum kvm_pgtable_prot {
|
||||
|
||||
#define KVM_HOST_S2_DEFAULT_MMIO_PTE \
|
||||
(KVM_HOST_S2_DEFAULT_MEM_PTE | \
|
||||
KVM_PTE_LEAF_ATTR_HI_S2_XN)
|
||||
FIELD_PREP(KVM_PTE_LEAF_ATTR_HI_S2_XN, KVM_PTE_LEAF_ATTR_HI_S2_XN_XN))
|
||||
|
||||
#define PAGE_HYP KVM_PGTABLE_PROT_RW
|
||||
#define PAGE_HYP_EXEC (KVM_PGTABLE_PROT_R | KVM_PGTABLE_PROT_X)
|
||||
|
Loading…
Reference in New Issue
Block a user