From: Keir Fraser Date: Fri, 27 Jun 2008 13:11:41 +0000 (+0100) Subject: vt-d: Minor fixing of interrupt remapping X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14192^2~29 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=65daf3ef4e5ee312ec817ba271edfaccf1aed74b;p=xen.git vt-d: Minor fixing of interrupt remapping When ir_ctrl->iremap_index == -1, it means there is no remap entry. So it needn't to convert from remap format to normal ioapic format. Signed-off-by: Weidong Han --- diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c index 3b6a2795c4..5654813b13 100644 --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -52,7 +52,7 @@ static void remap_entry_to_ioapic_rte( unsigned long flags; struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu); - if ( ir_ctrl == NULL || ir_ctrl->iremap_index < 0 ) + if ( ir_ctrl == NULL ) { dprintk(XENLOG_ERR VTDPREFIX, "remap_entry_to_ioapic_rte: ir_ctl is not ready\n"); @@ -170,7 +170,8 @@ unsigned int io_apic_read_remap_rte( struct iommu *iommu = ioapic_to_iommu(mp_ioapics[apic].mpc_apicid); struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu); - if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 ) + if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 || + ir_ctrl->iremap_index == -1 ) { *IO_APIC_BASE(apic) = reg; return *(IO_APIC_BASE(apic)+4);