All of lore.kernel.org
 help / color / mirror / Atom feed
* time periods of no resource re-assignment
@ 2013-02-28  9:08 Jan Beulich
  2013-02-28 16:06 ` Bjorn Helgaas
  2013-02-28 16:06 ` Bjorn Helgaas
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Beulich @ 2013-02-28  9:08 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: xen-devel, linux-pci

Bjorn,

in the context of dealing with the final part of a long known security
issue on Xen, I'd appreciate if you could help me understand
under what conditions (or at which times) MMIO resources for PCI
devices can get re-assigned in Linux. Or really I'm in need to know
under what conditions there won't be any resource re-assignment
(i.e. we particularly need the BARs to be stable that cover the
MSI-X table and the Pending Bit Array).

Right now I'm intending to send the hypervisor a respective
notification in the context of xen-pciback's probe function, after
having called pci_enable_device(). Can you confirm that at this
point, and until the driver lets go of the device again, resources
won't get re-assigned? Or if not, can you suggest a better point
in time for sending such a notification, or additional steps we
may need to take in order to ensure resource stability?

Thanks a lot, Jan


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

* Re: time periods of no resource re-assignment
  2013-02-28  9:08 time periods of no resource re-assignment Jan Beulich
  2013-02-28 16:06 ` Bjorn Helgaas
@ 2013-02-28 16:06 ` Bjorn Helgaas
  2013-02-28 16:33   ` Jan Beulich
  2013-02-28 16:33   ` Jan Beulich
  1 sibling, 2 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2013-02-28 16:06 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, linux-pci

On Thu, Feb 28, 2013 at 2:08 AM, Jan Beulich <JBeulich@suse.com> wrote:
> Bjorn,
>
> in the context of dealing with the final part of a long known security
> issue on Xen, I'd appreciate if you could help me understand
> under what conditions (or at which times) MMIO resources for PCI
> devices can get re-assigned in Linux. Or really I'm in need to know
> under what conditions there won't be any resource re-assignment
> (i.e. we particularly need the BARs to be stable that cover the
> MSI-X table and the Pending Bit Array).
>
> Right now I'm intending to send the hypervisor a respective
> notification in the context of xen-pciback's probe function, after
> having called pci_enable_device(). Can you confirm that at this
> point, and until the driver lets go of the device again, resources
> won't get re-assigned? Or if not, can you suggest a better point
> in time for sending such a notification, or additional steps we
> may need to take in order to ensure resource stability?

Hi Jan,

There is currently no mechanism for the PCI core to tell a driver that
we're changing any device resources (IRQ, MMIO, I/O).  Since there's
no way to tell a driver to refresh its idea of device resources, the
core can not change anything after we call a driver's .probe()
method.

This could change in the future if we support dynamic resource
reassignment, but I think that would require adding some sort of
notification infrastructure so we could essentially suspend a driver,
reassign device resources, and tell the driver "things might have
changed" when we resume it.

Bjorn

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

* Re: time periods of no resource re-assignment
  2013-02-28  9:08 time periods of no resource re-assignment Jan Beulich
@ 2013-02-28 16:06 ` Bjorn Helgaas
  2013-02-28 16:06 ` Bjorn Helgaas
  1 sibling, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2013-02-28 16:06 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-pci, xen-devel

On Thu, Feb 28, 2013 at 2:08 AM, Jan Beulich <JBeulich@suse.com> wrote:
> Bjorn,
>
> in the context of dealing with the final part of a long known security
> issue on Xen, I'd appreciate if you could help me understand
> under what conditions (or at which times) MMIO resources for PCI
> devices can get re-assigned in Linux. Or really I'm in need to know
> under what conditions there won't be any resource re-assignment
> (i.e. we particularly need the BARs to be stable that cover the
> MSI-X table and the Pending Bit Array).
>
> Right now I'm intending to send the hypervisor a respective
> notification in the context of xen-pciback's probe function, after
> having called pci_enable_device(). Can you confirm that at this
> point, and until the driver lets go of the device again, resources
> won't get re-assigned? Or if not, can you suggest a better point
> in time for sending such a notification, or additional steps we
> may need to take in order to ensure resource stability?

