Commit Graph

5480 Commits

Author SHA1 Message Date
fuzhongl 5409d14e08 acrn-config: update TGL platform and SOS RAM size
The default memory is 16G on TGL; the value of PLATFORM_RAM_SIZE and
SOS_RAM_SIZE is a little small in default xml.

Tracked-On: #5184
Reviewed-by: Victor Sun  <victor.sun@intel.com>
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2020-08-20 10:06:31 +08:00
Li Fei1 7b38829576 doc: update document for "--acpidev_pt" and "--mmiodev_pt" features
Add guild how to add ACPI device and MMIO device passthrough support through
the cmdline.

Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-08-19 15:52:02 -07:00
Shiqing Gao 24b89eb8c4 doc: update coding guidelines
- add a rule for pointer arithmetic operation
 - add a rule about ABI conformance
 - update GCC reference

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2020-08-19 15:49:35 -07:00
Yuan Liu f60896951b hv: change log level for find_match_mmio_node
Replace pr_fatal with pr_info to reduce printing logs

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Yuan Liu 43683c7fc9 hv: implement ivshmem device-specific registers emulation
Ivshmem device defines four registers including Interrupt Mask, Interrupt
Status, IVPostion and Doorbell. The first two are useless and no emulation
is required. The latter two are used for interrupts and will be implemented
in the future.

This patch also introduces a new priv_data member for structure pci_vdev,
it can be used to find an ivshmem device through pci_vdev.

v2: refine code style

v3: 1) add @pre for ivshmem_mmio_handler function
    2) refine code style

v4: 1) set ivshmem registers default value when vBAR mapping
    2) change find_ivshmem_device to set_ivshmem_device

v5: 1) change set_ivshmem_device to find_and_set_ivshmem_device
    2) add a ASSERT to check if the vdev->priv_data is set successfully

v6: change find_and_set_ivshmem_device to create_ivshmem_device

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Yuan Liu b6661e48d8 hv: implement configuration space operations of ivshmem device
Implement read_vdev_cfg/write_vdev_cfg operations for ivshmem deivce

v2: read_vdev_cfg/write_vdev_cfg always return zero, the ivshmem device
    only emulated in HV.

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Yuan Liu 0f5ccab68e hv: code cleanup for vBAR writing
This patch introduces vpci_update_one_vbar API to simplify
vBAR mapping/unmapping when vBAR writing.

v2: refine commit message

v4: refine commit message

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Yuan Liu 24fe34630d hv: initialize BARs of ivshmem device
ivshmem device supports two BARs, BAR 0 is used for inter-VM
notification mechanism, BAR 2 is used to provide shared memory
base address and size.

v4: check if the return value of get_shm_region function is NULL

v5: 1) change get_shm_region to find_shm_region
    2) add print log when ivshmem device doesn't find memory region

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Shuang Zheng c26ae8c420 hv: Inter-VM communication config for hybrid_rt on whl-ipc-i5
add an IVSHMEM regoin and the related configuration parameters in
hybrid_rt scenario on whl-ipc-i5. The size of the shared memory is
2M, and it is used for the communication between VM0 and VM2.

v6: rename shm name; remove unnecessary MACROs.

v7: rename MACRO for shm name; add unassigned vbdf for post-launched
    VMs.

Tracked-On: #4853

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Yuan Liu 92f9f5a4f3 hv: add ivshmem device
Ivshmem device is used for shared memory based communication between
pre-launched/post-launched VMs.

this patch implements ivshmem device configuration space initialization
and ivshmem device operation methods.

v2: introduce init_one_pcibar interface to simplify BAR initialization
    operation of HV emulated PCI device.

v3: 1) due to init_one_pcibar API is only used for pre-launched VM vdevs
       it can't be applied to all vdevs, so remove it.
    2) move ivshmem BARs initialization to subsequent patch, this patch
       only introduce ivshmem configuration space initialization.

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Yuan Liu d6f563c4eb hv: implement ivshmem memory regions initialization
The ivshmem memory regions use the memory of the hypervisor and
they are continuous and page aligned.

