From patchwork Tue May 27 12:37:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 30974 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C6FE5203C3 for ; Tue, 27 May 2014 12:39:18 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id pa12sf37286928veb.11 for ; Tue, 27 May 2014 05:39:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=Ipthc8oBDmsXGieTS30wStOw8Rr6GoVRuKUvA3/4gF4=; b=Q4B9DiYCjseCHJFdSL3gXjMsG/zDyggJhLrnPTgPsXOUUuQptA0rhCGxy0oeXYDRxO VdDwVRr5iIQzLEYG0HfWXA/0Lkvg+ZxdCLJ4KGZ0XHxL3johBkPm1MIm0BXr2QA/Xd1M MU9Y73tWxFYgAo3TVHGhDc2NRIDD/MS5aiHBEEy5MCXmlL/XERd+iRoJg4WePnCsvbJK 2yDRJtR9EI/cRqb8vdYu61m0HX4GAG5OpOA9dGrXjxMBmMPHFd6YWP/28+Uz4ik2FEce TIJn5cqyhhknIvY0ZmzECE79GSLUACxkmRbv7GD5jAxzyhMqUAka7qEJQt6VPikJ4YfV NU8A== X-Gm-Message-State: ALoCoQkhM6K7cvMWdApBJL7J2il2JTaQEFHhjqRKafjwNYjJVAq1m47NnvDd/uA9LAyknLVPR7JO X-Received: by 10.224.147.72 with SMTP id k8mr12980914qav.5.1401194358595; Tue, 27 May 2014 05:39:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.103 with SMTP id 94ls795218qgw.13.gmail; Tue, 27 May 2014 05:39:18 -0700 (PDT) X-Received: by 10.58.161.101 with SMTP id xr5mr1565339veb.36.1401194358291; Tue, 27 May 2014 05:39:18 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id sv4si7988251vdc.72.2014.05.27.05.39.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 05:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so10563740vcb.32 for ; Tue, 27 May 2014 05:39:18 -0700 (PDT) X-Received: by 10.58.185.165 with SMTP id fd5mr1070964vec.41.1401194358220; Tue, 27 May 2014 05:39:18 -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 ib8csp115743vcb; Tue, 27 May 2014 05:39:17 -0700 (PDT) X-Received: by 10.224.51.2 with SMTP id b2mr43036143qag.49.1401194357875; Tue, 27 May 2014 05:39:17 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f1si17207416qai.52.2014.05.27.05.39.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 27 May 2014 05:39:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:34075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpGez-0006n9-He for patch@linaro.org; Tue, 27 May 2014 08:39:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpGe4-0005gw-C5 for qemu-devel@nongnu.org; Tue, 27 May 2014 08:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WpGdx-00023S-CO for qemu-devel@nongnu.org; Tue, 27 May 2014 08:38:20 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:50899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpGdx-00023H-66 for qemu-devel@nongnu.org; Tue, 27 May 2014 08:38:13 -0400 Received: by mail-lb0-f173.google.com with SMTP id 10so4923613lbg.4 for ; Tue, 27 May 2014 05:38:12 -0700 (PDT) X-Received: by 10.152.42.145 with SMTP id o17mr23379248lal.33.1401194291933; Tue, 27 May 2014 05:38:11 -0700 (PDT) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id ao10sm6996799lac.2.2014.05.27.05.38.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 05:38:11 -0700 (PDT) From: Christoffer Dall To: qemu-devel@nongnu.org Date: Tue, 27 May 2014 14:37:43 +0200 Message-Id: <1401194263-13010-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.173 Cc: Peter Maydell , Paolo Bonzini , Alexander Graf , Christoffer Dall , Andreas Faerber Subject: [Qemu-devel] [PATCH v3] target-arm: Fix segfault on startup when KVM enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) 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 Commit 50a2c6e55fa introduced a bug where QEMU would segfault on startup when using KVM on ARM hosts, because kvm_arm_reset_cpu() accesses cpu->cpreg_reset_values, which is not allocated before kvm_arch_init_vcpu(). Fix this by not calling cpu_reset() until after qemu_init_vcpu(). Acked-by: Paolo Bonzini Reviewed-by: Peter Maydell Reviewed-by: Andreas Faerber Signed-off-by: Christoffer Dall --- Changes since v2: - Changed subject line which I forgot in v2 Changes since v1: - Updated commit message (current version by Peter Maydell) target-arm/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 6c6f2b3..794dcb9 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -370,8 +370,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) init_cpreg_list(cpu); - cpu_reset(cs); qemu_init_vcpu(cs); + cpu_reset(cs); acc->parent_realize(dev, errp); }