qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Glenn Miles <milesg@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: Glenn Miles <milesg@linux.ibm.com>,
	qemu-ppc@nongnu.org, clg@redhat.com, npiggin@gmail.com,
	harshpb@linux.ibm.com, thuth@redhat.com, rathc@linux.ibm.com,
	richard.henderson@linaro.org
Subject: [PATCH v6 5/9] target/ppc: Support for IBM PPE42 MMU
Date: Thu, 25 Sep 2025 15:17:43 -0500	[thread overview]
Message-ID: <20250925201758.652077-6-milesg@linux.ibm.com> (raw)
In-Reply-To: <20250925201758.652077-1-milesg@linux.ibm.com>

The IBM PPE42 processor only supports real mode
addressing and does not distinguish between
problem and supervisor states. It also uses
the IR and DR MSR bits for other purposes.
Therefore, add a check for PPE42 when we update
hflags and cause it to ignore the IR and DR bits
when calculating MMU indexes.

Signed-off-by: Glenn Miles <milesg@linux.ibm.com>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
---
 target/ppc/helper_regs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c
index 41b7b939ec..a07e6a7b7b 100644
--- a/target/ppc/helper_regs.c
+++ b/target/ppc/helper_regs.c
@@ -186,6 +186,10 @@ static uint32_t hreg_compute_hflags_value(CPUPPCState *env)
     if (env->spr[SPR_LPCR] & LPCR_HR) {
         hflags |= 1 << HFLAGS_HR;
     }
+    if (unlikely(ppc_flags & POWERPC_FLAG_PPE42)) {
+        /* PPE42 has a single address space and no problem state */
+        msr = 0;
+    }
 
 #ifndef CONFIG_USER_ONLY
     if (!env->has_hv_mode || (msr & (1ull << MSR_HV))) {
-- 
2.43.0



  parent reply	other threads:[~2025-09-25 20:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 20:17 [PATCH v6 0/9] Add IBM PPE42 CPU support Glenn Miles
2025-09-25 20:17 ` [PATCH v6 1/9] target/ppc: IBM PPE42 general regs and flags Glenn Miles
2025-09-25 20:17 ` [PATCH v6 2/9] target/ppc: Add IBM PPE42 family of processors Glenn Miles
2025-09-26 15:47   ` Chinmay Rath
2025-09-25 20:17 ` [PATCH v6 3/9] target/ppc: IBM PPE42 exception flags and regs Glenn Miles
2025-09-25 20:17 ` [PATCH v6 4/9] target/ppc: Add IBM PPE42 exception model Glenn Miles
2025-09-25 20:17 ` Glenn Miles [this message]
2025-09-25 20:17 ` [PATCH v6 6/9] target/ppc: Add IBM PPE42 special instructions Glenn Miles
2025-09-25 20:17 ` [PATCH v6 7/9] hw/ppc: Support for an IBM PPE42 CPU decrementer Glenn Miles
2025-09-28 17:51   ` Harsh Prateek Bora
2025-09-28 19:27     ` Richard Henderson
2025-09-28 19:33       ` Harsh Prateek Bora
2025-09-25 20:17 ` [PATCH v6 8/9] hw/ppc: Add a test machine for the IBM PPE42 CPU Glenn Miles
2025-09-25 20:17 ` [PATCH v6 9/9] tests/functional: Add test for IBM PPE42 instructions Glenn Miles

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=20250925201758.652077-6-milesg@linux.ibm.com \
    --to=milesg@linux.ibm.com \
    --cc=clg@redhat.com \
    --cc=harshpb@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rathc@linux.ibm.com \
    --cc=richard.henderson@linaro.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).