From patchwork Wed Apr 30 14:40:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 29428 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 80F30203F3 for ; Wed, 30 Apr 2014 14:42:28 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id fp1sf7772075pdb.10 for ; Wed, 30 Apr 2014 07:42:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=N7YYprXFub3YYctSc12dAfDib7Nlv1NYhYCAJ1cgusc=; b=O00znEgcfr3Q5s4E9Ni+aP3uRqANLJ2ztVnyFi9hct/XA3JwQU0Y1uKS+6adR7Q/rp ftIg6sCB6EfmamEcWkzaXoSzO9KR/Ta1kWFpuqVh5ISDpOeq0ojrdYNg2unUpoXTW5By xlTLdrY5GAzPLxb0gp38P6E0HDJ7TZgfyX8RZVSjsbf15kEt738UzdE8dOhqzCPB+/4G E+5Io94FEO/jPPzcxXXHoxeo/m9j8u0BQ3s+XHjCfKlqTVZpfGFbZU0RDXBBtxOYFT/s 97SZkTaV2S0iNyolDG2hn/TuAlok5SzsMa7LRhjzmRkDGOYKpqRVyWpzKEu1YnyMcoVb hSog== X-Gm-Message-State: ALoCoQmDZvoXDhCMf2vrtGZqgp86iINn2+F9KrQAFjDJG63ijh6rlEFg637OQVQm0wLbqvn5SWeD X-Received: by 10.66.180.77 with SMTP id dm13mr2491816pac.43.1398868945565; Wed, 30 Apr 2014 07:42:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.51 with SMTP id w48ls619434qgd.6.gmail; Wed, 30 Apr 2014 07:42:25 -0700 (PDT) X-Received: by 10.58.220.161 with SMTP id px1mr4334447vec.13.1398868945421; Wed, 30 Apr 2014 07:42:25 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id p4si5353567vem.192.2014.04.30.07.42.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 07:42:25 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ib6so2295765vcb.33 for ; Wed, 30 Apr 2014 07:42:25 -0700 (PDT) X-Received: by 10.58.96.36 with SMTP id dp4mr4278126veb.21.1398868945323; Wed, 30 Apr 2014 07:42:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp284626vcb; Wed, 30 Apr 2014 07:42:24 -0700 (PDT) X-Received: by 10.58.34.143 with SMTP id z15mr306482vei.52.1398868944845; Wed, 30 Apr 2014 07:42:24 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id d20si5364956veu.43.2014.04.30.07.42.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Apr 2014 07:42:24 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WfVgM-0004AI-I6; Wed, 30 Apr 2014 14:40:22 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WfVgL-0004AC-G8 for xen-devel@lists.xen.org; Wed, 30 Apr 2014 14:40:21 +0000 Received: from [85.158.139.211:44603] by server-13.bemta-5.messagelabs.com id C2/8C-16341-45B01635; Wed, 30 Apr 2014 14:40:20 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-12.tower-206.messagelabs.com!1398868819!1547436!1 X-Originating-IP: [74.125.83.45] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8496 invoked from network); 30 Apr 2014 14:40:20 -0000 Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com) (74.125.83.45) by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 30 Apr 2014 14:40:20 -0000 Received: by mail-ee0-f45.google.com with SMTP id d17so1471260eek.32 for ; Wed, 30 Apr 2014 07:40:19 -0700 (PDT) X-Received: by 10.14.22.69 with SMTP id s45mr4768163ees.56.1398868819792; Wed, 30 Apr 2014 07:40:19 -0700 (PDT) Received: from [10.80.2.139] ([185.25.64.249]) by mx.google.com with ESMTPSA id t50sm68371280eev.28.2014.04.30.07.40.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 07:40:19 -0700 (PDT) Message-ID: <53610B51.8030701@linaro.org> Date: Wed, 30 Apr 2014 15:40:17 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131104 Icedove/17.0.10 MIME-Version: 1.0 To: Jan Beulich , George Dunlap Cc: xen-devel , Ian Campbell , Stefano Stabellini Subject: [Xen-devel] Hit ASSERT in kill_timer function X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Hi, I played a bit with the function vcpu_initialize on ARM. If it fails, it will likely crash Xen with the following stack trace: (XEN) Xen BUG at /local/home/julien/works/arndale/xen/xen/include/xen/list.h:175 (XEN) CPU0: Unexpected Trap: Undefined Instruction (XEN) ----[ Xen-4.5-unstable arm32 debug=y Tainted: C ]---- (XEN) CPU: 0 (XEN) PC: 002457e0 __bug+0x2c/0x44 (XEN) CPSR: 200001da MODE:Hypervisor (XEN) R0: 0026b6d4 R1: 00000005 R2: 00000000 R3: 200001da (XEN) R4: 000000af R5: 00263274 R6: 002ec020 R7: 002ee380 (XEN) R8: 002ee380 R9: 8000015a R10:7ffc1040 R11:7ffdfd6c R12:00000006 (XEN) HYP: SP: 7ffdfd64 LR: 002457e0 (XEN) (XEN) VTCR_EL2: 80003558 (XEN) VTTBR_EL2: 00010002f9ffc000 (XEN) (XEN) SCTLR_EL2: 30cd187f (XEN) HCR_EL2: 0000000000382437 (XEN) TTBR0_EL2: 00000000ff6e7000 (XEN) (XEN) ESR_EL2: 00000000 (XEN) HPFAR_EL2: 0000000000fff110 (XEN) HDFAR: a0800f00 (XEN) HIFAR: 00000000 (XEN) (XEN) Xen stack trace from sp=7ffdfd64: (XEN) 00000000 7ffdfd94 00231cb0 00000003 7ffc1000 00000fff 7ffc1000 40022000 (XEN) 00000000 00000003 0026bb80 7ffdfda4 002296e4 00000000 00000fff 7ffdfdc4 (XEN) 002081d8 00000000 00000080 00000003 40025c30 002ec020 7ffdfdf8 7ffdfedc (XEN) 00206a10 76f6a004 00000000 76f6c004 002ef69c 002ef69c fffffffc 40022000 (XEN) 002ee298 002ee298 002ef69c 4000f9b8 00000001 0000000f 00000000 00000000 (XEN) 00000000 00000000 00000000 00000000 00000000 00000000 c437bb18 75464f92 (XEN) 83f21e90 0000000f 0000000a 00000003 00031008 00000001 76f43cec 76ea5000 (XEN) 00000000 7e8a319c 76eea484 76f49ec0 7e8a31bc 7e8a32d4 76f84000 76ef7000 (XEN) 000586f8 76efad4c 76f844c0 00000000 00000001 7e8a327c 76f77857 00000000 (XEN) 00000001 00000001 00000000 76f49ec0 76ed43b0 76f49e90 7e8a3500 00031030 (XEN) 00032290 00000003 00038828 7e8a3540 76f7bf2c 40024a60 7ffdff58 8000db88 (XEN) 00000005 00305000 00000ea1 9d7fc000 7e8a3120 7ffdff54 00254698 ffffffff (XEN) 002ef280 002ef294 4000f068 00000019 7ffdff58 002ef280 002ef294 7ffdff2c (XEN) 7ffdff2c 7ffdff3c 00000019 40023954 7ffdff58 00000000 76f6c000 9f782040 (XEN) 00000005 00305000 00000005 9d7fc000 ffffffff 9f782040 00000005 00305000 (XEN) 00000005 9d7fc000 7e8a3120 7ffdff58 00257110 76f6c004 76f89578 00000000 (XEN) 76ed43b0 ffffffff 9f782040 00000005 00305000 00000005 9d7fc000 7e8a3120 (XEN) 9f119010 00000024 ffffffff 76eead54 8000db88 60000013 00000000 7e8a30ec (XEN) 8056e740 80011ec0 9d7fdeb4 80200a60 8056e74c 80012000 8056e758 800120a0 (XEN) 00000000 00000000 00000000 00000000 00000000 00000000 00000000 60000010 (XEN) Xen call trace: (XEN) [<002457e0>] __bug+0x2c/0x44 (PC) (XEN) [<002457e0>] __bug+0x2c/0x44 (LR) (XEN) [<00231cb0>] kill_timer+0x1bc/0x364 (XEN) [<002296e4>] sched_destroy_vcpu+0x1c/0x14c (XEN) [<002081d8>] alloc_vcpu+0x17c/0x270 (XEN) [<00206a10>] do_domctl+0xa74/0x11f4 (XEN) [<00254698>] do_trap_hypervisor+0x7f0/0xb44 (XEN) [<00257110>] return_from_trap+0/0x4 (XEN) It's easily reproductible on ARM with this small patch: I guess we forget to take a lock or smth like that, but I don't know enough this code. Regards, diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index ccccb77..7ada03f 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -473,6 +473,9 @@ int vcpu_initialise(struct vcpu *v) if ( (rc = vcpu_vtimer_init(v)) != 0 ) return rc; + if ( v->domain->domain_id != 0 ) + return -EFAULT; + return rc; }