All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bruno Larsen (billionai)" <bruno.larsen@eldorado.org.br>
To: qemu-devel@nongnu.org
Cc: farosas@linux.ibm.com, richard.henderson@linaro.org,
	luis.pires@eldorado.org.br, lucas.araujo@eldorado.org.br,
	fernando.valle@eldorado.org.br, qemu-ppc@nongnu.org,
	"Bruno Larsen \(billionai\)" <bruno.larsen@eldorado.org.br>,
	matheus.ferst@eldorado.org.br, david@gibson.dropbear.id.au
Subject: [PATCH 02/11] target/ppc: moved ppc_store_sdr1 to cpu.c
Date: Wed, 12 May 2021 11:08:04 -0300	[thread overview]
Message-ID: <20210512140813.112884-3-bruno.larsen@eldorado.org.br> (raw)
In-Reply-To: <20210512140813.112884-1-bruno.larsen@eldorado.org.br>

Moved this function that is required in !TCG cases into a
common code file

Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
---
 target/ppc/cpu.c        | 29 +++++++++++++++++++++++++++++
 target/ppc/mmu_helper.c | 26 --------------------------
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c
index cb794e9f4f..0ab7ac1af1 100644
--- a/target/ppc/cpu.c
+++ b/target/ppc/cpu.c
@@ -20,7 +20,10 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "cpu-models.h"
+#include "cpu-qom.h"
+#include "exec/log.h"
 #include "fpu/softfloat-helpers.h"
+#include "mmu-hash64.h"
 
 target_ulong cpu_read_xer(CPUPPCState *env)
 {
@@ -61,3 +64,29 @@ uint32_t ppc_get_vscr(CPUPPCState *env)
     uint32_t sat = (env->vscr_sat.u64[0] | env->vscr_sat.u64[1]) != 0;
     return env->vscr | (sat << VSCR_SAT);
 }
+
+void ppc_store_sdr1(CPUPPCState *env, target_ulong value)
+{
+    PowerPCCPU *cpu = env_archcpu(env);
+    qemu_log_mask(CPU_LOG_MMU, "%s: " TARGET_FMT_lx "\n", __func__, value);
+    assert(!cpu->vhyp);
+#if defined(TARGET_PPC64)
+    if (mmu_is_64bit(env->mmu_model)) {
+        target_ulong sdr_mask = SDR_64_HTABORG | SDR_64_HTABSIZE;
+        target_ulong htabsize = value & SDR_64_HTABSIZE;
+
+        if (value & ~sdr_mask) {
+            error_report("Invalid bits 0x"TARGET_FMT_lx" set in SDR1",
+                         value & ~sdr_mask);
+            value &= sdr_mask;
+        }
+        if (htabsize > 28) {
+            error_report("Invalid HTABSIZE 0x" TARGET_FMT_lx" stored in SDR1",
+                         htabsize);
+            return;
+        }
+    }
+#endif /* defined(TARGET_PPC64) */
+    /* FIXME: Should check for valid HTABMASK values in 32-bit case */
+    env->spr[SPR_SDR1] = value;
+}
diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index ca88658cba..06e1ebdcbc 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -2085,32 +2085,6 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr)
 
 /*****************************************************************************/
 /* Special registers manipulation */
