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

Re: [Xen-devel] RE: kernel panic when enable x2apic

To: Weidong Han <weidong.han@xxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] RE: kernel panic when enable x2apic
From: Keir Fraser <keir@xxxxxxx>
Date: Tue, 30 Nov 2010 09:23:52 +0000
Cc: "Zhang, Yang Z" <yang.z.zhang@xxxxxxxxx>, Sander Eikelenboom <linux@xxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 30 Nov 2010 01:24:55 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:user-agent:date :subject:from:to:cc:message-id:thread-topic:thread-index:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=qZZPjpjhiVJ5dVziMOL5qu77GCtxr0yWnf2MOMoBrJ0=; b=njctp+7xDVPxEXEGzVCTO6ssaeW8KXX7MG/mspYu1L9D3rjrGx7XlNLJ5Hul4ae75K 7JfhGv/Ry9Ry0F1pQ+ewUoKof4FT1AqtOKOR5yCr1a5FVqKWagt+CzH0OV5V6BaCzei6 7juhON7fRb13+hx2K1AQqVLI1zCvIS5fRygWA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=Q6Z/uRrNw3/bcwtLGKSQVscFopNGuhSWnPZp3aKkBQxpk9lDd6yFMGXXwDqha/WD0C TGl0+tqFV9RUu3P8pA15VsownHfOOtiSF3Qne2kvwPUQrHIMVWTTXzuzHv2wVVgU16IJ 3HZ9js/VZa6tynuz9NDxM40+OJgBPJz20aMVM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CF4BAC3.6060009@xxxxxxxxx>
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: AcuQcE1uByFqnXV9HkW/W3iuOS4idw==
Thread-topic: [Xen-devel] RE: kernel panic when enable x2apic
User-agent: Microsoft-Entourage/12.27.0.100910
On 30/11/2010 08:50, "Weidong Han" <weidong.han@xxxxxxxxx> wrote:

> This results in Xen to allocate xsave
> area in vcpu_initialise, we observed it may allocate a used address for
> it, therefore cause the panic.

Actually you xmalloc a zero-sized area, and then immediately write past the
end of it, corrupting neigbouring data, including possibly xmalloc metadata.

> The obvious solution is to remove
> boot_cpu_data.x86_capability[4] = cpuid_ecx(1) in start_vmx. It indeed
> works with the change. I will send out the patch after more tests.

Yes, the write to x86_capability is totally unnecessary. There is a similar
pointless one in SVM code -- in fact they don't even manage to write to the
correct array element of x86_capability[]!

Removing both writes to x86_capability[] would be an appropriate fix for 4.0
branch as well.

 -- Keir



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