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.


fixed configuration macro checks and a few configuration bugs
Jack Lange [Thu, 13 Aug 2009 22:36:54 +0000 (17:36 -0500)]
38 files changed:
Kconfig
palacios/include/palacios/vm_guest.h
palacios/include/palacios/vmm_instrument.h
palacios/include/palacios/vmm_profiler.h
palacios/src/devices/8254.c
palacios/src/devices/8259a.c
palacios/src/devices/Makefile
palacios/src/devices/apic.c
palacios/src/devices/generic.c
palacios/src/devices/ide.c
palacios/src/devices/io_apic.c
palacios/src/devices/keyboard.c
palacios/src/devices/lnx_virtio_blk.c
palacios/src/devices/ne2k.c
palacios/src/devices/net_cd.c
palacios/src/devices/net_hd.c
palacios/src/devices/nvram.c
palacios/src/devices/pci.c
palacios/src/devices/ram_cd.c
palacios/src/devices/ram_hd.c
palacios/src/palacios/Makefile
palacios/src/palacios/svm.c
palacios/src/palacios/svm_halt.c
palacios/src/palacios/svm_handler.c
palacios/src/palacios/svm_io.c
palacios/src/palacios/vmm_config.c
palacios/src/palacios/vmm_ctrl_regs.c
palacios/src/palacios/vmm_dev_mgr.c
palacios/src/palacios/vmm_direct_paging.c
palacios/src/palacios/vmm_emulator.c
palacios/src/palacios/vmm_instrument.c
palacios/src/palacios/vmm_intr.c
palacios/src/palacios/vmm_io.c
palacios/src/palacios/vmm_paging.c
palacios/src/palacios/vmm_shadow_paging.c
palacios/src/palacios/vmm_ss_emulator.c
palacios/src/palacios/vmm_xed.c
palacios/src/palacios/vmx.c

diff --git a/Kconfig b/Kconfig
index 00edbc3..1ad2ad9 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -1,12 +1,5 @@
 mainmenu "Palacios VMM Configuration"
 
-config x86_64
-       bool
-       default y
-       help
-         Support for the x86-64 architecture.
-
-
 menu "Target Configuration"
 
 config CRAY_XT
@@ -25,16 +18,47 @@ config VMX
        default y
        help 
          Compile with support for Intel VMX
-endmenu
 
 
-menu "Virtual Devices"
+config SOCKET
+       bool "Include Network Socket Support"
+       default y
+       help 
+         Enable networking support in Palacios
+
+
 
-config APIC
-       bool "APIC"
+config PROFILE_VMM
+       bool "Enable VMM profiling support"
        default y
        help 
-         "Includes the Virtual APIC device"
+         Enable the profiling framework in Palacios
+         -----
+         This is a framwork that allows components of palacios to record 
+         information that is periodically reported to the log file 
+
+config INSTRUMENT_VMM
+       bool "Enable VMM instrumentation"
+       default n
+       help 
+         Enable the instrumentation framework
+         --------
+         This is much heavier weight than profiling
+
+
+endmenu
+
+
+
+
+menu "Symbiotic Functions"
+
+config SYMBIOTIC
+       bool "Enable Symbiotic Functionality"
+       default n
+       help 
+         Enable Symbiotic components of the VMM
+
 
 endmenu
 
@@ -58,20 +82,75 @@ config DEBUG_ON
          This turns on debugging support
 
 
-       
+config DEBUG_SHADOW_PAGING
+       bool "Shadow paging"
+       default n
+       depends on DEBUG_ON
+       help 
+         This turns on debugging for the shadow paging system
+
+
+config DEBUG_NESTED_PAGING
+       bool "Nested paging"
+       default n
+       depends on DEBUG_ON
+       help 
+         This turns on debugging for the nested paging system
+
+
+config DEBUG_CTRL_REGS
+       bool "Control registers"
+       default n
+       depends on DEBUG_ON
+       help 
+         This turns on debugging for the control register handlers
 
 
-config DEBUG_PIC
-       bool "PIC"
+config DEBUG_INTERRUPTS
+       bool "Interrupts"
+       default n
        depends on DEBUG_ON
        help 
