All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ye Wen <wen@umail.ucsb.edu>
To: olivier cozette <olivier.cozette@u-picardie.fr>
Cc: qemu-devel@nongnu.org
Subject: Re:Another related question Re: [Qemu-devel] Question about softmmu
Date: Thu, 11 Nov 2004 00:21:40 -0800	[thread overview]
Message-ID: <1100161300.41932114cac38@webaccess.umail.ucsb.edu> (raw)
In-Reply-To: <1100096107.4192226b7613f@webmail.u-picardie.fr>

Hi, Olivier:

Actually I'm thinking of a special case:
1. A basic block is translated and the PC value patched in is
   the virtual address when it is translated. At this time,
   the address mapping is virtual page 0 -> physical page 0
2. Now the mapping changes. virtual page 1 -> physical page 0,
   which means the physical location of the block doesn't change
   but its virtual address changes.
3. Since page table changes, the virtual pc hash flushed. But we
   still can find the block using physical hash.
4. Now the block is executed again. But since the embedded pc value
   is still the old value, will this cause problem?

Sorry to bother you again. But I'm really confused.

Thanks,
Ye
Quoting olivier cozette <olivier.cozette@u-picardie.fr>:

>   Hello Ye,
>
>
> >So EIP is just the offset of current instruction.
>
> Yes
>
> >When address mapping changes,
> >the CS segment register also changes.
>
> No.
> The virtual adress is CS+EIP (CS.Base+EIP), this virtual address is
> translated
> to the physical address with the page mapping. In pseudo code, the real
> address
> is PAGE_MAPPING(CS+EIP). So, if the page mapping change the CS stay the same.
>
> >That's why QEMU does not need to flush
> >the code. Am I right?
>
>
> >The reason I'm thinking about this is because I'm implementing QEMU's
> >translation method in my ARM simulator which needs to simulate the whole
> system
> >running Linux. In ARM, since PC is just r15, you can access it as a normal
> >register and it is the absolute virtual address. So I wonder if I have to
> flush
> >code cache every time page table changes.
>
> I don't know well ARM processor, but i know Alpha, and it's different from
> the
> x86.
>
> With x86, the data stored in the data/code cache are stored with the physical
> address (page mapping is done between processor and cache), and so the cache
> don't need to be flushed when page mapping change (CR3 change).
>
> With alpha (and probably arm), the address stored in cache are the virtual
> address (page mapping is done between cache and memory).
>
> But, i presume this difference have no impact with Qemu cache, and it will be
> better to don't flush qemu cache.
>
>
>
>    Olivier
>
>
> Thanks,
> Ye
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>


--
Ye Wen
wen@umail.ucsb.edu

  reply	other threads:[~2004-11-11  8:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10 14:15 Re:Another related question Re: [Qemu-devel] Question about softmmu olivier cozette
2004-11-11  8:21 ` Ye Wen [this message]
2004-11-12 17:30   ` RE : Another " Olivier Cozette
  -- strict thread matches above, loose matches on Subject: below --
2004-11-10 14:15 olivier cozette
2004-11-09 16:01 Olivier Cozette
2004-11-09 19:33 ` Ye Wen

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=1100161300.41932114cac38@webaccess.umail.ucsb.edu \
    --to=wen@umail.ucsb.edu \
    --cc=olivier.cozette@u-picardie.fr \
    --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 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.