WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Merge domain_crash backport back into -unstable.

To: xen-changelog@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Merge domain_crash backport back into -unstable.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Sat, 26 Mar 2005 01:24:11 +0000
Delivery-date: Sat, 26 Mar 2005 02:05:16 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-changelog>
List-help: <mailto:xen-changelog-request@lists.sourceforge.net?subject=help>
List-id: <xen-changelog.lists.sourceforge.net>
List-post: <mailto:xen-changelog@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.sourceforge.net?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-admin@xxxxxxxxxxxxxxxxxxxxx
ChangeSet 1.1377, 2005/03/26 01:24:11+00:00, cl349@xxxxxxxxxxxxxxxxxxxx

        Merge domain_crash backport back into -unstable.
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 b/xen/arch/x86/domain.c   | 1185 ++++++++---------
 b/xen/arch/x86/mm.c       | 3193 ++++++++++++++++++++++++++++++++++++++++++++++
 b/xen/arch/x86/shadow.c   |  851 ++++++++----
 b/xen/arch/x86/traps.c    | 1051 ++++++++-------
 b/xen/common/domain.c     |  179 +-
 b/xen/common/schedule.c   |  243 ++-
 b/xen/include/xen/sched.h |  265 ++-
 xen/arch/x86/memory.c     | 2372 ----------------------------------
 8 files changed, 5456 insertions(+), 3883 deletions(-)


diff -Nru a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     2005-03-25 21:04:34 -05:00
+++ b/xen/arch/x86/domain.c     2005-03-25 21:04:34 -05:00
@@ -19,6 +19,7 @@
 #include <xen/smp.h>
 #include <xen/delay.h>
 #include <xen/softirq.h>
+#include <xen/grant_table.h>
 #include <asm/regs.h>
 #include <asm/mc146818rtc.h>
 #include <asm/system.h>
@@ -33,26 +34,17 @@
 #include <asm/shadow.h>
 #include <xen/console.h>
 #include <xen/elf.h>
+#include <asm/vmx.h>
+#include <asm/vmx_vmcs.h>
+#include <asm/msr.h>
+#include <xen/kernel.h>
+#include <public/io/ioreq.h>
 #include <xen/multicall.h>
 
 /* opt_noreboot: If true, machine will need manual reset on error. */
 static int opt_noreboot = 0;
 boolean_param("noreboot", opt_noreboot);
 
-#if !defined(CONFIG_X86_64BITMODE)
-/* No ring-3 access in initial page tables. */
-#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
-#else
-/* 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
-#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)
-
 static void default_idle(void)
 {
     __cli();
@@ -80,8 +72,8 @@
 void startup_cpu_idle_loop(void)
 {
     /* Just some sanity to ensure that the scheduler is set up okay. */
-    ASSERT(current->id == IDLE_DOMAIN_ID);
-    domain_unpause_by_systemcontroller(current);
+    ASSERT(current->domain->id == IDLE_DOMAIN_ID);
+    domain_unpause_by_systemcontroller(current->domain);
     raise_softirq(SCHEDULE_SOFTIRQ);
     do_softirq();
 
@@ -97,106 +89,79 @@
 
 static long no_idt[2];
 static int reboot_mode;
-int reboot_thru_bios = 0;
-
-#ifdef CONFIG_SMP
-int reboot_smp = 0;
-static int reboot_cpu = -1;
-/* shamelessly grabbed from lib/vsprintf.c for readability */
-#define is_digit(c)    ((c) >= '0' && (c) <= '9')
-#endif
-
 
 static inline void kb_wait(void)
 {
     int i;
 
-    for (i=0; i<0x10000; i++)
-        if ((inb_p(0x64) & 0x02) == 0)
+    for ( i = 0; i < 0x10000; i++ )
+        if ( (inb_p(0x64) & 0x02) == 0 )
             break;
 }
 
