Commit Graph

7077 Commits

Author SHA1 Message Date
Hu Fenglin 3545af5f8a doc: ACRN Inter-VM Communication
I. Add three kinds of Inter-VM communication advantage and shortage:
    1. Inter-VM vUART
    2. Inter-VM network communication
    3. Inter-VM shared memory device (ivshmem)
II.Add how to implement an Ivshmem application on ACRN.

Signed-off-by: Hu Fenglin <fenglin.hu@intel.com>
2022-01-12 09:53:15 -08:00
Yonghua Huang 6bf70e3e35 dm: add ssram support for user VM
Hook ssram init && de-init functions to vdev
 devices lifecycle management:

 1) initialize ssram when vdev devices
    are initialized.

 2) de-initialize ssram when vdev devices
    are reset or destroyed.

 notes:
 ssram configuration data can be released only when
 user VM shutdown, hence it can't be done in deinit_vssram().

  - VM reboot:
    do deinit_vssram() only.

  - VM shutdown:
    do both deinit_vssram() and clean_vssram_config().

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang 5ff532b08c dm: add RTCT memory hierarchy entries to vRTCT
Add TCC native memory hierarchy entries  to vRTCT:
   - wrap one function to get TCC RTCT data.
   - Add memory hierarchy entries from TCC
     RTCT to vRTCT.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang 7aae9807b3 dm: add RTCT SSRAM entries from vSSRAM buffers
add all L2 & L3 cache buffers to RTCT entries:
   - SSRAM WAY_MASK entry, cache ways bitmask indicates
     the cache ways used by specific cache buffer.

   -  SSRAM region entry, support format V2 only.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang 216c295cb4 dm: init vRTCT header information
This patch initializes below entries in vRTCT:
  - Hardcode ACPI header
  - Hardcode RTCT compatibility entry, support RTCT v2 only
    for ACRN user VMs.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang 9e68aa759a dm: setup EPT mapping for vSSRAM buffers
Add EPT mapping for all L2 & L3 vSSRAM buffers
  for user VM.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang cb05f26547 dm: prepare vSSRAM buffers
This patch allocates cache buffers from native TCC
 buffer driver and do setup, make them  ready to be
 mapped to ACRN user VMs as software  SRAM regions.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang 904f2bae1f dm: load configurations of TCC SWSRAM
- wrap TCC driver interface to get SSRAM regions count
   and region configuration.

 - add function to load configurations of all SSRAM regions.

 - Add header file to describe TCC data structure.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang bc746b9118 dm: initialize vSSRAM buffers
This patch figures out the guest cache hierarchy:
  - calculate the cache hierarchy parameters, including
    cache thread sharing number and inclusiveness of LLC.

  - define and initialize data structure to describe
    L2 & L3 cache buffers, these buffers will be mapped
    to user VM as ssram regions.

  - add some utility functions.

  - complete the implementation of function
    'create_ssram_rtct_entries()', though most functions
    inside are not implemented yet.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang 28713b3e3e dm: parse bootargs of vssram regions
1) With this patch, '--ssram' option is updated to enable
    vSSRAM feature support for ACRN user VMs.

   '--ssram' argument of Device Model shall follow below format:
	--ssram {Ln,vcpu=vcpu_set,size=nK|M;}
   example:
    --ssram L2,vcpu=0,1,size=4K;L2,vcpu=2,3,size=1M;L3,vcpu=all,size=2M

 2) define data structure and variable
    to store the configuration data for later processing.

 3) add new API to cleanup configuration data when VM shutdown.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang db19e55f8f dm: wrap two functions from init_vssram
Move below logic out of init_vssram():
 - get guest vCPU information
 - vssram GPA space

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang a4490c2ffb dm: remove the dependency on native RTCT for vRTCT init
virtual RTCT will be created on TCC driver interface, instead of
  pass-through native RTCT to ACRN user VMs.

  this patch removes dependency on native RTCT table:
   - rename build_vrtct() function to init_ssram()
     and minor changes inside.
   - drop function create_and_inject_vrtct()
   - add one API to get virtual RTCT table.
   - rename variable 'pt_rtct' to 'ssram'

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang d9fb8f3141 dm: rename some ssram variables and functions
Rename them to unify the coding style or for simplification
  purpose, also remove redundant function declearations
  in pci_core.h header file.

  v4 update:
  SSRAM* -> VSSRAM*
  ssram* -> vssram*

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Yonghua Huang 8c9b9808fa dm: rename ssram source files
guest ssram will be virtualized based on tcc driver interface,
 instead of pass-thru native rtct, rename its source files to
 avoid confusing:

  - rename:
  rtct.c -> vssram.c
  rtct.h -> vssram.h

 - move rtct.c from platform/acpci/ to platform/
 - new directory 'vssram' to hold vssram source files.

Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-10 13:34:27 +08:00
Junjie Mao d96ab7ec90 board_inspector/pcieparser: check config space size of PCIe devices
According to PCIe specification (since 2.0), absence of any extended
capabilities is required to be indicated by an extended capability header
with a capability ID of FFFFh and a next capability offset of 000h. Thus,
the board inspector today accesses the first extended capability header at
100h in the configuration space of a PCIe function unconditionally.

