From: Thomas Huth <thuth@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>, qemu-ppc@nongnu.org
Cc: "Alexander Graf" <agraf@suse.de>,
qemu-devel@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
"Anton Blanchard" <anton@samba.org>
Subject: [Qemu-devel] [PATCH 2/3] hw/ppc/spapr: Fix the selection of the processor features
Date: Wed, 28 Sep 2016 13:16:29 +0200 [thread overview]
Message-ID: <1475061390-17644-3-git-send-email-thuth@redhat.com> (raw)
In-Reply-To: <1475061390-17644-1-git-send-email-thuth@redhat.com>
The current code uses pa_features_206 for POWERPC_MMU_2_06, and
for everything else, it uses pa_features_207. This is bad in some
cases because there is also a "degraded" MMU version of ISA 2.06,
called POWERPC_MMU_2_06a, which should of course use the flags for
2.06 instead. And there is also the possibility that the user runs
the pseries machine with a POWER5+ or even 970 processor. In that
case we certainly do not want to set the flags for 2.07, and rather
simply skip the setting of the pa-features property instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/ppc/spapr.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7ac775d..46d6b90 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -559,12 +559,19 @@ static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset)
uint8_t *pa_features;
size_t pa_size;
- if (env->mmu_model == POWERPC_MMU_2_06) {
+ switch (env->mmu_model) {
+ case POWERPC_MMU_2_06:
+ case POWERPC_MMU_2_06a:
pa_features = pa_features_206;
pa_size = sizeof(pa_features_206);
- } else { /* env->mmu_model == POWERPC_MMU_2_07 */
+ break;
+ case POWERPC_MMU_2_07:
+ case POWERPC_MMU_2_07a:
pa_features = pa_features_207;
pa_size = sizeof(pa_features_207);
+ break;
+ default:
+ return;
}
if (env->ci_large_pages) {
--
1.8.3.1
next prev parent reply other threads:[~2016-09-28 11:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 11:16 [Qemu-devel] [PATCH 0/3] hw/ppc/spapr: Improvements related to the "ibm, pa-features" property Thomas Huth
2016-09-28 11:16 ` [Qemu-devel] [PATCH 1/3] hw/ppc/spapr: Move code related to "ibm, pa-features" to a separate function Thomas Huth
2016-09-28 13:07 ` Cédric Le Goater
2016-09-29 1:14 ` David Gibson
2016-09-28 11:16 ` Thomas Huth [this message]
2016-09-28 13:30 ` [Qemu-devel] [PATCH 2/3] hw/ppc/spapr: Fix the selection of the processor features Cédric Le Goater
2016-09-28 11:16 ` [Qemu-devel] [PATCH 3/3] ppc: Check the availability of transactional memory Thomas Huth
2016-09-28 16:46 ` Cédric Le Goater
2016-09-29 1:21 ` David Gibson
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=1475061390-17644-3-git-send-email-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=agraf@suse.de \
--cc=anton@samba.org \
--cc=clg@kaod.org \
--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 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.