Enable Symbiotic components of the VMM.
This includes the SymSpy interface.
-
-
config SYMCALL
bool "Symbiotic upcalls"
default n
help
Enables the Symbiotic upcall interface
-config SYMMOD
- bool "Symbiotic Modules"
- default n
- depends on SYMBIOTIC && EXPERIMENTAL
- help
- Enable Symbiotic module loading
-
-
config SWAPBYPASS
bool "SwapBypass"
default n
help
Enable the telemetry information for the SwapBypass subsystem
+menuconfig SYMMOD
+ bool "Symbiotic Modules"
+ default n
+ depends on EXPERIMENTAL
+# depends on SYMBIOTIC
+ help
+ Enable Symbiotic module loading
+
+if SYMMOD
+
+source "modules/Kconfig"
+
+endif
+
+
endmenu
core-y := palacios/src/palacios/
libs-y := palacios/lib/$(ARCH)/
devices-y := palacios/src/devices/
+modules-y := modules/
ifeq ($(dot-config),1)
# In this section, we need .config
palacios-dirs := $(patsubst %/,%,$(filter %/, \
- $(core-y) $(devices-y) $(libs-y)))
+ $(core-y) $(devices-y) $(libs-y)) $(modules-y))
#palacios-alldirs := $(sort $(palacios-dirs) $(patsubst %/,%,$(filter %/, \
# $(core-n) $(core-) $(devices-n) $(devices-) \
palacios-cleandirs := $(sort $(palacios-dirs) $(patsubst %/,%,$(filter %/, \
- $(core-n) $(core-) $(devices-n) $(devices-))))
+ $(core-n) $(core-) $(devices-n) $(devices-) $(modules-n) $(modules-))))
core-y := $(patsubst %/, %/built-in.o, $(core-y))
devices-y := $(patsubst %/, %/built-in.o, $(devices-y))
libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
+modules-y := $(patsubst %/, %/built-in.o, $(modules-y))
#core-y := $(patsubst %/, %/lib.a, $(core-y))
#devices-y := $(patsubst %/, %/lib.a, $(devices-y))
-palacios := $(core-y) $(devices-y) $(libs-y)
+palacios := $(core-y) $(devices-y) $(libs-y) $(modules-y)
# Rule to link palacios - also used during CONFIG_KALLSYMS
# May be overridden by /Makefile.$(ARCH)
--- /dev/null
+source "./modules/linux_mods/Kconfig"
--- /dev/null
+obj-$(CONFIG_LNX_MOD_32BIT) += linux_mods/i386/
+#obj-$(CONFIG_LNX_MOD_64BIT) += linux_mods/x86_64/
--- /dev/null
+
+
+
+config LNX_KERN_MODS
+ bool "Linux kernel modules"
+ select LNX_MOD_32BIT
+ select LNX_MOD_64BIT
+
+
+
+
+
+config LNX_MOD_32BIT
+ bool "32 bit modules"
+ depends on LNX_KERN_MODS
+
+config LNX_MOD_32BIT_TEST
+ bool "Linux (i386) test module"
+ default y if SYMMOD
+ depends on LNX_MOD_32BIT
+ help
+ This is a simple 32 bit test Linux kernel module
+
+
+
+
+config LNX_MOD_64BIT
+ bool "64 bit modules"
+ depends on LNX_KERN_MODS
+ default y
+
--- /dev/null
+
+
+
+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
--- /dev/null
+obj-$(CONFIG_LNX_MOD_32BIT) += binaries.o headers.o
\ No newline at end of file
--- /dev/null
+#; -*- 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/linux_mods/i386/binaries/name)
+
+
+#ifdef CONFIG_LNX_MOD_32BIT_TEST
+.globl v3_lnx_mod_32bit_test_start
+v3_lnx_mod_32bit_test_start:
+.incbin MOD_DIR(test.ko)
+.globl v3_lnx_mod_32bit_test_stop
+v3_lnx_mod_32bit_test_stop:
+#endif
+
--- /dev/null
+/*
+ * 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_LNX_MOD_32BIT_TEST
+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);
+#endif
struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name);
+
+
+
+struct v3_module_hdr {
+ char * name;
+ void * start_addr;
+ void * end_addr;
+} __attribute__((packed));
+
+
+#define register_module(name, start, end) \
+ static char v3_module_name[] = name; \
+ static struct v3_module_hdr _v3_module \
+ __attribute__((__used__)) \
+ __attribute__((unused, __section__ ("_v3_modules"), \
+ aligned(sizeof(addr_t)))) \
+ = {v3_module_name, start, end};
+
+
int V3_init_symmod();
}
memcpy(buf, module->data + offset, buf_desc->length);
+ PrintDebug("Copying module to virtio buffers: SRC=%p, DST=%p, len=%d\n",
+ (void *)(module->data + offset), (void *)buf, buf_desc->length);
if (tmp_status != 0) {
PrintError("Error loading module segment\n");
xfer_len += status_desc->length;
*status_ptr = status;
+ PrintDebug("Transferred %d bytes (xfer_len)\n", xfer_len);
q->used->ring[q->used->index % QUEUE_SIZE].id = q->avail->ring[q->cur_avail_idx % QUEUE_SIZE];
q->used->ring[q->used->index % QUEUE_SIZE].length = xfer_len; // set to total inbound xfer length
.globl pxebios_end
pxebios_end:
#endif
+
+
+/* temporary module */
+/*
+.globl symmod_start
+symmod_start:
+.incbin "./palacios/src/modules/test.ko"
+.globl symmod_end
+symmod_end:*/
+
#include <palacios/vmm_symbiotic.h>
#include <palacios/vm_guest.h>
+static struct v3_sym_module test_module;
int V3_init_symmod() {
int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data) {
struct v3_symmod_state * symmod_state = &(vm->sym_vm_state.symmod_state);
+ extern uint8_t symmod_start[];
+ extern uint8_t symmod_end[];
+
+
+
+
+ struct v3_sym_module tmp_mod = {
+ .name = "test",
+ .num_bytes = symmod_end - symmod_start,
+ .data = symmod_start,
+ };
+
+
+ test_module = tmp_mod;
symmod_state->loader_ops = ops;
symmod_state->loader_data = priv_data;
+
return 0;
+
}
-static char test_module_data[16] = {"hello"};
-static struct v3_sym_module test_module = {
- .name = "test",
- .num_bytes = 16,
- .data = test_module_data,
-};
int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name) {
struct v3_symmod_state * symmod_state = &(vm->sym_vm_state.symmod_state);
PrintDebug("Loading Module (%s)\n", mod_name);
- return symmod_state->loader_ops->load_module(vm, mod_name, 16, symmod_state->loader_data);
+ return symmod_state->loader_ops->load_module(vm, test_module.name, test_module.num_bytes, symmod_state->loader_data);
}
+
+
+
struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name) {
return &test_module;
}