Commit Graph

4459 Commits

Author SHA1 Message Date
Wei Liu 1e2333647e acrn-config: skip the DRHDn_IGNORE when no device scope
Skip to generate DRHDn_IGNORE to board.c, when there is no device scope
type on target platform DRHD definition.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu 40929efe4b acrn-config: walk secondary PCI Bus for target board
There may be more than one PCI segment in target board, and DRHD info
should be parsed correctly base on secondary PCI bus. currently
board_parser.py tool did not handle such case.
Add this patch for walking secondary PCI Bus.

Tracked-On: #4143
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu 5e9234203a acrn-config: refinement for DmarDevScope struct
Refine the DmarDevScope struct and some class names.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu f6e6ec4ca2 acrn-config: modify SDC config xml to support kata vm config in webUI
Support to config kata vm in webUI, this need to modify 'configurable' attribute
to '1' in vm item.

Tracked-On: 4145
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Shuang Zheng bb2218effc acrn-config: add UI to add or remove Kata VM for sdc scenario
add UI to add or remove Kata VM for sdc scenario, the added Kata VM
is based on the generic config xml.

Tracked-On: 4145
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu 31d023e8f9 acrn-config: launch refinement on vcpu affinity and uos image
1. The vcpus of UOS are configured in vm configuration, they should be offlined from
sos before vm start.
2. retry offline cpu for all UOS type.
3. uos image name will be based on vm name instead of input parameter.
4. correct the unexpected token ';;' in launch config.

Tracked-On: #4145
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu d581473c82 acrn-config: refine vcpu affinity/number for SDC scenario
For SDC scenario, support kata vm would be triggered from webUI, and
will store the kata vm information to the scenario config file.
Then, vcpu affinity/number should be refined for vm1 and kata vm.

Note: with this patch, user should add/remove the kata vm in SDC
scenario webUI and its number should match MAX_KATA_VM_NUM in
hypervisor/arch/x86/Kconfig.

Tracked-On: #4145
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu d44440f734 acrn-config: print warning if MMIO BAR size above 4G
Currently MMIO BAR size not support size above 4G,
print warning to user to set the MMIO size in 4G region from BIOS.

Target-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu dc2d6b6656 acrn-config: modify the git commit message for gen_patch
Minor changes on git commit message of config patch:
For board config patch, specify with "config patch for board xxx";
For scenario config patch, specify with "config patch for scenario yyy".

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Li Fei1 2c4ebdc695 hv: vmsi: name vmsi with verb-object style
Name vmsi and vmsix function with verb-object style:
For external APIs, using MODULE_NAME_verb-object style;
For internal APIs, using verb-object style.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-29 08:53:07 +08:00
Li Fei1 6ee076f7df hv: assign: rename ptirq_msix_remap to ptirq_prepare_msix_remap
ptirq_msix_remap doesn't do the real remap, that's the vmsi_remap and vmsix_remap_entry
does. ptirq_msix_remap only did the preparation.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-29 08:53:07 +08:00
Geoffroy Van Cutsem 51a43dab79 hv: add Kconfig parameter to define the Service VM EFI bootloader
Add a Kconfig parameter called UEFI_OS_LOADER_NAME to hold the Service VM EFI
bootloader to be run by the ACRN hypervisor. A new string manipulation function
to convert from (char *) to (CHAR16 *) has been added to facilitate the
implementation.

The default value is set to systemd-boot (bootloaderx64.efi)

Tracked-On: #2793
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-11-27 10:38:49 +08:00
Junhao Gao 058b03c3a7 dm: fix memory free issue for xhci
remove uninitialized variable "dir", then make sure
"xfer->data","xfer->data[i].hcb","xfer->reqs" free correctly.

Tracked-On: #4154
Signed-off-by: Junhao Gao <junhao.gao@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-11-27 10:22:27 +08:00
Sainath Grandhi 422330d4ab HV: reimplement PCI device discovery
Major changes:

