From: Lai Jiangshan Date: Wed, 26 May 2010 08:48:25 +0000 (+0800) Subject: KVM: MMU: Calculate correct base gfn for direct non-DIR level X-Git-Tag: v2.6.36-rc1~580^2~126 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9fa0b3bef9a0b117b3c3f958ec553c21f609a9f;p=pandora-kernel.git 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 Signed-off-by: Lai Jiangshan Signed-off-by: Avi Kivity --- Reading git-diff-tree failed