Now all configuration macros are named V3_CONFIG* instead of CONFIG* to separate the Palacios namespace
endif
-ifdef CONFIG_LINUX
+ifdef V3_CONFIG_LINUX
DEFAULT_EXTRA_TARGETS=linux_module
else
DEFAULT_EXTRA_TARGETS=
all: palacios $(DEFAULT_EXTRA_TARGETS)
-ifdef CONFIG_LINUX
+ifdef V3_CONFIG_LINUX
CFLAGS += -mcmodel=kernel
else
CFLAGS += -fPIC
endif
-ifdef CONFIG_FRAME_POINTER
+ifdef V3_CONFIG_FRAME_POINTER
CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
else
CFLAGS += -fomit-frame-pointer
endif
-ifdef CONFIG_UNWIND_INFO
+ifdef V3_CONFIG_UNWIND_INFO
CFLAGS += -fasynchronous-unwind-tables
endif
-ifdef CONFIG_DEBUG_INFO
+ifdef V3_CONFIG_DEBUG_INFO
CFLAGS += -g
else
CFLAGS += -O
linux_module/v3vee.ko: linux_module/*.c linux_module/*.h libv3vee.a
- cd linux_module/ && make CONFIG_LINUX_KERN=$(CONFIG_LINUX_KERN)
+ cd linux_module/ && make V3_CONFIG_LINUX_KERN=$(V3_CONFIG_LINUX_KERN)
cp linux_module/v3vee.ko v3vee.ko
# Modules
/ %/: prepare scripts FORCE
- $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+ $(Q)$(MAKE) KBUILD_MODULES=$(if $(V3_CONFIG_MODULES),1) \
$(build)=$(build-dir)
%.ko: prepare scripts FORCE
- $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+ $(Q)$(MAKE) KBUILD_MODULES=$(if $(V3_CONFIG_MODULES),1) \
$(build)=$(build-dir) $(@:.ko=.o)
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
+include $(PWD)/../.config
-LDFLAGS += --whole-archive --script=$(PWD)/link.cmd
+LDFLAGS += --whole-archive --script=$(PWD)/ld.cmd
+
+ifdef V3_CONFIG_SYMMOD
+LDFLAGS += --script=$(PWD)/ld.symmod.cmd
+endif
EXTRA_CFLAGS += -I$(PWD)/../palacios/include/ -DMODULE=1 -D__KERNEL__=1
palacios-debugfs.o
-ifdef CONFIG_PALACIOS_VNET
+ifdef V3_CONFIG_PALACIOS_VNET
v3vee-objs += palacios-vnet.o
endif
-ifdef CONFIG_PALACIOS_PACKET
+ifdef V3_CONFIG_PALACIOS_PACKET
v3vee-objs += palacios-packet.o
endif
-ifdef CONFIG_PALACIOS_SOCKET
+ifdef V3_CONFIG_PALACIOS_SOCKET
v3vee-objs += palacios-socket.o
endif
all:
- $(MAKE) -C $(CONFIG_LINUX_KERN) M=$(PWD) modules
+ $(MAKE) -C $(V3_CONFIG_LINUX_KERN) M=$(PWD) modules
clean:
- $(MAKE) -C $(CONFIG_LINUX_KERN) M=$(PWD) clean
+ $(MAKE) -C $(V3_CONFIG_LINUX_KERN) M=$(PWD) clean
}
-/* _v3_capsules :
- {
- __start__v3_capsules = .;
- *(_v3_capsules);
- __stop__v3_capsules = .;
- }
-*/
_v3_shdw_pg_impls :
{
__start__v3_shdw_pg_impls = .;
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
#include <palacios/vmm_telemetry.h>
#endif
-#ifdef CONFIG_SYMBIOTIC
+#ifdef V3_CONFIG_SYMBIOTIC
#include <palacios/vmm_symbiotic.h>
struct v3_sym_core_state;
#endif
uint64_t num_exits;
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
struct v3_core_telemetry core_telem;
#endif
void * decoder_state;
-#ifdef CONFIG_SYMBIOTIC
+#ifdef V3_CONFIG_SYMBIOTIC
/* Symbiotic state */
struct v3_sym_core_state sym_core_state;
#endif
struct v3_extensions extensions;
-#ifdef CONFIG_SYMBIOTIC
+#ifdef V3_CONFIG_SYMBIOTIC
/* Symbiotic state */
struct v3_sym_vm_state sym_vm_state;
#endif
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
uint_t enable_telemetry;
struct v3_telemetry_state telemetry;
#endif
})
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
#define V3_CREATE_THREAD(fn, arg, name) \
do { \
void v3_print_cond(const char * fmt, ...);
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
void v3_interrupt_cpu(struct v3_vm_info * vm, int logical_cpu, int vector);
#endif
int V3_deinit_devices();
-#ifdef CONFIG_KEYED_STREAMS
+#ifdef V3_CONFIG_KEYED_STREAMS
#include <interfaces/vmm_keyed_stream.h>
#endif
struct v3_device_ops {
int (*free)(void * private_data);
-#ifdef CONFIG_KEYED_STREAMS
+#ifdef V3_CONFIG_KEYED_STREAMS
int (*checkpoint)(struct vm_device *dev, v3_keyed_stream_t stream);
int (*restore)(struct vm_device *dev, v3_keyed_stream_t stream);
#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) 2008, Jack Lange <jarusl@cs.northwestern.edu>
- * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
- * All rights reserved.
- *
- * Author: Chang Bae <c.s.bae@u.northwestern.edu>
- *
- * This is free software. You are permitted to use,
- * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
- */
-
-#ifndef __VMM_INSTRUMENT_H__
-#define __VMM_INSTRUMENT_H__
-
-#ifdef __V3VEE__
-
-#ifdef CONFIG_INSTRUMENT_VMM
-
-#include <palacios/vmm_types.h>
-#include <palacios/vmm_ringbuffer.h>
-
-
-void v3_init_instrumentation() __attribute__((__no_instrument_function__));
-
-#endif // INSTRUMENT_VMM
-
-#endif // __V3VEE__
-
-#endif //
-
-
void * local_impl_data;
-#ifdef CONFIG_SHADOW_PAGING_TELEMETRY
+#ifdef V3_CONFIG_SHADOW_PAGING_TELEMETRY
uint_t guest_faults;
#endif
#include <palacios/vmm_symspy.h>
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
#include <palacios/vmm_symcall.h>
#endif
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
#include <palacios/vmm_symmod.h>
#endif
struct v3_sym_vm_state {
struct v3_symspy_global_state symspy_state;
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
struct v3_symmod_state symmod_state;
#endif
};
struct v3_sym_core_state {
struct v3_symspy_local_state symspy_state;
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
struct v3_symcall_state symcall_state;
#endif
#ifdef __V3VEE__
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
#include <palacios/vmm_rbtree.h>
#include <palacios/vmm_list.h>
// Returns *monotonic* guest time.
static inline uint64_t v3_get_guest_time(struct vm_time *t) {
-#ifdef CONFIG_TIME_HIDE_VM_COST
+#ifdef V3_CONFIG_TIME_HIDE_VM_COST
V3_ASSERT(t->exit_time);
return t->exit_time + t->guest_host_offset;
#else
#include <palacios/vmm_io.h>
-#ifndef CONFIG_DEBUG_PIT
+#ifndef V3_CONFIG_DEBUG_PIT
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
return 0;
}
-#ifdef CONFIG_KEYED_STREAMS
+#ifdef V3_CONFIG_KEYED_STREAMS
static int pit_checkpoint(struct vm_device *dev, v3_keyed_stream_t stream)
{
struct pit *p = (struct pit *) (dev->private_data);
static struct v3_device_ops dev_ops = {
.free = (int (*)(void *))pit_free,
-#ifdef CONFIG_KEYED_STREAMS
+#ifdef V3_CONFIG_KEYED_STREAMS
.checkpoint = pit_checkpoint,
.restore = pit_restore,
#endif
return -1;
}
-#ifdef CONFIG_DEBUG_PIT
+#ifdef V3_CONFIG_DEBUG_PIT
PrintDebug("8254 PIT: OSC_HZ=%d, reload_val=", OSC_HZ);
//PrintTrace(reload_val);
PrintDebug("\n");
init_channel(&(pit_state->ch_1));
init_channel(&(pit_state->ch_2));
-#ifdef CONFIG_DEBUG_PIT
+#ifdef V3_CONFIG_DEBUG_PIT
PrintDebug("8254 PIT: CPU MHZ=%d -- pit count=", cpu_khz / 1000);
//PrintTraceLL(pit_state->pit_counter);
PrintDebug("\n");
#include <palacios/vmm_dev_mgr.h>
#include <palacios/vm_guest.h>
-#ifndef CONFIG_DEBUG_PIC
+#ifndef V3_CONFIG_DEBUG_PIC
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
return -1;
}
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
v3_interrupt_cpu(vm, 0, 0);
#endif
-obj-$(CONFIG_APIC) += apic.o
-obj-$(CONFIG_IO_APIC) += io_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_SERIAL_UART) += serial.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_LINUX_VIRTIO_NET) += lnx_virtio_nic.o
-obj-$(CONFIG_LINUX_VIRTIO_VNET) += lnx_virtio_vnet.o
-obj-$(CONFIG_VNET_NIC) += vnet_nic.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_SWAPBYPASS_DISK_CACHE) += swapbypass_cache.o
-obj-$(CONFIG_SWAPBYPASS_DISK_CACHE2) += swapbypass_cache2.o
-obj-$(CONFIG_DISK_MODEL) += disk_model.o
-obj-$(CONFIG_NIC_BRIDGE) += nic_bridge.o
-
-obj-$(CONFIG_NE2K) += ne2k.o
-obj-$(CONFIG_RTL8139) += rtl8139.o
-
-obj-$(CONFIG_TMPDISK) += tmpdisk.o
-obj-$(CONFIG_RAMDISK) += ramdisk.o
-obj-$(CONFIG_NETDISK) += netdisk.o
-obj-$(CONFIG_FILEDISK) += filedisk.o
-
-obj-$(CONFIG_CGA) += cga.o
-obj-$(CONFIG_TELNET_CONSOLE) += telnet_cons.o
-obj-$(CONFIG_CURSES_CONSOLE) += curses_cons.o
-
-obj-$(CONFIG_PASSTHROUGH_PCI) += pci_passthrough.o
-
-obj-$(CONFIG_SYMMOD) += lnx_virtio_symmod.o
-obj-$(CONFIG_CHAR_STREAM) += char_stream.o
-
-obj-$(CONFIG_MCHECK) += mcheck.o
-
-obj-$(CONFIG_VGA) += vga.o
-
-obj-$(CONFIG_PCI_FRONT) += pci_front.o
+obj-$(V3_CONFIG_APIC) += apic.o
+obj-$(V3_CONFIG_IO_APIC) += io_apic.o
+obj-$(V3_CONFIG_PIT) += 8254.o
+obj-$(V3_CONFIG_PIC) += 8259a.o
+obj-$(V3_CONFIG_BOCHS_DEBUG) += bochs_debug.o
+obj-$(V3_CONFIG_GENERIC) += generic.o
+obj-$(V3_CONFIG_I440FX) += i440fx.o
+obj-$(V3_CONFIG_IDE) += ide.o
+obj-$(V3_CONFIG_SERIAL_UART) += serial.o
+
+obj-$(V3_CONFIG_KEYBOARD) += keyboard.o
+obj-$(V3_CONFIG_LINUX_VIRTIO_BALLOON) += lnx_virtio_balloon.o
+obj-$(V3_CONFIG_LINUX_VIRTIO_BLOCK) += lnx_virtio_blk.o
+obj-$(V3_CONFIG_LINUX_VIRTIO_SYM) += lnx_virtio_sym.o
+obj-$(V3_CONFIG_LINUX_VIRTIO_NET) += lnx_virtio_nic.o
+obj-$(V3_CONFIG_LINUX_VIRTIO_VNET) += lnx_virtio_vnet.o
+obj-$(V3_CONFIG_VNET_NIC) += vnet_nic.o
+obj-$(V3_CONFIG_NVRAM) += nvram.o
+obj-$(V3_CONFIG_OS_DEBUG) += os_debug.o
+obj-$(V3_CONFIG_PCI) += pci.o
+obj-$(V3_CONFIG_PIIX3) += piix3.o
+obj-$(V3_CONFIG_SWAPBYPASS_DISK_CACHE) += swapbypass_cache.o
+obj-$(V3_CONFIG_SWAPBYPASS_DISK_CACHE2) += swapbypass_cache2.o
+obj-$(V3_CONFIG_DISK_MODEL) += disk_model.o
+obj-$(V3_CONFIG_NIC_BRIDGE) += nic_bridge.o
+
+obj-$(V3_CONFIG_NE2K) += ne2k.o
+obj-$(V3_CONFIG_RTL8139) += rtl8139.o
+
+obj-$(V3_CONFIG_TMPDISK) += tmpdisk.o
+obj-$(V3_CONFIG_RAMDISK) += ramdisk.o
+obj-$(V3_CONFIG_NETDISK) += netdisk.o
+obj-$(V3_CONFIG_FILEDISK) += filedisk.o
+
+obj-$(V3_CONFIG_CGA) += cga.o
+obj-$(V3_CONFIG_TELNET_CONSOLE) += telnet_cons.o
+obj-$(V3_CONFIG_CURSES_CONSOLE) += curses_cons.o
+
+obj-$(V3_CONFIG_PASSTHROUGH_PCI) += pci_passthrough.o
+
+obj-$(V3_CONFIG_SYMMOD) += lnx_virtio_symmod.o
+obj-$(V3_CONFIG_CHAR_STREAM) += char_stream.o
+
+obj-$(V3_CONFIG_MCHECK) += mcheck.o
+
+obj-$(V3_CONFIG_VGA) += vga.o
+
+obj-$(V3_CONFIG_PCI_FRONT) += pci_front.o
-#ifndef CONFIG_DEBUG_APIC
+#ifndef V3_CONFIG_DEBUG_APIC
#undef PrintDebug
#define PrintDebug(fmt, args...)
#else
*svc_location &= ~flag;
-#ifdef CONFIG_CRAY_XT
+#ifdef V3_CONFIG_CRAY_XT
if ((isr_irq == 238) ||
(isr_irq == 239)) {
// host maitains logical proc->phsysical proc
PrintDebug(" non-local core with new interrupt, forcing it to exit now\n");
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
v3_interrupt_cpu(dst_core->vm_info, dst_core->cpu_id, 0);
#else
V3_ASSERT(0);
}
if (do_xcall > 0 && (V3_Get_CPU() != dst)) {
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
v3_interrupt_cpu(vm, dst, 0);
#else
V3_ASSERT(0);
PrintDebug("apic %u: (setup device): done, my id is %u\n", i, apic->lapic_id.val);
}
-#ifdef CONFIG_DEBUG_APIC
+#ifdef V3_CONFIG_DEBUG_APIC
for (i = 0; i < vm->num_cores; i++) {
struct apic_state * apic = &(apic_dev->apics[i]);
PrintDebug("apic: sanity check: apic %u (at %p) has id %u and msr value %llx and core at %p\n",
#include <devices/console.h>
-#if CONFIG_DEBUG_CGA >= 2
+#if V3_CONFIG_DEBUG_CGA >= 2
#define PrintVerbose PrintDebug
#else
#define PrintVerbose(fmt, args...)
#endif
-#if CONFIG_DEBUG_CGA == 0
+#if V3_CONFIG_DEBUG_CGA == 0
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
}
}
-#if CONFIG_DEBUG_CGA >= 2
+#if V3_CONFIG_DEBUG_CGA >= 2
static unsigned long get_value(const void *ptr, int len) {
unsigned long value = 0;
#include <interfaces/vmm_file.h>
#include <palacios/vm_guest.h>
-#ifndef CONFIG_DEBUG_FILEDISK
+#ifndef V3_CONFIG_DEBUG_FILEDISK
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_dev_mgr.h>
#include <palacios/vm_guest_mem.h>
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
#include <interfaces/vmm_host_dev.h>
#endif
-#ifndef CONFIG_DEBUG_GENERIC
+#ifndef V3_CONFIG_DEBUG_GENERIC
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
struct generic_internal {
enum {GENERIC_PHYSICAL, GENERIC_HOST} forward_type;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
v3_host_dev_t host_dev;
#endif
struct vm_device *dev; // me
}
return length;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_write_io(state->host_dev,port,src,length);
uint_t i;
int rc;
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
}
return length;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_read_io(state->host_dev,port,dst,length);
uint_t i;
int rc;
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
static int generic_read_port_print_and_ignore(struct guest_info * core, uint16_t port, void * src,
uint_t length, void * priv_data) {
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
uint_t length, void * priv_data) {
int i;
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
memcpy(V3_VAddr((void*)gpa),src,len);
return len;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_write_mem(state->host_dev,gpa,src,len);
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
memcpy(dst,V3_VAddr((void*)gpa),len);
return len;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_read_mem(state->host_dev,gpa,dst,len);
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
PrintDebug("generic (%s): deinit_device\n", state->name);
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
if (state->host_dev) {
v3_host_dev_close(state->host_dev);
state->host_dev=0;
struct generic_internal * state = NULL;
char * dev_id = v3_cfg_val(cfg, "ID");
char * forward = v3_cfg_val(cfg, "forward");
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
char * host_dev = v3_cfg_val(cfg, "hostdev");
#endif
v3_cfg_tree_t * port_cfg = v3_cfg_subtree(cfg, "ports");
if (!strcasecmp(forward,"physical_device")) {
state->forward_type=GENERIC_PHYSICAL;
} else if (!strcasecmp(forward,"host_device")) {
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
state->forward_type=GENERIC_HOST;
#else
PrintError("generic (%s): cannot configure host device since host device support is not built in\n", state->name);
state->dev=dev;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
if (state->forward_type==GENERIC_HOST) {
if (!host_dev) {
PrintError("generic (%s): host forwarding requested, but no host device given\n", state->name);
#include "ide-types.h"
#include "atapi-types.h"
-#ifndef CONFIG_DEBUG_IDE
+#ifndef V3_CONFIG_DEBUG_IDE
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include "ata.h"
-#ifdef CONFIG_DEBUG_IDE
+#ifdef V3_CONFIG_DEBUG_IDE
static void print_prd_table(struct ide_internal * ide, 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 CONFIG_DEBUG_IDE
+#ifdef V3_CONFIG_DEBUG_IDE
print_prd_table(ide, channel);
#endif
#include <devices/apic.h>
#include <palacios/vm_guest.h>
-#ifndef CONFIG_DEBUG_IO_APIC
+#ifndef V3_CONFIG_DEBUG_IO_APIC
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vm_guest.h>
-#ifndef CONFIG_DEBUG_KEYBOARD
+#ifndef V3_CONFIG_DEBUG_KEYBOARD
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_telemetry.h>
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
#include <palacios/vmm_symmod.h>
#endif
}
// PrintGuestPageTables(info, info->shdw_pg_state.guest_cr3);
}
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
else if (evt->scan_code == 0x43) { // F9 Sym test
struct guest_info * core = &(vm->cores[0]);
PrintDebug("Testing sym call\n");
v3_dbg_enable ^= 1;
}
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
else if (evt->scan_code == 0x41) { // F7 telemetry dump
v3_print_telemetry(vm);
}
#endif
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
else if (evt->scan_code == 0x40) { // F6 Test symmod load
v3_load_sym_capsule(vm, "lnx_test");
}
-#ifndef CONFIG_DEBUG_VIRTIO_BLK
+#ifndef V3_CONFIG_DEBUG_VIRTIO_BLK
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_time.h>
-#ifndef CONFIG_DEBUG_VIRTIO_NET
+#ifndef V3_CONFIG_DEBUG_VIRTIO_NET
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <devices/pci.h>
-#ifndef CONFIG_DEBUG_LINUX_VIRTIO_VNET
+#ifndef V3_CONFIG_DEBUG_LINUX_VIRTIO_VNET
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_string.h>
#include <palacios/vmm_cpuid.h>
-#ifndef CONFIG_DEBUG_MCHECK
+#ifndef V3_CONFIG_DEBUG_MCHECK
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vm_guest.h>
#include <palacios/vmm_sprintf.h>
-#ifndef CONFIG_DEBUG_NE2K
+#ifndef V3_CONFIG_DEBUG_NE2K
#undef PrintDebug
#define PrintDebug(fmts, args...)
#endif
static int tx_one_pkt(struct ne2k_state * nic_state, uchar_t *pkt, uint32_t length) {
-#ifdef CONFIG_DEBUG_NE2K
+#ifdef V3_CONFIG_DEBUG_NE2K
PrintDebug("NE2000: Send Packet:\n");
v3_hexdump(pkt, length, NULL, 0);
#endif
static int ne2k_rx(uint8_t * buf, uint32_t size, void * private_data){
struct ne2k_state * nic_state = (struct ne2k_state *)private_data;
-#ifdef CONFIG_DEBUG_NE2K
+#ifdef V3_CONFIG_DEBUG_NE2K
PrintDebug("\nNe2k: Packet Received:\n");
v3_hexdump(buf, size, NULL, 0);
#endif
#include <palacios/vmm_dev_mgr.h>
#include <interfaces/vmm_socket.h>
-#ifndef CONFIG_DEBUG_IDE
+#ifndef V3_CONFIG_DEBUG_IDE
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_sprintf.h>
#include <interfaces/vmm_packet.h>
-#ifndef CONFIG_DEBUG_NIC_BRIDGE
+#ifndef V3_CONFIG_DEBUG_NIC_BRIDGE
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
int synchronize,
void * private_data) {
-#ifdef CONFIG_DEBUG_NIC_BRIDGE
+#ifdef V3_CONFIG_DEBUG_NIC_BRIDGE
{
PrintDebug("NIC Bridge: send pkt size: %d\n", len);
v3_hexdump(buf, len, NULL, 0);
void * private_data) {
struct nic_bridge_state * bridge = (struct nic_bridge_state *)private_data;
-#ifdef CONFIG_DEBUG_NIC_BRIDGE
+#ifdef V3_CONFIG_DEBUG_NIC_BRIDGE
{
PrintDebug("NIC Bridge: recv pkt size: %d\n", evt->size);
v3_hexdump(evt->pkt, evt->size, NULL, 0);
#include <palacios/vm_guest.h>
-#ifndef CONFIG_DEBUG_NVRAM
+#ifndef V3_CONFIG_DEBUG_NVRAM
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
-#ifndef CONFIG_DEBUG_PCI
+#ifndef V3_CONFIG_DEBUG_PCI
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
-#ifdef CONFIG_DEBUG_PCI
+#ifdef V3_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 CONFIG_DEBUG_PCI
+#ifdef V3_CONFIG_DEBUG_PCI
pci_dump_state(pci_state);
#endif
// add the device
add_device_to_bus(bus, pci_dev);
-#ifdef CONFIG_DEBUG_PCI
+#ifdef V3_CONFIG_DEBUG_PCI
pci_dump_state(pci_state);
#endif
#include <interfaces/vmm_host_dev.h>
-#ifndef CONFIG_DEBUG_PCI_FRONT
+#ifndef V3_CONFIG_DEBUG_PCI_FRONT
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_dev_mgr.h>
-#ifndef CONFIG_DEBUG_RAMDISK
+#ifndef V3_CONFIG_DEBUG_RAMDISK
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
-#ifndef CONFIG_DEBUG_RTL8139
+#ifndef V3_CONFIG_DEBUG_RTL8139
#undef PrintDebug
#define PrintDebug(fmts, args...)
#endif
v3_gpa_to_hva(&(nic_state->vm->cores[0]), (addr_t)pkt_gpa, &hostva);
pkt = (uchar_t *)hostva;
-#ifdef CONFIG_DEBUG_RTL8139
+#ifdef V3_CONFIG_DEBUG_RTL8139
v3_hexdump(pkt, txsize, NULL, 0);
#endif
#include <devices/serial.h>
-#ifndef CONFIG_DEBUG_SERIAL
+#ifndef V3_CONFIG_DEBUG_SERIAL
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vm_guest.h>
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
#include <palacios/vmm_telemetry.h>
#endif
union swap_header * hdr;
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
uint32_t pages_in;
uint32_t pages_out;
#endif
int i = 0;
// Notify the shadow paging layer
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
swap->pages_in += length / 4096;
#endif
if ((swap->active == 1) && (offset != 0)) {
int i = 0;
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
swap->pages_out += length / 4096;
#endif
};
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
static void telemetry_cb(struct v3_vm_info * vm, void * private_data, char * hdr) {
struct vm_device * dev = (struct vm_device *)private_data;
struct swap_state * swap = (struct swap_state *)(dev->private_data);
return -1;
}
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
if (vm->enable_telemetry == 1) {
v3_add_telemetry_cb(vm, telemetry_cb, dev);
}
#include <palacios/vmm_hashtable.h>
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
#include <palacios/vmm_telemetry.h>
#endif
struct v3_dev_blk_ops * ops;
void * private_data;
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
uint32_t pages_in;
uint32_t pages_out;
#endif
swap->unswapped_pages += (length / 4096);
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
swap->pages_in += length / 4096;
#endif
swap->swapped_pages += written_pages;
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
swap->pages_out += length / 4096;
#endif
};
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
static void telemetry_cb(struct v3_vm_info * vm, void * private_data, char * hdr) {
struct swap_state * swap = (struct swap_state *)private_data;
}
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
if (vm->enable_telemetry == 1) {
v3_add_telemetry_cb(vm, telemetry_cb, swap);
#include "vga_regs.h"
-#ifndef CONFIG_DEBUG_VGA
+#ifndef V3_CONFIG_DEBUG_VGA
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_sprintf.h>
#include <palacios/vmm_ethernet.h>
-#ifndef CONFIG_DEBUG_VNET_NIC
+#ifndef V3_CONFIG_DEBUG_VNET_NIC
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
obj-y += null.o
-obj-$(CONFIG_EXT_MTRRS) += ext_mtrr.o
-obj-$(CONFIG_EXT_VTSC) += ext_vtsc.o
-obj-$(CONFIG_EXT_VTIME) += ext_vtime.o
-obj-$(CONFIG_EXT_INSPECTOR) += ext_inspector.o
+obj-$(V3_CONFIG_EXT_MTRRS) += ext_mtrr.o
+obj-$(V3_CONFIG_EXT_VTSC) += ext_vtsc.o
+obj-$(V3_CONFIG_EXT_VTIME) += ext_vtime.o
+obj-$(V3_CONFIG_EXT_INSPECTOR) += ext_inspector.o
-obj-$(CONFIG_SOCKET) += vmm_socket.o
-obj-$(CONFIG_PACKET) += vmm_packet.o
-obj-$(CONFIG_FILE) += vmm_file.o
-obj-$(CONFIG_CONSOLE) += vmm_console.o
-obj-$(CONFIG_STREAM) += vmm_stream.o
-obj-$(CONFIG_GRAPHICS_CONSOLE) += vmm_graphics_console.o
-obj-$(CONFIG_KEYED_STREAMS) += vmm_keyed_stream.o
-obj-$(CONFIG_HOST_DEVICE) += vmm_host_dev.o
+obj-$(V3_CONFIG_SOCKET) += vmm_socket.o
+obj-$(V3_CONFIG_PACKET) += vmm_packet.o
+obj-$(V3_CONFIG_FILE) += vmm_file.o
+obj-$(V3_CONFIG_CONSOLE) += vmm_console.o
+obj-$(V3_CONFIG_STREAM) += vmm_stream.o
+obj-$(V3_CONFIG_GRAPHICS_CONSOLE) += vmm_graphics_console.o
+obj-$(V3_CONFIG_KEYED_STREAMS) += vmm_keyed_stream.o
+obj-$(V3_CONFIG_HOST_DEVICE) += vmm_host_dev.o
-obj-$(CONFIG_XED) += vmm_xed.o
-obj-$(CONFIG_V3_DECODER) += vmm_v3dec.o
+obj-$(V3_CONFIG_XED) += vmm_xed.o
+obj-$(V3_CONFIG_V3_DECODER) += vmm_v3dec.o
-obj-$(CONFIG_SVM) += svm.o \
- svm_io.o \
- svm_lowlevel.o \
- svm_msr.o \
- svm_pause.o \
- svm_wbinvd.o \
- svm_handler.o \
- vmcb.o
+obj-$(V3_CONFIG_SVM) += svm.o \
+ svm_io.o \
+ svm_lowlevel.o \
+ svm_msr.o \
+ svm_pause.o \
+ svm_wbinvd.o \
+ svm_handler.o \
+ vmcb.o
-obj-$(CONFIG_VMX) += vmx.o \
- vmx_handler.o \
- vmx_io.o \
- vmx_lowlevel.o \
- vmx_msr.o \
- vmx_hw_info.o \
- vmcs.o \
- vmx_ctrl_regs.o \
- vmx_assist.o \
- vmx_ept.o
+obj-$(V3_CONFIG_VMX) += vmx.o \
+ vmx_handler.o \
+ vmx_io.o \
+ vmx_lowlevel.o \
+ vmx_msr.o \
+ vmx_hw_info.o \
+ vmcs.o \
+ vmx_ctrl_regs.o \
+ vmx_assist.o \
+ vmx_ept.o
-obj-$(CONFIG_INSTRUMENT_VMM) += vmm_instrument.o
-obj-$(CONFIG_TELEMETRY) += vmm_telemetry.o
+obj-$(V3_CONFIG_INSTRUMENT_VMM) += vmm_instrument.o
+obj-$(V3_CONFIG_TELEMETRY) += vmm_telemetry.o
-obj-$(CONFIG_VNET) += vmm_vnet_core.o
+obj-$(V3_CONFIG_VNET) += vmm_vnet_core.o
-obj-$(CONFIG_SYMBIOTIC) += vmm_symbiotic.o vmm_symspy.o
-obj-$(CONFIG_SYMCALL) += vmm_symcall.o
-obj-$(CONFIG_SYMMOD) += vmm_symmod.o
+obj-$(V3_CONFIG_SYMBIOTIC) += vmm_symbiotic.o vmm_symspy.o
+obj-$(V3_CONFIG_SYMCALL) += vmm_symcall.o
+obj-$(V3_CONFIG_SYMMOD) += vmm_symmod.o
obj-y += mmu/
-obj-$(CONFIG_SHADOW_PAGING_VTLB) += vmm_shdw_pg_tlb.o
-obj-$(CONFIG_SWAPBYPASS) += vmm_shdw_pg_swapbypass.o
-obj-$(CONFIG_SHADOW_PAGING_CACHE1) += vmm_shdw_pg_cache.o
+obj-$(V3_CONFIG_SHADOW_PAGING_VTLB) += vmm_shdw_pg_tlb.o
+obj-$(V3_CONFIG_SWAPBYPASS) += vmm_shdw_pg_swapbypass.o
+obj-$(V3_CONFIG_SHADOW_PAGING_CACHE1) += vmm_shdw_pg_cache.o
#define V3_CACHED_PG 0x1
-#ifndef CONFIG_DEBUG_SHDW_PG_CACHE
+#ifndef V3_CONFIG_DEBUG_SHDW_PG_CACHE
#undef PrintDebug
#define PrintDebug(fmt, ...)
#endif
#include <palacios/vmm_paging.h>
-#ifndef CONFIG_DEBUG_SHDW_CACHE
+#ifndef V3_CONFIG_DEBUG_SHDW_CACHE
#undef PrintDebug
#define PrintDebug(fmt, ...)
#endif
-#ifdef CONFIG_SHADOW_CACHE
+#ifdef V3_CONFIG_SHADOW_CACHE
struct pde_chain {
addr_t shadow_pdes[NR_PTE_CHAIN_ENTRIES];
-#ifdef CONFIG_SHADOW_CACHE
+#ifdef V3_CONFIG_SHADOW_CACHE
static inline int activate_shadow_pt_32(struct guest_info * core) {
struct cr3_32 * shadow_cr3 = (struct cr3_32 *)&(core->ctrl_regs.cr3);
-#ifdef CONFIG_SHADOW_CACHE
+#ifdef V3_CONFIG_SHADOW_CACHE
static inline int activate_shadow_pt_32pae(struct guest_info * info) {
PrintError("Activating 32 bit PAE page tables not implemented\n");
-#ifdef CONFIG_SHADOW_CACHE
+#ifdef V3_CONFIG_SHADOW_CACHE
#define PT64_NX_MASK (1ULL << 63)
//#define SHOW_ALL
#include <palacios/vmm_hashtable.h>
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
#include <palacios/vmm_telemetry.h>
#endif
struct swapbypass_vm_state {
struct v3_swap_dev devs[256];
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
uint32_t read_faults;
uint32_t write_faults;
uint32_t flushes;
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
static void telemetry_cb(struct v3_vm_info * vm, void * private_data, char * hdr) {
struct swapbypass_vm_state * swap_state = (struct swapbypass_vm_state *)(vm->shdw_impl.impl_data);
if (shdw_ptr_list == NULL) {
shdw_ptr_list = (struct list_head *)V3_Malloc(sizeof(struct list_head));
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
swap_state->list_size++;
#endif
INIT_LIST_HEAD(shdw_ptr_list);
if (shdw_ptr == NULL) {
PrintError("MEMORY LEAK\n");
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
telemetry_cb(vm, NULL, "");
#endif
return 0;
// PrintDebug("Flushing Symbiotic Swap table\n");
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
swap_state->flushes++;
#endif
memset(sb_state, 0, sizeof(struct swapbypass_vm_state));
sb_state->shdw_ptr_ht = v3_create_htable(0, swap_hash_fn, swap_eq_fn);
-#ifdef CONFIG_SWAPBYPASS_TELEMETRY
+#ifdef V3_CONFIG_SWAPBYPASS_TELEMETRY
if (vm->enable_telemetry) {
v3_add_telemetry_cb(vm, telemetry_cb, NULL);
}
-#ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY
+#ifdef V3_CONFIG_SYMBIOTIC_SWAP_TELEMETRY
if (error_code.write == 0) {
info->vm_info->swap_state.read_faults++;
} else {
shadow_pte->page_base_addr = swp_pg_pa;
-#ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY
+#ifdef V3_CONFIG_SYMBIOTIC_SWAP_TELEMETRY
info->vm_info->swap_state.mapped_pages++;
#endif
// PrintError("Swap fault handled\n");
#include <palacios/vm_guest_mem.h>
-#ifndef CONFIG_DEBUG_SHDW_PG_VTLB
+#ifndef V3_CONFIG_DEBUG_SHDW_PG_VTLB
#undef PrintDebug
#define PrintDebug(fmt, ...)
#endif
#include <palacios/vmm_sprintf.h>
-#ifndef CONFIG_DEBUG_SVM
+#ifndef V3_CONFIG_DEBUG_SVM
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
uint32_t v3_last_exit;
// This is a global pointer to the host's VMCB
-static addr_t host_vmcbs[CONFIG_MAX_CPUS] = { [0 ... CONFIG_MAX_CPUS - 1] = 0};
+static addr_t host_vmcbs[V3_CONFIG_MAX_CPUS] = { [0 ... V3_CONFIG_MAX_CPUS - 1] = 0};
ctrl_area->instrs.HLT = 1;
-#ifdef CONFIG_TIME_VIRTUALIZE_TSC
+#ifdef V3_CONFIG_TIME_VIRTUALIZE_TSC
ctrl_area->instrs.RDTSC = 1;
ctrl_area->svm_instrs.RDTSCP = 1;
#endif
if ((info->intr_core_state.irq_pending == 1) && (guest_ctrl->guest_ctrl.V_IRQ == 0)) {
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
PrintDebug("INTAK cycle completed for irq %d\n", info->intr_core_state.irq_vector);
#endif
}
if ((info->intr_core_state.irq_started == 1) && (guest_ctrl->exit_int_info.valid == 0)) {
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
PrintDebug("Interrupt %d taken by guest\n", info->intr_core_state.irq_vector);
#endif
info->intr_core_state.irq_started = 0;
} else if ((info->intr_core_state.irq_started == 1) && (guest_ctrl->exit_int_info.valid == 1)) {
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
PrintDebug("EXIT INT INFO is set (vec=%d)\n", guest_ctrl->exit_int_info.vector);
#endif
}
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 CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
PrintDebug("Injecting exception %d with error code %x\n", excp, guest_ctrl->EVENTINJ.error_code);
#endif
}
guest_ctrl->EVENTINJ.valid = 1;
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
PrintDebug("<%d> Injecting Exception %d (CR2=%p) (EIP=%p)\n",
(int)info->num_exits,
guest_ctrl->EVENTINJ.vector,
v3_injecting_excp(info, excp);
} else if (info->intr_core_state.irq_started == 1) {
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_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 CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
PrintDebug("Injecting Interrupt %d (EIP=%p)\n",
guest_ctrl->guest_ctrl.V_INTR_VECTOR,
(void *)(addr_t)info->rip);
guest_state->rip = info->rip;
guest_state->rsp = info->vm_regs.rsp;
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
if (info->sym_core_state.symcall_state.sym_call_active == 0) {
update_irq_entry_state(info);
}
(void *)(addr_t)info->rip);
*/
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
if (info->sym_core_state.symcall_state.sym_call_active == 1) {
if (guest_ctrl->guest_ctrl.V_IRQ == 1) {
V3_Print("!!! Injecting Interrupt during Sym call !!!\n");
exit_info2 = guest_ctrl->exit_info2;
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
if (info->sym_core_state.symcall_state.sym_call_active == 0) {
update_irq_exit_state(info);
}
#include <palacios/vmm_cpuid.h>
#include <palacios/vmm_direct_paging.h>
-#ifndef CONFIG_DEBUG_SVM
+#ifndef V3_CONFIG_DEBUG_SVM
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
#include <palacios/vmm_telemetry.h>
#endif
int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_info1, addr_t exit_info2) {
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
if (info->vm_info->enable_telemetry) {
v3_telemetry_start_exit(info);
}
break;
case VMEXIT_CR0_WRITE:
-#ifdef CONFIG_DEBUG_CTRL_REGS
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
PrintDebug("CR0 Write\n");
#endif
if (v3_handle_cr0_write(info) == -1) {
}
break;
case VMEXIT_CR0_READ:
-#ifdef CONFIG_DEBUG_CTRL_REGS
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
PrintDebug("CR0 Read\n");
#endif
if (v3_handle_cr0_read(info) == -1) {
}
break;
case VMEXIT_CR3_WRITE:
-#ifdef CONFIG_DEBUG_CTRL_REGS
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
PrintDebug("CR3 Write\n");
#endif
if (v3_handle_cr3_write(info) == -1) {
break;
case VMEXIT_CR3_READ:
-#ifdef CONFIG_DEBUG_CTRL_REGS
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
PrintDebug("CR3 Read\n");
#endif
if (v3_handle_cr3_read(info) == -1) {
}
break;
case VMEXIT_CR4_WRITE:
-#ifdef CONFIG_DEBUG_CTRL_REGS
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
PrintDebug("CR4 Write\n");
#endif
if (v3_handle_cr4_write(info) == -1) {
}
break;
case VMEXIT_CR4_READ:
-#ifdef CONFIG_DEBUG_CTRL_REGS
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
PrintDebug("CR4 Read\n");
#endif
if (v3_handle_cr4_read(info) == -1) {
case VMEXIT_EXCP14: {
addr_t fault_addr = exit_info2;
pf_error_t * error_code = (pf_error_t *)&(exit_info1);
-#ifdef CONFIG_DEBUG_SHADOW_PAGING
+#ifdef V3_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 CONFIG_DEBUG_SHADOW_PAGING
+#ifdef V3_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 CONFIG_DEBUG_HALT
+#ifdef V3_CONFIG_DEBUG_HALT
PrintDebug("Guest halted\n");
#endif
if (v3_handle_halt(info) == -1) {
}
break;
case VMEXIT_WBINVD:
-#ifdef CONFIG_DEBUG_EMULATOR
+#ifdef V3_CONFIG_DEBUG_EMULATOR
PrintDebug("WBINVD\n");
#endif
if (v3_handle_svm_wbinvd(info) == -1) {
}
break;
case VMEXIT_RDTSC:
-#ifdef CONFIG_DEBUG_TIME
+#ifdef V3_CONFIG_DEBUG_TIME
PrintDebug("RDTSC/RDTSCP\n");
#endif
if (v3_handle_rdtsc(info) == -1) {
}
break;
case VMEXIT_RDTSCP:
-#ifdef CONFIG_DEBUG_TIME
+#ifdef V3_CONFIG_DEBUG_TIME
PrintDebug("RDTSCP\n");
#endif
if (v3_handle_rdtscp(info) == -1) {
}
// END OF SWITCH (EXIT_CODE)
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
if (info->vm_info->enable_telemetry) {
v3_telemetry_end_exit(info, exit_code);
}
#include <palacios/vmm_decoder.h>
#include <palacios/vm_guest_mem.h>
-#ifndef CONFIG_DEBUG_IO
+#ifndef V3_CONFIG_DEBUG_IO
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
v3_print_guest_state(core);
// init SVM/VMX
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
if ((cpu_type == V3_SVM_CPU) || (cpu_type == V3_SVM_REV3_CPU)) {
cpu_valid = 1;
PrintDebugVMCB((vmcb_t *)(core->vmm_data));
}
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
if ((cpu_type == V3_VMX_CPU) || (cpu_type == V3_VMX_EPT_CPU) || (cpu_type == V3_VMX_EPT_UG_CPU)) {
cpu_valid = 1;
v3_print_vmcs();
}
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
#include <palacios/svm.h>
#include <palacios/svm_io.h>
#include <palacios/svm_msr.h>
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
#include <palacios/vmx.h>
#include <palacios/vmx_io.h>
#include <palacios/vmx_msr.h>
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
v3_init_telemetry(vm);
#endif
v3_init_time_vm(vm);
-#ifdef CONFIG_SYMBIOTIC
+#ifdef V3_CONFIG_SYMBIOTIC
v3_init_symbiotic_vm(vm);
#endif
// init SVM/VMX
switch (cpu_type) {
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
case V3_SVM_CPU:
case V3_SVM_REV3_CPU:
v3_init_svm_io_map(vm);
v3_init_svm_msr_map(vm);
break;
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
case V3_VMX_CPU:
case V3_VMX_EPT_CPU:
case V3_VMX_EPT_UG_CPU:
-#ifdef CONFIG_SYMBIOTIC
+#ifdef V3_CONFIG_SYMBIOTIC
v3_deinit_symbiotic_vm(vm);
#endif
// init SVM/VMX
switch (cpu_type) {
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
case V3_SVM_CPU:
case V3_SVM_REV3_CPU:
v3_deinit_svm_io_map(vm);
v3_deinit_svm_msr_map(vm);
break;
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
case V3_VMX_CPU:
case V3_VMX_EPT_CPU:
case V3_VMX_EPT_UG_CPU:
v3_deinit_io_map(vm);
v3_deinit_hypercall_map(vm);
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
v3_deinit_telemetry(vm);
#endif
/*
* Initialize the subsystem data strutures
*/
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
v3_init_core_telemetry(core);
#endif
v3_init_decoder(core);
-#ifdef CONFIG_SYMBIOTIC
+#ifdef V3_CONFIG_SYMBIOTIC
v3_init_symbiotic_core(core);
#endif
switch (cpu_type) {
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
case V3_SVM_CPU:
case V3_SVM_REV3_CPU:
if (v3_init_svm_vmcb(core, vm->vm_class) == -1) {
}
break;
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
case V3_VMX_CPU:
case V3_VMX_EPT_CPU:
case V3_VMX_EPT_UG_CPU:
v3_cpu_arch_t cpu_type = v3_get_cpu_type(V3_Get_CPU());
-#ifdef CONFIG_SYMBIOTIC
+#ifdef V3_CONFIG_SYMBIOTIC
v3_deinit_symbiotic_core(core);
#endif
v3_free_passthrough_pts(core);
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
v3_deinit_core_telemetry(core);
#endif
switch (cpu_type) {
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
case V3_SVM_CPU:
case V3_SVM_REV3_CPU:
if (v3_deinit_svm_vmcb(core) == -1) {
}
break;
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
case V3_VMX_CPU:
case V3_VMX_EPT_CPU:
case V3_VMX_EPT_UG_CPU:
#include <palacios/vmm_sprintf.h>
#include <palacios/vmm_extensions.h>
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
#include <palacios/svm.h>
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
#include <palacios/vmx.h>
#endif
-#ifdef CONFIG_VNET
+#ifdef V3_CONFIG_VNET
#include <palacios/vmm_vnet.h>
#endif
-v3_cpu_arch_t v3_cpu_types[CONFIG_MAX_CPUS];
+v3_cpu_arch_t v3_cpu_types[V3_CONFIG_MAX_CPUS];
struct v3_os_hooks * os_hooks = NULL;
int v3_dbg_enable = 0;
static void init_cpu(void * arg) {
uint32_t cpu_id = (uint32_t)(addr_t)arg;
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
if (v3_is_svm_capable()) {
PrintDebug("Machine is SVM Capable\n");
v3_init_svm_cpu(cpu_id);
} else
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
if (v3_is_vmx_capable()) {
PrintDebug("Machine is VMX Capable\n");
v3_init_vmx_cpu(cpu_id);
switch (v3_cpu_types[cpu_id]) {
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
case V3_SVM_CPU:
case V3_SVM_REV3_CPU:
PrintDebug("Deinitializing SVM CPU %d\n", cpu_id);
v3_deinit_svm_cpu(cpu_id);
break;
#endif
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
case V3_VMX_CPU:
case V3_VMX_EPT_CPU:
case V3_VMX_EPT_UG_CPU:
// Set global variables.
os_hooks = hooks;
- for (i = 0; i < CONFIG_MAX_CPUS; i++) {
+ for (i = 0; i < V3_CONFIG_MAX_CPUS; i++) {
v3_cpu_types[i] = V3_INVALID_CPU;
}
V3_init_extensions();
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
V3_init_symmod();
#endif
-#ifdef CONFIG_VNET
+#ifdef V3_CONFIG_VNET
v3_init_vnet();
#endif
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
if ((hooks) && (hooks->call_on_cpu)) {
for (i = 0; i < num_cpus; i++) {
V3_deinit_extensions();
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
V3_deinit_symmod();
#endif
-#ifdef CONFIG_VNET
+#ifdef V3_CONFIG_VNET
v3_deinit_vnet();
#endif
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
if ((os_hooks) && (os_hooks->call_on_cpu)) {
- for (i = 0; i < CONFIG_MAX_CPUS; i++) {
+ for (i = 0; i < V3_CONFIG_MAX_CPUS; i++) {
if (v3_cpu_types[i] != V3_INVALID_CPU) {
deinit_cpu((void *)(addr_t)i);
}
core->cpu_id, (void *)(addr_t)core->rip);
switch (v3_cpu_types[0]) {
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
case V3_SVM_CPU:
case V3_SVM_REV3_CPU:
return v3_start_svm_guest(core);
break;
#endif
-#if CONFIG_VMX
+#if V3_CONFIG_VMX
case V3_VMX_CPU:
case V3_VMX_EPT_CPU:
case V3_VMX_EPT_UG_CPU:
// For the moment very ugly. Eventually we will shift the cpu_mask to an arbitrary sized type...
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
#define MAX_CORES 32
#else
#define MAX_CORES 1
return -1;
}
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
// spawn off new threads, for other cores
for (i = 0, vcore_id = 1; (i < MAX_CORES) && (vcore_id < vm->num_cores); i++) {
int major = 0;
}
-#ifdef CONFIG_MULTITHREAD_OS
+#ifdef V3_CONFIG_MULTITHREAD_OS
void v3_interrupt_cpu(struct v3_vm_info * vm, int logical_cpu, int vector) {
extern struct v3_os_hooks * os_hooks;
int v3_vm_enter(struct guest_info * info) {
switch (v3_cpu_types[0]) {
-#ifdef CONFIG_SVM
+#ifdef V3_CONFIG_SVM
case V3_SVM_CPU:
case V3_SVM_REV3_CPU:
return v3_svm_enter(info);
break;
#endif
-#if CONFIG_VMX
+#if V3_CONFIG_VMX
case V3_VMX_CPU:
case V3_VMX_EPT_CPU:
case V3_VMX_EPT_UG_CPU:
.data
-#ifdef CONFIG_VMX
+#ifdef V3_CONFIG_VMX
.globl v3_vmxassist_start
v3_vmxassist_start:
-.incbin CONFIG_VMXASSIST_PATH
+.incbin V3_CONFIG_VMXASSIST_PATH
.globl v3_vmxassist_end
v3_vmxassist_end:
#endif
.globl v3_vgabios_start
v3_vgabios_start:
-.incbin CONFIG_VGABIOS_PATH
+.incbin V3_CONFIG_VGABIOS_PATH
.global v3_vgabios_end
v3_vgabios_end:
.globl v3_rombios_start
v3_rombios_start:
-.incbin CONFIG_ROMBIOS_PATH
+.incbin V3_CONFIG_ROMBIOS_PATH
.globl v3_rombios_end
v3_rombios_end:
-#ifdef CONFIG_USE_PXE_BIOS
+#ifdef V3_CONFIG_USE_PXE_BIOS
.globl pxebios_start
pxebios_start:
-.incbin CONFIG_PXEBIOS_PATH
+.incbin V3_CONFIG_PXEBIOS_PATH
.globl pxebios_end
pxebios_end:
#endif
}
}
-#ifndef CONFIG_ALIGNED_PG_ALLOC
+#ifndef V3_CONFIG_ALIGNED_PG_ALLOC
if (alignment != PAGE_SIZE_4KB) {
PrintError("Aligned page allocations are not supported in this host (requested alignment=%d)\n", alignment);
PrintError("Ignoring alignment request\n");
return -1;
}
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
{
char * telemetry = v3_cfg_val(vm_cfg, "telemetry");
#include <palacios/vmm_direct_paging.h>
#include <palacios/svm.h>
-#ifndef CONFIG_DEBUG_CTRL_REGS
+#ifndef V3_CONFIG_DEBUG_CTRL_REGS
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_decoder.h>
-#ifndef CONFIG_DEBUG_DEV_MGR
+#ifndef V3_CONFIG_DEBUG_DEV_MGR
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
struct v3_device_info * tmp_dev = __start__v3_devices;
int i = 0;
-#ifdef CONFIG_DEBUG_DEV_MGR
+#ifdef V3_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);
#include <palacios/vm_guest.h>
-#ifndef CONFIG_DEBUG_NESTED_PAGING
+#ifndef V3_CONFIG_DEBUG_NESTED_PAGING
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_instr_emulator.h>
#include <palacios/vmm_ctrl_regs.h>
-#ifndef CONFIG_DEBUG_EMULATOR
+#ifndef V3_CONFIG_DEBUG_EMULATOR
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_intr.h>
-#ifndef CONFIG_DEBUG_HALT
+#ifndef V3_CONFIG_DEBUG_HALT
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_lock.h>
-#ifndef CONFIG_DEBUG_INTERRUPTS
+#ifndef V3_CONFIG_DEBUG_INTERRUPTS
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
}
}
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
if (type == V3_INVALID_INTR) {
PrintError("[get_intr_type] Invalid_Intr\n");
}
-#ifndef CONFIG_DEBUG_IO
+#ifndef V3_CONFIG_DEBUG_IO
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
map->base_region.guest_start = 0;
map->base_region.guest_end = mem_pages * PAGE_SIZE_4KB;
-#ifdef CONFIG_ALIGNED_PG_ALLOC
+#ifdef V3_CONFIG_ALIGNED_PG_ALLOC
map->base_region.host_addr = (addr_t)V3_AllocAlignedPages(mem_pages, vm->mem_align);
#else
map->base_region.host_addr = (addr_t)V3_AllocPages(mem_pages);
-#ifndef CONFIG_DEBUG_SHADOW_PAGING
+#ifndef V3_CONFIG_DEBUG_SHADOW_PAGING
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
-#ifdef CONFIG_SHADOW_PAGING_TELEMETRY
+#ifdef V3_CONFIG_SHADOW_PAGING_TELEMETRY
#include <palacios/vmm_telemetry.h>
#endif
-#ifdef CONFIG_SYMBIOTIC_SWAP
+#ifdef V3_CONFIG_SYMBIOTIC_SWAP
#include <palacios/vmm_sym_swap.h>
#endif
-#ifndef CONFIG_DEBUG_SHADOW_PAGING
+#ifndef V3_CONFIG_DEBUG_SHADOW_PAGING
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
***/
-#ifdef CONFIG_SHADOW_PAGING_TELEMETRY
+#ifdef V3_CONFIG_SHADOW_PAGING_TELEMETRY
static void telemetry_cb(struct v3_vm_info * vm, void * private_data, char * hdr) {
int i = 0;
for (i = 0; i < vm->num_cores; i++) {
}
-#ifdef CONFIG_SHADOW_PAGING_TELEMETRY
+#ifdef V3_CONFIG_SHADOW_PAGING_TELEMETRY
v3_add_telemetry_cb(core->vm_info, telemetry_cb, NULL);
#endif
return -1;
}
-#ifdef CONFIG_SHADOW_PAGING_TELEMETRY
+#ifdef V3_CONFIG_SHADOW_PAGING_TELEMETRY
v3_remove_telemetry_cb(core->vm_info, telemetry_cb, NULL);
#endif
int v3_inject_guest_pf(struct guest_info * core, addr_t fault_addr, pf_error_t error_code) {
core->ctrl_regs.cr2 = fault_addr;
-#ifdef CONFIG_SHADOW_PAGING_TELEMETRY
+#ifdef V3_CONFIG_SHADOW_PAGING_TELEMETRY
core->shdw_pg_state.guest_faults++;
#endif
-#if defined(CONFIG_BUILT_IN_STDIO) && \
- ( defined(CONFIG_BUILT_IN_SPRINTF) || \
- defined(CONFIG_BUILT_IN_SNPRINTF) || \
- defined(CONFIG_BUILT_IN_VSPRINTF) || \
- defined(CONFIG_BUILT_IN_VSNRPRINTF ))
+#if defined(V3_CONFIG_BUILT_IN_STDIO) && \
+ ( defined(V3_CONFIG_BUILT_IN_SPRINTF) || \
+ defined(V3_CONFIG_BUILT_IN_SNPRINTF) || \
+ defined(V3_CONFIG_BUILT_IN_VSPRINTF) || \
+ defined(V3_CONFIG_BUILT_IN_VSNRPRINTF ))
static char * ksprintn(char * nbuf, uint64_t num, int base, int *len, int upper);
static void snprintf_func(int ch, void * arg);
static int kvprintf(char const * fmt, void (*func)(int, void *), void * arg, int radix, va_list ap);
-#ifdef CONFIG_BUILT_IN_SPRINTF
+#ifdef V3_CONFIG_BUILT_IN_SPRINTF
/*
* Scaled down version of sprintf(3).
*/
#endif
-#ifdef CONFIG_BUILT_IN_VSPRINTF
+#ifdef V3_CONFIG_BUILT_IN_VSPRINTF
/*
* Scaled down version of vsprintf(3).
*/
#endif
-#ifdef CONFIG_BUILT_IN_SNPRINTF
+#ifdef V3_CONFIG_BUILT_IN_SNPRINTF
/*
* Scaled down version of snprintf(3).
*/
-#ifdef CONFIG_BUILT_IN_VSNRPRINTF
+#ifdef V3_CONFIG_BUILT_IN_VSNRPRINTF
/*
* Kernel version which takes radix argument vsnprintf(3).
*/
}
-#endif // CONFIG_BUILT_IN_STDIO
+#endif // V3_CONFIG_BUILT_IN_STDIO
#include <palacios/vmm.h>
-#ifdef CONFIG_BUILT_IN_MEMSET
+#ifdef V3_CONFIG_BUILT_IN_MEMSET
void * memset(void * s, int c, size_t n) {
uchar_t * p = (uchar_t *) s;
}
#endif
-#ifdef CONFIG_BUILT_IN_MEMCPY
+#ifdef V3_CONFIG_BUILT_IN_MEMCPY
void * memcpy(void * dst, const void * src, size_t n) {
uchar_t * d = (uchar_t *) dst;
const uchar_t * s = (const uchar_t *)src;
}
#endif
-#ifdef CONFIG_BUILT_IN_MEMMOVE
+#ifdef V3_CONFIG_BUILT_IN_MEMMOVE
void * memmove(void * dst, const void * src, size_t n) {
uint8_t * tmp = (uint8_t *)V3_Malloc(n);
#endif
-#ifdef CONFIG_BUILT_IN_MEMCMP
+#ifdef V3_CONFIG_BUILT_IN_MEMCMP
int memcmp(const void * s1_, const void * s2_, size_t n) {
const char * s1 = s1_;
const char * s2 = s2_;
#endif
-#ifdef CONFIG_BUILT_IN_STRLEN
+#ifdef V3_CONFIG_BUILT_IN_STRLEN
size_t strlen(const char * s) {
size_t len = 0;
-#ifdef CONFIG_BUILT_IN_STRNLEN
+#ifdef V3_CONFIG_BUILT_IN_STRNLEN
/*
* This it a GNU extension.
* It is like strlen(), but it will check at most maxlen
#endif
-#ifdef CONFIG_BUILT_IN_STRCMP
+#ifdef V3_CONFIG_BUILT_IN_STRCMP
int strcmp(const char * s1, const char * s2) {
while (1) {
int cmp = (*s1 - *s2);
}
#endif
-#ifdef CONFIG_BUILT_IN_STRCASECMP
+#ifdef V3_CONFIG_BUILT_IN_STRCASECMP
int strcasecmp(const char * s1, const char * s2) {
while (1) {
int cmp = (tolower(*s1) - tolower(*s2));
#endif
-#ifdef CONFIG_BUILT_IN_STRNCMP
+#ifdef V3_CONFIG_BUILT_IN_STRNCMP
int strncmp(const char * s1, const char * s2, size_t limit) {
size_t i = 0;
}
#endif
-#ifdef CONFIG_BUILT_IN_STRNCASECMP
+#ifdef V3_CONFIG_BUILT_IN_STRNCASECMP
int strncasecmp(const char * s1, const char * s2, size_t limit) {
size_t i = 0;
#endif
-#ifdef CONFIG_BUILT_IN_STRCAT
+#ifdef V3_CONFIG_BUILT_IN_STRCAT
char * strcat(char * s1, const char * s2) {
char * t1 = s1;
#endif
-#ifdef CONFIG_BUILT_IN_STRNCAT
+#ifdef V3_CONFIG_BUILT_IN_STRNCAT
char * strncat(char * s1, const char * s2, size_t limit) {
size_t i = 0;
char * t1;
-#ifdef CONFIG_BUILT_IN_STRCPY
+#ifdef V3_CONFIG_BUILT_IN_STRCPY
char * strcpy(char * dest, const char * src)
{
char *ret = dest;
#endif
-#ifdef CONFIG_BUILT_IN_STRNCPY
+#ifdef V3_CONFIG_BUILT_IN_STRNCPY
char * strncpy(char * dest, const char * src, size_t limit) {
char * ret = dest;
-#ifdef CONFIG_BUILT_IN_STRDUP
+#ifdef V3_CONFIG_BUILT_IN_STRDUP
char * strdup(const char * s1) {
char *ret;
-#ifdef CONFIG_BUILT_IN_ATOI
+#ifdef V3_CONFIG_BUILT_IN_ATOI
int atoi(const char * buf) {
int ret = 0;
-#ifdef CONFIG_BUILT_IN_STRCHR
+#ifdef V3_CONFIG_BUILT_IN_STRCHR
char * strchr(const char * s, int c) {
while (*s != '\0') {
if (*s == c)
#endif
-#ifdef CONFIG_BUILT_IN_STRRCHR
+#ifdef V3_CONFIG_BUILT_IN_STRRCHR
char * strrchr(const char * s, int c) {
size_t len = strlen(s);
const char * p = s + len;
}
#endif
-#ifdef CONFIG_BUILT_IN_STRPBRK
+#ifdef V3_CONFIG_BUILT_IN_STRPBRK
char * strpbrk(const char * s, const char * accept) {
size_t setLen = strlen(accept);
}
#endif
-#ifdef CONFIG_BUILT_IN_STRSPN
+#ifdef V3_CONFIG_BUILT_IN_STRSPN
size_t strspn(const char * s, const char * accept) {
int match = 1;
int cnt = 0;
#endif
-#ifdef CONFIG_BUILT_IN_STRCSPN
+#ifdef V3_CONFIG_BUILT_IN_STRCSPN
size_t strcspn(const char * s, const char * reject) {
int match = 0;
int cnt = 0;
#endif
-#ifdef CONFIG_BUILT_IN_STRSTR
+#ifdef V3_CONFIG_BUILT_IN_STRSTR
char *strstr(const char *haystack, const char *needle)
{
int l1, l2;
return -1;
}
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
if (v3_init_symcall_vm(vm) == -1) {
PrintError("Error intializing global SymCall state\n");
return -1;
}
#endif
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
if (v3_init_symmod_vm(vm, vm->cfg_data->cfg) == -1) {
PrintError("Error initializing global SymMod state\n");
return -1;
int v3_deinit_symbiotic_vm(struct v3_vm_info * vm) {
-#ifdef CONFIG_SYMMOD
+#ifdef V3_CONFIG_SYMMOD
if (v3_deinit_symmod_vm(vm) == -1) {
PrintError("Error deinitializing global SymMod state\n");
return -1;
#include <palacios/vmm_sprintf.h>
-#ifdef CONFIG_TELEMETRY_GRANULARITY
-#define DEFAULT_GRANULARITY CONFIG_TELEMETRY_GRANULARITY
+#ifdef V3_CONFIG_TELEMETRY_GRANULARITY
+#define DEFAULT_GRANULARITY V3_CONFIG_TELEMETRY_GRANULARITY
#else
#define DEFAULT_GRANULARITY 50000
#endif
#include <palacios/vmm_time.h>
#include <palacios/vm_guest.h>
-#ifndef CONFIG_DEBUG_TIME
+#ifndef V3_CONFIG_DEBUG_TIME
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_decoder.h>
#include <palacios/vmm_instr_decoder.h>
-#ifndef CONFIG_DEBUG_DECODER
+#ifndef V3_CONFIG_DEBUG_DECODER
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
instr->instr_length += length;
-#ifdef CONFIG_DEBUG_DECODER
+#ifdef V3_CONFIG_DEBUG_DECODER
v3_print_instr(instr);
#endif
#include <palacios/vmm_sprintf.h>
#include <palacios/vmm_ethernet.h>
-#ifndef CONFIG_DEBUG_VNET
+#ifndef V3_CONFIG_DEBUG_VNET
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
} vnet_state;
-#ifdef CONFIG_DEBUG_VNET
+#ifdef V3_CONFIG_DEBUG_VNET
static inline void mac_to_string(uint8_t * mac, char * buf) {
snprintf(buf, 100, "%2x:%2x:%2x:%2x:%2x:%2x",
mac[0], mac[1], mac[2],
new_route = (struct vnet_route_info *)V3_Malloc(sizeof(struct vnet_route_info));
memset(new_route, 0, sizeof(struct vnet_route_info));
-#ifdef CONFIG_DEBUG_VNET
+#ifdef V3_CONFIG_DEBUG_VNET
PrintDebug("VNET/P Core: add_route_entry:\n");
print_route(&route);
#endif
v3_unlock_irqrestore(vnet_state.lock, flags);
-#ifdef CONFIG_DEBUG_VNET
+#ifdef V3_CONFIG_DEBUG_VNET
dump_routes();
#endif
// uint8_t src_type = pkt->src_type;
// uint32_t src_link = pkt->src_id;
-#ifdef CONFIG_DEBUG_VNET
+#ifdef V3_CONFIG_DEBUG_VNET
{
char dst_str[100];
char src_str[100];
-#ifndef CONFIG_DEBUG_DECODER
+#ifndef V3_CONFIG_DEBUG_DECODER
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
xed_iform_enum_t iform = xed_decoded_inst_get_iform_enum(&xed_instr);
-#ifdef CONFIG_DEBUG_DECODER
+#ifdef V3_CONFIG_DEBUG_DECODER
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));
#include <palacios/vmx_assist.h>
#include <palacios/vmx_hw_info.h>
-#ifndef CONFIG_DEBUG_VMX
+#ifndef V3_CONFIG_DEBUG_VMX
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
extern v3_cpu_arch_t v3_cpu_types[];
-static addr_t active_vmcs_ptrs[CONFIG_MAX_CPUS] = { [0 ... CONFIG_MAX_CPUS - 1] = 0};
-static addr_t host_vmcs_ptrs[CONFIG_MAX_CPUS] = { [0 ... CONFIG_MAX_CPUS - 1] = 0};
+static addr_t active_vmcs_ptrs[V3_CONFIG_MAX_CPUS] = { [0 ... V3_CONFIG_MAX_CPUS - 1] = 0};
+static addr_t host_vmcs_ptrs[V3_CONFIG_MAX_CPUS] = { [0 ... V3_CONFIG_MAX_CPUS - 1] = 0};
extern int v3_vmx_launch(struct v3_gprs * vm_regs, struct guest_info * info, struct v3_ctrl_regs * ctrl_regs);
extern int v3_vmx_resume(struct v3_gprs * vm_regs, struct guest_info * info, struct v3_ctrl_regs * ctrl_regs);
vmx_state->pri_proc_ctrls.pause_exit = 0;
vmx_state->pri_proc_ctrls.tsc_offset = 1;
-#ifdef CONFIG_TIME_VIRTUALIZE_TSC
+#ifdef V3_CONFIG_TIME_VIRTUALIZE_TSC
vmx_state->pri_proc_ctrls.rdtsc_exit = 1;
#endif
check_vmcs_read(VMCS_IDT_VECTOR_INFO, &(idt_vec_info.value));
if ((info->intr_core_state.irq_started == 1) && (idt_vec_info.valid == 0)) {
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
V3_Print("Calling v3_injecting_intr\n");
#endif
info->intr_core_state.irq_started = 0;
check_vmcs_write(VMCS_ENTRY_EXCP_ERR, info->excp_state.excp_error_code);
int_info.error_code = 1;
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
V3_Print("Injecting exception %d with error code %x\n",
int_info.vector, info->excp_state.excp_error_code);
#endif
}
int_info.valid = 1;
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
V3_Print("Injecting exception %d (EIP=%p)\n", int_info.vector, (void *)(addr_t)info->rip);
#endif
check_vmcs_write(VMCS_ENTRY_INT_INFO, int_info.value);
if ((info->intr_core_state.irq_started == 1) && (idt_vec_info.valid == 1)) {
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
V3_Print("IRQ pending from previous injection\n");
#endif
ent_int.error_code = 0;
ent_int.valid = 1;
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
V3_Print("Injecting Interrupt %d at exit %u(EIP=%p)\n",
info->intr_core_state.irq_vector,
(uint32_t)info->num_exits,
check_vmcs_read(VMCS_EXIT_INSTR_LEN, &instr_len);
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
V3_Print("Enabling Interrupt-Window exiting: %d\n", instr_len);
#endif
v3_vmx_restore_vmcs(info);
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
if (info->sym_core_state.symcall_state.sym_call_active == 0) {
update_irq_entry_state(info);
}
exit_log[info->num_exits % 10] = exit_info;
-#ifdef CONFIG_SYMCALL
+#ifdef V3_CONFIG_SYMCALL
if (info->sym_core_state.symcall_state.sym_call_active == 0) {
update_irq_exit_state(info);
}
vmx_info->pri_proc_ctrls.int_wndw_exit = 0;
vmcs_write(VMCS_PROC_CTRLS, vmx_info->pri_proc_ctrls.value);
-#ifdef CONFIG_DEBUG_INTERRUPTS
+#ifdef V3_CONFIG_DEBUG_INTERRUPTS
V3_Print("Interrupts available again! (RIP=%llx)\n", info->rip);
#endif
}
#include <palacios/vmx.h>
#include <palacios/vmm_ctrl_regs.h>
-#ifndef CONFIG_DEBUG_VMX
+#ifndef V3_CONFIG_DEBUG_VMX
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
#include <palacios/vmm_direct_paging.h>
#include <palacios/vmm_ctrl_regs.h>
-#if 0
-#ifndef CONFIG_DEBUG_VMX
+#ifndef V3_CONFIG_DEBUG_VMX
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
-#endif
static v3_reg_t * get_reg_ptr(struct guest_info * info, struct vmx_exit_cr_qual * cr_qual);
static int handle_mov_to_cr0(struct guest_info * info, v3_reg_t * new_val, struct vmx_exit_info * exit_info);
#include <palacios/vmm_halt.h>
#include <palacios/vmx_ept.h>
-#ifndef CONFIG_DEBUG_VMX
+#ifndef V3_CONFIG_DEBUG_VMX
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
#include <palacios/vmm_telemetry.h>
#endif
}
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
if (info->vm_info->enable_telemetry) {
v3_telemetry_start_exit(info);
}
// JRL: Change "0x0e" to a macro value
if ((uint8_t)exit_info->int_info == 14) {
-#ifdef CONFIG_DEBUG_SHADOW_PAGING
+#ifdef V3_CONFIG_DEBUG_SHADOW_PAGING
PrintDebug("Page Fault at %p error_code=%x\n", (void *)exit_info->exit_qual, *(uint32_t *)&error_code);
#endif
break;
case VMEXIT_RDTSC:
-#ifdef CONFIG_DEBUG_TIME
+#ifdef V3_CONFIG_DEBUG_TIME
PrintDebug("RDTSC\n");
#endif
if (v3_handle_rdtsc(info) == -1) {
}
-#ifdef CONFIG_TELEMETRY
+#ifdef V3_CONFIG_TELEMETRY
if (info->vm_info->enable_telemetry) {
v3_telemetry_end_exit(info, exit_info->exit_reason);
}
#include <palacios/vm_guest_mem.h>
#include <palacios/vmm_decoder.h>
-#ifndef CONFIG_DEBUG_IO
+#ifndef V3_CONFIG_DEBUG_IO
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
sym = NULL;
switch (line[0]) {
case '#':
- if (memcmp(line + 2, "CONFIG_", 7))
+ if (memcmp(line + 2, "V3_CONFIG_", 10))
continue;
- p = strchr(line + 9, ' ');
+ p = strchr(line + 12, ' ');
if (!p)
continue;
*p++ = 0;
if (strncmp(p, "is not set", 10))
continue;
- sym = sym_find(line + 9);
+ sym = sym_find(line + 12);
if (!sym) {
- conf_warning("trying to assign nonexistent symbol %s", line + 9);
+ conf_warning("trying to assign nonexistent symbol %s", line + 12);
break;
} else if (!(sym->flags & SYMBOL_NEW)) {
conf_warning("trying to reassign symbol %s", sym->name);
;
}
break;
- case 'C':
- if (memcmp(line, "CONFIG_", 7)) {
- conf_warning("unexpected data");
+ case 'V':
+ if (memcmp(line, "V3_CONFIG_", 10)) {
+ conf_warning("unexpected data (1)");
continue;
}
- p = strchr(line + 7, '=');
+ p = strchr(line + 10, '=');
if (!p)
continue;
*p++ = 0;
p2 = strchr(p, '\n');
if (p2)
*p2 = 0;
- sym = sym_find(line + 7);
+ sym = sym_find(line + 10);
if (!sym) {
- conf_warning("trying to assign nonexistent symbol %s", line + 7);
+ conf_warning("trying to assign nonexistent symbol %s", line + 10);
break;
} else if (!(sym->flags & SYMBOL_NEW)) {
conf_warning("trying to reassign symbol %s", sym->name);
case '\n':
break;
default:
- conf_warning("unexpected data");
+ conf_warning("unexpected data (2)");
continue;
}
if (sym && sym_is_choice_value(sym)) {
case S_TRISTATE:
switch (sym_get_tristate_value(sym)) {
case no:
- fprintf(out, "# CONFIG_%s is not set\n", sym->name);
+ fprintf(out, "# V3_CONFIG_%s is not set\n", sym->name);
if (out_h)
- fprintf(out_h, "#undef CONFIG_%s\n", sym->name);
+ fprintf(out_h, "#undef V3_CONFIG_%s\n", sym->name);
break;
case mod:
- fprintf(out, "CONFIG_%s=m\n", sym->name);
+ fprintf(out, "V3_CONFIG_%s=m\n", sym->name);
if (out_h)
- fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
+ fprintf(out_h, "#define V3_CONFIG_%s_MODULE 1\n", sym->name);
break;
case yes:
- fprintf(out, "CONFIG_%s=y\n", sym->name);
+ fprintf(out, "V3_CONFIG_%s=y\n", sym->name);
if (out_h)
- fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
+ fprintf(out_h, "#define V3_CONFIG_%s 1\n", sym->name);
break;
}
break;
case S_STRING:
// fix me
str = sym_get_string_value(sym);
- fprintf(out, "CONFIG_%s=\"", sym->name);
+ fprintf(out, "V3_CONFIG_%s=\"", sym->name);
if (out_h)
- fprintf(out_h, "#define CONFIG_%s \"", sym->name);
+ fprintf(out_h, "#define V3_CONFIG_%s \"", sym->name);
do {
l = strcspn(str, "\"\\");
if (l) {
case S_HEX:
str = sym_get_string_value(sym);
if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+ fprintf(out, "V3_CONFIG_%s=%s\n", sym->name, str);
if (out_h)
- fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
+ fprintf(out_h, "#define V3_CONFIG_%s 0x%s\n", sym->name, str);
break;
}
case S_INT:
str = sym_get_string_value(sym);
- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+ fprintf(out, "V3_CONFIG_%s=%s\n", sym->name, str);
if (out_h)
- fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
+ fprintf(out_h, "#define V3_CONFIG_%s %s\n", sym->name, str);
break;
}
}