Commit Graph

4705 Commits

Author SHA1 Message Date
Li Fei1 d2089889d8 hv: pci: minor fix of coding style about pci_read_cap
There's no need to check which capability we care at the very beginning. We could
do it later step by step.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-26 08:54:23 +08:00
Gary cdf9d6b3a6 devicemodel: refactor CMD_OPT_LAPIC_PT case branch
This patch refactors the CMD_OPT_LAPIC_PT case branch
    to explicity add the dependency of option RTVM at the
    same branch, it is decoupled from the next case branch
    to comply with strict code standard and improve the
    code readability.

Tracked-On: #4283
Signed-off-by: Gary <gordon.king@intel.com>
2019-12-25 15:03:11 +08:00
Wei Liu 77c3ce06e1 acrn-config: remove uncessary split for 'virtio-net'
Split the input message for 'virtio-net' would discard extra
message from user input, this is not expected for 'virtio-net' setting.

Tracked-On: #4298
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 14:28:07 +08:00
Wei Liu ce35a00518 acrn-config: add 'cpu_sharing' support for launch config
Add support to parse and get 'cpu_sharing' item value
from launch config files, these values are editable by user.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 14:28:07 +08:00
Wei Liu 3544f7c87e acrn-config: add 'cpu_sharing' info in launch xmls
Launch script should be set to 'Disabled'/'Enabled' from webUI while
hv enabled/disabled the cpu sharing.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 14:28:07 +08:00
Victor Sun 57939730b7 HV: search rsdp from e820 acpi reclaim region
Per ACPI 6.2 spec, chapter 5.2.5.2 "Finding the RSDP on UEFI Enabled Systems":

In Unified Extensible Firmware Interface (UEFI) enabled systems, a pointer to
the RSDP structure exists within the EFI System Table. The OS loader is provided
a pointer to the EFI System Table at invocation. The OS loader must retrieve the
pointer to the RSDP structure from the EFI System Table and convey the pointer
to OSPM, using an OS dependent data structure, as part of the hand off of
control from the OS loader to the OS.

So when ACRN boot from direct mode on a UEFI enabled system, hypervisor might
be failed to get rsdp by seaching rsdp in legacy EBDA or 0xe0000~0xfffff region,
but it still have chance to get rsdp by seaching it in e820 ACPI reclaimable
region with some edk2 based BIOS.

The patch will search rsdp from e820 ACPI reclaim region When failed to get
rsdp from legacy region.

Tracked-On: #4301

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-25 13:50:11 +08:00
Zide Chen fc78013fba acrn-config: some cleanup for logical partition mode Linux bootargs
- commit 69152647 ("hv: Use virtual APIC IDs for Pre-launched VMs")
  enables virtual APIC IDs for pre-launched VMs thus xapic_phys is no
  longer needed to force guest xAPIC to work in physical destination mode.

- HVC is not available in logical partition mode and "console=hvc0" should
  be removed from guest Linux bootargs.

Tracked-On: #3854
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-25 13:46:37 +08:00
Conghui Chen 8f9cda183e DOC: Content edits to CPU Sharing doc
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
2019-12-24 12:55:09 -05:00
Wei Liu 651510a8d1 acrn-config: add 'logger_setting' into launch script
Add missed definition of 'logger_setting' into launch script.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu 7f74e6e9a9 acrn-config: refine mount device for virtio-blk
Previous launch config tool doesn't handle the situation that
'virtio-blk' is set with rootfs partition with rootfs image,
in such scenario, VM would be failed to start when launching
This patch refine the mount device while use rootfs partiton and image
from vritio block device.

Tracked-On: #4248
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu fc357a7782 acrn-config: add 'tap_' perfix for virtio-net
UOS would be failed to get ip address, add 'tap_' perfix for virtio-net
name setting.

