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

[Xen-devel] Re: Avoid alloc for xsave before xsave_init

To: "Huang2, Wei" <Wei.Huang2@xxxxxxx>, "Wei, Gang" <gang.wei@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: Avoid alloc for xsave before xsave_init
From: Keir Fraser <keir@xxxxxxx>
Date: Thu, 13 Jan 2011 21:15:38 +0000
Cc:
Delivery-date: Thu, 13 Jan 2011 13:16:15 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:user-agent:date:subject:from:to :message-id:thread-topic:thread-index:in-reply-to:mime-version :content-type:content-transfer-encoding; bh=95/y99iLvyujN9+L94P60hHYu0d7kEv30o/taQnVxqg=; b=Dp7i0R1koXyL2SmdtHkksA60nTvP2ZWEyev7L4d8oa/0UOW4lV9YmRHz/leaRbjXZw ESfVHXKJBhroS/1PWdr5tHk4WNJaxD5wUgmcywrg4LktLp4an/iwN2Jp/DgnC01QeCn/ 30SU5Watg7gLcpRkfzpbKLCkoWqjAhfXJG00Y=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=kIMprS0Z3j0PPqL8IYFWkRciIi0Gci0C63zqpPAv/1EY3T/RMRQxxY7tNglgx2oz5u 4F+Z7+ct0PZvmdzzxzoUShY3V856O6y39hqeHFQEzl9u7h8XMMxRpJKzIjeH6UwTp+lw We/BCUgtGI0warhoG7ZrL8ByKn7sJaagYXTxk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <EE335F95F28A664DB4A21289D2AA053BB50CA381@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcuzUojLeS2z6tQSQCO88b+hMX2tAQAC+pjAAAIkzIw=
Thread-topic: Avoid alloc for xsave before xsave_init
User-agent: Microsoft-Entourage/12.28.0.101117
On 13/01/2011 20:21, "Huang2, Wei" <Wei.Huang2@xxxxxxx> wrote:

> Hi Gang,
> 
> Was the issue caused by the uninitialized variable xsave_cntxt_size,
> triggering problem for _xmalloc()? If so, one solution is to set
> xsave_cntxt_size=576 (the default value after reset) as a default value. When
> xsave_alloc_save_area() is called for idel VCPU, _xmalloc() will initialize
> 576 bytes. Idle domain doesn't change xcr0 from my understanding. So its xcr0
> is XSTATE_FP_SSE all the time.

Idle domain isn't using FPU,SSE,AVX or any such extended state and doesn't
need it saved. Xsave_{alloc,free}_save_area() should test-and-exit on
is_idle_vcpu(), and our context switch code should not be doing XSAVE when
switching out an idle vcpu (I hope this is the case already, as it would be
a pointless waste of time).

 -- Keir

> Best,
> -Wei
> 
> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Wei, Gang
> Sent: Thursday, January 13, 2011 12:49 PM
> To: xen-devel@xxxxxxxxxxxxxxxxxxx
> Cc: Keir Fraser; Wei, Gang
> Subject: [Xen-devel] Avoid alloc for xsave before xsave_init
> 
> While debugging some weird booting failure bugs, just found currently,
> xsave_alloc_save_area will be called in
> init_idle_domain->scheduler_init->alloc_vcpu->vcpu_initialise calls, it is
> earlier than xsave_init called in identity_cpu(). This may causing buffer
> overflow on xmem_pool. I am thinking about how to fix it.
> 
> Jimmy
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
> 
> 



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