Skip to content

Commit 0a748fe

Browse files
jsun26intelacrnsi
authored andcommitted
HV: add hybrid scenario
Hybrid scenario will run 3 VMs: one pre-launched VM, one pre-launched SOS VM and one post-launched Standard VM. Tracked-On: #3214 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
1 parent a2c6b11 commit 0a748fe

File tree

4 files changed

+133
-0
lines changed

4 files changed

+133
-0
lines changed

hypervisor/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ else ifeq ($(CONFIG_LOGICAL_PARTITION),y)
4646
SCENARIO_NAME := logical_partition
4747
else ifeq ($(CONFIG_INDUSTRY),y)
4848
SCENARIO_NAME := industry
49+
else ifeq ($(CONFIG_HYBRID),y)
50+
SCENARIO_NAME := hybrid
4951
endif
5052

5153
LD_IN_TOOL = scripts/genld.sh

hypervisor/arch/x86/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ config INDUSTRY
2222
one pre-launched SOS VM, one post-launched Standard VM for HMI, one or two
2323
post-launched RT VM for real-time control.
2424

25+
config HYBRID
26+
bool "Hybrid VMs"
27+
help
28+
This scenario is a typical scenario for hybrid usage with 3 VMs:
29+
one pre-launched VM, one pre-launched SOS VM and one post-launched Standard
30+
VM.
31+
2532
endchoice
2633

2734
config BOARD
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright (C) 2018 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <vm_config.h>
8+
#include <vuart.h>
9+
10+
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
11+
{ /* VM0 */
12+
.load_order = PRE_LAUNCHED_VM,
13+
.name = "ACRN PRE-LAUNCHED VM0",
14+
.uuid = {0xfcU, 0x83U, 0x69U, 0x01U, 0x86U, 0x85U, 0x4bU, 0xc0U, \
15+
0x8bU, 0x71U, 0x6eU, 0x31U, 0xdcU, 0x36U, 0xfaU, 0x47U},
16+
/* fc836901-8685-4bc0-8b71-6e31dc36fa47 */
17+
.guest_flags = GUEST_FLAG_HIGHEST_SEVERITY,
18+
.pcpu_bitmap = VM0_CONFIG_PCPU_BITMAP,
19+
.clos = 0U,
20+
.memory = {
21+
.start_hpa = VM0_CONFIG_MEM_START_HPA,
22+
.size = VM0_CONFIG_MEM_SIZE,
23+
},
24+
.os_config = {
25+
.name = "Zephyr",
26+
.kernel_type = KERNEL_ZEPHYR,
27+
.kernel_mod_tag = "Zephyr_RawImage",
28+
.bootargs = "",
29+
.kernel_load_addr = 0x100000,
30+
.kernel_entry_addr = 0x100000,
31+
},
32+
.vuart[0] = {
33+
.type = VUART_LEGACY_PIO,
34+
.addr.port_base = COM1_BASE,
35+
.irq = COM1_IRQ,
36+
},
37+
.vuart[1] = {
38+
.type = VUART_LEGACY_PIO,
39+
.addr.port_base = COM2_BASE,
40+
.irq = COM2_IRQ,
41+
.t_vuart.vm_id = 1U,
42+
.t_vuart.vuart_id = 1U,
43+
},
44+
},
45+
{ /* VM1 */
46+
.load_order = SOS_VM,
47+
.name = "ACRN SOS VM",
48+
.uuid = {0xdbU, 0xbbU, 0xd4U, 0x34U, 0x7aU, 0x57U, 0x42U, 0x16U, \
49+
0xa1U, 0x2cU, 0x22U, 0x01U, 0xf1U, 0xabU, 0x02U, 0x40U},
50+
/* dbbbd434-7a57-4216-a12c-2201f1ab0240 */
51+
52+
/* Allow SOS to reboot the host since there is supposed to be the highest severity guest */
53+
.guest_flags = GUEST_FLAG_HIGHEST_SEVERITY,
54+
.clos = 0U,
55+
.memory = {
56+
.start_hpa = 0UL,
57+
.size = CONFIG_SOS_RAM_SIZE,
58+
},
59+
.os_config = {
60+
.name = "ACRN Service OS",
61+
.kernel_type = KERNEL_BZIMAGE,
62+
.kernel_mod_tag = "Linux_bzImage",
63+
.bootargs = SOS_VM_BOOTARGS,
64+
},
65+
.vuart[0] = {
66+
.type = VUART_LEGACY_PIO,
67+
.addr.port_base = CONFIG_COM_BASE,
68+
.irq = CONFIG_COM_IRQ,
69+
},
70+
.vuart[1] = {
71+
.type = VUART_LEGACY_PIO,
72+
.addr.port_base = INVALID_COM_BASE,
73+
}
74+
},
75+
{ /* VM2 */
76+
.load_order = POST_LAUNCHED_VM,
77+
.uuid = {0xd2U, 0x79U, 0x54U, 0x38U, 0x25U, 0xd6U, 0x11U, 0xe8U, \
78+
0x86U, 0x4eU, 0xcbU, 0x7aU, 0x18U, 0xb3U, 0x46U, 0x43U},
79+
/* d2795438-25d6-11e8-864e-cb7a18b34643 */
80+
.vuart[0] = {
81+
.type = VUART_LEGACY_PIO,
82+
.addr.port_base = INVALID_COM_BASE,
83+
},
84+
.vuart[1] = {
85+
.type = VUART_LEGACY_PIO,
86+
.addr.port_base = INVALID_COM_BASE,
87+
}
88+
}
89+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef VM_CONFIGURATIONS_H
8+
#define VM_CONFIGURATIONS_H
9+
10+
#include <misc_cfg.h>
11+
12+
/* Bits mask of guest flags that can be programmed by device model. Other bits are set by hypervisor only */
13+
#define DM_OWNED_GUEST_FLAG_MASK (GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | \
14+
GUEST_FLAG_RT | GUEST_FLAG_IO_COMPLETION_POLLING)
15+
16+
#define CONFIG_MAX_VM_NUM 3U
17+
18+
#define VM0_CONFIG_PCPU_BITMAP (PLUG_CPU(3))
19+
#define VM0_CONFIG_MEM_START_HPA 0x100000000UL
20+
#define VM0_CONFIG_MEM_SIZE 0x20000000UL
21+
22+
#define SOS_VM_BOOTARGS SOS_ROOTFS \
23+
"rw rootwait " \
24+
"console=tty0 " \
25+
SOS_CONSOLE \
26+
"consoleblank=0 " \
27+
"no_timer_check " \
28+
"quiet loglevel=3 " \
29+
"i915.nuclear_pageflip=1 " \
30+
"i915.avail_planes_per_pipe=0x01010F " \
31+
"i915.domain_plane_owners=0x011111110000 " \
32+
"i915.enable_gvt=1 " \
33+
SOS_BOOTARGS_DIFF
34+
35+
#endif /* VM_CONFIGURATIONS_H */

0 commit comments

Comments
 (0)