Tracked-On: #4255
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu 5b6a33bb34 acrn-config: enable log_setting in all VMs
enable log_setting for all VMs.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu bb6e28e183 acrn-config: check pass-thruogh device for audio/audio_codec
Add this check while validating audio/audio_codec for pass-through
device setting.

Tracked-On: #4249
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Wei Liu 4234d2e4d3 acrn-config: correct vuart1 setting in scenario config
The 'vuart1' item is selectable from webUI, but in some case user
might select vuart1 in industry scenario by mistake. If config tool
set them in vm configurations directly without checking, the
hypervisor might be failed to boot.
This patch will check such case and set the correct vuart1 in vm
configurations.

Tracked-On: #4247
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:56:22 +08:00
Chen, Zide d80a0dcea0 acrn-config: fix a few formatting issues
scenario_cfg_lib.py:
  - removed extra white space before ','

pci_dev_c.py:
  - follow style in other files, added two empty lines
  - removed extra line at the end of the .c file

vm_configurations_c.py
  - alignment

vm_configurations_h.py
  - alignment

Tracked-On: #3602
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-24 14:53:32 +08:00
Wei Liu 051f277cba acrn-config: modify hpa start size value for logical_partition scenario
Modify the hpa start size value for logical_partition scenario to avoid
build issue, and make the memory size of pre-launched VM configurable.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 16:55:32 +08:00
Yin Fengwei e5117bf19a vm: add severity for vm_config
Add severity definitions for different scenarios. The static
guest severity is defined according to guest configurations.

Also add sanity check to make sure the severity for all guests
are correct.

Tracked-On: #4270
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-12-23 15:15:09 +08:00
Yin Fengwei f7df43e7cd reset: detect highest severity guest dynamically
For guest reset, if the highest severity guest reset will reset
system. There is vm flag to call out the highest severity guest
in specific scenario which is a static guest severity assignment.

There is case that the static highest severity guest is shutdown
and the highest severity guest should be transfer to other guest.
For example, in ISD scenario, if RTVM (static highest severity
guest) is shutdown, SOS should be highest severity guest instead.

The is_highest_severity_vm() is updated to detect highest severity
guest dynamically. And promote the highest severity guest reset
to system reset.

Also remove the GUEST_FLAG_HIGHEST_SEVERITY definition.

Tracked-On: #4270
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-12-23 15:15:09 +08:00
Yin Fengwei bfa19e9104 pm: S5: update the system shutdown logical in ACRN
For system S5, ACRN had assumption that SOS shutdown will trigger
system shutdown. So the system shutdown logical is:
   1. Trap SOS shutdown
   2. Wait for all other guest shutdown
   3. Shutdown system

The new logical is refined as:
   If all guest is shutdown, shutdown whole system

Tracked-On: #4270
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-12-23 15:15:09 +08:00
Wei Liu 197e4a0620 acrn-config: add support to parse 'severity' item tag
Add support to parse 'severity' item tag from webUI and set them into
scenario configurations.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 15:15:09 +08:00
Wei Liu ca2855f230 acrn-config: add severity setting to scenario config xml
To keep align hypervisor source code for scenario config, need add
the 'severity' item tag into scenario config files.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 15:15:09 +08:00
Deb Taylor a408553834 Doc: Content edits to Running Kata containers on a Service VM doc
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-22 22:35:58 -05:00
Deb Taylor 9ee55965f8 Doc: More edits to CPU Sharing doc.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-22 21:56:58 -05:00
Wei Liu fcb85a806d acrn-config: remove pcpu3 from vm1 in SDC scenario
Currently kata vm is supported in SDC scenario by default, both vm1
and kata vm would share pcpu id 3 for vcpu affinity even when cpu
sharing is not enabled.
Remove pcpu id 3 from vm1 in SDC scenario config xmls.

