Hello community,
here is the log from the commit of package xen
checked in at Sat Nov 8 20:32:05 CET 2008.
--------
--- arch/i386/xen/xen.changes 2008-10-28 18:20:24.000000000 +0100
+++ /mounts/work_src_done/STABLE/xen/xen.changes 2008-11-07 19:36:37.000000000 +0100
@@ -1,0 +2,31 @@
+Fri Nov 7 13:49:09 CET 2008 - kwolf@suse.de
+
+- Fix merge damage which prevented disks to be snapshotted when
+ not in disk-only snapshot mode
+
+-------------------------------------------------------------------
+Wed Nov 5 17:22:30 CET 2008 - kwolf@suse.de
+
+- bnc#435195 - Fix error handling for blktap devices and ioemu;
+ check for images smaller than a sector and abort (causes hangs
+ of the complete blktap stack otherwise)
+
+ ioemu-blktap-zero-size.patch
+
+-------------------------------------------------------------------
+Mon Nov 3 10:30:49 MST 2008 - plc@novell.com
+
+- bnc#436572 - L3: vm serial port configuration and access is not
+ persistent across dom0 reboot
+
+-------------------------------------------------------------------
+Wed Oct 29 11:50:45 MDT 2008 - carnold@novell.com
+
+- bnc#436926 - Xen hypervisor crash
+
+-------------------------------------------------------------------
+Tue Oct 28 21:17:12 MDT 2008 - jfehlig@novell.com
+
+- bnc#438927 - Fix migration bug in xend
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
18542-pmstat-arg-check.patch
18631-msix-intr-remap.patch
svm-lmsl.patch
vtd-alloc-checks.patch
x86-emul-movnti.patch
New:
----
18637-vmx-set-dr7.patch
18656-vtd-alloc-checks.patch
18661-recursive-spinlocks.patch
18745-xend-ioport-irq.patch
dom-print.patch
ioemu-blktap-zero-size.patch
x86-dom-cleanup-no-hack.patch
x86-dom-cleanup.patch
x86-partial-page-ref.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:10.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:10.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package xen (Version 3.3.1_18455_01)
+# spec file for package xen (Version 3.3.1_18486_01)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -22,9 +22,9 @@
ExclusiveArch: %ix86 x86_64
%define xvers 3.3
%define xvermaj 3
-%define changeset 18455
+%define changeset 18486
%define xen_build_dir xen-3.3.1-testing
-%define with_kmp 0
+%define with_kmp 1
BuildRequires: LibVNCServer-devel SDL-devel automake bin86 curl-devel dev86 graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel pciutils-devel python-devel transfig
%if %suse_version >= 1030
BuildRequires: texlive texlive-latex
@@ -37,8 +37,8 @@
%if %{?with_kmp}0
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
-Version: 3.3.1_18455_01
-Release: 3
+Version: 3.3.1_18486_01
+Release: 1
License: GPL v2 only
Group: System/Kernel
AutoReqProv: on
@@ -88,16 +88,18 @@
Patch19: 18523-per-CPU-misc.patch
Patch20: 18528-dump-evtchn.patch
Patch21: 18539-pirq-vector-mapping.patch
-Patch22: 18542-pmstat-arg-check.patch
-Patch23: 18547-pirq-vector-mapping-fix.patch
-Patch24: 18573-move-pirq-logic.patch
-Patch25: 18574-msi-free-vector.patch
-Patch26: 18577-bad-assertion.patch
-Patch27: 18583-passthrough-locking.patch
-Patch28: 18584-evtchn-lock-rename.patch
-Patch29: 18620-x86-page-type-preemptible-fix.patch
-Patch30: 18631-msix-intr-remap.patch
-Patch31: 18654-xend-vcpus.patch
+Patch22: 18547-pirq-vector-mapping-fix.patch
+Patch23: 18573-move-pirq-logic.patch
+Patch24: 18574-msi-free-vector.patch
+Patch25: 18577-bad-assertion.patch
+Patch26: 18583-passthrough-locking.patch
+Patch27: 18584-evtchn-lock-rename.patch
+Patch28: 18620-x86-page-type-preemptible-fix.patch
+Patch29: 18637-vmx-set-dr7.patch
+Patch30: 18654-xend-vcpus.patch
+Patch31: 18656-vtd-alloc-checks.patch
+Patch32: 18661-recursive-spinlocks.patch
+Patch33: 18745-xend-ioport-irq.patch
# Our patches
Patch100: xen-config.diff
Patch101: xend-config.diff
@@ -159,25 +161,27 @@
Patch184: ioemu-blktap-barriers.patch
Patch185: tapdisk-ioemu-logfile.patch
Patch186: blktap-ioemu-close-fix.patch
+Patch187: ioemu-blktap-zero-size.patch
# Jim's domain lock patch
Patch190: xend-domain-lock.patch
# Patches from Jan
Patch240: dump-exec-state.patch
Patch241: x86-show-page-walk-early.patch
-Patch242: svm-lmsl.patch
-Patch243: x86-extra-trap-info.patch
-Patch244: x86-alloc-cpu-structs.patch
-Patch245: 32on64-extra-mem.patch
-Patch246: msi-enable.patch
+Patch242: x86-extra-trap-info.patch
+Patch243: x86-alloc-cpu-structs.patch
+Patch244: 32on64-extra-mem.patch
+Patch245: msi-enable.patch
# PV Driver Patches
Patch350: pv-driver-build.patch
Patch351: xen-ioemu-hvm-pv-support.diff
Patch352: pvdrv_emulation_control.patch
Patch353: blktap-pv-cdrom.patch
-Patch354: vtd-alloc-checks.patch
-Patch355: x86-emul-movnti.patch
-Patch356: i386-highmem-assist.patch
-Patch357: x86-cpufreq-report.patch
+Patch354: i386-highmem-assist.patch
+Patch355: x86-cpufreq-report.patch
+Patch356: x86-dom-cleanup.patch
+Patch357: x86-dom-cleanup-no-hack.patch
+Patch358: x86-partial-page-ref.patch
+Patch359: dom-print.patch
# novell_shim patches
Patch400: hv_tools.patch
Patch401: hv_xen_base.patch
@@ -545,6 +549,8 @@
%patch29 -p1
%patch30 -p1
%patch31 -p1
+%patch32 -p1
+%patch33 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
@@ -603,6 +609,7 @@
%patch184 -p1
%patch185 -p1
%patch186 -p1
+%patch187 -p1
%patch190 -p1
%patch240 -p1
%patch241 -p1
@@ -610,7 +617,6 @@
%patch243 -p1
%patch244 -p1
%patch245 -p1
-%patch246 -p1
%patch350 -p1
%patch351 -p1
%patch352 -p1
@@ -619,6 +625,8 @@
%patch355 -p1
%patch356 -p1
%patch357 -p1
+%patch358 -p1
+%patch359 -p1
# Don't use shim for now
%ifarch x86_64
%patch400 -p1
@@ -816,7 +824,6 @@
%defattr(-,root,root)
#/usr/bin/lomount
/usr/bin/xencons
-/usr/bin/xenperf
/usr/bin/xenstore*
/usr/bin/xentrace*
/usr/bin/pygrub
@@ -969,6 +976,21 @@
/sbin/ldconfig
%changelog
+* Fri Nov 07 2008 kwolf@suse.de
+- Fix merge damage which prevented disks to be snapshotted when
+ not in disk-only snapshot mode
+* Wed Nov 05 2008 kwolf@suse.de
+- bnc#435195 - Fix error handling for blktap devices and ioemu;
+ check for images smaller than a sector and abort (causes hangs
+ of the complete blktap stack otherwise)
+ ioemu-blktap-zero-size.patch
+* Mon Nov 03 2008 plc@novell.com
+- bnc#436572 - L3: vm serial port configuration and access is not
+ persistent across dom0 reboot
+* Wed Oct 29 2008 carnold@novell.com
+- bnc#436926 - Xen hypervisor crash
+* Wed Oct 29 2008 jfehlig@novell.com
+- bnc#438927 - Fix migration bug in xend
* Tue Oct 28 2008 carnold@suse.de
- disable KMP, does not build with current kernel
* Fri Oct 24 2008 jfehlig@novell.com
@@ -995,7 +1017,7 @@
blktap-ioemu-close-fix.patch
- blktapctrl: If tapdisk-ioemu has been shut down and a new
instance is needed, fix saving the PID of the new instance
-* Fri Oct 03 2008 jfehlig@novell.com
+* Thu Oct 02 2008 jfehlig@novell.com
- bnc#431737 - Fix use of deprecated python constructs in xend
* Mon Sep 29 2008 carnold@novell.com
- Update to c/s 18430, remove our versions of upstream patches.
@@ -1006,7 +1028,7 @@
* Thu Sep 25 2008 kwolf@suse.de
- bnc#429801 - Fixed xm start -c / --vncviewer
xm-start-fix.patch
-* Thu Sep 25 2008 carnold@novell.com
+* Wed Sep 24 2008 carnold@novell.com
- bnc#382401 - xm man page missing information for commands.
* Wed Sep 17 2008 carnold@novell.com
- Pulled some upstream patches for Intel and AMD microcode fixes.
@@ -1064,7 +1086,7 @@
- Added patch to prevent starting same domU from multiple hosts.
Feature is disabled by default - see /etc/xen/xend-config.sxp.
fate#305062
-* Tue Aug 12 2008 jfehlig@novell.com
+* Mon Aug 11 2008 jfehlig@novell.com
- Added python-openssl to Requires list for xen-tools. This
package is required if SSL relocation is enabled by user.
* Mon Aug 11 2008 carnold@novell.com
@@ -1072,7 +1094,7 @@
* Sat Aug 09 2008 jfehlig@novell.com
- Disabled xend-relocation-ssl-server for now. Certificates must
be created and feature needs testing.
-* Sat Aug 09 2008 carnold@novell.com
+* Fri Aug 08 2008 carnold@novell.com
- Update to xen-unstable changeset 18269 post RC3. Reverse
version back to 3.3.0 from 4.0.0.
* Wed Aug 06 2008 carnold@novell.com
@@ -1080,9 +1102,9 @@
3.3.0 to 4.0.0
* Mon Aug 04 2008 carnold@novell.com
- Updated to xen-unstable changeset 18210. Post 3.3.0-rc2.
-* Wed Jul 09 2008 carnold@novell.com
+* Tue Jul 08 2008 carnold@novell.com
- Updated to xen-unstable changeset 17990.
-* Wed Jul 09 2008 kwolf@suse.de
+* Tue Jul 08 2008 kwolf@suse.de
- ioemu: Write barriers for blktap devices
ioemu-blktap-barriers.patch
* Thu Jul 03 2008 kwolf@suse.de
@@ -1114,7 +1136,7 @@
ifup-bridge in sysconfig has been fixed so patch is no longer
needed. Calling ifdown on bridge now removes ports and deletes
bridge, so network-bridge no longer needs to do these tasks.
-* Sat May 17 2008 carnold@novell.com
+* Fri May 16 2008 carnold@novell.com
- bnc#390985 - xm man page needs FIXME sections to be fixed
xen-fixme-doc.diff
* Wed May 14 2008 carnold@novell.com
@@ -1135,7 +1157,7 @@
- Update to Xen 3.2.1 RC5 changeset 16864.
* Fri Apr 11 2008 jfehlig@novell.com
- bnc#378595 - Do not use ifup/ifdown in network-bridge for now.
-* Tue Mar 25 2008 carnold@novell.com
+* Mon Mar 24 2008 carnold@novell.com
- bnc#373194 - The xen module and the kernel for Dom0 don't match.
- Add ncurses-devel build dependency
* Mon Mar 24 2008 carnold@novell.com
@@ -1150,12 +1172,12 @@
* Wed Mar 12 2008 jfehlig@novell.com
- Increased dom0-min-mem value to 512Mb in xend-config.sxp
bnc#370007
-* Tue Mar 11 2008 jfehlig@novell.com
+* Mon Mar 10 2008 jfehlig@novell.com
- Fixed initialization of default VM config values when creating
VMs through Xen API. bnc#368273
* Mon Mar 10 2008 jfehlig@novell.com
- Removed unused/untested xend-relocation script.
-* Sat Mar 08 2008 jfehlig@novell.com
+* Fri Mar 07 2008 jfehlig@novell.com
- Set device model when creating pvfb consoles via XenAPI.
bnc#367851
* Fri Mar 07 2008 jfehlig@novell.com
@@ -1209,7 +1231,7 @@
- Merge xen-tools and xen-tools-ioemu into xen-tools.
* Thu Dec 20 2007 carnold@novell.com
- Update to xen 3.2 RC2. Changeset 16646
-* Fri Dec 14 2007 carnold@novell.com
+* Thu Dec 13 2007 carnold@novell.com
- Added agent support for HP Proliant hardware.
* Wed Dec 05 2007 carnold@novell.com
- #338108 - VUL-0: Xen security issues in SLE10
@@ -1240,9 +1262,9 @@
- #302106: Update network-multinet
* Wed Sep 05 2007 carnold@novell.com
- #307458: AMD-V CR8 intercept reduction for HVM windows 64b guests
-* Thu Aug 30 2007 ccoffing@novell.com
+* Wed Aug 29 2007 ccoffing@novell.com
- Update block-iscsi to match changes to open-iscsi.
-* Tue Aug 28 2007 carnold@novell.com
+* Mon Aug 27 2007 carnold@novell.com
- #289275 - domu will not reboot if pci= is passed in at boot time.
* Fri Aug 24 2007 carnold@novell.com
- #297345: Added several upstream patches for hvm migration.
@@ -1254,7 +1276,7 @@
file.
* Mon Aug 13 2007 carnold@novell.com
- hvm svm: Log into 'xm dmesg' that SVM NPT is enabled.
-* Sat Aug 11 2007 ccoffing@novell.com
+* Fri Aug 10 2007 ccoffing@novell.com
- Honor RPM_OPT_FLAGS better
* Thu Aug 09 2007 ccoffing@novell.com
- #298176: Do not enable NX if CPU/BIOS does not support it
@@ -1303,7 +1325,7 @@
* Fri Jul 06 2007 ccoffing@novell.com
- xensource bug #858: Disable strict aliasing for xenstore, to
avoid domU hangs.
-* Wed Jul 04 2007 ccoffing@novell.com
+* Tue Jul 03 2007 ccoffing@novell.com
- #285929: Bad "xendomains status" output w/ empty XENDOMAINS_SAVE
* Tue Jul 03 2007 carnold@novell.com
- Changes necessary to support EDD and EDID from Jan.
@@ -1312,7 +1334,7 @@
- Removed the modified 15157 patch. This patch was actually a
consolidation of changesets 15157 and 15250. These changesets
are now discrete patches to ease subsequent updates of Xen.
-* Thu Jun 21 2007 ccoffing@novell.com
+* Wed Jun 20 2007 ccoffing@novell.com
- Split vm-install off as a separate package.
- Update man page.
- Update Ron Terry's network-multi script.
@@ -1340,7 +1362,7 @@
'xm block-detach dom dev_name'. Modified version fixes bug 262805
without introducing regression. Patch fixing c/s 15157 has been
submitted upstream.
-* Thu May 24 2007 ccoffing@novell.com
+* Wed May 23 2007 ccoffing@novell.com
- Drop xen-messages.diff; Xen now supports HVM save/restore.
* Tue May 22 2007 ccoffing@novell.com
- Update Ron Terry's network-multi script.
@@ -1354,7 +1376,7 @@
+ #259994: disk size would reset when editing path
+ #247073: handle autoyast URLs
+ #254311: physical disks were showing as 0.0 GB
-* Thu May 17 2007 ccoffing@novell.com
+* Wed May 16 2007 ccoffing@novell.com
- Properly quote pathnames in domUloader to fix EVMS. (#274484)
- Allow user to specify a default 'keymap' in xend's configuration
file. (#258818 and 241149)
@@ -1378,7 +1400,7 @@
- Added security fixes for problems found Travis Orandy (#270621)
CVE-2007-1320, CVE-2007-1321, CVE-2007-1322, CVE-2007-1323,
CVE-2007-1366
-* Fri May 04 2007 ccoffing@novell.com
+* Thu May 03 2007 ccoffing@novell.com
- Update to xen-3.1-testing rc7 (changeset 15020).
- Fix identification of virt-manager windows. (#264162)
* Wed May 02 2007 jfehlig@novell.com
@@ -1397,7 +1419,7 @@
* Fri Apr 20 2007 ccoffing@novell.com
- Updated README. (#250705)
- Fix vm-install's detection of PV RHEL4/5 kernels. (#260983)
-* Fri Apr 20 2007 ccoffing@novell.com
+* Thu Apr 19 2007 ccoffing@novell.com
- Place xenstore-* tools in new xen-tools-domU package, to be used
by suse_register. (#249157)
* Tue Apr 17 2007 ccoffing@novell.com
@@ -1472,7 +1494,7 @@
* Wed Mar 07 2007 jfehlig@novell.com
- Added upstream patch that fixes save/restore on 32pae guests.
Upstream c/s 14150. Bug #237859
-* Wed Mar 07 2007 carnold@novell.com
+* Tue Mar 06 2007 carnold@novell.com
- Remove a debug message which is spamming the logs during live
migration.
* Tue Mar 06 2007 jfehlig@novell.com
@@ -1506,7 +1528,7 @@
- Fix exception caused by incorrect method name in xen-messages.diff.
This is one of perhaps several problems with save/restore,
bug #237859
-* Fri Mar 02 2007 dpmerrill@novell.com
+* Thu Mar 01 2007 dpmerrill@novell.com
- Add xen-ioemu-hvm-pv-support.diff
This patch allows for shutting down the IDE drive.
* Thu Mar 01 2007 jfehlig@novell.com
@@ -1523,7 +1545,7 @@
model exceptions
+ Add "Add" button to Operating System Installation page, based
on usability feedback
-* Thu Mar 01 2007 jfehlig@novell.com
+* Wed Feb 28 2007 jfehlig@novell.com
- Added changeset 13786 and 14022 from xen-unstable. These
changesets affect the Xen API C bindings only and are low risk.
This is a continuation of support for FATE feature 110320. ECO
@@ -1533,7 +1555,7 @@
+ #244772: display error message in GUI if xen isn't running
+ #246049: better error message when OS==SUSE but ISO looks wrong
+ Fix printing of jobid when run with --background
-* Thu Feb 22 2007 ccoffing@novell.com
+* Wed Feb 21 2007 ccoffing@novell.com
- Don't allow "xm create" of running VM. (#245253)
- Update vm-install:
+ Fix inability to use already-extracted SUSE kernel/initrds
@@ -1683,7 +1705,7 @@
- Update to xen-unstable (changeset 12757).
- Enable LIBXENAPI_BINDINGS and XENFB_TOOLS.
- Enable unix domain socket for xend; needed by tools.
-* Wed Dec 06 2006 ccoffing@novell.com
+* Tue Dec 05 2006 ccoffing@novell.com
- Update to xen-unstable (changeset 12734; feature freeze for
3.0.4)
- Make /etc/xen mode 0700 to protect vnc passwords.
@@ -1724,7 +1746,7 @@
* Tue Oct 31 2006 ccoffing@novell.com
- Backport xen-unstable changesets 1184[1-3] to address SVM
interrupt injection issues. Replaces earlier (broken) patches.
-* Tue Oct 31 2006 ccoffing@novell.com
+* Mon Oct 30 2006 ccoffing@novell.com
- /var/lib/xen/images should not be world readable. (#214638)
- Update to xen-3.0.3-0 (changeset 11774; no code changes).
* Mon Oct 16 2006 ccoffing@novell.com
@@ -1765,7 +1787,7 @@
- Build debug version of xen-pae.
* Mon Sep 25 2006 ccoffing@novell.com
- Update to xen-unstable changeset 11616.
-* Wed Sep 13 2006 ccoffing@novell.com
+* Tue Sep 12 2006 ccoffing@novell.com
- Update check_python script to identify Python 2.5 RCs as valid.
* Mon Sep 11 2006 ccoffing@novell.com
- Update to xen-unstable changeset 11440.
@@ -1773,14 +1795,14 @@
(#204758)
- Include Jan's updated patch for #192150 (to preserve register
context when doing IO).
-* Wed Sep 06 2006 ccoffing@novell.com
+* Tue Sep 05 2006 ccoffing@novell.com
- Update block-nbd and xmexample.nbd, and add block-iscsi and
xmexample.iscsi (from Kurt).
* Thu Aug 31 2006 ccoffing@novell.com
- Automatically create/destroy virtual frame buffer viewer. Add
"sdl=1" to config file of a paravirtualized VM to get the viewer.
- Log files have moved to /var/log/xen.
-* Wed Aug 30 2006 ccoffing@novell.com
+* Tue Aug 29 2006 ccoffing@novell.com
- xendomains does not actually save domains. (#201349)
- Update to xen-unstable changeset 11299.
* Tue Aug 29 2006 ccoffing@novell.com
@@ -1792,7 +1814,7 @@
* Wed Aug 16 2006 ccoffing@novell.com
- Update to xen-unstable changeset 11134.
- Drop xen-reverse-10064.diff now that kernel is updated.
-* Wed Aug 09 2006 ccoffing@novell.com
+* Tue Aug 08 2006 ccoffing@novell.com
- Re-enabled patch for #184175.
- Update to xen-unstable changeset 10986.
- Include Jan's patch to preserve register context when doing
@@ -1819,13 +1841,13 @@
- Added for loop to retry the losetup -d in /etc/xen/scripts/block.
It is possible for the losetup -d to fail if another process is
examining the loopback devices e.g. losetup -a. (#151105)
-* Thu Jul 13 2006 ccoffing@novell.com
+* Wed Jul 12 2006 ccoffing@novell.com
- Corrected and updated README.
* Mon Jul 10 2006 ccoffing@novell.com
- Add Jeff Mahoney's block-sync.diff, to give control of
"losetup -y" to the user (and potentially yast). Defaults to
old async behavior. (#190869)
-* Fri Jul 07 2006 ccoffing@novell.com
+* Thu Jul 06 2006 ccoffing@novell.com
- Update to xen-unstable tree. Revert changeset 10064, to maintain
backwards compatibility with SLES 10.
* Wed Jul 05 2006 ccoffing@novell.com
@@ -1853,7 +1875,7 @@
* Fri Jun 23 2006 kallan@novell.com
- Updated xen-bonding.diff to enable bonding again after the latest
patches to network-bridge etc. (#161888)
-* Thu Jun 22 2006 ccoffing@novell.com
+* Wed Jun 21 2006 ccoffing@novell.com
- Clean up the useless "Nothing to flush" messages, from 'ip addr
flush', in /var/log/xen-hotplug.log
- Fix race condition in domUloader.py, when another process did
@@ -2066,7 +2088,7 @@
- Handle memory failure when staring fully virtualized
guests to prevent reboot of the box (AMD) or
hanging the box (VT) (#149179).
-* Wed May 10 2006 ccoffing@novell.com
+* Tue May 09 2006 ccoffing@novell.com
- Include select patches from xen-3.0-testing:
+ 9665: Fix pciif parsing for compatibility variable.
+ 9666: Fix HVM hang; was broken due to previous "hda lost
@@ -2109,7 +2131,7 @@
+ Fix reboot on large SMP machines (IBM, no bug #).
- Integrate Jan's patches:
+ Spurious interrupt roundup (#152892).
-* Tue Apr 25 2006 ccoffing@novell.com
+* Mon Apr 24 2006 ccoffing@novell.com
- Integrate Jan's patches:
+ FXSR patch (#135677).
+ APIC option patch (work-around #150114).
@@ -2143,7 +2165,7 @@
* Wed Apr 19 2006 agruen@suse.de
- Create /boot symlinks in the %%install section instead of in
%%post so that they will end up in the package file list.
-* Wed Apr 19 2006 ccoffing@novell.com
+* Tue Apr 18 2006 ccoffing@novell.com
- Add /etc/xen/vm to vm config file search path (#167208).
* Fri Apr 14 2006 kallan@novell.com
- Add support for bonding in network-bridge. (#161678).
@@ -2160,7 +2182,7 @@
+ Fixes xmlrpc issues.
+ Fixes several emulated instructions for HVM.
+ Fixes for x86_64 inline assembly.
-* Wed Apr 12 2006 ccoffing@novell.com
+* Tue Apr 11 2006 ccoffing@novell.com
- Fix "jitter" and race in dom0's memory target calculation, which
could cause auto-ballooning to fail (#164714).
* Tue Apr 11 2006 brogers@novell.com
@@ -2205,7 +2227,7 @@
- Correctly default XAUTHORITY if it is not set. This allows the
GUI to come up for fully virtualized guests (was especially
problematic when VM was started from YaST). (#142472)
-* Thu Mar 30 2006 ccoffing@novell.com
+* Wed Mar 29 2006 ccoffing@novell.com
- Fixed reversed "Do I have enough memory?" test when creating
new VMs (#156448).
* Tue Mar 28 2006 ccoffing@novell.com
@@ -2284,7 +2306,7 @@
- Remove unnecessary x86_64 patch.
- Fix auto-ballooning of dom0 memory for HVM domUs (XenSource bug
521).
-* Wed Feb 22 2006 ccoffing@novell.com
+* Tue Feb 21 2006 ccoffing@novell.com
- Update to hg 8920 (xen-unstable tree). Fixes instruction decode
for fully virtualized guests, fixing booting from CDs.
- Integrate 3 patches from Intel, to improve VNC performance.
@@ -2336,7 +2358,7 @@
- Correct return values and improve messages of init scripts.
* Fri Jan 20 2006 ccoffing@novell.com
- Use domUloader instead of pygrub.
-* Fri Jan 20 2006 carnold@novell.com
+* Thu Jan 19 2006 carnold@novell.com
- Build based on the xen-unstable.hg 8628
* Wed Jan 18 2006 carnold@novell.com
- Update to hg 8646 xen-unstable-hvm.hg tree.
@@ -2344,7 +2366,7 @@
- Allow version string "XEN_VER=3.0" instead of just
"XEN_VER=xen-3.0" for backwards compatibility.
- Correctly set changeset in compile.h.
-* Fri Jan 13 2006 carnold@novell.com
+* Thu Jan 12 2006 carnold@novell.com
- Added two patches from AMD that apply to the 8513 changeset.
* Thu Jan 12 2006 kukuk@suse.de
- Add libreiserfs-devel to nfb.
@@ -2394,7 +2416,7 @@
configurable timeout for the commands. Make xendomains status
report something useful.
- Make xendomains script comaptible to non-SUSE distros.
-* Tue Oct 18 2005 garloff@suse.de
+* Mon Oct 17 2005 garloff@suse.de
- Update to hg 7398.
* Mon Oct 17 2005 garloff@suse.de
- Create useful xendomains init script and sysconfig file.
@@ -2429,13 +2451,13 @@
- Fix network-bridge down.
* Thu Sep 08 2005 garloff@suse.de
- Build PAE version along non-PAE version of Hypervisor.
-* Wed Sep 07 2005 garloff@suse.de
+* Tue Sep 06 2005 garloff@suse.de
- Try to fix network bridge down issue.
- Document netowrking and firewalling caveats in README.SUSE.
- Enable PAE.
* Tue Sep 06 2005 garloff@suse.de
- Update to hg 6644.
-* Mon Sep 05 2005 garloff@suse.de
+* Sun Sep 04 2005 garloff@suse.de
- Update to hg 6610.
- Rename default name of xen-br0 to xenbr0.
- Fix pygrub installation.
@@ -2491,7 +2513,7 @@
- Fix version-check in NetWare loader (0x336ec577 -> 0x326ec578).
* Fri Jun 17 2005 ccoffing@novell.com
- Backport NetWare-friendly loader from Xen 3.0.
-* Fri Jun 17 2005 ccoffing@novell.com
+* Thu Jun 16 2005 ccoffing@novell.com
- Destroy domains that failed to be fully created.
* Fri Jun 10 2005 garloff@suse.de
- Update to latest 2.0-testing snapshot.
@@ -2499,7 +2521,7 @@
* Wed Jun 08 2005 garloff@suse.de
- Update mk-xen-rescue-img.sh script: Handle SLES9 better.
- Export PYTHONOPTIMIZE in xend start script.
-* Tue Jun 07 2005 garloff@suse.de
+* Mon Jun 06 2005 garloff@suse.de
- Merge _perform_err fixes.
* Mon May 23 2005 ccoffing@novell.com
- update to 2.0.6
@@ -2507,7 +2529,7 @@
- More gcc4 and binutils related fixes.
* Wed Apr 13 2005 garloff@suse.de
- Build fixes for gcc4.
-* Mon Apr 04 2005 garloff@suse.de
+* Sun Apr 03 2005 garloff@suse.de
- Update xen: Various fixes (scheduling, memset, domain crash
handling) and enhancements (bg page scrubbing).
* Thu Mar 24 2005 garloff@suse.de
@@ -2521,7 +2543,7 @@
- Require ports < 1024 to allow controlling VMs.
* Mon Mar 21 2005 garloff@suse.de
- Update xen.
-* Thu Mar 17 2005 garloff@suse.de
+* Wed Mar 16 2005 garloff@suse.de
- Update xen.
- Add /var/lib/xen/xen-db/ subdirs.
* Sun Mar 13 2005 garloff@suse.de
++++++ 18412-x86-page-type-preemptible.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:11.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:11.000000000 +0100
@@ -1331,7 +1331,7 @@
process_deferred_ops();
domain_mmap_cache_destroy(&mapcache);
-@@ -3617,9 +3830,8 @@ static int ptwr_emulated_update(
+@@ -3621,9 +3834,8 @@ static int ptwr_emulated_update(
nl1e = l1e_from_intpte(val);
if ( unlikely(!get_page_from_l1e(nl1e, d)) )
{
++++++ 18464-cpu-hotplug.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:11.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:11.000000000 +0100
@@ -12,7 +12,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
+++ xen-3.3.1-testing/xen/arch/x86/irq.c
-@@ -737,9 +737,12 @@ __initcall(setup_dump_irqs);
+@@ -751,9 +751,12 @@ __initcall(setup_dump_irqs);
void fixup_irqs(cpumask_t map)
{
@@ -26,7 +26,7 @@
for ( irq = 0; irq < NR_IRQS; irq++ )
{
cpumask_t mask;
-@@ -758,8 +761,24 @@ void fixup_irqs(cpumask_t map)
+@@ -772,8 +775,24 @@ void fixup_irqs(cpumask_t map)
printk("Cannot set affinity for irq %i\n", irq);
}
@@ -55,7 +55,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/smpboot.c
+++ xen-3.3.1-testing/xen/arch/x86/smpboot.c
-@@ -1225,15 +1225,6 @@ int __cpu_disable(void)
+@@ -1224,15 +1224,6 @@ int __cpu_disable(void)
if (cpu == 0)
return -EBUSY;
@@ -71,7 +71,7 @@
local_irq_disable();
clear_local_APIC();
/* Allow any queued timer interrupts to get serviced */
-@@ -1249,6 +1240,9 @@ int __cpu_disable(void)
+@@ -1248,6 +1239,9 @@ int __cpu_disable(void)
fixup_irqs(map);
/* It's now safe to remove this processor from the online map */
cpu_clear(cpu, cpu_online_map);
@@ -81,7 +81,7 @@
return 0;
}
-@@ -1275,28 +1269,6 @@ static int take_cpu_down(void *unused)
+@@ -1274,28 +1268,6 @@ static int take_cpu_down(void *unused)
return __cpu_disable();
}
@@ -110,7 +110,7 @@
int cpu_down(unsigned int cpu)
{
int err = 0;
-@@ -1307,6 +1279,12 @@ int cpu_down(unsigned int cpu)
+@@ -1306,6 +1278,12 @@ int cpu_down(unsigned int cpu)
goto out;
}
++++++ 18468-therm-control-msr.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:11.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:11.000000000 +0100
@@ -13,7 +13,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/traps.c
+++ xen-3.3.1-testing/xen/arch/x86/traps.c
-@@ -2158,6 +2158,12 @@ static int emulate_privileged_op(struct
+@@ -2159,6 +2159,12 @@ static int emulate_privileged_op(struct
if ( wrmsr_safe(regs->ecx, eax, edx) != 0 )
goto fail;
break;
@@ -26,7 +26,7 @@
default:
if ( wrmsr_hypervisor_regs(regs->ecx, eax, edx) )
break;
-@@ -2234,6 +2240,12 @@ static int emulate_privileged_op(struct
+@@ -2235,6 +2241,12 @@ static int emulate_privileged_op(struct
MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL |
MSR_IA32_MISC_ENABLE_XTPR_DISABLE;
break;
++++++ 18520-per-CPU-GDT.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -380,7 +380,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/smpboot.c
+++ xen-3.3.1-testing/xen/arch/x86/smpboot.c
-@@ -835,10 +835,15 @@ static int __devinit do_boot_cpu(int api
+@@ -828,10 +828,15 @@ static int __devinit do_boot_cpu(int api
*/
{
unsigned long boot_error;
@@ -396,7 +396,7 @@
/*
* Save current MTRR state in case it was changed since early boot
-@@ -864,6 +869,37 @@ static int __devinit do_boot_cpu(int api
+@@ -857,6 +862,37 @@ static int __devinit do_boot_cpu(int api
/* Debug build: detect stack overflow by setting up a guard page. */
memguard_guard_stack(stack_start.esp);
@@ -438,7 +438,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/traps.c
+++ xen-3.3.1-testing/xen/arch/x86/traps.c
-@@ -2976,13 +2976,13 @@ void set_intr_gate(unsigned int n, void
+@@ -2977,13 +2977,13 @@ void set_intr_gate(unsigned int n, void
void set_tss_desc(unsigned int n, void *addr)
{
_set_tssldt_desc(
++++++ 18521-per-CPU-TSS.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -27,7 +27,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/smpboot.c
+++ xen-3.3.1-testing/xen/arch/x86/smpboot.c
-@@ -900,6 +900,13 @@ static int __devinit do_boot_cpu(int api
+@@ -893,6 +893,13 @@ static int __devinit do_boot_cpu(int api
= l1e_from_page(virt_to_page(gdt) + i,
__PAGE_HYPERVISOR);
++++++ 18523-per-CPU-misc.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -30,7 +30,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/smpboot.c
+++ xen-3.3.1-testing/xen/arch/x86/smpboot.c
-@@ -1120,7 +1120,7 @@ static void __init smp_boot_cpus(unsigne
+@@ -1119,7 +1119,7 @@ static void __init smp_boot_cpus(unsigne
Dprintk("CPU present map: %lx\n", physids_coerce(phys_cpu_present_map));
kicked = 1;
++++++ 18539-pirq-vector-mapping.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -11,8 +11,10 @@
Signed-off-by: Jan Beulich
Signed-off-by: Keir Fraser
---- a/xen/arch/ia64/xen/irq.c
-+++ b/xen/arch/ia64/xen/irq.c
+Index: xen-3.3.1-testing/xen/arch/ia64/xen/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/ia64/xen/irq.c
++++ xen-3.3.1-testing/xen/arch/ia64/xen/irq.c
@@ -459,20 +459,24 @@ int pirq_guest_bind(struct vcpu *v, int
return rc;
}
@@ -53,8 +55,10 @@
}
void
---- a/xen/arch/x86/domain.c
-+++ b/xen/arch/x86/domain.c
+Index: xen-3.3.1-testing/xen/arch/x86/domain.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/domain.c
++++ xen-3.3.1-testing/xen/arch/x86/domain.c
@@ -414,8 +414,6 @@ int arch_domain_create(struct domain *d,
goto fail;
}
@@ -64,8 +68,10 @@
if ( is_hvm_domain(d) )
{
if ( (rc = hvm_domain_initialise(d)) != 0 )
---- a/xen/arch/x86/io_apic.c
-+++ b/xen/arch/x86/io_apic.c
+Index: xen-3.3.1-testing/xen/arch/x86/io_apic.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/io_apic.c
++++ xen-3.3.1-testing/xen/arch/x86/io_apic.c
@@ -48,22 +48,6 @@ atomic_t irq_mis_count;
int msi_enable = 0;
boolean_param("msi", msi_enable);
@@ -97,8 +103,10 @@
#define IOAPIC_AUTO -1
#define IOAPIC_EDGE 0
---- a/xen/arch/x86/irq.c
-+++ b/xen/arch/x86/irq.c
+Index: xen-3.3.1-testing/xen/arch/x86/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
++++ xen-3.3.1-testing/xen/arch/x86/irq.c
@@ -277,6 +277,35 @@ static void __do_IRQ_guest(int vector)
}
}
@@ -201,29 +209,61 @@
spin_unlock_irqrestore(&desc->lock, flags);
return shared;
-@@ -491,16 +512,15 @@ int pirq_guest_bind(struct vcpu *v, int
+@@ -489,20 +510,17 @@ int pirq_guest_bind(struct vcpu *v, int
+ irq_guest_action_t *action, *newaction = NULL;
int rc = 0;
cpumask_t cpumask = CPU_MASK_NONE;
++ unsigned long flags;
-+ WARN_ON(!spin_is_locked(&v->domain->evtchn_lock));
-+
- retry:
+- retry:
- vector = domain_irq_to_vector(v->domain, irq);
- if ( vector == 0 )
+- {
+- rc = -EINVAL;
+- goto out;
+- }
+-
+- desc = &irq_desc[vector];
++ WARN_ON(!spin_is_locked(&v->domain->evtchn_lock));
+
+- spin_lock_irq(&desc->lock);
++ retry:
+ desc = domain_spin_lock_irq_desc(v->domain, irq, &flags);
+ if ( desc == NULL )
- return -EINVAL;
++ return -EINVAL;
-- desc = &irq_desc[vector];
--
-- spin_lock_irqsave(&desc->lock, flags);
--
action = (irq_guest_action_t *)desc->action;
+ vector = desc - irq_desc;
if ( !(desc->status & IRQ_GUEST) )
{
-@@ -575,26 +595,39 @@ int pirq_guest_bind(struct vcpu *v, int
+@@ -517,7 +535,7 @@ int pirq_guest_bind(struct vcpu *v, int
+
+ if ( newaction == NULL )
+ {
+- spin_unlock_irq(&desc->lock);
++ spin_unlock_irqrestore(&desc->lock, flags);
+ if ( (newaction = xmalloc(irq_guest_action_t)) != NULL )
+ goto retry;
+ gdprintk(XENLOG_INFO,
+@@ -563,7 +581,7 @@ int pirq_guest_bind(struct vcpu *v, int
+ */
+ ASSERT(action->ack_type == ACKTYPE_EOI);
+ ASSERT(desc->status & IRQ_DISABLED);
+- spin_unlock_irq(&desc->lock);
++ spin_unlock_irqrestore(&desc->lock, flags);
+ cpu_relax();
+ goto retry;
+ }
+@@ -579,32 +597,45 @@ int pirq_guest_bind(struct vcpu *v, int
+ action->guest[action->nr_guests++] = v->domain;
+
+ unlock_out:
+- spin_unlock_irq(&desc->lock);
++ spin_unlock_irqrestore(&desc->lock, flags);
+ out:
+ if ( newaction != NULL )
+ xfree(newaction);
return rc;
}
@@ -235,7 +275,6 @@
irq_desc_t *desc;
irq_guest_action_t *action;
cpumask_t cpu_eoi_map;
- unsigned long flags;
- int i;
+ int i, rc = 0;
@@ -244,7 +283,7 @@
- BUG_ON(vector == 0);
+ WARN_ON(!spin_is_locked(&d->evtchn_lock));
-- spin_lock_irqsave(&desc->lock, flags);
+- spin_lock_irq(&desc->lock);
+ desc = domain_spin_lock_irq_desc(d, irq, &flags);
+ if ( unlikely(desc == NULL) )
+ {
@@ -273,19 +312,41 @@
memmove(&action->guest[i], &action->guest[i+1], IRQ_MAX_GUESTS-i-1);
action->nr_guests--;
-@@ -661,7 +694,8 @@ void pirq_guest_unbind(struct domain *d,
+@@ -622,7 +653,7 @@ void pirq_guest_unbind(struct domain *d,
+ (action->nr_guests != 0) )
+ {
+ cpu_eoi_map = action->cpu_eoi_map;
+- spin_unlock_irq(&desc->lock);
++ spin_unlock_irqrestore(&desc->lock, flags);
+ on_selected_cpus(cpu_eoi_map, set_eoi_ready, desc, 1, 0);
+ spin_lock_irq(&desc->lock);
+ }
+@@ -659,7 +690,7 @@ void pirq_guest_unbind(struct domain *d,
+ if ( !cpus_empty(cpu_eoi_map) )
+ {
+ BUG_ON(action->ack_type != ACKTYPE_EOI);
+- spin_unlock_irq(&desc->lock);
++ spin_unlock_irqrestore(&desc->lock, flags);
+ on_selected_cpus(cpu_eoi_map, set_eoi_ready, desc, 1, 1);
+ spin_lock_irq(&desc->lock);
+ }
+@@ -673,9 +704,8 @@ void pirq_guest_unbind(struct domain *d,
desc->handler->shutdown(vector);
out:
-- spin_unlock_irqrestore(&desc->lock, flags);
+- spin_unlock_irq(&desc->lock);
+- if ( action != NULL )
+- xfree(action);
+ spin_unlock_irqrestore(&desc->lock, flags);
+ return rc;
}
extern void dump_ioapic_irq_info(void);
---- a/xen/arch/x86/msi.c
-+++ b/xen/arch/x86/msi.c
-@@ -727,7 +727,6 @@ void pci_disable_msi(int vector)
+Index: xen-3.3.1-testing/xen/arch/x86/msi.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/msi.c
++++ xen-3.3.1-testing/xen/arch/x86/msi.c
+@@ -728,7 +728,6 @@ void pci_disable_msi(int vector)
__pci_disable_msix(vector);
}
@@ -293,8 +354,10 @@
static void msi_free_vectors(struct pci_dev* dev)
{
struct msi_desc *entry, *tmp;
---- a/xen/arch/x86/physdev.c
-+++ b/xen/arch/x86/physdev.c
+Index: xen-3.3.1-testing/xen/arch/x86/physdev.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/physdev.c
++++ xen-3.3.1-testing/xen/arch/x86/physdev.c
@@ -26,17 +26,11 @@ int
ioapic_guest_write(
unsigned long physbase, unsigned int reg, u32 pval);
@@ -514,8 +577,10 @@
}
if ( copy_to_guest(arg, &irq_op, 1) != 0 )
---- a/xen/common/event_channel.c
-+++ b/xen/common/event_channel.c
+Index: xen-3.3.1-testing/xen/common/event_channel.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/common/event_channel.c
++++ xen-3.3.1-testing/xen/common/event_channel.c
@@ -376,7 +376,8 @@ static long __evtchn_close(struct domain
break;
@@ -526,8 +591,10 @@
d1->pirq_to_evtchn[chn1->u.pirq] = 0;
break;
---- a/xen/include/asm-x86/domain.h
-+++ b/xen/include/asm-x86/domain.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/domain.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/domain.h
++++ xen-3.3.1-testing/xen/include/asm-x86/domain.h
@@ -235,7 +235,7 @@ struct arch_domain
/* Shadow translated domain: P2M mapping */
pagetable_t phys_table;
@@ -537,8 +604,10 @@
int vector_pirq[NR_VECTORS];
int pirq_vector[NR_PIRQS];
---- a/xen/include/asm-x86/irq.h
-+++ b/xen/include/asm-x86/irq.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/irq.h
++++ xen-3.3.1-testing/xen/include/asm-x86/irq.h
@@ -52,6 +52,7 @@ extern atomic_t irq_mis_count;
int pirq_acktype(struct domain *d, int irq);
int pirq_shared(struct domain *d , int irq);
@@ -549,9 +618,11 @@
+#define domain_vector_to_irq(d, vec) (msi_enable ? (d)->arch.vector_pirq[vec] : vector_to_irq(vec))
+
#endif /* _ASM_HW_IRQ_H */
---- a/xen/include/asm-x86/msi.h
-+++ b/xen/include/asm-x86/msi.h
-@@ -106,7 +106,7 @@ struct msi_desc {
+Index: xen-3.3.1-testing/xen/include/asm-x86/msi.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/msi.h
++++ xen-3.3.1-testing/xen/include/asm-x86/msi.h
+@@ -107,7 +107,7 @@ struct msi_desc {
*/
#define NR_HP_RESERVED_VECTORS 20
@@ -560,8 +631,10 @@
/*
* MSI-X Address Register
---- a/xen/include/xen/irq.h
-+++ b/xen/include/xen/irq.h
+Index: xen-3.3.1-testing/xen/include/xen/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/xen/irq.h
++++ xen-3.3.1-testing/xen/include/xen/irq.h
@@ -22,7 +22,6 @@ struct irqaction
#define IRQ_PENDING 4 /* IRQ pending - replay on enable */
#define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */
++++++ 18547-pirq-vector-mapping-fix.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -6,8 +6,10 @@
x86: Clean up and fix 18539:31f09a5e24cf8
Signed-off-by: Keir Fraser
---- a/xen/arch/ia64/xen/irq.c
-+++ b/xen/arch/ia64/xen/irq.c
+Index: xen-3.3.1-testing/xen/arch/ia64/xen/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/ia64/xen/irq.c
++++ xen-3.3.1-testing/xen/arch/ia64/xen/irq.c
@@ -459,12 +459,12 @@ int pirq_guest_bind(struct vcpu *v, int
return rc;
}
@@ -46,15 +48,15 @@
}
void
---- a/xen/arch/x86/irq.c
-+++ b/xen/arch/x86/irq.c
-@@ -508,14 +508,14 @@ int pirq_guest_bind(struct vcpu *v, int
- unsigned int vector;
- irq_desc_t *desc;
- irq_guest_action_t *action;
-- unsigned long flags;
+Index: xen-3.3.1-testing/xen/arch/x86/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
++++ xen-3.3.1-testing/xen/arch/x86/irq.c
+@@ -510,12 +510,12 @@ int pirq_guest_bind(struct vcpu *v, int
+ irq_guest_action_t *action, *newaction = NULL;
int rc = 0;
cpumask_t cpumask = CPU_MASK_NONE;
+- unsigned long flags;
WARN_ON(!spin_is_locked(&v->domain->evtchn_lock));
+ BUG_ON(!local_irq_is_enabled());
@@ -63,9 +65,18 @@
- desc = domain_spin_lock_irq_desc(v->domain, irq, &flags);
+ desc = domain_spin_lock_irq_desc(v->domain, irq, NULL);
if ( desc == NULL )
- return -EINVAL;
+ return -EINVAL;
-@@ -575,7 +575,7 @@ int pirq_guest_bind(struct vcpu *v, int
+@@ -535,7 +535,7 @@ int pirq_guest_bind(struct vcpu *v, int
+
+ if ( newaction == NULL )
+ {
+- spin_unlock_irqrestore(&desc->lock, flags);
++ spin_unlock_irq(&desc->lock);
+ if ( (newaction = xmalloc(irq_guest_action_t)) != NULL )
+ goto retry;
+ gdprintk(XENLOG_INFO,
+@@ -581,7 +581,7 @@ int pirq_guest_bind(struct vcpu *v, int
*/
ASSERT(action->ack_type == ACKTYPE_EOI);
ASSERT(desc->status & IRQ_DISABLED);
@@ -74,12 +85,15 @@
cpu_relax();
goto retry;
}
-@@ -591,43 +591,25 @@ int pirq_guest_bind(struct vcpu *v, int
+@@ -597,45 +597,26 @@ int pirq_guest_bind(struct vcpu *v, int
action->guest[action->nr_guests++] = v->domain;
- out:
+ unlock_out:
- spin_unlock_irqrestore(&desc->lock, flags);
+ spin_unlock_irq(&desc->lock);
+ out:
+- if ( newaction != NULL )
+- xfree(newaction);
return rc;
}
@@ -91,12 +105,11 @@
+ unsigned int vector;
irq_guest_action_t *action;
cpumask_t cpu_eoi_map;
-- unsigned long flags;
- int i, rc = 0;
+-
+- WARN_ON(!spin_is_locked(&d->evtchn_lock));
+ int i;
-- WARN_ON(!spin_is_locked(&d->evtchn_lock));
--
- desc = domain_spin_lock_irq_desc(d, irq, &flags);
- if ( unlikely(desc == NULL) )
- {
@@ -124,40 +137,34 @@
memmove(&action->guest[i], &action->guest[i+1], IRQ_MAX_GUESTS-i-1);
action->nr_guests--;
-@@ -645,9 +627,9 @@ int pirq_guest_unbind(struct domain *d,
+@@ -653,7 +634,7 @@ int pirq_guest_unbind(struct domain *d,
(action->nr_guests != 0) )
{
cpu_eoi_map = action->cpu_eoi_map;
-- spin_unlock_irqrestore(&desc->lock, flags);
+- spin_unlock_irqrestore(&desc->lock, flags);
+ spin_unlock_irq(&desc->lock);
on_selected_cpus(cpu_eoi_map, set_eoi_ready, desc, 1, 0);
-- spin_lock_irqsave(&desc->lock, flags);
-+ spin_lock_irq(&desc->lock);
+ spin_lock_irq(&desc->lock);
}
- break;
- }
-@@ -659,7 +641,7 @@ int pirq_guest_unbind(struct domain *d,
- BUG_ON(test_bit(irq, d->pirq_mask));
-
+@@ -669,7 +650,7 @@ int pirq_guest_unbind(struct domain *d,
if ( action->nr_guests != 0 )
+ {
+ action = NULL;
- goto out;
+ return;
+ }
BUG_ON(action->in_flight != 0);
-
-@@ -679,9 +661,9 @@ int pirq_guest_unbind(struct domain *d,
+@@ -690,7 +671,7 @@ int pirq_guest_unbind(struct domain *d,
if ( !cpus_empty(cpu_eoi_map) )
{
BUG_ON(action->ack_type != ACKTYPE_EOI);
- spin_unlock_irqrestore(&desc->lock, flags);
+ spin_unlock_irq(&desc->lock);
on_selected_cpus(cpu_eoi_map, set_eoi_ready, desc, 1, 1);
-- spin_lock_irqsave(&desc->lock, flags);
-+ spin_lock_irq(&desc->lock);
+ spin_lock_irq(&desc->lock);
}
-
- BUG_ON(!cpus_empty(action->cpu_eoi_map));
-@@ -692,10 +674,63 @@ int pirq_guest_unbind(struct domain *d,
+@@ -702,10 +683,63 @@ int pirq_guest_unbind(struct domain *d,
desc->status &= ~IRQ_INPROGRESS;
kill_timer(&irq_guest_eoi_timer[vector]);
desc->handler->shutdown(vector);
@@ -223,8 +230,10 @@
}
extern void dump_ioapic_irq_info(void);
---- a/xen/arch/x86/physdev.c
-+++ b/xen/arch/x86/physdev.c
+Index: xen-3.3.1-testing/xen/arch/x86/physdev.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/physdev.c
++++ xen-3.3.1-testing/xen/arch/x86/physdev.c
@@ -147,7 +147,7 @@ static int unmap_domain_pirq(struct doma
{
unsigned long flags;
@@ -234,8 +243,10 @@
if ( forced_unbind )
dprintk(XENLOG_G_WARNING, "dom%d: forcing unbind of pirq %d\n",
---- a/xen/common/event_channel.c
-+++ b/xen/common/event_channel.c
+Index: xen-3.3.1-testing/xen/common/event_channel.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/common/event_channel.c
++++ xen-3.3.1-testing/xen/common/event_channel.c
@@ -376,8 +376,7 @@ static long __evtchn_close(struct domain
break;
@@ -246,8 +257,10 @@
d1->pirq_to_evtchn[chn1->u.pirq] = 0;
break;
---- a/xen/include/asm-x86/irq.h
-+++ b/xen/include/asm-x86/irq.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/irq.h
++++ xen-3.3.1-testing/xen/include/asm-x86/irq.h
@@ -55,4 +55,6 @@ int pirq_shared(struct domain *d , int i
#define domain_irq_to_vector(d, irq) (msi_enable ? (d)->arch.pirq_vector[irq] : irq_to_vector(irq))
#define domain_vector_to_irq(d, vec) (msi_enable ? (d)->arch.vector_pirq[vec] : vector_to_irq(vec))
@@ -255,8 +268,10 @@
+int pirq_guest_force_unbind(struct domain *d, int irq);
+
#endif /* _ASM_HW_IRQ_H */
---- a/xen/include/xen/irq.h
-+++ b/xen/include/xen/irq.h
+Index: xen-3.3.1-testing/xen/include/xen/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/xen/irq.h
++++ xen-3.3.1-testing/xen/include/xen/irq.h
@@ -77,7 +77,7 @@ struct vcpu;
extern int pirq_guest_eoi(struct domain *d, int irq);
extern int pirq_guest_unmask(struct domain *d);
++++++ 18573-move-pirq-logic.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -8,8 +8,10 @@
Signed-off-by: Yunhong Jiang
Signed-off-by: Keir Fraser
---- a/xen/arch/x86/irq.c
-+++ b/xen/arch/x86/irq.c
+Index: xen-3.3.1-testing/xen/arch/x86/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
++++ xen-3.3.1-testing/xen/arch/x86/irq.c
@@ -14,8 +14,11 @@
#include
#include
@@ -23,7 +25,7 @@
/* opt_noirqbalance: If true, software IRQ balancing/affinity is disabled. */
int opt_noirqbalance = 0;
-@@ -733,6 +736,157 @@ int pirq_guest_force_unbind(struct domai
+@@ -742,6 +745,157 @@ int pirq_guest_force_unbind(struct domai
return bound;
}
@@ -181,8 +183,10 @@
extern void dump_ioapic_irq_info(void);
static void dump_irqs(unsigned char key)
---- a/xen/arch/x86/physdev.c
-+++ b/xen/arch/x86/physdev.c
+Index: xen-3.3.1-testing/xen/arch/x86/physdev.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/physdev.c
++++ xen-3.3.1-testing/xen/arch/x86/physdev.c
@@ -26,171 +26,12 @@ int
ioapic_guest_write(
unsigned long physbase, unsigned int reg, u32 pval);
@@ -433,8 +437,10 @@
spin_unlock(&dom0->evtchn_lock);
}
---- a/xen/include/asm-x86/irq.h
-+++ b/xen/include/asm-x86/irq.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/irq.h
++++ xen-3.3.1-testing/xen/include/asm-x86/irq.h
@@ -52,6 +52,11 @@ extern atomic_t irq_mis_count;
int pirq_acktype(struct domain *d, int irq);
int pirq_shared(struct domain *d , int irq);
++++++ 18574-msi-free-vector.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -8,8 +8,10 @@
Signed-off-by: Yunhong Jiang
Signed-off-by: Keir Fraser
---- a/xen/arch/x86/domain.c
-+++ b/xen/arch/x86/domain.c
+Index: xen-3.3.1-testing/xen/arch/x86/domain.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/domain.c
++++ xen-3.3.1-testing/xen/arch/x86/domain.c
@@ -459,6 +459,7 @@ void arch_domain_destroy(struct domain *
hvm_domain_destroy(d);
@@ -18,8 +20,10 @@
if ( !is_idle_domain(d) )
iommu_domain_destroy(d);
---- a/xen/arch/x86/i8259.c
-+++ b/xen/arch/x86/i8259.c
+Index: xen-3.3.1-testing/xen/arch/x86/i8259.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/i8259.c
++++ xen-3.3.1-testing/xen/arch/x86/i8259.c
@@ -408,6 +408,10 @@ void __init init_IRQ(void)
irq_desc[LEGACY_VECTOR(i)].handler = &i8259A_irq_type;
}
@@ -31,8 +35,10 @@
apic_intr_init();
/* Set the clock to HZ Hz */
---- a/xen/arch/x86/io_apic.c
-+++ b/xen/arch/x86/io_apic.c
+Index: xen-3.3.1-testing/xen/arch/x86/io_apic.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/io_apic.c
++++ xen-3.3.1-testing/xen/arch/x86/io_apic.c
@@ -90,7 +90,8 @@ static struct irq_pin_list {
} irq_2_pin[PIN_MAP_SIZE];
static int irq_2_pin_free_entry = NR_IRQS;
@@ -107,9 +113,11 @@
vector_irq[vector] = irq;
if (irq != AUTO_ASSIGN)
IO_APIC_VECTOR(irq) = vector;
---- a/xen/arch/x86/irq.c
-+++ b/xen/arch/x86/irq.c
-@@ -863,7 +863,10 @@ int unmap_domain_pirq(struct domain *d,
+Index: xen-3.3.1-testing/xen/arch/x86/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
++++ xen-3.3.1-testing/xen/arch/x86/irq.c
+@@ -872,7 +872,10 @@ int unmap_domain_pirq(struct domain *d,
pci_disable_msi(vector);
if ( desc->handler == &pci_msi_type )
@@ -120,7 +128,7 @@
if ( !forced_unbind )
{
-@@ -887,6 +890,24 @@ int unmap_domain_pirq(struct domain *d,
+@@ -896,6 +899,24 @@ int unmap_domain_pirq(struct domain *d,
return ret;
}
@@ -145,8 +153,10 @@
extern void dump_ioapic_irq_info(void);
static void dump_irqs(unsigned char key)
---- a/xen/arch/x86/physdev.c
-+++ b/xen/arch/x86/physdev.c
+Index: xen-3.3.1-testing/xen/arch/x86/physdev.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/physdev.c
++++ xen-3.3.1-testing/xen/arch/x86/physdev.c
@@ -83,7 +83,7 @@ static int physdev_map_pirq(struct physd
if ( vector < 0 || vector >= NR_VECTORS )
{
@@ -173,8 +183,10 @@
free_domain:
rcu_unlock_domain(d);
return ret;
---- a/xen/include/asm-x86/io_apic.h
-+++ b/xen/include/asm-x86/io_apic.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/io_apic.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/io_apic.h
++++ xen-3.3.1-testing/xen/include/asm-x86/io_apic.h
@@ -192,5 +192,6 @@ static inline int ioapic_resume(void) {r
#endif
@@ -182,8 +194,10 @@
+extern int free_irq_vector(int vector);
#endif
---- a/xen/include/asm-x86/irq.h
-+++ b/xen/include/asm-x86/irq.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/irq.h
++++ xen-3.3.1-testing/xen/include/asm-x86/irq.h
@@ -19,7 +19,9 @@
extern int vector_irq[NR_VECTORS];
++++++ 18577-bad-assertion.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -6,9 +6,11 @@
x86: Remove bogus assertion from free_domain_pirqs().
Signed-off-by: Keir Fraser
---- a/xen/arch/x86/irq.c
-+++ b/xen/arch/x86/irq.c
-@@ -894,8 +894,6 @@ void free_domain_pirqs(struct domain *d)
+Index: xen-3.3.1-testing/xen/arch/x86/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
++++ xen-3.3.1-testing/xen/arch/x86/irq.c
+@@ -903,8 +903,6 @@ void free_domain_pirqs(struct domain *d)
{
int i;
++++++ 18583-passthrough-locking.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -10,9 +10,10 @@
Signed-off-by: Jiang, Yunhong
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/arch/x86/hvm/svm/intr.c
---- a/xen/arch/x86/hvm/svm/intr.c Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/arch/x86/hvm/svm/intr.c Thu Oct 09 11:14:52 2008 +0100
+Index: xen-3.3.1-testing/xen/arch/x86/hvm/svm/intr.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/svm/intr.c
++++ xen-3.3.1-testing/xen/arch/x86/hvm/svm/intr.c
@@ -124,9 +124,11 @@ static void svm_dirq_assist(struct vcpu
if ( !test_and_clear_bit(irq, &hvm_irq_dpci->dirq_mask) )
continue;
@@ -43,9 +44,10 @@
}
}
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/arch/x86/hvm/vmsi.c
---- a/xen/arch/x86/hvm/vmsi.c Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/arch/x86/hvm/vmsi.c Thu Oct 09 11:14:52 2008 +0100
+Index: xen-3.3.1-testing/xen/arch/x86/hvm/vmsi.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/vmsi.c
++++ xen-3.3.1-testing/xen/arch/x86/hvm/vmsi.c
@@ -134,7 +134,7 @@ int vmsi_deliver(struct domain *d, int p
"vector=%x trig_mode=%x\n",
dest, dest_mode, delivery_mode, vector, trig_mode);
@@ -55,9 +57,10 @@
{
gdprintk(XENLOG_WARNING, "pirq %x not msi \n", pirq);
return 0;
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/arch/x86/hvm/vmx/intr.c
---- a/xen/arch/x86/hvm/vmx/intr.c Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/arch/x86/hvm/vmx/intr.c Thu Oct 09 11:14:52 2008 +0100
+Index: xen-3.3.1-testing/xen/arch/x86/hvm/vmx/intr.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/vmx/intr.c
++++ xen-3.3.1-testing/xen/arch/x86/hvm/vmx/intr.c
@@ -127,11 +127,13 @@ static void vmx_dirq_assist(struct vcpu
if ( !test_and_clear_bit(irq, &hvm_irq_dpci->dirq_mask) )
continue;
@@ -95,9 +98,10 @@
}
}
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/arch/x86/irq.c
---- a/xen/arch/x86/irq.c Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/arch/x86/irq.c Thu Oct 09 11:14:52 2008 +0100
+Index: xen-3.3.1-testing/xen/arch/x86/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
++++ xen-3.3.1-testing/xen/arch/x86/irq.c
@@ -285,7 +285,7 @@ static void __do_IRQ_guest(int vector)
* The descriptor is returned locked. This function is safe against changes
* to the per-domain irq-to-vector mapping.
@@ -107,9 +111,10 @@
struct domain *d, int irq, unsigned long *pflags)
{
unsigned int vector;
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/drivers/passthrough/io.c
---- a/xen/drivers/passthrough/io.c Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/drivers/passthrough/io.c Thu Oct 09 11:14:52 2008 +0100
+Index: xen-3.3.1-testing/xen/drivers/passthrough/io.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/drivers/passthrough/io.c
++++ xen-3.3.1-testing/xen/drivers/passthrough/io.c
@@ -26,10 +26,14 @@ static void pt_irq_time_out(void *data)
struct hvm_mirq_dpci_mapping *irq_map = data;
unsigned int guest_gsi, machine_gsi = 0;
@@ -147,12 +152,12 @@
uint32_t device, intx, link;
struct dev_intx_gsi_link *digl;
+ int pirq = pt_irq_bind->machine_irq;
-
++
+ if ( pirq < 0 || pirq >= NR_PIRQS )
+ return -EINVAL;
+
+ spin_lock(&d->evtchn_lock);
-+
+
+ hvm_irq_dpci = domain_get_irq_dpci(d);
if ( hvm_irq_dpci == NULL )
{
@@ -181,10 +186,10 @@
if ( pt_irq_bind->irq_type == PT_IRQ_TYPE_MSI )
{
- int pirq = pt_irq_bind->machine_irq;
-
+-
- if ( pirq < 0 || pirq >= NR_IRQS )
- return -EINVAL;
--
+
- if ( !(hvm_irq_dpci->mirq[pirq].flags & HVM_IRQ_DPCI_VALID ) )
+ if ( !test_and_set_bit(pirq, hvm_irq_dpci->mapping))
{
@@ -254,10 +259,10 @@
uint32_t device, intx, link;
struct list_head *digl_list, *tmp;
struct dev_intx_gsi_link *digl;
--
+
- if ( hvm_irq_dpci == NULL )
- return 0;
-
+-
machine_gsi = pt_irq_bind->machine_irq;
device = pt_irq_bind->u.pci.device;
intx = pt_irq_bind->u.pci.intx;
@@ -320,10 +325,10 @@
void hvm_dpci_msi_eoi(struct domain *d, int vector)
{
struct hvm_irq_dpci *hvm_irq_dpci = d->arch.hvm_domain.irq.dpci;
-+ irq_desc_t *desc;
- int pirq;
+- int pirq;
- unsigned long flags;
-- irq_desc_t *desc;
+ irq_desc_t *desc;
++ int pirq;
if ( !iommu_enabled || (hvm_irq_dpci == NULL) )
return;
@@ -338,6 +343,10 @@
- int vec;
- vec = domain_irq_to_vector(d, pirq);
- desc = &irq_desc[vec];
+-
+- spin_lock_irqsave(&desc->lock, flags);
+- desc->status &= ~IRQ_INPROGRESS;
+- spin_unlock_irqrestore(&desc->lock, flags);
+ test_bit(pirq, hvm_irq_dpci->mapping) &&
+ (test_bit(_HVM_IRQ_DPCI_MSI, &hvm_irq_dpci->mirq[pirq].flags)))
+ {
@@ -349,14 +358,11 @@
+ return;
+ }
-- spin_lock_irqsave(&desc->lock, flags);
-- desc->status &= ~IRQ_INPROGRESS;
-- spin_unlock_irqrestore(&desc->lock, flags);
-+ desc->status &= ~IRQ_INPROGRESS;
-+ spin_unlock_irq(&desc->lock);
-
- pirq_guest_eoi(d, pirq);
- }
++ desc->status &= ~IRQ_INPROGRESS;
++ spin_unlock_irq(&desc->lock);
++
+ pirq_guest_eoi(d, pirq);
+ }
+
@@ -418,9 +424,10 @@
- spin_unlock(&hvm_irq_dpci->dirq_lock);
+ spin_unlock(&d->evtchn_lock);
}
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/drivers/passthrough/pci.c
---- a/xen/drivers/passthrough/pci.c Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/drivers/passthrough/pci.c Thu Oct 09 11:14:52 2008 +0100
+Index: xen-3.3.1-testing/xen/drivers/passthrough/pci.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/drivers/passthrough/pci.c
++++ xen-3.3.1-testing/xen/drivers/passthrough/pci.c
@@ -154,7 +154,7 @@ int pci_remove_device(u8 bus, u8 devfn)
static void pci_clean_dpci_irqs(struct domain *d)
@@ -457,10 +464,11 @@
}
void pci_release_devices(struct domain *d)
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/drivers/passthrough/vtd/x86/vtd.c
---- a/xen/drivers/passthrough/vtd/x86/vtd.c Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/drivers/passthrough/vtd/x86/vtd.c Thu Oct 09 11:14:52 2008 +0100
-@@ -85,37 +85,41 @@ void hvm_dpci_isairq_eoi(struct domain *
+Index: xen-3.3.1-testing/xen/drivers/passthrough/vtd/x86/vtd.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/drivers/passthrough/vtd/x86/vtd.c
++++ xen-3.3.1-testing/xen/drivers/passthrough/vtd/x86/vtd.c
+@@ -85,37 +85,41 @@ int domain_set_irq_dpci(struct domain *d
void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq)
{
struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq;
@@ -513,9 +521,10 @@
}
+ spin_unlock(&d->evtchn_lock);
}
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/include/asm-x86/hvm/irq.h
---- a/xen/include/asm-x86/hvm/irq.h Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/include/asm-x86/hvm/irq.h Thu Oct 09 11:14:52 2008 +0100
+Index: xen-3.3.1-testing/xen/include/asm-x86/hvm/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/hvm/irq.h
++++ xen-3.3.1-testing/xen/include/asm-x86/hvm/irq.h
@@ -25,6 +25,7 @@
#include
#include
@@ -545,10 +554,11 @@
struct hvm_mirq_dpci_mapping mirq[NR_IRQS];
/* Guest IRQ to guest device/intx mapping. */
struct hvm_girq_dpci_mapping girq[NR_IRQS];
-diff -r b8f329d2c074 -r a11ad61bdb5b xen/include/xen/irq.h
---- a/xen/include/xen/irq.h Thu Oct 09 11:08:13 2008 +0100
-+++ b/xen/include/xen/irq.h Thu Oct 09 11:14:52 2008 +0100
-@@ -78,6 +78,8 @@ extern int pirq_guest_unmask(struct doma
+Index: xen-3.3.1-testing/xen/include/xen/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/xen/irq.h
++++ xen-3.3.1-testing/xen/include/xen/irq.h
+@@ -78,6 +78,8 @@ extern int pirq_guest_eoi(struct domain
extern int pirq_guest_unmask(struct domain *d);
extern int pirq_guest_bind(struct vcpu *v, int irq, int will_share);
extern void pirq_guest_unbind(struct domain *d, int irq);
++++++ 18584-evtchn-lock-rename.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:13.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:13.000000000 +0100
@@ -8,8 +8,10 @@
Signed-off-by: Keir Fraser
---- a/xen/arch/x86/hvm/svm/intr.c
-+++ b/xen/arch/x86/hvm/svm/intr.c
+Index: xen-3.3.1-testing/xen/arch/x86/hvm/svm/intr.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/svm/intr.c
++++ xen-3.3.1-testing/xen/arch/x86/hvm/svm/intr.c
@@ -124,11 +124,11 @@ static void svm_dirq_assist(struct vcpu
if ( !test_and_clear_bit(irq, &hvm_irq_dpci->dirq_mask) )
continue;
@@ -33,8 +35,10 @@
}
}
---- a/xen/arch/x86/hvm/vmx/intr.c
-+++ b/xen/arch/x86/hvm/vmx/intr.c
+Index: xen-3.3.1-testing/xen/arch/x86/hvm/vmx/intr.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/vmx/intr.c
++++ xen-3.3.1-testing/xen/arch/x86/hvm/vmx/intr.c
@@ -127,11 +127,11 @@ static void vmx_dirq_assist(struct vcpu
if ( !test_and_clear_bit(irq, &hvm_irq_dpci->dirq_mask) )
continue;
@@ -58,8 +62,10 @@
}
}
---- a/xen/arch/x86/irq.c
-+++ b/xen/arch/x86/irq.c
+Index: xen-3.3.1-testing/xen/arch/x86/irq.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/irq.c
++++ xen-3.3.1-testing/xen/arch/x86/irq.c
@@ -514,7 +514,7 @@ int pirq_guest_bind(struct vcpu *v, int
int rc = 0;
cpumask_t cpumask = CPU_MASK_NONE;
@@ -69,7 +75,7 @@
BUG_ON(!local_irq_is_enabled());
retry:
-@@ -684,7 +684,7 @@ void pirq_guest_unbind(struct domain *d,
+@@ -693,7 +693,7 @@ void pirq_guest_unbind(struct domain *d,
irq_desc_t *desc;
int vector;
@@ -78,7 +84,7 @@
BUG_ON(!local_irq_is_enabled());
desc = domain_spin_lock_irq_desc(d, irq, NULL);
-@@ -713,7 +713,7 @@ int pirq_guest_force_unbind(struct domai
+@@ -722,7 +722,7 @@ int pirq_guest_force_unbind(struct domai
irq_guest_action_t *action;
int i, bound = 0;
@@ -87,7 +93,7 @@
BUG_ON(!local_irq_is_enabled());
desc = domain_spin_lock_irq_desc(d, irq, NULL);
-@@ -740,7 +740,7 @@ int get_free_pirq(struct domain *d, int
+@@ -749,7 +749,7 @@ int get_free_pirq(struct domain *d, int
{
int i;
@@ -96,7 +102,7 @@
if ( type == MAP_PIRQ_TYPE_GSI )
{
-@@ -770,7 +770,7 @@ int map_domain_pirq(
+@@ -779,7 +779,7 @@ int map_domain_pirq(
irq_desc_t *desc;
unsigned long flags;
@@ -105,7 +111,7 @@
if ( !IS_PRIV(current->domain) )
return -EPERM;
-@@ -838,7 +838,7 @@ int unmap_domain_pirq(struct domain *d,
+@@ -847,7 +847,7 @@ int unmap_domain_pirq(struct domain *d,
if ( !IS_PRIV(current->domain) )
return -EINVAL;
@@ -114,7 +120,7 @@
vector = d->arch.pirq_vector[pirq];
if ( vector <= 0 )
-@@ -897,13 +897,13 @@ void free_domain_pirqs(struct domain *d)
+@@ -906,13 +906,13 @@ void free_domain_pirqs(struct domain *d)
if ( !msi_enable )
return;
@@ -130,8 +136,10 @@
}
extern void dump_ioapic_irq_info(void);
---- a/xen/arch/x86/physdev.c
-+++ b/xen/arch/x86/physdev.c
+Index: xen-3.3.1-testing/xen/arch/x86/physdev.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/physdev.c
++++ xen-3.3.1-testing/xen/arch/x86/physdev.c
@@ -104,7 +104,7 @@ static int physdev_map_pirq(struct physd
}
@@ -175,8 +183,10 @@
}
if ( copy_to_guest(arg, &irq_op, 1) != 0 )
---- a/xen/common/event_channel.c
-+++ b/xen/common/event_channel.c
+Index: xen-3.3.1-testing/xen/common/event_channel.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/common/event_channel.c
++++ xen-3.3.1-testing/xen/common/event_channel.c
@@ -133,7 +133,7 @@ static long evtchn_alloc_unbound(evtchn_
if ( rc )
return rc;
@@ -520,8 +530,10 @@
}
static void dump_evtchn_info(unsigned char key)
---- a/xen/drivers/passthrough/io.c
-+++ b/xen/drivers/passthrough/io.c
+Index: xen-3.3.1-testing/xen/drivers/passthrough/io.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/drivers/passthrough/io.c
++++ xen-3.3.1-testing/xen/drivers/passthrough/io.c
@@ -30,7 +30,7 @@ static void pt_irq_time_out(void *data)
struct dev_intx_gsi_link *digl;
uint32_t device, intx;
@@ -670,8 +682,10 @@
- spin_unlock(&d->evtchn_lock);
+ spin_unlock(&d->event_lock);
}
---- a/xen/drivers/passthrough/pci.c
-+++ b/xen/drivers/passthrough/pci.c
+Index: xen-3.3.1-testing/xen/drivers/passthrough/pci.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/drivers/passthrough/pci.c
++++ xen-3.3.1-testing/xen/drivers/passthrough/pci.c
@@ -165,7 +165,7 @@ static void pci_clean_dpci_irqs(struct d
if ( !is_hvm_domain(d) && !need_iommu(d) )
return;
@@ -690,8 +704,10 @@
}
void pci_release_devices(struct domain *d)
---- a/xen/drivers/passthrough/vtd/x86/vtd.c
-+++ b/xen/drivers/passthrough/vtd/x86/vtd.c
+Index: xen-3.3.1-testing/xen/drivers/passthrough/vtd/x86/vtd.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/drivers/passthrough/vtd/x86/vtd.c
++++ xen-3.3.1-testing/xen/drivers/passthrough/vtd/x86/vtd.c
@@ -93,13 +93,13 @@ void hvm_dpci_isairq_eoi(struct domain *
if ( !vtd_enabled)
return;
@@ -715,8 +731,10 @@
- spin_unlock(&d->evtchn_lock);
+ spin_unlock(&d->event_lock);
}
---- a/xen/include/asm-x86/domain.h
-+++ b/xen/include/asm-x86/domain.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/domain.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/domain.h
++++ xen-3.3.1-testing/xen/include/asm-x86/domain.h
@@ -235,7 +235,7 @@ struct arch_domain
/* Shadow translated domain: P2M mapping */
pagetable_t phys_table;
@@ -726,8 +744,10 @@
int vector_pirq[NR_VECTORS];
int pirq_vector[NR_PIRQS];
---- a/xen/include/asm-x86/hvm/irq.h
-+++ b/xen/include/asm-x86/hvm/irq.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/hvm/irq.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/hvm/irq.h
++++ xen-3.3.1-testing/xen/include/asm-x86/hvm/irq.h
@@ -63,7 +63,7 @@ struct hvm_girq_dpci_mapping {
#define NR_ISAIRQS 16
@@ -737,8 +757,10 @@
struct hvm_irq_dpci {
/* Machine IRQ to guest device/intx mapping. */
DECLARE_BITMAP(mapping, NR_PIRQS);
---- a/xen/include/xen/sched.h
-+++ b/xen/include/xen/sched.h
+Index: xen-3.3.1-testing/xen/include/xen/sched.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/xen/sched.h
++++ xen-3.3.1-testing/xen/include/xen/sched.h
@@ -188,7 +188,7 @@ struct domain
/* Event channel information. */
@@ -748,8 +770,10 @@
struct grant_table *grant_table;
---- a/xen/xsm/acm/acm_simple_type_enforcement_hooks.c
-+++ b/xen/xsm/acm/acm_simple_type_enforcement_hooks.c
+Index: xen-3.3.1-testing/xen/xsm/acm/acm_simple_type_enforcement_hooks.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/xsm/acm/acm_simple_type_enforcement_hooks.c
++++ xen-3.3.1-testing/xen/xsm/acm/acm_simple_type_enforcement_hooks.c
@@ -248,11 +248,11 @@ ste_init_state(struct acm_sized_buffer *
/* a) check for event channel conflicts */
for ( bucket = 0; bucket < NR_EVTCHN_BUCKETS; bucket++ )
++++++ 18637-vmx-set-dr7.patch ++++++
# HG changeset patch
# User Keir Fraser
# Date 1224147160 -3600
# Node ID 98ff908a91b7e12d7ddc609853fa1237d1714dec
# Parent 819ab49deef1da3042d2c111d6c99c3de535dae0
vmx: set DR7 via DOMCTL_setvcpucontext
This patch is needed for a guest domain debugger
to support hardware watchpoint.
Signed-off-by: Kouya Shimura
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -575,7 +575,10 @@ int arch_set_info_guest(
v->arch.guest_context.user_regs.eflags |= 2;
if ( is_hvm_vcpu(v) )
+ {
+ hvm_set_info_guest(v);
goto out;
+ }
/* Only CR0.TS is modifiable by guest or admin. */
v->arch.guest_context.ctrlreg[0] &= X86_CR0_TS;
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1184,6 +1184,13 @@ static void vmx_set_uc_mode(struct vcpu
vpid_sync_all();
}
+static void vmx_set_info_guest(struct vcpu *v)
+{
+ vmx_vmcs_enter(v);
+ __vmwrite(GUEST_DR7, v->arch.guest_context.debugreg[7]);
+ vmx_vmcs_exit(v);
+}
+
static struct hvm_function_table vmx_function_table = {
.name = "VMX",
.domain_initialise = vmx_domain_initialise,
@@ -1214,7 +1221,8 @@ static struct hvm_function_table vmx_fun
.msr_read_intercept = vmx_msr_read_intercept,
.msr_write_intercept = vmx_msr_write_intercept,
.invlpg_intercept = vmx_invlpg_intercept,
- .set_uc_mode = vmx_set_uc_mode
+ .set_uc_mode = vmx_set_uc_mode,
+ .set_info_guest = vmx_set_info_guest
};
static unsigned long *vpid_bitmap;
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -128,6 +128,7 @@ struct hvm_function_table {
int (*msr_write_intercept)(struct cpu_user_regs *regs);
void (*invlpg_intercept)(unsigned long vaddr);
void (*set_uc_mode)(struct vcpu *v);
+ void (*set_info_guest)(struct vcpu *v);
};
extern struct hvm_function_table hvm_funcs;
@@ -311,4 +312,10 @@ int hvm_virtual_to_linear_addr(
unsigned int addr_size,
unsigned long *linear_addr);
+static inline void hvm_set_info_guest(struct vcpu *v)
+{
+ if ( hvm_funcs.set_info_guest )
+ return hvm_funcs.set_info_guest(v);
+}
+
#endif /* __ASM_X86_HVM_HVM_H__ */
++++++ 18656-vtd-alloc-checks.patch ++++++
# HG changeset patch
# User Keir Fraser
# Date 1224512379 -3600
# Node ID 2a25fd94c6f207d5b9066a1d765697a5a680fc42
# Parent bf84c03c38eebc527786e96af4178f114a5bea41
VT-d: correct allocation failure checks
Checking the return value of map_domain_page() (and hence
map_vtd_domain_page()) against NULL is pointless, checking the return
value of alloc_domheap_page() (and thus alloc_pgtable_maddr()) is
mandatory, however.
Signed-off-by: Jan Beulich
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -458,7 +458,7 @@ int intremap_setup(struct iommu *iommu)
{
dprintk(XENLOG_WARNING VTDPREFIX,
"Cannot allocate memory for ir_ctrl->iremap_maddr\n");
- return -ENODEV;
+ return -ENOMEM;
}
ir_ctrl->iremap_index = -1;
}
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -220,10 +220,10 @@ static u64 addr_to_dma_page_maddr(struct
if ( !alloc )
break;
maddr = alloc_pgtable_maddr();
+ if ( !maddr )
+ break;
dma_set_pte_addr(*pte, maddr);
vaddr = map_vtd_domain_page(maddr);
- if ( !vaddr )
- break;
/*
* high level table always sets r/w, last level
@@ -236,8 +236,6 @@ static u64 addr_to_dma_page_maddr(struct
else
{
vaddr = map_vtd_domain_page(pte->val);
- if ( !vaddr )
- break;
}
if ( level == 2 )
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -429,7 +429,11 @@ int qinval_setup(struct iommu *iommu)
{
qi_ctrl->qinval_maddr = alloc_pgtable_maddr();
if ( qi_ctrl->qinval_maddr == 0 )
- panic("Cannot allocate memory for qi_ctrl->qinval_maddr\n");
+ {
+ dprintk(XENLOG_WARNING VTDPREFIX,
+ "Cannot allocate memory for qi_ctrl->qinval_maddr\n");
+ return -ENOMEM;
+ }
flush->context = flush_context_qi;
flush->iotlb = flush_iotlb_qi;
}
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c
@@ -41,17 +41,19 @@ u64 alloc_pgtable_maddr(void)
{
struct page_info *pg;
u64 *vaddr;
+ unsigned long mfn;
pg = alloc_domheap_page(NULL, 0);
- vaddr = map_domain_page(page_to_mfn(pg));
- if ( !vaddr )
+ if ( !pg )
return 0;
+ mfn = page_to_mfn(pg);
+ vaddr = map_domain_page(mfn);
memset(vaddr, 0, PAGE_SIZE);
iommu_flush_cache_page(vaddr);
unmap_domain_page(vaddr);
- return page_to_maddr(pg);
+ return (u64)mfn << PAGE_SHIFT_4K;
}
void free_pgtable_maddr(u64 maddr)
++++++ 18661-recursive-spinlocks.patch ++++++
# HG changeset patch
# User Keir Fraser
# Date 1224519405 -3600
# Node ID 54d74fc0037ce688e79759ca632d3918f7aaa399
# Parent f4dab783b58b41f2c67a66d6d095887faec3c296
spinlock: Modify recursive spinlock definitions to support up to 4095 CPUs.
Signed-off-by: Keir Fraser
--- a/xen/include/asm-x86/spinlock.h
+++ b/xen/include/asm-x86/spinlock.h
@@ -8,11 +8,11 @@
typedef struct {
volatile s16 lock;
- s8 recurse_cpu;
- u8 recurse_cnt;
+ u16 recurse_cpu:12;
+ u16 recurse_cnt:4;
} spinlock_t;
-#define SPIN_LOCK_UNLOCKED /*(spinlock_t)*/ { 1, -1, 0 }
+#define SPIN_LOCK_UNLOCKED { 1, 0xfffu, 0 }
#define spin_lock_init(x) do { *(x) = (spinlock_t) SPIN_LOCK_UNLOCKED; } while(0)
#define spin_is_locked(x) (*(volatile char *)(&(x)->lock) <= 0)
@@ -59,11 +59,15 @@ static inline int _raw_spin_trylock(spin
#define _raw_spin_lock_recursive(_lock) \
do { \
int cpu = smp_processor_id(); \
+ /* Don't allow overflow of recurse_cpu field. */ \
+ BUILD_BUG_ON(NR_CPUS > 0xfffu); \
if ( likely((_lock)->recurse_cpu != cpu) ) \
{ \
spin_lock(_lock); \
(_lock)->recurse_cpu = cpu; \
} \
+ /* We support only fairly shallow recursion, else the counter overflows. */ \
+ ASSERT((_lock)->recurse_cnt < 0xfu); \
(_lock)->recurse_cnt++; \
} while ( 0 )
@@ -71,7 +75,7 @@ static inline int _raw_spin_trylock(spin
do { \
if ( likely(--(_lock)->recurse_cnt == 0) ) \
{ \
- (_lock)->recurse_cpu = -1; \
+ (_lock)->recurse_cpu = 0xfffu; \
spin_unlock(_lock); \
} \
} while ( 0 )
++++++ 18745-xend-ioport-irq.patch ++++++
Index: xen-3.3.1-testing/tools/python/xen/xend/server/iopif.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/iopif.py
+++ xen-3.3.1-testing/tools/python/xen/xend/server/iopif.py
@@ -45,9 +45,22 @@ def parse_ioport(val):
class IOPortsController(DevController):
+ valid_cfg = ['to', 'from', 'uuid']
+
def __init__(self, vm):
DevController.__init__(self, vm)
+ def getDeviceConfiguration(self, devid, transaction = None):
+ result = DevController.getDeviceConfiguration(self, devid, transaction)
+ if transaction is None:
+ devinfo = self.readBackend(devid, *self.valid_cfg)
+ else:
+ devinfo = self.readBackendTxn(transaction, devid, *self.valid_cfg)
+ config = dict(zip(self.valid_cfg, devinfo))
+ config = dict([(key, val) for key, val in config.items()
+ if val != None])
+ return config
+
def getDeviceDetails(self, config):
"""@see DevController.getDeviceDetails"""
@@ -81,4 +94,9 @@ class IOPortsController(DevController):
'ioports: Failed to configure legacy i/o range: %s - %s' %
(io_from, io_to))
- return (None, {}, {})
+ back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
+ return (self.allocateDeviceID(), back, {})
+
+ def waitForDevice(self, devid):
+ # don't wait for hotplug
+ return
Index: xen-3.3.1-testing/tools/python/xen/xend/server/irqif.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/irqif.py
+++ xen-3.3.1-testing/tools/python/xen/xend/server/irqif.py
@@ -39,6 +39,18 @@ class IRQController(DevController):
def __init__(self, vm):
DevController.__init__(self, vm)
+ valid_cfg = ['irq', 'uuid']
+
+ def getDeviceConfiguration(self, devid, transaction = None):
+ result = DevController.getDeviceConfiguration(self, devid, transaction)
+ if transaction is None:
+ devinfo = self.readBackend(devid, *self.valid_cfg)
+ else:
+ devinfo = self.readBackendTxn(transaction, devid, *self.valid_cfg)
+ config = dict(zip(self.valid_cfg, devinfo))
+ config = dict([(key, val) for key, val in config.items()
+ if val != None])
+ return config
def getDeviceDetails(self, config):
"""@see DevController.getDeviceDetails"""
@@ -75,4 +87,9 @@ class IRQController(DevController):
if rc < 0:
raise VmError(
'irq: Failed to map irq %x' % (pirq))
- return (None, {}, {})
+ back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
+ return (self.allocateDeviceID(), back, {})
+
+ def waitForDevice(self, devid):
+ # don't wait for hotplug
+ return
Index: xen-3.3.1-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.1-testing/tools/python/xen/xm/create.py
@@ -1032,6 +1032,14 @@ def preprocess_ioports(vals):
ioports.append(hexd)
vals.ioports = ioports
+def preprocess_irq(vals):
+ if not vals.irq: return
+ irq = []
+ for v in vals.irq:
+ d = repr(v)
+ irq.append(d)
+ vals.irq = irq
+
def preprocess_vtpm(vals):
if not vals.vtpm: return
vtpms = []
@@ -1162,6 +1170,7 @@ def preprocess(vals):
preprocess_vscsi(vals)
preprocess_ioports(vals)
preprocess_ip(vals)
+ preprocess_irq(vals)
preprocess_nfs(vals)
preprocess_vnc(vals)
preprocess_vtpm(vals)
++++++ blktap-ioemu-close-fix.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:14.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:14.000000000 +0100
@@ -2,19 +2,52 @@
===================================================================
--- xen-3.3.1-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c
-@@ -245,8 +245,15 @@ static int del_disktype(blkif_t *blkif)
+@@ -221,6 +221,28 @@ static void add_disktype(blkif_t *blkif,
+ entry->pprev = pprev;
+ }
+
++static int qemu_instance_has_disks(int domid)
++{
++ int i;
++ int count = 0;
++ driver_list_entry_t *entry;
++
++ for (i = 0; i < MAX_DISK_TYPES; i++) {
++ entry = active_disks[i];
++ while (entry) {
++#ifdef ALWAYS_USE_IOEMU
++ if (entry->blkif->domid == domid)
++#else
++ if ((entry->blkif->domid == domid) && dtypes[i]->use_ioemu)
++#endif
++ count++;
++ entry = entry->next;
++ }
++ }
++
++ return (count != 0);
++}
++
+ static int del_disktype(blkif_t *blkif)
+ {
+ driver_list_entry_t *entry, **pprev;
+@@ -245,8 +267,20 @@ static int del_disktype(blkif_t *blkif)
DPRINTF("DEL_DISKTYPE: Freeing entry\n");
free(entry);
+#ifdef ALWAYS_USE_IOEMU
-+ return 0;
++ return !qemu_instance_has_disks(blkif->domid);
+#else
++ /*
++ * When using ioemu, all disks of one VM are connected to the same
++ * qemu-dm instance. We may close the file handle only if there is
++ * no other disk left for this domain.
++ */
++ if (dtypes[type]->use_ioemu)
++ return !qemu_instance_has_disks(blkif->domid);
++
/* Caller should close() if no single controller, or list is empty. */
-- return (!dtypes[type]->single_handler || (active_disks[type] == NULL));
-+ /* tapdisk-ioemu is a single controller regardless of single_hander
-+ (TODO: This needs to be per-domain in fact) */
-+ return ((!dtypes[type]->single_handler && !dtypes[type]->use_ioemu)
-+ || (active_disks[type] == NULL));
+ return (!dtypes[type]->single_handler || (active_disks[type] == NULL));
+#endif
}
++++++ dom-print.patch ++++++
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -135,7 +135,7 @@ void dump_pageframe_info(struct domain *
printk("Memory pages belonging to domain %u:\n", d->domain_id);
- if ( d->tot_pages >= 10 )
+ if ( d->tot_pages >= 10 && d->is_dying < DOMDYING_dead )
{
printk(" DomPage list too long to display\n");
}
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -192,9 +192,9 @@ static void dump_domains(unsigned char k
{
printk("General information for domain %u:\n", d->domain_id);
cpuset_print(tmpstr, sizeof(tmpstr), d->domain_dirty_cpumask);
- printk(" refcnt=%d nr_pages=%d xenheap_pages=%d "
+ printk(" refcnt=%d dying=%d nr_pages=%d xenheap_pages=%d "
"dirty_cpus=%s\n",
- atomic_read(&d->refcnt),
+ atomic_read(&d->refcnt), d->is_dying,
d->tot_pages, d->xenheap_pages, tmpstr);
printk(" handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
++++++ hv_xen_base.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:15.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:15.000000000 +0100
@@ -42,7 +42,7 @@
hvm_funcs.domain_destroy(d);
rtc_deinit(d);
stdvga_deinit(d);
-@@ -645,8 +647,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
+@@ -644,8 +646,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
{
int rc;
@@ -57,7 +57,7 @@
if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
goto fail2;
-@@ -693,12 +701,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
+@@ -692,12 +700,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
hvm_funcs.vcpu_destroy(v);
fail2:
vlapic_destroy(v);
@@ -72,7 +72,7 @@
hvm_vcpu_cacheattr_destroy(v);
vlapic_destroy(v);
hvm_funcs.vcpu_destroy(v);
-@@ -1647,7 +1657,7 @@ void hvm_cpuid(unsigned int input, unsig
+@@ -1645,7 +1655,7 @@ void hvm_cpuid(unsigned int input, unsig
struct vcpu *v = current;
if ( cpuid_hypervisor_leaves(input, eax, ebx, ecx, edx) )
@@ -81,7 +81,7 @@
domain_cpuid(v->domain, input, *ecx, eax, ebx, ecx, edx);
-@@ -1659,6 +1669,8 @@ void hvm_cpuid(unsigned int input, unsig
+@@ -1657,6 +1667,8 @@ void hvm_cpuid(unsigned int input, unsig
if ( vlapic_hw_disabled(vcpu_vlapic(v)) )
__clear_bit(X86_FEATURE_APIC & 31, edx);
}
@@ -90,7 +90,7 @@
}
void hvm_rdtsc_intercept(struct cpu_user_regs *regs)
-@@ -1749,6 +1761,8 @@ int hvm_msr_read_intercept(struct cpu_us
+@@ -1747,6 +1759,8 @@ int hvm_msr_read_intercept(struct cpu_us
break;
default:
@@ -99,7 +99,7 @@
return hvm_funcs.msr_read_intercept(regs);
}
-@@ -1837,6 +1851,8 @@ int hvm_msr_write_intercept(struct cpu_u
+@@ -1835,6 +1849,8 @@ int hvm_msr_write_intercept(struct cpu_u
break;
default:
@@ -108,7 +108,7 @@
return hvm_funcs.msr_write_intercept(regs);
}
-@@ -1963,6 +1979,10 @@ int hvm_do_hypercall(struct cpu_user_reg
+@@ -1961,6 +1977,10 @@ int hvm_do_hypercall(struct cpu_user_reg
case 0:
break;
}
@@ -119,7 +119,7 @@
if ( (eax >= NR_hypercalls) || !hvm_hypercall32_table[eax] )
{
-@@ -2464,6 +2484,15 @@ long do_hvm_op(unsigned long op, XEN_GUE
+@@ -2462,6 +2482,15 @@ long do_hvm_op(unsigned long op, XEN_GUE
rc = -EINVAL;
break;
++++++ i386-highmem-assist.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:15.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:15.000000000 +0100
@@ -1,5 +1,9 @@
---- a/xen/arch/x86/mm.c
-+++ b/xen/arch/x86/mm.c
+-unstable staging c/s 18724
+
+Index: xen-3.3.1-testing/xen/arch/x86/mm.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/mm.c
++++ xen-3.3.1-testing/xen/arch/x86/mm.c
@@ -2431,6 +2431,29 @@ static inline cpumask_t vcpumask_to_pcpu
return pmask;
}
@@ -97,8 +101,10 @@
default:
MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
rc = -ENOSYS;
---- a/xen/arch/x86/x86_32/domain_page.c
-+++ b/xen/arch/x86/x86_32/domain_page.c
+Index: xen-3.3.1-testing/xen/arch/x86/x86_32/domain_page.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/x86_32/domain_page.c
++++ xen-3.3.1-testing/xen/arch/x86/x86_32/domain_page.c
@@ -114,7 +114,7 @@ void *map_domain_page(unsigned long mfn)
return (void *)va;
}
@@ -117,8 +123,10 @@
{
unsigned long __va = (unsigned long)va;
l2_pgentry_t *pl2e;
---- a/xen/arch/x86/x86_64/compat/mm.c
-+++ b/xen/arch/x86/x86_64/compat/mm.c
+Index: xen-3.3.1-testing/xen/arch/x86/x86_64/compat/mm.c
+===================================================================
+--- xen-3.3.1-testing.orig/xen/arch/x86/x86_64/compat/mm.c
++++ xen-3.3.1-testing/xen/arch/x86/x86_64/compat/mm.c
@@ -217,6 +217,8 @@ int compat_mmuext_op(XEN_GUEST_HANDLE(mm
case MMUEXT_PIN_L4_TABLE:
case MMUEXT_UNPIN_TABLE:
@@ -138,8 +146,10 @@
default:
arg2 = -1;
break;
---- a/xen/include/asm-x86/fixmap.h
-+++ b/xen/include/asm-x86/fixmap.h
+Index: xen-3.3.1-testing/xen/include/asm-x86/fixmap.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/asm-x86/fixmap.h
++++ xen-3.3.1-testing/xen/include/asm-x86/fixmap.h
@@ -29,6 +29,7 @@
* from the end of virtual memory backwards.
*/
@@ -148,8 +158,24 @@
#ifdef __i386__
FIX_PAE_HIGHMEM_0,
FIX_PAE_HIGHMEM_END = FIX_PAE_HIGHMEM_0 + NR_CPUS-1,
---- a/xen/include/public/xen.h
-+++ b/xen/include/public/xen.h
+Index: xen-3.3.1-testing/xen/include/public/features.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/public/features.h
++++ xen-3.3.1-testing/xen/include/public/features.h
+@@ -65,6 +65,9 @@
+ */
+ #define XENFEAT_gnttab_map_avail_bits 7
+
++/* x86: Does this Xen host support the MMU_{CLEAR,COPY}_PAGE hypercall? */
++#define XENFEAT_highmem_assist 6
++
+ #define XENFEAT_NR_SUBMAPS 1
+
+ #endif /* __XEN_PUBLIC_FEATURES_H__ */
+Index: xen-3.3.1-testing/xen/include/public/xen.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/public/xen.h
++++ xen-3.3.1-testing/xen/include/public/xen.h
@@ -231,6 +231,13 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
* cmd: MMUEXT_SET_LDT
* linear_addr: Linear address of LDT base (NB. must be page-aligned).
@@ -190,8 +216,10 @@
} arg2;
};
typedef struct mmuext_op mmuext_op_t;
---- a/xen/include/xen/domain_page.h
-+++ b/xen/include/xen/domain_page.h
+Index: xen-3.3.1-testing/xen/include/xen/domain_page.h
+===================================================================
+--- xen-3.3.1-testing.orig/xen/include/xen/domain_page.h
++++ xen-3.3.1-testing/xen/include/xen/domain_page.h
@@ -24,7 +24,7 @@ void *map_domain_page(unsigned long mfn)
* Pass a VA within a page previously mapped in the context of the
* currently-executing VCPU via a call to map_domain_page().
++++++ ioemu-blktap-zero-size.patch ++++++
Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.3.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.3.1-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -67,6 +67,7 @@ int read_fd;
int write_fd;
static pid_t process;
+int connected_disks = 0;
fd_list_entry_t *fd_start = NULL;
extern char* get_snapshot_name(int devid);
@@ -260,6 +261,12 @@ static int open_disk(struct td_state *s,
s->size = bs->total_sectors;
s->sector_size = 512;
+ if (s->size == 0) {
+ fprintf(stderr, "Error: Disk image %s is too small\n",
+ path);
+ return -ENOMEM;
+ }
+
s->info = ((s->flags & TD_RDONLY) ? VDISK_READONLY : 0);
#ifndef QEMU_TOOL
@@ -563,6 +570,7 @@ static void handle_blktap_ctrlmsg(void*
/* Allocate the disk structs */
s = state_init();
+ connected_disks++;
/*Open file*/
if (s == NULL || open_disk(s, path, msg->drivertype, msg->readonly)) {
@@ -624,7 +632,8 @@ static void handle_blktap_ctrlmsg(void*
case CTLMSG_CLOSE:
s = get_state(msg->cookie);
if (s) unmap_disk(s);
- break;
+ connected_disks--;
+ break;
case CTLMSG_PID:
memset(buf, 0x00, MSG_SIZE);
Index: xen-3.3.1-testing/tools/ioemu-remote/tapdisk-ioemu.c
===================================================================
--- xen-3.3.1-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c
+++ xen-3.3.1-testing/tools/ioemu-remote/tapdisk-ioemu.c
@@ -18,6 +18,7 @@ extern void *qemu_mallocz(size_t size);
extern void qemu_free(void *ptr);
extern void *fd_start;
+extern int connected_disks;
int domid = 0;
FILE* logfile;
@@ -98,7 +99,7 @@ int main(void)
int max_fd;
fd_set rfds;
struct timeval tv;
- void *old_fd_start = NULL;
+ int old_connected_disks = 0;
/* Daemonize */
if (fork() != 0)
@@ -153,11 +154,17 @@ int main(void)
pioh = &ioh->next;
}
+ if (old_connected_disks != connected_disks)
+ fprintf(stderr, "connected disks: %d => %d\n",
+ old_connected_disks, connected_disks);
+
/* Exit when the last image has been closed */
- if (old_fd_start != NULL && fd_start == NULL)
+ if (old_connected_disks != 0 && connected_disks == 0) {
+ fprintf(stderr, "Last image is closed, exiting.\n");
exit(0);
+ }
- old_fd_start = fd_start;
+ old_connected_disks = connected_disks;
}
return 0;
}
Index: xen-3.3.1-testing/tools/examples/blktap
===================================================================
--- xen-3.3.1-testing.orig/tools/examples/blktap
+++ xen-3.3.1-testing/tools/examples/blktap
@@ -75,6 +75,7 @@ fi
if [ "$command" = 'add' ]
then
[ -e "$file" ] || { fatal $file does not exist; }
+ [ $(stat --format="%s" "$file") -ge 512 ] || { fatal $file is too small; }
FRONTEND_ID=$(xenstore_read "$XENBUS_PATH/frontend-id")
FRONTEND_UUID=$(xenstore_read "/local/domain/$FRONTEND_ID/vm")
Index: xen-3.3.1-testing/tools/python/xen/xend/server/DevController.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/DevController.py
+++ xen-3.3.1-testing/tools/python/xen/xend/server/DevController.py
@@ -182,7 +182,7 @@ class DevController:
(devid, self.deviceClass))
elif status == Error:
- self.destroyDevice(devid, False)
+ self.destroyDevice(devid, True)
if err is None:
raise VmError("Device %s (%s) could not be connected. "
"Backend device not found." %
++++++ pv-driver-build.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:15.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:15.000000000 +0100
@@ -1,8 +1,8 @@
Index: xen-3.3.1-testing/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
===================================================================
---- xen-3.3.1-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c 2008-10-15 11:38:53.000000000 -0600
-+++ xen-3.3.1-testing/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c 2008-10-15 11:49:33.000000000 -0600
-@@ -14,7 +14,11 @@
+--- xen-3.3.1-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
++++ xen-3.3.1-testing/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
+@@ -14,7 +14,11 @@ EXPORT_SYMBOL(system_state);
void ctrl_alt_del(void)
{
@@ -17,9 +17,9 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
Index: xen-3.3.1-testing/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c
===================================================================
---- xen-3.3.1-testing.orig/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c 2008-10-15 11:38:53.000000000 -0600
-+++ xen-3.3.1-testing/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c 2008-10-15 11:39:04.000000000 -0600
-@@ -44,7 +44,11 @@
+--- xen-3.3.1-testing.orig/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c
++++ xen-3.3.1-testing/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c
+@@ -34,7 +34,11 @@ static void ap_suspend(void *_info)
atomic_dec(&info->nr_spinning);
}
++++++ python2.6-fixes.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:16.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:16.000000000 +0100
@@ -2,12 +2,15 @@
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/util/acmpolicy.py
+++ xen-3.3.1-testing/tools/python/xen/util/acmpolicy.py
-@@ -17,7 +17,7 @@
+@@ -17,7 +17,10 @@
#============================================================================
import os
-import sha
-+import hashlib
++try:
++ import hashlib # python v2.6 or newer
++except ImportError:
++ import sha # python v2.5 or older
import stat
import array
import struct
++++++ snapshot-xend.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:16.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:16.000000000 +0100
@@ -90,7 +90,7 @@
if node > -1:
insert_after(sxprep,'vcpus',['node', str(node)])
-@@ -91,52 +93,58 @@ def save(fd, dominfo, network, live, dst
+@@ -91,52 +93,60 @@ def save(fd, dominfo, network, live, dst
image_cfg = dominfo.info.get('image', {})
hvm = dominfo.info.is_hvm()
@@ -164,6 +164,8 @@
+ log.info("Domain %d suspended.", dominfo.getDomid())
+ dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP3,
+ domain_name)
++ if name:
++ dominfo.image.snapshotDeviceModel(name)
+ if hvm:
+ dominfo.image.saveDeviceModel()
+
@@ -195,20 +197,24 @@
if checkpoint:
dominfo.resumeDomain()
-@@ -193,6 +201,59 @@ def restore(xd, fd, dominfo = None, paus
+@@ -193,6 +203,63 @@ def restore(xd, fd, dominfo = None, paus
if othervm is not None and othervm.domid is not None:
raise VmError("Domain '%s' already exists with ID '%d'" % (domconfig["name_label"], othervm.domid))
+ def contains_state(fd):
-+ cur = os.lseek(fd, 0, 1)
-+ end = os.lseek(fd, 0, 2)
++ try:
++ cur = os.lseek(fd, 0, 1)
++ end = os.lseek(fd, 0, 2)
+
-+ ret = False
-+ if cur < end:
-+ ret = True
++ ret = False
++ if cur < end:
++ ret = True
+
-+ os.lseek(fd, cur, 0)
-+ return ret
++ os.lseek(fd, cur, 0)
++ return ret
++ except OSError, (errno, strerr):
++ # lseek failed <==> socket <==> state
++ return True
+
+ #
+ # We shouldn't hold the domains_lock over a waitForDevices
@@ -255,7 +261,7 @@
if dominfo:
dominfo.resume()
else:
-@@ -308,27 +369,8 @@ def restore(xd, fd, dominfo = None, paus
+@@ -308,27 +375,8 @@ def restore(xd, fd, dominfo = None, paus
dominfo.completeRestore(handler.store_mfn, handler.console_mfn)
++++++ x86-alloc-cpu-structs.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:16.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:16.000000000 +0100
@@ -72,7 +72,7 @@
perf = data->acpi_data;
policy->shared_type = perf->shared_type;
-@@ -257,8 +254,8 @@ int powernow_cpufreq_init(void)
+@@ -271,8 +268,8 @@ int powernow_cpufreq_init(void)
}
if (ret)
return ret;
@@ -83,7 +83,7 @@
}
max_dom++;
-@@ -274,13 +271,13 @@ int powernow_cpufreq_init(void)
+@@ -288,13 +285,13 @@ int powernow_cpufreq_init(void)
/* get cpumask of each psd domain */
for_each_online_cpu(i) {
@@ -114,7 +114,7 @@
uint64_t total_idle_ns;
uint64_t tmp_idle_ns;
-+ if ( !pxpt )
++ if ( !pxpt || !pxpt->u.pt )
+ continue;
total_idle_ns = get_cpu_idle_time(cpu);
tmp_idle_ns = total_idle_ns - pxpt->prev_idle_wall;
@@ -142,7 +142,7 @@
uint64_t total_idle_ns;
uint64_t tmp_idle_ns;
-+ if ( !pxpt || !pmpt )
++ if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt || !pmpt )
+ continue;
+
total_idle_ns = get_cpu_idle_time(i);
@@ -165,12 +165,12 @@
- struct processor_pminfo *pmpt = &processor_pminfo[cpuid];
+ struct pm_px *pxpt = px_statistic_data[cpuid];
+ const struct processor_pminfo *pmpt = processor_pminfo[cpuid];
++
++ if ( !pmpt )
++ return -EINVAL;
count = pmpt->perf.state_count;
-+ if ( !pmpt )
-+ return -EINVAL;
-+
+ if ( !pxpt )
+ {
+ pxpt = xmalloc(struct pm_px);
@@ -192,7 +192,7 @@
+ const struct processor_pminfo *pmpt = processor_pminfo[cpuid];
- count = processor_pminfo[cpuid].perf.state_count;
-+ if ( !pxpt || !pmpt )
++ if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt || !pmpt )
+ return;
+
+ count = pmpt->perf.state_count;
@@ -336,43 +336,24 @@
extern uint32_t pmstat_get_cx_nr(uint32_t cpuid);
extern int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat);
-@@ -50,13 +50,14 @@ extern int pmstat_reset_cx_stat(uint32_t
- int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
- {
- int ret = 0;
-- struct pm_px *pxpt = &px_statistic_data[op->cpuid];
-- struct processor_pminfo *pmpt = &processor_pminfo[op->cpuid];
-+ struct processor_pminfo *pmpt;
-
- /* to protect the case when Px was not controlled by xen */
- if ( (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) )
+@@ -55,7 +55,7 @@ int do_get_pm_info(struct xen_sysctl_get
+ if ( !op || (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) )
return -EINVAL;
+- pmpt = &processor_pminfo[op->cpuid];
+ pmpt = processor_pminfo[op->cpuid];
-+
+
switch ( op->type & PMSTAT_CATEGORY_MASK )
{
- case PMSTAT_CX:
-@@ -66,7 +67,7 @@ int do_get_pm_info(struct xen_sysctl_get
- case PMSTAT_PX:
- if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_PX) )
- return -ENODEV;
-- if ( !(pmpt->perf.init & XEN_PX_INIT) )
-+ if ( !pmpt || !(pmpt->perf.init & XEN_PX_INIT) )
- return -EINVAL;
- break;
- default:
-@@ -86,6 +87,10 @@ int do_get_pm_info(struct xen_sysctl_get
+@@ -86,7 +86,7 @@ int do_get_pm_info(struct xen_sysctl_get
uint64_t now, ct;
uint64_t total_idle_ns;
uint64_t tmp_idle_ns;
+- struct pm_px *pxpt = &px_statistic_data[op->cpuid];
+ struct pm_px *pxpt = px_statistic_data[op->cpuid];
-+
-+ if ( !pxpt )
-+ return -ENODATA;
- total_idle_ns = get_cpu_idle_time(op->cpuid);
- tmp_idle_ns = total_idle_ns - pxpt->prev_idle_wall;
+ if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt )
+ return -ENODATA;
Index: xen-3.3.1-testing/xen/arch/x86/platform_hypercall.c
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/platform_hypercall.c
++++++ x86-dom-cleanup-no-hack.patch ++++++
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1639,32 +1639,23 @@ static int relinquish_memory(
}
if ( test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
- put_page_and_type(page);
+ ret = put_page_and_type_preemptible(page, 1);
+ switch ( ret )
+ {
+ case 0:
+ break;
+ case -EAGAIN:
+ case -EINTR:
+ set_bit(_PGT_pinned, &page->u.inuse.type_info);
+ put_page(page);
+ goto out;
+ default:
+ BUG();
+ }
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
-#ifdef DOMAIN_DESTRUCT_AVOID_RECURSION
- /*
- * Forcibly drop reference counts of page tables above top most (which
- * were skipped to prevent long latencies due to deep recursion - see
- * the special treatment in free_lX_table()).
- */
- y = page->u.inuse.type_info;
- if ( (type < PGT_root_page_table) &&
- unlikely(((y + PGT_type_mask) &
- (PGT_type_mask|PGT_validated)) == type) )
- {
- BUG_ON((y & PGT_count_mask) >=
- (page->count_info & PGC_count_mask));
- while ( y & PGT_count_mask )
- {
- put_page_and_type(page);
- y = page->u.inuse.type_info;
- }
- }
-#endif
-
/*
* Forcibly invalidate top-most, still valid page tables at this point
* to break circular 'linear page table' references as well as clean up
@@ -1685,8 +1676,23 @@ static int relinquish_memory(
x & ~(PGT_validated|PGT_partial));
if ( likely(y == x) )
{
- if ( free_page_type(page, x, 0) != 0 )
+ /* No need for atomic update of type_info here: noone else updates it. */
+ switch ( ret = free_page_type(page, x, 1) )
+ {
+ case 0:
+ break;
+ case -EINTR:
+ page->u.inuse.type_info |= PGT_validated;
+ put_page(page);
+ ret = -EAGAIN;
+ goto out;
+ case -EAGAIN:
+ page->u.inuse.type_info |= PGT_partial;
+ put_page(page);
+ goto out;
+ default:
BUG();
+ }
if ( x & PGT_partial )
page->u.inuse.type_info--;
break;
@@ -1833,11 +1839,6 @@ int domain_relinquish_resources(struct d
/* fallthrough */
case RELMEM_done:
-#ifdef DOMAIN_DESTRUCT_AVOID_RECURSION
- ret = relinquish_memory(d, &d->page_list, PGT_l1_page_table);
- if ( ret )
- return ret;
-#endif
break;
default:
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1343,7 +1343,7 @@ static void free_l1_table(struct page_in
static int free_l2_table(struct page_info *page, int preemptible)
{
-#if defined(CONFIG_COMPAT) || defined(DOMAIN_DESTRUCT_AVOID_RECURSION)
+#ifdef CONFIG_COMPAT
struct domain *d = page_get_owner(page);
#endif
unsigned long pfn = page_to_mfn(page);
@@ -1351,11 +1351,6 @@ static int free_l2_table(struct page_inf
unsigned int i = page->nr_validated_ptes - 1;
int err = 0;
-#ifdef DOMAIN_DESTRUCT_AVOID_RECURSION
- if ( d->arch.relmem == RELMEM_l3 )
- return 0;
-#endif
-
pl2e = map_domain_page(pfn);
ASSERT(page->nr_validated_ptes);
@@ -1385,11 +1380,6 @@ static int free_l3_table(struct page_inf
unsigned int i = page->nr_validated_ptes - !page->partial_pte;
int rc = 0;
-#ifdef DOMAIN_DESTRUCT_AVOID_RECURSION
- if ( d->arch.relmem == RELMEM_l4 )
- return 0;
-#endif
-
pl3e = map_domain_page(pfn);
do {
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -41,14 +41,6 @@
#define CONFIG_HOTPLUG 1
#define CONFIG_HOTPLUG_CPU 1
-/*
- * Avoid deep recursion when tearing down pagetables during domain destruction,
- * causing dom0 to become unresponsive and Xen to miss time-critical softirq
- * deadlines. This will ultimately be replaced by built-in preemptibility of
- * get_page_type().
- */
-#define DOMAIN_DESTRUCT_AVOID_RECURSION 1
-
#define HZ 100
#define OPT_CONSOLE_STR "vga"
++++++ x86-dom-cleanup.patch ++++++
Equivalent of -unstable c/s 18720, 18731, and 18735.
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1687,6 +1687,8 @@ static int relinquish_memory(
{
if ( free_page_type(page, x, 0) != 0 )
BUG();
+ if ( x & PGT_partial )
+ page->u.inuse.type_info--;
break;
}
}
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1343,7 +1343,7 @@ static void free_l1_table(struct page_in
static int free_l2_table(struct page_info *page, int preemptible)
{
-#ifdef CONFIG_COMPAT
+#if defined(CONFIG_COMPAT) || defined(DOMAIN_DESTRUCT_AVOID_RECURSION)
struct domain *d = page_get_owner(page);
#endif
unsigned long pfn = page_to_mfn(page);
@@ -1351,6 +1351,11 @@ static int free_l2_table(struct page_inf
unsigned int i = page->nr_validated_ptes - 1;
int err = 0;
+#ifdef DOMAIN_DESTRUCT_AVOID_RECURSION
+ if ( d->arch.relmem == RELMEM_l3 )
+ return 0;
+#endif
+
pl2e = map_domain_page(pfn);
ASSERT(page->nr_validated_ptes);
@@ -1381,7 +1386,7 @@ static int free_l3_table(struct page_inf
int rc = 0;
#ifdef DOMAIN_DESTRUCT_AVOID_RECURSION
- if ( d->arch.relmem == RELMEM_l3 )
+ if ( d->arch.relmem == RELMEM_l4 )
return 0;
#endif
@@ -1424,11 +1429,6 @@ static int free_l4_table(struct page_inf
unsigned int i = page->nr_validated_ptes - !page->partial_pte;
int rc = 0;
-#ifdef DOMAIN_DESTRUCT_AVOID_RECURSION
- if ( d->arch.relmem == RELMEM_l4 )
- return 0;
-#endif
-
do {
if ( is_guest_l4_slot(d, i) )
rc = put_page_from_l4e(pl4e[i], pfn, preemptible);
@@ -1940,7 +1940,6 @@ int free_page_type(struct page_info *pag
{
struct domain *owner = page_get_owner(page);
unsigned long gmfn;
- int rc;
if ( likely(owner != NULL) )
{
@@ -1973,34 +1972,39 @@ int free_page_type(struct page_info *pag
page->nr_validated_ptes = 1U << PAGETABLE_ORDER;
page->partial_pte = 0;
}
+
switch ( type & PGT_type_mask )
{
case PGT_l1_page_table:
free_l1_table(page);
- rc = 0;
- break;
+ return 0;
case PGT_l2_page_table:
- rc = free_l2_table(page, preemptible);
- break;
+ return free_l2_table(page, preemptible);
case PGT_l3_page_table:
#if CONFIG_PAGING_LEVELS == 3
if ( !(type & PGT_partial) )
page->nr_validated_ptes = L3_PAGETABLE_ENTRIES;
#endif
- rc = free_l3_table(page, preemptible);
- break;
+ return free_l3_table(page, preemptible);
case PGT_l4_page_table:
- rc = free_l4_table(page, preemptible);
- break;
- default:
- MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
- rc = -EINVAL;
- BUG();
+ return free_l4_table(page, preemptible);
}
+ MEM_LOG("type %lx pfn %lx\n", type, page_to_mfn(page));
+ BUG();
+ return -EINVAL;
+}
+
+
+static int __put_page_type_final(struct page_info *page, unsigned long type,
+ int preemptible)
+{
+ int rc = free_page_type(page, type, preemptible);
+
/* No need for atomic update of type_info here: noone else updates it. */
- if ( rc == 0 )
+ switch ( rc )
{
+ case 0:
/*
* Record TLB information for flush later. We do not stamp page tables
* when running in shadow mode:
@@ -2013,9 +2017,8 @@ int free_page_type(struct page_info *pag
page->tlbflush_timestamp = tlbflush_current_time();
wmb();
page->u.inuse.type_info--;
- }
- else if ( rc == -EINTR )
- {
+ break;
+ case -EINTR:
ASSERT(!(page->u.inuse.type_info &
(PGT_count_mask|PGT_validated|PGT_partial)));
if ( !(shadow_mode_enabled(page_get_owner(page)) &&
@@ -2023,12 +2026,13 @@ int free_page_type(struct page_info *pag
page->tlbflush_timestamp = tlbflush_current_time();
wmb();
page->u.inuse.type_info |= PGT_validated;
- }
- else
- {
- BUG_ON(rc != -EAGAIN);
+ break;
+ case -EAGAIN:
wmb();
page->u.inuse.type_info |= PGT_partial;
+ break;
+ default:
+ BUG();
}
return rc;
@@ -2062,7 +2066,7 @@ static int __put_page_type(struct page_i
x, nx)) != x) )
continue;
/* We cleared the 'valid bit' so we do the clean up. */
- return free_page_type(page, x, preemptible);
+ return __put_page_type_final(page, x, preemptible);
}
/*
++++++ x86-partial-page-ref.patch ++++++
-unstable staging c/s 18742+18747
- retain a page reference when PGT_partial is set on a page (and drop
it when clearing that flag)
- don't drop a page reference never acquired when freeing the page type
of a page where the allocation of the type got preempted (and never
completed)
- don't acquire a page reference when allocating the page type of a
page where freeing the type got preempted (and never completed, and
hence didn't drop the respective reference)
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1683,18 +1683,24 @@ static int relinquish_memory(
break;
case -EINTR:
page->u.inuse.type_info |= PGT_validated;
+ if ( x & PGT_partial )
+ put_page(page);
put_page(page);
ret = -EAGAIN;
goto out;
case -EAGAIN:
page->u.inuse.type_info |= PGT_partial;
- put_page(page);
+ if ( x & PGT_partial )
+ put_page(page);
goto out;
default:
BUG();
}
if ( x & PGT_partial )
+ {
page->u.inuse.type_info--;
+ put_page(page);
+ }
break;
}
}
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -566,19 +566,21 @@ static int get_page_from_pagenr(unsigned
static int get_page_and_type_from_pagenr(unsigned long page_nr,
unsigned long type,
struct domain *d,
+ int partial,
int preemptible)
{
struct page_info *page = mfn_to_page(page_nr);
int rc;
- if ( unlikely(!get_page_from_pagenr(page_nr, d)) )
+ if ( likely(partial >= 0) &&
+ unlikely(!get_page_from_pagenr(page_nr, d)) )
return -EINVAL;
rc = (preemptible ?
get_page_type_preemptible(page, type) :
(get_page_type(page, type) ? 0 : -EINVAL));
- if ( rc )
+ if ( unlikely(rc) && partial >= 0 )
put_page(page);
return rc;
@@ -761,7 +763,7 @@ get_page_from_l2e(
}
rc = get_page_and_type_from_pagenr(
- l2e_get_pfn(l2e), PGT_l1_page_table, d, 0);
+ l2e_get_pfn(l2e), PGT_l1_page_table, d, 0, 0);
if ( unlikely(rc == -EINVAL) && get_l2_linear_pagetable(l2e, pfn, d) )
rc = 0;
@@ -772,7 +774,7 @@ get_page_from_l2e(
define_get_linear_pagetable(l3);
static int
get_page_from_l3e(
- l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int preemptible)
+ l3_pgentry_t l3e, unsigned long pfn, struct domain *d, int partial, int preemptible)
{
int rc;
@@ -786,7 +788,7 @@ get_page_from_l3e(
}
rc = get_page_and_type_from_pagenr(
- l3e_get_pfn(l3e), PGT_l2_page_table, d, preemptible);
+ l3e_get_pfn(l3e), PGT_l2_page_table, d, partial, preemptible);
if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
rc = 0;
@@ -797,7 +799,7 @@ get_page_from_l3e(
define_get_linear_pagetable(l4);
static int
get_page_from_l4e(
- l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int preemptible)
+ l4_pgentry_t l4e, unsigned long pfn, struct domain *d, int partial, int preemptible)
{
int rc;
@@ -811,7 +813,7 @@ get_page_from_l4e(
}
rc = get_page_and_type_from_pagenr(
- l4e_get_pfn(l4e), PGT_l3_page_table, d, preemptible);
+ l4e_get_pfn(l4e), PGT_l3_page_table, d, partial, preemptible);
if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
rc = 0;
@@ -961,23 +963,32 @@ static int put_page_from_l2e(l2_pgentry_
return 1;
}
+static int __put_page_type(struct page_info *, int preemptible);
static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
- int preemptible)
+ int partial, int preemptible)
{
if ( (l3e_get_flags(l3e) & _PAGE_PRESENT) &&
(l3e_get_pfn(l3e) != pfn) )
+ {
+ if ( unlikely(partial > 0) )
+ return __put_page_type(l3e_get_page(l3e), preemptible);
return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+ }
return 1;
}
#if CONFIG_PAGING_LEVELS >= 4
static int put_page_from_l4e(l4_pgentry_t l4e, unsigned long pfn,
- int preemptible)
+ int partial, int preemptible)
{
if ( (l4e_get_flags(l4e) & _PAGE_PRESENT) &&
(l4e_get_pfn(l4e) != pfn) )
+ {
+ if ( unlikely(partial > 0) )
+ return __put_page_type(l4e_get_page(l4e), preemptible);
return put_page_and_type_preemptible(l4e_get_page(l4e), preemptible);
+ }
return 1;
}
#endif
@@ -1184,7 +1195,7 @@ static int alloc_l3_table(struct page_in
unsigned long pfn = page_to_mfn(page);
l3_pgentry_t *pl3e;
unsigned int i;
- int rc = 0;
+ int rc = 0, partial = page->partial_pte;
#if CONFIG_PAGING_LEVELS == 3
/*
@@ -1213,7 +1224,8 @@ static int alloc_l3_table(struct page_in
if ( is_pv_32on64_domain(d) )
memset(pl3e + 4, 0, (L3_PAGETABLE_ENTRIES - 4) * sizeof(*pl3e));
- for ( i = page->nr_validated_ptes; i < L3_PAGETABLE_ENTRIES; i++ )
+ for ( i = page->nr_validated_ptes; i < L3_PAGETABLE_ENTRIES;
+ i++, partial = 0 )
{
if ( is_pv_32bit_domain(d) && (i == 3) )
{
@@ -1224,16 +1236,17 @@ static int alloc_l3_table(struct page_in
rc = get_page_and_type_from_pagenr(l3e_get_pfn(pl3e[i]),
PGT_l2_page_table |
PGT_pae_xen_l2,
- d, preemptible);
+ d, partial, preemptible);
}
else if ( !is_guest_l3_slot(i) ||
- (rc = get_page_from_l3e(pl3e[i], pfn, d, preemptible)) > 0 )
+ (rc = get_page_from_l3e(pl3e[i], pfn, d,
+ partial, preemptible)) > 0 )
continue;
if ( rc == -EAGAIN )
{
page->nr_validated_ptes = i;
- page->partial_pte = 1;
+ page->partial_pte = partial ?: 1;
}
else if ( rc == -EINTR && i )
{
@@ -1257,7 +1270,7 @@ static int alloc_l3_table(struct page_in
if ( !is_guest_l3_slot(i) )
continue;
unadjust_guest_l3e(pl3e[i], d);
- put_page_from_l3e(pl3e[i], pfn, 0);
+ put_page_from_l3e(pl3e[i], pfn, 0, 0);
}
}
@@ -1272,18 +1285,20 @@ static int alloc_l4_table(struct page_in
unsigned long pfn = page_to_mfn(page);
l4_pgentry_t *pl4e = page_to_virt(page);
unsigned int i;
- int rc = 0;
+ int rc = 0, partial = page->partial_pte;
- for ( i = page->nr_validated_ptes; i < L4_PAGETABLE_ENTRIES; i++ )
+ for ( i = page->nr_validated_ptes; i < L4_PAGETABLE_ENTRIES;
+ i++, partial = 0 )
{
if ( !is_guest_l4_slot(d, i) ||
- (rc = get_page_from_l4e(pl4e[i], pfn, d, preemptible)) > 0 )
+ (rc = get_page_from_l4e(pl4e[i], pfn, d,
+ partial, preemptible)) > 0 )
continue;
if ( rc == -EAGAIN )
{
page->nr_validated_ptes = i;
- page->partial_pte = 1;
+ page->partial_pte = partial ?: 1;
}
else if ( rc == -EINTR )
{
@@ -1299,7 +1314,7 @@ static int alloc_l4_table(struct page_in
MEM_LOG("Failure in alloc_l4_table: entry %d", i);
while ( i-- > 0 )
if ( is_guest_l4_slot(d, i) )
- put_page_from_l4e(pl4e[i], pfn, 0);
+ put_page_from_l4e(pl4e[i], pfn, 0, 0);
}
if ( rc < 0 )
return rc;
@@ -1377,19 +1392,20 @@ static int free_l3_table(struct page_inf
struct domain *d = page_get_owner(page);
unsigned long pfn = page_to_mfn(page);
l3_pgentry_t *pl3e;
- unsigned int i = page->nr_validated_ptes - !page->partial_pte;
- int rc = 0;
+ int rc = 0, partial = page->partial_pte;
+ unsigned int i = page->nr_validated_ptes - !partial;
pl3e = map_domain_page(pfn);
do {
if ( is_guest_l3_slot(i) )
{
- rc = put_page_from_l3e(pl3e[i], pfn, preemptible);
+ rc = put_page_from_l3e(pl3e[i], pfn, partial, preemptible);
+ if ( rc < 0 )
+ break;
+ partial = 0;
if ( rc > 0 )
continue;
- if ( rc )
- break;
unadjust_guest_l3e(pl3e[i], d);
}
} while ( i-- );
@@ -1399,7 +1415,7 @@ static int free_l3_table(struct page_inf
if ( rc == -EAGAIN )
{
page->nr_validated_ptes = i;
- page->partial_pte = 1;
+ page->partial_pte = partial ?: -1;
}
else if ( rc == -EINTR && i < L3_PAGETABLE_ENTRIES - 1 )
{
@@ -1416,18 +1432,21 @@ static int free_l4_table(struct page_inf
struct domain *d = page_get_owner(page);
unsigned long pfn = page_to_mfn(page);
l4_pgentry_t *pl4e = page_to_virt(page);
- unsigned int i = page->nr_validated_ptes - !page->partial_pte;
- int rc = 0;
+ int rc = 0, partial = page->partial_pte;
+ unsigned int i = page->nr_validated_ptes - !partial;
do {
if ( is_guest_l4_slot(d, i) )
- rc = put_page_from_l4e(pl4e[i], pfn, preemptible);
- } while ( rc >= 0 && i-- );
+ rc = put_page_from_l4e(pl4e[i], pfn, partial, preemptible);
+ if ( rc < 0 )
+ break;
+ partial = 0;
+ } while ( i-- );
if ( rc == -EAGAIN )
{
page->nr_validated_ptes = i;
- page->partial_pte = 1;
+ page->partial_pte = partial ?: -1;
}
else if ( rc == -EINTR && i < L4_PAGETABLE_ENTRIES - 1 )
{
@@ -1703,7 +1722,7 @@ static int mod_l3_entry(l3_pgentry_t *pl
return rc ? 0 : -EFAULT;
}
- rc = get_page_from_l3e(nl3e, pfn, d, preemptible);
+ rc = get_page_from_l3e(nl3e, pfn, d, 0, preemptible);
if ( unlikely(rc < 0) )
return page_unlock(l3pg), rc;
rc = 0;
@@ -1732,7 +1751,7 @@ static int mod_l3_entry(l3_pgentry_t *pl
}
page_unlock(l3pg);
- put_page_from_l3e(ol3e, pfn, 0);
+ put_page_from_l3e(ol3e, pfn, 0, 0);
return rc;
}
@@ -1781,7 +1800,7 @@ static int mod_l4_entry(l4_pgentry_t *pl
return rc ? 0 : -EFAULT;
}
- rc = get_page_from_l4e(nl4e, pfn, d, preemptible);
+ rc = get_page_from_l4e(nl4e, pfn, d, 0, preemptible);
if ( unlikely(rc < 0) )
return page_unlock(l4pg), rc;
rc = 0;
@@ -1802,7 +1821,7 @@ static int mod_l4_entry(l4_pgentry_t *pl
}
page_unlock(l4pg);
- put_page_from_l4e(ol4e, pfn, 0);
+ put_page_from_l4e(ol4e, pfn, 0, 0);
return rc;
}
@@ -1837,7 +1856,8 @@ int get_page(struct page_info *page, str
nx = x + 1;
d = nd;
if ( unlikely((x & PGC_count_mask) == 0) || /* Not allocated? */
- unlikely((nx & PGC_count_mask) == 0) || /* Count overflow? */
+ /* Keep one spare reference to be acquired by get_page_light(). */
+ unlikely(((nx + 1) & PGC_count_mask) <= 1) || /* Overflow? */
unlikely(d != _domain) ) /* Wrong owner? */
{
if ( !_shadow_mode_refcounts(domain) && !domain->is_dying )
@@ -1859,6 +1879,28 @@ int get_page(struct page_info *page, str
return 1;
}
+/*
+ * Special version of get_page() to be used exclusively when
+ * - a page is known to already have a non-zero reference count
+ * - the page does not need its owner to be checked
+ * - it will not be called more than once without dropping the thus
+ * acquired reference again.
+ * Due to get_page() reserving one reference, this call cannot fail.
+ */
+static void get_page_light(struct page_info *page)
+{
+ u32 x, nx, y = page->count_info;
+
+ do {
+ x = y;
+ nx = x + 1;
+ BUG_ON(!(x & PGC_count_mask)); /* Not allocated? */
+ BUG_ON(!(nx & PGC_count_mask)); /* Overflow? */
+ y = cmpxchg(&page->count_info, x, nx);
+ }
+ while ( unlikely(y != x) );
+}
+
static int alloc_page_type(struct page_info *page, unsigned long type,
int preemptible)
@@ -1899,6 +1941,7 @@ static int alloc_page_type(struct page_i
wmb();
if ( rc == -EAGAIN )
{
+ get_page_light(page);
page->u.inuse.type_info |= PGT_partial;
}
else if ( rc == -EINTR )
@@ -2009,8 +2052,8 @@ static int __put_page_type_final(struct
page->u.inuse.type_info--;
break;
case -EINTR:
- ASSERT(!(page->u.inuse.type_info &
- (PGT_count_mask|PGT_validated|PGT_partial)));
+ ASSERT((page->u.inuse.type_info &
+ (PGT_count_mask|PGT_validated|PGT_partial)) == 1);
if ( !(shadow_mode_enabled(page_get_owner(page)) &&
(page->count_info & PGC_page_table)) )
page->tlbflush_timestamp = tlbflush_current_time();
@@ -2019,6 +2062,7 @@ static int __put_page_type_final(struct
break;
case -EAGAIN:
wmb();
+ get_page_light(page);
page->u.inuse.type_info |= PGT_partial;
break;
default:
@@ -2033,6 +2077,7 @@ static int __put_page_type(struct page_i
int preemptible)
{
unsigned long nx, x, y = page->u.inuse.type_info;
+ int rc = 0;
for ( ; ; )
{
@@ -2056,7 +2101,10 @@ static int __put_page_type(struct page_i
x, nx)) != x) )
continue;
/* We cleared the 'valid bit' so we do the clean up. */
- return __put_page_type_final(page, x, preemptible);
+ rc = __put_page_type_final(page, x, preemptible);
+ if ( x & PGT_partial )
+ put_page(page);
+ break;
}
/*
@@ -2078,7 +2126,7 @@ static int __put_page_type(struct page_i
return -EINTR;
}
- return 0;
+ return rc;
}
@@ -2086,6 +2134,7 @@ static int __get_page_type(struct page_i
int preemptible)
{
unsigned long nx, x, y = page->u.inuse.type_info;
+ int rc = 0;
ASSERT(!(type & ~(PGT_type_mask | PGT_pae_xen_l2)));
@@ -2208,10 +2257,13 @@ static int __get_page_type(struct page_i
page->nr_validated_ptes = 0;
page->partial_pte = 0;
}
- return alloc_page_type(page, type, preemptible);
+ rc = alloc_page_type(page, type, preemptible);
}
- return 0;
+ if ( (x & PGT_partial) && !(nx & PGT_partial) )
+ put_page(page);
+
+ return rc;
}
void put_page_type(struct page_info *page)
@@ -2290,7 +2342,7 @@ int new_guest_cr3(unsigned long mfn)
#endif
okay = paging_mode_refcounts(d)
? get_page_from_pagenr(mfn, d)
- : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0);
+ : !get_page_and_type_from_pagenr(mfn, PGT_root_page_table, d, 0, 0);
if ( unlikely(!okay) )
{
MEM_LOG("Error while installing new baseptr %lx", mfn);
@@ -2534,7 +2586,7 @@ int do_mmuext_op(
if ( paging_mode_refcounts(FOREIGNDOM) )
break;
- rc = get_page_and_type_from_pagenr(mfn, type, FOREIGNDOM, 1);
+ rc = get_page_and_type_from_pagenr(mfn, type, FOREIGNDOM, 0, 1);
okay = !rc;
if ( unlikely(!okay) )
{
@@ -2615,7 +2667,7 @@ int do_mmuext_op(
okay = get_page_from_pagenr(mfn, d);
else
okay = !get_page_and_type_from_pagenr(
- mfn, PGT_root_page_table, d, 0);
+ mfn, PGT_root_page_table, d, 0, 0);
if ( unlikely(!okay) )
{
MEM_LOG("Error while installing new mfn %lx", mfn);
@@ -2722,7 +2774,7 @@ int do_mmuext_op(
unsigned char *ptr;
okay = !get_page_and_type_from_pagenr(mfn, PGT_writable_page,
- FOREIGNDOM, 0);
+ FOREIGNDOM, 0, 0);
if ( unlikely(!okay) )
{
MEM_LOG("Error while clearing mfn %lx", mfn);
@@ -2755,7 +2807,7 @@ int do_mmuext_op(
}
okay = !get_page_and_type_from_pagenr(mfn, PGT_writable_page,
- FOREIGNDOM, 0);
+ FOREIGNDOM, 0, 0);
if ( unlikely(!okay) )
{
put_page(mfn_to_page(src_mfn));
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -61,12 +61,36 @@ struct page_info
/*
* When PGT_partial is true then this field is valid and indicates
* that PTEs in the range [0, @nr_validated_ptes) have been validated.
- * If @partial_pte is true then PTE at @nr_validated_ptes+1 has been
- * partially validated.
+ * An extra page reference must be acquired (or not dropped) whenever
+ * PGT_partial gets set, and it must be dropped when the flag gets
+ * cleared. This is so that a get() leaving a page in partially
+ * validated state (where the caller would drop the reference acquired
+ * due to the getting of the type [apparently] failing [-EAGAIN])
+ * would not accidentally result in a page left with zero general
+ * reference count, but non-zero type reference count (possible when
+ * the partial get() is followed immediately by domain destruction).
+ * Likewise, the ownership of the single type reference for partially
+ * (in-)validated pages is tied to this flag, i.e. the instance
+ * setting the flag must not drop that reference, whereas the instance
+ * clearing it will have to.
+ *
+ * If @partial_pte is positive then PTE at @nr_validated_ptes+1 has
+ * been partially validated. This implies that the general reference
+ * to the page (acquired from get_page_from_lNe()) would be dropped
+ * (again due to the apparent failure) and hence must be re-acquired
+ * when resuming the validation, but must not be dropped when picking
+ * up the page for invalidation.
+ *
+ * If @partial_pte is negative then PTE at @nr_validated_ptes+1 has
+ * been partially invalidated. This is basically the opposite case of
+ * above, i.e. the general reference to the page was not dropped in
+ * put_page_from_lNe() (due to the apparent failure), and hence it
+ * must be dropped when the put operation is resumed (and completes),
+ * but it must not be acquired if picking up the page for validation.
*/
struct {
u16 nr_validated_ptes;
- bool_t partial_pte;
+ s8 partial_pte;
};
/*
++++++ x86-show-page-walk-early.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:17.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:17.000000000 +0100
@@ -2,7 +2,7 @@
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/traps.c
+++ xen-3.3.1-testing/xen/arch/x86/traps.c
-@@ -1265,6 +1265,7 @@ asmlinkage void do_early_page_fault(stru
+@@ -1266,6 +1266,7 @@ asmlinkage void do_early_page_fault(stru
unsigned long *stk = (unsigned long *)regs;
printk("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n",
regs->cs, _p(regs->eip), _p(cr2), regs->error_code);
++++++ xen-3.3.1-testing-src.tar.bz2 ++++++
arch/i386/xen/xen-3.3.1-testing-src.tar.bz2 /mounts/work_src_done/STABLE/xen/xen-3.3.1-testing-src.tar.bz2 differ: byte 11, line 1
++++++ xend-domain-lock.patch ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:17.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:17.000000000 +0100
@@ -2,21 +2,19 @@
===================================================================
--- /dev/null
+++ xen-3.3.1-testing/tools/examples/domain-lock
-@@ -0,0 +1,86 @@
+@@ -0,0 +1,83 @@
+#!/bin/bash
+
-+set +x
-+
+usage() {
-+ echo "usage: domain-lock [-l|-u|-s] -p <vm-config-path> [-n <vm-name>] [-i <vm-uuid>] [-h <vm-host>]"
++ echo "usage: domain-lock [-l|-u|-s] [-n <vm name>] [-i <vm uuid>] [-p <physical host>] path"
+ echo ""
-+ echo "-l lock"
-+ echo "-u unlock"
-+ echo "-s status (default)"
-+ echo "-p Required argument indicating path for lock file"
-+ echo "-n Virtual Machine name"
-+ echo "-i Virtual Machine Id or UUID"
-+ echo "-h Virtual Machine Server (Host) name"
++ echo "-l lock"
++ echo "-u unlock"
++ echo "-s status (default)"
++ echo "-n Virtual Machine name"
++ echo "-i Virtual Machine Id or UUID"
++ echo "-p Virtual Machine Server (physical host) name"
++ echo "path A per-VM, unique location where external lock will be managed"
+ exit 1
+}
+
@@ -47,7 +45,7 @@
+
+mode="status"
+
-+while getopts ":lusp:n:i:h:" opt; do
++while getopts ":lusn:i:p:" opt; do
+ case $opt in
+ l )
+ mode="lock"
@@ -59,7 +57,7 @@
+ mode="status"
+ ;;
+ p )
-+ vm_path=$OPTARG
++ vm_host=$OPTARG
+ ;;
+ n )
+ vm_name=$OPTARG
@@ -67,15 +65,14 @@
+ i )
+ vm_uuid=$OPTARG
+ ;;
-+ h )
-+ vm_host=$OPTARG
-+ ;;
+ \? )
+ usage
+ ;;
+ esac
+done
+
++shift $(($OPTIND - 1))
++vm_path=$1
+[ -z $vm_path ] && usage
+
+case $mode in
@@ -93,17 +90,20 @@
===================================================================
--- xen-3.3.1-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.3.1-testing/tools/examples/xend-config.sxp
-@@ -255,4 +255,44 @@
+@@ -255,4 +255,46 @@
# Path where persistent domain configuration is stored.
# Default is /var/lib/xend/domains/
+#
#(xend-domains-path /var/lib/xend/domains)
+
-+# Create a lock file when domains are started. Lock file is
-+# placed in xend-domains-path/ on domain startup
-+# and removed when domain is stopped. By default, a lock file
++# Create an external lock file when domains are started. Lock
++# file is placed in xend-domains-lock-path/ on domain
++# startup and removed when domain is stopped. By default, a lock file
+# is not created. Set to yes to enable lock file creation.
++# Note that external locking mechanisms are no substitute for a cluster
++# environment that protects shared resources, but may be useful in
++# some circumstances nonetheless.
+#
+#(xend-domain-lock no)
+
@@ -118,20 +118,19 @@
+# External locking utility for acquiring/releasing domain lock.
+# By default /etc/xen/scripts/domain-lock will be used if
+# xend-domain-lock is set to yes. Set to path of custom
-+# locking utility to override the default. Locking utility
-+# should accept
-+# <-l | -u | -s> -p <vm-config-path> [-n <vm-name>] [-i <vm-id>]
-+# [-h <vm-host>]
-+# command line options. Utility should return zero on success,
-+# non-zero on error.
++# locking utility to override the default. Synopsis:
++#
++# lock-util <-l | -u | -s> [-n <vm-name>] [-i <vm-id>] [-p <phy-host>] path
++#
++# Utility should return zero on success, non-zero on error.
+# -l lock Acquire (create) lock file
+# -u unlock Remove lock file
+# -s status Default action. If lock file exists, print contents on
+# stdout and return 0)
-+# -p path Required. Path where lock file should be written.
++# -p phy-host Name of physical host (dom0)
+# -n vm-name Name of domain
+# -i vm-id Id or UUID of domain
-+# -h vm-host Name of host machine (dom0)
++# path A unique location for external lock must be specified
+#
+# The /etc/xen/scripts/domain-lock default utility will create
+# <xend-domain-lock-path>/<vm-uuid>/lock and write <vm-name>, <vm-id>,
@@ -191,7 +190,7 @@
+ # Check if domain has a lock file present
+ def is_dom_locked(self, path):
-+ status = os.system('%s -s -p %s' % \
++ status = os.system('%s -s %s' % \
+ (xoptions.get_xend_domain_lock_utility(), \
+ path))
+
@@ -201,15 +200,15 @@
+ # entry in the lock file.
+ def get_lock_host(self, path):
+ fin = os.popen(xoptions.get_xend_domain_lock_utility() + \
-+ ' -s -p ' + path, 'r')
++ ' -s ' + path, 'r')
+ hostname = "unknown"
+
+ try:
+ line = fin.readline()
+ hostname = line.split()[-1]
++ return hostname
+ finally:
+ fin.close()
-+ return hostname
+
+ # Acquire a lock for the domain. No-op if domain locking is turned off.
+ def acquire_running_lock(self):
@@ -229,12 +228,12 @@
+ log.exception("%s could not be created." % path)
+ raise XendError("%s could not be created." % path)
+
-+ status = os.system('%s -l -p %s -n %s -i %s -h %s' % \
++ status = os.system('%s -l -p %s -n %s -i %s %s' % \
+ (xoptions.get_xend_domain_lock_utility(), \
-+ path, \
++ XendNode.instance().get_name(), \
+ self.info['name_label'], \
+ self.info['uuid'], \
-+ XendNode.instance().get_name()))
++ path))
+ if status != 0:
+ raise XendError('Acquire running lock failed: %s' % status)
+
@@ -245,7 +244,7 @@
+
+ path = xoptions.get_xend_domain_lock_path()
+ path = os.path.join(path, self.get_uuid())
-+ status = os.system('%s -u -p %s' % \
++ status = os.system('%s -u %s' % \
+ (xoptions.get_xend_domain_lock_utility(), \
+ path))
+ if status != 0:
++++++ xen-destdir.diff ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:17.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:17.000000000 +0100
@@ -177,16 +177,3 @@
$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
-Index: xen-3.3.1-testing/tools/misc/Makefile
-===================================================================
---- xen-3.3.1-testing.orig/tools/misc/Makefile
-+++ xen-3.3.1-testing/tools/misc/Makefile
-@@ -19,7 +19,7 @@ SUBDIRS-$(CONFIG_MINITERM) += miniterm
- SUBDIRS := $(SUBDIRS-y)
-
- INSTALL_BIN = $(TARGETS) xencons
--INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xenperf xsview
-+INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xsview
-
- DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path)
- PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH)
++++++ xen-no-dummy-nfs-ip.diff ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:18.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:18.000000000 +0100
@@ -2,7 +2,7 @@
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.1-testing/tools/python/xen/xm/create.py
-@@ -1073,9 +1073,8 @@ def preprocess_access_control(vals):
+@@ -1081,9 +1081,8 @@ def preprocess_access_control(vals):
def preprocess_ip(vals):
if vals.ip or vals.dhcp != 'off':
++++++ xen-tightvnc-args.diff ++++++
--- /var/tmp/diff_new_pack.t11715/_old 2008-11-08 20:31:18.000000000 +0100
+++ /var/tmp/diff_new_pack.t11715/_new 2008-11-08 20:31:18.000000000 +0100
@@ -2,7 +2,7 @@
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.1-testing/tools/python/xen/xm/create.py
-@@ -1129,8 +1129,7 @@ def spawn_vnc(display):
+@@ -1137,8 +1137,7 @@ def spawn_vnc(display):
returns the port that the vncviewer is listening on and sets the global
vncpid. On failure, returns 0. Note that vncviewer is daemonized.
"""
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org