Commit Graph

504 Commits

Author SHA1 Message Date
Geoffroy Van Cutsem 79892f911d misc: adjust code for gcc-10
The latest gcc 10.x changes the default to '-fno-common'. This causes a couple
of build failures in ACRN. This patch changes the default behaviour to
'-fcommon' for the 'acrnprobe' tool and fixes the 'hv_prebuild' codebase.

More details on that change can be found here:
https://gcc.gnu.org/gcc-10/porting_to.html

Tracked-On: #5553
Tracked-On: #5549
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-11-30 14:45:27 +08:00
Peter Fang 4dbf30fcad misc: add the s5_trigger.sh script
s5_trigger.sh is part of the system shutdown flow, coordinating with the
lifecycle manager in each VM.

Tracked-On: #5411
Signed-off-by: Peter Fang <peter.fang@intel.com>
2020-11-26 21:00:10 +08:00
Peter Fang e69750dd43 misc: life_mngr: prevent log flooding after SOS socket is closed
After the SOS socket is closed, read() returns instantly with a return
value of 0. This causes life_mngr to flood the log file with the
following messages:

    received msg []
    received msg []
    received msg []
    ...

Exit the program directly now if this is detected.

Tracked-On: #5429
Signed-off-by: Peter Fang <peter.fang@intel.com>
2020-11-26 14:10:12 +08:00
Yang,Yu-chu 2767eb0d29 acrn-config:refine the ivshmem for pre-launched vm
1. Discard the method to find unused vbar bases from system ram, find
unused mmio windows from 2G to 4G range.
2. Refine the ivshmem devices declaration.

Tracked-On: #5530
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2020-11-24 16:30:26 +08:00
Yang Yu-chu b6a18fa0fb acrn-config: update default pci_dev.c
update all default pci_dev.c under
misc/vm_configs/scenarios/<scenario>/<platform> for non-xml compilation

Tracked-On: #5425
Signed-off-by: Yang Yu-chu <yu-chu.yang@intel.com>
2020-11-24 16:29:40 +08:00
fuzhongl bb4fcae1b8 Doc: update document to remove CL Service VM dependency
Some document refer Clear Linux as Service VM; update them
to Ubuntu Service VM.

Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-11-23 00:02:58 -08:00
Tao Yuhong e6ca39406a TGL: Fix sos can't boot with 6 pci-vuarts
Increase CONFIG_MAX_EMULATED_MMIO_REGIONS to 32, for more pci-vuarts.
Each pci-vuart vdev need 2 mmio BARs, if there are 8 pci-vuarts, they
need emulate 16 mmio regions.

But by default CONFIG_MAX_EMULATED_MMIO_REGIONS=16, that is not enough.

Tracked-On: #5491
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2020-11-11 09:53:58 +08:00
Yang,Yu-chu 5bdc932d65 acrn-config: insert vbdf in hex format and vuart vbdf logic
Bug fix:
1. The bdf were inserted in decimal. Fix it with hexadecimal
format.
2. The vuart vbdf will only take the dev which no used bdf has
the same dev. For example: If 00:01.1 is in used but not 00:01.0,
vuart vbdf will skip 00:01.0 and look for 00:02.0, 00:03.0 and so on.

Tracked-On: #5482
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2020-11-09 08:54:01 +08:00
Yang,Yu-chu 3c86de8fb9 acrn-config: insert legacy vuart0 base by its enablement status
The legacy vuart0 of any VMs inserts its base address declaration
anyway without checking whether it's disabled or enabled, and the
com base is hardcoded no matter what is specified in xmls.

Pull the legacy vuart enablement status based on scenario xml.

This reverts commit a8fe9b906a

Tracked-On: #5470
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-09 08:53:36 +08:00
David B. Kinder a2167ae93a doc: add extension to create files and raw links
Links to files in the GitHub repo's master branch should be to the files
within the branch being generated.  For example, in the v2.1
documentation, links should be to the v2.1 branch contents.  (Previously
links were being made to the master branch in all our archived content.)
This creates a problem when we want to remove an obsolete file in the
master branch but can't because older documentaiton incorrectly depends
on it.

This new extension defines a :acrn_file: and :acrn_raw: role that will
create links to the given file within the current commit branch.

This PR also replaces docs with hard-coded links to files in the master
branch with uses of these new roles to create links to files.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-11-05 09:17:05 -08:00
Yang,Yu-chu b02776a9d4 acrn-config: removed_nested returns None instead return Error
qemu xml has no devices list. Tool will receive the empty devices
list while parsing the "platform" xml. Remove the error of resolved
nested mmio address window that the input couldn't be None. Simply
return an None list.

