Commit Graph

5136 Commits

Author SHA1 Message Date
Wei Liu a43b42b2a0 acrn-config: parse cpu_affinity from launch config xmls
Parse cpu_affinity from launch config xmls and generate '--cpu_affinity' as
acrn-dm args.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-24 16:19:55 +08:00
Wei Liu 233f2deb4b acrn-config: add cpu_affinity for launch config xmls
1.Remove cpu_sharing item from launch config xml.
2.Add cpu_affinity for launch config xmls to configurable POST VM cpu
affinity from webUI.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-24 16:19:55 +08:00
Li Fei1 c8618dd2fb hv: vioapic: minor refine about madt ioapic parse
Remove ioapic_parse_madt and do MADT IOAPIC parse in parse_madt_ioapic.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-04-24 15:35:38 +08:00
Li Fei1 907a0f7c04 hv: vioapic: minor refine about vioapic_init
Most code in the if ... else is duplicated. We could put it out of the
conditional statement.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-04-24 15:35:38 +08:00
Zide Chen 2c9c681e6d acrn-dm: change command option name from "pcpu_list" to "cpu_affinity"
commit 71bdc27a0f ("acrn-dm: implement cpu_affinity command line argument")
doesn't use correct name.

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-04-24 13:18:10 +08:00
Junming Liu 1da7e4145f dm:refine graphics data stolen memory passthru for EHL platform
EHL graphics data stolen memory(DSM) info has diff with KBL/WHL,
which includes two parts:
(1) DSM register location in pci config: on KBL/WHL, the register
locates on 0X5C, while on EHL, the register locates on 0xC0.
(2) DSM address length: On KBL/WHL,
DSM addr has 32 bits, while on EHL,DSM addr has 64 bits.

Here, refine graphics data stolen memory passthru to enable GVT-d on EHL platforms.

v3 -> v4:
        * add MICRO INTEL_ELKHARTLAKE
v2 -> v3:
	* refine discription,MICRO name
	* refine code style
v1 -> v2:
	* add callback functions for scalability

Tracked-On: projectacrn#4700

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-04-24 12:54:50 +08:00
Junming Liu 795225d55e dm:add function passthru_gpu_dsm_opregion for passthru_init
Pack GPU DSM(Data Stolen Memory) and Opregion related operations
into function passthru_gpu_dsm_opregion to avoid passthru_init too mess.

Tracked-On: #4700

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-04-24 12:54:50 +08:00
Junming Liu b45c24b062 dm:refine comments and variables name about data stolen memory
"gsm" term is not precise to describe GPU stolen memory,
It should be "dsm", which acronyms for data stolen memory.

Tracked-On: #4700

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-04-24 12:54:50 +08:00
Zide Chen 1e3df01362 acrn-config: update cpu_affinity in scenrio configuration xml files
Change the tag name from "vcpu_affinity" to 'cpu_affinity" in all the per
board scenario xml files, and change the descritpions.

Tracked-On: #4641
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-23 09:38:54 +08:00
Zide Chen fafce7aa5f acrn-config: change names for vcpu_affinity[] related items
hypervisor is replacing vm_configs[].vcpu_affinity[] array with
cpu_affinity_bitmap, the meaning of which has some changes as well.

This patch changes the names in generated vm_configuration.c:
-.vcpu_affinity = VMx_CONFIG_VCPU_AFFINITY,
+.cpu_affinity_bitmap = VMx_CONFIG_CPU_AFFINITY,

Changes in vm_configuration.h:
-#define  VMx_CONFIG_VCPU_AFFINITY {AFFINITY_CPU(xU), AFFINITY_CPU(xU)}
+#define  VMx_CONFIG_CPU_AFFINITY  (AFFINITY_CPU(xU) | AFFINITY_CPU(xU))

Also don't generate default assignment of vcpu_num in vm_configuration.c,
because now hypervisor can easily calculate it from cpu_affinity_bitmap.

Accordingly, in the scenario xml files, tag "vcpu_affinity" is changed
to "cpu_affinity".

