qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Shashidhar Mysore" <shashimc@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] address translation
Date: Thu, 12 Jul 2007 17:29:05 -0700	[thread overview]
Message-ID: <12835c8f0707121729y29d1a678qf27d29b0ca572f08@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

Hello group,

I have two questions, both regarding the virtual-physical translation of
addresses (all in the virtual machine context).

1>
Can somebody tell me if the program counter value available in the following
snippet from target-i386/translate.c
is virtual or physical? I learnt it may be virtual, in which case is there a
way to extract the physical address corresponding to the
virtual address, or if it is physical, then is there a way to translate to
its virtual address (within the virtual machine context)?

************************************************
/* convert one instruction. s->is_jmp is set if the translation must
   be stopped. Return the next pc value */
static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
{
    int b, prefixes, aflag, dflag;
    int shift, ot;
    int modrm, reg, rm, mod, reg_addr, op, opreg, offset_addr, val;
    target_ulong next_eip, tval;
    int rex_w, rex_r;

    s->pc = pc_start;   // This s->pc is what I am using to extract all
executed PC values
************************************************


2>
Second question I have is - Within the functions from target-i386/ops_mem.h
for example,

void OPPROTO glue(glue(op_ldub, MEMSUFFIX), _T0_A0)(void)
{
    T0 = glue(ldub, MEMSUFFIX)(A0);
}

Is A0 the physical address? or is it virtual?
And how to I translate from one to another in either case?


Thanks in advance.
-Shashi.

[-- Attachment #2: Type: text/html, Size: 1673 bytes --]

             reply	other threads:[~2007-07-13  0:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13  0:29 Shashidhar Mysore [this message]
2007-07-13 19:59 ` [Qemu-devel] address translation andrzej zaborowski
2007-07-13 22:17   ` Shashidhar Mysore
2007-07-13 22:23     ` andrzej zaborowski
2007-07-17 20:43       ` Shashidhar Mysore

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=12835c8f0707121729y29d1a678qf27d29b0ca572f08@mail.gmail.com \
    --to=shashimc@gmail.com \
    --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).