mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 06:29:19 +00:00
hv:enable gpu iommu except APL platforms
To enable gvt-d,need to allow the GPU IOMMU. While gvt-d hasn't been enabled on APL yet, so let APL disable GPU IOMMU. v2 -> v3: * let APL platforms disable GPU IOMMU. Tracked-On: #4405 Signed-off-by: Junming Liu <junming.liu@intel.com> Reviewed-by: Wu Binbin <binbin.wu@intel.com>
This commit is contained in:
parent
1f1eb7fdba
commit
1303861d26
@ -8,6 +8,7 @@
|
|||||||
#include <logmsg.h>
|
#include <logmsg.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <spinlock.h>
|
#include <spinlock.h>
|
||||||
|
#include <cpu_caps.h>
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
#include "vtd.h"
|
#include "vtd.h"
|
||||||
#include "acpi.h"
|
#include "acpi.h"
|
||||||
@ -204,11 +205,14 @@ handle_one_drhd(struct acpi_dmar_hardware_unit *acpi_drhd,
|
|||||||
|
|
||||||
consumed = handle_dmar_devscope(dev_scope, cp, remaining);
|
consumed = handle_dmar_devscope(dev_scope, cp, remaining);
|
||||||
|
|
||||||
if (((drhd->segment << 16U) |
|
/* Disable GPU IOMMU due to gvt-d hasn’t been enabled on APL yet. */
|
||||||
(dev_scope->bus << 8U) |
|
if (is_apl_platform()) {
|
||||||
dev_scope->devfun) == CONFIG_GPU_SBDF) {
|
if (((drhd->segment << 16U) |
|
||||||
ASSERT(dev_count == 1, "no dedicated iommu for gpu");
|
(dev_scope->bus << 8U) |
|
||||||
drhd->ignore = true;
|
dev_scope->devfun) == CONFIG_GPU_SBDF) {
|
||||||
|
ASSERT(dev_count == 1, "no dedicated iommu for gpu");
|
||||||
|
drhd->ignore = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (consumed <= 0)
|
if (consumed <= 0)
|
||||||
|
@ -113,6 +113,17 @@ static bool is_ctrl_setting_allowed(uint64_t msr_val, uint32_t ctrl)
|
|||||||
return ((((uint32_t)(msr_val >> 32UL)) & ctrl) == ctrl);
|
return ((((uint32_t)(msr_val >> 32UL)) & ctrl) == ctrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_apl_platform(void)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
|
||||||
|
if ((boot_cpu_data.family == 0x6U) && (boot_cpu_data.model == 0x92U)) {
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static void detect_ept_cap(void)
|
static void detect_ept_cap(void)
|
||||||
{
|
{
|
||||||
uint64_t msr_val;
|
uint64_t msr_val;
|
||||||
|
@ -48,6 +48,7 @@ bool is_apicv_advanced_feature_supported(void);
|
|||||||
bool pcpu_has_cap(uint32_t bit);
|
bool pcpu_has_cap(uint32_t bit);
|
||||||
bool pcpu_has_vmx_ept_cap(uint32_t bit_mask);
|
bool pcpu_has_vmx_ept_cap(uint32_t bit_mask);
|
||||||
bool pcpu_has_vmx_vpid_cap(uint32_t bit_mask);
|
bool pcpu_has_vmx_vpid_cap(uint32_t bit_mask);
|
||||||
|
bool is_apl_platform(void);
|
||||||
void init_pcpu_capabilities(void);
|
void init_pcpu_capabilities(void);
|
||||||
void init_pcpu_model_name(void);
|
void init_pcpu_model_name(void);
|
||||||
int32_t detect_hardware_support(void);
|
int32_t detect_hardware_support(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user