public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PARAVIRT/x86] BUGFIX: Put a missing paravirt_release_pmd in pgd_dtor
@ 2009-02-06  2:02 Alok Kataria
  2009-02-06  2:30 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 10+ messages in thread
From: Alok Kataria @ 2009-02-06  2:02 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, the arch/x86 maintainers
  Cc: Jeremy Fitzhardinge, Zachary Amsden, Rusty Russell, Rohit Jain,
	LKML

[PARAVIRT/x86] Put a missing paravirt_release_pmd in pgd_dtor.

From: Alok N Kataria <akataria@vmware.com>

The commit...
-----------------------------
commit 6194ba6ff6ccf8d5c54c857600843c67aa82c407
Author: Jeremy Fitzhardinge <jeremy@goop.org>
Date:   Wed Jan 30 13:34:11 2008 +0100

    x86: don't special-case pmd allocations as much
------------------------------
...made changes to the way we handle pmd allocations, and while doing that
it (accidently ?) dropped a call to  paravirt_release_pd from the pgd_dtor
code path.

As a result of this missing release, the hypervisor is now unaware of the
pgd page being freed, and as a result it ends up tracking this page as a
page table page.
After this the guest may start using the same page for other purposes, and
depending on what use the page is put to, it may result in various performance
and/or functional issues ( hangs, reboots).

The patch below adds a paravirt_release_pmd call for the PGD page.
Patch on top of 2.6.29-rc3 (mainline-git).

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Signed-off-by: Rohit Jain <rjain@vmware.com>
Cc: Zachary Amsden <zach@vmware.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: stable@kernel.org
---

 arch/x86/mm/pgtable.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 86f2ffc..c23cd7e 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -89,6 +89,12 @@ static void pgd_dtor(pgd_t *pgd)
 {
 	unsigned long flags; /* can be called from interrupt context */
 
+	if (PAGETABLE_LEVELS == 2 ||
+            (PAGETABLE_LEVELS == 3 && SHARED_KERNEL_PMD) ||
+            PAGETABLE_LEVELS == 4) {
+		paravirt_release_pmd(__pa(pgd) >> PAGE_SHIFT);
+	}
+
 	if (SHARED_KERNEL_PMD)
 		return;
 




^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-02-11 12:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06  2:02 [PARAVIRT/x86] BUGFIX: Put a missing paravirt_release_pmd in pgd_dtor Alok Kataria
2009-02-06  2:30 ` Jeremy Fitzhardinge
2009-02-06  6:17   ` Alok Kataria
2009-02-06  6:52     ` Jeremy Fitzhardinge
2009-02-06 14:53       ` Ingo Molnar
2009-02-06 17:00         ` Jeremy Fitzhardinge
2009-02-06 18:29           ` Alok Kataria
2009-02-09 12:10             ` Ingo Molnar
2009-02-09 20:19               ` Alok Kataria
2009-02-11 12:48                 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox