Commit Graph

5256 Commits

Author SHA1 Message Date
Li Fei1
805f103d1a dm: rb: only free rb_entry when we remove this entry from the rb tree
Only free rb_entry when we remove this entry from the rb tree, otherwise, a
page fault would trigger when next rb itreation would access the freed rb_entry.

Tracked-On: #6056
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2021-07-02 09:47:01 +08:00
Jie Deng
cf90f060c1 dm: NULL check of vq->used in virtio_net_ping_rxq
Add a check on this place to avoid NULL access issue.

Tracked-On: #6100
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-07-02 09:47:01 +08:00
Yin Fengwei
e301c61fb3 hv: ptirq: Shouldn't change sid if intx irq mapping was added
Now, we use hash table to maintain intx irq mapping by using
the key generated from sid. So once the entry is added,we can
not update source ide any more. Otherwise, we can't locate the
entry with the key generated from new source ide.

For source id change, remove_remapping/add_remapping is used
instead of update source id directly if entry was added already.

Tracked-On: #5640
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-01-20 11:23:17 +08:00
Sun Peng
54b8d4b43d dm: uart: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
e8d52d46bf dm: blockif: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
ebca2d5ac1 dm: ioc: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
2807487273 dm: timer: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
a692df46c1 dm: tpm: Convert print output to acrn-dm logger
Refine the DPRINTF/WPRINTF to pr_* based log interface for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
57dd678632 dm: rbmp: Convert print output to acrn-dm logger
Refine the DPRINTF/WPRINTF to pr_* based log interface for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
1dee884654 dm: usb: Convert print output to acrn-dm logger
Refine the UPRINTF to pr_* based log interface for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
e8ab23d648 dm: pci_passthrough: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
abdab52c63 dm: npk: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
3f0fe0765c dm: gvt: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
549e3c74b6 dm: gsi: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
fa668ac010 dm: pci_core: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
8c73798f25 dm: ahci: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
0e19d132ff dm: virtio: Convert console print output to acrn-dm logger
Refine the DPRINTF/WPRINTF to pr_* based log interface instead of printf directly.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Sun Peng
71c36f19d1 dm: core: Convert print output to acrn-dm logger
Unifies the logs to pr_* interfaces instead of printf for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-09-18 16:33:40 +08:00
Minggui Cao
25fff0c21a add flag to control vmexit sample in HV bootargs
for vmexit data sampling could affect HV performace profiling,
so set it disabled by default.

add a flag in HV bootargs to control vmexit data sampling.

Tracked-On: #5232
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2020-08-26 16:55:27 +08:00
Minggui Cao
ea2650918b sample vmexit data per-pCPU and per-vCPU
this feature is used to sample vmexit data as per physical CPU
and per virutal CPU of VM, command used in HV console as following:
  1. vmexit clear --> to clear current vmexit buffer
  2. vmexit -->output current vmexit info

also it gives the reschedule data as per-pcpu.

Tracked-On: #5232
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2020-08-26 16:55:27 +08:00
Victor Sun
978f899029 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;

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 15:24:42 +08:00
Victor Sun
070ac3c265 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 15:24:42 +08:00
Victor Sun
e7d0c20709 HV: init vcpu affinity of SOS VM when launch VMs
Previously the initialization of SOS vCPUs is done by sanitize_vm_config()
before call launch_vms(), once sanitize_vm_config() is moved to pre-build,
we need to do the initialization in launch_vms();

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 15:24:42 +08:00
Junming Liu
731e9182d6 DM: PT: Add "d3hot_reset" sub-parameter for passthrough device
Some passthrough devices have no reset mechanisms which cause the device stay
in unknown status during boot/reboot flow. And such unknown status cause
unexpected behaviors in the guest. Except the ordinary reset mechanisms
like FLR, we can utilize enter/exit D3cold as the reset that D3cold will
power gate the entire hardware. But the D3cold is implemented as ACPI
method which has no user interface in the SOS side. But the D3cold is
implemented as ACPI method which has no user interface in the SOS side.
But base on our experience, some devices can utilize D3hot instead of
D3cold. But it is not useful for all PCI devices as the power status
of D3hot is implementation defined.
Provide one new API to program PowerState(D0/D1/D2/D3hot) in PMCSR
register.
Add "d3hot_reset" sub-parameter for passthrough device to enable utilize
enter/exit D3hot flow to implement reset mechanisms.

Tracked-On: #5067

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-08-11 16:07:44 +08:00
Xiaoguang Wu
607a4221ac hv: fix stos and stosq asm instruction emulation error
This patch is used to fix asm instruction error such as stos and stosq.

Tracked-On: #5165
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
2020-08-11 14:18:27 +08:00
Binbin Wu
b1cbe39164 config: add GUEST_FLAG_PMU_PASSTHROUGH to DM_OWNED_GUEST_FLAG_MASK
Allow DM to set GUEST_FLAG_PMU_PASSTHROUGH to passthrough PMU to
a VM.

Tracked-On: #5132
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2020-08-06 14:03:55 +08:00
Binbin Wu
08c079693f dm: vm: add option to enable pmu passthrough
Add "--pmu" to enable PMU passthrough.

Tracked-On: #5132
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2020-08-06 14:03:55 +08:00
Binbin Wu
547428021a hv: pmu: passthrough pmu to vm when GUEST_FLAG_PMU_PASSTHROUGH set
Add a new guest_flag GUEST_FLAG_PMU_PASSTHROUGH to indicate whether to
passthrough Performance Monitor Unit (PMU) to a VM or not.
If GUEST_FLAG_PMU_PASSTHROUGH is set for a VM, passthrough PMU.

Currently, PEBS is not supported.

Tracked-On: #5132
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2020-08-06 14:03:55 +08:00
Victor Sun
77775c9297 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-05 13:38:15 +08:00
Wei Liu
8570ff71ba acrn-config: refine mac seed for launch config
Refine mac seed when generating launch script.

Tracked-On: #5039
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-07-23 11:31:02 +08:00
Wei Liu
69af2f4be7 acrn-config: generate '-s 1:0,lpc ' for non-hart rt in launch script
Generate '-s 1:0,lpc ' for none Hart RT in launch script.

Tracked-On: #5049
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-07-20 09:55:20 +08:00
Wei Liu
64896ac982 acrn-config: minor fix mac seed for launch config
Minor fix for mac seed when generating launch script.

Tracked-On: #5039
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-07-16 11:38:07 +08:00
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