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.


symbiotic module updates
Jack Lange [Fri, 12 Mar 2010 01:08:49 +0000 (19:08 -0600)]
13 files changed:
modules/Kconfig
modules/Makefile
modules/linux_mods/i386/headers.c
modules/v3_mods/Kconfig [new file with mode: 0644]
modules/v3_mods/i386/Kconfig [new file with mode: 0644]
modules/v3_mods/i386/Makefile [new file with mode: 0644]
modules/v3_mods/i386/binaries.S [new file with mode: 0644]
modules/v3_mods/i386/headers.c [new file with mode: 0644]
palacios/include/palacios/vmm_hypercall.h
palacios/include/palacios/vmm_list.h
palacios/include/palacios/vmm_symmod.h
palacios/src/devices/lnx_virtio_symmod.c
palacios/src/palacios/vmm_symmod.c

index d888b18..11cdb34 100644 (file)
@@ -1 +1,2 @@
 source "./modules/linux_mods/Kconfig"
+source "./modules/v3_mods/Kconfig"
\ No newline at end of file
index 303d52a..f5455c5 100644 (file)
@@ -1,2 +1,4 @@
 obj-$(CONFIG_LNX_MOD_32BIT)       += linux_mods/i386/
 #obj-$(CONFIG_LNX_MOD_64BIT)       += linux_mods/x86_64/
+obj-$(CONFIG_V3_MOD_32BIT)       += v3_mods/i386/
+#obj-$(CONFIG_V3_MOD_64BIT)       += v3_mods/x86_64/
index f7061e0..83b5317 100644 (file)
@@ -25,5 +25,5 @@
 extern uint8_t v3_lnx_mod_32bit_test_start[];
 extern uint8_t v3_lnx_mod_32bit_test_stop[];
 
-register_module("test_32", v3_lnx_mod_32bit_test_start, v3_lnx_mod_32bit_test_stop);
+register_module("test_32", v3_lnx_mod_32bit_test_start, v3_lnx_mod_32bit_test_stop, V3_SYMMOD_LNX);
 #endif
diff --git a/modules/v3_mods/Kconfig b/modules/v3_mods/Kconfig
new file mode 100644 (file)
index 0000000..5003358
--- /dev/null
@@ -0,0 +1,31 @@
+
+
+
+config V3_MODS
+       bool "V3VEE Symbiotic modules"
+       select V3_MOD_32BIT
+       select V3_MOD_64BIT
+       
+
+
+
+
+config V3_MOD_32BIT
+       bool "32 bit modules"
+       depends on V3_MODS
+
+config V3_MOD_32BIT_TEST
+       bool "V3 Sym (i386) test module"
+       default y if SYMMOD
+       depends on V3_MOD_32BIT
+       help 
+           This is a simple 32 bit test Symbiotic Module
+
+
+
+
+config V3_MOD_64BIT
+       bool "64 bit modules" 
+       depends on V3_MODS
+       default y               
+
diff --git a/modules/v3_mods/i386/Kconfig b/modules/v3_mods/i386/Kconfig
new file mode 100644 (file)
index 0000000..28ed4da
--- /dev/null
@@ -0,0 +1,20 @@
+
+
+
+config LINUX_KERN_MODS
+       bool "Include Linux kernel modules"
+       depends on SYMMOD
+
+if LINUX_KERN_MODS 
+
+config LINUX_TEST_MODULE
+       bool "Linux test module"
+       default y if SYMMOD
+       depends on SYMMOD
+       help 
+           This is a simple test linux kernel module
+
+
+       
+
+endif
diff --git a/modules/v3_mods/i386/Makefile b/modules/v3_mods/i386/Makefile
new file mode 100644 (file)
index 0000000..cdcc933
--- /dev/null
@@ -0,0 +1 @@
+obj-$(CONFIG_LNX_MOD_32BIT)   += binaries.o headers.o
\ No newline at end of file
diff --git a/modules/v3_mods/i386/binaries.S b/modules/v3_mods/i386/binaries.S
new file mode 100644 (file)
index 0000000..90c2ea3
--- /dev/null
@@ -0,0 +1,35 @@
+#;  -*- fundamental -*-
+
+/* 
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2010, Jack Lange <jarusl@cs.northwestern.edu>
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Jack Lange <jarusl@cs.northwestern.edu>
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
+.data
+
+#define TOSTR(str) #str
+#define MOD_DIR(name) TOSTR(./modules/v3_mods/i386/binaries/name)
+
+       
+#ifdef CONFIG_V3_MOD_32BIT_TEST
+.globl v3_mod_32bit_test_start
+v3_mod_32bit_test_start:
+.incbin MOD_DIR(test.vo)
+.globl v3_mod_32bit_test_stop
+v3_mod_32bit_test_stop:
+#endif
+
diff --git a/modules/v3_mods/i386/headers.c b/modules/v3_mods/i386/headers.c
new file mode 100644 (file)
index 0000000..e9daaa5
--- /dev/null
@@ -0,0 +1,29 @@
+/* 
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2010, Jack Lange <jarusl@cs.northwestern.edu> 
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Jack Lange <jarusl@cs.northwestern.edu>
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
+#include <palacios/vmm_symmod.h>
+
+
+
+#ifdef CONFIG_V3_MOD_32BIT_TEST
+extern uint8_t v3_mod_32bit_test_start[];
+extern uint8_t v3_mod_32bit_test_stop[];
+
+register_module("v3_test_32", v3_mod_32bit_test_start, v3_mod_32bit_test_stop, V3_SYMMOD_MOD);
+#endif
index c9646fa..8a7fc5d 100644 (file)
@@ -36,6 +36,15 @@ typedef enum {
     TEST_HCALL =           0x0001,
     SYMCALL_RET_HCALL =    0x0535,         // args in GPRs
     SYMCALL_ERR_HCALL =    0x0536,         // RBX: error code
+
+    /* -- Symmod symbol table hypercall --
+     * RBX: SymTable start 
+     * RCX: SymTable size  
+     * RDX: SymStrs start 
+     * RSI: SymStrs size
+     */
+    SYMMOD_SYMS_HCALL =    0x0600,         
+    
     MEM_OFFSET_HCALL =     0x1000,         // RBX: base addr(out)
     GUEST_INFO_HCALL =     0x3000,         // no args
     TELEMETRY_HCALL =      0x3001,         // no args
