qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: KONRAD Frederic <frederic.konrad@adacore.com>
To: david@gibson.dropbear.id.au, agraf@suse.de
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, frederic.konrad@adacore.com
Subject: [Qemu-devel] [PATCH for-2.11 1/4] booke206: fix booke206_tlbnps for mav 2.0
Date: Mon,  7 Aug 2017 17:50:45 +0200	[thread overview]
Message-ID: <1502121048-1816-2-git-send-email-frederic.konrad@adacore.com> (raw)
In-Reply-To: <1502121048-1816-1-git-send-email-frederic.konrad@adacore.com>

This fixes booke206_tlbnps for MAV 2.0 by checking the MMUCFG register and
return directly the right tlbnps instead of computing it from non existing
field.

Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
---
 target/ppc/cpu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 6ee2a26..d2faea9 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -2472,10 +2472,10 @@ static inline ppcmas_tlb_t *booke206_get_tlbm(CPUPPCState *env, const int tlbn,
 /* returns bitmap of supported page sizes for a given TLB */
 static inline uint32_t booke206_tlbnps(CPUPPCState *env, const int tlbn)
 {
-    bool mav2 = false;
     uint32_t ret = 0;
 
-    if (mav2) {
+    if ((env->spr[SPR_MMUCFG] & MMUCFG_MAVN) == MMUCFG_MAVN_V2) {
+        /* MAV2 */
         ret = env->spr[SPR_BOOKE_TLB0PS + tlbn];
     } else {
         uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];
-- 
1.8.3.1

  reply	other threads:[~2017-08-07 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 15:50 [Qemu-devel] [PATCH for-2.11 0/4] ppc64: add e6500 KONRAD Frederic
2017-08-07 15:50 ` KONRAD Frederic [this message]
2017-08-07 15:50 ` [Qemu-devel] [PATCH for-2.11 2/4] booke206: fix tlbnps for fixed size TLB KONRAD Frederic
2017-08-07 15:50 ` [Qemu-devel] [PATCH for-2.11 3/4] booke206: allow to specify an mmucfg value at the init KONRAD Frederic
2017-08-07 15:50 ` [Qemu-devel] [PATCH for-2.11 4/4] ppc64: introduce e6500 KONRAD Frederic
2017-08-09  7:13 ` [Qemu-devel] [PATCH for-2.11 0/4] ppc64: add e6500 David Gibson
2017-08-11  9:14   ` Alexander Graf

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=1502121048-1816-2-git-send-email-frederic.konrad@adacore.com \
    --to=frederic.konrad@adacore.com \
    --cc=agraf@suse.de \
    --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).