2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2015, The V3VEE Project <http://www.v3vee.org>
11 * All rights reserved.
13 * Author: Peter Dinda (pdinda@northwestern.edu)
15 * This is free software. You are permitted to use,
16 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
19 #ifndef __VMM_CACHE_INFO
20 #define __VMM_CACHE_INFO
22 #include <palacios/vmm_types.h>
25 typedef enum {V3_CACHE_CODE, V3_CACHE_DATA, V3_CACHE_COMBINED, V3_TLB_CODE, V3_TLB_DATA, V3_TLB_COMBINED} v3_cache_type_t;
27 struct v3_cache_info {
29 uint32_t level; // level
30 uint32_t size; // size in bytes (cache) or entries (tlb)
31 uint32_t blocksize; // block size in bytes (caches, ignore for tlbs)
32 uint32_t associativity; // n-way, etc. (for 4K pages in case of TLB)
33 // -1 for fully assoc, 0 for disabled/nonexistent
38 struct v3_cache_info_iface {
39 // level 1 => L1 ("closest"), level 2=> L2, etc.
40 // level 0xffffffff => last level shared cache
41 int (*get_cache_level)(v3_cache_type_t type, uint32_t level, struct v3_cache_info *info);
45 extern void V3_Init_Cache_Info(struct v3_cache_info_iface * palacios_cache_info);
49 int v3_get_cache_info(v3_cache_type_t type, uint32_t level, struct v3_cache_info *info);