From 387129caad2dbeb3f397def696b558c1ca542343207b8377fee07129a8082a22 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Thu, 4 Apr 2013 17:05:57 +0000 Subject: [PATCH] - bnc#797014 - no way to control live migrations - bnc#803712 - after live migration rcu_sched_state detected stalls xen.migrate.tools-xend_move_assert_to_exception_block.patch xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch xen.migrate.tools_notify_restore_to_hangup_during_migration_--abort_if_busy.patch - bnc#811764 - XEN (hypervisor or kernel) has a problem with EFI variable services x86-EFI-set-variable-permit-attrs.patch - Upstream patches from Jan 26060-ACPI-ERST-table-size-checks.patch 26692-x86-fully-protect-MSI-X-table-from-PV-guest-accesses.patch 26702-powernow-add-fixups-for-AMD-P-state-figures.patch 26704-x86-MCA-suppress-bank-clearing-for-certain-injected-events.patch (bnc#805579) 26731-AMD-IOMMU-Process-softirqs-while-building-dom0-iommu-mappings.patch 26733-VT-d-Enumerate-IOMMUs-when-listing-capabilities.patch 26734-ACPI-ERST-Name-table-in-otherwise-opaque-error-messages.patch 26736-ACPI-APEI-Unlock-apei_iomaps_lock-on-error-path.patch 26737-ACPI-APEI-Add-apei_exec_run_optional.patch 26742-IOMMU-properly-check-whether-interrupt-remapping-is-enabled.patch 26743-VT-d-deal-with-5500-5520-X58-errata.patch (bnc#801910) 26744-AMD-IOMMU-allow-disabling-only-interrupt-remapping.patch - PVonHVM: __devinit was removed in linux-3.8 OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=234 --- 26060-ACPI-ERST-table-size-checks.patch | 67 ++++ 26062-ACPI-ERST-move-data.patch | 2 + ...t-MSI-X-table-from-PV-guest-accesses.patch | 369 ++++++++++++++++++ ...w-add-fixups-for-AMD-P-state-figures.patch | 139 +++++++ ...clearing-for-certain-injected-events.patch | 72 ++++ ...s-while-building-dom0-iommu-mappings.patch | 32 ++ ...ate-IOMMUs-when-listing-capabilities.patch | 22 ++ ...e-in-otherwise-opaque-error-messages.patch | 28 ++ ...nlock-apei_iomaps_lock-on-error-path.patch | 34 ++ ...ACPI-APEI-Add-apei_exec_run_optional.patch | 70 ++++ ...ether-interrupt-remapping-is-enabled.patch | 96 +++++ ...-VT-d-deal-with-5500-5520-X58-errata.patch | 90 +++++ ...w-disabling-only-interrupt-remapping.patch | 63 +++ 32on64-extra-mem.patch | 2 +- blktap.patch | 2 +- change-vnc-passwd.patch | 2 +- change_home_server.patch | 2 +- checkpoint-rename.patch | 2 +- multi-xvdp.patch | 2 +- x86-EFI-set-variable-permit-attrs.patch | 14 + xen-domUloader.diff | 6 +- xen-managed-pci-device.patch | 2 +- xen-max-free-mem.diff | 2 +- xen.changes | 30 ++ ..._print_stats_if_migration_is_aborted.patch | 25 ++ ...-xend_move_assert_to_exception_block.patch | 43 ++ ...gup_during_migration_--abort_if_busy.patch | 57 +++ ...t_migration_constraints_from_cmdline.patch | 15 +- ...mber_of_dirty_pages_during_migration.patch | 283 ++++++++++++++ xen.spec | 52 ++- xenapi-console-protocol.patch | 2 +- xend-console-port-restore.patch | 6 +- xend-core-dump-loc.diff | 2 +- xend-domain-lock-sfex.patch | 8 +- xend-domain-lock.patch | 18 +- xend-migration-domname-fix.patch | 4 +- xend-vcpu-affinity-fix.patch | 2 +- xenpaging.autostart.patch | 18 +- 38 files changed, 1633 insertions(+), 52 deletions(-) create mode 100644 26060-ACPI-ERST-table-size-checks.patch create mode 100644 26692-x86-fully-protect-MSI-X-table-from-PV-guest-accesses.patch create mode 100644 26702-powernow-add-fixups-for-AMD-P-state-figures.patch create mode 100644 26704-x86-MCA-suppress-bank-clearing-for-certain-injected-events.patch create mode 100644 26731-AMD-IOMMU-Process-softirqs-while-building-dom0-iommu-mappings.patch create mode 100644 26733-VT-d-Enumerate-IOMMUs-when-listing-capabilities.patch create mode 100644 26734-ACPI-ERST-Name-table-in-otherwise-opaque-error-messages.patch create mode 100644 26736-ACPI-APEI-Unlock-apei_iomaps_lock-on-error-path.patch create mode 100644 26737-ACPI-APEI-Add-apei_exec_run_optional.patch create mode 100644 26742-IOMMU-properly-check-whether-interrupt-remapping-is-enabled.patch create mode 100644 26743-VT-d-deal-with-5500-5520-X58-errata.patch create mode 100644 26744-AMD-IOMMU-allow-disabling-only-interrupt-remapping.patch create mode 100644 x86-EFI-set-variable-permit-attrs.patch create mode 100644 xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch create mode 100644 xen.migrate.tools-xend_move_assert_to_exception_block.patch create mode 100644 xen.migrate.tools_notify_restore_to_hangup_during_migration_--abort_if_busy.patch create mode 100644 xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch diff --git a/26060-ACPI-ERST-table-size-checks.patch b/26060-ACPI-ERST-table-size-checks.patch new file mode 100644 index 0000000..5ef6ce8 --- /dev/null +++ b/26060-ACPI-ERST-table-size-checks.patch @@ -0,0 +1,67 @@ +References: bnc#785211 + +# HG changeset patch +# User Huang Ying +# Date 1350401196 -7200 +# Node ID 4fc87c2f31a02c770655518c9e4d389302564f00 +# Parent c1c549c4fe9ebdc460cbf51e296edad157b6e518 +ACPI: fix APEI related table size checking + +On Huang Ying's machine: + +erst_tab->header_length == sizeof(struct acpi_table_einj) + +but Yinghai reported that on his machine, + +erst_tab->header_length == sizeof(struct acpi_table_einj) - +sizeof(struct acpi_table_header) + +To make erst table size checking code works on all systems, both +testing are treated as PASS. + +Same situation applies to einj_tab->header_length, so corresponding +table size checking is changed in similar way too. + +Originally-by: Yinghai Lu +Signed-off-by: Huang Ying + +- use switch() for better readability +- add comment explaining why a formally invalid size it also being + accepted +- check erst_tab->header.length before even looking at + erst_tab->header_length +- prefer sizeof(*erst_tab) over sizeof(struct acpi_table_erst) + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser +Committed-by: Jan Beulich + +--- a/xen/drivers/acpi/apei/erst.c ++++ b/xen/drivers/acpi/apei/erst.c +@@ -715,12 +715,23 @@ int erst_clear(u64 record_id) + + static int __init erst_check_table(struct acpi_table_erst *erst_tab) + { +- if (erst_tab->header_length != sizeof(struct acpi_table_erst)) ++ if (erst_tab->header.length < sizeof(*erst_tab)) + return -EINVAL; +- if (erst_tab->header.length < sizeof(struct acpi_table_erst)) ++ ++ switch (erst_tab->header_length) { ++ case sizeof(*erst_tab) - sizeof(erst_tab->header): ++ /* ++ * While invalid per specification, there are (early?) systems ++ * indicating the full header size here, so accept that value too. ++ */ ++ case sizeof(*erst_tab): ++ break; ++ default: + return -EINVAL; ++ } ++ + if (erst_tab->entries != +- (erst_tab->header.length - sizeof(struct acpi_table_erst)) / ++ (erst_tab->header.length - sizeof(*erst_tab)) / + sizeof(struct acpi_erst_entry)) + return -EINVAL; + diff --git a/26062-ACPI-ERST-move-data.patch b/26062-ACPI-ERST-move-data.patch index 963274d..b817792 100644 --- a/26062-ACPI-ERST-move-data.patch +++ b/26062-ACPI-ERST-move-data.patch @@ -1,3 +1,5 @@ +References: bnc#785211 + # HG changeset patch # User Huang Ying # Date 1350475926 -7200 diff --git a/26692-x86-fully-protect-MSI-X-table-from-PV-guest-accesses.patch b/26692-x86-fully-protect-MSI-X-table-from-PV-guest-accesses.patch new file mode 100644 index 0000000..c51e4de --- /dev/null +++ b/26692-x86-fully-protect-MSI-X-table-from-PV-guest-accesses.patch @@ -0,0 +1,369 @@ +# Commit 4245d331e0e75de8d1bddbbb518f3a8ce6d0bb7e +# Date 2013-03-08 14:05:34 +0100 +# Author Jan Beulich +# Committer Jan Beulich +x86/MSI: add mechanism to fully protect MSI-X table from PV guest accesses + +This adds two new physdev operations for Dom0 to invoke when resource +allocation for devices is known to be complete, so that the hypervisor +can arrange for the respective MMIO ranges to be marked read-only +before an eventual guest getting such a device assigned even gets +started, such that it won't be able to set up writable mappings for +these MMIO ranges before Xen has a chance to protect them. + +This also addresses another issue with the code being modified here, +in that so far write protection for the address ranges in question got +set up only once during the lifetime of a device (i.e. until either +system shutdown or device hot removal), while teardown happened when +the last interrupt was disposed of by the guest (which at least allowed +the tables to be writable when the device got assigned to a second +guest [instance] after the first terminated). + +Signed-off-by: Jan Beulich + +--- a/xen/arch/x86/msi.c ++++ b/xen/arch/x86/msi.c +@@ -649,8 +649,8 @@ static u64 read_pci_mem_bar(u16 seg, u8 + * @entries: pointer to an array of struct msix_entry entries + * @nvec: number of @entries + * +- * Setup the MSI-X capability structure of device function with a +- * single MSI-X irq. A return of zero indicates the successful setup of ++ * Setup the MSI-X capability structure of device function with the requested ++ * number MSI-X irqs. A return of zero indicates the successful setup of + * requested MSI-X entries with allocated irqs or non-zero for otherwise. + **/ + static int msix_capability_init(struct pci_dev *dev, +@@ -658,86 +658,69 @@ static int msix_capability_init(struct p + struct msi_desc **desc, + unsigned int nr_entries) + { +- struct msi_desc *entry; +- int pos; ++ struct msi_desc *entry = NULL; ++ int pos, vf; + u16 control; +- u64 table_paddr, entry_paddr; +- u32 table_offset, entry_offset; +- u8 bir; +- void __iomem *base; +- int idx; ++ u64 table_paddr; ++ u32 table_offset; ++ u8 bir, pbus, pslot, pfunc; + u16 seg = dev->seg; + u8 bus = dev->bus; + u8 slot = PCI_SLOT(dev->devfn); + u8 func = PCI_FUNC(dev->devfn); + + ASSERT(spin_is_locked(&pcidevs_lock)); +- ASSERT(desc); + + pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSIX); + control = pci_conf_read16(seg, bus, slot, func, msix_control_reg(pos)); + msix_set_enable(dev, 0);/* Ensure msix is disabled as I set it up */ + +- /* MSI-X Table Initialization */ +- entry = alloc_msi_entry(); +- if ( !entry ) +- return -ENOMEM; ++ if ( desc ) ++ { ++ entry = alloc_msi_entry(); ++ if ( !entry ) ++ return -ENOMEM; ++ ASSERT(msi); ++ } + +- /* Request & Map MSI-X table region */ ++ /* Locate MSI-X table region */ + table_offset = pci_conf_read32(seg, bus, slot, func, + msix_table_offset_reg(pos)); + bir = (u8)(table_offset & PCI_MSIX_BIRMASK); + table_offset &= ~PCI_MSIX_BIRMASK; +- entry_offset = msi->entry_nr * PCI_MSIX_ENTRY_SIZE; + +- table_paddr = msi->table_base + table_offset; +- entry_paddr = table_paddr + entry_offset; +- idx = msix_get_fixmap(dev, table_paddr, entry_paddr); +- if ( idx < 0 ) +- { +- xfree(entry); +- return idx; +- } +- base = (void *)(fix_to_virt(idx) + +- ((unsigned long)entry_paddr & ((1UL << PAGE_SHIFT) - 1))); +- +- entry->msi_attrib.type = PCI_CAP_ID_MSIX; +- entry->msi_attrib.is_64 = 1; +- entry->msi_attrib.entry_nr = msi->entry_nr; +- entry->msi_attrib.maskbit = 1; +- entry->msi_attrib.masked = 1; +- entry->msi_attrib.pos = pos; +- entry->irq = msi->irq; +- entry->dev = dev; +- entry->mask_base = base; +- +- list_add_tail(&entry->list, &dev->msi_list); +- +- if ( !dev->msix_nr_entries ) ++ if ( !dev->info.is_virtfn ) + { +- u8 pbus, pslot, pfunc; +- int vf; +- u64 pba_paddr; +- u32 pba_offset; ++ pbus = bus; ++ pslot = slot; ++ pfunc = func; ++ vf = -1; ++ } ++ else ++ { ++ pbus = dev->info.physfn.bus; ++ pslot = PCI_SLOT(dev->info.physfn.devfn); ++ pfunc = PCI_FUNC(dev->info.physfn.devfn); ++ vf = PCI_BDF2(dev->bus, dev->devfn); ++ } + +- if ( !dev->info.is_virtfn ) +- { +- pbus = bus; +- pslot = slot; +- pfunc = func; +- vf = -1; +- } +- else ++ table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf); ++ WARN_ON(msi && msi->table_base != table_paddr); ++ if ( !table_paddr ) ++ { ++ if ( !msi || !msi->table_base ) + { +- pbus = dev->info.physfn.bus; +- pslot = PCI_SLOT(dev->info.physfn.devfn); +- pfunc = PCI_FUNC(dev->info.physfn.devfn); +- vf = PCI_BDF2(dev->bus, dev->devfn); ++ xfree(entry); ++ return -ENXIO; + } ++ table_paddr = msi->table_base; ++ } ++ table_paddr += table_offset; + +- ASSERT(!dev->msix_used_entries); +- WARN_ON(msi->table_base != +- read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf)); ++ if ( !dev->msix_used_entries ) ++ { ++ u64 pba_paddr; ++ u32 pba_offset; + + dev->msix_nr_entries = nr_entries; + dev->msix_table.first = PFN_DOWN(table_paddr); +@@ -758,7 +741,42 @@ static int msix_capability_init(struct p + BITS_TO_LONGS(nr_entries) - 1); + WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, dev->msix_pba.first, + dev->msix_pba.last)); ++ } ++ ++ if ( entry ) ++ { ++ /* Map MSI-X table region */ ++ u64 entry_paddr = table_paddr + msi->entry_nr * PCI_MSIX_ENTRY_SIZE; ++ int idx = msix_get_fixmap(dev, table_paddr, entry_paddr); ++ void __iomem *base; ++ ++ if ( idx < 0 ) ++ { ++ xfree(entry); ++ return idx; ++ } ++ base = (void *)(fix_to_virt(idx) + ++ ((unsigned long)entry_paddr & (PAGE_SIZE - 1))); + ++ /* Mask interrupt here */ ++ writel(1, base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); ++ ++ entry->msi_attrib.type = PCI_CAP_ID_MSIX; ++ entry->msi_attrib.is_64 = 1; ++ entry->msi_attrib.entry_nr = msi->entry_nr; ++ entry->msi_attrib.maskbit = 1; ++ entry->msi_attrib.masked = 1; ++ entry->msi_attrib.pos = pos; ++ entry->irq = msi->irq; ++ entry->dev = dev; ++ entry->mask_base = base; ++ ++ list_add_tail(&entry->list, &dev->msi_list); ++ *desc = entry; ++ } ++ ++ if ( !dev->msix_used_entries ) ++ { + if ( rangeset_add_range(mmio_ro_ranges, dev->msix_table.first, + dev->msix_table.last) ) + WARN(); +@@ -769,7 +787,7 @@ static int msix_capability_init(struct p + if ( dev->domain ) + p2m_change_entry_type_global(dev->domain, + p2m_mmio_direct, p2m_mmio_direct); +- if ( !dev->domain || !paging_mode_translate(dev->domain) ) ++ if ( desc && (!dev->domain || !paging_mode_translate(dev->domain)) ) + { + struct domain *d = dev->domain; + +@@ -783,6 +801,13 @@ static int msix_capability_init(struct p + break; + if ( d ) + { ++ if ( !IS_PRIV(d) && dev->msix_warned != d->domain_id ) ++ { ++ dev->msix_warned = d->domain_id; ++ printk(XENLOG_ERR ++ "Potentially insecure use of MSI-X on %04x:%02x:%02x.%u by Dom%d\n", ++ seg, bus, slot, func, d->domain_id); ++ } + /* XXX How to deal with existing mappings? */ + } + } +@@ -791,10 +816,6 @@ static int msix_capability_init(struct p + WARN_ON(dev->msix_table.first != (table_paddr >> PAGE_SHIFT)); + ++dev->msix_used_entries; + +- /* Mask interrupt here */ +- writel(1, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); +- +- *desc = entry; + /* Restore MSI-X enabled bits */ + pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control); + +@@ -919,6 +940,19 @@ static int __pci_enable_msix(struct msi_ + return status; + } + ++static void _pci_cleanup_msix(struct pci_dev *dev) ++{ ++ if ( !--dev->msix_used_entries ) ++ { ++ if ( rangeset_remove_range(mmio_ro_ranges, dev->msix_table.first, ++ dev->msix_table.last) ) ++ WARN(); ++ if ( rangeset_remove_range(mmio_ro_ranges, dev->msix_pba.first, ++ dev->msix_pba.last) ) ++ WARN(); ++ } ++} ++ + static void __pci_disable_msix(struct msi_desc *entry) + { + struct pci_dev *dev; +@@ -942,15 +976,45 @@ static void __pci_disable_msix(struct ms + + pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos), control); + +- if ( !--dev->msix_used_entries ) ++ _pci_cleanup_msix(dev); ++} ++ ++int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool_t off) ++{ ++ int rc; ++ struct pci_dev *pdev; ++ u8 slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn); ++ unsigned int pos = pci_find_cap_offset(seg, bus, slot, func, ++ PCI_CAP_ID_MSIX); ++ ++ if ( !use_msi ) ++ return 0; ++ ++ if ( !pos ) ++ return -ENODEV; ++ ++ spin_lock(&pcidevs_lock); ++ pdev = pci_get_pdev(seg, bus, devfn); ++ if ( !pdev ) ++ rc = -ENODEV; ++ else if ( pdev->msix_used_entries != !!off ) ++ rc = -EBUSY; ++ else if ( off ) + { +- if ( rangeset_remove_range(mmio_ro_ranges, dev->msix_table.first, +- dev->msix_table.last) ) +- WARN(); +- if ( rangeset_remove_range(mmio_ro_ranges, dev->msix_pba.first, +- dev->msix_pba.last) ) +- WARN(); ++ _pci_cleanup_msix(pdev); ++ rc = 0; + } ++ else ++ { ++ u16 control = pci_conf_read16(seg, bus, slot, func, ++ msix_control_reg(pos)); ++ ++ rc = msix_capability_init(pdev, NULL, NULL, ++ multi_msix_capable(control)); ++ } ++ spin_unlock(&pcidevs_lock); ++ ++ return rc; + } + + /* +--- a/xen/arch/x86/physdev.c ++++ b/xen/arch/x86/physdev.c +@@ -609,6 +609,18 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H + break; + } + ++ case PHYSDEVOP_prepare_msix: ++ case PHYSDEVOP_release_msix: { ++ struct physdev_pci_device dev; ++ ++ if ( copy_from_guest(&dev, arg, 1) ) ++ ret = -EFAULT; ++ else ++ ret = pci_prepare_msix(dev.seg, dev.bus, dev.devfn, ++ cmd != PHYSDEVOP_prepare_msix); ++ break; ++ } ++ + #ifdef __x86_64__ + case PHYSDEVOP_pci_mmcfg_reserved: { + struct physdev_pci_mmcfg_reserved info; +--- a/xen/include/asm-x86/msi.h ++++ b/xen/include/asm-x86/msi.h +@@ -80,6 +80,7 @@ struct msi_desc; + /* Helper functions */ + extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc); + extern void pci_disable_msi(struct msi_desc *desc); ++extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool_t off); + extern void pci_cleanup_msi(struct pci_dev *pdev); + extern void setup_msi_handler(struct irq_desc *, struct msi_desc *); + extern void setup_msi_irq(struct irq_desc *); +--- a/xen/include/public/physdev.h ++++ b/xen/include/public/physdev.h +@@ -303,6 +303,12 @@ DEFINE_XEN_GUEST_HANDLE(physdev_pci_devi + + #define PHYSDEVOP_pci_device_remove 26 + #define PHYSDEVOP_restore_msi_ext 27 ++/* ++ * Dom0 should use these two to announce MMIO resources assigned to ++ * MSI-X capable devices won't (prepare) or may (release) change. ++ */ ++#define PHYSDEVOP_prepare_msix 30 ++#define PHYSDEVOP_release_msix 31 + struct physdev_pci_device { + /* IN */ + uint16_t seg; +--- a/xen/include/xen/pci.h ++++ b/xen/include/xen/pci.h +@@ -57,6 +57,7 @@ struct pci_dev { + int msix_table_refcnt[MAX_MSIX_TABLE_PAGES]; + int msix_table_idx[MAX_MSIX_TABLE_PAGES]; + spinlock_t msix_table_lock; ++ domid_t msix_warned; + + struct domain *domain; + const u16 seg; diff --git a/26702-powernow-add-fixups-for-AMD-P-state-figures.patch b/26702-powernow-add-fixups-for-AMD-P-state-figures.patch new file mode 100644 index 0000000..d3b378d --- /dev/null +++ b/26702-powernow-add-fixups-for-AMD-P-state-figures.patch @@ -0,0 +1,139 @@ +# Commit 1d80765b504b34b63a42a63aff4291e07e29f0c5 +# Date 2013-03-12 15:34:22 +0100 +# Author Konrad Rzeszutek Wilk +# Committer Jan Beulich +powernow: add fixups for AMD P-state figures + +In the Linux kernel, these two git commits: + +- f594065faf4f9067c2283a34619fc0714e79a98d + ACPI: Add fixups for AMD P-state figures +- 9855d8ce41a7801548a05d844db2f46c3e810166 + ACPI: Check MSR valid bit before using P-state frequencies + +Try to fix the the issue that "some AMD systems may round the +frequencies in ACPI tables to 100MHz boundaries. We can obtain the real +frequencies from MSRs, so add a quirk to fix these frequencies up +on AMD systems." (from f594065..) + +In discussion (around 9855d8..) "it turned out that indeed real +HW/BIOSes may choose to not set the valid bit and thus mark the +P-state as invalid. So this could be considered a fix for broken +BIOSes." (from 9855d8..) + +which is great for Linux. Unfortunatly the Linux kernel, when +it tries to do the RDMSR under Xen it fails to get the right +value (it gets zero) as Xen traps it and returns zero. Hence +when dom0 uploads the P-states they will be unmodified and +we should take care of updating the frequencies with the right +values. + +I've tested it under Dell Inc. PowerEdge T105 /0RR825, BIOS 1.3.2 +08/20/2008 where this quirk can be observed (x86 == 0x10, model == 2). +Also on other AMD (x86 == 0x12, A8-3850; x86 = 0x14, AMD E-350) to +make sure the quirk is not applied there. + +Signed-off-by: Konrad Rzeszutek Wilk +Acked-by: stefan.bader@canonical.com + +Do the MSR access here (and while at it, also the one reading +MSR_PSTATE_CUR_LIMIT) on the target CPU, and bound the loop over +amd_fixup_frequency() by max_hw_pstate (matching the one in +powernow_cpufreq_cpu_init()). + +Signed-off-by: Jan Beulich + +--- a/xen/arch/x86/acpi/cpufreq/powernow.c ++++ b/xen/arch/x86/acpi/cpufreq/powernow.c +@@ -159,6 +159,51 @@ static int powernow_cpufreq_target(struc + return result; + } + ++static void amd_fixup_frequency(struct xen_processor_px *px) ++{ ++ u32 hi, lo, fid, did; ++ int index = px->control & 0x00000007; ++ const struct cpuinfo_x86 *c = ¤t_cpu_data; ++ ++ if ((c->x86 != 0x10 || c->x86_model >= 10) && c->x86 != 0x11) ++ return; ++ ++ rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi); ++ /* ++ * MSR C001_0064+: ++ * Bit 63: PstateEn. Read-write. If set, the P-state is valid. ++ */ ++ if (!(hi & (1U << 31))) ++ return; ++ ++ fid = lo & 0x3f; ++ did = (lo >> 6) & 7; ++ if (c->x86 == 0x10) ++ px->core_frequency = (100 * (fid + 16)) >> did; ++ else ++ px->core_frequency = (100 * (fid + 8)) >> did; ++} ++ ++struct amd_cpu_data { ++ struct processor_performance *perf; ++ u32 max_hw_pstate; ++}; ++ ++static void get_cpu_data(void *arg) ++{ ++ struct amd_cpu_data *data = arg; ++ struct processor_performance *perf = data->perf; ++ uint64_t msr_content; ++ unsigned int i; ++ ++ rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content); ++ data->max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >> ++ HW_PSTATE_MAX_SHIFT; ++ ++ for (i = 0; i < perf->state_count && i <= data->max_hw_pstate; i++) ++ amd_fixup_frequency(&perf->states[i]); ++} ++ + static int powernow_cpufreq_verify(struct cpufreq_policy *policy) + { + struct acpi_cpufreq_data *data; +@@ -205,8 +250,7 @@ static int powernow_cpufreq_cpu_init(str + struct acpi_cpufreq_data *data; + unsigned int result = 0; + struct processor_performance *perf; +- u32 max_hw_pstate; +- uint64_t msr_content; ++ struct amd_cpu_data info; + struct cpuinfo_x86 *c = &cpu_data[policy->cpu]; + + data = xzalloc(struct acpi_cpufreq_data); +@@ -217,7 +261,7 @@ static int powernow_cpufreq_cpu_init(str + + data->acpi_data = &processor_pminfo[cpu]->perf; + +- perf = data->acpi_data; ++ info.perf = perf = data->acpi_data; + policy->shared_type = perf->shared_type; + + if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || +@@ -239,8 +283,6 @@ static int powernow_cpufreq_cpu_init(str + result = -ENODEV; + goto err_unreg; + } +- rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content); +- max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT; + + if (perf->control_register.space_id != perf->status_register.space_id) { + result = -ENODEV; +@@ -265,8 +307,10 @@ static int powernow_cpufreq_cpu_init(str + + policy->governor = cpufreq_opt_governor ? : CPUFREQ_DEFAULT_GOVERNOR; + ++ on_selected_cpus(cpumask_of(cpu), get_cpu_data, &info, 1); ++ + /* table init */ +- for (i = 0; i < perf->state_count && i <= max_hw_pstate; i++) { ++ for (i = 0; i < perf->state_count && i <= info.max_hw_pstate; i++) { + if (i > 0 && perf->states[i].core_frequency >= + data->freq_table[valid_states-1].frequency / 1000) + continue; diff --git a/26704-x86-MCA-suppress-bank-clearing-for-certain-injected-events.patch b/26704-x86-MCA-suppress-bank-clearing-for-certain-injected-events.patch new file mode 100644 index 0000000..f1b251b --- /dev/null +++ b/26704-x86-MCA-suppress-bank-clearing-for-certain-injected-events.patch @@ -0,0 +1,72 @@ +References: bnc#805579 + +# Commit b0583c0e64cc8bb6229c95c3304fdac2051f79b3 +# Date 2013-03-12 15:53:30 +0100 +# Author Jan Beulich +# Committer Jan Beulich +x86/MCA: suppress bank clearing for certain injected events + +As the bits indicating validity of the ADDR and MISC bank MSRs may be +injected in a way that isn't consistent with what the underlying +hardware implements (while the bank must be valid for injection to +work, the auxiliary MSRs may not be implemented - and hence cause #GP +upon access - if the hardware never sets the corresponding valid bits. + +Consequently we need to do the clearing writes only if no value was +interposed for the respective MSR (which also makes sense the other way +around: there's no point in clearing a hardware register when all data +read came from software). Of course this all requires the injection +tool to do things in a consistent way (but that had been a requirement +before already). + +Signed-off-by: Jan Beulich +Tested-by: Ren Yongjie +Acked-by: Liu Jinsong + +--- a/xen/arch/x86/cpu/mcheck/mce.c ++++ b/xen/arch/x86/cpu/mcheck/mce.c +@@ -1145,13 +1145,15 @@ static void intpose_add(unsigned int cpu + printk("intpose_add: interpose array full - request dropped\n"); + } + +-void intpose_inval(unsigned int cpu_nr, uint64_t msr) ++bool_t intpose_inval(unsigned int cpu_nr, uint64_t msr) + { +- struct intpose_ent *ent; ++ struct intpose_ent *ent = intpose_lookup(cpu_nr, msr, NULL); + +- if ((ent = intpose_lookup(cpu_nr, msr, NULL)) != NULL) { +- ent->cpu_nr = -1; +- } ++ if ( !ent ) ++ return 0; ++ ++ ent->cpu_nr = -1; ++ return 1; + } + + #define IS_MCA_BANKREG(r) \ +--- a/xen/arch/x86/cpu/mcheck/mce.h ++++ b/xen/arch/x86/cpu/mcheck/mce.h +@@ -89,7 +89,7 @@ extern void mce_recoverable_register(mce + /* Read an MSR, checking for an interposed value first */ + extern struct intpose_ent *intpose_lookup(unsigned int, uint64_t, + uint64_t *); +-extern void intpose_inval(unsigned int, uint64_t); ++extern bool_t intpose_inval(unsigned int, uint64_t); + + static inline uint64_t mca_rdmsr(unsigned int msr) + { +@@ -101,9 +101,9 @@ static inline uint64_t mca_rdmsr(unsigne + + /* Write an MSR, invalidating any interposed value */ + #define mca_wrmsr(msr, val) do { \ +- intpose_inval(smp_processor_id(), msr); \ +- wrmsrl(msr, val); \ +-} while (0) ++ if ( !intpose_inval(smp_processor_id(), msr) ) \ ++ wrmsrl(msr, val); \ ++} while ( 0 ) + + + /* Utility function to "logout" all architectural MCA telemetry from the MCA diff --git a/26731-AMD-IOMMU-Process-softirqs-while-building-dom0-iommu-mappings.patch b/26731-AMD-IOMMU-Process-softirqs-while-building-dom0-iommu-mappings.patch new file mode 100644 index 0000000..6c5d01a --- /dev/null +++ b/26731-AMD-IOMMU-Process-softirqs-while-building-dom0-iommu-mappings.patch @@ -0,0 +1,32 @@ +# Commit 0f7b6f91ac1bbfd33b23c291b14874b9561909d2 +# Date 2013-03-20 10:00:01 +0100 +# Author Andrew Cooper +# Committer Jan Beulich +AMD/IOMMU: Process softirqs while building dom0 iommu mappings + +Recent changes which have made their way into xen-4.2 stable have pushed the +runtime of construct_dom0() over 5 seconds, which has caused regressions in +XenServer testing because of our 5 second watchdog. + +The root cause is that amd_iommu_dom0_init() does not process softirqs and in +particular the nmi_timer which causes the watchdog to decide that no useful +progress is being made. + +This patch adds periodic calls to process_pending_softirqs() at the same +interval as the Intel variant of this function. The server which was failing +with the watchdog test now boots reliably with a timeout of 1 second. + +Signed-off-by: Andrew Cooper + +--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c ++++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c +@@ -285,6 +285,9 @@ static void __init amd_iommu_dom0_init(s + if ( mfn_valid(pfn) ) + amd_iommu_map_page(d, pfn, pfn, + IOMMUF_readable|IOMMUF_writable); ++ ++ if ( !(i & 0xfffff) ) ++ process_pending_softirqs(); + } + } + diff --git a/26733-VT-d-Enumerate-IOMMUs-when-listing-capabilities.patch b/26733-VT-d-Enumerate-IOMMUs-when-listing-capabilities.patch new file mode 100644 index 0000000..45c5339 --- /dev/null +++ b/26733-VT-d-Enumerate-IOMMUs-when-listing-capabilities.patch @@ -0,0 +1,22 @@ +# Commit 32861c537781ac94bf403fb778505c3679b85f67 +# Date 2013-03-20 10:02:26 +0100 +# Author Andrew Cooper +# Committer Jan Beulich +VT-d: Enumerate IOMMUs when listing capabilities + +This saves N identical console log lines on a multi-iommu server. + +Signed-off-by: Andrew Cooper + +--- a/xen/drivers/passthrough/vtd/iommu.c ++++ b/xen/drivers/passthrough/vtd/iommu.c +@@ -2135,7 +2135,8 @@ int __init intel_vtd_setup(void) + { + iommu = drhd->iommu; + +- printk("Intel VT-d supported page sizes: 4kB"); ++ printk("Intel VT-d iommu %"PRIu32" supported page sizes: 4kB", ++ iommu->index); + if (cap_sps_2mb(iommu->cap)) + printk(", 2MB"); + diff --git a/26734-ACPI-ERST-Name-table-in-otherwise-opaque-error-messages.patch b/26734-ACPI-ERST-Name-table-in-otherwise-opaque-error-messages.patch new file mode 100644 index 0000000..21a942b --- /dev/null +++ b/26734-ACPI-ERST-Name-table-in-otherwise-opaque-error-messages.patch @@ -0,0 +1,28 @@ +# Commit 759847e44401176401e86e7c55b644cb9f93c781 +# Date 2013-03-20 10:02:52 +0100 +# Author Andrew Cooper +# Committer Jan Beulich +ACPI/ERST: Name table in otherwise opaque error messages + +Signed-off-by: Andrew Cooper + +Fix spelling and lower severities. + +Signed-off-by: Jan Beulich + +--- a/xen/drivers/acpi/apei/erst.c ++++ b/xen/drivers/acpi/apei/erst.c +@@ -799,11 +799,11 @@ int __init erst_init(void) + status = acpi_get_table(ACPI_SIG_ERST, 0, + (struct acpi_table_header **)&erst_tab); + if (status == AE_NOT_FOUND) { +- printk(KERN_ERR "Table is not found!\n"); ++ printk(KERN_INFO "ERST table was not found\n"); + return -ENODEV; + } else if (ACPI_FAILURE(status)) { + const char *msg = acpi_format_exception(status); +- printk(KERN_ERR "Failed to get table, %s\n", msg); ++ printk(KERN_WARNING "Failed to get ERST table: %s\n", msg); + return -EINVAL; + } + diff --git a/26736-ACPI-APEI-Unlock-apei_iomaps_lock-on-error-path.patch b/26736-ACPI-APEI-Unlock-apei_iomaps_lock-on-error-path.patch new file mode 100644 index 0000000..e7a45ea --- /dev/null +++ b/26736-ACPI-APEI-Unlock-apei_iomaps_lock-on-error-path.patch @@ -0,0 +1,34 @@ +References: bnc#785211 + +# Commit 0611689d9153227831979c7bafe594214b8505a3 +# Date 2013-03-22 09:43:38 +0100 +# Author Andrew Cooper +# Committer Jan Beulich +ACPI/APEI: Unlock apei_iomaps_lock on error path + +This causes deadlocks during early boot on hardware with broken/buggy +APEI implementations, such as a Dell Poweredge 2950 with the latest +currently available BIOS. + +Signed-off-by: Andrew Cooper + +Don't use goto or another special error path, as handling the error +case in normal flow is quite simple. + +Signed-off-by: Jan Beulich + +--- a/xen/drivers/acpi/apei/apei-io.c ++++ b/xen/drivers/acpi/apei/apei-io.c +@@ -146,10 +146,8 @@ static void __init apei_post_unmap(paddr + + spin_lock_irqsave(&apei_iomaps_lock, flags); + map = __apei_find_iomap(paddr, size); +- if (!map) +- return; +- +- list_del(&map->list); ++ if (map) ++ list_del(&map->list); + spin_unlock_irqrestore(&apei_iomaps_lock, flags); + + xfree(map); diff --git a/26737-ACPI-APEI-Add-apei_exec_run_optional.patch b/26737-ACPI-APEI-Add-apei_exec_run_optional.patch new file mode 100644 index 0000000..7b60230 --- /dev/null +++ b/26737-ACPI-APEI-Add-apei_exec_run_optional.patch @@ -0,0 +1,70 @@ +References: bnc#785211 + +# Commit 72af01bf6f7489e54ad59270222a29d3e8c501d1 +# Date 2013-03-22 12:46:25 +0100 +# Author Huang Ying +# Committer Jan Beulich +ACPI, APEI: Add apei_exec_run_optional + +Some actions in APEI ERST and EINJ tables are optional, for example, +ACPI_EINJ_BEGIN_OPERATION action is used to do some preparation for +error injection, and firmware may choose to do nothing here. While +some other actions are mandatory, for example, firmware must provide +ACPI_EINJ_GET_ERROR_TYPE implementation. + +Original implementation treats all actions as optional (that is, can +have no instructions), that may cause issue if firmware does not +provide some mandatory actions. To fix this, this patch adds +apei_exec_run_optional, which should be used for optional actions. +The original apei_exec_run should be used for mandatory actions. + +Signed-off-by: Huang Ying +Signed-off-by: Jan Beulich +Tested-by: Andrew Cooper + +--- a/xen/drivers/acpi/apei/apei-base.c ++++ b/xen/drivers/acpi/apei/apei-base.c +@@ -154,9 +154,10 @@ int apei_exec_noop(struct apei_exec_cont + * Interpret the specified action. Go through whole action table, + * execute all instructions belong to the action. + */ +-int apei_exec_run(struct apei_exec_context *ctx, u8 action) ++int __apei_exec_run(struct apei_exec_context *ctx, u8 action, ++ bool_t optional) + { +- int rc; ++ int rc = -ENOENT; + u32 i, ip; + struct acpi_whea_header *entry; + apei_exec_ins_func_t run; +@@ -195,7 +196,7 @@ rewind: + goto rewind; + } + +- return 0; ++ return !optional && rc < 0 ? rc : 0; + } + + typedef int (*apei_exec_entry_func_t)(struct apei_exec_context *ctx, +--- a/xen/drivers/acpi/apei/apei-internal.h ++++ b/xen/drivers/acpi/apei/apei-internal.h +@@ -48,7 +48,18 @@ static inline u64 apei_exec_ctx_get_outp + return ctx->value; + } + +-int apei_exec_run(struct apei_exec_context *ctx, u8 action); ++int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool_t optional); ++ ++static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action) ++{ ++ return __apei_exec_run(ctx, action, 0); ++} ++ ++/* It is optional whether the firmware provides the action */ ++static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 action) ++{ ++ return __apei_exec_run(ctx, action, 1); ++} + + /* Common instruction implementation */ + diff --git a/26742-IOMMU-properly-check-whether-interrupt-remapping-is-enabled.patch b/26742-IOMMU-properly-check-whether-interrupt-remapping-is-enabled.patch new file mode 100644 index 0000000..e718ed0 --- /dev/null +++ b/26742-IOMMU-properly-check-whether-interrupt-remapping-is-enabled.patch @@ -0,0 +1,96 @@ +# Commit fae0372140befb88d890a30704a8ec058c902af8 +# Date 2013-03-25 14:28:31 +0100 +# Author Jan Beulich +# Committer Jan Beulich +IOMMU: properly check whether interrupt remapping is enabled + +... rather than the IOMMU as a whole. + +That in turn required to make sure iommu_intremap gets properly +cleared when the respective initialization fails (or isn't being +done at all). + +Along with making sure interrupt remapping doesn't get inconsistently +enabled on some IOMMUs and not on others in the VT-d code, this in turn +allowed quite a bit of cleanup on the VT-d side (removed from the +backport). + +Signed-off-by: Jan Beulich +Acked-by: "Zhang, Xiantao" + +--- a/xen/arch/x86/msi.c ++++ b/xen/arch/x86/msi.c +@@ -204,7 +204,7 @@ static void read_msi_msg(struct msi_desc + BUG(); + } + +- if ( iommu_enabled ) ++ if ( iommu_intremap ) + iommu_read_msi_from_ire(entry, msg); + } + +@@ -212,7 +212,7 @@ static void write_msi_msg(struct msi_des + { + entry->msg = *msg; + +- if ( iommu_enabled ) ++ if ( iommu_intremap ) + { + ASSERT(msg != &entry->msg); + iommu_update_ire_from_msi(entry, msg); +@@ -482,7 +482,7 @@ int msi_free_irq(struct msi_desc *entry) + } + + /* Free the unused IRTE if intr remap enabled */ +- if ( iommu_enabled ) ++ if ( iommu_intremap ) + iommu_update_ire_from_msi(entry, NULL); + + list_del(&entry->list); +--- a/xen/drivers/passthrough/iommu.c ++++ b/xen/drivers/passthrough/iommu.c +@@ -469,6 +469,8 @@ int __init iommu_setup(void) + rc = iommu_hardware_setup(); + iommu_enabled = (rc == 0); + } ++ if ( !iommu_enabled ) ++ iommu_intremap = 0; + + if ( (force_iommu && !iommu_enabled) || + (force_intremap && !iommu_intremap) ) +@@ -485,9 +487,12 @@ int __init iommu_setup(void) + } + printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis"); + if ( iommu_enabled ) ++ { + printk(" - Dom0 mode: %s\n", + iommu_passthrough ? "Passthrough" : + iommu_dom0_strict ? "Strict" : "Relaxed"); ++ printk("Interrupt remapping %sabled\n", iommu_intremap ? "en" : "dis"); ++ } + + return rc; + } +--- a/xen/drivers/passthrough/vtd/iommu.c ++++ b/xen/drivers/passthrough/vtd/iommu.c +@@ -2072,6 +2072,9 @@ static int init_vtd_hw(void) + break; + } + } ++ if ( !iommu_intremap ) ++ for_each_drhd_unit ( drhd ) ++ disable_intremap(drhd->iommu); + } + + /* +--- a/xen/include/asm-x86/io_apic.h ++++ b/xen/include/asm-x86/io_apic.h +@@ -129,7 +129,7 @@ struct IO_APIC_route_entry { + extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; + + /* Only need to remap ioapic RTE (reg: 10~3Fh) */ +-#define ioapic_reg_remapped(reg) (iommu_enabled && ((reg) >= 0x10)) ++#define ioapic_reg_remapped(reg) (iommu_intremap && ((reg) >= 0x10)) + + static inline unsigned int __io_apic_read(unsigned int apic, unsigned int reg) + { diff --git a/26743-VT-d-deal-with-5500-5520-X58-errata.patch b/26743-VT-d-deal-with-5500-5520-X58-errata.patch new file mode 100644 index 0000000..9b57f32 --- /dev/null +++ b/26743-VT-d-deal-with-5500-5520-X58-errata.patch @@ -0,0 +1,90 @@ +References: bnc#801910 + +# Commit 6890cebc6a987d0e896f5d23a8de11a3934101cf +# Date 2013-03-25 14:31:27 +0100 +# Author Malcolm Crossley +# Committer Jan Beulich +VT-d: deal with 5500/5520/X58 errata + +http://www.intel.com/content/www/us/en/chipsets/5520-and-5500-chipset-ioh-specification-update.html + +Stepping B-3 has two errata (#47 and #53) related to Interrupt +remapping, to which the workaround is for the BIOS to completely disable +interrupt remapping. These errata are fixed in stepping C-2. + +Unfortunately this chipset stepping is very common and many BIOSes are +not disabling interrupt remapping on this stepping . We can detect this in +Xen and prevent Xen from using the problematic interrupt remapping feature. + +The Intel 5500/5520/X58 chipset does not support VT-d +Extended Interrupt Mode(EIM). This means the iommu_supports_eim() check +always fails and so x2apic mode cannot be enabled in Xen before this quirk +disables the interrupt remapping feature. + +Signed-off-by: Malcolm Crossley +Signed-off-by: Andrew Cooper + +Gate the function call to check the quirk on interrupt remapping being +requested to get enabled, and upon failure disable the IOMMU to be in +line with what the changes for XSA-36 (plus follow-ups) did. + +Signed-off-by: Jan Beulich +Acked-by: "Zhang, Xiantao" + +--- a/xen/drivers/passthrough/vtd/iommu.c ++++ b/xen/drivers/passthrough/vtd/iommu.c +@@ -2129,6 +2129,11 @@ int __init intel_vtd_setup(void) + } + + platform_quirks_init(); ++ if ( !iommu_enabled ) ++ { ++ ret = -ENODEV; ++ goto error; ++ } + + /* We enable the following features only if they are supported by all VT-d + * engines: Snoop Control, DMA passthrough, Queued Invalidation and +--- a/xen/drivers/passthrough/vtd/quirks.c ++++ b/xen/drivers/passthrough/vtd/quirks.c +@@ -248,6 +248,29 @@ void vtd_ops_postamble_quirk(struct iomm + } + } + ++/* 5500/5520/X58 Chipset Interrupt remapping errata, for stepping B-3. ++ * Fixed in stepping C-2. */ ++static void __init tylersburg_intremap_quirk(void) ++{ ++ uint32_t bus, device; ++ uint8_t rev; ++ ++ for ( bus = 0; bus < 0x100; bus++ ) ++ { ++ /* Match on System Management Registers on Device 20 Function 0 */ ++ device = pci_conf_read32(0, bus, 20, 0, PCI_VENDOR_ID); ++ rev = pci_conf_read8(0, bus, 20, 0, PCI_REVISION_ID); ++ ++ if ( rev == 0x13 && device == 0x342e8086 ) ++ { ++ printk(XENLOG_WARNING VTDPREFIX ++ "Disabling IOMMU due to Intel 5500/5520/X58 Chipset errata #47, #53\n"); ++ iommu_enabled = 0; ++ break; ++ } ++ } ++} ++ + /* initialize platform identification flags */ + void __init platform_quirks_init(void) + { +@@ -268,6 +291,10 @@ void __init platform_quirks_init(void) + + /* ioremap IGD MMIO+0x2000 page */ + map_igd_reg(); ++ ++ /* Tylersburg interrupt remap quirk */ ++ if ( iommu_intremap ) ++ tylersburg_intremap_quirk(); + } + + /* diff --git a/26744-AMD-IOMMU-allow-disabling-only-interrupt-remapping.patch b/26744-AMD-IOMMU-allow-disabling-only-interrupt-remapping.patch new file mode 100644 index 0000000..a705a10 --- /dev/null +++ b/26744-AMD-IOMMU-allow-disabling-only-interrupt-remapping.patch @@ -0,0 +1,63 @@ +# Commit 92b8bc03bd4b582cb524db51494d0dba7607e7ac +# Date 2013-03-25 16:55:22 +0100 +# Author Jan Beulich +# Committer Jan Beulich +AMD IOMMU: allow disabling only interrupt remapping when certain IVRS consistency checks fail + +After some more thought on the XSA-36 and specifically the comments we +got regarding disabling the IOMMU in this situation altogether making +things worse instead of better, I came to the conclusion that we can +actually restrict the action in affected cases to just disabling +interrupt remapping. That doesn't make the situation worse than prior +to the XSA-36 fixes (where interrupt remapping didn't really protect +domains from one another), but allows at least DMA isolation to still +be utilized. + +To do so, disabling of interrupt remapping must be explicitly requested +on the command line - respective checks will then be skipped. + +Signed-off-by: Jan Beulich +Acked-by: Suravee Suthikulanit + +--- a/xen/drivers/passthrough/amd/iommu_acpi.c ++++ b/xen/drivers/passthrough/amd/iommu_acpi.c +@@ -664,6 +664,9 @@ static u16 __init parse_ivhd_device_spec + return dev_length; + } + ++ if ( !iommu_intremap ) ++ return dev_length; ++ + /* + * Some BIOSes have IOAPIC broken entries so we check for IVRS + * consistency here --- whether entry's IOAPIC ID is valid and +@@ -902,7 +905,7 @@ static int __init parse_ivrs_table(struc + } + + /* Each IO-APIC must have been mentioned in the table. */ +- for ( apic = 0; !error && apic < nr_ioapics; ++apic ) ++ for ( apic = 0; !error && iommu_intremap && apic < nr_ioapics; ++apic ) + { + if ( !nr_ioapic_entries[apic] || + ioapic_sbdf[IO_APIC_ID(apic)].pin_setup ) +--- a/xen/drivers/passthrough/amd/iommu_init.c ++++ b/xen/drivers/passthrough/amd/iommu_init.c +@@ -1192,7 +1192,8 @@ int __init amd_iommu_init(void) + + BUG_ON( !iommu_found() ); + +- if ( amd_iommu_perdev_intremap && amd_sp5100_erratum28() ) ++ if ( iommu_intremap && amd_iommu_perdev_intremap && ++ amd_sp5100_erratum28() ) + goto error_out; + + ivrs_bdf_entries = amd_iommu_get_ivrs_dev_entries(); +@@ -1209,7 +1210,7 @@ int __init amd_iommu_init(void) + goto error_out; + + /* initialize io-apic interrupt remapping entries */ +- if ( amd_iommu_setup_ioapic_remapping() != 0 ) ++ if ( iommu_intremap && amd_iommu_setup_ioapic_remapping() != 0 ) + goto error_out; + + /* allocate and initialize a global device table shared by all iommus */ diff --git a/32on64-extra-mem.patch b/32on64-extra-mem.patch index 7eaa83a..890a97b 100644 --- a/32on64-extra-mem.patch +++ b/32on64-extra-mem.patch @@ -2,7 +2,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -2982,7 +2982,7 @@ class XendDomainInfo: +@@ -2984,7 +2984,7 @@ class XendDomainInfo: self.guest_bitsize = self.image.getBitSize() # Make sure there's enough RAM available for the domain diff --git a/blktap.patch b/blktap.patch index 3644ec0..a9603c2 100644 --- a/blktap.patch +++ b/blktap.patch @@ -5,7 +5,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -3315,7 +3315,7 @@ class XendDomainInfo: +@@ -3317,7 +3317,7 @@ class XendDomainInfo: (fn, BOOTLOADER_LOOPBACK_DEVICE)) vbd = { diff --git a/change-vnc-passwd.patch b/change-vnc-passwd.patch index 232b503..65bab24 100644 --- a/change-vnc-passwd.patch +++ b/change-vnc-passwd.patch @@ -63,7 +63,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -1504,6 +1504,20 @@ class XendDomainInfo: +@@ -1506,6 +1506,20 @@ class XendDomainInfo: target = max_target self.setMemoryTarget(target) diff --git a/change_home_server.patch b/change_home_server.patch index ce87435..185007c 100644 --- a/change_home_server.patch +++ b/change_home_server.patch @@ -2,7 +2,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -3153,6 +3153,11 @@ class XendDomainInfo: +@@ -3155,6 +3155,11 @@ class XendDomainInfo: self._cleanup_phantom_devs(paths) self._cleanupVm() diff --git a/checkpoint-rename.patch b/checkpoint-rename.patch index 239b628..fbabdaa 100644 --- a/checkpoint-rename.patch +++ b/checkpoint-rename.patch @@ -2,7 +2,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -185,7 +185,7 @@ def save(fd, dominfo, network, live, dst +@@ -188,7 +188,7 @@ def save(fd, dominfo, network, live, dst dominfo.destroy() dominfo.testDeviceComplete() try: diff --git a/multi-xvdp.patch b/multi-xvdp.patch index d83ea8d..da1c397 100644 --- a/multi-xvdp.patch +++ b/multi-xvdp.patch @@ -18,7 +18,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py xc = xen.lowlevel.xc.xc() xoptions = XendOptions.instance() -@@ -3322,33 +3322,38 @@ class XendDomainInfo: +@@ -3324,33 +3324,38 @@ class XendDomainInfo: # This is a file, not a device. pygrub can cope with a # file if it's raw, but if it's QCOW or other such formats # used through blktap, then we need to mount it first. diff --git a/x86-EFI-set-variable-permit-attrs.patch b/x86-EFI-set-variable-permit-attrs.patch new file mode 100644 index 0000000..d0e2b1f --- /dev/null +++ b/x86-EFI-set-variable-permit-attrs.patch @@ -0,0 +1,14 @@ +References: bnc#811764 + +--- a/xen/arch/x86/efi/runtime.c ++++ b/xen/arch/x86/efi/runtime.c +@@ -380,9 +380,6 @@ int efi_runtime_call(struct xenpf_efi_ru + long len; + unsigned char *data; + +- if ( op->misc ) +- return -EINVAL; +- + len = gwstrlen(guest_handle_cast(op->u.set_variable.name, CHAR16)); + if ( len < 0 ) + return len; diff --git a/xen-domUloader.diff b/xen-domUloader.diff index 5f0d5a5..b81e57b 100644 --- a/xen-domUloader.diff +++ b/xen-domUloader.diff @@ -79,7 +79,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -2347,6 +2347,10 @@ class XendDomainInfo: +@@ -2349,6 +2349,10 @@ class XendDomainInfo: deviceClass, config = self.info['devices'].get(dev_uuid) self._waitForDevice(deviceClass, config['devid']) @@ -90,7 +90,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py def _waitForDevice_destroy(self, deviceClass, devid, backpath): return self.getDeviceController(deviceClass).waitForDevice_destroy( devid, backpath) -@@ -3297,7 +3301,8 @@ class XendDomainInfo: +@@ -3299,7 +3303,8 @@ class XendDomainInfo: from xen.xend import XendDomain dom0 = XendDomain.instance().privilegedDomain() mounted_vbd_uuid = dom0.create_vbd(vbd, disk); @@ -100,7 +100,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py fn = BOOTLOADER_LOOPBACK_DEVICE try: -@@ -3307,10 +3312,10 @@ class XendDomainInfo: +@@ -3309,10 +3314,10 @@ class XendDomainInfo: if mounted: log.info("Unmounting %s from %s." % (fn, BOOTLOADER_LOOPBACK_DEVICE)) diff --git a/xen-managed-pci-device.patch b/xen-managed-pci-device.patch index e012fdd..97e11aa 100644 --- a/xen-managed-pci-device.patch +++ b/xen-managed-pci-device.patch @@ -272,7 +272,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py # If there is no device left, destroy pci and remove config. if num_devs == 0: if self.info.is_hvm(): -@@ -3168,6 +3197,7 @@ class XendDomainInfo: +@@ -3170,6 +3199,7 @@ class XendDomainInfo: log.debug("%s KiB need to add to Memory pool" %self.alloc_mem) MemoryPool.instance().increase_memory(self.alloc_mem) diff --git a/xen-max-free-mem.diff b/xen-max-free-mem.diff index 81ee8b1..734578d 100644 --- a/xen-max-free-mem.diff +++ b/xen-max-free-mem.diff @@ -92,7 +92,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -1473,6 +1473,27 @@ class XendDomainInfo: +@@ -1475,6 +1475,27 @@ class XendDomainInfo: self.info['abort_if_busy'] = str(abort_if_busy) self.info['log_save_progress'] = str(log_save_progress) diff --git a/xen.changes b/xen.changes index 1d43161..63bd64f 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Tue Apr 2 15:41:19 CEST 2013 - ohering@suse.de + +- bnc#797014 - no way to control live migrations +- bnc#803712 - after live migration rcu_sched_state detected stalls + xen.migrate.tools-xend_move_assert_to_exception_block.patch + xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch + xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch + xen.migrate.tools_notify_restore_to_hangup_during_migration_--abort_if_busy.patch + +------------------------------------------------------------------- +Tue Mar 26 10:37:43 MDT 2013 - carnold@suse.com + +- bnc#811764 - XEN (hypervisor or kernel) has a problem with EFI + variable services + x86-EFI-set-variable-permit-attrs.patch +- Upstream patches from Jan + 26060-ACPI-ERST-table-size-checks.patch + 26692-x86-fully-protect-MSI-X-table-from-PV-guest-accesses.patch + 26702-powernow-add-fixups-for-AMD-P-state-figures.patch + 26704-x86-MCA-suppress-bank-clearing-for-certain-injected-events.patch (bnc#805579) + 26731-AMD-IOMMU-Process-softirqs-while-building-dom0-iommu-mappings.patch + 26733-VT-d-Enumerate-IOMMUs-when-listing-capabilities.patch + 26734-ACPI-ERST-Name-table-in-otherwise-opaque-error-messages.patch + 26736-ACPI-APEI-Unlock-apei_iomaps_lock-on-error-path.patch + 26737-ACPI-APEI-Add-apei_exec_run_optional.patch + 26742-IOMMU-properly-check-whether-interrupt-remapping-is-enabled.patch + 26743-VT-d-deal-with-5500-5520-X58-errata.patch (bnc#801910) + 26744-AMD-IOMMU-allow-disabling-only-interrupt-remapping.patch + ------------------------------------------------------------------- Thu Mar 14 09:58:38 MDT 2013 - jfehlig@suse.com diff --git a/xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch b/xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch new file mode 100644 index 0000000..75baeaf --- /dev/null +++ b/xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch @@ -0,0 +1,25 @@ +user: Olaf Hering +date: Thu Mar 28 15:36:07 2013 +0100 +files: tools/libxc/xc_domain_save.c +description: +tools/libxc: print stats if migration is aborted + +Signed-off-by: Olaf Hering + + +--- + tools/libxc/xc_domain_save.c | 1 + + 1 file changed, 1 insertion(+) + +Index: xen-4.2.1-testing/tools/libxc/xc_domain_save.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/xc_domain_save.c ++++ xen-4.2.1-testing/tools/libxc/xc_domain_save.c +@@ -1536,6 +1536,7 @@ int xc_domain_save(xc_interface *xch, in + ERROR("Live migration aborted, as requested. (guest too busy?)" + " total_sent %lu iter %d, max_iters %u max_factor %u", + total_sent, iter, max_iters, max_factor); ++ print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1); + rc = 1; + goto out; + } diff --git a/xen.migrate.tools-xend_move_assert_to_exception_block.patch b/xen.migrate.tools-xend_move_assert_to_exception_block.patch new file mode 100644 index 0000000..2fbc591 --- /dev/null +++ b/xen.migrate.tools-xend_move_assert_to_exception_block.patch @@ -0,0 +1,43 @@ +user: Olaf Hering +date: Thu Mar 28 15:36:02 2013 +0100 +files: tools/python/xen/xend/XendCheckpoint.py +description: +tools/xend: move assert to exception block + +The two assert in restore trigger sometimes after hundreds of +migrations. If they trigger the destination host will not destroy the +newly created, still empty guest. After a second migration attempt to +this host there will be two guets with the same name and uuid. This +situation is poorly handled by the xm tools. +With this change the guest will be destroyed. + +Signed-off-by: Olaf Hering + +--- + tools/python/xen/xend/XendCheckpoint.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py +=================================================================== +--- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py +@@ -262,9 +262,6 @@ def restore(xd, fd, dominfo = None, paus + store_port = dominfo.getStorePort() + console_port = dominfo.getConsolePort() + +- assert store_port +- assert console_port +- + # if hvm, pass mem size to calculate the store_mfn + if is_hvm: + apic = int(dominfo.info['platform'].get('apic', 0)) +@@ -276,6 +273,9 @@ def restore(xd, fd, dominfo = None, paus + pae = 0 + + try: ++ assert store_port ++ assert console_port ++ + restore_image = image.create(dominfo, dominfo.info) + memory = restore_image.getRequiredAvailableMemory( + dominfo.info['memory_dynamic_max'] / 1024) diff --git a/xen.migrate.tools_notify_restore_to_hangup_during_migration_--abort_if_busy.patch b/xen.migrate.tools_notify_restore_to_hangup_during_migration_--abort_if_busy.patch new file mode 100644 index 0000000..b31bfe5 --- /dev/null +++ b/xen.migrate.tools_notify_restore_to_hangup_during_migration_--abort_if_busy.patch @@ -0,0 +1,57 @@ +user: Olaf Hering +date: Thu Mar 28 15:42:23 2013 +0100 +files: tools/libxc/xc_domain_restore.c tools/libxc/xc_domain_save.c tools/libxc/xg_save_restore.h +description: +tools: notify restore to hangup during migration --abort_if_busy + +If a guest is too busy to finish migration, the remote side is not +notified and as a result an imcomplete, paused guest will remain on the +remote side. Add a new flag to notify the receiver about the aborted +migration so that both sides can cleanup properly. + +Signed-off-by: Olaf Hering + + +Index: xen-4.2.1-testing/tools/libxc/xc_domain_restore.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/xc_domain_restore.c ++++ xen-4.2.1-testing/tools/libxc/xc_domain_restore.c +@@ -932,6 +932,10 @@ static int pagebuf_get_one(xc_interface + DPRINTF("read generation id buffer address"); + return pagebuf_get_one(xch, ctx, buf, fd, dom); + ++ case XC_SAVE_ID_BUSY_ABORT: ++ ERROR("Source host requested cancelation, guest is busy."); ++ errno = EBUSY; ++ return -1; + default: + if ( (count > MAX_BATCH_SIZE) || (count < 0) ) { + ERROR("Max batch size exceeded (%d). Giving up.", count); +Index: xen-4.2.1-testing/tools/libxc/xc_domain_save.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/xc_domain_save.c ++++ xen-4.2.1-testing/tools/libxc/xc_domain_save.c +@@ -1535,9 +1535,11 @@ int xc_domain_save(xc_interface *xch, in + { + if ( !min_reached && abort_if_busy ) + { ++ unsigned int cmd = XC_SAVE_ID_BUSY_ABORT; + ERROR("Live migration aborted, as requested. (guest too busy?)" + " total_sent %lu iter %d, max_iters %u max_factor %u", + total_sent, iter, max_iters, max_factor); ++ wrexact(io_fd, &cmd, sizeof(cmd)); + print_stats(xch, dom, sent_this_iter, &time_stats, &shadow_stats, 1); + rc = 1; + goto out; +Index: xen-4.2.1-testing/tools/libxc/xg_save_restore.h +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/xg_save_restore.h ++++ xen-4.2.1-testing/tools/libxc/xg_save_restore.h +@@ -259,6 +259,7 @@ + #define XC_SAVE_ID_HVM_ACCESS_RING_PFN -16 + #define XC_SAVE_ID_HVM_SHARING_RING_PFN -17 + #define XC_SAVE_ID_TOOLSTACK -18 /* Optional toolstack specific info */ ++#define XC_SAVE_ID_BUSY_ABORT -19 /* Source requested cancelation */ + + /* + ** We process save/restore/migrate in batches of pages; the below diff --git a/xen.migrate.tools_set_migration_constraints_from_cmdline.patch b/xen.migrate.tools_set_migration_constraints_from_cmdline.patch index a437c28..44dd5a8 100644 --- a/xen.migrate.tools_set_migration_constraints_from_cmdline.patch +++ b/xen.migrate.tools_set_migration_constraints_from_cmdline.patch @@ -69,6 +69,15 @@ v2: Signed-off-by: Olaf Hering +--- + tools/libxc/xc_domain_save.c | 13 ++++++++++++- + tools/libxc/xenguest.h | 1 + + tools/python/xen/xend/XendCheckpoint.py | 14 ++++++++++++-- + tools/python/xen/xend/XendDomain.py | 12 ++++++++++++ + tools/python/xen/xend/XendDomainInfo.py | 12 ++++++++++++ + tools/python/xen/xm/migrate.py | 16 ++++++++++++++++ + 6 files changed, 65 insertions(+), 3 deletions(-) + Index: xen-4.2.1-testing/tools/libxc/xc_domain_save.c =================================================================== --- xen-4.2.1-testing.orig/tools/libxc/xc_domain_save.c @@ -195,15 +204,15 @@ Index: xen-4.2.1-testing/tools/python/xen/xm/migrate.py fn=set_true, default=0, use="Change home server for managed domains.") -+gopts.opt('max_iters', short='M', val='max_iters', ++gopts.opt('max_iters', val='max_iters', + fn=set_int, default=0, + use="Number of iterations before final suspend (default: 30).") + -+gopts.opt('max_factor', short='m', val='max_factor', ++gopts.opt('max_factor', val='max_factor', + fn=set_int, default=0, + use="Max amount of memory to transfer before final suspend (default: 3*RAM).") + -+gopts.opt('abort_if_busy', short='A', ++gopts.opt('abort_if_busy', + fn=set_true, default=0, + use="Abort migration instead of doing final suspend.") + diff --git a/xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch b/xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch new file mode 100644 index 0000000..4631775 --- /dev/null +++ b/xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch @@ -0,0 +1,283 @@ +user: Olaf Hering +date: Thu Mar 28 15:42:14 2013 +0100 +files: docs/man/xl.pod.1 tools/libxc/Makefile tools/libxc/xc_domain_save.c tools/libxc/xc_nomigrate.c tools/libxc/xenguest.h tools/libxl/libxl.c tools/libxl/libxl.h tools/libxl/libxl_internal.h tools/libxl/libxl_save_callout.c tools/libxl/libxl_save_helper.c tools/libxl/xl_cmdimpl.c tools/libxl/xl_cmdtable.c tools/python/xen/lowlevel/checkpoint/libcheckpoint.c tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/migrate.py tools/xcutils/xc_save.c +description: +tools: set number of dirty pages during migration + +If a guest is really busy it will not reach the low number of remaining +50 dirty pages for the final suspend. As a result the guest is either +suspendend for a long time during the final transfer, or if the number +of iterations is increased the migration will take a long time. + +Add a new option xm/xl migrate --min_remaing to increase the +default from command line. The default of 50 is 200kb, which is +appearently an arbitrary number. With todays network speeds a larger +block of memory can be transfered quickly without causing too much +suspension time. This knob gives the admin the chance to adapt the +suspension time to the given workload. + +The existing default of 50 pages is not altered by this change. + +Signed-off-by: Olaf Hering + + +--- + tools/libxc/ia64/xc_ia64_linux_save.c | 2 +- + tools/libxc/xc_domain_save.c | 6 ++++-- + tools/libxc/xc_nomigrate.c | 2 +- + tools/libxc/xenguest.h | 2 +- + tools/libxl/libxl_save_helper.c | 2 +- + tools/python/xen/lowlevel/checkpoint/libcheckpoint.c | 2 +- + tools/python/xen/xend/XendCheckpoint.py | 5 ++++- + tools/python/xen/xend/XendDomain.py | 5 +++-- + tools/python/xen/xend/XendDomainInfo.py | 8 +++++--- + tools/python/xen/xm/migrate.py | 5 +++++ + tools/xcutils/xc_save.c | 11 ++++++----- + 11 files changed, 32 insertions(+), 18 deletions(-) + +Index: xen-4.2.1-testing/tools/libxc/ia64/xc_ia64_linux_save.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/ia64/xc_ia64_linux_save.c ++++ xen-4.2.1-testing/tools/libxc/ia64/xc_ia64_linux_save.c +@@ -381,7 +381,7 @@ out: + + int + xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters, +- uint32_t max_factor, uint32_t flags, ++ uint32_t max_factor, uint32_t min_remaining, uint32_t flags, + struct save_callbacks* callbacks, int hvm, + unsigned long vm_generationid_addr) + { +Index: xen-4.2.1-testing/tools/libxc/xc_domain_save.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/xc_domain_save.c ++++ xen-4.2.1-testing/tools/libxc/xc_domain_save.c +@@ -43,6 +43,7 @@ + */ + #define DEF_MAX_ITERS 29 /* limit us to 30 times round loop */ + #define DEF_MAX_FACTOR 3 /* never send more than 3x p2m_size */ ++#define DEF_MIN_REMAINING 50 /* low water mark of dirty pages */ + + struct save_ctx { + unsigned long hvirt_start; /* virtual starting address of the hypervisor */ +@@ -803,7 +804,7 @@ static int save_tsc_info(xc_interface *x + } + + int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters, +- uint32_t max_factor, uint32_t flags, ++ uint32_t max_factor, uint32_t min_remaining, uint32_t flags, + struct save_callbacks* callbacks, int hvm, + unsigned long vm_generationid_addr) + { +@@ -914,6 +915,7 @@ int xc_domain_save(xc_interface *xch, in + /* If no explicit control parameters given, use defaults */ + max_iters = max_iters ? : DEF_MAX_ITERS; + max_factor = max_factor ? : DEF_MAX_FACTOR; ++ min_remaining = min_remaining ? : DEF_MIN_REMAINING; + + if ( !get_platform_info(xch, dom, + &ctx->max_mfn, &ctx->hvirt_start, &ctx->pt_levels, &dinfo->guest_width) ) +@@ -1526,7 +1528,7 @@ int xc_domain_save(xc_interface *xch, in + + if ( live ) + { +- int min_reached = sent_this_iter + skip_this_iter < 50; ++ int min_reached = sent_this_iter + skip_this_iter < min_remaining; + if ( (iter >= max_iters) || + min_reached || + (total_sent > dinfo->p2m_size*max_factor) ) +Index: xen-4.2.1-testing/tools/libxc/xc_nomigrate.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/xc_nomigrate.c ++++ xen-4.2.1-testing/tools/libxc/xc_nomigrate.c +@@ -22,7 +22,7 @@ + #include + + int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters, +- uint32_t max_factor, uint32_t flags, ++ uint32_t max_factor, uint32_t min_remaining, uint32_t flags, + struct save_callbacks* callbacks, int hvm, + unsigned long vm_generationid_addr) + { +Index: xen-4.2.1-testing/tools/libxc/xenguest.h +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxc/xenguest.h ++++ xen-4.2.1-testing/tools/libxc/xenguest.h +@@ -87,7 +87,7 @@ struct save_callbacks { + * @return 0 on success, -1 on failure + */ + int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters, +- uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */, ++ uint32_t max_factor, uint32_t min_remaining, uint32_t flags /* XCFLAGS_xxx */, + struct save_callbacks* callbacks, int hvm, + unsigned long vm_generationid_addr); + +Index: xen-4.2.1-testing/tools/libxl/libxl_save_helper.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/libxl/libxl_save_helper.c ++++ xen-4.2.1-testing/tools/libxl/libxl_save_helper.c +@@ -235,7 +235,7 @@ int main(int argc, char **argv) + helper_setcallbacks_save(&helper_save_callbacks, cbflags); + + startup("save"); +- r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, flags, ++ r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, 0, flags, + &helper_save_callbacks, hvm, genidad); + complete(r); + +Index: xen-4.2.1-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c ++++ xen-4.2.1-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c +@@ -206,7 +206,7 @@ int checkpoint_start(checkpoint_state* s + + callbacks->switch_qemu_logdirty = noop_switch_logdirty; + +- rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm, ++ rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, 0, flags, callbacks, hvm, + vm_generationid_addr); + + if (hvm) +Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py +=================================================================== +--- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py +@@ -120,19 +120,22 @@ def save(fd, dominfo, network, live, dst + # more information. + max_iters = dominfo.info.get('max_iters', "0") + max_factor = dominfo.info.get('max_factor', "0") ++ min_remaining = dominfo.info.get('min_remaining', "0") + abort_if_busy = dominfo.info.get('abort_if_busy', "0") + log_save_progress = dominfo.info.get('log_save_progress', "0") + if max_iters == "None": + max_iters = "0" + if max_factor == "None": + max_factor = "0" ++ if min_remaining == "None": ++ min_remaining = "0" + if abort_if_busy == "None": + abort_if_busy = "0" + if log_save_progress == "None": + log_save_progress = "0" + cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd), + str(dominfo.getDomid()), +- max_iters, max_factor, ++ max_iters, max_factor, min_remaining, + str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) | (int(log_save_progress) << 6) ) ] + log.debug("[xc_save]: %s", string.join(cmd)) + +Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomain.py +=================================================================== +--- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomain.py ++++ xen-4.2.1-testing/tools/python/xen/xend/XendDomain.py +@@ -1832,18 +1832,19 @@ class XendDomain: + log.exception(ex) + raise XendError(str(ex)) + +- def domain_migrate_constraints_set(self, domid, max_iters, max_factor, abort_if_busy, log_save_progress): ++ def domain_migrate_constraints_set(self, domid, max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress): + """Set the Migrate Constraints of this domain. + @param domid: Domain ID or Name + @param max_iters: Number of iterations before final suspend + @param max_factor: Max amount of memory to transfer before final suspend ++ @param min_remaining: Number of dirty pages before final suspend + @param abort_if_busy: Abort migration instead of doing final suspend + @param log_save_progress: Log progress of migrate to xend.log + """ + dominfo = self.domain_lookup_nr(domid) + if not dominfo: + raise XendInvalidDomain(str(domid)) +- dominfo.setMigrateConstraints(max_iters, max_factor, abort_if_busy, log_save_progress) ++ dominfo.setMigrateConstraints(max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress) + + def domain_maxmem_set(self, domid, mem): + """Set the memory limit for a domain. +Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py +=================================================================== +--- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -1459,17 +1459,19 @@ class XendDomainInfo: + pci_conf = self.info['devices'][dev_uuid][1] + return map(pci_dict_to_bdf_str, pci_conf['devs']) + +- def setMigrateConstraints(self, max_iters, max_factor, abort_if_busy, log_save_progress): ++ def setMigrateConstraints(self, max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress): + """Set the Migrate Constraints of this domain. + @param max_iters: Number of iterations before final suspend + @param max_factor: Max amount of memory to transfer before final suspend ++ @param min_remaining: Number of dirty pages before final suspend + @param abort_if_busy: Abort migration instead of doing final suspend + @param log_save_progress: Log progress of migrate to xend.log + """ +- log.debug("Setting migration constraints of domain %s (%s) to '%s' '%s' '%s'.", +- self.info['name_label'], str(self.domid), max_iters, max_factor, abort_if_busy) ++ log.debug("Setting migration constraints of domain %s (%s) to '%s' '%s' '%s' '%s'.", ++ self.info['name_label'], str(self.domid), max_iters, max_factor, min_remaining, abort_if_busy) + self.info['max_iters'] = str(max_iters) + self.info['max_factor'] = str(max_factor) ++ self.info['min_remaining'] = str(min_remaining) + self.info['abort_if_busy'] = str(abort_if_busy) + self.info['log_save_progress'] = str(log_save_progress) + +Index: xen-4.2.1-testing/tools/python/xen/xm/migrate.py +=================================================================== +--- xen-4.2.1-testing.orig/tools/python/xen/xm/migrate.py ++++ xen-4.2.1-testing/tools/python/xen/xm/migrate.py +@@ -63,6 +63,10 @@ gopts.opt('max_factor', val='max_factor' + fn=set_int, default=0, + use="Max amount of memory to transfer before final suspend (default: 3*RAM).") + ++gopts.opt('min_remaining', val='min_remaining', ++ fn=set_int, default=0, ++ use="Number of dirty pages before final suspend (default: 50).") ++ + gopts.opt('abort_if_busy', + fn=set_true, default=0, + use="Abort migration instead of doing final suspend.") +@@ -99,6 +103,7 @@ def main(argv): + server.xend.domain.migrate_constraints_set(dom, + opts.vals.max_iters, + opts.vals.max_factor, ++ opts.vals.min_remaining, + opts.vals.abort_if_busy, + opts.vals.log_progress) + server.xend.domain.migrate(dom, dst, opts.vals.live, +Index: xen-4.2.1-testing/tools/xcutils/xc_save.c +=================================================================== +--- xen-4.2.1-testing.orig/tools/xcutils/xc_save.c ++++ xen-4.2.1-testing/tools/xcutils/xc_save.c +@@ -179,20 +179,21 @@ int + main(int argc, char **argv) + { + xc_interface *xch; +- unsigned int maxit, max_f, lflags; ++ unsigned int maxit, max_f, min_r, lflags; + int io_fd, ret, port; + struct save_callbacks callbacks; + xentoollog_level lvl; + xentoollog_logger *l; + +- if (argc != 6) +- errx(1, "usage: %s iofd domid maxit maxf flags", argv[0]); ++ if (argc != 7) ++ errx(1, "usage: %s iofd domid maxit maxf minr flags", argv[0]); + + io_fd = atoi(argv[1]); + si.domid = atoi(argv[2]); + maxit = atoi(argv[3]); + max_f = atoi(argv[4]); +- si.flags = atoi(argv[5]); ++ min_r = atoi(argv[5]); ++ si.flags = atoi(argv[6]); + + si.suspend_evtchn = -1; + +@@ -226,7 +227,7 @@ main(int argc, char **argv) + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.suspend = suspend; + callbacks.switch_qemu_logdirty = switch_qemu_logdirty; +- ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, si.flags, ++ ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, min_r, si.flags, + &callbacks, !!(si.flags & XCFLAGS_HVM), 0); + + if (si.suspend_evtchn > 0) diff --git a/xen.spec b/xen.spec index f0c7fdb..bbaf77e 100644 --- a/xen.spec +++ b/xen.spec @@ -15,6 +15,8 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +# needssslcertforbuild + Name: xen ExclusiveArch: %ix86 x86_64 %define xvers 4.2 @@ -114,7 +116,7 @@ BuildRequires: kernel-syms BuildRequires: module-init-tools BuildRequires: xorg-x11 %endif -Version: 4.2.1_10 +Version: 4.2.1_11 Release: 0 PreReq: %insserv_prereq %fillup_prereq Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) @@ -181,6 +183,7 @@ Patch25957: 25957-x86-TSC-adjust-HVM.patch Patch25958: 25958-x86-TSC-adjust-sr.patch Patch25959: 25959-x86-TSC-adjust-expose.patch Patch25975: 25975-x86-IvyBridge.patch +Patch26060: 26060-ACPI-ERST-table-size-checks.patch Patch26062: 26062-ACPI-ERST-move-data.patch Patch26077: 26077-stubdom_fix_compile_errors_in_grub.patch Patch26078: 26078-hotplug-Linux_remove_hotplug_support_rely_on_udev_instead.patch @@ -275,6 +278,17 @@ Patch26679: 26679-x86-defer-processing-events-on-the-NMI-exit-path.patch Patch26683: 26683-credit1-Use-atomic-bit-operations-for-the-flags-structure.patch Patch26686: 26686-xentrace-fix-off-by-one-in-calculate_tbuf_size.patch Patch26689: 26689-fix-domain-unlocking-in-some-xsm-error-paths.patch +Patch26692: 26692-x86-fully-protect-MSI-X-table-from-PV-guest-accesses.patch +Patch26702: 26702-powernow-add-fixups-for-AMD-P-state-figures.patch +Patch26704: 26704-x86-MCA-suppress-bank-clearing-for-certain-injected-events.patch +Patch26731: 26731-AMD-IOMMU-Process-softirqs-while-building-dom0-iommu-mappings.patch +Patch26733: 26733-VT-d-Enumerate-IOMMUs-when-listing-capabilities.patch +Patch26734: 26734-ACPI-ERST-Name-table-in-otherwise-opaque-error-messages.patch +Patch26736: 26736-ACPI-APEI-Unlock-apei_iomaps_lock-on-error-path.patch +Patch26737: 26737-ACPI-APEI-Add-apei_exec_run_optional.patch +Patch26742: 26742-IOMMU-properly-check-whether-interrupt-remapping-is-enabled.patch +Patch26743: 26743-VT-d-deal-with-5500-5520-X58-errata.patch +Patch26744: 26744-AMD-IOMMU-allow-disabling-only-interrupt-remapping.patch Patch34: CVE-2013-0151-xsa34.patch Patch41: CVE-2012-6075-xsa41.patch Patch88: xen.migrate.tools-xc_print_messages_from_xc_save_with_xc_report.patch @@ -282,6 +296,10 @@ Patch89: xen.migrate.tools-xc_document_printf_calls_in_xc_restore.patch Patch90: xen.migrate.tools-xc_rework_xc_save.cswitch_qemu_logdirty.patch Patch91: xen.migrate.tools_set_migration_constraints_from_cmdline.patch Patch92: xen.migrate.tools_add_xm_migrate_--log_progress_option.patch +Patch93: xen.migrate.tools-xend_move_assert_to_exception_block.patch +Patch94: xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch +Patch95: xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch +Patch96: xen.migrate.tools_notify_restore_to_hangup_during_migration_--abort_if_busy.patch # Upstream qemu patches Patch100: VNC-Support-for-ExtendedKeyEvent-client-message.patch # Our patches @@ -374,11 +392,11 @@ Patch457: xen-cpupool-xl-config-format.patch Patch458: ipxe-enable-nics.patch Patch459: blktap-close-fifos.patch Patch460: blktap-disable-debug-printf.patch -Patch461: xen-glibc217.patch -Patch462: xen-migration-bridge-check.patch -Patch463: pygrub-netware-xnloader.patch -Patch464: xen-managed-pci-device.patch -Patch465: xend-hvm-firmware-passthrough.patch +Patch461: xen-migration-bridge-check.patch +Patch462: pygrub-netware-xnloader.patch +Patch463: xen-managed-pci-device.patch +Patch464: xend-hvm-firmware-passthrough.patch +Patch465: xen-glibc217.patch # Jim's domain lock patch Patch480: xend-domain-lock.patch Patch481: xend-domain-lock-sfex.patch @@ -389,8 +407,9 @@ Patch502: x86-cpufreq-report.patch Patch503: x86-dom-print.patch Patch504: pvdrv-import-shared-info.patch Patch505: x86-extra-trap-info.patch -Patch506: pvdrv_emulation_control.patch -Patch507: blktap-pv-cdrom.patch +Patch506: x86-EFI-set-variable-permit-attrs.patch +Patch507: pvdrv_emulation_control.patch +Patch508: blktap-pv-cdrom.patch Patch511: supported_module.diff Patch512: magic_ioport_compat.patch Patch513: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch @@ -755,6 +774,7 @@ tar xfj %{SOURCE6} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch25958 -p1 %patch25959 -p1 %patch25975 -p1 +%patch26060 -p1 %patch26062 -p1 %patch26077 -p1 %patch26078 -p1 @@ -850,12 +870,27 @@ tar xfj %{SOURCE6} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch26683 -p1 %patch26686 -p1 %patch26689 -p1 +%patch26692 -p1 +%patch26702 -p1 +%patch26704 -p1 +%patch26731 -p1 +%patch26733 -p1 +%patch26734 -p1 +%patch26736 -p1 +%patch26737 -p1 +%patch26742 -p1 +%patch26743 -p1 +%patch26744 -p1 %patch41 -p1 %patch88 -p1 %patch89 -p1 %patch90 -p1 %patch91 -p1 %patch92 -p1 +%patch93 -p1 +%patch94 -p1 +%patch95 -p1 +%patch96 -p1 # Qemu %patch100 -p1 # Our patches @@ -960,6 +995,7 @@ tar xfj %{SOURCE6} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch505 -p1 %patch506 -p1 %patch507 -p1 +%patch508 -p1 %patch511 -p1 %patch512 -p1 %patch513 -p1 diff --git a/xenapi-console-protocol.patch b/xenapi-console-protocol.patch index a427b44..219d982 100644 --- a/xenapi-console-protocol.patch +++ b/xenapi-console-protocol.patch @@ -2,7 +2,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -3954,6 +3954,14 @@ class XendDomainInfo: +@@ -3956,6 +3956,14 @@ class XendDomainInfo: if not config.has_key('backend'): config['backend'] = "00000000-0000-0000-0000-000000000000" diff --git a/xend-console-port-restore.patch b/xend-console-port-restore.patch index 04f954d..63d3082 100644 --- a/xend-console-port-restore.patch +++ b/xend-console-port-restore.patch @@ -7,7 +7,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -342,8 +342,7 @@ def restore(xd, fd, dominfo = None, paus +@@ -345,8 +345,7 @@ def restore(xd, fd, dominfo = None, paus restore_image.setCpuid() # xc_restore will wait for source to close connection @@ -21,7 +21,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -3076,7 +3076,7 @@ class XendDomainInfo: +@@ -3078,7 +3078,7 @@ class XendDomainInfo: # TODO: recategorise - called from XendCheckpoint # @@ -30,7 +30,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py log.debug("XendDomainInfo.completeRestore") -@@ -3087,6 +3087,7 @@ class XendDomainInfo: +@@ -3089,6 +3089,7 @@ class XendDomainInfo: self.image = image.create(self, self.info) if self.image: self.image.createDeviceModel(True) diff --git a/xend-core-dump-loc.diff b/xend-core-dump-loc.diff index 0863a09..48a8372 100644 --- a/xend-core-dump-loc.diff +++ b/xend-core-dump-loc.diff @@ -2,7 +2,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -2318,7 +2318,7 @@ class XendDomainInfo: +@@ -2320,7 +2320,7 @@ class XendDomainInfo: # To prohibit directory traversal based_name = os.path.basename(self.info['name_label']) diff --git a/xend-domain-lock-sfex.patch b/xend-domain-lock-sfex.patch index 6556aad..9b20062 100644 --- a/xend-domain-lock-sfex.patch +++ b/xend-domain-lock-sfex.patch @@ -223,7 +223,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -4570,8 +4570,14 @@ class XendDomainInfo: +@@ -4572,8 +4572,14 @@ class XendDomainInfo: # Return name of host contained in lock file. def get_lock_host(self, path): @@ -240,7 +240,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py hostname = "unknown" try: -@@ -4593,6 +4599,16 @@ class XendDomainInfo: +@@ -4595,6 +4601,16 @@ class XendDomainInfo: path = xoptions.get_xend_domain_lock_path() path = os.path.join(path, self.get_uuid()) @@ -257,7 +257,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py try: if not os.path.exists(path): mkdir.parents(path, stat.S_IRWXU) -@@ -4600,12 +4616,7 @@ class XendDomainInfo: +@@ -4602,12 +4618,7 @@ class XendDomainInfo: log.exception("%s could not be created." % path) raise XendError("%s could not be created." % path) @@ -271,7 +271,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py if status != 0: log.debug("Failed to aqcuire lock: status = %d" % status) raise XendError("The VM is locked and appears to be running on host %s." % self.get_lock_host(path)) -@@ -4622,12 +4633,18 @@ class XendDomainInfo: +@@ -4624,12 +4635,18 @@ class XendDomainInfo: path = xoptions.get_xend_domain_lock_path() path = os.path.join(path, self.get_uuid()) diff --git a/xend-domain-lock.patch b/xend-domain-lock.patch index 8ad8b77..678e776 100644 --- a/xend-domain-lock.patch +++ b/xend-domain-lock.patch @@ -228,19 +228,19 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -136,6 +136,11 @@ def save(fd, dominfo, network, live, dst +@@ -139,6 +139,11 @@ def save(fd, dominfo, network, live, dst str( int(live) | (int(hvm) << 2) | (int(abort_if_busy) << 5) | (int(log_save_progress) << 6) ) ] log.debug("[xc_save]: %s", string.join(cmd)) -+ # It is safe to release the domain lock at this point if not -+ # checkpointing -+ if checkpoint == False: -+ dominfo.release_running_lock(domain_name) ++ # It is safe to release the domain lock at this point if not ++ # checkpointing ++ if checkpoint == False: ++ dominfo.release_running_lock(domain_name) + def saveInputHandler(line, tochild): log.debug("In saveInputHandler %s", line) if line == "suspend": -@@ -200,6 +205,9 @@ def save(fd, dominfo, network, live, dst +@@ -203,6 +208,9 @@ def save(fd, dominfo, network, live, dst log.exception("Save failed on domain %s (%s) - resuming.", domain_name, dominfo.getDomid()) dominfo.resumeDomain() @@ -250,7 +250,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py try: dominfo.setName(domain_name) -@@ -366,6 +374,7 @@ def restore(xd, fd, dominfo = None, paus +@@ -369,6 +377,7 @@ def restore(xd, fd, dominfo = None, paus if not paused: dominfo.unpause() @@ -270,7 +270,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py XendTask.log_progress(0, 30, self._constructDomain) XendTask.log_progress(31, 60, self._initDomain) -@@ -3053,6 +3054,11 @@ class XendDomainInfo: +@@ -3055,6 +3056,11 @@ class XendDomainInfo: self._stateSet(DOM_STATE_HALTED) self.domid = None # Do not push into _stateSet()! @@ -282,7 +282,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py finally: self.refresh_shutdown_lock.release() -@@ -4562,6 +4568,74 @@ class XendDomainInfo: +@@ -4564,6 +4570,74 @@ class XendDomainInfo: def has_device(self, dev_class, dev_uuid): return (dev_uuid in self.info['%s_refs' % dev_class.lower()]) diff --git a/xend-migration-domname-fix.patch b/xend-migration-domname-fix.patch index 3a1c706..4cefe25 100644 --- a/xend-migration-domname-fix.patch +++ b/xend-migration-domname-fix.patch @@ -8,7 +8,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -1961,6 +1961,8 @@ class XendDomainInfo: +@@ -1963,6 +1963,8 @@ class XendDomainInfo: self.info['name_label'] = name if to_store: self.storeVm("name", name) @@ -21,7 +21,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -185,7 +185,10 @@ def save(fd, dominfo, network, live, dst +@@ -188,7 +188,10 @@ def save(fd, dominfo, network, live, dst dominfo.destroy() dominfo.testDeviceComplete() try: diff --git a/xend-vcpu-affinity-fix.patch b/xend-vcpu-affinity-fix.patch index 7d63867..7d280f7 100644 --- a/xend-vcpu-affinity-fix.patch +++ b/xend-vcpu-affinity-fix.patch @@ -2,7 +2,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -2799,7 +2799,10 @@ class XendDomainInfo: +@@ -2801,7 +2801,10 @@ class XendDomainInfo: from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): diff --git a/xenpaging.autostart.patch b/xenpaging.autostart.patch index da1d75a..c7d5d6e 100644 --- a/xenpaging.autostart.patch +++ b/xenpaging.autostart.patch @@ -124,9 +124,9 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomain.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomain.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomain.py -@@ -1848,6 +1848,21 @@ class XendDomain: +@@ -1849,6 +1849,21 @@ class XendDomain: raise XendInvalidDomain(str(domid)) - dominfo.setMigrateConstraints(max_iters, max_factor, abort_if_busy, log_save_progress) + dominfo.setMigrateConstraints(max_iters, max_factor, min_remaining, abort_if_busy, log_save_progress) + def domain_swaptarget_set(self, domid, mem): + """Set the memory limit for a domain. @@ -150,7 +150,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py +++ xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -1548,6 +1548,17 @@ class XendDomainInfo: +@@ -1550,6 +1550,17 @@ class XendDomainInfo: break xen.xend.XendDomain.instance().managed_config_save(self) @@ -168,7 +168,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py def setMemoryTarget(self, target): """Set the memory target of this domain. @param target: In MiB. -@@ -2338,6 +2349,8 @@ class XendDomainInfo: +@@ -2340,6 +2351,8 @@ class XendDomainInfo: self.info['name_label'], self.domid, self.info['uuid'], new_name, new_uuid) self._unwatchVm() @@ -177,7 +177,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py self._releaseDevices() # Remove existing vm node in xenstore self._removeVm() -@@ -3017,6 +3030,9 @@ class XendDomainInfo: +@@ -3019,6 +3032,9 @@ class XendDomainInfo: self._createDevices() @@ -187,7 +187,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py self.image.cleanupTmpImages() self.info['start_time'] = time.time() -@@ -3041,6 +3057,8 @@ class XendDomainInfo: +@@ -3043,6 +3059,8 @@ class XendDomainInfo: self.refresh_shutdown_lock.acquire() try: self.unwatchShutdown() @@ -196,7 +196,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py self._releaseDevices() bootloader_tidy(self) -@@ -3125,6 +3143,7 @@ class XendDomainInfo: +@@ -3127,6 +3145,7 @@ class XendDomainInfo: self.image = image.create(self, self.info) if self.image: self.image.createDeviceModel(True) @@ -204,7 +204,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py self.console_port = console_port self._storeDomDetails() self._registerWatches() -@@ -3267,6 +3286,8 @@ class XendDomainInfo: +@@ -3269,6 +3288,8 @@ class XendDomainInfo: # could also fetch a parsed note from xenstore fast = self.info.get_notes().get('SUSPEND_CANCEL') and 1 or 0 if not fast: @@ -213,7 +213,7 @@ Index: xen-4.2.1-testing/tools/python/xen/xend/XendDomainInfo.py self._releaseDevices() self.testDeviceComplete() self.testvifsComplete() -@@ -3282,6 +3303,8 @@ class XendDomainInfo: +@@ -3284,6 +3305,8 @@ class XendDomainInfo: self._storeDomDetails() self._createDevices()