From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhai, Edwin" Subject: [PATCH] [IOEMU] Fix wrong INTx for pass-through device Date: Mon, 28 Dec 2009 15:04:59 +0800 Message-ID: <4B38589B.8060307@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070204000205070709060802" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Simon Horman Cc: Xen Developers , Ian Jackson , "Zhai, Edwin" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------070204000205070709060802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Simon, For the pass-through device's INTx emulation, we follow the policy: if virtual function 0, use INTA#, otherwise use hardware value. However, this policy only apply when bind_pt_pci_irq to xen, and always use physical value when exporting to guest. This discrepancy cause different INTx, thus different GSI in xen and guest, so that interrupts never got injected to guest. E.g. when assigning a USB controller with non-zero function(00:1d.2) to guest as 00:4.0, xen will see INTA#, while guest see INTC#. This simple patch can fix it. Could you pls. review it? Thanks, -- best rgds, edwin --------------070204000205070709060802 Content-Type: text/plain; name="qemu_passthrough_intx_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu_passthrough_intx_fix.patch" Signed-Off-By: Zhai Edwin diff --git a/hw/pass-through.c b/hw/pass-through.c index e7bd386..a08c0bf 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -2710,7 +2710,8 @@ static uint32_t pt_status_reg_init(struct pt_dev *ptdev, static uint32_t pt_irqpin_reg_init(struct pt_dev *ptdev, struct pt_reg_info_tbl *reg, uint32_t real_offset) { - return ptdev->dev.config[real_offset]; + /* Translate xen INTx value to hw */ + return pci_intx(ptdev) + 1; } /* initialize BAR */ --------------070204000205070709060802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------070204000205070709060802--