diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-09-07 08:46:03 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-09-07 08:46:03 +0100 |
commit | 5c53154b6190af523ec097dbb76c41685052dddd (patch) | |
tree | 8c1fccceda1bec3eb81f75400c5b6beab784a809 /xen/arch/x86/msi.c | |
parent | cda2f6c76132090176f4b88c84917861c21bd21c (diff) | |
download | xen-5c53154b6190af523ec097dbb76c41685052dddd.tar.gz xen-5c53154b6190af523ec097dbb76c41685052dddd.tar.bz2 xen-5c53154b6190af523ec097dbb76c41685052dddd.zip |
vt-d: use 32-bit Destination ID when Interrupt Remapping with EIM is
enabled
When x2APIC and Interrupt Remapping(IR) with EIM are enabled, we
should use 32-bit Destination ID for IOAPIC and MSI.
We implemented the IR support in xen by hooking the functions like
io_apic_write(),io_apic_modify(), write_msi_message(), and as a
result, in the hook functions in intremap.c, we can only see the 8-bit
dest id rather the 32-bit id, so we can't set IR table Entry that
requires a 32-bit dest id.
To solve the issue throughly, we need find every place in io_apic.c
and msi.c that could write ioapic RTE and and device's msi message and
explicitly handle the 32-bit dest id carefully (namely, when genapic
is x2apic, cpu_mask_to_apic could return a 32-bit value); and we have
to change the iommu_ops->{.update_ire_from_apic, .update_ire_from_msi}
interfaces. We may have to write an over-1000-LOC patch for this.
Instead, we could use a workround:
1) for ioapic, in the struct IO_APIC_route_entry, we could use a new
"dest32" to refer to the dest field;
2) for msi, in the struct msi_msg, we could add a new "u32 dest".
And in intremap.c, if x2apic_enabled, we use the new names to refer to
the dest fields.
We can improve this in future.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'xen/arch/x86/msi.c')
-rw-r--r-- | xen/arch/x86/msi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c index 0c7c4662ff..261da58185 100644 --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -144,6 +144,7 @@ void msi_compose_msg(struct pci_dev *pdev, int irq, MSI_ADDR_REDIRECTION_CPU: MSI_ADDR_REDIRECTION_LOWPRI) | MSI_ADDR_DEST_ID(dest); + msg->dest32 = dest; msg->data = MSI_DATA_TRIGGER_EDGE | @@ -283,6 +284,7 @@ void set_msi_affinity(unsigned int irq, cpumask_t mask) msg.data |= MSI_DATA_VECTOR(cfg->vector); msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; msg.address_lo |= MSI_ADDR_DEST_ID(dest); + msg.dest32 = dest; write_msi_msg(msi_desc, &msg); } |