-void ppc_store_sdr1(CPUPPCState *env, target_ulong value)
-{
-    PowerPCCPU *cpu = env_archcpu(env);
-    qemu_log_mask(CPU_LOG_MMU, "%s: " TARGET_FMT_lx "\n", __func__, value);
-    assert(!cpu->vhyp);
-#if defined(TARGET_PPC64)
-    if (mmu_is_64bit(env->mmu_model)) {
-        target_ulong sdr_mask = SDR_64_HTABORG | SDR_64_HTABSIZE;
-        target_ulong htabsize = value & SDR_64_HTABSIZE;
-
-        if (value & ~sdr_mask) {
-            error_report("Invalid bits 0x"TARGET_FMT_lx" set in SDR1",
-                         value & ~sdr_mask);
-            value &= sdr_mask;
-        }
-        if (htabsize > 28) {
-            error_report("Invalid HTABSIZE 0x" TARGET_FMT_lx" stored in SDR1",
-                         htabsize);
-            return;
-        }
-    }
-#endif /* defined(TARGET_PPC64) */
-    /* FIXME: Should check for valid HTABMASK values in 32-bit case */
-    env->spr[SPR_SDR1] = value;
-}
-
 #if defined(TARGET_PPC64)
 void ppc_store_ptcr(CPUPPCState *env, target_ulong value)
 {
-- 
2.17.1



  parent reply	other threads:[~2021-05-12 14:17 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 14:08 [RFC PATCH 00/11] target/ppc: add support to disable-tcg Bruno Larsen (billionai)
2021-05-12 14:08 ` [PATCH 01/11] target/ppc: created ppc_{store, get}_vscr for generic vscr usage Bruno Larsen (billionai)
2021-05-12 16:48   ` [PATCH 01/11] target/ppc: created ppc_{store,get}_vscr " Richard Henderson
2021-05-13  3:48   ` David Gibson
2021-05-12 14:08 ` Bruno Larsen (billionai) [this message]
2021-05-12 16:54   ` [PATCH 02/11] target/ppc: moved ppc_store_sdr1 to cpu.c Richard Henderson
2021-05-13  3:50   ` David Gibson
2021-05-31 18:17     ` Bruno Piazera Larsen
2021-06-07  3:50       ` David Gibson
2021-05-12 14:08 ` [PATCH 03/11] target/ppc: moved ppc_cpu_dump_state to cpu_init.c Bruno Larsen (billionai)
2021-05-12 16:58   ` Richard Henderson
2021-05-12 17:00     ` Richard Henderson
2021-05-13  3:51   ` David Gibson
2021-05-12 14:08 ` [PATCH 04/11] target/ppc: moved ppc_store_msr into gdbstub.c Bruno Larsen (billionai)
2021-05-12 17:05   ` Richard Henderson
2021-05-13  3:52     ` David Gibson
2021-05-12 14:08 ` [PATCH 05/11] target/ppc: moved ppc_store_lpcr to cpu.c Bruno Larsen (billionai)
2021-05-12 17:07   ` Richard Henderson
2021-05-13  3:53   ` David Gibson
2021-05-12 14:08 ` [PATCH 06/11] target/ppc: updated vscr manipulation in machine.c Bruno Larsen (billionai)
2021-05-12 17:08   ` Richard Henderson
2021-05-13  3:54     ` David Gibson
2021-05-12 14:08 ` [PATCH 07/11] target/ppc: added KVM fallback to fpscr manipulation Bruno Larsen (billionai)
2021-05-12 18:20   ` Richard Henderson
2021-05-12 19:15     ` Bruno Piazera Larsen
2021-05-13 16:36     ` Bruno Piazera Larsen
2021-05-13 22:45       ` Richard Henderson
2021-05-14 11:12         ` Bruno Piazera Larsen
2021-05-12 14:08 ` [RFC PATCH 08/11] target/ppc: wrapped some TCG only logic with ifdefs Bruno Larsen (billionai)
2021-05-12 18:33   ` Richard Henderson
2021-05-12 18:57     ` Bruno Piazera Larsen
2021-05-14 13:29       ` Bruno Piazera Larsen
2021-05-14 14:44         ` Richard Henderson
2021-05-14 16:22           ` Bruno Piazera Larsen
2021-05-17  4:10             ` David Gibson
2021-05-17 16:07               ` Richard Henderson
2021-05-17  4:00           ` David Gibson
2021-05-24 18:01     ` Bruno Piazera Larsen
2021-05-24 20:03       ` Richard Henderson
2021-05-12 14:08 ` [PATCH 09/11] include/exec: added functions to the stubs in exec-all.h Bruno Larsen (billionai)
2021-05-12 18:34   ` Richard Henderson
2021-05-13 14:03     ` Lucas Mateus Martins Araujo e Castro
2021-05-13 23:44       ` Richard Henderson
2021-05-17  3:58         ` David Gibson
2021-05-17 16:59           ` Lucas Mateus Martins Araujo e Castro
2021-05-17 18:02             ` Richard Henderson
2021-05-18 18:45               ` Bruno Piazera Larsen
2021-05-24  3:18             ` David Gibson
2021-05-17  3:55       ` David Gibson
2021-05-17 11:07         ` Bruno Piazera Larsen
2021-05-24  3:15           ` David Gibson
2021-05-12 14:08 ` [RFC PATCH 10/11] target/ppc: created tcg-stub.c file Bruno Larsen (billionai)
2021-05-12 18:39   ` Richard Henderson
2021-05-12 19:09     ` Bruno Piazera Larsen
2021-05-14 18:07     ` Bruno Piazera Larsen
2021-05-13  3:59   ` David Gibson
2021-05-13 12:56     ` Bruno Piazera Larsen
2021-05-17  3:53       ` David Gibson
2021-05-12 14:08 ` [PATCH 11/11] target/ppc: updated meson.build to support disable-tcg Bruno Larsen (billionai)

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=20210512140813.112884-3-bruno.larsen@eldorado.org.br \
    --to=bruno.larsen@eldorado.org.br \
    --cc=david@gibson.dropbear.id.au \
    --cc=farosas@linux.ibm.com \
    --cc=fernando.valle@eldorado.org.br \
    --cc=lucas.araujo@eldorado.org.br \
    --cc=luis.pires@eldorado.org.br \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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.