All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: "Andreas Färber" <afaerber@suse.de>,
	"Alexander Graf" <agraf@suse.de>,
	qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Christoffer Dall <christoffer.dall@linaro.org>,
	kvm@vger.kernel.org, Peter Maydell <peter.maydell@linaro.org>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>
Subject: Re: BUG: commit 50a2c6e breaks KVM/ARM (reset/init vcpu order)
Date: Mon, 26 May 2014 10:28:58 -0700	[thread overview]
Message-ID: <538379DA.9070404@twiddle.net> (raw)
In-Reply-To: <53831565.6060401@suse.de>

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

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~


[-- Attachment #2: z --]
[-- Type: text/plain, Size: 1023 bytes --]

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)

      parent reply	other threads:[~2014-05-26 17:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26  9:18 BUG: commit 50a2c6e breaks KVM/ARM (reset/init vcpu order) Christoffer Dall
2014-05-26  9:18 ` [Qemu-devel] " Christoffer Dall
2014-05-26  9:55 ` Paolo Bonzini
2014-05-26  9:55   ` [Qemu-devel] " Paolo Bonzini
2014-05-26  9:57   ` Alexander Graf
2014-05-26  9:57     ` [Qemu-devel] " Alexander Graf
2014-05-26 10:20     ` Andreas Färber
2014-05-26 10:20       ` [Qemu-devel] " Andreas Färber
2014-05-26 10:31       ` Alexander Graf
2014-05-26 10:31         ` [Qemu-devel] " Alexander Graf
2014-05-26 12:36         ` Andreas Färber
2014-05-26 21:04           ` Alexander Graf
2014-05-26 12:39       ` 回复: " 管雪涛
2014-05-26 17:28       ` Richard Henderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=538379DA.9070404@twiddle.net \
    --to=rth@twiddle.net \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=christoffer.dall@linaro.org \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.