Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cache information interface and implementation for AMD and Intel on Linux
[palacios.git] / palacios / include / interfaces / vmm_cache_info.h
1 /*
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.
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2015, The V3VEE Project <http://www.v3vee.org>
11  * All rights reserved.
12  *
13  * Author: Peter Dinda (pdinda@northwestern.edu)
14  *
15  * This is free software.  You are permitted to use,
16  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
17  */
18
19 #ifndef __VMM_CACHE_INFO
20 #define __VMM_CACHE_INFO
21
22 #include <palacios/vmm_types.h>
23
24
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;
26
27 struct v3_cache_info {
28     v3_cache_type_t type;
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
34                             
35 };
36     
37
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);
42 };
43
44
45 extern void V3_Init_Cache_Info(struct v3_cache_info_iface * palacios_cache_info);
46
47 #ifdef __V3VEE__
48
49 int v3_get_cache_info(v3_cache_type_t type, uint32_t level, struct v3_cache_info *info);
50
51 #endif
52
53 #endif