Tracked-On: #4286
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-23 10:15:06 +08:00
Li Fei1 1fddf943d8 hv: vpci: restore PCI BARs when doing AF FLR
ACRN hypervisor should trap guest doing PCI AF FLR. Besides, it should save some status
before doing the FLR and restore them later, only BARs values for now.
This patch will trap guest Conventional PCI Advanced Features Control Register write
operation if the device supports Conventional PCI Advanced Features Capability and
check whether it wants to do device AF FLR. If it does, call pdev_do_flr to do the job.

Tracked-On: #3465
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-12-23 10:14:37 +08:00
Li Fei1 a90e0f6c84 hv: vpci: restore PCI BARs when doing PCIe FLR
ACRN hypervisor should trap guest doing PCIe FLR. Besides, it should save some status
before doing the FLR and restore them later, only BARs values for now.
This patch will trap guest Device Capabilities Register write operation if the device
supports PCI Express Capability and check whether it wants to do device FLR. If it does,
call pdev_do_flr to do the job.

Tracked-On: #3465
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-12-23 10:14:37 +08:00
Deb Taylor 3c2f4509af Doc: Add v1.5 release menu choice.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-21 10:42:44 -05:00
Deb Taylor 3e45d5e301 Doc: Content edit to cpu-sharing page
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-21 10:04:33 -05:00
Deb Taylor fa5922c8bf Doc: Content edit to rt_industry document.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-20 08:14:24 -05:00
lirui34 17f6344ce2 doc: Add tutorial about how to launch kata vm.
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-12-20 07:13:48 -05:00
fenglin.hu 2ceff27069 doc: modify Configuration Tools
Signed-off-by: fenglin.hu <fenglin.hu@intel.com>
2019-12-20 07:12:00 -05:00
Conghui Chen 7edf8ed798 doc: add document for cpu sharing
Add document and usage for cpu sharing.

Signed-off-by: Conghui Chen <conghui.chen@intel.com>
2019-12-20 07:11:40 -05:00
Peter Fang cce8a9f9c3 OVMF release v1.5
- Upgrade OpenSSL to 1.1.1d - cherry-picked the following commits from master:
  - 4d613feee5 - CryptoPkg/OpensslLib.inf: list OpenSSL local header
    "ms/uplink.h" (2019-12-02) <Laszlo Ersek>
  - b49a6c8f80 - CryptoPkg/OpensslLib: improve INF file consistency
    (2019-12-02) <Laszlo Ersek>
  - 1bcc65b9a1 - CryptoPkg: Upgrade OpenSSL to 1.1.1d (2019-11-05) <Shenglei
    Zhang>
  - 9f4fbd56d4 - CryptoPkg/OpensslLib: Update process_files.pl to generate .h
    files (2019-10-30) <Shenglei Zhang>
  - 8906f076de - CryptoPkg/OpensslLib: Add missing header files in INF file
    (2019-08-16) <Shenglei Zhang>
  - 51f7a3e6c5 - CryptoPkg/OpensslLib: Exclude err_all.c in process_files.pl
    (2019-06-25) <Xiaoyu Lu>
  - b86fbe1f98 - CryptoPkg/OpensslLib: disable autoload-config for OpenSSL
    (2019-06-21) <Xiaoyu Lu>
  - 20d2e5a125 - CryptoPkg/OpensslLib: fix build break caused by missing
    library (2019-06-06) <Wang, Jian J>
  - 0a1b13fd4d - CryptoPkg/OpensslLib: fix VS2017 build failure (2019-06-05)
    <Wang, Jian J>
  - 456dd8b99f - CryptoPkg: Upgrade OpenSSL to 1.1.1b (2019-06-03) <XiaoyuX
    Lu>
  - b739678918 - CryptoPkg/OpensslLib: Add functions for upgrading
    OpenSSL1_1_1b (2019-06-03) <XiaoyuX Lu>
  - 5db2fbff23 - CryptoPkg/OpensslLib: Prepare for upgrading OpenSSL
    (2019-06-03) <XiaoyuX Lu>
  - 7eee048894 - CryptoPkg/OpensslLib: Exclude unnecessary files in
    process_files.pl (2019-06-03) <Xiaoyu Lu>
  - 6fcc3d68eb - CryptoPkg/OpensslLib: Modify process_files.pl for upgrading
    OpenSSL (2019-06-03) <Xiaoyu Lu>
  - a18f784cfd - Upgrade OpenSSL to 1.1.0j (2018-12-21) <Jian J Wang>
