linux/arch/x86/kvm
Lai Jiangshan 3af1817a0d KVM: MMU: calculate correct gfn for small host pages backing large guest pages
In Documentation/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 function FNAME(fetch)(), sp->gfn is incorrect when one of following
situations occurred:

 1) guest is 32bit paging and the guest PDE maps a 4-MByte page
    (backed by 4k host pages), FNAME(fetch)() miss handling the quadrant.

    And if guest use pse-36, "table_gfn = gpte_to_gfn(gw->ptes[level - delta]);"
    is incorrect.

 2) guest is long mode paging and the guest PDPTE maps a 1-GByte page
    (backed by 4k or 2M host pages).

So we fix it to suit to the document and suit to the code which
requires sp->gfn correct when sp->role.direct=1.

We use the goal mapping gfn(gw->gfn) to calculate the base page frame
for linear translations, it is simple and easy to be understood.

Reported-by: Marcelo Tosatti <mtosatti@redhat.com>
Reported-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-08-01 10:39:21 +03:00
..
Kconfig Merge branch 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2010-03-05 13:12:34 -08:00
Makefile KVM: Move assigned device code to own file 2009-12-03 09:32:09 +02:00
emulate.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
i8254.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
i8254.h KVM: Convert i8254/i8259 locks to raw_spinlocks 2010-03-01 12:36:12 -03:00
i8259.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
irq.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
irq.h KVM: x86: Kick VCPU outside PIC lock again 2010-04-25 12:39:28 +03:00
kvm_cache_regs.h KVM: kvm_pdptr_read() may sleep 2010-08-01 10:35:27 +03:00
kvm_timer.h KVM: arch/x86/kvm/kvm_timer.h checkpatch cleanup 2010-05-17 12:14:42 +03:00
lapic.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
lapic.h KVM: Add HYPER-V apic access MSRs 2010-03-01 12:36:00 -03:00
mmu.c KVM: MMU: Calculate correct base gfn for direct non-DIR level 2010-08-01 10:35:53 +03:00
mmu.h KVM: x86 emulator: fix memory access during x86 emulation 2010-03-01 12:36:11 -03:00
mmutrace.h KVM: MMU: convert mmu tracepoints 2010-05-19 11:36:26 +03:00
paging_tmpl.h KVM: MMU: calculate correct gfn for small host pages backing large guest pages 2010-08-01 10:39:21 +03:00
svm.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
timer.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
trace.h KVM: Trace emulated instructions 2010-05-17 12:17:35 +03:00
tss.h KVM: x86: hardware task switching support 2008-04-27 12:00:39 +03:00
vmx.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
x86.c KVM: Update Red Hat copyrights 2010-08-01 10:35:51 +03:00
x86.h KVM: use the correct RCU API for PROVE_RCU=y 2010-05-17 12:18:01 +03:00