From: "Jan Beulich" Subject: [PATCH] i386 linux: make 32-bit PAE kernel work when built with newer gcc Date: Mon, 13 Mar 2006 17:40:12 +0100 Message-ID: <4415AE7C.76F0.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE5C0B97C.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartE5C0B97C.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline The compiler isn't required to order the two stores ptep_get_and_clear_full() in any particular way, and we saw cases where the upper 32 bits get stored before the lower ones, which causes the access to fail (page-fault propagated out of Xen). Jan --=__PartE5C0B97C.0__= Content-Type: text/plain; name="xenlinux-i386-pae-ptep_get_and_clear_full.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="xenlinux-i386-pae-ptep_get_and_clear_full.patch" Index: head-2006-03-13/include/asm-i386/mach-xen/asm/pgtable.h =================================================================== --- head-2006-03-13.orig/include/asm-i386/mach-xen/asm/pgtable.h 2006-03-13 10:22:14.000000000 +0100 +++ head-2006-03-13/include/asm-i386/mach-xen/asm/pgtable.h 2006-03-13 15:25:53.000000000 +0100 @@ -272,7 +272,15 @@ static inline pte_t ptep_get_and_clear_f pte_t pte; if (full) { pte = *ptep; +#ifdef CONFIG_X86_PAE + /* Cannot do this in a single step, as the compiler may + issue the two stores in either order, but the hypervisor + must not see the high part before the low one. */ + ptep->pte_low = 0; + ptep->pte_high = 0; +#else *ptep = __pte(0); +#endif } else { pte = ptep_get_and_clear(mm, addr, ptep); } --=__PartE5C0B97C.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartE5C0B97C.0__=--