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

[Xen-changelog] Christian's changes for linux 2.6.10 so that it boots in shadow mode



ChangeSet 1.1236.32.12, 2005/03/19 14:49:05+00:00, mafetter@xxxxxxxxxxxxxxxx

        Christian's changes for linux 2.6.10 so that it boots in shadow mode
        with translation enabled.
        
        Signed-off-by: michael.fetterman@xxxxxxxxxxxx



 linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig           |    4 
 linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c         |    2 
 linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c                |   10 +-
 linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c            |    3 
 linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c            |    2 
 linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c              |   20 ++--
 linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c                  |    9 -
 linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c             |   50 
++++------
 linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c                   |   14 +-
 linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c                |   28 ++++-
 linux-2.6.10-xen-sparse/arch/xen/i386/mm/pageattr.c               |    5 -
 linux-2.6.10-xen-sparse/arch/xen/i386/mm/pgtable.c                |   43 
++++----
 linux-2.6.10-xen-sparse/arch/xen/kernel/reboot.c                  |   14 +-
 linux-2.6.10-xen-sparse/drivers/xen/balloon/balloon.c             |    8 -
 linux-2.6.10-xen-sparse/drivers/xen/blkback/blkback.c             |    2 
 linux-2.6.10-xen-sparse/drivers/xen/blkfront/blkfront.c           |    8 -
 linux-2.6.10-xen-sparse/drivers/xen/blkfront/vbd.c                |    2 
 linux-2.6.10-xen-sparse/drivers/xen/netback/netback.c             |    6 -
 linux-2.6.10-xen-sparse/drivers/xen/netfront/netfront.c           |   14 +-
 linux-2.6.10-xen-sparse/drivers/xen/privcmd/privcmd.c             |    2 
 linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/desc.h           |    2 
 linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/fixmap.h         |   10 +-
 linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/io.h             |   19 ++-
 linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/page.h           |   34 +++---
 linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgalloc.h        |    3 
 linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h |   14 --
 linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h        |   14 ++
 xen/include/public/arch-x86_32.h                                  |    4 
 28 files changed, 178 insertions(+), 168 deletions(-)


diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig 
b/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig
--- a/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig   2005-04-05 
12:13:11 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig   2005-04-05 
12:13:11 -04:00
@@ -12,9 +12,9 @@
 #
 CONFIG_XEN_PRIVILEGED_GUEST=y
 CONFIG_XEN_PHYSDEV_ACCESS=y
-CONFIG_XEN_BLKDEV_BACKEND=y
+# CONFIG_XEN_BLKDEV_BACKEND is not set
 # CONFIG_XEN_BLKDEV_TAP_BE is not set
-CONFIG_XEN_NETDEV_BACKEND=y
+# CONFIG_XEN_NETDEV_BACKEND is not set
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
 # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c 2005-04-05 
12:13:11 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c 2005-04-05 
12:13:11 -04:00
@@ -512,7 +512,7 @@
        for (va = gdt_descr->address, f = 0;
             va < gdt_descr->address + gdt_descr->size;
             va += PAGE_SIZE, f++) {
-               frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
+               frames[f] = __vms_virt_to_machine(va) >> PAGE_SHIFT;
                make_page_readonly((void *)va);
        }
        flush_page_update_queue();
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c        2005-04-05 
12:13:11 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c        2005-04-05 
12:13:11 -04:00
@@ -61,8 +61,10 @@
                cpumask_t mask;
                preempt_disable();
 #endif
+#if 0
                make_pages_readonly(pc->ldt, (pc->size * LDT_ENTRY_SIZE) /
                                    PAGE_SIZE);
+#endif
                load_LDT(pc);
                flush_page_update_queue();
 #ifdef CONFIG_SMP
@@ -73,8 +75,10 @@
 #endif
        }
        if (oldsize) {
+#if 0
                make_pages_writable(oldldt, (oldsize * LDT_ENTRY_SIZE) /
                        PAGE_SIZE);
+#endif
                flush_page_update_queue();
                if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
                        vfree(oldldt);
@@ -90,8 +94,10 @@
        if (err < 0)
                return err;
        memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+#if 0
        make_pages_readonly(new->ldt, (new->size * LDT_ENTRY_SIZE) /
                            PAGE_SIZE);
+#endif
        flush_page_update_queue();
        return 0;
 }
@@ -124,9 +130,11 @@
        if (mm->context.size) {
                if (mm == current->active_mm)
                        clear_LDT();
+#if 0
                make_pages_writable(mm->context.ldt, 
                                    (mm->context.size * LDT_ENTRY_SIZE) /
                                    PAGE_SIZE);
+#endif
                flush_page_update_queue();
                if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
                        vfree(mm->context.ldt);
@@ -222,7 +230,7 @@
        }
 
        lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) 
mm->context.ldt);
-       mach_lp = arbitrary_virt_to_machine(lp);
+       mach_lp = arbitrary_virt_to_phys(lp);
 
        /* Allow LDTs to be cleared by the user. */
        if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c    2005-04-05 
