Revision 868bb33f

b/Makefile.target
4 4
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
5 5
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
6 6
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
7
CONFIG_NO_XEN_MAPCACHE = $(if $(subst n,,$(CONFIG_XEN_MAPCACHE)),n,y)
8 7

  
9 8
include ../config-host.mak
10 9
include config-devices.mak
......
207 206
QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
208 207

  
209 208
# xen support
210
obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o
209
obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o xen-mapcache.o
211 210
obj-$(CONFIG_NO_XEN) += xen-stub.o
212
obj-i386-$(CONFIG_XEN_MAPCACHE) += xen-mapcache.o
213
obj-$(CONFIG_NO_XEN_MAPCACHE) += xen-mapcache-stub.o
214 211

  
215 212
obj-i386-$(CONFIG_XEN) += xen_platform.o
216 213

  
b/exec.c
2953 2953
                abort();
2954 2954
            }
2955 2955
#else
2956
            if (xen_mapcache_enabled()) {
2956
            if (xen_enabled()) {
2957 2957
                xen_ram_alloc(new_block->offset, size);
2958 2958
            } else {
2959 2959
                new_block->host = qemu_vmalloc(size);
......
3019 3019
#if defined(TARGET_S390X) && defined(CONFIG_KVM)
3020 3020
                munmap(block->host, block->length);
3021 3021
#else
3022
                if (xen_mapcache_enabled()) {
3022
                if (xen_enabled()) {
3023 3023
                    xen_invalidate_map_cache_entry(block->host);
3024 3024
                } else {
3025 3025
                    qemu_vfree(block->host);
......
3112 3112
                QLIST_REMOVE(block, next);
3113 3113
                QLIST_INSERT_HEAD(&ram_list.blocks, block, next);
3114 3114
            }
3115
            if (xen_mapcache_enabled()) {
3115
            if (xen_enabled()) {
3116 3116
                /* We need to check if the requested address is in the RAM
3117 3117
                 * because we don't want to map the entire memory in QEMU.
3118 3118
                 * In that case just map until the end of the page.
......
3143 3143

  
3144 3144
    QLIST_FOREACH(block, &ram_list.blocks, next) {
3145 3145
        if (addr - block->offset < block->length) {
3146
            if (xen_mapcache_enabled()) {
3146
            if (xen_enabled()) {
3147 3147
                /* We need to check if the requested address is in the RAM
3148 3148
                 * because we don't want to map the entire memory in QEMU.
3149 3149
                 * In that case just map until the end of the page.
......
3169 3169
 * but takes a size argument */
3170 3170
void *qemu_ram_ptr_length(target_phys_addr_t addr, target_phys_addr_t *size)
3171 3171
{
3172
    if (xen_mapcache_enabled())
3172
    if (xen_enabled()) {
3173 3173
        return xen_map_cache(addr, *size, 1);
3174
    else {
3174
    } else {
3175 3175
        RAMBlock *block;
3176 3176

  
3177 3177
        QLIST_FOREACH(block, &ram_list.blocks, next) {
......
3200 3200
    RAMBlock *block;
3201 3201
    uint8_t *host = ptr;
3202 3202

  
3203
    if (xen_mapcache_enabled()) {
3203
    if (xen_enabled()) {
3204 3204
        *ram_addr = xen_ram_addr_from_mapcache(ptr);
3205 3205
        return 0;
3206 3206
    }
......
4115 4115
                access_len -= l;
4116 4116
            }
4117 4117
        }
4118
        if (xen_mapcache_enabled()) {
4118
        if (xen_enabled()) {
4119 4119
            xen_invalidate_map_cache_entry(buffer);
4120 4120
        }
4121 4121
        return;
b/hw/xen.h
31 31
#endif
32 32
}
33 33

  
34
static inline int xen_mapcache_enabled(void)
35
{
36
#ifdef CONFIG_XEN_MAPCACHE
37
    return xen_enabled();
38
#else
39
    return 0;
40
#endif
41
}
42

  
43 34
int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
44 35
void xen_piix3_set_irq(void *opaque, int irq_num, int level);
45 36
void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
/dev/null
1
/*
2
 * Copyright (C) 2011       Citrix Ltd.
3
 *
4
 * This work is licensed under the terms of the GNU GPL, version 2.  See
5
 * the COPYING file in the top-level directory.
6
 *
7
 */
8

  
9
#include "config.h"
10

  
11
#include "cpu.h"
12
#include "qemu-common.h"
13
#include "cpu-common.h"
14
#include "xen-mapcache.h"
15

  
16
void xen_map_cache_init(void)
17
{
18
}
19

  
20
uint8_t *xen_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size,
21
                       uint8_t lock)
22
{
23
    return qemu_get_ram_ptr(phys_addr);
24
}
25

  
26
ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
27
{
28
    return -1;
29
}
30

  
31
void xen_invalidate_map_cache(void)
32
{
33
}
34

  
35
void xen_invalidate_map_cache_entry(uint8_t *buffer)
36
{
37
}

Also available in: Unified diff