-         Enable debugging for the PIC  
+         This turns on debugging for the interrupt system
+
+
 
-config DEBUG_APIC
-       bool "APIC"
-       depends on DEBUG_ON && APIC
+config DEBUG_IO
+       bool "IO"
+       default n
+       depends on DEBUG_ON
        help 
-         Enable debugging for the APIC
+         This turns on debugging for the IO handlers
+
+
+config DEBUG_EMULATOR
+       bool "Instruction Emulator"
+       default n
+       depends on DEBUG_ON
+       help 
+         This turns on debugging for the Instruction Emulator
+
+
+config DEBUG_XED
+       bool "XED"
+       default n
+       depends on DEBUG_ON
+       help 
+         This turns on debugging for the Xed Decoder
+
+config DEBUG_HALT
+       bool "Halt"
+       default n
+       depends on DEBUG_ON
+       help 
+         This turns on debugging for the halt instruction handler
+
+config DEBUG_DEV_MGR
+       bool "Device Manager"
+       default n
+       depends on DEBUG_ON
+       help 
+         This turns on debugging for the device manager
 
 
 
@@ -93,7 +172,16 @@ config VGABIOS_PATH
        help
          This is the vgabios that will be used for the guests
 
+config VMXASSIST_PATH
+       string "Path to pre-built VMXASSIST binary"
+       depends on VMX
+       default "./bios/vmxassist/vmxassist.bin"
+       help
+         This is vmxassist image to boot real mode guests on 
+         Intel VMX Platforms
+
 endmenu
 
-#source "net/Kconfig"
+
+source "palacios/src/devices/Kconfig"
 
index eb85d7d..bbfc22d 100644 (file)
@@ -110,8 +110,10 @@ struct v3_segments {
 
 struct shadow_page_state;
 struct v3_intr_state;
-struct v3_profiler;
 
+#ifdef CONFIG_PROFILE_VMM
+struct v3_profiler;
+#endif
 
 
 
@@ -167,9 +169,10 @@ struct guest_info {
     uint64_t yield_start_cycle;
     
 
-
+#ifdef CONFIG_PROFILE_VMM
     uint_t enable_profiler;
     struct v3_profiler profiler;
+#endif
 
     void * decoder_state;
 };
index b59eac0..63b2be2 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifdef __V3VEE__
 
-#ifdef INSTRUMENT_VMM 
+#ifdef CONFIG_INSTRUMENT_VMM 
 
 #include <palacios/vmm_types.h>
 #include <palacios/vmm_ringbuffer.h>
index 75722b8..9787db0 100644 (file)
@@ -22,6 +22,8 @@
 
 #ifdef __V3VEE__
 
+#ifdef CONFIG_PROFILE_VMM 
+
 #include <palacios/vmm_rbtree.h>
 
 struct guest_info;
@@ -45,6 +47,7 @@ void v3_profile_exit(struct guest_info * info, uint_t exit_code);
 
 void v3_print_profile(struct guest_info * info);
 
+#endif
 
 #endif
 
index 7d1acfe..c205752 100644 (file)
@@ -26,7 +26,7 @@
 
 
 
-#ifndef DEBUG_PIT
+#ifndef CONFIG_DEBUG_PIT
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -653,7 +653,7 @@ static int pit_init(struct guest_info * info, void * cfg_data) {
     v3_dev_hook_io(dev, CHANNEL2_PORT, &pit_read_channel, &pit_write_channel);
     v3_dev_hook_io(dev, COMMAND_PORT, NULL, &pit_write_command);
 
-#ifdef DEBUG_PIT
+#ifdef CONFIG_DEBUG_PIT
     PrintDebug("8254 PIT: OSC_HZ=%d, reload_val=", OSC_HZ);
     PrintTraceLL(reload_val);
     PrintDebug("\n");
@@ -673,7 +673,7 @@ static int pit_init(struct guest_info * info, void * cfg_data) {
     init_channel(&(pit_state->ch_1));
     init_channel(&(pit_state->ch_2));
 
-#ifdef DEBUG_PIT
+#ifdef CONFIG_DEBUG_PIT
     PrintDebug("8254 PIT: CPU MHZ=%d -- pit count=", cpu_khz / 1000);
     PrintTraceLL(pit_state->pit_counter);
     PrintDebug("\n");
index 336c0d7..1d47e73 100644 (file)
@@ -24,7 +24,7 @@
 #include <palacios/vmm.h>
 #include <palacios/vmm_dev_mgr.h>
 
-#ifndef DEBUG_PIC
+#ifndef CONFIG_DEBUG_PIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 3938c7c..44c4b91 100644 (file)
@@ -1,25 +1,24 @@
-obj-y := \
-       8254.o \
-       8259a.o \
-       apic.o \
-       bochs_debug.o \
-       generic.o \
-       i440fx.o \
-       ide.o \
-       io_apic.o \
-       keyboard.o \
-       lnx_virtio_balloon.o \
-       lnx_virtio_blk.o \
-       lnx_virtio_sym.o \
-       nvram.o \
-       os_debug.o \
-       pci.o \
-       piix3.o \
-       ram_cd.o \
-       ram_hd.o \
-       sym_swap.o 
+obj-$(CONFIG_APIC) += apic.o
+obj-$(CONFIG_PIT) += 8254.o
+obj-$(CONFIG_PIC) += 8259a.o
+obj-$(CONFIG_BOCHS_DEBUG) += bochs_debug.o
+obj-$(CONFIG_GENERIC) += generic.o
+obj-$(CONFIG_I440FX) += i440fx.o
+obj-$(CONFIG_IDE) += ide.o
+obj-$(CONFIG_IO_APIC) += io_apic.o
+obj-$(CONFIG_KEYBOARD) += keyboard.o
+obj-$(CONFIG_LINUX_VIRTIO_BALLOON) += lnx_virtio_balloon.o
+obj-$(CONFIG_LINUX_VIRTIO_BLOCK) += lnx_virtio_blk.o
+obj-$(CONFIG_LINUX_VIRTIO_SYM) += lnx_virtio_sym.o
+obj-$(CONFIG_NVRAM) += nvram.o
+obj-$(CONFIG_OS_DEBUG) += os_debug.o
+obj-$(CONFIG_PCI) += pci.o
+obj-$(CONFIG_PIIX3) += piix3.o
+obj-$(CONFIG_RAM_CD) += ram_cd.o
+obj-$(CONFIG_RAM_HD) += ram_hd.o
+obj-$(CONFIG_SYM_SWAP) += sym_swap.o 
 
-#      ne2k.o \
+obj-$(CONFIG_NE2K) += ne2k.o
 
-obj-$(CONFIG_SOCKET) += net_cd.o \
-                       net_hd.o 
+obj-$(CONFIG_NET_CD) += net_cd.o 
+obj-$(CONFIG_NET_HD) += net_hd.o 
index 2ce9225..2d95008 100644 (file)
@@ -24,7 +24,7 @@
 #include <palacios/vmm_msr.h>
 
 
-#ifndef DEBUG_APIC
+#ifndef CONFIG_DEBUG_APIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 7a70e5d..fbeff20 100644 (file)
@@ -26,7 +26,7 @@
 
 
 
-#ifndef DEBUG_GENERIC
+#ifndef CONFIG_DEBUG_GENERIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 8349f70..3138c64 100644 (file)
@@ -26,7 +26,7 @@
 #include "ide-types.h"
 #include "atapi-types.h"
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -353,7 +353,7 @@ static int dma_write(struct vm_device * dev, struct ide_channel * channel);
 #include "ata.h"
 
 
-#ifdef DEBUG_IDE
+#ifdef CONFIG_DEBUG_IDE
 static void print_prd_table(struct vm_device * dev, struct ide_channel * channel) {
     struct ide_dma_prd prd_entry;
     int index = 0;
@@ -395,7 +395,7 @@ static int dma_read(struct vm_device * dev, struct ide_channel * channel) {
     // Read in the data buffer....
     // Read a sector/block at a time until the prd entry is full.
 
-#ifdef DEBUG_IDE
+#ifdef CONFIG_DEBUG_IDE
     print_prd_table(dev, channel);
 #endif
 
index 5b840d5..860cf8d 100644 (file)
@@ -23,7 +23,7 @@
 #include <devices/apic.h>
 
 
-#ifndef DEBUG_IO_APIC
+#ifndef CONFIG_DEBUG_IO_APIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 0fcdc90..e9fff1f 100644 (file)
@@ -25,7 +25,7 @@
 #include <palacios/vmm_lock.h>
 
 
-#ifndef DEBUG_KEYBOARD
+#ifndef CONFIG_DEBUG_KEYBOARD
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 0720e93..e58ec10 100644 (file)
 #include <devices/pci.h>
 
 
-/*
-#ifndef DEBUG_VIRTIO_BLK
+
+#ifndef CONFIG_DEBUG_VIRTIO_BLK
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
-*/
+
 
 #define BLK_CAPACITY_PORT     20
 #define BLK_MAX_SIZE_PORT     28
index e535a1c..9df0871 100644 (file)
@@ -29,7 +29,7 @@
 #include <palacios/vmm_debug.h>
 #include <palacios/vmm_string.h>
 
-#ifndef DEBUG_NE2K
+#ifndef CONFIG_DEBUG_NE2K
 #undef PrintDebug
 #define PrintDebug(fmts, args...)
 #endif
@@ -333,7 +333,7 @@ struct ne2k_context {
 
 #define compare_mac(src, dst) !memcmp(src, dst, 6)
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
 static void dump_state(struct vm_device * dev) {
     struct ne2k_context *nic_state = (struct ne2k_context *)dev->private_data;
     int i;
@@ -413,7 +413,7 @@ static void ne2k_init_state(struct vm_device * dev) {
     nic_state->mem[14] = 0x57;
     nic_state->mem[15] = 0x57;
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     dump_state(dev);
 #endif
 
@@ -558,7 +558,7 @@ static int netif_input(uchar_t *pkt, uint_t size) {
     static const uchar_t brocast_mac[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
     int i;
   
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     PrintDebug("\nNe2k: Packet Received:\nSource:");
     for (i = 6; i < 12; i++) {
        PrintDebug("%x ", pkt[i]);
@@ -1146,7 +1146,7 @@ static int ne2k_init_device(struct vm_device * dev) {
     }
     
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     dump_state(dev);
 #endif
 
index d8ea73e..f980bab 100644 (file)
@@ -22,7 +22,7 @@
 #include <devices/ide.h>
 #include <palacios/vmm_socket.h>
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif 
index 8db6b97..0894797 100644 (file)
@@ -22,7 +22,7 @@
 #include <devices/ide.h>
 #include <palacios/vmm_socket.h>
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 5c70d3b..36da2aa 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <devices/ide.h>
 
-#ifndef DEBUG_NVRAM
+#ifndef CONFIG_DEBUG_NVRAM
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 7cd1147..2e7044f 100644 (file)
@@ -32,7 +32,7 @@
 #include <devices/pci.h>
 #include <devices/pci_types.h>
 
-#ifndef DEBUG_PCI
+#ifndef CONFIG_DEBUG_PCI
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -99,7 +99,7 @@ struct pci_internal {
 
 
 
-#ifdef DEBUG_PCI
+#ifdef CONFIG_DEBUG_PCI
 
 static void pci_dump_state(struct pci_internal * pci_state) {
     struct rb_node * node = v3_rb_first(&(pci_state->bus_list[0].devices));
@@ -875,7 +875,7 @@ struct pci_device * v3_pci_register_device(struct vm_device * pci,
     // add the device
     add_device_to_bus(bus, pci_dev);
 
-#ifdef DEBUG_PCI
+#ifdef CONFIG_DEBUG_PCI
     pci_dump_state(pci_state);
 #endif
 
index a139fc0..87670c7 100644 (file)
@@ -22,7 +22,7 @@
 #include <palacios/vmm_dev_mgr.h>
 #include <devices/ide.h>
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 6c61ad4..6a5730c 100644 (file)
@@ -23,7 +23,7 @@
 
 
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 826c405..c0b20f8 100644 (file)
@@ -28,9 +28,6 @@ obj-y := \
        vmm_time.o \
        vmm_util.o \
        vmm_xed.o \
-       vmm_instrument.o \
-       vmm_profiler.o \
-       vmm_socket.o \
        vmm_binaries.o 
 
 
@@ -48,10 +45,11 @@ obj-$(CONFIG_VMX) +=        vmx.o \
                        vmx_handler.o \
                        vmx_io.o \
                        vmx_lowlevel.o \
-                       vmx_msr.o
+                       vmx_msr.o \
+                       vmcs.o
 
 
-#obj-$(CONFIG_INSTRUMENT) +=   vmm_instrument.o \
-#                              vmm_profiler 
 
-#obj-$(CONFIG_SOCKET) +=  vmm_socket.o
+obj-$(CONFIG_INSTRUMENT_VMM) += vmm_instrument.o
+obj-$(CONFIG_PROFILE_VMM) += vmm_profiler.o 
+obj-$(CONFIG_SOCKET) +=  vmm_socket.o
index d2444ac..4a1b404 100644 (file)
@@ -321,9 +321,11 @@ static int start_svm_guest(struct guest_info *info) {
        if ((num_exits % 5000) == 0) {
            PrintDebug("SVM Exit number %d\n", num_exits);
 
+#ifdef CONFIG_PROFILE_VMM
            if (info->enable_profiler) {
                v3_print_profile(info);
            }
+#endif
        }
 
        if (v3_handle_svm_exit(info) != 0) {
index 2e6f9e2..a8bf0b9 100644 (file)
@@ -22,7 +22,7 @@
 #include <palacios/vmm_intr.h>
 
 
-#ifndef DEBUG_HALT
+#ifndef CONFIG_DEBUG_HALT
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index f7fd96e..a70b0dd 100644 (file)
@@ -72,7 +72,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
 
     if ((info->intr_state.irq_pending == 1) && (guest_ctrl->guest_ctrl.V_IRQ == 0)) {
 
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
        PrintDebug("INTAK cycle completed for irq %d\n", info->intr_state.irq_vector);
 #endif
 
@@ -83,7 +83,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
     }
 
     if ((info->intr_state.irq_started == 1) && (guest_ctrl->exit_int_info.valid == 0)) {
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
        PrintDebug("Interrupt %d taken by guest\n", info->intr_state.irq_vector);
 #endif
 
@@ -91,16 +91,17 @@ int v3_handle_svm_exit(struct guest_info * info) {
        info->intr_state.irq_started = 0;
 
     } else {
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
        PrintDebug("EXIT INT INFO is set (vec=%d)\n", guest_ctrl->exit_int_info.vector);
 #endif
     }
 
 
-
+#ifdef CONFIG_PROFILE_VMM
     if (info->enable_profiler) {
        rdtscll(info->profiler.start_time);
     }
+#endif
 
 
     //PrintDebug("SVM Returned: Exit Code: %x\n",exit_code); 
@@ -151,7 +152,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
                
            break;
        case VMEXIT_CR0_WRITE: 
-#ifdef DEBUG_CTRL_REGS
+#ifdef CONFIG_DEBUG_CTRL_REGS
            PrintDebug("CR0 Write\n");
 #endif
            if (v3_handle_cr0_write(info) == -1) {
@@ -159,7 +160,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }
            break;
        case VMEXIT_CR0_READ: 
-#ifdef DEBUG_CTRL_REGS
+#ifdef CONFIG_DEBUG_CTRL_REGS
            PrintDebug("CR0 Read\n");
 #endif
            if (v3_handle_cr0_read(info) == -1) {
@@ -167,7 +168,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }
            break;
        case VMEXIT_CR3_WRITE: 
-#ifdef DEBUG_CTRL_REGS
+#ifdef CONFIG_DEBUG_CTRL_REGS
            PrintDebug("CR3 Write\n");
 #endif
            if (v3_handle_cr3_write(info) == -1) {
@@ -175,7 +176,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }    
            break;
        case  VMEXIT_CR3_READ: 
-#ifdef DEBUG_CTRL_REGS
+#ifdef CONFIG_DEBUG_CTRL_REGS
            PrintDebug("CR3 Read\n");
 #endif
            if (v3_handle_cr3_read(info) == -1) {
@@ -183,7 +184,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }
            break;
        case VMEXIT_CR4_WRITE: 
-#ifdef DEBUG_CTRL_REGS
+#ifdef CONFIG_DEBUG_CTRL_REGS
            PrintDebug("CR4 Write\n");
 #endif
            if (v3_handle_cr4_write(info) == -1) {
@@ -191,7 +192,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }    
            break;
        case  VMEXIT_CR4_READ: 
-#ifdef DEBUG_CTRL_REGS
+#ifdef CONFIG_DEBUG_CTRL_REGS
            PrintDebug("CR4 Read\n");
 #endif
            if (v3_handle_cr4_read(info) == -1) {
@@ -201,7 +202,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
        case VMEXIT_EXCP14: {
            addr_t fault_addr = guest_ctrl->exit_info2;
            pf_error_t * error_code = (pf_error_t *)&(guest_ctrl->exit_info1);
-#ifdef DEBUG_SHADOW_PAGING
+#ifdef CONFIG_DEBUG_SHADOW_PAGING
            PrintDebug("PageFault at %p (error=%d)\n", 
                       (void *)fault_addr, *(uint_t *)error_code);
 #endif
@@ -231,7 +232,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }
        case VMEXIT_INVLPG: 
            if (info->shdw_pg_mode == SHADOW_PAGING) {
-#ifdef DEBUG_SHADOW_PAGING
+#ifdef CONFIG_DEBUG_SHADOW_PAGING
                PrintDebug("Invlpg\n");
 #endif
                if (v3_handle_shadow_invlpg(info) == -1) {
@@ -258,7 +259,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            //   handle_svm_smi(info); // ignored for now
            break;
        case VMEXIT_HLT:
-#ifdef DEBUG_HALT
+#ifdef CONFIG_DEBUG_HALT
            PrintDebug("Guest halted\n");
 #endif
            if (v3_handle_svm_halt(info) == -1) {
@@ -272,7 +273,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }
            break;
        case VMEXIT_WBINVD:   
-#ifdef DEBUG_EMULATOR
+#ifdef CONFIG_DEBUG_EMULATOR
            PrintDebug("WBINVD\n");
 #endif
            if (v3_handle_svm_wbinvd(info) == -1) { 
@@ -319,11 +320,12 @@ int v3_handle_svm_exit(struct guest_info * info) {
     }
     // END OF SWITCH (EXIT_CODE)
 
-
+#ifdef CONFIG_PROFILE_VMM
     if (info->enable_profiler) {
        rdtscll(info->profiler.end_time);
        v3_profile_exit(info, exit_code);
     }
+#endif
 
 
     if (v3_excp_pending(info)) {
@@ -334,7 +336,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
        if (info->excp_state.excp_error_code_valid) {
            guest_ctrl->EVENTINJ.error_code = info->excp_state.excp_error_code;
            guest_ctrl->EVENTINJ.ev = 1;
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
            PrintDebug("Injecting exception %d with error code %x\n", excp, guest_ctrl->EVENTINJ.error_code);
 #endif
        }
@@ -342,14 +344,14 @@ int v3_handle_svm_exit(struct guest_info * info) {
        guest_ctrl->EVENTINJ.vector = excp;
        
        guest_ctrl->EVENTINJ.valid = 1;
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
        PrintDebug("Injecting Exception %d (EIP=%p)\n", 
                   guest_ctrl->EVENTINJ.vector, 
                   (void *)(addr_t)info->rip);
 #endif
        v3_injecting_excp(info, excp);
     } else if (info->intr_state.irq_started == 1) {
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
        PrintDebug("IRQ pending from previous injection\n");
 #endif
        guest_ctrl->guest_ctrl.V_IRQ = 1;
@@ -367,7 +369,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
                guest_ctrl->guest_ctrl.V_IGN_TPR = 1;
                guest_ctrl->guest_ctrl.V_INTR_PRIO = 0xf;
 
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
                PrintDebug("Injecting Interrupt %d (EIP=%p)\n", 
                           guest_ctrl->guest_ctrl.V_INTR_VECTOR, 
                           (void *)(addr_t)info->rip);
index 3f71bc1..c009a25 100644 (file)
@@ -23,7 +23,7 @@
 #include <palacios/vmm_decoder.h>
 #include <palacios/vm_guest_mem.h>
 
-#ifndef DEBUG_IO
+#ifndef CONFIG_DEBUG_IO
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index e01eee7..7ec24c6 100644 (file)
@@ -97,12 +97,14 @@ int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_p
        info->shdw_pg_mode = SHADOW_PAGING;
     }
 
+#ifdef CONFIG_PROFILE_VMM
     if (config_ptr->enable_profiling) {
        info->enable_profiler = 1;
        v3_init_profiler(info);
     } else {
        info->enable_profiler = 0;
     }
+#endif
 
     if (config_ptr->schedule_freq == 0) {
        // set the schedule frequency to 100 HZ
index 5975daf..ba6e9c5 100644 (file)
@@ -25,7 +25,7 @@
 #include <palacios/vmm_ctrl_regs.h>
 #include <palacios/vmm_direct_paging.h>
 
-#ifndef DEBUG_CTRL_REGS
+#ifndef CONFIG_DEBUG_CTRL_REGS
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 3492f7c..c212958 100644 (file)
@@ -23,7 +23,7 @@
 #include <palacios/vmm_decoder.h>
 
 
-#ifndef DEBUG_DEV_MGR
+#ifndef CONFIG_DEBUG_DEV_MGR
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -50,7 +50,7 @@ int v3_init_devices() {
     struct v3_device_info * tmp_dev =  __start__v3_devices;
     int i = 0;
 
-#ifdef DEBUG_DEV_MGR
+#ifdef CONFIG_DEBUG_DEV_MGR
     {
        int num_devices = (__stop__v3_devices - __start__v3_devices) / sizeof(struct v3_device_info);
        PrintDebug("%d Virtual devices registered with Palacios\n", num_devices);
@@ -213,7 +213,7 @@ int v3_attach_device(struct guest_info * vm, struct vm_device * dev ) {
 }
 
 
-#ifdef DEBUG_DEV_MGR
+#ifdef CONFIG_DEBUG_DEV_MGR
 
 void PrintDebugDevMgr(struct guest_info * info) {
     struct vmm_dev_mgr * mgr = &(info->dev_mgr);
index 674fc56..f3ef009 100644 (file)
@@ -25,7 +25,7 @@
 #include <palacios/vm_guest.h>
 
 
-#ifndef DEBUG_NESTED_PAGING
+#ifndef CONFIG_DEBUG_NESTED_PAGING
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 024620e..5fb9226 100644 (file)
@@ -24,7 +24,7 @@
 #include <palacios/vmm_paging.h>
 #include <palacios/vmm_instr_emulator.h>
 
-#ifndef DEBUG_EMULATOR
+#ifndef CONFIG_DEBUG_EMULATOR
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index f7478f7..8146338 100644 (file)
@@ -17,7 +17,7 @@
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
-#ifdef INSTRUMENT_VMM 
+
 
 #include <palacios/svm_handler.h>
 #include <palacios/vmm_instrument.h>
@@ -133,4 +133,3 @@ static void print_instrumentation() {
 
 
 
-#endif
index 358b307..b823c8c 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <palacios/vmm_lock.h>
 
-#ifndef DEBUG_INTERRUPTS
+#ifndef CONFIG_DEBUG_INTERRUPTS
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -288,7 +288,7 @@ intr_type_t v3_get_intr_type(struct guest_info * info) {
        }
     }
 
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
     if (type == V3_INVALID_INTR) {
        PrintError("[get_intr_type] Invalid_Intr\n");
     }
index 793a0f3..4dbd61d 100644 (file)
@@ -24,7 +24,7 @@
 
 
 
-#ifndef DEBUG_IO
+#ifndef CONFIG_DEBUG_IO
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 97a094b..b4ba9ee 100644 (file)
@@ -46,7 +46,7 @@ static pt_entry_type_t pte64_lookup(pte64_t * pt, addr_t addr, addr_t * entry);
 
 
 
-#ifndef DEBUG_SHADOW_PAGING
+#ifndef CONFIG_DEBUG_SHADOW_PAGING
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
index 3f12f05..4a4e719 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <palacios/vmm_direct_paging.h>
 
-#ifndef DEBUG_SHADOW_PAGING
+#ifndef CONFIG_DEBUG_SHADOW_PAGING
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -237,11 +237,15 @@ static struct shadow_page_data * create_new_shadow_pt(struct guest_info * info)
 
 
 static int inject_guest_pf(struct guest_info * info, addr_t fault_addr, pf_error_t error_code) {
+
+#ifdef CONFIG_PROFILE_VMM
     if (info->enable_profiler) {
        info->profiler.guest_pf_cnt++;
     }
+#endif
 
     info->ctrl_regs.cr2 = fault_addr;
+
     return v3_raise_exception_with_error(info, PF_EXCEPTION, *(uint_t *)&error_code);
 }
 
index 329ee0f..de50876 100644 (file)
@@ -26,7 +26,7 @@
 #include <palacios/vmm_ctrl_regs.h>
 
 
-#ifndef DEBUG_EMULATOR
+#ifndef CONFIG_DEBUG_EMULATOR
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -97,7 +97,7 @@ int v3_emulate_memory_read(struct guest_info * info, addr_t read_gva,
        return -1;
     }
 
-#ifdef DEBUG_EMULATOR
+#ifdef CONFIG_DEBUG_EMULATOR
     PrintDebug("Instr (15 bytes) at %p:\n", (void *)(addr_t)instr);
     PrintTraceMemDump(instr, 15);
 #endif  
index 24bac95..bd0d4f0 100644 (file)
@@ -35,7 +35,7 @@
 
 
 
-#ifndef DEBUG_XED
+#ifndef CONFIG_DEBUG_XED
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
@@ -325,7 +325,7 @@ int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * ins
 
     xed_iform_enum_t iform = xed_decoded_inst_get_iform_enum(&xed_instr);
 
-#ifdef DEBUG_XED
+#ifdef CONFIG_DEBUG_XED
     xed_iclass_enum_t iclass = xed_decoded_inst_get_iclass(&xed_instr);
 
     PrintDebug("iform=%s, iclass=%s\n", xed_iform_enum_t2str(iform), xed_iclass_enum_t2str(iclass));
index 445c416..9a1ed31 100644 (file)
@@ -682,15 +682,15 @@ static int init_vmx_guest(struct guest_info * info, struct v3_vm_config * config
 
  
 #define VMXASSIST_START 0x000d0000
-    extern uint8_t vmxassist_start[];
-    extern uint8_t vmxassist_end[];
+    extern uint8_t v3_vmxassist_start[];
+    extern uint8_t v3_vmxassist_end[];
 
     addr_t vmxassist_dst = 0;
     if(guest_pa_to_host_va(info, VMXASSIST_START, &vmxassist_dst) == -1) {
         PrintError("Could not find VMXASSIST destination\n");
         return -1;
     }
-    memcpy((void*)vmxassist_dst, vmxassist_start, vmxassist_end-vmxassist_start);
+    memcpy((void*)vmxassist_dst, v3_vmxassist_start, v3_vmxassist_end - v3_vmxassist_start);
     
     /*** Write all the info to the VMCS ***/
     if(update_vmcs_ctrl_fields(info)) {