]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MMU: Respect nonpae pagetable quadrant when zapping ptes
authorAvi Kivity <avi@qumranet.com>
Tue, 1 May 2007 13:44:05 +0000 (16:44 +0300)
committerAvi Kivity <avi@qumranet.com>
Mon, 16 Jul 2007 09:05:39 +0000 (12:05 +0300)
commita6284421a9b59e95f979094cd55d108c957b73d0
treee2a1a101f5f77894674738476cb5808327c03f0c
parente1e1cf7ca806e813a9f8592fa41d32d15c5f6922
KVM: MMU: Respect nonpae pagetable quadrant when zapping ptes

When a guest writes to a page that has an mmu shadow, we have to clear
the shadow pte corresponding to the memory location touched by the guest.

Now, in nonpae mode, a single guest page may have two or four shadow
pages (because a nonpae page maps 4MB or 4GB, whereas the pae shadow maps
2MB or 1GB), so we when we look up the page we find up to three additional
aliases for the page.  Since we _clear_ the shadow pte, it doesn't matter
except for a slight performance penalty, but if we want to _update_ the
shadow pte instead of clearing it, it is vital that we don't modify the
aliases.

Fortunately, exactly which page is needed (the "quadrant") is easily
computed, and is accessible in the shadow page header.  All we need is
to ignore shadow pages from the wrong quadrants.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/mmu.c