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

[Xen-changelog] VMX domain should call domain_crash_synchronous instead of domain_crash.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 5f94478ca9b52d981aa9b7b1881ac7a46c459cb6
# Parent  c0dbb3a538f229d1c42ad367258eebc129e6498a
VMX domain should call domain_crash_synchronous instead of domain_crash.
Since domain_crash will return at last, and I watched system crash after
its return.

Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>

diff -r c0dbb3a538f2 -r 5f94478ca9b5 xen/arch/x86/shadow_public.c
--- a/xen/arch/x86/shadow_public.c      Sat Dec 10 23:16:26 2005
+++ b/xen/arch/x86/shadow_public.c      Sat Dec 10 23:17:11 2005
@@ -236,26 +236,24 @@
     l4_pgentry_t *l4;
     l3_pgentry_t *l3, *pae_l3;
     int i;
-    
+
     l4page = alloc_domheap_page(NULL);
     if (l4page == NULL)
-        domain_crash(d);
+        domain_crash_synchronous();
     l4 = map_domain_page(page_to_pfn(l4page));
     memset(l4, 0, PAGE_SIZE);
 
     l3page = alloc_domheap_page(NULL);
     if (l3page == NULL)
-        domain_crash(d);
-    l3 =  map_domain_page(page_to_pfn(l3page));
+        domain_crash_synchronous();
+    l3 = map_domain_page(page_to_pfn(l3page));
     memset(l3, 0, PAGE_SIZE);
 
     l4[0] = l4e_from_page(l3page, __PAGE_HYPERVISOR);
+
     pae_l3 = map_domain_page(pagetable_get_pfn(d->arch.phys_table));
-
-    for (i = 0; i < PDP_ENTRIES; i++) {
-        l3[i] = pae_l3[i];
-        l3e_add_flags(l3[i], 0x67);
-    }
+    for (i = 0; i < PDP_ENTRIES; i++)
+        l3[i] = l3e_from_pfn(l3e_get_pfn(pae_l3[i]), __PAGE_HYPERVISOR);
 
     unmap_domain_page(l4);
     unmap_domain_page(l3);
@@ -276,17 +274,18 @@
     mmfn_info = alloc_domheap_page(NULL);
     ASSERT( mmfn_info );
 
-    mmfn = (unsigned long) (mmfn_info - frame_table);
+    mmfn = page_to_pfn(mmfn_info);
     mpl4e = (l4_pgentry_t *) map_domain_page(mmfn);
     memcpy(mpl4e, &idle_pg_table[0], PAGE_SIZE);
     mpl4e[l4_table_offset(PERDOMAIN_VIRT_START)] =
         l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
+
     /* map the phys_to_machine map into the per domain Read-Only MPT space */
     phys_table = page_table_convert(d);
-
     mpl4e[l4_table_offset(RO_MPT_VIRT_START)] =
         l4e_from_paddr(pagetable_get_paddr(phys_table),
                        __PAGE_HYPERVISOR);
+
     v->arch.monitor_table = mk_pagetable(mmfn << PAGE_SHIFT);
     v->arch.monitor_vtable = (l2_pgentry_t *) mpl4e;
 }
diff -r c0dbb3a538f2 -r 5f94478ca9b5 xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c        Sat Dec 10 23:16:26 2005
+++ b/xen/arch/x86/vmx.c        Sat Dec 10 23:17:11 2005
@@ -196,12 +196,12 @@
     case MSR_FS_BASE:
         if (!(VMX_LONG_GUEST(vc)))
             /* XXX should it be GP fault */
-            domain_crash(vc->domain);
+            domain_crash_synchronous();
         __vmread(GUEST_FS_BASE, &msr_content);
         break;
     case MSR_GS_BASE:
         if (!(VMX_LONG_GUEST(vc)))
-            domain_crash(vc->domain);
+            domain_crash_synchronous();
         __vmread(GUEST_GS_BASE, &msr_content);
         break;
     case MSR_SHADOW_GS_BASE:
@@ -265,7 +265,7 @@
     case MSR_FS_BASE:
     case MSR_GS_BASE:
         if (!(VMX_LONG_GUEST(vc)))
-            domain_crash(vc->domain);
+            domain_crash_synchronous();
         if (!IS_CANO_ADDRESS(msr_content)){
             VMX_DBG_LOG(DBG_LEVEL_1, "Not cano address of msr write\n");
             vmx_inject_exception(vc, TRAP_gp_fault, 0);
@@ -278,7 +278,7 @@
 
     case MSR_SHADOW_GS_BASE:
         if (!(VMX_LONG_GUEST(vc)))
-            domain_crash(vc->domain);
+            domain_crash_synchronous();
         vc->arch.arch_vmx.msr_content.shadow_gs = msr_content;
         wrmsrl(MSR_SHADOW_GS_BASE, msr_content);
         break;
@@ -1345,12 +1345,8 @@
         }
         break;
     }
-    case 4:
+    case 4: /* CR4 */
     {
-        /* CR4 */
-        unsigned long old_guest_cr;
-
-        __vmread(GUEST_CR4, &old_guest_cr);
         if (value & X86_CR4_PAE){
             set_bit(VMX_CPU_STATE_PAE_ENABLED, &v->arch.arch_vmx.cpu_state);
         } else {
diff -r c0dbb3a538f2 -r 5f94478ca9b5 xen/arch/x86/vmx_vmcs.c
--- a/xen/arch/x86/vmx_vmcs.c   Sat Dec 10 23:16:26 2005
+++ b/xen/arch/x86/vmx_vmcs.c   Sat Dec 10 23:17:11 2005
@@ -157,13 +157,13 @@
     mpfn = get_mfn_from_pfn(E820_MAP_PAGE >> PAGE_SHIFT);
     if (mpfn == INVALID_MFN) {
         printk("Can not find E820 memory map page for VMX domain.\n");
-        domain_crash(d);
+        domain_crash_synchronous();
     }
 
     p = map_domain_page(mpfn);
     if (p == NULL) {
         printk("Can not map E820 memory map page for VMX domain.\n");
-        domain_crash(d);
+        domain_crash_synchronous();
     }
 
     e820_map_nr = *(p + E820_MAP_NR_OFFSET);
@@ -182,7 +182,7 @@
         printk("Can not get io request shared page"
                " from E820 memory map for VMX domain.\n");
         unmap_domain_page(p);
-        domain_crash(d);
+        domain_crash_synchronous();
     }
     unmap_domain_page(p);
 
@@ -190,13 +190,13 @@
     mpfn = get_mfn_from_pfn(gpfn);
     if (mpfn == INVALID_MFN) {
         printk("Can not find io request shared page for VMX domain.\n");
-        domain_crash(d);
+        domain_crash_synchronous();
     }
 
     p = map_domain_page(mpfn);
     if (p == NULL) {
         printk("Can not map io request shared page for VMX domain.\n");
-        domain_crash(d);
+        domain_crash_synchronous();
     }
     d->arch.vmx_platform.shared_page_va = (unsigned long)p;
 

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