virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Virtualization Mailing List <virtualization@lists.osdl.org>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	mathiasen@gmail.com, virtualization@lists.linux-foundation.org
Subject: Re: A set of "standard" virtual devices?
Date: Wed, 4 Apr 2007 15:11:41 +0200	[thread overview]
Message-ID: <200704041511.42543.arnd@arndb.de> (raw)
In-Reply-To: <4612F6E9.7040003@zytor.com>

On Wednesday 04 April 2007, H. Peter Anvin wrote:
> Configuration space access is platform-dependent.  It's only defined to 
> work in a specific way on x86 platforms.
> 
> "Interrupt swizzling" is really totally independent of PCI.  ALL PCI 
> really provides is up to four interrupts per device (not counting 
> MSI/MSI-X) and an 8-bit writable field which the platform can choose to 
> use to hold interrupt information.  That's all.  The rest is all 
> platform information.
> 
> PCI enumeration is hardly complex.  Most of the stuff that doesn't apply 
> to you you can generally ignore, as is done by other busses like 
> HyperTransport when they emulate PCI.

You still don't get my point: On a platform that doesn't have interrupt
numbers, and where most of the fields in the config space don't correspond
do anything that is already there, you really don't want to invent
a set of new hcalls that implement emulation, to get something as
simple as a pipe.

wc drivers/pci/*.[ch] include/asm-i386/{pci,io}.h lib/iomap*.c \
	arch/i386/pci/*.c kernel/irq/*.c
17015  59037 463967 total

Even if you only need half of that code in reality, reimplementing
all that in both the kernel and in the hypervisor is an enourmous
effort. We've seen that before on the ps3, which initially faked
a virtual PCI bus just for the USB controller, but doing something
like that requires adding abstraction layers, to decide whether to
implement e.g. an inb as a hypercall or as a memory read.

> That being said, on platforms which are PCI-centric, such as x86, this 
> of course makes it a lot easier to produce virtual devices which work 
> across hypervisors, since the device model, of *any* operating system is 
> set up to handle them.

Yes, as I said there are two separate problems. I really think that
a standardized virtual driver interface should be modeled after
kernel <-> user interfaces, not hardware <-> kernel interfaces.

Once we know what operations we want (e.g. read, write and SIGIO,
or some other set of primitives), it will be good to provide a
virtual PCI device that can be used as one transport mechanism
below it. Using PCI device IDs to tell what functionality is
provided by the device would provide a reasonable method for
autoprobing.

	Arnd <><

  reply	other threads:[~2007-04-04 13:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4611652F.700@zytor.com>
2007-04-02 20:56 ` A set of "standard" virtual devices? Jeremy Fitzhardinge
2007-04-02 21:12   ` Andi Kleen
2007-04-02 21:33     ` Jeff Garzik
2007-04-02 21:36       ` Andi Kleen
2007-04-02 21:42         ` Jeremy Fitzhardinge
2007-04-02 21:53           ` Anthony Liguori
2007-04-02 22:04             ` Jeremy Fitzhardinge
2007-04-02 22:10           ` H. Peter Anvin
2007-04-02 22:25             ` Jeff Garzik
2007-04-02 22:30               ` H. Peter Anvin
2007-04-03  9:41             ` Arnd Bergmann
2007-04-03 10:41               ` Cornelia Huck
2007-04-03 12:15                 ` Arnd Bergmann
2007-04-03 13:39                   ` Cornelia Huck
2007-04-03 14:03                     ` Arnd Bergmann
2007-04-03 16:07                       ` Cornelia Huck
2007-04-03  8:29     ` Christian Borntraeger
2007-04-03  8:30       ` Andi Kleen
2007-04-03  9:17         ` Cornelia Huck
2007-04-03  9:26           ` Andi Kleen
2007-04-03 10:51             ` Cornelia Huck
2007-04-03 15:00             ` Adrian Bunk
2007-04-03 17:50           ` Arnd Bergmann
2007-04-03 19:07             ` Jeremy Fitzhardinge
2007-04-03 19:42               ` Arnd Bergmann
2007-04-03 19:55                 ` Jeremy Fitzhardinge
2007-04-03 20:03                   ` H. Peter Anvin
2007-04-03 21:00                     ` Jeremy Fitzhardinge
2007-04-03 21:45                       ` H. Peter Anvin
2007-04-03 21:51                       ` Arnd Bergmann
2007-04-03 22:10                         ` H. Peter Anvin
2007-04-03 22:49                           ` Arnd Bergmann
2007-04-04  0:52                             ` H. Peter Anvin
2007-04-04 13:11                               ` Arnd Bergmann [this message]
2007-04-04 15:50                                 ` H. Peter Anvin
2007-04-03 20:50                   ` Arnd Bergmann

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=200704041511.42543.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=cornelia.huck@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathiasen@gmail.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=virtualization@lists.osdl.org \
    /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).