KVM: x86 emulator: fix memory access during x86 emulation
authorGleb Natapov <gleb@redhat.com>
Wed, 10 Feb 2010 12:21:32 +0000 (14:21 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:11 +0000 (12:36 -0300)
commit1871c6020d7308afb99127bba51f04548e7ca84e
tree64871be680574ed53104923456dc0b184db3cf69
parenta0044755679f3e761b8b95995e5f2db2b7efd0f6
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>
arch/x86/include/asm/kvm_emulate.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/emulate.c
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.h
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/x86.c