1. Correct handling of device multi-function capability

We only check function zero for this feature. If it has it, we continue
looking at all remaining functions, ignoring those with invalid vendors.
The PCI spec says we are not to probe beyond function zero if it does
not exist or indicates it is not a multi-function device.

2a. Walk *ALL* buses in the PCI space, however,
Before walking the PCI hierarchy, post-processed ACPI DMAR info is parsed
and a map is created between all device-scopes across all DRHDs and the
corresponding IOMMU index.

This map is used at the time of walking the PCI hierarchy. If a BDF that
ACRN is currently working on, is found in the above-mentioned map, the
BDF device is mapped to the corresponding DRHD in the map.
If the BDF were a bridge type, realized with "Header Type" in config space,
the BDF device along with all its downstream devices are mapped to the
corresponding DRHD in the map.

To avoid walking previously visited buses, we maintain a bitmap that
stores which bus is walked when we handle Bridge type devices.

Once ACPI information is included into ACRN about the PCI-Express Root
Complexes / PCI Host Bridges, we can avoid the final loop which probes
all remainder buses, and instead jump to the next Host Bridge bus.

From prior patches, init_pdev returns the pdev structure it created to
the caller. This allows us to complete initialization by updating its
drhd_idx to the correct DRHD.

Tracked-On: #4134
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-11-27 09:49:32 +08:00
Alexander Merritt 94a456ae24 HV: refactor device_to_dmaru
On server platforms, DMAR DRHD device scope entries may contain PCI
bridges.

Bridges in the DRHD device scope indicate this IOMMU translates for all
devices on the hierarchy below that bridge.

ACRN is unaware of bridge types in the device scope, and adds these
directly to its internal representation of a DRHD. When looking up a BDF
within these DRHD entries, device_to_dmaru assumes all entries are
Endpoints, comparing BDF to BDF. Thus device to DMAR unit fails, because
it treats a bridge as an Endpoint type.

This change leverages prior patches by converting a BDF to the
associated device DRHD index, and uses that index to obtain the correct
DRHD state.

Handling a bridge in other ways may require maintaining a bus list for
each, or replacing each bridge in the dev scope with a set of all device
BDFs underneath it. Server platforms can have hundreds of PCI devices,
thus making the device scope artificially large is unwieldy.

Tracked-On: #4134
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-11-27 09:49:32 +08:00
Sainath Grandhi 34c75a0b60 doc: Add multiple PCI segments as known limitation for hypervisor
ACRN does not support multiple PCI segments in its current form.
This patch adds support for mutliple PCI segments as a limitation
for ACRN in reference docs.

Tracked-On: #4134
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-11-27 09:49:32 +08:00
Sainath Grandhi c5a87d41df HV: Cleanup PCI segment usage from VT-d interfaces
ACRN does not support multiple PCI segments in its current form.
But VT-d module uses segment info in its interfaces and
hardcodes it to 0.
This patch cleans up everything related to segment to avoid
ambiguity.

Tracked-On: #4134
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-11-27 09:49:32 +08:00
Alexander Merritt 810169ad20 HV: initialize IOMMU before PCI device discovery
In later patches we use information from DMAR tables to guide discovery
and initialization of PCI devices.

Tracked-On: #4134
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-11-27 09:49:32 +08:00
Alexander Merritt ea131eea41 HV: add DRHD index to pci_pdev
We add new member pci_pdev.drhd_idx associating the DRHD
(IOMMU) with this pdev, and a method to convert a pbdf of a device to
this index by searching the pdev list.

Partial patch: drhd_index initialization handled in subsequent patch.

Tracked-On: #4134
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-11-27 09:49:32 +08:00
Alexander Merritt 0b7bcd6408 HV: extra methods for extracting header fields
Add some encapsulation of utilities which read PCI header space using
wrapper functions. Also contain verification of PCI vendor to its own
function, rather than having hard-coded integrals exposed among other
code.

