Il 03/03/2014 11:47, Alexey Kardashevskiy ha scritto:
> > Sorry, I am not following you here. Does KVM map things not page-aligned?
>
> Look in exec.c for xen_enabled().  Xen's implementation of
> address_space_map/unmap is completely different.

Honestly cannot see much difference in the current QEMU...

void *qemu_get_ram_ptr(ram_addr_t addr)
{
    RAMBlock *block = qemu_get_ram_block(addr);

    if (xen_enabled()) {
        /* We need to check if the requested address is in the RAM
         * because we don't want to map the entire memory in QEMU.
         * In that case just map until the end of the page.
         */
        if (block->offset == 0) {
            return xen_map_cache(addr, 0, 0);
        } else if (block->host == NULL) {
            block->host =
                xen_map_cache(block->offset, block->length, 1);
        }
    }
    return block->host + (addr - block->offset);
}

Paolo

Reply via email to