this patch is used to initialize each memory region hpa.

v2: 1) if CONFIG_IVSHMEM_SHARED_MEMORY_ENABLED is not defined, the
       entire code of ivshmem will not be compiled.
    2) change ivshmem shared memory unit from byte to page to avoid
       misconfiguration.
    3) add ivshmem configuration and vm configuration references

v3: 1) change CONFIG_IVSHMEM_SHARED_MEMORY_ENABLED to CONFIG_IVSHMEM_ENABLED
    2) remove the ivshmem configuration sample, offline tool provides default
       ivshmem configuration.
    3) refine code style.

v4: 1) make ivshmem_base 2M aligned.

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-19 15:06:15 +08:00
Wei Liu 088cd62d8b HV: sync hv reference code that generated by config tool
Sync hv reference code that generated by acrn-config tool.

Tracked-On: #5092
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-08-17 14:34:30 +08:00
Wei Liu 01362c3cd1 acrn-config: fix build issue while CDP_ENABLED=y
Fix build issue while CDP_ENABLED=y for EHL-CRB-B.

Tracked-On: #5092
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-08-17 14:34:30 +08:00
Junming Liu 23d9c13c41 hv:cpuid:refine cpuid_subleaf interface
There's a corner case:
When want to get CPUID.01H:EDX value,
may have the following code snippet:

uint32_t unused,edx;
cpuid_subleaf(0x1U, 0x0U, &unused, &unused, &unused, &edx);

while in cpuid_subleaf:
*eax = leaf;
*ecx = subleaf;
eax and ecx point to the same location,
When deep into asm_cpuid, it's input value will be 0x0U and 0x0U.
but the expected input value is 0x1U and 0x0U.

This case will return CPUID.00H:EDX, which is the wrong answer.

Tracked-On: #4526

Signed-off-by: Junming Liu <junming.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-17 10:14:00 +08:00
fuzhongl 5e07e99dcc MISC: Update HV and SOS ramsize in TGL xml
The default memory is 16G on TGL; the value of HV and sos
ramsize is a little small in default xml.

Tracked-On: # 5184
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2020-08-14 14:54:53 +08:00
Junming Liu 3631a85c3c hv:cpu-caps:refine is_apl_platform func and clean up duplicated code
Fix the bug for "is_apl_platform" func.
"monitor_cap_buggy" is identical to "is_apl_platform", so remove it.

On apl platform:
1) ACRN doesn't use monitor/mwait instructions
2) ACRN disable GPU IOMMU

Tracked-On:#3675

Signed-off-by: Junming Liu <junming.liu@intel.com>
2020-08-14 10:08:50 +08:00
liujunming 538e7cf74d hv:cpu-caps:refine processor family and model info
v3 -> v4:
Refine commit message and code stype

1.
SDM Vol. 2A 3-211 states DisplayFamily = Extended_Family_ID + Family_ID
when Family_ID == 0FH.
So it should be family += ((eax >> 20U) & 0xffU) when Family_ID == 0FH.

2.
IF (Family_ID = 06H or Family_ID = 0FH)
	THEN DisplayModel = (Extended_Model_ID « 4) + Model_ID;
While previous code this logic:
IF (DisplayFamily = 06H or DisplayFamily = 0FH)

Fix the bug about calculation of display family and
display model according to SDM definition.

3. use variable name to distinguish Family ID/Display Family/Model ID/Display Model,
then the code is more clear to avoid some mistake

Tracked-On:#3675

Signed-off-by: liujunming <junming.liu@intel.com>
Reviewed-by: Wu Xiangyang <xiangyang.wu@linux.intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-14 10:08:50 +08:00
Victor Sun 05a083c944 HV: comment SOS_VM as VMx in vm_configurations.h
Add a comment for SOS_VM to indicate its VM ID for better understanding;

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-13 13:48:17 +08:00
lirui34 b04fba2db5 acrn-config: set CONFIG_MAX_MSIX_TABLE_NUM to 16 in the qemu sdc xml
when CONFIG_MAX_MSIX_TABLE_NUM was set to 64, it will trigger timeout ASSERT
on WHL-I5 board.

