From: "Jan Beulich" Subject: [PATCH] x86_64 linux: don't use USER_PTRS_PER_PGD in mm_walk() Date: Tue, 07 Feb 2006 17:05:53 +0100 Message-ID: <43E8D371.76F0.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part7755D171.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. --=__Part7755D171.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Since USER_PTRS_PER_PGD depends on TASK_SIZE and thus on the current thread, it must not be used in code that can be called in the context switch path (otherwise the 32-bitness of the outgoing task is used here rather then the 32-bitness of the incoming one, possibly resulting in large parts of the page tables not getting converted to read-only). Jan --=__Part7755D171.0__= Content-Type: text/plain; name="xenlinux-x86_64-mm_walk.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="xenlinux-x86_64-mm_walk.patch" --- head-2006-02-07.orig/arch/x86_64/mm/pageattr-xen.c 2006-02-07 12:29:10.225160488 +0100 +++ head-2006-02-07/arch/x86_64/mm/pageattr-xen.c 2006-02-07 11:54:30.000000000 +0100 @@ -40,7 +40,7 @@ static void mm_walk(struct mm_struct *mm int g,u,m; pgd = mm->pgd; - for (g = 0; g <= USER_PTRS_PER_PGD; g++, pgd++) { + for (g = 0; g <= (TASK_SIZE64 - 1) / PGDIR_SIZE; g++, pgd++) { if (pgd_none(*pgd)) continue; pud = pud_offset(pgd, 0); --=__Part7755D171.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 --=__Part7755D171.0__=--