From: Konrad Rzeszutek Wilk Date: Fri, 24 Feb 2012 04:54:01 +0000 (-0500) Subject: Merge branch 'devel/acpi-s3.v4.rebased' into uek2-merge X-Git-Tag: v2.6.39-400.9.0~595^2~8 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=af87c1f1aac1f4faa384629f60ee3ac62c2ef9d7;p=users%2Fjedix%2Flinux-maple.git Merge branch 'devel/acpi-s3.v4.rebased' into uek2-merge * devel/acpi-s3.v4.rebased: xen/pci:use hypercall PHYSDEVOP_restore_msi_ext to restore MSI/MSI-X vectors xen/acpi/sleep: Register to the acpi_suspend_lowlevel a callback. xen/acpi/sleep: Enable ACPI sleep via the __acpi_override_sleep xen/acpi: Domain0 acpi parser related platform hypercall xen: Utilize the restore_msi_irqs hook. x86/acpi/sleep: Provide registration for acpi_suspend_lowlevel. x86, acpi, tboot: Have a ACPI sleep override instead of calling tboot_sleep. x86: Expand the x86_msi_ops to have a restore MSIs. Conflicts: drivers/xen/Makefile include/xen/interface/physdev.h include/xen/interface/platform.h --- af87c1f1aac1f4faa384629f60ee3ac62c2ef9d7 diff --cc arch/x86/pci/xen.c index 27d0caf02051,32f17f0fcdd7..a22ad4bf11ba --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@@ -324,29 -243,72 +324,55 @@@ static int xen_initdom_setup_msi_irqs(s out: return ret; } + + static void xen_initdom_restore_msi_irqs(struct pci_dev *dev, int irq) + { + int ret = 0; + + if (pci_seg_supported) { + struct physdev_pci_device restore_ext; + + restore_ext.seg = pci_domain_nr(dev->bus); + restore_ext.bus = dev->bus->number; + restore_ext.devfn = dev->devfn; + ret = HYPERVISOR_physdev_op(PHYSDEVOP_restore_msi_ext, + &restore_ext); + if (ret == -ENOSYS) + pci_seg_supported = false; + WARN(ret && ret != -ENOSYS, "restore_msi_ext -> %d\n", ret); + } + if (!pci_seg_supported) { + struct physdev_restore_msi restore; + + restore.bus = dev->bus->number; + restore.devfn = dev->devfn; + ret = HYPERVISOR_physdev_op(PHYSDEVOP_restore_msi, &restore); + WARN(ret && ret != -ENOSYS, "restore_msi -> %d\n", ret); + } + } #endif -#endif -static int xen_pcifront_enable_irq(struct pci_dev *dev) +static void xen_teardown_msi_irqs(struct pci_dev *dev) { - int rc; - int share = 1; - int pirq; - u8 gsi; - - rc = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &gsi); - if (rc < 0) { - dev_warn(&dev->dev, "Xen PCI: failed to read interrupt line: %d\n", - rc); - return rc; - } - - rc = xen_allocate_pirq_gsi(gsi); - if (rc < 0) { - dev_warn(&dev->dev, "Xen PCI: failed to allocate a PIRQ for GSI%d: %d\n", - gsi, rc); - return rc; - } - pirq = rc; + struct msi_desc *msidesc; - if (gsi < NR_IRQS_LEGACY) - share = 0; + msidesc = list_entry(dev->msi_list.next, struct msi_desc, list); + if (msidesc->msi_attrib.is_msix) + xen_pci_frontend_disable_msix(dev); + else + xen_pci_frontend_disable_msi(dev); - rc = xen_bind_pirq_gsi_to_irq(gsi, pirq, share, "pcifront"); - if (rc < 0) { - dev_warn(&dev->dev, "Xen PCI: failed to bind GSI%d (PIRQ%d) to IRQ: %d\n", - gsi, pirq, rc); - return rc; - } + /* Free the IRQ's and the msidesc using the generic code. */ + default_teardown_msi_irqs(dev); +} - dev->irq = rc; - dev_info(&dev->dev, "Xen PCI mapped GSI%d to IRQ%d\n", gsi, dev->irq); - return 0; +static void xen_teardown_msi_irq(unsigned int irq) +{ + xen_destroy_irq(irq); } +#endif + int __init pci_xen_init(void) { if (!xen_pv_domain() || xen_initial_domain()) diff --cc arch/x86/xen/enlighten.c index 1813892b810a,6962653a1d2a..ebb8551c188b --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@@ -1353,16 -1249,10 +1354,18 @@@ asmlinkage void __init xen_start_kernel if (pci_xen) x86_init.pci.arch_init = pci_xen_init; } else { + const struct dom0_vga_console_info *info = + (void *)((char *)xen_start_info + + xen_start_info->console.dom0.info_off); + + xen_init_vga(info, xen_start_info->console.dom0.info_size); + xen_start_info->console.domU.mfn = 0; + xen_start_info->console.domU.evtchn = 0; + /* Make sure ACS will be enabled */ pci_request_acs(); + + xen_acpi_sleep_register(); } diff --cc drivers/xen/Makefile index 12346a125a8b,0b0058c151d9..e32d0326dbd6 --- a/drivers/xen/Makefile +++ b/drivers/xen/Makefile @@@ -14,13 -14,11 +14,13 @@@ obj-$(CONFIG_XEN_GNTDEV) += xen-gntdev obj-$(CONFIG_XEN_GRANT_DEV_ALLOC) += xen-gntalloc.o obj-$(CONFIG_XENFS) += xenfs/ obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o -obj-$(CONFIG_XEN_PLATFORM_PCI) += xen-platform-pci.o +obj-$(CONFIG_XEN_PVHVM) += platform-pci.o +obj-$(CONFIG_XEN_TMEM) += tmem.o obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o - obj-$(CONFIG_XEN_DOM0) += pci.o + obj-$(CONFIG_XEN_DOM0) += pci.o acpi.o +obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o +obj-$(CONFIG_XEN_PROCESSOR_PASSTHRU) += processor-passthru.o obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/ - xen-evtchn-y := evtchn.o xen-gntdev-y := gntdev.o xen-gntalloc-y := gntalloc.o