Tracked-On: #4641
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-23 09:38:54 +08:00
Zide Chen 71bdc27a0f acrn-dm: implement cpu_affinity command line argument
User has a chance to specify VCPU affinity through acrn-dm command line
argument. Examples of the command line:

3 PCPUs: 1/2/3
--cpu_affinity 1-3

5 PCPUs: 2/3/6/7/8
--cpu_affinity 2,3,6-8

8 PCPUs: 2/3/6/7/9/10/11/12
--cpu_affinity 2,3,6-7,9,10-12

The specified pCPUs must be included in the guest VM's statically
defined vm_config[].cpu_affinity_bitmap.

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-04-23 09:38:54 +08:00
Zide Chen 3691e305c0 hv: dynamically configure CPU affinity through hypercall
- add a new member cpu_affinity to struct acrn_create_vm, so that acrn-dm
  is able to assign CPU affinity through HC_CREATE_VM hypercall.

- if vm_create.cpu_affinity is zero, hypervisor launches the VM with the
  statically configured CPU affinity.

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-04-23 09:38:54 +08:00
Zide Chen 9150284ca7 hv: replace vcpu_affinity array with cpu_affinity_bitmap
Currently the vcpu_affinity[] array fixes the vCPU to pCPU mapping.
While the new cpu_affinity_bitmap doesn't explicitly sepcify this
mapping, instead, it implicitly assumes that vCPU0 maps to the pCPU
with lowest pCPU ID, vCPU1 maps to the second lowest pCPU ID, and
so on.

This makes it possible for post-launched VM to run vCPUs on a subset of
these pCPUs only, and not all of them.

acrn-dm may launch post-launched VMs with the current approach: indicate
VM UUID and hypervisor launches all VCPUs from the PCPUs that are masked
in cpu_affinity_bitmap.

Also acrn-dm can choose to launch the VM on a subset of PCPUs that is
defined in cpu_affinity_bitmap. In this way, acrn-dm must specify the
subset of PCPUs in the CREATE_VM hypercall.

Additionally, with this change, a guest's vcpu_num can be easily calculated
from cpu_affinity_bitmap, so don't assign vcpu_num in vm_configuration.c.

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-04-23 09:38:54 +08:00
Geoffroy Van Cutsem 3e79287cd3 doc: fix a coupe of typos in rtvm_performance_tips.rst doc
Fix a couple of typos that sneaked in in the 'rtvm_performance_tips.rst'
document.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-04-22 12:25:21 -04:00
David B. Kinder 714b3a35d6 doc: edits for rtvm_performance_tips doc
Fixed windows line endings, improved tip formatting, additional grammar
and content simplification edits.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-04-22 10:35:33 -04:00
Shuang Zheng f7594f0a93 acrn-config: assign VM IDs for dynamic scenario and launch setting
When dynamically creating or adding or deleting VMs, acrn config app
will assign VM IDs for the VMs with the orders of prelaunched VMs and SOS
VM and postlaunched VMs to be consistent with the VM order of vm_configs
in vm configuration. When dynamically creating launch scripts, acrn
config app will let users to specify the VM ID before launch setting.

Tracked-On: #4641

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-22 20:10:17 +08:00
Shuang Zheng 44ec68dc49 acrn-config: add attributes for scenario and launch setting
There are no board/scenario/uos_launcher attributes for created
scenario and launch settings, which causes xml mismatch error
when generating configuration files or launch scripts.
This patch is to add the attributes for scearnio and launch
settings.

Tracked-On: #4641

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-22 20:10:17 +08:00
Wei Liu ea61900a80 acrn-config: add max VM count check when generating scenario XML file
Add max VM count check when generating scenario XML file.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-22 20:10:17 +08:00
Wei Liu 374cd99ed9 acrn-config: refine template xmls
Refine some items for configuarable="0"

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-22 20:10:17 +08:00
Wei Liu 71b3743a75 acrn-config: add 2 UUIDs for post-launched Standard VM
Add 2 UUIDs for post-launched Standard VM.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-22 20:10:17 +08:00
Victor Sun 00a38e89c4 Makefile: do not override RELEASE when build with XML
SCENARIO XML file has included RELEASE or DEBUG info already, so if RELEASE
is not specified in make command, Makefile should not override RELEASE info
in SCENARIO XML. If RELEASE is specified in make command, then RELEASE info
in SCENARIO XML could be overridden by make command.

