@@ -4,7 +4,6 @@ GENERATED_HEADERS = config-target.h
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
-CONFIG_NO_XEN_MAPCACHE = $(if $(subst n,,$(CONFIG_XEN_MAPCACHE)),n,y)
include ../config-host.mak
include config-devices.mak
@@ -206,10 +205,8 @@ QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
# xen support
-obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o
+obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o xen-mapcache.o
obj-$(CONFIG_NO_XEN) += xen-stub.o
-obj-i386-$(CONFIG_XEN_MAPCACHE) += xen-mapcache.o
-obj-$(CONFIG_NO_XEN_MAPCACHE) += xen-mapcache-stub.o
# Inter-VM PCI shared memory
CONFIG_IVSHMEM =
@@ -3329,9 +3329,6 @@ case "$target_arch2" in
if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
target_phys_bits=64
echo "CONFIG_XEN=y" >> $config_target_mak
- if test "$cpu" = "i386" -o "$cpu" = "x86_64"; then
- echo "CONFIG_XEN_MAPCACHE=y" >> $config_target_mak
- fi
fi
esac
case "$target_arch2" in
@@ -2923,7 +2923,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name,
abort();
}
#else
- if (xen_mapcache_enabled()) {
+ if (xen_enabled()) {
xen_ram_alloc(new_block->offset, size);
} else {
new_block->host = qemu_vmalloc(size);
@@ -2989,7 +2989,7 @@ void qemu_ram_free(ram_addr_t addr)
#if defined(TARGET_S390X) && defined(CONFIG_KVM)
munmap(block->host, block->length);
#else
- if (xen_mapcache_enabled()) {
+ if (xen_enabled()) {
xen_invalidate_map_cache_entry(block->host);
} else {
qemu_vfree(block->host);
@@ -3082,7 +3082,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr)
QLIST_REMOVE(block, next);
QLIST_INSERT_HEAD(&ram_list.blocks, block, next);
}
- if (xen_mapcache_enabled()) {
+ 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.
*/
@@ -3111,7 +3111,7 @@ void *qemu_safe_ram_ptr(ram_addr_t addr)
QLIST_FOREACH(block, &ram_list.blocks, next) {
if (addr - block->offset < block->length) {
- if (xen_mapcache_enabled()) {
+ 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.
*/
@@ -3135,7 +3135,7 @@ void qemu_put_ram_ptr(void *addr)
{
trace_qemu_put_ram_ptr(addr);
- if (xen_mapcache_enabled()) {
+ if (xen_enabled()) {
RAMBlock *block;
QLIST_FOREACH(block, &ram_list.blocks, next) {
@@ -3168,7 +3168,7 @@ int qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr)
}
}
- if (xen_mapcache_enabled()) {
+ if (xen_enabled()) {
*ram_addr = xen_ram_addr_from_mapcache(ptr);
return 0;
}
@@ -4080,7 +4080,7 @@ void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len,
access_len -= l;
}
}
- if (xen_mapcache_enabled()) {
+ if (xen_enabled()) {
uint8_t *buffer1 = buffer;
uint8_t *end_buffer = buffer + len;
@@ -31,15 +31,6 @@ static inline int xen_enabled(void)
#endif
}
-static inline int xen_mapcache_enabled(void)
-{
-#ifdef CONFIG_XEN_MAPCACHE
- return xen_enabled();
-#else
- return 0;
-#endif
-}
-
int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
void xen_piix3_set_irq(void *opaque, int irq_num, int level);
void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
deleted file mode 100644
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 Citrix Ltd.
- *
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
- *
- */
-
-#include "config.h"
-
-#include "exec-all.h"
-#include "qemu-common.h"
-#include "cpu-common.h"
-#include "xen-mapcache.h"
-
-void xen_map_cache_init(void)
-{
-}
-
-uint8_t *xen_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size,
- uint8_t lock)
-{
- return qemu_get_ram_ptr(phys_addr);
-}
-
-void xen_map_cache_unlock(void *buffer)
-{
-}
-
-ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
-{
- return -1;
-}
-
-void xen_invalidate_map_cache(void)
-{
-}
-
-void xen_invalidate_map_cache_entry(uint8_t *buffer)
-{
-}
-uint8_t *xen_map_block(target_phys_addr_t phys_addr, target_phys_addr_t size)
-{
- return NULL;
-}
-
-void xen_unmap_block(void *addr, ram_addr_t size)
-{
-}
@@ -8,6 +8,7 @@
#include "qemu-common.h"
#include "hw/xen.h"
+#include "xen-mapcache.h"
int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num)
{
@@ -39,3 +40,31 @@ int xen_init(void)
{
return -ENOSYS;
}
+
+uint8_t *xen_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size,
+ uint8_t lock)
+{
+ return NULL;
+}
+
+void xen_map_cache_unlock(void *buffer)
+{
+}
+
+ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
+{
+ return -1;
+}
+
+void xen_invalidate_map_cache_entry(uint8_t *buffer)
+{
+}
+
+uint8_t *xen_map_block(target_phys_addr_t phys_addr, target_phys_addr_t size)
+{
+ return NULL;
+}
+
+void xen_unmap_block(void *addr, ram_addr_t size)
+{
+}