Commit Graph

5195 Commits

Author SHA1 Message Date
Tonny Tzeng d9672639dc doc: specify component versions used by Kata-on-ACRN tutorial
This commit calls out specific configurations used for the validation.

Tracked-On: #4879
Signed-off-by: Tonny Tzeng <tonny.tzeng@intel.com>
2020-06-05 08:27:01 -07:00
Li Fei1 c4b5af9663 hv: pci: remove some unnecessary functions
We define some functions to read some fields of the CFG header registers. We
could remove them since they're not necessary since calling pci_pdev_read_cfg
is simple.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-06-05 16:53:33 +08:00
Long Liu 1672eca2b9 DM USB: xHCI: Drop commands if slot is disabled
From xHCI spec 4.5.3.2, the only command that software is
allowed to issue for the slot in disabled state is the Enable
Slot Command. Drop other commands in command handle function.

Tracked-On: #4711
Signed-off-by: Long Liu <long.liu@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-06-05 15:31:05 +08:00
Naveen Saini b919122c34 use variables for installation directories.
Don't hardcode install paths. Instead of hardcoding where binaries are
installed, add variables that installer can override.

Tracked-On: #4864

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
2020-06-05 15:25:12 +08:00
Wei Liu d694760167 acrn-config: add RDT configurable item for QEMU sdc xml
add RDT configurable item for QEMU sdc xml

Tracked-On: #4889
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-05 09:14:15 +08:00
Binbin Wu 65ec6f3f3b hv: vtd: fix potential dead loop if qi request timeout
Fix potential dead loop if qi request timeout.

Tracked-On: #4680
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2020-06-05 05:31:16 +08:00
David B. Kinder 764d7c1332 doc: rename rt_industry GSG
Move the rt_industry GST into a tutorial for using Clear Linux as the
Service VM.  Also drop a redirect to avoid 404 errors reference the
moved doc (redirect list maintained in conf.py)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-06-04 08:10:02 -07:00
Deb Taylor 7fd535215d Grammatical updates to GSG Indust Scen Ubuntu
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2020-06-04 08:29:04 -04:00
Victor Sun a6e552b7b5 Makefile: minor fix on hypervisor dependency
The $(VERSION) should be depended on config.h change. For example, when RELEASE
parameter is changed in make commmand, CONFIG_RELEASE need to be updated in
defconfig file, and then message in version.h should be updated.

The patch also fix a bug that a code path in make defconfig never be triggered
because shell will treat [ ! -f $(KCONFIG_FILE) ] as false when $(KCONFIG_FILE)
is not specified. (i.e. "$(KCONFIG_FILE)" == "")

Tracked-On: #2412

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-06-04 15:03:43 +08:00
David B. Kinder 1e2d0f3993 doc: update Kata tutorial for Ubuntu Service VM
Update tutorial for running Kata containers on Ubuntu

Tracked-On: #4879

Signed-off-by: Tonny Tzeng <tonny.tzeng@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-06-03 15:20:54 -07:00
Fuzhong Liu 78ba180987 Update doc/getting-started/rt_industry_ubuntu.rst
Co-authored-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-06-03 17:52:31 -04:00
Deb Taylor acbc6848fc Initial GSG for ARCN industry Scenario with Unbuntu Service VM
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2020-06-03 17:52:31 -04:00
David B. Kinder db454dcdf1 doc: rst syntax tweaks
There are some subtle syntax errors in some documents that, while they
render OK (most of the time), are being caught by rstcheck (a
restructuredText linter). This PR fixes most of the issues encountered.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-06-03 14:37:37 -07:00
Wei Liu 2e9da35ea3 acrn-config: refine sanity check for MASK_CLOS number
refine sanity check for MASK_CLOS number by max clos in board xml.

Tracked-On: #4876
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-03 22:18:31 +08:00
Wei Liu a4a3b4e951 acrn-config: refine GVT args for SOS cmdline
1.Refinement GVT args for SOS kernel cmdline in scenario config xmls.
2.Refinement GVT args for launch UOS script in launch config xmls.

