public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: use pgd accessors when cloning a pgd range.
@ 2010-10-27  8:50 Ian Campbell
  2010-10-27 10:40 ` Borislav Petkov
  0 siblings, 1 reply; 22+ messages in thread
From: Ian Campbell @ 2010-10-27  8:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: x86, Ian Campbell, Borislav Petkov, H. Peter Anvin,
	Jeremy Fitzhardinge

Page tables should always be updated using the proper accessor
methods. Not doing so bypasses the paravirt infrastructure.

In this case the failure to do so was exposed under Xen by
b40827fa7268 "x86-32, mm: Add an initial page table for core
bootstrapping".

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
---
 arch/x86/include/asm/pgtable.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index ada823a..0b4c514 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -619,7 +619,10 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm,
  */
 static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
 {
-       memcpy(dst, src, count * sizeof(pgd_t));
+	int i;
+
+	for (i=0; i<count; i++)
+		set_pgd(&dst[i], src[i]);
 }
 
 
-- 
1.5.6.5


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

end of thread, other threads:[~2010-11-03 15:35 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27  8:50 [PATCH] x86: use pgd accessors when cloning a pgd range Ian Campbell
2010-10-27 10:40 ` Borislav Petkov
2010-10-27 16:50   ` Jeremy Fitzhardinge
2010-10-27 17:18     ` H. Peter Anvin
2010-10-27 17:31       ` Jeremy Fitzhardinge
2010-10-27 17:42         ` H. Peter Anvin
2010-10-27 17:51           ` Ian Campbell
2010-10-27 17:51           ` Jeremy Fitzhardinge
2010-10-27 18:02             ` Ian Campbell
2010-10-27 18:11             ` H. Peter Anvin
2010-10-27 18:51               ` Jeremy Fitzhardinge
2010-10-27 19:00                 ` H. Peter Anvin
2010-10-27 19:02                 ` H. Peter Anvin
2010-10-27 17:44         ` Borislav Petkov
2010-10-27 17:54           ` Jeremy Fitzhardinge
2010-10-27 17:58           ` Ian Campbell
2010-10-28  9:23             ` Ian Campbell
2010-10-28 11:20               ` Borislav Petkov
2010-10-28 11:53                 ` Ian Campbell
2010-10-28 15:49                 ` H. Peter Anvin
2010-10-28 15:48               ` H. Peter Anvin
2010-11-03 15:35               ` Ian Campbell

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