Tracked-On: #4134
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-11-27 09:49:32 +08:00
hongliang 9af4a62482 doc: edit using_ubuntu_as_sos.rst adjust to v1.4
Signed-off-by: hongliang <hongliangx.ye@intel.com>
2019-11-26 17:19:50 -08:00
Mingqiang Chi 32b8d99f48 hv:panic if there is no memory map in multiboot info
add panic if there is no memory map info during booting.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-11-26 16:16:23 +08:00
Mingqiang Chi bd0dbd274d hv:add dump_guest_mem
add shell command to support dump dump guest memory
e.g.
dump_guest_mem vm_id, gva, length

Tracked-On: #4144
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-11-26 10:58:19 +08:00
Mingqiang Chi 215bb6ca6c hv:refine dump_host_mem
rename shell_dumpmem to shell_dump_host_mem
and refine this api.

Tracked-On: #4144
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-11-26 10:58:19 +08:00
Mingqiang Chi 4c8dde1b9c hv:remove show_guest_call_trace
now this api assumes the guest OS is 64 bits,
this patch remove this api and will replace it
with dumping guest memory.

Tracked-On: #4144
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-11-26 10:58:19 +08:00
wenlingz 24fa14bcf6 Revert "Revert "OVMF release v1.4""
This reverts commit 18d5dd2fe9.
2019-11-26 10:33:39 +08:00
Jack Ren 5b4d676bc9 version: 1.5-unstable
Signed-off-by: Jack Ren <jack.ren@intel.com>
2019-11-22 11:56:38 +08:00
lirui34 c2f9de95fb doc: remove rt gsg kernel info
No need rt kernel info in gsg doc.

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-22 11:30:14 +08:00
Lei, Lu 2d5fdecf41 doc: update acrn ootb doc
1. Update acrn.efi name in acrn ootb scripts
2. Add licenses to acrn ootb scripts
3. Add format U disk step
4. Add execute permission to ootb script
5. Fix wrong img name
6. update clearlinux version to 31600

Signed-off-by: Lei, Lu <leix.lu@intel.com>
2019-11-21 10:17:28 -05:00
lirui34 ec6777ab09 doc: Update 1.4 versions and some words
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-21 10:15:46 -05:00
Deb Taylor faa348ebdd Doc: Corrected title formatting in RN 1.0.2 doc.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-11-21 09:43:55 -05:00
wenlingz 2400f073d1 releasenote for release_1.0.2
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2019-11-21 08:51:25 -05:00
Victor Sun f657bae0a8 Makefile: do not rm board acpi info header
The $(BOARD)_acpi_info.h is generated by acrn-config tool, remove this
header in make clean would cause failure when user finish configuring
in webUI and start to make acrn-hypervisor by the command
"make hypervisor BOARD=xxx SCENARIO=yyy" because we mandatory do make
clean before making hypervisor.

The patch replace the file removal with a warning string to hint user
to check the file validity.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-21 16:15:23 +08:00
David B. Kinder 28e24c4198 doc: put v1.0 docs back in version menu
We've been keeping the doc version choice list trimmed as new doc
version releases are made, but the v1.0 version should remain.  (Note
that the documents for all previously published versions are still
available on the server, but they were included in the menu choice).
This PR puts the 1.0 choice back in.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-20 09:02:37 -08:00
Wei Liu b332bf84b8 acrn-config: enhance the board config that has no serial port
There may be no physical serial port in the target board, and it will
stop generating board file, the patch add support to handle such case.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Wei Liu 658dccfbe3 acrn-config: set S3/S5 to default value while BIOS not support them
If S3/S5 are not support by BIOS in some platform, will set them to 0
as default.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Wei Liu 037e7a4a2c acrn-config: modify the key of vuart base
Return correct key of vuart base to webUI for parsing.