- Security hardening for OVMF build

Tracked-On: #4273
Signed-off-by: Peter Fang <peter.fang@intel.com>
2019-12-20 10:31:15 +08:00
Gary 5b5f1735ff acrnboot: fix the parsing hv_cmdline to correctly handle the case of containing trailing whitespaces
The pointer variable 'start' should be checked against NULL
    right after detected it is not pointer to a space character,
    otherwise the pointer variable 'end' must hold the wrong
    address right after NULL if the cmdline containing trailing
    whitespaces and deference the wrong address out of cmdline
    string. this parsing code also been optimized and simplified.

Tracked-On: projectacrn#4250
Signed-off-by: Gary <gordon.king@intel.com>
2019-12-17 10:58:28 +08:00
Kaige Fu 5f9d1379bc HV: Remove INIT signal notification related code
We don't use INIT signal notification method now. This patch
removes them.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-17 09:45:52 +08:00
Kaige Fu 6d1f63aef0 HV: Use NMI to replace INIT signal for lapic-pt VMs S5
We have implemented a new notification method using NMI.
So replace the INIT notification method with the NMI one.
Then we can remove INIT notification related code later.

Tracked-On: #3886
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-17 09:45:52 +08:00
Kaige Fu a13909cedc HV: Use NMI-window exiting to address req missing issue
There is a window where we may miss the current request in the
notification period when the work flow is as the following:

      CPUx +                   + CPUr
           |                   |
           |                   +--+
           |                   |  | Handle pending req
           |                   <--+
           +--+                |
           |  | Set req flag   |
           <--+                |
           +------------------>---+
           |     Send NMI      |  | Handle NMI
           |                   <--+
           |                   |
           |                   |
           |                   +--> vCPU enter
           |                   |
           +                   +

So, this patch enables the NMI-window exiting to trigger the next vmexit
once there is no "virtual-NMI blocking" after vCPU enter into VMX non-root
mode. Then we can process the pending request on time.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-17 09:45:52 +08:00
Kaige Fu 40ba7e8686 HV: Don't make NMI injection req when notifying vCPU
The NMI for notification should not be inject to guest. So,
this patch drops NMI injection request when we use NMI
to notify vCPUs. Meanwhile, ACRN doesn't support vNMI well
and there is no well-designed way to check if the NMI is
for notification or for guest now. So, we take all the NMIs as
notificaton NMI for hard rtvm temporarily. It means that the
hard rtvm will never receive NMI with this patch applied.

TODO: vNMI support is not ready yet. we will add it later.

Tracked-On: #3886
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-17 09:45:52 +08:00
Kaige Fu 72f7f69c47 HV: Use NMI to kick lapic-pt vCPU's thread
ACRN hypervisor needs to kick vCPU off VMX non-root mode to do some
operations in hypervisor, such as interrupt/exception injection, EPT
flush etc. For non lapic-pt vCPUs, we can use IPI to do so. But, it
doesn't work for lapic-pt vCPUs as the IPI will be injected to VMs
directly without vmexit.

Without the way to kick the vCPU off VMX non-root mode to handle pending
request on time, there may be fatal errors triggered.
1). Certain operation may not be carried out on time which may further
    lead to fatal errors. Taking the EPT flush request as an example, once we
    don't flush the EPT on time and the guest access the out-of-date EPT,
    fatal error happens.
