From: Thomas Huth <thuth@redhat.com>
To: alarson@ddci.com, David Gibson <david@gibson.dropbear.id.au>,
agraf@suse.de
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] Determining interest in PPC e500spin, yield, and openpic patches
Date: Thu, 16 Jun 2016 08:47:05 +0200 [thread overview]
Message-ID: <57624B69.1070809@redhat.com> (raw)
In-Reply-To: <OFB9FC4520.28F3555F-ON86257FD3.006DFC02-86257FD3.006F050A@ddci.com>
On 15.06.2016 22:12, alarson@ddci.com wrote:
[...]
> The following patch has a fix for that, and also raises a separate
> issue that I'd be happy to resolve after getting some guidance.
[...]
@@ -104,6 +108,16 @@
cpu_synchronize_state(cpu);
stl_p(&curspin->pir, env->spr[SPR_PIR]);
+/* The stl_p() above seems wrong to me. First of all, it seems more appropriate
+ * in a guest ROM/BOOT code than in qemu emulation. However, SPR_PIR is never
+ * initialized, so the effect of the stl_p() is to overwrite the curspin->pir
+ * with 0. It makes more sense to load the SPR_PIR with the curspin->pir, which
+ * is what the following does.
+ * env->spr[SPR_PIR]=ldl_p(&curspin->pir);
+ * Alternately SPR_PIR could be initialized from SPR_BOOKE_PIR which is properly
+ * initialized, so this could also work:
+ * env->spr[SPR_PIR] = env->spr[SPR_BOOKE_PIR]
+*/
env->nip = ldq_p(&curspin->addr) & (map_size - 1);
env->gpr[3] = ldq_p(&curspin->r3);
env->gpr[4] = 0;
I'm not very familiar with the e500 code, but as far as I understand the
ppce500_spin.c code, it provides the spin table facility from ePAPR for the
guests that is normally provided by the boot firmware instead. Some more
information why this has been done can be found in the original commit
message here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=5c145dacacad04f751c
So it's right to set up curspin->pir here (not the other way round), but
I think SPR_PIR was just a typo and should be SPR_BOOKE_PIR instead,
since the PIR register for BookE CPUs has the number 286 and not 1023.
So does it work for you if you simply replace the line with:
stl_p(&curspin->pir, env->spr[SPR_BOOKE_PIR]);
?
Thomas
next prev parent reply other threads:[~2016-06-16 6:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 23:08 [Qemu-devel] Determining interest in PPC e500spin, yield, and openpic patches alarson
2016-06-14 19:09 ` [Qemu-devel] [Qemu-ppc] " Mark Cave-Ayland
2016-06-15 4:17 ` David Gibson
2016-06-15 20:12 ` alarson
2016-06-16 6:25 ` Thomas Huth
2016-06-17 22:01 ` alarson
2016-06-16 6:37 ` David Gibson
2016-06-16 6:47 ` Thomas Huth [this message]
2016-06-18 0:50 ` [Qemu-devel] PPC e500spin pir improperly initialized alarson
2016-06-20 14:01 ` Thomas Huth
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=57624B69.1070809@redhat.com \
--to=thuth@redhat.com \
--cc=agraf@suse.de \
--cc=alarson@ddci.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).