All of lore.kernel.org
 help / color / mirror / Atom feed
* VT-d device assignment may fail (regression from Xen c/s 19805:2f1fa2215e60)
@ 2010-10-22 10:13 Jan Beulich
  2010-10-25  7:05 ` Jiang, Yunhong
  2010-10-27  5:43 ` Weidong Han
  0 siblings, 2 replies; 12+ messages in thread
From: Jan Beulich @ 2010-10-22 10:13 UTC (permalink / raw)
  To: Weidong Han; +Cc: yunhong.jiang, xen-devel@lists.xensource.com

Weidong,

in this patch you removed a bus/devfn check around an invocation of
domain_context_mapping_one() avoiding the attempt to call the
function again if it was already called for this very device. This
removal, however, conflicts with the context_present() check at the
top of domain_context_mapping_one() - in particular, pdev->domain
isn't set to the new owner yet, and hence the function fails.

The question now is whether some similar check should be restored,
or whether pdev->domain should get updated earlier. This may
need some additional consideration, since from looking at the code
I would say that reassign_device_ownership() needs some error
handling improvements too: Currently, partial failure isn't being
handled properly at all (respective devices are left in a half way
state - no longer properly assigned to Dom0, but also not yet
assigned to DomU).

I also wonder what guarantee there is for a device to exist at
<secbus>:00.0 (since if there is none, the same context_present()
check could at least theoretically again lead to problems as it
checks for pci_get_pdev() returning non-NULL).

Finally, isn't it inconsistent that only the original device gets its
->domain set to the new owner and gets moved to that domain's
device list, but neither the upstream bridge nor that bridge's
<secbus>:00.0 get handled the same way? What if below that
bridge a device gets hot-added? Wouldn't that device
incorrectly end up in Dom0, with no failures because the bridge
still appears to be owned by Dom0 while it really isn't?

Jan

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

end of thread, other threads:[~2010-10-28  0:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 10:13 VT-d device assignment may fail (regression from Xen c/s 19805:2f1fa2215e60) Jan Beulich
2010-10-25  7:05 ` Jiang, Yunhong
2010-10-25  8:58   ` Jan Beulich
2010-10-25 15:31     ` Jiang, Yunhong
2010-10-25 15:52     ` Jiang, Yunhong
2010-10-25 16:07       ` Jan Beulich
2010-10-26  3:48         ` Alfred Song
2010-10-27  5:43 ` Weidong Han
2010-10-27  9:55   ` Jan Beulich
2010-10-28  0:26     ` Weidong Han
2010-10-27 11:34   ` Jan Beulich
2010-10-28  0:31     ` Weidong Han

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.