Tracked-On:#5454
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2020-11-04 10:38:40 +08:00
Shuang Zheng 0cd71f2cf2 acrn-config: remove PSRAM_PASSTHROUGH_PRE_RTVM and disable PSRAM config
remove PSRAM_PASSTHROUGH_PRE_RTVM config which is not used in
PSRAM config and disable psram config.

Tracked-On: #5418

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2020-11-04 10:34:59 +08:00
dongshen 9735718e1f acrn-config: specify kernel boot argument 'reboot=acpi' for pre-launched VMs
Add the 'reboot=acpi' kernel boot argument for pre-launched VMs

Add the code to sanity check if 'reboot=acpi' is specified in the
scenario files

If hardware reduced ACPI is detected, by default, Linux will set the reboot type to
use EFI for rebooting. "reboot=acpi" sets the reboot type to use ACPI for rebooting.

Tracked-On: #5411
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-11-04 10:33:31 +08:00
dongshen 7cc9c8fe06 acrn-config: build a hardware-reduced only ACPI
Change ACPI version from V3 to V5 to support hardware-reduced ACPI, which
is a V5 feature

Remove/obsolete the PM1X related stuff as they are not used for hardware-reduced
ACPI

Add the _S5 method in DSDT table

Using hardware-reduced mode allows to use a much simpler form of ACPI that
does not require supporting the legacy of previous versions of the specification
such as SCI IRQ.

Hardware-reduced mode is specified by setting the Hardware Reduced (HW_REDUCED_ACPI)
flag in FADT table.

If the HW_REDUCED_ACPI flag in the FADT table is set, OSPM will ignore fields related
to the ACPI HW register interface such as the PM1x control register. Instead, sleep
control/status registers can be used for system sleep state entry on hardware-reduced
ACPI systems.

Tracked-On: #5411
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-11-04 10:33:31 +08:00
dongshen 3cf476dc1d acrn-config: specify valid ACPI reset register address and value in FADT table
So that guest VM can recognize and use ACPI reset register to reboot

No need to specify "Flags (decoded below)" in FADT template, iasl will
calculate and fill in this flag for us

Tracked-On: #5411
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2020-11-04 10:33:31 +08:00
Yang,Yu-chu a8fe9b906a acrn-config: remove legacy vuart declaration
Improve the legacy vuart code. The legacy vuart insert the declaration
without checking if it's enabled. Refined the logic that if the legacy
is disabled, simply do not declare.

Tracked-On: #5425
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 0d9c2ac6aa acrn-config: remove readonly="0" from legacy_vuart in all scenario xmls
Remove readonly="0" from legacy_vuarts in xml and make it configurable.

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 60f9b62826 acrn-config: Add console and communication vuarts to template and
generic

Add console and communication vuarts to:
misc/vm_configs/xmls/config-xmls/generic/<scenario>.xml
misc/vm_configs/xmls/config-xmls/template/<scenario>.xml

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 3a53bb9b74 acrn-config: add console and communication vuarts to scenario xmls
Add console and communication vuarts to default xmls under:
misc/vm_configs/xmls/config-xmls/<platforms>/<scenarios>.xml

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 1f32bd6542 acrn-config: Add console and communication vuarts to launch xmls
Add new tag console_vuart and communication_vuarts to all launch script
xmls.

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 4f79e691d0 acrn-config: pci vuart sanity check for scenario xmls
Check if the scenario xmls configure pci vuarts properly
Sanity check of scenario xml:
1. check the format of console and communication vuarts
2. legacy vuart0 and console vuart0 cannot be eabled at the same time
3. legacy vuart1 and communication vuart1 cannot be enabled at the
same time
4. Any vuart should not connect to any type of vuart0
5. Every vuart can only connect to enabled vuart<idx> (idx > 0)

Tracked-On: #5425
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 29fbefea74 acrn-config: add pci vuart to launch script
Add pci vuart to launch script if the pci vuart is enabled.
Add pci vuart sanity check for launch script:
- vuart0 and console vuart cannot be enabled at the same time
- vuart1 cannot be eabled if the legacy vuart 1 is enabled

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 6ecd58f51a acrn-config: add pci vuart number to total pci devices number
take enabled pci vuarts to count in total pci devices number per VM

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 4f8ec75c8a acrn-config: add legacy vuart parser in common library
- Add legacy vuart in get_leaf_tag_map.
- Rename vuart to legacy vuart in plateform scenario xmls accrodingly

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu e52b3ce7de acrn-config: rename vuart to legacy vuart in xmls
rename vuart to legacy vuart in:
misc/vm_configs/xmls/config-xmls/generic
misc/vm_configs/xmls/config-xmls/template

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 6b8ec62b52 acrn-config: insert vuart device information to pci_dev.c
- Find unused bdf for SOS and pre-launched VM's pci vuart if it's
enabled
- The vuart cannot detect the function difference, find the unused vbdf
based on "dev" increment

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 53c488844f acrn-config: add functions to get pci vuarts information from xml
Add functions to get pci vuarts information and vuarts conunt per vm

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Yang, Yu-chu 98f922e6a9 acrn-config: find unused vbar base for pci vuarts
Allocate unused vbar for pci based vuarts when the it's enabled for SOS
and/or pre-launched VMs.

