[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix preemptible uses of smp_processor_id() in page fault



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 7598dc3ed0cbf9edbe3f77ccf6d64970e865901b
# Parent  eae0c4f0aafd8c2963d8c64c401d3f53a9ec9cfe
Fix preemptible uses of smp_processor_id() in page fault
handler.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r eae0c4f0aafd -r 7598dc3ed0cb 
linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c     Wed Sep 28 13:29:35 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c     Wed Sep 28 14:00:48 2005
@@ -209,7 +209,10 @@
 {
        unsigned long *p, page;
 
-        page = __pa(per_cpu(cur_pgd, smp_processor_id()));
+       preempt_disable();
+       page = __pa(per_cpu(cur_pgd, smp_processor_id()));
+       preempt_enable();
+
        p  = (unsigned long *)__va(page);
        p += (address >> 30) * 2;
        printk(KERN_ALERT "%08lx -> *pde = %08lx:%08lx\n", page, p[1], p[0]);
@@ -237,7 +240,12 @@
 {
        unsigned long page;
 
+       preempt_disable();
        page = ((unsigned long *) per_cpu(cur_pgd, smp_processor_id()))
+           [address >> 22];
+       preempt_enable();
+
+       page = ((unsigned long *) per_cpu(cur_pgd, get_cpu()))
            [address >> 22];
        printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page,
               machine_to_phys(page));
@@ -567,7 +575,9 @@
                pmd_t *pmd, *pmd_k;
                pte_t *pte_k;
 
+               preempt_disable();
                pgd = index + per_cpu(cur_pgd, smp_processor_id());
+               preempt_enable();
                pgd_k = init_mm.pgd + index;
 
                if (!pgd_present(*pgd_k))
diff -r eae0c4f0aafd -r 7598dc3ed0cb 
linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c   Wed Sep 28 13:29:35 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c   Wed Sep 28 14:00:48 2005
@@ -149,7 +149,9 @@
        pmd_t *pmd;
        pte_t *pte;
 
+       preempt_disable();
        pgd = (pgd_t *)per_cpu(cur_pgd, smp_processor_id());
+       preempt_enable();
        pgd += pgd_index(address);
 
        printk("PGD %lx ", pgd_val(*pgd));
@@ -252,7 +254,9 @@
 
        /* On Xen the line below does not always work. Needs investigating! */
        /*pgd = pgd_offset(current->mm ?: &init_mm, address);*/
+       preempt_disable();
        pgd = (pgd_t *)per_cpu(cur_pgd, smp_processor_id());
+       preempt_enable();
        pgd += pgd_index(address);
 
        pgd_ref = pgd_offset_k(address);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.