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
41 // KERN_EMERG "<0>" /* system is unusable */
42 // KERN_ALERT "<1>" /* action must be taken immediately */
43 // KERN_CRIT "<2>" /* critical conditions */
44 // KERN_ERR "<3>" /* error conditions */
45 // KERN_WARNING "<4>" /* warning conditions */
46 // KERN_NOTICE "<5>" /* normal but significant condition */
47 // KERN_INFO "<6>" /* informational */
48 // KERN_DEBUG "<7>" /* debug-level messages */
50 // All 'printk's should be changed to one of these macros, for easier control
51 #define ERROR(fmt, args...) printk((KERN_ERR "palacios: " fmt), ##args)
52 #define WARNING(fmt, args...) printk((KERN_WARNING "palacios: " fmt), ##args)
53 #define NOTICE(fmt, args...) printk((KERN_NOTICE "palacios: " fmt), ##args)
54 #define INFO(fmt, args...) printk((KERN_INFO "palacios: " fmt), ##args)
55 #define DEBUG(fmt, args...) printk((KERN_DEBUG "palacios: " fmt), ##args)
57 // Turn this on for unprefaced output
58 #define V3_PRINTK_OLD_STYLE_OUTPUT 0
59 // Maximum length output from printk
60 #define V3_PRINTK_BUF_SIZE 1024
63 unsigned long long size;
66 } __attribute__((packed));
68 struct v3_mem_region {
69 unsigned long long base_addr;
70 unsigned long long num_pages;
71 } __attribute__((packed));
76 } __attribute__((packed));
78 struct v3_core_move_cmd {
79 unsigned short vcore_id;
80 unsigned short pcore_id;
81 } __attribute__((packed));
83 struct v3_chkpt_info {
85 char url[256]; /* This might need to be bigger... */
86 } __attribute__((packed));
91 void * trace_malloc(size_t size, gfp_t flags);
92 void trace_free(const void * objp);
104 struct rb_root vm_ctrls;
105 struct list_head exts;
111 // For now MAX_VMS must be a multiple of 8
112 // This is due to the minor number bitmap
117 int palacios_vmm_init( void );
118 int palacios_vmm_exit( void );