From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Henderson Subject: Re: BUG: commit 50a2c6e breaks KVM/ARM (reset/init vcpu order) Date: Mon, 26 May 2014 10:28:58 -0700 Message-ID: <538379DA.9070404@twiddle.net> References: <20140526091813.GA31431@lvm> <53830F7A.3060306@redhat.com> <5383100C.3030807@suse.de> <53831565.6060401@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050206050801080608070503" Cc: Paolo Bonzini , Christoffer Dall , kvm@vger.kernel.org, Peter Maydell , Guan Xuetao To: =?ISO-8859-1?Q?Andreas_F=E4rber?= , Alexander Graf , qemu-devel@nongnu.org Return-path: 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) In-Reply-To: <53831565.6060401@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------050206050801080608070503 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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~ --------------050206050801080608070503 Content-Type: text/plain; charset=UTF-8; name="z" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="z" 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) --------------050206050801080608070503--