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-ia64-devel

[PATCH] [Fwd: RE: [Xen-ia64-devel] stack corruption creating idle domain

To: dan.magenheimer@xxxxxx
Subject: [PATCH] [Fwd: RE: [Xen-ia64-devel] stack corruption creating idle domain]
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Tue, 31 Jan 2006 15:59:30 -0700
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 31 Jan 2006 23:09:12 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: LOSL
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Dan,

   I'd like to see this patch from last week make it in before we forget
about it.  It's a compiler timebomb waiting to go off.  To see it on
gcc-3.4, run ski, set a break point at alloc_vcpu_struct, set the data
window to the address in r12 (sp), step over the second memset and note
that the stack has been cleared.  If we were using the stack (as I was
w/ gcc-3.3) we'd be in trouble.  Thanks,

        Alex

-------- Forwarded Message --------
From: Alex Williamson <alex.williamson@xxxxxx>
To: Tian, Kevin <kevin.tian@xxxxxxxxx>
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-ia64-devel] stack corruption creating idle domain
Date: Wed, 25 Jan 2006 10:36:49 -0700

On Wed, 2006-01-25 at 11:04 +0800, Tian, Kevin wrote:
> 
> Make sense and thanks for info. We shouldn't manipulate switch stack
> area for current running vcpu, since that area only makes sense when
> specific vcpu is de-activated. The initial stack of idle vcpu0 starts
> from point under pt_regs, and thus above memset definitely corrupts
> active stack frames. Could you try whether following change working
> for you?

Kevin,

   Yes, that seems to fix the problem, or at least avoid it.
xen-unstable.hg looks to be a bit out of date with xen-ia64-unstable.hg
in this area.  I think the patch below is effectively the same change
versus xen-unstable.hg.  Thanks,

        Alex


Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---

diff -r aad2b2da3c8b xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Wed Jan 25 11:51:21 2006
+++ b/xen/arch/ia64/xen/domain.c        Wed Jan 25 04:22:50 2006
@@ -157,14 +157,14 @@
            if ((v = alloc_xenheap_pages(KERNEL_STACK_SIZE_ORDER)) == NULL)
                return NULL;
            memset(v, 0, sizeof(*v)); 
-       }
-
-       ti = alloc_thread_info(v);
-       /* Clear thread_info to clear some important fields, like
-        * preempt_count
-        */
-       memset(ti, 0, sizeof(struct thread_info));
-       init_switch_stack(v);
+
+           ti = alloc_thread_info(v);
+           /* Clear thread_info to clear some important fields, like
+            * preempt_count
+            */
+           memset(ti, 0, sizeof(struct thread_info));
+           init_switch_stack(v);
+       }
 
        if (!is_idle_domain(d)) {
            v->arch.privregs = 



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

-- 
Alex Williamson                             HP Linux & Open Source Lab


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

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] [Fwd: RE: [Xen-ia64-devel] stack corruption creating idle domain], Alex Williamson <=