X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fmain.c;h=5c9ffa2fbc50fd5f118fefabc7d3b81c1d4fc911;hb=afdee70966b757149da1c1a47c5d0043a37336a1;hp=296d01bbc6171a60c1196cd18f537d00109b1957;hpb=298a05652b5704f9881af0683e3f16fc4cd03959;p=palacios.releases.git diff --git a/linux_module/main.c b/linux_module/main.c index 296d01b..5c9ffa2 100644 --- a/linux_module/main.c +++ b/linux_module/main.c @@ -26,11 +26,11 @@ #include "palacios.h" #include "mm.h" #include "vm.h" +#include "allow_devmem.h" #include "linux-exts.h" - MODULE_LICENSE("GPL"); // Module parameter @@ -39,11 +39,16 @@ int cpu_list_len = 0; module_param_array(cpu_list, int, &cpu_list_len, 0644); MODULE_PARM_DESC(cpu_list, "Comma-delimited list of CPUs that Palacios will run on"); +static int allow_devmem = 0; +module_param(allow_devmem, int, 0); +MODULE_PARM_DESC(allow_devmem, "Allow general user-space /dev/mem access even if kernel is strict"); + // Palacios options parameter static char *options; module_param(options, charp, 0); MODULE_PARM_DESC(options, "Generic options to internal Palacios modules"); + int mod_allocs = 0; int mod_frees = 0; @@ -332,6 +337,9 @@ static int show_mem(char * buf, char ** start, off_t off, int count, } + + + static int __init v3_init(void) { dev_t dev = MKDEV(0, 0); // We dynamicallly assign the major number int ret = 0; @@ -339,6 +347,10 @@ static int __init v3_init(void) { palacios_init_mm(); + if (allow_devmem) { + palacios_allow_devmem(); + } + // Initialize Palacios palacios_vmm_init(options); @@ -460,6 +472,10 @@ static void __exit v3_exit(void) { deinit_lnx_extensions(); + if (allow_devmem) { + palacios_restore_devmem(); + } + palacios_deinit_mm(); remove_proc_entry("v3-guests", dir);