From 1ae95546c85fa83a06fbdaae5f677b345344f24d Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Tue, 6 Apr 2021 14:36:44 +0200 Subject: [PATCH] drivers/interrupt_controller: Add a VT-D option to disable src id check Theoretically, source id check is not mandatory in the context we use VT-D here (i.e. non VM one, just multi-vector MSI support) Signed-off-by: Tomasz Bursztyka --- drivers/interrupt_controller/Kconfig.intel_vtd | 5 +++++ drivers/interrupt_controller/intc_intel_vtd.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/interrupt_controller/Kconfig.intel_vtd b/drivers/interrupt_controller/Kconfig.intel_vtd index 124b8f4c1ef..3565942dcdd 100644 --- a/drivers/interrupt_controller/Kconfig.intel_vtd +++ b/drivers/interrupt_controller/Kconfig.intel_vtd @@ -22,6 +22,11 @@ config INTEL_VTD_ICTL_XAPIC_PASSTHROUGH help If XAPIC mode is enabled, it will avoid remapping all interrupts. +config INTEL_VTD_ICTL_NO_SRC_ID_CHECK + bool "Never check the source id" + help + Disable the source id check in IRTE. + config INTEL_VTD_ICTL_INIT_PRIORITY int "Initialization priority" default 40 diff --git a/drivers/interrupt_controller/intc_intel_vtd.c b/drivers/interrupt_controller/intc_intel_vtd.c index 772251d0fcd..90481468811 100644 --- a/drivers/interrupt_controller/intc_intel_vtd.c +++ b/drivers/interrupt_controller/intc_intel_vtd.c @@ -363,7 +363,8 @@ static int vtd_ictl_remap(const struct device *dev, irte.bits.dst_id = 0xFF << 8; } - if (src_id != USHRT_MAX) { + if (src_id != USHRT_MAX && + !IS_ENABLED(CONFIG_INTEL_VTD_ICTL_NO_SRC_ID_CHECK)) { irte.bits.src_validation_type = 1; irte.bits.src_id = src_id; }