The patch also fixed a issue that get correct board defconfig when build
hypervisor from TARGET_DIR;

Tracked-On: #4688

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-22 16:45:43 +08:00
Victor Sun 27fb606d7a acrn-config: add SOS_IDLE for SOS cmdline
Add SOS_IDLE for SOS cmdline so that "idle=halt" paramter will be needed
only when CPU sharing is enabled;

Tracked-On: #4329

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-22 14:49:04 +08:00
Victor Sun 9264f51456 HV: refine usage of idle=halt in sos cmdline
The parameter of "idle=halt" for SOS cmdline is only needed when cpu sharing
is enabled, otherwise it will impact SOS power.

Tracked-On: #4329

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-22 14:49:04 +08:00
Geoffroy Van Cutsem b22d9e5e15 acrn-config: fix typos and text in board_parser.py tool
Enhance and fix some typos in the text that gets printed out from the
board_parser.py script.

Tracked-On: #4630
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-04-22 10:42:54 +08:00
Wei Liu 28ef2f509b acrn-config: remove sdc2 config xmls
Remove sdc2 scenario since the VM launch requirement under this scenario
will be satisfied by industry scenario.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Wei Liu 72892926c8 acrn-config: refine the HV_RAM_SIZE/HV_RAM_START for board_defconfig
Leave HV_RAM_SIZE/HV_RAM_START default to blank, and config tool would
generate for them, otherwise, they would be set by the UI.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Wei Liu a1a8807268 acrn-config: set HV_RAM_SIZE/HV_RAM_START to blank from config xmls
Leave HV_RAM_SIZE/HV_RAM_START default to blank, and config tool would
generate for them, otherwise, they would be set by the UI.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Wei Liu 602c87acb8 acrn-config: refine template xmls
1. Set default value for HV template.
2. Refine vuartx in template vm setting xmls.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Wei Liu 369547aa63 acrn-config: modify epc_section to configurable="0"
1. modify epc_section to configurable="0".
2. add 'idle=halt' for sos bootargs to impove performance.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Wei Liu d4236bc02d acrn-config: fix syntax for new logical partition xmls
UI got syntax warning while loading new logical partitons xml, add
missed '</clos>' for it.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Wei Liu b69e2685d5 acrn-config: refine GPU vpid format for launch script
Refine GPU vpid format for launch script.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Wei Liu a0e18eec34 acrn-config: refine '--out' for config tool
Currently, '--out' is relative scripts run dir if it gets relative path,
Refine '--out' to source root tree if it gets relative path.

Tracked-On: #4641
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-04-22 08:43:45 +08:00
Li Fei1 113f2f1e35 hv: vacpi: add ioapic madt table
Add IOAPIC MADT table support so that guest could detect IOAPIC exist.

Tracked-On: #4623
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-04-22 08:42:19 +08:00
Li Fei1 1dccbdbaa2 hv: vapic: add mcfg table support
Add MCFG table support to allow guest access PCIe external CFG space by ECAM

Tracked-On: #4623
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-04-22 08:42:19 +08:00
Li Fei1 4eb3f5a0c7 hv: vacpi: add fadt table support
Add FADT table support to support guest S5 setting.

According to ACPI 6.3 Spec, OSPM must ignored the DSDT and FACS fields if them're zero.
However, Linux kernel seems not to abide by the protocol, it will check DSDT still.
So add an empty DSDT to meet it.

Tracked-On: #4623
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-04-22 08:42:19 +08:00
Minggui Cao 9f036cff6a DM: add wall time info into disk log file
1. add wall time info into disk log file, to make it easier to
   sync with other log

