All of lore.kernel.org
 help / color / mirror / Atom feed
* sharing PCI devices ....
@ 2005-09-07 13:42 Himanshu Raj
  2005-09-07 13:55 ` Daniel Hulme
  2005-09-07 15:13 ` Mark Williamson
  0 siblings, 2 replies; 5+ messages in thread
From: Himanshu Raj @ 2005-09-07 13:42 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-users

Hi Folks,

A question about PCI devices. If we leave security problems aside, is it possible
to provide access of a PCI device to 2 domains (may include dom 0), i.e. would
current xen implementation suffice or a PCI device can only be used exclusively
by a domain.

Thanks,
Himanshu

-- 
-------------------------------------------------------------------------
Himanshu Raj
PhD Student, GaTech (www.cc.gatech.edu/~rhim)
I prefer to receive attachments in an open, non-proprietary format.
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sharing PCI devices ....
  2005-09-07 13:42 sharing PCI devices Himanshu Raj
@ 2005-09-07 13:55 ` Daniel Hulme
  2005-09-07 14:05   ` Daniel Hulme
  2005-09-07 15:13 ` Mark Williamson
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Hulme @ 2005-09-07 13:55 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1565 bytes --]

> A question about PCI devices. If we leave security problems aside, is
> it possible to provide access of a PCI device to 2 domains (may
> include dom 0), i.e. would current xen implementation suffice or a PCI
> device can only be used exclusively by a domain.
No, not without writing a backend driver to mediate device accesses. If
two domains can both access the raw device, who gets the interrupts
raised by the device? What if one domain gets context-switched away in
the middle of what it thinks is an atomic operation, and the other
domain uses the device in the meantime? What if the domains each want
the device in a different 'mode' (like promiscuous mode for NICs) - how
do you change the mode back and forth as each domain is scheduled?

If you have a particular device that you want two or more domains to
use, you need to write a backend and a frontend device driver, and then
export the virtual device to your domUs just like the virtual NIC and
the virtual block device.

If you do this, consider sharing the source with everyone: someone else
will probably want to do the same thing eventually and it would make
their lives easier. Also, other people may spot unnoticed bugs in your
driver, before they bite you on the bum.

-- 
"And  what if  I assign  a  hundred  programmers  to  it?"   The  master
programmer shrugged. "Then the design will never be completed," he said.
http://www.google.com/search?q=%22pgp+singing%22  <-- childish but funny
http://surreal.istic.org/ <-- It's like a DEATH CIRCUS! | keyid 885b170d

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sharing PCI devices ....
  2005-09-07 13:55 ` Daniel Hulme
@ 2005-09-07 14:05   ` Daniel Hulme
  2005-09-07 14:16     ` harry
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Hulme @ 2005-09-07 14:05 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 681 bytes --]

> Also, other people may spot unnoticed bugs in your driver, before they
> bite you on the bum.
Actually, on reflection I would like to emphasize that it is the bugs
that will be biting you on the bum, not the other people. I hope nobody
else had a horrible mental picture of Xen developers lining up to tell
some poor chap his code is buggy and then bite him on the bum.

-- 
"And  what if  I assign  a  hundred  programmers  to  it?"   The  master
programmer shrugged. "Then the design will never be completed," he said.
http://www.google.com/search?q=%22pgp+singing%22  <-- childish but funny
http://surreal.istic.org/ <-- It's like a DEATH CIRCUS! | keyid 885b170d

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sharing PCI devices ....
  2005-09-07 14:05   ` Daniel Hulme
@ 2005-09-07 14:16     ` harry
  0 siblings, 0 replies; 5+ messages in thread
From: harry @ 2005-09-07 14:16 UTC (permalink / raw)
  To: Daniel Hulme; +Cc: xen-devel

On Wed, 2005-09-07 at 15:05 +0100, Daniel Hulme wrote:
> > Also, other people may spot unnoticed bugs in your driver, before they
> > bite you on the bum.
> Actually, on reflection I would like to emphasize that it is the bugs
> that will be biting you on the bum, not the other people. I hope nobody
> else had a horrible mental picture of Xen developers lining up to tell
> some poor chap his code is buggy and then bite him on the bum.

That thought hadn't occurred to me... until now.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sharing PCI devices ....
  2005-09-07 13:42 sharing PCI devices Himanshu Raj
  2005-09-07 13:55 ` Daniel Hulme
@ 2005-09-07 15:13 ` Mark Williamson
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Williamson @ 2005-09-07 15:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Himanshu Raj, xen-users

> A question about PCI devices. If we leave security problems aside, is it
> possible to provide access of a PCI device to 2 domains (may include dom
> 0), i.e. would current xen implementation suffice or a PCI device can only
> be used exclusively by a domain.

Not usually: devices are basically stupid and they only expect one entity to 
be talking to them.  If you get multiple domains driving a device directly 
it'll probably end in tears, although it might be amusing :-)

You've really got two choices:
1) Just assign a device to one domain at a time - maybe buy multiple devices 
to serve multiple domains.
2) Virtualise at a higher level using a backend / frontend.  e.g. the virtual 
block device, virtual net dev, virtual usb dev, etc...

What are you actually trying to achieve?

Cheers,
Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-09-07 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-07 13:42 sharing PCI devices Himanshu Raj
2005-09-07 13:55 ` Daniel Hulme
2005-09-07 14:05   ` Daniel Hulme
2005-09-07 14:16     ` harry
2005-09-07 15:13 ` Mark Williamson

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.