Tracked-On: #4869
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-03 22:02:58 +08:00
Wei Liu fbb1dfa264 HV/Kconfig: update efi bootloader image file path for Kconfig
Update efi bootloader image file path for Yocto rootfs in Kconfig.

Tracked-On: #4868
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2020-06-03 22:02:58 +08:00
Wei Liu 83275cf892 acrn-config: update efi bootloader image file path for acrn-config
1.Update efi bootloader image file path for Yocto rootfs.
2.Remove empty check for UEFI OS loader name.

Tracked-On: #4868
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-03 22:02:58 +08:00
Li Fei1 ae4fa40adc hv: vpci: hv: vpci: refine pci device assignment logic
Now Host Bridge and PCI Bridge could only be added to SOS's acrn_vm_pci_dev_config.
So For UOS, we always emualte Host Bridge and PCI Bridge for it and assign PCI device
to it; for SOS, if it's the highest severity VM, we will assign Host Bridge and PCI
Bridge to it directly, otherwise, we will emulate them same as UOS.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-03 22:00:43 +08:00
Li Fei1 b8f151a55f hv: pci: check whether a PCI device is host bridge or not by class
According PCI Code and ID Assignment Specification Revision 1.11, a PCI device
whose Base Class is 06h and Sub-Class is 00h is a Host bridge.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-03 22:00:43 +08:00
Li Fei1 0bd2daf1c5 hv: pci: remove host bridge BDF definition
We should check whether a PCI device is host bridge or not by Base Class (06h)
and Sub-Class (00h).

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-03 22:00:43 +08:00
Wei Liu 7e5c2865d7 acrn-config: update native board information
Update mrb ttys, up2 iomem and ehl-crb-b information.

Tracked-On: #4862
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-02 15:15:39 +08:00
Wei Liu 5403fd720d acrn-config: re-generate TTYS_INFO in native board
Currently, MMIO PCI BDF of ttyS was indexed by IRQ, but it may found
the wrong BDF when the IRQ was shared and it is not expected. So, the
patch uses the MMIO base to query /proc/iomem to find BDF, the waring
will get if BDF is not present in iomem.

Tracked-On: #4862
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-02 15:15:39 +08:00
Peter Fang e41c17653f OVMF release v2.0
- Add Platform GOP Policy
- Add MemoryFence to AcrnEmuVariableFvbRuntimeDxe
- UefiCpuPkg/CpuExceptionHandlerLib: Fix split lock
- OvmfPkg/SataControllerDxe: Calculate ChannelCount based on PI value

Tracked-On: #4866
Signed-off-by: Peter Fang <peter.fang@intel.com>
2020-06-02 15:09:30 +08:00
Terry.Zou b382b3b065
Merge pull request #4861 from liuwei987/support_RDT_for_config_tool
acrn-config: add RDT support in scenario config of config tool
2020-06-02 08:44:24 +08:00
Shuang Zheng 93b12818c7 acrn-config: add RDT support in scenario config of config app
RDT config item is located in the 5rd layer of scenario config;
the number of CLOS_MASK config is dynamically obtained by the rdt
resource clos max in the board config;
the vcpu_clos config is dynamically added or removed when the
pcpu_id config is added or removed;
the drop-down list of vcpu_clos config is reduced by half when
CDP_ENABLED=y.

Tracked-On: #4860
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2020-06-01 14:32:57 +08:00
Wei Liu 6ed2b855bf acrn-config: support to parse RDT information
1.Add parser and sanity check for RDT_ENABLED/CDP_ENABLED/CLOS_MASK.
2.Skip to generate RDT inforamtion when HW not support RDT or usr
select 'n' to disable RDT feature.
3.Add contiguous bit 1 check for CLOS_MASK.

