qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: qemu-stable@nongnu.org
Cc: thuth@redhat.com, anton@samba.org, agraf@suse.de,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 3/4] hw/ppc/spapr: Fix the selection of the processor features
Date: Thu, 13 Oct 2016 16:15:33 +1100	[thread overview]
Message-ID: <1476335734-29831-4-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1476335734-29831-1-git-send-email-david@gibson.dropbear.id.au>

From: Thomas Huth <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>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 4cbec30d769a73853b60dc7f275e6e7da9ab5162)
---
 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 36d9077..9f0d99b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -607,12 +607,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) {
-- 
2.7.4

  parent reply	other threads:[~2016-10-13  5:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13  5:15 [Qemu-devel] [PULL 0/4] ppc patches for qemu-2.7 stable branch David Gibson
2016-10-13  5:15 ` [Qemu-devel] [PULL 1/4] linux-headers: update David Gibson
2016-10-13  5:15 ` [Qemu-devel] [PULL 2/4] hw/ppc/spapr: Move code related to "ibm, pa-features" to a separate function David Gibson
2016-10-13  5:15 ` David Gibson [this message]
2016-10-13  5:15 ` [Qemu-devel] [PULL 4/4] ppc: Check the availability of transactional memory David Gibson
2016-10-13 11:54 ` [Qemu-devel] [PULL 0/4] ppc patches for qemu-2.7 stable branch Peter Maydell
2016-10-13 11:57   ` Peter Maydell
2016-10-13 22:28     ` David Gibson
2016-10-14  8:27       ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-10-14 17:38         ` Peter Maydell
2016-10-17  7:44           ` Thomas Huth
2016-10-17 16:51             ` [Qemu-devel] [Qemu-stable] " Michael Roth
2016-10-17 17:33               ` Peter Maydell
2016-10-17 18:13                 ` Michael Roth
2016-10-17 18:45                   ` Peter Maydell
2016-10-17 21:24                     ` Michael Roth
2016-10-17 21:49                       ` Peter Maydell
2016-10-25  1:41                       ` David Gibson
2016-10-25 23:57                         ` Michael Roth
2016-11-01  2:26                           ` David Gibson
2016-11-02 23:49                             ` Michael Roth

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=1476335734-29831-4-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=anton@samba.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=thuth@redhat.com \
    /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).