From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I991y-0006Om-4z for qemu-devel@nongnu.org; Thu, 12 Jul 2007 20:29:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I991v-0006NJ-CW for qemu-devel@nongnu.org; Thu, 12 Jul 2007 20:29:08 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I991v-0006NC-9y for qemu-devel@nongnu.org; Thu, 12 Jul 2007 20:29:07 -0400 Received: from wx-out-0506.google.com ([66.249.82.230]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I991u-0005hy-Qh for qemu-devel@nongnu.org; Thu, 12 Jul 2007 20:29:07 -0400 Received: by wx-out-0506.google.com with SMTP id h31so331473wxd for ; Thu, 12 Jul 2007 17:29:05 -0700 (PDT) Message-ID: <12835c8f0707121729y29d1a678qf27d29b0ca572f08@mail.gmail.com> Date: Thu, 12 Jul 2007 17:29:05 -0700 From: "Shashidhar Mysore" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_31564_8329516.1184286545296" Subject: [Qemu-devel] address translation Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_31564_8329516.1184286545296 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. ------=_Part_31564_8329516.1184286545296 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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.
------=_Part_31564_8329516.1184286545296--