bool mte_allowed;
bool is_vma_cacheable;
bool s2_force_noncacheable;
- bool vfio_allow_any_uc;
unsigned long mmu_seq;
phys_addr_t ipa;
- short vma_shift;
gfn_t gfn;
kvm_pfn_t pfn;
bool logging_active;
return -EFAULT;
}
- fault->vma_shift = kvm_s2_resolve_vma_size(vma, fault->hva, fault->memslot, fault->nested,
- &fault->force_pte, &fault->ipa);
- fault->vma_pagesize = 1UL << fault->vma_shift;
+ fault->vma_pagesize = 1UL << kvm_s2_resolve_vma_size(vma, fault->hva, fault->memslot,
+ fault->nested, &fault->force_pte,
+ &fault->ipa);
/*
* Both the canonical IPA and fault IPA must be aligned to the
fault->gfn = fault->ipa >> PAGE_SHIFT;
fault->mte_allowed = kvm_vma_mte_allowed(vma);
- fault->vfio_allow_any_uc = vma->vm_flags & VM_ALLOW_ANY_UNCACHED;
-
fault->vm_flags = vma->vm_flags;
fault->is_vma_cacheable = kvm_vma_is_cacheable(vma);
fault->write_fault ? FOLL_WRITE : 0,
&fault->writable, &fault->page);
if (fault->pfn == KVM_PFN_ERR_HWPOISON) {
- kvm_send_hwpoison_signal(fault->hva, fault->vma_shift);
+ kvm_send_hwpoison_signal(fault->hva, __ffs(fault->vma_pagesize));
return 0;
}
if (is_error_noslot_pfn(fault->pfn))
fault->prot |= KVM_PGTABLE_PROT_X;
if (fault->s2_force_noncacheable) {
- if (fault->vfio_allow_any_uc)
+ if (fault->vm_flags & VM_ALLOW_ANY_UNCACHED)
fault->prot |= KVM_PGTABLE_PROT_NORMAL_NC;
else
fault->prot |= KVM_PGTABLE_PROT_DEVICE;
.logging_active = memslot_is_logging(memslot),
.force_pte = memslot_is_logging(memslot),
.s2_force_noncacheable = false,
- .vfio_allow_any_uc = false,
.prot = KVM_PGTABLE_PROT_R,
};
struct kvm_s2_fault *fault = &fault_data;