4 #include <linux/cdev.h>
5 #include <linux/list.h>
6 #include <linux/sched.h>
7 #include <linux/slab.h>
10 /* Global Control IOCTLs */
11 #define V3_CREATE_GUEST 12
12 #define V3_FREE_GUEST 13
14 #define V3_ADD_MEMORY 50
16 /* VM Specific IOCTLs */
17 #define V3_VM_CONSOLE_CONNECT 20
18 #define V3_VM_STREAM_CONNECT 21
20 #define V3_VM_PAUSE 23
21 #define V3_VM_CONTINUE 24
23 #define V3_VM_LAUNCH 25
27 #define V3_VM_SIMULATE 29
29 #define V3_VM_INSPECT 30
30 #define V3_VM_DEBUG 31
32 #define V3_VM_MOVE_CORE 33
34 #define V3_VM_FB_INPUT 257
35 #define V3_VM_FB_QUERY 258
37 #define V3_VM_HOST_DEV_CONNECT 10245
39 #define V3_VM_KSTREAM_USER_CONNECT 11245
43 unsigned long long size;
46 } __attribute__((packed));
48 struct v3_mem_region {
49 unsigned long long base_addr;
50 unsigned long long num_pages;
51 } __attribute__((packed));
56 } __attribute__((packed));
58 struct v3_core_move_cmd {
59 unsigned short vcore_id;
60 unsigned short pcore_id;
61 } __attribute__((packed));
63 struct v3_chkpt_info {
65 char url[256]; /* This might need to be bigger... */
66 } __attribute__((packed));
71 void * trace_malloc(size_t size, gfp_t flags);
72 void trace_free(const void * objp);
84 struct rb_root vm_ctrls;
85 struct list_head exts;
91 // For now MAX_VMS must be a multiple of 8
92 // This is due to the minor number bitmap
97 int palacios_vmm_init( void );
98 int palacios_vmm_exit( void );
101 // Exported stubs, for use in other palacios components, like vnet
102 void palacios_print(const char *fmt, ...);
103 unsigned int palacios_get_cpu(void);
107 // Palacios Printing Support
109 // These macros affect how palacios_print will generate output
110 // Turn this on for unprefaced output from palacios_print
111 #define V3_PRINTK_OLD_STYLE_OUTPUT 0
112 // Maximum length output from palacios_print
113 #define V3_PRINTK_BUF_SIZE 1024
114 // Turn this on to check if new-style output for palacios_print contains only 7-bit chars
115 #define V3_PRINTK_CHECK_7BIT 1
118 // The following macros are for printing in the linux module itself, even before
119 // Palacios is initialized and after it it deinitialized
120 // All printk's in linux_module use these macros, for easier control
121 #define ERROR(fmt, args...) printk((KERN_ERR "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
122 #define WARNING(fmt, args...) printk((KERN_WARNING "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
123 #define NOTICE(fmt, args...) printk((KERN_NOTICE "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
124 #define INFO(fmt, args...) printk((KERN_INFO "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
125 #define DEBUG(fmt, args...) printk((KERN_DEBUG "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)