}
struct kvm_s2_fault {
- bool write_fault;
bool exec_fault;
bool writable;
bool topup_memcache;
return ret;
fault->pfn = __kvm_faultin_pfn(s2fd->memslot, get_canonical_gfn(s2fd, fault),
- fault->write_fault ? FOLL_WRITE : 0,
+ kvm_is_write_fault(s2fd->vcpu) ? FOLL_WRITE : 0,
&fault->writable, &fault->page);
if (unlikely(is_error_noslot_pfn(fault->pfn))) {
if (fault->pfn == KVM_PFN_ERR_HWPOISON) {
*/
fault->s2_force_noncacheable = true;
}
- } else if (fault->logging_active && !fault->write_fault) {
+ } else if (fault->logging_active && !kvm_is_write_fault(s2fd->vcpu)) {
/*
* Only actually map the page as writable if this was a write
* fault.
static int user_mem_abort(const struct kvm_s2_fault_desc *s2fd)
{
bool perm_fault = kvm_vcpu_trap_is_permission_fault(s2fd->vcpu);
- bool write_fault = kvm_is_write_fault(s2fd->vcpu);
bool logging_active = memslot_is_logging(s2fd->memslot);
struct kvm_s2_fault fault = {
.logging_active = logging_active,
.force_pte = logging_active,
.prot = KVM_PGTABLE_PROT_R,
- .write_fault = write_fault,
.exec_fault = kvm_vcpu_trap_is_exec_fault(s2fd->vcpu),
- .topup_memcache = !perm_fault || (logging_active && write_fault),
+ .topup_memcache = !perm_fault || (logging_active && kvm_is_write_fault(s2fd->vcpu)),
};
void *memcache;
int ret;
- VM_WARN_ON_ONCE(fault.write_fault && fault.exec_fault);
-
/*
* Permission faults just need to update the existing leaf entry,
* and so normally don't require allocations from the memcache. The