hv: add function to check if using posted interrupt is possible for vm

Add platform_caps.c to maintain platform related information

Set platform_caps.pi to true if all iommus are posted interrupt capable, false
otherwise

If lapic passthru is not configured and platform_caps.pi is true, the vm
may be able to use posted interrupt for a ptdev, if the ptdev's IRQ is
single-destination

Tracked-On: #4506
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@Intel.com>
This commit is contained in:
dongshen
2020-03-18 15:41:50 -07:00
committed by wenlingz
parent 47f883db30
commit 6496da7c56
6 changed files with 50 additions and 0 deletions

View File

@@ -263,6 +263,7 @@ void vrtc_init(struct acrn_vm *vm);
bool is_lapic_pt_configured(const struct acrn_vm *vm);
bool is_rt_vm(const struct acrn_vm *vm);
bool is_pi_capable(const struct acrn_vm *vm);
bool has_rt_vm(void);
bool is_highest_severity_vm(const struct acrn_vm *vm);
bool vm_hide_mtrr(const struct acrn_vm *vm);

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2020 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef PLATFORM_CAPS_H
#define PLATFORM_CAPS_H
struct platform_caps_x86 {
/* true if posted interrupt is supported by all IOMMUs */
bool pi;
};
extern struct platform_caps_x86 platform_caps;
#endif /* PLATFORM_CAPS_H */