- vuart needs 2 bar, both are 4k size
- for SOS, find unused vbar in the range which is assigned to pci host
bridge. The allocated vbar cannot have confilicts with any existing pci devices
- for pre-launched VMs, find unused vbar in the range 0x80000000 to
0xfffffff. The alloacted vbar cannot have confilicts with any
passthrough devices and mmio

Tracked-On: #5425
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-11-02 08:52:52 +08:00
Shixiong Zhang 22c5dd2c58 acrn-config: fix the wrong vuart name in launch script
when fix the issue of _PM_SystemS5 with life_mngr fail,
the vuart1(tty) item was devided into two parts, the last
part "/dev/tty*" which need to get will be added to the
end, so it should be handled singly, but it will be added
to other item too, such as vuart1(pty).

Tracked-On:#5366

Signed-off-by: Shixiong Zhang <shixiongx.zhang@intel.com>
2020-10-30 21:09:27 +08:00
Tao Yuhong 55b7fae67a HV: pci-vuart: pci based vuart emulation
Add emulation for pci based vuart device mcs9900 at hv land.
add struct pci_vdev_ops vuart_pci_ops, the vdev callbalks for vuart.

How to use
In misc/vm_configs/scenarios/<SCENARIO>/<BOARD>/pci_dev.c, add pci
vuart config to vm_pci_devs[] array. For example:

struct acrn_vm_pci_dev_config vm0_pci_devs[] = {
       /* console vuart setting*/
       {
               .emu_type = PCI_DEV_TYPE_HVEMUL,
               .vbdf.bits = {.b = 0x00U, .d = 0x04U, .f = 0x00U},
               .vdev_ops = &vmcs_ops,
               .vbar_base[0] = 0x80001000,	/* mmio bar */
               .vbar_base[1] = 0x80002000,	/* msix bar */
               .vuart_idx = 0,
       },
       /* communication vuart setting */
       {
               .emu_type = PCI_DEV_TYPE_HVEMUL,
               .vbdf.bits = {.b = 0x00U, .d = 0x05U, .f = 0x00U},
               .vdev_ops = &vmcs_ops,
               .vbar_base[0] = 0x80003000,
               .vbar_base[1] = 0x80004000,
               .vuart_idx = 1,
               .t_vuart.vm_id = 1U,
               .t_vuart.vuart_id = 1U,
       },
}

Tracked-On: #5394
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2020-10-30 20:41:34 +08:00
Yang,Yu-chu 8e545734d4 acrn-config: fix the bug of resolved nested mmio address
Multiple devices could be nested under the same range. Skip remove if
the device is removed already

Tracked-On: #5437
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:40:16 +08:00
Liang Yi 5646b218ff acrn-config: minor change scenario xml for cfl-k700-i7
Changes:
	1. assign 3 CPUs for WaaG on hybrid_rt scenario;
	2. Passthrough NVME@9:0.0 for VM0 on hybrid_rt scenario;
	3. Change rootfs from partition2 to partition3;

Tracked-On: #5390

Signed-off-by: Liang Yi <yi.liang@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-10-30 20:38:43 +08:00
Yang,Yu-chu 7f80314406 acrn-config: find unused vbar base from start to end
- find unused vbar base from start of the memory address

Tracked-On: #5426
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-10-30 20:24:28 +08:00
Yang,Yu-chu 6fa5e10e93 acrn-config: fix the shmem vbar2 with prefechtable bit
BAR2 is sharing memory bar:
- set bit[3] Prefetchable
- bit [2:1] to 10b

Tracked-On: #5426
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-10-30 20:24:28 +08:00
Yang,Yu-chu c2f1d65ace acrn-config: add vbar[1] to SOS and pre-launched VM
Add vbar base region 1 for SOS and pre-launched VM ivshmem

Tracked-On: #5426
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-10-30 20:24:28 +08:00
Yang,Yu-chu 2290396ef5 acrn-config: generate SOS ivshmem device information
Support enable ivshmem for SOS. Insert the ivshmem device information if
it is enabled.
1. get ivshmem vbar based:
  - vbar[0] is size 0x100
  - vbar[2] is specified MB size
2. get vbdf for ivshmem device

