From: Alex Williamson <alex.williamson@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] pci-assign: Do not expose MSI/MSI-X if the kernel does not support it
Date: Tue, 02 Aug 2011 14:26:13 -0600 [thread overview]
Message-ID: <1312316773.2653.475.camel@bling.home> (raw)
In-Reply-To: <4E3834B2.4040101@siemens.com>
On Tue, 2011-08-02 at 19:32 +0200, Jan Kiszka wrote:
> On 2011-08-02 19:02, Alex Williamson wrote:
> > On Tue, 2011-08-02 at 14:27 +0200, Jan Kiszka wrote:
> >> Add checks for KVM_CAP_ASSIGN_DEV_IRQ (MSI) and KVM_CAP_DEVICE_MSIX, do
> >> not set up MSI/MSI-X if the required kernel features are missing.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> >> ---
> >> hw/device-assignment.c | 6 ++++--
> >> 1 files changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> >> index 4cc7b1a..7e965cb 100644
> >> --- a/hw/device-assignment.c
> >> +++ b/hw/device-assignment.c
> >> @@ -1201,7 +1201,8 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
> >>
> >> /* Expose MSI capability
> >> * MSI capability is the 1st capability in capability config */
> >> - if ((pos = pci_find_cap_offset(pci_dev, PCI_CAP_ID_MSI, 0))) {
> >> + pos = pci_find_cap_offset(pci_dev, PCI_CAP_ID_MSI, 0);
> >> + if (pos != 0 && kvm_check_extension(kvm_state, KVM_CAP_ASSIGN_DEV_IRQ)) {
> >
> > Is it even useful to have a device assigned w/o KVM_CAP_ASSIGN_DEV_IRQ?
>
> If that feature is lacking, we fall back to the old KVM_ASSIGN_IRQ
> interface. I guess that used to work, but I bet no one tested it
> recently. However, the code is there, also in the kvm core.
Ah right. Not sure how much I trust that, but seems obviously correct
to not expose capabilities we can't support.
Acked-by: Alex Williamson <alex.williamson@redhat.com>
next prev parent reply other threads:[~2011-08-02 20:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-02 12:27 [PATCH] pci-assign: Do not expose MSI/MSI-X if the kernel does not support it Jan Kiszka
2011-08-02 17:02 ` Alex Williamson
2011-08-02 17:32 ` Jan Kiszka
2011-08-02 20:26 ` Alex Williamson [this message]
2011-08-03 20:29 ` Marcelo Tosatti
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=1312316773.2653.475.camel@bling.home \
--to=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@siemens.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox