From 08af757235c459cf2b624ec93020d1c036c05e55302bef2a5cb4b3fda5a1b6c3 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Tue, 2 Oct 2012 22:08:01 +0000 Subject: [PATCH] - Upstream patches from Jan 25927-x86-domctl-ioport-mapping-range.patch 25929-tmem-restore-pool-version.patch 25931-x86-domctl-iomem-mapping-checks.patch 25940-x86-S3-flush-cache.patch 25952-x86-MMIO-remap-permissions.patch 25961-x86-HPET-interrupts.patch 25962-x86-assign-irq-vector-old.patch 25965-x86-ucode-Intel-resume.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=205 --- 25927-x86-domctl-ioport-mapping-range.patch | 28 ++ 25929-tmem-restore-pool-version.patch | 26 ++ 25931-x86-domctl-iomem-mapping-checks.patch | 257 +++++++++++++++ 25940-x86-S3-flush-cache.patch | 53 +++ 25952-x86-MMIO-remap-permissions.patch | 41 +++ 25961-x86-HPET-interrupts.patch | 36 +++ 25962-x86-assign-irq-vector-old.patch | 35 ++ 25965-x86-ucode-Intel-resume.patch | 35 ++ blktap-pv-cdrom.patch | 2 +- x86-dom-print.patch | 2 +- xen-destdir.diff | 61 ++++ xen-warnings-unused.diff | 342 -------------------- xen-warnings.diff | 265 --------------- xen.changes | 13 + xen.spec | 38 ++- 15 files changed, 613 insertions(+), 621 deletions(-) create mode 100644 25927-x86-domctl-ioport-mapping-range.patch create mode 100644 25929-tmem-restore-pool-version.patch create mode 100644 25931-x86-domctl-iomem-mapping-checks.patch create mode 100644 25940-x86-S3-flush-cache.patch create mode 100644 25952-x86-MMIO-remap-permissions.patch create mode 100644 25961-x86-HPET-interrupts.patch create mode 100644 25962-x86-assign-irq-vector-old.patch create mode 100644 25965-x86-ucode-Intel-resume.patch delete mode 100644 xen-warnings-unused.diff delete mode 100644 xen-warnings.diff diff --git a/25927-x86-domctl-ioport-mapping-range.patch b/25927-x86-domctl-ioport-mapping-range.patch new file mode 100644 index 0000000..5833c8e --- /dev/null +++ b/25927-x86-domctl-ioport-mapping-range.patch @@ -0,0 +1,28 @@ +# HG changeset patch +# User Jan Beulich +# Date 1348039675 -7200 +# Node ID 3e3959413b2fbef584993beb434285d0691d5c67 +# Parent 4a0438fe1e6afe01e46023bcb2c828c5aaeefb1d +x86: properly check XEN_DOMCTL_ioport_mapping arguments for invalid range + +In particular, the case of "np" being a very large value wasn't handled +correctly. The range start checks also were off by one (except that in +practice, when "np" is properly range checked, this would still have +been caught by the range end checks). + +Also, is a GFN wrap in XEN_DOMCTL_memory_mapping really okay? + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/domctl.c ++++ b/xen/arch/x86/domctl.c +@@ -888,7 +888,7 @@ long arch_do_domctl( + int found = 0; + + ret = -EINVAL; +- if ( (np == 0) || (fgp > MAX_IOPORTS) || (fmp > MAX_IOPORTS) || ++ if ( ((fgp | fmp | (np - 1)) >= MAX_IOPORTS) || + ((fgp + np) > MAX_IOPORTS) || ((fmp + np) > MAX_IOPORTS) ) + { + printk(XENLOG_G_ERR diff --git a/25929-tmem-restore-pool-version.patch b/25929-tmem-restore-pool-version.patch new file mode 100644 index 0000000..e09d79c --- /dev/null +++ b/25929-tmem-restore-pool-version.patch @@ -0,0 +1,26 @@ +# HG changeset patch +# User Zhenzhong Duan +# Date 1348069127 -7200 +# Node ID fee83ac77d8c7339abf5185690603ea5b0c548cf +# Parent 7b045d43e59dcb42340097058502bf456e151180 +tmem: bump pool version to 1 to fix restore issue when tmem enabled + +Restore fails when tmem is enabled both in hypervisor and guest. This +is due to spec version mismatch when restoring a pool. + +Signed-off-by: Zhenzhong Duan +Acked-by: Dan Magenheimer +Committed-by: Jan Beulich + +--- a/xen/common/tmem.c ++++ b/xen/common/tmem.c +@@ -2407,7 +2407,8 @@ static NOINLINE int tmemc_save_subop(int + break; + rc = (pool->persistent ? TMEM_POOL_PERSIST : 0) | + (pool->shared ? TMEM_POOL_SHARED : 0) | +- (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT); ++ (pool->pageshift << TMEM_POOL_PAGESIZE_SHIFT) | ++ (TMEM_SPEC_VERSION << TMEM_POOL_VERSION_SHIFT); + break; + case TMEMC_SAVE_GET_POOL_NPAGES: + if ( pool == NULL ) diff --git a/25931-x86-domctl-iomem-mapping-checks.patch b/25931-x86-domctl-iomem-mapping-checks.patch new file mode 100644 index 0000000..6039228 --- /dev/null +++ b/25931-x86-domctl-iomem-mapping-checks.patch @@ -0,0 +1,257 @@ +# HG changeset patch +# User Jan Beulich +# Date 1348125713 -7200 +# Node ID 14980591956954584f3cd87bf4e8d306360e7f27 +# Parent 4e93cbeac98b3e6be98e5ec0881b44b68ee95974 +x86: tighten checks in XEN_DOMCTL_memory_mapping handler + +Properly checking the MFN implies knowing the physical address width +supported by the platform, so to obtain this consistently the +respective code gets moved out of the MTRR subdir. + +Btw., the model specific workaround in that code is likely unnecessary +- I believe those CPU models don't support 64-bit mode. But I wasn't +able to formally verify this, so I preferred to retain that code for +now. + +But domctl code here also was lacking other error checks (as was, +looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one. +Besides adding the missing checks, printing is also added for the case +where revoking access permissions didn't work (as that may have +implications for the host operator, e.g. wanting to not pass through +affected devices to another guest until the one previously using them +did actually die). + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/cpu/centaur.c ++++ b/xen/arch/x86/cpu/centaur.c +@@ -56,6 +56,9 @@ static void __init init_c3(struct cpuinf + if (c->x86_model >=6 && c->x86_model <9) + set_bit(X86_FEATURE_3DNOW, c->x86_capability); + ++ if (cpuid_eax(0x80000000) < 0x80000008) ++ paddr_bits = 32; ++ + get_model_name(c); + display_cacheinfo(c); + } +--- a/xen/arch/x86/cpu/common.c ++++ b/xen/arch/x86/cpu/common.c +@@ -36,6 +36,8 @@ integer_param("cpuid_mask_ext_edx", opt_ + + struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {}; + ++unsigned int paddr_bits __read_mostly = 36; ++ + /* + * Default host IA32_CR_PAT value to cover all memory types. + * BIOS usually sets it to 0x07040600070406. +@@ -265,6 +267,8 @@ static void __cpuinit generic_identify(s + } + if ( xlvl >= 0x80000004 ) + get_model_name(c); /* Default name */ ++ if ( xlvl >= 0x80000008 ) ++ paddr_bits = cpuid_eax(0x80000008) & 0xff; + } + + /* Intel-defined flags: level 0x00000007 */ +--- a/xen/arch/x86/cpu/cyrix.c ++++ b/xen/arch/x86/cpu/cyrix.c +@@ -255,7 +255,9 @@ static void __init init_cyrix(struct cpu + } + safe_strcpy(c->x86_model_id, Cx86_model[dir0_msn & 7]); + if (p) safe_strcat(c->x86_model_id, p); +- return; ++ ++ if (cpu_has_cyrix_arr) ++ paddr_bits = 32; + } + + /* +--- a/xen/arch/x86/cpu/intel.c ++++ b/xen/arch/x86/cpu/intel.c +@@ -144,6 +144,11 @@ void __devinit early_intel_workaround(st + c->cpuid_level); + } + } ++ ++ /* CPUID workaround for Intel 0F33/0F34 CPU */ ++ if (boot_cpu_data.x86 == 0xF && boot_cpu_data.x86_model == 3 && ++ (boot_cpu_data.x86_mask == 3 || boot_cpu_data.x86_mask == 4)) ++ paddr_bits = 36; + } + + /* +--- a/xen/arch/x86/cpu/mtrr/main.c ++++ b/xen/arch/x86/cpu/mtrr/main.c +@@ -587,8 +587,6 @@ struct mtrr_value { + unsigned long lsize; + }; + +-unsigned int paddr_bits __read_mostly = 36; +- + /** + * mtrr_bp_init - initialize mtrrs on the boot CPU + * +@@ -602,48 +600,12 @@ void __init mtrr_bp_init(void) + + if (cpu_has_mtrr) { + mtrr_if = &generic_mtrr_ops; +- size_or_mask = 0xff000000; /* 36 bits */ +- size_and_mask = 0x00f00000; +- +- /* This is an AMD specific MSR, but we assume(hope?) that +- Intel will implement it to when they extend the address +- bus of the Xeon. */ +- if (cpuid_eax(0x80000000) >= 0x80000008) { +- paddr_bits = cpuid_eax(0x80000008) & 0xff; +- /* CPUID workaround for Intel 0F33/0F34 CPU */ +- if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && +- boot_cpu_data.x86 == 0xF && +- boot_cpu_data.x86_model == 0x3 && +- (boot_cpu_data.x86_mask == 0x3 || +- boot_cpu_data.x86_mask == 0x4)) +- paddr_bits = 36; +- +- size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1); +- size_and_mask = ~size_or_mask & 0xfffff00000ULL; +- } else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR && +- boot_cpu_data.x86 == 6) { +- /* VIA C* family have Intel style MTRRs, but +- don't support PAE */ +- size_or_mask = 0xfff00000; /* 32 bits */ +- size_and_mask = 0; +- } + } else { + #ifndef CONFIG_X86_64 + switch (boot_cpu_data.x86_vendor) { +- case X86_VENDOR_AMD: +- if (cpu_has_k6_mtrr) { +- /* Pre-Athlon (K6) AMD CPU MTRRs */ +- mtrr_if = mtrr_ops[X86_VENDOR_AMD]; +- size_or_mask = 0xfff00000; /* 32 bits */ +- size_and_mask = 0; +- } +- break; + case X86_VENDOR_CYRIX: +- if (cpu_has_cyrix_arr) { ++ if (cpu_has_cyrix_arr) + mtrr_if = mtrr_ops[X86_VENDOR_CYRIX]; +- size_or_mask = 0xfff00000; /* 32 bits */ +- size_and_mask = 0; +- } + break; + default: + break; +@@ -652,6 +614,8 @@ void __init mtrr_bp_init(void) + } + + if (mtrr_if) { ++ size_or_mask = ~((1ULL << (paddr_bits - PAGE_SHIFT)) - 1); ++ size_and_mask = ~size_or_mask & 0xfffff00000ULL; + set_num_var_ranges(); + init_table(); + if (use_intel()) +--- a/xen/arch/x86/domctl.c ++++ b/xen/arch/x86/domctl.c +@@ -829,10 +829,12 @@ long arch_do_domctl( + unsigned long mfn = domctl->u.memory_mapping.first_mfn; + unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns; + int add = domctl->u.memory_mapping.add_mapping; +- int i; ++ unsigned long i; + + ret = -EINVAL; +- if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */ ++ if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */ ++ ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits - PAGE_SHIFT)) || ++ (gfn + nr_mfns - 1) < gfn ) /* wrap? */ + break; + + ret = -EPERM; +@@ -857,8 +859,25 @@ long arch_do_domctl( + d->domain_id, gfn, mfn, nr_mfns); + + ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1); +- for ( i = 0; i < nr_mfns; i++ ) +- set_mmio_p2m_entry(d, gfn+i, _mfn(mfn+i)); ++ if ( !ret && paging_mode_translate(d) ) ++ { ++ for ( i = 0; !ret && i < nr_mfns; i++ ) ++ if ( !set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i)) ) ++ ret = -EIO; ++ if ( ret ) ++ { ++ printk(XENLOG_G_WARNING ++ "memory_map:fail: dom%d gfn=%lx mfn=%lx\n", ++ d->domain_id, gfn + i, mfn + i); ++ while ( i-- ) ++ clear_mmio_p2m_entry(d, gfn + i); ++ if ( iomem_deny_access(d, mfn, mfn + nr_mfns - 1) && ++ IS_PRIV(current->domain) ) ++ printk(XENLOG_ERR ++ "memory_map: failed to deny dom%d access to [%lx,%lx]\n", ++ d->domain_id, mfn, mfn + nr_mfns - 1); ++ } ++ } + } + else + { +@@ -866,9 +885,17 @@ long arch_do_domctl( + "memory_map:remove: dom%d gfn=%lx mfn=%lx nr=%lx\n", + d->domain_id, gfn, mfn, nr_mfns); + +- for ( i = 0; i < nr_mfns; i++ ) +- clear_mmio_p2m_entry(d, gfn+i); ++ if ( paging_mode_translate(d) ) ++ for ( i = 0; i < nr_mfns; i++ ) ++ add |= !clear_mmio_p2m_entry(d, gfn + i); + ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1); ++ if ( !ret && add ) ++ ret = -EIO; ++ if ( ret && IS_PRIV(current->domain) ) ++ printk(XENLOG_ERR ++ "memory_map: error %ld %s dom%d access to [%lx,%lx]\n", ++ ret, add ? "removing" : "denying", d->domain_id, ++ mfn, mfn + nr_mfns - 1); + } + + rcu_unlock_domain(d); +@@ -930,12 +957,23 @@ long arch_do_domctl( + if ( !found ) + { + g2m_ioport = xmalloc(struct g2m_ioport); ++ if ( !g2m_ioport ) ++ ret = -ENOMEM; ++ } ++ if ( !found && !ret ) ++ { + g2m_ioport->gport = fgp; + g2m_ioport->mport = fmp; + g2m_ioport->np = np; + list_add_tail(&g2m_ioport->list, &hd->g2m_ioport_list); + } +- ret = ioports_permit_access(d, fmp, fmp + np - 1); ++ if ( !ret ) ++ ret = ioports_permit_access(d, fmp, fmp + np - 1); ++ if ( ret && !found && g2m_ioport ) ++ { ++ list_del(&g2m_ioport->list); ++ xfree(g2m_ioport); ++ } + } + else + { +@@ -950,6 +988,10 @@ long arch_do_domctl( + break; + } + ret = ioports_deny_access(d, fmp, fmp + np - 1); ++ if ( ret && IS_PRIV(current->domain) ) ++ printk(XENLOG_ERR ++ "ioport_map: error %ld denying dom%d access to [%x,%x]\n", ++ ret, d->domain_id, fmp, fmp + np - 1); + } + rcu_unlock_domain(d); + } diff --git a/25940-x86-S3-flush-cache.patch b/25940-x86-S3-flush-cache.patch new file mode 100644 index 0000000..4ec5073 --- /dev/null +++ b/25940-x86-S3-flush-cache.patch @@ -0,0 +1,53 @@ +# HG changeset patch +# User Ben Guthro +# Date 1348555094 -7200 +# Node ID c8d65d91a6f20fa7fae905bbf172e59b335d6371 +# Parent b49f7bf52fa92626517386cba89350243b808871 +x86/S3: add cache flush on secondary CPUs before going to sleep + +Secondary CPUs, between doing their final memory writes (particularly +updating cpu_initialized) and getting a subsequent INIT, may not write +back all modified data. The INIT itself then causes those modifications +to be lost, so in the cpu_initialized case the CPU would find itself +already initialized, (intentionally) entering an infinite loop instead +of actually coming online. + +Signed-off-by: Ben Guthro + +Make acpi_dead_idle() call default_dead_idle() rather than duplicating +the logic there. + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser +Committed-by: Jan Beulich + +--- a/xen/arch/x86/acpi/cpu_idle.c ++++ b/xen/arch/x86/acpi/cpu_idle.c +@@ -647,6 +647,12 @@ static void acpi_dead_idle(void) + } + + default_halt: ++ /* ++ * When going into S3, without flushing caches modified data may be ++ * held by the CPUs spinning here indefinitely, and get discarded by ++ * a subsequent INIT. ++ */ ++ wbinvd(); + for ( ; ; ) + halt(); + } +--- a/xen/arch/x86/domain.c ++++ b/xen/arch/x86/domain.c +@@ -86,6 +86,12 @@ static void default_idle(void) + + static void default_dead_idle(void) + { ++ /* ++ * When going into S3, without flushing caches modified data may be ++ * held by the CPUs spinning here indefinitely, and get discarded by ++ * a subsequent INIT. ++ */ ++ wbinvd(); + for ( ; ; ) + halt(); + } diff --git a/25952-x86-MMIO-remap-permissions.patch b/25952-x86-MMIO-remap-permissions.patch new file mode 100644 index 0000000..91a44dd --- /dev/null +++ b/25952-x86-MMIO-remap-permissions.patch @@ -0,0 +1,41 @@ +# HG changeset patch +# User Daniel De Graaf +# Date 1348653367 -7200 +# Node ID 8278d7d8fa485996f51134c5265fceaf239adf6a +# Parent b83f414ccf7a6e4e077a10bc422cf3f6c7d30566 +x86: check remote MMIO remap permissions + +When a domain is mapping pages from a different pg_owner domain, the +iomem_access checks are currently only applied to the pg_owner domain, +potentially allowing a domain with a more restrictive iomem_access +policy to have the pages mapped into its page tables. To catch this, +also check the owner of the page tables. The current domain does not +need to be checked because the ability to manipulate a domain's page +tables implies full access to the target domain, so checking that +domain's permission is sufficient. + +Signed-off-by: Daniel De Graaf +Committed-by: Jan Beulich + +--- a/xen/arch/x86/mm.c ++++ b/xen/arch/x86/mm.c +@@ -870,6 +870,19 @@ get_page_from_l1e( + return -EINVAL; + } + ++ if ( pg_owner != l1e_owner && ++ !iomem_access_permitted(l1e_owner, mfn, mfn) ) ++ { ++ if ( mfn != (PADDR_MASK >> PAGE_SHIFT) ) /* INVALID_MFN? */ ++ { ++ MEM_LOG("Dom%u attempted to map I/O space %08lx in dom%u to dom%u", ++ curr->domain->domain_id, mfn, pg_owner->domain_id, ++ l1e_owner->domain_id); ++ return -EPERM; ++ } ++ return -EINVAL; ++ } ++ + if ( !(l1f & _PAGE_RW) || + !rangeset_contains_singleton(mmio_ro_ranges, mfn) ) + return 0; diff --git a/25961-x86-HPET-interrupts.patch b/25961-x86-HPET-interrupts.patch new file mode 100644 index 0000000..30cccd0 --- /dev/null +++ b/25961-x86-HPET-interrupts.patch @@ -0,0 +1,36 @@ +# HG changeset patch +# User Jan Beulich +# Date 1348816934 -7200 +# Node ID 6a581212909478bba0c7b4dfc6c370270dee825c +# Parent 6bf8b882df8f66ab5500e4d9cc0c3338ae5a6cb9 +x86/HPET: don't disable interrupt delivery right after setting it up + +We shouldn't clear HPET_TN_FSB right after we (indirectly, via +request_irq()) enabled it for the channels we intend to use for +broadcasts. + +This fixes a regression introduced by c/s 25103:0b0e42dc4f0a. + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/hpet.c ++++ b/xen/arch/x86/hpet.c +@@ -533,7 +533,7 @@ void __init hpet_broadcast_init(void) + { + /* set HPET Tn as oneshot */ + cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx)); +- cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB); ++ cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC); + cfg |= HPET_TN_ENABLE | HPET_TN_32BIT; + hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx)); + +@@ -590,7 +590,7 @@ void hpet_broadcast_resume(void) + + /* set HPET Tn as oneshot */ + cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx)); +- cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB); ++ cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC); + cfg |= HPET_TN_ENABLE | HPET_TN_32BIT; + hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx)); + diff --git a/25962-x86-assign-irq-vector-old.patch b/25962-x86-assign-irq-vector-old.patch new file mode 100644 index 0000000..cc3b82d --- /dev/null +++ b/25962-x86-assign-irq-vector-old.patch @@ -0,0 +1,35 @@ +# HG changeset patch +# User Jan Beulich +# Date 1348817014 -7200 +# Node ID 41f523f1b5e5af9cf8e85160f2412456da83050f +# Parent 6a581212909478bba0c7b4dfc6c370270dee825c +x86/IRQ: fix valid-old-vector checks in __assign_irq_vector() + +There are two greater-than-zero checks for the old vector retrieved, +which don't work when a negative value got stashed into the respective +arch_irq_desc field. The effect of this was that for interrupts that +are intended to get their affinity adjusted the first time before the +first interrupt occurs, the affinity change would fail, because the +original vector assignment would have caused the move_in_progress flag +to get set (which causes subsequent re-assignments to fail until it +gets cleared, which only happens from the ->ack() actor, i.e. when an +interrupt actually occurred). + +This addresses a problem introduced in c/s 23816:7f357e1ef60a (by +changing IRQ_VECTOR_UNASSIGNED from 0 to -1). + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/irq.c ++++ b/xen/arch/x86/irq.c +@@ -430,8 +430,7 @@ static int __assign_irq_vector( + * 0x80, because int 0x80 is hm, kind of importantish. ;) + */ + static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0; +- unsigned int old_vector; +- int cpu, err; ++ int cpu, err, old_vector; + cpumask_t tmp_mask; + vmask_t *irq_used_vectors = NULL; + diff --git a/25965-x86-ucode-Intel-resume.patch b/25965-x86-ucode-Intel-resume.patch new file mode 100644 index 0000000..b5ae1b0 --- /dev/null +++ b/25965-x86-ucode-Intel-resume.patch @@ -0,0 +1,35 @@ +# HG changeset patch +# User Jan Beulich +# Date 1348817291 -7200 +# Node ID 4496d56c68a0e57ed9f03b482028093f1e7fdf6c +# Parent 00c05b9d76247d063a8ebc75050246e488323f50 +x86/ucode: fix Intel case of resume handling on boot CPU + +Checking the stored version doesn't tell us anything about the need to +apply the update (during resume, what is stored doesn't necessarily +match what is loaded). + +Note that the check can be removed altogether because once switched to +use what was read from the CPU (uci->cpu_sig.rev, as used in the +subsequent pr_debug()), it would become redundant with the checks that +lead to microcode_update_match() returning the indication that an +update should be applied. + +Note further that this was not an issue on APs since they start with +uci->mc.mc_intel being NULL. + +Signed-off-by: Jan Beulich +Tested-by: Ben Guthro +Acked-by: Keir Fraser + +--- a/xen/arch/x86/microcode_intel.c ++++ b/xen/arch/x86/microcode_intel.c +@@ -261,8 +261,6 @@ static int get_matching_microcode(const + } + return 0; + find: +- if ( uci->mc.mc_intel && uci->mc.mc_intel->hdr.rev >= mc_header->rev ) +- return 0; + pr_debug("microcode: CPU%d found a matching microcode update with" + " version 0x%x (current=0x%x)\n", + cpu, mc_header->rev, uci->cpu_sig.rev); diff --git a/blktap-pv-cdrom.patch b/blktap-pv-cdrom.patch index 1311a7a..8d608eb 100644 --- a/blktap-pv-cdrom.patch +++ b/blktap-pv-cdrom.patch @@ -741,7 +741,7 @@ Index: xen-4.2.0-testing/tools/blktap/lib/blktaplib.h =================================================================== --- xen-4.2.0-testing.orig/tools/blktap/lib/blktaplib.h +++ xen-4.2.0-testing/tools/blktap/lib/blktaplib.h -@@ -220,6 +220,7 @@ typedef struct msg_pid { +@@ -219,6 +219,7 @@ typedef struct msg_pid { #define DISK_TYPE_RAM 3 #define DISK_TYPE_QCOW 4 #define DISK_TYPE_QCOW2 5 diff --git a/x86-dom-print.patch b/x86-dom-print.patch index d25fbb0..23bfd31 100644 --- a/x86-dom-print.patch +++ b/x86-dom-print.patch @@ -1,6 +1,6 @@ --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c -@@ -148,15 +148,30 @@ void dump_pageframe_info(struct domain * +@@ -154,15 +154,30 @@ void dump_pageframe_info(struct domain * printk("Memory pages belonging to domain %u:\n", d->domain_id); diff --git a/xen-destdir.diff b/xen-destdir.diff index 0bf62ab..6b1898f 100644 --- a/xen-destdir.diff +++ b/xen-destdir.diff @@ -170,3 +170,64 @@ Index: xen-4.2.0-testing/tools/Makefile --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \ -I$(XEN_ROOT)/tools/libxc \ +Index: xen-4.2.0-testing/stubdom/Makefile +=================================================================== +--- xen-4.2.0-testing.orig/stubdom/Makefile ++++ xen-4.2.0-testing/stubdom/Makefile +@@ -398,7 +398,7 @@ install-grub: pv-grub + + install-xenstore: xenstore-stubdom + $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot" +- $(INSTALL_PROG) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz" ++ $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/xenstore-stubdom.gz" + + ####### + # clean +Index: xen-4.2.0-testing/tools/blktap2/vhd/lib/Makefile +=================================================================== +--- xen-4.2.0-testing.orig/tools/blktap2/vhd/lib/Makefile ++++ xen-4.2.0-testing/tools/blktap2/vhd/lib/Makefile +@@ -68,7 +68,7 @@ libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR + + install: all + $(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR) +- $(INSTALL_PROG) libvhd.a $(DESTDIR)$(INST-DIR) ++ $(INSTALL_DATA) libvhd.a $(DESTDIR)$(INST-DIR) + $(INSTALL_PROG) libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR) + ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR) + ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so +Index: xen-4.2.0-testing/tools/blktap/lib/Makefile +=================================================================== +--- xen-4.2.0-testing.orig/tools/blktap/lib/Makefile ++++ xen-4.2.0-testing/tools/blktap/lib/Makefile +@@ -23,23 +23,26 @@ OBJS = $(SRCS:.c=.o) + OBJS_PIC = $(SRCS:.c=.opic) + IBINS := + +-LIB = libblktap.a libblktap.so.$(MAJOR).$(MINOR) ++LIB = libblktap.a ++LIB_SO = libblktap.so.$(MAJOR).$(MINOR) ++LIB_ALL = $(LIB) $(LIB_SO) + + .PHONY: all +-all: $(LIB) ++all: $(LIB_ALL) + + .PHONY: install + install: all + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) + $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR) +- $(INSTALL_PROG) $(LIB) $(DESTDIR)$(LIBDIR) ++ $(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIBDIR) ++ $(INSTALL_PROG) $(LIB_SO) $(DESTDIR)$(LIBDIR) + ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libblktap.so.$(MAJOR) + ln -sf libblktap.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libblktap.so + $(INSTALL_DATA) blktaplib.h $(DESTDIR)$(INCLUDEDIR) + + .PHONY: clean + clean: +- rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen TAGS ++ rm -rf *.a *.so* *.o *.opic *.rpm $(LIB_ALL) *~ $(DEPS) xen TAGS + + libblktap.so.$(MAJOR).$(MINOR): $(OBJS_PIC) + $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_LDFLAGS) \ diff --git a/xen-warnings-unused.diff b/xen-warnings-unused.diff deleted file mode 100644 index 6b2dd51..0000000 --- a/xen-warnings-unused.diff +++ /dev/null @@ -1,342 +0,0 @@ ---- a/tools/misc/gtraceview.c -+++ b/tools/misc/gtraceview.c -@@ -621,7 +621,8 @@ void crt_init(void) - void nr_addch(int nr, int ch) - { - int i; -- int y, x; -+ int x; -+ int __attribute__((__unused__)) y; - getyx(stdscr, y, x); - for (i = 0; i < nr; i++) { - if (x == COLS-1) ---- a/tools/xcutils/xc_restore.c -+++ b/tools/xcutils/xc_restore.c -@@ -19,7 +19,8 @@ int - main(int argc, char **argv) - { - unsigned int domid, store_evtchn, console_evtchn; -- unsigned int hvm, pae, apic; -+ unsigned int hvm, pae; -+ unsigned int __attribute__((__unused__)) apic; - xc_interface *xch; - int io_fd, ret; - int superpages; ---- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c -+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c -@@ -1064,7 +1064,7 @@ uint32_t HashLogEvent32(struct hlei *hle - uint32_t rc = 0; - uint16_t size; - uint32_t logdataptr; -- uint32_t logdatalen; -+ uint32_t __attribute__((__unused__)) logdatalen; - uint32_t hashdataptr; - uint32_t hashdatalen; - ---- a/tools/console/client/main.c -+++ b/tools/console/client/main.c -@@ -277,7 +277,8 @@ int main(int argc, char **argv) - - }; - char *dom_path = NULL, *path = NULL; -- int spty, xsfd; -+ int spty; -+ int __attribute__((__unused__)) xsfd; - struct xs_handle *xs; - char *end; - console_type type = CONSOLE_INVAL; ---- a/tools/xenstat/xentop/xentop.c -+++ b/tools/xenstat/xentop/xentop.c -@@ -278,7 +278,8 @@ static void fail(const char *str) - /* Return the row containing the cursor. */ - static int current_row(void) - { -- int y, x; -+ int __attribute__((__unused__)) x; -+ int y; - getyx(stdscr, y, x); - return y; - } -@@ -286,7 +287,8 @@ static int current_row(void) - /* Return the number of lines on the screen. */ - static int lines(void) - { -- int y, x; -+ int __attribute__((__unused__)) x; -+ int y; - getmaxyx(stdscr, y, x); - return y; - } ---- a/tools/libxl/libxlu_cfg.c -+++ b/tools/libxl/libxlu_cfg.c -@@ -406,7 +406,7 @@ char *xlu__cfgl_dequote(CfgParseContext - - #define NUMERIC_CHAR(minlen,maxlen,base,basetext) do{ \ - char numbuf[(maxlen)+1], *ep; \ -- unsigned long val; \ -+ unsigned long __attribute__((__unused__)) val; \ - \ - strncpy(numbuf,p,(maxlen)); \ - numbuf[(maxlen)]= 0; \ ---- a/tools/libxl/libxl_pci.c -+++ b/tools/libxl/libxl_pci.c -@@ -71,7 +71,7 @@ int libxl__create_pci_backend(libxl__gc - flexarray_t *front = NULL; - flexarray_t *back = NULL; - libxl__device device; -- int ret = ERROR_NOMEM, i; -+ int i; - - front = flexarray_make(16, 1); - if (!front) -@@ -80,8 +80,6 @@ int libxl__create_pci_backend(libxl__gc - if (!back) - goto out; - -- ret = 0; -- - LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Creating pci backend"); - - /* add pci device */ ---- a/tools/libxl/libxl_dom.c -+++ b/tools/libxl/libxl_dom.c -@@ -565,7 +565,6 @@ int libxl__build_hvm(libxl__gc *gc, uint - LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, ret, "hvm build set params failed"); - goto out; - } -- rc = 0; - out: - return rc; - } ---- a/tools/debugger/gdbsx/gx/gx_comm.c -+++ b/tools/debugger/gdbsx/gx/gx_comm.c -@@ -163,7 +163,7 @@ readchar(void) - static char buf[BUFSIZ]; - static int bufcnt = 0; - static char *bufp; -- uint64_t ll; -+ uint64_t __attribute__((__unused__)) ll; - - if (bufcnt-- > 0) - return *bufp++ & 0x7f; ---- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c -+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c -@@ -836,7 +836,7 @@ static int create_suspend_thread(checkpo - - static void stop_suspend_thread(checkpoint_state* s) - { -- int err; -+ int __attribute__((__unused__)) err; - - s->done = 1; - ---- a/tools/python/xen/lowlevel/netlink/libnetlink.c -+++ b/tools/python/xen/lowlevel/netlink/libnetlink.c -@@ -433,7 +433,8 @@ int rtnl_from_file(FILE *rtnl, rtnl_filt - nladdr.nl_groups = 0; - - while (1) { -- int err, len, type; -+ int err, len; -+ int __attribute__((__unused__)) type; - int l; - - status = fread(&buf, 1, sizeof(*h), rtnl); ---- a/xen/common/cpupool.c -+++ b/xen/common/cpupool.c -@@ -371,7 +371,7 @@ int cpupool_add_domain(struct domain *d, - { - struct cpupool *c; - int rc; -- int n_dom = 0; -+ int __attribute__((__unused__)) n_dom = 0; - - if ( poolid == CPUPOOLID_NONE ) - return 0; -@@ -399,8 +399,8 @@ int cpupool_add_domain(struct domain *d, - */ - void cpupool_rm_domain(struct domain *d) - { -- int cpupool_id; -- int n_dom; -+ int __attribute__((__unused__)) cpupool_id; -+ int __attribute__((__unused__)) n_dom; - - if ( d->cpupool == NULL ) - return; ---- a/xen/common/kexec.c -+++ b/xen/common/kexec.c -@@ -817,7 +817,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v - { - xen_kexec_exec_t exec; - xen_kexec_image_t *image; -- int base, bit, pos, ret = -EINVAL; -+ int base, bit, pos; -+ int __attribute__((__unused__)) ret = -EINVAL; - - if ( unlikely(copy_from_guest(&exec, uarg, 1)) ) - return -EFAULT; ---- a/xen/arch/x86/time.c -+++ b/xen/arch/x86/time.c -@@ -1012,7 +1012,8 @@ static void local_time_calibration(void) - * System timestamps, extrapolated from local and master oscillators, - * taken during this calibration and the previous calibration. - */ -- s_time_t prev_local_stime, curr_local_stime; -+ s_time_t curr_local_stime; -+ s_time_t __attribute__((__unused__)) prev_local_stime; - s_time_t prev_master_stime, curr_master_stime; - - /* TSC timestamps taken during this calibration and prev calibration. */ ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c -@@ -483,7 +483,7 @@ p2m_remove_page(struct p2m_domain *p2m, - unsigned int page_order) - { - unsigned long i; -- mfn_t mfn_return; -+ mfn_t __attribute__((__unused__)) mfn_return; - p2m_type_t t; - p2m_access_t a; - ---- a/xen/arch/x86/cpu/intel_cacheinfo.c -+++ b/xen/arch/x86/cpu/intel_cacheinfo.c -@@ -169,7 +169,8 @@ unsigned int __cpuinit init_intel_cachei - unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ - unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */ - unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */ -- unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb; -+ unsigned int num_threads_sharing, index_msb; -+ unsigned int __attribute__((__unused__)) l2_id = 0, l3_id = 0; - - if (c->cpuid_level > 3) { - static int is_initialized; ---- a/xen/arch/x86/hvm/viridian.c -+++ b/xen/arch/x86/hvm/viridian.c -@@ -317,7 +317,7 @@ int rdmsr_viridian_regs(uint32_t idx, ui - int viridian_hypercall(struct cpu_user_regs *regs) - { - int mode = hvm_guest_x86_mode(current); -- unsigned long input_params_gpa, output_params_gpa; -+ unsigned long __attribute__((__unused__)) input_params_gpa, output_params_gpa; - uint16_t status = HV_STATUS_SUCCESS; - - union hypercall_input { ---- a/xen/arch/x86/mm.c -+++ b/xen/arch/x86/mm.c -@@ -4973,7 +4973,7 @@ static int ptwr_emulated_update( - { - unsigned long mfn; - unsigned long unaligned_addr = addr; -- struct page_info *page; -+ struct page_info __attribute__((__unused__)) *page; - l1_pgentry_t pte, ol1e, nl1e, *pl1e; - struct vcpu *v = current; - struct domain *d = v->domain; ---- a/xen/common/tmem.c -+++ b/xen/common/tmem.c -@@ -1352,7 +1352,8 @@ obj_unlock: - static int tmem_evict(void) - { - client_t *client = tmh_client_from_current(); -- pgp_t *pgp = NULL, *pgp2, *pgp_del; -+ pgp_t *pgp = NULL, *pgp2; -+ pgp_t __attribute__((__unused__)) *pgp_del; - obj_t *obj; - pool_t *pool; - int ret = 0; -@@ -1589,7 +1590,8 @@ static NOINLINE int do_tmem_put(pool_t * - pagesize_t pfn_offset, pagesize_t len, tmem_cli_va_t clibuf) - { - obj_t *obj = NULL, *objfound = NULL, *objnew = NULL; -- pgp_t *pgp = NULL, *pgpdel = NULL; -+ pgp_t *pgp = NULL; -+ pgp_t __attribute__((__unused__)) *pgpdel = NULL; - client_t *client = pool->client; - int ret = client->frozen ? -EFROZEN : -ENOMEM; - ---- a/xen/common/tmem_xen.c -+++ b/xen/common/tmem_xen.c -@@ -196,7 +196,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p - EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn, - void **out_va, size_t *out_len, tmem_cli_va_t clibuf) - { -- int ret = 0; -+ int __attribute__((__unused__)) ret = 0; - unsigned char *dmem = this_cpu(dstmem); - unsigned char *wmem = this_cpu(workmem); - char *scratch = this_cpu(scratch_page); -@@ -272,7 +272,7 @@ EXPORT int tmh_decompress_to_client(tmem - void *cli_va = NULL; - char *scratch = this_cpu(scratch_page); - size_t out_len = PAGE_SIZE; -- int ret; -+ int __attribute__((__unused__)) ret; - - if ( guest_handle_is_null(clibuf) ) - { -@@ -405,15 +405,17 @@ static void tmh_persistent_pool_page_put - EXPORT tmh_client_t *tmh_client_init(cli_id_t cli_id) - { - tmh_client_t *tmh; -+#ifndef __i386__ - char name[5]; - int i, shift; -+#endif - - if ( (tmh = xmalloc(tmh_client_t)) == NULL ) - return NULL; -+#ifndef __i386__ - for (i = 0, shift = 12; i < 4; shift -=4, i++) - name[i] = (((unsigned short)cli_id >> shift) & 0xf) + '0'; - name[4] = '\0'; --#ifndef __i386__ - tmh->persistent_pool = xmem_pool_create(name, tmh_persistent_pool_page_get, - tmh_persistent_pool_page_put, PAGE_SIZE, 0, PAGE_SIZE); - if ( tmh->persistent_pool == NULL ) ---- a/xen/arch/x86/mm/shadow/multi.c -+++ b/xen/arch/x86/mm/shadow/multi.c -@@ -124,7 +124,7 @@ set_shadow_status(struct vcpu *v, mfn_t - /* Put a shadow into the hash table */ - { - struct domain *d = v->domain; -- int res; -+ int __attribute__((__unused__)) res; - - SHADOW_PRINTK("d=%d, v=%d, gmfn=%05lx, type=%08x, smfn=%05lx\n", - d->domain_id, v->vcpu_id, mfn_x(gmfn), -@@ -4438,7 +4438,7 @@ sh_update_cr3(struct vcpu *v, int do_loc - int sh_rm_write_access_from_sl1p(struct vcpu *v, mfn_t gmfn, - mfn_t smfn, unsigned long off) - { -- int r; -+ int __attribute__((__unused__)) r; - shadow_l1e_t *sl1p, sl1e; - struct page_info *sp; - ---- a/xen/arch/x86/domain_build.c -+++ b/xen/arch/x86/domain_build.c -@@ -377,8 +377,7 @@ int __init construct_dom0( - return rc; - - /* compatibility check */ -- compatible = 0; -- compat32 = 0; -+ compatible = compat32 = 0; - machine = elf_uval(&elf, elf.ehdr, e_machine); - switch (CONFIG_PAGING_LEVELS) { - case 3: /* x86_32p */ ---- a/xen/arch/x86/traps.c -+++ b/xen/arch/x86/traps.c -@@ -1910,7 +1910,11 @@ static int emulate_privileged_op(struct - struct vcpu *v = current; - unsigned long *reg, eip = regs->eip; - u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0, lock = 0, rex = 0; -+#ifdef CONFIG_X86_64 - enum { lm_seg_none, lm_seg_fs, lm_seg_gs } lm_ovr = lm_seg_none; -+#else -+ enum { lm_seg_none, lm_seg_fs, lm_seg_gs } __attribute__((__unused__)) lm_ovr = lm_seg_none; -+#endif - int rc; - unsigned int port, i, data_sel, ar, data, bpmatch = 0; - unsigned int op_bytes, op_default, ad_bytes, ad_default, opsize_prefix= 0; diff --git a/xen-warnings.diff b/xen-warnings.diff deleted file mode 100644 index 785cc00..0000000 --- a/xen-warnings.diff +++ /dev/null @@ -1,265 +0,0 @@ -Index: xen-4.2.0-testing/tools/misc/miniterm/miniterm.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/misc/miniterm/miniterm.c -+++ xen-4.2.0-testing/tools/misc/miniterm/miniterm.c -@@ -157,7 +157,7 @@ int main(int argc, char **argv) - case 0: - close(1); /* stdout not needed */ - for ( c = (char)getchar(); c != ENDMINITERM; c = (char)getchar() ) -- write(fd,&c,1); -+ if (write(fd,&c,1)) ; - tcsetattr(fd,TCSANOW,&oldsertio); - tcsetattr(0,TCSANOW,&oldstdtio); - close(fd); -@@ -169,19 +169,19 @@ int main(int argc, char **argv) - close(fd); - exit(-1); - default: -- write(1, start_str, strlen(start_str)); -+ if (write(1, start_str, strlen(start_str))) ; - close(0); /* stdin not needed */ - sa.sa_handler = child_handler; - sa.sa_flags = 0; - sigaction(SIGCHLD,&sa,NULL); /* handle dying child */ - while ( !stop ) - { -- read(fd,&c,1); /* modem */ -+ if (read(fd,&c,1)) ; /* modem */ - c = (char)c; -- write(1,&c,1); /* stdout */ -+ if (write(1,&c,1)) ; /* stdout */ - } - wait(NULL); /* wait for child to die or it will become a zombie */ -- write(1, end_str, strlen(end_str)); -+ if (write(1, end_str, strlen(end_str))) ; - break; - } - -Index: xen-4.2.0-testing/tools/libxc/xc_dom_elfloader.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/libxc/xc_dom_elfloader.c -+++ xen-4.2.0-testing/tools/libxc/xc_dom_elfloader.c -@@ -228,8 +228,9 @@ static int xc_dom_load_elf_symtab(struct - - if ( load ) - { -+ void * dst = (void*)elf_section_start(&syms, shdr); - shdr2 = elf_shdr_by_index(elf, h); -- memcpy((void*)elf_section_start(&syms, shdr), -+ memcpy(dst, - elf_section_start(elf, shdr2), - size); - } -Index: xen-4.2.0-testing/tools/xenstore/Makefile -=================================================================== ---- xen-4.2.0-testing.orig/tools/xenstore/Makefile -+++ xen-4.2.0-testing/tools/xenstore/Makefile -@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk - MAJOR = 3.0 - MINOR = 1 - --CFLAGS += -Werror -+CFLAGS += -Werror -fno-strict-aliasing - CFLAGS += -I. - CFLAGS += $(CFLAGS_libxenctrl) - -Index: xen-4.2.0-testing/tools/xenstore/xenstored_core.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/xenstore/xenstored_core.c -+++ xen-4.2.0-testing/tools/xenstore/xenstored_core.c -@@ -79,8 +79,8 @@ static void check_store(void); - - int quota_nb_entry_per_domain = 1000; - int quota_nb_watch_per_domain = 128; --int quota_max_entry_size = 2048; /* 2K */ --int quota_max_transaction = 10; -+unsigned int quota_max_entry_size = 2048; /* 2K */ -+unsigned int quota_max_transaction = 10; - - TDB_CONTEXT *tdb_context(struct connection *conn) - { -@@ -134,7 +134,7 @@ void trace(const char *fmt, ...) - va_list arglist; - char *str; - char sbuf[1024]; -- int ret, dummy; -+ int ret, __attribute__((__unused__)) dummy; - - if (tracefd < 0) - return; -@@ -204,7 +204,7 @@ void trace_destroy(const void *data, con - static void trigger_reopen_log(int signal __attribute__((unused))) - { - char c = 'A'; -- int dummy; -+ int __attribute__((__unused__)) dummy; - dummy = write(reopen_log_pipe[1], &c, 1); - } - -@@ -1807,10 +1807,10 @@ int main(int argc, char *argv[]) - remove_local = false; - break; - case 'S': -- quota_max_entry_size = strtol(optarg, NULL, 10); -+ quota_max_entry_size = strtoul(optarg, NULL, 10); - break; - case 't': -- quota_max_transaction = strtol(optarg, NULL, 10); -+ quota_max_transaction = strtoul(optarg, NULL, 10); - break; - case 'T': - tracefile = optarg; -Index: xen-4.2.0-testing/tools/xenstore/xenstored_domain.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/xenstore/xenstored_domain.c -+++ xen-4.2.0-testing/tools/xenstore/xenstored_domain.c -@@ -241,7 +241,7 @@ void handle_event(void) - { - evtchn_port_t port; - -- if ((port = xc_evtchn_pending(xce_handle)) == -1) -+ if ((port = xc_evtchn_pending(xce_handle)) == (evtchn_port_t)-1) - barf_perror("Failed to read from event fd"); - - if (port == virq_port) -@@ -603,7 +603,7 @@ static int dom0_init(void) - struct domain *dom0; - - port = xenbus_evtchn(); -- if (port == -1) -+ if (port == (evtchn_port_t)-1) - return -1; - - dom0 = new_domain(NULL, 0, port); -Index: xen-4.2.0-testing/tools/xenstore/xenstored_transaction.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/xenstore/xenstored_transaction.c -+++ xen-4.2.0-testing/tools/xenstore/xenstored_transaction.c -@@ -82,7 +82,7 @@ struct transaction - struct list_head changed_domains; - }; - --extern int quota_max_transaction; -+extern unsigned int quota_max_transaction; - static unsigned int generation; - - /* Return tdb context to use for this connection. */ -Index: xen-4.2.0-testing/tools/xenstore/xenstore_client.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/xenstore/xenstore_client.c -+++ xen-4.2.0-testing/tools/xenstore/xenstore_client.c -@@ -255,7 +255,7 @@ do_chmod(char *path, struct xs_permissio - char **xsval = xs_directory(xsh, xth, path, &xsval_n); - - if (xsval) { -- int i; -+ unsigned int i; - for (i = 0; i < xsval_n; i++) { - snprintf(buf, MAX_PATH_LEN, "%s/%s", path, xsval[i]); - -Index: xen-4.2.0-testing/tools/libxen/src/xen_common.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/libxen/src/xen_common.c -+++ xen-4.2.0-testing/tools/libxen/src/xen_common.c -@@ -1057,6 +1057,8 @@ static size_t size_of_member(const abstr - default: - assert(false); - } -+ -+ return 0; /* prevents a compiler warning */ - } - - -@@ -1568,6 +1570,8 @@ get_val_as_string(const struct abstract_ - default: - assert(false); - } -+ -+ return NULL; /* prevents a compiler warning */ - } - - -Index: xen-4.2.0-testing/tools/blktap2/drivers/block-remus.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/blktap2/drivers/block-remus.c -+++ xen-4.2.0-testing/tools/blktap2/drivers/block-remus.c -@@ -1636,7 +1636,7 @@ static int tdremus_open(td_driver_t *dri - td_flag_t flags) - { - struct tdremus_state *s = (struct tdremus_state *)driver->data; -- int rc; -+ int rc = 0; - - RPRINTF("opening %s\n", name); - -Index: xen-4.2.0-testing/tools/blktap/lib/blktaplib.h -=================================================================== ---- xen-4.2.0-testing.orig/tools/blktap/lib/blktaplib.h -+++ xen-4.2.0-testing/tools/blktap/lib/blktaplib.h -@@ -196,6 +196,7 @@ typedef struct msg_pid { - } msg_pid_t; - - #define READ 0 -+#undef WRITE - #define WRITE 1 - - /*Control Messages between manager and tapdev*/ -Index: xen-4.2.0-testing/tools/blktap2/include/blktaplib.h -=================================================================== ---- xen-4.2.0-testing.orig/tools/blktap2/include/blktaplib.h -+++ xen-4.2.0-testing/tools/blktap2/include/blktaplib.h -@@ -190,6 +190,7 @@ typedef struct msg_lock { - } msg_lock_t; - - #define READ 0 -+#undef WRITE - #define WRITE 1 - - /*Control Messages between manager and tapdev*/ -Index: xen-4.2.0-testing/tools/blktap/lib/Makefile -=================================================================== ---- xen-4.2.0-testing.orig/tools/blktap/lib/Makefile -+++ xen-4.2.0-testing/tools/blktap/lib/Makefile -@@ -24,6 +24,8 @@ OBJS_PIC = $(SRCS:.c=.opic) - IBINS := - - LIB = libblktap.a libblktap.so.$(MAJOR).$(MINOR) -+LIB_SO = libblktap.so.$(MAJOR).$(MINOR) -+LIB_AR = libblktap.a - - .PHONY: all - all: $(LIB) -@@ -32,7 +34,8 @@ all: $(LIB) - install: all - $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) - $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR) -- $(INSTALL_PROG) $(LIB) $(DESTDIR)$(LIBDIR) -+ $(INSTALL_PROG) $(LIB_SO) $(DESTDIR)$(LIBDIR) -+ $(INSTALL_DATA) $(LIB_AR) $(DESTDIR)$(LIBDIR) - ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libblktap.so.$(MAJOR) - ln -sf libblktap.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libblktap.so - $(INSTALL_DATA) blktaplib.h $(DESTDIR)$(INCLUDEDIR) -Index: xen-4.2.0-testing/tools/blktap2/vhd/lib/Makefile -=================================================================== ---- xen-4.2.0-testing.orig/tools/blktap2/vhd/lib/Makefile -+++ xen-4.2.0-testing/tools/blktap2/vhd/lib/Makefile -@@ -52,6 +52,8 @@ LIB-OBJS += $(LVM-UTIL-OBJ) - LIB-PICOBJS = $(patsubst %.o,%.opic,$(LIB-OBJS)) - - LIBVHD = libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) -+LIBVHD_SO = libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) -+LIBVHD_AR = libvhd.a - - all: build - -@@ -68,8 +70,8 @@ libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR - - install: all - $(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR) -- $(INSTALL_PROG) libvhd.a $(DESTDIR)$(INST-DIR) -- $(INSTALL_PROG) libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR) -+ $(INSTALL_PROG) $(LIBVHD_SO) $(DESTDIR)$(INST-DIR) -+ $(INSTALL_DATA) $(LIBVHD_AR) $(DESTDIR)$(INST-DIR) - ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR) - ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so - diff --git a/xen.changes b/xen.changes index dcab324..d87607e 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Mon Oct 1 10:09:24 MDT 2012 - carnold@novell.com + +- Upstream patches from Jan + 25927-x86-domctl-ioport-mapping-range.patch + 25929-tmem-restore-pool-version.patch + 25931-x86-domctl-iomem-mapping-checks.patch + 25940-x86-S3-flush-cache.patch + 25952-x86-MMIO-remap-permissions.patch + 25961-x86-HPET-interrupts.patch + 25962-x86-assign-irq-vector-old.patch + 25965-x86-ucode-Intel-resume.patch + ------------------------------------------------------------------- Tue Sep 25 14:24:29 CEST 2012 - ohering@suse.de diff --git a/xen.spec b/xen.spec index 77256e9..0e60802 100644 --- a/xen.spec +++ b/xen.spec @@ -15,7 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - Name: xen ExclusiveArch: %ix86 x86_64 %define xvers 4.2 @@ -48,6 +47,7 @@ BuildRequires: automake BuildRequires: bin86 BuildRequires: curl-devel BuildRequires: dev86 +BuildRequires: fdupes BuildRequires: glib2-devel BuildRequires: graphviz BuildRequires: latex2html @@ -97,10 +97,10 @@ BuildRequires: gcc46 BuildRequires: libgcc46 BuildRequires: libgcc46-32bit %endif -BuildRequires: gcc-32bit -BuildRequires: gcc43-32bit BuildRequires: glibc-32bit BuildRequires: glibc-devel-32bit +BuildRequires: gcc-32bit +BuildRequires: gcc43-32bit %define max_cpus 256 %define pae_enabled n %else @@ -114,7 +114,7 @@ BuildRequires: kernel-syms BuildRequires: module-init-tools BuildRequires: xorg-x11 %endif -Version: 4.2.0_01 +Version: 4.2.0_02 Release: 0 PreReq: %insserv_prereq %fillup_prereq Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) @@ -185,18 +185,24 @@ Patch25866: 25866-sercon-ns16550-pci-irq.patch Patch25867: 25867-sercon-ns16550-parse.patch Patch25874: 25874-x86-EFI-chain-cfg.patch Patch25909: 25909-xenpm-consistent.patch +Patch25927: 25927-x86-domctl-ioport-mapping-range.patch +Patch25929: 25929-tmem-restore-pool-version.patch +Patch25931: 25931-x86-domctl-iomem-mapping-checks.patch +Patch25940: 25940-x86-S3-flush-cache.patch Patch25941: 25941-pygrub_always_append_--args.patch +Patch25952: 25952-x86-MMIO-remap-permissions.patch +Patch25961: 25961-x86-HPET-interrupts.patch +Patch25962: 25962-x86-assign-irq-vector-old.patch +Patch25965: 25965-x86-ucode-Intel-resume.patch # Upstream qemu patches # Our patches Patch301: xend-config.diff Patch302: xen-destdir.diff Patch303: xen-rpmoptflags.diff -Patch304: xen-warnings.diff -Patch305: xen-warnings-unused.diff -Patch306: xen-changeset.diff -Patch307: xen-paths.diff -Patch308: xen-xmexample.diff -Patch309: xen-xmexample-vti.diff +Patch304: xen-changeset.diff +Patch305: xen-paths.diff +Patch306: xen-xmexample.diff +Patch307: xen-xmexample-vti.diff Patch310: xen-fixme-doc.diff Patch311: xen-domUloader.diff Patch312: xen-no-dummy-nfs-ip.diff @@ -669,7 +675,15 @@ tar xfj %{SOURCE6} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch25867 -p1 %patch25874 -p1 %patch25909 -p1 +%patch25927 -p1 +%patch25929 -p1 +%patch25931 -p1 +%patch25940 -p1 %patch25941 -p1 +%patch25952 -p1 +%patch25961 -p1 +%patch25962 -p1 +%patch25965 -p1 # Qemu # Our patches %patch301 -p1 @@ -679,8 +693,6 @@ tar xfj %{SOURCE6} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch305 -p1 %patch306 -p1 %patch307 -p1 -%patch308 -p1 -%patch309 -p1 %patch310 -p1 %patch311 -p1 %patch312 -p1 @@ -1025,6 +1037,8 @@ rm -f $RPM_BUILD_ROOT/usr/local/share/doc/qemu/qemu-tech.html #/usr/share/SuSEfirewall2/services/TEMPLATE mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir} install -m 644 %{S:26} $RPM_BUILD_ROOT/%{_fwdefdir}/xend-relocation-server +# create symlinks for keymaps +%fdupes -s $RPM_BUILD_ROOT/%{_datadir} %else # 32 bit hypervisor no longer supported. Remove dom0 tools. rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc