mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-03 17:31:42 +00:00
HV: vm description clean up
The partition mode vm config in vm_description.c is abandoned, so delete the file. Its related struct in vm.h is also removed; Tracked-On: #2291 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
55efc763ae
commit
d05af3526f
@ -224,7 +224,6 @@ C_SRCS += dm/vpci/core.c
|
|||||||
C_SRCS += dm/vpci/vpci.c
|
C_SRCS += dm/vpci/vpci.c
|
||||||
ifeq ($(CONFIG_PARTITION_MODE),y)
|
ifeq ($(CONFIG_PARTITION_MODE),y)
|
||||||
C_SRCS += dm/vmptable.c
|
C_SRCS += dm/vmptable.c
|
||||||
C_SRCS += partition/$(CONFIG_BOARD)/vm_description.c
|
|
||||||
C_SRCS += dm/vpci/partition_mode.c
|
C_SRCS += dm/vpci/partition_mode.c
|
||||||
C_SRCS += dm/vpci/hostbridge.c
|
C_SRCS += dm/vpci/hostbridge.c
|
||||||
C_SRCS += dm/vpci/pci_pt.c
|
C_SRCS += dm/vpci/pci_pt.c
|
||||||
|
@ -15,11 +15,6 @@
|
|||||||
#ifdef CONFIG_PARTITION_MODE
|
#ifdef CONFIG_PARTITION_MODE
|
||||||
#include <mptable.h>
|
#include <mptable.h>
|
||||||
#endif
|
#endif
|
||||||
enum vm_privilege_level {
|
|
||||||
VM_PRIVILEGE_LEVEL_HIGH = 0,
|
|
||||||
VM_PRIVILEGE_LEVEL_MEDIUM,
|
|
||||||
VM_PRIVILEGE_LEVEL_LOW
|
|
||||||
};
|
|
||||||
|
|
||||||
#define INVALID_VM_ID 0xffffU
|
#define INVALID_VM_ID 0xffffU
|
||||||
|
|
||||||
@ -303,17 +298,6 @@ struct acrn_vm *get_sos_vm(void);
|
|||||||
#define NUM_E820_ENTRIES 5U
|
#define NUM_E820_ENTRIES 5U
|
||||||
extern const struct e820_entry ve820_entry[NUM_E820_ENTRIES];
|
extern const struct e820_entry ve820_entry[NUM_E820_ENTRIES];
|
||||||
|
|
||||||
struct vm_config_arraies {
|
|
||||||
int32_t num_vm_config;
|
|
||||||
struct acrn_vm_config vm_config_array[CONFIG_MAX_VM_NUM];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct pcpu_vm_config_mapping {
|
|
||||||
struct acrn_vm_config *vm_config_ptr;
|
|
||||||
bool is_bsp;
|
|
||||||
};
|
|
||||||
extern const struct pcpu_vm_config_mapping pcpu_vm_config_map[];
|
|
||||||
|
|
||||||
uint16_t get_vm_pcpu_nums(struct acrn_vm_config *vm_config);
|
uint16_t get_vm_pcpu_nums(struct acrn_vm_config *vm_config);
|
||||||
void vrtc_init(struct acrn_vm *vm);
|
void vrtc_init(struct acrn_vm *vm);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,99 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <hypervisor.h>
|
|
||||||
#include <e820.h>
|
|
||||||
|
|
||||||
static struct vpci_vdev_array vpci_vdev_array1 = {
|
|
||||||
.num_pci_vdev = 2,
|
|
||||||
|
|
||||||
.vpci_vdev_list = {
|
|
||||||
{/*vdev 0: hostbridge */
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
|
|
||||||
{/*vdev 1: SATA controller*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x01U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x12U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct vpci_vdev_array vpci_vdev_array2 = {
|
|
||||||
.num_pci_vdev = 3,
|
|
||||||
|
|
||||||
.vpci_vdev_list = {
|
|
||||||
{/*vdev 0: hostbridge*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
|
|
||||||
{/*vdev 1: USB controller*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x01U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x15U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
|
|
||||||
{/*vdev 2: Ethernet*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x02U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x02U, .d = 0x00U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************/
|
|
||||||
/* User Defined VM definitions */
|
|
||||||
/*******************************/
|
|
||||||
struct vm_config_arraies vm_config_partition = {
|
|
||||||
|
|
||||||
/* Virtual Machine descriptions */
|
|
||||||
.vm_config_array = {
|
|
||||||
{
|
|
||||||
.type = PRE_LAUNCHED_VM,
|
|
||||||
.pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2)),
|
|
||||||
.guest_flags = IO_COMPLETION_POLLING,
|
|
||||||
.memory.start_hpa = 0x100000000UL,
|
|
||||||
.memory.size = 0x20000000UL, /* uses contiguous memory from host */
|
|
||||||
.vm_vuart = true,
|
|
||||||
.os_config.bootargs = "root=/dev/sda3 rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \
|
|
||||||
console=ttyS2 no_timer_check ignore_loglevel log_buf_len=16M \
|
|
||||||
consoleblank=0 tsc=reliable xapic_phys",
|
|
||||||
.vpci_vdev_array = &vpci_vdev_array1,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
.type = PRE_LAUNCHED_VM,
|
|
||||||
.pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3)),
|
|
||||||
.guest_flags = LAPIC_PASSTHROUGH | IO_COMPLETION_POLLING,
|
|
||||||
.memory.start_hpa = 0x120000000UL,
|
|
||||||
.memory.size = 0x20000000UL, /* uses contiguous memory from host */
|
|
||||||
.vm_vuart = true,
|
|
||||||
.os_config.bootargs = "root=/dev/sda3 rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \
|
|
||||||
console=ttyS2 no_timer_check ignore_loglevel log_buf_len=16M \
|
|
||||||
consoleblank=0 tsc=reliable xapic_phys",
|
|
||||||
.vpci_vdev_array = &vpci_vdev_array2,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct pcpu_vm_config_mapping pcpu_vm_config_map[] = {
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[0],
|
|
||||||
.is_bsp = true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[1],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[0],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[1],
|
|
||||||
.is_bsp = true,
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,120 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <hypervisor.h>
|
|
||||||
#include <e820.h>
|
|
||||||
|
|
||||||
static struct vpci_vdev_array vpci_vdev_array1 = {
|
|
||||||
.num_pci_vdev = 3,
|
|
||||||
|
|
||||||
.vpci_vdev_list = {
|
|
||||||
{/*vdev 0: hostbridge */
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
|
|
||||||
{/*vdev 1: Ethernet*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x01U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x03U, .d = 0x00U, .f = 0x1U},
|
|
||||||
},
|
|
||||||
|
|
||||||
{/*vdev 2: USB*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x02U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x15U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct vpci_vdev_array vpci_vdev_array2 = {
|
|
||||||
.num_pci_vdev = 3,
|
|
||||||
|
|
||||||
.vpci_vdev_list = {
|
|
||||||
{/*vdev 0: hostbridge*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
|
|
||||||
{/*vdev 1: SATA controller*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x05U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x00U, .d = 0x14U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
|
|
||||||
{/*vdev 2: Ethernet*/
|
|
||||||
.vbdf.bits = {.b = 0x00U, .d = 0x06U, .f = 0x0U},
|
|
||||||
.pbdf.bits = {.b = 0x03U, .d = 0x00U, .f = 0x0U},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************/
|
|
||||||
/* User Defined VM definitions */
|
|
||||||
/*******************************/
|
|
||||||
struct vm_config_arraies vm_config_partition = {
|
|
||||||
|
|
||||||
/* Virtual Machine descriptions */
|
|
||||||
.vm_config_array = {
|
|
||||||
{
|
|
||||||
.type = PRE_LAUNCHED_VM,
|
|
||||||
.pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2) | PLUG_CPU(4) | PLUG_CPU(6)),
|
|
||||||
.guest_flags = LAPIC_PASSTHROUGH | IO_COMPLETION_POLLING,
|
|
||||||
.memory.start_hpa = 0x100000000UL,
|
|
||||||
.memory.size = 0x80000000UL, /* uses contiguous memory from host */
|
|
||||||
.vm_vuart = true,
|
|
||||||
.os_config.bootargs = "root=/dev/sda rw rootwait noxsave maxcpus=4 nohpet console=hvc0 " \
|
|
||||||
"console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M "\
|
|
||||||
"consoleblank=0 tsc=reliable xapic_phys apic_debug",
|
|
||||||
.vpci_vdev_array = &vpci_vdev_array1,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
.type = PRE_LAUNCHED_VM,
|
|
||||||
.pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3) | PLUG_CPU(5) | PLUG_CPU(7)),
|
|
||||||
.guest_flags = LAPIC_PASSTHROUGH | IO_COMPLETION_POLLING,
|
|
||||||
.memory.start_hpa = 0x180000000UL,
|
|
||||||
.memory.size = 0x80000000UL, /* uses contiguous memory from host */
|
|
||||||
.vm_vuart = true,
|
|
||||||
.os_config.bootargs = "root=/dev/sda2 rw rootwait noxsave maxcpus=4 nohpet console=hvc0 "\
|
|
||||||
"console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M "\
|
|
||||||
"consoleblank=0 tsc=reliable xapic_phys apic_debug",
|
|
||||||
.vpci_vdev_array = &vpci_vdev_array2,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct pcpu_vm_config_mapping pcpu_vm_config_map[] = {
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[0],
|
|
||||||
.is_bsp = true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[1],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[0],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[1],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[0],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[1],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[0],
|
|
||||||
.is_bsp = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.vm_config_ptr = &vm_config_partition.vm_config_array[1],
|
|
||||||
.is_bsp = true,
|
|
||||||
},
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user