diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-02-10 14:21:32 +0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 12:36:11 -0300 |
commit | 1871c6020d7308afb99127bba51f04548e7ca84e (patch) | |
tree | 64871be680574ed53104923456dc0b184db3cf69 /arch/x86/kvm/mmu.h | |
parent | a0044755679f3e761b8b95995e5f2db2b7efd0f6 (diff) | |
download | linux-stable-1871c6020d7308afb99127bba51f04548e7ca84e.tar.gz linux-stable-1871c6020d7308afb99127bba51f04548e7ca84e.tar.bz2 linux-stable-1871c6020d7308afb99127bba51f04548e7ca84e.zip |
KVM: x86 emulator: fix memory access during x86 emulation
Currently when x86 emulator needs to access memory, page walk is done with
broadest permission possible, so if emulated instruction was executed
by userspace process it can still access kernel memory. Fix that by
providing correct memory access to page walker during emulation.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.h')
-rw-r--r-- | arch/x86/kvm/mmu.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h index 61ef5a65b7d8..be66759321a5 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h @@ -42,6 +42,12 @@ #define PT_DIRECTORY_LEVEL 2 #define PT_PAGE_TABLE_LEVEL 1 +#define PFERR_PRESENT_MASK (1U << 0) +#define PFERR_WRITE_MASK (1U << 1) +#define PFERR_USER_MASK (1U << 2) +#define PFERR_RSVD_MASK (1U << 3) +#define PFERR_FETCH_MASK (1U << 4) + int kvm_mmu_get_spte_hierarchy(struct kvm_vcpu *vcpu, u64 addr, u64 sptes[4]); static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu) |