aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-10-23 14:38:47 +0100
committerKeir Fraser <keir@xensource.com>2007-10-23 14:38:47 +0100
commit907e0a6046567e32113433fddea5b55c67961391 (patch)
treee9c1ff31b07abf40d243b76cdecf65b1b3b81f11 /tools
parenteab576f8d60b834e34f5fe9beed90d2cd09b9fd5 (diff)
downloadxen-907e0a6046567e32113433fddea5b55c67961391.tar.gz
xen-907e0a6046567e32113433fddea5b55c67961391.tar.bz2
xen-907e0a6046567e32113433fddea5b55c67961391.zip
hvm, vt-d: Add memory cache-attribute pinning domctl for HVM
guests. Use this to pin virtual framebuffer VRAM as attribute WB, even if guest tries to map with other attributes. Signed-off-by: Disheng Su <disheng.su@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/ioemu/hw/cirrus_vga.c6
-rw-r--r--tools/libxc/xc_domain.c15
-rw-r--r--tools/libxc/xenctrl.h6
3 files changed, 27 insertions, 0 deletions
diff --git a/tools/ioemu/hw/cirrus_vga.c b/tools/ioemu/hw/cirrus_vga.c
index 68ec0b392b..2fd1626362 100644
--- a/tools/ioemu/hw/cirrus_vga.c
+++ b/tools/ioemu/hw/cirrus_vga.c
@@ -2565,6 +2565,12 @@ static void *set_vram_mapping(unsigned long begin, unsigned long end)
return NULL;
}
+ (void)xc_domain_pin_memory_cacheattr(
+ xc_handle, domid,
+ begin >> TARGET_PAGE_BITS,
+ end >> TARGET_PAGE_BITS,
+ XEN_DOMCTL_MEM_CACHEATTR_WB);
+
vram_pointer = xc_map_foreign_pages(xc_handle, domid,
PROT_READ|PROT_WRITE,
extent_start, nr_extents);
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 3c3bb351f6..a67ec53947 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -376,6 +376,21 @@ int xc_domain_setmaxmem(int xc_handle,
return do_domctl(xc_handle, &domctl);
}
+int xc_domain_pin_memory_cacheattr(int xc_handle,
+ uint32_t domid,
+ unsigned long start,
+ unsigned long end,
+ unsigned int type)
+{
+ DECLARE_DOMCTL;
+ domctl.cmd = XEN_DOMCTL_pin_mem_cacheattr;
+ domctl.domain = (domid_t)domid;
+ domctl.u.pin_mem_cacheattr.start = start;
+ domctl.u.pin_mem_cacheattr.end = end;
+ domctl.u.pin_mem_cacheattr.type = type;
+ return do_domctl(xc_handle, &domctl);
+}
+
#if defined(__i386__) || defined(__x86_64__)
#include "xc_e820.h"
int xc_domain_set_memmap_limit(int xc_handle,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index bf08942787..5c7f5a649c 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -614,6 +614,12 @@ int xc_domain_iomem_permission(int xc_handle,
unsigned long nr_mfns,
uint8_t allow_access);
+int xc_domain_pin_memory_cacheattr(int xc_handle,
+ uint32_t domid,
+ unsigned long start,
+ unsigned long end,
+ unsigned int type);
+
unsigned long xc_make_page_below_4G(int xc_handle, uint32_t domid,
unsigned long mfn);