ia64/xen-unstable

changeset 9251:ccf3d5cd1428

Fix PAE ptep_get_and_clear_full(). The fast path requires us to manually clear
the low half before the high half. Otherwise the compiler may reorder the writes
and validation in Xen will fail.

From: Jan Beulich
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 14 15:25:33 2006 +0100 (2006-03-14)
parents 7d8efd4f1ac7
children 065006aa5322
files linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h	Tue Mar 14 15:18:35 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h	Tue Mar 14 15:25:33 2006 +0100
     1.3 @@ -272,7 +272,16 @@ static inline pte_t ptep_get_and_clear_f
     1.4  	pte_t pte;
     1.5  	if (full) {
     1.6  		pte = *ptep;
     1.7 +#ifdef CONFIG_X86_PAE
     1.8 +		/* Cannot do this in a single step, as the compiler may
     1.9 +		   issue the two stores in either order, but the hypervisor
    1.10 +		   must not see the high part before the low one. */
    1.11 +		ptep->pte_low = 0;
    1.12 +		barrier();
    1.13 +		ptep->pte_high = 0;
    1.14 +#else
    1.15  		*ptep = __pte(0);
    1.16 +#endif
    1.17  	} else {
    1.18  		pte = ptep_get_and_clear(mm, addr, ptep);
    1.19  	}