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] Better handling of NULL callback pointers -- synchronous

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Better handling of NULL callback pointers -- synchronously crash the
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Mon, 23 May 2005 18:17:51 +0000
Delivery-date: Mon, 23 May 2005 19:01:17 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1515, 2005/05/23 19:17:51+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Better handling of NULL callback pointers -- synchronously crash the
        offending domain. This gets us some nice debug output for domain0.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 traps.c        |   18 ------------------
 x86_32/entry.S |    2 ++
 x86_64/entry.S |    2 ++
 3 files changed, 4 insertions(+), 18 deletions(-)


diff -Nru a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      2005-05-23 15:01:55 -04:00
+++ b/xen/arch/x86/traps.c      2005-05-23 15:01:55 -04:00
@@ -245,12 +245,6 @@
     if ( !GUEST_MODE(regs) )
         goto xen_fault;
 
-#ifndef NDEBUG
-    if ( (ed->arch.guest_context.trap_ctxt[trapnr].address == 0) &&
-         (ed->domain->domain_id == 0) )
-        goto xen_fault;
-#endif
-
     ti = &current->arch.guest_context.trap_ctxt[trapnr];
     tb->flags = TBF_EXCEPTION;
     tb->cs    = ti->cs;
@@ -450,12 +444,6 @@
     if ( !GUEST_MODE(regs) )
         goto xen_fault;
 
-#ifndef NDEBUG
-    if ( (ed->arch.guest_context.trap_ctxt[TRAP_page_fault].address == 0) &&
-         (d->domain_id == 0) )
-        goto xen_fault;
-#endif
-
     propagate_page_fault(addr, regs->error_code);
     return 0; 
 
@@ -930,12 +918,6 @@
          (regs->error_code == 0) && 
          gpf_emulate_4gb(regs) )
         return 0;
-#endif
-
-#ifndef NDEBUG
-    if ( (ed->arch.guest_context.trap_ctxt[TRAP_gp_fault].address == 0) &&
-         (ed->domain->domain_id == 0) )
-        goto gp_in_kernel;
 #endif
 
     /* Pass on GPF as is. */
diff -Nru a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S       2005-05-23 15:01:55 -04:00
+++ b/xen/arch/x86/x86_32/entry.S       2005-05-23 15:01:55 -04:00
@@ -331,6 +331,8 @@
         movb TRAPBOUNCE_flags(%edx),%cl
         subl $12,%esi
         movl UREGS_eip+4(%esp),%eax
+        test %eax,%eax
+        jz   domain_crash_synchronous
 FLT14:  movl %eax,%gs:(%esi) 
         movl EDOMAIN_vcpu_info(%ebx),%eax
         pushl VCPUINFO_upcall_mask(%eax)
diff -Nru a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S       2005-05-23 15:01:55 -04:00
+++ b/xen/arch/x86/x86_64/entry.S       2005-05-23 15:01:55 -04:00
@@ -320,6 +320,8 @@
         movw  UREGS_cs+8(%rsp),%ax      # Bits  0-15: CS
 FLT5:   movq  %rax,8(%rsi)              # CS/saved_upcall_mask
         movq  UREGS_rip+8(%rsp),%rax
+        testq %rax,%rax
+        jz    domain_crash_synchronous
 FLT6:   movq  %rax,(%rsi)               # RIP
         testb $TBF_EXCEPTION_ERRCODE,%cl
         jz    1f

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Better handling of NULL callback pointers -- synchronously crash the, BitKeeper Bot <=