aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/msi.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-09-18 00:12:19 +0100
committerJan Beulich <jbeulich@suse.com>2011-09-18 00:12:19 +0100
commit7620c0cf9a4df9cff19be020bf84f8a71cc31d8d (patch)
tree4e0695f43d0d1ad85c0fcaf1a4d59fb5b7859740 /xen/arch/x86/msi.c
parent21844b0e32e77c9e1a600b9279a859a7ffe01844 (diff)
downloadxen-7620c0cf9a4df9cff19be020bf84f8a71cc31d8d.tar.gz
xen-7620c0cf9a4df9cff19be020bf84f8a71cc31d8d.tar.bz2
xen-7620c0cf9a4df9cff19be020bf84f8a71cc31d8d.zip
PCI multi-seg: add new physdevop-s
The new PHYSDEVOP_pci_device_add is intended to be extensible, with a first extension (to pass the proximity domain of a device) added right away. A couple of directly related functions at once get adjusted to account for the segment number. Should we deprecate the PHYSDEVOP_manage_pci_* sub-hypercalls? Signed-off-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/msi.c')
-rw-r--r--xen/arch/x86/msi.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 74251e7df3..f450b5dd20 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -528,7 +528,7 @@ static u64 read_pci_mem_bar(u8 bus, u8 slot, u8 func, u8 bir, int vf)
if ( vf >= 0 )
{
- struct pci_dev *pdev = pci_get_pdev(bus, PCI_DEVFN(slot, func));
+ struct pci_dev *pdev = pci_get_pdev(0, bus, PCI_DEVFN(slot, func));
unsigned int pos = pci_find_ext_capability(0, bus,
PCI_DEVFN(slot, func),
PCI_EXT_CAP_ID_SRIOV);
@@ -767,7 +767,7 @@ static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
struct msi_desc *old_desc;
ASSERT(spin_is_locked(&pcidevs_lock));
- pdev = pci_get_pdev(msi->bus, msi->devfn);
+ pdev = pci_get_pdev(msi->seg, msi->bus, msi->devfn);
if ( !pdev )
return -ENODEV;
@@ -775,7 +775,8 @@ static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
if ( old_desc )
{
dprintk(XENLOG_WARNING, "irq %d has already mapped to MSI on "
- "device %02x:%02x.%01x.\n", msi->irq, msi->bus,
+ "device %04x:%02x:%02x.%01x\n",
+ msi->irq, msi->seg, msi->bus,
PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
*desc = old_desc;
return 0;
@@ -785,7 +786,7 @@ static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
if ( old_desc )
{
dprintk(XENLOG_WARNING, "MSI-X is already in use on "
- "device %02x:%02x.%01x\n", msi->bus,
+ "device %04x:%02x:%02x.%01x\n", msi->seg, msi->bus,
PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
pci_disable_msi(old_desc);
}
@@ -830,7 +831,7 @@ static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc)
struct msi_desc *old_desc;
ASSERT(spin_is_locked(&pcidevs_lock));
- pdev = pci_get_pdev(msi->bus, msi->devfn);
+ pdev = pci_get_pdev(msi->seg, msi->bus, msi->devfn);
if ( !pdev )
return -ENODEV;
@@ -844,7 +845,8 @@ static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc)
if ( old_desc )
{
dprintk(XENLOG_WARNING, "irq %d has already mapped to MSIX on "
- "device %02x:%02x.%01x.\n", msi->irq, msi->bus,
+ "device %04x:%02x:%02x.%01x\n",
+ msi->irq, msi->seg, msi->bus,
PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
*desc = old_desc;
return 0;
@@ -854,7 +856,7 @@ static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc)
if ( old_desc )
{
dprintk(XENLOG_WARNING, "MSI is already in use on "
- "device %02x:%02x.%01x\n", msi->bus,
+ "device %04x:%02x:%02x.%01x\n", msi->seg, msi->bus,
PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
pci_disable_msi(old_desc);
@@ -962,8 +964,10 @@ int pci_restore_msi_state(struct pci_dev *pdev)
if (desc->msi_desc != entry)
{
- dprintk(XENLOG_ERR, "Restore MSI for dev %x:%x not set before?\n",
- pdev->bus, pdev->devfn);
+ dprintk(XENLOG_ERR,
+ "Restore MSI for dev %04x:%02x:%02x:%x not set before?\n",
+ pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+ PCI_FUNC(pdev->devfn));
spin_unlock_irqrestore(&desc->lock, flags);
return -EINVAL;
}