From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, richard.henderson@linaro.org,
frederic.konrad@adacore.com, alistair@alistair23.me,
frasse.iglesias@gmail.com, sai.pavan.boddu@xilinx.com,
edgar.iglesias@xilinx.com
Subject: [Qemu-devel] [PATCH v2 26/36] target-microblaze: mmu: Prepare for 64-bit addresses
Date: Tue, 8 May 2018 19:31:42 +0200 [thread overview]
Message-ID: <20180508173152.29327-27-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <20180508173152.29327-1-edgar.iglesias@gmail.com>
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
Prepare for 64-bit addresses.
This makes no functional difference as the upper parts of
the 64-bit addresses are not yet reachable.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
target/microblaze/mmu.c | 14 +++++++-------
target/microblaze/mmu.h | 6 +++---
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/target/microblaze/mmu.c b/target/microblaze/mmu.c
index 231803ceea..a379968618 100644
--- a/target/microblaze/mmu.c
+++ b/target/microblaze/mmu.c
@@ -81,16 +81,16 @@ unsigned int mmu_translate(struct microblaze_mmu *mmu,
{
unsigned int i, hit = 0;
unsigned int tlb_ex = 0, tlb_wr = 0, tlb_zsel;
- unsigned int tlb_size;
- uint32_t tlb_tag, tlb_rpn, mask, t0;
+ uint64_t tlb_tag, tlb_rpn, mask;
+ uint32_t tlb_size, t0;
lu->err = ERR_MISS;
for (i = 0; i < ARRAY_SIZE(mmu->rams[RAM_TAG]); i++) {
- uint32_t t, d;
+ uint64_t t, d;
/* Lookup and decode. */
t = mmu->rams[RAM_TAG][i];
- D(qemu_log("TLB %d valid=%d\n", i, t & TLB_VALID));
+ D(qemu_log("TLB %d valid=%" PRId64 "\n", i, t & TLB_VALID));
if (t & TLB_VALID) {
tlb_size = tlb_decode_size((t & TLB_PAGESZ_MASK) >> 7);
if (tlb_size < TARGET_PAGE_SIZE) {
@@ -98,10 +98,10 @@ unsigned int mmu_translate(struct microblaze_mmu *mmu,
abort();
}
- mask = ~(tlb_size - 1);
+ mask = ~((uint64_t)tlb_size - 1);
tlb_tag = t & TLB_EPN_MASK;
if ((vaddr & mask) != (tlb_tag & mask)) {
- D(qemu_log("TLB %d vaddr=%x != tag=%x\n",
+ D(qemu_log("TLB %d vaddr=%" PRIx64 " != tag=%" PRIx64 "\n",
i, vaddr & mask, tlb_tag & mask));
continue;
}
@@ -173,7 +173,7 @@ unsigned int mmu_translate(struct microblaze_mmu *mmu,
}
}
done:
- D(qemu_log("MMU vaddr=%x rw=%d tlb_wr=%d tlb_ex=%d hit=%d\n",
+ D(qemu_log("MMU vaddr=%" PRIx64 " rw=%d tlb_wr=%d tlb_ex=%d hit=%d\n",
vaddr, rw, tlb_wr, tlb_ex, hit));
return hit;
}
diff --git a/target/microblaze/mmu.h b/target/microblaze/mmu.h
index 624becfded..1714caf82e 100644
--- a/target/microblaze/mmu.h
+++ b/target/microblaze/mmu.h
@@ -28,7 +28,7 @@
#define RAM_TAG 0
/* Tag portion */
-#define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */
+#define TLB_EPN_MASK MAKE_64BIT_MASK(10, 64 - 10)
#define TLB_PAGESZ_MASK 0x00000380
#define TLB_PAGESZ(x) (((x) & 0x7) << 7)
#define PAGESZ_1K 0
@@ -42,7 +42,7 @@
#define TLB_VALID 0x00000040 /* Entry is valid */
/* Data portion */
-#define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */
+#define TLB_RPN_MASK MAKE_64BIT_MASK(10, 64 - 10)
#define TLB_PERM_MASK 0x00000300
#define TLB_EX 0x00000200 /* Instruction execution allowed */
#define TLB_WR 0x00000100 /* Writes permitted */
@@ -63,7 +63,7 @@
struct microblaze_mmu
{
/* Data and tag brams. */
- uint32_t rams[2][TLB_ENTRIES];
+ uint64_t rams[2][TLB_ENTRIES];
/* We keep a separate ram for the tids to avoid the 48 bit tag width. */
uint8_t tids[TLB_ENTRIES];
/* Control flops. */
--
2.14.1
next prev parent reply other threads:[~2018-05-08 17:32 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 17:31 [Qemu-devel] [PATCH v2 00/36] target-microblaze: Add support for Extended Addressing Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 01/36] target-microblaze: dec_load: Use bool instead of unsigned int Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 02/36] target-microblaze: dec_store: " Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 03/36] target-microblaze: compute_ldst_addr: Use bool instead of int Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 04/36] target-microblaze: Fallback to our latest CPU version Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 05/36] target-microblaze: Correct special register array sizes Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 06/36] target-microblaze: Correct the PVR array size Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 07/36] target-microblaze: Tighten up TCGv_i32 vs TCGv type usage Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 08/36] target-microblaze: Remove USE_MMU PVR checks Edgar E. Iglesias
2018-05-09 20:48 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 09/36] target-microblaze: Conditionalize setting of PVR11_USE_MMU Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 10/36] target-microblaze: Bypass MMU with MMU_NOMMU_IDX Edgar E. Iglesias
2018-05-09 20:51 ` Richard Henderson
2018-05-15 21:45 ` Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 11/36] target-microblaze: Make compute_ldst_addr always use a temp Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 12/36] target-microblaze: Remove pointer indirection for ld/st addresses Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 13/36] target-microblaze: Use TCGv for load/store addresses Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 14/36] target-microblaze: Name special registers we support Edgar E. Iglesias
2018-05-09 20:57 ` Alistair Francis
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 15/36] target-microblaze: Break out trap_userspace() Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 16/36] target-microblaze: Break out trap_illegal() Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 17/36] target-microblaze: dec_msr: Use bool and extract32 Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 18/36] target-microblaze: dec_msr: Reuse more code when reg-decoding Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 19/36] target-microblaze: dec_msr: Fix MTS to FSR Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 20/36] target-microblaze: Make special registers 64-bit Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 21/36] target-microblaze: Setup for 64bit addressing Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 23/36] target-microblaze: Implement MFSE EAR Edgar E. Iglesias
2018-05-09 21:04 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 24/36] target-microblaze: mmu: Add R_TBLX_MISS macros Edgar E. Iglesias
2018-05-09 21:09 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 25/36] target-microblaze: mmu: Remove unused register state Edgar E. Iglesias
2018-05-09 21:10 ` Richard Henderson
2018-05-08 17:31 ` Edgar E. Iglesias [this message]
2018-05-09 21:11 ` [Qemu-devel] [PATCH v2 26/36] target-microblaze: mmu: Prepare for 64-bit addresses Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 27/36] target-microblaze: mmu: Add a configurable output address mask Edgar E. Iglesias
2018-05-09 21:12 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 28/36] target-microblaze: Add support for extended access to TLBLO Edgar E. Iglesias
2018-05-09 21:15 ` Richard Henderson
2018-05-15 22:23 ` Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 29/36] target-microblaze: Allow address sizes between 32 and 64 bits Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 30/36] target-microblaze: Simplify address computation using tcg_gen_addi_i32() Edgar E. Iglesias
2018-05-09 21:16 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 31/36] target-microblaze: mmu: Cleanup debug log messages Edgar E. Iglesias
2018-05-09 21:16 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 32/36] target-microblaze: Use table based condition-codes conversion Edgar E. Iglesias
2018-05-09 21:18 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 33/36] target-microblaze: Remove argument b in eval_cc() Edgar E. Iglesias
2018-05-09 21:18 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 34/36] target-microblaze: Convert env_btaken to i64 Edgar E. Iglesias
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 35/36] target-microblaze: Convert env_btarget " Edgar E. Iglesias
2018-05-09 21:20 ` Richard Henderson
2018-05-08 17:31 ` [Qemu-devel] [PATCH v2 36/36] target-microblaze: Use tcg_gen_movcond in eval_cond_jmp Edgar E. Iglesias
2018-05-09 21:21 ` Richard Henderson
2018-05-16 18:49 ` Edgar E. Iglesias
[not found] ` <20180508173152.29327-23-edgar.iglesias@gmail.com>
2018-05-09 21:09 ` [Qemu-devel] [PATCH v2 22/36] target-microblaze: Add Extended Addressing Richard Henderson
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=20180508173152.29327-27-edgar.iglesias@gmail.com \
--to=edgar.iglesias@gmail.com \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@xilinx.com \
--cc=frasse.iglesias@gmail.com \
--cc=frederic.konrad@adacore.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sai.pavan.boddu@xilinx.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).