From: Jack Lange Date: Mon, 2 May 2011 22:39:40 +0000 (-0500) Subject: moved mptable to a device for the moment X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d406e84682878859284200ae00251d27c53c845;p=palacios-OLD.git moved mptable to a device for the moment this allows the ability to enable/disable it as needed --- diff --git a/palacios/include/palacios/vmm_mptable.h b/palacios/include/palacios/vmm_mptable.h deleted file mode 100644 index eb6a630..0000000 --- a/palacios/include/palacios/vmm_mptable.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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) 2010, Peter Dinda - * Copyright (c) 2008, The V3VEE Project - * All rights reserved. - * - * Author: Peter Dinda - * - * This is free software. You are permitted to use, - * redistribute, and modify it as specified in the file "V3VEE_LICENSE". - */ - -#ifndef __VMM_MPTABLE_H__ -#define __VMM_MPTABLE_H__ - -/* - This module is responsible for injecting an appropriate description of - the multicore guest into the the guest's memory in the form - of an Intel Multiprocessor Specification-compatible MP table. - - The guest BIOS must cooperate in having preallocated space for the table -*/ - -#include -#include -#include - -// Note that this must be run *after* the rombios has been mapped in -// AND the rombios needs to be COPIED in so that we can edit it -int v3_inject_mptable(struct v3_vm_info *vm); - -#endif diff --git a/palacios/src/devices/Kconfig b/palacios/src/devices/Kconfig index 35b8523..86c8dfc 100644 --- a/palacios/src/devices/Kconfig +++ b/palacios/src/devices/Kconfig @@ -18,6 +18,7 @@ config DEBUG_APIC config IO_APIC bool "IOAPIC" + depends on APIC default y help Includes the Virtual IO APIC @@ -30,6 +31,13 @@ config DEBUG_IO_APIC Enable debugging for the IO APIC +config MPTABLE + bool "MPTABLE" + default y + depends on APIC + help + Includes the MPTABLE to map the APICs and IO-APIC + config BOCHS_DEBUG bool "Bochs Debug Console Device" diff --git a/palacios/src/devices/Makefile b/palacios/src/devices/Makefile index 3eb4a87..f3a553e 100644 --- a/palacios/src/devices/Makefile +++ b/palacios/src/devices/Makefile @@ -1,5 +1,6 @@ obj-$(V3_CONFIG_APIC) += apic.o obj-$(V3_CONFIG_IO_APIC) += io_apic.o +obj-$(V3_CONFIG_MPTABLE) += mptable.o obj-$(V3_CONFIG_PIT) += 8254.o obj-$(V3_CONFIG_PIC) += 8259a.o obj-$(V3_CONFIG_BOCHS_DEBUG) += bochs_debug.o diff --git a/palacios/src/palacios/vmm_mptable.c b/palacios/src/devices/mptable.c similarity index 99% rename from palacios/src/palacios/vmm_mptable.c rename to palacios/src/devices/mptable.c index 4b21fcc..64cf96f 100644 --- a/palacios/src/palacios/vmm_mptable.c +++ b/palacios/src/devices/mptable.c @@ -18,7 +18,6 @@ */ #include -#include #include #include @@ -397,8 +396,7 @@ static int write_mptable(void * target, uint32_t numcores) { return 0; } - -int v3_inject_mptable(struct v3_vm_info * vm) { +static int mptable_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { void * target = NULL; if (v3_gpa_to_hva(&(vm->cores[0]), BIOS_MP_TABLE_DEFAULT_LOCATION, (addr_t *)&target) == -1) { @@ -441,3 +439,7 @@ int v3_inject_mptable(struct v3_vm_info * vm) { return 0; } + + + +device_register("MPTABLE", mptable_init) diff --git a/palacios/src/palacios/Makefile b/palacios/src/palacios/Makefile index 2be53ea..8fba939 100644 --- a/palacios/src/palacios/Makefile +++ b/palacios/src/palacios/Makefile @@ -32,7 +32,6 @@ obj-y := \ vmm_cpuid.o \ vmm_xml.o \ vmm_mem_hook.o \ - vmm_mptable.o \ vmm_extensions.o \ vmm_mtrr.o \ vmm_multitree.o \ diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index b000939..8082970 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -30,7 +30,6 @@ #include #include #include -#include #include @@ -353,13 +352,6 @@ static int post_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { return -1; } - /* - * Initialize configured extensions - */ - if (setup_extensions(vm, cfg) == -1) { - PrintError("Failed to setup extensions\n"); - return -1; - } /* * Initialize configured devices @@ -384,6 +376,15 @@ static int post_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { return -1; } + /* + * Initialize configured extensions + */ + if (setup_extensions(vm, cfg) == -1) { + PrintError("Failed to setup extensions\n"); + return -1; + } + + return 0; } diff --git a/palacios/src/palacios/vmm_config_class.h b/palacios/src/palacios/vmm_config_class.h index df42ea6..3f5b238 100644 --- a/palacios/src/palacios/vmm_config_class.h +++ b/palacios/src/palacios/vmm_config_class.h @@ -77,12 +77,6 @@ static int post_config_pc(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { } - if (vm->num_cores > 1) { - if (v3_inject_mptable(vm) == -1) { - PrintError("Failed to inject mptable during configuration\n"); - return -1; - } - } return 0; }