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.


tried to reduce compiler warnings, and cut down on debugging output
Jack Lange [Wed, 15 Oct 2008 21:58:50 +0000 (16:58 -0500)]
build/Makefile
palacios/build/Makefile
palacios/include/palacios/vmm_list.h
palacios/src/devices/serial.c
palacios/src/palacios/svm.c
palacios/src/palacios/svm_halt.c
palacios/src/palacios/svm_io.c
palacios/src/palacios/vmm_config.c
palacios/src/palacios/vmm_emulator.c
palacios/src/palacios/vmm_hashtable.c
palacios/src/palacios/vmm_xed.c

index 0364304..cae3ceb 100644 (file)
@@ -152,6 +152,22 @@ DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_RAMDISK=0
 endif
 endif
 
+ifeq ($(DEBUG_XED),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_XED=1
+else 
+ifeq ($(DEBUG_XED),0) 
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_XED=0
+endif
+endif
+
+ifeq ($(DEBUG_HALT),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_HALT=1
+else 
+ifeq ($(DEBUG_HALT),0) 
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_HALT=0
+endif
+endif
+
 
 # ----------------------------------------------------------------------
 # Targets -
index 9f05bf9..51d0096 100644 (file)
@@ -148,13 +148,28 @@ endif
 endif
 
 ifeq ($(TRACE_RAMDISK),1)
-DEBUG_SECTIONS := $(DEBUG_SECTIONS -DTRACE_RAMDISK
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DTRACE_RAMDISK
 else
 ifeq ($(TRACE_RAMDSK),0)
 DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UTRACE_RAMDISK
 endif
 endif
 
+ifeq ($(DEBUG_XED),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_XED
+else 
+ifeq ($(DEBUG_XED),0) 
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_XED
+endif
+endif
+
+ifeq ($(DEBUG_HALT),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_HALT
+else 
+ifeq ($(DEBUG_HALT),0) 
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_HALT
+endif
+endif
 
 
 #DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DTEST_NE2K
@@ -340,8 +355,8 @@ FD_SECTORS_PER_TRACK := $(PERL) $(PROJECT_ROOT)/scripts/numsecs_per_track
 
 # Flags used for all C source files
 #GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(VMM_FLAGS) -fPIC #-fvisibility=hidden
-GENERAL_OPTS :=  -O -Wall  $(EXTRA_C_OPTS) $(VMM_FLAGS) -fPIC #-fvisibility=hidden
-CC_GENERAL_OPTS := $(GENERAL_OPTS) -Werror 
+GENERAL_OPTS :=  -O -Wall  $(EXTRA_C_OPTS) $(VMM_FLAGS) -fPIC -Werror#-fvisibility=hidden
+CC_GENERAL_OPTS := $(GENERAL_OPTS) 
 
 # Flags used for VMM C source files
 CC_VMM_OPTS := -g -I$(PROJECT_ROOT)/include -D__V3VEE__ -D$(V3_ARCH) $(DECODER_FLAGS) $(JRLDEBUG)
@@ -411,8 +426,6 @@ rombios_link:
 vgabios_link:
        ln -s -f ../src/vmboot/vgabios/VGABIOS-lgpl-latest.bin vgabios
 
-force_lwip:
-       (cd ../src/lwip/build; make clean; make)
 
 force_rombios: rombios_link
        (cd ../src/vmboot/rombios; make clean; make)
@@ -423,7 +436,7 @@ force_vgabios: vgabios_link
 force_payload: force_rombios force_vgabios
        ../scripts/make_payload.pl payload_layout.txt vm_kernel
 
-inter1: force_payload force_lwip
+inter1: force_payload
        -make clean
 
 world: inter1 vmm
index d66d4c7..0d8747e 100644 (file)
@@ -19,7 +19,7 @@
         (type *)( (char *)__mptr - offsetof(type,member) );})
 
 
-static inline void prefetch(const void *x) {;}
+static inline void prefetch(const void *x) {const void * foo; foo = x;}
 
 /*
  * These are non-NULL pointers that will result in page faults
index 55d7541..4f99113 100644 (file)
@@ -162,7 +162,7 @@ struct serial_buffer {
 };
 
 int queue_data(struct serial_buffer * buf, char data) {
-  int next_loc = (buf->head + 1) % SERIAL_BUF_LEN;
+  uint_t next_loc = (buf->head + 1) % SERIAL_BUF_LEN;
 
   if (next_loc == buf->tail) {
     return -1;
@@ -175,7 +175,7 @@ int queue_data(struct serial_buffer * buf, char data) {
 }
 
 int dequeue_data(struct serial_buffer * buf, char * data) {
-  int next_tail = (buf->tail + 1) % SERIAL_BUF_LEN;
+  uint_t next_tail = (buf->tail + 1) % SERIAL_BUF_LEN;
 
   if (buf->head == buf->tail) {
     return -1;
index 015e396..7cf20ab 100644 (file)
@@ -188,7 +188,7 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) {
       uchar_t * bitmap = (uchar_t *)io_port_bitmap;
 
       bitmap += (port / 8);
-      PrintDebug("Setting Bit for port 0x%x\n", port);
+      //      PrintDebug("Setting Bit for port 0x%x\n", port);
       *bitmap |= 1 << (port % 8);
     }
 
index 68261c3..2f5f1bb 100644 (file)
 #include <palacios/vmm_intr.h>
 
 
+#ifndef DEBUG_HALT
+#undef PrintDebug
+#define PrintDebug(fmt, args...)
+#endif
+
+
 
 //
 // This should trigger a #GP if cpl!=0, otherwise, yield to host
index 63a5603..5a68133 100644 (file)
@@ -39,7 +39,7 @@ int handle_svm_io_in(struct guest_info * info) {
   struct svm_io_info * io_info = (struct svm_io_info *)&(ctrl_area->exit_info1);
 
   struct vmm_io_hook * hook = v3_get_io_hook(&(info->io_map), io_info->port);
-  uint_t read_size = 0;
+  int read_size = 0;
 
   if (hook == NULL) {
     PrintError("Hook Not present for in on port %x\n", io_info->port);
@@ -83,7 +83,7 @@ int handle_svm_io_ins(struct guest_info * info) {
   struct svm_io_info * io_info = (struct svm_io_info *)&(ctrl_area->exit_info1);
   
   struct vmm_io_hook * hook = v3_get_io_hook(&(info->io_map), io_info->port);
-  uint_t read_size = 0;
+  int read_size = 0;
 
   addr_t dst_addr = 0;
   uint_t rep_num = 1;
@@ -218,7 +218,7 @@ int handle_svm_io_out(struct guest_info * info) {
   struct svm_io_info * io_info = (struct svm_io_info *)&(ctrl_area->exit_info1);
 
   struct vmm_io_hook * hook = v3_get_io_hook(&(info->io_map), io_info->port);
-  uint_t write_size = 0;
+  int write_size = 0;
 
   if (hook == NULL) {
     PrintError("Hook Not present for out on port %x\n", io_info->port);
@@ -261,7 +261,7 @@ int handle_svm_io_outs(struct guest_info * info) {
   struct svm_io_info * io_info = (struct svm_io_info *)&(ctrl_area->exit_info1);
   
   struct vmm_io_hook * hook = v3_get_io_hook(&(info->io_map), io_info->port);
-  uint_t write_size = 0;
+  int write_size = 0;
 
   addr_t dst_addr = 0;
   uint_t rep_num = 1;
index 3a4cbaf..ec6c5ab 100644 (file)
@@ -102,7 +102,7 @@ int config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) {
   struct guest_mem_layout * layout = (struct guest_mem_layout *)config_ptr->vm_kernel;
   extern v3_cpu_arch_t v3_cpu_type;
   void * region_start;
-  int i;
+  uint_t i;
 
   int use_ramdisk = config_ptr->use_ramdisk;
   int use_generic = USE_GENERIC;
index 3294aa0..37fa3f9 100644 (file)
@@ -154,6 +154,11 @@ int v3_emulate_memory_read(struct guest_info * info, addr_t read_gva,
     ret = read_guest_va_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr);
   }
 
+  if (ret == -1) {
+    PrintError("Could not read guest memory\n");
+    return -1;
+  }
+
 #ifdef DEBUG_EMULATOR
   PrintDebug("Instr (15 bytes) at %x:\n", instr);
   PrintTraceMemDump(instr, 15);
@@ -183,7 +188,8 @@ int v3_emulate_memory_read(struct guest_info * info, addr_t read_gva,
 
 
   // Read the data directly onto the emulated page
-  if (read(read_gpa, (void *)(data_page->page_addr + data_addr_offset), instr_info.op_size, private_data) != instr_info.op_size) {
+  ret = read(read_gpa, (void *)(data_page->page_addr + data_addr_offset), instr_info.op_size, private_data);
+  if ((ret == -1) || ((uint_t)ret != instr_info.op_size)) {
     PrintError("Read error in emulator\n");
     V3_FreePage((void *)(data_page->page_addr));
     V3_Free(data_page);
index 65dbca1..612ae78 100644 (file)
@@ -125,7 +125,7 @@ ulong_t hash_long(ulong_t val, uint_t bits) {
 ulong_t hash_buffer(uchar_t * msg, uint_t length) {
   ulong_t hash = 0;
   ulong_t temp = 0;
-  int i;
+  uint_t i;
 
   for (i = 0; i < length; i++) {
     hash = (hash << 4) + *(msg + i) + i;
index 7830458..bea0aaf 100644 (file)
 
 #endif
 
+
+
+#ifndef DEBUG_XED
+#undef PrintDebug
+#define PrintDebug(fmt, args...)
+#endif
+
+
+
 static xed_state_t decoder_state;
 
 #define GPR_REGISTER     0