index f44933a..f1e878f 100644 (file)
@@ -263,6 +263,21 @@ static inline void list_splice_init(struct list_head *list,
     
 
 
+/** 
+ * list_next_entry -- get the struct for the next entry in a list
+ * @ptr:  current list entry
+ * @type: type of the struct this is embedded in
+ * @member: name of the list struct within the struct
+ */
+#define list_next_entry(node, type, member)                    \
+    ({                                                         \
+       type * next = NULL;                                     \
+       if ((node)->next != (node)) {                           \
+           next = list_entry((node)->next, type, member);      \
+       }                                                       \
+       next;                                                   \
+    })
+
 
 /**
  * list_for_each       -       iterate over a list
index d46ad11..b6d3745 100644 (file)
@@ -36,38 +36,49 @@ struct v3_symmod_state {
     struct v3_symmod_loader_ops * loader_ops;
     void * loader_data;
 
-
     struct hashtable * module_table;
 };
 
+#define V3_SYMMOD_INV (0x00000000)
+#define V3_SYMMOD_LNX (0x00000001)
+#define V3_SYMMOD_MOD (0x00000002)
+#define V3_SYMMOD_SEC (0x00000003)
+union v3_symmod_flags {
+    uint32_t flags;
+    struct {
+       uint8_t type;
+    } __attribute__((packed));
+} __attribute__((packed));
+
 
 struct v3_sym_module {
     char * name;
     void * start_addr;
     void * end_addr;
+    uint32_t flags; // see 'struct v3_symmod_flags'
 } __attribute__((packed));
 
 
+
+
 int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data);
 
 int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name);
 
-
 int v3_init_symmod_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
 
-
 struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name);
 
 
 
 
-#define register_module(name, start, end)                      \
+#define register_module(name, start, end, flags)               \
     static char v3_module_name[] = name;                       \
     static struct v3_sym_module _v3_module                     \
     __attribute__((__used__))                                  \
        __attribute__((unused, __section__ ("_v3_modules"),     \
                       aligned(sizeof(addr_t))))                \
-       = {v3_module_name, start, end};
+       = {v3_module_name, start, end, flags};
 
 
 int V3_init_symmod();
index d3bae18..d6df7a7 100644 (file)
@@ -406,7 +406,7 @@ static int virtio_load_module(struct v3_vm_info * vm, char * name, int mod_size,
     }
 
     
-    if (q->cur_avail_idx < q->avail->index) {
+    if (q->cur_avail_idx != q->avail->index) {
        uint16_t notifier_idx = q->avail->ring[q->cur_avail_idx % q->queue_size];
        struct symmod_hdr * notifier = NULL;
        struct vring_desc * notifier_desc = NULL;
index a311ae1..193f511 100644 (file)
@@ -47,13 +47,10 @@ int V3_init_symmod() {
     master_mod_table = v3_create_htable(0, mod_hash_fn, mod_eq_fn);
 
     while (tmp_mod != __stop__v3_modules) {
-
        if (v3_htable_search(master_mod_table, (addr_t)(tmp_mod->name))) {
            PrintError("Multiple instances of Module (%s)\n", tmp_mod->name);
            return -1;
-       }
-       
-       
+       }       
        PrintDebug("Registering Symbiotic Module (%s)\n", tmp_mod->name);
 
        if (v3_htable_insert(master_mod_table, 
@@ -62,12 +59,9 @@ int V3_init_symmod() {
            PrintError("Could not insert module %s to master list\n", tmp_mod->name);
            return -1;
        }
-
-
        tmp_mod = &(__start__v3_modules[++i]);
     }
     
-
     return 0;
 }
 
@@ -112,7 +106,6 @@ int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name) {
 struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name) {
     struct v3_sym_module * mod = (struct v3_sym_module *)v3_htable_search(master_mod_table, (addr_t)name);
 
-
     if (!mod) {
        PrintError("Could not find module %s\n", name);
        return NULL;