From patchwork Tue May 27 12:22:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 30973 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 75EBD203C3 for ; Tue, 27 May 2014 12:24:18 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id y20sf48777186ier.3 for ; Tue, 27 May 2014 05:24: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=7PsoHK/URqLKKb2KYdoIHtijdN0CNpQljZ44Tn9/neQ=; b=dIorUgmlAKcL1lhhfY5dj+GvygauKhLntTRt+ajP+Gs0lAG9HNboAh43r/5g/4SFfP MNLL5Fo1g31efj22AHk/XZm9jHUAc6qQhaqZT3EK9QR4UGQ3PHM0letI5tIRJgTB64R2 ftoos1bavQTFgvfHIVP4hlnESgVm53LvulRJAH6/3oQXUxgs63tHcrJRWoZwx2AEA4ZF O9S3nN8+OVcwbMYEfwI6kliyhaS8j0tQ9yXaVtuWP2pNUgavzyRAl66ijJ+stEeb4cGQ UrjIA8Qq2e1MNI0VVvowXEbgObQoUmwP6ohNRidwDHVZS2CVyWU611D60m/fAcPaVL0h KYcA== X-Gm-Message-State: ALoCoQl3y0N9PxA6BzW1GTlDIp3Espqx/GEoIvTi794N7x/2zub9WHRX3e9GTta1XSYoJvgSBLKl X-Received: by 10.42.203.202 with SMTP id fj10mr12284459icb.0.1401193458440; Tue, 27 May 2014 05:24:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.130 with SMTP id q2ls2470817qga.91.gmail; Tue, 27 May 2014 05:24:18 -0700 (PDT) X-Received: by 10.52.147.170 with SMTP id tl10mr22124110vdb.14.1401193458293; Tue, 27 May 2014 05:24:18 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id x1si7988313vep.70.2014.05.27.05.24.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 05:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so10626248veb.11 for ; Tue, 27 May 2014 05:24:18 -0700 (PDT) X-Received: by 10.53.13.133 with SMTP id ey5mr22599809vdd.8.1401193458000; Tue, 27 May 2014 05:24: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 ib8csp114695vcb; Tue, 27 May 2014 05:24:17 -0700 (PDT) X-Received: by 10.224.20.72 with SMTP id e8mr40853028qab.86.1401193457561; Tue, 27 May 2014 05:24:17 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r91si16683510qgd.25.2014.05.27.05.24.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 27 May 2014 05:24: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]:33998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpGQT-0005g6-6O for patch@linaro.org; Tue, 27 May 2014 08:24:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpGPs-0005EF-FP for qemu-devel@nongnu.org; Tue, 27 May 2014 08:23:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WpGPm-0005qc-JR for qemu-devel@nongnu.org; Tue, 27 May 2014 08:23:40 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:48210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpGPm-0005qW-Cy for qemu-devel@nongnu.org; Tue, 27 May 2014 08:23:34 -0400 Received: by mail-lb0-f169.google.com with SMTP id s7so4956292lbd.0 for ; Tue, 27 May 2014 05:23:33 -0700 (PDT) X-Received: by 10.152.6.131 with SMTP id b3mr23424576laa.9.1401193413087; Tue, 27 May 2014 05:23:33 -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 d8sm15029741lbe.3.2014.05.27.05.23.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 05:23:32 -0700 (PDT) From: Christoffer Dall To: qemu-devel@nongnu.org Date: Tue, 27 May 2014 14:22:08 +0200 Message-Id: <1401193328-12786-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.169 Cc: Peter Maydell , Paolo Bonzini , Alexander Graf , Christoffer Dall , Andreas Faerber Subject: [Qemu-devel] [PATCH v2] arm: Bugfix: Fix cpu_reset() / vcpu_init() order 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.128.180 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 Signed-off-by: Christoffer Dall Reviewed-by: Andreas Färber --- 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); }