Index: hw/mthca/kernel/hca_pnp.c
===================================================================
--- hw/mthca/kernel/hca_pnp.c	(revision 1031)
+++ hw/mthca/kernel/hca_pnp.c	(working copy)
@@ -678,6 +678,29 @@
 		if( pHcaRes->Type == CmResourceTypeInterrupt )
 		{
 			p_ext->interruptInfo = *pHostRes;
+            if ( g_processor_affinity == 0xFFFFFFFF ) 
+			{
+ 				/* 
+				 * Calculate the mask of the last processor
+				 */
+				KAFFINITY		n_active_processors_bitmask;
+				uint32_t  		last_processor_mask = 0 , tmp_processor_mask = 1;
+				
+				n_active_processors_bitmask = KeQueryActiveProcessors();
+                while ( tmp_processor_mask & n_active_processors_bitmask )
+				{
+						last_processor_mask = tmp_processor_mask;
+						tmp_processor_mask = tmp_processor_mask << 1;
+				}
+				p_ext->interruptInfo.u.Interrupt.Affinity = last_processor_mask; 
+			}
+			else if (g_processor_affinity != 0) 
+			{
+				p_ext->interruptInfo.u.Interrupt.Affinity = g_processor_affinity;				
+			}
+			HCA_PRINT( TRACE_LEVEL_INFORMATION, HCA_DBG_PNP,("Set Interrupt affinity to : 0x%08X\n",
+					 (int)p_ext->interruptInfo.u.Interrupt.Affinity ));
+
 			continue;
 		}
 		
Index: hw/mthca/kernel/mt_l2w.c
===================================================================
--- hw/mthca/kernel/mt_l2w.c	(revision 1031)
+++ hw/mthca/kernel/mt_l2w.c	(working copy)
@@ -118,7 +118,7 @@
 		(BOOLEAN)((int_info->Flags == CM_RESOURCE_INTERRUPT_LATCHED) ? 
 		Latched : LevelSensitive),							/* interrupt type: LATCHED or LEVEL */
 		(BOOLEAN)(int_info->ShareDisposition == CmResourceShareShared), 	/* vector shared or not */
-		g_processor_affinity ? g_processor_affinity : (KAFFINITY)int_info->u.Interrupt.Affinity,	/* interrupt affinity */
+		(KAFFINITY)int_info->u.Interrupt.Affinity,	/* interrupt affinity */
 		FALSE 															/* whether to save Float registers */
 		);
 
