mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-29 04:04:05 +00:00
misc: Update sample launch scripts into generic_board folder.
Currently we use configurator to generate sample launch scripts and configuration code, remove old ones and put all generated launch scripts into generic_board. Tracked-On: #6690 Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
This commit is contained in:
parent
0caf1ac0de
commit
a58d2ebddc
1
debian/acrn-devicemodel.install
vendored
1
debian/acrn-devicemodel.install
vendored
@ -1,3 +1,2 @@
|
||||
usr/bin/acrn-dm
|
||||
usr/share/acrn/bios/
|
||||
usr/share/doc/acrn-devicemodel/samples/
|
||||
|
5
debian/rules
vendored
5
debian/rules
vendored
@ -330,11 +330,6 @@ override_dh_auto_install-arch: debian/acrn-hypervisor.install
|
||||
$(Q)sed -i 's/acrn_tap\* //g' \
|
||||
$(DESTDIR)$(docdir)/acrnd/examples/50-acrn.network
|
||||
@:
|
||||
@# move devicemodel samples
|
||||
$(Q)mkdir -p $(DESTDIR)$(docdir)/acrn-devicemodel
|
||||
$(Q)mv $(DESTDIR)$(datadir)/acrn/samples \
|
||||
$(DESTDIR)$(docdir)/acrn-devicemodel
|
||||
@:
|
||||
@# adapt systemd services for tools (available in DEBUG build only)
|
||||
$(if $(call strequ,${RELEASE},n), \
|
||||
$(Q)sed -i -e '/telemd.socket/d' -e '/prepare.service/d' \
|
||||
|
@ -208,8 +208,6 @@ DISTCLEAN_OBJS := $(shell find $(BASEDIR) -name '*.o')
|
||||
|
||||
PROGRAM := acrn-dm
|
||||
|
||||
SAMPLES_NUC := $(wildcard samples/nuc/*)
|
||||
|
||||
BIOS_BIN := $(wildcard bios/*)
|
||||
|
||||
all: $(DM_OBJDIR)/$(PROGRAM)
|
||||
@ -259,11 +257,9 @@ $(DM_OBJDIR)/%.o: %.c $(HEADERS)
|
||||
[ ! -e $@ ] && mkdir -p $(dir $@); \
|
||||
$(CC) $(CFLAGS) -c $< -o $@ -MMD -MT $@
|
||||
|
||||
install: $(DM_OBJDIR)/$(PROGRAM) install-samples-nuc install-bios
|
||||
install: $(DM_OBJDIR)/$(PROGRAM) install-bios
|
||||
install -D --mode=0755 $(DM_OBJDIR)/$(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
|
||||
|
||||
install-samples-nuc: $(SAMPLES_NUC)
|
||||
install -D -t $(DESTDIR)$(datadir)/acrn/samples/nuc $^
|
||||
|
||||
install-bios: $(BIOS_BIN)
|
||||
install -d $(DESTDIR)$(datadir)/acrn/bios
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6,20 +6,21 @@
|
||||
|
||||
/*
|
||||
* BIOS Information
|
||||
* Vendor: Intel Corp.
|
||||
* Version: TNTGL357.0042.2020.1221.1743
|
||||
* Release Date: 12/21/2020
|
||||
* Vendor: American Megatrends International, LLC.
|
||||
* Version: E5000XXU3F00105-BPCIe
|
||||
* Release Date: 08/25/2021
|
||||
* BIOS Revision: 5.19
|
||||
*
|
||||
* Base Board Information
|
||||
* Manufacturer: Intel Corporation
|
||||
* Product Name: NUC11TNBi5
|
||||
* Version: M11904-403
|
||||
* Manufacturer: Default string
|
||||
* Product Name: Default string
|
||||
* Version: Default string
|
||||
*/
|
||||
|
||||
#include <asm/board.h>
|
||||
#include <asm/vtd.h>
|
||||
#include <asm/msr.h>
|
||||
#include <asm/rdt.h>
|
||||
#include <pci.h>
|
||||
#include <misc_cfg.h>
|
||||
|
||||
@ -39,29 +40,11 @@ static struct dmar_dev_scope drhd1_dev_scope[DRHD1_DEV_CNT] = {
|
||||
.bus = DRHD1_DEVSCOPE0_BUS,
|
||||
.devfun = DRHD1_DEVSCOPE0_PATH,
|
||||
},
|
||||
};
|
||||
|
||||
static struct dmar_dev_scope drhd2_dev_scope[DRHD2_DEV_CNT] = {
|
||||
{
|
||||
.type = DRHD2_DEVSCOPE0_TYPE,
|
||||
.id = DRHD2_DEVSCOPE0_ID,
|
||||
.bus = DRHD2_DEVSCOPE0_BUS,
|
||||
.devfun = DRHD2_DEVSCOPE0_PATH,
|
||||
},
|
||||
};
|
||||
|
||||
static struct dmar_dev_scope drhd3_dev_scope[DRHD3_DEV_CNT] = {
|
||||
{
|
||||
.type = DRHD3_DEVSCOPE0_TYPE,
|
||||
.id = DRHD3_DEVSCOPE0_ID,
|
||||
.bus = DRHD3_DEVSCOPE0_BUS,
|
||||
.devfun = DRHD3_DEVSCOPE0_PATH,
|
||||
},
|
||||
{
|
||||
.type = DRHD3_DEVSCOPE1_TYPE,
|
||||
.id = DRHD3_DEVSCOPE1_ID,
|
||||
.bus = DRHD3_DEVSCOPE1_BUS,
|
||||
.devfun = DRHD3_DEVSCOPE1_PATH,
|
||||
.type = DRHD1_DEVSCOPE1_TYPE,
|
||||
.id = DRHD1_DEVSCOPE1_ID,
|
||||
.bus = DRHD1_DEVSCOPE1_BUS,
|
||||
.devfun = DRHD1_DEVSCOPE1_PATH,
|
||||
},
|
||||
};
|
||||
|
||||
@ -82,22 +65,6 @@ static struct dmar_drhd drhd_info_array[DRHD_COUNT] = {
|
||||
.ignore = DRHD1_IGNORE,
|
||||
.devices = drhd1_dev_scope
|
||||
},
|
||||
{
|
||||
.dev_cnt = DRHD2_DEV_CNT,
|
||||
.segment = DRHD2_SEGMENT,
|
||||
.flags = DRHD2_FLAGS,
|
||||
.reg_base_addr = DRHD2_REG_BASE,
|
||||
.ignore = DRHD2_IGNORE,
|
||||
.devices = drhd2_dev_scope
|
||||
},
|
||||
{
|
||||
.dev_cnt = DRHD3_DEV_CNT,
|
||||
.segment = DRHD3_SEGMENT,
|
||||
.flags = DRHD3_FLAGS,
|
||||
.reg_base_addr = DRHD3_REG_BASE,
|
||||
.ignore = DRHD3_IGNORE,
|
||||
.devices = drhd3_dev_scope
|
||||
},
|
||||
};
|
||||
|
||||
struct dmar_info plat_dmar_info = {
|
||||
@ -106,41 +73,122 @@ struct dmar_info plat_dmar_info = {
|
||||
};
|
||||
|
||||
#ifdef CONFIG_RDT_ENABLED
|
||||
struct platform_clos_info platform_l2_clos_array[MAX_CACHE_CLOS_NUM_ENTRIES];
|
||||
struct platform_clos_info platform_l3_clos_array[MAX_CACHE_CLOS_NUM_ENTRIES];
|
||||
struct platform_clos_info platform_mba_clos_array[MAX_MBA_CLOS_NUM_ENTRIES];
|
||||
union clos_config platform_l2_clos_array_0[8] = {
|
||||
};
|
||||
|
||||
union clos_config platform_l2_clos_array_1[8] = {
|
||||
};
|
||||
|
||||
union clos_config platform_l2_clos_array_2[8] = {
|
||||
};
|
||||
|
||||
union clos_config platform_l2_clos_array_3[8] = {
|
||||
};
|
||||
|
||||
union clos_config platform_l3_clos_array[MAX_CACHE_CLOS_NUM_ENTRIES];
|
||||
union clos_config platform_mba_clos_array[MAX_MBA_CLOS_NUM_ENTRIES];
|
||||
struct rdt_ins rdt_ins_l2[4] = {
|
||||
{
|
||||
.res.cache = {
|
||||
.bitmask = 0xfffff,
|
||||
.cbm_len = 20,
|
||||
.is_cdp_enabled = false,
|
||||
},
|
||||
.num_closids = 8,
|
||||
.num_clos_config = 0,
|
||||
.clos_config_array = platform_l2_clos_array_0,
|
||||
.cpu_mask = 0x1,
|
||||
},
|
||||
{
|
||||
.res.cache = {
|
||||
.bitmask = 0xfffff,
|
||||
.cbm_len = 20,
|
||||
.is_cdp_enabled = false,
|
||||
},
|
||||
.num_closids = 8,
|
||||
.num_clos_config = 0,
|
||||
.clos_config_array = platform_l2_clos_array_1,
|
||||
.cpu_mask = 0x2,
|
||||
},
|
||||
{
|
||||
.res.cache = {
|
||||
.bitmask = 0xfffff,
|
||||
.cbm_len = 20,
|
||||
.is_cdp_enabled = false,
|
||||
},
|
||||
.num_closids = 8,
|
||||
.num_clos_config = 0,
|
||||
.clos_config_array = platform_l2_clos_array_2,
|
||||
.cpu_mask = 0x4,
|
||||
},
|
||||
{
|
||||
.res.cache = {
|
||||
.bitmask = 0xfffff,
|
||||
.cbm_len = 20,
|
||||
.is_cdp_enabled = false,
|
||||
},
|
||||
.num_closids = 8,
|
||||
.num_clos_config = 0,
|
||||
.clos_config_array = platform_l2_clos_array_3,
|
||||
.cpu_mask = 0x8,
|
||||
},
|
||||
};
|
||||
|
||||
struct rdt_type res_cap_info[RDT_NUM_RESOURCES] = {
|
||||
{
|
||||
.res_id = RDT_RESID_L2,
|
||||
.msr_qos_cfg = MSR_IA32_L2_QOS_CFG,
|
||||
.msr_base = MSR_IA32_L2_MASK_BASE,
|
||||
.num_ins = 4,
|
||||
.ins_array = rdt_ins_l2,
|
||||
},
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
static const struct acrn_cstate_data board_cpu_cx[3] = {
|
||||
{{SPACE_FFixedHW, 0x00U, 0x00U, 0x00U, 0x00UL}, 0x01U, 0x01U, 0x00U}, /* C1 */
|
||||
{{SPACE_SYSTEM_IO, 0x08U, 0x00U, 0x00U, 0x1816UL}, 0x02U, 0xFDU, 0x00U}, /* C2 */
|
||||
{{SPACE_SYSTEM_IO, 0x08U, 0x00U, 0x00U, 0x1819UL}, 0x03U, 0x418U, 0x00U}, /* C3 */
|
||||
static const struct acrn_cstate_data board_cpu_cx[1] = {
|
||||
{{SPACE_FFixedHW, 0x00U, 0x00U, 0x00U, 0x00UL}, 0x01U, 0x00U, 0x00U}, /* C1 */
|
||||
};
|
||||
|
||||
static const struct acrn_pstate_data board_cpu_px[16] = {
|
||||
{0x961UL, 0x00UL, 0x0AUL, 0x0AUL, 0x002A00UL, 0x002A00UL}, /* P0 */
|
||||
{0x960UL, 0x00UL, 0x0AUL, 0x0AUL, 0x001800UL, 0x001800UL}, /* P1 */
|
||||
{0x8FCUL, 0x00UL, 0x0AUL, 0x0AUL, 0x001700UL, 0x001700UL}, /* P2 */
|
||||
{0x834UL, 0x00UL, 0x0AUL, 0x0AUL, 0x001500UL, 0x001500UL}, /* P3 */
|
||||
{0x7D0UL, 0x00UL, 0x0AUL, 0x0AUL, 0x001400UL, 0x001400UL}, /* P4 */
|
||||
{0x708UL, 0x00UL, 0x0AUL, 0x0AUL, 0x001200UL, 0x001200UL}, /* P5 */
|
||||
{0x6A4UL, 0x00UL, 0x0AUL, 0x0AUL, 0x001100UL, 0x001100UL}, /* P6 */
|
||||
{0x5DCUL, 0x00UL, 0x0AUL, 0x0AUL, 0x000F00UL, 0x000F00UL}, /* P7 */
|
||||
{0x578UL, 0x00UL, 0x0AUL, 0x0AUL, 0x000E00UL, 0x000E00UL}, /* P8 */
|
||||
{0x514UL, 0x00UL, 0x0AUL, 0x0AUL, 0x000D00UL, 0x000D00UL}, /* P9 */
|
||||
{0x44CUL, 0x00UL, 0x0AUL, 0x0AUL, 0x000B00UL, 0x000B00UL}, /* P10 */
|
||||
{0x384UL, 0x00UL, 0x0AUL, 0x0AUL, 0x000900UL, 0x000900UL}, /* P11 */
|
||||
{0x320UL, 0x00UL, 0x0AUL, 0x0AUL, 0x000800UL, 0x000800UL}, /* P12 */
|
||||
{0x2BCUL, 0x00UL, 0x0AUL, 0x0AUL, 0x000700UL, 0x000700UL}, /* P13 */
|
||||
{0x1F4UL, 0x00UL, 0x0AUL, 0x0AUL, 0x000500UL, 0x000500UL}, /* P14 */
|
||||
{0x190UL, 0x00UL, 0x0AUL, 0x0AUL, 0x000400UL, 0x000400UL}, /* P15 */
|
||||
};
|
||||
/* Px data is not available */
|
||||
static const struct acrn_pstate_data board_cpu_px[0];
|
||||
|
||||
const struct cpu_state_table board_cpu_state_tbl = {
|
||||
"11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz",
|
||||
"11th Gen Intel(R) Core(TM) i7-1185GRE @ 2.80GHz",
|
||||
{(uint8_t)ARRAY_SIZE(board_cpu_px), board_cpu_px,
|
||||
(uint8_t)ARRAY_SIZE(board_cpu_cx), board_cpu_cx}
|
||||
};
|
||||
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
||||
|
||||
const struct vmsix_on_msi_info vmsix_on_msi_devs[MAX_VMSIX_ON_MSI_PDEVS_NUM];
|
||||
|
||||
struct acrn_cpufreq_limits cpufreq_limits[MAX_PCPU_NUM] = {
|
||||
{
|
||||
.guaranteed_hwp_lvl = 255,
|
||||
.highest_hwp_lvl = 255,
|
||||
.lowest_hwp_lvl = 1,
|
||||
.nominal_pstate = 0,
|
||||
.performance_pstate = 0,
|
||||
},
|
||||
{
|
||||
.guaranteed_hwp_lvl = 255,
|
||||
.highest_hwp_lvl = 255,
|
||||
.lowest_hwp_lvl = 1,
|
||||
.nominal_pstate = 0,
|
||||
.performance_pstate = 0,
|
||||
},
|
||||
{
|
||||
.guaranteed_hwp_lvl = 255,
|
||||
.highest_hwp_lvl = 255,
|
||||
.lowest_hwp_lvl = 1,
|
||||
.nominal_pstate = 0,
|
||||
.performance_pstate = 0,
|
||||
},
|
||||
{
|
||||
.guaranteed_hwp_lvl = 255,
|
||||
.highest_hwp_lvl = 255,
|
||||
.lowest_hwp_lvl = 1,
|
||||
.nominal_pstate = 0,
|
||||
.performance_pstate = 0,
|
||||
},
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -7,12 +7,15 @@
|
||||
#ifndef BOARD_INFO_H
|
||||
#define BOARD_INFO_H
|
||||
|
||||
#define MAX_PCPU_NUM 4U
|
||||
#define MAX_VMSIX_ON_MSI_PDEVS_NUM 0U
|
||||
#define MAX_HIDDEN_PDEVS_NUM 0U
|
||||
|
||||
#define HI_MMIO_START 0x4000000000UL
|
||||
#define HI_MMIO_END 0x8000000000UL
|
||||
#define HI_MMIO_SIZE 0x20504000UL
|
||||
#define MAX_HIDDEN_PDEVS_NUM 0U
|
||||
#define MAX_PCPU_NUM 4U
|
||||
#define MAX_VMSIX_ON_MSI_PDEVS_NUM 0U
|
||||
#define MAXIMUM_PA_WIDTH 39U
|
||||
#define MMIO32_START 0X50400000UL
|
||||
#define MMIO32_END 0XC0000000UL
|
||||
#define MMIO64_START 0X4000000000UL
|
||||
#define MMIO64_END 0X8000000000UL
|
||||
#define HI_MMIO_START 0X4000000000UL
|
||||
#define HI_MMIO_END 0X8000000000UL
|
||||
|
||||
#endif /* BOARD_INFO_H */
|
||||
|
@ -6,15 +6,15 @@
|
||||
|
||||
/*
|
||||
* BIOS Information
|
||||
* Vendor: Intel Corp.
|
||||
* Version: TNTGL357.0042.2020.1221.1743
|
||||
* Release Date: 12/21/2020
|
||||
* Vendor: American Megatrends International, LLC.
|
||||
* Version: E5000XXU3F00105-BPCIe
|
||||
* Release Date: 08/25/2021
|
||||
* BIOS Revision: 5.19
|
||||
*
|
||||
* Base Board Information
|
||||
* Manufacturer: Intel Corporation
|
||||
* Product Name: NUC11TNBi5
|
||||
* Version: M11904-403
|
||||
* Manufacturer: Default string
|
||||
* Product Name: Default string
|
||||
* Version: Default string
|
||||
*/
|
||||
|
||||
#ifndef PCI_DEVICES_H_
|
||||
@ -22,48 +22,42 @@
|
||||
|
||||
#define HOST_BRIDGE .pbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U}
|
||||
|
||||
#define HOST_BRIDGE_1 .pbdf.bits = {.b = 0x00U, .d = 0x10U, .f = 0x05U}
|
||||
|
||||
#define VGA_COMPATIBLE_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x02U, .f = 0x00U}
|
||||
|
||||
#define PCI_BRIDGE_0 .pbdf.bits = {.b = 0x00U, .d = 0x06U, .f = 0x00U}
|
||||
|
||||
#define PCI_BRIDGE_1 .pbdf.bits = {.b = 0x00U, .d = 0x07U, .f = 0x00U}
|
||||
|
||||
#define PCI_BRIDGE_2 .pbdf.bits = {.b = 0x00U, .d = 0x07U, .f = 0x02U}
|
||||
|
||||
#define PCI_BRIDGE_3 .pbdf.bits = {.b = 0x00U, .d = 0x1DU, .f = 0x00U}
|
||||
|
||||
#define SYSTEM_PERIPHERAL_0 .pbdf.bits = {.b = 0x00U, .d = 0x08U, .f = 0x00U}
|
||||
|
||||
#define USB_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x0DU, .f = 0x00U}
|
||||
|
||||
#define USB_CONTROLLER_1 .pbdf.bits = {.b = 0x00U, .d = 0x0DU, .f = 0x02U}
|
||||
#define USB_CONTROLLER_1 .pbdf.bits = {.b = 0x00U, .d = 0x14U, .f = 0x00U}
|
||||
|
||||
#define USB_CONTROLLER_2 .pbdf.bits = {.b = 0x00U, .d = 0x0DU, .f = 0x03U}
|
||||
#define SERIAL_BUS_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x10U, .f = 0x00U}
|
||||
|
||||
#define USB_CONTROLLER_3 .pbdf.bits = {.b = 0x00U, .d = 0x14U, .f = 0x00U}
|
||||
|
||||
#define RAM_MEMORY_0 .pbdf.bits = {.b = 0x00U, .d = 0x14U, .f = 0x02U}
|
||||
|
||||
#define NETWORK_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x14U, .f = 0x03U}
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x15U, .f = 0x00U}
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_1 .pbdf.bits = {.b = 0x00U, .d = 0x15U, .f = 0x01U}
|
||||
#define SERIAL_BUS_CONTROLLER_1 .pbdf.bits = {.b = 0x00U, .d = 0x15U, .f = 0x00U}
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_2 .pbdf.bits = {.b = 0x00U, .d = 0x1FU, .f = 0x05U}
|
||||
|
||||
#define RAM_MEMORY_0 .pbdf.bits = {.b = 0x00U, .d = 0x14U, .f = 0x02U}
|
||||
|
||||
#define COMMUNICATION_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x16U, .f = 0x00U}
|
||||
|
||||
#define SERIAL_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x16U, .f = 0x03U}
|
||||
|
||||
#define SATA_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x17U, .f = 0x00U}
|
||||
|
||||
#define PCI_BRIDGE_0 .pbdf.bits = {.b = 0x00U, .d = 0x1CU, .f = 0x00U}
|
||||
|
||||
#define PCI_BRIDGE_1 .pbdf.bits = {.b = 0x00U, .d = 0x1CU, .f = 0x07U}
|
||||
|
||||
#define ISA_BRIDGE_0 .pbdf.bits = {.b = 0x00U, .d = 0x1FU, .f = 0x00U}
|
||||
|
||||
#define AUDIO_DEVICE_0 .pbdf.bits = {.b = 0x00U, .d = 0x1FU, .f = 0x03U}
|
||||
|
||||
#define SMBUS_0 .pbdf.bits = {.b = 0x00U, .d = 0x1FU, .f = 0x04U}
|
||||
|
||||
#define ETHERNET_CONTROLLER_0 .pbdf.bits = {.b = 0x00U, .d = 0x1FU, .f = 0x06U}
|
||||
|
||||
#define ETHERNET_CONTROLLER_1 .pbdf.bits = {.b = 0x02U, .d = 0x00U, .f = 0x00U}
|
||||
|
||||
#define NON_VOLATILE_MEMORY_CONTROLLER_0 .pbdf.bits = {.b = 0x01U, .d = 0x00U, .f = 0x00U}
|
||||
|
||||
#define ETHERNET_CONTROLLER_0 .pbdf.bits = {.b = 0x58U, .d = 0x00U, .f = 0x00U}
|
||||
|
||||
#endif /* PCI_DEVICES_H_ */
|
||||
|
@ -12,15 +12,15 @@
|
||||
|
||||
/*
|
||||
* BIOS Information
|
||||
* Vendor: Intel Corp.
|
||||
* Version: TNTGL357.0042.2020.1221.1743
|
||||
* Release Date: 12/21/2020
|
||||
* Vendor: American Megatrends International, LLC.
|
||||
* Version: E5000XXU3F00105-BPCIe
|
||||
* Release Date: 08/25/2021
|
||||
* BIOS Revision: 5.19
|
||||
*
|
||||
* Base Board Information
|
||||
* Manufacturer: Intel Corporation
|
||||
* Product Name: NUC11TNBi5
|
||||
* Version: M11904-403
|
||||
* Manufacturer: Default string
|
||||
* Product Name: Default string
|
||||
* Version: Default string
|
||||
*/
|
||||
|
||||
/* pm sstate data */
|
||||
@ -28,15 +28,15 @@
|
||||
#define PM1A_EVT_ACCESS_SIZE 0x2U
|
||||
#define PM1A_CNT_ADDRESS 0x1804UL
|
||||
|
||||
#define WAKE_VECTOR_32 0x40CD800CUL
|
||||
#define WAKE_VECTOR_64 0x40CD8018UL
|
||||
#define WAKE_VECTOR_32 0x3F6A400CUL
|
||||
#define WAKE_VECTOR_64 0x3F6A4018UL
|
||||
|
||||
#define RESET_REGISTER_ADDRESS 0xCF9UL
|
||||
#define RESET_REGISTER_SPACE_ID SPACE_SYSTEM_IO
|
||||
#define RESET_REGISTER_VALUE 0x6U
|
||||
|
||||
/* DRHD of DMAR */
|
||||
#define DRHD_COUNT 4U
|
||||
#define DRHD_COUNT 2U
|
||||
|
||||
#define DRHD0_DEV_CNT 0x1U
|
||||
#define DRHD0_SEGMENT 0x0U
|
||||
@ -48,39 +48,19 @@
|
||||
#define DRHD0_DEVSCOPE0_BUS 0x0U
|
||||
#define DRHD0_DEVSCOPE0_PATH 0x10U
|
||||
|
||||
#define DRHD1_DEV_CNT 0x1U
|
||||
#define DRHD1_DEV_CNT 0x2U
|
||||
#define DRHD1_SEGMENT 0x0U
|
||||
#define DRHD1_FLAGS 0x0U
|
||||
#define DRHD1_REG_BASE 0xFED85000UL
|
||||
#define DRHD1_FLAGS 0x1U
|
||||
#define DRHD1_REG_BASE 0xFED91000UL
|
||||
#define DRHD1_IGNORE false
|
||||
#define DRHD1_DEVSCOPE0_TYPE 0x2U
|
||||
#define DRHD1_DEVSCOPE0_ID 0x0U
|
||||
#define DRHD1_DEVSCOPE0_TYPE 0x3U
|
||||
#define DRHD1_DEVSCOPE0_ID 0x2U
|
||||
#define DRHD1_DEVSCOPE0_BUS 0x0U
|
||||
#define DRHD1_DEVSCOPE0_PATH 0x38U
|
||||
|
||||
#define DRHD2_DEV_CNT 0x1U
|
||||
#define DRHD2_SEGMENT 0x0U
|
||||
#define DRHD2_FLAGS 0x0U
|
||||
#define DRHD2_REG_BASE 0xFED86000UL
|
||||
#define DRHD2_IGNORE false
|
||||
#define DRHD2_DEVSCOPE0_TYPE 0x2U
|
||||
#define DRHD2_DEVSCOPE0_ID 0x0U
|
||||
#define DRHD2_DEVSCOPE0_BUS 0x0U
|
||||
#define DRHD2_DEVSCOPE0_PATH 0x3aU
|
||||
|
||||
#define DRHD3_DEV_CNT 0x2U
|
||||
#define DRHD3_SEGMENT 0x0U
|
||||
#define DRHD3_FLAGS 0x1U
|
||||
#define DRHD3_REG_BASE 0xFED91000UL
|
||||
#define DRHD3_IGNORE false
|
||||
#define DRHD3_DEVSCOPE0_TYPE 0x3U
|
||||
#define DRHD3_DEVSCOPE0_ID 0x2U
|
||||
#define DRHD3_DEVSCOPE0_BUS 0x0U
|
||||
#define DRHD3_DEVSCOPE0_PATH 0xf7U
|
||||
#define DRHD3_DEVSCOPE1_TYPE 0x4U
|
||||
#define DRHD3_DEVSCOPE1_ID 0x0U
|
||||
#define DRHD3_DEVSCOPE1_BUS 0x0U
|
||||
#define DRHD3_DEVSCOPE1_PATH 0xf6U
|
||||
#define DRHD1_DEVSCOPE0_PATH 0xf7U
|
||||
#define DRHD1_DEVSCOPE1_TYPE 0x4U
|
||||
#define DRHD1_DEVSCOPE1_ID 0x0U
|
||||
#define DRHD1_DEVSCOPE1_BUS 0x0U
|
||||
#define DRHD1_DEVSCOPE1_PATH 0xf6U
|
||||
|
||||
/* PCI mmcfg base of MCFG */
|
||||
#define DEFAULT_PCI_MMCFG_BASE 0xc0000000UL
|
||||
|
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
# Board defconfig generated by acrn-config tool
|
||||
|
||||
CONFIG_BOARD="generic_board"
|
||||
CONFIG_HV_RAM_START=0x00400000
|
||||
CONFIG_PLATFORM_RAM_SIZE=0x400000000
|
||||
CONFIG_STACK_SIZE=0x2000
|
||||
CONFIG_IVSHMEM_ENABLED=n
|
||||
CONFIG_GPU_SBDF=0x00000010
|
||||
CONFIG_SCHED_BVT=y
|
||||
CONFIG_RELOC=y
|
||||
CONFIG_MULTIBOOT2=y
|
||||
CONFIG_RDT_ENABLED=n
|
||||
CONFIG_CDP_ENABLED=n
|
||||
CONFIG_HYPERV_ENABLED=y
|
||||
CONFIG_IOMMU_ENFORCE_SNP=n
|
||||
CONFIG_ACPI_PARSE_ENABLED=y
|
||||
CONFIG_L1D_FLUSH_VMENTRY_ENABLED=n
|
||||
CONFIG_MCE_ON_PSC_WORKAROUND_DISABLED=n
|
||||
CONFIG_IOMMU_BUS_NUM=0x100
|
||||
CONFIG_MAX_IOAPIC_NUM=1
|
||||
CONFIG_MAX_PCI_DEV_NUM=96
|
||||
CONFIG_MAX_IOAPIC_LINES=120
|
||||
CONFIG_MAX_PT_IRQ_ENTRIES=256
|
||||
CONFIG_MAX_MSIX_TABLE_NUM=16
|
||||
CONFIG_MAX_EMULATED_MMIO_REGIONS=16
|
||||
CONFIG_SERIAL_LEGACY=y
|
||||
CONFIG_SERIAL_PIO_BASE=0x3F8
|
||||
CONFIG_LOG_BUF_SIZE=0x40000
|
||||
CONFIG_NPK_LOGLEVEL_DEFAULT=5
|
||||
CONFIG_MEM_LOGLEVEL_DEFAULT=5
|
||||
CONFIG_LOG_DESTINATION=7
|
||||
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=3
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -7,11 +7,11 @@
|
||||
#ifndef MISC_CFG_H
|
||||
#define MISC_CFG_H
|
||||
|
||||
#define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p3 "
|
||||
#define SERVICE_VM_OS_CONSOLE "console=ttyS0 "
|
||||
#define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p2 "
|
||||
#define SERVICE_VM_BOOTARGS_DIFF \
|
||||
"rw rootwait console=tty0 consoleblank=0 no_timer_check quiet loglevel=3 i915.nuclear_pageflip=1 " \
|
||||
"swiotlb=131072 maxcpus=3 hugepagesz=1G hugepages=8 "
|
||||
"rw rootwait console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3 " \
|
||||
"i915.nuclear_pageflip=1 swiotlb=131072 maxcpus=3 hugepagesz=1G hugepages=4 "
|
||||
#define SERVICE_VM_BOOTARGS_MISC "udmabuf.list_limit=8192 "
|
||||
#define VM0_CONFIG_CPU_AFFINITY (AFFINITY_CPU(3U))
|
||||
#define SERVICE_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U) | AFFINITY_CPU(2U))
|
||||
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U))
|
||||
@ -20,14 +20,11 @@
|
||||
#define HV_SUPPORTED_MAX_CLOS 0U
|
||||
#define MAX_MBA_CLOS_NUM_ENTRIES 0U
|
||||
#define MAX_CACHE_CLOS_NUM_ENTRIES 0U
|
||||
#define CLOS_MASK_0 0xfffffU
|
||||
#define CLOS_MASK_1 0xfffffU
|
||||
#define CLOS_MASK_2 0xfffffU
|
||||
#define CLOS_MASK_3 0xfffffU
|
||||
#define CLOS_MASK_4 0xfffffU
|
||||
#define CLOS_MASK_5 0xfffffU
|
||||
#define CLOS_MASK_6 0xfffffU
|
||||
#define CLOS_MASK_7 0xfffffU
|
||||
#endif
|
||||
|
||||
#define VM0_BOOT_ARGS \
|
||||
"rw rootwait root=/dev/sda2 console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3 " \
|
||||
"i915.nuclear_pageflip=1 swiotlb=131072 "
|
||||
#define PRE_RTVM_SW_SRAM_MAX_SIZE 0UL
|
||||
|
||||
#endif /* MISC_CFG_H */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef VBAR_BASE_H_
|
||||
#define VBAR_BASE_H_
|
||||
|
||||
#define VGA_COMPATIBLE_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x0UL, .vbar_base[2] = HI_MMIO_START + 0x10000000UL
|
||||
|
||||
#define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL
|
||||
|
||||
#define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL
|
||||
|
||||
#define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, .vbar_base[2] = HI_MMIO_START + 0x20080000UL
|
||||
|
||||
#define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, .vbar_base[2] = HI_MMIO_START + 0x20100000UL
|
||||
|
||||
#define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL
|
||||
|
||||
#define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, .vbar_base[2] = HI_MMIO_START + 0x20124000UL
|
||||
|
||||
#define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL
|
||||
|
||||
#define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL
|
||||
|
||||
#define SATA_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x20130000UL, .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \
|
||||
.vbar_base[5] = HI_MMIO_START + 0x20132800UL
|
||||
|
||||
#define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, .vbar_base[4] = HI_MMIO_START + 0x20200000UL
|
||||
|
||||
#define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL
|
||||
|
||||
#define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL
|
||||
|
||||
#define ETHERNET_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x20400000UL, .vbar_base[3] = HI_MMIO_START + 0x20500000UL
|
||||
|
||||
#endif /* VBAR_BASE_H_ */
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -11,203 +11,247 @@
|
||||
#include <schedule.h>
|
||||
|
||||
extern struct pt_intx_config vm0_pt_intx[1U];
|
||||
static struct vm_hpa_regions vm0_hpa[] = {
|
||||
{.start_hpa = 0x100000000, .size_hpa = 0x20000000},
|
||||
{.start_hpa = 0x120000000, .size_hpa = 0x10000000},
|
||||
};
|
||||
extern struct acrn_vm_pci_dev_config sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM];
|
||||
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
{
|
||||
/* Static configured VM0 */
|
||||
CONFIG_SAFETY_VM,
|
||||
.name = "SAFETY_VM0",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = VM0_CONFIG_CPU_AFFINITY,
|
||||
.memory =
|
||||
{
|
||||
.start_hpa = VM0_CONFIG_MEM_START_HPA,
|
||||
.size = VM0_CONFIG_MEM_SIZE,
|
||||
.start_hpa2 = VM0_CONFIG_MEM_START_HPA2,
|
||||
.size_hpa2 = VM0_CONFIG_MEM_SIZE_HPA2,
|
||||
},
|
||||
.os_config =
|
||||
{
|
||||
.name = "Zephyr",
|
||||
.kernel_type = KERNEL_ELF,
|
||||
.kernel_mod_tag = "Zephyr_ElfImage",
|
||||
.ramdisk_mod_tag = "",
|
||||
},
|
||||
.acpi_config =
|
||||
{
|
||||
.acpi_mod_tag = "ACPI_VM0",
|
||||
},
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x2F8U,
|
||||
.irq = 3U,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
},
|
||||
struct acrn_vm_config
|
||||
vm_configs[CONFIG_MAX_VM_NUM] =
|
||||
{{
|
||||
/* Static configured VM0 */
|
||||
CONFIG_PRE_STD_VM,
|
||||
.name = "SAFETY_VM0",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = VM0_CONFIG_CPU_AFFINITY,
|
||||
.memory =
|
||||
{
|
||||
.region_num = 2,
|
||||
.host_regions = vm0_hpa,
|
||||
},
|
||||
.os_config =
|
||||
{
|
||||
.name = "",
|
||||
.kernel_type = KERNEL_ELF,
|
||||
.kernel_mod_tag = "Zephyr_ElfImage",
|
||||
.ramdisk_mod_tag = "",
|
||||
.bootargs = VM0_BOOT_ARGS,
|
||||
},
|
||||
.acpi_config =
|
||||
{
|
||||
.acpi_mod_tag = "ACPI_VM0",
|
||||
},
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x2F8U,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
},
|
||||
.vuart[2] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 2U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
#ifdef VM0_PASSTHROUGH_TPM
|
||||
.pt_tpm2 = true,
|
||||
.mmiodevs[0] =
|
||||
{
|
||||
.name = "tpm2",
|
||||
.res[0] =
|
||||
{
|
||||
.user_vm_pa = VM0_TPM_BUFFER_BASE_ADDR_GPA,
|
||||
.host_pa = VM0_TPM_BUFFER_BASE_ADDR,
|
||||
.size = VM0_TPM_BUFFER_SIZE,
|
||||
.mem_type = EPT_UNCACHED,
|
||||
},
|
||||
.res[1] =
|
||||
{
|
||||
.user_vm_pa = VM0_TPM_EVENTLOG_BASE_ADDR,
|
||||
.host_pa = VM0_TPM_EVENTLOG_BASE_ADDR_HPA,
|
||||
.size = VM0_TPM_EVENTLOG_SIZE,
|
||||
.mem_type = EPT_WB,
|
||||
},
|
||||
},
|
||||
.pt_tpm2 = true,
|
||||
.mmiodevs[0] =
|
||||
{
|
||||
.name = "tpm2",
|
||||
.res[0] =
|
||||
{
|
||||
.user_vm_pa = VM0_TPM_BUFFER_BASE_ADDR_GPA,
|
||||
.host_pa = VM0_TPM_BUFFER_BASE_ADDR,
|
||||
.size = VM0_TPM_BUFFER_SIZE,
|
||||
.mem_type = EPT_UNCACHED,
|
||||
},
|
||||
.res[1] =
|
||||
{
|
||||
.user_vm_pa = VM0_TPM_EVENTLOG_BASE_ADDR,
|
||||
.host_pa = VM0_TPM_EVENTLOG_BASE_ADDR_HPA,
|
||||
.size = VM0_TPM_EVENTLOG_SIZE,
|
||||
.mem_type = EPT_WB,
|
||||
},
|
||||
},
|
||||
#endif
|
||||
#ifdef P2SB_BAR_ADDR
|
||||
.pt_p2sb_bar = true,
|
||||
.mmiodevs[0] =
|
||||
.pt_p2sb_bar = true,
|
||||
.mmiodevs[0] =
|
||||
{
|
||||
.res[0] =
|
||||
{
|
||||
.user_vm_pa = P2SB_BAR_ADDR_GPA,
|
||||
.host_pa = P2SB_BAR_ADDR,
|
||||
.size = P2SB_BAR_SIZE,
|
||||
},
|
||||
},
|
||||
#endif
|
||||
.pt_intx_num = 0,
|
||||
.pt_intx = vm0_pt_intx,
|
||||
},
|
||||
{
|
||||
.res[0] =
|
||||
/* Static configured VM1 */
|
||||
CONFIG_SERVICE_VM,
|
||||
.name = "ACRN_Service_VM",
|
||||
/* Allow Service VM to reboot the system since it is the highest priority VM. */
|
||||
.vm_prio = PRIO_LOW,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY,
|
||||
.os_config =
|
||||
{
|
||||
.user_vm_pa = P2SB_BAR_ADDR_GPA,
|
||||
.host_pa = P2SB_BAR_ADDR,
|
||||
.size = P2SB_BAR_SIZE,
|
||||
.name = "",
|
||||
.kernel_type = KERNEL_BZIMAGE,
|
||||
.kernel_mod_tag = "Linux_bzImage",
|
||||
.ramdisk_mod_tag = "",
|
||||
.bootargs = SERVICE_VM_OS_BOOTARGS,
|
||||
},
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
.vuart[2] =
|
||||
{
|
||||
.irq = 0U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0X9000U,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 2U,
|
||||
},
|
||||
.vuart[3] =
|
||||
{
|
||||
.irq = 0U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0X9008U,
|
||||
.t_vuart.vm_id = 2U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
},
|
||||
.vuart[4] =
|
||||
{
|
||||
.irq = 0U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0X9010U,
|
||||
.t_vuart.vm_id = 3U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
},
|
||||
.pci_dev_num = 0U,
|
||||
.pci_devs = sos_pci_devs,
|
||||
},
|
||||
{
|
||||
/* Static configured VM2 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM1",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = VM2_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 3U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
},
|
||||
#endif
|
||||
.pt_intx_num = 0,
|
||||
.pt_intx = vm0_pt_intx,
|
||||
},
|
||||
{
|
||||
/* Static configured VM1 */
|
||||
CONFIG_SERVICE_VM,
|
||||
.name = "ACRN_Service_VM",
|
||||
/* Allow Service VM to reboot the system since it is the highest priority VM. */
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY,
|
||||
.memory =
|
||||
{
|
||||
.start_hpa = 0UL,
|
||||
/* Static configured VM3 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM2",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = VM3_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 4U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
},
|
||||
.os_config =
|
||||
{
|
||||
.name = "ACRN Service OS",
|
||||
.kernel_type = KERNEL_BZIMAGE,
|
||||
.kernel_mod_tag = "Linux_bzImage",
|
||||
.ramdisk_mod_tag = "",
|
||||
.bootargs = SERVICE_VM_OS_BOOTARGS,
|
||||
/* Dynamic configured VM4 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
/* Dynamic configured VM5 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x2F8U,
|
||||
.irq = 3U,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
/* Dynamic configured VM6 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
.pci_dev_num = 0U,
|
||||
.pci_devs = sos_pci_devs,
|
||||
},
|
||||
{
|
||||
/* Static configured VM2 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM1",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = VM2_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
/* Dynamic configured VM7 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
/* Dynamic configured VM8 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Static configured VM3 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM2",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = VM3_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
/* Dynamic configured VM9 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
/* Dynamic configured VM10 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM4 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM5 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM6 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM7 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM8 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM9 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM10 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM11 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM12 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM13 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM14 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM15 */
|
||||
CONFIG_POST_STD_VM,
|
||||
}
|
||||
{
|
||||
/* Dynamic configured VM11 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM12 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM13 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM14 */
|
||||
CONFIG_POST_STD_VM,
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM15 */
|
||||
CONFIG_POST_STD_VM,
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -13,12 +13,11 @@
|
||||
#define PRE_VM_NUM 1U
|
||||
#define SERVICE_VM_NUM 1U
|
||||
#define MAX_POST_VM_NUM 14U
|
||||
#define MAX_TRUSTY_VM_NUM 0U
|
||||
#define CONFIG_MAX_VM_NUM 16U
|
||||
#define VM0_CONFIG_MEM_START_HPA 0x100000000UL
|
||||
#define VM0_CONFIG_MEM_SIZE 0x20000000UL
|
||||
#define VM0_CONFIG_MEM_START_HPA2 0x0UL
|
||||
#define VM0_CONFIG_MEM_SIZE_HPA2 0x0UL
|
||||
/* SERVICE_VM == VM1 */
|
||||
#define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_OS_CONSOLE SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF
|
||||
#define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF SERVICE_VM_BOOTARGS_MISC
|
||||
#define MAX_VUART_NUM_PER_VM 5U
|
||||
#define MAX_IR_ENTRIES 256U
|
||||
|
||||
#endif /* VM_CONFIGURATIONS_H */
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
# Board defconfig generated by acrn-config tool
|
||||
|
||||
CONFIG_BOARD="generic_board"
|
||||
CONFIG_HV_RAM_START=0x00400000
|
||||
CONFIG_PLATFORM_RAM_SIZE=0x400000000
|
||||
CONFIG_STACK_SIZE=0x2000
|
||||
CONFIG_IVSHMEM_ENABLED=n
|
||||
CONFIG_GPU_SBDF=0x00000010
|
||||
CONFIG_SCHED_BVT=y
|
||||
CONFIG_RELOC=y
|
||||
CONFIG_MULTIBOOT2=y
|
||||
CONFIG_RDT_ENABLED=n
|
||||
CONFIG_CDP_ENABLED=n
|
||||
CONFIG_HYPERV_ENABLED=y
|
||||
CONFIG_IOMMU_ENFORCE_SNP=n
|
||||
CONFIG_ACPI_PARSE_ENABLED=y
|
||||
CONFIG_L1D_FLUSH_VMENTRY_ENABLED=n
|
||||
CONFIG_MCE_ON_PSC_WORKAROUND_DISABLED=n
|
||||
CONFIG_IOMMU_BUS_NUM=0x100
|
||||
CONFIG_MAX_IOAPIC_NUM=1
|
||||
CONFIG_MAX_PCI_DEV_NUM=96
|
||||
CONFIG_MAX_IOAPIC_LINES=120
|
||||
CONFIG_MAX_PT_IRQ_ENTRIES=64
|
||||
CONFIG_MAX_MSIX_TABLE_NUM=64
|
||||
CONFIG_MAX_EMULATED_MMIO_REGIONS=16
|
||||
CONFIG_SERIAL_LEGACY=y
|
||||
CONFIG_SERIAL_PIO_BASE=0x3F8
|
||||
CONFIG_LOG_BUF_SIZE=0x40000
|
||||
CONFIG_NPK_LOGLEVEL_DEFAULT=5
|
||||
CONFIG_MEM_LOGLEVEL_DEFAULT=5
|
||||
CONFIG_LOG_DESTINATION=7
|
||||
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=3
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -13,23 +13,16 @@
|
||||
#define HV_SUPPORTED_MAX_CLOS 0U
|
||||
#define MAX_MBA_CLOS_NUM_ENTRIES 0U
|
||||
#define MAX_CACHE_CLOS_NUM_ENTRIES 0U
|
||||
#define CLOS_MASK_0 0xfffffU
|
||||
#define CLOS_MASK_1 0xfffffU
|
||||
#define CLOS_MASK_2 0xfffffU
|
||||
#define CLOS_MASK_3 0xfffffU
|
||||
#define CLOS_MASK_4 0xfffffU
|
||||
#define CLOS_MASK_5 0xfffffU
|
||||
#define CLOS_MASK_6 0xfffffU
|
||||
#define CLOS_MASK_7 0xfffffU
|
||||
#endif
|
||||
#define VM0_CONFIG_PCI_DEV_NUM 3U
|
||||
#define VM1_CONFIG_PCI_DEV_NUM 2U
|
||||
|
||||
#define VM0_BOOT_ARGS \
|
||||
"rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M " \
|
||||
"consoleblank=0 tsc=reliable reboot=acpi "
|
||||
"rw rootwait root=/dev/sda2 console=tty0 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel " \
|
||||
"log_buf_len=16M consoleblank=0 tsc=reliable reboot=acpi "
|
||||
#define VM1_BOOT_ARGS \
|
||||
"rw rootwait root=/dev/sda2 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M " \
|
||||
"consoleblank=0 tsc=reliable reboot=acpi "
|
||||
"rw rootwait root=/dev/sda2 console=tty0 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel " \
|
||||
"log_buf_len=16M consoleblank=0 tsc=reliable reboot=acpi "
|
||||
#define PRE_RTVM_SW_SRAM_MAX_SIZE 0UL
|
||||
|
||||
#endif /* MISC_CFG_H */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -31,9 +31,9 @@ struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM] = {
|
||||
.d = 0x17U,
|
||||
.f = 0x00U,
|
||||
},
|
||||
.vbar_base[0] = 0x80104000UL,
|
||||
.vbar_base[5] = 0x80106000UL,
|
||||
.vbar_base[1] = 0x80107000UL,
|
||||
.vbar_base[0] = 0x80020000UL,
|
||||
.vbar_base[5] = 0x80022000UL,
|
||||
.vbar_base[1] = 0x80023000UL,
|
||||
.vbar_base[4] = 0x3060UL,
|
||||
.vbar_base[3] = 0x3080UL,
|
||||
.vbar_base[2] = 0x3090UL,
|
||||
@ -48,12 +48,11 @@ struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM] = {
|
||||
},
|
||||
.pbdf.bits =
|
||||
{
|
||||
.b = 0x58U,
|
||||
.d = 0x00U,
|
||||
.f = 0x00U,
|
||||
.b = 0x00U,
|
||||
.d = 0x1FU,
|
||||
.f = 0x06U,
|
||||
},
|
||||
.vbar_base[0] = 0x80000000UL,
|
||||
.vbar_base[3] = 0x80100000UL,
|
||||
},
|
||||
};
|
||||
struct acrn_vm_pci_dev_config vm1_pci_devs[VM1_CONFIG_PCI_DEV_NUM] = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef VBAR_BASE_H_
|
||||
#define VBAR_BASE_H_
|
||||
|
||||
#define VGA_COMPATIBLE_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x0UL, .vbar_base[2] = HI_MMIO_START + 0x10000000UL
|
||||
|
||||
#define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL
|
||||
|
||||
#define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL
|
||||
|
||||
#define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, .vbar_base[2] = HI_MMIO_START + 0x20080000UL
|
||||
|
||||
#define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, .vbar_base[2] = HI_MMIO_START + 0x20100000UL
|
||||
|
||||
#define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL
|
||||
|
||||
#define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, .vbar_base[2] = HI_MMIO_START + 0x20124000UL
|
||||
|
||||
#define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL
|
||||
|
||||
#define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL
|
||||
|
||||
#define SATA_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x20130000UL, .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \
|
||||
.vbar_base[5] = HI_MMIO_START + 0x20132800UL
|
||||
|
||||
#define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, .vbar_base[4] = HI_MMIO_START + 0x20200000UL
|
||||
|
||||
#define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL
|
||||
|
||||
#define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL
|
||||
|
||||
#define ETHERNET_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x20400000UL, .vbar_base[3] = HI_MMIO_START + 0x20500000UL
|
||||
|
||||
#endif /* VBAR_BASE_H_ */
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -12,29 +12,34 @@
|
||||
|
||||
extern struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM];
|
||||
extern struct pt_intx_config vm0_pt_intx[1U];
|
||||
static struct vm_hpa_regions vm0_hpa[] = {
|
||||
{.start_hpa = 0x100000000, .size_hpa = 0x20000000},
|
||||
};
|
||||
extern struct acrn_vm_pci_dev_config vm1_pci_devs[VM1_CONFIG_PCI_DEV_NUM];
|
||||
extern struct pt_intx_config vm1_pt_intx[1U];
|
||||
static struct vm_hpa_regions vm1_hpa[] = {
|
||||
{.start_hpa = 0x120000000, .size_hpa = 0x20000000},
|
||||
};
|
||||
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
{
|
||||
/* Static configured VM0 */
|
||||
CONFIG_PRE_STD_VM,
|
||||
.name = "PRE_STD_VM0",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = VM0_CONFIG_CPU_AFFINITY,
|
||||
.memory =
|
||||
{
|
||||
.start_hpa = VM0_CONFIG_MEM_START_HPA,
|
||||
.size = VM0_CONFIG_MEM_SIZE,
|
||||
.start_hpa2 = VM0_CONFIG_MEM_START_HPA2,
|
||||
.size_hpa2 = VM0_CONFIG_MEM_SIZE_HPA2,
|
||||
.region_num = 1,
|
||||
.host_regions = vm0_hpa,
|
||||
},
|
||||
.os_config =
|
||||
{
|
||||
.name = "YOCTO",
|
||||
.name = "",
|
||||
.kernel_type = KERNEL_BZIMAGE,
|
||||
.kernel_mod_tag = "Linux_bzImage",
|
||||
.ramdisk_mod_tag = "",
|
||||
.ramdisk_mod_tag = "Ubuntu",
|
||||
.bootargs = VM0_BOOT_ARGS,
|
||||
},
|
||||
.acpi_config =
|
||||
@ -49,9 +54,9 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x2F8U,
|
||||
.irq = 3U,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
},
|
||||
@ -98,18 +103,17 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
CONFIG_PRE_STD_VM,
|
||||
.name = "PRE_STD_VM1",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = VM1_CONFIG_CPU_AFFINITY,
|
||||
.memory =
|
||||
{
|
||||
.start_hpa = VM1_CONFIG_MEM_START_HPA,
|
||||
.size = VM1_CONFIG_MEM_SIZE,
|
||||
.start_hpa2 = VM1_CONFIG_MEM_START_HPA2,
|
||||
.size_hpa2 = VM1_CONFIG_MEM_SIZE_HPA2,
|
||||
.region_num = 1,
|
||||
.host_regions = vm1_hpa,
|
||||
},
|
||||
.os_config =
|
||||
{
|
||||
.name = "YOCTO",
|
||||
.name = "",
|
||||
.kernel_type = KERNEL_BZIMAGE,
|
||||
.kernel_mod_tag = "Linux_bzImage",
|
||||
.ramdisk_mod_tag = "",
|
||||
@ -127,11 +131,11 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x2F8U,
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
.pci_dev_num = VM1_CONFIG_PCI_DEV_NUM,
|
||||
.pci_devs = vm1_pci_devs,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -13,14 +13,9 @@
|
||||
#define PRE_VM_NUM 2U
|
||||
#define SERVICE_VM_NUM 0U
|
||||
#define MAX_POST_VM_NUM 14U
|
||||
#define MAX_TRUSTY_VM_NUM 0U
|
||||
#define CONFIG_MAX_VM_NUM 16U
|
||||
#define VM0_CONFIG_MEM_START_HPA 0x100000000UL
|
||||
#define VM0_CONFIG_MEM_SIZE 0x20000000UL
|
||||
#define VM0_CONFIG_MEM_START_HPA2 0x0UL
|
||||
#define VM0_CONFIG_MEM_SIZE_HPA2 0x0UL
|
||||
#define VM1_CONFIG_MEM_START_HPA 0x120000000UL
|
||||
#define VM1_CONFIG_MEM_SIZE 0x20000000UL
|
||||
#define VM1_CONFIG_MEM_START_HPA2 0x0UL
|
||||
#define VM1_CONFIG_MEM_SIZE_HPA2 0x0UL
|
||||
#define MAX_VUART_NUM_PER_VM 2U
|
||||
#define MAX_IR_ENTRIES 256U
|
||||
|
||||
#endif /* VM_CONFIGURATIONS_H */
|
||||
|
@ -1,32 +0,0 @@
|
||||
# Board defconfig generated by acrn-config tool
|
||||
|
||||
CONFIG_BOARD="generic_board"
|
||||
CONFIG_HV_RAM_START=0x00400000
|
||||
CONFIG_PLATFORM_RAM_SIZE=0x400000000
|
||||
CONFIG_STACK_SIZE=0x2000
|
||||
CONFIG_IVSHMEM_ENABLED=n
|
||||
CONFIG_GPU_SBDF=0x00000010
|
||||
CONFIG_SCHED_BVT=y
|
||||
CONFIG_RELOC=y
|
||||
CONFIG_MULTIBOOT2=y
|
||||
CONFIG_RDT_ENABLED=n
|
||||
CONFIG_CDP_ENABLED=n
|
||||
CONFIG_HYPERV_ENABLED=y
|
||||
CONFIG_IOMMU_ENFORCE_SNP=n
|
||||
CONFIG_ACPI_PARSE_ENABLED=y
|
||||
CONFIG_L1D_FLUSH_VMENTRY_ENABLED=n
|
||||
CONFIG_MCE_ON_PSC_WORKAROUND_DISABLED=n
|
||||
CONFIG_IOMMU_BUS_NUM=0x100
|
||||
CONFIG_MAX_IOAPIC_NUM=1
|
||||
CONFIG_MAX_PCI_DEV_NUM=96
|
||||
CONFIG_MAX_IOAPIC_LINES=120
|
||||
CONFIG_MAX_PT_IRQ_ENTRIES=256
|
||||
CONFIG_MAX_MSIX_TABLE_NUM=16
|
||||
CONFIG_MAX_EMULATED_MMIO_REGIONS=16
|
||||
CONFIG_SERIAL_LEGACY=y
|
||||
CONFIG_SERIAL_PIO_BASE=0x3F8
|
||||
CONFIG_LOG_BUF_SIZE=0x40000
|
||||
CONFIG_NPK_LOGLEVEL_DEFAULT=5
|
||||
CONFIG_MEM_LOGLEVEL_DEFAULT=5
|
||||
CONFIG_LOG_DESTINATION=7
|
||||
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=3
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -7,30 +7,20 @@
|
||||
#ifndef MISC_CFG_H
|
||||
#define MISC_CFG_H
|
||||
|
||||
#define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p3 "
|
||||
#define SERVICE_VM_OS_CONSOLE "console=ttyS0 "
|
||||
#define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p2 "
|
||||
#define SERVICE_VM_BOOTARGS_DIFF \
|
||||
"rw rootwait console=tty0 consoleblank=0 no_timer_check quiet loglevel=3 i915.nuclear_pageflip=1 " \
|
||||
"swiotlb=131072 maxcpus=4 hugepagesz=1G hugepages=8 "
|
||||
"rw rootwait console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3 " \
|
||||
"i915.nuclear_pageflip=1 swiotlb=131072 maxcpus=4 hugepagesz=1G hugepages=5 "
|
||||
#define SERVICE_VM_BOOTARGS_MISC "udmabuf.list_limit=8192 "
|
||||
#define SERVICE_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U) | AFFINITY_CPU(2U) | AFFINITY_CPU(3U))
|
||||
#define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U) | AFFINITY_CPU(3U))
|
||||
#define VM3_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
#define VM4_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
#define VM5_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
#define VM6_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
#ifdef CONFIG_RDT_ENABLED
|
||||
#define HV_SUPPORTED_MAX_CLOS 0U
|
||||
#define MAX_MBA_CLOS_NUM_ENTRIES 0U
|
||||
#define MAX_CACHE_CLOS_NUM_ENTRIES 0U
|
||||
#define CLOS_MASK_0 0xfffffU
|
||||
#define CLOS_MASK_1 0xfffffU
|
||||
#define CLOS_MASK_2 0xfffffU
|
||||
#define CLOS_MASK_3 0xfffffU
|
||||
#define CLOS_MASK_4 0xfffffU
|
||||
#define CLOS_MASK_5 0xfffffU
|
||||
#define CLOS_MASK_6 0xfffffU
|
||||
#define CLOS_MASK_7 0xfffffU
|
||||
#endif
|
||||
|
||||
#define PRE_RTVM_SW_SRAM_MAX_SIZE 0UL
|
||||
|
||||
#endif /* MISC_CFG_H */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef VBAR_BASE_H_
|
||||
#define VBAR_BASE_H_
|
||||
|
||||
#define VGA_COMPATIBLE_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x0UL, .vbar_base[2] = HI_MMIO_START + 0x10000000UL
|
||||
|
||||
#define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL
|
||||
|
||||
#define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL
|
||||
|
||||
#define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, .vbar_base[2] = HI_MMIO_START + 0x20080000UL
|
||||
|
||||
#define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, .vbar_base[2] = HI_MMIO_START + 0x20100000UL
|
||||
|
||||
#define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL
|
||||
|
||||
#define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, .vbar_base[2] = HI_MMIO_START + 0x20124000UL
|
||||
|
||||
#define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL
|
||||
|
||||
#define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL
|
||||
|
||||
#define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL
|
||||
|
||||
#define SATA_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x20130000UL, .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \
|
||||
.vbar_base[5] = HI_MMIO_START + 0x20132800UL
|
||||
|
||||
#define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, .vbar_base[4] = HI_MMIO_START + 0x20200000UL
|
||||
|
||||
#define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL
|
||||
|
||||
#define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL
|
||||
|
||||
#define ETHERNET_CONTROLLER_0_VBAR \
|
||||
.vbar_base[0] = HI_MMIO_START + 0x20400000UL, .vbar_base[3] = HI_MMIO_START + 0x20500000UL
|
||||
|
||||
#endif /* VBAR_BASE_H_ */
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -18,15 +18,12 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
.name = "ACRN_Service_VM",
|
||||
/* Allow Service VM to reboot the system since it is the highest priority VM. */
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY,
|
||||
.memory =
|
||||
{
|
||||
.start_hpa = 0UL,
|
||||
},
|
||||
.os_config =
|
||||
{
|
||||
.name = "ACRN Service OS",
|
||||
.name = "",
|
||||
.kernel_type = KERNEL_BZIMAGE,
|
||||
.kernel_mod_tag = "Linux_bzImage",
|
||||
.ramdisk_mod_tag = "",
|
||||
@ -40,12 +37,36 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x2F8U,
|
||||
.irq = 3U,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
},
|
||||
.vuart[2] =
|
||||
{
|
||||
.irq = 4U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3E8U,
|
||||
.t_vuart.vm_id = 2U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
},
|
||||
.vuart[3] =
|
||||
{
|
||||
.irq = 0U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0X9000U,
|
||||
.t_vuart.vm_id = 1U,
|
||||
.t_vuart.vuart_id = 2U,
|
||||
},
|
||||
.vuart[4] =
|
||||
{
|
||||
.irq = 0U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0X9008U,
|
||||
.t_vuart.vm_id = 2U,
|
||||
.t_vuart.vuart_id = 2U,
|
||||
},
|
||||
.pci_dev_num = 0U,
|
||||
.pci_devs = sos_pci_devs,
|
||||
},
|
||||
@ -54,7 +75,8 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM1",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = VM1_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
@ -64,7 +86,19 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
.vuart[2] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 3U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -72,7 +106,8 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
CONFIG_POST_RT_VM,
|
||||
.name = "POST_RT_VM1",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = (GUEST_FLAG_STATIC_VM | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT),
|
||||
.companion_vm_id = 65535U,
|
||||
.guest_flags = (GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT | GUEST_FLAG_STATIC_VM),
|
||||
.cpu_affinity = VM2_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
@ -82,84 +117,36 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.irq = 4U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x2F8U,
|
||||
.irq = 3U,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 1U,
|
||||
.t_vuart.vuart_id = 2U,
|
||||
.addr.port_base = 0x3E8U,
|
||||
},
|
||||
.vuart[2] =
|
||||
{
|
||||
.irq = 3U,
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.t_vuart.vm_id = 0U,
|
||||
.t_vuart.vuart_id = 4U,
|
||||
.addr.port_base = 0x2F8U,
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Static configured VM3 */
|
||||
/* Dynamic configured VM3 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM2",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = VM3_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Static configured VM4 */
|
||||
/* Dynamic configured VM4 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM3",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = VM4_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Static configured VM5 */
|
||||
/* Dynamic configured VM5 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM4",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = VM5_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Static configured VM6 */
|
||||
/* Dynamic configured VM6 */
|
||||
CONFIG_POST_STD_VM,
|
||||
.name = "POST_STD_VM5",
|
||||
.vm_prio = PRIO_LOW,
|
||||
.guest_flags = GUEST_FLAG_STATIC_VM,
|
||||
.cpu_affinity = VM6_CONFIG_CPU_AFFINITY,
|
||||
.vuart[0] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = 0x3F8U,
|
||||
.irq = 4U,
|
||||
},
|
||||
.vuart[1] =
|
||||
{
|
||||
.type = VUART_LEGACY_PIO,
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Dynamic configured VM7 */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation.
|
||||
* Copyright (C) 2022 Intel Corporation.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
@ -13,8 +13,11 @@
|
||||
#define PRE_VM_NUM 0U
|
||||
#define SERVICE_VM_NUM 1U
|
||||
#define MAX_POST_VM_NUM 15U
|
||||
#define MAX_TRUSTY_VM_NUM 0U
|
||||
#define CONFIG_MAX_VM_NUM 16U
|
||||
/* SERVICE_VM == VM0 */
|
||||
#define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_OS_CONSOLE SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF
|
||||
#define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF SERVICE_VM_BOOTARGS_MISC
|
||||
#define MAX_VUART_NUM_PER_VM 5U
|
||||
#define MAX_IR_ENTRIES 256U
|
||||
|
||||
#endif /* VM_CONFIGURATIONS_H */
|
||||
|
@ -1 +0,0 @@
|
||||
hybrid_launch_2user_vm.xml
|
175
misc/config_tools/data/generic_board/hybrid.xml
Normal file
175
misc/config_tools/data/generic_board/hybrid.xml
Normal file
@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<acrn-config>
|
||||
<hv>
|
||||
<BUILD_TYPE>debug</BUILD_TYPE>
|
||||
<FEATURES>
|
||||
<RELOC_ENABLED>y</RELOC_ENABLED>
|
||||
<SCHEDULER>SCHED_BVT</SCHEDULER>
|
||||
<MULTIBOOT2_ENABLED>y</MULTIBOOT2_ENABLED>
|
||||
<SPLIT_LOCK_DETECTION_ENABLED>n</SPLIT_LOCK_DETECTION_ENABLED>
|
||||
<UC_LOCK_DETECTION_ENABLED>y</UC_LOCK_DETECTION_ENABLED>
|
||||
<SECURITY_VM_FIXUP>n</SECURITY_VM_FIXUP>
|
||||
<RDT>
|
||||
<RDT_ENABLED>n</RDT_ENABLED>
|
||||
<CDP_ENABLED>n</CDP_ENABLED>
|
||||
<VCAT_ENABLED>n</VCAT_ENABLED>
|
||||
</RDT>
|
||||
<HYPERV_ENABLED>y</HYPERV_ENABLED>
|
||||
<IOMMU_ENFORCE_SNP>n</IOMMU_ENFORCE_SNP>
|
||||
<ACPI_PARSE_ENABLED>y</ACPI_PARSE_ENABLED>
|
||||
<L1D_VMENTRY_ENABLED>n</L1D_VMENTRY_ENABLED>
|
||||
<MCE_ON_PSC_ENABLED>y</MCE_ON_PSC_ENABLED>
|
||||
<KEEP_IRQ_DISABLED>n</KEEP_IRQ_DISABLED>
|
||||
</FEATURES>
|
||||
<vuart_connections>
|
||||
<vuart_connection>
|
||||
<name>vUART connection 1</name>
|
||||
<type>legacy</type>
|
||||
<endpoint>
|
||||
<vm_name>SAFETY_VM0</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
<vbdf>00:10.0</vbdf>
|
||||
</endpoint>
|
||||
<endpoint>
|
||||
<vm_name>ACRN_Service_VM</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
<vbdf>00:10.0</vbdf>
|
||||
</endpoint>
|
||||
</vuart_connection>
|
||||
</vuart_connections>
|
||||
<DEBUG_OPTIONS>
|
||||
<SERIAL_CONSOLE>/dev/ttyS0</SERIAL_CONSOLE>
|
||||
<MEM_LOGLEVEL>5</MEM_LOGLEVEL>
|
||||
<NPK_LOGLEVEL>5</NPK_LOGLEVEL>
|
||||
<CONSOLE_LOGLEVEL>3</CONSOLE_LOGLEVEL>
|
||||
</DEBUG_OPTIONS>
|
||||
<MEMORY>
|
||||
<STACK_SIZE>0x2000</STACK_SIZE>
|
||||
</MEMORY>
|
||||
<CAPACITIES>
|
||||
<MAX_VM_NUM>16</MAX_VM_NUM>
|
||||
<MAX_IOAPIC_NUM>1</MAX_IOAPIC_NUM>
|
||||
<MAX_PCI_DEV_NUM>96</MAX_PCI_DEV_NUM>
|
||||
<MAX_IOAPIC_LINES>120</MAX_IOAPIC_LINES>
|
||||
<MAX_PT_IRQ_ENTRIES>256</MAX_PT_IRQ_ENTRIES>
|
||||
<MAX_EMULATED_MMIO>16</MAX_EMULATED_MMIO>
|
||||
<MAX_MSIX_TABLE_NUM>64</MAX_MSIX_TABLE_NUM>
|
||||
</CAPACITIES>
|
||||
<MISC_CFG>
|
||||
<GPU_SBDF>0x00000010</GPU_SBDF>
|
||||
</MISC_CFG>
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<memory>
|
||||
<size>256</size>
|
||||
<hpa_region>
|
||||
<start_hpa>0x100000000</start_hpa>
|
||||
<size_hpa>512</size_hpa>
|
||||
</hpa_region>
|
||||
</memory>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>3</pcpu_id>
|
||||
<real_time_vcpu>n</real_time_vcpu>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_ELF</kern_type>
|
||||
<kern_mod>Zephyr_ElfImage</kern_mod>
|
||||
<bootargs>rw rootwait root=/dev/sda2 console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3 i915.nuclear_pageflip=1 swiotlb=131072</bootargs>
|
||||
</os_config>
|
||||
<mmio_resources>
|
||||
<TPM2>n</TPM2>
|
||||
<p2sb>n</p2sb>
|
||||
</mmio_resources>
|
||||
<load_order>PRE_LAUNCHED_VM</load_order>
|
||||
<name>SAFETY_VM0</name>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<companion_vmid>65535</companion_vmid>
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<load_order>SERVICE_VM</load_order>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>Linux_bzImage</kern_mod>
|
||||
<bootargs>root=/dev/nvme0n1p2 rw rootwait console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3
|
||||
i915.nuclear_pageflip=1 swiotlb=131072</bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<companion_vmid>65535</companion_vmid>
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>2</pcpu_id>
|
||||
<real_time_vcpu>n</real_time_vcpu>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>4096</size>
|
||||
</memory>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<pci_devs>
|
||||
<pci_dev>00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)</pci_dev>
|
||||
</pci_devs>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>WaaG</interface_name>
|
||||
</network>
|
||||
<block>./win10-ltsc.img</block>
|
||||
</virtio_devices>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<companion_vmid>65535</companion_vmid>
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>2</pcpu_id>
|
||||
<real_time_vcpu>n</real_time_vcpu>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>512</size>
|
||||
</memory>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Non-Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>YaaG</interface_name>
|
||||
</network>
|
||||
<block>./YaaG.img</block>
|
||||
</virtio_devices>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<companion_vmid>65535</companion_vmid>
|
||||
</vm>
|
||||
</acrn-config>
|
@ -1,165 +0,0 @@
|
||||
<acrn-config>
|
||||
<hv>
|
||||
<BUILD_TYPE>debug</BUILD_TYPE>
|
||||
<DEBUG_OPTIONS>
|
||||
<SERIAL_CONSOLE>/dev/ttyS0</SERIAL_CONSOLE>
|
||||
<MEM_LOGLEVEL>5</MEM_LOGLEVEL>
|
||||
<NPK_LOGLEVEL>5</NPK_LOGLEVEL>
|
||||
<CONSOLE_LOGLEVEL>3</CONSOLE_LOGLEVEL>
|
||||
</DEBUG_OPTIONS>
|
||||
<FEATURES>
|
||||
<RELOC_ENABLED>y</RELOC_ENABLED>
|
||||
<SCHEDULER>SCHED_BVT</SCHEDULER>
|
||||
<MULTIBOOT2_ENABLED>y</MULTIBOOT2_ENABLED>
|
||||
<SPLIT_LOCK_DETECTION_ENABLED>n</SPLIT_LOCK_DETECTION_ENABLED>
|
||||
<UC_LOCK_DETECTION_ENABLED>y</UC_LOCK_DETECTION_ENABLED>
|
||||
<SECURITY_VM_FIXUP>n</SECURITY_VM_FIXUP>
|
||||
<RDT>
|
||||
<RDT_ENABLED>n</RDT_ENABLED>
|
||||
<CDP_ENABLED>n</CDP_ENABLED>
|
||||
<VCAT_ENABLED>n</VCAT_ENABLED>
|
||||
</RDT>
|
||||
<HYPERV_ENABLED>y</HYPERV_ENABLED>
|
||||
<IOMMU_ENFORCE_SNP>n</IOMMU_ENFORCE_SNP>
|
||||
<ACPI_PARSE_ENABLED>y</ACPI_PARSE_ENABLED>
|
||||
<L1D_VMENTRY_ENABLED>n</L1D_VMENTRY_ENABLED>
|
||||
<MCE_ON_PSC_ENABLED>y</MCE_ON_PSC_ENABLED>
|
||||
<IVSHMEM/>
|
||||
</FEATURES>
|
||||
<MEMORY>
|
||||
<STACK_SIZE>0x2000</STACK_SIZE>
|
||||
</MEMORY>
|
||||
<CAPACITIES>
|
||||
<MAX_VM_NUM>16</MAX_VM_NUM>
|
||||
<MAX_IOAPIC_NUM>1</MAX_IOAPIC_NUM>
|
||||
<MAX_PCI_DEV_NUM>96</MAX_PCI_DEV_NUM>
|
||||
<MAX_IOAPIC_LINES>120</MAX_IOAPIC_LINES>
|
||||
<MAX_PT_IRQ_ENTRIES>256</MAX_PT_IRQ_ENTRIES>
|
||||
<MAX_MSIX_TABLE_NUM/>
|
||||
<MAX_EMULATED_MMIO>16</MAX_EMULATED_MMIO>
|
||||
</CAPACITIES>
|
||||
<MISC_CFG>
|
||||
<GPU_SBDF>0x00000010</GPU_SBDF>
|
||||
</MISC_CFG>
|
||||
<vuart_connections>
|
||||
<vuart_connection>
|
||||
<name>vUART connection 1</name>
|
||||
<type>legacy</type>
|
||||
<endpoint>
|
||||
<vm_name>SAFETY_VM0</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
</endpoint>
|
||||
<endpoint>
|
||||
<vm_name>ACRN_Service_VM</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
</endpoint>
|
||||
</vuart_connection>
|
||||
</vuart_connections>
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<load_order>PRE_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>SAFETY_VM0</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>3</pcpu_id>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<memory>
|
||||
<hpa_region>
|
||||
<start_hpa>0x100000000</start_hpa>
|
||||
<size_hpa>512</size_hpa>
|
||||
</hpa_region>
|
||||
</memory>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_ELF</kern_type>
|
||||
<kern_mod>Zephyr_ElfImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs/>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<mmio_resources>
|
||||
<TPM2>n</TPM2>
|
||||
<p2sb>n</p2sb>
|
||||
</mmio_resources>
|
||||
<pt_intx> </pt_intx>
|
||||
<pci_devs/>
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<load_order>SERVICE_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>Linux_bzImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs>root=/dev/nvme0n1p2 rw rootwait console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3
|
||||
i915.nuclear_pageflip=1 swiotlb=131072</bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>2</pcpu_id>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>4096</size>
|
||||
</memory>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<pci_devs>
|
||||
<pci_dev>00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)</pci_dev>
|
||||
</pci_devs>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console/>
|
||||
<network>
|
||||
<interface_name>WaaG</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./win10-ltsc.img</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>2</pcpu_id>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>512</size>
|
||||
</memory>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Non-Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>YaaG</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./YaaG.img</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
</acrn-config>
|
@ -1,188 +0,0 @@
|
||||
<acrn-config>
|
||||
<hv>
|
||||
<BUILD_TYPE>debug</BUILD_TYPE>
|
||||
<DEBUG_OPTIONS>
|
||||
<SERIAL_CONSOLE>/dev/ttyS0</SERIAL_CONSOLE>
|
||||
<MEM_LOGLEVEL>5</MEM_LOGLEVEL>
|
||||
<NPK_LOGLEVEL>5</NPK_LOGLEVEL>
|
||||
<CONSOLE_LOGLEVEL>3</CONSOLE_LOGLEVEL>
|
||||
</DEBUG_OPTIONS>
|
||||
<FEATURES>
|
||||
<RELOC_ENABLED>y</RELOC_ENABLED>
|
||||
<SCHEDULER>SCHED_BVT</SCHEDULER>
|
||||
<MULTIBOOT2_ENABLED>y</MULTIBOOT2_ENABLED>
|
||||
<SPLIT_LOCK_DETECTION_ENABLED>n</SPLIT_LOCK_DETECTION_ENABLED>
|
||||
<RDT>
|
||||
<RDT_ENABLED>n</RDT_ENABLED>
|
||||
<CDP_ENABLED>n</CDP_ENABLED>
|
||||
</RDT>
|
||||
<HYPERV_ENABLED>y</HYPERV_ENABLED>
|
||||
<IOMMU_ENFORCE_SNP>n</IOMMU_ENFORCE_SNP>
|
||||
<ACPI_PARSE_ENABLED>y</ACPI_PARSE_ENABLED>
|
||||
<L1D_VMENTRY_ENABLED>n</L1D_VMENTRY_ENABLED>
|
||||
<MCE_ON_PSC_ENABLED>y</MCE_ON_PSC_ENABLED>
|
||||
<IVSHMEM>
|
||||
<IVSHMEM_REGION>
|
||||
<NAME>shm_region_0</NAME>
|
||||
<PROVIDED_BY>Hypervisor</PROVIDED_BY>
|
||||
<IVSHMEM_SIZE>2</IVSHMEM_SIZE>
|
||||
<IVSHMEM_VMS>
|
||||
<IVSHMEM_VM>
|
||||
<VM_NAME>PRE_RT_VM0</VM_NAME>
|
||||
<VBDF>00:08.0</VBDF>
|
||||
</IVSHMEM_VM>
|
||||
<IVSHMEM_VM>
|
||||
<VM_NAME>POST_STD_VM1</VM_NAME>
|
||||
<VBDF>00:08.0</VBDF>
|
||||
</IVSHMEM_VM>
|
||||
</IVSHMEM_VMS>
|
||||
</IVSHMEM_REGION>
|
||||
</IVSHMEM>
|
||||
</FEATURES>
|
||||
<MEMORY>
|
||||
<STACK_SIZE>0x2000</STACK_SIZE>
|
||||
</MEMORY>
|
||||
<CAPACITIES>
|
||||
<MAX_VM_NUM>16</MAX_VM_NUM>
|
||||
<MAX_IOAPIC_NUM>1</MAX_IOAPIC_NUM>
|
||||
<MAX_PCI_DEV_NUM>96</MAX_PCI_DEV_NUM>
|
||||
<MAX_IOAPIC_LINES>120</MAX_IOAPIC_LINES>
|
||||
<MAX_PT_IRQ_ENTRIES>256</MAX_PT_IRQ_ENTRIES>
|
||||
<MAX_MSIX_TABLE_NUM/>
|
||||
<MAX_EMULATED_MMIO>16</MAX_EMULATED_MMIO>
|
||||
</CAPACITIES>
|
||||
<MISC_CFG>
|
||||
<GPU_SBDF>0x00000010</GPU_SBDF>
|
||||
</MISC_CFG>
|
||||
<vuart_connections>
|
||||
<vuart_connection>
|
||||
<name>vUART connection 1</name>
|
||||
<type>legacy</type>
|
||||
<endpoint>
|
||||
<vm_name>PRE_RT_VM0</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
</endpoint>
|
||||
<endpoint>
|
||||
<vm_name>ACRN_Service_VM</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
</endpoint>
|
||||
</vuart_connection>
|
||||
</vuart_connections>
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<load_order>PRE_LAUNCHED_VM</load_order>
|
||||
<vm_type>RTVM</vm_type>
|
||||
<name>PRE_RT_VM0</name>
|
||||
<lapic_passthrough>y</lapic_passthrough>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>2</pcpu_id>
|
||||
<real_time_vcpu>y</real_time_vcpu>
|
||||
</pcpu>
|
||||
<pcpu>
|
||||
<pcpu_id>3</pcpu_id>
|
||||
<real_time_vcpu>y</real_time_vcpu>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<memory>
|
||||
<hpa_region>
|
||||
<start_hpa>0x100000000</start_hpa>
|
||||
<size_hpa>1024</size_hpa>
|
||||
</hpa_region>
|
||||
</memory>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>RT_bzImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs>rw rootwait root=/dev/sda3 no_ipi_broadcast=1 console=ttyS0 console=tty0 noxsave nohpet no_timer_check ignore_loglevel consoleblank=0 tsc=reliable clocksource=tsc x2apic_phys processor.max_cstate=0 intel_idle.max_cstate=0 intel_pstate=disable mce=ignore_ce audit=0 isolcpus=nohz,domain,1 nohz_full=1 rcu_nocbs=1 nosoftlockup idle=poll irqaffinity=0 reboot=acpi </bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<mmio_resources>
|
||||
<TPM2>n</TPM2>
|
||||
</mmio_resources>
|
||||
<pci_devs>
|
||||
<pci_dev>00:17.0 SATA controller: Intel Corporation Device a0d3 (rev 20)</pci_dev>
|
||||
<pci_dev>58:00.0 Ethernet controller: Intel Corporation Ethernet Controller I225-LM (rev 03)</pci_dev>
|
||||
</pci_devs>
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<load_order>SERVICE_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>Linux_bzImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs>root=/dev/nvme0n1p2 rw rootwait console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3
|
||||
i915.nuclear_pageflip=1 swiotlb=131072</bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>0</pcpu_id>
|
||||
</pcpu>
|
||||
<pcpu>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>4096</size>
|
||||
</memory>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<pci_devs>
|
||||
<pci_dev>00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)</pci_dev>
|
||||
</pci_devs>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console/>
|
||||
<network>
|
||||
<interface_name>WaaG</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./win10-ltsc.img</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>512</size>
|
||||
</memory>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Non-Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>YaaG</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./YaaG.img</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
</acrn-config>
|
@ -81,9 +81,9 @@
|
||||
<os_config>
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>Linux_bzImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs> rw rootwait root=/dev/sda3 console=ttyS0 console=tty0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable reboot=acpi
|
||||
</bootargs>
|
||||
<ramdisk_mod>Ubuntu</ramdisk_mod>
|
||||
<bootargs> rw rootwait root=/dev/sda2 console=tty0 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable reboot=acpi
|
||||
</bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<mmio_resources>
|
||||
@ -91,7 +91,7 @@
|
||||
</mmio_resources>
|
||||
<pci_devs>
|
||||
<pci_dev>00:17.0 SATA controller: Intel Corporation Device a0d3 (rev 20)</pci_dev>
|
||||
<pci_dev>58:00.0 Ethernet controller: Intel Corporation Ethernet Controller I225-LM (rev 03)</pci_dev>
|
||||
<pci_dev>00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (13) I219-LM (rev 20)</pci_dev>
|
||||
</pci_devs>
|
||||
</vm>
|
||||
<vm id="1">
|
||||
@ -120,9 +120,8 @@
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>Linux_bzImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs> rw rootwait root=/dev/sda2 console=ttyS0 console=tty0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M
|
||||
consoleblank=0 tsc=reliable reboot=acpi
|
||||
</bootargs>
|
||||
<bootargs> rw rootwait root=/dev/sda2 console=tty0 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable reboot=acpi
|
||||
</bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<mmio_resources>
|
||||
|
@ -0,0 +1,270 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
# Launch script for VM name: POST_STD_VM1
|
||||
|
||||
|
||||
#
|
||||
|
||||
# Helper functions
|
||||
|
||||
function probe_modules() {
|
||||
modprobe pci_stub
|
||||
}
|
||||
|
||||
function offline_cpus() {
|
||||
# Each parameter of this function is considered the APIC ID (as is reported in /proc/cpuinfo, in decimal) of a CPU
|
||||
# assigned to a post-launched RTVM.
|
||||
for i in $*; do
|
||||
processor_id=$(grep -B 15 "apicid.*: ${i}$" /proc/cpuinfo | grep "^processor" | head -n 1 | cut -d ' ' -f 2)
|
||||
if [ -z ${processor_id} ]; then
|
||||
continue
|
||||
fi
|
||||
if [ "${processor_id}" = "0" ]; then
|
||||
echo "Warning: processor 0 can't be offline, there may be unexpect error!" >> /dev/stderr
|
||||
continue
|
||||
fi
|
||||
cpu_path="/sys/devices/system/cpu/cpu${processor_id}"
|
||||
if [ -f ${cpu_path}/online ]; then
|
||||
online=`cat ${cpu_path}/online`
|
||||
echo cpu${processor_id} online=${online} >> /dev/stderr
|
||||
if [ "${online}" = "1" ]; then
|
||||
echo 0 > ${cpu_path}/online
|
||||
online=`cat ${cpu_path}/online`
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "${online}" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > ${cpu_path}/online
|
||||
online=`cat ${cpu_path}/online`
|
||||
done
|
||||
echo ${processor_id} > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function unbind_device() {
|
||||
physical_bdf=$1
|
||||
|
||||
vendor_id=$(cat /sys/bus/pci/devices/${physical_bdf}/vendor)
|
||||
device_id=$(cat /sys/bus/pci/devices/${physical_bdf}/device)
|
||||
|
||||
echo $(printf "%04x %04x" ${vendor_id} ${device_id}) > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${physical_bdf} > /sys/bus/pci/devices/${physical_bdf}/driver/unbind
|
||||
echo ${physical_bdf} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
}
|
||||
|
||||
function create_tap() {
|
||||
# create a unique tap device for each VM
|
||||
tap=$1
|
||||
tap_exist=$(ip a show dev $tap)
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "$tap TAP device already available, reusing it."
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
fi
|
||||
|
||||
# if acrn-br0 exists, add VM's unique tap device under it
|
||||
br_exist=$(ip a | grep acrn-br0 | awk '{print $1}')
|
||||
if [ "$br_exist"x != "x" -a "$tap_exist"x = "x" ]; then
|
||||
echo "acrn-br0 bridge already exists, adding new $tap TAP device to it..."
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
}
|
||||
|
||||
function mount_partition() {
|
||||
partition=$1
|
||||
|
||||
tmpdir=`mktemp -d`
|
||||
mount ${partition} ${tmpdir}
|
||||
echo ${tmpdir}
|
||||
}
|
||||
|
||||
function unmount_partition() {
|
||||
tmpdir=$1
|
||||
|
||||
umount ${tmpdir}
|
||||
rmdir ${tmpdir}
|
||||
}
|
||||
|
||||
# Generators of device model parameters
|
||||
|
||||
function add_cpus() {
|
||||
# Each parameter of this function is considered the apicid of processor (as is reported in /proc/cpuinfo) of
|
||||
# a CPU assigned to a post-launched RTVM.
|
||||
|
||||
if [ "${vm_type}" = "RTVM" ] || [ "${scheduler}" = "SCHED_NOOP" ] || [ "${own_pcpu}" = "y" ]; then
|
||||
offline_cpus $*
|
||||
fi
|
||||
|
||||
cpu_list=$(local IFS=, ; echo "$*")
|
||||
echo -n "--cpu_affinity ${cpu_list}"
|
||||
}
|
||||
|
||||
function add_interrupt_storm_monitor() {
|
||||
threshold_per_sec=$1
|
||||
probe_period_in_sec=$2
|
||||
inject_delay_in_ms=$3
|
||||
delay_duration_in_ms=$4
|
||||
|
||||
echo -n "--intr_monitor ${threshold_per_sec},${probe_period_in_sec},${inject_delay_in_ms},${delay_duration_in_ms}"
|
||||
}
|
||||
|
||||
function add_logger_settings() {
|
||||
loggers=()
|
||||
|
||||
for conf in $*; do
|
||||
logger=${conf%=*}
|
||||
level=${conf#*=}
|
||||
loggers+=("${logger},level=${level}")
|
||||
done
|
||||
|
||||
cmd_param=$(local IFS=';' ; echo "${loggers[*]}")
|
||||
echo -n "--logger_setting ${cmd_param}"
|
||||
}
|
||||
|
||||
function add_virtual_device() {
|
||||
slot=$1
|
||||
kind=$2
|
||||
options=$3
|
||||
|
||||
if [ "${kind}" = "virtio-net" ]; then
|
||||
# Create the tap device
|
||||
if [[ ${options} =~ tap=([^,]+) ]]; then
|
||||
tap_conf="${BASH_REMATCH[1]}"
|
||||
create_tap "${tap_conf}" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${kind}" = "virtio-input" ]; then
|
||||
options=$*
|
||||
if [[ "${options}" =~ id:([a-zA-Z0-9_\-]*) ]]; then
|
||||
unique_identifier="${BASH_REMATCH[1]}"
|
||||
options=${options/",id:${unique_identifier}"/''}
|
||||
fi
|
||||
|
||||
if [[ "${options}" =~ (Device name: )(.*),( Device physical path: )(.*) ]]; then
|
||||
device_name="${BASH_REMATCH[2]}"
|
||||
phys_name="${BASH_REMATCH[4]}"
|
||||
local IFS=$'\n'
|
||||
device_name_paths=$(grep -r "${device_name}" /sys/class/input/event*/device/name)
|
||||
phys_paths=$(grep -r "${phys_name}" /sys/class/input/event*/device/phys)
|
||||
fi
|
||||
|
||||
if [ -n "${device_name_paths}" ] && [ -n "${phys_paths}" ]; then
|
||||
for device_path in ${device_name_paths}; do
|
||||
for phys_path in ${phys_paths}; do
|
||||
if [ "${device_path%/device*}" = "${phys_path%/device*}" ]; then
|
||||
event_path=${device_path}
|
||||
if [[ ${event_path} =~ event([0-9]+) ]]; then
|
||||
event_num="${BASH_REMATCH[1]}"
|
||||
options="/dev/input/event${event_num}"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ ${options} =~ event([0-9]+) ]]; then
|
||||
echo "${options} input device path is available in the service vm." >> /dev/stderr
|
||||
else
|
||||
echo "${options} input device path is not found in the service vm." >> /dev/stderr
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -n "${options}" ] && [ -n "${unique_identifier}" ]; then
|
||||
options="${options},${unique_identifier}"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo -n "-s ${slot},${kind}"
|
||||
if [ -n "${options}" ]; then
|
||||
echo -n ",${options}"
|
||||
fi
|
||||
}
|
||||
|
||||
function add_passthrough_device() {
|
||||
slot=$1
|
||||
physical_bdf=$2
|
||||
options=$3
|
||||
|
||||
unbind_device ${physical_bdf%,*}
|
||||
|
||||
# bus, device and function as decimal integers
|
||||
bus_temp=${physical_bdf#*:}; bus=$((16#${bus_temp%:*}))
|
||||
dev_temp=${physical_bdf##*:}; dev=$((16#${dev_temp%.*}))
|
||||
fun=$((16#${physical_bdf#*.}))
|
||||
|
||||
echo -n "-s "
|
||||
printf '%s,passthru,%x/%x/%x' ${slot} ${bus} ${dev} ${fun}
|
||||
if [ -n "${options}" ]; then
|
||||
echo -n ",${options}"
|
||||
fi
|
||||
}
|
||||
|
||||
###
|
||||
# The followings are generated by launch_cfg_gen.py
|
||||
###
|
||||
|
||||
# Defining variables that describe VM types
|
||||
vm_type='STANDARD_VM'
|
||||
scheduler='SCHED_BVT'
|
||||
own_pcpu='n'
|
||||
|
||||
# Initializing
|
||||
probe_modules
|
||||
mac=$(cat /sys/class/net/e*/address)
|
||||
|
||||
|
||||
# Note for developers: The number of available logical CPUs depends on the
|
||||
# number of enabled cores and whether Hyperthreading is enabled in the BIOS
|
||||
# settings. CPU IDs are assigned to each logical CPU but are not the same ID
|
||||
# value throughout the system:
|
||||
#
|
||||
# Native CPU_ID:
|
||||
# ID enumerated by the Linux Kernel and shown in the
|
||||
# ACRN Configurator's CPU Affinity option (used in the scenario.xml)
|
||||
# Service VM CPU_ID:
|
||||
# ID assigned by the Service VM at runtime
|
||||
# APIC_ID:
|
||||
# Advanced Programmable Interrupt Controller's unique ID as
|
||||
# enumerated by the board inspector (used in this launch script)
|
||||
#
|
||||
# This table shows equivalent CPU IDs for this scenario and board:
|
||||
#
|
||||
|
||||
# Native CPU_ID Service VM CPU_ID APIC_ID
|
||||
# ------------- ----------------- -------
|
||||
# 0 0 0
|
||||
# 1 1 2
|
||||
# 2 2 4
|
||||
# 3 3 6
|
||||
|
||||
# Invoking ACRN device model
|
||||
dm_params=(
|
||||
--windows
|
||||
`add_cpus 0 2`
|
||||
-m 4096M
|
||||
--ovmf /usr/share/acrn/bios/OVMF.fd
|
||||
`add_virtual_device 1:0 lpc`
|
||||
`add_virtual_device 0:0 hostbridge`
|
||||
`add_virtual_device 3 virtio-console @stdio:stdio_port`
|
||||
`add_virtual_device 4 virtio-net tap=WaaG,mac_seed=${mac:0:17}-POST_STD_VM1`
|
||||
`add_virtual_device 5 virtio-blk ./win10-ltsc.img`
|
||||
`add_passthrough_device 2 0000:00:02.0`
|
||||
`add_logger_settings console=4 kmsg=3 disk=5`
|
||||
POST_STD_VM1
|
||||
)
|
||||
|
||||
echo "Launch device model with parameters: ${dm_params[@]}"
|
||||
acrn-dm "${dm_params[@]}"
|
||||
|
||||
# Deinitializing
|
@ -0,0 +1,270 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
# Launch script for VM name: POST_RT_VM1
|
||||
|
||||
|
||||
#
|
||||
|
||||
# Helper functions
|
||||
|
||||
function probe_modules() {
|
||||
modprobe pci_stub
|
||||
}
|
||||
|
||||
function offline_cpus() {
|
||||
# Each parameter of this function is considered the APIC ID (as is reported in /proc/cpuinfo, in decimal) of a CPU
|
||||
# assigned to a post-launched RTVM.
|
||||
for i in $*; do
|
||||
processor_id=$(grep -B 15 "apicid.*: ${i}$" /proc/cpuinfo | grep "^processor" | head -n 1 | cut -d ' ' -f 2)
|
||||
if [ -z ${processor_id} ]; then
|
||||
continue
|
||||
fi
|
||||
if [ "${processor_id}" = "0" ]; then
|
||||
echo "Warning: processor 0 can't be offline, there may be unexpect error!" >> /dev/stderr
|
||||
continue
|
||||
fi
|
||||
cpu_path="/sys/devices/system/cpu/cpu${processor_id}"
|
||||
if [ -f ${cpu_path}/online ]; then
|
||||
online=`cat ${cpu_path}/online`
|
||||
echo cpu${processor_id} online=${online} >> /dev/stderr
|
||||
if [ "${online}" = "1" ]; then
|
||||
echo 0 > ${cpu_path}/online
|
||||
online=`cat ${cpu_path}/online`
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "${online}" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > ${cpu_path}/online
|
||||
online=`cat ${cpu_path}/online`
|
||||
done
|
||||
echo ${processor_id} > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function unbind_device() {
|
||||
physical_bdf=$1
|
||||
|
||||
vendor_id=$(cat /sys/bus/pci/devices/${physical_bdf}/vendor)
|
||||
device_id=$(cat /sys/bus/pci/devices/${physical_bdf}/device)
|
||||
|
||||
echo $(printf "%04x %04x" ${vendor_id} ${device_id}) > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${physical_bdf} > /sys/bus/pci/devices/${physical_bdf}/driver/unbind
|
||||
echo ${physical_bdf} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
}
|
||||
|
||||
function create_tap() {
|
||||
# create a unique tap device for each VM
|
||||
tap=$1
|
||||
tap_exist=$(ip a show dev $tap)
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "$tap TAP device already available, reusing it."
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
fi
|
||||
|
||||
# if acrn-br0 exists, add VM's unique tap device under it
|
||||
br_exist=$(ip a | grep acrn-br0 | awk '{print $1}')
|
||||
if [ "$br_exist"x != "x" -a "$tap_exist"x = "x" ]; then
|
||||
echo "acrn-br0 bridge already exists, adding new $tap TAP device to it..."
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
}
|
||||
|
||||
function mount_partition() {
|
||||
partition=$1
|
||||
|
||||
tmpdir=`mktemp -d`
|
||||
mount ${partition} ${tmpdir}
|
||||
echo ${tmpdir}
|
||||
}
|
||||
|
||||
function unmount_partition() {
|
||||
tmpdir=$1
|
||||
|
||||
umount ${tmpdir}
|
||||
rmdir ${tmpdir}
|
||||
}
|
||||
|
||||
# Generators of device model parameters
|
||||
|
||||
function add_cpus() {
|
||||
# Each parameter of this function is considered the apicid of processor (as is reported in /proc/cpuinfo) of
|
||||
# a CPU assigned to a post-launched RTVM.
|
||||
|
||||
if [ "${vm_type}" = "RTVM" ] || [ "${scheduler}" = "SCHED_NOOP" ] || [ "${own_pcpu}" = "y" ]; then
|
||||
offline_cpus $*
|
||||
fi
|
||||
|
||||
cpu_list=$(local IFS=, ; echo "$*")
|
||||
echo -n "--cpu_affinity ${cpu_list}"
|
||||
}
|
||||
|
||||
function add_interrupt_storm_monitor() {
|
||||
threshold_per_sec=$1
|
||||
probe_period_in_sec=$2
|
||||
inject_delay_in_ms=$3
|
||||
delay_duration_in_ms=$4
|
||||
|
||||
echo -n "--intr_monitor ${threshold_per_sec},${probe_period_in_sec},${inject_delay_in_ms},${delay_duration_in_ms}"
|
||||
}
|
||||
|
||||
function add_logger_settings() {
|
||||
loggers=()
|
||||
|
||||
for conf in $*; do
|
||||
logger=${conf%=*}
|
||||
level=${conf#*=}
|
||||
loggers+=("${logger},level=${level}")
|
||||
done
|
||||
|
||||
cmd_param=$(local IFS=';' ; echo "${loggers[*]}")
|
||||
echo -n "--logger_setting ${cmd_param}"
|
||||
}
|
||||
|
||||
function add_virtual_device() {
|
||||
slot=$1
|
||||
kind=$2
|
||||
options=$3
|
||||
|
||||
if [ "${kind}" = "virtio-net" ]; then
|
||||
# Create the tap device
|
||||
if [[ ${options} =~ tap=([^,]+) ]]; then
|
||||
tap_conf="${BASH_REMATCH[1]}"
|
||||
create_tap "${tap_conf}" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${kind}" = "virtio-input" ]; then
|
||||
options=$*
|
||||
if [[ "${options}" =~ id:([a-zA-Z0-9_\-]*) ]]; then
|
||||
unique_identifier="${BASH_REMATCH[1]}"
|
||||
options=${options/",id:${unique_identifier}"/''}
|
||||
fi
|
||||
|
||||
if [[ "${options}" =~ (Device name: )(.*),( Device physical path: )(.*) ]]; then
|
||||
device_name="${BASH_REMATCH[2]}"
|
||||
phys_name="${BASH_REMATCH[4]}"
|
||||
local IFS=$'\n'
|
||||
device_name_paths=$(grep -r "${device_name}" /sys/class/input/event*/device/name)
|
||||
phys_paths=$(grep -r "${phys_name}" /sys/class/input/event*/device/phys)
|
||||
fi
|
||||
|
||||
if [ -n "${device_name_paths}" ] && [ -n "${phys_paths}" ]; then
|
||||
for device_path in ${device_name_paths}; do
|
||||
for phys_path in ${phys_paths}; do
|
||||
if [ "${device_path%/device*}" = "${phys_path%/device*}" ]; then
|
||||
event_path=${device_path}
|
||||
if [[ ${event_path} =~ event([0-9]+) ]]; then
|
||||
event_num="${BASH_REMATCH[1]}"
|
||||
options="/dev/input/event${event_num}"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ ${options} =~ event([0-9]+) ]]; then
|
||||
echo "${options} input device path is available in the service vm." >> /dev/stderr
|
||||
else
|
||||
echo "${options} input device path is not found in the service vm." >> /dev/stderr
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -n "${options}" ] && [ -n "${unique_identifier}" ]; then
|
||||
options="${options},${unique_identifier}"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo -n "-s ${slot},${kind}"
|
||||
if [ -n "${options}" ]; then
|
||||
echo -n ",${options}"
|
||||
fi
|
||||
}
|
||||
|
||||
function add_passthrough_device() {
|
||||
slot=$1
|
||||
physical_bdf=$2
|
||||
options=$3
|
||||
|
||||
unbind_device ${physical_bdf%,*}
|
||||
|
||||
# bus, device and function as decimal integers
|
||||
bus_temp=${physical_bdf#*:}; bus=$((16#${bus_temp%:*}))
|
||||
dev_temp=${physical_bdf##*:}; dev=$((16#${dev_temp%.*}))
|
||||
fun=$((16#${physical_bdf#*.}))
|
||||
|
||||
echo -n "-s "
|
||||
printf '%s,passthru,%x/%x/%x' ${slot} ${bus} ${dev} ${fun}
|
||||
if [ -n "${options}" ]; then
|
||||
echo -n ",${options}"
|
||||
fi
|
||||
}
|
||||
|
||||
###
|
||||
# The followings are generated by launch_cfg_gen.py
|
||||
###
|
||||
|
||||
# Defining variables that describe VM types
|
||||
vm_type='RTVM'
|
||||
scheduler='SCHED_BVT'
|
||||
own_pcpu='n'
|
||||
|
||||
# Initializing
|
||||
probe_modules
|
||||
mac=$(cat /sys/class/net/e*/address)
|
||||
|
||||
|
||||
# Note for developers: The number of available logical CPUs depends on the
|
||||
# number of enabled cores and whether Hyperthreading is enabled in the BIOS
|
||||
# settings. CPU IDs are assigned to each logical CPU but are not the same ID
|
||||
# value throughout the system:
|
||||
#
|
||||
# Native CPU_ID:
|
||||
# ID enumerated by the Linux Kernel and shown in the
|
||||
# ACRN Configurator's CPU Affinity option (used in the scenario.xml)
|
||||
# Service VM CPU_ID:
|
||||
# ID assigned by the Service VM at runtime
|
||||
# APIC_ID:
|
||||
# Advanced Programmable Interrupt Controller's unique ID as
|
||||
# enumerated by the board inspector (used in this launch script)
|
||||
#
|
||||
# This table shows equivalent CPU IDs for this scenario and board:
|
||||
#
|
||||
|
||||
# Native CPU_ID Service VM CPU_ID APIC_ID
|
||||
# ------------- ----------------- -------
|
||||
# 0 0 0
|
||||
# 1 1 2
|
||||
# 2 2 4
|
||||
# 3 3 6
|
||||
|
||||
# Invoking ACRN device model
|
||||
dm_params=(
|
||||
`add_cpus 4 6`
|
||||
-m 1024M
|
||||
--ovmf /usr/share/acrn/bios/OVMF.fd
|
||||
`add_virtual_device 0:0 hostbridge`
|
||||
--virtio_poll 1000000
|
||||
`add_virtual_device 3 virtio-console @stdio:stdio_port`
|
||||
`add_virtual_device 4 virtio-net tap=RT,mac_seed=${mac:0:17}-POST_RT_VM1`
|
||||
`add_virtual_device 5 virtio-blk ./core-image-weston-intel-corei7-64.wic`
|
||||
--rtvm
|
||||
--lapic_pt
|
||||
`add_logger_settings console=4 kmsg=3 disk=5`
|
||||
POST_RT_VM1
|
||||
)
|
||||
|
||||
echo "Launch device model with parameters: ${dm_params[@]}"
|
||||
acrn-dm "${dm_params[@]}"
|
||||
|
||||
# Deinitializing
|
@ -1 +0,0 @@
|
||||
shared_launch_2user_vm.xml
|
159
misc/config_tools/data/generic_board/shared.xml
Normal file
159
misc/config_tools/data/generic_board/shared.xml
Normal file
@ -0,0 +1,159 @@
|
||||
<acrn-config>
|
||||
<hv>
|
||||
<BUILD_TYPE>debug</BUILD_TYPE>
|
||||
<DEBUG_OPTIONS>
|
||||
<SERIAL_CONSOLE>/dev/ttyS0</SERIAL_CONSOLE>
|
||||
<MEM_LOGLEVEL>5</MEM_LOGLEVEL>
|
||||
<NPK_LOGLEVEL>5</NPK_LOGLEVEL>
|
||||
<CONSOLE_LOGLEVEL>3</CONSOLE_LOGLEVEL>
|
||||
</DEBUG_OPTIONS>
|
||||
<FEATURES>
|
||||
<RELOC_ENABLED>y</RELOC_ENABLED>
|
||||
<SCHEDULER>SCHED_BVT</SCHEDULER>
|
||||
<MULTIBOOT2_ENABLED>y</MULTIBOOT2_ENABLED>
|
||||
<SPLIT_LOCK_DETECTION_ENABLED>n</SPLIT_LOCK_DETECTION_ENABLED>
|
||||
<UC_LOCK_DETECTION_ENABLED>y</UC_LOCK_DETECTION_ENABLED>
|
||||
<SECURITY_VM_FIXUP>n</SECURITY_VM_FIXUP>
|
||||
<RDT>
|
||||
<RDT_ENABLED>n</RDT_ENABLED>
|
||||
<CDP_ENABLED>n</CDP_ENABLED>
|
||||
<VCAT_ENABLED>n</VCAT_ENABLED>
|
||||
</RDT>
|
||||
<HYPERV_ENABLED>y</HYPERV_ENABLED>
|
||||
<IOMMU_ENFORCE_SNP>n</IOMMU_ENFORCE_SNP>
|
||||
<ACPI_PARSE_ENABLED>y</ACPI_PARSE_ENABLED>
|
||||
<L1D_VMENTRY_ENABLED>n</L1D_VMENTRY_ENABLED>
|
||||
<MCE_ON_PSC_ENABLED>y</MCE_ON_PSC_ENABLED>
|
||||
<IVSHMEM/>
|
||||
</FEATURES>
|
||||
<MEMORY>
|
||||
<STACK_SIZE>0x2000</STACK_SIZE>
|
||||
</MEMORY>
|
||||
<CAPACITIES>
|
||||
<MAX_VM_NUM>16</MAX_VM_NUM>
|
||||
<MAX_IOAPIC_NUM>1</MAX_IOAPIC_NUM>
|
||||
<MAX_PCI_DEV_NUM>96</MAX_PCI_DEV_NUM>
|
||||
<MAX_IOAPIC_LINES>120</MAX_IOAPIC_LINES>
|
||||
<MAX_PT_IRQ_ENTRIES>256</MAX_PT_IRQ_ENTRIES>
|
||||
<MAX_MSIX_TABLE_NUM/>
|
||||
<MAX_EMULATED_MMIO>16</MAX_EMULATED_MMIO>
|
||||
</CAPACITIES>
|
||||
<MISC_CFG>
|
||||
<GPU_SBDF>0x00000010</GPU_SBDF>
|
||||
</MISC_CFG>
|
||||
<vuart_connections>
|
||||
<vuart_connection>
|
||||
<name>vUART connection 1</name>
|
||||
<type>legacy</type>
|
||||
<endpoint>
|
||||
<vm_name>ACRN_Service_VM</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
</endpoint>
|
||||
<endpoint>
|
||||
<vm_name>POST_STD_VM1</vm_name>
|
||||
<io_port>0x2F8</io_port>
|
||||
</endpoint>
|
||||
</vuart_connection>
|
||||
<vuart_connection>
|
||||
<name>vUART connection 2</name>
|
||||
<type>legacy</type>
|
||||
<endpoint>
|
||||
<vm_name>ACRN_Service_VM</vm_name>
|
||||
<io_port>0x3E8</io_port>
|
||||
</endpoint>
|
||||
<endpoint>
|
||||
<vm_name>POST_RT_VM1</vm_name>
|
||||
<io_port>0x3E8</io_port>
|
||||
</endpoint>
|
||||
</vuart_connection>
|
||||
</vuart_connections>
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<load_order>SERVICE_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>Linux_bzImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs> rw rootwait root=/dev/nvme0n1p2 console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3
|
||||
i915.nuclear_pageflip=1 swiotlb=131072
|
||||
</bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>0</pcpu_id>
|
||||
</pcpu>
|
||||
<pcpu>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>4096</size>
|
||||
</memory>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<pci_devs>
|
||||
<pci_dev>00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)</pci_dev>
|
||||
</pci_devs>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>WaaG</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./win10-ltsc.img</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>RTVM</vm_type>
|
||||
<name>POST_RT_VM1</name>
|
||||
<lapic_passthrough>y</lapic_passthrough>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>2</pcpu_id>
|
||||
<real_time_vcpu>y</real_time_vcpu>
|
||||
</pcpu>
|
||||
<pcpu>
|
||||
<pcpu_id>3</pcpu_id>
|
||||
<real_time_vcpu>y</real_time_vcpu>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>1024</size>
|
||||
</memory>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Non-Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>RT</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./core-image-weston-intel-corei7-64.wic</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
</acrn-config>
|
@ -1,133 +0,0 @@
|
||||
<acrn-config>
|
||||
<hv>
|
||||
<BUILD_TYPE>debug</BUILD_TYPE>
|
||||
<DEBUG_OPTIONS>
|
||||
<SERIAL_CONSOLE>/dev/ttyS0</SERIAL_CONSOLE>
|
||||
<MEM_LOGLEVEL>5</MEM_LOGLEVEL>
|
||||
<NPK_LOGLEVEL>5</NPK_LOGLEVEL>
|
||||
<CONSOLE_LOGLEVEL>3</CONSOLE_LOGLEVEL>
|
||||
</DEBUG_OPTIONS>
|
||||
<FEATURES>
|
||||
<RELOC_ENABLED>y</RELOC_ENABLED>
|
||||
<SCHEDULER>SCHED_BVT</SCHEDULER>
|
||||
<MULTIBOOT2_ENABLED>y</MULTIBOOT2_ENABLED>
|
||||
<SPLIT_LOCK_DETECTION_ENABLED>n</SPLIT_LOCK_DETECTION_ENABLED>
|
||||
<UC_LOCK_DETECTION_ENABLED>y</UC_LOCK_DETECTION_ENABLED>
|
||||
<SECURITY_VM_FIXUP>n</SECURITY_VM_FIXUP>
|
||||
<RDT>
|
||||
<RDT_ENABLED>n</RDT_ENABLED>
|
||||
<CDP_ENABLED>n</CDP_ENABLED>
|
||||
<VCAT_ENABLED>n</VCAT_ENABLED>
|
||||
</RDT>
|
||||
<HYPERV_ENABLED>y</HYPERV_ENABLED>
|
||||
<IOMMU_ENFORCE_SNP>n</IOMMU_ENFORCE_SNP>
|
||||
<ACPI_PARSE_ENABLED>y</ACPI_PARSE_ENABLED>
|
||||
<L1D_VMENTRY_ENABLED>n</L1D_VMENTRY_ENABLED>
|
||||
<MCE_ON_PSC_ENABLED>y</MCE_ON_PSC_ENABLED>
|
||||
<IVSHMEM/>
|
||||
</FEATURES>
|
||||
<MEMORY>
|
||||
<STACK_SIZE>0x2000</STACK_SIZE>
|
||||
</MEMORY>
|
||||
<CAPACITIES>
|
||||
<MAX_VM_NUM>16</MAX_VM_NUM>
|
||||
<MAX_IOAPIC_NUM>1</MAX_IOAPIC_NUM>
|
||||
<MAX_PCI_DEV_NUM>96</MAX_PCI_DEV_NUM>
|
||||
<MAX_IOAPIC_LINES>120</MAX_IOAPIC_LINES>
|
||||
<MAX_PT_IRQ_ENTRIES>256</MAX_PT_IRQ_ENTRIES>
|
||||
<MAX_MSIX_TABLE_NUM/>
|
||||
<MAX_EMULATED_MMIO>16</MAX_EMULATED_MMIO>
|
||||
</CAPACITIES>
|
||||
<MISC_CFG>
|
||||
<GPU_SBDF>0x00000010</GPU_SBDF>
|
||||
</MISC_CFG>
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<load_order>SERVICE_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<os_config>
|
||||
<kern_type>KERNEL_BZIMAGE</kern_type>
|
||||
<kern_mod>Linux_bzImage</kern_mod>
|
||||
<ramdisk_mod/>
|
||||
<bootargs> rw rootwait root=/dev/nvme0n1p2 console=tty0 console=ttyS0 consoleblank=0 no_timer_check quiet loglevel=3
|
||||
i915.nuclear_pageflip=1 swiotlb=131072
|
||||
</bootargs>
|
||||
</os_config>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>STANDARD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>0</pcpu_id>
|
||||
</pcpu>
|
||||
<pcpu>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>4096</size>
|
||||
</memory>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<pci_devs>
|
||||
<pci_dev>00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)</pci_dev>
|
||||
</pci_devs>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>WaaG</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./win10-ltsc.img</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<load_order>POST_LAUNCHED_VM</load_order>
|
||||
<vm_type>RTVM</vm_type>
|
||||
<name>POST_RT_VM1</name>
|
||||
<lapic_passthrough>y</lapic_passthrough>
|
||||
<cpu_affinity>
|
||||
<pcpu>
|
||||
<pcpu_id>2</pcpu_id>
|
||||
<real_time_vcpu>y</real_time_vcpu>
|
||||
</pcpu>
|
||||
<pcpu>
|
||||
<pcpu_id>3</pcpu_id>
|
||||
<real_time_vcpu>y</real_time_vcpu>
|
||||
</pcpu>
|
||||
</cpu_affinity>
|
||||
<memory>
|
||||
<size>1024</size>
|
||||
</memory>
|
||||
<priority>PRIO_LOW</priority>
|
||||
<console_vuart>COM Port 1</console_vuart>
|
||||
<PTM>n</PTM>
|
||||
<os_type>Non-Windows OS</os_type>
|
||||
<vbootloader>y</vbootloader>
|
||||
<vuart0>n</vuart0>
|
||||
<usb_xhci/>
|
||||
<virtio_devices>
|
||||
<console>
|
||||
<use_type>Virtio console</use_type>
|
||||
<backend_type>stdio</backend_type>
|
||||
</console>
|
||||
<network>
|
||||
<interface_name>RT</interface_name>
|
||||
</network>
|
||||
<input/>
|
||||
<block>./core-image-weston-intel-corei7-64.wic</block>
|
||||
</virtio_devices>
|
||||
</vm>
|
||||
</acrn-config>
|
1
misc/config_tools/data/sample_launch_scripts
Symbolic link
1
misc/config_tools/data/sample_launch_scripts
Symbolic link
@ -0,0 +1 @@
|
||||
generic_board/sample_launch_scripts
|
@ -1,594 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2019-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
kernel_version=$(uname -r)
|
||||
audio_module="/usr/lib/modules/$kernel_version/kernel/sound/soc/intel/boards/snd-soc-sst_bxt_sos_tdf8532.ko"
|
||||
ipu_passthrough=0
|
||||
|
||||
# Check the device file of /dev/vbs_ipu to determine the IPU mode
|
||||
if [ ! -e "/dev/vbs_ipu" ]; then
|
||||
ipu_passthrough=1
|
||||
fi
|
||||
|
||||
# use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532
|
||||
if [ ! -e $(audio_module)]; then
|
||||
modprobe -q snd-soc-skl
|
||||
modprobe -q snd-soc-sst_bxt_tdf8532
|
||||
else
|
||||
|
||||
modprobe -q snd_soc_skl
|
||||
modprobe -q snd_soc_tdf8532
|
||||
modprobe -q snd_soc_sst_bxt_sos_tdf8532
|
||||
modprobe -q snd_soc_skl_virtio_be
|
||||
fi
|
||||
audio_passthrough=0
|
||||
|
||||
# Check the device file of /dev/vbs_k_audio to determine the audio mode
|
||||
if [ ! -e "/dev/vbs_k_audio" ]; then
|
||||
audio_passthrough=1
|
||||
fi
|
||||
|
||||
cse_passthrough=0
|
||||
hbm_ver=`cat /sys/class/mei/mei0/hbm_ver`
|
||||
major_ver=`echo $hbm_ver | cut -d '.' -f1`
|
||||
minor_ver=`echo $hbm_ver | cut -d '.' -f2`
|
||||
if [[ "$major_ver" -lt "2" ]] || \
|
||||
[[ "$major_ver" == "2" && "$minor_ver" -le "2" ]]; then
|
||||
cse_passthrough=1
|
||||
fi
|
||||
|
||||
# pci devices for passthru
|
||||
declare -A passthru_vpid
|
||||
declare -A passthru_bdf
|
||||
|
||||
passthru_vpid=(
|
||||
["usb_xdci"]="8086 5aaa"
|
||||
["ipu"]="8086 5a88"
|
||||
["ipu_i2c"]="8086 5aac"
|
||||
["cse"]="8086 5a9a"
|
||||
["sd_card"]="8086 5aca"
|
||||
["audio"]="8086 5a98"
|
||||
["audio_codec"]="8086 5ab4"
|
||||
["wifi"]="11ab 2b38"
|
||||
["bluetooth"]="8086 5abc"
|
||||
)
|
||||
passthru_bdf=(
|
||||
["usb_xdci"]="0000:00:15.1"
|
||||
["ipu"]="0000:00:03.0"
|
||||
["ipu_i2c"]="0000:00:16.0"
|
||||
["cse"]="0000:00:0f.0"
|
||||
["sd_card"]="0000:00:1b.0"
|
||||
["audio"]="0000:00:0e.0"
|
||||
["audio_codec"]="0000:00:17.0"
|
||||
["wifi"]="0000:03:00.0"
|
||||
["bluetooth"]="0000:00:18.0"
|
||||
)
|
||||
|
||||
function launch_clearlinux()
|
||||
{
|
||||
if [ ! -f "/data/$4/$4.img" ]; then
|
||||
echo "no /data/$4/$4.img, exit"
|
||||
exit
|
||||
fi
|
||||
|
||||
#vm-name used to generate uos-mac address
|
||||
mac=$(cat /sys/class/net/e*/address)
|
||||
vm_name=vm$1
|
||||
mac_seed=${mac:9:8}-${vm_name}
|
||||
|
||||
# create a unique tap device for each VM
|
||||
tap=tap_$5
|
||||
tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "tap device existed, reuse $tap"
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
fi
|
||||
|
||||
# if acrn-br0 exists, add VM's unique tap device under it
|
||||
br_exist=$(ip a | grep acrn-br0 | awk '{print $1}')
|
||||
if [ "$br_exist"x != "x" -a "$tap_exist"x = "x" ]; then
|
||||
echo "acrn-br0 bridge aleady exists, adding new tap device to it..."
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#for VT-d device setting
|
||||
modprobe pci_stub
|
||||
echo ${passthru_vpid["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/devices/${passthru_bdf["usb_xdci"]}/driver/unbind
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
echo 100 > /sys/bus/usb/drivers/usb-storage/module/parameters/delay_use
|
||||
|
||||
boot_ipu_option=""
|
||||
if [ $ipu_passthrough == 1 ];then
|
||||
# for ipu passthrough - ipu device
|
||||
if [ -d "/sys/bus/pci/devices/${passthru_bdf["ipu"]}" ]; then
|
||||
echo ${passthru_vpid["ipu"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/devices/${passthru_bdf["ipu"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 12,passthru,0/3/0 "
|
||||
fi
|
||||
|
||||
# for ipu passthrough - ipu related i2c
|
||||
# please use virtual slot 22 for i2c to make sure that the i2c controller
|
||||
# could get the same virtaul BDF as physical BDF
|
||||
if [ -d "/sys/bus/pci/devices/${passthru_bdf["ipu_i2c"]}" ]; then
|
||||
echo ${passthru_vpid["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/devices/${passthru_bdf["ipu_i2c"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 22,passthru,0/16/0 "
|
||||
fi
|
||||
else
|
||||
boot_ipu_option="$boot_ipu_option"" -s 21,virtio-ipu "
|
||||
fi
|
||||
|
||||
boot_cse_option=""
|
||||
if [ $cse_passthrough == 1 ]; then
|
||||
echo ${passthru_vpid["cse"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/devices/${passthru_bdf["cse"]}/driver/unbind
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_cse_option="$boot_cse_option"" -s 15,passthru,0/0f/0 "
|
||||
else
|
||||
boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 "
|
||||
fi
|
||||
|
||||
# for sd card passthrough - SDXC/MMC Host Controller 00:1b.0
|
||||
echo ${passthru_vpid["sd_card"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind
|
||||
echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB
|
||||
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
|
||||
if [ $memsize -gt 7500000 ];then
|
||||
mem_size=6G
|
||||
elif [ $memsize -gt 3500000 ];then
|
||||
mem_size=2G
|
||||
else
|
||||
mem_size=1750M
|
||||
fi
|
||||
|
||||
if [ "$setup_mem" != "" ];then
|
||||
mem_size=$setup_mem
|
||||
fi
|
||||
|
||||
boot_dev_flag=",b"
|
||||
if [ $6 == 1 ];then
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL_debug.bin"
|
||||
else
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL.bin"
|
||||
fi
|
||||
|
||||
#interrupt storm monitor for pass-through devices, params order:
|
||||
#threshold/s,probe-period(s),intr-inject-delay-time(ms),delay-duration(ms)
|
||||
intr_storm_monitor="--intr_monitor 10000,10,1,100"
|
||||
|
||||
acrn-dm --help 2>&1 | grep 'GVT args'
|
||||
if [ $? == 0 ];then
|
||||
GVT_args=$2
|
||||
boot_GVT_option=" -s 0:2:0,pci-gvt -G "
|
||||
else
|
||||
boot_GVT_option=''
|
||||
GVT_args=''
|
||||
fi
|
||||
|
||||
|
||||
acrn-dm -A -m $mem_size $boot_GVT_option"$GVT_args" -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \
|
||||
-s 5,virtio-console,@pty:pty_port \
|
||||
-s 6,virtio-hyper_dmabuf \
|
||||
-s 8,wdt-i6300esb \
|
||||
-s 3,virtio-blk$boot_dev_flag,/data/$4/$4.img \
|
||||
-s 4,virtio-net,$tap $boot_image_option \
|
||||
-s 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \
|
||||
-s 9,passthru,0/15/1 \
|
||||
$boot_cse_option \
|
||||
--mac_seed $mac_seed \
|
||||
-s 27,passthru,0/1b/0 \
|
||||
$intr_storm_monitor \
|
||||
$boot_ipu_option \
|
||||
-i /run/acrn/ioc_$vm_name,0x20 \
|
||||
-l com2,/run/acrn/ioc_$vm_name \
|
||||
--pm_notify_channel ioc \
|
||||
-B "root=/dev/vda2 rw rootwait nohpet console=hvc0 \
|
||||
snd_soc_skl_virtio_fe.domain_id=1 \
|
||||
snd_soc_skl_virtio_fe.domain_name="GuestOS" \
|
||||
console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M \
|
||||
consoleblank=0 tsc=reliable i915.avail_planes_per_pipe=$3 i915.enable_guc_loading=0 \
|
||||
i915.enable_hangcheck=0 i915.nuclear_pageflip=1 \
|
||||
i915.enable_guc_submission=0 i915.enable_guc=0" $vm_name
|
||||
}
|
||||
|
||||
function launch_android()
|
||||
{
|
||||
if [ ! -f "/data/$4/$4.img" ]; then
|
||||
echo "no /data/$4/$4.img, exit"
|
||||
exit
|
||||
fi
|
||||
|
||||
#vm-name used to generate uos-mac address
|
||||
mac=$(cat /sys/class/net/e*/address)
|
||||
vm_name=vm$1
|
||||
mac_seed=${mac:9:8}-${vm_name}
|
||||
|
||||
# create a unique tap device for each VM
|
||||
tap=tap_$5
|
||||
tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "tap device existed, reuse $tap"
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
fi
|
||||
|
||||
# if acrn-br0 exists, add VM's unique tap device under it
|
||||
br_exist=$(ip a | grep acrn-br0 | awk '{print $1}')
|
||||
if [ "$br_exist"x != "x" -a "$tap_exist"x = "x" ]; then
|
||||
echo "acrn-br0 bridge aleady exists, adding new tap device to it..."
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
|
||||
#Use MMC name + serial for ADB serial no., same as native android
|
||||
mmc_name=`cat /sys/block/mmcblk1/device/name`
|
||||
mmc_serial=`cat /sys/block/mmcblk1/device/serial | sed -n 's/^..//p'`
|
||||
ser=$mmc_name$mmc_serial
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#for VT-d device setting
|
||||
modprobe pci_stub
|
||||
echo ${passthru_vpid["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/devices/${passthru_bdf["usb_xdci"]}/driver/unbind
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
#for audio device
|
||||
boot_audio_option=""
|
||||
if [ $audio_passthrough == 1 ]; then
|
||||
echo ${passthru_vpid["audio"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["audio"]} > /sys/bus/pci/devices/${passthru_bdf["audio"]}/driver/unbind
|
||||
echo ${passthru_bdf["audio"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
#for audio codec
|
||||
echo ${passthru_vpid["audio_codec"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["audio_codec"]} > /sys/bus/pci/devices/${passthru_bdf["audio_codec"]}/driver/unbind
|
||||
echo ${passthru_bdf["audio_codec"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
boot_audio_option="-s 14,passthru,0/e/0,keep_gsi -s 23,passthru,0/17/0"
|
||||
else
|
||||
boot_audio_option="-s 14,virtio-audio"
|
||||
fi
|
||||
|
||||
# for sd card passthrough - SDXC/MMC Host Controller 00:1b.0
|
||||
echo ${passthru_vpid["sd_card"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind
|
||||
echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
# WIFI
|
||||
echo ${passthru_vpid["wifi"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["wifi"]} > /sys/bus/pci/devices/${passthru_bdf["wifi"]}/driver/unbind
|
||||
echo ${passthru_bdf["wifi"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
# Bluetooth passthrough depends on WIFI
|
||||
echo ${passthru_vpid["bluetooth"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["bluetooth"]} > /sys/bus/pci/devices/${passthru_bdf["bluetooth"]}/driver/unbind
|
||||
echo ${passthru_bdf["bluetooth"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
# Check if the NPK device/driver is present
|
||||
ls -d /sys/bus/pci/drivers/intel_th_pci/0000* 2>/dev/null 1>/dev/null
|
||||
if [ $? == 0 ];then
|
||||
npk_virt="-s 0:0:2,npk,8/24"
|
||||
else
|
||||
npk_virt=""
|
||||
fi
|
||||
|
||||
# WA for USB role switch hang issue, disable runtime PM of xHCI device
|
||||
echo on > /sys/devices/pci0000:00/0000:00:15.0/power/control
|
||||
|
||||
echo 100 > /sys/bus/usb/drivers/usb-storage/module/parameters/delay_use
|
||||
|
||||
boot_ipu_option=""
|
||||
if [ $ipu_passthrough == 1 ];then
|
||||
# for ipu passthrough - ipu device
|
||||
if [ -d "/sys/bus/pci/devices/${passthru_bdf["ipu"]}" ]; then
|
||||
echo ${passthru_vpid["ipu"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/devices/${passthru_bdf["ipu"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 12,passthru,0/3/0 "
|
||||
fi
|
||||
|
||||
# for ipu passthrough - ipu related i2c
|
||||
# please use virtual slot 22 for i2c to make sure that the i2c controller
|
||||
# could get the same virtaul BDF as physical BDF
|
||||
if [ -d "/sys/bus/pci/devices/${passthru_bdf["ipu_i2c"]}" ]; then
|
||||
echo ${passthru_vpid["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/devices/${passthru_bdf["ipu_i2c"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 22,passthru,0/16/0 "
|
||||
fi
|
||||
else
|
||||
boot_ipu_option="$boot_ipu_option"" -s 21,virtio-ipu "
|
||||
fi
|
||||
|
||||
boot_cse_option=""
|
||||
if [ $cse_passthrough == 1 ]; then
|
||||
echo ${passthru_vpid["cse"]} /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/devices/${passthru_bdf["cse"]}/driver/unbind
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_cse_option="$boot_cse_option"" -s 15,passthru,0/0f/0 "
|
||||
else
|
||||
boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 "
|
||||
fi
|
||||
|
||||
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB
|
||||
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
|
||||
if [ $memsize -gt 7500000 ];then
|
||||
mem_size=6G
|
||||
elif [ $memsize -gt 3500000 ];then
|
||||
mem_size=2G
|
||||
else
|
||||
mem_size=1750M
|
||||
fi
|
||||
|
||||
if [ "$setup_mem" != "" ];then
|
||||
mem_size=$setup_mem
|
||||
fi
|
||||
|
||||
kernel_cmdline_generic="nohpet tsc=reliable intel_iommu=off \
|
||||
androidboot.serialno=$ser \
|
||||
snd_soc_skl_virtio_fe.domain_id=1 \
|
||||
snd_soc_skl_virtio_fe.domain_name="GuestOS" \
|
||||
i915.enable_rc6=1 i915.enable_fbc=1 i915.enable_guc_loading=0 i915.avail_planes_per_pipe=$3 \
|
||||
i915.enable_hangcheck=0 use_nuclear_flip=1 i915.enable_guc_submission=0 i915.enable_guc=0"
|
||||
|
||||
boot_dev_flag=",b"
|
||||
if [ $6 == 1 ];then
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL_debug.bin"
|
||||
else
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL.bin"
|
||||
fi
|
||||
kernel_cmdline="$kernel_cmdline_generic"
|
||||
|
||||
: '
|
||||
select right virtual slots for acrn_dm:
|
||||
1. some passthru device need virtual slot same as physical, like audio 0:e.0 at
|
||||
virtual #14 slot, so "-s 14,passthru,0/e/0"
|
||||
2. acrn_dm share vioapic irq between some virtual slots: like 6&14, 7&15. Need
|
||||
guarantee no virt irq sharing for each passthru device.
|
||||
FIXME: picking a virtual slot (#24 now) which is level-triggered to make sure
|
||||
audio codec passthrough working
|
||||
3. the bootable device slot is configured in compile stating in Android Guest
|
||||
image, it should be kept using 3 as fixed value for Android Guest on Gordon_peak
|
||||
ACRN project
|
||||
'
|
||||
|
||||
#interrupt storm monitor for pass-through devices, params order:
|
||||
#threshold/s,probe-period(s),intr-inject-delay-time(ms),delay-duration(ms)
|
||||
intr_storm_monitor="--intr_monitor 10000,10,1,100"
|
||||
|
||||
acrn-dm --help 2>&1 | grep 'GVT args'
|
||||
if [ $? == 0 ];then
|
||||
GVT_args=$2
|
||||
boot_GVT_option=" -s 2,pci-gvt -G "
|
||||
else
|
||||
boot_GVT_option=''
|
||||
GVT_args=''
|
||||
fi
|
||||
|
||||
acrn-dm -A -m $mem_size $boot_GVT_option"$GVT_args" -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio $npk_virt\
|
||||
-s 9,virtio-net,$tap \
|
||||
-s 3,virtio-blk$boot_dev_flag,/data/$4/$4.img \
|
||||
-s 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \
|
||||
-s 8,passthru,0/15/1 \
|
||||
-s 13,virtio-rpmb \
|
||||
-s 10,virtio-hyper_dmabuf \
|
||||
-s 11,wdt-i6300esb \
|
||||
$boot_audio_option \
|
||||
$boot_cse_option \
|
||||
--mac_seed $mac_seed \
|
||||
-s 27,passthru,0/1b/0 \
|
||||
-s 24,passthru,0/18/0 \
|
||||
-s 18,passthru,3/0/0,keep_gsi \
|
||||
$intr_storm_monitor \
|
||||
$boot_ipu_option \
|
||||
-i /run/acrn/ioc_$vm_name,0x20 \
|
||||
-l com2,/run/acrn/ioc_$vm_name \
|
||||
--pm_notify_channel ioc \
|
||||
$boot_image_option \
|
||||
--enable_trusty \
|
||||
-B "$kernel_cmdline" $vm_name
|
||||
}
|
||||
|
||||
function launch_alios()
|
||||
{
|
||||
#AliOS is not Android, only has same configuration currently, reuse launch function
|
||||
|
||||
launch_android "$@"
|
||||
}
|
||||
|
||||
function help()
|
||||
{
|
||||
echo "Use luanch_uos.sh like that ./launch_uos.sh -V <#>"
|
||||
echo "The option -V means the UOSs group to be launched by vsbl as below"
|
||||
echo "-V 1 means just launching 1 clearlinux UOS"
|
||||
echo "-V 2 means just launching 1 android UOS"
|
||||
echo "-V 3 means launching 1 clearlinux UOS + 1 android UOS"
|
||||
echo "-V 4 means launching 2 clearlinux UOSs"
|
||||
echo "-V 5 means just launching 1 alios UOS"
|
||||
echo "-V 6 means auto check android/linux/alios UOS; if exist, launch it"
|
||||
echo "-C means launching acrn-dm in runC container for QoS"
|
||||
}
|
||||
|
||||
launch_type=1
|
||||
debug=0
|
||||
runC_enable=0
|
||||
|
||||
function run_container()
|
||||
{
|
||||
vm_name=vm1
|
||||
config_src="/usr/share/acrn/samples/apl-mrb/runC.json"
|
||||
shell="/usr/share/acrn/conf/add/$vm_name.sh"
|
||||
arg_file="/usr/share/acrn/conf/add/$vm_name.args"
|
||||
runc_bundle="/usr/share/acrn/conf/add/runc/$vm_name"
|
||||
rootfs_dir="/usr/share/acrn/conf/add/runc/rootfs"
|
||||
config_dst="$runc_bundle/config.json"
|
||||
|
||||
|
||||
input=$(runc list -f table | awk '{print $1}''{print $3}')
|
||||
arr=(${input// / })
|
||||
|
||||
for((i=0;i<${#arr[@]};i++))
|
||||
do
|
||||
if [ "$vm_name" = "${arr[$i]}" ]; then
|
||||
if [ "running" = "${arr[$i+1]}" ]; then
|
||||
echo "runC instance ${arr[$i]} is running"
|
||||
exit
|
||||
else
|
||||
runc kill ${arr[$i]}
|
||||
runc delete ${arr[$i]}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
vmsts=$(acrnctl list)
|
||||
vms=(${vmsts// / })
|
||||
for((i=0;i<${#vms[@]};i++))
|
||||
do
|
||||
if [ "$vm_name" = "${vms[$i]}" ]; then
|
||||
if [ "stopped" != "${vms[$i+1]}" ]; then
|
||||
echo "Uos ${vms[$i]} ${vms[$i+1]}"
|
||||
acrnctl stop ${vms[$i]}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -f "$shell" ]; then
|
||||
echo "Pls add the vm at first!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -f "$arg_file" ]; then
|
||||
echo "Pls add the vm args!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -d "$rootfs_dir" ]; then
|
||||
mkdir -p "$rootfs_dir"
|
||||
fi
|
||||
if [ ! -d "$runc_bundle" ]; then
|
||||
mkdir -p "$runc_bundle"
|
||||
fi
|
||||
if [ ! -f "$config_dst" ]; then
|
||||
cp "$config_src" "$config_dst"
|
||||
args=$(sed '{s/-C//g;s/^[ \t]*//g;s/^/\"/;s/ /\",\"/g;s/$/\"/}' ${arg_file})
|
||||
sed -i "s|\"sh\"|\"$shell\", $args|" $config_dst
|
||||
fi
|
||||
runc run --bundle $runc_bundle -d $vm_name
|
||||
echo "The runC container is running in backgroud"
|
||||
echo "'#runc exec <vmname> bash' to login the container bash"
|
||||
exit
|
||||
}
|
||||
|
||||
while getopts "V:M:hdC" opt
|
||||
do
|
||||
case $opt in
|
||||
V) launch_type=$[$OPTARG]
|
||||
;;
|
||||
M) setup_mem=$OPTARG
|
||||
;;
|
||||
d) debug=1
|
||||
;;
|
||||
C) runC_enable=1
|
||||
;;
|
||||
h) help
|
||||
exit 1
|
||||
;;
|
||||
?) help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -b "/dev/mmcblk1p3" ]; then
|
||||
echo "no /dev/mmcblk1p3 data partition, exit"
|
||||
exit
|
||||
fi
|
||||
|
||||
mkdir -p /data
|
||||
mount /dev/mmcblk1p3 /data
|
||||
|
||||
if [ $launch_type == 6 ]; then
|
||||
if [ -f "/data/android/android.img" ]; then
|
||||
launch_type=2;
|
||||
elif [ -f "/data/alios/alios.img" ]; then
|
||||
launch_type=5;
|
||||
else
|
||||
launch_type=1;
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $runC_enable == 1 ]; then
|
||||
if [ $(hostname) = "runc" ]; then
|
||||
echo "Already in container exit!"
|
||||
exit
|
||||
fi
|
||||
run_container
|
||||
exit
|
||||
fi
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "$online" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
done
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
case $launch_type in
|
||||
1) echo "Launch clearlinux UOS"
|
||||
launch_clearlinux 1 "64 448 8" 0x070F00 clearlinux "LaaG" $debug
|
||||
;;
|
||||
2) echo "Launch android UOS"
|
||||
launch_android 1 "64 448 8" 0x070F00 android "AaaG" $debug
|
||||
;;
|
||||
3) echo "Launch clearlinux UOS + android UOS"
|
||||
launch_android 1 "64 448 4" 0x00000C android "AaaG" $debug &
|
||||
sleep 5
|
||||
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux "LaaG" $debug
|
||||
;;
|
||||
4) echo "Launch two clearlinux UOSs"
|
||||
launch_clearlinux 1 "64 448 4" 0x00000C clearlinux "L1aaG" $debug &
|
||||
sleep 5
|
||||
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux_dup "L2aaG" $debug
|
||||
;;
|
||||
5) echo "Launch alios UOS"
|
||||
launch_alios 1 "64 448 8" 0x070F00 alios "AliaaG" $debug
|
||||
;;
|
||||
esac
|
||||
|
||||
umount /data
|
@ -1,481 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2019-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
kernel_version=$(uname -r | awk -F. '{ printf("%d.%d", $1,$2) }')
|
||||
|
||||
ipu_passthrough=0
|
||||
|
||||
# Check the device file of /dev/vbs_ipu to determine the IPU mode
|
||||
if [ ! -e "/dev/vbs_ipu" ]; then
|
||||
ipu_passthrough=1
|
||||
fi
|
||||
|
||||
audio_passthrough=0
|
||||
|
||||
# Check the device file of /dev/vbs_k_audio to determine the audio mode
|
||||
if [ ! -e "/dev/vbs_k_audio" ]; then
|
||||
audio_passthrough=1
|
||||
fi
|
||||
|
||||
cse_passthrough=0
|
||||
hbm_ver=`cat /sys/class/mei/mei0/hbm_ver`
|
||||
major_ver=`echo $hbm_ver | cut -d '.' -f1`
|
||||
minor_ver=`echo $hbm_ver | cut -d '.' -f2`
|
||||
if [[ "$major_ver" -lt "2" ]] || \
|
||||
[[ "$major_ver" == "2" && "$minor_ver" -le "2" ]]; then
|
||||
cse_passthrough=1
|
||||
fi
|
||||
|
||||
# pci devices for passthru
|
||||
declare -A passthru_vpid
|
||||
declare -A passthru_bdf
|
||||
|
||||
passthru_vpid=(
|
||||
["usb_xdci"]="8086 5aaa"
|
||||
["ipu"]="8086 5a88"
|
||||
["ipu_i2c"]="8086 5aac"
|
||||
["cse"]="8086 5a9a"
|
||||
["sd_card"]="8086 5acc"
|
||||
["audio"]="8086 5a98"
|
||||
["audio_codec"]="8086 5ab4"
|
||||
)
|
||||
passthru_bdf=(
|
||||
["usb_xdci"]="0000:00:15.1"
|
||||
["ipu"]="0000:00:03.0"
|
||||
["ipu_i2c"]="0000:00:16.0"
|
||||
["cse"]="0000:00:0f.0"
|
||||
["sd_card"]="0000:00:1c.0"
|
||||
["audio"]="0000:00:0e.0"
|
||||
["audio_codec"]="0000:00:17.0"
|
||||
)
|
||||
|
||||
function launch_clearlinux()
|
||||
{
|
||||
if [ ! -f "/data/$4/$4.img" ]; then
|
||||
echo "no /data/$4/$4.img, exit"
|
||||
exit
|
||||
fi
|
||||
|
||||
#vm-name used to generate uos-mac address
|
||||
mac=$(cat /sys/class/net/en*/address)
|
||||
vm_name=vm$1
|
||||
mac_seed=${mac:9:8}-${vm_name}
|
||||
|
||||
# create a unique tap device for each VM
|
||||
tap=tap_$5
|
||||
tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "tap device existed, reuse $tap"
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
fi
|
||||
|
||||
# if acrn-br0 exists, add VM's unique tap device under it
|
||||
br_exist=$(ip a | grep acrn-br0 | awk '{print $1}')
|
||||
if [ "$br_exist"x != "x" -a "$tap_exist"x = "x" ]; then
|
||||
echo "acrn-br0 bridge aleady exists, adding new tap device to it..."
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#for VT-d device setting
|
||||
modprobe pci_stub
|
||||
echo ${passthru_vpid["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/devices/${passthru_bdf["usb_xdci"]}/driver/unbind
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
boot_ipu_option=""
|
||||
if [ $ipu_passthrough == 1 ];then
|
||||
# for ipu passthrough - ipu device 0:3.0
|
||||
if [ -d "/sys/bus/pci/devices/${passthru_bdf["ipu"]}" ]; then
|
||||
echo ${passthru_vpid["ipu"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/devices/${passthru_bdf["ipu"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 12,passthru,0/3/0 "
|
||||
fi
|
||||
|
||||
# for ipu passthrough - ipu related i2c
|
||||
# please use virtual slot 22 for i2c to make sure that the i2c controller
|
||||
# could get the same virtaul BDF as physical BDF
|
||||
if [ -d "/sys/bus/pci/devices/${passthru_bdf["ipu_i2c"]}" ]; then
|
||||
echo ${passthru_vpid["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/devices/${passthru_bdf["ipu_i2c"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 22,passthru,0/16/0 "
|
||||
fi
|
||||
else
|
||||
boot_ipu_option="$boot_ipu_option"" -s 21,virtio-ipu "
|
||||
fi
|
||||
|
||||
boot_cse_option=""
|
||||
if [ $cse_passthrough == 1 ]; then
|
||||
echo ${passthru_vpid["cse"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/devices/${passthru_bdf["cse"]}/driver/unbind
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_cse_option="$boot_cse_option"" -s 15,passthru,0/0f/0 "
|
||||
else
|
||||
boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 "
|
||||
fi
|
||||
|
||||
# for sd card passthrough - SDXC/MMC Host Controller
|
||||
# echo ${passthru_vpid["sd_card"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
# echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind
|
||||
# echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB
|
||||
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
|
||||
if [ $memsize -gt 7500000 ];then
|
||||
mem_size=6G
|
||||
elif [ $memsize -gt 3500000 ];then
|
||||
mem_size=2G
|
||||
else
|
||||
mem_size=1750M
|
||||
fi
|
||||
|
||||
if [ "$setup_mem" != "" ];then
|
||||
mem_size=$setup_mem
|
||||
fi
|
||||
|
||||
boot_dev_flag=",b"
|
||||
if [ $6 == 1 ];then
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL_debug.bin"
|
||||
else
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL.bin"
|
||||
fi
|
||||
|
||||
#interrupt storm monitor for pass-through devices, params order:
|
||||
#threshold/s,probe-period(s),intr-inject-delay-time(ms),delay-duration(ms)
|
||||
intr_storm_monitor="--intr_monitor 10000,10,1,100"
|
||||
|
||||
acrn-dm --help 2>&1 | grep 'GVT args'
|
||||
if [ $? == 0 ];then
|
||||
GVT_args=$2
|
||||
boot_GVT_option=" -s 0:2:0,pci-gvt -G "
|
||||
else
|
||||
boot_GVT_option=''
|
||||
GVT_args=''
|
||||
fi
|
||||
|
||||
#logger_setting, format: logger_name,level; like following
|
||||
logger_setting="--logger_setting console,level=4;kmsg,level=3;disk,level=5"
|
||||
|
||||
acrn-dm -A -m $mem_size $boot_GVT_option"$GVT_args" -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \
|
||||
-s 5,virtio-console,@pty:pty_port \
|
||||
-s 6,virtio-hyper_dmabuf \
|
||||
-s 8,wdt-i6300esb \
|
||||
-s 3,virtio-blk$boot_dev_flag,/data/$4/$4.img \
|
||||
-s 4,virtio-net,$tap $boot_image_option \
|
||||
-s 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \
|
||||
-s 9,passthru,0/15/1 \
|
||||
$boot_cse_option \
|
||||
$intr_storm_monitor \
|
||||
$logger_setting \
|
||||
$boot_ipu_option \
|
||||
--mac_seed $mac_seed \
|
||||
--pm_notify_channel power_button \
|
||||
-B "root=/dev/vda2 rw rootwait nohpet console=hvc0 \
|
||||
console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M \
|
||||
consoleblank=0 tsc=reliable i915.avail_planes_per_pipe=$3 i915.enable_guc_loading=0 \
|
||||
i915.enable_hangcheck=0 i915.nuclear_pageflip=1 \
|
||||
i915.enable_guc_submission=0 i915.enable_guc=0" $vm_name
|
||||
}
|
||||
|
||||
function launch_android()
|
||||
{
|
||||
if [ ! -f "/data/$4/$4.img" ]; then
|
||||
echo "no /data/$4/$4.img, exit"
|
||||
exit
|
||||
fi
|
||||
|
||||
#vm-name used to generate uos-mac address
|
||||
mac=$(cat /sys/class/net/en*/address)
|
||||
vm_name=vm$1
|
||||
mac_seed=${mac:9:8}-${vm_name}
|
||||
|
||||
# create a unique tap device for each VM
|
||||
tap=tap_$5
|
||||
tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "tap device existed, reuse $tap"
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
fi
|
||||
|
||||
# if acrn-br0 exists, add VM's unique tap device under it
|
||||
br_exist=$(ip a | grep acrn-br0 | awk '{print $1}')
|
||||
if [ "$br_exist"x != "x" -a "$tap_exist"x = "x" ]; then
|
||||
echo "acrn-br0 bridge aleady exists, adding new tap device to it..."
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
|
||||
#Use MMC name + serial for ADB serial no., same as native android
|
||||
mmc_name=`cat /sys/block/mmcblk0/device/name`
|
||||
mmc_serial=`cat /sys/block/mmcblk0/device/serial | sed -n 's/^..//p'`
|
||||
ser=$mmc_name$mmc_serial
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#for VT-d device setting
|
||||
modprobe pci_stub
|
||||
echo ${passthru_vpid["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/devices/${passthru_bdf["usb_xdci"]}/driver/unbind
|
||||
echo ${passthru_bdf["usb_xdci"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
#for audio device
|
||||
boot_audio_option=""
|
||||
if [ $audio_passthrough == 1 ]; then
|
||||
echo ${passthru_vpid["audio"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["audio"]} > /sys/bus/pci/devices/${passthru_bdf["audio"]}/driver/unbind
|
||||
echo ${passthru_bdf["audio"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
#for audio codec
|
||||
echo ${passthru_vpid["audio_codec"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["audio_codec"]} > /sys/bus/pci/devices/${passthru_bdf["audio_codec"]}/driver/unbind
|
||||
echo ${passthru_bdf["audio_codec"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
boot_audio_option="-s 14,passthru,0/e/0,keep_gsi -s 23,passthru,0/17/0"
|
||||
else
|
||||
boot_audio_option="-s 14,virtio-audio"
|
||||
fi
|
||||
# # for sd card passthrough - SDXC/MMC Host Controller 00:1b.0
|
||||
# echo ${passthru_vpid["sd_card"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
# echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind
|
||||
# echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
# Check if the NPK device/driver is present
|
||||
ls -d /sys/bus/pci/drivers/intel_th_pci/0000* 2>/dev/null 1>/dev/null
|
||||
if [ $? == 0 ];then
|
||||
npk_virt="-s 0:0:2,npk,8/24"
|
||||
else
|
||||
npk_virt=""
|
||||
fi
|
||||
|
||||
# WA for USB role switch hang issue, disable runtime PM of xHCI device
|
||||
echo on > /sys/devices/pci0000:00/0000:00:15.0/power/control
|
||||
|
||||
boot_ipu_option=""
|
||||
if [ $ipu_passthrough == 1 ];then
|
||||
# for ipu passthrough - ipu device
|
||||
if [ -d "/sys/bus/pci/devices/${passthru_bdf["ipu"]}" ]; then
|
||||
echo ${passthru_vpid["ipu"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/devices/${passthru_bdf["ipu"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 12,passthru,0/3/0 "
|
||||
fi
|
||||
|
||||
# for ipu passthrough - ipu related i2c 0:16.0
|
||||
# please use virtual slot 22 for i2c 0:16.0 to make sure that the i2c controller
|
||||
# could get the same virtaul BDF as physical BDF
|
||||
if [ -d "/sys/bus/pci/devices/0000:00:16.0" ]; then
|
||||
echo ${passthru_vpid["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/devices/${passthru_bdf["ipu_i2c"]}/driver/unbind
|
||||
echo ${passthru_bdf["ipu_i2c"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_ipu_option="$boot_ipu_option"" -s 22,passthru,0/16/0 "
|
||||
fi
|
||||
else
|
||||
boot_ipu_option="$boot_ipu_option"" -s 21,virtio-ipu "
|
||||
fi
|
||||
|
||||
boot_cse_option=""
|
||||
if [ $cse_passthrough == 1 ]; then
|
||||
echo ${passthru_vpid["cse"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/devices/${passthru_bdf["cse"]}/driver/unbind
|
||||
echo ${passthru_bdf["cse"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
boot_cse_option="$boot_cse_option"" -s 15,passthru,0/0f/0 "
|
||||
else
|
||||
boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 "
|
||||
fi
|
||||
|
||||
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB
|
||||
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
|
||||
if [ $memsize -gt 7500000 ];then
|
||||
mem_size=6G
|
||||
elif [ $memsize -gt 3500000 ];then
|
||||
mem_size=2G
|
||||
else
|
||||
mem_size=1750M
|
||||
fi
|
||||
|
||||
if [ "$setup_mem" != "" ];then
|
||||
mem_size=$setup_mem
|
||||
fi
|
||||
|
||||
kernel_cmdline_generic="nohpet tsc=reliable intel_iommu=off \
|
||||
androidboot.serialno=$ser \
|
||||
i915.enable_rc6=1 i915.enable_fbc=1 i915.enable_guc_loading=0 i915.avail_planes_per_pipe=$3 \
|
||||
i915.enable_hangcheck=0 use_nuclear_flip=1 i915.enable_guc_submission=0 i915.enable_guc=0"
|
||||
|
||||
boot_dev_flag=",b"
|
||||
if [ $6 == 1 ];then
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL_debug.bin"
|
||||
else
|
||||
boot_image_option="--vsbl /usr/share/acrn/bios/VSBL.bin"
|
||||
fi
|
||||
kernel_cmdline="$kernel_cmdline_generic"
|
||||
|
||||
: '
|
||||
select right virtual slots for acrn_dm:
|
||||
1. some passthru device need virtual slot same as physical, like audio 0:e.0 at
|
||||
virtual #14 slot, so "-s 14,passthru,0/e/0"
|
||||
2. acrn_dm share vioapic irq between some virtual slots: like 6&14, 7&15. Need
|
||||
guarantee no virt irq sharing for each passthru device.
|
||||
FIXME: picking a virtual slot (#24 now) which is level-triggered to make sure
|
||||
audio codec passthrough working
|
||||
3. the bootable device slot is configured in compile stating in Android Guest
|
||||
image, it should be kept using 3 as fixed value for Android Guest on Gordon_peak
|
||||
ACRN project
|
||||
'
|
||||
|
||||
#interrupt storm monitor for pass-through devices, params order:
|
||||
#threshold/s,probe-period(s),intr-inject-delay-time(ms),delay-duration(ms)
|
||||
intr_storm_monitor="--intr_monitor 10000,10,1,100"
|
||||
|
||||
acrn-dm --help 2>&1 | grep 'GVT args'
|
||||
if [ $? == 0 ];then
|
||||
GVT_args=$2
|
||||
boot_GVT_option=" -s 2,pci-gvt -G "
|
||||
else
|
||||
boot_GVT_option=''
|
||||
GVT_args=''
|
||||
fi
|
||||
|
||||
#logger_setting, format: logger_name,level; like following
|
||||
logger_setting="--logger_setting console,level=4;kmsg,level=3;disk,level=5"
|
||||
|
||||
acrn-dm -A -m $mem_size $boot_GVT_option"$GVT_args" -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio $npk_virt\
|
||||
-s 9,virtio-net,$tap \
|
||||
-s 3,virtio-blk$boot_dev_flag,/data/$4/$4.img \
|
||||
-s 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \
|
||||
-s 8,passthru,0/15/1 \
|
||||
-s 13,virtio-rpmb \
|
||||
-s 10,virtio-hyper_dmabuf \
|
||||
-s 11,wdt-i6300esb \
|
||||
$boot_audio_option \
|
||||
$boot_cse_option \
|
||||
$intr_storm_monitor \
|
||||
$logger_setting \
|
||||
$boot_ipu_option \
|
||||
--mac_seed $mac_seed \
|
||||
$boot_image_option \
|
||||
--enable_trusty \
|
||||
--pm_notify_channel power_button \
|
||||
-B "$kernel_cmdline" $vm_name
|
||||
}
|
||||
|
||||
function launch_alios()
|
||||
{
|
||||
#AliOS is not Android, only has same configuration currently, reuse launch function
|
||||
|
||||
launch_android "$@"
|
||||
}
|
||||
|
||||
function help()
|
||||
{
|
||||
echo "Use luanch_uos.sh like that ./launch_uos.sh -V <#>"
|
||||
echo "The option -V means the UOSs group to be launched by vsbl as below"
|
||||
echo "-V 1 means just launching 1 clearlinux UOS"
|
||||
echo "-V 2 means just launching 1 android UOS"
|
||||
echo "-V 3 means launching 1 clearlinux UOS + 1 android UOS"
|
||||
echo "-V 4 means launching 2 clearlinux UOSs"
|
||||
echo "-V 5 means just launching 1 alios UOS"
|
||||
echo "-V 6 means auto check android/linux/alios UOS; if exist, launch it"
|
||||
}
|
||||
|
||||
launch_type=1
|
||||
debug=0
|
||||
|
||||
while getopts "V:M:hd" opt
|
||||
do
|
||||
case $opt in
|
||||
V) launch_type=$[$OPTARG]
|
||||
;;
|
||||
M) setup_mem=$OPTARG
|
||||
;;
|
||||
d) debug=1
|
||||
;;
|
||||
h) help
|
||||
exit 1
|
||||
;;
|
||||
?) help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -b "/dev/mmcblk0p1" ]; then
|
||||
echo "no /dev/mmcblk0p1 data partition, exit"
|
||||
exit
|
||||
fi
|
||||
|
||||
mkdir -p /data
|
||||
mount /dev/mmcblk0p1 /data
|
||||
|
||||
if [ $launch_type == 6 ]; then
|
||||
if [ -f "/data/android/android.img" ]; then
|
||||
launch_type=2;
|
||||
elif [ -f "/data/alios/alios.img" ]; then
|
||||
launch_type=5;
|
||||
else
|
||||
launch_type=1;
|
||||
fi
|
||||
fi
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "$online" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
done
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
case $launch_type in
|
||||
1) echo "Launch clearlinux UOS"
|
||||
launch_clearlinux 1 "64 448 8" 0x070F00 clearlinux "LaaG" $debug
|
||||
;;
|
||||
2) echo "Launch android UOS"
|
||||
launch_android 1 "64 448 8" 0x070F00 android "AaaG" $debug
|
||||
;;
|
||||
3) echo "Launch clearlinux UOS + android UOS"
|
||||
launch_android 1 "64 448 4" 0x00000C android "AaaG" $debug &
|
||||
sleep 5
|
||||
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux "LaaG" $debug
|
||||
;;
|
||||
4) echo "Launch two clearlinux UOSs"
|
||||
launch_clearlinux 1 "64 448 4" 0x00000C clearlinux "L1aaG" $debug &
|
||||
sleep 5
|
||||
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux_dup "L2aaG" $debug
|
||||
;;
|
||||
5) echo "Launch alios UOS"
|
||||
launch_alios 1 "64 448 8" 0x070F00 alios "AliaaG" $debug
|
||||
;;
|
||||
esac
|
||||
|
||||
umount /data
|
@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2020-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
function launch_ubuntu()
|
||||
{
|
||||
vm_name=ubuntu_vm$1
|
||||
|
||||
logger_setting="--logger_setting console,level=5;kmsg,level=6;disk,level=5"
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#for memsize setting
|
||||
mem_size=1024M
|
||||
|
||||
acrn-dm -A -m $mem_size -s 0:0,hostbridge \
|
||||
-s 3,virtio-blk,/home/guestl1/acrn-dm-bins/ubuntuUOS.img \
|
||||
-s 4,virtio-net,tap0 \
|
||||
-s 5,virtio-console,@stdio:stdio_port \
|
||||
-k /home/guestl1/acrn-dm-bins/bzImage_uos \
|
||||
-B "earlyprintk=serial,ttyS0,115200n8 consoleblank=0 root=/dev/vda1 rw rootwait maxcpus=1 nohpet console=tty0 console=hvc0 console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M tsc=reliable" \
|
||||
$logger_setting \
|
||||
$vm_name
|
||||
}
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "$online" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
done
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
launch_ubuntu 1 "64 448 8"
|
@ -1,78 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2019-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# This is an example, if use different HW,the script must be adapted to match the BDF on the actual HW platform
|
||||
|
||||
# pci devices for passthru
|
||||
declare -A passthru_vpid
|
||||
declare -A passthru_bdf
|
||||
|
||||
passthru_vpid=(
|
||||
["eth"]="8086 156f"
|
||||
["sata"]="8086 9d03"
|
||||
["nvme"]="8086 f1a6"
|
||||
)
|
||||
passthru_bdf=(
|
||||
["eth"]="0000:00:1f.6"
|
||||
["sata"]="0000:00:17.0"
|
||||
["nvme"]="0000:02:00.0"
|
||||
)
|
||||
|
||||
function launch_hard_rt_vm()
|
||||
{
|
||||
#for memsize setting
|
||||
mem_size=1024M
|
||||
|
||||
modprobe pci_stub
|
||||
# Ethernet pass-through
|
||||
#echo ${passthru_vpid["eth"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
#echo ${passthru_bdf["eth"]} > /sys/bus/pci/devices/${passthru_bdf["eth"]}/driver/unbind
|
||||
#echo ${passthru_bdf["eth"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
# SATA pass-through
|
||||
#echo ${passthru_vpid["sata"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
#echo ${passthru_bdf["sata"]} > /sys/bus/pci/devices/${passthru_bdf["sata"]}/driver/unbind
|
||||
#echo ${passthru_bdf["sata"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
# NVME pass-through
|
||||
echo ${passthru_vpid["nvme"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["nvme"]} > /sys/bus/pci/devices/${passthru_bdf["nvme"]}/driver/unbind
|
||||
echo ${passthru_bdf["nvme"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
|
||||
/usr/bin/acrn-dm -A -m $mem_size -s 0:0,hostbridge \
|
||||
--lapic_pt \
|
||||
--rtvm \
|
||||
--virtio_poll 1000000 \
|
||||
-U 495ae2e5-2603-4d64-af76-d4bc5a8ec0e5 \
|
||||
-s 2,passthru,02/0/0 \
|
||||
-s 3,virtio-console,@stdio:stdio_port \
|
||||
--ovmf /usr/share/acrn/bios/OVMF.fd \
|
||||
hard_rtvm
|
||||
|
||||
}
|
||||
|
||||
# -s 2,passthru,0/17/0 \ #please using "lspci -nn" check the bdf info
|
||||
|
||||
# Depends on which partation RT_LaaG is installed in;maybe need to change
|
||||
# /dev/nvme0n1p3 to /dev/sda3 on NUC and uncomment SATA pass-through
|
||||
# Add following RT_LaaG kernel cmdline into loader/entries/xxx.conf of EFI partation
|
||||
#root=/dev/nvme0n1p3 rw rootwait nohpet console=hvc0 console=ttyS0 \
|
||||
#no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 \
|
||||
#clocksource=tsc tsc=reliable x2apic_phys processor.max_cstate=0 \
|
||||
#intel_idle.max_cstate=0 intel_pstate=disable mce=ignore_ce audit=0 \
|
||||
#isolcpus=nohz,domain,1 nohz_full=1 rcu_nocbs=1 nosoftlockup idle=poll \
|
||||
#irqaffinity=0
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
launch_hard_rt_vm
|
@ -1,139 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2019-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
function run_container()
|
||||
{
|
||||
vm_name=vm1
|
||||
config_src="/usr/share/acrn/samples/nuc/runC.json"
|
||||
shell="/usr/share/acrn/conf/add/$vm_name.sh"
|
||||
arg_file="/usr/share/acrn/conf/add/$vm_name.args"
|
||||
runc_bundle="/usr/share/acrn/conf/add/runc/$vm_name"
|
||||
rootfs_dir="/usr/share/acrn/conf/add/runc/rootfs"
|
||||
config_dst="$runc_bundle/config.json"
|
||||
|
||||
|
||||
input=$(runc list -f table | awk '{print $1}''{print $3}')
|
||||
arr=(${input// / })
|
||||
|
||||
for((i=0;i<${#arr[@]};i++))
|
||||
do
|
||||
if [ "$vm_name" = "${arr[$i]}" ]; then
|
||||
if [ "running" = "${arr[$i+1]}" ]; then
|
||||
echo "runC instance ${arr[$i]} is running"
|
||||
exit
|
||||
else
|
||||
runc kill ${arr[$i]}
|
||||
runc delete ${arr[$i]}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
vmsts=$(acrnctl list)
|
||||
vms=(${vmsts// / })
|
||||
for((i=0;i<${#vms[@]};i++))
|
||||
do
|
||||
if [ "$vm_name" = "${vms[$i]}" ]; then
|
||||
if [ "stopped" != "${vms[$i+1]}" ]; then
|
||||
echo "Uos ${vms[$i]} ${vms[$i+1]}"
|
||||
acrnctl stop ${vms[$i]}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f "$shell" ]; then
|
||||
echo "Pls add the vm at first!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -f "$arg_file" ]; then
|
||||
echo "Pls add the vm args!"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -d "$rootfs_dir" ]; then
|
||||
mkdir -p "$rootfs_dir"
|
||||
fi
|
||||
if [ ! -d "$runc_bundle" ]; then
|
||||
mkdir -p "$runc_bundle"
|
||||
fi
|
||||
if [ ! -f "$config_dst" ]; then
|
||||
cp "$config_src" "$config_dst"
|
||||
args=$(sed '{s/-C//g;s/^[ \t]*//g;s/^/\"/;s/ /\",\"/g;s/$/\"/}' ${arg_file})
|
||||
sed -i "s|\"sh\"|\"$shell\", $args|" $config_dst
|
||||
fi
|
||||
runc run --bundle $runc_bundle -d $vm_name
|
||||
echo "The runC container is running in backgroud"
|
||||
echo "'#runc exec <vmname> bash' to login the container bash"
|
||||
exit
|
||||
}
|
||||
|
||||
function launch_clear()
|
||||
{
|
||||
mac=$(cat /sys/class/net/e*/address)
|
||||
vm_name=vm$1
|
||||
mac_seed=${mac:9:8}-${vm_name}
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#logger_setting, format: logger_name,level; like following
|
||||
logger_setting="--logger_setting console,level=4;kmsg,level=3;disk,level=5"
|
||||
|
||||
|
||||
#for memsize setting
|
||||
mem_size=2048M
|
||||
|
||||
acrn-dm -A -m $mem_size -s 0:0,hostbridge \
|
||||
-s 2,pci-gvt -G "$2" \
|
||||
-s 5,virtio-console,@stdio:stdio_port \
|
||||
-s 6,virtio-hyper_dmabuf \
|
||||
-s 3,virtio-blk,/home/clear/uos/uos.img \
|
||||
-s 4,virtio-net,tap0 \
|
||||
-s 7,virtio-rnd \
|
||||
--ovmf /usr/share/acrn/bios/OVMF.fd \
|
||||
$logger_setting \
|
||||
--mac_seed $mac_seed \
|
||||
$vm_name
|
||||
}
|
||||
|
||||
#add following cmdline to grub.cfg and update kernel
|
||||
#when launching LaaG by OVMF
|
||||
#rw rootwait maxcpus=1 nohpet console=tty0 console=hvc0
|
||||
#console=ttyS0 no_timer_check ignore_loglevel
|
||||
#log_buf_len=16M consoleblank=0
|
||||
#tsc=reliable i915.avail_planes_per_pipe="64 448 8"
|
||||
#i915.enable_hangcheck=0 i915.nuclear_pageflip=1
|
||||
#i915.enable_guc_loading=0
|
||||
#i915.enable_guc_submission=0 i915.enable_guc=0
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "$online" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
done
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [ "$1" = "-C" ];then
|
||||
echo "runc_container"
|
||||
run_container
|
||||
else
|
||||
launch_clear 1 "64 448 8" 0x070F00
|
||||
fi
|
@ -1,56 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2019-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
function launch_vxworks()
|
||||
{
|
||||
vm_name=vxworks_vm$1
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#for memsize setting
|
||||
mem_size=2048M
|
||||
|
||||
# Note:
|
||||
# Here we just launch VxWorks as a normal vm without lapic pt. If you want try it
|
||||
# with lapic pt, you should add the following options and make sure the front-end virtio-console
|
||||
# driver use polling mode (This feature is not supported by VxWorks offically now and should
|
||||
# be implemented it by youself).
|
||||
#
|
||||
# --lapic_pt \
|
||||
# --virtio_poll 1000000 \
|
||||
# -U $rtvm_uuid \
|
||||
#
|
||||
# Once the front-end polling mode virtio-console get supported by VxWorks offically, we will
|
||||
# set the lapic_pt option as default.
|
||||
acrn-dm -A -m $mem_size -s 0:0,hostbridge \
|
||||
-s 5,virtio-console,@stdio:stdio_port \
|
||||
-s 3,virtio-blk,./VxWorks.img \
|
||||
--ovmf /usr/share/acrn/bios/OVMF.fd \
|
||||
$vm_name
|
||||
}
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "$online" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
done
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
launch_vxworks 1
|
@ -1,109 +0,0 @@
|
||||
#!/bin/bash
|
||||
# board: WHL-IPC-I5, scenario: INDUSTRY, uos: WINDOWS
|
||||
# pci devices for passthru
|
||||
declare -A passthru_vpid
|
||||
declare -A passthru_bdf
|
||||
|
||||
passthru_vpid=(
|
||||
["audio"]="8086 9dc8"
|
||||
["gpu"]="8086 3ea0"
|
||||
)
|
||||
passthru_bdf=(
|
||||
["audio"]="0000:00:1f.3"
|
||||
["gpu"]="0000:00:02.0"
|
||||
)
|
||||
|
||||
function tap_net() {
|
||||
# create a unique tap device for each VM
|
||||
tap=$1
|
||||
tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "tap device existed, reuse $tap"
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
fi
|
||||
|
||||
# if acrn-br0 exists, add VM's unique tap device under it
|
||||
br_exist=$(ip a | grep acrn-br0 | awk '{print $1}')
|
||||
if [ "$br_exist"x != "x" -a "$tap_exist"x = "x" ]; then
|
||||
echo "acrn-br0 bridge aleady exists, adding new tap device to it..."
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
}
|
||||
|
||||
function launch_windows()
|
||||
{
|
||||
#vm-name used to generate uos-mac address
|
||||
mac=$(cat /sys/class/net/e*/address)
|
||||
vm_name=post_vm_id$1
|
||||
mac_seed=${mac:0:17}-${vm_name}
|
||||
|
||||
tap_net tap_WaaG
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo ${passthru_vpid["gpu"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["gpu"]} > /sys/bus/pci/devices/${passthru_bdf["gpu"]}/driver/unbind
|
||||
echo ${passthru_bdf["gpu"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
modprobe pci_stub
|
||||
kernel_version=$(uname -r)
|
||||
audio_module="/usr/lib/modules/$kernel_version/kernel/sound/soc/intel/boards/snd-soc-sst_bxt_sos_tdf8532.ko"
|
||||
|
||||
# use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532
|
||||
if [ ! -e $audio_module ]; then
|
||||
modprobe -q snd-soc-skl
|
||||
modprobe -q snd-soc-sst_bxt_tdf8532
|
||||
else
|
||||
|
||||
modprobe -q snd_soc_skl
|
||||
modprobe -q snd_soc_tdf8532
|
||||
modprobe -q snd_soc_sst_bxt_sos_tdf8532
|
||||
modprobe -q snd_soc_skl_virtio_be
|
||||
fi
|
||||
audio_passthrough=0
|
||||
|
||||
# Check the device file of /dev/vbs_k_audio to determine the audio mode
|
||||
if [ ! -e "/dev/vbs_k_audio" ]; then
|
||||
audio_passthrough=1
|
||||
fi
|
||||
boot_audio_option=""
|
||||
if [ $audio_passthrough == 1 ]; then
|
||||
# for audio device
|
||||
echo ${passthru_vpid["audio"]} > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo ${passthru_bdf["audio"]} > /sys/bus/pci/devices/${passthru_bdf["audio"]}/driver/unbind
|
||||
echo ${passthru_bdf["audio"]} > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
boot_audio_option="-s 5,passthru,00/1f/3"
|
||||
else
|
||||
boot_audio_option="-s 5,virtio-audio"
|
||||
fi
|
||||
mem_size=4096M
|
||||
#interrupt storm monitor for pass-through devices, params order:
|
||||
#threshold/s,probe-period(s),intr-inject-delay-time(ms),delay-duration(ms)
|
||||
intr_storm_monitor="--intr_monitor 10000,10,1,100"
|
||||
|
||||
#logger_setting, format: logger_name,level; like following
|
||||
logger_setting="--logger_setting console,level=4;kmsg,level=3;disk,level=5"
|
||||
|
||||
acrn-dm -A -m $mem_size -s 0:0,hostbridge -U d2795438-25d6-11e8-864e-cb7a18b34643 \
|
||||
--windows \
|
||||
$logger_setting \
|
||||
-s 6,virtio-blk,./win10-ltsc.img \
|
||||
-s 7,virtio-net,tap_WaaG \
|
||||
-s 2,passthru,0/2/0 \
|
||||
--ovmf /usr/share/acrn/bios/OVMF.fd \
|
||||
$intr_storm_monitor \
|
||||
-s 31:0,lpc \
|
||||
-l com1,stdio \
|
||||
$boot_audio_option \
|
||||
$vm_name
|
||||
}
|
||||
launch_windows 1
|
||||
|
@ -1,227 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2020-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
# set -x
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$0 [-b disk | -f img] [-k kernel.tar.gz] {-n ethernet} {-B mem_size} {-r}"
|
||||
echo " example:"
|
||||
echo " $0 -b /dev/sdb3 -k ~/linux-4.19.tar.gz -n eth0"
|
||||
echo " $0 -f clearlinux.img -k ../linux-5.2.tar -n eth0 -B 512M"
|
||||
echo " $0 -f clearlinux.img -k ../linux-5.2.tar -n eth0 -r # restore passthroughed eth0 when script returns"
|
||||
exit
|
||||
}
|
||||
|
||||
function get_bdf()
|
||||
{
|
||||
IFS=/
|
||||
for dir in $1; do
|
||||
case $dir in 0000:??:??.?)
|
||||
bdf=$dir;;
|
||||
esac
|
||||
done
|
||||
|
||||
unset IFS
|
||||
echo $bdf
|
||||
}
|
||||
|
||||
modprobe pci_stub
|
||||
# pci devices for passthru
|
||||
dev_opts=
|
||||
declare -A passthru_devs
|
||||
guest_pci_nr=2
|
||||
|
||||
function passthru_pci_devs()
|
||||
{
|
||||
for dev in "${passthrus[@]}"
|
||||
do
|
||||
dev_info=$(find /sys/devices/pci* -name $(basename $dev))
|
||||
dev_bdf=$(get_bdf $dev_info)
|
||||
dev_path=$(echo $dev_info | sed "s/$dev_bdf\(.*\)//g")$dev_bdf
|
||||
dev_vendor_id=$(cat $dev_path/vendor | sed 's/0x//g')
|
||||
dev_device_id=$(cat $dev_path/device | sed 's/0x//g')
|
||||
dev_bus=$(echo ${dev_bdf#0000:}|sed "s/:.*//g")
|
||||
dev_dev=$(echo $dev_bdf|sed "s/.*://g"|sed "s/\..*//g")
|
||||
dev_fun=$(echo $dev_bdf|sed "s/.*\.//g")
|
||||
dev_drv=$(lspci -k -s $dev_bdf | grep "Kernel driver in use"|sed "s/.*: //g")
|
||||
dev_passthru_opt="-s $guest_pci_nr,passthru,$dev_bus/$dev_dev/$dev_fun"
|
||||
|
||||
echo "passthrough a pci device:"
|
||||
echo dev_info:$dev_info
|
||||
echo dev_path:$dev_path
|
||||
echo dev_vendor_id:$dev_vendor_id
|
||||
echo dev_device_id:$dev_device_id
|
||||
echo dev_bus:$dev_bus
|
||||
echo dev_dev:$dev_dev
|
||||
echo dev_fun:$dev_fun
|
||||
echo dev_drv:$dev_drv
|
||||
echo dev_passthru_opt:$dev_passthru_opt
|
||||
|
||||
# replace its driver with pci-stub
|
||||
echo "$dev_vendor_id $dev_device_id" > /sys/bus/pci/drivers/pci-stub/new_id
|
||||
echo $dev_bdf > $dev_path/driver/unbind
|
||||
echo $dev_bdf > /sys/bus/pci/drivers/pci-stub/bind
|
||||
|
||||
# add to global options
|
||||
dev_opts="$dev_opts $dev_passthru_opt"
|
||||
|
||||
# register for de-passthrough later
|
||||
passthru_devs[$dev_bdf]=$dev_drv
|
||||
|
||||
# increase virtual pci slot number
|
||||
guest_pci_nr=$(expr $guest_pci_nr + 1)
|
||||
done
|
||||
}
|
||||
|
||||
function de_passthru_pci_devs()
|
||||
{
|
||||
for dev_bdf in "${!passthru_devs[@]}"
|
||||
do
|
||||
echo $dev_bdf > /sys/bus/pci/drivers/pci-stub/unbind
|
||||
echo $dev_bdf > /sys/bus/pci/drivers/${passthru_devs[$dev_bdf]}/bind
|
||||
done
|
||||
}
|
||||
|
||||
mem_size=1024M
|
||||
eth=
|
||||
disk=
|
||||
img=
|
||||
kernel=
|
||||
passthrus=()
|
||||
while getopts hn:b:f:k:B:r opt
|
||||
do
|
||||
case "${opt}" in
|
||||
h)
|
||||
usage;
|
||||
;;
|
||||
r)
|
||||
# restore pci device driver on exit
|
||||
trap de_passthru_pci_devs EXIT
|
||||
;;
|
||||
n)
|
||||
eth=${OPTARG}
|
||||
passthrus+=($eth)
|
||||
;;
|
||||
b)
|
||||
disk="${OPTARG}"
|
||||
passthrus+=($disk)
|
||||
;;
|
||||
f)
|
||||
img="${OPTARG}"
|
||||
;;
|
||||
k)
|
||||
kernel="${OPTARG}"
|
||||
;;
|
||||
B)
|
||||
mem_size="${OPTARG}"
|
||||
;;
|
||||
?)
|
||||
echo "{OPTARG}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ( -z "${kernel}") || (( -z "${disk}") && ( -z "${img}" )) ]]; then
|
||||
usage; exit 1
|
||||
fi
|
||||
|
||||
# create a unique tap device for each VM
|
||||
if [ -z $eth ];then
|
||||
tap=tap_rtvm
|
||||
tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
|
||||
if [ "$tap_exist"x != "x" ]; then
|
||||
echo "tap device existed, reuse $tap"
|
||||
else
|
||||
ip tuntap add dev $tap mode tap
|
||||
ip link set "$tap" master acrn-br0
|
||||
ip link set dev "$tap" down
|
||||
ip link set dev "$tap" up
|
||||
fi
|
||||
|
||||
dev_opts="$dev_opts -s $guest_pci_nr,virtio-net,$tap"
|
||||
guest_pci_nr=$(expr $guest_pci_nr + 1)
|
||||
fi
|
||||
|
||||
function launch_hard_rt_vm()
|
||||
{
|
||||
mkdir -p /mnt
|
||||
if [ ! -z $img ]; then
|
||||
# mount virtual disk (assuming the last partition is root)
|
||||
vdisk=$(losetup -f -P --show $img)
|
||||
vdisk_root=$(ls -1 ${vdisk}p* | tail -1)
|
||||
mount $vdisk_root /mnt
|
||||
|
||||
# extract the kernel and install kernel modules
|
||||
bzImage=/mnt/$(tar xzvf $kernel -C /mnt --dereference --exclude=vmlinux* | grep vmlinuz)
|
||||
cp $bzImage /tmp/bzImage.xenomai
|
||||
|
||||
# umount disk
|
||||
umount /mnt
|
||||
losetup -d $vdisk
|
||||
|
||||
# find appropriate root partition information
|
||||
disk_part_nr=$(basename $vdisk_root| sed 's/.*p\([0-9]$\)/\1/')
|
||||
vdisk=/dev/vda$disk_part_nr
|
||||
|
||||
dev_opts="$dev_opts -s $guest_pci_nr,virtio-blk,$img"
|
||||
guest_pci_nr=$(expr $guest_pci_nr + 1)
|
||||
elif [ ! -z $disk ];then
|
||||
# mount the physical disk
|
||||
mount $disk /mnt
|
||||
|
||||
# extract the kernel and install kernel modules
|
||||
bzImage=/mnt/$(tar xzvf $kernel -C /mnt --dereference --exclude=vmlinux* | grep vmlinuz)
|
||||
cp $bzImage /tmp/bzImage.xenomai
|
||||
|
||||
# umount disk
|
||||
umount /mnt
|
||||
|
||||
# detect partition information
|
||||
disk_part_nr=$(basename $disk| sed 's/.*\([0-9]$\)/\1/')
|
||||
if [[ $disk =~ "nvme" ]]; then
|
||||
vdisk=/dev/nvme0n1p$disk_part_nr
|
||||
else
|
||||
vdisk=/dev/sda$disk_part_nr
|
||||
fi
|
||||
fi
|
||||
|
||||
passthru_pci_devs
|
||||
|
||||
#logger_setting, format: logger_name,level; like following
|
||||
logger_setting="--logger_setting console,level=4;kmsg,level=3;disk,level=5"
|
||||
|
||||
/usr/bin/acrn-dm -A -m $mem_size -s 0:0,hostbridge \
|
||||
-k /tmp/bzImage.xenomai \
|
||||
-U 495ae2e5-2603-4d64-af76-d4bc5a8ec0e5 \
|
||||
--lapic_pt \
|
||||
--rtvm \
|
||||
--virtio_poll 1000000 \
|
||||
-s 1,virtio-console,@stdio:stdio_port \
|
||||
$dev_opts \
|
||||
$logger_setting \
|
||||
-B "root=$vdisk rw rootwait nohpet console=hvc0 consoleblank=0 \
|
||||
no_timer_check ignore_loglevel log_buf_len=16M nmi_watchdog=0 nosoftlockup \
|
||||
processor.max_cstate=0 intel_idle.max_cstate=0 intel_pstate=disable idle=poll \
|
||||
rcu_nocb_poll isolcpus=1 nohz_full=1 rcu_nocbs=1 \
|
||||
tsc=reliable x2apic_phys xenomai.supported_cpus=2 irqaffinity=0 mce=off" hard_rtvm
|
||||
}
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
echo 3 > /sys/kernel/debug/dri/0/i915_cache_sharing
|
||||
echo 300 > /sys/class/drm/card0/gt_max_freq_mhz
|
||||
echo 300 > /sys/class/drm/card0/gt_min_freq_mhz
|
||||
echo 300 > /sys/class/drm/card0/gt_boost_freq_mhz
|
||||
|
||||
launch_hard_rt_vm
|
@ -1,44 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2019-2022 Intel Corporation.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
function launch_zephyr()
|
||||
{
|
||||
vm_name=zephyr_vm$1
|
||||
|
||||
#check if the vm is running or not
|
||||
vm_ps=$(pgrep -a -f acrn-dm)
|
||||
result=$(echo $vm_ps | grep -w "${vm_name}")
|
||||
if [[ "$result" != "" ]]; then
|
||||
echo "$vm_name is running, can't create twice!"
|
||||
exit
|
||||
fi
|
||||
|
||||
#for memsize setting
|
||||
mem_size=128M
|
||||
|
||||
acrn-dm -A -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \
|
||||
-s 5,virtio-console,@pty:pty_port \
|
||||
-s 3,virtio-blk,./zephyr.img \
|
||||
--ovmf /usr/share/acrn/bios/OVMF.fd \
|
||||
$vm_name
|
||||
}
|
||||
|
||||
# offline SOS CPUs except BSP before launch UOS
|
||||
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
||||
online=`cat $i/online`
|
||||
idx=`echo $i | tr -cd "[1-99]"`
|
||||
echo cpu$idx online=$online
|
||||
if [ "$online" = "1" ]; then
|
||||
echo 0 > $i/online
|
||||
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
|
||||
while [ "$online" = "1" ]; do
|
||||
sleep 1
|
||||
echo 0 > $i/online
|
||||
online=`cat $i/online`
|
||||
done
|
||||
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||
fi
|
||||
done
|
||||
|
||||
launch_zephyr 1
|
@ -1,274 +0,0 @@
|
||||
{
|
||||
"ociVersion": "1.0.1-dev",
|
||||
"process": {
|
||||
"terminal": false,
|
||||
"user": {
|
||||
"uid": 0,
|
||||
"gid": 0
|
||||
},
|
||||
"args": [
|
||||
"sh"
|
||||
],
|
||||
"env": [
|
||||
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||
"TERM=xterm"
|
||||
],
|
||||
"cwd": "/",
|
||||
"capabilities": {
|
||||
"bounding": [
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_CHOWN",
|
||||
"CAP_DAC_OVERRIDE",
|
||||
"CAP_DAC_READ_SEARCH",
|
||||
"CAP_FOWNER",
|
||||
"CAP_FSETID",
|
||||
"CAP_KILL",
|
||||
"CAP_SETGID",
|
||||
"CAP_SETUID",
|
||||
"CAP_SETPCAP",
|
||||
"CAP_LINUX_IMMUTABLE",
|
||||
"CAP_NET_BIND_SERVICE",
|
||||
"CAP_NET_BROADCAST",
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW",
|
||||
"CAP_IPC_LOCK",
|
||||
"CAP_IPC_OWNER",
|
||||
"CAP_SYS_MODULE",
|
||||
"CAP_SYS_RAWIO",
|
||||
"CAP_SYS_CHROOT",
|
||||
"CAP_SYS_PTRACE",
|
||||
"CAP_SYS_PACCT",
|
||||
"CAP_SYS_ADMIN",
|
||||
"CAP_SYS_BOOT",
|
||||
"CAP_SYS_NICE",
|
||||
"CAP_SYS_RESOURCE",
|
||||
"CAP_SYS_TIME",
|
||||
"CAP_SYS_TTY_CONFIG",
|
||||
"CAP_MKNOD",
|
||||
"CAP_LEASE",
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_AUDIT_CONTROL",
|
||||
"CAP_SETFCAP",
|
||||
"CAP_MAC_OVERRIDE",
|
||||
"CAP_MAC_ADMIN",
|
||||
"CAP_SYSLOG",
|
||||
"CAP_WAKE_ALARM",
|
||||
"CAP_BLOCK_SUSPEND",
|
||||
"CAP_AUDIT_READ"
|
||||
|
||||
],
|
||||
"effective": [
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_CHOWN",
|
||||
"CAP_DAC_OVERRIDE",
|
||||
"CAP_DAC_READ_SEARCH",
|
||||
"CAP_FOWNER",
|
||||
"CAP_FSETID",
|
||||
"CAP_KILL",
|
||||
"CAP_SETGID",
|
||||
"CAP_SETUID",
|
||||
"CAP_SETPCAP",
|
||||
"CAP_LINUX_IMMUTABLE",
|
||||
"CAP_NET_BIND_SERVICE",
|
||||
"CAP_NET_BROADCAST",
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW",
|
||||
"CAP_IPC_LOCK",
|
||||
"CAP_IPC_OWNER",
|
||||
"CAP_SYS_MODULE",
|
||||
"CAP_SYS_RAWIO",
|
||||
"CAP_SYS_CHROOT",
|
||||
"CAP_SYS_PTRACE",
|
||||
"CAP_SYS_PACCT",
|
||||
"CAP_SYS_ADMIN",
|
||||
"CAP_SYS_BOOT",
|
||||
"CAP_SYS_NICE",
|
||||
"CAP_SYS_RESOURCE",
|
||||
"CAP_SYS_TIME",
|
||||
"CAP_SYS_TTY_CONFIG",
|
||||
"CAP_MKNOD",
|
||||
"CAP_LEASE",
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_AUDIT_CONTROL",
|
||||
"CAP_SETFCAP",
|
||||
"CAP_MAC_OVERRIDE",
|
||||
"CAP_MAC_ADMIN",
|
||||
"CAP_SYSLOG",
|
||||
"CAP_WAKE_ALARM",
|
||||
"CAP_BLOCK_SUSPEND",
|
||||
"CAP_AUDIT_READ"
|
||||
],
|
||||
"inheritable": [
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_CHOWN",
|
||||
"CAP_DAC_OVERRIDE",
|
||||
"CAP_DAC_READ_SEARCH",
|
||||
"CAP_FOWNER",
|
||||
"CAP_FSETID",
|
||||
"CAP_KILL",
|
||||
"CAP_SETGID",
|
||||
"CAP_SETUID",
|
||||
"CAP_SETPCAP",
|
||||
"CAP_LINUX_IMMUTABLE",
|
||||
"CAP_NET_BIND_SERVICE",
|
||||
"CAP_NET_BROADCAST",
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW",
|
||||
"CAP_IPC_LOCK",
|
||||
"CAP_IPC_OWNER",
|
||||
"CAP_SYS_MODULE",
|
||||
"CAP_SYS_RAWIO",
|
||||
"CAP_SYS_CHROOT",
|
||||
"CAP_SYS_PTRACE",
|
||||
"CAP_SYS_PACCT",
|
||||
"CAP_SYS_ADMIN",
|
||||
"CAP_SYS_BOOT",
|
||||
"CAP_SYS_NICE",
|
||||
"CAP_SYS_RESOURCE",
|
||||
"CAP_SYS_TIME",
|
||||
"CAP_SYS_TTY_CONFIG",
|
||||
"CAP_MKNOD",
|
||||
"CAP_LEASE",
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_AUDIT_CONTROL",
|
||||
"CAP_SETFCAP",
|
||||
"CAP_MAC_OVERRIDE",
|
||||
"CAP_MAC_ADMIN",
|
||||
"CAP_SYSLOG",
|
||||
"CAP_WAKE_ALARM",
|
||||
"CAP_BLOCK_SUSPEND",
|
||||
"CAP_AUDIT_READ"
|
||||
],
|
||||
"permitted": [
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_CHOWN",
|
||||
"CAP_DAC_OVERRIDE",
|
||||
"CAP_DAC_READ_SEARCH",
|
||||
"CAP_FOWNER",
|
||||
"CAP_FSETID",
|
||||
"CAP_KILL",
|
||||
"CAP_SETGID",
|
||||
"CAP_SETUID",
|
||||
"CAP_SETPCAP",
|
||||
"CAP_LINUX_IMMUTABLE",
|
||||
"CAP_NET_BIND_SERVICE",
|
||||
"CAP_NET_BROADCAST",
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW",
|
||||
"CAP_IPC_LOCK",
|
||||
"CAP_IPC_OWNER",
|
||||
"CAP_SYS_MODULE",
|
||||
"CAP_SYS_RAWIO",
|
||||
"CAP_SYS_CHROOT",
|
||||
"CAP_SYS_PTRACE",
|
||||
"CAP_SYS_PACCT",
|
||||
"CAP_SYS_ADMIN",
|
||||
"CAP_SYS_BOOT",
|
||||
"CAP_SYS_NICE",
|
||||
"CAP_SYS_RESOURCE",
|
||||
"CAP_SYS_TIME",
|
||||
"CAP_SYS_TTY_CONFIG",
|
||||
"CAP_MKNOD",
|
||||
"CAP_LEASE",
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_AUDIT_CONTROL",
|
||||
"CAP_SETFCAP",
|
||||
"CAP_MAC_OVERRIDE",
|
||||
"CAP_MAC_ADMIN",
|
||||
"CAP_SYSLOG",
|
||||
"CAP_WAKE_ALARM",
|
||||
"CAP_BLOCK_SUSPEND",
|
||||
"CAP_AUDIT_READ"
|
||||
],
|
||||
"ambient": [
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_CHOWN",
|
||||
"CAP_DAC_OVERRIDE",
|
||||
"CAP_DAC_READ_SEARCH",
|
||||
"CAP_FOWNER",
|
||||
"CAP_FSETID",
|
||||
"CAP_KILL",
|
||||
"CAP_SETGID",
|
||||
"CAP_SETUID",
|
||||
"CAP_SETPCAP",
|
||||
"CAP_LINUX_IMMUTABLE",
|
||||
"CAP_NET_BIND_SERVICE",
|
||||
"CAP_NET_BROADCAST",
|
||||
"CAP_NET_ADMIN",
|
||||
"CAP_NET_RAW",
|
||||
"CAP_IPC_LOCK",
|
||||
"CAP_IPC_OWNER",
|
||||
"CAP_SYS_MODULE",
|
||||
"CAP_SYS_RAWIO",
|
||||
"CAP_SYS_CHROOT",
|
||||
"CAP_SYS_PTRACE",
|
||||
"CAP_SYS_PACCT",
|
||||
"CAP_SYS_ADMIN",
|
||||
"CAP_SYS_BOOT",
|
||||
"CAP_SYS_NICE",
|
||||
"CAP_SYS_RESOURCE",
|
||||
"CAP_SYS_TIME",
|
||||
"CAP_SYS_TTY_CONFIG",
|
||||
"CAP_MKNOD",
|
||||
"CAP_LEASE",
|
||||
"CAP_AUDIT_WRITE",
|
||||
"CAP_AUDIT_CONTROL",
|
||||
"CAP_SETFCAP",
|
||||
"CAP_MAC_OVERRIDE",
|
||||
"CAP_MAC_ADMIN",
|
||||
"CAP_SYSLOG",
|
||||
"CAP_WAKE_ALARM",
|
||||
"CAP_BLOCK_SUSPEND",
|
||||
"CAP_AUDIT_READ"
|
||||
]
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"path": "../rootfs",
|
||||
"readonly": false
|
||||
},
|
||||
"hostname": "runc",
|
||||
"mounts": [
|
||||
{
|
||||
"destination": "/",
|
||||
"type": "none",
|
||||
"source": "/",
|
||||
"options": ["rbind","rw"]
|
||||
}
|
||||
],
|
||||
"linux": {
|
||||
"resources": {
|
||||
"devices": [
|
||||
{
|
||||
"allow": true,
|
||||
"access": "rwm"
|
||||
}
|
||||
]
|
||||
},
|
||||
"uidMappings": [
|
||||
{
|
||||
"hostID": 0,
|
||||
"containerID": 0,
|
||||
"size": 1
|
||||
}
|
||||
],
|
||||
"gidMappings": [
|
||||
{
|
||||
"hostID": 0,
|
||||
"containerID": 0,
|
||||
"size": 1
|
||||
}
|
||||
],
|
||||
"namespaces": [
|
||||
{
|
||||
"type": "pid"
|
||||
},
|
||||
{
|
||||
"type": "uts"
|
||||
},
|
||||
{
|
||||
"type": "mount"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user