From: Sheng Yang <sheng@linux.intel.com>
To: kvm@vger.kernel.org
Cc: Alex Williamson <alex.williamson@hp.com>,
Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [PATCH 13/16] kvm: enable MSI-X capabilty for assigned device
Date: Thu, 9 Apr 2009 09:31:08 +0800 [thread overview]
Message-ID: <200904090931.12076.sheng@linux.intel.com> (raw)
In-Reply-To: <1239207236.4726.175.camel@lappy>
On Thursday 09 April 2009 00:13:56 Alex Williamson wrote:
> Hi Sheng,
>
> On Wed, 2009-04-08 at 10:26 +0800, Sheng Yang wrote:
> > On Wednesday 08 April 2009 00:38:10 Alex Williamson wrote:
> > > On Tue, 2009-04-07 at 14:09 +0800, Sheng Yang wrote:
> > > > Could you enable DEVICE_ASSSIGNMENT_DEBUG=1 in
> > > > qemu/hw/device-assignment.c and post the output?
> > >
> > > Yup, see below. The error comes after I 'ifdown eth0; ifup eth0' in
> > > the guest. Note bnx2 appears to only turn on MSIX for SMP systems.
> > > Thanks,
> > >
> > > Alex
> >
> > Seems your "ifdown/ifup" script reload the module?
>
> No, the bnx2 module isn't unloaded on ifdown.
>
> > Oh god, I found one bug
> > after checked the spec:
> >
> > System software reads this field to determine the MSI-X Table Size *N*,
> > which is encoded as *N-1*. For example, a returned value of “00000000011”
> > indicates a table size of 4.
> >
> > But it seems still can't explain the problem...(OK, it may affect the
> > guest in a unknown way as well...) I would post a fix for it soon.
>
> [snip]
>
> > The writing to MMIO have been intercepted, but code fail to count it?
> > Strange...
> >
> > Could you try this debug?
>
> I added the debug printfs, plus the MSI-X table size patch, and printed
> the value of msg_ctrl as we loop through. Output below. This is what
> made me think the MSI-X state isn't getting cleared when the driver
> closes the interface. Let me know what you think. Thanks,
>
Thanks Alex, now I know where the problem is. Part of functional haven't been
implemented...
> address=0052 val=0x00008008 len=2 the MSIX capabilty position is 0x50
> the MSIX entries_max_nr is 0x9
> 0: msg_ctrl: 0001
> 1: msg_ctrl: 0001
> 2: msg_ctrl: 0001
> 3: msg_ctrl: 0001
> 4: msg_ctrl: 0001
> 5: msg_ctrl: 0001
> 6: msg_ctrl: 0001
> 7: msg_ctrl: 0001
> 8: msg_ctrl: 0001
> MSI-X entry number is zero!
> assigned_dev_update_msix_mmio: No such device or address
Driver write to the vectors at first, then enable MSI-X,
> msix_mmio_writel: write to MSI-X entry table mmio offset 0xc, val 0x0
> msix_mmio_writel: write to MSI-X entry table mmio offset 0x1c, val 0x0
> msix_mmio_writel: write to MSI-X entry table mmio offset 0x2c, val 0x0
> msix_mmio_writel: write to MSI-X entry table mmio offset 0x3c, val 0x0
> msix_mmio_writel: write to MSI-X entry table mmio offset 0x4c, val 0x0
> msix_mmio_writel: write to MSI-X entry table mmio offset 0x5c, val 0x0
> msix_mmio_writel: write to MSI-X entry table mmio offset 0x6c, val 0x0
> msix_mmio_writel: write to MSI-X entry table mmio offset 0x7c, val 0x0
And finally clear the mask bit.
For current we didn't implement mask capability in MSI-X vectors, so it won't
work...
OK. I'd like to remove the check of mask bit and only ignored unused vector
when msg data is zero now(hope it won't cause more problems). And we would add
support for per-vector mask later.
Thanks for help to debug!
--
regards
Yang, Sheng
next prev parent reply other threads:[~2009-04-09 1:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 3:50 [PATCH 0/16 v6] Device assignment improvement in userspace Sheng Yang
2009-03-17 3:50 ` [PATCH 01/16] kvm: ioctl for KVM_ASSIGN_DEV_IRQ and KVM_DEASSIGN_DEV_IRQ Sheng Yang
2009-03-17 3:50 ` [PATCH 02/16] kvm: deassign irq for INTx Sheng Yang
2009-03-17 3:50 ` [PATCH 03/16] kvm: Replace force type convert with container_of() Sheng Yang
2009-03-17 3:50 ` [PATCH 04/16] Make device assignment depend on libpci Sheng Yang
2009-03-17 3:50 ` [PATCH 05/16] Figure out device capability Sheng Yang
2009-03-17 3:50 ` [PATCH 06/16] Support for " Sheng Yang
2009-04-03 19:23 ` Alex Williamson
2009-04-07 5:54 ` Sheng Yang
2009-03-17 3:50 ` [PATCH 07/16] kvm: user interface for MSI type irq routing Sheng Yang
2009-03-17 3:50 ` [PATCH 08/16] kvm: libkvm: allocate unused gsi for " Sheng Yang
2009-03-17 3:50 ` [PATCH 09/16] kvm: expose MSI capability to guest Sheng Yang
2009-03-17 3:50 ` [PATCH 10/16] kvm: Support MSI convert to INTx in device assignment Sheng Yang
2009-03-17 3:50 ` [PATCH 11/16] Add MSI-X related macro to pci.c Sheng Yang
2009-03-17 3:50 ` [PATCH 12/16] kvm: add ioctl KVM_SET_MSIX_ENTRY_NR and KVM_SET_MSIX_ENTRY Sheng Yang
2009-03-17 3:50 ` [PATCH 13/16] kvm: enable MSI-X capabilty for assigned device Sheng Yang
2009-04-03 21:27 ` Alex Williamson
2009-04-07 6:09 ` Sheng Yang
2009-04-07 16:38 ` Alex Williamson
2009-04-08 2:26 ` Sheng Yang
2009-04-08 16:13 ` Alex Williamson
2009-04-09 1:31 ` Sheng Yang [this message]
2009-03-17 3:50 ` [PATCH 14/16] kvm: fix interrupt pin 0 assignment Sheng Yang
2009-03-17 3:50 ` [PATCH 15/16] KVM: Fill config with correct VID/DID Sheng Yang
2009-03-17 3:50 ` [PATCH 16/16] kvm: emulate command register for SRIOV virtual function Sheng Yang
2009-03-18 10:38 ` [PATCH 0/16 v6] Device assignment improvement in userspace Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2009-03-12 13:36 [PATCH 0/16 v5] " Sheng Yang
2009-03-12 13:36 ` [PATCH 13/16] kvm: enable MSI-X capabilty for assigned device Sheng Yang
2009-03-16 8:32 ` Sheng Yang
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=200904090931.12076.sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=alex.williamson@hp.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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.