ia64/xen-unstable

diff xen/include/public/memory.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 4bdc3de246c3
children 2090917489c5
line diff
     1.1 --- a/xen/include/public/memory.h	Wed Aug 27 13:31:01 2008 +0100
     1.2 +++ b/xen/include/public/memory.h	Wed Aug 27 14:53:39 2008 +0100
     1.3 @@ -204,6 +204,7 @@ struct xen_add_to_physmap {
     1.4      /* Source mapping space. */
     1.5  #define XENMAPSPACE_shared_info 0 /* shared info page */
     1.6  #define XENMAPSPACE_grant_table 1 /* grant table page */
     1.7 +#define XENMAPSPACE_mfn         2 /* usual MFN */
     1.8      unsigned int space;
     1.9  
    1.10      /* Index into source mapping space. */
    1.11 @@ -216,6 +217,22 @@ typedef struct xen_add_to_physmap xen_ad
    1.12  DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
    1.13  
    1.14  /*
    1.15 + * Unmaps the page appearing at a particular GPFN from the specified guest's
    1.16 + * pseudophysical address space.
    1.17 + * arg == addr of xen_remove_from_physmap_t.
    1.18 + */
    1.19 +#define XENMEM_remove_from_physmap      15
    1.20 +struct xen_remove_from_physmap {
    1.21 +    /* Which domain to change the mapping for. */
    1.22 +    domid_t domid;
    1.23 +
    1.24 +    /* GPFN of the current mapping of the page. */
    1.25 +    xen_pfn_t     gpfn;
    1.26 +};
    1.27 +typedef struct xen_remove_from_physmap xen_remove_from_physmap_t;
    1.28 +DEFINE_XEN_GUEST_HANDLE(xen_remove_from_physmap_t);
    1.29 +
    1.30 +/*
    1.31   * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
    1.32   * code on failure. This call only works for auto-translated guests.
    1.33   */