qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Address translation - virt->phys->ram


From: Anthony Liguori
Subject: Re: [Qemu-devel] Address translation - virt->phys->ram
Date: Mon, 22 Feb 2010 08:35:49 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 02/22/2010 07:59 AM, Ian Molton wrote:
Hi folks,

I've been updating some old patches which make use of a function to
translate guest virtual addresses into pointers into the guest RAM.

As I understand it qemu has guest virtual and physical addresses, the
latter of which map somehow to host ram addresses.

The function which the code had been using appears not to work under
kvm, which leads me to think that qemu doesnt emulate the MMU (or at
least not in the same manner) when it is using kvm as opposed to pure
emulation.

If I turn off kvm, the patch works, albeit slowly. If I enable it, the
code takes the path which looks for the magic value (below).

Is there a 'proper' way to translate guest virtual addresses into host
RAM addresses?

cpu_physical_memory_map().

But this function has some subtle characteristics. It may return a bounce buffer if you attempt to map MMIO memory. There is a limited pool of bounce buffers available so it may return NULL in the event that it cannot allocate a bounce buffer.

It may also return a partial result if you're attempting to map a region that straddles multiple memory slots.

Regards,

Anthony Liguori




reply via email to

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