Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
xen
19557-amd-iommu-ioapic-remap.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 19557-amd-iommu-ioapic-remap.patch of Package xen
# HG changeset patch # User Keir Fraser <keir.fraser@citrix.com> # Date 1239970599 -3600 # Node ID 226ef307cd2e632d9d92b1c9498a665c353f5c37 # Parent b44db970f6b7fe9ff2945e5ed4c2a3bf34487f12 AMD IOMMU: Fix ioapic interrupt remapping A few ioapic redirection entries are initialized by hypervisor before enabling iommu hardware. This patch copies those entries from ioapic redirection table into interrupt remapping table after interrupt remapping table has been allocated. Signed-off-by: Wei Wang <wei.wang2@amd.com> --- a/xen/drivers/passthrough/amd/iommu_intr.c +++ b/xen/drivers/passthrough/amd/iommu_intr.c @@ -109,7 +109,11 @@ static void update_intremap_entry_from_i int __init amd_iommu_setup_intremap_table(void) { + struct IO_APIC_route_entry rte = {0}; unsigned long flags; + u32* entry; + int apic, pin; + u8 delivery_mode, dest, vector, dest_mode; spin_lock_irqsave(&int_remap_table_lock, flags); if ( int_remap_table == NULL ) @@ -122,6 +126,31 @@ int __init amd_iommu_setup_intremap_tabl memset((u8*)int_remap_table, 0, PAGE_SIZE*2); spin_unlock_irqrestore(&int_remap_table_lock, flags); + /* Read ioapic entries and update interrupt remapping table accordingly */ + for ( apic = 0; apic < nr_ioapics; apic++ ) + { + for ( pin = 0; pin < nr_ioapic_registers[apic]; pin++ ) + { + *(((int *)&rte) + 1) = io_apic_read(apic, 0x11 + 2 * pin); + *(((int *)&rte) + 0) = io_apic_read(apic, 0x10 + 2 * pin); + + if ( rte.mask == 1 ) + continue; + + delivery_mode = rte.delivery_mode; + vector = rte.vector; + dest_mode = rte.dest_mode; + if ( dest_mode == 0 ) + dest = rte.dest.physical.physical_dest & 0xf; + else + dest = rte.dest.logical.logical_dest & 0xff; + + spin_lock_irqsave(&int_remap_table_lock, flags); + entry = (u32*)get_intremap_entry(vector, delivery_mode); + update_intremap_entry(entry, vector, delivery_mode, dest_mode, dest); + spin_unlock_irqrestore(&int_remap_table_lock, flags); + } + } return 0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor