mainmenu "Palacios VMM Configuration"
 
-config x86_64
-       bool
-       default y
-       help
-         Support for the x86-64 architecture.
-
-
 menu "Target Configuration"
 
 config CRAY_XT
        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
 
          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
 
 
 
        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"
 
 
 
 struct shadow_page_state;
 struct v3_intr_state;
-struct v3_profiler;
 
+#ifdef CONFIG_PROFILE_VMM
+struct v3_profiler;
+#endif
 
 
 
     uint64_t yield_start_cycle;
     
 
-
+#ifdef CONFIG_PROFILE_VMM
     uint_t enable_profiler;
     struct v3_profiler profiler;
+#endif
 
     void * decoder_state;
 };
 
 
 #ifdef __V3VEE__
 
-#ifdef INSTRUMENT_VMM 
+#ifdef CONFIG_INSTRUMENT_VMM 
 
 #include <palacios/vmm_types.h>
 #include <palacios/vmm_ringbuffer.h>
 
 
 #ifdef __V3VEE__
 
+#ifdef CONFIG_PROFILE_VMM 
+
 #include <palacios/vmm_rbtree.h>
 
 struct guest_info;
 
 void v3_print_profile(struct guest_info * info);
 
+#endif
 
 #endif
 
 
 
 
 
-#ifndef DEBUG_PIT
+#ifndef CONFIG_DEBUG_PIT
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
     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");
     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");
 
 #include <palacios/vmm.h>
 #include <palacios/vmm_dev_mgr.h>
 
-#ifndef DEBUG_PIC
+#ifndef CONFIG_DEBUG_PIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
-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 
 
 #include <palacios/vmm_msr.h>
 
 
-#ifndef DEBUG_APIC
+#ifndef CONFIG_DEBUG_APIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
 
 
-#ifndef DEBUG_GENERIC
+#ifndef CONFIG_DEBUG_GENERIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 #include "ide-types.h"
 #include "atapi-types.h"
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 #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;
     // 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
 
 
 #include <devices/apic.h>
 
 
-#ifndef DEBUG_IO_APIC
+#ifndef CONFIG_DEBUG_IO_APIC
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 #include <palacios/vmm_lock.h>
 
 
-#ifndef DEBUG_KEYBOARD
+#ifndef CONFIG_DEBUG_KEYBOARD
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 #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
 
 #include <palacios/vmm_debug.h>
 #include <palacios/vmm_string.h>
 
-#ifndef DEBUG_NE2K
+#ifndef CONFIG_DEBUG_NE2K
 #undef PrintDebug
 #define PrintDebug(fmts, args...)
 #endif
 
 #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;
     nic_state->mem[14] = 0x57;
     nic_state->mem[15] = 0x57;
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     dump_state(dev);
 #endif
 
     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]);
     }
     
 
-#ifdef DEBUG_NE2K
+#ifdef CONFIG_DEBUG_NE2K
     dump_state(dev);
 #endif
 
 
 #include <devices/ide.h>
 #include <palacios/vmm_socket.h>
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif 
 
 #include <devices/ide.h>
 #include <palacios/vmm_socket.h>
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
 #include <devices/ide.h>
 
-#ifndef DEBUG_NVRAM
+#ifndef CONFIG_DEBUG_NVRAM
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 #include <devices/pci.h>
 #include <devices/pci_types.h>
 
-#ifndef DEBUG_PCI
+#ifndef CONFIG_DEBUG_PCI
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
 
-#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));
     // add the device
     add_device_to_bus(bus, pci_dev);
 
-#ifdef DEBUG_PCI
+#ifdef CONFIG_DEBUG_PCI
     pci_dump_state(pci_state);
 #endif
 
 
 #include <palacios/vmm_dev_mgr.h>
 #include <devices/ide.h>
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
 
 
-#ifndef DEBUG_IDE
+#ifndef CONFIG_DEBUG_IDE
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
        vmm_time.o \
        vmm_util.o \
        vmm_xed.o \
-       vmm_instrument.o \
-       vmm_profiler.o \
-       vmm_socket.o \
        vmm_binaries.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
 
        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) {
 
 #include <palacios/vmm_intr.h>
 
 
-#ifndef DEBUG_HALT
+#ifndef CONFIG_DEBUG_HALT
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
     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
 
     }
 
     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
 
        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); 
                
            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) {
            }
            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) {
            }
            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) {
            }    
            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) {
            }
            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) {
            }    
            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) {
        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
            }
        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) {
            //   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) {
            }
            break;
        case VMEXIT_WBINVD:   
-#ifdef DEBUG_EMULATOR
+#ifdef CONFIG_DEBUG_EMULATOR
            PrintDebug("WBINVD\n");
 #endif
            if (v3_handle_svm_wbinvd(info) == -1) { 
     }
     // 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)) {
        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
        }
        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;
                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);
 
 #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
 
        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
 
 #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
 
 #include <palacios/vmm_decoder.h>
 
 
-#ifndef DEBUG_DEV_MGR
+#ifndef CONFIG_DEBUG_DEV_MGR
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
     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);
 }
 
 
-#ifdef DEBUG_DEV_MGR
+#ifdef CONFIG_DEBUG_DEV_MGR
 
 void PrintDebugDevMgr(struct guest_info * info) {
     struct vmm_dev_mgr * mgr = &(info->dev_mgr);
 
 #include <palacios/vm_guest.h>
 
 
-#ifndef DEBUG_NESTED_PAGING
+#ifndef CONFIG_DEBUG_NESTED_PAGING
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 #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
 
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
-#ifdef INSTRUMENT_VMM 
+
 
 #include <palacios/svm_handler.h>
 #include <palacios/vmm_instrument.h>
 
 
 
-#endif
 
 
 #include <palacios/vmm_lock.h>
 
-#ifndef DEBUG_INTERRUPTS
+#ifndef CONFIG_DEBUG_INTERRUPTS
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
        }
     }
 
-#ifdef DEBUG_INTERRUPTS
+#ifdef CONFIG_DEBUG_INTERRUPTS
     if (type == V3_INVALID_INTR) {
        PrintError("[get_intr_type] Invalid_Intr\n");
     }
 
 
 
 
-#ifndef DEBUG_IO
+#ifndef CONFIG_DEBUG_IO
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
 
 
-#ifndef DEBUG_SHADOW_PAGING
+#ifndef CONFIG_DEBUG_SHADOW_PAGING
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
 #include <palacios/vmm_direct_paging.h>
 
-#ifndef DEBUG_SHADOW_PAGING
+#ifndef CONFIG_DEBUG_SHADOW_PAGING
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
 
 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);
 }
 
 
 #include <palacios/vmm_ctrl_regs.h>
 
 
-#ifndef DEBUG_EMULATOR
+#ifndef CONFIG_DEBUG_EMULATOR
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
        return -1;
     }
 
-#ifdef DEBUG_EMULATOR
+#ifdef CONFIG_DEBUG_EMULATOR
     PrintDebug("Instr (15 bytes) at %p:\n", (void *)(addr_t)instr);
     PrintTraceMemDump(instr, 15);
 #endif  
 
 
 
 
-#ifndef DEBUG_XED
+#ifndef CONFIG_DEBUG_XED
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
     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));
 
 
  
 #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)) {