Commit Graph

5892 Commits

Author SHA1 Message Date
Junjie Mao 2f6abbe752 acrn-config: add XSLT scripts to transform XMLs to config.[h|mk]
In order to remove Kconfig from the build process, acrn-config shall
transform XML configuration files to config.h and config.mk by itself. This
patch adds XSLT scripts that do the trick.

Unfortunately, the scenario XML file along is not sufficient to generate
config.h and config.mk, though. In addition to resource
allocation (i.e. allocating physical RAM for the hypervisor), the
transformation also need to do the following:

    1. Translate UART info in board XML into several configuration entries
       depending on the UART selected in the scenario XML.
    2. Use the MAX_MSIX_TABLE_NUM value in the board XML if the scenario
       XML does not specify it.

In order to use XSLT to transform both XMLs in one shot, a template is
provided to create another XML that includes (using XInclude) both board
and scenario XMLs as sub-nodes. It will be instantiated once the
transformations are integrated in the following patch.

v2:
 * Add `allocation.xml` to `unified.xml` to include the results from static
   allocation.
 * Use HV_RAM_START and HV_RAM_SIZE in allocation results if they are not
   explicitly specified in the scenario XML.

Tracked-On: #5644
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-20 17:58:00 +08:00
Junjie Mao 7a145253f3 acrn-config: add static allocators to rewrite scenario XMLs
In order to split the allocation logic from tranformation in the
configuration tool, this patch introduces the `static_allocators` directory
under `misc/acrn-config` to host scripts that statically allocate
resources (currently the physical memory) and fill the scenario XML with
the results. The logic is extracted from the existing configuration tool
which allocates resources when transforming XML files, while XPath is used
to read and manipulate the XML when possible.

The aim is to make transformation from XML files to C configuration sources
to be more trivial and easier to express in descriptive languages like
XSLT.

v2:
 * Instead of rewriting the scenario XML, the new version generates
   allocation results to a new XML named `allocation.xml` so that the form
   of the results are not restricted by the XML schema.

Tracked-On: #5644
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-20 17:58:00 +08:00
Junjie Mao 9cff2bbdc0 acrn-config: add a script to generate config sources from XMLs
In order for a unified interface for generating configuration sources from
board and scenario XMLs, this patch introduces a script named genconf.sh
which takes XML files as inputs and generate sources under the specified
directory. Once used in Makefiles, this script helps to minimize the
impacts on the Makefiles when we refine the configuration source generation
process in the future.

This patch also adds a non-zero return value to board_cfg_gen.py and
scenario_cfg_gen.py so that we do not need to inspect the logs to determine
if the generation succeeds.

Tracked-On: #5644
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-20 17:58:00 +08:00
Tao Yuhong 6c6fa5f340 Fix: HV: keep reshuffling on VBARs
The commit 'Fix: HV: VM OS failed to assign new address to pci-vuart
BARs' need more reshuffle.

Tracked-On: #5491
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
2021-01-15 15:00:01 +08:00
Jie Deng 5c5d272358 hv: remove bitmap_clear_lock of split-lock after completing emulation
When "signal_event" is called, "wait_event" will actually not block.
So it is ok to remove this line.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-01-13 15:32:27 +08:00
Yin Fengwei ef411d4ac3 hv: ptirq: Shouldn't change sid if intx irq mapping was added
Now, we use hash table to maintain intx irq mapping by using
the key generated from sid. So once the entry is added,we can
not update source ide any more. Otherwise, we can't locate the
entry with the key generated from new source ide.

For source id change, remove_remapping/add_remapping is used
instead of update source id directly if entry was added already.

