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] [PATCH] [PATCH] SMP coredump fix

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [PATCH] [PATCH] SMP coredump fix
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Mon, 16 May 2005 07:43:46 +0000
Delivery-date: Mon, 16 May 2005 08:05:19 +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.1411, 2005/05/16 08:43:46+01:00, kmacy@xxxxxxxxxx

        [PATCH] [PATCH] SMP coredump fix
        
        # This is a BitKeeper generated diff -Nru style patch.
        #
        # ChangeSet
        #   2005/05/15 18:03:44-07:00 kmacy@xxxxxxxxxxxxxxxxxxxxxx
        #   Fix SMP coredumps
        #   Signed-off-by: Kip Macy <kmacy@xxxxxxxxxx>
        #
        # BitKeeper/etc/logging_ok
        #   2005/05/15 18:03:43-07:00 kmacy@xxxxxxxxxxxxxxxxxxxxxx +1 -0
        #   Logging to logging@xxxxxxxxxxxxxxx accepted
        #
        # tools/libxc/xc_core.c
        #   2005/05/15 18:03:21-07:00 kmacy@xxxxxxxxxxxxxxxxxxxxxx +11 -7
        #   handle discontiguous CPUs correctly
        #   make offsets in core header correct for MP case
        #



 xc_core.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)


diff -Nru a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c     2005-05-16 04:05:56 -04:00
+++ b/tools/libxc/xc_core.c     2005-05-16 04:05:56 -04:00
@@ -32,7 +32,7 @@
        unsigned long nr_pages;
        unsigned long *page_array;
        xc_dominfo_t info;
-       int i, dump_fd;
+       int i, j, vcpu_map_size, dump_fd;
        char *dump_mem, *dump_mem_start = NULL;
        struct xc_core_header header;
        vcpu_guest_context_t     ctxt[MAX_VIRT_CPUS];
@@ -53,14 +53,17 @@
                goto error_out;
        }
        
-       for (i = 0; i < sizeof(info.vcpu_to_cpu) / sizeof(info.vcpu_to_cpu[0]);
-            i++) {
-               if (info.vcpu_to_cpu[i] == -1)
+       vcpu_map_size =  sizeof(info.vcpu_to_cpu) / sizeof(info.vcpu_to_cpu[0]);
+
+       for (i = 0, j = 0; i < vcpu_map_size; i++) {
+               if (info.vcpu_to_cpu[i] == -1) {
                        continue;
-               if (xc_domain_get_vcpu_context(xc_handle, domid, i, &ctxt[i])) {
+               }
+               if (xc_domain_get_vcpu_context(xc_handle, domid, i, &ctxt[j])) {
                        PERROR("Could not get all vcpu contexts for domain");
                        goto error_out;
                }
+               j++;
        }
        
        nr_pages = info.nr_pages;
@@ -70,9 +73,10 @@
        header.xch_nr_pages = nr_pages;
        header.xch_ctxt_offset = sizeof(struct xc_core_header);
        header.xch_index_offset = sizeof(struct xc_core_header) +
-           sizeof(vcpu_guest_context_t);
+           sizeof(vcpu_guest_context_t)*info.vcpus;
        header.xch_pages_offset = round_pgup(sizeof(struct xc_core_header) +
-           sizeof(vcpu_guest_context_t) + nr_pages * sizeof(unsigned long));
+           (sizeof(vcpu_guest_context_t) * info.vcpus) + 
+           (nr_pages * sizeof(unsigned long)));
 
        write(dump_fd, &header, sizeof(struct xc_core_header));
        write(dump_fd, &ctxt, sizeof(ctxt[0]) * info.vcpus);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [PATCH] [PATCH] SMP coredump fix, BitKeeper Bot <=