qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xin Tong <xerox.time.tech@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] MMU Modes
Date: Sat, 7 Jan 2012 09:40:15 -0500	[thread overview]
Message-ID: <CALKntY1a_AmzCXAC820GPvvhkh1cLgb1Xh8w3p-CD9pOAyAy+w@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA8OSuk7SnUrbUeNjHJxcb9fZNh0gV4uueXrbanLS2ZJSg@mail.gmail.com>

I am investigating how LW is emulated from target-mips on x86 host.
However, i can not find where the OFFSET is passed in.

    case OPC_LW:
        save_cpu_state(ctx, 0);
        op_ld_lw(t0, t0, ctx);
        gen_store_gpr(t0, rt);
        opn = "lw";
        break;

       ||
       ||
      \||/

 static inline void op_ld_##insn(TCGv ret, TCGv arg1, DisasContext *ctx)   \
 {                                                                         \
     tcg_gen_qemu_##fname(ret, arg1, ctx->mem_idx);                        \
 }

I think ctx->mem_idx here contains the MMU modes.

       ||
       ||
      \||/

 static inline void tcg_gen_qemu_ld32u(TCGv ret, TCGv addr, int mem_index)
 {
  #if TARGET_LONG_BITS == 32
    tcg_gen_op3i_i32(INDEX_op_qemu_ld32, ret, addr, mem_index);
  #else
    tcg_gen_op4i_i32(INDEX_op_qemu_ld32, TCGV_LOW(ret), TCGV_LOW(addr),
                    TCGV_HIGH(addr), mem_index);
    tcg_gen_movi_i32(TCGV_HIGH(ret), 0);
  #endif
  }


       ||
       ||
      \||/


 case INDEX_op_qemu_ld32:
       tcg_out_qemu_ld(s, args, 2);
       break;


Thanks


Xin



On Fri, Jan 6, 2012 at 7:55 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 6 January 2012 12:45, Xin Tong <xerox.time.tech@gmail.com> wrote:
>> In qemu soft TLB, there is a MMU modes. what is it and what does it do
>> ? I see target-mips, NB_MMU_MODES is defined to be 3, unfortunately,
>> there is no comments on what each one of them means in the code.
>
> This distinguishes TLB entries for kernel mode from those for user mode
> and so on. Look in target-mips/cpu.h for the MMU_MODE[012]_SUFFIX
> definitions and the cpu_mmu_index() function, which should tell you what
> MIPS in particular uses them for.
>
> -- PMM

      reply	other threads:[~2012-01-07 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06 12:45 [Qemu-devel] MMU Modes Xin Tong
2012-01-06 12:55 ` Peter Maydell
2012-01-07 14:40   ` Xin Tong [this message]

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=CALKntY1a_AmzCXAC820GPvvhkh1cLgb1Xh8w3p-CD9pOAyAy+w@mail.gmail.com \
    --to=xerox.time.tech@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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 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).