diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-08 12:08:16 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-22 18:20:54 +0300 |
commit | f13577e8aa863cf3b4f17541bc74f8e9b0b40c90 (patch) | |
tree | 927ee29f9622329b17a76c3b67d4007480197957 /arch/x86/kvm/paging_tmpl.h | |
parent | e9ad4ec8379ad1ba6f68b8ca1c26b50b5ae0a327 (diff) | |
download | linux-f13577e8aa863cf3b4f17541bc74f8e9b0b40c90.tar.xz |
KVM: MMU: return page fault error code from permission_fault
This will help in the implementation of PKRU, where the PK bit of the page
fault error code cannot be computed in advance (unlike I/D, R/W and U/S).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index e159a8185ad9..45ed3c38d20e 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -359,10 +359,9 @@ retry_walk: walker->ptes[walker->level - 1] = pte; } while (!is_last_gpte(mmu, walker->level, pte)); - if (unlikely(permission_fault(vcpu, mmu, pte_access, access))) { - errcode |= PFERR_PRESENT_MASK; + errcode = permission_fault(vcpu, mmu, pte_access, access); + if (unlikely(errcode)) goto error; - } gfn = gpte_to_gfn_lvl(pte, walker->level); gfn += (addr & PT_LVL_OFFSET_MASK(walker->level)) >> PAGE_SHIFT; |