All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhai, Edwin" <edwin.zhai@intel.com>
To: Simon Horman <horms@verge.net.au>
Cc: Xen Developers <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Zhai, Edwin" <edwin.zhai@intel.com>
Subject: [PATCH] [IOEMU] Fix wrong INTx for pass-through device
Date: Mon, 28 Dec 2009 15:04:59 +0800	[thread overview]
Message-ID: <4B38589B.8060307@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

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


[-- Attachment #2: qemu_passthrough_intx_fix.patch --]
[-- Type: text/plain, Size: 525 bytes --]

Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>

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 */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2009-12-28  7:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-28  7:04 Zhai, Edwin [this message]
2009-12-28  7:54 ` [PATCH] [IOEMU] Fix wrong INTx for pass-through device Simon Horman
2009-12-28 14:33 ` Tom Rotenberg
2009-12-29  0:22   ` Zhai, Edwin
2009-12-29  2:01     ` Simon Horman
2009-12-29  8:51       ` Tom Rotenberg
2009-12-29  8:59         ` Zhai, Edwin
2009-12-30  8:20           ` Tom Rotenberg
2009-12-31  4:32             ` Simon Horman
2009-12-31  6:08               ` Zhai, Edwin
2009-12-31  6:45                 ` Simon Horman
2009-12-31  7:40                   ` Zhai, Edwin
2009-12-31  7:56                     ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B38589B.8060307@intel.com \
    --to=edwin.zhai@intel.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=horms@verge.net.au \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.