aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/pci.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-12-19 09:08:03 -0500
committerJiri Kosina <jkosina@suse.cz>2013-12-19 09:08:32 -0500
commite23c34bb41da65f354fb7eee04300c56ee48f60c (patch)
tree549fbe449d55273b81ef104a9755109bf4ae7817 /drivers/xen/pci.c
parentb481c2cb3534c85dca625973b33eba15f9af3e4c (diff)
parent319e2e3f63c348a9b66db4667efa73178e18b17d (diff)
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply fixes on top of newer things in tree (efi-stub). Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/xen/pci.c')
-rw-r--r--drivers/xen/pci.c53
1 files changed, 50 insertions, 3 deletions
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
index 18fff88254eb..188825122aae 100644
--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -26,6 +26,7 @@
26#include <asm/xen/hypervisor.h> 26#include <asm/xen/hypervisor.h>
27#include <asm/xen/hypercall.h> 27#include <asm/xen/hypercall.h>
28#include "../pci/pci.h" 28#include "../pci/pci.h"
29#include <asm/pci_x86.h>
29 30
30static bool __read_mostly pci_seg_supported = true; 31static bool __read_mostly pci_seg_supported = true;
31 32
@@ -58,12 +59,12 @@ static int xen_add_device(struct device *dev)
58 add.flags = XEN_PCI_DEV_EXTFN; 59 add.flags = XEN_PCI_DEV_EXTFN;
59 60
60#ifdef CONFIG_ACPI 61#ifdef CONFIG_ACPI
61 handle = DEVICE_ACPI_HANDLE(&pci_dev->dev); 62 handle = ACPI_HANDLE(&pci_dev->dev);
62 if (!handle && pci_dev->bus->bridge) 63 if (!handle && pci_dev->bus->bridge)
63 handle = DEVICE_ACPI_HANDLE(pci_dev->bus->bridge); 64 handle = ACPI_HANDLE(pci_dev->bus->bridge);
64#ifdef CONFIG_PCI_IOV 65#ifdef CONFIG_PCI_IOV
65 if (!handle && pci_dev->is_virtfn) 66 if (!handle && pci_dev->is_virtfn)
66 handle = DEVICE_ACPI_HANDLE(physfn->bus->bridge); 67 handle = ACPI_HANDLE(physfn->bus->bridge);
67#endif 68#endif
68 if (handle) { 69 if (handle) {
69 acpi_status status; 70 acpi_status status;
@@ -192,3 +193,49 @@ static int __init register_xen_pci_notifier(void)
192} 193}
193 194
194arch_initcall(register_xen_pci_notifier); 195arch_initcall(register_xen_pci_notifier);
196
197#ifdef CONFIG_PCI_MMCONFIG
198static int __init xen_mcfg_late(void)
199{
200 struct pci_mmcfg_region *cfg;
201 int rc;
202
203 if (!xen_initial_domain())
204 return 0;
205
206 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
207 return 0;
208
209 if (list_empty(&pci_mmcfg_list))
210 return 0;
211
212 /* Check whether they are in the right area. */
213 list_for_each_entry(cfg, &pci_mmcfg_list, list) {
214 struct physdev_pci_mmcfg_reserved r;
215
216 r.address = cfg->address;
217 r.segment = cfg->segment;
218 r.start_bus = cfg->start_bus;
219 r.end_bus = cfg->end_bus;
220 r.flags = XEN_PCI_MMCFG_RESERVED;
221
222 rc = HYPERVISOR_physdev_op(PHYSDEVOP_pci_mmcfg_reserved, &r);
223 switch (rc) {
224 case 0:
225 case -ENOSYS:
226 continue;
227
228 default:
229 pr_warn("Failed to report MMCONFIG reservation"
230 " state for %s to hypervisor"
231 " (%d)\n",
232 cfg->name, rc);
233 }
234 }
235 return 0;
236}
237/*
238 * Needs to be done after acpi_init which are subsys_initcall.
239 */
240subsys_initcall_sync(xen_mcfg_late);
241#endif