From 73e10176b8c6d2fa01e47acf8476577aa2b45deb59f6c6131d5617a3c3dbe372 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Mon, 26 Jul 2010 17:09:10 +0000 Subject: [PATCH] - bnc#624285 - TP-L3: xen rdtsc emulation reports wrong frequency 21445-x86-tsc-handling-cleanups-v2.patch - bnc#623201 - drbd xvd will fail in new xen4 packages due to wrong popen2 arguments in blkif.py popen2-argument-fix.patch - bnc#599550 - Xen cannot distinguish the status of 'pause' OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=64 --- 21360-x86-mce-polling-diabled-init.patch | 20 -- 21445-x86-tsc-handling-cleanups-v2.patch | 268 +++++++++++++++++++++++ 21693-memevent-64bit-only.patch | 52 +++-- README.SuSE | 7 +- addcommand_domstate.patch | 172 --------------- hv_xen_base.patch | 20 +- popen2-argument-fix.patch | 13 ++ xen.changes | 15 +- xen.spec | 56 ++--- 9 files changed, 375 insertions(+), 248 deletions(-) delete mode 100644 21360-x86-mce-polling-diabled-init.patch create mode 100644 21445-x86-tsc-handling-cleanups-v2.patch delete mode 100644 addcommand_domstate.patch create mode 100644 popen2-argument-fix.patch diff --git a/21360-x86-mce-polling-diabled-init.patch b/21360-x86-mce-polling-diabled-init.patch deleted file mode 100644 index 91b52d3..0000000 --- a/21360-x86-mce-polling-diabled-init.patch +++ /dev/null @@ -1,20 +0,0 @@ -# HG changeset patch -# User Keir Fraser -# Date 1273651780 -3600 -# Node ID fa94385978e6317732e2c12000923ca6a5e0d2ed -# Parent 0079f76e906f378f81044da4e135df2fbb878fa5 -mce: MCE polling logic should check mce_disabled during initialisation. - -Signed-off-by: Keir Fraser - ---- a/xen/arch/x86/cpu/mcheck/non-fatal.c -+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c -@@ -91,7 +91,7 @@ static int __init init_nonfatal_mce_chec - struct cpuinfo_x86 *c = &boot_cpu_data; - - /* Check for MCE support */ -- if (!mce_available(c)) -+ if (mce_disabled || !mce_available(c)) - return -ENODEV; - - /* diff --git a/21445-x86-tsc-handling-cleanups-v2.patch b/21445-x86-tsc-handling-cleanups-v2.patch new file mode 100644 index 0000000..db93ecb --- /dev/null +++ b/21445-x86-tsc-handling-cleanups-v2.patch @@ -0,0 +1,268 @@ +# HG changeset patch +# User Keir Fraser +# Date 1278094440 -3600 +# Node ID a9c458ab90e4ecb25383456be653368ecd900ee4 +# Parent 322468d5ab6ceca4afa21977a02f4492308d2ddc +x86: TSC handling cleanups (version 2) + +"I am removing the tsc_scaled variable that is never actually used +because when tsc needs to be scaled vtsc is 1. I am also making this +more explicit in tsc_set_info. I am also removing hvm_domain.gtsc_khz +that is a duplicate of d->arch.tsc_khz. I am using scale_delta(delta, +&d->arch.ns_to_vtsc) to scale the tsc value before returning it to the +guest like in the pv case. I added a feature flag to specify that the +pvclock algorithm is safe to be used in an HVM guest so that the guest +can now use it without hanging." + +Version 2 fixes a bug which breaks PV domU time. + +Signed-off-by: Stefano Stabellini +xen-unstable changeset: 21445:c1ed00d49534 +xen-unstable date: Sat May 22 06:31:47 2010 +0100 + +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c +@@ -152,32 +152,6 @@ void hvm_set_rdtsc_exiting(struct domain + hvm_funcs.set_rdtsc_exiting(v, enable); + } + +-int hvm_gtsc_need_scale(struct domain *d) +-{ +- uint32_t gtsc_mhz, htsc_mhz; +- +- if ( d->arch.vtsc ) +- return 0; +- +- gtsc_mhz = d->arch.hvm_domain.gtsc_khz / 1000; +- htsc_mhz = (uint32_t)cpu_khz / 1000; +- +- d->arch.hvm_domain.tsc_scaled = (gtsc_mhz && (gtsc_mhz != htsc_mhz)); +- return d->arch.hvm_domain.tsc_scaled; +-} +- +-static u64 hvm_h2g_scale_tsc(struct vcpu *v, u64 host_tsc) +-{ +- uint32_t gtsc_khz, htsc_khz; +- +- if ( !v->domain->arch.hvm_domain.tsc_scaled ) +- return host_tsc; +- +- htsc_khz = cpu_khz; +- gtsc_khz = v->domain->arch.hvm_domain.gtsc_khz; +- return muldiv64(host_tsc, gtsc_khz, htsc_khz); +-} +- + void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc) + { + uint64_t tsc; +@@ -185,11 +159,11 @@ void hvm_set_guest_tsc(struct vcpu *v, u + if ( v->domain->arch.vtsc ) + { + tsc = hvm_get_guest_time(v); ++ tsc = gtime_to_gtsc(v->domain, tsc); + } + else + { + rdtscll(tsc); +- tsc = hvm_h2g_scale_tsc(v, tsc); + } + + v->arch.hvm_vcpu.cache_tsc_offset = guest_tsc - tsc; +@@ -203,12 +177,12 @@ u64 hvm_get_guest_tsc(struct vcpu *v) + if ( v->domain->arch.vtsc ) + { + tsc = hvm_get_guest_time(v); ++ tsc = gtime_to_gtsc(v->domain, tsc); + v->domain->arch.vtsc_kerncount++; + } + else + { + rdtscll(tsc); +- tsc = hvm_h2g_scale_tsc(v, tsc); + } + + return tsc + v->arch.hvm_vcpu.cache_tsc_offset; +Index: xen-4.0.0-testing/xen/arch/x86/hvm/save.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/save.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/save.c +@@ -33,7 +33,7 @@ void arch_hvm_save(struct domain *d, str + hdr->cpuid = eax; + + /* Save guest's preferred TSC. */ +- hdr->gtsc_khz = d->arch.hvm_domain.gtsc_khz; ++ hdr->gtsc_khz = d->arch.tsc_khz; + } + + int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr) +@@ -62,8 +62,8 @@ int arch_hvm_load(struct domain *d, stru + + /* Restore guest's preferred TSC frequency. */ + if ( hdr->gtsc_khz ) +- d->arch.hvm_domain.gtsc_khz = hdr->gtsc_khz; +- if ( hvm_gtsc_need_scale(d) ) ++ d->arch.tsc_khz = hdr->gtsc_khz; ++ if ( d->arch.vtsc ) + { + hvm_set_rdtsc_exiting(d, 1); + gdprintk(XENLOG_WARNING, "Domain %d expects freq %uMHz " +Index: xen-4.0.0-testing/xen/arch/x86/hvm/vpt.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/vpt.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/vpt.c +@@ -32,9 +32,6 @@ void hvm_init_guest_time(struct domain * + spin_lock_init(&pl->pl_time_lock); + pl->stime_offset = -(u64)get_s_time(); + pl->last_guest_time = 0; +- +- d->arch.hvm_domain.gtsc_khz = cpu_khz; +- d->arch.hvm_domain.tsc_scaled = 0; + } + + u64 hvm_get_guest_time(struct vcpu *v) +Index: xen-4.0.0-testing/xen/arch/x86/time.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/time.c ++++ xen-4.0.0-testing/xen/arch/x86/time.c +@@ -850,8 +850,13 @@ static void __update_vcpu_system_time(st + + if ( d->arch.vtsc ) + { +- u64 delta = max_t(s64, t->stime_local_stamp - d->arch.vtsc_offset, 0); +- tsc_stamp = scale_delta(delta, &d->arch.ns_to_vtsc); ++ u64 stime = t->stime_local_stamp; ++ if ( is_hvm_domain(d) ) ++ { ++ struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time; ++ stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset; ++ } ++ tsc_stamp = gtime_to_gtsc(d, stime); + } + else + { +@@ -874,6 +879,8 @@ static void __update_vcpu_system_time(st + _u.tsc_to_system_mul = t->tsc_scale.mul_frac; + _u.tsc_shift = (s8)t->tsc_scale.shift; + } ++ if ( is_hvm_domain(d) ) ++ _u.tsc_timestamp += v->arch.hvm_vcpu.cache_tsc_offset; + + /* Don't bother unless timestamp record has changed or we are forced. */ + _u.version = u->version; /* make versions match for memcmp test */ +@@ -1640,11 +1647,17 @@ struct tm wallclock_time(void) + * PV SoftTSC Emulation. + */ + ++u64 gtime_to_gtsc(struct domain *d, u64 tsc) ++{ ++ if ( !is_hvm_domain(d) ) ++ tsc = max_t(s64, tsc - d->arch.vtsc_offset, 0); ++ return scale_delta(tsc, &d->arch.ns_to_vtsc); ++} ++ + void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp) + { + s_time_t now = get_s_time(); + struct domain *d = v->domain; +- u64 delta; + + spin_lock(&d->arch.vtsc_lock); + +@@ -1660,8 +1673,7 @@ void pv_soft_rdtsc(struct vcpu *v, struc + + spin_unlock(&d->arch.vtsc_lock); + +- delta = max_t(s64, now - d->arch.vtsc_offset, 0); +- now = scale_delta(delta, &d->arch.ns_to_vtsc); ++ now = gtime_to_gtsc(d, now); + + regs->eax = (uint32_t)now; + regs->edx = (uint32_t)(now >> 32); +@@ -1802,8 +1814,10 @@ void tsc_set_info(struct domain *d, + d->arch.vtsc_offset = get_s_time() - elapsed_nsec; + d->arch.tsc_khz = gtsc_khz ? gtsc_khz : cpu_khz; + set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000 ); +- /* use native TSC if initial host has safe TSC and not migrated yet */ +- if ( host_tsc_is_safe() && incarnation == 0 ) ++ /* use native TSC if initial host has safe TSC, has not migrated ++ * yet and tsc_khz == cpu_khz */ ++ if ( host_tsc_is_safe() && incarnation == 0 && ++ d->arch.tsc_khz == cpu_khz ) + d->arch.vtsc = 0; + else + d->arch.ns_to_vtsc = scale_reciprocal(d->arch.vtsc_to_ns); +@@ -1828,7 +1842,7 @@ void tsc_set_info(struct domain *d, + } + d->arch.incarnation = incarnation + 1; + if ( is_hvm_domain(d) ) +- hvm_set_rdtsc_exiting(d, d->arch.vtsc || hvm_gtsc_need_scale(d)); ++ hvm_set_rdtsc_exiting(d, d->arch.vtsc); + } + + /* vtsc may incur measurable performance degradation, diagnose with this */ +Index: xen-4.0.0-testing/xen/common/kernel.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/common/kernel.c ++++ xen-4.0.0-testing/xen/common/kernel.c +@@ -243,6 +243,8 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL + fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) | + (1U << XENFEAT_highmem_assist) | + (1U << XENFEAT_gnttab_map_avail_bits); ++ else ++ fi.submap |= (1U << XENFEAT_hvm_safe_pvclock); + #endif + break; + default: +Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h +=================================================================== +--- xen-4.0.0-testing.orig/xen/include/asm-x86/hvm/domain.h ++++ xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h +@@ -45,8 +45,6 @@ struct hvm_domain { + struct hvm_ioreq_page ioreq; + struct hvm_ioreq_page buf_ioreq; + +- uint32_t gtsc_khz; /* kHz */ +- bool_t tsc_scaled; + struct pl_time pl_time; + + struct hvm_io_handler io_handler; +Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm.h +=================================================================== +--- xen-4.0.0-testing.orig/xen/include/asm-x86/hvm/hvm.h ++++ xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm.h +@@ -290,7 +290,6 @@ int hvm_event_needs_reinjection(uint8_t + uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2); + + void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable); +-int hvm_gtsc_need_scale(struct domain *d); + + static inline int + hvm_cpu_prepare(unsigned int cpu) +Index: xen-4.0.0-testing/xen/include/asm-x86/time.h +=================================================================== +--- xen-4.0.0-testing.orig/xen/include/asm-x86/time.h ++++ xen-4.0.0-testing/xen/include/asm-x86/time.h +@@ -60,6 +60,7 @@ uint64_t acpi_pm_tick_to_ns(uint64_t tic + uint64_t ns_to_acpi_pm_tick(uint64_t ns); + + void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp); ++u64 gtime_to_gtsc(struct domain *d, u64 tsc); + + void tsc_set_info(struct domain *d, uint32_t tsc_mode, uint64_t elapsed_nsec, + uint32_t gtsc_khz, uint32_t incarnation); +Index: xen-4.0.0-testing/xen/include/public/features.h +=================================================================== +--- xen-4.0.0-testing.orig/xen/include/public/features.h ++++ xen-4.0.0-testing/xen/include/public/features.h +@@ -68,6 +68,9 @@ + */ + #define XENFEAT_gnttab_map_avail_bits 7 + ++/* x86: pvclock algorithm is safe to use on HVM */ ++#define XENFEAT_hvm_safe_pvclock 9 ++ + #define XENFEAT_NR_SUBMAPS 1 + + #endif /* __XEN_PUBLIC_FEATURES_H__ */ diff --git a/21693-memevent-64bit-only.patch b/21693-memevent-64bit-only.patch index 21b0498..5aca3aa 100644 --- a/21693-memevent-64bit-only.patch +++ b/21693-memevent-64bit-only.patch @@ -19,8 +19,10 @@ present in the hypervisor. Signed-off-by: Keir Fraser ---- a/tools/python/xen/xend/image.py -+++ b/tools/python/xen/xend/image.py +Index: xen-4.0.0-testing/tools/python/xen/xend/image.py +=================================================================== +--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py ++++ xen-4.0.0-testing/tools/python/xen/xend/image.py @@ -830,8 +830,10 @@ class HVMImageHandler(ImageHandler): self.acpi = int(vmConfig['platform'].get('acpi', 0)) self.guest_os_type = vmConfig['platform'].get('guest_os_type') @@ -34,8 +36,10 @@ Signed-off-by: Keir Fraser # Return a list of cmd line args to the device models based on the # xm config file ---- a/xen/arch/x86/domctl.c -+++ b/xen/arch/x86/domctl.c +Index: xen-4.0.0-testing/xen/arch/x86/domctl.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/domctl.c ++++ xen-4.0.0-testing/xen/arch/x86/domctl.c @@ -1420,6 +1420,7 @@ long arch_do_domctl( break; #endif /* XEN_GDBSX_CONFIG */ @@ -52,9 +56,11 @@ Signed-off-by: Keir Fraser default: ret = -ENOSYS; ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -948,6 +948,7 @@ bool_t hvm_hap_nested_page_fault(unsigne +Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c +@@ -922,6 +922,7 @@ bool_t hvm_hap_nested_page_fault(unsigne return 1; } @@ -62,7 +68,7 @@ Signed-off-by: Keir Fraser /* Check if the page has been paged out */ if ( p2m_is_paged(p2mt) || (p2mt == p2m_ram_paging_out) ) p2m_mem_paging_populate(current->domain, gfn); -@@ -958,6 +959,7 @@ bool_t hvm_hap_nested_page_fault(unsigne +@@ -932,6 +933,7 @@ bool_t hvm_hap_nested_page_fault(unsigne mem_sharing_unshare_page(current->domain, gfn, 0); return 1; } @@ -70,8 +76,10 @@ Signed-off-by: Keir Fraser /* Spurious fault? PoD and log-dirty also take this path. */ if ( p2m_is_ram(p2mt) ) ---- a/xen/arch/x86/mm.c -+++ b/xen/arch/x86/mm.c +Index: xen-4.0.0-testing/xen/arch/x86/mm.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/mm.c ++++ xen-4.0.0-testing/xen/arch/x86/mm.c @@ -3179,20 +3179,23 @@ int do_mmu_update( rc = -ENOENT; break; @@ -109,8 +117,10 @@ Signed-off-by: Keir Fraser default: return subarch_memory_op(op, arg); ---- a/xen/arch/x86/mm/Makefile -+++ b/xen/arch/x86/mm/Makefile +Index: xen-4.0.0-testing/xen/arch/x86/mm/Makefile +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/mm/Makefile ++++ xen-4.0.0-testing/xen/arch/x86/mm/Makefile @@ -6,9 +6,9 @@ obj-y += p2m.o obj-y += guest_walk_2.o obj-y += guest_walk_3.o @@ -124,8 +134,10 @@ Signed-off-by: Keir Fraser guest_walk_%.o: guest_walk.c Makefile $(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c +Index: xen-4.0.0-testing/xen/arch/x86/mm/p2m.c +=================================================================== +--- xen-4.0.0-testing.orig/xen/arch/x86/mm/p2m.c ++++ xen-4.0.0-testing/xen/arch/x86/mm/p2m.c @@ -1708,17 +1708,23 @@ void p2m_teardown(struct domain *d) { struct page_info *pg; @@ -169,8 +181,10 @@ Signed-off-by: Keir Fraser /* * Local variables: ---- a/xen/include/asm-x86/mem_sharing.h -+++ b/xen/include/asm-x86/mem_sharing.h +Index: xen-4.0.0-testing/xen/include/asm-x86/mem_sharing.h +=================================================================== +--- xen-4.0.0-testing.orig/xen/include/asm-x86/mem_sharing.h ++++ xen-4.0.0-testing/xen/include/asm-x86/mem_sharing.h @@ -22,6 +22,8 @@ #ifndef __MEM_SHARING_H__ #define __MEM_SHARING_H__ @@ -191,8 +205,10 @@ Signed-off-by: Keir Fraser +#endif /* __x86_64__ */ + #endif /* __MEM_SHARING_H__ */ ---- a/xen/include/asm-x86/p2m.h -+++ b/xen/include/asm-x86/p2m.h +Index: xen-4.0.0-testing/xen/include/asm-x86/p2m.h +=================================================================== +--- xen-4.0.0-testing.orig/xen/include/asm-x86/p2m.h ++++ xen-4.0.0-testing/xen/include/asm-x86/p2m.h @@ -77,11 +77,12 @@ typedef enum { p2m_grant_map_rw = 7, /* Read/write grant mapping */ p2m_grant_map_ro = 8, /* Read-only grant mapping */ diff --git a/README.SuSE b/README.SuSE index f161bbc..c8bd432 100644 --- a/README.SuSE +++ b/README.SuSE @@ -464,6 +464,9 @@ The hypervisor and domain 0 kernel are a matched set, and usually must be upgraded together. Consult the online documentation for a matrix of supported 32- and 64-bit combinations +A 64-bit paravirtualized VM will not run on 32-bit host but a 32-bit +paravirtualized VM will run on a 64-bit host. + On certain machines with 2GB or less of RAM, domain 0 Linux may fail to boot, printing the following messages: PCI-DMA: Using software bounce buffering for IO (SWIOTLB) @@ -495,8 +498,8 @@ file (viewable with the "xm dmesg" command). If problems persist, check if a newer version is available. Well-tested versions will be shipped with SUSE and via YaST Online Update. More frequent -(but less supported) updates are available on Novell's Forge site: - http://forge.novell.com/modules/xfmod/project/?xenpreview +(but less supported) updates are available on the Xen Technical Preview site: + ftp://ftp.novell.com/forge/XenTechnicalPreview/ Known Issues diff --git a/addcommand_domstate.patch b/addcommand_domstate.patch deleted file mode 100644 index ccbd453..0000000 --- a/addcommand_domstate.patch +++ /dev/null @@ -1,172 +0,0 @@ -Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py -=================================================================== ---- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomain.py -+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py -@@ -251,6 +251,18 @@ class XendDomain: - @return: path to config file. - """ - return os.path.join(self._managed_path(domuuid), CACHED_CONFIG_FILE) -+ def domain_setpauseflag(self, dom, flag=False): -+ try: -+ dominfo = self.domain_lookup_nr(dom) -+ dominfo.paused_by_admin = flag -+ except Exception, err: -+ log.debug("error in in setpauseflag") -+ def domain_getpauseflag(self, dom): -+ try: -+ dominfo = self.domain_lookup_nr(dom) -+ return dominfo.paused_by_admin -+ except Exception, err: -+ log.debug("error in in getpauseflag") - - def _managed_check_point_path(self, domuuid): - """Returns absolute path to check point file for managed domain. -Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py -=================================================================== ---- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -329,7 +329,9 @@ class XendDomainInfo: - @type info: dictionary - @ivar domid: Domain ID (if VM has started) - @type domid: int or None -- @ivar guest_bitsize: the bitsize of guest -+ @ivar paused_by_admin: Is this Domain paused by command or API -+ @type paused_by_admin: bool -+ @ivar guest_bitsize: the bitsize of guest - @type guest_bitsize: int or None - @ivar alloc_mem: the memory domain allocated when booting - @type alloc_mem: int or None -@@ -392,6 +394,7 @@ class XendDomainInfo: - self.domid = domid - self.guest_bitsize = None - self.alloc_mem = None -+ self.paused_by_admin = False - - maxmem = self.info.get('memory_static_max', 0) - memory = self.info.get('memory_dynamic_max', 0) -Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py -=================================================================== ---- xen-4.0.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py -+++ xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py -@@ -250,6 +250,20 @@ class SrvDomain(SrvDir): - self.acceptCommand(req) - return self.xd.domain_reset(self.dom.getName()) - -+ def op_do_get_pauseflag(self, op, req): -+ self.acceptCommand(req) -+ return req.threadRequest(self.do_get_pauseflag, op, req) -+ -+ def do_get_pauseflag(self, _, req): -+ return self.xd.domain_getpauseflag(self.dom.getName(), req) -+ -+ def op_do_set_pauseflag(self, op, req): -+ self.acceptCommand(req) -+ return req.threadRequest(self.do_set_pauseflag, op, req) -+ -+ def do_set_pauseflag(self, _, req): -+ return self.xd.domain_setpauseflag(self.dom.getName(), req) -+ - def op_usb_add(self, op, req): - self.acceptCommand(req) - return req.threadRequest(self.do_usb_add, op, req) -Index: xen-4.0.0-testing/tools/python/xen/xm/main.py -=================================================================== ---- xen-4.0.0-testing.orig/tools/python/xen/xm/main.py -+++ xen-4.0.0-testing/tools/python/xen/xm/main.py -@@ -174,6 +174,8 @@ SUBCOMMAND_HELP = { - #usb - 'usb-add' : (' <[host:bus.addr] [host:vendor_id:product_id]>','Add the usb device to FV VM.'), - 'usb-del' : (' <[host:bus.addr] [host:vendor_id:product_id]>','Delete the usb device to FV VM.'), -+ #domstate -+ 'domstate' : (' ', 'get the state of a domain'), - - # device commands - -@@ -409,6 +411,7 @@ common_commands = [ - "uptime", - "usb-add", - "usb-del", -+ "domstate", - "vcpu-set", - ] - -@@ -447,6 +450,7 @@ domain_commands = [ - "uptime", - "usb-add", - "usb-del", -+ "domstate", - "vcpu-list", - "vcpu-pin", - "vcpu-set", -@@ -1018,7 +1022,6 @@ def getDomains(domain_names, state, full - return "-" - state_str = "".join([state_on_off(state) - for state in states]) -- - dom_rec.update({'name': dom_rec['name_label'], - 'memory_actual': int(dom_metrics_rec['memory_actual'])/1024, - 'vcpus': dom_metrics_rec['VCPUs_number'], -@@ -1527,8 +1530,10 @@ def xm_pause(args): - - if serverType == SERVER_XEN_API: - server.xenapi.VM.pause(get_single_vm(dom)) -+ server.xenapi.VM.set_pauseflag(get_single_vm(dom), True) - else: - server.xend.domain.pause(dom) -+ server.xend.domain.setpauseflag(dom, True) - - def xm_unpause(args): - arg_check(args, "unpause", 1) -@@ -1536,8 +1541,10 @@ def xm_unpause(args): - - if serverType == SERVER_XEN_API: - server.xenapi.VM.unpause(get_single_vm(dom)) -+ server.xenapi.VM.set_pauseflag(get_single_vm(dom), False) - else: - server.xend.domain.unpause(dom) -+ server.xend.domain.setpauseflag(dom, False) - - def xm_dump_core(args): - live = False -@@ -1647,6 +1654,32 @@ def xm_usb_add(args): - arg_check(args, "usb-add", 2) - server.xend.domain.usb_add(args[0],args[1]) - -+def xm_domstate(args): -+ arg_check(args, "domstate", 1) -+ (opitons, params) = getopt.gnu_getopt(args, 's', ['domname=']) -+ doms = getDomains(params, 'all') -+ d = parse_doms_info(doms[0]) -+ state = d['state'] -+ if state: -+ if state.find('s') > 0: -+ print 'shutoff' -+ elif state.find('b') > 0: -+ print 'idle' -+ elif state.find('d') > 0: -+ print 'shutdown' -+ elif state.find('r') > 0: -+ print 'running' -+ elif state.find('c') > 0: -+ print 'crashed' -+ elif state.find('p') > 0: -+ if server.xend.domain.getpauseflag(args[0]): -+ print 'paused by admin' -+ else: -+ print 'paused' -+ else: -+ print 'shutoff' -+ return -+ - def xm_usb_del(args): - arg_check(args, "usb-del", 2) - server.xend.domain.usb_del(args[0],args[1]) -@@ -3859,6 +3892,8 @@ commands = { - #usb - "usb-add": xm_usb_add, - "usb-del": xm_usb_del, -+ #domstate -+ "domstate": xm_domstate, - } - - ## The commands supported by a separate argument parser in xend.xm. diff --git a/hv_xen_base.patch b/hv_xen_base.patch index 24e1caa..5201090 100644 --- a/hv_xen_base.patch +++ b/hv_xen_base.patch @@ -2,7 +2,7 @@ Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h =================================================================== --- xen-4.0.0-testing.orig/xen/include/asm-x86/hvm/domain.h +++ xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h -@@ -98,6 +98,7 @@ struct hvm_domain { +@@ -96,6 +96,7 @@ struct hvm_domain { struct vmx_domain vmx; struct svm_domain svm; }; @@ -33,7 +33,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c #include #include #include -@@ -461,6 +462,7 @@ void hvm_domain_relinquish_resources(str +@@ -435,6 +436,7 @@ void hvm_domain_relinquish_resources(str void hvm_domain_destroy(struct domain *d) { @@ -41,7 +41,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c hvm_funcs.domain_destroy(d); rtc_deinit(d); stdvga_deinit(d); -@@ -782,8 +784,14 @@ int hvm_vcpu_initialise(struct vcpu *v) +@@ -756,8 +758,14 @@ int hvm_vcpu_initialise(struct vcpu *v) v->arch.hvm_vcpu.xfeature_mask = XSTATE_FP_SSE; } @@ -56,7 +56,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 ) goto fail2; -@@ -834,12 +842,14 @@ int hvm_vcpu_initialise(struct vcpu *v) +@@ -808,12 +816,14 @@ int hvm_vcpu_initialise(struct vcpu *v) hvm_funcs.vcpu_destroy(v); fail2: vlapic_destroy(v); @@ -71,7 +71,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); hvm_vcpu_cacheattr_destroy(v); vlapic_destroy(v); -@@ -1899,7 +1909,7 @@ void hvm_cpuid(unsigned int input, unsig +@@ -1873,7 +1883,7 @@ void hvm_cpuid(unsigned int input, unsig return; if ( cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx) ) @@ -80,7 +80,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c domain_cpuid(v->domain, input, *ecx, eax, ebx, ecx, edx); -@@ -1966,6 +1976,8 @@ void hvm_cpuid(unsigned int input, unsig +@@ -1940,6 +1950,8 @@ void hvm_cpuid(unsigned int input, unsig *edx &= ~bitmaskof(X86_FEATURE_RDTSCP); break; } @@ -89,7 +89,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c } void hvm_rdtsc_intercept(struct cpu_user_regs *regs) -@@ -2066,6 +2078,8 @@ int hvm_msr_read_intercept(struct cpu_us +@@ -2040,6 +2052,8 @@ int hvm_msr_read_intercept(struct cpu_us break; /* ret == 0, This is not an MCE MSR, see other MSRs */ else if (!ret) @@ -98,7 +98,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c return hvm_funcs.msr_read_intercept(regs); } -@@ -2164,6 +2178,8 @@ int hvm_msr_write_intercept(struct cpu_u +@@ -2138,6 +2152,8 @@ int hvm_msr_write_intercept(struct cpu_u else if ( ret ) break; else if (!ret) @@ -107,7 +107,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c return hvm_funcs.msr_write_intercept(regs); } -@@ -2356,6 +2372,10 @@ int hvm_do_hypercall(struct cpu_user_reg +@@ -2330,6 +2346,10 @@ int hvm_do_hypercall(struct cpu_user_reg case 0: break; } @@ -118,7 +118,7 @@ Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c if ( (eax & 0x80000000) && is_viridian_domain(curr->domain) ) return viridian_hypercall(regs); -@@ -2890,6 +2910,18 @@ long do_hvm_op(unsigned long op, XEN_GUE +@@ -2864,6 +2884,18 @@ long do_hvm_op(unsigned long op, XEN_GUE rc = -EINVAL; break; diff --git a/popen2-argument-fix.patch b/popen2-argument-fix.patch new file mode 100644 index 0000000..ad4e6ec --- /dev/null +++ b/popen2-argument-fix.patch @@ -0,0 +1,13 @@ +Index: xen-4.0.0-testing/tools/python/xen/util/blkif.py +=================================================================== +--- xen-4.0.0-testing.orig/tools/python/xen/util/blkif.py ++++ xen-4.0.0-testing/tools/python/xen/util/blkif.py +@@ -81,7 +81,7 @@ def parse_uname(uname): + + if typ == "drbd": + if not fn.startswith("drbd"): +- (drbdadmstdin, drbdadmstdout) = os.popen2(["/sbin/drbdadm", "sh-dev", fn]) ++ (drbdadmstdin, drbdadmstdout) = os.popen2("/sbin/drbdadm "+"sh-dev "+fn) + fn = drbdadmstdout.readline().strip() + else: + fn = "/dev/%s" %(fn,) diff --git a/xen.changes b/xen.changes index ff7b48b..1ad131b 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Jul 21 11:46:41 MDT 2010 - carnold@novell.com + +- bnc#624285 - TP-L3: xen rdtsc emulation reports wrong frequency + 21445-x86-tsc-handling-cleanups-v2.patch + +------------------------------------------------------------------- +Thu Jul 20 13:23:14 MDT 2010 - carnold@novell.com + +- bnc#623201 - drbd xvd will fail in new xen4 packages due to wrong + popen2 arguments in blkif.py + popen2-argument-fix.patch + ------------------------------------------------------------------- Thu Jul 8 15:27:14 MDT 2010 - carnold@novell.com @@ -34,7 +47,7 @@ Tue Jul 6 11:31:33 MDT 2010 - carnold@novell.com ------------------------------------------------------------------- Fri Jun 25 15:43:35 CST 2010 - jsong@novell.com -- bnc #599550 - Xen cannot distinguish the status of 'pause' +- bnc#599550 - Xen cannot distinguish the status of 'pause' addcommand_domstate.patch ------------------------------------------------------------------- diff --git a/xen.spec b/xen.spec index 3cf387d..88caacf 100644 --- a/xen.spec +++ b/xen.spec @@ -108,31 +108,32 @@ Patch30: 21406-x86-microcode-quiet.patch Patch31: 21408-amd-erratum-383.patch Patch32: 21421-vts-ats-enabling.patch Patch33: 21435-vmx-retain-global-controls.patch -Patch34: 21446-iommu-graceful-generic-fail.patch -Patch35: 21453-shadow-avoid-remove-all-after-teardown.patch -Patch36: 21456-compat-hvm-addr-check.patch -Patch37: 21459-block-script.patch -Patch38: 21460-xend-timeoffset.patch -Patch39: 21492-x86-pirq-unbind.patch -Patch40: 21526-x86-nehalem-cpuid-mask.patch -Patch41: 21542-amd-erratum-411.patch -Patch42: 21615-dont-save-xen-heap-pages.patch -Patch43: 21620-x86-signed-domain-irq.patch -Patch44: 21627-cpuidle-wrap.patch -Patch45: 21643-vmx-vpmu-pmc-offset.patch -Patch46: 21653-xend-mac-addr.patch -Patch47: 21678-xend-mac-fix.patch -Patch48: 21682-trace-buffer-range.patch -Patch49: 21683-vtd-kill-timer-conditional.patch -Patch50: 21693-memevent-64bit-only.patch -Patch51: 21695-trace-t_info-readonly.patch -Patch52: 21698-x86-pirq-range-check.patch -Patch53: 21699-p2m-query-for-type-change.patch -Patch54: 21700-32on64-vm86-gpf.patch -Patch55: 21705-trace-printk.patch -Patch56: 21706-trace-security.patch -Patch57: 21712-amd-osvw.patch -Patch58: 21744-x86-cpufreq-range-check.patch +Patch34: 21445-x86-tsc-handling-cleanups-v2.patch +Patch35: 21446-iommu-graceful-generic-fail.patch +Patch36: 21453-shadow-avoid-remove-all-after-teardown.patch +Patch37: 21456-compat-hvm-addr-check.patch +Patch38: 21459-block-script.patch +Patch39: 21460-xend-timeoffset.patch +Patch40: 21492-x86-pirq-unbind.patch +Patch41: 21526-x86-nehalem-cpuid-mask.patch +Patch42: 21542-amd-erratum-411.patch +Patch43: 21615-dont-save-xen-heap-pages.patch +Patch44: 21620-x86-signed-domain-irq.patch +Patch45: 21627-cpuidle-wrap.patch +Patch46: 21643-vmx-vpmu-pmc-offset.patch +Patch47: 21653-xend-mac-addr.patch +Patch48: 21678-xend-mac-fix.patch +Patch49: 21682-trace-buffer-range.patch +Patch50: 21683-vtd-kill-timer-conditional.patch +Patch51: 21693-memevent-64bit-only.patch +Patch52: 21695-trace-t_info-readonly.patch +Patch53: 21698-x86-pirq-range-check.patch +Patch54: 21699-p2m-query-for-type-change.patch +Patch55: 21700-32on64-vm86-gpf.patch +Patch56: 21705-trace-printk.patch +Patch57: 21706-trace-security.patch +Patch58: 21712-amd-osvw.patch +Patch59: 21744-x86-cpufreq-range-check.patch # Our patches Patch300: xen-config.diff Patch301: xend-config.diff @@ -194,6 +195,8 @@ Patch367: cpu-pools-libxen.patch Patch368: cpu-pools-xmtest.patch Patch369: cpu-pools-docs.patch Patch370: xend-sysconfig.patch +Patch371: domu-usb-controller.patch +Patch372: popen2-argument-fix.patch # Patches for snapshot support Patch400: snapshot-ioemu-save.patch Patch401: snapshot-ioemu-restore.patch @@ -635,6 +638,7 @@ Authors: %patch56 -p1 %patch57 -p1 %patch58 -p1 +%patch59 -p1 %patch300 -p1 %patch301 -p1 %patch302 -p1 @@ -694,6 +698,8 @@ Authors: %patch368 -p1 %patch369 -p1 %patch370 -p1 +%patch371 -p1 +%patch372 -p1 %patch400 -p1 %patch401 -p1 %patch402 -p1