hv: vtd: add an API to reserve continuous irtes

dmar_reserve_irte is added to reserve N coutinuous IRTEs.
N could be 1, 2, 4, 8, 16, or 32.

The reserved IRTEs will not be freed.

Tracked-On:#4831
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Binbin Wu
2020-05-29 23:35:36 +08:00
committed by wenlingz
parent 7bfcc673a6
commit da1788c9a3
2 changed files with 42 additions and 0 deletions

View File

@@ -671,6 +671,21 @@ void resume_iommu(void);
*/
int32_t init_iommu(void);
/**
* @brief Reserve num continuous IRTEs.
*
* @param[in] intr_src filled with type of interrupt source and the source
* @param[in] num number of IRTEs to reserve
* @param[out] start_id stard index of reserved IRTEs, caller should check the value is INVALID_IRTE_ID or not.
*
* @retval 0 on success, caller should check whether the returned start index is valid or not.
* @retval -EINVAL if corresponding DMAR is not preset.
*
* @pre num can only be 2, 4, 8, 16 or 32
*
*/
int32_t dmar_reserve_irte(const struct intr_source *intr_src, uint16_t num, uint16_t *start_id);
/**
* @brief Assign RTE for Interrupt Remapping Table.
*