diff tools/ioemu/hw/vga_int.h @ 18394:dade7f0bdc8d

hvm: Use main memory for video memory.

When creating an HVM domain, if e.g. another domain is created before
qemu allocates video memory, the extra 8MB memory ballooning is not
available any more, because it got consumed by the other domain.

This fixes it by taking video memory from the main memory:

- make hvmloader use e820_malloc to reserve some of the main memory
and notify ioemu of its address through the Xen platform PCI card.
- add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow
ioemu to move the MFNs between the original position and the PCI
mapping, when LFB acceleration is disabled/enabled
- add a remove_from_physmap memory op, to allow ioemu to unmap it
completely for the case of old guests with acceleration disabled.
- add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to
get the MFNs of the video memory.
- have xend save the PCI memory space instead of ioemu: if a memory
page is there, the guest can access it like usual memory, so xend
can safely be responsible to save it. The extra benefit is that
live migration will apply the logdirty optimization there too.
- handle old saved images, populating the video memory from ioemu if
really needed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Aug 27 14:53:39 2008 +0100 (2008-08-27)
parents adf05a812edb
line diff
     1.1 --- a/tools/ioemu/hw/vga_int.h	Wed Aug 27 13:31:01 2008 +0100
     1.2 +++ b/tools/ioemu/hw/vga_int.h	Wed Aug 27 14:53:39 2008 +0100
     1.3 @@ -80,9 +80,9 @@
     1.4  #define VGA_MAX_HEIGHT 2048
     1.6  #define VGA_STATE_COMMON                                                \
     1.7 -    uint8_t *vram_alloc;                                                \
     1.8      uint8_t *vram_ptr;                                                  \
     1.9 -    uint8_t *vram_shadow;                                               \
    1.10 +    xen_pfn_t *vram_mfns;                                               \
    1.11 +    uint64_t stolen_vram_addr; /* Address of stolen RAM */              \
    1.12      unsigned long vram_offset;                                          \
    1.13      unsigned int vram_size;                                             \
    1.14      unsigned long bios_offset;                                          \