-
 void machine_restart(char * __unused)
 {
-#ifdef CONFIG_SMP
-    int cpuid;
-#endif
+    int i;
        
     if ( opt_noreboot )
     {
         printk("Reboot disabled on cmdline: require manual reset\n");
-        for ( ; ; ) __asm__ __volatile__ ("hlt");
+        for ( ; ; )
+            safe_halt();
     }
 
-#ifdef CONFIG_SMP
-    cpuid = GET_APIC_ID(apic_read(APIC_ID));
-
-    /* KAF: Need interrupts enabled for safe IPI. */
     __sti();
 
-    if (reboot_smp) {
-
-        /* check to see if reboot_cpu is valid 
-           if its not, default to the BSP */
-        if ((reboot_cpu == -1) ||  
-            (reboot_cpu > (NR_CPUS -1))  || 
-            !(phys_cpu_present_map & (1<<cpuid))) 
-            reboot_cpu = boot_cpu_physical_apicid;
-
-        reboot_smp = 0;  /* use this as a flag to only go through this once*/
-        /* re-run this function on the other CPUs
-           it will fall though this section since we have 
-           cleared reboot_smp, and do the reboot if it is the
-           correct CPU, otherwise it halts. */
-        if (reboot_cpu != cpuid)
-            smp_call_function((void *)machine_restart , NULL, 1, 0);
-    }
-
-    /* if reboot_cpu is still -1, then we want a tradional reboot, 
-       and if we are not running on the reboot_cpu,, halt */
-    if ((reboot_cpu != -1) && (cpuid != reboot_cpu)) {
-        for (;;)
-            __asm__ __volatile__ ("hlt");
+    /* Ensure we are the boot CPU. */
+    if ( GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid )
+    {
+        smp_call_function((void *)machine_restart, NULL, 1, 0);
+        for ( ; ; )
+            safe_halt();
     }
+
     /*
      * Stop all CPUs and turn off local APICs and the IO-APIC, so
      * other OSs see a clean IRQ state.
      */
     smp_send_stop();
     disable_IO_APIC();
+
+#ifdef CONFIG_VMX
+    stop_vmx();
 #endif
 
-    if(!reboot_thru_bios) {
-        /* rebooting needs to touch the page at absolute addr 0 */
-        *((unsigned short *)__va(0x472)) = reboot_mode;
-        for (;;) {
-            int i;
-            for (i=0; i<100; i++) {
-                kb_wait();
-                udelay(50);
-                outb(0xfe,0x64);         /* pulse reset low */
-                udelay(50);
-            }
-            /* That didn't work - force a triple fault.. */
-            __asm__ __volatile__("lidt %0": "=m" (no_idt));
-            __asm__ __volatile__("int3");
+    /* Rebooting needs to touch the page at absolute address 0. */
+    *((unsigned short *)__va(0x472)) = reboot_mode;
+
+    for ( ; ; )
+    {
+        /* Pulse the keyboard reset line. */
+        for ( i = 0; i < 100; i++ )
+        {
+            kb_wait();
+            udelay(50);
+            outb(0xfe,0x64); /* pulse reset low */
+            udelay(50);
         }
-    }
 
-    panic("Need to reinclude BIOS reboot code\n");
+        /* That didn't work - force a triple fault.. */
+        __asm__ __volatile__("lidt %0": "=m" (no_idt));
+        __asm__ __volatile__("int3");
+    }
 }
 
 
 void __attribute__((noreturn)) __machine_halt(void *unused)
 {
     for ( ; ; )
-        __asm__ __volatile__ ( "cli; hlt" );
+        safe_halt();
 }
 
 void machine_halt(void)
 {
-    smp_call_function(__machine_halt, NULL, 1, 1);
+    watchdog_on = 0;
+    smp_call_function(__machine_halt, NULL, 1, 0);
     __machine_halt(NULL);
 }
 
@@ -220,158 +185,364 @@
            page->u.inuse.type_info);
 }
 
-xmem_cache_t *domain_struct_cachep;
-void __init domain_startofday(void)
+struct domain *arch_alloc_domain_struct(void)
 {
-    domain_struct_cachep = xmem_cache_create(
-        "domain_cache", sizeof(struct domain),
-        0, SLAB_HWCACHE_ALIGN, NULL, NULL);
-    if ( domain_struct_cachep == NULL )
-        panic("No slab cache for domain structs.");
+    return xmalloc(struct domain);
 }
 
-struct domain *arch_alloc_domain_struct(void)
+void arch_free_domain_struct(struct domain *d)
 {
-    return xmem_cache_alloc(domain_struct_cachep);
+    xfree(d);
 }
 
-void arch_free_domain_struct(struct domain *d)
+struct exec_domain *arch_alloc_exec_domain_struct(void)
 {
-    xmem_cache_free(domain_struct_cachep, d);
+    return xmalloc(struct exec_domain);
+}
+
+void arch_free_exec_domain_struct(struct exec_domain *ed)
+{
+    xfree(ed);
 }
 
 void free_perdomain_pt(struct domain *d)
 {
-    free_xenheap_page((unsigned long)d->mm.perdomain_pt);
+    free_xenheap_page((unsigned long)d->arch.mm_perdomain_pt);
+#ifdef __x86_64__
+    free_xenheap_page((unsigned long)d->arch.mm_perdomain_l2);
+    free_xenheap_page((unsigned long)d->arch.mm_perdomain_l3);
+#endif
 }
 
-static void continue_idle_task(struct domain *d)
+static void continue_idle_task(struct exec_domain *ed)
 {
     reset_stack_and_jump(idle_loop);
 }
 
-static void continue_nonidle_task(struct domain *d)
+static void continue_nonidle_task(struct exec_domain *ed)
 {
     reset_stack_and_jump(ret_from_intr);


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Merge domain_crash backport back into -unstable., BitKeeper Bot <=