Tracked-On: #4860
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-01 14:32:57 +08:00
Wei Liu abba0f0e63 acrn-config: add configurable RDT feature in scenario xmls
1.Add RDT feature in scenario xmls, add set RDT_ENABLED=y, CDP_ENABLED=n
by default for industry scenario if HW support RDT.
2.Add CLOS_MASK in xmls to configurable and set them to '0xff' by
default if HW support RDT.
3.Remove configurable="0" of clos for PRE launched VM and POST VM, currently,
remain configurable="0" for SOS VM.
4.Add vcpu_clos to match the pcpu_id number, and set vcpu_clos to 0.

Tracked-On: #4860
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-06-01 14:32:57 +08:00
Vijay Dhanraj cc952f73de Update doc/tutorials/acrn_on_qemu.rst
Co-authored-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-05-29 09:10:42 -07:00
Vijay Dhanraj 2d6868d041 Update doc/tutorials/acrn_on_qemu.rst
Co-authored-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-05-29 09:10:42 -07:00
Vijay Dhanraj c0447aaad2 Update doc/tutorials/acrn_on_qemu.rst
Co-authored-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-05-29 09:10:42 -07:00
Vijay Dhanraj a81f6e2c62 doc: Enabling ACRN on top of QEMU/KVM
Tracked-On: #3198
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2020-05-29 09:10:42 -07:00
Geoffroy Van Cutsem 31ed8e27b0 doc: update note about min version of gcc and binutils
Update the note in the document to indicate the minimum version of gcc and
binutils required to succesfully compile ACRN.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-05-29 09:04:55 -07:00
Geoffroy Van Cutsem 0079184f97 doc: remove zlib from the build dependency
Remove the zlib package from the list of build dependencies for Ubuntu.

Tracked-On: #4838
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-05-29 09:04:55 -07:00
Zide Chen f6a7206200 acrn-dm: fix corner cases in acrn_parse_cpu_affinity()
- re-arange the code to make static code analysis tool happy.

- If no valid conversion could be performed, a zero value is returned
  (0L) from strtol(), so add a sanity check "isdigit(cp[0])" to ensure
  that it won't unexpectedly parse CPU 0 if the string starts or ends
  with the valid delimiters ',' or '-', for example:

  -- cpu_affinity 1,
  -- cpu_affinity ,1

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-05-29 11:51:09 +08:00
wenlingz 0f6d11866b Modify Makefile to add acrn.bin after install
Tracked-On: #4842
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2020-05-29 10:31:16 +08:00
Yuan Liu aeae464980 Implement creation and removal of inter-vm shared memory
The shared memory will be created when a post-launched VM which
specified ivshmem v1 device starts, the same shared memory name
will only create a shared memory region.

The shared memory will be removed when all post-launched VMs
that opened it close the shared memory object.

v2: Support one post-launched VM can configure multiple ivshmem
    devices

Tracked-On: #4853
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-05-29 09:28:24 +08:00
Yuan Liu cb816f7f65 Introduce ACRN Inter-VM Virtualization
Support shared memory based inter-vm communication for ACRN
post-launched VMs. The ivshmem mediator emulates one standard
PCI device which expose the shared memory region through its BAR2.
The shared memory region is allocated through Linux shm mechanism and
post-launched VM needs to specify the shm name and size as the acrn-dm
parameter, the VMs have same shm name parameter can communicate over
the shared memory.

For first stage, only support shared memory. Consider to support
notification(interrupt) in future.

To add a ivshmem device in device model, the usage as below
-s N,ivshmem,shm_name,shm_size

v2: Implement the ivshmem MMIO registers emulation

v3: Refine code style
    Add ivshmem device usage
    Refine MMIO register return value

v4: Refine comments
    Use logger interfaces to print logs

Tracked-On: #4853
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-05-29 09:28:24 +08:00
Helmut Buchsbaum 884e9fc911 Revert "dm: acpi: add PSDS table in ACPI table"
This reverts commit 59e2de4805.

Since PSDS table format does not meet the expectations on all boards
providing a PSDS, such as e.g. Kontron COMe-mAL10 based boards, remove
exposure of PSDS table for now.

