Commit Graph

5224 Commits

Author SHA1 Message Date
Qian Wang
7c94d8c411 HV: restrict conditions to assign/deassign pcidev
This patch is ported from mainline branch to v2.0 branch to fix
potential service VM hang issue when fuzzing hypercalls.

hv: hypercall: restrict the condition to assign/deassign a pci device to
a post-launched VM for safety

For the safety of post-launched VMs, pci devices assignments should
occur only when VM is being created (at VM_CREATED STATUS), and pci
devices de-assignment should occur only when VM is being created or
shutdown/reset (at VM_CREATED or VM_PAUSED status)

Tracked-On: #5024
Acked-by: Eddie Done <eddie.dong@intel.com>
Reviewed-by: Li Fei <Fei1.Li@intel.com>
Signed-off-by: Wang Qian <qian1.wang@intel.com>
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2020-07-13 10:48:25 +08:00
Victor Sun
1a167ca0b0 HV:BOARD_ENABLE: add whl-phx-i7 configs code
add whl-phx-i7 configuration code support;

Tracked-On: 4998

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-07-02 15:00:55 +08:00
Victor Sun
f269c2e020 HV:BOARD_ENABLE: add whl-phx-i7 xmls
add whl-phx-i7 board xml and its industry scenario xml into repo;

Tracked-On: #4998

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-07-02 15:00:55 +08:00
Yin Fengwei
7ae20c970b debug: BOARD_ENABLE: update the debug serial port info of SOS
Currently, we always assign 0x3F8 as port base io address for
emualted COM1 of SOS.

But in some board, it use serial port which has other base io
address for debugging purpose. And this serial port info is also
exposed to SOS by ACPI table.

In this case, SOS could access the debugging serial port because
it could see the port from ACPI table and conflict with ACRN.

To mitigate this issue, we could let emulated COM1 of SOS to use
native debugging serial port base io port and irq info.

Tracked-On: #4998
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2020-07-02 09:40:52 +08:00
Wei Liu
ae748704c0 acrn-config: extend the max msix table number to 64
Config tool should keep aligning with Kconfig default value for
MAX_MSIX_TABLE_NUM.

Tracked-On: #4994
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-06-30 16:17:11 +08:00
Yin Fengwei
8d8c36b340 kconfig: extend the max msix table number to 64
There are some devices (like Samsung NVMe SSD SM981/PM981 which has 33 MSIX tables)
which have more than 16 MSIX tables. Extend the default value to 64 to handle them.

Tracked-On: #4994
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2020-06-30 16:17:11 +08:00
wenlingz
9c1f1a0dba version:v2.0
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2020-06-27 09:21:22 +08:00
David B. Kinder
ddc769f594 doc: update release_2.0 branch with doc changes
Update the working release_2.0 branch with doc updates made since the
code feature freeze two weeks ago.  (This is an update of all docs
changed in master since then, instead of doing cherry-picks of the
individual doc PRs/commits).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-06-24 09:40:54 -07:00
Li Fei1
e0a101d9f0 hv: vpci: a minor fix about is_zombie_vf
Now we check whether a device is zombie by the ->user != NULL.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-06-21 11:56:07 +08:00
yuhong.tao@intel.com
2100ef0b50 HV: Fix split-locked access detection is disabled by default
The commit 'HV: Config Splitlock Detection to be disable' allows
using CONFIG_ENFORCE_TURNOFF_AC to turn off splitlock #AC. If
CONFIG_ENFORCE_TURNOFF_AC is not set, splitlock #AC should be turn on

Tracked-On: #4962
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2020-06-19 14:44:26 +08:00
Li Fei1
70f7e2239f hv: mmu: release 1GB cpu side support constrain
There're some platforms still doesn't support 1GB large page on CPU side.
Such as lakefield, TNT and EHL platforms on which have some silicon bug and
this case CPU don't support 1GB large page.

This patch tries to release this constrain to support more hardware platform.