2). ACRN now will send an IPI with vector 0xF0 to target vCPU to kick the vCPU
    off VMX non-root mode if it wants to do some operations on target vCPU.
    However, this way doesn't work for lapic-pt vCPUs. The IPI will be delivered
    to the guest directly without vmexit and the guest will receive a unexpected
    interrupt. Consequently, if the guest can't handle this interrupt properly,
    fatal error may happen.

The NMI can be used as the notification signal to kick the vCPU off VMX
non-root mode for lapic-pt vCPUs. So, this patch uses NMI as notification signal
to address the above issues for lapic-pt vCPUs.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-17 09:45:52 +08:00
Deb Taylor 5f401461e7 Doc: Content edits to Using WaaG VM on ACRN
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-16 19:50:42 -05:00
Deb Taylor cc6224ec70 Doc: Content edits to the introduction/index file.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-16 17:47:17 -05:00
Deb Taylor ba5099e69f Doc: Content edits to the acrntrace README file.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-16 16:25:15 -05:00
Yuan Liu 6289124e7c doc: add windows 10 activation
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
2019-12-16 09:54:56 -05:00
Jian Jun Chen 42b8b6eb6e doc: Update WaaG GSG to use ACRNGT GOP to install Windows
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
2019-12-16 09:51:35 -05:00
Geoffroy Van Cutsem e0b323f5ef doc: add a little info on how to configure the boot options
Add a little information (at least pointers) as to how one can change the VM
(Pre-launched, Service or User) boot options.

Tracked-On: #3758
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-12-16 09:46:07 -05:00
Yonghua Huang ee8a3e3826 doc:debug feature is disabled by default
Update guidance to build ACRN from source,
as debug feature is disabled by default in Makefile.

 'RELEASE' shall be 0 if debug feature is required.

Tracked-On: #4222
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-12-16 09:11:24 -05:00
Geoffroy Van Cutsem 72b1a409bb doc: add new dependency to Clear Linux ACRN builder container
Since commit 9e9e1f61, a new build dependency on the NUMA library has been
introduced. We therefore need to add the `devpkg-numactl` bundle to our
Dockerfile used to build the Clear Linux "ACRN builder" container image.

Tracked-On: #4175
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-12-16 15:34:26 +08:00
Shiqing Gao 3cee259583 hv: msr: remove redundant check in write_pat_msr
Reserved bits in a 8-bit PAT field has been checked in pat_mem_type_invalid.
Remove this redundant check "(PAT_FIELD_RSV_BITS & field) != 0UL" in
write_pat_msr.

Tracked-On: #1842
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-12-16 14:32:42 +08:00
Yonghua Huang d4677a8917 hv:fix crash issue when handling HC_NOTIFY_REQUEST_FINISH
Input 'vcpu_id' and the state of target vCPU should be validated
properly:

  - 'vcpu_id' shall be less than 'vm->hw.created_vcpus' instead
     of 'MAX_VCPUS_PER_VM'.
  - The state of target vCPU should be "VCPU_PAUSED", and reject
    all other states.

Tracked-On: #4245
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-16 09:44:12 +08:00
Victor Sun 5702619620 HV: kconfig: add range check for memory setting
When user use make menuconfig to configure memory related kconfig items,
we need add range check to avoid compile error or other potential issues:

CONFIG_LOW_RAM_SIZE:(0 ~ 0x10000)
		the value should be less than 64KB;

CONFIG_HV_RAM_SIZE: (0x1000000 ~ 0x10000000)
		the hypervisor RAM size should be supposed between
		16MB to 256MB;

CONFIG_PLATFORM_RAM_SIZE: (0x100000000 ~ 0x4000000000)
		the platform RAM size should be larger than 4GB
		and less than 256GB;

CONFIG_SOS_RAM_SIZE: (0x100000000 ~ 0x4000000000)
		the SOS RAM size should be larger than 4GB
		and less than 256GB;

CONFIG_UOS_RAM_SIZE: (0 ~ 0x2000000000)
		the UOS RAM size should be less than 128GB;

Tracked-On: #4229

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-12-16 09:36:44 +08:00