This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] Since USER_PTRS_PER_PGD depends on TASK_SIZE and thus on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Since USER_PTRS_PER_PGD depends on TASK_SIZE and thus on the current
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 07 Feb 2006 19:50:06 +0000
Delivery-date: Tue, 07 Feb 2006 20:01:47 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID aefd8b8c6b1fc3242e6a231a4461c12780d0c254
# Parent  581d4a0ac7290523d04f5a7d8b35cc727baa8089
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

Signed-off-by: Jan Beulich <JBeulich@xxxxxxxxxx>

diff -r 581d4a0ac729 -r aefd8b8c6b1f 
--- a/linux-2.6-xen-sparse/arch/x86_64/mm/pageattr-xen.c        Tue Feb  7 
15:24:04 2006
+++ b/linux-2.6-xen-sparse/arch/x86_64/mm/pageattr-xen.c        Tue Feb  7 
18:16:11 2006
@@ -40,7 +40,14 @@
        int          g,u,m;
        pgd = mm->pgd;
-       for (g = 0; g <= USER_PTRS_PER_PGD; g++, pgd++) {
+       /*
+        * Cannot iterate up to USER_PTRS_PER_PGD as these pagetables may not
+        * be the 'current' task's pagetables (e.g., current may be 32-bit,
+        * but the pagetables may be for a 64-bit task).
+        * Subtracting 1 from TASK_SIZE64 means the loop limit is correct
+        * regardless of whether TASK_SIZE64 is a multiple of PGDIR_SIZE.
+        */
+       for (g = 0; g <= ((TASK_SIZE64-1) / PGDIR_SIZE); g++, pgd++) {
                if (pgd_none(*pgd))
                pud = pud_offset(pgd, 0);

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Since USER_PTRS_PER_PGD depends on TASK_SIZE and thus on the current, Xen patchbot -unstable <=