diff --git a/21894-intel-unmask-cpuid.patch b/21894-intel-unmask-cpuid.patch new file mode 100644 index 0000000..a6b7507 --- /dev/null +++ b/21894-intel-unmask-cpuid.patch @@ -0,0 +1,48 @@ +# HG changeset patch +# User Keir Fraser +# Date 1280486194 -3600 +# Node ID c9e7850ec9a18d7085c7468407e175bb64513846 +# Parent 754877be695ba3050f140002dbd185a27a437fcc +x86: unmask CPUID levels on Intel CPUs +References: bnc#640773 + +If the CPUID limit bit in MSR_IA32_MISC_ENABLE is set, clear it to +make all CPUID information available. This is required for some +features to work, such as MWAIT in cpuidle, get cpu topology, XSAVE, +etc. + +Signed-off-by: Wei Gang + +--- a/xen/arch/x86/cpu/intel.c ++++ b/xen/arch/x86/cpu/intel.c +@@ -90,6 +90,20 @@ void __devinit early_intel_workaround(st + /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */ + if (c->x86 == 15 && c->x86_cache_alignment == 64) + c->x86_cache_alignment = 128; ++ ++ /* Unmask CPUID levels if masked: */ ++ if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) { ++ u64 misc_enable; ++ ++ rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); ++ ++ if (misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID) { ++ misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; ++ wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); ++ c->cpuid_level = cpuid_eax(0); ++ printk("revised cpuid_level = %d\n", c->cpuid_level); ++ } ++ } + } + + /* +--- a/xen/include/asm-x86/msr-index.h ++++ b/xen/include/asm-x86/msr-index.h +@@ -324,6 +324,7 @@ + #define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL (1<<11) + #define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1<<12) + #define MSR_IA32_MISC_ENABLE_MONITOR_ENABLE (1<<18) ++#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1<<22) + #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1<<23) + + /* Intel Model 6 */ diff --git a/22135-heap-lock.patch b/22135-heap-lock.patch new file mode 100644 index 0000000..bdc8a66 --- /dev/null +++ b/22135-heap-lock.patch @@ -0,0 +1,51 @@ +References: bnc#638465 + +# HG changeset patch +# User Keir Fraser +# Date 1284394111 -3600 +# Node ID 69e8bb164683c76e0cd787df21b98c73905a61e6 +# Parent e300bfa3c0323ac08e7b8cd9fb40f9f1ab548543 +page_alloc: Hold heap_lock while adjusting page states to/from PGC_state_free. + +This avoids races with buddy-merging logic in free_heap_pages(). + +Signed-off-by: Keir Fraser + +--- a/xen/common/page_alloc.c ++++ b/xen/common/page_alloc.c +@@ -378,8 +378,6 @@ static struct page_info *alloc_heap_page + total_avail_pages -= request; + ASSERT(total_avail_pages >= 0); + +- spin_unlock(&heap_lock); +- + cpus_clear(mask); + + for ( i = 0; i < (1 << order); i++ ) +@@ -401,6 +399,8 @@ static struct page_info *alloc_heap_page + page_set_owner(&pg[i], NULL); + } + ++ spin_unlock(&heap_lock); ++ + if ( unlikely(!cpus_empty(mask)) ) + { + perfc_incr(need_flush_tlb_flush); +@@ -496,6 +496,8 @@ static void free_heap_pages( + ASSERT(order <= MAX_ORDER); + ASSERT(node >= 0); + ++ spin_lock(&heap_lock); ++ + for ( i = 0; i < (1 << order); i++ ) + { + /* +@@ -523,8 +525,6 @@ static void free_heap_pages( + pg[i].tlbflush_timestamp = tlbflush_current_time(); + } + +- spin_lock(&heap_lock); +- + avail[node][zone] += 1 << order; + total_avail_pages += 1 << order; + diff --git a/22148-serial-irq-dest.patch b/22148-serial-irq-dest.patch new file mode 100644 index 0000000..3c7736b --- /dev/null +++ b/22148-serial-irq-dest.patch @@ -0,0 +1,24 @@ +# HG changeset patch +# User Keir Fraser +# Date 1284395845 -3600 +# Node ID a254d1236c1a52264beb0253352ef64d65a98eb3 +# Parent f0a1229cb0a6505f3240ac59a3bb6ade2acfa1a2 +Fix serial interrupt's destination + +Lowest Priority can't use with invalid cpu_mask, and the default value +of CPU_MASK_ALL may cover CPU which wasn't online. + +From: "Yang, Sheng" +Signed-off-by: Keir Fraser + +--- a/xen/arch/x86/smpboot.c ++++ b/xen/arch/x86/smpboot.c +@@ -1602,7 +1602,7 @@ void __init smp_intr_init(void) + irq_vector[irq] = FIRST_HIPRIORITY_VECTOR + seridx + 1; + per_cpu(vector_irq, cpu)[FIRST_HIPRIORITY_VECTOR + seridx + 1] = irq; + irq_cfg[irq].vector = FIRST_HIPRIORITY_VECTOR + seridx + 1; +- irq_cfg[irq].domain = (cpumask_t)CPU_MASK_ALL; ++ irq_cfg[irq].domain = cpu_online_map; + } + + /* IPI for cleanuping vectors after irq move */ diff --git a/7410-qemu-alt-gr.patch b/7410-qemu-alt-gr.patch new file mode 100644 index 0000000..e41ba7a --- /dev/null +++ b/7410-qemu-alt-gr.patch @@ -0,0 +1,118 @@ +# HG changeset patch +# User Ian Jackson +# Date 1284481903 -3600 +# Node ID f71a4c18e34e86e1011662fa42c10ec54bff0688 +# Parent 080b5a094d4e0acab6646125f91f988911409016 +ioemu: fix VNC altgr-insert behavior + +When access to a Xen DomU (Linux) from a VNC client in Windows, alt-gr +key is not working properly with Spanish keyboard. When Alt + another +key pressed, vncserver receives Altgr down, Altgr up and key down +messages in order, that causes incorrect output. + +With following patch, when vncerver receives key down message, it +first check if the keysym needs altgr modifer, if it needs altgr +modifier but altgr is not 'down', sending altgr keycode before sending +key keycode. + +Signed-off-by: Chunyan Liu + +committer: Ian Jackson +git-commit-id: f95d202ed6444dacb15fbea4dee185eb0e048d9a + +diff -r 080b5a094d4e -r f71a4c18e34e keymaps.c +--- a/tools/ioemu-qemu-xen/keymaps.c Wed Sep 08 16:38:09 2010 +0100 ++++ b//tools/ioemu-qemu-xen/keymaps.c Tue Sep 14 17:31:43 2010 +0100 +@@ -51,6 +51,7 @@ + struct key_range *numlock_range; + struct key_range *shift_range; + struct key_range *localstate_range; ++ struct key_range *altgr_range; + } kbd_layout_t; + + static void add_to_key_range(struct key_range **krp, int code) { +@@ -133,7 +134,11 @@ + add_to_key_range(&k->localstate_range, keycode); + //fprintf(stderr, "localstate keysym %04x keycode %d\n", keysym, keycode); + } +- ++ if (rest && strstr(rest, "altgr")) { ++ add_to_key_range(&k->altgr_range, keysym); ++ //fprintf(stderr, "altgr keysym %04x keycode %d\n", keysym, keycode); ++ } ++ + /* if(keycode&0x80) + keycode=(keycode<<8)^0x80e0; */ + if (keysym < MAX_NORMAL_KEYCODE) { +@@ -233,3 +238,16 @@ + return 0; + return 1; + } ++ ++static inline int keysym_is_altgr(void *kbd_layout, int keysym) ++{ ++ kbd_layout_t *k = kbd_layout; ++ struct key_range *kr; ++ ++ for (kr = k->altgr_range; kr; kr = kr->next) ++ if (keysym >= kr->start && keysym <= kr->end){ ++ return 1; ++ } ++ return 0; ++} ++ +diff -r 080b5a094d4e -r f71a4c18e34e vnc.c +--- a/tools/ioemu-qemu-xen/vnc.c Wed Sep 08 16:38:09 2010 +0100 ++++ b/tools/ioemu-qemu-xen/vnc.c Tue Sep 14 17:31:43 2010 +0100 +@@ -1274,12 +1274,27 @@ + } + } + ++static void press_key_altgr_down(VncState *vs, int down) ++{ ++ kbd_put_keycode(0xe0); ++ if (down){ ++ kbd_put_keycode(0xb8 & 0x7f); ++ vs->modifiers_state[0xb8] = 1; ++ } ++ else { ++ kbd_put_keycode(0xb8 | 0x80); ++ vs->modifiers_state[0xb8] = 0; ++ } ++} ++ + static void do_key_event(VncState *vs, int down, uint32_t sym) + { + int keycode; + int shift_keys = 0; + int shift = 0; + int keypad = 0; ++ int altgr = 0; ++ int altgr_keys = 0; + + if (is_graphic_console()) { + if (sym >= 'A' && sym <= 'Z') { +@@ -1289,8 +1304,11 @@ + else { + shift = keysym_is_shift(vs->kbd_layout, sym & 0xFFFF); + } ++ ++ altgr = keysym_is_altgr(vs->kbd_layout, sym & 0xFFFF); + } + shift_keys = vs->modifiers_state[0x2a] | vs->modifiers_state[0x36]; ++ altgr_keys = vs->modifiers_state[0xb8]; + + keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF); + if (keycode == 0) { +@@ -1357,6 +1375,11 @@ + } + + if (is_graphic_console()) { ++ ++ if (altgr && !altgr_keys) { ++ press_key_altgr_down(vs, down); ++ } ++ + /* If the shift state needs to change then simulate an additional + keypress before sending this one. Ignore for non shiftable keys. + */ diff --git a/capslock_enable.patch b/capslock_enable.patch index ee5946c..dacca9a 100644 --- a/capslock_enable.patch +++ b/capslock_enable.patch @@ -2,7 +2,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/vnc.c =================================================================== --- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/vnc.c +++ xen-4.0.1-testing/tools/ioemu-qemu-xen/vnc.c -@@ -1326,6 +1326,11 @@ static void do_key_event(VncState *vs, i +@@ -1344,6 +1344,11 @@ static void do_key_event(VncState *vs, i } break; case 0x3a: /* CapsLock */ diff --git a/check_device_status.patch b/check_device_status.patch new file mode 100644 index 0000000..983b104 --- /dev/null +++ b/check_device_status.patch @@ -0,0 +1,48 @@ +diff -r ce65e0e03a57 tools/python/xen/xend/server/DevController.py +--- a/tools/python/xen/xend/server/DevController.py Fri Aug 27 16:53:00 2010 +0800 ++++ b/tools/python/xen/xend/server/DevController.py Fri Aug 27 17:13:32 2010 +0800 +@@ -149,7 +149,10 @@ + (status, err) = self.waitForBackend(devid) + + if status == Timeout: +- self.destroyDevice(devid, False) ++ #Clean timeout backend resource ++ dev = self.convertToDeviceNumber(devid) ++ self.writeBackend(dev, HOTPLUG_STATUS_NODE, HOTPLUG_STATUS_ERROR) ++ self.destroyDevice(devid, True) + raise VmError("Device %s (%s) could not be connected. " + "Hotplug scripts not working." % + (devid, self.deviceClass)) +@@ -554,7 +557,17 @@ + + xswatch(statusPath, hotplugStatusCallback, ev, result) + +- ev.wait(DEVICE_CREATE_TIMEOUT) ++ for i in range(1, 50): ++ ev.wait(DEVICE_CREATE_TIMEOUT/50) ++ status = xstransact.Read(statusPath) ++ if status is not None: ++ if status == HOTPLUG_STATUS_ERROR: ++ result['status'] = Error ++ elif status == HOTPLUG_STATUS_BUSY: ++ result['status'] = Busy ++ else: ++ result['status'] = Connected ++ break + + err = xstransact.Read(backpath, HOTPLUG_ERROR_NODE) + +@@ -571,7 +584,12 @@ + + xswatch(statusPath, deviceDestroyCallback, ev, result) + +- ev.wait(DEVICE_DESTROY_TIMEOUT) ++ for i in range(1, 50): ++ ev.wait(DEVICE_DESTROY_TIMEOUT/50) ++ status = xstransact.Read(statusPath) ++ if status is None: ++ result['status'] = Disconnected ++ break + + return result['status'] + diff --git a/heaplock.patch b/heaplock.patch deleted file mode 100644 index 9593000..0000000 --- a/heaplock.patch +++ /dev/null @@ -1,41 +0,0 @@ -From: Keir Fraser -References: bnc#638465 - ---- a/xen/common/page_alloc.c Wed Sep 01 10:22:05 2010 +0100 -+++ b/xen/common/page_alloc.c Tue Sep 07 13:55:34 2010 +0100 -@@ -378,8 +378,6 @@ - total_avail_pages -= request; - ASSERT(total_avail_pages >= 0); - -- spin_unlock(&heap_lock); -- - cpus_clear(mask); - - for ( i = 0; i < (1 << order); i++ ) -@@ -400,6 +398,8 @@ - pg[i].u.inuse.type_info = 0; - page_set_owner(&pg[i], NULL); - } -+ -+ spin_unlock(&heap_lock); - - if ( unlikely(!cpus_empty(mask)) ) - { -@@ -496,6 +496,8 @@ - ASSERT(order <= MAX_ORDER); - ASSERT(node >= 0); - -+ spin_lock(&heap_lock); -+ - for ( i = 0; i < (1 << order); i++ ) - { - /* -@@ -522,8 +524,6 @@ - if ( pg[i].u.free.need_tlbflush ) - pg[i].tlbflush_timestamp = tlbflush_current_time(); - } -- -- spin_lock(&heap_lock); - - avail[node][zone] += 1 << order; - total_avail_pages += 1 << order; diff --git a/multi-xvdp.patch b/multi-xvdp.patch new file mode 100644 index 0000000..0da4e79 --- /dev/null +++ b/multi-xvdp.patch @@ -0,0 +1,87 @@ +Index: xen-4.0.1-testing/tools/python/xen/util/blkif.py +=================================================================== +--- xen-4.0.1-testing.orig/tools/python/xen/util/blkif.py ++++ xen-4.0.1-testing/tools/python/xen/util/blkif.py +@@ -19,10 +19,12 @@ def blkdev_name_to_number(name): + devname = 'virtual-device' + devnum = None + ++ """ + try: + return (devname, os.stat(n).st_rdev) + except Exception, ex: + pass ++ """ + + scsi_major = [ 8, 65, 66, 67, 68, 69, 70, 71, 128, 129, 130, 131, 132, 133, 134, 135 ] + if re.match( '/dev/sd[a-z]([1-9]|1[0-5])?$', n): +Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py +=================================================================== +--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -73,7 +73,7 @@ from xen.xend.XendPSCSI import XendPSCSI + from xen.xend.XendDSCSI import XendDSCSI, XendDSCSI_HBA + + MIGRATE_TIMEOUT = 30.0 +-BOOTLOADER_LOOPBACK_DEVICE = '/dev/xvdp' ++BOOTLOADER_LOOPBACK_DEVICES = ['/dev/xvdy', '/dev/xvdx', '/dev/xvdw', '/dev/xvdv', '/dev/xvdu', '/dev/xvdt', '/dev/xvds', '/dev/xvdr', '/dev/xvdq', '/dev/xvdp', '/dev/xvdo', '/dev/xvdn', '/dev/xvdm', '/dev/xvdl', '/dev/xvdk', '/dev/xvdj', '/dev/xvdi', '/dev/xvdh', '/dev/xvdg', '/dev/xvdf', '/dev/xvde', '/dev/xvdd'] + + xc = xen.lowlevel.xc.xc() + xoptions = XendOptions.instance() +@@ -3314,20 +3314,27 @@ 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. +- +- log.info("Mounting %s on %s." % +- (fn, BOOTLOADER_LOOPBACK_DEVICE)) +- +- vbd = { +- 'mode': 'RW', +- 'device': BOOTLOADER_LOOPBACK_DEVICE, +- } +- +- from xen.xend import XendDomain +- dom0 = XendDomain.instance().privilegedDomain() +- vbd_uuid = dom0.create_vbd(vbd, disk) +- dom0._waitForDeviceFrontUUID(vbd_uuid) +- fn = BOOTLOADER_LOOPBACK_DEVICE ++ # Try all possible loopback_devices ++ for loopback_device in BOOTLOADER_LOOPBACK_DEVICES: ++ log.info("Mounting %s on %s." % (fn, loopback_device)) ++ vbd = { 'mode' : 'RW', 'device' : loopback_device, } ++ try: ++ from xen.xend import XendDomain ++ dom0 = XendDomain.instance().privilegedDomain() ++ vbd_uuid = dom0.create_vbd(vbd, disk) ++ dom0._waitForDeviceFrontUUID(vbd_uuid) ++ fn = loopback_device ++ break ++ except VmError, e: ++ if str(e).find('already connected.') != -1: ++ continue ++ elif str(e).find('isn\'t accessible') != -1: ++ dom0.destroyDevice('vbd', loopback_device, force = True, rm_cfg = True) ++ continue ++ else: ++ raise ++ else: ++ raise + + try: + blcfg = bootloader(blexec, fn, self, False, +@@ -3335,11 +3342,11 @@ class XendDomainInfo: + finally: + if mounted: + log.info("Unmounting %s from %s." % +- (fn, BOOTLOADER_LOOPBACK_DEVICE)) ++ (fn, loopback_device)) + if devtype in ['tap', 'tap2']: +- dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE, rm_cfg = True) ++ dom0.destroyDevice('tap', loopback_device, rm_cfg = True) + else: +- dom0.destroyDevice('vbd', BOOTLOADER_LOOPBACK_DEVICE, rm_cfg = True) ++ dom0.destroyDevice('vbd', loopback_device, rm_cfg = True) + + if blcfg is None: + msg = "Had a bootloader specified, but can't find disk" diff --git a/xen-domUloader.diff b/xen-domUloader.diff index 7e61638..ed51a5f 100644 --- a/xen-domUloader.diff +++ b/xen-domUloader.diff @@ -101,11 +101,11 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendBootloader.py + raise VmError(msg) + + avail = False -+ for i in xrange(1, 20): ++ for i in xrange(1, 100): + avail = os.access(disk, os.R_OK) + if avail: + break -+ time.sleep(.05) ++ time.sleep(.1) + + if not avail: + msg = "Disk '%s' isn't accessible" % disk diff --git a/xen.changes b/xen.changes index 045a893..e43d30e 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Mon Sep 27 09:59:37 MDT 2010 - carnold@novell.com + +- bnc#640773 - Xen kernel crashing right after grub + 21894-intel-unmask-cpuid.patch +- Upstream patch from Jan + 22148-serial-irq-dest.patch + +------------------------------------------------------------------- +Tue Sep 23 16:45:11 CST 2010 - cyliu@novell.com + +- bnc#628719 - improve check_device_status to handle HA cases + check_device_status.patch + +------------------------------------------------------------------- +Tue Sep 23 16:43:11 CST 2010 - cyliu@novell.com + +- bnc#628719 - multi-xvdp + mutli-xvdp.patch + +------------------------------------------------------------------- +Tue Sep 20 14:11:31 CST 2010 - cyliu@novell.com + +- bnc#632956 - fix VNC altgr-insert behavior + ------------------------------------------------------------------- Mon Sep 13 16:24:31 MDT 2010 - carnold@novell.com @@ -19,7 +44,7 @@ Mon Sep 13 10:50:56 MDT 2010 - carnold@novell.com Mon Sep 13 10:47:09 MDT 2010 - carnold@novell.com - bnc#638465 - hypervisor panic in memory handling - heaplock.patch + 22135-heap-lock.patch ------------------------------------------------------------------- Thu Sep 9 11:29:45 MDT 2010 - carnold@novell.com diff --git a/xen.spec b/xen.spec index 9d31108..901bdff 100644 --- a/xen.spec +++ b/xen.spec @@ -91,12 +91,16 @@ Patch13: 21683-vtd-kill-timer-conditional.patch Patch14: 21723-get-domu-state.patch Patch15: 21847-pscsi.patch Patch16: 21866-xenapi.patch -Patch17: 22019-x86-cpuidle-online-check.patch -Patch18: 22051-x86-forced-EOI.patch -Patch19: 22067-x86-irq-domain.patch -Patch20: 22068-vtd-irte-RH-bit.patch -Patch21: 22071-ept-get-entry-lock.patch -Patch22: 22084-x86-xsave-off.patch +Patch17: 21894-intel-unmask-cpuid.patch +Patch18: 22019-x86-cpuidle-online-check.patch +Patch19: 22051-x86-forced-EOI.patch +Patch20: 22067-x86-irq-domain.patch +Patch21: 22068-vtd-irte-RH-bit.patch +Patch22: 22071-ept-get-entry-lock.patch +Patch23: 22084-x86-xsave-off.patch +Patch24: 7410-qemu-alt-gr.patch +Patch25: 22135-heap-lock.patch +Patch26: 22148-serial-irq-dest.patch # Our patches Patch300: xen-config.diff Patch301: xend-config.diff @@ -184,6 +188,8 @@ Patch429: hibernate.patch Patch430: del_usb_xend_entry.patch Patch431: capslock_enable.patch Patch432: enable_more_nic_pxe.patch +Patch433: multi-xvdp.patch +Patch434: check_device_status.patch # Jim's domain lock patch Patch450: xend-domain-lock.patch # Hypervisor and PV driver Patches @@ -202,7 +208,6 @@ Patch511: supported_module.diff Patch512: magic_ioport_compat.patch Patch650: disable_emulated_device.diff Patch651: ioemu-disable-scsi.patch -Patch652: heaplock.patch # novell_shim patches Patch700: hv_tools.patch Patch701: hv_xen_base.patch @@ -565,6 +570,10 @@ Authors: %patch20 -p1 %patch21 -p1 %patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 %patch300 -p1 %patch301 -p1 %patch302 -p1 @@ -647,6 +656,8 @@ Authors: %patch430 -p1 %patch431 -p1 %patch432 -p1 +%patch433 -p1 +%patch434 -p1 %patch450 -p1 %patch500 -p1 %patch501 -p1 @@ -663,7 +674,6 @@ Authors: %patch512 -p1 %patch650 -p1 %patch651 -p1 -%patch652 -p1 %patch700 -p1 %patch701 -p1 %patch702 -p1 diff --git a/xend-domain-lock.patch b/xend-domain-lock.patch index 72c74ba..01d5912 100644 --- a/xend-domain-lock.patch +++ b/xend-domain-lock.patch @@ -106,7 +106,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py finally: self.refresh_shutdown_lock.release() -@@ -4496,6 +4503,74 @@ class XendDomainInfo: +@@ -4503,6 +4510,74 @@ class XendDomainInfo: def has_device(self, dev_class, dev_uuid): return (dev_uuid in self.info['%s_refs' % dev_class.lower()])