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 fixes
Jack Lange [Thu, 6 May 2010 21:22:49 +0000 (16:22 -0500)]
palacios/include/palacios/vmm_symmod.h
palacios/src/palacios/vmm_symmod.c
symmods/capsule/Makefile
symmods/capsule/binary.S
symmods/linux/test/Makefile

index 57ef01c..9433890 100644 (file)
@@ -83,6 +83,8 @@ struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name);
 
 
 
+
+
 #define register_module(name, start, end, flags)               \
     static char v3_module_name[] = name;                       \
     static struct v3_sym_module _v3_module                     \
index e2becb9..20559a9 100644 (file)
 
 static struct hashtable * master_mod_table = NULL;
 
-
+/* 
+ * This is a place holder to ensure that the _v3_modules section gets created 
+ */
+static struct {} null_mod  __attribute__((__used__))                   \
+    __attribute__((unused, __section__ ("_v3_modules"),                        \
+                  aligned(sizeof(addr_t))));
 
 static uint_t mod_hash_fn(addr_t key) {
     char * name = (char *)key;
@@ -45,13 +50,20 @@ int V3_init_symmod() {
     struct v3_sym_module * tmp_mod = __start__v3_modules;
     int i = 0;
 
+    if (tmp_mod == __stop__v3_modules) {
+       PrintDebug("No Symbiotic modules found\n");
+       return 0;
+    }
+
     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, 
index eaae927..1dea03f 100644 (file)
@@ -17,10 +17,11 @@ DEFS := -DMOD_NAME=$(MOD_NAME) \
 #      cpp -undef $(DEFS) binary.S -o $(MOD_DIR)/.tmp.binary.S
 #      cpp $(DEFS) $(MOD_DIR)/.tmp.binary.S
 
+CFLAGS := -fno-stack-protector -Wall -O -Werror -fPIC -mno-red-zone
 
 module: FORCE
        cpp -undef $(DEFS) binary.S -o $(MOD_DIR)/.tmp.binary.S
-       gcc $(DEFS) -c $(MOD_DIR)/.tmp.binary.S -o $(MOD_DIR)/$(MOD_NAME).vo
+       gcc $(CFLAGS) $(DEFS) -c $(MOD_DIR)/.tmp.binary.S -o $(MOD_DIR)/$(MOD_NAME).vo
        rm -f $(MOD_DIR)/.tmp.binary.S
 
 FORCE:
index 4e4fa2f..e37a312 100644 (file)
@@ -39,7 +39,7 @@ mod_name:
 .ascii MOD_NM(MOD_NAME)
 
 
-.section "_v3_modules"
+.section _v3_modules, "a"
 IDENT(#ifdef __x86_64__)
 .quad mod_name 
 .quad mod_start
index 757010d..0b4e233 100644 (file)
@@ -17,9 +17,16 @@ else
        PALACIOSDIR := $(PWD)/../../capsule
        V3_MOD_TYPE := V3_LINUX_MOD
 
-default:
+
+linux: FORCE
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+
+capsule: FORCE 
        $(MAKE) -C $(PALACIOSDIR) MOD_NAME=$(V3_MOD_NAME) MOD_DIR=$(PWD) \
                MOD_OBJ=$(V3_MOD_OBJ) MOD_TYPE=$(V3_MOD_TYPE)
 
+default: linux capsule 
+
+FORCE:
+
 endif