Tracked-On: #4846
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2020-05-29 09:03:52 +08:00
Xie, nanlin af52ed6e5d CODEOWNERS: Update the maintainer of misc folder
Tracked-On: #3419

Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2020-05-28 13:47:31 +08:00
Li Fei1 ce3451827a hv: vpci: add vmsix capability registers rw permission control
Guest may write a MSI-X capability register with only RW bits setting on. This works
well on native since the hardware will make sure RO register bits could not over-write.
However, the software needs more efforts to achieve this. This patch does this by
defining a RW permission mapping base on bits. When a guest tries to write a MSI-X
Capability register, only modify the RW bits on vCFG space.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-05-28 13:44:18 +08:00
Li Fei1 ea0ba47b02 hv: vpci: add vmsi capability registers rw permission control
Guest may write a MSI capability register with only RW bits setting on. This works
well on native since the hardware will make sure RO register bits could not over-write.
However, the software needs more efforts to achieve this. This patch does this by
defining a RW permission mapping base on bits. When a guest tries to write a MSI
Capability register, only modify the RW bits on vCFG space.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-05-28 13:44:18 +08:00
Helmut Buchsbaum ccbabb4ce8 dm: bzimage: dynamically adapt to ramdisk size
To remove the limit of 4MB ramdisk size simply adjust layout
dynamically according to ramdisk size rounded up to a 4K boundary.
This enables ramdisk based virtual machines which tend to have
large ramdisk memory requirements (128MB and above).

Tracked-On: #4840
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2020-05-28 08:49:47 +08:00
Vijay Dhanraj d03df0c7e2 HV: Fix MP Init sequence hang by adding a delay
As per the BWG a delay should be provided between the
INIT IPI and Startup IPI. Without the delay observe hangs
on certain platforms during MP Init sequence. So Setting
a delay of 10us between assert INIT IPI and Startup IPI.

Also, as per SDM section 10.7 the the de-assert INIT IPI is
only used for Pentium and P6 processors. This is not applicable
for Pentium4 and Xeon processors so removing this sequence.

Tracked-On: #4835
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-05-27 13:34:59 +08:00
Minggui Cao 8c090c71ca HV: fix bug to clear guest flags after it not used
in shutdown_vm, it uses guest flags when handling the phyiscal
CPUs whose LAPIC is pass-through. So if it is cleared first,
the related vCPUs and pCPUs can not be switched to correct state.

so move the clear action after the flags used.

Tracked-On: #4848
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2020-05-27 11:35:47 +08:00
Binbin Wu 454bb14348 hv: vtd: remove some unnecessary check
1. context_entry couldn't be NULL in iommu_attach_device since bus
number is checked before the call.
2. root_entry couldn't be NULL in iommu_detach_device since bus number
is checked before the call.

Tracked-On: #4831
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-05-27 11:27:42 +08:00
Binbin Wu e9901b3edd hv: vtd: add a function to check valid of dmar unit
Add a function dmar_unit_valid to check if the input dmar uint is valid
or not.

A valid dmar_unit should not be NULL, or ignore flag should not be set.

Tracked-On: #4831
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-05-27 11:27:42 +08:00
Binbin Wu 3009d9399f hv: vtd: cleanup snoop control related code
Snoop control will not be turned on by hypervisor, delete snoop control
related code.

Tracked-On: #4831
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-05-27 11:27:42 +08:00
Binbin Wu a94c3ef763 hv: vtd: init DMAR/IR table address when register
Initialize root_table_addr/ir_table_addr of dmar uint when register the dmar uint.
So no need to check if they are initialzed or not later.

Tracked-On: #4831
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-05-27 11:27:42 +08:00
Helmut Buchsbaum b7f667a3ba dm: Do not link to zlib
Since zlib is not used, remove linking to it. This reduces build
dependencies.

Tracked-On: #4838
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2020-05-26 14:01:54 +08:00
Minggui Cao 564984570c HV: explicitly init lock variable before using it
1. though "pci_device_lock" & "logmsg_ctl.lock" are set to 0 when
  system dose memory initialization, it is better to explicitly init
  them before using.
2. unify the usage of spinlock_init

Tracked-On: #4827
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-05-26 10:26:59 +08:00