From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH][SVM] fix spinlock panic Date: Wed, 17 Jun 2009 16:20:48 +0200 Message-ID: <200906171620.49105.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_BvPOKRbPX+2UvbX" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org --Boundary-00=_BvPOKRbPX+2UvbX Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! Attached patch enables irq when initializing SVM so it's safe to take locks. This fixes a panic like this: (XEN) Xen BUG at spinlock.c:24 [...] (XEN) Xen call trace: (XEN) [] check_lock+0x3d/0x49 (XEN) [] _spin_lock+0x11/0x2d (XEN) [] alloc_heap_pages+0xcf/0x43d (XEN) [] alloc_domheap_pages+0x115/0x160 (XEN) [] alloc_xenheap_pages+0x50/0xd7 (XEN) [] alloc_host_save_area+0x18/0x45 (XEN) [] start_svm+0x6b/0x1f5 (XEN) [] init_amd+0x92b/0x96e (XEN) [] smp_store_cpu_info+0x3b/0xbd (XEN) [] smp_callin+0x101/0x217 (XEN) [] start_secondary+0xb0/0x419 Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_BvPOKRbPX+2UvbX Content-Type: text/x-diff; charset="us-ascii"; name="xen_svm_irq.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_svm_irq.diff" diff -r 45ca3f3c3f98 xen/arch/x86/hvm/svm/svm.c --- a/xen/arch/x86/hvm/svm/svm.c Tue Jun 16 11:53:47 2009 +0100 +++ b/xen/arch/x86/hvm/svm/svm.c Wed Jun 17 16:15:44 2009 +0200 @@ -850,6 +850,9 @@ int start_svm(struct cpuinfo_x86 *c) ecx = cpuid_ecx(0x80000001); boot_cpu_data.x86_capability[5] = ecx; + /* Now enable interrupts so it's safe to take locks. */ + local_irq_enable(); + if ( !(test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability)) ) return 0; --Boundary-00=_BvPOKRbPX+2UvbX Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_BvPOKRbPX+2UvbX--