qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-9.1 v2 1/2] target/mips: Pass page table entry size in by


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH-for-9.1 v2 1/2] target/mips: Pass page table entry size in bytes to get_pte()
Date: Tue, 13 Aug 2024 14:16:53 +0200
User-agent: Mozilla Thunderbird

On 13/8/24 13:02, Richard Henderson wrote:
On 8/13/24 20:18, Philippe Mathieu-Daudé wrote:
In order to simplify a bit, pass the PTE size in
bytes rather than bits.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  target/mips/tcg/sysemu/tlb_helper.c | 16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/mips/tcg/sysemu/tlb_helper.c b/target/mips/tcg/sysemu/tlb_helper.c
index 3ba6d369a6..a8caf3ade8 100644
--- a/target/mips/tcg/sysemu/tlb_helper.c
+++ b/target/mips/tcg/sysemu/tlb_helper.c
@@ -592,13 +592,13 @@ static void raise_mmu_exception(CPUMIPSState *env, target_ulong address,
   * resulting in a TLB or XTLB Refill exception.
   */
-static bool get_pte(CPUMIPSState *env, uint64_t vaddr, int entry_size,
+static bool get_pte(CPUMIPSState *env, uint64_t vaddr, unsigned entry_bytes,
          uint64_t *pte)
  {
-    if ((vaddr & ((entry_size >> 3) - 1)) != 0) {
+    if ((vaddr & (entry_bytes - 1)) != 0) {
          return false;
      }
-    if (entry_size == 64) {
+    if (entry_bytes == 8) {
          *pte = cpu_ldq_code(env, vaddr);
      } else {
          *pte = cpu_ldl_code(env, vaddr);

Considering the next patch, where you need to make the MemOpIdx,
why not pass in the size as MemOp?

Clever.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]