Tracked-On: #4128
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Jidong Xia 26c45a0c70 hv: modify printf "not support the vuart index parameter" in vuart_register_io_handler
call vuart_register_io_handler function, when the parameter vuart_idx is greater
than or equal to 2, print the vuart index value which will not register the vuart.

Tracked-On: #4072
Signed-off-by: Jidong Xia <xiajidong@cmss.chinamobile.com>
2019-11-20 09:45:00 +08:00
Deb Taylor 40439e1d84 Doc: Content edits to the AGL as VMs docs
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-11-19 13:07:54 -05:00
hongliang 1d8f16a2e9 doc: edit agl-vms.rst adjust to v1.3 2019-11-19 11:58:03 -05:00
Yonghua Huang da469d9e3e doc: add mitigation description for CVE-2018-12207 in advisory
Mitigation for this vulnerability is applied in 1.4 release, update
 related notes in adviosry.

Tracked-On: #4101
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-11-18 12:54:45 -05:00
Li Fei1 5aa92b85ea hv: vpci: move vBAR base setting into pci_vdev_write_bar
Updating vBAR base when setting vBAR configuration sapce.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Li Fei1 5fdb6cc0ac hv: vpci: remove 64 bits PCI BAR map logic constraint
After reshuffle pci_bar structrue we could write ~0U not BAR size mask to BAR
configuration space directly when do BAR sizing. In this case, we could know whether
the value in BAR configuration space is a valid base address. As a result, we could
do BAR re-programming whenever we want.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Li Fei1 c049c5c965 hv: vpci: reshuffle pci_bar structure
The current code declare pci_bar structure following the PCI bar spec. However,
we could not tell whether the value in virtual BAR configuration space is valid
base address base on current pci_bar structure. We need to add more fields which
are duplicated instances of the vBAR information. Basides these fields which will
added, bar_base_mapped is another duplicated instance of the vBAR information.
This patch try to reshuffle the pci_bar structure to declare pci_bar structure
following the software implement benefit not the PCI bar spec.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Li Fei1 f53baadd5a hv: vpci: refine PCI IO BAR map
The current do PCI IO BAR remap in vdev_pt_allow_io_vbar. This patch split this
function into vdev_pt_deny_io_vbar and vdev_pt_allow_io_vbar. vdev_pt_deny_io_vbar
removes the old IO port mapping, vdev_pt_allow_io_vbar add the new IO port mapping.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Mingqiang Chi a59205f6a2 dm:use acrn-dm logger function instread of fprintf
use acrn-dm logger function instread of fprintf,
this helps the stability testing log capture.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Cao Minggui <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-11-14 15:34:04 +08:00
Mingqiang Chi 5375a1613b dm:use acrn-dm logger function instread of printf
Use acrn-dm logger function instread of printf,
this helps the stability testing log capture.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Cao Minggui <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-11-14 15:34:04 +08:00
Sainath Grandhi 22a1bd6948 hv: Fix the definition of struct representing interrupt hw frame
In 64-bit mode, processor pushes SS and RSP onto stack unconditionally.
Also when dumping the exception info, it makes more sense to dump
the RSP at the point of interrupt, rather than the RSP after pushing
context (including GPRs)

Tracked-On: #4102
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-11-13 16:06:35 +08:00
Victor Sun 0d52f933da Makefile: move .mk file to hv scripts folder
The *.mk files under misc/acrn-config/library are all rules for hypervisor
makefiles only, so move these files to hypervisor/scripts/makefile/ folder.

The folder of acrn-config/library/ will be used to store python script lib only.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Terry Zou <terry.zou@intel.com>
2019-11-13 16:05:30 +08:00
Victor Sun acd0deb8a1 Makefile: board specific acpi info header clean up
The board specific $(BOARD)_acpi_info.h is generated by acrn-config tool,
we should clean it up before build hypervisor, otherwise the file could be
referenced by next build process if no config XMLs is specified.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-13 16:05:30 +08:00