From patchwork Mon May 26 17:28:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 4244431 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E09309F333 for ; Mon, 26 May 2014 17:29:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10056201CE for ; Mon, 26 May 2014 17:29:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0A63201BB for ; Mon, 26 May 2014 17:29:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbaEZR3F (ORCPT ); Mon, 26 May 2014 13:29:05 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:64110 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418AbaEZR3E (ORCPT ); Mon, 26 May 2014 13:29:04 -0400 Received: by mail-pa0-f54.google.com with SMTP id bj1so7879123pad.13 for ; Mon, 26 May 2014 10:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=eROWlJz8JYBmxS/CwJlcBNS6Tb86wpLiFLzGgm4IPBQ=; b=mow61YQE0FQARkg11vkMWlPpusx5h7G+O3TqPkG9LxlJcfZUCY5azv4k1ESAA7Q0EM 3Ye6xR8JofhDqkl19S2/Eyy6QFtOSysZP9KXCF1KrP1sGHh6hZi0vm1zpK2y6k2DXhNB /Fpip3wT0mKjUigwTmeo67T0vlwNVyTqlzcqYzZjGFonXWXvKbZz0qW5BJHPrEJrWAhE Z1xte2WgEyR6JN7l6nRw8QCjoRcr0aINuFSgddRrFe6JfrhzsbeQWc3YRgiWvJGi8WKC HfR9BesAWFcqGgYzyn+Gg9ddnEvr62l6hE7iXemhR5aW8i9lWktbUq1JgiAXILaR0G81 00Tg== X-Received: by 10.68.204.162 with SMTP id kz2mr30027506pbc.13.1401125342828; Mon, 26 May 2014 10:29:02 -0700 (PDT) Received: from pike.twiddle.home (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id vc5sm60719203pac.19.2014.05.26.10.29.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 May 2014 10:29:01 -0700 (PDT) Message-ID: <538379DA.9070404@twiddle.net> Date: Mon, 26 May 2014 10:28:58 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Andreas_F=E4rber?= , Alexander Graf , qemu-devel@nongnu.org CC: Paolo Bonzini , Christoffer Dall , kvm@vger.kernel.org, Peter Maydell , Guan Xuetao Subject: Re: BUG: commit 50a2c6e breaks KVM/ARM (reset/init vcpu order) References: <20140526091813.GA31431@lvm> <53830F7A.3060306@redhat.com> <5383100C.3030807@suse.de> <53831565.6060401@suse.de> In-Reply-To: <53831565.6060401@suse.de> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 05/26/2014 03:20 AM, Andreas Färber wrote: > Alpha is the main blocker for unifying CPU reset iirc. It does not > implement reset at all and thus is not calling it. The struct was not > designed for zero'ing things, so there's a mix of data fields and > pointers without clear separation to allow memset(), and I have neither > a working alpha test image nor the time to investigate this at the moment. > > WIP here: > https://github.com/afaerber/qemu-cpu/commits/qom-cpu-alpha > https://github.com/afaerber/qemu-cpu/commits/qom-cpu-reset Doesn't compile anymore. I can fix that up with the attached, but we can't actually test this without changes to the rom to actually support reset. At the moment, the rom will tell qemu to poweroff whether the kernel signals for poweroff or reset. If this is good enough to unblock you in other qom cleanups, please go ahead. One of these days I'll get around to filling out more complete roms... r~ diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c index 6ab31a1..cbad6fa 100644 --- a/target-alpha/cpu.c +++ b/target-alpha/cpu.c @@ -49,19 +49,30 @@ static bool alpha_cpu_has_work(CPUState *cs) /* CPUClass::reset() */ static void alpha_cpu_reset(CPUState *s) { +#ifdef CONFIG_SOFTMMU AlphaCPU *cpu = ALPHA_CPU(s); AlphaCPUClass *acc = ALPHA_CPU_GET_CLASS(cpu); CPUAlphaState *env = &cpu->env; + uint64_t palbr; if (qemu_loglevel_mask(CPU_LOG_RESET)) { qemu_log("CPU Reset (CPU %d)\n", s->cpu_index); - log_cpu_state(env, 0); + log_cpu_state(s, 0); } acc->parent_reset(s); - memset(env, 0, offsetof(CPUAlphaState, breakpoints)); - tlb_flush(env, 1); + palbr = env->palbr; + + memset(env, 0, offsetof(CPUAlphaState, error_code)); + tlb_flush(s, 1); + + /* Reset vector goes to palbr + 0. */ + env->palbr = palbr; + env->pc = palbr; +#else + abort(); +#endif } static void alpha_cpu_realizefn(DeviceState *dev, Error **errp)