]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: MMU: Calculate correct base gfn for direct non-DIR level
authorLai Jiangshan <laijs@cn.fujitsu.com>
Wed, 26 May 2010 08:48:25 +0000 (16:48 +0800)
committerAvi Kivity <avi@redhat.com>
Wed, 26 May 2010 10:15:28 +0000 (13:15 +0300)
commit8ccf8df926c54841edd4493be93f72186ac71e67
tree489b157da5df88730a3d48363f34f181c304ff60
parent8e9ec7b9091ed98fb723f7b115db41549de7739e
KVM: MMU: Calculate correct base gfn for direct non-DIR level

In Document/kvm/mmu.txt:
  gfn:
    Either the guest page table containing the translations shadowed by this
    page, or the base page frame for linear translations. See role.direct.

But in __direct_map(), the base gfn calculation is incorrect,
it does not calculate correctly when level=3 or 4.

Fix by using PT64_LVL_ADDR_MASK() which accounts for all levels correctly.

Reported-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c