Tracked-On: #5426
Signed-off-by: Yang,Yu-chu <yu-chu,yang>
2020-10-30 20:24:28 +08:00
Yang, Yu-chu 0f16746c1e acrn-config: add sos pci_dev_num and pci_devs to vm_configurations.c
Add following to default output scenarios vm_configurations.c:
 - pci_dev_num
 - pci_devs = sos_pci_devs

Both was defineded in CONFIG_SOS_VM.

Tracked-On: #5426
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:24:28 +08:00
Yang, Yu-chu 57ed333027 acrn-config: fix logical of vm total pci devices count
Skip vhostbridge if there is no pci passtrhough device

Tracked-On: #5426
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:24:28 +08:00
Yang, Yu-chu 8c78590da7 acrn-config: refactor pci_dev_c.py and insert vuart device information
- Refactor pci_dev_c.py to insert devices information per VMs
- Add function to get unused vbdf form bus:dev.func 00:00.0 to 00:1F.7

Add pci devices variables to vm_configurations.c
- To pass the pci vuart information form tool, add pci_dev_num and
pci_devs initialization by tool
- Change CONFIG_SOS_VM in hypervisor/include/arch/x86/vm_config.h to
compromise vm_configurations.c

Tracked-On: #5426
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:24:28 +08:00
Yang, Yu-chu fc5add8dd6 acrn-config: add functions to get pci count per vm
Function to get pci dev number per VM

Tracked-On: #5426
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:24:28 +08:00
Yang,Yu-chu bda53a3599 acrn-config: Add functionality to find unused vbar base
Allocate unused vbar for SOS and pre-launched VMs.

- For SOS, find unused vbar in the range which is assigned to pci host
bridge. The allocated vbar cannot have confilicts with any existing pci devices
- For pre-launched VMs, find unused vbar in the range 0x80000000 to
0xfffffff. The alloacted vbar cannot have confilicts with any
passthrough devices and mmio.

Tracked-On: #5426
Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
2020-10-30 20:24:28 +08:00
Shuang Zheng b23374ccc9 acrn-config: get PTCT table from native environment
automatically get PTCT table from native environment for the usage
of pre-launched VMs.

Tracked-On: #5418

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:39:59 +08:00
Shuang Zheng 0e9775f4a4 acrn-config: integrate PTCT table for pre-launched RTVM
fill physical PTCT table into pre-launched vACPI table when PSRAM
is configured to passthrough to pre-launched RTVM.

Tracked-On: #5418

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:39:59 +08:00
Shuang Zheng faeef67c20 acrn-config: add PSRAM config in scenario setting
add CONFIG_PSRAM_ENABLED and CONFIG_PSRAM_PRE_RT_ENABLED config in
scenario setting and update Kconfig.

Tracked-On: #5418

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:39:59 +08:00
Shuang Zheng 6df069f6ba acrn-config: add PSRAM config in xmls
add PSRAM configs in xmls, only enable PSRAM and passthrough to
pre-launched RTVM for hybrid_rt scenario on tgl-rvp board.

Tracked-On: #5418

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:39:59 +08:00
Shuang Zheng c348cad1ee acrn-config: add mutually exclusive logic for legacy vuart and PCI vuart on config UI
Config tool UI will do mutually exclusive check the legacy vuart 0/1 and
PCI vuart 0/1 to make sure there is no legacy vuart and PCI vuart are
used at the same time for VMs.

Tracked-On: #5394

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:25:57 +08:00
Shuang Zheng 4f5885c271 acrn-config: add PCI VUART config in launch config UI
Add PCI VUART config for post-launched VMs in launch config UI. Users
can configure the console_vuart, configure or dynamically add or remove
communication_vuart based on the communication vuarts which are configured
from the scenario xml.

Tracked-On: #5394

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:25:57 +08:00
Shuang Zheng 788f28035d acrn-config: add PCI VUART config in scenario config UI
Add PCI VUART dynamic config for VMs in scenario config UI, keep legacy
VUART config. PCI vuart base can be set to INVALID_PCI_BASE and PCI_VUART;
users will configure the target_vm_id and target_vuart_id when PCI vuart
base is set to PCI_VUART; users can dynamically add or delete PCI vuart
for VMs.

Tracked-On: #5394

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2020-10-30 18:25:57 +08:00
Victor Sun a4cca45bc6 acrn-config: minor change scenario xml for ehl
changes:
	1. Change SOS VM rootfs to nvme0;
	2. Change hybrid_rt scenario VM0 mem size to 1GB;

Tracked-On: #5238

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-10-29 13:37:03 +08:00
Peter Fang 654d0f9d00 misc: life_mngr: use the entire read buffer for the SOS socket
The messages from the SOS socket can be safely read into the entire read
buffer.

Tracked-On: #5429
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-10-29 10:11:25 +08:00