From 048c28bf88792efc3b75d940110b6ae565847f43 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 3 Mar 2011 04:14:51 +0100 Subject: Keep supplementary L1 pages read-only * i386/intel/pmap.c (pmap_bootstrap): Fix loop which keeps supplementary L1 pages read-only: break as soon as one of the L1 supplementary pages has been recognized, so that its pte does not get rewritten read-write. --- i386/intel/pmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'i386/intel/pmap.c') diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index b07644a..3505f52 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -764,11 +764,14 @@ void pmap_bootstrap() else { #ifdef MACH_XEN + /* Keep supplementary L1 pages read-only */ int i; for (i = 0; i < NSUP_L1; i++) - if (va == (vm_offset_t) l1_map[i]) + if (va == (vm_offset_t) l1_map[i]) { WRITE_PTE(pte, pa_to_pte(_kvtophys(va)) | INTEL_PTE_VALID | global); + break; + } if (i == NSUP_L1) #endif /* MACH_XEN */ WRITE_PTE(pte, pa_to_pte(_kvtophys(va)) -- cgit v1.2.3