However, in practice we have seen real PCI functions which has a PCIe
capability but no extended capability header. This will cause the board
inspector to crash due to invalid configuration space accesses.

To fix that, this patch adds a check to the size of the configuration space
before walking the extended capabilities of a PCIe function.

Tracked-On: #6411
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2022-01-07 19:32:20 +08:00
Mingqiang Chi 83c0a97fb1 hv: fix clang analyzer deadcode
remove the dead code since the variable is never used.

Tracked-On: #6776
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2022-01-07 13:47:32 +08:00
Hu Fenglin d29a6e08b4 deb-pkg: rename acrn-sos to acrn-service-vm
Rename acrn-sos to acrn-service-vm

Tracked-On: #6688

Signed-off-by: Hu Fenglin <fenglin.hu@intel.com>
2022-01-06 14:41:41 +08:00
Xiangyang Wu 1adbf3293b Misc: acrnd: fix acrnd start failure
Currently, if user starts acrnd service, acrnd service will fail to
find the folder "/sys/kernel/gvt" in Service VM, fail to start.

Root cause is GVT-g is not supported in current ACRN, the folder
"/sys/kernel/gvt" will not be created in Service VM.

This patch updates acrnd service to remove this condition check.

v1-->v2:
	Weston service is optional for ACRN, acrnd should not depend
	on it, so remove weston service dependency in acrnd service.

Tracked-On: #6994
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-01-04 18:47:32 +08:00
Xiangyang Wu 44f6804ad0 Misc: acrnctl: update acrnctl readme
User should make sure acrnd service has been started
before running acrnctl.
This patch add note about this.

v2-->v3:
	Update document about acrnd service enabling.

Tracked-On: #6991
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-01-04 10:58:16 +08:00
Xiangyang Wu 4aeee0bebf Misc: acrnctl: hot fix acrnctl bug
Currently, while there is no running post-launched User VM and
user executes acrnctl command, he or she will get failure and
error message is "/run/acrn/mngr doesn't exist".

Root cause of this failure is acrnctl only check whether the folder
"/run/acrn/mngr" exist or not, if this folder doesn't exist, will
report failure.
acrnd service will create the folder "/run/acrn/mngr", user should
make sure acrnd service is started before using acrnctl

This patch will update log message while the folder "/run/acrn/mngr"
doesn't exist.

v1-->v2:
	Update log message to make it clearer.

Tracked-On: #6991

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-01-04 10:58:16 +08:00
Chenli Wei 93ede38169 dm: remove some dynamic parameters from acrn-dm usage
The following parameters have not used by new design:

1.  --vsbl <vsbl_file_path>
2.  --part_info <part_info_name>
3.  -G, --gvtargs <GVT_args>
4.  -s <slot>,pci-gvt
5.  -Y, --mptgen
6.  -s <slot>,virtio-hdcp
7.  -s <slot>,npk
8.  -s <slot>,virtio-coreu
9.  -i, --ioc_node <ioc_mediator_parameters>
10. --pm_by_vuart [pty|tty],<node_path>
11. --pm_notify_channel <channel>

This patch remove these parameters from usage and comment in code to
explain they are all obsoleted now.

Tracked-On: #6690
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2021-12-29 14:25:50 +08:00
Weiyi Feng d56e241228 config_tools: add cpu_affinity cmdline at scenario set "SCHED_NOOP"
add cpu_affinity cmdline at scenario set "SCHED_NOOP"

Tracked-On: #6961
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-12-23 16:40:42 +08:00
Hu Fenglin 57360ad8d1 deb-pkg: Support hybrid_rt scenario
Debian package adds support for hybrid_rt scenario.

Tracked-On: #6688

Signed-off-by: Hu Fenglin <fenglin.hu@intel.com>
2021-12-23 16:39:21 +08:00
David B. Kinder 27f0d2969a doc: clarify 2.7 release notes
Update description of passthrough device usecase additions, and improved
description of Issue #6631 (Kata broken)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-21 18:13:16 -08:00
wenlingz cba39a1c2f version:2.8-unstable
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2021-12-20 14:24:33 +08:00
Zhao Yakui 39e70b2678 ACRN/DM: Add the ADL-P GPU device_id to support GPU passthrough
Otherwise it will fail to set the GPU opregion/stolen_memory for guest VM in
course of GPU passthrough and the display can't work.