12:13:11 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c    2005-04-05 
12:13:11 -04:00
@@ -30,6 +30,8 @@
 static void
 xen_contig_memory(unsigned long vstart, unsigned int order)
 {
+#define HACK
+#ifndef HACK
        /*
         * Ensure multi-page extents are contiguous in machine memory.
         * This code could be cleaned up some, and the number of
@@ -76,6 +78,7 @@
        xen_tlb_flush();
 
         balloon_unlock(flags);
+#endif
 }
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c    2005-04-05 
12:13:11 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c    2005-04-05 
12:13:11 -04:00
@@ -518,7 +518,7 @@
        if (unlikely(next->tls_array[i].a != prev->tls_array[i].a ||        \
                     next->tls_array[i].b != prev->tls_array[i].b))         \
                queue_multicall3(__HYPERVISOR_update_descriptor,            \
-                                virt_to_machine(&get_cpu_gdt_table(cpu)    \
+                                virt_to_phys(&get_cpu_gdt_table(cpu)       \
                                                 [GDT_ENTRY_TLS_MIN + i]),  \
                                 ((u32 *)&next->tls_array[i])[0],           \
                                 ((u32 *)&next->tls_array[i])[1]);          \
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c      2005-04-05 
12:13:11 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c      2005-04-05 
12:13:11 -04:00
@@ -345,8 +345,8 @@
 shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
 EXPORT_SYMBOL(HYPERVISOR_shared_info);
 
-unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
-EXPORT_SYMBOL(phys_to_machine_mapping);
+unsigned int *__vms_phys_to_machine_mapping, *__vms_pfn_to_mfn_frame_list;
+EXPORT_SYMBOL(__vms_phys_to_machine_mapping);
 
 DEFINE_PER_CPU(multicall_entry_t, multicall_list[8]);
 DEFINE_PER_CPU(int, nr_multicall_ents);
@@ -1142,7 +1142,7 @@
        }
 #endif
 
-       phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list;
+       __vms_phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list;
 
        return max_low_pfn;
 }
@@ -1437,11 +1437,11 @@
 
        /* Make sure we have a large enough P->M table. */
        if (max_pfn > xen_start_info.nr_pages) {
-               phys_to_machine_mapping = alloc_bootmem_low_pages(
+               __vms_phys_to_machine_mapping = alloc_bootmem_low_pages(
                        max_pfn * sizeof(unsigned long));
-               memset(phys_to_machine_mapping, ~0,
+               memset(__vms_phys_to_machine_mapping, ~0,
                        max_pfn * sizeof(unsigned long));
-               memcpy(phys_to_machine_mapping,
+               memcpy(__vms_phys_to_machine_mapping,
                        (unsigned long *)xen_start_info.mfn_list,
                        xen_start_info.nr_pages * sizeof(unsigned long));
                free_bootmem(
@@ -1450,14 +1450,14 @@
                        sizeof(unsigned long))));
        }
 
-       pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
+       __vms_pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
        for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
        {       
-            pfn_to_mfn_frame_list[j] = 
-                 virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
+            __vms_pfn_to_mfn_frame_list[j] = 
+                 __vms_virt_to_machine(&__vms_phys_to_machine_mapping[i]) >> 
PAGE_SHIFT;
        }
        HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
-            virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
+            __vms_virt_to_machine(__vms_pfn_to_mfn_frame_list) >> PAGE_SHIFT;
 
 
        /*
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c  2005-04-05 12:13:11 
-04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c  2005-04-05 12:13:11 
-04:00
@@ -458,8 +458,8 @@
        printk("%08lx\n", regs->eip);
        page = ((unsigned long *) per_cpu(cur_pgd, smp_processor_id()))
            [address >> 22];
-       printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page,
-              machine_to_phys(page));
+       printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n",
+              __vms_phys_to_machine(page), page);
        /*
         * We must not directly access the pte in the highpte
         * case, the page table might be allocated in highmem.
@@ -470,10 +470,9 @@
        if (page & 1) {
                page &= PAGE_MASK;
                address &= 0x003ff000;
-               page = machine_to_phys(page);
                page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT];
-               printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n", page,
-                      machine_to_phys(page));
+               printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n",
+                      __vms_phys_to_machine(page), page);
        }
 #endif
        show_trace(NULL, (unsigned long *)&regs[1]);
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c     2005-04-05 
12:13:11 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c     2005-04-05 
12:13:11 -04:00
@@ -56,7 +56,7 @@
 #ifdef CONFIG_SMP
 #define QUEUE_SIZE 1
 #else
-#define QUEUE_SIZE 128
+#define QUEUE_SIZE 1
 #endif
 #endif
 
@@ -125,14 +125,12 @@
 
 void queue_l1_entry_update(pte_t *ptr, unsigned long val)
 {
-    _flush_page_update_queue();
-    *(unsigned long *)ptr = val;
+    set_pte(ptr, __pte(val));
 }
 
 void queue_l2_entry_update(pmd_t *ptr, unsigned long val)
 {
-    _flush_page_update_queue();
-    *(unsigned long *)ptr = val;
+    set_pmd(ptr, __pmd(val));
 }
 
 void queue_pt_switch(unsigned long ptr)
@@ -142,7 +140,7 @@
     unsigned long flags;
     spin_lock_irqsave(&update_lock, flags);
     idx = per_cpu(mmu_update_queue_idx, cpu);
-    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
+    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
     per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
     per_cpu(update_queue[idx], cpu).val  = MMUEXT_NEW_BASEPTR;
     increment_index();
@@ -176,56 +174,56 @@
     spin_unlock_irqrestore(&update_lock, flags);
 }
 
-void queue_pgd_pin(unsigned long ptr)
+void __vms_queue_pgd_pin(unsigned long ptr)
 {
     int cpu = smp_processor_id();
     int idx;
     unsigned long flags;
     spin_lock_irqsave(&update_lock, flags);
     idx = per_cpu(mmu_update_queue_idx, cpu);

_______________________________________________
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®.