On x86, Redirection Hint is only supported in physical Destination Mode,
and otherwise should be ignored.
This enables to use some hardware which sets DM 0/RH 1.
Signed-off-by: Veaceslav Falico <
vfa...@gmail.com>
---
Notes:
This goes in line with:
https://software.intel.com/en-us/forums/topic/288883
official intel response, last comment
https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg04949.html
QEMU implementation
Also, it finally permits to use my network card in
non-root-cell - as it seems to provide garbage in RH.
hypervisor/arch/x86/apic.c | 3 +--
hypervisor/arch/x86/vtd.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/hypervisor/arch/x86/apic.c b/hypervisor/arch/x86/apic.c
index d3b4211..9556538 100644
--- a/hypervisor/arch/x86/apic.c
+++ b/hypervisor/arch/x86/apic.c
@@ -237,8 +237,7 @@ bool apic_filter_irq_dest(struct cell *cell, struct apic_irq_message *irq_msg)
if (dest != irq_msg->destination && cell != &root_cell)
return false;
irq_msg->destination = dest;
- } else if (dest > APIC_MAX_PHYS_ID ||
- !cell_owns_cpu(cell, apic_to_cpu_id[dest])) {
+ } else if (dest > APIC_MAX_PHYS_ID) {
return false;
}
return true;
diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c
index db43d46..d469634 100644
--- a/hypervisor/arch/x86/vtd.c
+++ b/hypervisor/arch/x86/vtd.c
@@ -871,9 +871,8 @@ int iommu_map_interrupt(struct cell *cell, u16 device_id, unsigned int vector,
* Note that we do support redirection hint only in logical
* destination mode.
*/
- if ((irq_msg.delivery_mode != APIC_MSG_DLVR_FIXED &&
- irq_msg.delivery_mode != APIC_MSG_DLVR_LOWPRI) ||
- irq_msg.dest_logical != irq_msg.redir_hint)
+ if (irq_msg.delivery_mode != APIC_MSG_DLVR_FIXED &&
+ irq_msg.delivery_mode != APIC_MSG_DLVR_LOWPRI)
return -EINVAL;
if (!apic_filter_irq_dest(cell, &irq_msg))
return -EPERM;
--
2.4.3