Tracked-On: #5178

Signed-off-by: lirui34 <ruix.li@intel.com>
2020-08-13 09:34:01 +08:00
Long Liu ab522e7517 DM: xHCI: Extend the max Native Bus number
Extend the max native USB bus number to 5. After IceLake platform, there
has 2 physical xHCI controllers in the SOC which involves 4 USB buses.

Tracked-On: #5172
Signed-off-by: Long Liu <long.liu@intel.com>
Acked-by: Yu Wang yu1.wang@intel.com
2020-08-12 10:39:41 +08:00
Victor Sun b5dfe369da HV: move vm configuration check to pre-build time
This patch will move the VM configuration check to pre-build stage,
a test program will do the check for pre-defined VM configuration
data before making hypervisor binary. If test failed, the make
process will be aborted. So once the hypervisor binary is built
successfully or start to run, it means the VM configuration has
been sanitized.

The patch did not add any new VM configuration check function,
it just port the original sanitize_vm_config() function from cpu.c
to static_checks.c with below change:
  1. remove runtime rdt detection for clos check;
  2. replace pr_err() from logmsg.h with printf() from stdio.h;
  3. replace runtime call get_pcpu_nums() in ALL_CPUS_MASK macro
     with static defined MAX_PCPU_NUM;
  4. remove cpu_affinity check since pre-launched VM might share
     pcpu with SOS VM;

The BOARD/SCENARIO parameter check and configuration folder check is
also moved to prebuild Makefile.

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-12 10:21:17 +08:00
Victor Sun 8245145317 HV: remove sanitize_vm_config function
Remove function of sanitize_vm_config() since the processing of sanitizing
will be moved to pre-build process.

When hypervisor has booted, we assume all VM configurations is sanitized;

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-12 10:21:17 +08:00
wenlingz 7d0d750e0b version:2.2
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2020-08-11 09:17:32 +08:00
David B. Kinder 84601935a1 doc: use consistent month names in release notes
Some months were spelled out, others were abbreviated, making the list
of all release notes look a bit off.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-10 16:15:46 -07:00
Wei Liu e2a5c56840 Makefile: modify the realpath to abspath function
realpath function would be got null while the directory or file is
not exist, modify the function abspath to instead realpath.

Tracked-On: #5146
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-08-08 17:07:48 +08:00
David B. Kinder ba3b8e58a1 doc: add v2.1 to doc version menu
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-07 17:50:36 -07:00
David B. Kinder 7404fb08ff doc: update release notes about LAPIC timer in OVMF
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-07 14:43:36 -07:00
David B. Kinder 21893b3335 doc: fix mismatched ACRN version
Document was updated to use v2.1 but left a references to v1.6

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-07 09:07:16 -07:00
Yonghua Huang c56fb35515 doc: update security advisory for v2.1 release
Add fixed security vulnerabilities for v2.1 release.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-07 08:35:44 -07:00
guoqingxz 98aaf23f5c doc: add known issue:5157 for building-from-source.rst
build with XML file, "TARGET_DIR=xxx" does not work

