qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: "Alexander Graf" <agraf@suse.de>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Cédric Le Goater" <clg@kaod.org>
Subject: [Qemu-devel] [PATCH 2/4] ppc: fix large page support
Date: Fri,  1 Jul 2016 09:10:11 +0200	[thread overview]
Message-ID: <1467357013-4039-3-git-send-email-clg@kaod.org> (raw)
In-Reply-To: <1467357013-4039-1-git-send-email-clg@kaod.org>

A regression was introduced by commit 53df75a59bcf ('ppc: Fix 64K
pages support in full emulation'). ppc_hash64_hpte_page_shift_noslb()
should be used to compute the page size.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 target-ppc/mmu-hash64.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c
index 7d056c1e3b4a..fdaff9e874ba 100644
--- a/target-ppc/mmu-hash64.c
+++ b/target-ppc/mmu-hash64.c
@@ -450,28 +450,6 @@ void ppc_hash64_stop_access(PowerPCCPU *cpu, uint64_t token)
     }
 }
 
-/* Returns the effective page shift or 0. MPSS isn't supported yet so
- * this will always be the slb_pshift or 0
- */
-static uint32_t ppc_hash64_pte_size_decode(uint64_t pte1, uint32_t slb_pshift)
-{
-    switch (slb_pshift) {
-    case 12:
-        return 12;
-    case 16:
-        if ((pte1 & 0xf000) == 0x1000) {
-            return 16;
-        }
-        return 0;
-    case 24:
-        if ((pte1 & 0xff000) == 0) {
-            return 24;
-        }
-        return 0;
-    }
-    return 0;
-}
-
 static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash,
                                      uint32_t slb_pshift, bool secondary,
                                      target_ulong ptem, ppc_hash_pte64_t *pte)
@@ -494,7 +472,7 @@ static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash,
         if ((pte0 & HPTE64_V_VALID)
             && (secondary == !!(pte0 & HPTE64_V_SECONDARY))
             && HPTE64_V_COMPARE(pte0, ptem)) {
-            uint32_t pshift = ppc_hash64_pte_size_decode(pte1, slb_pshift);
+            uint32_t pshift = ppc_hash64_hpte_page_shift_noslb(cpu, pte0, pte1);
             if (pshift == 0) {
                 continue;
             }
-- 
2.1.4

  parent reply	other threads:[~2016-07-01  7:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01  7:10 [Qemu-devel] [PATCH 0/4] ppc: fixes for large page and VRMA support Cédric Le Goater
2016-07-01  7:10 ` [Qemu-devel] [PATCH 1/4] ppc: simplify ppc_hash64_hpte_page_shift_noslb() Cédric Le Goater
2016-07-04  4:46   ` David Gibson
2016-07-04  5:17     ` David Gibson
2016-07-01  7:10 ` Cédric Le Goater [this message]
2016-07-01  7:10 ` [Qemu-devel] [PATCH 3/4] ppc: simplify ppc_hash64_pteg_search() Cédric Le Goater
2016-07-01  7:10 ` [Qemu-devel] [PATCH 4/4] ppc: fix VRMA support Cédric Le Goater
2016-07-04  6:11 ` [Qemu-devel] [PATCH 0/4] ppc: fixes for large page and " Benjamin Herrenschmidt
2016-07-04  6:26   ` Cédric Le Goater

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=1467357013-4039-3-git-send-email-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.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 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).