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

[Xen-changelog] Merge with Rolf's tree



ChangeSet 1.1251, 2005/03/21 16:41:29+00:00, mafetter@xxxxxxxxxxxxxxxx

        Merge with Rolf's tree
        
        Signed-off-by: michael.fetterman@xxxxxxxxxxxx



 b/linux-2.6.10-xen-sparse/arch/xen/Kconfig                          |   28 
 b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c                  |   15 
 b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c             |   11 
 b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c                   |   15 
 b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h |   15 
 b/xen/arch/x86/domain_build.c                                       |  592 
++++++++++
 b/xen/arch/x86/mm.c                                                 |   12 
 b/xen/arch/x86/x86_32/domain_page.c                                 |   10 
 b/xen/common/page_alloc.c                                           |    4 
 b/xen/include/xen/perfc.h                                           |   50 
 b/xen/include/xen/perfc_defn.h                                      |   60 -
 b/xen/include/xen/sched.h                                           |   11 
 xen/arch/x86/x86_32/domain_build.c                                  |  454 
-------
 xen/arch/x86/x86_64/domain_build.c                                  |  424 
-------
 14 files changed, 758 insertions(+), 943 deletions(-)


diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/Kconfig 
b/linux-2.6.10-xen-sparse/arch/xen/Kconfig
--- a/linux-2.6.10-xen-sparse/arch/xen/Kconfig  2005-04-05 12:14:42 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/Kconfig  2005-04-05 12:14:42 -04:00
@@ -118,6 +118,34 @@
        bool "writable page tables"
        default y
 
+config XEN_SYSCALL_STATS
+       bool "system call statistics"
+       default n
+
+config XEN_DEBUG_NO_MMU_BATCHING
+       bool "Disables batching on MMU updates"
+       default n
+    help
+      This does a hypercall per PTE update
+      we only use this for benchmarking
+      enable only if you know what you are doing
+
+config XEN_BATCH_MODE1
+       bool "A variant of writable pagetable using the batch interface"
+       default n
+    help
+      default is no batching and minor mods for some batching
+      we only use this for benchmarking
+      enable only if you know what you are doing
+
+config XEN_BATCH_MODE2
+       bool "forward port of 2.4 batching"
+       default n
+    help
+      default is batching + flushes where 2.4 had them
+      we only use this for benchmarking
+      enable only if you know what you are doing
+
 config XEN_SHADOW_MODE
        bool "Fake shadow mode"
        default n
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:14:42 
-04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c  2005-04-05 12:14:42 
-04:00
@@ -216,6 +216,11 @@
  *     bit 1 == 0 means read, 1 means write
  *     bit 2 == 0 means kernel, 1 means user-mode
  */
+
+extern unsigned long c_do_page_fault;
+extern unsigned long c_minor_page_fault;
+extern unsigned long c_major_page_fault;
+
 fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code,
                              unsigned long address)
 {
@@ -226,11 +231,19 @@
        int write;
        siginfo_t info;
 
+    c_do_page_fault++;
+
        /* Set the "privileged fault" bit to something sane. */
        error_code &= 3;
        error_code |= (regs->xcs & 2) << 1;
        if (regs->eflags & X86_EFLAGS_VM)
                error_code |= 4;
+
+#ifdef CONFIG_XEN_BATCH_MODE2
+    /* ensure all updates have completed */
+    flush_page_update_queue();
+#endif
+
                
        if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
                                        SIGSEGV) == NOTIFY_STOP)
@@ -353,9 +366,11 @@
        switch (handle_mm_fault(mm, vma, address, write)) {
                case VM_FAULT_MINOR:
                        tsk->min_flt++;
+            c_minor_page_fault++;
                        break;
                case VM_FAULT_MAJOR:
                        tsk->maj_flt++;
+            c_major_page_fault++;
                        break;
                case VM_FAULT_SIGBUS:
                        goto do_sigbus;
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:14:43 -04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c     2005-04-05 
12:14:43 -04:00
@@ -138,8 +138,11 @@
     per_cpu(update_queue[idx], cpu).ptr = virt_to_machine(ptr);
     per_cpu(update_queue[idx], cpu).val = val;
     increment_index();
+#ifdef CONFIG_XEN_DEBUG_NO_MMU_BATCHING
+    __flush_page_update_queue();
+#endif
     spin_unlock_irqrestore(&update_lock, flags);
-#else /* CONFIG_XEN_SHADOW_MODE */
+#else
     set_pte(ptr, __pte(val));
 #endif /* CONFIG_XEN_SHADOW_MODE */
 }
@@ -156,7 +159,7 @@
     per_cpu(update_queue[idx], cpu).val = val;
     increment_index();
     spin_unlock_irqrestore(&update_lock, flags);
-#else /* CONFIG_XEN_SHADOW_MODE */
+#else
     set_pmd(ptr, __pmd(val));
 #endif /* CONFIG_XEN_SHADOW_MODE */
 }
@@ -333,7 +336,7 @@
     per_cpu(update_queue[idx], cpu).val = val;
     increment_index_and_flush();
     spin_unlock_irqrestore(&update_lock, flags);
