[Top][All Lists]

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

Re: [Qemu-devel] address translation

From: andrzej zaborowski
Subject: Re: [Qemu-devel] address translation
Date: Fri, 13 Jul 2007 21:59:44 +0200

On 13/07/07, Shashidhar Mysore <address@hidden> wrote:
Hello group,

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

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)?

It is virtual, I think cpu_get_phys_page_debug() + the offset should
give you physical.

/* 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

This s->pc doesn't correspond to executed PC values, qemu is a translator.


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?

Also virtual.


reply via email to

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