From cc1b18047035cdeadecca100f1e5ba18ee6341f9 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 27 May 2010 16:44:12 +0300 Subject: [PATCH] --- yaml --- r: 202308 b: refs/heads/master c: 316b95216e277cdb22bd65346f9b9d9e10d0f53d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/kvm/mmu.txt | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 27d918aa5130..e97fb604d7fc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ec87fe2afcbcc4f430554980ec3e408bae34229d +refs/heads/master: 316b95216e277cdb22bd65346f9b9d9e10d0f53d diff --git a/trunk/Documentation/kvm/mmu.txt b/trunk/Documentation/kvm/mmu.txt index 1e7ecdd15bba..8cb42b957c73 100644 --- a/trunk/Documentation/kvm/mmu.txt +++ b/trunk/Documentation/kvm/mmu.txt @@ -317,6 +317,29 @@ on fault type: (user write faults generate a #PF) +Large pages +=========== + +The mmu supports all combinations of large and small guest and host pages. +Supported page sizes include 4k, 2M, 4M, and 1G. 4M pages are treated as +two separate 2M pages, on both guest and host, since the mmu always uses PAE +paging. + +To instantiate a large spte, four constraints must be satisfied: + +- the spte must point to a large host page +- the guest pte must be a large pte of at least equivalent size (if tdp is + enabled, there is no guest pte and this condition is satisified) +- if the spte will be writeable, the large page frame may not overlap any + write-protected pages +- the guest page must be wholly contained by a single memory slot + +To check the last two conditions, the mmu maintains a ->write_count set of +arrays for each memory slot and large page size. Every write protected page +causes its write_count to be incremented, thus preventing instantiation of +a large spte. The frames at the end of an unaligned memory slot have +artificically inflated ->write_counts so they can never be instantiated. + Further reading ===============