]> xenbits.xensource.com Git - xen.git/commitdiff
Fix the kunmap_atomic() change in 10529:4260eb8c08740de0000081c61a6237ffcb95b2d5.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 29 Jun 2006 09:48:07 +0000 (10:48 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 29 Jun 2006 09:48:07 +0000 (10:48 +0100)
Mustn't zap the PTE if the virtual address is not in kmap_atomic range!
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/i386/mm/highmem-xen.c

index 566219167d56a5505c0934906c3bdcfb0ef7d52c..23f0e1b2e926fbeb4bd1c7ed7fe62595badcf245 100644 (file)
@@ -60,7 +60,7 @@ void *kmap_atomic_pte(struct page *page, enum km_type type)
 
 void kunmap_atomic(void *kvaddr, enum km_type type)
 {
-#ifdef CONFIG_DEBUG_HIGHMEM
+#if defined(CONFIG_DEBUG_HIGHMEM) || defined(CONFIG_XEN)
        unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
        enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
 
@@ -69,7 +69,9 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
                preempt_check_resched();
                return;
        }
+#endif
 
+#if defined(CONFIG_DEBUG_HIGHMEM)
        if (vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx))
                BUG();
 
@@ -86,8 +88,6 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
         * XXX TODO: We could make this faster by only zapping when
         * kmap_flush_unused is called but that is trickier and more invasive.
         */
-       unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
-       enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
        pte_clear(&init_mm, vaddr, kmap_pte-idx);
 #endif