diff options
| author | Joel Stanley <joel@jms.id.au> | 2020-08-10 07:07:46 +0300 |
|---|---|---|
| committer | Joel Stanley <joel@jms.id.au> | 2020-08-10 07:07:49 +0300 |
| commit | 4789fd48a313d36fe6b8fc1da5e0788f5ea074cb (patch) | |
| tree | 2c8c27b52f0e38abb7416ce81b04c3b85511b694 /virt | |
| parent | 8a9b346382056b52cd7ff141ae9f15a0fcfeb13d (diff) | |
| parent | d9939285fc818425ae92bd99f8c97b6b9ef3bb88 (diff) | |
| download | linux-dev-5.4.tar.xz | |
Merge tag 'v5.4.57' into dev-5.4dev-5.4
This is the 5.4.57 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'virt')
| -rw-r--r-- | virt/kvm/arm/mmu.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index ce7fa37987e1..767ac4eab4fe 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1199,7 +1199,7 @@ static bool stage2_get_leaf_entry(struct kvm *kvm, phys_addr_t addr, return true; } -static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr) +static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr, unsigned long sz) { pud_t *pudp; pmd_t *pmdp; @@ -1211,11 +1211,11 @@ static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr) return false; if (pudp) - return kvm_s2pud_exec(pudp); + return sz <= PUD_SIZE && kvm_s2pud_exec(pudp); else if (pmdp) - return kvm_s2pmd_exec(pmdp); + return sz <= PMD_SIZE && kvm_s2pmd_exec(pmdp); else - return kvm_s2pte_exec(ptep); + return sz == PAGE_SIZE && kvm_s2pte_exec(ptep); } static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache, @@ -1805,7 +1805,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, * execute permissions, and we preserve whatever we have. */ needs_exec = exec_fault || - (fault_status == FSC_PERM && stage2_is_exec(kvm, fault_ipa)); + (fault_status == FSC_PERM && + stage2_is_exec(kvm, fault_ipa, vma_pagesize)); if (vma_pagesize == PUD_SIZE) { pud_t new_pud = kvm_pfn_pud(pfn, mem_type); |