Note this patch doesn't release the constrain on IOMMU side.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-06-15 16:02:00 +08:00
Li Fei1
83dc1e5ed2 Revert "hv: Let trampoline execution use 1GB pages"
There're some silicon bug on lakefield, TNT and EHL platforms which cause CPU
couldn't support 1GB large page.

This reverts commit f01aad7e77 in order to release
hardware platform 1GB large page support constrain on CPU side.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-06-15 16:02:00 +08:00
Shuo A Liu
7fa5a0055d acrn-config: update EHL CRB configs
BIOS version: EHLSFWI1.R00.2224.A00.2005281500

Tracked-On: #4937
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2020-06-15 15:53:17 +08:00
Shuo A Liu
dc7d99c05a dm: fix wrong hugetlb_lv_max
The logic to get hugetlb_lv_max is wrong. Correct it.

Tracked-On: #4937
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2020-06-15 15:53:17 +08:00
Shuo A Liu
e66de66697 Revert "hv: Offload syncing PIR to vIRR to processor hardware"
This reverts commit bf1ff8c98f.

Tracked-On: #4937
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2020-06-15 15:53:17 +08:00
Shuo A Liu
6b93675225 hv: Change to a permissive check with broken DMAR table
From the VT-d spec 8.3:
If a DRHD structure with INCLUDE_PCI_ALL flag Set is reported for a
Segment, it must be enumerated by BIOS after all other DRHD structures
for the same Segment.

However, some broken BIOS violate the rules. To bring up ACRN with them,
change the ASSERT to a permissive check to unblock the BIOS limitation.
Also, scan the DRHD list to find the one who has INCLUDE_PCI_ALL flag.

Tracked-On: #4937
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2020-06-15 15:53:17 +08:00
Shuo A Liu
75705dd0e0 hv: Refine dmar parsing code
Replace dmar_iterate_tbl() by a direct for loop. Handle the
dmar_unit_cnt and handle_one_drhd() of each DRHD in the direct for loop.

Also tune some function definitions to save LOC.

Tracked-On: #4937
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2020-06-15 15:53:17 +08:00
Wei Liu
4bedb7d136 acrn-config: modify the linux like uos type to yocto
Modify the linux like uos type to yocto.

Tracked-On: #4901
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-06-12 13:48:38 +08:00
Wei Liu
0b6b3c4ccb acrn-config: add support to generate General Linux/Yocto/Ubuntu
Add support to generate Linux like oS launch scripts.

Tracked-On: #4901
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-06-12 13:48:38 +08:00
Wei Liu
c1846a5ba2 acrn-config: modify whl-ipc-i7 default industry xml
modify whl-ipc-i7 default industry xml to avoid build issue.

Tracked-On: #4913
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-06-12 13:48:38 +08:00
Long Liu
e3fe3da273 DM USB: xHCI: Fix XHCI_GET_SLOT value check issue
Fix XHCI_GET_SLOT macro check slot valid function, when the
slot value is bigger than XHCI_MAX_SLOT set the slot value
to zero.

Tracked-On: #4711
Signed-off-by: Long Liu <long.liu@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
2020-06-09 15:57:56 +08:00
Victor Sun
1e3c64f52e HV: correct mmap info for multiboot2
The acrn_mbi.mi_mmap_va should point to struct multiboot2_mmap_entry when
boot from multiboot2, which is different from struct multiboot_mmap when
boot from multiboot1. So we should handle mmap info separately for multiboot2.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-06-09 08:40:28 +08:00
Yin Fengwei
ca2d3de79b debug: dump more info when walk guest page table.
dump more info when walk guest page table.
Note:
And this patch is not for fixing it. It's only debug patch. But we were
required to merge it to acrn-2.0 branch.

Tracked-On: #4908
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2020-06-08 13:33:20 +08:00
Victor Sun
1fcab2298b HV: enable multiboot module string as kernel bootargs
Previously the VM kernel bootargs for pre-launched VMs and direct boot mode
of SOS VM are built-in hypervisor binary so end users have no way to change
it. Now we provide another option that the multiboot module string could be
used as bootargs also. This would bring convenience to end users when they
use GRUB as bootloader because the bootargs could be configurable in GRUB
menu.

