From: Sasha Levin <sasha.levin@oracle.com>
To: Bjorn Helgaas <bhelgaas@google.com>, Ming Lei <tom.leiming@gmail.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Rusty Russell <rusty@rustcorp.com.au>,
Pekka Enberg <penberg@kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 8/9] PCI: Ignore BAR contents when firmware left decoding disabled
Date: Fri, 21 Mar 2014 16:25:16 -0400 [thread overview]
Message-ID: <532CA02C.40505@oracle.com> (raw)
In-Reply-To: <CAErSpo6zjOA43yrwk-4F8PDGTS-8G4piDBq+z-zv+L6_KkKFHQ@mail.gmail.com>
On 03/21/2014 04:07 PM, Bjorn Helgaas wrote:
> I think I figured out what the problem is. In virtio_pci__init(), we
> allocate some address space with pci_get_io_space_block(), save its
> address in vpci->mmio_addr, and hook that address space up to
> virtio_pci__io_mmio_callback with kvm__register_mmio().
>
> But when we update the BAR value in pci__config_wr(), the address
> space mapping is never updated. I think this means that virtio-pci
> can't tolerate its devices being moved by the OS.
>
> In my opinion, this is a bug in linux-kvm. We've managed to avoid
> triggering this bug by preventing Linux from moving the BAR (either by
> me reverting my patch, or by Sasha's linux-kvm change [1]). But it's
> not very robust to assume that the OS will never change the BAR, so
> it's quite possible that you'll trip over this again in the future.
The purpose of KVM tool is to implement as much as possible of the KVM
interface and the virtio spec so that we'll have a good development/testing
environment with a very simple to understand codebase.
The issue you've mentioned is the "evil" side of the KVM tool. It never
tried (or claimed) to implement anything close to legacy hardware
interfaces. This means, for example, that it doesn't run any BIOS, there's
very lacking APIC support and the kernel is just injected into the virtual
RAM and gets run from there.
It also means that we went into the PCI spec deep enough to get the code
to work with the kernel. The only reason we implemented MSI interrupts
for example is because they provide improved performance with KVM, not
because we were trying to get a complete implementation of the PCI spec.
So yes, the PCI implementation in the KVM tool is lacking and what we
have there might be broken by making the kernel conform more closely
to the spec, but we are always happy to adapt and improve our code to
work with any changes in the kernel.
To sum it up, If you'll end up adding a change to the kernel that is
valid according to the spec but breaks the KVM tool we'll just go ahead
and fix the tool. You really don't need to worry about breaking it.
Thanks,
Sasha
next prev parent reply other threads:[~2014-03-21 20:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 19:37 [PATCH 0/9] PCI: Use IORESOURCE_UNSET for unassigned BARs Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 1/9] resource: Add resource_contains() Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 2/9] vsprintf: Add support for IORESOURCE_UNSET in %pR Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 3/9] PCI: Remove pci_find_parent_resource() use for allocation Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 4/9] PCI: Mark resources as IORESOURCE_UNSET if we can't assign them Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 5/9] PCI: Don't clear IORESOURCE_UNSET when updating BAR Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 6/9] PCI: Check IORESOURCE_UNSET before " Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 7/9] PCI: Don't try to claim IORESOURCE_UNSET resources Bjorn Helgaas
2014-02-26 19:37 ` [PATCH 8/9] PCI: Ignore BAR contents when firmware left decoding disabled Bjorn Helgaas
2014-03-13 8:51 ` Ming Lei
2014-03-13 16:08 ` Bjorn Helgaas
2014-03-14 1:48 ` Ming Lei
2014-03-18 0:27 ` Bjorn Helgaas
2014-03-19 3:32 ` Ming Lei
2014-03-19 4:52 ` Ming Lei
2014-03-19 16:45 ` Bjorn Helgaas
2014-03-20 1:32 ` Ming Lei
2014-03-21 20:07 ` Bjorn Helgaas
2014-03-21 20:25 ` Sasha Levin [this message]
2014-03-21 20:40 ` Bjorn Helgaas
2014-03-19 18:54 ` Bjorn Helgaas
2014-03-19 21:16 ` Bjorn Helgaas
2014-03-19 21:23 ` Sasha Levin
2014-02-26 19:38 ` [PATCH 9/9] PCI: Don't enable decoding if BAR hasn't been assigned an address Bjorn Helgaas
2014-03-04 20:53 ` [PATCH 0/9] PCI: Use IORESOURCE_UNSET for unassigned BARs Bjorn Helgaas
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=532CA02C.40505@oracle.com \
--to=sasha.levin@oracle.com \
--cc=bhelgaas@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=penberg@kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=tom.leiming@gmail.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;
as well as URLs for NNTP newsgroup(s).