Hi Jan,

There is currently no mechanism for the PCI core to tell a driver that
we're changing any device resources (IRQ, MMIO, I/O).  Since there's
no way to tell a driver to refresh its idea of device resources, the
core can not change anything after we call a driver's .probe()
method.

This could change in the future if we support dynamic resource
reassignment, but I think that would require adding some sort of
notification infrastructure so we could essentially suspend a driver,
reassign device resources, and tell the driver "things might have
changed" when we resume it.

Bjorn

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

* Re: time periods of no resource re-assignment
  2013-02-28 16:06 ` Bjorn Helgaas
  2013-02-28 16:33   ` Jan Beulich
@ 2013-02-28 16:33   ` Jan Beulich
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2013-02-28 16:33 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: xen-devel, linux-pci

>>> On 28.02.13 at 17:06, Bjorn Helgaas <bhelgaas@google.com> wrote:
> There is currently no mechanism for the PCI core to tell a driver that
> we're changing any device resources (IRQ, MMIO, I/O).  Since there's
> no way to tell a driver to refresh its idea of device resources, the
> core can not change anything after we call a driver's .probe()
> method.
> 
> This could change in the future if we support dynamic resource
> reassignment, but I think that would require adding some sort of
> notification infrastructure so we could essentially suspend a driver,
> reassign device resources, and tell the driver "things might have
> changed" when we resume it.

Thanks Bjorn! That should allow us to get things working for now
the way I have coded them up already, and I assume eventual
changes in this area (as you outlined) would imply cooperation by
the driver (i.e. if a device is assigned to a guest, it ought to be
possible to deny the re-assignment attempt if there's no way to
let the guest know of the change).

Jan


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

* Re: time periods of no resource re-assignment
  2013-02-28 16:06 ` Bjorn Helgaas
@ 2013-02-28 16:33   ` Jan Beulich
  2013-02-28 16:33   ` Jan Beulich
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2013-02-28 16:33 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, xen-devel

>>> On 28.02.13 at 17:06, Bjorn Helgaas <bhelgaas@google.com> wrote:
> There is currently no mechanism for the PCI core to tell a driver that
> we're changing any device resources (IRQ, MMIO, I/O).  Since there's
> no way to tell a driver to refresh its idea of device resources, the
> core can not change anything after we call a driver's .probe()
> method.
> 
> This could change in the future if we support dynamic resource
> reassignment, but I think that would require adding some sort of
> notification infrastructure so we could essentially suspend a driver,
> reassign device resources, and tell the driver "things might have
> changed" when we resume it.

Thanks Bjorn! That should allow us to get things working for now
the way I have coded them up already, and I assume eventual
changes in this area (as you outlined) would imply cooperation by
the driver (i.e. if a device is assigned to a guest, it ought to be
possible to deny the re-assignment attempt if there's no way to
let the guest know of the change).

Jan

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

* time periods of no resource re-assignment
@ 2013-02-28  9:08 Jan Beulich
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2013-02-28  9:08 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, xen-devel

Bjorn,

in the context of dealing with the final part of a long known security
issue on Xen, I'd appreciate if you could help me understand
under what conditions (or at which times) MMIO resources for PCI
devices can get re-assigned in Linux. Or really I'm in need to know
under what conditions there won't be any resource re-assignment
(i.e. we particularly need the BARs to be stable that cover the
MSI-X table and the Pending Bit Array).

Right now I'm intending to send the hypervisor a respective
notification in the context of xen-pciback's probe function, after
having called pci_enable_device(). Can you confirm that at this
point, and until the driver lets go of the device again, resources
won't get re-assigned? Or if not, can you suggest a better point
in time for sending such a notification, or additional steps we
may need to take in order to ensure resource stability?

Thanks a lot, Jan

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

end of thread, other threads:[~2013-02-28 16:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28  9:08 time periods of no resource re-assignment Jan Beulich
2013-02-28 16:06 ` Bjorn Helgaas
2013-02-28 16:06 ` Bjorn Helgaas
2013-02-28 16:33   ` Jan Beulich
2013-02-28 16:33   ` Jan Beulich
2013-02-28  9:08 Jan Beulich

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.