-#else /* CONFIG_XEN_SHADOW_MODE */
+#else
     set_pte(ptr, __pte(val));
 #endif /* CONFIG_XEN_SHADOW_MODE */
 }
@@ -350,7 +353,7 @@
     per_cpu(update_queue[idx], cpu).val = val;
     increment_index_and_flush();
     spin_unlock_irqrestore(&update_lock, flags);
-#else /* CONFIG_XEN_SHADOW_MODE */
+#else
     set_pmd(ptr, __pmd(val));
 #endif /* CONFIG_XEN_SHADOW_MODE */
 }
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c 
b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c
--- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c   2005-04-05 12:14:42 
-04:00
+++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c   2005-04-05 12:14:42 
-04:00
@@ -79,7 +79,7 @@
                pte_t *page_table = (pte_t *) 
alloc_bootmem_low_pages(PAGE_SIZE);
 #ifndef CONFIG_XEN_SHADOW_MODE
                make_page_readonly(page_table);
-#endif /* CONFIG_XEN_SHADOW_MODE */
+#endif
                set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
                if (page_table != pte_offset_kernel(pmd, 0))
                        BUG();  
@@ -179,9 +179,9 @@
                                pte = one_page_table_init(pmd);
 
                                pte += pte_ofs;
-                               /* XEN: Only map initial RAM allocation. */
-                               for (; pte_ofs < PTRS_PER_PTE && pfn < 
max_ram_pfn; pte++, pfn++, pte_ofs++) {
-                                               if (pte_present(*pte))
+                               for (; pte_ofs < PTRS_PER_PTE && pfn < 
max_low_pfn; pte++, pfn++, pte_ofs++) {
+                                               /* XEN: Only map initial RAM 
allocation. */
+                                               if ((pfn >= max_ram_pfn) || 
pte_present(*pte))
                                                        continue;
                                                if (is_kernel_text(address))
                                                        set_pte(pte, 
pfn_pte(pfn, PAGE_KERNEL_EXEC));
@@ -648,6 +648,7 @@
        int codesize, reservedpages, datasize, initsize;
        int tmp;
        int bad_ppro;
+       unsigned long pfn;
 
 #ifndef CONFIG_DISCONTIGMEM
        if (!mem_map)
@@ -676,6 +677,12 @@
 
        /* this will put all low memory onto the freelists */
        totalram_pages += __free_all_bootmem();
+       /* XEN: init and count low-mem pages outside initial allocation. */
+       for (pfn = xen_start_info.nr_pages; pfn < max_low_pfn; pfn++) {
+               ClearPageReserved(&mem_map[pfn]);
+               set_page_count(&mem_map[pfn], 1);
+               totalram_pages++;
+       }
 
        reservedpages = 0;
        for (tmp = 0; tmp < max_low_pfn; tmp++)
diff -Nru a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h 
b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
--- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h 
2005-04-05 12:14:42 -04:00
+++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h 
2005-04-05 12:14:42 -04:00
@@ -36,7 +36,22 @@
 #endif
 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr, pteval)
 #else
+#if defined(CONFIG_XEN_DEBUG_NO_MMU_BATCHING)
+#define set_pte(pteptr, pteval)\
+    set_pte_batched(pteptr, pteval)
+
+#elif defined(CONFIG_XEN_BATCH_MODE1)
+#define set_pte(pteptr, pteval)({\
+    set_pte_batched(pteptr, pteval);\
+    _flush_page_update_queue();})
+
+#elif defined(CONFIG_XEN_BATCH_MODE2)
+#define set_pte(pteptr, pteval)\
+    set_pte_batched(pteptr, pteval)
+
+#else
 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
+#endif
 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
 #endif
 /*
diff -Nru a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
--- /dev/null   Wed Dec 31 16:00:00 196900
+++ b/xen/arch/x86/domain_build.c       2005-04-05 12:14:42 -04:00
@@ -0,0 +1,592 @@
+/******************************************************************************
+ * domain_build.c
+ * 
+ * Copyright (c) 2002-2005, K A Fraser
+ */
+
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/sched.h>
+#include <xen/smp.h>
+#include <xen/delay.h>
+#include <xen/event.h>
+#include <xen/elf.h>
+#include <xen/kernel.h>
+#include <asm/regs.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+#include <asm/desc.h>
+#include <asm/i387.h>
+#include <asm/shadow.h>
+
+/* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
+static unsigned int opt_dom0_mem = 0;
+integer_param("dom0_mem", opt_dom0_mem);
+
+static unsigned int opt_dom0_shadow = 0;
+boolean_param("dom0_shadow", opt_dom0_shadow);
+
+#if defined(__i386__)
+/* No ring-3 access in initial leaf page tables. */
+#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
+#elif defined(__x86_64__)
+/* Allow ring-3 access in long mode as guest cannot use ring 1. */
+#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_USER)
+#endif
+/* Don't change these: Linux expects just these bits to be set. */
+/* (And that includes the bogus _PAGE_DIRTY!) */
+#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
+#define L3_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
+#define L4_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
+
+#define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
+#define round_pgdown(_p)  ((_p)&PAGE_MASK)
+

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