]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.17/0004-KVM-MMU-invalidate-and-flush-on-spte-small-large-pag.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / 0004-KVM-MMU-invalidate-and-flush-on-spte-small-large-pag.patch
CommitLineData
7d777456
GKH
1From 51e00c5c8ddedce8030521bf8645d90b82854980 Mon Sep 17 00:00:00 2001
2From: Marcelo Tosatti <mtosatti@redhat.com>
3Date: Fri, 28 May 2010 09:44:59 -0300
4Subject: KVM: MMU: invalidate and flush on spte small->large page size change
5
6Always invalidate spte and flush TLBs when changing page size, to make
7sure different sized translations for the same address are never cached
8in a CPU's TLB.
9
10Currently the only case where this occurs is when a non-leaf spte pointer is
11overwritten by a leaf, large spte entry. This can happen after dirty
12logging is disabled on a memslot, for example.
13
14Noticed by Andrea.
15
16KVM-Stable-Tag
17Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
18Signed-off-by: Avi Kivity <avi@redhat.com>
19(cherry picked from commit 3be2264be3c00865116f997dc53ebcc90fe7fc4b)
20---
21 arch/x86/kvm/mmu.c | 2 ++
22 1 file changed, 2 insertions(+)
23
24--- a/arch/x86/kvm/mmu.c
25+++ b/arch/x86/kvm/mmu.c
26@@ -1901,6 +1901,8 @@ static void mmu_set_spte(struct kvm_vcpu
27
28 child = page_header(pte & PT64_BASE_ADDR_MASK);
29 mmu_page_remove_parent_pte(child, sptep);
30+ __set_spte(sptep, shadow_trap_nonpresent_pte);
31+ kvm_flush_remote_tlbs(vcpu->kvm);
32 } else if (pfn != spte_to_pfn(*sptep)) {
33 pgprintk("hfn old %lx new %lx\n",
34 spte_to_pfn(*sptep), pfn);