2. improve the log path creating operation, call system to make
   dir to avoid the first and second level path not existed.

Tracked-On: #4633
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2020-04-22 08:39:25 +08:00
David B. Kinder a7a5c41e75 doc: update doc guidelines for sphinx-tabs
Include how to use the sphinx-tabs directives.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-04-21 16:11:16 -07:00
David B. Kinder 426c214733 doc: add sphinx-tabs extension
The sphinx-tabs extension let's us create a document that can
dynamically display alternate material based on clicking a tab, as used
in the Zephyr getting started guide:
https://docs.zephyrproject.org/latest/getting_started/index.html

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-04-21 12:14:00 -07:00
lirui34 aef1f4cde8 doc: remove the kbl-nuc flow pic from the partition mode gsg.
Signed-off-by: lirui34 <ruix.li@intel.com>
2020-04-21 13:51:55 -04:00
Sainath Grandhi c548ba10b9 acrn-config: Generate info in pci_dev file for Pre-Launched VMs
Pre-Launched VMs need the vbar_base values pre-populated
for pass-thru PCI devices.

This patch moves the pci parser logic from board_cfg_gen to library
so that scenario_cfg_gen scripts can use pci parser routines while
generating pci_dev file logical partition scenario.

Tracked-On: #4666
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2020-04-20 21:59:23 +08:00
Victor Sun e5561a5c71 HV: remove sdc2 scenario support
Remove sdc2 scenario since the VM launch requirement under this scenario
could be satisfied by industry scenario now;

Tracked-On: #4661

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-20 14:59:23 +08:00
Victor Sun a90890e9c7 HV: support up to 7 post launched VMs for industry scenario
In industry scenario, hypervisor will support 1 post-launched RT VM
and 1 post-launched kata VM and up to 5 post-launched standard VMs;

Tracked-On: #4661

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-20 14:59:23 +08:00
Victor Sun 09212cf4b6 HV: Kconfig: enable CPU sharing by default
The patch enables CPU sharing feature by default, the default scheduler is
set to SCHED_BVT;

Tracked-On: #4661

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-20 14:59:23 +08:00
Yin Fengwei 345cb77376 crashlog: fix build issue under latest clearlinux
gcc in latest clearlinux enabled the pointer-sign warning as
default. This breaks the acrn-crashlog build.

Make acrn-crashlog build issue fixed by convert to correct
pointer type.

Tracked-On: #4636
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2020-04-20 14:54:33 +08:00
Sainath Grandhi 60c4ec0c59 hv: Wake up vCPU for interrupts from vPIC
Wake up vCPUs that are blocked upon interrupts from vPIC.

Tracked-On: #4664
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2020-04-20 09:49:41 +08:00
Deb Taylor 1815ed4e14 Doc: Minor grammatical edits to GSG for ACRN logical part mode
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2020-04-17 11:20:29 -04:00
lirui34 3b21146dfb doc: update partition mode tutorial to use whl board.
Signed-off-by: lirui34 <ruix.li@intel.com>
2020-04-17 09:56:07 -04:00
Victor Sun dfb947fe91 HV: fix wrong gpa start of hpa2 in ve820.c
The current logic puts hpa2 above GPA 4G always, which is incorrect. Need
to set gpa start of hpa2 right after hpa1 when hpa1 size is less then 2G;

Tracked-On: #4458

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-17 14:08:54 +08:00
Victor Sun fe6407155f HV: set default MCFG base for generic board
On most board the MCFG base is set to 0xe0000000, so modify this value in
platform_acpi_info.h for generic boards;

The description of ACPI_PARSE_ENABLED is modified also to match its usage.

Tracked-On: #4157

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-17 13:49:58 +08:00
Shuang Zheng 6aeadb9cbb acrn-config: add template xmls for dynamic config
The template xmls are used to be the dafault VM settings for dynamically
adding VMs.

Tracked-On: #4641

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2020-04-17 13:45:18 +08:00