Signed-off-by: guoqingxz <guoqingx.q.zhang@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-07 08:23:25 -07:00
fuzhongl 3f7b6853ff Doc:release_notes_2.1 update
Add fixed issues and known issues.

Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-07 08:11:09 -07:00
David B. Kinder 99c855dd63 doc: use kbd consistently and fix misspellings
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-06 16:40:53 -07:00
Tao Yuhong 92f7a8a6a7 Doc: update user guide for Pre-Launched RT mode
The Release_2.1 use multiboot2, so update the example

Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2020-08-06 10:44:05 -07:00
Xiaoguang Wu 116c7f7823 doc: remove invalid kernel parameters for gvt-g
After change to IDV display solution for gvt-g, the kernel parameters:
i915.domain_plane_owners, i915.domain_plane_owners and i915.enable_pvmmio
related instruction is invalid and should be removed.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
2020-08-06 08:59:38 -07:00
David B. Kinder f788d2746f doc: draft v2.1 release notes
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-06 08:56:26 -07:00
David B. Kinder 76e0461caa doc: fix more references to hypervisor folders
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-05 14:22:01 -07:00
David B. Kinder 97603adb0a doc: fix references to misc/vm_configs folder
As noticed in PR #5134 scenario configurations were moved out of the
hypervisor folder over to the misc folder (within the acrn-hypervisor
repo).  Fix references and make them all consistent (referencing
misc/vm_configs)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-05 13:39:31 -07:00
fuzhongl 2a8a1e4464 Doc: Update Using GRUB to boot ACRN
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2020-08-05 10:04:48 -07:00
Mingqiang Chi a67a85c70d hv:refine vm & vcpu lock
-- move vm_state_lock to other place in vm structure
   to avoid the memory waste because of the page-aligned.
-- remove the memset from create_vm
-- explicitly set max_emul_mmio_regions and vcpuid_entry_nr to 0
   inside create_vm to avoid use without initialization.
-- rename max_emul_mmio_regions to nr_emul_mmio_regions
v1->v2:
   add deinit_emul_io in shutdown_vm

Tracked-On: #4958
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Grandhi, Sainath <sainath.grandhi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-05 13:39:28 +08:00
fuzhongl 19f8cc9af3 Doc:Update Logical Partition Getting Started Guide
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-08-04 09:55:06 -07:00
Victor Sun c6a28daebc doc: update vm configuration related path
After vm configurations moved to acrn-hypervisor/misc/vm_configs,
some documents need to be updated.

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-08-04 09:26:26 -07:00
fuzhongl aabcf94ebf Doc: Getting Started Guide Update for hybrid mode
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2020-08-03 18:22:45 -07:00
Victor Sun af9867f4cc Makefile: fix issue on make menuconfig
The BOARD/SCENARIO envrionment variable should be passed in one shell command;

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-08-04 09:05:29 +08:00
Victor Sun 3cd5abe5ac acrn-config: add cpu_affinity for SOS VM
Add cpu_affinity setup for SOS VM. Cpu affinity must be set in
scenario XML, except if no pre-launched VM on the scenario and
all pCPUs will be assigned to SOS VM in that case;

Tracked-On: #5077
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-08-04 09:05:29 +08:00
Victor Sun b9ad04d24d HV: add cpu affinity info for SOS VM
Previously the CPU affinity of SOS VM is initialized at runtime during
sanitize_vm_config() stage, follow the policy that all physical CPUs
except ocuppied by Pre-launched VMs are all belong to SOS_VM. Now change
the process that SOS CPU affinity should be initialized at build time
and has the assumption that its validity is guarenteed before runtime.

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-04 09:05:29 +08:00
Victor Sun 3acafd140f HV: Make: simplify acpi info header file check
Previously we have complicated check mechanism on platform_acpi_info.h which
is supposed to be generated by acrn-config tool, but given the reality that
all configurations should be generated by acrn-config before build acrn
hypervisor, this check is not needed anymore.

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-04 09:05:29 +08:00
Victor Sun 07ad37f436 HV: Make: remove sdc scenario build support
The SDC scenario configurations will not be validated so remove it from
build makefile;

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-04 09:05:29 +08:00
Victor Sun 8f0b0472f6 HV: correct RO mask of MSI cap structure
In MSI Capability Structure, bit 7 (64 bit address capable) of MSICTRL
is RO;

Tracked-On: #5125

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Li Fei <fei1.li@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-08-03 13:40:27 +08:00
Wei Liu 1ed214015c HV: set guest flag value for logical partition
Set guest flag value for logical partition.

Tracked-On: #5119
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-08-03 08:36:56 +08:00
Wei Liu 922696de7e acrn-config: remove RT guest flag configuration
Remove RT guest flags from logical partition
configuration.

Tracked-On: #5119
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2020-08-03 08:36:56 +08:00