Tracked-On: #5640
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-01-12 15:23:44 +08:00
Jie Deng 8aebf5526f hv: move split-lock logic into dedicated file
This patch move the split-lock logic into dedicated file
to reduce LOC. This may make the logic more clear.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-01-08 17:37:20 +08:00
Jie Deng 27d5711b62 hv: add a cache register for VMX_PROC_VM_EXEC_CONTROLS
This patch adds a cache register for VMX_PROC_VM_EXEC_CONTROLS
to avoid the frequent VMCS access.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-01-08 17:37:20 +08:00
Jie Deng f291997811 hv: split-lock: using MTF instead of TF(#DB)
The TF is visible to guest which may be modified by
the guest, so it is not a safe method to emulate the
split-lock. While MTF is specifically designed for
single-stepping in x86/Intel hardware virtualization
VT-x technology which is invisible to the guest. Use MTF
to single step the VCPU during the emulation of split lock.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-01-08 17:37:20 +08:00
Jie Deng 6852438e3a hv: Support concurrent split-lock emulation on SMP.
For a SMP guest, split-lock check may happen on
multiple vCPUs simultaneously. In this case, one
vCPU at most can be allowed running in the
split-lock emulation window. And if the vCPU is
doing the emulation, it should never be blocked
in the hypervisor, it should go back to the guest
to execute the lock instruction immediately and
trap back to the hypervisor with #DB to complete the
split-lock emulation.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-01-08 17:37:20 +08:00
Li Fei1 0b18389d95 hv: vcpuid: expose mce feature to guest
Windows64 seems only support processor which has MCE (Machine Check Error)
feature.

Tracked-On: #5638
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2021-01-08 17:22:34 +08:00
Jie Deng d0aa8f9102 dm: virtio-gpio: avoid flood messages in virtio_irq_evt_notify
To avoid flood messages in virtio_irq_evt_notify.

Tracked-On: #5635
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-01-08 17:21:33 +08:00
Victor Sun 84ef242b10 DM: samples: Enable VxWorks as normal VM by default
This patch basically reverts commit 22f24c229b
since virtio polling mode is still not ready in VxWorks official build.

	commit 22f24c229b
	Author: Kaige Fu <kaige.fu@intel.com>
	Date:   Thu Jun 13 09:24:07 2019 +0000

	    DM: Samples: Enable VxWorks as hard-rt VM

	    This patch adds --lapic_pt option to launch VxWorks as hard-rt VM.

End user could enable VxWorks as hard-rt VM with acrn-config tool, or add
below acrn-dm parameters in launch script:

	" --lapic_pt \
	  --virtio_poll 1000000 \
	  -U $rtvm_uuid"

Tracked-On: #3069

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-01-08 17:21:15 +08:00
Tao Yuhong 84752ab229 Fix: HV: VM OS failed to assign new address to pci-vuart BARs
When wrong BAR address is set for pci-vuart, OS may assign a
new BAR address to it. Pci-vuart BAR can't be reprogrammed,
for its wrong fixed value. That can may because pci_vbar.fixed and
pci_vbar.type has overlap in abstraction, pci_vbar.fixed
has a confusing name, pci_vbar.type has PCIBAR_MEM64HI which is not
really a type of pci BARs.
So replace pci_vbar.type with pci_vbar.is_mem64hi, and change
pci_vbar.fixed to an union type with new name pci_vbar.bar_type.

Tracked-On: #5491
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2021-01-08 17:20:56 +08:00
Geoffroy Van Cutsem 08bafdffc6 doc: fix typo in docbuild.rst
Fix a typo in the `docbuild.rst` file.
2021-01-04 08:51:56 -08:00
David B. Kinder b74b4cd53d doc: upgrade doc-build tools
Update the documentation for how to build ACRN documents
(tutorial/docbuild.rst) and the scripts/requirements.txt that lists the
tested configuration of python tools being used.

Previous merged commits have already been made to handle doc builds with
the previous (2.3 documented configuration and the new v2.4
configuration.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-31 14:56:17 -08:00
David B. Kinder c0707ab361 doc: prep for upgrading doc build tools
Update known-issues list to eliminate known warnings for duplicate
declaration warnings because of breathe/sphinx upgrades.

Update conf.py to check sphinx version and use appropriate way to
include extra javascript and css files depending on the version.

Both of these changes will allow the old and new doc tools to not show
unanticipated warnings or errors and allow for a smooth upgrade to the
CI system (and contributors local doc builds).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-31 13:04:27 -08:00
Jie Deng b14c32a110 hv: Retain RIP only for fault exception.
We have trapped the #DB for split-lock emulation.
Only fault exception need RIP being retained.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-12-31 11:12:33 +08:00
Jie Deng 977e862192 hv: Add split-lock emulation for xchg
xchg may also cause the #AC for split-lock check.
This patch adds this emulation.

 1. Kick other vcpus of the guest to stop execution
    if the guest has more than one vcpu.

 2. Emulate the xchg instruction.

 3. Notify other vcpus (if any) to restart execution.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-12-31 11:12:33 +08:00
Jie Deng 47e193a7bb hv: Add split-lock emulation for LOCK prefix instruction
This patch adds the split-lock emulation.
If a #AC is caused by instruction with LOCK prefix then
emulate it, otherwise, inject it back as it used to be.

 1. Kick other vcpus of the guest to stop execution
    and set the TF flag to have #DB if the guest has more
    than one vcpu.

 2. Skip over the LOCK prefix and resume the current
    vcpu back to guest for execution.

 3. Notify other vcpus to restart exception at the end
    of handling the #DB since we have completed
    the LOCK prefix instruction emulation.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-12-31 11:12:33 +08:00
David B. Kinder 69b207ac6a doc: spelling fixes
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-28 15:02:06 -08:00
David B. Kinder 33901fd287 doc: fix formatting in windows as UOS doc
code-block content wasn't indented in a recent change so wasn't included
in the code-block formatting

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-24 11:07:28 -08:00
fuzhongl 703e0e2d52 Doc: update Debian and Ubuntu as the User VM
Pipe info isn't needed for IDV solution; so remove this part in
the document.

Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2020-12-23 09:27:19 -08:00
Shuang Zheng 529a2ac497 acrn-config: config the entry number of vcpu_clos same as that of pcpu_id
configure the entry number of vcpu_clos same as the entry number
of pcpu_id to avoid sanity check error.

Tracked-On: #5600
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-12-23 08:47:02 +08:00
David B. Kinder 35aba4ff21 doc: remove stray x attrib on png and rst files
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-21 09:57:19 -08:00
Yonghua Huang df5e0bfe00 doc: remove exec attribute for 'acrn-secure-boot-with-grub.rst'
Remove 'x' attribute of this file and one more minor fix.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2020-12-21 09:45:43 -08:00
Geoffroy Van Cutsem 6fa0cb3758 doc: fix 'cp' command in instructions
Fix the 'cp' operation in the instructions explaining
how to build the kernels.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-12-21 09:37:54 -08:00
fuzhongl 2c5b7fcde8 Doc: update WaaG image creation with GVT-d GOP
Since GVT-g isn't enable for new platform (i.e TGL EHL CFL),
update the doc about using GVT-d GOP to create WaaG image.

Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com
2020-12-21 09:37:12 -08:00
Geoffroy Van Cutsem 070be0aa99 doc: specify the version of 'sphinx-tabs' to install
Specify the version of 'sphinx-tabs' to be installed in order
to be able to build the documentation. Without this, the latest
is installed but is incompatible with 'sphinx==1.7.7' as specified
in our doc/scripts/requirements' file.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-12-21 09:35:18 -08:00
David B. Kinder 52d33f067e doc: tweak to copyright footer
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-18 08:40:31 -08:00
David B. Kinder 99d8f29617 doc: update LICENSE copyright years
LICENSE file copyright must reflect latest year of contributions
(before this update, it said 2017-2018).

Tracked-On: #5611

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-18 15:12:18 +08:00
Shuang Zheng 7e4b953185 acrn-config: add cfl-k700-i7 into tpm supported boards
add cfl-k700-i7 into tpm supprted boards to enable tpm
passthru to the pre-launched vm.

Tracked-On: #5614
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2020-12-18 13:22:08 +08:00
Yonghua Huang 655777e6ce ovmf: update OVMF.fd
Currently, OVMF sets CR4.MCE bit without
  any hardware support checking, this will cause
  User VM boot fails as MCE feature is not available
  for ACRN guest VM.

  This patch walk around this issue in OVMF.

Tracked-On: #5586
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2020-12-18 11:21:22 +08:00
Yonghua Huang 643bbcfe34 hv: check the availability of guest CR4 features
Check hardware support for all features in CR4,
 and hide bits from guest by vcpuid if they're not supported
 for guests OS.

Tracked-On: #5586
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-12-18 11:21:22 +08:00
Yonghua Huang 442fc30117 hv: refine virtualization flow for cr0 and cr4
- The current code to virtualize CR0/CR4 is not
   well designed, and hard to read.
   This patch reshuffle the logic to make it clear
   and classify those bits into PASSTHRU,
   TRAP_AND_PASSTHRU, TRAP_AND_EMULATE & reserved bits.

Tracked-On: #5586
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2020-12-18 11:21:22 +08:00
Minggui Cao f31be45df0 misc: add more boot arguments for EHL preempt-rt
some RT related boot arguments are needed for preempt-rt linux.
add them in configure file built in for EHL board.
  for EHL, it is booted with SBL, not like GRUB, extra boot arguments
can be added; so better to be built in.

Tracked-On: #5606
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2020-12-18 11:06:41 +08:00
David B. Kinder 61e5957129 doc: automate copyright year footer
Automatically update the copyright year on the page footers to be
2018-[current_year] when generating documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-17 10:59:57 -08:00
Steve Winslow bdcfb5c83b doc: add ACRN lockup logo to README
As part of the trademark registration for ACRN, it is helpful to
ensure that the logo is displayed on the same page from which the
ACRN code can be downloaded.

This PR adds the logo and updates the README file to display it.

Tracked-On: #5601

Signed-off-by: Steve Winslow <steve@swinslow.net>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-15 10:36:42 -08:00
Yang,Yu-chu 371440754e acrn-config: fix the logic of get_vuart1_vmid
The function validate if the legacy vuart1 and its target_vm_id are
paired. However, it dynamically modifies the tracking list. It would try
to access an invalid keys which has been removed.

Refine the logic to add a valid paired legacy vuart1 to new list.

Tracked-On: #5592
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2020-12-14 13:00:51 +08:00
Geoffroy Van Cutsem 7a4b811a63 hv: set SHELL in top-level Makefile
Explicitly set the SHELL variable in the top-level Makefile. This ensures that
'echo -e' as used in the Makefile behaves correctly on various systems. It does
require /bin/bash to be present but that is probably true on many systems.

Tracked-On: #5588
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-12-11 09:46:21 +08:00
Geoffroy Van Cutsem b87070f95a Revert "hv: fix formatting for cfg.log output"
This reverts commit e2590d88aa. It introdcues a
regression for systems that have '/bin/sh' pointing at '/bin/bash'.

Tracked-On: #5588
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-12-11 09:46:21 +08:00
ChenYing Kuo ead26799ff Small updates to ROScube-I Installation Guide
* Add newline before `sudo reboot` in User VM section.
* Add `cd ~/acrn/tools/` before downloading script in User VM section.

Signed-off-by: ChenYing Kuo <chenying.kuo@adlinktech.com>
2020-12-10 09:23:49 -08:00
Geoffroy Van Cutsem 9264aeb77d doc: small updates to the GSG
Small updates to the Getting Started Guide:
* Add a missing command
* Add a note for the Grub configuration
* Make the 'blkid' hint consistent with the environment

Tracked-On: #5594
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-12-10 09:21:54 -08:00
David B. Kinder 2571314d77 doc: add ROScube GSG
Adding a new GSG contributed by ADLINK for installing an ACRN Industry
Scenario on their ROScube-I system.

Signed-off-by: ChenYing Kuo <chenying.kuo@adlinktech.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-08 11:08:58 -08:00
Shuang Zheng b4249bd11c acrn-config: update function for xml.etree.ElementTree to compatible with python3.9
The function getchildren() is removed from xml.etree.ElementTree.Element
on python3.9, update the function to list() to make config tool
compatible with python3.9.

Tracked-On: #5570

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-12-08 15:47:01 +08:00
Yonghua Huang 06e9220794 dm: rename ioctl command for hv-emulated management
Use add/remove device instead of create/destroy.

Tracked-On: #5586
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2020-12-07 16:25:17 +08:00
Yonghua Huang 08c42f91c9 hv: rename hypercall for hv-emulated device management
Coding style cleanup, use add/remove instead of create/destroy.

Tracked-On: #5586
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2020-12-07 16:25:17 +08:00
Yonghua Huang d5bf1a76ff doc: update acrn secureboot enablement
- Format some section title
 - Add one more section.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-12-05 12:05:27 -08:00
Yonghua Huang 914ac534c0 doc: update HLD of HV-Land Ivshmem
Add a figure for HLD of HV-land doorbell design.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2020-12-05 11:25:31 -08:00
Shixiong Zhang 91fde59f41 acrn-config: modify the cmd args in pre-launched rt xml
add the right cmd args provided by Ronnie.

Tracked-On: #5501

Signed-off-by: Shixiong Zhang <shixiongx.zhang@intel.com>
2020-12-04 14:59:15 +08:00