[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/33] target/ppc: introduce mmu-books.h
From: |
David Gibson |
Subject: |
[PULL 18/33] target/ppc: introduce mmu-books.h |
Date: |
Fri, 9 Jul 2021 15:17:13 +1000 |
From: "Bruno Larsen (billionai)" <bruno.larsen@eldorado.org.br>
Intrudoce a header common to all BookS MMUs, that can hold code that is
common to hash32 and book3s-v3 MMUs.
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
Message-Id: <20210706150316.21005-2-bruno.larsen@eldorado.org.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
target/ppc/mmu-book3s-v3.h | 14 +-------------
target/ppc/mmu-books.h | 30 ++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 13 deletions(-)
create mode 100644 target/ppc/mmu-books.h
diff --git a/target/ppc/mmu-book3s-v3.h b/target/ppc/mmu-book3s-v3.h
index c89d0bccfd..d6d5ed8f8e 100644
--- a/target/ppc/mmu-book3s-v3.h
+++ b/target/ppc/mmu-book3s-v3.h
@@ -21,6 +21,7 @@
#define PPC_MMU_BOOK3S_V3_H
#include "mmu-hash64.h"
+#include "mmu-books.h"
#ifndef CONFIG_USER_ONLY
@@ -47,19 +48,6 @@ struct prtb_entry {
uint64_t prtbe0, prtbe1;
};
-/*
- * These correspond to the mmu_idx values computed in
- * hreg_compute_hflags_value. See the tables therein
- *
- * They are here because some bits are inverted for BookE MMUs
- * not necessarily because they only work for BookS. However,
- * we only needed to change BookS MMUs, we left the functions
- * here to avoid other possible bugs for untested MMUs
- */
-static inline bool mmuidx_pr(int idx) { return !(idx & 1); }
-static inline bool mmuidx_real(int idx) { return idx & 2; }
-static inline bool mmuidx_hv(int idx) { return idx & 4; }
-
#ifdef TARGET_PPC64
static inline bool ppc64_use_proc_tbl(PowerPCCPU *cpu)
diff --git a/target/ppc/mmu-books.h b/target/ppc/mmu-books.h
new file mode 100644
index 0000000000..0d12551867
--- /dev/null
+++ b/target/ppc/mmu-books.h
@@ -0,0 +1,30 @@
+/*
+ * PowerPC BookS emulation generic mmu definitions for qemu.
+ *
+ * Copyright (c) 2021 Instituto de Pesquisas Eldorado (eldorado.org.br)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PPC_MMU_BOOKS_H
+#define PPC_MMU_BOOKS_H
+
+/*
+ * These correspond to the mmu_idx values computed in
+ * hreg_compute_hflags_value. See the tables therein
+ */
+static inline bool mmuidx_pr(int idx) { return !(idx & 1); }
+static inline bool mmuidx_real(int idx) { return idx & 2; }
+static inline bool mmuidx_hv(int idx) { return idx & 4; }
+#endif /* PPC_MMU_BOOKS_H */
--
2.31.1
- [PULL 04/33] target/ppc: Remove PowerPCCPUClass.handle_mmu_fault, (continued)
- [PULL 04/33] target/ppc: Remove PowerPCCPUClass.handle_mmu_fault, David Gibson, 2021/07/09
- [PULL 01/33] target/ppc: Introduce ppc_interrupts_little_endian(), David Gibson, 2021/07/09
- [PULL 05/33] target/ppc: Use MMUAccessType with *_handle_mmu_fault, David Gibson, 2021/07/09
- [PULL 03/33] spapr: tune rtas-size, David Gibson, 2021/07/09
- [PULL 07/33] target/ppc: Use bool success for ppc_radix64_xlate, David Gibson, 2021/07/09
- [PULL 06/33] target/ppc: Push real-mode handling into ppc_radix64_xlate, David Gibson, 2021/07/09
- [PULL 12/33] target/ppc: Restrict ppc_cpu_tlb_fill to TCG, David Gibson, 2021/07/09
- [PULL 14/33] target/ppc: Fix compilation with FLUSH_ALL_TLBS debug option, David Gibson, 2021/07/09
- [PULL 15/33] target/ppc: Fix compilation with DEBUG_BATS debug option, David Gibson, 2021/07/09
- [PULL 08/33] target/ppc: Split out ppc_hash64_xlate, David Gibson, 2021/07/09
- [PULL 18/33] target/ppc: introduce mmu-books.h,
David Gibson <=
- [PULL 17/33] target/ppc: changed ppc_hash64_xlate to use mmu_idx, David Gibson, 2021/07/09
- [PULL 09/33] target/ppc: Split out ppc_hash32_xlate, David Gibson, 2021/07/09
- [PULL 10/33] target/ppc: Split out ppc_jumbo_xlate, David Gibson, 2021/07/09
- [PULL 13/33] target/ppc: Fix compilation with DUMP_PAGE_TABLES debug option, David Gibson, 2021/07/09
- [PULL 11/33] target/ppc: Introduce ppc_xlate, David Gibson, 2021/07/09
- [PULL 21/33] docs/system: ppc: Update ppce500 documentation with eTSEC support, David Gibson, 2021/07/09
- [PULL 19/33] target/ppc: change ppc_hash32_xlate to use mmu_idx, David Gibson, 2021/07/09
- [PULL 23/33] target/ppc: mtmsrd is an illegal instruction on BookE, David Gibson, 2021/07/09
- [PULL 16/33] target/ppc: fix address translation bug for radix mmus, David Gibson, 2021/07/09
- [PULL 25/33] target/ppc: Allow virtual hypervisor on CPU without HV, David Gibson, 2021/07/09