The usage is if there is any string follows configured kernel_mod_tag in
module string, the string will be used as new kernel bootargs instead of
built-in kernel bootargs. If there is no string follows kernel_mod_tag,
then the built-in bootargs will be the default kernel bootargs.

Please note kernel_mod_tag must be the first word in module string in any
case, it is used to specify the module for which VM.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2020-06-05 21:24:46 +08:00
Victor Sun
cdd7afc436 HV: rename append_seed_arg to fill_seed_arg
Previously append_seed_arg() just do fill in seed arg to dest cmd buffer,
so rename the api name to fill_seed_arg().

Since fill_seed_arg() will be called in SOS VM path only, the param of
bool vm_is_sos is not needed and will be replaced by dest buffer size.

The seed_args[] which used by fill_seed_arg() is pre-defined as all-zero,
so memset() is not needed in fill_seed_arg(), buffer pointer check
and strncpy_s() are not needed also.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-05 21:24:46 +08:00
Victor Sun
482a6fa2d8 HV: replace merge_cmdline api with strncat_s
Add a standard string api strncat_s() to replace merge_cmdline() to make code
more readable.

Another change is that the multiboot cmdline will be appended to the end of
configured SOS bootargs instead of the beginning, this would enable a feature
that some kernel cmdline paramter items could be overriden by multiboot cmdline
since the later one would win if same parameters configured in kernel cmdline.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-05 21:24:46 +08:00
Victor Sun
c622698532 HV: rewrite strncpy_s to be iso c11 compliant
Per C11 standard (ISO/IEC 9899:2011): K.3.7.1.4

1. Copying shall not take place between objects that overlap;
2. If there is a runtime-constraint violation, the strncpy_s function sets
   s1[0] to '\0\;
3. The strncpy_s function returns zero if there was no runtime-constraint
   violation. Otherwise, a nonzero value is returned.
4. The function is implemented with memcpy_s() because the runtime-constraint
   detection is almost same.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-05 21:24:46 +08:00
Victor Sun
55afb2f039 HV: rewrite memcpy_s to be iso c11 compliant
Per C11 standard (ISO/IEC 9899:2011): K.3.7.1.1

1. Copying shall not take place between objects that overlap;
2. If there is a runtime-constraint violation, the memcpy_s function stores
   zeros in the first s1max characters of the object;
3. The memcpy_s function returns zero if there was no runtime-constraint
   violation. Otherwise, a nonzero value is returned.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-05 21:24:46 +08:00
Victor Sun
4315de8a58 HV: add hv cmdline support for multiboot2
The multiboot2 cmdline would be used as hypervisor cmdline, add parse logic
for the case that hypervisor boot from multiboot2 protocol.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-05 21:24:46 +08:00
Victor Sun
ad8e784b78 HV: split sanitize_multiboot_info api
Previously sanitize_multiboot_info() was called after init_debug_pre() because
the debug message can only print after uart is initialized. On the other hand,
multiboot cmdline need to be parsed before init_debug_pre() because the cmdline
could override uart settings and make sure debug message printed successfully.
This cause multiboot info was parsed in two stages.

The patch revise the multiboot parse logic that split sanitize_multiboot_info()
api and use init_acrn_multiboot_info() api for the early stage. The most of
multiboot info will be initialized during this stage and no debug message need
to be printed. After uart is initialized, the sanitize_multiboot_info() would
do sanitize multiboot info and print needed debug messages.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-05 21:24:46 +08:00
Xiaoguang Wu
06d3f4bcb2 DM USB: xHCI: [REVERTME] release memory on port resetting.
There is fd leakage during guest OS rebooting process, and this is
a WA patch to fix it. Formal patch will be made later.

Tracked-On: #4897
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
2020-06-05 21:19:05 +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