Browse Source

xen: mapcache: Add function to check if the mapcache is enabled

Add function to check if the mapcache is enabled.
No functional change.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
master
Edgar E. Iglesias 8 months ago
parent
commit
ded5f9a909
  1. 6
      hw/xen/xen-mapcache.c
  2. 5
      hw/xen/xen_stubs.c
  3. 1
      include/system/xen-mapcache.h

6
hw/xen/xen-mapcache.c

@ -80,6 +80,12 @@ static MapCache *mapcache_grants_ro;
static MapCache *mapcache_grants_rw;
static xengnttab_handle *xen_region_gnttabdev;
bool xen_map_cache_enabled(void)
{
/* Map cache enabled implies xen_enabled(). */
return xen_enabled() && mapcache;
}
static inline void mapcache_lock(MapCache *mc)
{
qemu_mutex_lock(&mc->lock);

5
hw/xen/xen_stubs.c

@ -29,6 +29,11 @@ bool xen_mr_is_memory(MemoryRegion *mr)
g_assert_not_reached();
}
bool xen_map_cache_enabled(void)
{
return false;
}
void xen_invalidate_map_cache_entry(uint8_t *buffer)
{
g_assert_not_reached();

1
include/system/xen-mapcache.h

@ -13,6 +13,7 @@
typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr phys_offset,
ram_addr_t size);
bool xen_map_cache_enabled(void);
void xen_map_cache_init(phys_offset_to_gaddr_t f,
void *opaque);
uint8_t *xen_map_cache(MemoryRegion *mr, hwaddr phys_addr, hwaddr size,

Loading…
Cancel
Save