Tracked-On: #6988
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2021-12-17 15:37:40 +08:00
David B. Kinder 7f6f27be00 doc: add v2.7 docs to version menu
Also cleaned out older versions from list, keeping v1.0,
v1.6.1, v2.0, v2.5, and v2.6.

The documentation for previous releases is still available (by editing
the URL to mention that release (e.g., /2.1/ ).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-16 10:12:59 -08:00
David B. Kinder 88f8ab0a45 doc: finalize 2.7 release notes
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-15 20:36:34 -08:00
fuzhongl edbef20c02 Doc: release notes update
Adding the fixed and known issues in release notes.

Signed-off-by: fuzhongl <fuzhong.liu@eintel.com>
2021-12-15 20:25:07 -08:00
fuzhongl 32e853ccf0 Doc: Launch script update for acrn on qemu
To launch User VM, cpu_affinity parameter is needed for v2.7.

Signed-off-by: fuzhongl <fuzhong.liu@eintel.com>
Reviewed-by:   gvancuts <geoffroy.vancutsem@intel.com>
2021-12-15 18:58:04 -08:00
Yang,Yu-chu 29bc085db9 config-tools: remove unused python scripts under scenario_config
Remove following scripts and calling thread:
 - misc/config_tools/scenario_config/ivshmem_cfg_h.py
 - misc/config_tools/scenario_config/pci_dev_c.py
 - misc/config_tools/scenario_config/pt_intx_c.py
 - misc/config_tools/scenario_config/vm_configurations_c.py
 - misc/config_tools/scenario_config/vm_configurations_h.py

Tracked-On: #6962
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-16 10:07:12 +08:00
Reyes, Amy 9b30aa84a8 doc: Add formatting to Supported HW
- Format the HW table to improve look and feel / readability

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2021-12-15 17:39:53 -08:00
jackwhich ad5cf0ea3e doc: update GSG and partitioned documentation
1. Update launch script and replace the apt-get command with apt in GSG documentation.
2. Update the tag to v2.7 in partitioned documentation.

Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-15 13:37:42 -08:00
Reyes, Amy a8ea36318d doc: Supported HW
- Remove outdated information.
- Add new HW table.

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2021-12-15 13:25:31 -08:00
David B. Kinder ae0820760a doc: add CSS color styles
Add some color styles we can use (via .. rst-class:: style directive) to
add color to rst tables.  Also introduce a centered class instead of
using the deprecated .. centered:: directive.  Update documentation
guidelines to describe these new styles (background colors).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-14 16:58:16 -08:00
David B. Kinder 7c8004ab0d doc: fix $disk usage in GSG
The commands in the Getting Started Guide for copying files to and from
the USB stick will fail if the USB stick volume name has a space in it.
Fix this by quoting uses of $disk.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-14 10:42:42 -08:00
David B. Kinder 60097affd3 doc: update 2.7 release notes
Fix errors in description of changes.
Add mention of SOS -> Service_VM change in config options/values.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-13 21:27:13 -08:00
Yifan Liu 82778ccc9b hv_prebuild: Support LAPIC-PT only VM
Currently in sanitize_vm_config, all LAPIC-PT VM are treated as RTVM,
which can be relaxed: LAPIC PT VM does not have to be RTVM.

Change the logic in sanitize_vm_config to support this relaxation.

Tracked-On: #6968
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-14 09:55:02 +08:00
Xiangyang Wu 4f034c99a2 doc: remove suspend and resume command from acrnctl
Currently, the command "acrnctl suspend" and "acrnctl resume"
is not used by user. This patch removes related code.

Tracked-On: #5921
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-14 09:52:31 +08:00
Xiangyang Wu 982d1565d5 Misc: acrnctl: remove suspend and resume command from acrnctl
Currently, the command "acrnctl suspend" and "acrnctl resume"
is not used by user. This patch removes related code.

v1-->v2:
	Remove vm_suspend.

Tracked-On: #5921
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-14 09:52:31 +08:00
Yonghua Huang a778a0da00 doc: update 'asa.rst' for 2.7 release
Update security advisory 2.7 release.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-12-13 09:55:27 -08:00
Xiangyang Wu 097afee832 doc: add note about SRIOV disable
Currently, Service VM may fail to shut down due to some enabled
VFs. ACRN doesn't disable VFs automatically.

In this patch, add a note for user to disable VFs before Service
VM shuts down.

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-12-13 09:38:23 -08:00
Yuanyuan Zhao 8f114d82af hv: rename CONFIG_IOMMU_BUS_NUM
Rename `CONFIG_IOMMU_BUS_NUM` to `ACFG_MAX_PCI_BUS_NUM`. Configure tool
will calculate `ACFG_MAX_PCI_BUS_NUM` base on the max pci num which is
used by VF. So user needn't care about `ACFG_MAX_PCI_BUS_NUM`, and memory
will be used resonable.

Tracked-On: #6942
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-13 11:06:10 +08:00
Yang,Yu-chu ae998f157e config-tools: generate ACFG_MAX_PCI_BUS_NUM based on board.xml
Extract the max pci bus number from board information and generate the
common configuration macro ACFG_MAX_PCI_BUS_NUM automatically.

Tracked-On: #6942
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-12-13 11:06:10 +08:00
Mingqiang Chi 3555aae4ac hv:remove 2 bits vmx capability check
remove is_valid_xsave_combination api,
assume the hardware or QEMU can guarantee that support
XSAVE on CPU side and XSAVE_XRSTR on VMX side or not.
will add offline-tool in QEMU platform to avoid the user
use wrong XSAVE configurations.
remov check VMX_PROCBASED_CTLS2_XSVE_XRSTR based on the above reason.
for VMX_PROCBASED_CTLS2_PAUSE_LOOP, now it will panic
if run ACRN over QEMU, here remove it from essential check,
and it will print error information when set this bit
if there is no the hardware capability.

v1-v2:
  remove is_valid_xsave_combination

Tracked-On: #6584
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-13 08:52:52 +08:00
Yifan Liu 5c9456462b hv && config-tool: Add compilation option to disable all interrupts in HV
This patch adds an option CONFIG_KEEP_IRQ_DISABLED to hv (default n) and
config-tool so that when this option is 'y', all interrupts in hv root
mode will be permanently disabled.

With this option to be 'y', all interrupts received in root mode will be
handled in external interrupt vmexit after next VM entry. The postpone
latency is negligible. This new configuration is a requirement from x86
TEE's secure/non-secure interrupt flow support. Many race conditions can be
avoided when keeping IRQ off.

v5:
Rename CONFIG_ACRN_KEEP_IRQ_DISABLED to CONFIG_KEEP_IRQ_DISABLED

v4:
Change CPU_IRQ_ENABLE/DISABLE to
CPU_IRQ_ENABLE_ON_CONFIG/DISABLE_ON_CONFIG and guard them using
CONFIG_ACRN_KEEP_IRQ_DISABLED

v3:
CONFIG_ACRN_DISABLE_INTERRUPT -> CONFIG_ACRN_KEEP_IRQ_DISABLED
Add more comment in commit message

Tracked-On: #6571
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-10 09:50:17 +08:00
Jie Deng 2fab18a6d6 hv: tee: avoid halt in REE bootargs
"idle=halt " should be avoided in REE since we have to
keep the interrupt always masked in root mode.

Tracked-On: #6571
Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-09 10:47:16 +08:00
Yifan Liu fa6b55db68 hv: tee: Handling x86_tee secure interrupts corner cases
Previous upstreamed patches handles the secure/non-secure interrupts in
handle_x86_tee_int. However there is a corner case in which there might
be unhandled secure interrupts (in a very short time window) when TEE
yields vCPU. For this case we always make sure that no secure interrupts
are pending in TEE's vlapic before scheduling REE.

Also in previous patches, if non-secure interrupt comes when TEE is
handling its secure interrupts, hypervisor injects a predefined vector
into TEE's vlapic. TEE does not consume this vector in secure interrupt
handling routine so it stays in vIRR, but it should be cleared because the
actual interrupt will be consumed in REE after VM Entry.

v3:
    Fix comments on interrupt priority

v2:
    Add comments explaining the priority of secure/non-secure interrupts

Tracked-On: #6571
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-09 10:47:16 +08:00
Yifan Liu fd7ab300a8 hv: tee: Rename TEE_NOTIFICATION_VECTOR to TEE_FIXED_NONSECURE_VECTOR
The TEE_NOTIFICATION_VECTOR can sometimes be confused with TEE's PI
notification vector. So rename it to TEE_FIXED_NONSECURE_VECTOR for
better readability.

No logic change.

v3:
Add more comments in commit message.

Tracked-On: #6571
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-09 10:47:16 +08:00
Yifan Liu 702a71639f hv: Add two vlapic APIs
Sometimes HV would like to know if there are specific interrupt
pending in vIRR, and clears them if necessary (such as in x86_tee case).

This patch adds two APIs: get_next_pending_intr and clear_pending_intr.
This patch also moves the inline api prio() from
vlapic.c to vlapic.h

v3:
    Remove apicv_get_next_pending_intr and apicv_clear_pending_intr
    and use vlapic_get_next_pending_intr and vlapic_clear_pending_intr
    directly.

v2:
    get_pending_intr -> get_next_pending_intr
    apicv_basic/advanced_clear_pending_intr -> apicv_clear_pending_intr
    apicv_basic/advanced_get_pending_intr -> apicv_get_next_pending_intr
    has_pending_intr kept

Tracked-On: #6571
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-09 10:47:16 +08:00