openSUSE Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
October 2011
- 1 participants
- 1929 discussions
Hello community,
here is the log from the commit of package flashrom for openSUSE:Factory checked in at 2011-10-29 08:00:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/flashrom (Old)
and /work/SRC/openSUSE:Factory/.flashrom.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "flashrom", Maintainer is "BWalle(a)novell.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/flashrom/flashrom.changes 2011-10-16 12:44:04.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.flashrom.new/flashrom.changes 2011-10-29 08:00:14.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Oct 28 21:59:50 CLST 2011 - crrodriguez(a)opensuse.org
+
+- update to 0.9.4 r1457.
+ * Mark several new boards as supported/unsupported
+
+-------------------------------------------------------------------
Old:
----
flashrom-0.9.4_r1450.tar.bz2
New:
----
flashrom-0.9.4_r1457.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ flashrom.spec ++++++
--- /var/tmp/diff_new_pack.HptQ37/_old 2011-10-29 08:00:16.000000000 +0200
+++ /var/tmp/diff_new_pack.HptQ37/_new 2011-10-29 08:00:16.000000000 +0200
@@ -20,7 +20,7 @@
Name: flashrom
Url: http://coreboot.org/
Summary: A universal flash programming utility
-Version: 0.9.4_r1450
+Version: 0.9.4_r1457
Release: 1
License: GPLv2 ; GPLv2+
Group: Development/Tools/Other
++++++ flashrom-0.9.4_r1450.tar.bz2 -> flashrom-0.9.4_r1457.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/ChangeLog new/flashrom-0.9.4_r1457/ChangeLog
--- old/flashrom-0.9.4_r1450/ChangeLog 2011-10-14 05:02:54.000000000 +0200
+++ new/flashrom-0.9.4_r1457/ChangeLog 2011-10-29 02:59:50.000000000 +0200
@@ -1,4 +1,259 @@
------------------------------------------------------------------------
+r1457 | stefanct | 2011-10-22 19:01:09 -0300 (Sat, 22 Oct 2011) | 58 lines
+
+Fix all ASUS P5GD* board enables
+
+Changes related to P5GD1 variants:
+- Reorder "P5GD1 Pro" in print.c and include a DMI patter to its board enable
+- Add an untested "P5GD1(-VM)" board enable and add an entry to print.c
+- Add P5GD1-VM/S variant as reported by "Limer"
+
+Changes related to P5GD(2/C) variants:
+- Fix the name of "P5GDC-V Deluxe" board enable and add a DMI pattern and
+ print.c entry. NB: there is no "P5GDC-V" board.
+- Add a generic match for P5GD(2/C)* boards with a not tested tag.
+ This are the potential targets for this according to the asus ftp:
+ ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/
+ Unsupported variants of the P5GD2:
+ P5GD2, P5GD2 Deluxe, P5GD2 Pro, P5GD2-X
+ (P5GD2 Premium is already tested)
+ (there seems to be also a P5GD2-TVM/GB/SI in the wild, which is not known to
+ asus :)
+ Unsupported variants of the P5GDC:
+ P5GDC Pro, P5GDC-MX
+ (P5GDC Deluxe and P5GDC-V Deluxe are already tested)
+
+ References:
+P5GD1 PRO (dmi "P5GD1 PRO")
+ smbus: 0x8086, 0x266a, 0x1043, 0x80a6; audio: 0x8086, 0x2668, 0x1043, *0x814e*
+ http://www.coreboot.org/pipermail/flashrom/2010-August/004539.html
+P5GD1 (dmi "P5GD1")
+ The non-pro version seems to match the pro pci pattern, but could be
+ distinguished by the SATA ID of 1043:2604 vs. 1043:2601:
+ https://launchpadlibrarian.net/62167576/Lspci.txt
+ or a DMI pattern of course.
+P5GD1-VM (dmi "P5GD1-VM")
+ This does also match the current PCI IDs.
+ https://bugs.launchpad.net/ubuntu/+source/linux/+bug/465379
+
+- P5GD2 Premium (dmi "P5GD2-Premium")
+ smbus: 0x8086, 0x266a, 0x1043, 0x80a6; audio: 0x8086, 0x2668, 0x1043, 0x813d
+ http://www.flashrom.org/pipermail/flashrom/2010-August/004555.html
+- P5GDC-V Deluxe (dmi "P5GDC-V")
+ smbus: 0x8086, 0x266a, 0x1043, 0x80a6; audio: 0x8086, 0x2668, 0x1043, 0x813d
+ http://www.flashrom.org/pipermail/flashrom/2010-September/004939.html
+- P5GDC Deluxe (dmi "P5GDC")
+ smbus: 0x8086, 0x266a, 0x1043, 0x80a6; audio: 0x8086, 0x2668, 0x1043, 0x813d
+ http://www.flashrom.org/pipermail/flashrom/2010-September/004684.html
+
+- P5GDC Pro, P5GDC-MX, P5GD2-X, P5GD2 Pro, P5GD2
+ no useful logs found
+- P5GD2-Deluxe (dmi "P5GD2-Deluxe")
+ smbus: 0x8086, 0x266a, 0x1043, 0x80a6; audio: 0x8086, 0x2668, 0x1043, 0x813d
+ https://bugs.launchpad.net/ubuntu/+source/foomatic-filters/+bug/572514
+
+- P5GD2-TVM/GB/SI (dmi "P5GD2-TVM/GB/SI")
+ smbus: 0x8086, 0x266a, 0x1043, 0x266a; audio: 0x8086, 0x2668, 0x1043, *0x81a7*
+ https://bugs.launchpad.net/ubuntu/+source/linux/+bug/462500
+
+Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+and due to the tremendous interest... ;)
+Acked-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+------------------------------------------------------------------------
+r1456 | stefanct | 2011-10-22 18:45:27 -0300 (Sat, 22 Oct 2011) | 8 lines
+
+serprog: small improvements
+
+- rename serprog_delay parameter to usecs
+- fix code style, (output) formatting issues and comments
+- sp_docommand: remove unnecessary malloc+memcpy and fix formatting
+
+Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+Acked-by: Uwe Hermann <uwe(a)hermann-uwe.de>
+------------------------------------------------------------------------
+r1455 | stefanct | 2011-10-21 10:20:11 -0300 (Fri, 21 Oct 2011) | 13 lines
+
+Add board enable for ABIT AV8
+
+I disassembled the write enable and the write disable functions from
+the Award BIOS image and reconstructed C code to understand for
+myself what happens. For details see:
+http://www.flashrom.org/pipermail/flashrom/2011-October/008033.html
+
+I compared the download pages of both, abit AV8 and abit AV8-3rd Eye,
+and the BIOS downloads are the same. So it's save to assume that this
+board enable works on both versions. Tested on AV8.
+
+Signed-off-by: Christoph Grenz <christophg+cb(a)grenz-bonn.de>
+Acked-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+------------------------------------------------------------------------
+r1454 | stefanct | 2011-10-21 09:33:07 -0300 (Fri, 21 Oct 2011) | 87 lines
+
+Add a bunch of new/tested stuff and various small changes 8
+
+Tested mainboards:
+OK:
+- ASUS Crosshair II Formula
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007888.html
+- ASUS K8N
+ http://paste.flashrom.org/view.php?id=856
+- ASUS M2N-E SLI
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007909.html
+- ASUS M3N78-VM
+ http://www.flashrom.org/pipermail/flashrom/2011-May/006496.html
+- ASUS M4A78LT-M LE
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007869.html
+- ASUS M4A89GTD PRO
+ http://www.flashrom.org/pipermail/flashrom/2011-February/005824.html
+- MSI A75MA-G55 (MS-7696)
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008055.html
+- PCCHIPS M598LMR (V9.0)
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008051.html
+- ECS P4VXMS (V1.0A)
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007986.html
+- Foxconn P4M800P7MA-RS2
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008114.html
+- GIGABYTE GA-P67A-UD3P
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007930.html
+- GIGABYTE Z68MX-UD2H-B
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008080.html
+- ZOTAC Fusion-ITX WiFi (FUSION350-A-E)
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008011.html
+NOT OK:
+- ASUS P8B-E/4L
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008047.html
+- ASUS P8B WS
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008081.html
+
+Tested chipsets:
+- MCP78S (:075d)
+ http://www.flashrom.org/pipermail/flashrom/2011-August/007612.html
+- VT8233 (:3074)
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007986.html
+- SiS 530 (:0530)
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008051.html
+- P67 (:1c46)
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007930.html
+ - Z68 (:1c44)
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008080.html
+
+Tested flash chips:
+- mark AMIC A29002T as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008085.html
+- mark Eon EN29F002(A)(N)T as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008053.html
+- mark EonEN25F16 as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-February/005824.html
+- mark Macronix MX29F002(N)T as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008083.html
+- mark Pm39LV040 as TEST_OK_PR
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007942.html
+- mark Pm39LV010 as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007942.html
+- mark SST49LF008A as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-September/007989.html
+- mark SyncMOS {F,S,V}29C51002T as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008052.html
+- mark W39V040B as write tested
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008114.html
+- mark W39V040C as TEST_OK_PREW
+ http://www.flashrom.org/pipermail/flashrom/2011-October/008114.html
+
+- remove superfluous line break in enable_flash_ich_dc_spi
+- m->M in "min" and "max" (voltage) in print_wiki.c
+
+- spi25: get rid of unneccessary line breaks (on failed probes)
+which is
+Acked-by: Uwe Hermann <uwe(a)hermann-uwe.de>
+
+- rayer_spi.c: Remove double word: `s/the the/the/`
+which is
+Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
+
+The parts added until 2011-10-14 (most of this patch) were
+Acked-by: Uwe Hermann <uwe(a)hermann-uwe.de>
+
+everything else is
+Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+Acked-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+------------------------------------------------------------------------
+r1453 | uwe | 2011-10-20 20:14:10 -0300 (Thu, 20 Oct 2011) | 33 lines
+
+Add support for the GOEPEL PicoTAP programmer.
+
+http://www.goepel.com/en/jtagboundary-scan/hardware/picotap.html
+
+This device is actually a JTAG adapter, but since it uses standard
+FT2232 A interface pins, it can be easily used as SPI programmer
+(tested it here successfully). PicoTAP supports only 5V output, so one
+needs to reduce this to 3.3V in a same manner as DLP Design DLP-USB1232H, see
+
+ http://flashrom.org/FT2232SPI_Programmer#DLP_Design_DLP-USB1232H
+
+for details.
+
+The PicoTAP pin-out is as follows:
+
+ PicoTAP | SPI
+ ---------+-------
+ TCK | SCLK
+ TMS | CS#
+ TDI | SO
+ TDO | SI
+ /TRST | -
+ GND | GND
+ +5V | VCC, HOLD# & WP# after 3.3V regulator
+
+I managed to run PicoTAP in 10MHz, 15MHz and 30MHz modes (by forcing
+DIVIDE_BY), against SST25VF016B SPI flash, read/write/erase all worked
+fine (write seems somewhat slow).
+
+Signed-off-by: Samir Ibrad?\197?\190i?\196?\135 <sibradzic(a)gmail.com>
+Acked-by: Uwe Hermann <uwe(a)hermann-uwe.de>
+
+
+------------------------------------------------------------------------
+r1452 | stefanct | 2011-10-20 09:57:14 -0300 (Thu, 20 Oct 2011) | 7 lines
+
+ichspi: add (partially) dead support code for Intel Hardware Sequencing
+
+This was done to ease the review. Another patch will hook up (and
+explain) this code later.
+
+Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
+------------------------------------------------------------------------
+r1451 | uwe | 2011-10-14 17:33:14 -0300 (Fri, 14 Oct 2011) | 28 lines
+
+TIAO/DIYGADGET USB Multi-Protocol Adapter (TUMPA) support.
+
+Thanks to TIAO/DIYGADGET for sponsoring a test device!
+
+This is an FTDI FT2232H based device which provides an easily accessible JTAG,
+SPI, I2C, serial breakout. The SPI part can be used to flash SPI flash chips
+using flashrom.
+
+http://www.diygadget.com/tiao-usb-multi-protocol-adapter-jtag-spi-i2c-serial.html
+http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User%27s_Manual#SPI_Connector_1
+
+There are two SPI connectors (pin headers) on the board: SPI1, which is
+connected to the FT2232H's A interface, and SPI2, which is connected to the
+chip's B interface. Both can be used to flash SPI chips:
+
+ flashrom -p ft2232_spi:type=tumpa,port=A
+ flashrom -p ft2232_spi:type=tumpa,port=B
+
+The default interface is A, so for SPI1 you can also just write:
+
+ flashrom -p ft2232_spi:type=tumpa
+
+I tested all operations on both interfaces, everything works fine.
+
+Signed-off-by: Uwe Hermann <uwe(a)hermann-uwe.de>
+Acked-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
+
+
+------------------------------------------------------------------------
r1450 | stefanct | 2011-09-18 19:42:18 -0300 (Sun, 18 Sep 2011) | 17 lines
Revert "Unsignify lengths and addresses in chip functions and structs"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/Makefile new/flashrom-0.9.4_r1457/Makefile
--- old/flashrom-0.9.4_r1450/Makefile 2011-10-14 05:02:48.000000000 +0200
+++ new/flashrom-0.9.4_r1457/Makefile 2011-10-29 02:59:44.000000000 +0200
@@ -256,7 +256,7 @@
# of the checked out flashrom files.
# Note to packagers: Any tree exported with "make export" or "make tarball"
# will not require subversion. The downloadable snapshots are already exported.
-SVNVERSION := 1450
+SVNVERSION := 1457
RELEASE := 0.9.4
VERSION := $(RELEASE)-r$(SVNVERSION)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/board_enable.c new/flashrom-0.9.4_r1457/board_enable.c
--- old/flashrom-0.9.4_r1450/board_enable.c 2011-09-03 13:22:27.000000000 +0200
+++ new/flashrom-0.9.4_r1457/board_enable.c 2011-10-23 00:01:09.000000000 +0200
@@ -1830,6 +1830,22 @@
/*
* Suited for:
+ * - abit AV8: Socket939 + K8T800Pro + VT8237
+ */
+static int board_abit_av8(void)
+{
+ uint8_t val;
+
+ /* Raise GPO pins GP22 & GP23 */
+ val = INB(0x404E);
+ val |= 0xC0;
+ OUTB(val, 0x404E);
+
+ return 0;
+}
+
+/*
+ * Suited for:
* - ASUS A7V333: VIA KT333 + VT8233A + IT8703F
* - ASUS A7V8X: VIA KT400 + VT8235 + IT8703F
*/
@@ -1979,6 +1995,7 @@
/* first pci-id set [4], second pci-id set [4], dmi identifier, coreboot id [2], phase, vendor name, board name max_rom_... OK? flash enable */
#if defined(__i386__) || defined(__x86_64__)
{0x10DE, 0x0547, 0x147B, 0x1C2F, 0x10DE, 0x0548, 0x147B, 0x1C2F, NULL, NULL, NULL, P3, "abit", "AN-M2", 0, NT, nvidia_mcp_gpio2_raise},
+ {0x1106, 0x0282, 0x147B, 0x1415, 0x1106, 0x3227, 0x147B, 0x1415, "^AV8 ", NULL, NULL, P3, "abit", "AV8", 0, OK, board_abit_av8},
{0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, "^i440BX-W977 (BM6)$", NULL, NULL, P3, "abit", "BM6", 0, OK, intel_piix4_gpo26_lower},
{0x8086, 0x24d3, 0x147b, 0x1014, 0x8086, 0x2578, 0x147b, 0x1014, NULL, NULL, NULL, P3, "abit", "IC7", 0, NT, intel_ich_gpio23_raise},
{0x8086, 0x2930, 0x147b, 0x1084, 0x11ab, 0x4364, 0x147b, 0x1084, NULL, NULL, NULL, P3, "abit", "IP35", 0, OK, intel_ich_gpio16_raise},
@@ -2024,9 +2041,13 @@
{0x8086, 0x2570, 0x1043, 0x80A5, 0x105A, 0x24D3, 0x1043, 0x80A6, NULL, NULL, NULL, P3, "ASUS", "P4SD-LA", 0, NT, intel_ich_gpio32_raise},
{0x1039, 0x0661, 0x1043, 0x8113, 0x1039, 0x5513, 0x1043, 0x8087, NULL, NULL, NULL, P3, "ASUS", "P4S800-MX", 512, OK, w836xx_memw_enable_2e},
{0x10B9, 0x1541, 0, 0, 0x10B9, 0x1533, 0, 0, "^P5A$", "asus", "p5a", P3, "ASUS", "P5A", 0, OK, board_asus_p5a},
- {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x814e, NULL, NULL, NULL, P3, "ASUS", "P5GD1 Pro", 0, OK, intel_ich_gpio21_raise},
+ {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x814e, "^P5GD1 PRO$", NULL, NULL, P3, "ASUS", "P5GD1 Pro", 0, OK, intel_ich_gpio21_raise},
+ {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x814e, "^P5GD1-VM$", NULL, NULL, P3, "ASUS", "P5GD1-VM/S", 0, OK, intel_ich_gpio21_raise},
+ {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x814e, NULL, NULL, NULL, P3, "ASUS", "P5GD1(-VM)", 0, NT, intel_ich_gpio21_raise},
{0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x813d, "^P5GD2-Premium$", NULL, NULL, P3, "ASUS", "P5GD2 Premium", 0, OK, intel_ich_gpio21_raise},
- {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x813d, NULL, NULL, NULL, P3, "ASUS", "P5GDC Deluxe", 0, OK, intel_ich_gpio21_raise},
+ {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x813d, "^P5GDC-V$", NULL, NULL, P3, "ASUS", "P5GDC-V Deluxe", 0, OK, intel_ich_gpio21_raise},
+ {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x813d, "^P5GDC$", NULL, NULL, P3, "ASUS", "P5GDC Deluxe", 0, OK, intel_ich_gpio21_raise},
+ {0x8086, 0x266a, 0x1043, 0x80a6, 0x8086, 0x2668, 0x1043, 0x813d, NULL, NULL, NULL, P3, "ASUS", "P5GD2/C variants", 0, NT, intel_ich_gpio21_raise},
{0x8086, 0x27b8, 0x103c, 0x2a22, 0x8086, 0x2770, 0x103c, 0x2a22, "^LITHIUM$", NULL, NULL, P3, "ASUS", "P5LP-LE (Lithium-UL8E)",0, OK, intel_ich_gpio34_raise},
{0x8086, 0x27b8, 0x1043, 0x2a22, 0x8086, 0x2770, 0x1043, 0x2a22, "^P5LP-LE$", NULL, NULL, P3, "ASUS", "P5LP-LE (Epson OEM)", 0, OK, intel_ich_gpio34_raise},
{0x8086, 0x27da, 0x1043, 0x8179, 0x8086, 0x27b8, 0x1043, 0x8179, "^P5LD2$", NULL, NULL, P3, "ASUS", "P5LD2", 0, NT, intel_ich_gpio16_raise},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/chipset_enable.c new/flashrom-0.9.4_r1457/chipset_enable.c
--- old/flashrom-0.9.4_r1450/chipset_enable.c 2011-09-09 14:46:32.000000000 +0200
+++ new/flashrom-0.9.4_r1457/chipset_enable.c 2011-10-21 14:33:07.000000000 +0200
@@ -536,7 +536,7 @@
/* Get physical address of Root Complex Register Block */
tmp = pci_read_long(dev, 0xf0) & 0xffffc000;
- msg_pdbg("\nRoot Complex Register Block address = 0x%x\n", tmp);
+ msg_pdbg("Root Complex Register Block address = 0x%x\n", tmp);
/* Map RCBA to virtual memory */
rcrb = physmap("ICH RCRB", tmp, 0x4000);
@@ -1138,7 +1138,7 @@
{0x1022, 0x780e, OK, "AMD", "Hudson", enable_flash_sb600},
{0x1039, 0x0406, NT, "SiS", "501/5101/5501", enable_flash_sis501},
{0x1039, 0x0496, NT, "SiS", "85C496+497", enable_flash_sis85c496},
- {0x1039, 0x0530, NT, "SiS", "530", enable_flash_sis530},
+ {0x1039, 0x0530, OK, "SiS", "530", enable_flash_sis530},
{0x1039, 0x0540, NT, "SiS", "540", enable_flash_sis540},
{0x1039, 0x0620, NT, "SiS", "620", enable_flash_sis530},
{0x1039, 0x0630, NT, "SiS", "630", enable_flash_sis540},
@@ -1205,7 +1205,7 @@
{0x10de, 0x0443, NT, "NVIDIA", "MCP65", enable_flash_mcp6x_7x},
{0x10de, 0x0548, OK, "NVIDIA", "MCP67", enable_flash_mcp6x_7x},
{0x10de, 0x075c, NT, "NVIDIA", "MCP78S", enable_flash_mcp6x_7x},
- {0x10de, 0x075d, NT, "NVIDIA", "MCP78S", enable_flash_mcp6x_7x},
+ {0x10de, 0x075d, OK, "NVIDIA", "MCP78S", enable_flash_mcp6x_7x},
{0x10de, 0x07d7, NT, "NVIDIA", "MCP73", enable_flash_mcp6x_7x},
{0x10de, 0x0aac, NT, "NVIDIA", "MCP79", enable_flash_mcp6x_7x},
{0x10de, 0x0aad, NT, "NVIDIA", "MCP79", enable_flash_mcp6x_7x},
@@ -1222,7 +1222,7 @@
{0x1106, 0x0586, OK, "VIA", "VT82C586A/B", enable_flash_amd8111},
{0x1106, 0x0596, OK, "VIA", "VT82C596", enable_flash_amd8111},
{0x1106, 0x0686, NT, "VIA", "VT82C686A/B", enable_flash_amd8111},
- {0x1106, 0x3074, NT, "VIA", "VT8233", enable_flash_vt823x},
+ {0x1106, 0x3074, OK, "VIA", "VT8233", enable_flash_vt823x},
{0x1106, 0x3147, OK, "VIA", "VT8233A", enable_flash_vt823x},
{0x1106, 0x3177, OK, "VIA", "VT8235", enable_flash_vt823x},
{0x1106, 0x3227, OK, "VIA", "VT8237", enable_flash_vt823x},
@@ -1236,8 +1236,8 @@
{0x1166, 0x0205, OK, "Broadcom", "HT-1000", enable_flash_ht1000},
{0x8086, 0x122e, OK, "Intel", "PIIX", enable_flash_piix4},
{0x8086, 0x1234, NT, "Intel", "MPIIX", enable_flash_piix4},
- {0x8086, 0x1c44, NT, "Intel", "Z68", enable_flash_pch6},
- {0x8086, 0x1c46, NT, "Intel", "P67", enable_flash_pch6},
+ {0x8086, 0x1c44, OK, "Intel", "Z68", enable_flash_pch6},
+ {0x8086, 0x1c46, OK, "Intel", "P67", enable_flash_pch6},
{0x8086, 0x1c47, NT, "Intel", "UM67", enable_flash_pch6},
{0x8086, 0x1c49, NT, "Intel", "HM65", enable_flash_pch6},
{0x8086, 0x1c4a, OK, "Intel", "H67", enable_flash_pch6},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/flashchips.c new/flashrom-0.9.4_r1457/flashchips.c
--- old/flashrom-0.9.4_r1450/flashchips.c 2011-09-14 00:05:44.000000000 +0200
+++ new/flashrom-0.9.4_r1457/flashchips.c 2011-10-21 14:33:07.000000000 +0200
@@ -1229,7 +1229,7 @@
.total_size = 256,
.page_size = 64 * 1024,
.feature_bits = FEATURE_ADDR_2AA | FEATURE_SHORT_RESET,
- .tested = TEST_OK_PR,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO,
.block_erasers =
@@ -3169,7 +3169,7 @@
.total_size = 2048,
.page_size = 256,
.feature_bits = FEATURE_WRSR_WREN,
- .tested = TEST_UNTESTED,
+ .tested = TEST_OK_PREW,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
.block_erasers =
@@ -3550,7 +3550,7 @@
.total_size = 256,
.page_size = 256,
.feature_bits = FEATURE_ADDR_AAA | FEATURE_EITHER_RESET,
- .tested = TEST_OK_PR,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
.block_erasers =
@@ -4587,7 +4587,7 @@
.total_size = 256,
.page_size = 64 * 1024,
.feature_bits = FEATURE_ADDR_2AA | FEATURE_SHORT_RESET,
- .tested = TEST_OK_PR,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO,
.block_erasers =
@@ -5268,7 +5268,7 @@
.total_size = 128,
.page_size = 4096,
.feature_bits = FEATURE_ADDR_2AA | FEATURE_EITHER_RESET,
- .tested = TEST_OK_PRE,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
.block_erasers =
@@ -5328,7 +5328,7 @@
.total_size = 512,
.page_size = 4096,
.feature_bits = FEATURE_ADDR_2AA | FEATURE_EITHER_RESET,
- .tested = TEST_UNTESTED,
+ .tested = TEST_OK_PR,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
.block_erasers =
@@ -6482,7 +6482,7 @@
.total_size = 1024,
.page_size = 64 * 1024,
.feature_bits = FEATURE_REGISTERMAP | FEATURE_EITHER_RESET,
- .tested = TEST_OK_PRE,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
.probe_timing = 1, /* 150 ns */
.block_erasers =
@@ -7763,7 +7763,7 @@
.total_size = 256,
.page_size = 512,
.feature_bits = FEATURE_EITHER_RESET,
- .tested = TEST_OK_PRE,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
.block_erasers =
@@ -8532,9 +8532,9 @@
.total_size = 512,
.page_size = 64 * 1024,
.feature_bits = FEATURE_EITHER_RESET,
- .tested = TEST_OK_PRE,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
- .probe_timing = 10,
+ .probe_timing = 10,
.block_erasers =
{
{
@@ -8560,7 +8560,7 @@
.total_size = 512,
.page_size = 64 * 1024,
.feature_bits = FEATURE_EITHER_RESET,
- .tested = TEST_UNTESTED,
+ .tested = TEST_OK_PREW,
.probe = probe_jedec,
.probe_timing = 10,
.block_erasers =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/flashrom.8 new/flashrom-0.9.4_r1457/flashrom.8
--- old/flashrom-0.9.4_r1450/flashrom.8 2011-09-12 08:17:06.000000000 +0200
+++ new/flashrom-0.9.4_r1457/flashrom.8 2011-10-21 01:14:10.000000000 +0200
@@ -199,7 +199,8 @@
based USB SPI programmer), including the DLP Design DLP-USB1232H, \
FTDI FT2232H Mini-Module, FTDI FT4232H Mini-Module, openbiosprog-spi, Amontec \
JTAGkey/JTAGkey-tiny/JTAGkey-2, Dangerous Prototypes Bus Blaster, \
-Olimex ARM-USB-TINY/-H, and Olimex ARM-USB-OCD/-H."
+Olimex ARM-USB-TINY/-H, Olimex ARM-USB-OCD/-H, TIAO/DIYGADGET USB
+Multi-Protocol Adapter (TUMPA), and GOEPEL PicoTAP.
.sp
.BR "* serprog" " (for flash ROMs attached to a programmer speaking serprog), \
including AVR flasher by Urja Rannikko, AVR flasher by eightdot, \
@@ -441,7 +442,8 @@
.B model
can be
.BR 2232H ", " 4232H ", " jtagkey ", " busblaster ", " openmoko ", " \
-arm-usb-tiny ", " arm-usb-tiny-h ", " arm-usb-ocd " or " arm-usb-ocd-h
+arm-usb-tiny ", " arm-usb-tiny-h ", " arm-usb-ocd ", " arm-usb-ocd-h \
+", " tumpa ", or " picotap
and
.B interface
can be
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/ft2232_spi.c new/flashrom-0.9.4_r1457/ft2232_spi.c
--- old/flashrom-0.9.4_r1450/ft2232_spi.c 2011-08-16 14:08:22.000000000 +0200
+++ new/flashrom-0.9.4_r1457/ft2232_spi.c 2011-10-21 01:14:10.000000000 +0200
@@ -29,11 +29,17 @@
#include "spi.h"
#include <ftdi.h>
+/* Please keep sorted by vendor ID, then device ID. */
+
#define FTDI_VID 0x0403
#define FTDI_FT2232H_PID 0x6010
#define FTDI_FT4232H_PID 0x6011
+#define TIAO_TUMPA_PID 0x8a98
#define AMONTEC_JTAGKEY_PID 0xCFF8
+#define GOEPEL_VID 0x096C
+#define GOEPEL_PICOTAP_PID 0x1449
+
#define FIC_VID 0x1457
#define OPENMOKO_DBGBOARD_PID 0x5118
@@ -46,7 +52,9 @@
const struct usbdev_status devs_ft2232spi[] = {
{FTDI_VID, FTDI_FT2232H_PID, OK, "FTDI", "FT2232H"},
{FTDI_VID, FTDI_FT4232H_PID, OK, "FTDI", "FT4232H"},
+ {FTDI_VID, TIAO_TUMPA_PID, OK, "TIAO", "USB Multi-Protocol Adapter"},
{FTDI_VID, AMONTEC_JTAGKEY_PID, OK, "Amontec", "JTAGkey"},
+ {GOEPEL_VID, GOEPEL_PICOTAP_PID, OK, "GOEPEL", "PicoTAP"},
{FIC_VID, OPENMOKO_DBGBOARD_PID, OK, "FIC",
"OpenMoko Neo1973 Debug board (V2+)"},
{OLIMEX_VID, OLIMEX_ARM_OCD_PID, NT, "Olimex", "ARM-USB-OCD"},
@@ -172,6 +180,14 @@
ft2232_interface = INTERFACE_A;
cs_bits = 0x18;
pindir = 0x1b;
+ } else if (!strcasecmp(arg, "picotap")) {
+ ft2232_vid = GOEPEL_VID;
+ ft2232_type = GOEPEL_PICOTAP_PID;
+ ft2232_interface = INTERFACE_A;
+ } else if (!strcasecmp(arg, "tumpa")) {
+ /* Interface A is SPI1, B is SPI2. */
+ ft2232_type = TIAO_TUMPA_PID;
+ ft2232_interface = INTERFACE_A;
} else if (!strcasecmp(arg, "busblaster")) {
/* In its default configuration it is a jtagkey clone */
ft2232_type = FTDI_FT2232H_PID;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/ich_descriptors.c new/flashrom-0.9.4_r1457/ich_descriptors.c
--- old/flashrom-0.9.4_r1450/ich_descriptors.c 2011-09-16 01:52:55.000000000 +0200
+++ new/flashrom-0.9.4_r1457/ich_descriptors.c 2011-10-20 14:57:14.000000000 +0200
@@ -213,6 +213,34 @@
msg_pdbg2("\n");
}
+/** Returns the integer representation of the component density with index
+idx in bytes or 0 if a correct size can not be determined. */
+int getFCBA_component_density(const struct ich_descriptors *desc, uint8_t idx)
+{
+ uint8_t size_enc;
+
+ switch(idx) {
+ case 0:
+ size_enc = desc->component.comp1_density;
+ break;
+ case 1:
+ if (desc->content.NC == 0)
+ return 0;
+ size_enc = desc->component.comp2_density;
+ break;
+ default:
+ msg_perr("Only ICH SPI component index 0 or 1 are supported "
+ "yet.\n");
+ return 0;
+ }
+ if (size_enc > 5) {
+ msg_perr("Density of ICH SPI component with index %d is "
+ "invalid. Encoded density is 0x%x.\n", idx, size_enc);
+ return 0;
+ }
+ return (1 << (19 + size_enc));
+}
+
static uint32_t read_descriptor_reg(uint8_t section, uint16_t offset, void *spibar)
{
uint32_t control = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/ich_descriptors.h new/flashrom-0.9.4_r1457/ich_descriptors.h
--- old/flashrom-0.9.4_r1450/ich_descriptors.h 2011-09-16 01:52:55.000000000 +0200
+++ new/flashrom-0.9.4_r1457/ich_descriptors.h 2011-10-20 14:57:14.000000000 +0200
@@ -255,6 +255,7 @@
void prettyprint_ich_descriptor_master(const struct ich_desc_master *master);
int read_ich_descriptors_via_fdo(void *spibar, struct ich_descriptors *desc);
+int getFCBA_component_density(const struct ich_descriptors *desc, uint8_t idx);
#endif /* __ICH_DESCRIPTORS_H__ */
#endif /* defined(__i386__) || defined(__x86_64__) */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/ichspi.c new/flashrom-0.9.4_r1457/ichspi.c
--- old/flashrom-0.9.4_r1450/ichspi.c 2011-09-18 17:15:31.000000000 +0200
+++ new/flashrom-0.9.4_r1457/ichspi.c 2011-10-20 14:57:14.000000000 +0200
@@ -26,6 +26,7 @@
#if defined(__i386__) || defined(__x86_64__)
#include <string.h>
+#include <stdlib.h>
#include "flash.h"
#include "programmer.h"
#include "spi.h"
@@ -1080,6 +1081,77 @@
return result;
}
+#if 0
+/* Sets FLA in FADDR to (addr & 0x01FFFFFF) without touching other bits. */
+static void ich_hwseq_set_addr(uint32_t addr)
+{
+ uint32_t addr_old = REGREAD32(ICH9_REG_FADDR) & ~0x01FFFFFF;
+ REGWRITE32(ICH9_REG_FADDR, (addr & 0x01FFFFFF) | addr_old);
+}
+
+/* Sets FADDR.FLA to 'addr' and returns the erase block size in bytes
+ * of the block containing this address. May return nonsense if the address is
+ * not valid. The erase block size for a specific address depends on the flash
+ * partition layout as specified by FPB and the partition properties as defined
+ * by UVSCC and LVSCC respectively. An alternative to implement this method
+ * would be by querying FPB and the respective VSCC register directly.
+ */
+static uint32_t ich_hwseq_get_erase_block_size(unsigned int addr)
+{
+ uint8_t enc_berase;
+ static const uint32_t const dec_berase[4] = {
+ 256,
+ 4 * 1024,
+ 8 * 1024,
+ 64 * 1024
+ };
+
+ ich_hwseq_set_addr(addr);
+ enc_berase = (REGREAD16(ICH9_REG_HSFS) & HSFS_BERASE) >>
+ HSFS_BERASE_OFF;
+ return dec_berase[enc_berase];
+}
+
+/* Polls for Cycle Done Status, Flash Cycle Error or timeout in 8 us intervals.
+ Resets all error flags in HSFS.
+ Returns 0 if the cycle completes successfully without errors within
+ timeout us, 1 on errors. */
+static int ich_hwseq_wait_for_cycle_complete(unsigned int timeout,
+ unsigned int len)
+{
+ uint16_t hsfs;
+ uint32_t addr;
+
+ timeout /= 8; /* scale timeout duration to counter */
+ while ((((hsfs = REGREAD16(ICH9_REG_HSFS)) &
+ (HSFS_FDONE | HSFS_FCERR)) == 0) &&
+ --timeout) {
+ programmer_delay(8);
+ }
+ REGWRITE16(ICH9_REG_HSFS, REGREAD16(ICH9_REG_HSFS));
+ if (!timeout) {
+ addr = REGREAD32(ICH9_REG_FADDR) & 0x01FFFFFF;
+ msg_perr("Timeout error between offset 0x%08x and "
+ "0x%08x + %d (=0x%08x)!\n",
+ addr, addr, len - 1, addr + len - 1);
+ prettyprint_ich9_reg_hsfs(hsfs);
+ prettyprint_ich9_reg_hsfc(REGREAD16(ICH9_REG_HSFC));
+ return 1;
+ }
+
+ if (hsfs & HSFS_FCERR) {
+ addr = REGREAD32(ICH9_REG_FADDR) & 0x01FFFFFF;
+ msg_perr("Transaction error between offset 0x%08x and "
+ "0x%08x (=0x%08x + %d)!\n",
+ addr, addr + len - 1, addr, len - 1);
+ prettyprint_ich9_reg_hsfs(hsfs);
+ prettyprint_ich9_reg_hsfc(REGREAD16(ICH9_REG_HSFC));
+ return 1;
+ }
+ return 0;
+}
+#endif
+
static int ich_spi_send_multicommand(struct spi_command *cmds)
{
int ret = 0;
@@ -1250,21 +1322,18 @@
uint8_t old, new;
uint16_t spibar_offset, tmp2;
uint32_t tmp;
- int ichspi_desc = 0;
+ int desc_valid = 0;
switch (ich_generation) {
case 7:
- register_spi_programmer(&spi_programmer_ich7);
spibar_offset = 0x3020;
break;
case 8:
- register_spi_programmer(&spi_programmer_ich9);
spibar_offset = 0x3020;
break;
case 9:
case 10:
default: /* Future version might behave the same */
- register_spi_programmer(&spi_programmer_ich9);
spibar_offset = 0x3800;
break;
}
@@ -1275,8 +1344,8 @@
/* Assign Virtual Address */
ich_spibar = rcrb + spibar_offset;
- switch (spi_programmer->type) {
- case SPI_CONTROLLER_ICH7:
+ switch (ich_generation) {
+ case 7:
msg_pdbg("0x00: 0x%04x (SPIS)\n",
mmio_readw(ich_spibar + 0));
msg_pdbg("0x02: 0x%04x (SPIC)\n",
@@ -1313,9 +1382,13 @@
ichspi_lock = 1;
}
ich_set_bbar(ich_generation, 0);
+ register_spi_programmer(&spi_programmer_ich7);
ich_init_opcodes();
break;
- case SPI_CONTROLLER_ICH9:
+ case 8:
+ case 9:
+ case 10:
+ default: /* Future version might behave the same */
tmp2 = mmio_readw(ich_spibar + ICH9_REG_HSFS);
msg_pdbg("0x04: 0x%04x (HSFS)\n", tmp2);
prettyprint_ich9_reg_hsfs(tmp2);
@@ -1324,8 +1397,8 @@
ichspi_lock = 1;
}
if (tmp2 & HSFS_FDV)
- ichspi_desc = 1;
- if (!(tmp2 & HSFS_FDOPSS) && ichspi_desc)
+ desc_valid = 1;
+ if (!(tmp2 & HSFS_FDOPSS) && desc_valid)
msg_pinfo("The Flash Descriptor Security Override "
"Strap-Pin is set. Restrictions implied\n"
"by the FRAP and FREG registers are NOT in "
@@ -1400,18 +1473,16 @@
}
msg_pdbg("\n");
- if (ichspi_desc) {
+ if (desc_valid) {
struct ich_descriptors desc = {{ 0 }};
if (read_ich_descriptors_via_fdo(ich_spibar, &desc) ==
ICH_RET_OK)
prettyprint_ich_descriptors(CHIPSET_ICH_UNKNOWN,
&desc);
}
+ register_spi_programmer(&spi_programmer_ich9);
ich_init_opcodes();
break;
- default:
- /* Nothing */
- break;
}
old = pci_read_byte(dev, 0xdc);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/print.c new/flashrom-0.9.4_r1457/print.c
--- old/flashrom-0.9.4_r1450/print.c 2011-09-13 00:55:01.000000000 +0200
+++ new/flashrom-0.9.4_r1457/print.c 2011-10-23 00:01:09.000000000 +0200
@@ -535,6 +535,7 @@
#if defined(__i386__) || defined(__x86_64__)
B("A-Trend", "ATC-6220", 1, "http://www.motherboard.cz/mb/atrend/atc6220.htm", NULL),
B("abit", "AN-M2", 1, "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?DEFTITLE=…", NULL),
+ B("abit", "AV8", 1, "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?DEFTITLE=…", NULL),
B("abit", "AX8", 1, "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?DEFTITLE=…", NULL),
B("abit", "BM6", 1, "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?pMODEL_NA…", NULL),
B("abit", "Fatal1ty F-I90HD", 1, "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?pMODEL_NA…", NULL),
@@ -590,8 +591,10 @@
B("ASUS", "A8V Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=tvpdgPNCPaABZRVU", NULL),
B("ASUS", "A8V-E Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=hQBPIJWEZnnGAZEh", NULL),
B("ASUS", "A8V-E SE", 1, "http://www.asus.com/product.aspx?P_ID=VMfiJJRYTHM4gXIi", "See http://www.coreboot.org/pipermail/coreboot/2007-October/026496.html"),
+ B("ASUS", "Crosshair II Formula", 1, "http://www.asus.com/product.aspx?P_ID=EIDxaW1Ln3YR9RA2", NULL),
B("ASUS", "Crosshair IV Extreme", 1, "http://www.asus.com/product.aspx?P_ID=lt1ShF6xEn3rlLe7", NULL),
B("ASUS", "E35M1-I DELUXE", 1, "http://www.asus.com/product.aspx?P_ID=9BmKhMwWCwqyl1lz", NULL),
+ B("ASUS", "K8N", 1, "http://www.asus.com/product.aspx?P_ID=zigzffr75jWJ7j2y", NULL),
B("ASUS", "K8V", 1, "http://www.asus.com/product.aspx?P_ID=fG2KZOWF7v6MRFRm", NULL),
B("ASUS", "K8V SE Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=65HeDI8XM1u6Uy6o", NULL),
B("ASUS", "K8V-X", 1, NULL, NULL),
@@ -600,6 +603,7 @@
B("ASUS", "M2A-VM", 1, "http://www.asus.com/product.aspx?P_ID=St3pWpym8xXpROQS", "See http://www.coreboot.org/pipermail/coreboot/2007-September/025281.html"),
B("ASUS", "M2N32-SLI Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=0jMy2X8lKstYRvev", NULL),
B("ASUS", "M2N-E", 1, "http://www.asus.com/product.aspx?P_ID=NFlvt10av3F7ayQ9", "If the machine doesn't come up again after flashing, try resetting the NVRAM(CMOS). The MAC address of the onboard network card will change to the value stored in the new image, so backup the old address first. See http://www.flashrom.org/pipermail/flashrom/2009-November/000879.html"),
+ B("ASUS", "M2N-E SLI", 1, "http://www.asus.com/product.aspx?P_ID=NJ8fkR6ufRM9XvFC", NULL),
B("ASUS", "M2N-SLI Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=szSFtrap7crpBaQE", NULL),
B("ASUS", "M2NBP-VM CSM", 1, "http://www.asus.com/product.aspx?P_ID=MnOfzTGd2KkwG0rF", NULL),
B("ASUS", "M2NPV-VM", 1, "http://www.asus.com/product.aspx?P_ID=HGTVnGv5nGahCYgK", NULL),
@@ -608,11 +612,14 @@
B("ASUS", "M3A", 1, "http://www.asus.com/product.aspx?P_ID=P48rppKk4jrc9pNd", NULL),
B("ASUS", "M3A76-CM", 1, "http://www.asus.com/product.aspx?P_ID=aU8effdifLvraVze", NULL),
B("ASUS", "M3A78-EM", 1, "http://www.asus.com/product.aspx?P_ID=KjpYqzmAd9vsTM2D", NULL),
+ B("ASUS", "M3N78-VM", 1, "http://www.asus.com/product.aspx?P_ID=ovqEgLFRjnSClhSV", NULL),
B("ASUS", "M4A78-EM", 1, "http://www.asus.com/product.aspx?P_ID=0KyowHKUFAQqH2DO", NULL),
B("ASUS", "M4A785TD-V EVO", 1, "http://www.asus.com/product.aspx?P_ID=fcsXWSxnhzZE9rnR", NULL),
B("ASUS", "M4A785TD-M EVO", 1, "http://www.asus.com/product.aspx?P_ID=QHbvGVB1mXmmD8qQ", NULL),
+ B("ASUS", "M4A78LT-M LE", 1, "http://www.asus.com/product.aspx?P_ID=exJL00uovTJaDqxR", NULL),
B("ASUS", "M4A79T Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=lhJiLTN5huPfCVkW", NULL),
B("ASUS", "M4A87TD/USB3", 1, "http://www.asus.com/product.aspx?P_ID=nlWYrI9wlNIYHAaa", NULL),
+ B("ASUS", "M4A89GTD PRO", 1, "http://www.asus.com/product.aspx?P_ID=Gdf0vtpVf72LTYgs", NULL),
B("ASUS", "M6Ne", 0, "http://www.asus.com/Product.aspx?P_ID=IbqN4JCxeRiep4WN", "Untested board enable."),
B("ASUS", "MEW-AM", 0, "ftp://ftp.asus.com.tw/pub/ASUS/mb/sock370/810/mew-am/", "No public report found. Owned by Uwe Hermann <uwe(a)hermann-uwe.de>. May work now."),
B("ASUS", "MEW-VM", 0, "http://www.elhvb.com/mboards/OEM/HP/manual/ASUS%20MEW-VM.htm", "No public report found. Owned by Uwe Hermann <uwe(a)hermann-uwe.de>. May work now."),
@@ -640,15 +647,19 @@
B("ASUS", "P5B-Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=bswT66IBSb2rEWNa", NULL),
B("ASUS", "P5BV-M", 0, "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B-VM/", "Reported by Bernhard M. Wiedemann <bernhard(a)uml12d.zq1.de> to flashrom(a)coreboot.org, no public archive. Missing board enable and/or SST49LF008A unlocking. May work now."),
B("ASUS", "P5GC-MX/1333", 1, "http://www.asus.com/product.aspx?P_ID=PYvbfOokwxUzJky3", NULL),
+ B("ASUS", "P5GD1 Pro", 1, "http://www.asus.com/product.aspx?P_ID=50M49xQh71EZOeM1", NULL),
+ B("ASUS", "P5GD1-VM/S", 1, NULL, "This is an OEM board from FSC. Although flashrom supports it and can probably not distinguish it from the P5GD1-VM, please note that the P5GD1-VM BIOS does not support the FSC variants completely."),
+ B("ASUS", "P5GD1(-VM)", 0, NULL, "Untested board enable."),
B("ASUS", "P5GD2 Premium", 1, "http://www.asus.it/product.aspx?P_ID=lRKaz1Rb6Xb0OFM7", NULL),
B("ASUS", "P5GDC Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=AbeoopyNpI2TZixg", NULL),
+ B("ASUS", "P5GDC-V Deluxe", 1, NULL, NULL),
+ B("ASUS", "P5GD2/C variants", 0, NULL, "Untested board enable."),
B("ASUS", "P5KC", 1, "http://www.asus.com/product.aspx?P_ID=fFZ8oUIGmLpwNMjj", NULL),
B("ASUS", "P5L-MX", 1, "http://www.asus.com/product.aspx?P_ID=X70d3NCzH2DE9vWH", NULL),
B("ASUS", "P5LD2", 0, NULL, "Untested board enable."),
B("ASUS", "P5LP-LE (Lithium-UL8E)", 1, "http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00379616&tmp_task=prod…", "This is an OEM board from HP."),
B("ASUS", "P5LP-LE (Epson OEM)", 1, NULL, "This is an OEM board from Epson (e.g. Endeavor MT7700)."),
B("ASUS", "P5LP-LE", 0, NULL, "This designation is used for OEM boards from HP, Epson and maybe others. The HP names vary and not all of them have been tested yet. Please report any success or failure, thanks."),
- B("ASUS", "P5GD1 Pro", 1, "http://www.asus.com/product.aspx?P_ID=50M49xQh71EZOeM1", NULL),
B("ASUS", "P5N-E SLI", 0, "http://www.asus.com/product.aspx?P_ID=KyHOsOKWujC2QguJ", "Needs a board enable (http://patchwork.coreboot.org/patch/3298/)"),
B("ASUS", "P5N32-E SLI", 1, "http://www.asus.com/product.aspx?P_ID=vBZLIBtPzYB2bLcb", NULL),
B("ASUS", "P5ND2-SLI Deluxe", 1, "http://www.asus.com/product.aspx?P_ID=WY7XroDuUImVbgp5", NULL),
@@ -659,6 +670,8 @@
B("ASUS", "P6T Deluxe V2", 1, "http://www.asus.com/product.aspx?P_ID=iRlP8RG9han6saZx", NULL),
B("ASUS", "P7H57D-V EVO", 1, "http://www.asus.com/Motherboards/Intel_Socket_1156/P7H57DV_EVO/", NULL),
B("ASUS", "P7H55-M LX", 0, NULL, "flashrom works correctly, but GbE LAN is nonworking (probably due to a missing/bogus MAC address; see http://www.flashrom.org/pipermail/flashrom/2011-July/007432.html and http://ubuntuforums.org/showthread.php?t=1534389 for a possible workaround)"),
+ B("ASUS", "P8B-E/4L", 0, NULL, "Probing works (Winbond W25Q64, 8192 kB, SPI), but parts of the flash are problematic: descriptor is r/o (conforming to ICH reqs), ME region is locked."),
+ B("ASUS", "P8B WS", 0, NULL, "Probing works (Winbond W25Q32, 4096 kB, SPI), but parts of the flash are problematic: descriptor is r/o (conforming to ICH reqs), ME region is locked."),
B("ASUS", "Z8NA-D6C", 1, "http://www.asus.com/product.aspx?P_ID=k81cpN8uEB01BpQ6", NULL),
B("BCOM", "WinNET100", 1, "http://www.coreboot.org/BCOM_WINNET100", "Used in the IGEL-316 thin client."),
B("Biostar", "N68S3+", 1, NULL, NULL),
@@ -677,6 +690,7 @@
B("Elitegroup", "K7S6A", 1, "http://www.ecs.com.tw/ECSWebSite/Products/ProductsDetail.aspx?detailid=77&C…", NULL),
B("Elitegroup", "K7VTA3", 1, "http://www.ecs.com.tw/ECSWebSite/Products/ProductsDetail.aspx?detailid=264&…", NULL),
B("Elitegroup", "P4M800PRO-M (V1.0A)", 1, "http://www.ecs.com.tw/ECSWebSite_2007/Products/ProductsDetail.aspx?Category…", NULL),
+ B("Elitegroup", "P4VXMS (V1.0A)", 1, NULL, NULL),
B("Elitegroup", "P6IWP-Fe", 1, "http://www.ecs.com.tw/ECSWebSite_2007/Products/ProductsDetail.aspx?Category…", NULL),
B("Elitegroup", "P6VAP-A+", 1, "http://www.ecs.com.tw/ECSWebSite/Products/ProductsDetail.aspx?detailid=117&…", NULL),
B("Elitegroup", "RS485M-M", 1, "http://www.ecs.com.tw/ECSWebSite_2007/Products/ProductsDetail.aspx?Category…", NULL),
@@ -691,6 +705,7 @@
B("FIC", "VA-502", 0, "ftp://ftp.fic.com.tw/motherboard/manual/socket7/va-502/", "No public report found. Owned by Uwe Hermann <uwe(a)hermann-uwe.de>. Seems the PCI subsystem IDs are identical with the Tekram P6Pro-A5. May work now."),
B("Foxconn", "6150K8MD-8EKRSH", 1, "http://www.foxconnchannel.com/product/motherboards/detail_overview.aspx?id=…", NULL),
B("Foxconn", "A6VMX", 1, "http://www.foxconnchannel.com/product/motherboards/detail_overview.aspx?id=…", NULL),
+ B("Foxconn", "P4M800P7MA-RS2", 1, "http://www.foxconnchannel.com/Product/Motherboards/detail_overview.aspx?id=…", NULL),
B("Freetech", "P6F91i", 1, "http://web.archive.org/web/20010417035034/http://www.freetech.com/prod/P6F9…", NULL),
B("Fujitsu-Siemens", "ESPRIMO P5915", 1, "http://uk.ts.fujitsu.com/rl/servicesupport/techsupport/professionalpc/ESPRI…", "Mainboard model is D2312-A2."),
B("GIGABYTE", "GA-2761GXDK", 1, "http://www.computerbase.de/news/hardware/mainboards/amd-systeme/2007/mai/gi…", NULL),
@@ -733,7 +748,9 @@
B("GIGABYTE", "GA-MA790GP-DS4H", 1, "http://www.gigabyte.com/products/product-page.aspx?pid=2887", NULL),
B("GIGABYTE", "GA-MA790XT-UD4P (rev. 1.0)", 1, "http://www.gigabyte.com/products/product-page.aspx?pid=3010", NULL),
B("GIGABYTE", "GA-P55A-UD4 (rev. 1.0)", 1, "http://www.gigabyte.com/products/product-page.aspx?pid=3436", NULL),
+ B("GIGABYTE", "GA-P67A-UD3P", 1, "http://www.gigabyte.com/products/product-page.aspx?pid=3649", NULL),
B("GIGABYTE", "GA-X58A-UD7 (rev. 2.0)", 1, NULL, NULL),
+ B("GIGABYTE", "GA-Z68MX-UD2H-B (rev. 1.3)", 1, "http://www.gigabyte.com/products/product-page.aspx?pid=3854", NULL),
B("HP", "e-Vectra P2706T", 1, "http://h20000.www2.hp.com/bizsupport/TechSupport/Home.jsp?lang=en&cc=us&pro…", NULL),
B("HP", "ProLiant DL145 G3", 1, "http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c008…", NULL),
B("HP", "ProLiant DL165 G6", 1, "http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/15351-15351-3328412-241644-33…", NULL),
@@ -799,9 +816,11 @@
B("MSI", "MS-7599 (870-C45)", 1, "http://www.msi.com/product/mb/870-C45.html", NULL),
B("MSI", "MS-7640 (890FXA-GD70)",1, "http://www.msi.com/product/mb/890FXA-GD70.html", NULL),
B("MSI", "MS-7642 (890GXM-G65)", 1, "http://www.msi.com/product/mb/890GXM-G65.html", NULL),
+ B("MSI", "MS-7696 (A75MA-G55)", 1, "http://www.msi.com/product/mb/A75MA-G55.html", NULL),
B("MSI", "MS-7698 (E350IA-E45)", 1, "http://www.msi.com/product/mb/E350IA-E45.html", NULL),
B("NEC", "PowerMate 2000", 1, "http://support.necam.com/mobilesolutions/hardware/Desktops/pm2000/celeron/", NULL),
B("Nokia", "IP530", 1, NULL, NULL),
+ B("PCCHIPS ", "M598LMR (V9.0)", 1, NULL, NULL),
B("PCCHIPS ", "M863G (V5.1A)", 1, "http://www.pcchips.com.tw/PCCWebSite/Products/ProductsDetail.aspx?CategoryI…", NULL),
B("PC Engines", "Alix.1c", 1, "http://pcengines.ch/alix1c.htm", NULL),
B("PC Engines", "Alix.2c2", 1, "http://pcengines.ch/alix2c2.htm", NULL),
@@ -884,6 +903,7 @@
B("VIA", "pc2500e", 1, "http://www.via.com.tw/en/initiatives/empowered/pc2500_mainboard/index.jsp", NULL),
B("VIA", "PC3500G", 1, "http://www.via.com.tw/en/initiatives/empowered/pc3500_mainboard/index.jsp", NULL),
B("VIA", "VB700X", 1, "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_i…", NULL),
+ B("ZOTAC", "Fusion-ITX WiFi (FUSION350-A-E)", 1, NULL, NULL),
B("ZOTAC", "GeForce 8200", 1, "http://pden.zotac.com/index.php?page=shop.product_details&product_id=129&ca…", NULL),
B("ZOTAC", "ZBOX HD-ID11", 1, "http://pdde.zotac.com/index.php?page=shop.product_details&product_id=240&ca…", NULL),
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/print_wiki.c new/flashrom-0.9.4_r1457/print_wiki.c
--- old/flashrom-0.9.4_r1450/print_wiki.c 2011-09-15 00:09:48.000000000 +0200
+++ new/flashrom-0.9.4_r1457/print_wiki.c 2011-10-21 14:33:07.000000000 +0200
@@ -70,7 +70,7 @@
! align=\"center\" colspan=\"2\" | Voltage [V]\n\n\
|- bgcolor=\"#6699ff\"\n| colspan=\"4\" | \n\
| Probe\n| Read\n| Erase\n| Write\n\
-| align=\"center\" | min \n| align=\"center\" | max\n\n";
+| align=\"center\" | Min \n| align=\"center\" | Max\n\n";
static const char programmer_section[] = "\
\n== Supported programmers ==\n\nThis is a list \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/programmer.h new/flashrom-0.9.4_r1457/programmer.h
--- old/flashrom-0.9.4_r1450/programmer.h 2011-09-19 00:42:18.000000000 +0200
+++ new/flashrom-0.9.4_r1457/programmer.h 2011-10-22 23:45:27.000000000 +0200
@@ -607,9 +607,10 @@
void serprog_chip_writeb(uint8_t val, chipaddr addr);
uint8_t serprog_chip_readb(const chipaddr addr);
void serprog_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
-void serprog_delay(int delay);
+void serprog_delay(int usecs);
int serprog_spi_send_command(unsigned int writecnt, unsigned int readcnt,
- const unsigned char *writearr, unsigned char *readarr);
+ const unsigned char *writearr,
+ unsigned char *readarr);
int serprog_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len);
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/rayer_spi.c new/flashrom-0.9.4_r1457/rayer_spi.c
--- old/flashrom-0.9.4_r1450/rayer_spi.c 2011-09-12 08:17:06.000000000 +0200
+++ new/flashrom-0.9.4_r1457/rayer_spi.c 2011-10-21 14:33:07.000000000 +0200
@@ -42,7 +42,7 @@
/* We have two sets of pins, out and in. The numbers for both sets are
* independent and are bitshift values, not real pin numbers.
- * Default settings are for the the RayeR hardware.
+ * Default settings are for the RayeR hardware.
*/
/* Pins for master->slave direction */
static int rayer_cs_bit = 5;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/serprog-protocol.txt new/flashrom-0.9.4_r1457/serprog-protocol.txt
--- old/flashrom-0.9.4_r1450/serprog-protocol.txt 2011-09-16 01:38:14.000000000 +0200
+++ new/flashrom-0.9.4_r1457/serprog-protocol.txt 2011-10-22 23:45:27.000000000 +0200
@@ -19,7 +19,7 @@
0x05 Query supported bustypes none ACK + 8-bit flags (as per flashrom) / NAK
0x06 Query connected address lines none ACK + 8bit line count / NAK
0x07 Query operation buffer size none ACK + 16bit size / NAK
-0x08 Query write-n maximum data len none ACK + 24bit maximum length / NAK
+0x08 Query maximum write-n length none ACK + 24bit length (0==2^24) / NAK
0x09 Read byte 24-bit addr ACK + BYTE / NAK
0x0A Read n bytes 24-bit addr + 24-bit length ACK + length bytes / NAK
0x0B Initialize operation buffer none ACK / NAK
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/serprog.c new/flashrom-0.9.4_r1457/serprog.c
--- old/flashrom-0.9.4_r1450/serprog.c 2011-09-19 00:42:18.000000000 +0200
+++ new/flashrom-0.9.4_r1457/serprog.c 2011-10-22 23:45:27.000000000 +0200
@@ -38,7 +38,7 @@
#include "programmer.h"
#include "chipdrivers.h"
-#define MSGHEADER "serprog:"
+#define MSGHEADER "serprog: "
/*
* FIXME: This prototype was added to help reduce diffs for the shutdown
@@ -204,7 +204,7 @@
return;
}
}
- msg_perr("Error: cannot synchronize protocol\n"
+ msg_perr("Error: cannot synchronize protocol "
"- check communications and reset device?\n");
exit(1);
}
@@ -220,32 +220,27 @@
static int sp_automatic_cmdcheck(uint8_t cmd)
{
if ((sp_check_avail_automatic) && (sp_check_commandavail(cmd) == 0)) {
- msg_pdbg("Warning: Automatic command availability check"
- " failed for cmd %d - wont execute cmd\n",cmd);
+ msg_pdbg("Warning: Automatic command availability check failed "
+ "for cmd 0x%x - won't execute cmd\n", cmd);
return 1;
}
return 0;
}
static int sp_docommand(uint8_t command, uint32_t parmlen,
- uint8_t * params, uint32_t retlen, void *retparms)
+ uint8_t *params, uint32_t retlen, void *retparms)
{
- unsigned char *sendpacket;
unsigned char c;
if (sp_automatic_cmdcheck(command))
return 1;
- sendpacket = malloc(1 + parmlen);
- if (!sendpacket)
- sp_die("Error: cannot malloc command buffer");
- sendpacket[0] = command;
- memcpy(&(sendpacket[1]), params, parmlen);
- if (write(sp_fd, sendpacket, 1 + parmlen) != (1 + parmlen)) {
- sp_die("Error: cannot write command");
- }
- free(sendpacket);
+ if (write(sp_fd, &command, 1) != 1)
+ sp_die("Error: cannot write op code");
+ if (write(sp_fd, params, parmlen) != (parmlen))
+ sp_die("Error: cannot write parameters");
if (read(sp_fd, &c, 1) != 1)
sp_die("Error: cannot read from device");
- if (c == S_NAK) return 1;
+ if (c == S_NAK)
+ return 1;
if (c != S_ACK) {
msg_perr("Error: invalid response 0x%02X from device\n",c);
exit(1);
@@ -256,8 +251,8 @@
int r;
r = read(sp_fd, retparms + rd_bytes,
retlen - rd_bytes);
- if (r <= 0) sp_die
- ("Error: cannot read return parameters");
+ if (r <= 0)
+ sp_die("Error: cannot read return parameters");
rd_bytes += r;
} while (rd_bytes != retlen);
}
@@ -404,12 +399,12 @@
msg_pdbg(MSGHEADER "Synchronized\n");
if (sp_docommand(S_CMD_Q_IFACE, 0, NULL, 2, &iface)) {
- msg_perr("Error: NAK to Query Interface version\n");
+ msg_perr("Error: NAK to query interface version\n");
exit(1);
}
if (iface != 1) {
- msg_perr("Error: Unknown interface version %d\n", iface);
+ msg_perr("Error: Unknown interface version: %d\n", iface);
exit(1);
}
@@ -428,6 +423,11 @@
c = BUS_NONSPI; /* A reasonable default for now. */
}
buses_supported = c;
+ msg_pdbg(MSGHEADER "Bus support: parallel=%s, LPC=%s, FWH=%s, SPI=%s\n",
+ (c & BUS_PARALLEL) ? "on" : "off",
+ (c & BUS_LPC) ? "on" : "off",
+ (c & BUS_FWH) ? "on" : "off",
+ (c & BUS_SPI) ? "on" : "off");
/* Check for the minimum operational set of commands. */
if (buses_supported & BUS_SPI) {
uint8_t bt = BUS_SPI;
@@ -538,12 +538,12 @@
strcpy((char *)pgmname, "(unknown)");
}
pgmname[16] = 0;
- msg_pinfo(MSGHEADER "Programmer name \"%s\"\n", pgmname);
+ msg_pinfo(MSGHEADER "Programmer name is \"%s\"\n", pgmname);
if (sp_docommand(S_CMD_Q_SERBUF, 0, NULL, 2, &sp_device_serbuf_size)) {
msg_perr("Warning: NAK to query serial buffer size\n");
}
- msg_pdbg(MSGHEADER "serial buffer size %d\n",
+ msg_pdbg(MSGHEADER "Serial buffer size is %d\n",
sp_device_serbuf_size);
if (sp_check_commandavail(S_CMD_O_INIT)) {
@@ -564,7 +564,7 @@
msg_perr("Warning: NAK to query operation buffer "
"size\n");
}
- msg_pdbg(MSGHEADER "operation buffer size %d\n",
+ msg_pdbg(MSGHEADER "operation buffer size is %d\n",
sp_device_opbuf_size);
}
@@ -581,7 +581,7 @@
{
unsigned char header[7];
msg_pspew(MSGHEADER "Passing write-n bytes=%d addr=0x%x\n",
- sp_write_n_bytes, sp_write_n_addr);
+ sp_write_n_bytes, sp_write_n_addr);
if (sp_streamed_transmit_bytes >=
(7 + sp_write_n_bytes + sp_device_serbuf_size))
sp_flush_stream();
@@ -735,31 +735,32 @@
{
size_t lenm = len;
chipaddr addrm = addr;
- while ((sp_max_read_n)&&(lenm > sp_max_read_n)) {
- sp_do_read_n(&(buf[addrm-addr]),addrm,sp_max_read_n);
+ while ((sp_max_read_n != 0) && (lenm > sp_max_read_n)) {
+ sp_do_read_n(&(buf[addrm-addr]), addrm, sp_max_read_n);
addrm += sp_max_read_n;
lenm -= sp_max_read_n;
}
- if (lenm) sp_do_read_n(&(buf[addrm-addr]),addrm,lenm);
+ if (lenm)
+ sp_do_read_n(&(buf[addrm-addr]), addrm, lenm);
}
-void serprog_delay(int delay)
+void serprog_delay(int usecs)
{
unsigned char buf[4];
- msg_pspew("%s\n", __func__);
+ msg_pspew("%s usecs=%d\n", __func__, usecs);
if (!sp_check_commandavail(S_CMD_O_DELAY)) {
- internal_delay(delay);
msg_pdbg("Note: serprog_delay used, but the programmer doesn't "
"support delay\n");
+ internal_delay(usecs);
return;
}
if ((sp_max_write_n) && (sp_write_n_bytes))
sp_pass_writen();
sp_check_opbuf_usage(5);
- buf[0] = ((delay >> 0) & 0xFF);
- buf[1] = ((delay >> 8) & 0xFF);
- buf[2] = ((delay >> 16) & 0xFF);
- buf[3] = ((delay >> 24) & 0xFF);
+ buf[0] = ((usecs >> 0) & 0xFF);
+ buf[1] = ((usecs >> 8) & 0xFF);
+ buf[2] = ((usecs >> 16) & 0xFF);
+ buf[3] = ((usecs >> 24) & 0xFF);
sp_stream_buffer_op(S_CMD_O_DELAY, 4, buf);
sp_opbuf_usage += 5;
sp_prev_was_write = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/spi25.c new/flashrom-0.9.4_r1457/spi25.c
--- old/flashrom-0.9.4_r1450/spi25.c 2011-09-19 00:42:18.000000000 +0200
+++ new/flashrom-0.9.4_r1457/spi25.c 2011-10-21 14:33:07.000000000 +0200
@@ -120,7 +120,6 @@
uint32_t id2;
if (spi_rdid(readarr, bytes)) {
- msg_cdbg("\n");
return 0;
}
@@ -201,7 +200,6 @@
uint32_t id1, id2;
if (spi_rems(readarr)) {
- msg_cdbg("\n");
return 0;
}
@@ -259,7 +257,6 @@
}
if (spi_res(readarr, 1)) {
- msg_cdbg("\n");
return 0;
}
@@ -283,7 +280,6 @@
uint32_t id1, id2;
if (spi_res(readarr, 2)) {
- msg_cdbg("\n");
return 0;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flashrom-0.9.4_r1450/util/z60_flashrom.rules new/flashrom-0.9.4_r1457/util/z60_flashrom.rules
--- old/flashrom-0.9.4_r1450/util/z60_flashrom.rules 2011-06-17 23:25:48.000000000 +0200
+++ new/flashrom-0.9.4_r1457/util/z60_flashrom.rules 2011-10-21 01:14:10.000000000 +0200
@@ -56,6 +56,10 @@
# http://www.ftdichip.com/Products/EvaluationKits/FT4232H_MiniModule.htm
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev"
+# GOEPEL PicoTAP
+# http://www.goepel.com/jtagboundary-scan/hardware/picotap.html
+ATTRS{idVendor}=="096c", ATTRS{idProduct}=="1449", MODE="664", GROUP="plugdev"
+
# Olimex ARM-USB-OCD
# http://olimex.com/dev/arm-usb-ocd.html
ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="664", GROUP="plugdev"
@@ -72,4 +76,8 @@
# http://olimex.com/dev/arm-usb-tiny-h.html
ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="664", GROUP="plugdev"
+# TIAO/DIYGADGET USB Multi-Protocol Adapter (TUMPA)
+# http://www.diygadget.com/tiao-usb-multi-protocol-adapter-jtag-spi-i2c-seria…
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="664", GROUP="plugdev"
+
LABEL="flashrom_rules_end"
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package xen for openSUSE:12.1 checked in at 2011-10-29 06:50:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1/xen (Old)
and /work/SRC/openSUSE:12.1/.xen.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xen", Maintainer is "CARNOLD(a)suse.com"
Changes:
--------
--- /work/SRC/openSUSE:12.1/xen/xen.changes 2011-10-24 13:34:38.000000000 +0200
+++ /work/SRC/openSUSE:12.1/.xen.new/xen.changes 2011-10-29 06:50:38.000000000 +0200
@@ -1,0 +2,80 @@
+Wed Oct 26 10:13:04 MDT 2011 - carnold(a)novell.com
+
+- bnc#725169 - xen-4.0.2_21511_03-0.5.3: bootup hangs
+ 23993-x86-microcode-amd-fix-23871.patch
+
+-------------------------------------------------------------------
+Wed Oct 26 09:48:14 MDT 2011 - carnold(a)novell.com
+
+- Update to Xen 4.1.2 FCS c/s 23174
+
+-------------------------------------------------------------------
+Mon Oct 24 09:26:24 MDT 2011 - jfehlig(a)suse.com
+
+- bnc#720054 - Fix syntax error introduced during recent adjustment
+ of Xen's tap udev rule.
+ Updated udev-rules.patch
+
+-------------------------------------------------------------------
+Thu Oct 20 21:39:08 CEST 2011 - ohering(a)suse.de
+
+- fate#310510 - fix xenpaging
+ Merge paging related fixes from xen-unstable:
+ 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch
+ 23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch
+ 23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch
+ 23562-xenpaging_remove_unused_spinlock_in_pager.patch
+ 23576-x86_show_page_walk_also_for_early_page_faults.patch
+ 23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch
+ 23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch
+ 23579-xenpaging_drop_xc.c_remove_ASSERT.patch
+ 23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch
+ 23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch
+ 23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch
+ 23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch
+ 23584-xenpaging_drop_xc.c_remove_xc_files.patch
+ 23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch
+ 23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch
+ 23587-xenpaging_remove_srand_call.patch
+ 23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch
+ 23589-xenpaging_catch_xc_mem_paging_resume_errors.patch
+ 23590-xenpaging_remove_local_domain_id_variable.patch
+ 23591-xenpaging_move_num_pages_into_xenpaging_struct.patch
+ 23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch
+ 23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch
+ 23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch
+ 23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch
+ 23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch
+ 23597-xenpaging_remove_private_mem_event.h.patch
+ 23599-tools_fix_build_after_recent_xenpaging_changes.patch
+ 23817-mem_event_add_ref_counting_for_free_requestslots.patch
+ 23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch
+ 23827-xenpaging_use_batch_of_pages_during_final_page-in.patch
+ 23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch
+ 23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch
+ 23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch
+ 23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch
+ 23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch
+ 23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch
+ 23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch
+ 23943-xenpaging_clear_page_content_after_evict.patch
+ 23953-xenpaging_handle_evict_failures.patch
+ 23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch
+ 23979-xenpaging_document_p2m_mem_paging_functions.patch
+ 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch
+ Remove obsolete patches:
+ x86-show-page-walk-early.patch
+ xenpaging.23817-mem_event_check_ring.patch
+ xenpaging.catch-xc_mem_paging_resume-error.patch
+ xenpaging.guest_remove_page.slow_path.patch
+ xenpaging.mem_event-no-p2mt.patch
+ xenpaging.no-srand.patch
+ xenpaging.return-void.patch
+ xenpaging.xenpaging_populate_page-gfn.patch
+
+-------------------------------------------------------------------
+Thu Oct 20 20:57:11 CEST 2011 - ohering(a)suse.de
+
+- xen.spec: use changeset number as patch number for upstream patches
+
+-------------------------------------------------------------------
Old:
----
x86-show-page-walk-early.patch
xenpaging.23817-mem_event_check_ring.patch
xenpaging.catch-xc_mem_paging_resume-error.patch
xenpaging.guest_remove_page.slow_path.patch
xenpaging.mem_event-no-p2mt.patch
xenpaging.no-srand.patch
xenpaging.return-void.patch
xenpaging.xenpaging_populate_page-gfn.patch
New:
----
23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch
23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch
23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch
23562-xenpaging_remove_unused_spinlock_in_pager.patch
23576-x86_show_page_walk_also_for_early_page_faults.patch
23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch
23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch
23579-xenpaging_drop_xc.c_remove_ASSERT.patch
23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch
23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch
23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch
23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch
23584-xenpaging_drop_xc.c_remove_xc_files.patch
23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch
23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch
23587-xenpaging_remove_srand_call.patch
23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch
23589-xenpaging_catch_xc_mem_paging_resume_errors.patch
23590-xenpaging_remove_local_domain_id_variable.patch
23591-xenpaging_move_num_pages_into_xenpaging_struct.patch
23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch
23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch
23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch
23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch
23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch
23597-xenpaging_remove_private_mem_event.h.patch
23599-tools_fix_build_after_recent_xenpaging_changes.patch
23817-mem_event_add_ref_counting_for_free_requestslots.patch
23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch
23827-xenpaging_use_batch_of_pages_during_final_page-in.patch
23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch
23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch
23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch
23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch
23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch
23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch
23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch
23943-xenpaging_clear_page_content_after_evict.patch
23953-xenpaging_handle_evict_failures.patch
23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch
23979-xenpaging_document_p2m_mem_paging_functions.patch
23980-xenpaging_disallow_paging_in_a_PoD_guest.patch
23993-x86-microcode-amd-fix-23871.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -22,7 +22,7 @@
ExclusiveArch: %ix86 x86_64
%define xvers 4.1
%define xvermaj 4
-%define changeset 23171
+%define changeset 23174
%define xen_build_dir xen-4.1.2-testing
%define with_kmp 1
%define with_stubdom 1
@@ -96,7 +96,7 @@
%if %{?with_kmp}0
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
-Version: 4.1.2_03
+Version: 4.1.2_05
Release: 1
License: GPLv2+
Group: System/Kernel
@@ -142,62 +142,105 @@
# http://xenbits.xensource.com/ext/xenalyze
Source20000: xenalyze.hg.tar.bz2
# Upstream patches
-Patch1: 22998-x86-get_page_from_l1e-retcode.patch
-Patch2: 22999-x86-mod_l1_entry-retcode.patch
-Patch3: 23000-x86-mod_l2_entry-retcode.patch
-Patch4: 23074-pfn.h.patch
-Patch5: 23096-x86-hpet-no-cpumask_lock.patch
-Patch6: 23099-x86-rwlock-scalability.patch
-Patch7: 23103-x86-pirq-guest-eoi-check.patch
-Patch8: 23127-vtd-bios-settings.patch
-Patch9: 23199-amd-iommu-unmapped-intr-fault.patch
-Patch10: 23233-hvm-cr-access.patch
-Patch11: 23234-svm-decode-assist-base.patch
-Patch12: 23235-svm-decode-assist-crs.patch
-Patch13: 23236-svm-decode-assist-invlpg.patch
-Patch14: 23238-svm-decode-assist-insn-fetch.patch
-Patch15: 23246-x86-xsave-enable.patch
-Patch16: 23303-cpufreq-misc.patch
-Patch17: 23304-amd-oprofile-strings.patch
-Patch18: 23305-amd-fam15-xenoprof.patch
-Patch19: 23306-amd-fam15-vpmu.patch
-Patch20: 23334-amd-fam12+14-vpmu.patch
-Patch21: 23383-libxc-rm-static-vars.patch
-Patch22: 23437-amd-fam15-TSC-scaling.patch
-Patch23: 23462-libxc-cpu-feature.patch
-Patch24: 23508-vmx-proc-based-ctls-probe.patch
-Patch25: 23511-amd-fam15-no-flush-for-C3.patch
-Patch26: 23571-vtd-fault-verbosity.patch
-Patch27: 23574-x86-dom0-compressed-ELF.patch
-Patch28: 23575-x86-DMI.patch
-Patch29: 23610-x86-topology-info.patch
-Patch30: 23611-amd-fam15-topology.patch
-Patch31: 23613-EFI-headers.patch
-Patch32: 23614-x86_64-EFI-boot.patch
-Patch33: 23615-x86_64-EFI-runtime.patch
-Patch34: 23616-x86_64-EFI-MPS.patch
-Patch35: 23676-x86_64-image-map-bounds.patch
-Patch36: 23723-x86-CMOS-lock.patch
-Patch37: 23724-x86-smpboot-x2apic.patch
-Patch38: 23726-x86-intel-flexmigration-v2.patch
-Patch39: 23735-guest-dom0-cap.patch
-Patch40: 23747-mmcfg-base-address.patch
-Patch41: 23749-mmcfg-reservation.patch
-Patch42: 23771-x86-ioapic-clear-pin.patch
-Patch43: 23772-x86-trampoline.patch
-Patch44: 23774-x86_64-EFI-EDD.patch
-Patch45: 23781-pm-wide-ACPI-ids.patch
-Patch46: 23782-x86-ioapic-clear-irr.patch
-Patch47: 23783-ACPI-set-_PDC-bits.patch
-Patch48: 23795-intel-ich10-quirk.patch
-Patch49: 23800-x86_64-guest-addr-range.patch
-Patch50: 23804-x86-IPI-counts.patch
-Patch51: 23853-x86-pv-cpuid-xsave.patch
-Patch52: 23897-x86-mce-offline-again.patch
-Patch53: 23925-x86-AMD-ARAT-Fam12.patch
-Patch54: 23933-pt-bus2bridge-update.patch
-Patch55: 23955-x86-pv-cpuid-xsave.patch
-Patch56: 23957-cpufreq-error-paths.patch
+Patch22998: 22998-x86-get_page_from_l1e-retcode.patch
+Patch22999: 22999-x86-mod_l1_entry-retcode.patch
+Patch23000: 23000-x86-mod_l2_entry-retcode.patch
+Patch23074: 23074-pfn.h.patch
+Patch23096: 23096-x86-hpet-no-cpumask_lock.patch
+Patch23099: 23099-x86-rwlock-scalability.patch
+Patch23103: 23103-x86-pirq-guest-eoi-check.patch
+Patch23127: 23127-vtd-bios-settings.patch
+Patch23199: 23199-amd-iommu-unmapped-intr-fault.patch
+Patch23233: 23233-hvm-cr-access.patch
+Patch23234: 23234-svm-decode-assist-base.patch
+Patch23235: 23235-svm-decode-assist-crs.patch
+Patch23236: 23236-svm-decode-assist-invlpg.patch
+Patch23238: 23238-svm-decode-assist-insn-fetch.patch
+Patch23246: 23246-x86-xsave-enable.patch
+Patch23303: 23303-cpufreq-misc.patch
+Patch23304: 23304-amd-oprofile-strings.patch
+Patch23305: 23305-amd-fam15-xenoprof.patch
+Patch23306: 23306-amd-fam15-vpmu.patch
+Patch23334: 23334-amd-fam12+14-vpmu.patch
+Patch23383: 23383-libxc-rm-static-vars.patch
+Patch23437: 23437-amd-fam15-TSC-scaling.patch
+Patch23462: 23462-libxc-cpu-feature.patch
+Patch23506: 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch
+Patch23507: 23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch
+Patch23508: 23508-vmx-proc-based-ctls-probe.patch
+Patch23509: 23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch
+Patch23511: 23511-amd-fam15-no-flush-for-C3.patch
+Patch23562: 23562-xenpaging_remove_unused_spinlock_in_pager.patch
+Patch23571: 23571-vtd-fault-verbosity.patch
+Patch23574: 23574-x86-dom0-compressed-ELF.patch
+Patch23575: 23575-x86-DMI.patch
+Patch23576: 23576-x86_show_page_walk_also_for_early_page_faults.patch
+Patch23577: 23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch
+Patch23578: 23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch
+Patch23579: 23579-xenpaging_drop_xc.c_remove_ASSERT.patch
+Patch23580: 23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch
+Patch23581: 23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch
+Patch23582: 23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch
+Patch23583: 23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch
+Patch23584: 23584-xenpaging_drop_xc.c_remove_xc_files.patch
+Patch23585: 23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch
+Patch23586: 23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch
+Patch23587: 23587-xenpaging_remove_srand_call.patch
+Patch23588: 23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch
+Patch23589: 23589-xenpaging_catch_xc_mem_paging_resume_errors.patch
+Patch23590: 23590-xenpaging_remove_local_domain_id_variable.patch
+Patch23591: 23591-xenpaging_move_num_pages_into_xenpaging_struct.patch
+Patch23592: 23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch
+Patch23593: 23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch
+Patch23594: 23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch
+Patch23595: 23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch
+Patch23596: 23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch
+Patch23597: 23597-xenpaging_remove_private_mem_event.h.patch
+Patch23599: 23599-tools_fix_build_after_recent_xenpaging_changes.patch
+Patch23610: 23610-x86-topology-info.patch
+Patch23611: 23611-amd-fam15-topology.patch
+Patch23613: 23613-EFI-headers.patch
+Patch23614: 23614-x86_64-EFI-boot.patch
+Patch23615: 23615-x86_64-EFI-runtime.patch
+Patch23616: 23616-x86_64-EFI-MPS.patch
+Patch23676: 23676-x86_64-image-map-bounds.patch
+Patch23723: 23723-x86-CMOS-lock.patch
+Patch23724: 23724-x86-smpboot-x2apic.patch
+Patch23726: 23726-x86-intel-flexmigration-v2.patch
+Patch23735: 23735-guest-dom0-cap.patch
+Patch23747: 23747-mmcfg-base-address.patch
+Patch23749: 23749-mmcfg-reservation.patch
+Patch23771: 23771-x86-ioapic-clear-pin.patch
+Patch23772: 23772-x86-trampoline.patch
+Patch23774: 23774-x86_64-EFI-EDD.patch
+Patch23781: 23781-pm-wide-ACPI-ids.patch
+Patch23782: 23782-x86-ioapic-clear-irr.patch
+Patch23783: 23783-ACPI-set-_PDC-bits.patch
+Patch23795: 23795-intel-ich10-quirk.patch
+Patch23800: 23800-x86_64-guest-addr-range.patch
+Patch23804: 23804-x86-IPI-counts.patch
+Patch23817: 23817-mem_event_add_ref_counting_for_free_requestslots.patch
+Patch23818: 23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch
+Patch23827: 23827-xenpaging_use_batch_of_pages_during_final_page-in.patch
+Patch23841: 23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch
+Patch23842: 23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch
+Patch23853: 23853-x86-pv-cpuid-xsave.patch
+Patch23874: 23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch
+Patch23897: 23897-x86-mce-offline-again.patch
+Patch23904: 23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch
+Patch23905: 23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch
+Patch23906: 23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch
+Patch23908: 23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch
+Patch23925: 23925-x86-AMD-ARAT-Fam12.patch
+Patch23933: 23933-pt-bus2bridge-update.patch
+Patch23943: 23943-xenpaging_clear_page_content_after_evict.patch
+Patch23953: 23953-xenpaging_handle_evict_failures.patch
+Patch23955: 23955-x86-pv-cpuid-xsave.patch
+Patch23957: 23957-cpufreq-error-paths.patch
+Patch23978: 23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch
+Patch23979: 23979-xenpaging_document_p2m_mem_paging_functions.patch
+Patch23980: 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch
+Patch23993: 23993-x86-microcode-amd-fix-23871.patch
# Upstream qemu patches
# Our patches
Patch300: xen-config.diff
@@ -311,7 +354,6 @@
Patch502: x86-cpufreq-report.patch
Patch504: dom-print.patch
Patch505: pvdrv-import-shared-info.patch
-Patch506: x86-show-page-walk-early.patch
Patch507: x86-extra-trap-info.patch
Patch508: pvdrv_emulation_control.patch
Patch509: blktap-pv-cdrom.patch
@@ -339,14 +381,7 @@
Patch1011: xen-unstable.xentrace.data_size__read_mostly.patch
Patch1012: xen-unstable.xentrace.__insert_record-dst-type.patch
# FATE 310510
-Patch1100: xenpaging.guest_remove_page.slow_path.patch
-Patch1101: xenpaging.mem_event-no-p2mt.patch
-Patch1102: xenpaging.no-srand.patch
-Patch1103: xenpaging.return-void.patch
-Patch1104: xenpaging.catch-xc_mem_paging_resume-error.patch
-Patch1105: xenpaging.xenpaging_populate_page-gfn.patch
Patch1106: xenpaging.autostart.patch
-Patch1107: xenpaging.23817-mem_event_check_ring.patch
# xenalyze
Patch20000: xenalyze.gcc46.patch
# Build patch
@@ -690,62 +725,107 @@
%setup -q -n %xen_build_dir -a 1 -a 20000
%patch20000 -p1
tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-%patch15 -p1
-%patch16 -p1
-%patch17 -p1
-%patch18 -p1
-%patch19 -p1
-%patch20 -p1
-%patch21 -p1
-%patch22 -p1
-%patch23 -p1
-%patch24 -p1
-%patch25 -p1
-%patch26 -p1
-%patch27 -p1
-%patch28 -p1
-%patch29 -p1
-%patch30 -p1
-%patch31 -p1
-%patch32 -p1
-%patch33 -p1
-%patch34 -p1
-%patch35 -p1
-%patch36 -p1
-%patch37 -p1
-%patch38 -p1
-%patch39 -p1
-%patch40 -p1
-%patch41 -p1
-%patch42 -p1
-%patch43 -p1
-%patch44 -p1
-%patch45 -p1
-%patch46 -p1
-%patch47 -p1
-%patch48 -p1
-%patch49 -p1
-%patch50 -p1
-%patch51 -p1
-%patch52 -p1
-%patch53 -p1
-%patch54 -p1
-%patch55 -p1
-%patch56 -p1
+# Upstream patches
+%patch22998 -p1
+%patch22999 -p1
+%patch23000 -p1
+%patch23074 -p1
+%patch23096 -p1
+%patch23099 -p1
+%patch23103 -p1
+%patch23127 -p1
+%patch23199 -p1
+%patch23233 -p1
+%patch23234 -p1
+%patch23235 -p1
+%patch23236 -p1
+%patch23238 -p1
+%patch23246 -p1
+%patch23303 -p1
+%patch23304 -p1
+%patch23305 -p1
+%patch23306 -p1
+%patch23334 -p1
+%patch23383 -p1
+%patch23437 -p1
+%patch23462 -p1
+%patch23506 -p1
+%patch23507 -p1
+%patch23508 -p1
+%patch23509 -p1
+%patch23511 -p1
+%patch23562 -p1
+%patch23571 -p1
+%patch23574 -p1
+%patch23575 -p1
+%patch23576 -p1
+%patch23577 -p1
+%patch23578 -p1
+%patch23579 -p1
+%patch23580 -p1
+%patch23581 -p1
+%patch23582 -p1
+%patch23583 -p1
+%patch23584 -p1
+%patch23585 -p1
+%patch23586 -p1
+%patch23587 -p1
+%patch23588 -p1
+%patch23589 -p1
+%patch23590 -p1
+%patch23591 -p1
+%patch23592 -p1
+%patch23593 -p1
+%patch23594 -p1
+%patch23595 -p1
+%patch23596 -p1
+%patch23597 -p1
+%patch23599 -p1
+%patch23610 -p1
+%patch23611 -p1
+%patch23613 -p1
+%patch23614 -p1
+%patch23615 -p1
+%patch23616 -p1
+%patch23676 -p1
+%patch23723 -p1
+%patch23724 -p1
+%patch23726 -p1
+%patch23735 -p1
+%patch23747 -p1
+%patch23749 -p1
+%patch23771 -p1
+%patch23772 -p1
+%patch23774 -p1
+%patch23781 -p1
+%patch23782 -p1
+%patch23783 -p1
+%patch23795 -p1
+%patch23800 -p1
+%patch23804 -p1
+%patch23817 -p1
+%patch23818 -p1
+%patch23827 -p1
+%patch23841 -p1
+%patch23842 -p1
+%patch23853 -p1
+%patch23874 -p1
+%patch23897 -p1
+%patch23904 -p1
+%patch23905 -p1
+%patch23906 -p1
+%patch23908 -p1
+%patch23925 -p1
+%patch23933 -p1
+%patch23943 -p1
+%patch23953 -p1
+%patch23955 -p1
+%patch23957 -p1
+%patch23978 -p1
+%patch23979 -p1
+%patch23980 -p1
+%patch23993 -p1
+# Upstream patches
%patch300 -p1
%patch301 -p1
%patch302 -p1
@@ -851,7 +931,6 @@
%patch502 -p1
%patch504 -p1
%patch505 -p1
-%patch506 -p1
%patch507 -p1
%patch508 -p1
%patch509 -p1
@@ -879,14 +958,7 @@
%patch1011 -p1
%patch1012 -p1
# FATE 310510
-%patch1100 -p1
-%patch1101 -p1
-%patch1102 -p1
-%patch1103 -p1
-%patch1104 -p1
-%patch1105 -p1
%patch1106 -p1
-%patch1107 -p1
#
%patch99998 -p1
%patch99999 -p1
++++++ 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch ++++++
changeset: 23506:d1309a79bde8
user: Keir Fraser <keir(a)xen.org>
date: Fri Jun 10 08:18:33 2011 +0100
files: xen/arch/x86/x86_64/mm.c xen/include/asm-x86/mm.h
description:
x86: Disable set_gpfn_from_mfn until m2p table is allocated.
This is a prerequisite for calling set_gpfn_from_mfn() unconditionally
from free_heap_pages().
Signed-off-by: Keir Fraser <keir(a)xen.org>
---
xen/arch/x86/x86_64/mm.c | 4 ++++
xen/include/asm-x86/mm.h | 15 +++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
@@ -47,6 +47,8 @@ unsigned int __read_mostly pfn_pdx_hole_
unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
+bool_t __read_mostly machine_to_phys_mapping_valid = 0;
+
/* Top-level master (and idle-domain) page directory. */
l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
idle_pg_table[L4_PAGETABLE_ENTRIES];
@@ -800,6 +802,8 @@ void __init paging_init(void)
#undef CNT
#undef MFN
+ machine_to_phys_mapping_valid = 1;
+
/* Set up linear page table mapping. */
l4e_write(&idle_pg_table[l4_table_offset(LINEAR_PT_VIRT_START)],
l4e_from_paddr(__pa(idle_pg_table), __PAGE_HYPERVISOR));
Index: xen-4.1.2-testing/xen/include/asm-x86/mm.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/asm-x86/mm.h
+++ xen-4.1.2-testing/xen/include/asm-x86/mm.h
@@ -469,7 +469,7 @@ TYPE_SAFE(unsigned long,mfn);
#ifdef CONFIG_COMPAT
#define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START)
-#define set_gpfn_from_mfn(mfn, pfn) ({ \
+#define _set_gpfn_from_mfn(mfn, pfn) ({ \
struct domain *d = page_get_owner(__mfn_to_page(mfn)); \
unsigned long entry = (d && (d == dom_cow)) ? \
SHARED_M2P_ENTRY : (pfn); \
@@ -478,7 +478,7 @@ TYPE_SAFE(unsigned long,mfn);
machine_to_phys_mapping[(mfn)] = (entry)); \
})
#else
-#define set_gpfn_from_mfn(mfn, pfn) ({ \
+#define _set_gpfn_from_mfn(mfn, pfn) ({ \
struct domain *d = page_get_owner(__mfn_to_page(mfn)); \
if(d && (d == dom_cow)) \
machine_to_phys_mapping[(mfn)] = SHARED_M2P_ENTRY; \
@@ -486,6 +486,17 @@ TYPE_SAFE(unsigned long,mfn);
machine_to_phys_mapping[(mfn)] = (pfn); \
})
#endif
+
+/*
+ * Disable some users of set_gpfn_from_mfn() (e.g., free_heap_pages()) until
+ * the machine_to_phys_mapping is actually set up.
+ */
+extern bool_t machine_to_phys_mapping_valid;
+#define set_gpfn_from_mfn(mfn, pfn) do { \
+ if ( machine_to_phys_mapping_valid ) \
+ _set_gpfn_from_mfn(mfn, pfn); \
+} while (0)
+
#define get_gpfn_from_mfn(mfn) (machine_to_phys_mapping[(mfn)])
#define mfn_to_gmfn(_d, mfn) \
++++++ 23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch ++++++
changeset: 23507:0a29c8c3ddf7
user: Keir Fraser <keir(a)xen.org>
date: Fri Jun 10 08:19:07 2011 +0100
files: xen/common/page_alloc.c
description:
xenpaging: update machine_to_phys_mapping[] during page deallocation
The machine_to_phys_mapping[] array needs updating during page
deallocation. If that page is allocated again, a call to
get_gpfn_from_mfn() will still return an old gfn from another guest.
This will cause trouble because this gfn number has no or different
meaning in the context of the current guest.
This happens when the entire guest ram is paged-out before
xen_vga_populate_vram() runs. Then XENMEM_populate_physmap is called
with gfn 0xff000. A new page is allocated with alloc_domheap_pages.
This new page does not have a gfn yet. However, in
guest_physmap_add_entry() the passed mfn maps still to an old gfn
(perhaps from another old guest). This old gfn is in paged-out state
in this guests context and has no mfn anymore. As a result, the
ASSERT() triggers because p2m_is_ram() is true for p2m_ram_paging*
types. If the machine_to_phys_mapping[] array is updated properly,
both loops in guest_physmap_add_entry() turn into no-ops for the new
page and the mfn/gfn mapping will be done at the end of the function.
If XENMEM_add_to_physmap is used with XENMAPSPACE_gmfn,
get_gpfn_from_mfn() will return an appearently valid gfn. As a
result, guest_physmap_remove_page() is called. The ASSERT in
p2m_remove_page triggers because the passed mfn does not match the old
mfn for the passed gfn.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
xen/common/page_alloc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: xen-4.1.2-testing/xen/common/page_alloc.c
===================================================================
--- xen-4.1.2-testing.orig/xen/common/page_alloc.c
+++ xen-4.1.2-testing/xen/common/page_alloc.c
@@ -528,7 +528,7 @@ static int reserve_offlined_page(struct
static void free_heap_pages(
struct page_info *pg, unsigned int order)
{
- unsigned long mask;
+ unsigned long mask, mfn = page_to_mfn(pg);
unsigned int i, node = phys_to_nid(page_to_maddr(pg)), tainted = 0;
unsigned int zone = page_to_zone(pg);
@@ -539,6 +539,10 @@ static void free_heap_pages(
for ( i = 0; i < (1 << order); i++ )
{
+ /* This page is not a guest frame any more. */
+ page_set_owner(&pg[i], NULL); /* set_gpfn_from_mfn snoops pg owner */
+ set_gpfn_from_mfn(mfn + i, INVALID_M2P_ENTRY);
+
/*
* Cannot assume that count_info == 0, as there are some corner cases
* where it isn't the case and yet it isn't a bug:
++++++ 23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch ++++++
changeset: 23509:782bc7b2661a
user: Keir Fraser <keir(a)xen.org>
date: Fri Jun 10 13:51:39 2011 +0100
files: xen/arch/x86/x86_32/mm.c
description:
x86_32: Fix build: Define machine_to_phys_mapping_valid
Signed-off-by: Keir Fraser <keir(a)xen.org>
---
xen/arch/x86/x86_32/mm.c | 4 ++++
1 file changed, 4 insertions(+)
Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
@@ -39,6 +39,8 @@ extern l1_pgentry_t l1_identmap[L1_PAGET
unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR;
unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
+bool_t __read_mostly machine_to_phys_mapping_valid = 0;
+
static unsigned long __read_mostly mpt_size;
void *alloc_xen_pagetable(void)
@@ -123,6 +125,8 @@ void __init paging_init(void)
#undef CNT
#undef MFN
+ machine_to_phys_mapping_valid = 1;
+
/* Create page tables for ioremap()/map_domain_page_global(). */
for ( i = 0; i < (IOREMAP_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
{
++++++ 23562-xenpaging_remove_unused_spinlock_in_pager.patch ++++++
changeset: 23562:8a7f52c59d64
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:02 2011 +0200
files: tools/xenpaging/mem_event.h tools/xenpaging/spinlock.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: remove unused spinlock in pager
The spinlock code in the pager is a no-op because xenpaging is a single
threaded application. There is no locking when put_response() places a
response into the ringbuffer.
The only locking is inside the hypervisor, where mem_event_put_request() and
mem_event_get_response() lock the ringbuffer to protect multiple vcpus from
each other.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/mem_event.h | 5 ---
tools/xenpaging/spinlock.h | 69 --------------------------------------------
tools/xenpaging/xenpaging.c | 12 -------
tools/xenpaging/xenpaging.h | 1
4 files changed, 87 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/mem_event.h
+++ xen-4.1.2-testing/tools/xenpaging/mem_event.h
@@ -25,7 +25,6 @@
#define __XEN_MEM_EVENT_H__
-#include "spinlock.h"
#include "xc.h"
#include <xc_private.h>
@@ -33,9 +32,6 @@
#include <xen/mem_event.h>
-#define mem_event_ring_lock_init(_m) spin_lock_init(&(_m)->ring_lock)
-#define mem_event_ring_lock(_m) spin_lock(&(_m)->ring_lock)
-#define mem_event_ring_unlock(_m) spin_unlock(&(_m)->ring_lock)
typedef struct mem_event {
@@ -45,7 +41,6 @@ typedef struct mem_event {
mem_event_back_ring_t back_ring;
mem_event_shared_page_t *shared_page;
void *ring_page;
- spinlock_t ring_lock;
} mem_event_t;
Index: xen-4.1.2-testing/tools/xenpaging/spinlock.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/spinlock.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/spinlock.h
- *
- * Spinlock implementation.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#ifndef __SPINLOCK_H__
-#define __SPINLOCK_H__
-
-
-#include "bitops.h"
-
-
-#define SPIN_LOCK_UNLOCKED 0
-
-
-typedef int spinlock_t;
-
-
-static inline void spin_lock(spinlock_t *lock)
-{
- while ( test_and_set_bit(1, lock) );
-}
-
-static inline void spin_lock_init(spinlock_t *lock)
-{
- *lock = SPIN_LOCK_UNLOCKED;
-}
-
-static inline void spin_unlock(spinlock_t *lock)
-{
- *lock = SPIN_LOCK_UNLOCKED;
-}
-
-static inline int spin_trylock(spinlock_t *lock)
-{
- return !test_and_set_bit(1, lock);
-}
-
-
-#endif // __SPINLOCK_H__
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -32,7 +32,6 @@
#include <xen/mem_event.h>
#include "bitops.h"
-#include "spinlock.h"
#include "file_ops.h"
#include "xc.h"
@@ -127,9 +126,6 @@ static xenpaging_t *xenpaging_init(domid
BACK_RING_INIT(&paging->mem_event.back_ring,
(mem_event_sring_t *)paging->mem_event.ring_page,
PAGE_SIZE);
-
- /* Initialise lock */
- mem_event_ring_lock_init(&paging->mem_event);
/* Initialise Xen */
rc = xc_mem_event_enable(xch, paging->mem_event.domain_id,
@@ -302,8 +298,6 @@ static int get_request(mem_event_t *mem_
mem_event_back_ring_t *back_ring;
RING_IDX req_cons;
- mem_event_ring_lock(mem_event);
-
back_ring = &mem_event->back_ring;
req_cons = back_ring->req_cons;
@@ -315,8 +309,6 @@ static int get_request(mem_event_t *mem_
back_ring->req_cons = req_cons;
back_ring->sring->req_event = req_cons + 1;
- mem_event_ring_unlock(mem_event);
-
return 0;
}
@@ -325,8 +317,6 @@ static int put_response(mem_event_t *mem
mem_event_back_ring_t *back_ring;
RING_IDX rsp_prod;
- mem_event_ring_lock(mem_event);
-
back_ring = &mem_event->back_ring;
rsp_prod = back_ring->rsp_prod_pvt;
@@ -338,8 +328,6 @@ static int put_response(mem_event_t *mem
back_ring->rsp_prod_pvt = rsp_prod;
RING_PUSH_RESPONSES(back_ring);
- mem_event_ring_unlock(mem_event);
-
return 0;
}
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -25,7 +25,6 @@
#define __XEN_PAGING2_H__
-#include "spinlock.h"
#include "xc.h"
#include <xc_private.h>
++++++ 23576-x86_show_page_walk_also_for_early_page_faults.patch ++++++
changeset: 23576:e2235fe267eb
user: Jan Beulich <jbeulich(a)novell.com>
date: Thu Jun 23 11:35:55 2011 +0100
files: xen/arch/x86/mm.c xen/arch/x86/traps.c xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/mm.c xen/arch/x86/x86_64/traps.c
description:
x86: show page walk also for early page faults
At once, move the common (between 32- and 64-bit) definition of
machine_to_phys_mapping_valid to a common location.
Signed-off-by: Jan Beulich <jbeulich(a)novell.com>
---
xen/arch/x86/mm.c | 2 ++
xen/arch/x86/traps.c | 1 +
xen/arch/x86/x86_32/mm.c | 2 --
xen/arch/x86/x86_32/traps.c | 9 ++++++---
xen/arch/x86/x86_64/mm.c | 2 --
xen/arch/x86/x86_64/traps.c | 12 ++++++++----
6 files changed, 17 insertions(+), 11 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/mm.c
@@ -151,6 +151,8 @@ unsigned long __read_mostly pdx_group_va
(FRAMETABLE_SIZE / sizeof(*frame_table) + PDX_GROUP_COUNT - 1)
/ PDX_GROUP_COUNT)] = { [0] = 1 };
+bool_t __read_mostly machine_to_phys_mapping_valid = 0;
+
#define PAGE_CACHE_ATTRS (_PAGE_PAT|_PAGE_PCD|_PAGE_PWT)
bool_t __read_mostly opt_allow_superpage;
Index: xen-4.1.2-testing/xen/arch/x86/traps.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/traps.c
+++ xen-4.1.2-testing/xen/arch/x86/traps.c
@@ -1428,6 +1428,7 @@ asmlinkage void __init do_early_page_fau
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);
+ show_page_walk(cr2);
printk("Stack dump: ");
while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
printk("%p ", _p(*stk++));
Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
@@ -39,8 +39,6 @@ extern l1_pgentry_t l1_identmap[L1_PAGET
unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR;
unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
-bool_t __read_mostly machine_to_phys_mapping_valid = 0;
-
static unsigned long __read_mostly mpt_size;
void *alloc_xen_pagetable(void)
Index: xen-4.1.2-testing/xen/arch/x86/x86_32/traps.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_32/traps.c
@@ -164,7 +164,8 @@ void show_page_walk(unsigned long addr)
l3t += (cr3 & 0xFE0UL) >> 3;
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
unmap_domain_page(l3t);
@@ -175,7 +176,8 @@ void show_page_walk(unsigned long addr)
l2t = map_domain_page(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -188,7 +190,8 @@ void show_page_walk(unsigned long addr)
l1t = map_domain_page(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
unmap_domain_page(l1t);
Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
@@ -47,8 +47,6 @@ unsigned int __read_mostly pfn_pdx_hole_
unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
-bool_t __read_mostly machine_to_phys_mapping_valid = 0;
-
/* Top-level master (and idle-domain) page directory. */
l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
idle_pg_table[L4_PAGETABLE_ENTRIES];
Index: xen-4.1.2-testing/xen/arch/x86/x86_64/traps.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/traps.c
@@ -176,7 +176,8 @@ void show_page_walk(unsigned long addr)
l4t = mfn_to_virt(mfn);
l4e = l4t[l4_table_offset(addr)];
mfn = l4e_get_pfn(l4e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L4[0x%03lx] = %"PRIpte" %016lx\n",
l4_table_offset(addr), l4e_get_intpte(l4e), pfn);
if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) ||
@@ -186,7 +187,8 @@ void show_page_walk(unsigned long addr)
l3t = mfn_to_virt(mfn);
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L3[0x%03lx] = %"PRIpte" %016lx%s\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn,
(l3e_get_flags(l3e) & _PAGE_PSE) ? " (PSE)" : "");
@@ -198,7 +200,8 @@ void show_page_walk(unsigned long addr)
l2t = mfn_to_virt(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L2[0x%03lx] = %"PRIpte" %016lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -210,7 +213,8 @@ void show_page_walk(unsigned long addr)
l1t = mfn_to_virt(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L1[0x%03lx] = %"PRIpte" %016lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
}
++++++ 23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch ++++++
++++ 1023 lines (skipped)
++++++ 23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch ++++++
changeset: 23578:7299a9a44b35
user: Olaf Hering <olaf(a)aepfle.de>
date: Wed Jun 22 14:47:09 2011 +0100
files: tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: add xs_handle to struct xenpaging
A xs_handle is currently used in the xc_mem_paging_flush_ioemu_cache()
function and will be used by a subsequent patch.
Add it to struct xenpaging.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell(a)citrix.com>
---
tools/xenpaging/xenpaging.c | 14 ++++++++++++++
tools/xenpaging/xenpaging.h | 1 +
2 files changed, 15 insertions(+)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -28,6 +28,7 @@
#include <signal.h>
#include <unistd.h>
#include <xc_private.h>
+#include <xs.h>
#include <xen/mem_event.h>
@@ -92,6 +93,14 @@ static xenpaging_t *xenpaging_init(domid
paging = malloc(sizeof(xenpaging_t));
memset(paging, 0, sizeof(xenpaging_t));
+ /* Open connection to xenstore */
+ paging->xs_handle = xs_open(0);
+ if ( paging->xs_handle == NULL )
+ {
+ ERROR("Error initialising xenstore connection");
+ goto err;
+ }
+
p = getenv("XENPAGING_POLICY_MRU_SIZE");
if ( p && *p )
{
@@ -221,6 +230,8 @@ static xenpaging_t *xenpaging_init(domid
err:
if ( paging )
{
+ if ( paging->xs_handle )
+ xs_close(paging->xs_handle);
xc_interface_close(xch);
if ( paging->mem_event.shared_page )
{
@@ -277,6 +288,9 @@ static int xenpaging_teardown(xenpaging_
}
paging->mem_event.xce_handle = NULL;
+ /* Close connection to xenstore */
+ xs_close(paging->xs_handle);
+
/* Close connection to Xen */
rc = xc_interface_close(xch);
if ( rc != 0 )
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -36,6 +36,7 @@
typedef struct xenpaging {
xc_interface *xc_handle;
+ struct xs_handle *xs_handle;
xc_platform_info_t *platform_info;
xc_domaininfo_t *domain_info;
++++++ 23579-xenpaging_drop_xc.c_remove_ASSERT.patch ++++++
changeset: 23579:868c8c898f73
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:06 2011 +0200
files: tools/xenpaging/policy_default.c tools/xenpaging/xc.h
description:
xenpaging: drop xc.c, remove ASSERT
The ASSERT is not needed, victim is never NULL.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/policy_default.c | 1 -
tools/xenpaging/xc.h | 7 -------
2 files changed, 8 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/policy_default.c
+++ xen-4.1.2-testing/tools/xenpaging/policy_default.c
@@ -78,7 +78,6 @@ int policy_choose_victim(xenpaging_t *pa
{
xc_interface *xch = paging->xc_handle;
unsigned long wrap = current_gfn;
- ASSERT(victim != NULL);
do
{
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -30,13 +30,6 @@
#include <xen/mem_event.h>
-#if 1
-#define ASSERT(_p) \
- if ( !(_p) ) { DPRINTF("Assertion '%s' failed, line %d, file %s", #_p , \
- __LINE__, __FILE__); *(int*)0=0; }
-#else
-#define ASSERT(_p) ((void)0)
-#endif
++++++ 23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch ++++++
changeset: 23580:771b6984aa2a
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:07 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: drop xc.c, remove xc_platform_info_t
xc_platform_info_t is not used in xenpaging.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 10 ----------
tools/xenpaging/xc.h | 8 --------
tools/xenpaging/xenpaging.c | 17 -----------------
tools/xenpaging/xenpaging.h | 1 -
4 files changed, 36 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -26,7 +26,6 @@
#include <stdarg.h>
#include <sys/poll.h>
#include <xc_private.h>
-#include <xg_save_restore.h>
#include <xs.h>
#include "xc.h"
@@ -97,15 +96,6 @@ int xc_wait_for_event(xc_interface *xch,
return xc_wait_for_event_or_timeout(xch, xce, -1);
}
-int xc_get_platform_info(xc_interface *xc_handle, domid_t domain_id,
- xc_platform_info_t *platform_info)
-{
- return get_platform_info(xc_handle, domain_id,
- &platform_info->max_mfn,
- &platform_info->hvirt_start,
- &platform_info->pt_levels,
- &platform_info->guest_width);
-}
/*
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -34,12 +34,6 @@
-typedef struct xc_platform_info {
- unsigned long max_mfn;
- unsigned long hvirt_start;
- unsigned int pt_levels;
- unsigned int guest_width;
-} xc_platform_info_t;
@@ -47,8 +41,6 @@ int xc_mem_paging_flush_ioemu_cache(domi
int xc_wait_for_event(xc_interface *xch, xc_evtchn *xce);
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
-int xc_get_platform_info(xc_interface *xc_handle, domid_t domain_id,
- xc_platform_info_t *platform_info);
#endif // __XC_H__
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -176,22 +176,6 @@ static xenpaging_t *xenpaging_init(domid
paging->mem_event.port = rc;
- /* Get platform info */
- paging->platform_info = malloc(sizeof(xc_platform_info_t));
- if ( paging->platform_info == NULL )
- {
- ERROR("Error allocating memory for platform info");
- goto err;
- }
-
- rc = xc_get_platform_info(xch, paging->mem_event.domain_id,
- paging->platform_info);
- if ( rc != 1 )
- {
- ERROR("Error getting platform info");
- goto err;
- }
-
/* Get domaininfo */
paging->domain_info = malloc(sizeof(xc_domaininfo_t));
if ( paging->domain_info == NULL )
@@ -246,7 +230,6 @@ static xenpaging_t *xenpaging_init(domid
}
free(paging->bitmap);
- free(paging->platform_info);
free(paging->domain_info);
free(paging);
}
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -38,7 +38,6 @@ typedef struct xenpaging {
xc_interface *xc_handle;
struct xs_handle *xs_handle;
- xc_platform_info_t *platform_info;
xc_domaininfo_t *domain_info;
unsigned long *bitmap;
++++++ 23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch ++++++
changeset: 23581:9ce56626a5ab
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:08 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h
description:
xenpaging: drop xc.c, remove xc_wait_for_event
xc_wait_for_event is not used in xenpaging.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 4 ----
tools/xenpaging/xc.h | 1 -
2 files changed, 5 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -91,10 +91,6 @@ int xc_wait_for_event_or_timeout(xc_inte
return -errno;
}
-int xc_wait_for_event(xc_interface *xch, xc_evtchn *xce)
-{
- return xc_wait_for_event_or_timeout(xch, xce, -1);
-}
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -38,7 +38,6 @@
int xc_mem_paging_flush_ioemu_cache(domid_t domain_id);
-int xc_wait_for_event(xc_interface *xch, xc_evtchn *xce);
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
++++++ 23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch ++++++
changeset: 23582:480e548fe76b
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:10 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c
description:
xenpaging: drop xc.c, move xc_mem_paging_flush_ioemu_cache
Move xc_mem_paging_flush_ioemu_cache() into xenpaging and massage it a bit to
use the required members from xenpaging_t.
Also update type of rc to match xs_write() return value.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 18 ------------------
tools/xenpaging/xc.h | 1 -
tools/xenpaging/xenpaging.c | 16 +++++++++++++++-
3 files changed, 15 insertions(+), 20 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -31,24 +31,6 @@
-int xc_mem_paging_flush_ioemu_cache(domid_t domain_id)
-{
- struct xs_handle *xsh = NULL;
- char path[80];
- int rc;
-
- sprintf(path, "/local/domain/0/device-model/%u/command", domain_id);
-
- xsh = xs_daemon_open();
- if ( xsh == NULL )
- return -EIO;
-
- rc = xs_write(xsh, XBT_NULL, path, "flush-cache", strlen("flush-cache"));
-
- xs_daemon_close(xsh);
-
- return rc ? 0 : -1;
-}
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms)
{
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -37,7 +37,6 @@
-int xc_mem_paging_flush_ioemu_cache(domid_t domain_id);
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -48,6 +48,20 @@ static void close_handler(int sig)
unlink(filename);
}
+static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
+{
+ struct xs_handle *xsh = paging->xs_handle;
+ domid_t domain_id = paging->mem_event.domain_id;
+ char path[80];
+ bool rc;
+
+ sprintf(path, "/local/domain/0/device-model/%u/command", domain_id);
+
+ rc = xs_write(xsh, XBT_NULL, path, "flush-cache", strlen("flush-cache"));
+
+ return rc == true ? 0 : -1;
+}
+
static void *init_page(void)
{
void *buffer;
@@ -484,7 +498,7 @@ static int evict_victim(xenpaging_t *pag
else
{
if ( j++ % 1000 == 0 )
- if ( xc_mem_paging_flush_ioemu_cache(paging->mem_event.domain_id) )
+ if ( xenpaging_mem_paging_flush_ioemu_cache(paging) )
ERROR("Error flushing ioemu cache");
}
}
++++++ 23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch ++++++
changeset: 23583:235d8fdcb3a9
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:11 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c
description:
xenpaging: drop xc.c, move xc_wait_for_event_or_timeout
Move xc_wait_for_event_or_timeout() into xenpaging and massage it a bit for
further changes in subsequent patches.
Include poll.h instead of sys/poll.h.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 40 ------------------------------------
tools/xenpaging/xc.h | 1
tools/xenpaging/xenpaging.c | 48 +++++++++++++++++++++++++++++++++++++++++---
3 files changed, 45 insertions(+), 44 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -32,46 +32,6 @@
-int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms)
-{
- struct pollfd fd = { .fd = xc_evtchn_fd(xce), .events = POLLIN | POLLERR };
- int port;
- int rc;
-
- rc = poll(&fd, 1, ms);
- if ( rc == -1 )
- {
- if (errno == EINTR)
- return 0;
-
- ERROR("Poll exited with an error");
- goto err;
- }
-
- if ( rc == 1 )
- {
- port = xc_evtchn_pending(xce);
- if ( port == -1 )
- {
- ERROR("Failed to read port from event channel");
- goto err;
- }
-
- rc = xc_evtchn_unmask(xce, port);
- if ( rc != 0 )
- {
- ERROR("Failed to unmask event channel port");
- goto err;
- }
- }
- else
- port = -1;
-
- return port;
-
- err:
- return -errno;
-}
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -37,7 +37,6 @@
-int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -27,6 +27,7 @@
#include <time.h>
#include <signal.h>
#include <unistd.h>
+#include <poll.h>
#include <xc_private.h>
#include <xs.h>
@@ -62,6 +63,47 @@ static int xenpaging_mem_paging_flush_io
return rc == true ? 0 : -1;
}
+static int xenpaging_wait_for_event_or_timeout(xenpaging_t *paging)
+{
+ xc_interface *xch = paging->xc_handle;
+ xc_evtchn *xce = paging->mem_event.xce_handle;
+ struct pollfd fd[1];
+ int port;
+ int rc;
+
+ fd[0].fd = xc_evtchn_fd(xce);
+ fd[0].events = POLLIN | POLLERR;
+ rc = poll(fd, 1, 100);
+ if ( rc < 0 )
+ {
+ if (errno == EINTR)
+ return 0;
+
+ ERROR("Poll exited with an error");
+ return -errno;
+ }
+
+ if ( rc && fd[0].revents & POLLIN )
+ {
+ DPRINTF("Got event from evtchn\n");
+ port = xc_evtchn_pending(xce);
+ if ( port == -1 )
+ {
+ ERROR("Failed to read port from event channel");
+ rc = -1;
+ goto err;
+ }
+
+ rc = xc_evtchn_unmask(xce, port);
+ if ( rc < 0 )
+ {
+ ERROR("Failed to unmask event channel port");
+ }
+ }
+err:
+ return rc;
+}
+
static void *init_page(void)
{
void *buffer;
@@ -598,13 +640,13 @@ int main(int argc, char *argv[])
while ( !interrupted )
{
/* Wait for Xen to signal that a page needs paged in */
- rc = xc_wait_for_event_or_timeout(xch, paging->mem_event.xce_handle, 100);
- if ( rc < -1 )
+ rc = xenpaging_wait_for_event_or_timeout(paging);
+ if ( rc < 0 )
{
ERROR("Error getting event");
goto out;
}
- else if ( rc != -1 )
+ else if ( rc != 0 )
{
DPRINTF("Got event from Xen\n");
}
++++++ 23584-xenpaging_drop_xc.c_remove_xc_files.patch ++++++
changeset: 23584:e30cff57b146
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:12 2011 +0200
files: tools/xenpaging/Makefile tools/xenpaging/mem_event.h tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: drop xc.c, remove xc files
Finally remove xc.c/xc.h and its references since both are empty now.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/Makefile | 2 -
tools/xenpaging/mem_event.h | 1
tools/xenpaging/xc.c | 47 --------------------------------------
tools/xenpaging/xc.h | 54 --------------------------------------------
tools/xenpaging/xenpaging.c | 1
tools/xenpaging/xenpaging.h | 1
6 files changed, 1 insertion(+), 105 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/Makefile
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/Makefile
+++ xen-4.1.2-testing/tools/xenpaging/Makefile
@@ -9,7 +9,7 @@ LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS
POLICY = default
SRC :=
-SRCS += file_ops.c xc.c xenpaging.c policy_$(POLICY).c
+SRCS += file_ops.c xenpaging.c policy_$(POLICY).c
CFLAGS += -Werror
CFLAGS += -Wno-unused
Index: xen-4.1.2-testing/tools/xenpaging/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/mem_event.h
+++ xen-4.1.2-testing/tools/xenpaging/mem_event.h
@@ -25,7 +25,6 @@
#define __XEN_MEM_EVENT_H__
-#include "xc.h"
#include <xc_private.h>
#include <xen/event_channel.h>
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/lib/xc.c
- *
- * libxc-type add-ons for paging support.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#include <errno.h>
-#include <string.h>
-#include <stdarg.h>
-#include <sys/poll.h>
-#include <xc_private.h>
-#include <xs.h>
-#include "xc.h"
-
-
-
-
-
-
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/lib/xc.h
- *
- * libxc add-ons.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#ifndef __XC_H__
-#define __XC_H__
-
-
-#include <stdarg.h>
-#include <xc_private.h>
-#include <xen/mem_event.h>
-
-
-
-
-
-
-
-
-
-
-
-
-#endif // __XC_H__
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -35,7 +35,6 @@
#include "xc_bitops.h"
#include "file_ops.h"
-#include "xc.h"
#include "policy.h"
#include "xenpaging.h"
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -25,7 +25,6 @@
#define __XEN_PAGING2_H__
-#include "xc.h"
#include <xc_private.h>
#include <xen/event_channel.h>
++++++ 23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch ++++++
changeset: 23585:b4d18ac00a46
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:14 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: correct dropping of pages to avoid full ring buffer
Doing a one-way channel from Xen to xenpaging is not possible with the
current ring buffer implementation. xenpaging uses the mem_event ring
buffer, which expects request/response pairs to make progress. The
previous patch, which tried to establish a one-way communication from
Xen to xenpaging, stalled the guest once the buffer was filled up with
requests. Correct page-dropping by taking the slow path and let
p2m_mem_paging_resume() consume the response from xenpaging. This makes
room for yet another request/response pair and avoids hanging guests.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -690,19 +690,19 @@ int main(int argc, char *argv[])
ERROR("Error populating page");
goto out;
}
+ }
- /* Prepare the response */
- rsp.gfn = req.gfn;
- rsp.p2mt = req.p2mt;
- rsp.vcpu_id = req.vcpu_id;
- rsp.flags = req.flags;
+ /* Prepare the response */
+ rsp.gfn = req.gfn;
+ rsp.p2mt = req.p2mt;
+ rsp.vcpu_id = req.vcpu_id;
+ rsp.flags = req.flags;
- rc = xenpaging_resume_page(paging, &rsp, 1);
- if ( rc != 0 )
- {
- ERROR("Error resuming page");
- goto out;
- }
+ rc = xenpaging_resume_page(paging, &rsp, 1);
+ if ( rc != 0 )
+ {
+ ERROR("Error resuming page");
+ goto out;
}
/* Evict a new page to replace the one we just paged in */
++++++ 23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch ++++++
changeset: 23586:bbdd7413a50a
user: Olaf Hering <olaf(a)aepfle.de>
date: Wed Jun 22 14:47:13 2011 +0100
files: tools/xenpaging/xenpaging.c
description:
xenpaging: do not bounce p2mt back to the hypervisor
do not bounce p2mt back to the hypervisor because p2m_mem_paging_populate()
and p2m_mem_paging_resume() dont make use of p2mt.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 4 ----
1 file changed, 4 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -694,7 +694,6 @@ int main(int argc, char *argv[])
/* Prepare the response */
rsp.gfn = req.gfn;
- rsp.p2mt = req.p2mt;
rsp.vcpu_id = req.vcpu_id;
rsp.flags = req.flags;
@@ -711,10 +710,8 @@ int main(int argc, char *argv[])
else
{
DPRINTF("page already populated (domain = %d; vcpu = %d;"
- " p2mt = %x;"
" gfn = %"PRIx64"; paused = %d)\n",
paging->mem_event.domain_id, req.vcpu_id,
- req.p2mt,
req.gfn, req.flags & MEM_EVENT_FLAG_VCPU_PAUSED);
/* Tell Xen to resume the vcpu */
@@ -723,7 +720,6 @@ int main(int argc, char *argv[])
{
/* Prepare the response */
rsp.gfn = req.gfn;
- rsp.p2mt = req.p2mt;
rsp.vcpu_id = req.vcpu_id;
rsp.flags = req.flags;
++++++ 23587-xenpaging_remove_srand_call.patch ++++++
changeset: 23587:926febc8bd98
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:16 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: remove srand call
The policy uses now a linear algorithm instead of a random one.
Remove the call to srand().
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 3 ---
1 file changed, 3 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -581,9 +581,6 @@ int main(int argc, char *argv[])
domain_id = atoi(argv[1]);
num_pages = atoi(argv[2]);
- /* Seed random-number generator */
- srand(time(NULL));
-
/* Initialise domain paging */
paging = xenpaging_init(domain_id);
if ( paging == NULL )
++++++ 23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch ++++++
changeset: 23588:e48535e70145
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:18 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: remove return values from functions that can not fail
get_request() and put_response() can not fail, remove return value
and update calling functions.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -342,7 +342,7 @@ static int xenpaging_teardown(xenpaging_
return -1;
}
-static int get_request(mem_event_t *mem_event, mem_event_request_t *req)
+static void get_request(mem_event_t *mem_event, mem_event_request_t *req)
{
mem_event_back_ring_t *back_ring;
RING_IDX req_cons;
@@ -357,11 +357,9 @@ static int get_request(mem_event_t *mem_
/* Update ring */
back_ring->req_cons = req_cons;
back_ring->sring->req_event = req_cons + 1;
-
- return 0;
}
-static int put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
+static void put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
{
mem_event_back_ring_t *back_ring;
RING_IDX rsp_prod;
@@ -376,8 +374,6 @@ static int put_response(mem_event_t *mem
/* Update ring */
back_ring->rsp_prod_pvt = rsp_prod;
RING_PUSH_RESPONSES(back_ring);
-
- return 0;
}
static int xenpaging_evict_page(xenpaging_t *paging,
@@ -437,9 +433,7 @@ static int xenpaging_resume_page(xenpagi
int ret;
/* Put the page info on the ring */
- ret = put_response(&paging->mem_event, rsp);
- if ( ret != 0 )
- goto out;
+ put_response(&paging->mem_event, rsp);
/* Notify policy of page being paged in */
if ( notify_policy )
@@ -649,12 +643,7 @@ int main(int argc, char *argv[])
while ( RING_HAS_UNCONSUMED_REQUESTS(&paging->mem_event.back_ring) )
{
- rc = get_request(&paging->mem_event, &req);
- if ( rc != 0 )
- {
- ERROR("Error getting request");
- goto out;
- }
+ get_request(&paging->mem_event, &req);
/* Check if the page has already been paged in */
if ( test_and_clear_bit(req.gfn, paging->bitmap) )
++++++ 23589-xenpaging_catch_xc_mem_paging_resume_errors.patch ++++++
changeset: 23589:49cb290ede16
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:19 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: catch xc_mem_paging_resume errors
In the unlikely event that xc_mem_paging_resume() fails, do not overwrite the
error with the return value from xc_evtchn_notify()
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -442,8 +442,9 @@ static int xenpaging_resume_page(xenpagi
/* Tell Xen page is ready */
ret = xc_mem_paging_resume(paging->xc_handle, paging->mem_event.domain_id,
rsp->gfn);
- ret = xc_evtchn_notify(paging->mem_event.xce_handle,
- paging->mem_event.port);
+ if ( ret == 0 )
+ ret = xc_evtchn_notify(paging->mem_event.xce_handle,
+ paging->mem_event.port);
out:
return ret;
++++++ 23590-xenpaging_remove_local_domain_id_variable.patch ++++++
changeset: 23590:d957acb8bee6
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:20 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: remove local domain_id variable
Remove the local domain_id variable, it is already fetched from
paging->mem_event in other places.
Update the sprintf format string to use unsigned argument.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -552,7 +552,6 @@ static int evict_victim(xenpaging_t *pag
int main(int argc, char *argv[])
{
struct sigaction act;
- domid_t domain_id;
int num_pages;
xenpaging_t *paging;
xenpaging_victim_t *victims;
@@ -573,11 +572,10 @@ int main(int argc, char *argv[])
return -1;
}
- domain_id = atoi(argv[1]);
num_pages = atoi(argv[2]);
/* Initialise domain paging */
- paging = xenpaging_init(domain_id);
+ paging = xenpaging_init(atoi(argv[1]));
if ( paging == NULL )
{
fprintf(stderr, "Error initialising paging");
@@ -585,10 +583,10 @@ int main(int argc, char *argv[])
}
xch = paging->xc_handle;
- DPRINTF("starting %s %u %d\n", argv[0], domain_id, num_pages);
+ DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, num_pages);
/* Open file */
- sprintf(filename, "page_cache_%d", domain_id);
+ sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
fd = open(filename, open_flags, open_mode);
if ( fd < 0 )
{
++++++ 23591-xenpaging_move_num_pages_into_xenpaging_struct.patch ++++++
changeset: 23591:4aaa90c1db42
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:22 2011 +0200
files: tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: move num_pages into xenpaging struct
Move num_pages into struct xenpaging.
num_pages will be used by the policy in a subsequent patch.
Also remove a memset, the victims array is allocated with calloc.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 30 ++++++++++++++----------------
tools/xenpaging/xenpaging.h | 1 +
2 files changed, 15 insertions(+), 16 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -128,7 +128,7 @@ static void *init_page(void)
return NULL;
}
-static xenpaging_t *xenpaging_init(domid_t domain_id)
+static xenpaging_t *xenpaging_init(domid_t domain_id, int num_pages)
{
xenpaging_t *paging;
xc_interface *xch;
@@ -256,6 +256,13 @@ static xenpaging_t *xenpaging_init(domid
}
DPRINTF("max_pages = %"PRIx64"\n", paging->domain_info->max_pages);
+ if ( num_pages < 0 || num_pages > paging->domain_info->max_pages )
+ {
+ num_pages = paging->domain_info->max_pages;
+ DPRINTF("setting num_pages to %d\n", num_pages);
+ }
+ paging->num_pages = num_pages;
+
/* Initialise policy */
rc = policy_init(paging);
if ( rc != 0 )
@@ -552,7 +559,6 @@ static int evict_victim(xenpaging_t *pag
int main(int argc, char *argv[])
{
struct sigaction act;
- int num_pages;
xenpaging_t *paging;
xenpaging_victim_t *victims;
mem_event_request_t req;
@@ -572,10 +578,8 @@ int main(int argc, char *argv[])
return -1;
}
- num_pages = atoi(argv[2]);
-
/* Initialise domain paging */
- paging = xenpaging_init(atoi(argv[1]));
+ paging = xenpaging_init(atoi(argv[1]), atoi(argv[2]));
if ( paging == NULL )
{
fprintf(stderr, "Error initialising paging");
@@ -583,7 +587,7 @@ int main(int argc, char *argv[])
}
xch = paging->xc_handle;
- DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, num_pages);
+ DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->num_pages);
/* Open file */
sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
@@ -594,12 +598,7 @@ int main(int argc, char *argv[])
return 2;
}
- if ( num_pages < 0 || num_pages > paging->domain_info->max_pages )
- {
- num_pages = paging->domain_info->max_pages;
- DPRINTF("setting num_pages to %d\n", num_pages);
- }
- victims = calloc(num_pages, sizeof(xenpaging_victim_t));
+ victims = calloc(paging->num_pages, sizeof(xenpaging_victim_t));
/* ensure that if we get a signal, we'll do cleanup, then exit */
act.sa_handler = close_handler;
@@ -611,8 +610,7 @@ int main(int argc, char *argv[])
sigaction(SIGALRM, &act, NULL);
/* Evict pages */
- memset(victims, 0, sizeof(xenpaging_victim_t) * num_pages);
- for ( i = 0; i < num_pages; i++ )
+ for ( i = 0; i < paging->num_pages; i++ )
{
rc = evict_victim(paging, &victims[i], fd, i);
if ( rc == -ENOSPC )
@@ -648,13 +646,13 @@ int main(int argc, char *argv[])
if ( test_and_clear_bit(req.gfn, paging->bitmap) )
{
/* Find where in the paging file to read from */
- for ( i = 0; i < num_pages; i++ )
+ for ( i = 0; i < paging->num_pages; i++ )
{
if ( victims[i].gfn == req.gfn )
break;
}
- if ( i >= num_pages )
+ if ( i >= paging->num_pages )
{
DPRINTF("Couldn't find page %"PRIx64"\n", req.gfn);
goto out;
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -42,6 +42,7 @@ typedef struct xenpaging {
unsigned long *bitmap;
mem_event_t mem_event;
+ int num_pages;
int policy_mru_size;
} xenpaging_t;
++++++ 23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch ++++++
changeset: 23592:1e44e75d889c
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:23 2011 +0200
files: tools/xenpaging/policy_default.c
description:
xenpaging: start paging in the middle of gfn range
Set the starting gfn to somewhere in the middle of the gfn range to
avoid paging during BIOS startup. This can speedup booting of a guest.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/policy_default.c | 4 ++++
1 file changed, 4 insertions(+)
Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/policy_default.c
+++ xen-4.1.2-testing/tools/xenpaging/policy_default.c
@@ -69,6 +69,10 @@ int policy_init(xenpaging_t *paging)
/* Don't page out page 0 */
set_bit(0, bitmap);
+ /* Start in the middle to avoid paging during BIOS startup */
+ current_gfn = max_pages / 2;
+ current_gfn -= paging->num_pages / 2;
+
rc = 0;
out:
return rc;
++++++ 23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch ++++++
changeset: 23593:7d72475641fa
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:24 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: pass integer to xenpaging_populate_page
Pass gfn as integer to xenpaging_populate_page(). xc_map_foreign_pages()
takes a pointer to a list of gfns, but its a const pointer. So writing
the value back to the caller is not needed.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -458,27 +458,24 @@ static int xenpaging_resume_page(xenpagi
}
static int xenpaging_populate_page(xenpaging_t *paging,
- uint64_t *gfn, int fd, int i)
+ xen_pfn_t gfn, int fd, int i)
{
xc_interface *xch = paging->xc_handle;
- unsigned long _gfn;
void *page;
int ret;
unsigned char oom = 0;
- _gfn = *gfn;
- DPRINTF("populate_page < gfn %lx pageslot %d\n", _gfn, i);
+ DPRINTF("populate_page < gfn %"PRI_xen_pfn" pageslot %d\n", gfn, i);
do
{
/* Tell Xen to allocate a page for the domain */
- ret = xc_mem_paging_prep(xch, paging->mem_event.domain_id,
- _gfn);
+ ret = xc_mem_paging_prep(xch, paging->mem_event.domain_id, gfn);
if ( ret != 0 )
{
if ( errno == ENOMEM )
{
if ( oom++ == 0 )
- DPRINTF("ENOMEM while preparing gfn %lx\n", _gfn);
+ DPRINTF("ENOMEM while preparing gfn %"PRI_xen_pfn"\n", gfn);
sleep(1);
continue;
}
@@ -491,8 +488,7 @@ static int xenpaging_populate_page(xenpa
/* Map page */
ret = -EFAULT;
page = xc_map_foreign_pages(xch, paging->mem_event.domain_id,
- PROT_READ | PROT_WRITE, &_gfn, 1);
- *gfn = _gfn;
+ PROT_READ | PROT_WRITE, &gfn, 1);
if ( page == NULL )
{
ERROR("Error mapping page: page is null");
@@ -667,7 +663,7 @@ int main(int argc, char *argv[])
else
{
/* Populate the page */
- rc = xenpaging_populate_page(paging, &req.gfn, fd, i);
+ rc = xenpaging_populate_page(paging, req.gfn, fd, i);
if ( rc != 0 )
{
ERROR("Error populating page");
++++++ 23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch ++++++
changeset: 23594:2fe46305a00d
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:25 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: add helper function for unlinking pagefile
Unlink pagefile in the signal handler and also in the exit path.
This does not leave a stale pagefile if an error occoured.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -41,11 +41,20 @@
static char filename[80];
static int interrupted;
-static void close_handler(int sig)
+
+static void unlink_pagefile(void)
{
- interrupted = sig;
if ( filename[0] )
+ {
unlink(filename);
+ filename[0] = '\0';
+ }
+}
+
+static void close_handler(int sig)
+{
+ interrupted = sig;
+ unlink_pagefile();
}
static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
@@ -716,6 +725,7 @@ int main(int argc, char *argv[])
out:
close(fd);
+ unlink_pagefile();
free(victims);
/* Tear down domain paging */
++++++ 23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch ++++++
changeset: 23595:389c8bf31688
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:27 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: add watch thread to catch guest shutdown
If xenpaging is started manually then no event is sent to xenpaging when
the guest is shutdown or rebooted. Add a watch on the @releaseDomain
node to leave the loop and gracefully shutdown the pager.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -39,6 +39,7 @@
#include "policy.h"
#include "xenpaging.h"
+static char watch_token[16];
static char filename[80];
static int interrupted;
@@ -75,13 +76,19 @@ static int xenpaging_wait_for_event_or_t
{
xc_interface *xch = paging->xc_handle;
xc_evtchn *xce = paging->mem_event.xce_handle;
- struct pollfd fd[1];
+ char **vec;
+ unsigned int num;
+ struct pollfd fd[2];
int port;
int rc;
+ /* Wait for event channel and xenstore */
fd[0].fd = xc_evtchn_fd(xce);
fd[0].events = POLLIN | POLLERR;
- rc = poll(fd, 1, 100);
+ fd[1].fd = xs_fileno(paging->xs_handle);
+ fd[1].events = POLLIN | POLLERR;
+
+ rc = poll(fd, 2, 100);
if ( rc < 0 )
{
if (errno == EINTR)
@@ -91,6 +98,27 @@ static int xenpaging_wait_for_event_or_t
return -errno;
}
+ /* First check for guest shutdown */
+ if ( rc && fd[1].revents & POLLIN )
+ {
+ DPRINTF("Got event from xenstore\n");
+ vec = xs_read_watch(paging->xs_handle, &num);
+ if ( vec )
+ {
+ if ( strcmp(vec[XS_WATCH_TOKEN], watch_token) == 0 )
+ {
+ /* If our guest disappeared, set interrupt flag and fall through */
+ if ( xs_is_domain_introduced(paging->xs_handle, paging->mem_event.domain_id) == false )
+ {
+ xs_unwatch(paging->xs_handle, "@releaseDomain", watch_token);
+ interrupted = SIGQUIT;
+ rc = 0;
+ }
+ }
+ free(vec);
+ }
+ }
+
if ( rc && fd[0].revents & POLLIN )
{
DPRINTF("Got event from evtchn\n");
@@ -165,6 +193,14 @@ static xenpaging_t *xenpaging_init(domid
goto err;
}
+ /* write domain ID to watch so we can ignore other domain shutdowns */
+ snprintf(watch_token, sizeof(watch_token), "%u", domain_id);
+ if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
+ {
+ ERROR("Could not bind to shutdown watch\n");
+ goto err;
+ }
+
p = getenv("XENPAGING_POLICY_MRU_SIZE");
if ( p && *p )
{
++++++ 23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch ++++++
changeset: 23596:c49e22648d0e
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:28 2011 +0200
files: tools/xenpaging/Makefile tools/xenpaging/pagein.c tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: implement stopping of pager by sending SIGTERM/SIGINT
Write all paged-out pages back into the guest if the pager is
interrupted by ctrl-c or if it receives SIGTERM.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/Makefile | 1
tools/xenpaging/pagein.c | 68 ++++++++++++++++++++++++++++++++++++++++++++
tools/xenpaging/xenpaging.c | 35 ++++++++++++++++++++--
tools/xenpaging/xenpaging.h | 3 +
4 files changed, 104 insertions(+), 3 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/Makefile
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/Makefile
+++ xen-4.1.2-testing/tools/xenpaging/Makefile
@@ -10,6 +10,7 @@ POLICY = default
SRC :=
SRCS += file_ops.c xenpaging.c policy_$(POLICY).c
+SRCS += pagein.c
CFLAGS += -Werror
CFLAGS += -Wno-unused
Index: xen-4.1.2-testing/tools/xenpaging/pagein.c
===================================================================
--- /dev/null
+++ xen-4.1.2-testing/tools/xenpaging/pagein.c
@@ -0,0 +1,68 @@
+/* Trigger a page-in in a separate thread-of-execution to avoid deadlock */
+#include <pthread.h>
+#include "xc_private.h"
+
+struct page_in_args {
+ domid_t dom;
+ xc_interface *xch;
+};
+
+static struct page_in_args page_in_args;
+static unsigned long page_in_gfn;
+static unsigned int page_in_possible;
+
+static pthread_t page_in_thread;
+static pthread_cond_t page_in_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t page_in_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+static void *page_in(void *arg)
+{
+ struct page_in_args *pia = arg;
+ void *page;
+ xen_pfn_t gfn;
+
+ while (1)
+ {
+ pthread_mutex_lock(&page_in_mutex);
+ while (!page_in_gfn)
+ pthread_cond_wait(&page_in_cond, &page_in_mutex);
+ gfn = page_in_gfn;
+ page_in_gfn = 0;
+ pthread_mutex_unlock(&page_in_mutex);
+
+ /* Ignore errors */
+ page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, &gfn, 1);
+ if (page)
+ munmap(page, PAGE_SIZE);
+ }
+ page_in_possible = 0;
+ pthread_exit(NULL);
+}
+
+void page_in_trigger(unsigned long gfn)
+{
+ if (!page_in_possible)
+ return;
+
+ pthread_mutex_lock(&page_in_mutex);
+ page_in_gfn = gfn;
+ pthread_mutex_unlock(&page_in_mutex);
+ pthread_cond_signal(&page_in_cond);
+}
+
+void create_page_in_thread(domid_t domain_id, xc_interface *xch)
+{
+ page_in_args.dom = domain_id;
+ page_in_args.xch = xch;
+ if (pthread_create(&page_in_thread, NULL, page_in, &page_in_args) == 0)
+ page_in_possible = 1;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -650,6 +650,9 @@ int main(int argc, char *argv[])
sigaction(SIGINT, &act, NULL);
sigaction(SIGALRM, &act, NULL);
+ /* listen for page-in events to stop pager */
+ create_page_in_thread(paging->mem_event.domain_id, xch);
+
/* Evict pages */
for ( i = 0; i < paging->num_pages; i++ )
{
@@ -665,7 +668,7 @@ int main(int argc, char *argv[])
DPRINTF("%d pages evicted. Done.\n", i);
/* Swap pages in and out */
- while ( !interrupted )
+ while ( 1 )
{
/* Wait for Xen to signal that a page needs paged in */
rc = xenpaging_wait_for_event_or_timeout(paging);
@@ -728,8 +731,12 @@ int main(int argc, char *argv[])
goto out;
}
- /* Evict a new page to replace the one we just paged in */
- evict_victim(paging, &victims[i], fd, i);
+ /* Evict a new page to replace the one we just paged in,
+ * or clear this pagefile slot on exit */
+ if ( interrupted )
+ victims[i].gfn = INVALID_MFN;
+ else
+ evict_victim(paging, &victims[i], fd, i);
}
else
{
@@ -756,6 +763,28 @@ int main(int argc, char *argv[])
}
}
}
+
+ /* Write all pages back into the guest */
+ if ( interrupted == SIGTERM || interrupted == SIGINT )
+ {
+ for ( i = 0; i < paging->domain_info->max_pages; i++ )
+ {
+ if ( test_bit(i, paging->bitmap) )
+ {
+ page_in_trigger(i);
+ break;
+ }
+ }
+ /* If no more pages to process, exit loop */
+ if ( i == paging->domain_info->max_pages )
+ break;
+ }
+ else
+ {
+ /* Exit on any other signal */
+ if ( interrupted )
+ break;
+ }
}
DPRINTF("xenpaging got signal %d\n", interrupted);
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -53,6 +53,9 @@ typedef struct xenpaging_victim {
} xenpaging_victim_t;
+extern void create_page_in_thread(domid_t domain_id, xc_interface *xch);
+extern void page_in_trigger(unsigned long gfn);
+
#endif // __XEN_PAGING_H__
++++++ 23597-xenpaging_remove_private_mem_event.h.patch ++++++
changeset: 23597:3dcb553f3ba9
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:29 2011 +0200
files: tools/xenpaging/mem_event.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: remove private mem_event.h
tools/xenpaging/mem_event.h is only included in xenpaging.h.
Add the contents into that file and remove mem_event.h.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/mem_event.h | 57 --------------------------------------------
tools/xenpaging/xenpaging.c | 3 --
tools/xenpaging/xenpaging.h | 11 ++++++--
3 files changed, 8 insertions(+), 63 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/mem_event.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/mem_event.h
- *
- * Memory event structures.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#ifndef __XEN_MEM_EVENT_H__
-#define __XEN_MEM_EVENT_H__
-
-
-#include <xc_private.h>
-
-#include <xen/event_channel.h>
-#include <xen/mem_event.h>
-
-
-
-
-typedef struct mem_event {
- domid_t domain_id;
- xc_evtchn *xce_handle;
- int port;
- mem_event_back_ring_t back_ring;
- mem_event_shared_page_t *shared_page;
- void *ring_page;
-} mem_event_t;
-
-
-#endif // __XEN_MEM_EVENT_H__
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -31,11 +31,8 @@
#include <xc_private.h>
#include <xs.h>
-#include <xen/mem_event.h>
-
#include "xc_bitops.h"
#include "file_ops.h"
-
#include "policy.h"
#include "xenpaging.h"
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -26,12 +26,17 @@
#include <xc_private.h>
-
#include <xen/event_channel.h>
#include <xen/mem_event.h>
-#include "mem_event.h"
-
+typedef struct mem_event {
+ domid_t domain_id;
+ xc_evtchn *xce_handle;
+ int port;
+ mem_event_back_ring_t back_ring;
+ mem_event_shared_page_t *shared_page;
+ void *ring_page;
+} mem_event_t;
typedef struct xenpaging {
xc_interface *xc_handle;
++++++ 23599-tools_fix_build_after_recent_xenpaging_changes.patch ++++++
changeset: 23599:d3027374a8c0
user: Tim Deegan <Tim.Deegan(a)citrix.com>
date: Mon Jun 27 14:48:57 2011 +0100
files: tools/xenpaging/Makefile
description:
tools: fix build after recent xenpaging changes
xenpaging now uses pthreads, so must link appropriately.
Signed-off-by: Tim Deegan <Tim.Deegan(a)citrix.com>
Committed-by: Ian Jackson <ian.jackson(a)eu.citrix.com>
---
tools/xenpaging/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: xen-4.1.2-testing/tools/xenpaging/Makefile
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/Makefile
+++ xen-4.1.2-testing/tools/xenpaging/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
CFLAGS += -I $(XEN_XC)
CFLAGS += -I ./
CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore)
-LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore)
+LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) -pthread
POLICY = default
++++++ 23614-x86_64-EFI-boot.patch ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -2143,7 +2143,7 @@
#include <asm/paging.h>
#include <asm/shadow.h>
#include <asm/page.h>
-@@ -353,6 +354,8 @@ void __init arch_init_memory(void)
+@@ -355,6 +356,8 @@ void __init arch_init_memory(void)
subarch_init_memory();
@@ -2288,7 +2288,7 @@
#include <xen/sched.h>
#include <xen/numa.h>
#include <xen/nodemask.h>
-@@ -828,7 +829,8 @@ void __init zap_low_mappings(void)
+@@ -830,7 +831,8 @@ void __init zap_low_mappings(void)
/* Replace with mapping of the boot trampoline only. */
map_pages_to_xen(BOOT_TRAMPOLINE, BOOT_TRAMPOLINE >> PAGE_SHIFT,
++++++ 23676-x86_64-image-map-bounds.patch ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -18,7 +18,7 @@
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/mm.c
-@@ -776,7 +776,7 @@ static int update_xen_mappings(unsigned
+@@ -778,7 +778,7 @@ static int update_xen_mappings(unsigned
int err = 0;
#ifdef __x86_64__
bool_t alias = mfn >= PFN_DOWN(xen_phys_start) &&
++++++ 23723-x86-CMOS-lock.patch ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -136,7 +136,7 @@
#include <public/arch-x86/cpuid.h>
/*
-@@ -1629,6 +1631,10 @@ static int admin_io_okay(
+@@ -1630,6 +1632,10 @@ static int admin_io_okay(
if ( (port == 0xcf8) && (bytes == 4) )
return 0;
@@ -147,7 +147,7 @@
return ioports_access_permitted(v->domain, port, port + bytes - 1);
}
-@@ -1658,6 +1664,21 @@ static uint32_t guest_io_read(
+@@ -1659,6 +1665,21 @@ static uint32_t guest_io_read(
{
sub_data = pv_pit_handler(port, 0, 0);
}
@@ -169,7 +169,7 @@
else if ( (port == 0xcf8) && (bytes == 4) )
{
size = 4;
-@@ -1683,8 +1704,6 @@ static uint32_t guest_io_read(
+@@ -1684,8 +1705,6 @@ static uint32_t guest_io_read(
return data;
}
@@ -178,7 +178,7 @@
static void guest_io_write(
unsigned int port, unsigned int bytes, uint32_t data,
struct vcpu *v, struct cpu_user_regs *regs)
-@@ -1693,8 +1712,6 @@ static void guest_io_write(
+@@ -1694,8 +1713,6 @@ static void guest_io_write(
{
switch ( bytes ) {
case 1:
@@ -187,7 +187,7 @@
outb((uint8_t)data, port);
if ( pv_post_outb_hook )
pv_post_outb_hook(port, (uint8_t)data);
-@@ -1717,6 +1734,23 @@ static void guest_io_write(
+@@ -1718,6 +1735,23 @@ static void guest_io_write(
{
pv_pit_handler(port, (uint8_t)data, 1);
}
@@ -211,7 +211,7 @@
else if ( (port == 0xcf8) && (bytes == 4) )
{
size = 4;
-@@ -2082,10 +2116,6 @@ static int emulate_privileged_op(struct
+@@ -2083,10 +2117,6 @@ static int emulate_privileged_op(struct
goto fail;
if ( admin_io_okay(port, op_bytes, v, regs) )
{
++++++ 23772-x86-trampoline.patch ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -316,7 +316,7 @@
#include <xen/sched.h>
#include <xen/guest_access.h>
#include <asm/current.h>
-@@ -164,8 +165,9 @@ void __init zap_low_mappings(l2_pgentry_
+@@ -166,8 +167,9 @@ void __init zap_low_mappings(l2_pgentry_
flush_all(FLUSH_TLB_GLOBAL);
/* Replace with mapping of the boot trampoline only. */
@@ -332,7 +332,7 @@
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
-@@ -828,7 +828,7 @@ void __init zap_low_mappings(void)
+@@ -830,7 +830,7 @@ void __init zap_low_mappings(void)
flush_local(FLUSH_TLB_GLOBAL);
/* Replace with mapping of the boot trampoline only. */
++++++ 23817-mem_event_add_ref_counting_for_free_requestslots.patch ++++++
changeset: 23817:083f10851dd8
user: Olaf Hering <olaf(a)aepfle.de>
date: Mon Sep 05 15:10:09 2011 +0100
files: xen/arch/x86/mm/mem_event.c xen/arch/x86/mm/mem_sharing.c xen/arch/x86/mm/p2m.c xen/include/asm-x86/mem_event.h xen/include/xen/sched.h
description:
mem_event: add ref counting for free requestslots
If mem_event_check_ring() is called by many vcpus at the same time
before any of them called also mem_event_put_request(), all of the
callers must assume there are enough free slots available in the ring.
Record the number of request producers in mem_event_check_ring() to
keep track of available free slots.
Add a new mem_event_put_req_producers() function to release a request
attempt made in mem_event_check_ring(). Its required for
p2m_mem_paging_populate() because that function can only modify the
p2m type if there are free request slots. But in some cases
p2m_mem_paging_populate() does not actually have to produce another
request when it is known that the same request was already made
earlier by a different vcpu.
mem_event_check_ring() can not return a reference to a free request
slot because there could be multiple references for different vcpus
and the order of mem_event_put_request() calls is not known. As a
result, incomplete requests could be consumed by the ring user.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
xen/arch/x86/mm/mem_event.c | 19 ++++++++++++-------
xen/arch/x86/mm/mem_sharing.c | 1 -
xen/arch/x86/mm/p2m.c | 1 +
xen/include/asm-x86/mem_event.h | 1 +
xen/include/xen/sched.h | 1 +
5 files changed, 15 insertions(+), 8 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -37,8 +37,6 @@
#define mem_event_ring_lock(_d) spin_lock(&(_d)->mem_event.ring_lock)
#define mem_event_ring_unlock(_d) spin_unlock(&(_d)->mem_event.ring_lock)
-#define MEM_EVENT_RING_THRESHOLD 4
-
static int mem_event_enable(struct domain *d, mfn_t ring_mfn, mfn_t shared_mfn)
{
int rc;
@@ -109,6 +107,7 @@ void mem_event_put_request(struct domain
req_prod++;
/* Update ring */
+ d->mem_event.req_producers--;
front_ring->req_prod_pvt = req_prod;
RING_PUSH_REQUESTS(front_ring);
@@ -153,11 +152,18 @@ void mem_event_mark_and_pause(struct vcp
vcpu_sleep_nosync(v);
}
+void mem_event_put_req_producers(struct domain *d)
+{
+ mem_event_ring_lock(d);
+ d->mem_event.req_producers--;
+ mem_event_ring_unlock(d);
+}
+
int mem_event_check_ring(struct domain *d)
{
struct vcpu *curr = current;
int free_requests;
- int ring_full;
+ int ring_full = 1;
if ( !d->mem_event.ring_page )
return -1;
@@ -165,12 +171,11 @@ int mem_event_check_ring(struct domain *
mem_event_ring_lock(d);
free_requests = RING_FREE_REQUESTS(&d->mem_event.front_ring);
- if ( unlikely(free_requests < 2) )
+ if ( d->mem_event.req_producers < free_requests )
{
- gdprintk(XENLOG_INFO, "free request slots: %d\n", free_requests);
- WARN_ON(free_requests == 0);
+ d->mem_event.req_producers++;
+ ring_full = 0;
}
- ring_full = free_requests < MEM_EVENT_RING_THRESHOLD ? 1 : 0;
if ( (curr->domain->domain_id == d->domain_id) && ring_full )
{
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
@@ -322,7 +322,6 @@ static struct page_info* mem_sharing_all
req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
}
- /* XXX: Need to reserve a request, not just check the ring! */
if(mem_event_check_ring(d)) return page;
req.gfn = gfn;
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2970,6 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_
else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
{
/* gfn is already on its way back and vcpu is not paused */
+ mem_event_put_req_producers(d);
return;
}
Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/asm-x86/mem_event.h
+++ xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
@@ -27,6 +27,7 @@
/* Pauses VCPU while marking pause flag for mem event */
void mem_event_mark_and_pause(struct vcpu *v);
int mem_event_check_ring(struct domain *d);
+void mem_event_put_req_producers(struct domain *d);
void mem_event_put_request(struct domain *d, mem_event_request_t *req);
void mem_event_get_response(struct domain *d, mem_event_response_t *rsp);
void mem_event_unpause_vcpus(struct domain *d);
Index: xen-4.1.2-testing/xen/include/xen/sched.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/xen/sched.h
+++ xen-4.1.2-testing/xen/include/xen/sched.h
@@ -190,6 +190,7 @@ struct mem_event_domain
{
/* ring lock */
spinlock_t ring_lock;
+ unsigned int req_producers;
/* shared page */
mem_event_shared_page_t *shared_page;
/* shared ring page */
++++++ 23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch ++++++
changeset: 23818:0268e7380953
user: Olaf Hering <olaf(a)aepfle.de>
date: Mon Sep 05 15:10:28 2011 +0100
files: xen/arch/x86/mm/mem_event.c
description:
mem_event: use mem_event_mark_and_pause() in mem_event_check_ring()
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
xen/arch/x86/mm/mem_event.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -178,10 +178,7 @@ int mem_event_check_ring(struct domain *
}
if ( (curr->domain->domain_id == d->domain_id) && ring_full )
- {
- set_bit(_VPF_mem_event, &curr->pause_flags);
- vcpu_sleep_nosync(curr);
- }
+ mem_event_mark_and_pause(curr);
mem_event_ring_unlock(d);
++++++ 23827-xenpaging_use_batch_of_pages_during_final_page-in.patch ++++++
changeset: 23827:d1d6abc1db20
user: Olaf Hering <olaf(a)aepfle.de>
date: Tue Sep 13 10:25:32 2011 +0100
files: tools/xenpaging/pagein.c tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: use batch of pages during final page-in
Map up to RING_SIZE pages in exit path to fill the ring instead of
populating one page at a time.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
tools/xenpaging/pagein.c | 36 ++++++++++++++++++++++++------------
tools/xenpaging/xenpaging.c | 18 +++++++++++++-----
tools/xenpaging/xenpaging.h | 7 +++++--
3 files changed, 42 insertions(+), 19 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/pagein.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/pagein.c
+++ xen-4.1.2-testing/tools/xenpaging/pagein.c
@@ -1,14 +1,16 @@
/* Trigger a page-in in a separate thread-of-execution to avoid deadlock */
#include <pthread.h>
-#include "xc_private.h"
+#include <xc_private.h>
+#include "xenpaging.h"
struct page_in_args {
domid_t dom;
+ unsigned long *pagein_queue;
xc_interface *xch;
};
static struct page_in_args page_in_args;
-static unsigned long page_in_gfn;
+static unsigned long page_in_request;
static unsigned int page_in_possible;
static pthread_t page_in_thread;
@@ -19,19 +21,28 @@ static void *page_in(void *arg)
{
struct page_in_args *pia = arg;
void *page;
- xen_pfn_t gfn;
+ int i, num;
+ xen_pfn_t gfns[XENPAGING_PAGEIN_QUEUE_SIZE];
while (1)
{
pthread_mutex_lock(&page_in_mutex);
- while (!page_in_gfn)
+ while (!page_in_request)
pthread_cond_wait(&page_in_cond, &page_in_mutex);
- gfn = page_in_gfn;
- page_in_gfn = 0;
+ num = 0;
+ for (i = 0; i < XENPAGING_PAGEIN_QUEUE_SIZE; i++)
+ {
+ if (!pia->pagein_queue[i])
+ continue;
+ gfns[num] = pia->pagein_queue[i];
+ pia->pagein_queue[i] = 0;
+ num++;
+ }
+ page_in_request = 0;
pthread_mutex_unlock(&page_in_mutex);
/* Ignore errors */
- page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, &gfn, 1);
+ page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, gfns, num);
if (page)
munmap(page, PAGE_SIZE);
}
@@ -39,21 +50,22 @@ static void *page_in(void *arg)
pthread_exit(NULL);
}
-void page_in_trigger(unsigned long gfn)
+void page_in_trigger(void)
{
if (!page_in_possible)
return;
pthread_mutex_lock(&page_in_mutex);
- page_in_gfn = gfn;
+ page_in_request = 1;
pthread_mutex_unlock(&page_in_mutex);
pthread_cond_signal(&page_in_cond);
}
-void create_page_in_thread(domid_t domain_id, xc_interface *xch)
+void create_page_in_thread(xenpaging_t *paging)
{
- page_in_args.dom = domain_id;
- page_in_args.xch = xch;
+ page_in_args.dom = paging->mem_event.domain_id;
+ page_in_args.pagein_queue = paging->pagein_queue;
+ page_in_args.xch = paging->xc_handle;
if (pthread_create(&page_in_thread, NULL, page_in, &page_in_args) == 0)
page_in_possible = 1;
}
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -648,7 +648,7 @@ int main(int argc, char *argv[])
sigaction(SIGALRM, &act, NULL);
/* listen for page-in events to stop pager */
- create_page_in_thread(paging->mem_event.domain_id, xch);
+ create_page_in_thread(paging);
/* Evict pages */
for ( i = 0; i < paging->num_pages; i++ )
@@ -764,16 +764,24 @@ int main(int argc, char *argv[])
/* Write all pages back into the guest */
if ( interrupted == SIGTERM || interrupted == SIGINT )
{
+ int num = 0;
for ( i = 0; i < paging->domain_info->max_pages; i++ )
{
if ( test_bit(i, paging->bitmap) )
{
- page_in_trigger(i);
- break;
+ paging->pagein_queue[num] = i;
+ num++;
+ if ( num == XENPAGING_PAGEIN_QUEUE_SIZE )
+ break;
}
}
- /* If no more pages to process, exit loop */
- if ( i == paging->domain_info->max_pages )
+ /*
+ * One more round if there are still pages to process.
+ * If no more pages to process, exit loop.
+ */
+ if ( num )
+ page_in_trigger();
+ else if ( i == paging->domain_info->max_pages )
break;
}
else
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -29,6 +29,8 @@
#include <xen/event_channel.h>
#include <xen/mem_event.h>
+#define XENPAGING_PAGEIN_QUEUE_SIZE 64
+
typedef struct mem_event {
domid_t domain_id;
xc_evtchn *xce_handle;
@@ -49,6 +51,7 @@ typedef struct xenpaging {
mem_event_t mem_event;
int num_pages;
int policy_mru_size;
+ unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
} xenpaging_t;
@@ -58,8 +61,8 @@ typedef struct xenpaging_victim {
} xenpaging_victim_t;
-extern void create_page_in_thread(domid_t domain_id, xc_interface *xch);
-extern void page_in_trigger(unsigned long gfn);
+extern void create_page_in_thread(xenpaging_t *paging);
+extern void page_in_trigger(void);
#endif // __XEN_PAGING_H__
++++++ 23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch ++++++
changeset: 23841:ed7586b1d515
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Sep 16 12:13:31 2011 +0100
files: xen/arch/x86/hvm/hvm.c xen/arch/x86/mm/mem_event.c xen/arch/x86/mm/mem_sharing.c xen/arch/x86/mm/p2m.c xen/include/asm-x86/mem_event.h
description:
mem_event: pass mem_event_domain pointer to mem_event functions
Pass a struct mem_event_domain pointer to the various mem_event
functions. This will be used in a subsequent patch which creates
different ring buffers for the memshare, xenpaging and memaccess
functionality.
Remove the struct domain argument from some functions.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/hvm/hvm.c | 4 -
xen/arch/x86/mm/mem_event.c | 95 ++++++++++++++++++++--------------------
xen/arch/x86/mm/mem_sharing.c | 6 +-
xen/arch/x86/mm/p2m.c | 18 +++----
xen/include/asm-x86/mem_event.h | 8 +--
5 files changed, 66 insertions(+), 65 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
@@ -3909,7 +3909,7 @@ static int hvm_memory_event_traps(long p
if ( (p & HVMPME_onchangeonly) && (value == old) )
return 1;
- rc = mem_event_check_ring(d);
+ rc = mem_event_check_ring(d, &d->mem_event);
if ( rc )
return rc;
@@ -3932,7 +3932,7 @@ static int hvm_memory_event_traps(long p
req.gla_valid = 1;
}
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
return 1;
}
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -33,21 +33,21 @@
#define xen_rmb() rmb()
#define xen_wmb() wmb()
-#define mem_event_ring_lock_init(_d) spin_lock_init(&(_d)->mem_event.ring_lock)
-#define mem_event_ring_lock(_d) spin_lock(&(_d)->mem_event.ring_lock)
-#define mem_event_ring_unlock(_d) spin_unlock(&(_d)->mem_event.ring_lock)
+#define mem_event_ring_lock_init(_med) spin_lock_init(&(_med)->ring_lock)
+#define mem_event_ring_lock(_med) spin_lock(&(_med)->ring_lock)
+#define mem_event_ring_unlock(_med) spin_unlock(&(_med)->ring_lock)
-static int mem_event_enable(struct domain *d, mfn_t ring_mfn, mfn_t shared_mfn)
+static int mem_event_enable(struct domain *d, struct mem_event_domain *med, mfn_t ring_mfn, mfn_t shared_mfn)
{
int rc;
/* Map ring and shared pages */
- d->mem_event.ring_page = map_domain_page(mfn_x(ring_mfn));
- if ( d->mem_event.ring_page == NULL )
+ med->ring_page = map_domain_page(mfn_x(ring_mfn));
+ if ( med->ring_page == NULL )
goto err;
- d->mem_event.shared_page = map_domain_page(mfn_x(shared_mfn));
- if ( d->mem_event.shared_page == NULL )
+ med->shared_page = map_domain_page(mfn_x(shared_mfn));
+ if ( med->shared_page == NULL )
goto err_ring;
/* Allocate event channel */
@@ -56,15 +56,15 @@ static int mem_event_enable(struct domai
if ( rc < 0 )
goto err_shared;
- ((mem_event_shared_page_t *)d->mem_event.shared_page)->port = rc;
- d->mem_event.xen_port = rc;
+ ((mem_event_shared_page_t *)med->shared_page)->port = rc;
+ med->xen_port = rc;
/* Prepare ring buffer */
- FRONT_RING_INIT(&d->mem_event.front_ring,
- (mem_event_sring_t *)d->mem_event.ring_page,
+ FRONT_RING_INIT(&med->front_ring,
+ (mem_event_sring_t *)med->ring_page,
PAGE_SIZE);
- mem_event_ring_lock_init(d);
+ mem_event_ring_lock_init(med);
/* Wake any VCPUs paused for memory events */
mem_event_unpause_vcpus(d);
@@ -72,34 +72,34 @@ static int mem_event_enable(struct domai
return 0;
err_shared:
- unmap_domain_page(d->mem_event.shared_page);
- d->mem_event.shared_page = NULL;
+ unmap_domain_page(med->shared_page);
+ med->shared_page = NULL;
err_ring:
- unmap_domain_page(d->mem_event.ring_page);
- d->mem_event.ring_page = NULL;
+ unmap_domain_page(med->ring_page);
+ med->ring_page = NULL;
err:
return 1;
}
-static int mem_event_disable(struct domain *d)
+static int mem_event_disable(struct mem_event_domain *med)
{
- unmap_domain_page(d->mem_event.ring_page);
- d->mem_event.ring_page = NULL;
+ unmap_domain_page(med->ring_page);
+ med->ring_page = NULL;
- unmap_domain_page(d->mem_event.shared_page);
- d->mem_event.shared_page = NULL;
+ unmap_domain_page(med->shared_page);
+ med->shared_page = NULL;
return 0;
}
-void mem_event_put_request(struct domain *d, mem_event_request_t *req)
+void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req)
{
mem_event_front_ring_t *front_ring;
RING_IDX req_prod;
- mem_event_ring_lock(d);
+ mem_event_ring_lock(med);
- front_ring = &d->mem_event.front_ring;
+ front_ring = &med->front_ring;
req_prod = front_ring->req_prod_pvt;
/* Copy request */
@@ -107,23 +107,23 @@ void mem_event_put_request(struct domain
req_prod++;
/* Update ring */
- d->mem_event.req_producers--;
+ med->req_producers--;
front_ring->req_prod_pvt = req_prod;
RING_PUSH_REQUESTS(front_ring);
- mem_event_ring_unlock(d);
+ mem_event_ring_unlock(med);
- notify_via_xen_event_channel(d, d->mem_event.xen_port);
+ notify_via_xen_event_channel(d, med->xen_port);
}
-void mem_event_get_response(struct domain *d, mem_event_response_t *rsp)
+void mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp)
{
mem_event_front_ring_t *front_ring;
RING_IDX rsp_cons;
- mem_event_ring_lock(d);
+ mem_event_ring_lock(med);
- front_ring = &d->mem_event.front_ring;
+ front_ring = &med->front_ring;
rsp_cons = front_ring->rsp_cons;
/* Copy response */
@@ -134,7 +134,7 @@ void mem_event_get_response(struct domai
front_ring->rsp_cons = rsp_cons;
front_ring->sring->rsp_event = rsp_cons + 1;
- mem_event_ring_unlock(d);
+ mem_event_ring_unlock(med);
}
void mem_event_unpause_vcpus(struct domain *d)
@@ -152,35 +152,35 @@ void mem_event_mark_and_pause(struct vcp
vcpu_sleep_nosync(v);
}
-void mem_event_put_req_producers(struct domain *d)
+void mem_event_put_req_producers(struct mem_event_domain *med)
{
- mem_event_ring_lock(d);
- d->mem_event.req_producers--;
- mem_event_ring_unlock(d);
+ mem_event_ring_lock(med);
+ med->req_producers--;
+ mem_event_ring_unlock(med);
}
-int mem_event_check_ring(struct domain *d)
+int mem_event_check_ring(struct domain *d, struct mem_event_domain *med)
{
struct vcpu *curr = current;
int free_requests;
int ring_full = 1;
- if ( !d->mem_event.ring_page )
+ if ( !med->ring_page )
return -1;
- mem_event_ring_lock(d);
+ mem_event_ring_lock(med);
- free_requests = RING_FREE_REQUESTS(&d->mem_event.front_ring);
- if ( d->mem_event.req_producers < free_requests )
+ free_requests = RING_FREE_REQUESTS(&med->front_ring);
+ if ( med->req_producers < free_requests )
{
- d->mem_event.req_producers++;
+ med->req_producers++;
ring_full = 0;
}
- if ( (curr->domain->domain_id == d->domain_id) && ring_full )
+ if ( ring_full && (curr->domain == d) )
mem_event_mark_and_pause(curr);
- mem_event_ring_unlock(d);
+ mem_event_ring_unlock(med);
return ring_full;
}
@@ -230,6 +230,7 @@ int mem_event_domctl(struct domain *d, x
{
struct domain *dom_mem_event = current->domain;
struct vcpu *v = current;
+ struct mem_event_domain *med = &d->mem_event;
unsigned long ring_addr = mec->ring_addr;
unsigned long shared_addr = mec->shared_addr;
l1_pgentry_t l1e;
@@ -242,7 +243,7 @@ int mem_event_domctl(struct domain *d, x
* the cache is in an undefined state and so is the guest
*/
rc = -EBUSY;
- if ( d->mem_event.ring_page )
+ if ( med->ring_page )
break;
/* Currently only EPT is supported */
@@ -270,7 +271,7 @@ int mem_event_domctl(struct domain *d, x
break;
rc = -EINVAL;
- if ( mem_event_enable(d, ring_mfn, shared_mfn) != 0 )
+ if ( mem_event_enable(d, med, ring_mfn, shared_mfn) != 0 )
break;
rc = 0;
@@ -279,7 +280,7 @@ int mem_event_domctl(struct domain *d, x
case XEN_DOMCTL_MEM_EVENT_OP_DISABLE:
{
- rc = mem_event_disable(d);
+ rc = mem_event_disable(&d->mem_event);
}
break;
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
@@ -322,12 +322,12 @@ static struct page_info* mem_sharing_all
req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
}
- if(mem_event_check_ring(d)) return page;
+ if(mem_event_check_ring(d, &d->mem_event)) return page;
req.gfn = gfn;
req.p2mt = p2m_ram_shared;
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
return page;
}
@@ -342,7 +342,7 @@ int mem_sharing_sharing_resume(struct do
mem_event_response_t rsp;
/* Get request off the ring */
- mem_event_get_response(d, &rsp);
+ mem_event_get_response(&d->mem_event, &rsp);
/* Unpause domain/vcpu */
if( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2923,7 +2923,7 @@ void p2m_mem_paging_drop_page(struct p2m
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
- if ( mem_event_check_ring(d) == 0)
+ if ( mem_event_check_ring(d, &d->mem_event) == 0)
{
/* Send release notification to pager */
memset(&req, 0, sizeof(req));
@@ -2931,7 +2931,7 @@ void p2m_mem_paging_drop_page(struct p2m
req.gfn = gfn;
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
}
}
@@ -2943,7 +2943,7 @@ void p2m_mem_paging_populate(struct p2m_
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
- if ( mem_event_check_ring(d) )
+ if ( mem_event_check_ring(d, &d->mem_event) )
return;
memset(&req, 0, sizeof(req));
@@ -2970,7 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_
else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
{
/* gfn is already on its way back and vcpu is not paused */
- mem_event_put_req_producers(d);
+ mem_event_put_req_producers(&d->mem_event);
return;
}
@@ -2979,7 +2979,7 @@ void p2m_mem_paging_populate(struct p2m_
req.p2mt = p2mt;
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
}
int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn)
@@ -3008,7 +3008,7 @@ void p2m_mem_paging_resume(struct p2m_do
mfn_t mfn;
/* Pull the response off the ring */
- mem_event_get_response(d, &rsp);
+ mem_event_get_response(&d->mem_event, &rsp);
/* Fix p2m entry if the page was not dropped */
if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
@@ -3055,7 +3055,7 @@ void p2m_mem_access_check(unsigned long
p2m_unlock(p2m);
/* Otherwise, check if there is a memory event listener, and send the message along */
- res = mem_event_check_ring(d);
+ res = mem_event_check_ring(d, &d->mem_event);
if ( res < 0 )
{
/* No listener */
@@ -3099,7 +3099,7 @@ void p2m_mem_access_check(unsigned long
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
/* VCPU paused, mem event request sent */
}
@@ -3109,7 +3109,7 @@ void p2m_mem_access_resume(struct p2m_do
struct domain *d = p2m->domain;
mem_event_response_t rsp;
- mem_event_get_response(d, &rsp);
+ mem_event_get_response(&d->mem_event, &rsp);
/* Unpause domain */
if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/asm-x86/mem_event.h
+++ xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
@@ -26,10 +26,10 @@
/* Pauses VCPU while marking pause flag for mem event */
void mem_event_mark_and_pause(struct vcpu *v);
-int mem_event_check_ring(struct domain *d);
-void mem_event_put_req_producers(struct domain *d);
-void mem_event_put_request(struct domain *d, mem_event_request_t *req);
-void mem_event_get_response(struct domain *d, mem_event_response_t *rsp);
+int mem_event_check_ring(struct domain *d, struct mem_event_domain *med);
+void mem_event_put_req_producers(struct mem_event_domain *med);
+void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req);
+void mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp);
void mem_event_unpause_vcpus(struct domain *d);
int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
++++++ 23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch ++++++
++++ 868 lines (skipped)
++++++ 23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch ++++++
changeset: 23874:651aed73b39c
user: Olaf Hering <olafiaepfle.de>
date: Mon Sep 26 22:19:42 2011 +0100
files: tools/libxc/xc_domain.c tools/libxc/xenctrl.h xen/arch/x86/mm/p2m.c xen/common/domctl.c xen/include/public/domctl.h xen/include/xen/sched.h
description:
xenpaging: track number of paged pages in struct domain
The toolstack should know how many pages are paged-out at a given point
in time so it could make smarter decisions about how many pages should
be paged or ballooned.
Add a new member to xen_domctl_getdomaininfo and bump interface version.
Use the new member in xc_dominfo_t.
The SONAME of libxc should be changed if this patch gets applied.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Ian Campbell <ian.campbell(a)citrix.com>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/libxc/xc_domain.c | 1 +
tools/libxc/xenctrl.h | 1 +
xen/arch/x86/mm/p2m.c | 5 +++++
xen/common/domctl.c | 1 +
xen/include/public/domctl.h | 3 ++-
xen/include/xen/sched.h | 1 +
6 files changed, 11 insertions(+), 1 deletion(-)
Index: xen-4.1.2-testing/tools/libxc/xc_domain.c
===================================================================
--- xen-4.1.2-testing.orig/tools/libxc/xc_domain.c
+++ xen-4.1.2-testing/tools/libxc/xc_domain.c
@@ -235,6 +235,7 @@ int xc_domain_getinfo(xc_interface *xch,
info->ssidref = domctl.u.getdomaininfo.ssidref;
info->nr_pages = domctl.u.getdomaininfo.tot_pages;
info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
+ info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
info->shared_info_frame = domctl.u.getdomaininfo.shared_info_frame;
info->cpu_time = domctl.u.getdomaininfo.cpu_time;
Index: xen-4.1.2-testing/tools/libxc/xenctrl.h
===================================================================
--- xen-4.1.2-testing.orig/tools/libxc/xenctrl.h
+++ xen-4.1.2-testing/tools/libxc/xenctrl.h
@@ -353,6 +353,7 @@ typedef struct xc_dominfo {
unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
unsigned long nr_pages; /* current number, not maximum */
unsigned long nr_shared_pages;
+ unsigned long nr_paged_pages;
unsigned long shared_info_frame;
uint64_t cpu_time;
unsigned long max_memkb;
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2913,6 +2913,9 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Put the page back so it gets freed */
put_page(page);
+ /* Track number of paged gfns */
+ atomic_inc(&p2m->domain->paged_pages);
+
return 0;
}
@@ -2997,6 +3000,8 @@ int p2m_mem_paging_prep(struct p2m_domai
audit_p2m(p2m, 1);
p2m_unlock(p2m);
+ atomic_dec(&p2m->domain->paged_pages);
+
return 0;
}
Index: xen-4.1.2-testing/xen/common/domctl.c
===================================================================
--- xen-4.1.2-testing.orig/xen/common/domctl.c
+++ xen-4.1.2-testing/xen/common/domctl.c
@@ -139,6 +139,7 @@ void getdomaininfo(struct domain *d, str
info->tot_pages = d->tot_pages;
info->max_pages = d->max_pages;
info->shr_pages = atomic_read(&d->shr_pages);
+ info->paged_pages = atomic_read(&d->paged_pages);
info->shared_info_frame = mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_SHIFT);
BUG_ON(SHARED_M2P(info->shared_info_frame));
Index: xen-4.1.2-testing/xen/include/public/domctl.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/public/domctl.h
+++ xen-4.1.2-testing/xen/include/public/domctl.h
@@ -35,7 +35,7 @@
#include "xen.h"
#include "grant_table.h"
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000007
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
/*
* NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
uint64_aligned_t tot_pages;
uint64_aligned_t max_pages;
uint64_aligned_t shr_pages;
+ uint64_aligned_t paged_pages;
uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
uint64_aligned_t cpu_time;
uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
Index: xen-4.1.2-testing/xen/include/xen/sched.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/xen/sched.h
+++ xen-4.1.2-testing/xen/include/xen/sched.h
@@ -215,6 +215,7 @@ struct domain
unsigned int tot_pages; /* number of pages currently possesed */
unsigned int max_pages; /* maximum value for tot_pages */
atomic_t shr_pages; /* number of shared pages */
+ atomic_t paged_pages; /* number of paged-out pages */
unsigned int xenheap_pages; /* # pages allocated from Xen heap */
unsigned int max_vcpus;
++++++ 23897-x86-mce-offline-again.patch ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -10,8 +10,10 @@
Signed-off-by: Liu, Jinsong <jinsong.liu(a)intel.com>
Committed-by: Keir Fraser <keir(a)xen.org>
---- a/xen/arch/x86/cpu/mcheck/mce_intel.c
-+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce_intel.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/mce_intel.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -639,6 +639,8 @@ static void intel_memerr_dhandler(int bn
/* This is free page */
if (status & PG_OFFLINE_OFFLINED)
@@ -21,8 +23,10 @@
else if (status & PG_OFFLINE_PENDING) {
/* This page has owner */
if (status & PG_OFFLINE_OWNED) {
---- a/xen/common/page_alloc.c
-+++ b/xen/common/page_alloc.c
+Index: xen-4.1.2-testing/xen/common/page_alloc.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/page_alloc.c
++++ xen-4.1.2-testing/xen/common/page_alloc.c
@@ -38,6 +38,7 @@
#include <xen/tmem.h>
#include <xen/tmem_xen.h>
@@ -31,7 +35,7 @@
#include <asm/page.h>
#include <asm/numa.h>
#include <asm/flushtlb.h>
-@@ -704,6 +705,19 @@ int offline_page(unsigned long mfn, int
+@@ -708,6 +709,19 @@ int offline_page(unsigned long mfn, int
return -EINVAL;
}
@@ -51,8 +55,10 @@
spin_lock(&heap_lock);
old_info = mark_page_offline(pg, broken);
---- a/xen/include/public/sysctl.h
-+++ b/xen/include/public/sysctl.h
+Index: xen-4.1.2-testing/xen/include/public/sysctl.h
+===================================================================
+--- xen-4.1.2-testing.orig/xen/include/public/sysctl.h
++++ xen-4.1.2-testing/xen/include/public/sysctl.h
@@ -399,6 +399,7 @@ struct xen_sysctl_page_offline_op {
#define PG_OFFLINE_OFFLINED (0x1UL << 1)
#define PG_OFFLINE_PENDING (0x1UL << 2)
++++++ 23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch ++++++
changeset: 23904:ecab267b85ef
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 12:33:17 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: use p2m->get_entry() in p2m_mem_paging functions
Use p2m->get_entry() in the p2m_mem_paging functions. This preserves the
p2m_access type when gfn is updated with set_p2m_entry().
Its also a preparation for locking fixes in a subsequent patch.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2839,10 +2839,11 @@ int p2m_mem_paging_nominate(struct p2m_d
{
struct page_info *page;
p2m_type_t p2mt;
+ p2m_access_t a;
mfn_t mfn;
int ret;
- mfn = gfn_to_mfn(p2m, gfn, &p2mt);
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
/* Check if mfn is valid */
ret = -EINVAL;
@@ -2869,7 +2870,7 @@ int p2m_mem_paging_nominate(struct p2m_d
/* Fix p2m entry */
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_out, p2m->default_access);
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_out, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -2883,11 +2884,12 @@ int p2m_mem_paging_evict(struct p2m_doma
{
struct page_info *page;
p2m_type_t p2mt;
+ p2m_access_t a;
mfn_t mfn;
struct domain *d = p2m->domain;
/* Get mfn */
- mfn = gfn_to_mfn(p2m, gfn, &p2mt);
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( unlikely(!mfn_valid(mfn)) )
return -EINVAL;
@@ -2906,7 +2908,7 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Remove mapping from p2m table */
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, p2m->default_access);
+ set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -2943,6 +2945,7 @@ void p2m_mem_paging_populate(struct p2m_
struct vcpu *v = current;
mem_event_request_t req;
p2m_type_t p2mt;
+ p2m_access_t a;
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
@@ -2955,11 +2958,11 @@ void p2m_mem_paging_populate(struct p2m_
/* Fix p2m mapping */
/* XXX: It seems inefficient to have this here, as it's only needed
* in one case (ept guest accessing paging out page) */
- gfn_to_mfn(p2m, gfn, &p2mt);
+ p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( p2mt == p2m_ram_paged )
{
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, p2m->default_access);
+ set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
}
@@ -2988,7 +2991,10 @@ void p2m_mem_paging_populate(struct p2m_
int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
+ p2m_type_t p2mt;
+ p2m_access_t a;
+ p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
/* Get a free page */
page = alloc_domheap_page(p2m->domain, 0);
if ( unlikely(page == NULL) )
@@ -2996,7 +3002,7 @@ int p2m_mem_paging_prep(struct p2m_domai
/* Fix p2m mapping */
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, p2m->default_access);
+ set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -3010,6 +3016,7 @@ void p2m_mem_paging_resume(struct p2m_do
struct domain *d = p2m->domain;
mem_event_response_t rsp;
p2m_type_t p2mt;
+ p2m_access_t a;
mfn_t mfn;
/* Pull the response off the ring */
@@ -3018,9 +3025,9 @@ void p2m_mem_paging_resume(struct p2m_do
/* Fix p2m entry if the page was not dropped */
if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
{
- mfn = gfn_to_mfn(p2m, rsp.gfn, &p2mt);
+ mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
p2m_lock(p2m);
- set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, p2m->default_access);
+ set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
++++++ 23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch ++++++
changeset: 23905:50ee6be56460
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 12:33:17 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: fix locking in p2m_mem_paging functions
As suggested by <hongkaixing(a)huawei.com>, query and adjust the p2mt
under the p2m_lock to prevent races with PoD.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 42 ++++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 16 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2843,6 +2843,8 @@ int p2m_mem_paging_nominate(struct p2m_d
mfn_t mfn;
int ret;
+ p2m_unlock(p2m);
+
mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
/* Check if mfn is valid */
@@ -2869,14 +2871,12 @@ int p2m_mem_paging_nominate(struct p2m_d
goto out;
/* Fix p2m entry */
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_out, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
-
ret = 0;
out:
+ p2m_unlock(p2m);
return ret;
}
@@ -2887,30 +2887,31 @@ int p2m_mem_paging_evict(struct p2m_doma
p2m_access_t a;
mfn_t mfn;
struct domain *d = p2m->domain;
+ int ret = -EINVAL;
+
+ p2m_lock(p2m);
/* Get mfn */
mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( unlikely(!mfn_valid(mfn)) )
- return -EINVAL;
+ goto out;
if ( (p2mt == p2m_ram_paged) || (p2mt == p2m_ram_paging_in) ||
(p2mt == p2m_ram_paging_in_start) )
- return -EINVAL;
+ goto out;
/* Get the page so it doesn't get modified under Xen's feet */
page = mfn_to_page(mfn);
if ( unlikely(!get_page(page, d)) )
- return -EINVAL;
+ goto out;
/* Decrement guest domain's ref count of the page */
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
/* Remove mapping from p2m table */
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
/* Put the page back so it gets freed */
put_page(page);
@@ -2918,7 +2919,11 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Track number of paged gfns */
atomic_inc(&p2m->domain->paged_pages);
- return 0;
+ ret = 0;
+
+ out:
+ p2m_unlock(p2m);
+ return ret;
}
void p2m_mem_paging_drop_page(struct p2m_domain *p2m, unsigned long gfn)
@@ -2958,14 +2963,14 @@ void p2m_mem_paging_populate(struct p2m_
/* Fix p2m mapping */
/* XXX: It seems inefficient to have this here, as it's only needed
* in one case (ept guest accessing paging out page) */
+ p2m_lock(p2m);
p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( p2mt == p2m_ram_paged )
{
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
}
+ p2m_unlock(p2m);
/* Pause domain */
if ( v->domain->domain_id == d->domain_id )
@@ -2993,22 +2998,27 @@ int p2m_mem_paging_prep(struct p2m_domai
struct page_info *page;
p2m_type_t p2mt;
p2m_access_t a;
+ int ret = -ENOMEM;
+
+ p2m_lock(p2m);
p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+
/* Get a free page */
page = alloc_domheap_page(p2m->domain, 0);
if ( unlikely(page == NULL) )
- return -ENOMEM;
+ goto out;
/* Fix p2m mapping */
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
atomic_dec(&p2m->domain->paged_pages);
- return 0;
+ ret = 0;
+ out:
+ p2m_unlock(p2m);
+ return ret;
}
void p2m_mem_paging_resume(struct p2m_domain *p2m)
@@ -3025,8 +3035,8 @@ void p2m_mem_paging_resume(struct p2m_do
/* Fix p2m entry if the page was not dropped */
if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
{
- mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
p2m_lock(p2m);
+ mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
audit_p2m(p2m, 1);
++++++ 23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch ++++++
changeset: 23906:7bf85c3fd9f0
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 12:33:17 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: remove confusing comment from p2m_mem_paging_populate
Currently there is no way to avoid the double check of the p2mt
because p2m_mem_paging_populate() is called from many places without
the p2m_lock held. Upcoming changes will move the function into
gfn_to_mfn(), so its interface could be changed and the extra
p2m_lock/get_entry can be removed.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 2 --
1 file changed, 2 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2961,8 +2961,6 @@ void p2m_mem_paging_populate(struct p2m_
req.type = MEM_EVENT_TYPE_PAGING;
/* Fix p2m mapping */
- /* XXX: It seems inefficient to have this here, as it's only needed
- * in one case (ept guest accessing paging out page) */
p2m_lock(p2m);
p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( p2mt == p2m_ram_paged )
++++++ 23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch ++++++
changeset: 23908:88b6e08b8aa8
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 14:15:43 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
p2m: query/modify p2mt with p2m_lock held
Query and update the p2mt in set_mmio_p2m_entry, clear_mmio_p2m_entry
and set_shared_p2m_entry with the p2m_lock held.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2751,9 +2751,11 @@ set_mmio_p2m_entry(struct p2m_domain *p2
if ( !paging_mode_translate(p2m->domain) )
return 0;
+ p2m_lock(p2m);
omfn = gfn_to_mfn_query(p2m, gfn, &ot);
if ( p2m_is_grant(ot) )
{
+ p2m_unlock(p2m);
domain_crash(p2m->domain);
return 0;
}
@@ -2764,7 +2766,6 @@ set_mmio_p2m_entry(struct p2m_domain *p2
}
P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn));
- p2m_lock(p2m);
rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_mmio_direct, p2m->default_access);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -2785,18 +2786,20 @@ clear_mmio_p2m_entry(struct p2m_domain *
if ( !paging_mode_translate(p2m->domain) )
return 0;
- mfn = gfn_to_mfn(p2m, gfn, &t);
+ p2m_lock(p2m);
+ mfn = gfn_to_mfn_query(p2m, gfn, &t);
/* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) )
{
gdprintk(XENLOG_ERR,
"clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);
- return 0;
+ goto out;
}
- p2m_lock(p2m);
rc = set_p2m_entry(p2m, gfn, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access);
audit_p2m(p2m, 1);
+
+out:
p2m_unlock(p2m);
return rc;
@@ -2813,6 +2816,8 @@ set_shared_p2m_entry(struct p2m_domain *
if ( !paging_mode_translate(p2m->domain) )
return 0;
+ if ( need_lock )
+ p2m_lock(p2m);
omfn = gfn_to_mfn_query(p2m, gfn, &ot);
/* At the moment we only allow p2m change if gfn has already been made
* sharable first */
@@ -2822,8 +2827,6 @@ set_shared_p2m_entry(struct p2m_domain *
set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
- if ( need_lock )
- p2m_lock(p2m);
rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_shared, p2m->default_access);
if ( need_lock )
p2m_unlock(p2m);
++++++ 23943-xenpaging_clear_page_content_after_evict.patch ++++++
changeset: 23943:1185ae04b5aa
user: Olaf Hering <olaf(a)aepfle.de>
date: Tue Oct 11 10:46:28 2011 +0100
files: tools/xenpaging/xenpaging.c xen/arch/x86/mm/p2m.c
description:
xenpaging: clear page content after evict
If the guest happens to read from the gfn while xenpaging is in the process of
evicting the page, the guest may read zeros instead of actual data.
Also if eviction fails the page content will be corrupted and xenpaging wont
attempt to restore the page.
Remove page scrubbing from pager and do it after successful eviction.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Ian Jackson <ian.jackson(a)eu.citrix.com>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/xenpaging/xenpaging.c | 3 ---
xen/arch/x86/mm/p2m.c | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -455,9 +455,6 @@ static int xenpaging_evict_page(xenpagin
goto out;
}
- /* Clear page */
- memset(page, 0, PAGE_SIZE);
-
munmap(page, PAGE_SIZE);
/* Tell Xen to evict page */
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2916,6 +2916,9 @@ int p2m_mem_paging_evict(struct p2m_doma
set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, a);
audit_p2m(p2m, 1);
+ /* Clear content before returning the page to Xen */
+ scrub_one_page(page);
+
/* Put the page back so it gets freed */
put_page(page);
++++++ 23953-xenpaging_handle_evict_failures.patch ++++++
changeset: 23953:eda18b27de6e
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 13 12:21:10 2011 +0100
files: tools/xenpaging/xenpaging.c xen/arch/x86/mm.c xen/arch/x86/mm/p2m.c xen/include/public/mem_event.h
description:
xenpaging: handle evict failures
Evict of a nominated gfn must fail if some other process mapped the
page without checking the p2mt of that gfn first.
Add a check to cancel eviction if the page usage count is not 1.
Handle the possible eviction failure in the page-in paths.
After nominate and before evict, something may check the p2mt and call
populate. Handle this case and let the gfn enter the page-in path. The
gfn may still be connected to a mfn, so there is no need to allocate a
new page in prep.
Adjust do_mmu_update to return -ENOENT only if the gfn has entered the
page-in path and if it is not yet connected to a mfn. Otherwise
linux_privcmd_map_foreign_bulk() may loop forever.
Add MEM_EVENT_FLAG_EVICT_FAIL to inform pager that a page-in request for
a possible not-evicted page was sent. xenpaging does currently not need
that flag because failure to evict a gfn will be caught.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/xenpaging/xenpaging.c | 10 ++++---
xen/arch/x86/mm.c | 8 ++---
xen/arch/x86/mm/p2m.c | 55 +++++++++++++++++++++++++++++------------
xen/include/public/mem_event.h | 1
4 files changed, 50 insertions(+), 24 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -734,10 +734,12 @@ int main(int argc, char *argv[])
}
else
{
- DPRINTF("page already populated (domain = %d; vcpu = %d;"
- " gfn = %"PRIx64"; paused = %d)\n",
- paging->mem_event.domain_id, req.vcpu_id,
- req.gfn, req.flags & MEM_EVENT_FLAG_VCPU_PAUSED);
+ DPRINTF("page %s populated (domain = %d; vcpu = %d;"
+ " gfn = %"PRIx64"; paused = %d; evict_fail = %d)\n",
+ req.flags & MEM_EVENT_FLAG_EVICT_FAIL ? "not" : "already",
+ paging->mem_event.domain_id, req.vcpu_id, req.gfn,
+ !!(req.flags & MEM_EVENT_FLAG_VCPU_PAUSED) ,
+ !!(req.flags & MEM_EVENT_FLAG_EVICT_FAIL) );
/* Tell Xen to resume the vcpu */
/* XXX: Maybe just check if the vcpu was paused? */
Index: xen-4.1.2-testing/xen/arch/x86/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/mm.c
@@ -3502,7 +3502,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l1e_p2mt )
+ else if ( p2m_ram_paging_in_start == l1e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
@@ -3543,7 +3543,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l2e_p2mt )
+ else if ( p2m_ram_paging_in_start == l2e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
@@ -3572,7 +3572,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l3e_p2mt )
+ else if ( p2m_ram_paging_in_start == l3e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
@@ -3602,7 +3602,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l4e_p2mt )
+ else if ( p2m_ram_paging_in_start == l4e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2899,15 +2899,24 @@ int p2m_mem_paging_evict(struct p2m_doma
if ( unlikely(!mfn_valid(mfn)) )
goto out;
- if ( (p2mt == p2m_ram_paged) || (p2mt == p2m_ram_paging_in) ||
- (p2mt == p2m_ram_paging_in_start) )
+ /* Allow only nominated pages */
+ if ( p2mt != p2m_ram_paging_out )
goto out;
+ ret = -EBUSY;
/* Get the page so it doesn't get modified under Xen's feet */
page = mfn_to_page(mfn);
if ( unlikely(!get_page(page, d)) )
goto out;
+ /* Check page count and type once more */
+ if ( (page->count_info & (PGC_count_mask | PGC_allocated)) !=
+ (2 | PGC_allocated) )
+ goto out_put;
+
+ if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_none )
+ goto out_put;
+
/* Decrement guest domain's ref count of the page */
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
@@ -2919,14 +2928,15 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Clear content before returning the page to Xen */
scrub_one_page(page);
- /* Put the page back so it gets freed */
- put_page(page);
-
/* Track number of paged gfns */
atomic_inc(&p2m->domain->paged_pages);
ret = 0;
+ out_put:
+ /* Put the page back so it gets freed */
+ put_page(page);
+
out:
p2m_unlock(p2m);
return ret;
@@ -2957,6 +2967,7 @@ void p2m_mem_paging_populate(struct p2m_
mem_event_request_t req;
p2m_type_t p2mt;
p2m_access_t a;
+ mfn_t mfn;
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
@@ -2968,20 +2979,26 @@ void p2m_mem_paging_populate(struct p2m_
/* Fix p2m mapping */
p2m_lock(p2m);
- p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
- if ( p2mt == p2m_ram_paged )
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+ /* Allow only nominated or evicted pages to enter page-in path */
+ if ( p2mt == p2m_ram_paging_out || p2mt == p2m_ram_paged )
{
- set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, a);
+ /* Evict will fail now, tag this request for pager */
+ if ( p2mt == p2m_ram_paging_out )
+ req.flags |= MEM_EVENT_FLAG_EVICT_FAIL;
+
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_in_start, a);
audit_p2m(p2m, 1);
}
p2m_unlock(p2m);
- /* Pause domain */
- if ( v->domain->domain_id == d->domain_id )
+ /* Pause domain if request came from guest and gfn has paging type */
+ if ( p2m_is_paging(p2mt) && v->domain->domain_id == d->domain_id )
{
vcpu_pause_nosync(v);
req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
}
+ /* No need to inform pager if the gfn is not in the page-out path */
else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
{
/* gfn is already on its way back and vcpu is not paused */
@@ -3002,19 +3019,25 @@ int p2m_mem_paging_prep(struct p2m_domai
struct page_info *page;
p2m_type_t p2mt;
p2m_access_t a;
+ mfn_t mfn;
int ret = -ENOMEM;
p2m_lock(p2m);
- p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
- /* Get a free page */
- page = alloc_domheap_page(p2m->domain, 0);
- if ( unlikely(page == NULL) )
- goto out;
+ /* Allocate a page if the gfn does not have one yet */
+ if ( !mfn_valid(mfn) )
+ {
+ /* Get a free page */
+ page = alloc_domheap_page(p2m->domain, 0);
+ if ( unlikely(page == NULL) )
+ goto out;
+ mfn = page_to_mfn(page);
+ }
/* Fix p2m mapping */
- set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, a);
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_in, a);
audit_p2m(p2m, 1);
atomic_dec(&p2m->domain->paged_pages);
Index: xen-4.1.2-testing/xen/include/public/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/public/mem_event.h
+++ xen-4.1.2-testing/xen/include/public/mem_event.h
@@ -38,6 +38,7 @@
/* Memory event flags */
#define MEM_EVENT_FLAG_VCPU_PAUSED (1 << 0)
#define MEM_EVENT_FLAG_DROP_PAGE (1 << 1)
+#define MEM_EVENT_FLAG_EVICT_FAIL (1 << 2)
/* Reasons for the memory event request */
#define MEM_EVENT_REASON_UNKNOWN 0 /* typical reason */
++++++ 23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch ++++++
changeset: 23978:fd3fa0a85020
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 20 11:25:55 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: check p2mt in p2m_mem_paging functions
Add checks to forward the p2m_ram_paging* state properly during page-in.
Resume can be called several times if several vcpus called populate for
the gfn. Finish resume only once.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -3020,16 +3020,22 @@ int p2m_mem_paging_prep(struct p2m_domai
p2m_type_t p2mt;
p2m_access_t a;
mfn_t mfn;
- int ret = -ENOMEM;
+ int ret;
p2m_lock(p2m);
mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+ ret = -ENOENT;
+ /* Allow only missing pages */
+ if ( p2mt != p2m_ram_paging_in_start )
+ goto out;
+
/* Allocate a page if the gfn does not have one yet */
if ( !mfn_valid(mfn) )
{
/* Get a free page */
+ ret = -ENOMEM;
page = alloc_domheap_page(p2m->domain, 0);
if ( unlikely(page == NULL) )
goto out;
@@ -3064,9 +3070,15 @@ void p2m_mem_paging_resume(struct p2m_do
{
p2m_lock(p2m);
mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
- set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
- set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
- audit_p2m(p2m, 1);
+ /* Allow only pages which were prepared properly, or pages which
+ * were nominated but not evicted */
+ if ( mfn_valid(mfn) &&
+ (p2mt == p2m_ram_paging_in || p2mt == p2m_ram_paging_in_start) )
+ {
+ set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
+ set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
+ audit_p2m(p2m, 1);
+ }
p2m_unlock(p2m);
}
++++++ 23979-xenpaging_document_p2m_mem_paging_functions.patch ++++++
changeset: 23979:18306b054799
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 20 11:25:58 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: document p2m_mem_paging functions
Add some documentation for each of the p2m_mem_paging functions to describe
what they ought to do.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2838,6 +2838,24 @@ set_shared_p2m_entry(struct p2m_domain *
}
#ifdef __x86_64__
+/**
+ * p2m_mem_paging_nominate - Mark a guest page as to-be-paged-out
+ * @d: guest domain
+ * @gfn: guest page to nominate
+ *
+ * Returns 0 for success or negative errno values if gfn is not pageable.
+ *
+ * p2m_mem_paging_nominate() is called by the pager and checks if a guest page
+ * can be paged out. If the following conditions are met the p2mt will be
+ * changed:
+ * - the gfn is backed by a mfn
+ * - the p2mt of the gfn is pageable
+ * - the mfn is not used for IO
+ * - the mfn has exactly one user and has no special meaning
+ *
+ * Once the p2mt is changed the page is readonly for the guest. On success the
+ * pager can write the page contents to disk and later evict the page.
+ */
int p2m_mem_paging_nominate(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
@@ -2883,6 +2901,25 @@ int p2m_mem_paging_nominate(struct p2m_d
return ret;
}
+/**
+ * p2m_mem_paging_evict - Mark a guest page as paged-out
+ * @d: guest domain
+ * @gfn: guest page to evict
+ *
+ * Returns 0 for success or negative errno values if eviction is not possible.
+ *
+ * p2m_mem_paging_evict() is called by the pager and will free a guest page and
+ * release it back to Xen. If the following conditions are met the page can be
+ * freed:
+ * - the gfn is backed by a mfn
+ * - the gfn was nominated
+ * - the mfn has still exactly one user and has no special meaning
+ *
+ * After successful nomination some other process could have mapped the page. In
+ * this case eviction can not be done. If the gfn was populated before the pager
+ * could evict it, eviction can not be done either. In this case the gfn is
+ * still backed by a mfn.
+ */
int p2m_mem_paging_evict(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
@@ -2942,6 +2979,15 @@ int p2m_mem_paging_evict(struct p2m_doma
return ret;
}
+/**
+ * p2m_mem_paging_drop_page - Tell pager to drop its reference to a paged page
+ * @d: guest domain
+ * @gfn: guest page to drop
+ *
+ * p2m_mem_paging_drop_page() will notify the pager that a paged-out gfn was
+ * released by the guest. The pager is supposed to drop its reference of the
+ * gfn.
+ */
void p2m_mem_paging_drop_page(struct p2m_domain *p2m, unsigned long gfn)
{
struct vcpu *v = current;
@@ -2961,6 +3007,27 @@ void p2m_mem_paging_drop_page(struct p2m
}
}
+/**
+ * p2m_mem_paging_populate - Tell pager to populete a paged page
+ * @d: guest domain
+ * @gfn: guest page in paging state
+ *
+ * p2m_mem_paging_populate() will notify the pager that a page in any of the
+ * paging states needs to be written back into the guest.
+ * This function needs to be called whenever gfn_to_mfn() returns any of the p2m
+ * paging types because the gfn may not be backed by a mfn.
+ *
+ * The gfn can be in any of the paging states, but the pager needs only be
+ * notified when the gfn is in the paging-out path (paging_out or paged). This
+ * function may be called more than once from several vcpus. If the vcpu belongs
+ * to the guest, the vcpu must be stopped and the pager notified that the vcpu
+ * was stopped. The pager needs to handle several requests for the same gfn.
+ *
+ * If the gfn is not in the paging-out path and the vcpu does not belong to the
+ * guest, nothing needs to be done and the function assumes that a request was
+ * already sent to the pager. In this case the caller has to try again until the
+ * gfn is fully paged in again.
+ */
void p2m_mem_paging_populate(struct p2m_domain *p2m, unsigned long gfn)
{
struct vcpu *v = current;
@@ -3014,6 +3081,17 @@ void p2m_mem_paging_populate(struct p2m_
mem_event_put_request(d, &d->mem_paging, &req);
}
+/**
+ * p2m_mem_paging_prep - Allocate a new page for the guest
+ * @d: guest domain
+ * @gfn: guest page in paging state
+ *
+ * p2m_mem_paging_prep() will allocate a new page for the guest if the gfn is
+ * not backed by a mfn. It is called by the pager.
+ * It is required that the gfn was already populated. The gfn may already have a
+ * mfn if populate was called for gfn which was nominated but not evicted. In
+ * this case only the p2mt needs to be forwarded.
+ */
int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
@@ -3054,6 +3132,21 @@ int p2m_mem_paging_prep(struct p2m_domai
return ret;
}
+/**
+ * p2m_mem_paging_resume - Resume guest gfn and vcpus
+ * @d: guest domain
+ * @gfn: guest page in paging state
+ *
+ * p2m_mem_paging_resume() will forward the p2mt of a gfn to ram_rw and all
+ * waiting vcpus will be unpaused again. It is called by the pager.
+ *
+ * The gfn was previously either evicted and populated, or nominated and
+ * populated. If the page was evicted the p2mt will be p2m_ram_paging_in. If
+ * the page was just nominated the p2mt will be p2m_ram_paging_in_start because
+ * the pager did not call p2m_mem_paging_prep().
+ *
+ * If the gfn was dropped the vcpu needs to be unpaused.
+ */
void p2m_mem_paging_resume(struct p2m_domain *p2m)
{
struct domain *d = p2m->domain;
++++++ 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch ++++++
changeset: 23980:a06609840ff1
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 20 11:25:58 2011 +0100
files: tools/xenpaging/xenpaging.c xen/arch/x86/mm/mem_event.c
description:
xenpaging: disallow paging in a PoD guest
Disallow xenpaging in a PoD guest until coexistance between the two features
is properly implemented.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/xenpaging/xenpaging.c | 3 +++
xen/arch/x86/mm/mem_event.c | 6 ++++++
2 files changed, 9 insertions(+)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -246,6 +246,9 @@ static xenpaging_t *xenpaging_init(domid
case ENODEV:
ERROR("EPT not supported for this guest");
break;
+ case EXDEV:
+ ERROR("xenpaging not supported in a PoD guest");
+ break;
default:
ERROR("Error initialising shared page: %s", strerror(errno));
break;
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -253,6 +253,7 @@ int mem_event_domctl(struct domain *d, x
case XEN_DOMCTL_MEM_EVENT_OP_PAGING:
{
struct mem_event_domain *med = &d->mem_paging;
+ struct p2m_domain *p2m = p2m_get_hostp2m(d);
rc = -ENODEV;
/* Only HAP is supported */
if ( !hap_enabled(d) )
@@ -262,6 +263,11 @@ int mem_event_domctl(struct domain *d, x
if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
break;
+ rc = -EXDEV;
+ /* Disallow paging in a PoD guest */
+ if ( p2m->pod.entry_count )
+ break;
+
switch( mec->op )
{
case XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE:
++++++ 23993-x86-microcode-amd-fix-23871.patch ++++++
# HG changeset patch
# User Jan Beulich <jbeulich(a)novell.com>
# Date 1319475620 -3600
# Node ID e458dfc35b8d3be04a9b72c30ff97163e27a7314
# Parent ffe861c1d5dfa8f4485052e5600e06124105033f
x86/ucode-amd: fix regression from c/s 23871:503ee256fecf
microcode_fits() must return distinct values for the success and
no-fit-but-no-error cases, so the caller can react accordingly. Make
it return 1 in the success case, and adjust its single caller.
Also remove an impossible code path - install_equiv_cpu_table(), which
gets called prior to microcode_fits(), never leaves equiv_cpu_table
being NULL without also returning an error.
Note that this is still awaiting testing on a system where the
regression was actually observed (which also requires a new enough
microcode_ctl package). Note also that this will need to be
backported to 4.0 and 4.1 (or the broken c/s that got backported
there reverted).
Signed-off-by: Jan Beulich <jbeulich(a)novell.com>
Committed-by: Keir Fraser <keir(a)xen.org>
Index: xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/microcode_amd.c
+++ xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
@@ -76,14 +76,6 @@ static int microcode_fits(void *mc, int
/* We should bind the task to the CPU */
BUG_ON(cpu != raw_smp_processor_id());
- if ( equiv_cpu_table == NULL )
- {
- printk(KERN_INFO "microcode: CPU%d microcode update with "
- "version 0x%x (current=0x%x)\n",
- cpu, mc_header->patch_id, uci->cpu_sig.rev);
- goto out;
- }
-
current_cpu_id = cpuid_eax(0x00000001);
for ( i = 0; equiv_cpu_table[i].installed_cpu != 0; i++ )
@@ -96,7 +88,7 @@ static int microcode_fits(void *mc, int
}
if ( !equiv_cpu_id )
- return 0;
+ return 0;
if ( (mc_header->processor_rev_id) != equiv_cpu_id )
{
@@ -113,8 +105,7 @@ static int microcode_fits(void *mc, int
"update with version 0x%x (current=0x%x)\n",
cpu, mc_header->patch_id, uci->cpu_sig.rev);
-out:
- return 0;
+ return 1;
}
static int apply_microcode(int cpu)
@@ -289,7 +280,7 @@ static int cpu_request_microcode(int cpu
while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
{
error = microcode_fits(mc, cpu);
- if (error != 0)
+ if (error <= 0)
continue;
error = apply_microcode(cpu);
++++++ udev-rules.patch ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -7,5 +7,5 @@
KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600"
KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600"
-SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
-+SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", TEST="/proc/xen", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
++SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", TEST=="/proc/xen", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"
++++++ xen-4.1.2-testing-src.tar.bz2 ++++++
/work/SRC/openSUSE:12.1/xen/xen-4.1.2-testing-src.tar.bz2 /work/SRC/openSUSE:12.1/.xen.new/xen-4.1.2-testing-src.tar.bz2 differ: char 11, line 1
++++++ xen-config.diff ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -9,9 +9,9 @@
-CONFIG_QEMU ?= $(QEMU_REMOTE)
+CONFIG_QEMU ?= ioemu-qemu-xen
- QEMU_TAG := xen-4.1.2-rc3
+ QEMU_TAG := xen-4.1.2
#QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599
-@@ -187,7 +187,7 @@ QEMU_TAG := xen-4.1.2-rc3
+@@ -187,7 +187,7 @@ QEMU_TAG := xen-4.1.2
# Optional components
XENSTAT_XENTOP ?= y
VTPM_TOOLS ?= n
++++++ xen-warnings-unused.diff ++++++
--- /var/tmp/diff_new_pack.CSVOYS/_old 2011-10-29 06:50:41.000000000 +0200
+++ /var/tmp/diff_new_pack.CSVOYS/_new 2011-10-29 06:50:41.000000000 +0200
@@ -1,5 +1,7 @@
---- a/tools/libxc/xc_tmem.c
-+++ b/tools/libxc/xc_tmem.c
+Index: xen-4.1.2-testing/tools/libxc/xc_tmem.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxc/xc_tmem.c
++++ xen-4.1.2-testing/tools/libxc/xc_tmem.c
@@ -390,7 +390,8 @@ static int xc_tmem_restore_new_pool(
int xc_tmem_restore(xc_interface *xch, int dom, int io_fd)
@@ -10,8 +12,10 @@
uint32_t this_max_pools, this_version;
uint32_t pool_id;
uint32_t minusone;
---- a/tools/libxc/xc_domain_restore.c
-+++ b/tools/libxc/xc_domain_restore.c
+Index: xen-4.1.2-testing/tools/libxc/xc_domain_restore.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxc/xc_domain_restore.c
++++ xen-4.1.2-testing/tools/libxc/xc_domain_restore.c
@@ -1087,7 +1087,6 @@ int xc_domain_restore(xc_interface *xch,
int vcpuextstate = 0;
uint32_t vcpuextstate_size = 0;
@@ -28,8 +32,10 @@
n = m = 0;
loadpages:
---- a/tools/misc/gtraceview.c
-+++ b/tools/misc/gtraceview.c
+Index: xen-4.1.2-testing/tools/misc/gtraceview.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/misc/gtraceview.c
++++ xen-4.1.2-testing/tools/misc/gtraceview.c
@@ -622,7 +622,8 @@ void crt_init(void)
void nr_addch(int nr, int ch)
{
@@ -40,8 +46,10 @@
getyx(stdscr, y, x);
for (i = 0; i < nr; i++) {
if (x == COLS-1)
---- a/tools/xcutils/xc_restore.c
-+++ b/tools/xcutils/xc_restore.c
+Index: xen-4.1.2-testing/tools/xcutils/xc_restore.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/xcutils/xc_restore.c
++++ xen-4.1.2-testing/tools/xcutils/xc_restore.c
@@ -19,7 +19,8 @@ int
main(int argc, char **argv)
{
@@ -52,8 +60,10 @@
xc_interface *xch;
int io_fd, ret;
int superpages;
---- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
-+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+Index: xen-4.1.2-testing/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
++++ xen-4.1.2-testing/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -1064,7 +1064,7 @@ uint32_t HashLogEvent32(struct hlei *hle
uint32_t rc = 0;
uint16_t size;
@@ -63,8 +73,10 @@
uint32_t hashdataptr;
uint32_t hashdatalen;
---- a/tools/console/client/main.c
-+++ b/tools/console/client/main.c
+Index: xen-4.1.2-testing/tools/console/client/main.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/console/client/main.c
++++ xen-4.1.2-testing/tools/console/client/main.c
@@ -277,7 +277,8 @@ int main(int argc, char **argv)
};
@@ -75,8 +87,10 @@
struct xs_handle *xs;
char *end;
console_type type = CONSOLE_INVAL;
---- a/tools/xenstat/xentop/xentop.c
-+++ b/tools/xenstat/xentop/xentop.c
+Index: xen-4.1.2-testing/tools/xenstat/xentop/xentop.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/xenstat/xentop/xentop.c
++++ xen-4.1.2-testing/tools/xenstat/xentop/xentop.c
@@ -272,7 +272,8 @@ static void fail(const char *str)
/* Return the row containing the cursor. */
static int current_row(void)
@@ -97,9 +111,11 @@
getmaxyx(stdscr, y, x);
return y;
}
---- a/tools/libxl/libxlu_cfg.c
-+++ b/tools/libxl/libxlu_cfg.c
-@@ -348,7 +348,7 @@ char *xlu__cfgl_dequote(CfgParseContext
+Index: xen-4.1.2-testing/tools/libxl/libxlu_cfg.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxlu_cfg.c
++++ xen-4.1.2-testing/tools/libxl/libxlu_cfg.c
+@@ -348,7 +348,7 @@ char *xlu__cfgl_dequote(CfgParseContext
#define NUMERIC_CHAR(minlen,maxlen,base,basetext) do{ \
char numbuf[(maxlen)+1], *ep; \
@@ -108,9 +124,11 @@
\
strncpy(numbuf,p,(maxlen)); \
numbuf[(maxlen)]= 0; \
---- a/tools/libxl/libxl.c
-+++ b/tools/libxl/libxl.c
-@@ -221,7 +221,7 @@ int libxl_domain_rename(libxl_ctx *ctx,
+Index: xen-4.1.2-testing/tools/libxl/libxl.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl.c
++++ xen-4.1.2-testing/tools/libxl/libxl.c
+@@ -221,7 +221,7 @@ int libxl_domain_rename(libxl_ctx *ctx,
int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid)
{
libxl__gc gc = LIBXL_INIT_GC(ctx);
@@ -137,8 +155,10 @@
libxl__sprintf(&gc, "%s/device/vif", dompath), &nb_nics);
if (!l)
goto err;
---- a/tools/libxl/libxl_pci.c
-+++ b/tools/libxl/libxl_pci.c
+Index: xen-4.1.2-testing/tools/libxl/libxl_pci.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl_pci.c
++++ xen-4.1.2-testing/tools/libxl/libxl_pci.c
@@ -240,7 +240,7 @@ static int libxl_create_pci_backend(libx
flexarray_t *front = NULL;
flexarray_t *back = NULL;
@@ -157,8 +177,10 @@
LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Creating pci backend");
/* add pci device */
---- a/tools/libxl/libxl_dom.c
-+++ b/tools/libxl/libxl_dom.c
+Index: xen-4.1.2-testing/tools/libxl/libxl_dom.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl_dom.c
++++ xen-4.1.2-testing/tools/libxl/libxl_dom.c
@@ -265,14 +265,13 @@ int libxl__build_hvm(libxl_ctx *ctx, uin
libxl_domain_build_info *info, libxl_domain_build_state *state)
{
@@ -183,8 +205,10 @@
out:
libxl__free_all(&gc);
return 0;
---- a/tools/libxl/libxl_utils.c
-+++ b/tools/libxl/libxl_utils.c
+Index: xen-4.1.2-testing/tools/libxl/libxl_utils.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl_utils.c
++++ xen-4.1.2-testing/tools/libxl/libxl_utils.c
@@ -531,7 +531,7 @@ int libxl_devid_to_device_disk(libxl_ctx
libxl__gc gc = LIBXL_INIT_GC(ctx);
char *val;
@@ -194,8 +218,10 @@
int rc = ERROR_INVAL;
devid_n = libxl__device_disk_dev_number(devid);
---- a/tools/libxl/xl_cmdimpl.c
-+++ b/tools/libxl/xl_cmdimpl.c
+Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/xl_cmdimpl.c
++++ xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c
@@ -5448,7 +5448,7 @@ int main_cpupoollist(int argc, char **ar
{"cpus", 0, 0, 'c'},
{0, 0, 0, 0}
@@ -205,8 +231,10 @@
int opt_cpus = 0;
const char *pool = NULL;
libxl_cpupoolinfo *poolinfo;
---- a/tools/debugger/gdbsx/gx/gx_comm.c
-+++ b/tools/debugger/gdbsx/gx/gx_comm.c
+Index: xen-4.1.2-testing/tools/debugger/gdbsx/gx/gx_comm.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/debugger/gdbsx/gx/gx_comm.c
++++ xen-4.1.2-testing/tools/debugger/gdbsx/gx/gx_comm.c
@@ -163,7 +163,7 @@ readchar(void)
static char buf[BUFSIZ];
static int bufcnt = 0;
@@ -216,8 +244,10 @@
if (bufcnt-- > 0)
return *bufp++ & 0x7f;
---- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
-+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
+Index: xen-4.1.2-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
++++ xen-4.1.2-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
@@ -820,7 +820,7 @@ static int create_suspend_thread(checkpo
static void stop_suspend_thread(checkpoint_state* s)
@@ -227,8 +257,10 @@
s->done = 1;
---- a/tools/python/xen/lowlevel/netlink/libnetlink.c
-+++ b/tools/python/xen/lowlevel/netlink/libnetlink.c
+Index: xen-4.1.2-testing/tools/python/xen/lowlevel/netlink/libnetlink.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/python/xen/lowlevel/netlink/libnetlink.c
++++ xen-4.1.2-testing/tools/python/xen/lowlevel/netlink/libnetlink.c
@@ -433,7 +433,8 @@ int rtnl_from_file(FILE *rtnl, rtnl_filt
nladdr.nl_groups = 0;
@@ -239,8 +271,10 @@
int l;
status = fread(&buf, 1, sizeof(*h), rtnl);
---- a/xen/arch/x86/msi.c
-+++ b/xen/arch/x86/msi.c
+Index: xen-4.1.2-testing/xen/arch/x86/msi.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/msi.c
++++ xen-4.1.2-testing/xen/arch/x86/msi.c
@@ -799,7 +799,7 @@ static void __pci_disable_msi(struct msi
{
struct pci_dev *dev;
@@ -250,9 +284,11 @@
u8 bus, slot, func;
dev = entry->dev;
---- a/xen/arch/x86/microcode_amd.c
-+++ b/xen/arch/x86/microcode_amd.c
-@@ -160,7 +160,7 @@ static int apply_microcode(int cpu)
+Index: xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/microcode_amd.c
++++ xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
+@@ -151,7 +151,7 @@ static int apply_microcode(int cpu)
static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
size_t size, unsigned long *offset)
{
@@ -261,8 +297,10 @@
size_t total_size;
const uint8_t *bufp = buf;
unsigned long off;
---- a/xen/common/cpupool.c
-+++ b/xen/common/cpupool.c
+Index: xen-4.1.2-testing/xen/common/cpupool.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/cpupool.c
++++ xen-4.1.2-testing/xen/common/cpupool.c
@@ -356,7 +356,7 @@ int cpupool_add_domain(struct domain *d,
{
struct cpupool *c;
@@ -283,8 +321,10 @@
if ( d->cpupool == NULL )
return;
---- a/xen/common/grant_table.c
-+++ b/xen/common/grant_table.c
+Index: xen-4.1.2-testing/xen/common/grant_table.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/grant_table.c
++++ xen-4.1.2-testing/xen/common/grant_table.c
@@ -765,7 +765,7 @@ __gnttab_unmap_common(
struct domain *ld, *rd;
struct active_grant_entry *act;
@@ -294,8 +334,10 @@
ld = current->domain;
---- a/xen/common/kexec.c
-+++ b/xen/common/kexec.c
+Index: xen-4.1.2-testing/xen/common/kexec.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/kexec.c
++++ xen-4.1.2-testing/xen/common/kexec.c
@@ -569,7 +569,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
{
xen_kexec_exec_t exec;
@@ -306,8 +348,10 @@
if ( unlikely(copy_from_guest(&exec, uarg, 1)) )
return -EFAULT;
---- a/xen/drivers/passthrough/vtd/intremap.c
-+++ b/xen/drivers/passthrough/vtd/intremap.c
+Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/intremap.c
++++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c
@@ -367,7 +367,7 @@ unsigned int io_apic_read_remap_rte(
unsigned int ioapic_pin = (reg - 0x10) / 2;
int index;
@@ -326,8 +370,10 @@
iommu = drhd->iommu;
qi_ctrl = iommu_qi_ctrl(iommu);
---- a/xen/common/sched_credit2.c
-+++ b/xen/common/sched_credit2.c
+Index: xen-4.1.2-testing/xen/common/sched_credit2.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/sched_credit2.c
++++ xen-4.1.2-testing/xen/common/sched_credit2.c
@@ -1854,7 +1854,8 @@ static void deactivate_runqueue(struct c
static void init_pcpu(const struct scheduler *ops, int cpu)
@@ -338,9 +384,11 @@
struct csched_private *prv = CSCHED_PRIV(ops);
struct csched_runqueue_data *rqd;
spinlock_t *old_lock;
---- a/xen/common/unlzo.c
-+++ b/xen/common/unlzo.c
-@@ -68,7 +68,7 @@ static int INIT parse_header(u8 *input,
+Index: xen-4.1.2-testing/xen/common/unlzo.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/unlzo.c
++++ xen-4.1.2-testing/xen/common/unlzo.c
+@@ -68,7 +68,7 @@ static int INIT parse_header(u8 *input,
{
int l;
u8 *parse = input;
@@ -349,8 +397,10 @@
u16 version;
/* read magic: 9 first bits */
---- a/xen/arch/x86/time.c
-+++ b/xen/arch/x86/time.c
+Index: xen-4.1.2-testing/xen/arch/x86/time.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/time.c
++++ xen-4.1.2-testing/xen/arch/x86/time.c
@@ -1009,7 +1009,8 @@ static void local_time_calibration(void)
* System timestamps, extrapolated from local and master oscillators,
* taken during this calibration and the previous calibration.
@@ -361,8 +411,10 @@
s_time_t prev_master_stime, curr_master_stime;
/* TSC timestamps taken during this calibration and prev calibration. */
---- a/xen/arch/x86/cpu/amd.c
-+++ b/xen/arch/x86/cpu/amd.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/amd.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/amd.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/amd.c
@@ -391,7 +391,7 @@ static void __devinit init_amd(struct cp
{
u32 l, h;
@@ -372,9 +424,11 @@
#ifdef CONFIG_SMP
unsigned long long value;
---- a/xen/arch/x86/mm/p2m.c
-+++ b/xen/arch/x86/mm/p2m.c
-@@ -2338,7 +2338,7 @@ p2m_remove_page(struct p2m_domain *p2m,
+Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
++++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
+@@ -2338,7 +2338,7 @@ p2m_remove_page(struct p2m_domain *p2m,
unsigned int page_order)
{
unsigned long i;
@@ -392,8 +446,10 @@
int pod_count = 0;
int rc = 0;
---- a/xen/arch/x86/hvm/emulate.c
-+++ b/xen/arch/x86/hvm/emulate.c
+Index: xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/emulate.c
++++ xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c
@@ -59,7 +59,7 @@ static int hvmemul_do_io(
ioreq_t *p = get_ioreq(curr);
unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
@@ -403,8 +459,10 @@
int rc;
/* Check for paged out page */
---- a/xen/arch/x86/hvm/hvm.c
-+++ b/xen/arch/x86/hvm/hvm.c
+Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c
++++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
@@ -253,7 +253,8 @@ void hvm_migrate_timers(struct vcpu *v)
void hvm_migrate_pirqs(struct vcpu *v)
@@ -424,8 +482,10 @@
mfn = gfn_to_mfn_unshare(p2m, pfn, &t, 0);
if ( p2m_is_paging(t) )
{
---- a/xen/arch/x86/acpi/cpu_idle.c
-+++ b/xen/arch/x86/acpi/cpu_idle.c
+Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/acpi/cpu_idle.c
++++ xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c
@@ -275,7 +275,7 @@ static void acpi_processor_ffh_cstate_en
static void acpi_idle_do_entry(struct acpi_processor_cx *cx)
@@ -435,8 +495,10 @@
switch ( cx->entry_method )
{
---- a/xen/arch/x86/cpu/intel_cacheinfo.c
-+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/intel_cacheinfo.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/intel_cacheinfo.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -170,7 +170,8 @@ unsigned int __cpuinit init_intel_cachei
unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
@@ -447,9 +509,11 @@
if (c->cpuid_level > 3) {
static int is_initialized;
---- a/xen/arch/x86/mm/mem_sharing.c
-+++ b/xen/arch/x86/mm/mem_sharing.c
-@@ -376,7 +376,7 @@ int mem_sharing_debug_gfn(struct domain
+Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c
++++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
+@@ -375,7 +375,7 @@ int mem_sharing_debug_gfn(struct domain
{
p2m_type_t p2mt;
mfn_t mfn;
@@ -458,8 +522,10 @@
mfn = gfn_to_mfn(p2m_get_hostp2m(d), gfn, &p2mt);
page = mfn_to_page(mfn);
---- a/xen/arch/x86/hvm/viridian.c
-+++ b/xen/arch/x86/hvm/viridian.c
+Index: xen-4.1.2-testing/xen/arch/x86/hvm/viridian.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/viridian.c
++++ xen-4.1.2-testing/xen/arch/x86/hvm/viridian.c
@@ -270,7 +270,7 @@ int rdmsr_viridian_regs(uint32_t idx, ui
int viridian_hypercall(struct cpu_user_regs *regs)
{
@@ -469,9 +535,11 @@
uint16_t status = HV_STATUS_SUCCESS;
union hypercall_input {
---- a/xen/arch/x86/mm.c
-+++ b/xen/arch/x86/mm.c
-@@ -4904,7 +4904,7 @@ static int ptwr_emulated_update(
+Index: xen-4.1.2-testing/xen/arch/x86/mm.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
++++ xen-4.1.2-testing/xen/arch/x86/mm.c
+@@ -4906,7 +4906,7 @@ static int ptwr_emulated_update(
{
unsigned long mfn;
unsigned long unaligned_addr = addr;
@@ -480,8 +548,10 @@
l1_pgentry_t pte, ol1e, nl1e, *pl1e;
struct vcpu *v = current;
struct domain *d = v->domain;
---- a/xen/arch/x86/x86_64/mm.c
-+++ b/xen/arch/x86/x86_64/mm.c
+Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
++++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
@@ -436,7 +436,8 @@ void destroy_m2p_mapping(struct mem_hota
static int setup_compat_m2p_table(struct mem_hotadd_info *info)
{
@@ -492,8 +562,10 @@
l3_pgentry_t *l3_ro_mpt = NULL;
l2_pgentry_t *l2_ro_mpt = NULL;
struct page_info *l1_pg;
---- a/xen/arch/x86/cpu/mcheck/mce.c
-+++ b/xen/arch/x86/cpu/mcheck/mce.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/mce.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c
@@ -151,7 +151,6 @@ static struct mcinfo_bank *mca_init_bank
struct mc_info *mi, int bank)
{
@@ -510,7 +582,7 @@
if (mib->mc_status & MCi_STATUS_MISCV)
mib->mc_misc = mca_rdmsr(MSR_IA32_MCx_MISC(bank));
-@@ -281,7 +279,7 @@ mctelem_cookie_t mcheck_mca_logout(enum
+@@ -281,7 +279,7 @@ mctelem_cookie_t mcheck_mca_logout(enum
recover = (mc_recoverable_scan)? 1: 0;
for (i = 0; i < 32 && i < nr_mce_banks; i++) {
@@ -528,8 +600,10 @@
uint64_t hwcr = 0;
int intpose;
int i;
---- a/xen/common/tmem.c
-+++ b/xen/common/tmem.c
+Index: xen-4.1.2-testing/xen/common/tmem.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/tmem.c
++++ xen-4.1.2-testing/xen/common/tmem.c
@@ -1351,7 +1351,8 @@ obj_unlock:
static int tmem_evict(void)
{
@@ -550,8 +624,10 @@
client_t *client = pool->client;
int ret = client->frozen ? -EFROZEN : -ENOMEM;
---- a/xen/common/tmem_xen.c
-+++ b/xen/common/tmem_xen.c
+Index: xen-4.1.2-testing/xen/common/tmem_xen.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/tmem_xen.c
++++ xen-4.1.2-testing/xen/common/tmem_xen.c
@@ -177,7 +177,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
void **out_va, size_t *out_len, void *cli_va)
@@ -589,8 +665,10 @@
tmh->persistent_pool = xmem_pool_create(name, tmh_persistent_pool_page_get,
tmh_persistent_pool_page_put, PAGE_SIZE, 0, PAGE_SIZE);
if ( tmh->persistent_pool == NULL )
---- a/xen/arch/x86/cpu/mcheck/vmce.c
-+++ b/xen/arch/x86/cpu/mcheck/vmce.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/vmce.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c
@@ -574,7 +574,7 @@ int is_vmce_ready(struct mcinfo_bank *ba
*/
int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn)
@@ -600,9 +678,11 @@
struct p2m_domain *p2m;
p2m_type_t pt;
---- a/xen/arch/x86/mm/shadow/multi.c
-+++ b/xen/arch/x86/mm/shadow/multi.c
-@@ -124,7 +124,7 @@ set_shadow_status(struct vcpu *v, mfn_t
+Index: xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm/shadow/multi.c
++++ xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c
+@@ -124,7 +124,7 @@ set_shadow_status(struct vcpu *v, mfn_t
/* Put a shadow into the hash table */
{
struct domain *d = v->domain;
@@ -620,8 +700,10 @@
shadow_l1e_t *sl1p, sl1e;
struct page_info *sp;
---- a/xen/arch/x86/domain_build.c
-+++ b/xen/arch/x86/domain_build.c
+Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/domain_build.c
++++ xen-4.1.2-testing/xen/arch/x86/domain_build.c
@@ -378,8 +378,7 @@ int __init construct_dom0(
return rc;
@@ -632,9 +714,11 @@
machine = elf_uval(&elf, elf.ehdr, e_machine);
switch (CONFIG_PAGING_LEVELS) {
case 3: /* x86_32p */
---- a/xen/arch/x86/traps.c
-+++ b/xen/arch/x86/traps.c
-@@ -1853,7 +1853,11 @@ static int emulate_privileged_op(struct
+Index: xen-4.1.2-testing/xen/arch/x86/traps.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/traps.c
++++ xen-4.1.2-testing/xen/arch/x86/traps.c
+@@ -1854,7 +1854,11 @@ static int emulate_privileged_op(struct
struct vcpu *v = current;
unsigned long *reg, eip = regs->eip;
u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0, lock = 0, rex = 0;
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package xen for openSUSE:Factory checked in at 2011-10-29 06:50:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xen (Old)
and /work/SRC/openSUSE:Factory/.xen.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xen", Maintainer is "CARNOLD(a)suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/xen/xen.changes 2011-10-21 16:46:34.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.xen.new/xen.changes 2011-10-29 06:50:25.000000000 +0200
@@ -1,0 +2,80 @@
+Wed Oct 26 10:13:04 MDT 2011 - carnold(a)novell.com
+
+- bnc#725169 - xen-4.0.2_21511_03-0.5.3: bootup hangs
+ 23993-x86-microcode-amd-fix-23871.patch
+
+-------------------------------------------------------------------
+Wed Oct 26 09:48:14 MDT 2011 - carnold(a)novell.com
+
+- Update to Xen 4.1.2 FCS c/s 23174
+
+-------------------------------------------------------------------
+Mon Oct 24 09:26:24 MDT 2011 - jfehlig(a)suse.com
+
+- bnc#720054 - Fix syntax error introduced during recent adjustment
+ of Xen's tap udev rule.
+ Updated udev-rules.patch
+
+-------------------------------------------------------------------
+Thu Oct 20 21:39:08 CEST 2011 - ohering(a)suse.de
+
+- fate#310510 - fix xenpaging
+ Merge paging related fixes from xen-unstable:
+ 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch
+ 23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch
+ 23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch
+ 23562-xenpaging_remove_unused_spinlock_in_pager.patch
+ 23576-x86_show_page_walk_also_for_early_page_faults.patch
+ 23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch
+ 23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch
+ 23579-xenpaging_drop_xc.c_remove_ASSERT.patch
+ 23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch
+ 23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch
+ 23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch
+ 23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch
+ 23584-xenpaging_drop_xc.c_remove_xc_files.patch
+ 23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch
+ 23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch
+ 23587-xenpaging_remove_srand_call.patch
+ 23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch
+ 23589-xenpaging_catch_xc_mem_paging_resume_errors.patch
+ 23590-xenpaging_remove_local_domain_id_variable.patch
+ 23591-xenpaging_move_num_pages_into_xenpaging_struct.patch
+ 23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch
+ 23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch
+ 23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch
+ 23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch
+ 23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch
+ 23597-xenpaging_remove_private_mem_event.h.patch
+ 23599-tools_fix_build_after_recent_xenpaging_changes.patch
+ 23817-mem_event_add_ref_counting_for_free_requestslots.patch
+ 23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch
+ 23827-xenpaging_use_batch_of_pages_during_final_page-in.patch
+ 23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch
+ 23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch
+ 23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch
+ 23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch
+ 23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch
+ 23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch
+ 23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch
+ 23943-xenpaging_clear_page_content_after_evict.patch
+ 23953-xenpaging_handle_evict_failures.patch
+ 23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch
+ 23979-xenpaging_document_p2m_mem_paging_functions.patch
+ 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch
+ Remove obsolete patches:
+ x86-show-page-walk-early.patch
+ xenpaging.23817-mem_event_check_ring.patch
+ xenpaging.catch-xc_mem_paging_resume-error.patch
+ xenpaging.guest_remove_page.slow_path.patch
+ xenpaging.mem_event-no-p2mt.patch
+ xenpaging.no-srand.patch
+ xenpaging.return-void.patch
+ xenpaging.xenpaging_populate_page-gfn.patch
+
+-------------------------------------------------------------------
+Thu Oct 20 20:57:11 CEST 2011 - ohering(a)suse.de
+
+- xen.spec: use changeset number as patch number for upstream patches
+
+-------------------------------------------------------------------
Old:
----
x86-show-page-walk-early.patch
xenpaging.23817-mem_event_check_ring.patch
xenpaging.catch-xc_mem_paging_resume-error.patch
xenpaging.guest_remove_page.slow_path.patch
xenpaging.mem_event-no-p2mt.patch
xenpaging.no-srand.patch
xenpaging.return-void.patch
xenpaging.xenpaging_populate_page-gfn.patch
New:
----
23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch
23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch
23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch
23562-xenpaging_remove_unused_spinlock_in_pager.patch
23576-x86_show_page_walk_also_for_early_page_faults.patch
23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch
23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch
23579-xenpaging_drop_xc.c_remove_ASSERT.patch
23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch
23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch
23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch
23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch
23584-xenpaging_drop_xc.c_remove_xc_files.patch
23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch
23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch
23587-xenpaging_remove_srand_call.patch
23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch
23589-xenpaging_catch_xc_mem_paging_resume_errors.patch
23590-xenpaging_remove_local_domain_id_variable.patch
23591-xenpaging_move_num_pages_into_xenpaging_struct.patch
23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch
23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch
23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch
23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch
23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch
23597-xenpaging_remove_private_mem_event.h.patch
23599-tools_fix_build_after_recent_xenpaging_changes.patch
23817-mem_event_add_ref_counting_for_free_requestslots.patch
23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch
23827-xenpaging_use_batch_of_pages_during_final_page-in.patch
23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch
23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch
23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch
23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch
23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch
23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch
23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch
23943-xenpaging_clear_page_content_after_evict.patch
23953-xenpaging_handle_evict_failures.patch
23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch
23979-xenpaging_document_p2m_mem_paging_functions.patch
23980-xenpaging_disallow_paging_in_a_PoD_guest.patch
23993-x86-microcode-amd-fix-23871.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:36.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:36.000000000 +0200
@@ -22,7 +22,7 @@
ExclusiveArch: %ix86 x86_64
%define xvers 4.1
%define xvermaj 4
-%define changeset 23171
+%define changeset 23174
%define xen_build_dir xen-4.1.2-testing
%define with_kmp 1
%define with_stubdom 1
@@ -96,7 +96,7 @@
%if %{?with_kmp}0
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
-Version: 4.1.2_03
+Version: 4.1.2_05
Release: 1
License: GPLv2+
Group: System/Kernel
@@ -142,62 +142,105 @@
# http://xenbits.xensource.com/ext/xenalyze
Source20000: xenalyze.hg.tar.bz2
# Upstream patches
-Patch1: 22998-x86-get_page_from_l1e-retcode.patch
-Patch2: 22999-x86-mod_l1_entry-retcode.patch
-Patch3: 23000-x86-mod_l2_entry-retcode.patch
-Patch4: 23074-pfn.h.patch
-Patch5: 23096-x86-hpet-no-cpumask_lock.patch
-Patch6: 23099-x86-rwlock-scalability.patch
-Patch7: 23103-x86-pirq-guest-eoi-check.patch
-Patch8: 23127-vtd-bios-settings.patch
-Patch9: 23199-amd-iommu-unmapped-intr-fault.patch
-Patch10: 23233-hvm-cr-access.patch
-Patch11: 23234-svm-decode-assist-base.patch
-Patch12: 23235-svm-decode-assist-crs.patch
-Patch13: 23236-svm-decode-assist-invlpg.patch
-Patch14: 23238-svm-decode-assist-insn-fetch.patch
-Patch15: 23246-x86-xsave-enable.patch
-Patch16: 23303-cpufreq-misc.patch
-Patch17: 23304-amd-oprofile-strings.patch
-Patch18: 23305-amd-fam15-xenoprof.patch
-Patch19: 23306-amd-fam15-vpmu.patch
-Patch20: 23334-amd-fam12+14-vpmu.patch
-Patch21: 23383-libxc-rm-static-vars.patch
-Patch22: 23437-amd-fam15-TSC-scaling.patch
-Patch23: 23462-libxc-cpu-feature.patch
-Patch24: 23508-vmx-proc-based-ctls-probe.patch
-Patch25: 23511-amd-fam15-no-flush-for-C3.patch
-Patch26: 23571-vtd-fault-verbosity.patch
-Patch27: 23574-x86-dom0-compressed-ELF.patch
-Patch28: 23575-x86-DMI.patch
-Patch29: 23610-x86-topology-info.patch
-Patch30: 23611-amd-fam15-topology.patch
-Patch31: 23613-EFI-headers.patch
-Patch32: 23614-x86_64-EFI-boot.patch
-Patch33: 23615-x86_64-EFI-runtime.patch
-Patch34: 23616-x86_64-EFI-MPS.patch
-Patch35: 23676-x86_64-image-map-bounds.patch
-Patch36: 23723-x86-CMOS-lock.patch
-Patch37: 23724-x86-smpboot-x2apic.patch
-Patch38: 23726-x86-intel-flexmigration-v2.patch
-Patch39: 23735-guest-dom0-cap.patch
-Patch40: 23747-mmcfg-base-address.patch
-Patch41: 23749-mmcfg-reservation.patch
-Patch42: 23771-x86-ioapic-clear-pin.patch
-Patch43: 23772-x86-trampoline.patch
-Patch44: 23774-x86_64-EFI-EDD.patch
-Patch45: 23781-pm-wide-ACPI-ids.patch
-Patch46: 23782-x86-ioapic-clear-irr.patch
-Patch47: 23783-ACPI-set-_PDC-bits.patch
-Patch48: 23795-intel-ich10-quirk.patch
-Patch49: 23800-x86_64-guest-addr-range.patch
-Patch50: 23804-x86-IPI-counts.patch
-Patch51: 23853-x86-pv-cpuid-xsave.patch
-Patch52: 23897-x86-mce-offline-again.patch
-Patch53: 23925-x86-AMD-ARAT-Fam12.patch
-Patch54: 23933-pt-bus2bridge-update.patch
-Patch55: 23955-x86-pv-cpuid-xsave.patch
-Patch56: 23957-cpufreq-error-paths.patch
+Patch22998: 22998-x86-get_page_from_l1e-retcode.patch
+Patch22999: 22999-x86-mod_l1_entry-retcode.patch
+Patch23000: 23000-x86-mod_l2_entry-retcode.patch
+Patch23074: 23074-pfn.h.patch
+Patch23096: 23096-x86-hpet-no-cpumask_lock.patch
+Patch23099: 23099-x86-rwlock-scalability.patch
+Patch23103: 23103-x86-pirq-guest-eoi-check.patch
+Patch23127: 23127-vtd-bios-settings.patch
+Patch23199: 23199-amd-iommu-unmapped-intr-fault.patch
+Patch23233: 23233-hvm-cr-access.patch
+Patch23234: 23234-svm-decode-assist-base.patch
+Patch23235: 23235-svm-decode-assist-crs.patch
+Patch23236: 23236-svm-decode-assist-invlpg.patch
+Patch23238: 23238-svm-decode-assist-insn-fetch.patch
+Patch23246: 23246-x86-xsave-enable.patch
+Patch23303: 23303-cpufreq-misc.patch
+Patch23304: 23304-amd-oprofile-strings.patch
+Patch23305: 23305-amd-fam15-xenoprof.patch
+Patch23306: 23306-amd-fam15-vpmu.patch
+Patch23334: 23334-amd-fam12+14-vpmu.patch
+Patch23383: 23383-libxc-rm-static-vars.patch
+Patch23437: 23437-amd-fam15-TSC-scaling.patch
+Patch23462: 23462-libxc-cpu-feature.patch
+Patch23506: 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch
+Patch23507: 23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch
+Patch23508: 23508-vmx-proc-based-ctls-probe.patch
+Patch23509: 23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch
+Patch23511: 23511-amd-fam15-no-flush-for-C3.patch
+Patch23562: 23562-xenpaging_remove_unused_spinlock_in_pager.patch
+Patch23571: 23571-vtd-fault-verbosity.patch
+Patch23574: 23574-x86-dom0-compressed-ELF.patch
+Patch23575: 23575-x86-DMI.patch
+Patch23576: 23576-x86_show_page_walk_also_for_early_page_faults.patch
+Patch23577: 23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch
+Patch23578: 23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch
+Patch23579: 23579-xenpaging_drop_xc.c_remove_ASSERT.patch
+Patch23580: 23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch
+Patch23581: 23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch
+Patch23582: 23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch
+Patch23583: 23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch
+Patch23584: 23584-xenpaging_drop_xc.c_remove_xc_files.patch
+Patch23585: 23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch
+Patch23586: 23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch
+Patch23587: 23587-xenpaging_remove_srand_call.patch
+Patch23588: 23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch
+Patch23589: 23589-xenpaging_catch_xc_mem_paging_resume_errors.patch
+Patch23590: 23590-xenpaging_remove_local_domain_id_variable.patch
+Patch23591: 23591-xenpaging_move_num_pages_into_xenpaging_struct.patch
+Patch23592: 23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch
+Patch23593: 23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch
+Patch23594: 23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch
+Patch23595: 23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch
+Patch23596: 23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch
+Patch23597: 23597-xenpaging_remove_private_mem_event.h.patch
+Patch23599: 23599-tools_fix_build_after_recent_xenpaging_changes.patch
+Patch23610: 23610-x86-topology-info.patch
+Patch23611: 23611-amd-fam15-topology.patch
+Patch23613: 23613-EFI-headers.patch
+Patch23614: 23614-x86_64-EFI-boot.patch
+Patch23615: 23615-x86_64-EFI-runtime.patch
+Patch23616: 23616-x86_64-EFI-MPS.patch
+Patch23676: 23676-x86_64-image-map-bounds.patch
+Patch23723: 23723-x86-CMOS-lock.patch
+Patch23724: 23724-x86-smpboot-x2apic.patch
+Patch23726: 23726-x86-intel-flexmigration-v2.patch
+Patch23735: 23735-guest-dom0-cap.patch
+Patch23747: 23747-mmcfg-base-address.patch
+Patch23749: 23749-mmcfg-reservation.patch
+Patch23771: 23771-x86-ioapic-clear-pin.patch
+Patch23772: 23772-x86-trampoline.patch
+Patch23774: 23774-x86_64-EFI-EDD.patch
+Patch23781: 23781-pm-wide-ACPI-ids.patch
+Patch23782: 23782-x86-ioapic-clear-irr.patch
+Patch23783: 23783-ACPI-set-_PDC-bits.patch
+Patch23795: 23795-intel-ich10-quirk.patch
+Patch23800: 23800-x86_64-guest-addr-range.patch
+Patch23804: 23804-x86-IPI-counts.patch
+Patch23817: 23817-mem_event_add_ref_counting_for_free_requestslots.patch
+Patch23818: 23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch
+Patch23827: 23827-xenpaging_use_batch_of_pages_during_final_page-in.patch
+Patch23841: 23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch
+Patch23842: 23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch
+Patch23853: 23853-x86-pv-cpuid-xsave.patch
+Patch23874: 23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch
+Patch23897: 23897-x86-mce-offline-again.patch
+Patch23904: 23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch
+Patch23905: 23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch
+Patch23906: 23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch
+Patch23908: 23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch
+Patch23925: 23925-x86-AMD-ARAT-Fam12.patch
+Patch23933: 23933-pt-bus2bridge-update.patch
+Patch23943: 23943-xenpaging_clear_page_content_after_evict.patch
+Patch23953: 23953-xenpaging_handle_evict_failures.patch
+Patch23955: 23955-x86-pv-cpuid-xsave.patch
+Patch23957: 23957-cpufreq-error-paths.patch
+Patch23978: 23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch
+Patch23979: 23979-xenpaging_document_p2m_mem_paging_functions.patch
+Patch23980: 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch
+Patch23993: 23993-x86-microcode-amd-fix-23871.patch
# Upstream qemu patches
# Our patches
Patch300: xen-config.diff
@@ -311,7 +354,6 @@
Patch502: x86-cpufreq-report.patch
Patch504: dom-print.patch
Patch505: pvdrv-import-shared-info.patch
-Patch506: x86-show-page-walk-early.patch
Patch507: x86-extra-trap-info.patch
Patch508: pvdrv_emulation_control.patch
Patch509: blktap-pv-cdrom.patch
@@ -339,14 +381,7 @@
Patch1011: xen-unstable.xentrace.data_size__read_mostly.patch
Patch1012: xen-unstable.xentrace.__insert_record-dst-type.patch
# FATE 310510
-Patch1100: xenpaging.guest_remove_page.slow_path.patch
-Patch1101: xenpaging.mem_event-no-p2mt.patch
-Patch1102: xenpaging.no-srand.patch
-Patch1103: xenpaging.return-void.patch
-Patch1104: xenpaging.catch-xc_mem_paging_resume-error.patch
-Patch1105: xenpaging.xenpaging_populate_page-gfn.patch
Patch1106: xenpaging.autostart.patch
-Patch1107: xenpaging.23817-mem_event_check_ring.patch
# xenalyze
Patch20000: xenalyze.gcc46.patch
# Build patch
@@ -690,62 +725,107 @@
%setup -q -n %xen_build_dir -a 1 -a 20000
%patch20000 -p1
tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-%patch15 -p1
-%patch16 -p1
-%patch17 -p1
-%patch18 -p1
-%patch19 -p1
-%patch20 -p1
-%patch21 -p1
-%patch22 -p1
-%patch23 -p1
-%patch24 -p1
-%patch25 -p1
-%patch26 -p1
-%patch27 -p1
-%patch28 -p1
-%patch29 -p1
-%patch30 -p1
-%patch31 -p1
-%patch32 -p1
-%patch33 -p1
-%patch34 -p1
-%patch35 -p1
-%patch36 -p1
-%patch37 -p1
-%patch38 -p1
-%patch39 -p1
-%patch40 -p1
-%patch41 -p1
-%patch42 -p1
-%patch43 -p1
-%patch44 -p1
-%patch45 -p1
-%patch46 -p1
-%patch47 -p1
-%patch48 -p1
-%patch49 -p1
-%patch50 -p1
-%patch51 -p1
-%patch52 -p1
-%patch53 -p1
-%patch54 -p1
-%patch55 -p1
-%patch56 -p1
+# Upstream patches
+%patch22998 -p1
+%patch22999 -p1
+%patch23000 -p1
+%patch23074 -p1
+%patch23096 -p1
+%patch23099 -p1
+%patch23103 -p1
+%patch23127 -p1
+%patch23199 -p1
+%patch23233 -p1
+%patch23234 -p1
+%patch23235 -p1
+%patch23236 -p1
+%patch23238 -p1
+%patch23246 -p1
+%patch23303 -p1
+%patch23304 -p1
+%patch23305 -p1
+%patch23306 -p1
+%patch23334 -p1
+%patch23383 -p1
+%patch23437 -p1
+%patch23462 -p1
+%patch23506 -p1
+%patch23507 -p1
+%patch23508 -p1
+%patch23509 -p1
+%patch23511 -p1
+%patch23562 -p1
+%patch23571 -p1
+%patch23574 -p1
+%patch23575 -p1
+%patch23576 -p1
+%patch23577 -p1
+%patch23578 -p1
+%patch23579 -p1
+%patch23580 -p1
+%patch23581 -p1
+%patch23582 -p1
+%patch23583 -p1
+%patch23584 -p1
+%patch23585 -p1
+%patch23586 -p1
+%patch23587 -p1
+%patch23588 -p1
+%patch23589 -p1
+%patch23590 -p1
+%patch23591 -p1
+%patch23592 -p1
+%patch23593 -p1
+%patch23594 -p1
+%patch23595 -p1
+%patch23596 -p1
+%patch23597 -p1
+%patch23599 -p1
+%patch23610 -p1
+%patch23611 -p1
+%patch23613 -p1
+%patch23614 -p1
+%patch23615 -p1
+%patch23616 -p1
+%patch23676 -p1
+%patch23723 -p1
+%patch23724 -p1
+%patch23726 -p1
+%patch23735 -p1
+%patch23747 -p1
+%patch23749 -p1
+%patch23771 -p1
+%patch23772 -p1
+%patch23774 -p1
+%patch23781 -p1
+%patch23782 -p1
+%patch23783 -p1
+%patch23795 -p1
+%patch23800 -p1
+%patch23804 -p1
+%patch23817 -p1
+%patch23818 -p1
+%patch23827 -p1
+%patch23841 -p1
+%patch23842 -p1
+%patch23853 -p1
+%patch23874 -p1
+%patch23897 -p1
+%patch23904 -p1
+%patch23905 -p1
+%patch23906 -p1
+%patch23908 -p1
+%patch23925 -p1
+%patch23933 -p1
+%patch23943 -p1
+%patch23953 -p1
+%patch23955 -p1
+%patch23957 -p1
+%patch23978 -p1
+%patch23979 -p1
+%patch23980 -p1
+%patch23993 -p1
+# Upstream patches
%patch300 -p1
%patch301 -p1
%patch302 -p1
@@ -851,7 +931,6 @@
%patch502 -p1
%patch504 -p1
%patch505 -p1
-%patch506 -p1
%patch507 -p1
%patch508 -p1
%patch509 -p1
@@ -879,14 +958,7 @@
%patch1011 -p1
%patch1012 -p1
# FATE 310510
-%patch1100 -p1
-%patch1101 -p1
-%patch1102 -p1
-%patch1103 -p1
-%patch1104 -p1
-%patch1105 -p1
%patch1106 -p1
-%patch1107 -p1
#
%patch99998 -p1
%patch99999 -p1
++++++ 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch ++++++
changeset: 23506:d1309a79bde8
user: Keir Fraser <keir(a)xen.org>
date: Fri Jun 10 08:18:33 2011 +0100
files: xen/arch/x86/x86_64/mm.c xen/include/asm-x86/mm.h
description:
x86: Disable set_gpfn_from_mfn until m2p table is allocated.
This is a prerequisite for calling set_gpfn_from_mfn() unconditionally
from free_heap_pages().
Signed-off-by: Keir Fraser <keir(a)xen.org>
---
xen/arch/x86/x86_64/mm.c | 4 ++++
xen/include/asm-x86/mm.h | 15 +++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
@@ -47,6 +47,8 @@ unsigned int __read_mostly pfn_pdx_hole_
unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
+bool_t __read_mostly machine_to_phys_mapping_valid = 0;
+
/* Top-level master (and idle-domain) page directory. */
l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
idle_pg_table[L4_PAGETABLE_ENTRIES];
@@ -800,6 +802,8 @@ void __init paging_init(void)
#undef CNT
#undef MFN
+ machine_to_phys_mapping_valid = 1;
+
/* Set up linear page table mapping. */
l4e_write(&idle_pg_table[l4_table_offset(LINEAR_PT_VIRT_START)],
l4e_from_paddr(__pa(idle_pg_table), __PAGE_HYPERVISOR));
Index: xen-4.1.2-testing/xen/include/asm-x86/mm.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/asm-x86/mm.h
+++ xen-4.1.2-testing/xen/include/asm-x86/mm.h
@@ -469,7 +469,7 @@ TYPE_SAFE(unsigned long,mfn);
#ifdef CONFIG_COMPAT
#define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START)
-#define set_gpfn_from_mfn(mfn, pfn) ({ \
+#define _set_gpfn_from_mfn(mfn, pfn) ({ \
struct domain *d = page_get_owner(__mfn_to_page(mfn)); \
unsigned long entry = (d && (d == dom_cow)) ? \
SHARED_M2P_ENTRY : (pfn); \
@@ -478,7 +478,7 @@ TYPE_SAFE(unsigned long,mfn);
machine_to_phys_mapping[(mfn)] = (entry)); \
})
#else
-#define set_gpfn_from_mfn(mfn, pfn) ({ \
+#define _set_gpfn_from_mfn(mfn, pfn) ({ \
struct domain *d = page_get_owner(__mfn_to_page(mfn)); \
if(d && (d == dom_cow)) \
machine_to_phys_mapping[(mfn)] = SHARED_M2P_ENTRY; \
@@ -486,6 +486,17 @@ TYPE_SAFE(unsigned long,mfn);
machine_to_phys_mapping[(mfn)] = (pfn); \
})
#endif
+
+/*
+ * Disable some users of set_gpfn_from_mfn() (e.g., free_heap_pages()) until
+ * the machine_to_phys_mapping is actually set up.
+ */
+extern bool_t machine_to_phys_mapping_valid;
+#define set_gpfn_from_mfn(mfn, pfn) do { \
+ if ( machine_to_phys_mapping_valid ) \
+ _set_gpfn_from_mfn(mfn, pfn); \
+} while (0)
+
#define get_gpfn_from_mfn(mfn) (machine_to_phys_mapping[(mfn)])
#define mfn_to_gmfn(_d, mfn) \
++++++ 23507-xenpaging_update_machine_to_phys_mapping_during_page_deallocation.patch ++++++
changeset: 23507:0a29c8c3ddf7
user: Keir Fraser <keir(a)xen.org>
date: Fri Jun 10 08:19:07 2011 +0100
files: xen/common/page_alloc.c
description:
xenpaging: update machine_to_phys_mapping[] during page deallocation
The machine_to_phys_mapping[] array needs updating during page
deallocation. If that page is allocated again, a call to
get_gpfn_from_mfn() will still return an old gfn from another guest.
This will cause trouble because this gfn number has no or different
meaning in the context of the current guest.
This happens when the entire guest ram is paged-out before
xen_vga_populate_vram() runs. Then XENMEM_populate_physmap is called
with gfn 0xff000. A new page is allocated with alloc_domheap_pages.
This new page does not have a gfn yet. However, in
guest_physmap_add_entry() the passed mfn maps still to an old gfn
(perhaps from another old guest). This old gfn is in paged-out state
in this guests context and has no mfn anymore. As a result, the
ASSERT() triggers because p2m_is_ram() is true for p2m_ram_paging*
types. If the machine_to_phys_mapping[] array is updated properly,
both loops in guest_physmap_add_entry() turn into no-ops for the new
page and the mfn/gfn mapping will be done at the end of the function.
If XENMEM_add_to_physmap is used with XENMAPSPACE_gmfn,
get_gpfn_from_mfn() will return an appearently valid gfn. As a
result, guest_physmap_remove_page() is called. The ASSERT in
p2m_remove_page triggers because the passed mfn does not match the old
mfn for the passed gfn.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
xen/common/page_alloc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: xen-4.1.2-testing/xen/common/page_alloc.c
===================================================================
--- xen-4.1.2-testing.orig/xen/common/page_alloc.c
+++ xen-4.1.2-testing/xen/common/page_alloc.c
@@ -528,7 +528,7 @@ static int reserve_offlined_page(struct
static void free_heap_pages(
struct page_info *pg, unsigned int order)
{
- unsigned long mask;
+ unsigned long mask, mfn = page_to_mfn(pg);
unsigned int i, node = phys_to_nid(page_to_maddr(pg)), tainted = 0;
unsigned int zone = page_to_zone(pg);
@@ -539,6 +539,10 @@ static void free_heap_pages(
for ( i = 0; i < (1 << order); i++ )
{
+ /* This page is not a guest frame any more. */
+ page_set_owner(&pg[i], NULL); /* set_gpfn_from_mfn snoops pg owner */
+ set_gpfn_from_mfn(mfn + i, INVALID_M2P_ENTRY);
+
/*
* Cannot assume that count_info == 0, as there are some corner cases
* where it isn't the case and yet it isn't a bug:
++++++ 23509-x86_32_Fix_build_Define_machine_to_phys_mapping_valid.patch ++++++
changeset: 23509:782bc7b2661a
user: Keir Fraser <keir(a)xen.org>
date: Fri Jun 10 13:51:39 2011 +0100
files: xen/arch/x86/x86_32/mm.c
description:
x86_32: Fix build: Define machine_to_phys_mapping_valid
Signed-off-by: Keir Fraser <keir(a)xen.org>
---
xen/arch/x86/x86_32/mm.c | 4 ++++
1 file changed, 4 insertions(+)
Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
@@ -39,6 +39,8 @@ extern l1_pgentry_t l1_identmap[L1_PAGET
unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR;
unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
+bool_t __read_mostly machine_to_phys_mapping_valid = 0;
+
static unsigned long __read_mostly mpt_size;
void *alloc_xen_pagetable(void)
@@ -123,6 +125,8 @@ void __init paging_init(void)
#undef CNT
#undef MFN
+ machine_to_phys_mapping_valid = 1;
+
/* Create page tables for ioremap()/map_domain_page_global(). */
for ( i = 0; i < (IOREMAP_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
{
++++++ 23562-xenpaging_remove_unused_spinlock_in_pager.patch ++++++
changeset: 23562:8a7f52c59d64
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:02 2011 +0200
files: tools/xenpaging/mem_event.h tools/xenpaging/spinlock.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: remove unused spinlock in pager
The spinlock code in the pager is a no-op because xenpaging is a single
threaded application. There is no locking when put_response() places a
response into the ringbuffer.
The only locking is inside the hypervisor, where mem_event_put_request() and
mem_event_get_response() lock the ringbuffer to protect multiple vcpus from
each other.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/mem_event.h | 5 ---
tools/xenpaging/spinlock.h | 69 --------------------------------------------
tools/xenpaging/xenpaging.c | 12 -------
tools/xenpaging/xenpaging.h | 1
4 files changed, 87 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/mem_event.h
+++ xen-4.1.2-testing/tools/xenpaging/mem_event.h
@@ -25,7 +25,6 @@
#define __XEN_MEM_EVENT_H__
-#include "spinlock.h"
#include "xc.h"
#include <xc_private.h>
@@ -33,9 +32,6 @@
#include <xen/mem_event.h>
-#define mem_event_ring_lock_init(_m) spin_lock_init(&(_m)->ring_lock)
-#define mem_event_ring_lock(_m) spin_lock(&(_m)->ring_lock)
-#define mem_event_ring_unlock(_m) spin_unlock(&(_m)->ring_lock)
typedef struct mem_event {
@@ -45,7 +41,6 @@ typedef struct mem_event {
mem_event_back_ring_t back_ring;
mem_event_shared_page_t *shared_page;
void *ring_page;
- spinlock_t ring_lock;
} mem_event_t;
Index: xen-4.1.2-testing/tools/xenpaging/spinlock.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/spinlock.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/spinlock.h
- *
- * Spinlock implementation.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#ifndef __SPINLOCK_H__
-#define __SPINLOCK_H__
-
-
-#include "bitops.h"
-
-
-#define SPIN_LOCK_UNLOCKED 0
-
-
-typedef int spinlock_t;
-
-
-static inline void spin_lock(spinlock_t *lock)
-{
- while ( test_and_set_bit(1, lock) );
-}
-
-static inline void spin_lock_init(spinlock_t *lock)
-{
- *lock = SPIN_LOCK_UNLOCKED;
-}
-
-static inline void spin_unlock(spinlock_t *lock)
-{
- *lock = SPIN_LOCK_UNLOCKED;
-}
-
-static inline int spin_trylock(spinlock_t *lock)
-{
- return !test_and_set_bit(1, lock);
-}
-
-
-#endif // __SPINLOCK_H__
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -32,7 +32,6 @@
#include <xen/mem_event.h>
#include "bitops.h"
-#include "spinlock.h"
#include "file_ops.h"
#include "xc.h"
@@ -127,9 +126,6 @@ static xenpaging_t *xenpaging_init(domid
BACK_RING_INIT(&paging->mem_event.back_ring,
(mem_event_sring_t *)paging->mem_event.ring_page,
PAGE_SIZE);
-
- /* Initialise lock */
- mem_event_ring_lock_init(&paging->mem_event);
/* Initialise Xen */
rc = xc_mem_event_enable(xch, paging->mem_event.domain_id,
@@ -302,8 +298,6 @@ static int get_request(mem_event_t *mem_
mem_event_back_ring_t *back_ring;
RING_IDX req_cons;
- mem_event_ring_lock(mem_event);
-
back_ring = &mem_event->back_ring;
req_cons = back_ring->req_cons;
@@ -315,8 +309,6 @@ static int get_request(mem_event_t *mem_
back_ring->req_cons = req_cons;
back_ring->sring->req_event = req_cons + 1;
- mem_event_ring_unlock(mem_event);
-
return 0;
}
@@ -325,8 +317,6 @@ static int put_response(mem_event_t *mem
mem_event_back_ring_t *back_ring;
RING_IDX rsp_prod;
- mem_event_ring_lock(mem_event);
-
back_ring = &mem_event->back_ring;
rsp_prod = back_ring->rsp_prod_pvt;
@@ -338,8 +328,6 @@ static int put_response(mem_event_t *mem
back_ring->rsp_prod_pvt = rsp_prod;
RING_PUSH_RESPONSES(back_ring);
- mem_event_ring_unlock(mem_event);
-
return 0;
}
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -25,7 +25,6 @@
#define __XEN_PAGING2_H__
-#include "spinlock.h"
#include "xc.h"
#include <xc_private.h>
++++++ 23576-x86_show_page_walk_also_for_early_page_faults.patch ++++++
changeset: 23576:e2235fe267eb
user: Jan Beulich <jbeulich(a)novell.com>
date: Thu Jun 23 11:35:55 2011 +0100
files: xen/arch/x86/mm.c xen/arch/x86/traps.c xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/mm.c xen/arch/x86/x86_64/traps.c
description:
x86: show page walk also for early page faults
At once, move the common (between 32- and 64-bit) definition of
machine_to_phys_mapping_valid to a common location.
Signed-off-by: Jan Beulich <jbeulich(a)novell.com>
---
xen/arch/x86/mm.c | 2 ++
xen/arch/x86/traps.c | 1 +
xen/arch/x86/x86_32/mm.c | 2 --
xen/arch/x86/x86_32/traps.c | 9 ++++++---
xen/arch/x86/x86_64/mm.c | 2 --
xen/arch/x86/x86_64/traps.c | 12 ++++++++----
6 files changed, 17 insertions(+), 11 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/mm.c
@@ -151,6 +151,8 @@ unsigned long __read_mostly pdx_group_va
(FRAMETABLE_SIZE / sizeof(*frame_table) + PDX_GROUP_COUNT - 1)
/ PDX_GROUP_COUNT)] = { [0] = 1 };
+bool_t __read_mostly machine_to_phys_mapping_valid = 0;
+
#define PAGE_CACHE_ATTRS (_PAGE_PAT|_PAGE_PCD|_PAGE_PWT)
bool_t __read_mostly opt_allow_superpage;
Index: xen-4.1.2-testing/xen/arch/x86/traps.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/traps.c
+++ xen-4.1.2-testing/xen/arch/x86/traps.c
@@ -1428,6 +1428,7 @@ asmlinkage void __init do_early_page_fau
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);
+ show_page_walk(cr2);
printk("Stack dump: ");
while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
printk("%p ", _p(*stk++));
Index: xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_32/mm.c
@@ -39,8 +39,6 @@ extern l1_pgentry_t l1_identmap[L1_PAGET
unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR;
unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
-bool_t __read_mostly machine_to_phys_mapping_valid = 0;
-
static unsigned long __read_mostly mpt_size;
void *alloc_xen_pagetable(void)
Index: xen-4.1.2-testing/xen/arch/x86/x86_32/traps.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_32/traps.c
@@ -164,7 +164,8 @@ void show_page_walk(unsigned long addr)
l3t += (cr3 & 0xFE0UL) >> 3;
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
unmap_domain_page(l3t);
@@ -175,7 +176,8 @@ void show_page_walk(unsigned long addr)
l2t = map_domain_page(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -188,7 +190,8 @@ void show_page_walk(unsigned long addr)
l1t = map_domain_page(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
unmap_domain_page(l1t);
Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
@@ -47,8 +47,6 @@ unsigned int __read_mostly pfn_pdx_hole_
unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
-bool_t __read_mostly machine_to_phys_mapping_valid = 0;
-
/* Top-level master (and idle-domain) page directory. */
l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
idle_pg_table[L4_PAGETABLE_ENTRIES];
Index: xen-4.1.2-testing/xen/arch/x86/x86_64/traps.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/traps.c
@@ -176,7 +176,8 @@ void show_page_walk(unsigned long addr)
l4t = mfn_to_virt(mfn);
l4e = l4t[l4_table_offset(addr)];
mfn = l4e_get_pfn(l4e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L4[0x%03lx] = %"PRIpte" %016lx\n",
l4_table_offset(addr), l4e_get_intpte(l4e), pfn);
if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) ||
@@ -186,7 +187,8 @@ void show_page_walk(unsigned long addr)
l3t = mfn_to_virt(mfn);
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L3[0x%03lx] = %"PRIpte" %016lx%s\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn,
(l3e_get_flags(l3e) & _PAGE_PSE) ? " (PSE)" : "");
@@ -198,7 +200,8 @@ void show_page_walk(unsigned long addr)
l2t = mfn_to_virt(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L2[0x%03lx] = %"PRIpte" %016lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -210,7 +213,8 @@ void show_page_walk(unsigned long addr)
l1t = mfn_to_virt(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && machine_to_phys_mapping_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L1[0x%03lx] = %"PRIpte" %016lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
}
++++++ 23577-tools_merge_several_bitop_functions_into_xc_bitops.h.patch ++++++
++++ 1023 lines (skipped)
++++++ 23578-xenpaging_add_xs_handle_to_struct_xenpaging.patch ++++++
changeset: 23578:7299a9a44b35
user: Olaf Hering <olaf(a)aepfle.de>
date: Wed Jun 22 14:47:09 2011 +0100
files: tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: add xs_handle to struct xenpaging
A xs_handle is currently used in the xc_mem_paging_flush_ioemu_cache()
function and will be used by a subsequent patch.
Add it to struct xenpaging.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell(a)citrix.com>
---
tools/xenpaging/xenpaging.c | 14 ++++++++++++++
tools/xenpaging/xenpaging.h | 1 +
2 files changed, 15 insertions(+)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -28,6 +28,7 @@
#include <signal.h>
#include <unistd.h>
#include <xc_private.h>
+#include <xs.h>
#include <xen/mem_event.h>
@@ -92,6 +93,14 @@ static xenpaging_t *xenpaging_init(domid
paging = malloc(sizeof(xenpaging_t));
memset(paging, 0, sizeof(xenpaging_t));
+ /* Open connection to xenstore */
+ paging->xs_handle = xs_open(0);
+ if ( paging->xs_handle == NULL )
+ {
+ ERROR("Error initialising xenstore connection");
+ goto err;
+ }
+
p = getenv("XENPAGING_POLICY_MRU_SIZE");
if ( p && *p )
{
@@ -221,6 +230,8 @@ static xenpaging_t *xenpaging_init(domid
err:
if ( paging )
{
+ if ( paging->xs_handle )
+ xs_close(paging->xs_handle);
xc_interface_close(xch);
if ( paging->mem_event.shared_page )
{
@@ -277,6 +288,9 @@ static int xenpaging_teardown(xenpaging_
}
paging->mem_event.xce_handle = NULL;
+ /* Close connection to xenstore */
+ xs_close(paging->xs_handle);
+
/* Close connection to Xen */
rc = xc_interface_close(xch);
if ( rc != 0 )
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -36,6 +36,7 @@
typedef struct xenpaging {
xc_interface *xc_handle;
+ struct xs_handle *xs_handle;
xc_platform_info_t *platform_info;
xc_domaininfo_t *domain_info;
++++++ 23579-xenpaging_drop_xc.c_remove_ASSERT.patch ++++++
changeset: 23579:868c8c898f73
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:06 2011 +0200
files: tools/xenpaging/policy_default.c tools/xenpaging/xc.h
description:
xenpaging: drop xc.c, remove ASSERT
The ASSERT is not needed, victim is never NULL.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/policy_default.c | 1 -
tools/xenpaging/xc.h | 7 -------
2 files changed, 8 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/policy_default.c
+++ xen-4.1.2-testing/tools/xenpaging/policy_default.c
@@ -78,7 +78,6 @@ int policy_choose_victim(xenpaging_t *pa
{
xc_interface *xch = paging->xc_handle;
unsigned long wrap = current_gfn;
- ASSERT(victim != NULL);
do
{
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -30,13 +30,6 @@
#include <xen/mem_event.h>
-#if 1
-#define ASSERT(_p) \
- if ( !(_p) ) { DPRINTF("Assertion '%s' failed, line %d, file %s", #_p , \
- __LINE__, __FILE__); *(int*)0=0; }
-#else
-#define ASSERT(_p) ((void)0)
-#endif
++++++ 23580-xenpaging_drop_xc.c_remove_xc_platform_info_t.patch ++++++
changeset: 23580:771b6984aa2a
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:07 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: drop xc.c, remove xc_platform_info_t
xc_platform_info_t is not used in xenpaging.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 10 ----------
tools/xenpaging/xc.h | 8 --------
tools/xenpaging/xenpaging.c | 17 -----------------
tools/xenpaging/xenpaging.h | 1 -
4 files changed, 36 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -26,7 +26,6 @@
#include <stdarg.h>
#include <sys/poll.h>
#include <xc_private.h>
-#include <xg_save_restore.h>
#include <xs.h>
#include "xc.h"
@@ -97,15 +96,6 @@ int xc_wait_for_event(xc_interface *xch,
return xc_wait_for_event_or_timeout(xch, xce, -1);
}
-int xc_get_platform_info(xc_interface *xc_handle, domid_t domain_id,
- xc_platform_info_t *platform_info)
-{
- return get_platform_info(xc_handle, domain_id,
- &platform_info->max_mfn,
- &platform_info->hvirt_start,
- &platform_info->pt_levels,
- &platform_info->guest_width);
-}
/*
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -34,12 +34,6 @@
-typedef struct xc_platform_info {
- unsigned long max_mfn;
- unsigned long hvirt_start;
- unsigned int pt_levels;
- unsigned int guest_width;
-} xc_platform_info_t;
@@ -47,8 +41,6 @@ int xc_mem_paging_flush_ioemu_cache(domi
int xc_wait_for_event(xc_interface *xch, xc_evtchn *xce);
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
-int xc_get_platform_info(xc_interface *xc_handle, domid_t domain_id,
- xc_platform_info_t *platform_info);
#endif // __XC_H__
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -176,22 +176,6 @@ static xenpaging_t *xenpaging_init(domid
paging->mem_event.port = rc;
- /* Get platform info */
- paging->platform_info = malloc(sizeof(xc_platform_info_t));
- if ( paging->platform_info == NULL )
- {
- ERROR("Error allocating memory for platform info");
- goto err;
- }
-
- rc = xc_get_platform_info(xch, paging->mem_event.domain_id,
- paging->platform_info);
- if ( rc != 1 )
- {
- ERROR("Error getting platform info");
- goto err;
- }
-
/* Get domaininfo */
paging->domain_info = malloc(sizeof(xc_domaininfo_t));
if ( paging->domain_info == NULL )
@@ -246,7 +230,6 @@ static xenpaging_t *xenpaging_init(domid
}
free(paging->bitmap);
- free(paging->platform_info);
free(paging->domain_info);
free(paging);
}
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -38,7 +38,6 @@ typedef struct xenpaging {
xc_interface *xc_handle;
struct xs_handle *xs_handle;
- xc_platform_info_t *platform_info;
xc_domaininfo_t *domain_info;
unsigned long *bitmap;
++++++ 23581-xenpaging_drop_xc.c_remove_xc_wait_for_event.patch ++++++
changeset: 23581:9ce56626a5ab
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:08 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h
description:
xenpaging: drop xc.c, remove xc_wait_for_event
xc_wait_for_event is not used in xenpaging.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 4 ----
tools/xenpaging/xc.h | 1 -
2 files changed, 5 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -91,10 +91,6 @@ int xc_wait_for_event_or_timeout(xc_inte
return -errno;
}
-int xc_wait_for_event(xc_interface *xch, xc_evtchn *xce)
-{
- return xc_wait_for_event_or_timeout(xch, xce, -1);
-}
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -38,7 +38,6 @@
int xc_mem_paging_flush_ioemu_cache(domid_t domain_id);
-int xc_wait_for_event(xc_interface *xch, xc_evtchn *xce);
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
++++++ 23582-xenpaging_drop_xc.c_move_xc_mem_paging_flush_ioemu_cache.patch ++++++
changeset: 23582:480e548fe76b
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:10 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c
description:
xenpaging: drop xc.c, move xc_mem_paging_flush_ioemu_cache
Move xc_mem_paging_flush_ioemu_cache() into xenpaging and massage it a bit to
use the required members from xenpaging_t.
Also update type of rc to match xs_write() return value.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 18 ------------------
tools/xenpaging/xc.h | 1 -
tools/xenpaging/xenpaging.c | 16 +++++++++++++++-
3 files changed, 15 insertions(+), 20 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -31,24 +31,6 @@
-int xc_mem_paging_flush_ioemu_cache(domid_t domain_id)
-{
- struct xs_handle *xsh = NULL;
- char path[80];
- int rc;
-
- sprintf(path, "/local/domain/0/device-model/%u/command", domain_id);
-
- xsh = xs_daemon_open();
- if ( xsh == NULL )
- return -EIO;
-
- rc = xs_write(xsh, XBT_NULL, path, "flush-cache", strlen("flush-cache"));
-
- xs_daemon_close(xsh);
-
- return rc ? 0 : -1;
-}
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms)
{
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -37,7 +37,6 @@
-int xc_mem_paging_flush_ioemu_cache(domid_t domain_id);
int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -48,6 +48,20 @@ static void close_handler(int sig)
unlink(filename);
}
+static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
+{
+ struct xs_handle *xsh = paging->xs_handle;
+ domid_t domain_id = paging->mem_event.domain_id;
+ char path[80];
+ bool rc;
+
+ sprintf(path, "/local/domain/0/device-model/%u/command", domain_id);
+
+ rc = xs_write(xsh, XBT_NULL, path, "flush-cache", strlen("flush-cache"));
+
+ return rc == true ? 0 : -1;
+}
+
static void *init_page(void)
{
void *buffer;
@@ -484,7 +498,7 @@ static int evict_victim(xenpaging_t *pag
else
{
if ( j++ % 1000 == 0 )
- if ( xc_mem_paging_flush_ioemu_cache(paging->mem_event.domain_id) )
+ if ( xenpaging_mem_paging_flush_ioemu_cache(paging) )
ERROR("Error flushing ioemu cache");
}
}
++++++ 23583-xenpaging_drop_xc.c_move_xc_wait_for_event_or_timeout.patch ++++++
changeset: 23583:235d8fdcb3a9
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:11 2011 +0200
files: tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c
description:
xenpaging: drop xc.c, move xc_wait_for_event_or_timeout
Move xc_wait_for_event_or_timeout() into xenpaging and massage it a bit for
further changes in subsequent patches.
Include poll.h instead of sys/poll.h.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xc.c | 40 ------------------------------------
tools/xenpaging/xc.h | 1
tools/xenpaging/xenpaging.c | 48 +++++++++++++++++++++++++++++++++++++++++---
3 files changed, 45 insertions(+), 44 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ xen-4.1.2-testing/tools/xenpaging/xc.c
@@ -32,46 +32,6 @@
-int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms)
-{
- struct pollfd fd = { .fd = xc_evtchn_fd(xce), .events = POLLIN | POLLERR };
- int port;
- int rc;
-
- rc = poll(&fd, 1, ms);
- if ( rc == -1 )
- {
- if (errno == EINTR)
- return 0;
-
- ERROR("Poll exited with an error");
- goto err;
- }
-
- if ( rc == 1 )
- {
- port = xc_evtchn_pending(xce);
- if ( port == -1 )
- {
- ERROR("Failed to read port from event channel");
- goto err;
- }
-
- rc = xc_evtchn_unmask(xce, port);
- if ( rc != 0 )
- {
- ERROR("Failed to unmask event channel port");
- goto err;
- }
- }
- else
- port = -1;
-
- return port;
-
- err:
- return -errno;
-}
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ xen-4.1.2-testing/tools/xenpaging/xc.h
@@ -37,7 +37,6 @@
-int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned long ms);
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -27,6 +27,7 @@
#include <time.h>
#include <signal.h>
#include <unistd.h>
+#include <poll.h>
#include <xc_private.h>
#include <xs.h>
@@ -62,6 +63,47 @@ static int xenpaging_mem_paging_flush_io
return rc == true ? 0 : -1;
}
+static int xenpaging_wait_for_event_or_timeout(xenpaging_t *paging)
+{
+ xc_interface *xch = paging->xc_handle;
+ xc_evtchn *xce = paging->mem_event.xce_handle;
+ struct pollfd fd[1];
+ int port;
+ int rc;
+
+ fd[0].fd = xc_evtchn_fd(xce);
+ fd[0].events = POLLIN | POLLERR;
+ rc = poll(fd, 1, 100);
+ if ( rc < 0 )
+ {
+ if (errno == EINTR)
+ return 0;
+
+ ERROR("Poll exited with an error");
+ return -errno;
+ }
+
+ if ( rc && fd[0].revents & POLLIN )
+ {
+ DPRINTF("Got event from evtchn\n");
+ port = xc_evtchn_pending(xce);
+ if ( port == -1 )
+ {
+ ERROR("Failed to read port from event channel");
+ rc = -1;
+ goto err;
+ }
+
+ rc = xc_evtchn_unmask(xce, port);
+ if ( rc < 0 )
+ {
+ ERROR("Failed to unmask event channel port");
+ }
+ }
+err:
+ return rc;
+}
+
static void *init_page(void)
{
void *buffer;
@@ -598,13 +640,13 @@ int main(int argc, char *argv[])
while ( !interrupted )
{
/* Wait for Xen to signal that a page needs paged in */
- rc = xc_wait_for_event_or_timeout(xch, paging->mem_event.xce_handle, 100);
- if ( rc < -1 )
+ rc = xenpaging_wait_for_event_or_timeout(paging);
+ if ( rc < 0 )
{
ERROR("Error getting event");
goto out;
}
- else if ( rc != -1 )
+ else if ( rc != 0 )
{
DPRINTF("Got event from Xen\n");
}
++++++ 23584-xenpaging_drop_xc.c_remove_xc_files.patch ++++++
changeset: 23584:e30cff57b146
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:12 2011 +0200
files: tools/xenpaging/Makefile tools/xenpaging/mem_event.h tools/xenpaging/xc.c tools/xenpaging/xc.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: drop xc.c, remove xc files
Finally remove xc.c/xc.h and its references since both are empty now.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/Makefile | 2 -
tools/xenpaging/mem_event.h | 1
tools/xenpaging/xc.c | 47 --------------------------------------
tools/xenpaging/xc.h | 54 --------------------------------------------
tools/xenpaging/xenpaging.c | 1
tools/xenpaging/xenpaging.h | 1
6 files changed, 1 insertion(+), 105 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/Makefile
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/Makefile
+++ xen-4.1.2-testing/tools/xenpaging/Makefile
@@ -9,7 +9,7 @@ LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS
POLICY = default
SRC :=
-SRCS += file_ops.c xc.c xenpaging.c policy_$(POLICY).c
+SRCS += file_ops.c xenpaging.c policy_$(POLICY).c
CFLAGS += -Werror
CFLAGS += -Wno-unused
Index: xen-4.1.2-testing/tools/xenpaging/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/mem_event.h
+++ xen-4.1.2-testing/tools/xenpaging/mem_event.h
@@ -25,7 +25,6 @@
#define __XEN_MEM_EVENT_H__
-#include "xc.h"
#include <xc_private.h>
#include <xen/event_channel.h>
Index: xen-4.1.2-testing/tools/xenpaging/xc.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/lib/xc.c
- *
- * libxc-type add-ons for paging support.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#include <errno.h>
-#include <string.h>
-#include <stdarg.h>
-#include <sys/poll.h>
-#include <xc_private.h>
-#include <xs.h>
-#include "xc.h"
-
-
-
-
-
-
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xc.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/lib/xc.h
- *
- * libxc add-ons.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#ifndef __XC_H__
-#define __XC_H__
-
-
-#include <stdarg.h>
-#include <xc_private.h>
-#include <xen/mem_event.h>
-
-
-
-
-
-
-
-
-
-
-
-
-#endif // __XC_H__
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -35,7 +35,6 @@
#include "xc_bitops.h"
#include "file_ops.h"
-#include "xc.h"
#include "policy.h"
#include "xenpaging.h"
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -25,7 +25,6 @@
#define __XEN_PAGING2_H__
-#include "xc.h"
#include <xc_private.h>
#include <xen/event_channel.h>
++++++ 23585-xenpaging_correct_dropping_of_pages_to_avoid_full_ring_buffer.patch ++++++
changeset: 23585:b4d18ac00a46
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:14 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: correct dropping of pages to avoid full ring buffer
Doing a one-way channel from Xen to xenpaging is not possible with the
current ring buffer implementation. xenpaging uses the mem_event ring
buffer, which expects request/response pairs to make progress. The
previous patch, which tried to establish a one-way communication from
Xen to xenpaging, stalled the guest once the buffer was filled up with
requests. Correct page-dropping by taking the slow path and let
p2m_mem_paging_resume() consume the response from xenpaging. This makes
room for yet another request/response pair and avoids hanging guests.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -690,19 +690,19 @@ int main(int argc, char *argv[])
ERROR("Error populating page");
goto out;
}
+ }
- /* Prepare the response */
- rsp.gfn = req.gfn;
- rsp.p2mt = req.p2mt;
- rsp.vcpu_id = req.vcpu_id;
- rsp.flags = req.flags;
+ /* Prepare the response */
+ rsp.gfn = req.gfn;
+ rsp.p2mt = req.p2mt;
+ rsp.vcpu_id = req.vcpu_id;
+ rsp.flags = req.flags;
- rc = xenpaging_resume_page(paging, &rsp, 1);
- if ( rc != 0 )
- {
- ERROR("Error resuming page");
- goto out;
- }
+ rc = xenpaging_resume_page(paging, &rsp, 1);
+ if ( rc != 0 )
+ {
+ ERROR("Error resuming page");
+ goto out;
}
/* Evict a new page to replace the one we just paged in */
++++++ 23586-xenpaging_do_not_bounce_p2mt_back_to_the_hypervisor.patch ++++++
changeset: 23586:bbdd7413a50a
user: Olaf Hering <olaf(a)aepfle.de>
date: Wed Jun 22 14:47:13 2011 +0100
files: tools/xenpaging/xenpaging.c
description:
xenpaging: do not bounce p2mt back to the hypervisor
do not bounce p2mt back to the hypervisor because p2m_mem_paging_populate()
and p2m_mem_paging_resume() dont make use of p2mt.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 4 ----
1 file changed, 4 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -694,7 +694,6 @@ int main(int argc, char *argv[])
/* Prepare the response */
rsp.gfn = req.gfn;
- rsp.p2mt = req.p2mt;
rsp.vcpu_id = req.vcpu_id;
rsp.flags = req.flags;
@@ -711,10 +710,8 @@ int main(int argc, char *argv[])
else
{
DPRINTF("page already populated (domain = %d; vcpu = %d;"
- " p2mt = %x;"
" gfn = %"PRIx64"; paused = %d)\n",
paging->mem_event.domain_id, req.vcpu_id,
- req.p2mt,
req.gfn, req.flags & MEM_EVENT_FLAG_VCPU_PAUSED);
/* Tell Xen to resume the vcpu */
@@ -723,7 +720,6 @@ int main(int argc, char *argv[])
{
/* Prepare the response */
rsp.gfn = req.gfn;
- rsp.p2mt = req.p2mt;
rsp.vcpu_id = req.vcpu_id;
rsp.flags = req.flags;
++++++ 23587-xenpaging_remove_srand_call.patch ++++++
changeset: 23587:926febc8bd98
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:16 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: remove srand call
The policy uses now a linear algorithm instead of a random one.
Remove the call to srand().
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 3 ---
1 file changed, 3 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -581,9 +581,6 @@ int main(int argc, char *argv[])
domain_id = atoi(argv[1]);
num_pages = atoi(argv[2]);
- /* Seed random-number generator */
- srand(time(NULL));
-
/* Initialise domain paging */
paging = xenpaging_init(domain_id);
if ( paging == NULL )
++++++ 23588-xenpaging_remove_return_values_from_functions_that_can_not_fail.patch ++++++
changeset: 23588:e48535e70145
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:18 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: remove return values from functions that can not fail
get_request() and put_response() can not fail, remove return value
and update calling functions.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -342,7 +342,7 @@ static int xenpaging_teardown(xenpaging_
return -1;
}
-static int get_request(mem_event_t *mem_event, mem_event_request_t *req)
+static void get_request(mem_event_t *mem_event, mem_event_request_t *req)
{
mem_event_back_ring_t *back_ring;
RING_IDX req_cons;
@@ -357,11 +357,9 @@ static int get_request(mem_event_t *mem_
/* Update ring */
back_ring->req_cons = req_cons;
back_ring->sring->req_event = req_cons + 1;
-
- return 0;
}
-static int put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
+static void put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
{
mem_event_back_ring_t *back_ring;
RING_IDX rsp_prod;
@@ -376,8 +374,6 @@ static int put_response(mem_event_t *mem
/* Update ring */
back_ring->rsp_prod_pvt = rsp_prod;
RING_PUSH_RESPONSES(back_ring);
-
- return 0;
}
static int xenpaging_evict_page(xenpaging_t *paging,
@@ -437,9 +433,7 @@ static int xenpaging_resume_page(xenpagi
int ret;
/* Put the page info on the ring */
- ret = put_response(&paging->mem_event, rsp);
- if ( ret != 0 )
- goto out;
+ put_response(&paging->mem_event, rsp);
/* Notify policy of page being paged in */
if ( notify_policy )
@@ -649,12 +643,7 @@ int main(int argc, char *argv[])
while ( RING_HAS_UNCONSUMED_REQUESTS(&paging->mem_event.back_ring) )
{
- rc = get_request(&paging->mem_event, &req);
- if ( rc != 0 )
- {
- ERROR("Error getting request");
- goto out;
- }
+ get_request(&paging->mem_event, &req);
/* Check if the page has already been paged in */
if ( test_and_clear_bit(req.gfn, paging->bitmap) )
++++++ 23589-xenpaging_catch_xc_mem_paging_resume_errors.patch ++++++
changeset: 23589:49cb290ede16
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:19 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: catch xc_mem_paging_resume errors
In the unlikely event that xc_mem_paging_resume() fails, do not overwrite the
error with the return value from xc_evtchn_notify()
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -442,8 +442,9 @@ static int xenpaging_resume_page(xenpagi
/* Tell Xen page is ready */
ret = xc_mem_paging_resume(paging->xc_handle, paging->mem_event.domain_id,
rsp->gfn);
- ret = xc_evtchn_notify(paging->mem_event.xce_handle,
- paging->mem_event.port);
+ if ( ret == 0 )
+ ret = xc_evtchn_notify(paging->mem_event.xce_handle,
+ paging->mem_event.port);
out:
return ret;
++++++ 23590-xenpaging_remove_local_domain_id_variable.patch ++++++
changeset: 23590:d957acb8bee6
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:20 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: remove local domain_id variable
Remove the local domain_id variable, it is already fetched from
paging->mem_event in other places.
Update the sprintf format string to use unsigned argument.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -552,7 +552,6 @@ static int evict_victim(xenpaging_t *pag
int main(int argc, char *argv[])
{
struct sigaction act;
- domid_t domain_id;
int num_pages;
xenpaging_t *paging;
xenpaging_victim_t *victims;
@@ -573,11 +572,10 @@ int main(int argc, char *argv[])
return -1;
}
- domain_id = atoi(argv[1]);
num_pages = atoi(argv[2]);
/* Initialise domain paging */
- paging = xenpaging_init(domain_id);
+ paging = xenpaging_init(atoi(argv[1]));
if ( paging == NULL )
{
fprintf(stderr, "Error initialising paging");
@@ -585,10 +583,10 @@ int main(int argc, char *argv[])
}
xch = paging->xc_handle;
- DPRINTF("starting %s %u %d\n", argv[0], domain_id, num_pages);
+ DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, num_pages);
/* Open file */
- sprintf(filename, "page_cache_%d", domain_id);
+ sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
fd = open(filename, open_flags, open_mode);
if ( fd < 0 )
{
++++++ 23591-xenpaging_move_num_pages_into_xenpaging_struct.patch ++++++
changeset: 23591:4aaa90c1db42
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:22 2011 +0200
files: tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: move num_pages into xenpaging struct
Move num_pages into struct xenpaging.
num_pages will be used by the policy in a subsequent patch.
Also remove a memset, the victims array is allocated with calloc.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 30 ++++++++++++++----------------
tools/xenpaging/xenpaging.h | 1 +
2 files changed, 15 insertions(+), 16 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -128,7 +128,7 @@ static void *init_page(void)
return NULL;
}
-static xenpaging_t *xenpaging_init(domid_t domain_id)
+static xenpaging_t *xenpaging_init(domid_t domain_id, int num_pages)
{
xenpaging_t *paging;
xc_interface *xch;
@@ -256,6 +256,13 @@ static xenpaging_t *xenpaging_init(domid
}
DPRINTF("max_pages = %"PRIx64"\n", paging->domain_info->max_pages);
+ if ( num_pages < 0 || num_pages > paging->domain_info->max_pages )
+ {
+ num_pages = paging->domain_info->max_pages;
+ DPRINTF("setting num_pages to %d\n", num_pages);
+ }
+ paging->num_pages = num_pages;
+
/* Initialise policy */
rc = policy_init(paging);
if ( rc != 0 )
@@ -552,7 +559,6 @@ static int evict_victim(xenpaging_t *pag
int main(int argc, char *argv[])
{
struct sigaction act;
- int num_pages;
xenpaging_t *paging;
xenpaging_victim_t *victims;
mem_event_request_t req;
@@ -572,10 +578,8 @@ int main(int argc, char *argv[])
return -1;
}
- num_pages = atoi(argv[2]);
-
/* Initialise domain paging */
- paging = xenpaging_init(atoi(argv[1]));
+ paging = xenpaging_init(atoi(argv[1]), atoi(argv[2]));
if ( paging == NULL )
{
fprintf(stderr, "Error initialising paging");
@@ -583,7 +587,7 @@ int main(int argc, char *argv[])
}
xch = paging->xc_handle;
- DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, num_pages);
+ DPRINTF("starting %s %u %d\n", argv[0], paging->mem_event.domain_id, paging->num_pages);
/* Open file */
sprintf(filename, "page_cache_%u", paging->mem_event.domain_id);
@@ -594,12 +598,7 @@ int main(int argc, char *argv[])
return 2;
}
- if ( num_pages < 0 || num_pages > paging->domain_info->max_pages )
- {
- num_pages = paging->domain_info->max_pages;
- DPRINTF("setting num_pages to %d\n", num_pages);
- }
- victims = calloc(num_pages, sizeof(xenpaging_victim_t));
+ victims = calloc(paging->num_pages, sizeof(xenpaging_victim_t));
/* ensure that if we get a signal, we'll do cleanup, then exit */
act.sa_handler = close_handler;
@@ -611,8 +610,7 @@ int main(int argc, char *argv[])
sigaction(SIGALRM, &act, NULL);
/* Evict pages */
- memset(victims, 0, sizeof(xenpaging_victim_t) * num_pages);
- for ( i = 0; i < num_pages; i++ )
+ for ( i = 0; i < paging->num_pages; i++ )
{
rc = evict_victim(paging, &victims[i], fd, i);
if ( rc == -ENOSPC )
@@ -648,13 +646,13 @@ int main(int argc, char *argv[])
if ( test_and_clear_bit(req.gfn, paging->bitmap) )
{
/* Find where in the paging file to read from */
- for ( i = 0; i < num_pages; i++ )
+ for ( i = 0; i < paging->num_pages; i++ )
{
if ( victims[i].gfn == req.gfn )
break;
}
- if ( i >= num_pages )
+ if ( i >= paging->num_pages )
{
DPRINTF("Couldn't find page %"PRIx64"\n", req.gfn);
goto out;
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -42,6 +42,7 @@ typedef struct xenpaging {
unsigned long *bitmap;
mem_event_t mem_event;
+ int num_pages;
int policy_mru_size;
} xenpaging_t;
++++++ 23592-xenpaging_start_paging_in_the_middle_of_gfn_range.patch ++++++
changeset: 23592:1e44e75d889c
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:23 2011 +0200
files: tools/xenpaging/policy_default.c
description:
xenpaging: start paging in the middle of gfn range
Set the starting gfn to somewhere in the middle of the gfn range to
avoid paging during BIOS startup. This can speedup booting of a guest.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/policy_default.c | 4 ++++
1 file changed, 4 insertions(+)
Index: xen-4.1.2-testing/tools/xenpaging/policy_default.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/policy_default.c
+++ xen-4.1.2-testing/tools/xenpaging/policy_default.c
@@ -69,6 +69,10 @@ int policy_init(xenpaging_t *paging)
/* Don't page out page 0 */
set_bit(0, bitmap);
+ /* Start in the middle to avoid paging during BIOS startup */
+ current_gfn = max_pages / 2;
+ current_gfn -= paging->num_pages / 2;
+
rc = 0;
out:
return rc;
++++++ 23593-xenpaging_pass_integer_to_xenpaging_populate_page.patch ++++++
changeset: 23593:7d72475641fa
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:24 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: pass integer to xenpaging_populate_page
Pass gfn as integer to xenpaging_populate_page(). xc_map_foreign_pages()
takes a pointer to a list of gfns, but its a const pointer. So writing
the value back to the caller is not needed.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -458,27 +458,24 @@ static int xenpaging_resume_page(xenpagi
}
static int xenpaging_populate_page(xenpaging_t *paging,
- uint64_t *gfn, int fd, int i)
+ xen_pfn_t gfn, int fd, int i)
{
xc_interface *xch = paging->xc_handle;
- unsigned long _gfn;
void *page;
int ret;
unsigned char oom = 0;
- _gfn = *gfn;
- DPRINTF("populate_page < gfn %lx pageslot %d\n", _gfn, i);
+ DPRINTF("populate_page < gfn %"PRI_xen_pfn" pageslot %d\n", gfn, i);
do
{
/* Tell Xen to allocate a page for the domain */
- ret = xc_mem_paging_prep(xch, paging->mem_event.domain_id,
- _gfn);
+ ret = xc_mem_paging_prep(xch, paging->mem_event.domain_id, gfn);
if ( ret != 0 )
{
if ( errno == ENOMEM )
{
if ( oom++ == 0 )
- DPRINTF("ENOMEM while preparing gfn %lx\n", _gfn);
+ DPRINTF("ENOMEM while preparing gfn %"PRI_xen_pfn"\n", gfn);
sleep(1);
continue;
}
@@ -491,8 +488,7 @@ static int xenpaging_populate_page(xenpa
/* Map page */
ret = -EFAULT;
page = xc_map_foreign_pages(xch, paging->mem_event.domain_id,
- PROT_READ | PROT_WRITE, &_gfn, 1);
- *gfn = _gfn;
+ PROT_READ | PROT_WRITE, &gfn, 1);
if ( page == NULL )
{
ERROR("Error mapping page: page is null");
@@ -667,7 +663,7 @@ int main(int argc, char *argv[])
else
{
/* Populate the page */
- rc = xenpaging_populate_page(paging, &req.gfn, fd, i);
+ rc = xenpaging_populate_page(paging, req.gfn, fd, i);
if ( rc != 0 )
{
ERROR("Error populating page");
++++++ 23594-xenpaging_add_helper_function_for_unlinking_pagefile.patch ++++++
changeset: 23594:2fe46305a00d
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:25 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: add helper function for unlinking pagefile
Unlink pagefile in the signal handler and also in the exit path.
This does not leave a stale pagefile if an error occoured.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -41,11 +41,20 @@
static char filename[80];
static int interrupted;
-static void close_handler(int sig)
+
+static void unlink_pagefile(void)
{
- interrupted = sig;
if ( filename[0] )
+ {
unlink(filename);
+ filename[0] = '\0';
+ }
+}
+
+static void close_handler(int sig)
+{
+ interrupted = sig;
+ unlink_pagefile();
}
static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
@@ -716,6 +725,7 @@ int main(int argc, char *argv[])
out:
close(fd);
+ unlink_pagefile();
free(victims);
/* Tear down domain paging */
++++++ 23595-xenpaging_add_watch_thread_to_catch_guest_shutdown.patch ++++++
changeset: 23595:389c8bf31688
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:27 2011 +0200
files: tools/xenpaging/xenpaging.c
description:
xenpaging: add watch thread to catch guest shutdown
If xenpaging is started manually then no event is sent to xenpaging when
the guest is shutdown or rebooted. Add a watch on the @releaseDomain
node to leave the loop and gracefully shutdown the pager.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -39,6 +39,7 @@
#include "policy.h"
#include "xenpaging.h"
+static char watch_token[16];
static char filename[80];
static int interrupted;
@@ -75,13 +76,19 @@ static int xenpaging_wait_for_event_or_t
{
xc_interface *xch = paging->xc_handle;
xc_evtchn *xce = paging->mem_event.xce_handle;
- struct pollfd fd[1];
+ char **vec;
+ unsigned int num;
+ struct pollfd fd[2];
int port;
int rc;
+ /* Wait for event channel and xenstore */
fd[0].fd = xc_evtchn_fd(xce);
fd[0].events = POLLIN | POLLERR;
- rc = poll(fd, 1, 100);
+ fd[1].fd = xs_fileno(paging->xs_handle);
+ fd[1].events = POLLIN | POLLERR;
+
+ rc = poll(fd, 2, 100);
if ( rc < 0 )
{
if (errno == EINTR)
@@ -91,6 +98,27 @@ static int xenpaging_wait_for_event_or_t
return -errno;
}
+ /* First check for guest shutdown */
+ if ( rc && fd[1].revents & POLLIN )
+ {
+ DPRINTF("Got event from xenstore\n");
+ vec = xs_read_watch(paging->xs_handle, &num);
+ if ( vec )
+ {
+ if ( strcmp(vec[XS_WATCH_TOKEN], watch_token) == 0 )
+ {
+ /* If our guest disappeared, set interrupt flag and fall through */
+ if ( xs_is_domain_introduced(paging->xs_handle, paging->mem_event.domain_id) == false )
+ {
+ xs_unwatch(paging->xs_handle, "@releaseDomain", watch_token);
+ interrupted = SIGQUIT;
+ rc = 0;
+ }
+ }
+ free(vec);
+ }
+ }
+
if ( rc && fd[0].revents & POLLIN )
{
DPRINTF("Got event from evtchn\n");
@@ -165,6 +193,14 @@ static xenpaging_t *xenpaging_init(domid
goto err;
}
+ /* write domain ID to watch so we can ignore other domain shutdowns */
+ snprintf(watch_token, sizeof(watch_token), "%u", domain_id);
+ if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
+ {
+ ERROR("Could not bind to shutdown watch\n");
+ goto err;
+ }
+
p = getenv("XENPAGING_POLICY_MRU_SIZE");
if ( p && *p )
{
++++++ 23596-xenpaging_implement_stopping_of_pager_by_sending_SIGTERM-SIGINT.patch ++++++
changeset: 23596:c49e22648d0e
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:28 2011 +0200
files: tools/xenpaging/Makefile tools/xenpaging/pagein.c tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: implement stopping of pager by sending SIGTERM/SIGINT
Write all paged-out pages back into the guest if the pager is
interrupted by ctrl-c or if it receives SIGTERM.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/Makefile | 1
tools/xenpaging/pagein.c | 68 ++++++++++++++++++++++++++++++++++++++++++++
tools/xenpaging/xenpaging.c | 35 ++++++++++++++++++++--
tools/xenpaging/xenpaging.h | 3 +
4 files changed, 104 insertions(+), 3 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/Makefile
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/Makefile
+++ xen-4.1.2-testing/tools/xenpaging/Makefile
@@ -10,6 +10,7 @@ POLICY = default
SRC :=
SRCS += file_ops.c xenpaging.c policy_$(POLICY).c
+SRCS += pagein.c
CFLAGS += -Werror
CFLAGS += -Wno-unused
Index: xen-4.1.2-testing/tools/xenpaging/pagein.c
===================================================================
--- /dev/null
+++ xen-4.1.2-testing/tools/xenpaging/pagein.c
@@ -0,0 +1,68 @@
+/* Trigger a page-in in a separate thread-of-execution to avoid deadlock */
+#include <pthread.h>
+#include "xc_private.h"
+
+struct page_in_args {
+ domid_t dom;
+ xc_interface *xch;
+};
+
+static struct page_in_args page_in_args;
+static unsigned long page_in_gfn;
+static unsigned int page_in_possible;
+
+static pthread_t page_in_thread;
+static pthread_cond_t page_in_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t page_in_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+static void *page_in(void *arg)
+{
+ struct page_in_args *pia = arg;
+ void *page;
+ xen_pfn_t gfn;
+
+ while (1)
+ {
+ pthread_mutex_lock(&page_in_mutex);
+ while (!page_in_gfn)
+ pthread_cond_wait(&page_in_cond, &page_in_mutex);
+ gfn = page_in_gfn;
+ page_in_gfn = 0;
+ pthread_mutex_unlock(&page_in_mutex);
+
+ /* Ignore errors */
+ page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, &gfn, 1);
+ if (page)
+ munmap(page, PAGE_SIZE);
+ }
+ page_in_possible = 0;
+ pthread_exit(NULL);
+}
+
+void page_in_trigger(unsigned long gfn)
+{
+ if (!page_in_possible)
+ return;
+
+ pthread_mutex_lock(&page_in_mutex);
+ page_in_gfn = gfn;
+ pthread_mutex_unlock(&page_in_mutex);
+ pthread_cond_signal(&page_in_cond);
+}
+
+void create_page_in_thread(domid_t domain_id, xc_interface *xch)
+{
+ page_in_args.dom = domain_id;
+ page_in_args.xch = xch;
+ if (pthread_create(&page_in_thread, NULL, page_in, &page_in_args) == 0)
+ page_in_possible = 1;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -650,6 +650,9 @@ int main(int argc, char *argv[])
sigaction(SIGINT, &act, NULL);
sigaction(SIGALRM, &act, NULL);
+ /* listen for page-in events to stop pager */
+ create_page_in_thread(paging->mem_event.domain_id, xch);
+
/* Evict pages */
for ( i = 0; i < paging->num_pages; i++ )
{
@@ -665,7 +668,7 @@ int main(int argc, char *argv[])
DPRINTF("%d pages evicted. Done.\n", i);
/* Swap pages in and out */
- while ( !interrupted )
+ while ( 1 )
{
/* Wait for Xen to signal that a page needs paged in */
rc = xenpaging_wait_for_event_or_timeout(paging);
@@ -728,8 +731,12 @@ int main(int argc, char *argv[])
goto out;
}
- /* Evict a new page to replace the one we just paged in */
- evict_victim(paging, &victims[i], fd, i);
+ /* Evict a new page to replace the one we just paged in,
+ * or clear this pagefile slot on exit */
+ if ( interrupted )
+ victims[i].gfn = INVALID_MFN;
+ else
+ evict_victim(paging, &victims[i], fd, i);
}
else
{
@@ -756,6 +763,28 @@ int main(int argc, char *argv[])
}
}
}
+
+ /* Write all pages back into the guest */
+ if ( interrupted == SIGTERM || interrupted == SIGINT )
+ {
+ for ( i = 0; i < paging->domain_info->max_pages; i++ )
+ {
+ if ( test_bit(i, paging->bitmap) )
+ {
+ page_in_trigger(i);
+ break;
+ }
+ }
+ /* If no more pages to process, exit loop */
+ if ( i == paging->domain_info->max_pages )
+ break;
+ }
+ else
+ {
+ /* Exit on any other signal */
+ if ( interrupted )
+ break;
+ }
}
DPRINTF("xenpaging got signal %d\n", interrupted);
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -53,6 +53,9 @@ typedef struct xenpaging_victim {
} xenpaging_victim_t;
+extern void create_page_in_thread(domid_t domain_id, xc_interface *xch);
+extern void page_in_trigger(unsigned long gfn);
+
#endif // __XEN_PAGING_H__
++++++ 23597-xenpaging_remove_private_mem_event.h.patch ++++++
changeset: 23597:3dcb553f3ba9
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Jun 10 10:47:29 2011 +0200
files: tools/xenpaging/mem_event.h tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: remove private mem_event.h
tools/xenpaging/mem_event.h is only included in xenpaging.h.
Add the contents into that file and remove mem_event.h.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/mem_event.h | 57 --------------------------------------------
tools/xenpaging/xenpaging.c | 3 --
tools/xenpaging/xenpaging.h | 11 ++++++--
3 files changed, 8 insertions(+), 63 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/mem_event.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/******************************************************************************
- * tools/xenpaging/mem_event.h
- *
- * Memory event structures.
- *
- * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#ifndef __XEN_MEM_EVENT_H__
-#define __XEN_MEM_EVENT_H__
-
-
-#include <xc_private.h>
-
-#include <xen/event_channel.h>
-#include <xen/mem_event.h>
-
-
-
-
-typedef struct mem_event {
- domid_t domain_id;
- xc_evtchn *xce_handle;
- int port;
- mem_event_back_ring_t back_ring;
- mem_event_shared_page_t *shared_page;
- void *ring_page;
-} mem_event_t;
-
-
-#endif // __XEN_MEM_EVENT_H__
-
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -31,11 +31,8 @@
#include <xc_private.h>
#include <xs.h>
-#include <xen/mem_event.h>
-
#include "xc_bitops.h"
#include "file_ops.h"
-
#include "policy.h"
#include "xenpaging.h"
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -26,12 +26,17 @@
#include <xc_private.h>
-
#include <xen/event_channel.h>
#include <xen/mem_event.h>
-#include "mem_event.h"
-
+typedef struct mem_event {
+ domid_t domain_id;
+ xc_evtchn *xce_handle;
+ int port;
+ mem_event_back_ring_t back_ring;
+ mem_event_shared_page_t *shared_page;
+ void *ring_page;
+} mem_event_t;
typedef struct xenpaging {
xc_interface *xc_handle;
++++++ 23599-tools_fix_build_after_recent_xenpaging_changes.patch ++++++
changeset: 23599:d3027374a8c0
user: Tim Deegan <Tim.Deegan(a)citrix.com>
date: Mon Jun 27 14:48:57 2011 +0100
files: tools/xenpaging/Makefile
description:
tools: fix build after recent xenpaging changes
xenpaging now uses pthreads, so must link appropriately.
Signed-off-by: Tim Deegan <Tim.Deegan(a)citrix.com>
Committed-by: Ian Jackson <ian.jackson(a)eu.citrix.com>
---
tools/xenpaging/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: xen-4.1.2-testing/tools/xenpaging/Makefile
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/Makefile
+++ xen-4.1.2-testing/tools/xenpaging/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
CFLAGS += -I $(XEN_XC)
CFLAGS += -I ./
CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore)
-LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore)
+LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) -pthread
POLICY = default
++++++ 23614-x86_64-EFI-boot.patch ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -2143,7 +2143,7 @@
#include <asm/paging.h>
#include <asm/shadow.h>
#include <asm/page.h>
-@@ -353,6 +354,8 @@ void __init arch_init_memory(void)
+@@ -355,6 +356,8 @@ void __init arch_init_memory(void)
subarch_init_memory();
@@ -2288,7 +2288,7 @@
#include <xen/sched.h>
#include <xen/numa.h>
#include <xen/nodemask.h>
-@@ -828,7 +829,8 @@ void __init zap_low_mappings(void)
+@@ -830,7 +831,8 @@ void __init zap_low_mappings(void)
/* Replace with mapping of the boot trampoline only. */
map_pages_to_xen(BOOT_TRAMPOLINE, BOOT_TRAMPOLINE >> PAGE_SHIFT,
++++++ 23676-x86_64-image-map-bounds.patch ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -18,7 +18,7 @@
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/mm.c
-@@ -776,7 +776,7 @@ static int update_xen_mappings(unsigned
+@@ -778,7 +778,7 @@ static int update_xen_mappings(unsigned
int err = 0;
#ifdef __x86_64__
bool_t alias = mfn >= PFN_DOWN(xen_phys_start) &&
++++++ 23723-x86-CMOS-lock.patch ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -136,7 +136,7 @@
#include <public/arch-x86/cpuid.h>
/*
-@@ -1629,6 +1631,10 @@ static int admin_io_okay(
+@@ -1630,6 +1632,10 @@ static int admin_io_okay(
if ( (port == 0xcf8) && (bytes == 4) )
return 0;
@@ -147,7 +147,7 @@
return ioports_access_permitted(v->domain, port, port + bytes - 1);
}
-@@ -1658,6 +1664,21 @@ static uint32_t guest_io_read(
+@@ -1659,6 +1665,21 @@ static uint32_t guest_io_read(
{
sub_data = pv_pit_handler(port, 0, 0);
}
@@ -169,7 +169,7 @@
else if ( (port == 0xcf8) && (bytes == 4) )
{
size = 4;
-@@ -1683,8 +1704,6 @@ static uint32_t guest_io_read(
+@@ -1684,8 +1705,6 @@ static uint32_t guest_io_read(
return data;
}
@@ -178,7 +178,7 @@
static void guest_io_write(
unsigned int port, unsigned int bytes, uint32_t data,
struct vcpu *v, struct cpu_user_regs *regs)
-@@ -1693,8 +1712,6 @@ static void guest_io_write(
+@@ -1694,8 +1713,6 @@ static void guest_io_write(
{
switch ( bytes ) {
case 1:
@@ -187,7 +187,7 @@
outb((uint8_t)data, port);
if ( pv_post_outb_hook )
pv_post_outb_hook(port, (uint8_t)data);
-@@ -1717,6 +1734,23 @@ static void guest_io_write(
+@@ -1718,6 +1735,23 @@ static void guest_io_write(
{
pv_pit_handler(port, (uint8_t)data, 1);
}
@@ -211,7 +211,7 @@
else if ( (port == 0xcf8) && (bytes == 4) )
{
size = 4;
-@@ -2082,10 +2116,6 @@ static int emulate_privileged_op(struct
+@@ -2083,10 +2117,6 @@ static int emulate_privileged_op(struct
goto fail;
if ( admin_io_okay(port, op_bytes, v, regs) )
{
++++++ 23772-x86-trampoline.patch ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -316,7 +316,7 @@
#include <xen/sched.h>
#include <xen/guest_access.h>
#include <asm/current.h>
-@@ -164,8 +165,9 @@ void __init zap_low_mappings(l2_pgentry_
+@@ -166,8 +167,9 @@ void __init zap_low_mappings(l2_pgentry_
flush_all(FLUSH_TLB_GLOBAL);
/* Replace with mapping of the boot trampoline only. */
@@ -332,7 +332,7 @@
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
-@@ -828,7 +828,7 @@ void __init zap_low_mappings(void)
+@@ -830,7 +830,7 @@ void __init zap_low_mappings(void)
flush_local(FLUSH_TLB_GLOBAL);
/* Replace with mapping of the boot trampoline only. */
++++++ 23817-mem_event_add_ref_counting_for_free_requestslots.patch ++++++
changeset: 23817:083f10851dd8
user: Olaf Hering <olaf(a)aepfle.de>
date: Mon Sep 05 15:10:09 2011 +0100
files: xen/arch/x86/mm/mem_event.c xen/arch/x86/mm/mem_sharing.c xen/arch/x86/mm/p2m.c xen/include/asm-x86/mem_event.h xen/include/xen/sched.h
description:
mem_event: add ref counting for free requestslots
If mem_event_check_ring() is called by many vcpus at the same time
before any of them called also mem_event_put_request(), all of the
callers must assume there are enough free slots available in the ring.
Record the number of request producers in mem_event_check_ring() to
keep track of available free slots.
Add a new mem_event_put_req_producers() function to release a request
attempt made in mem_event_check_ring(). Its required for
p2m_mem_paging_populate() because that function can only modify the
p2m type if there are free request slots. But in some cases
p2m_mem_paging_populate() does not actually have to produce another
request when it is known that the same request was already made
earlier by a different vcpu.
mem_event_check_ring() can not return a reference to a free request
slot because there could be multiple references for different vcpus
and the order of mem_event_put_request() calls is not known. As a
result, incomplete requests could be consumed by the ring user.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
xen/arch/x86/mm/mem_event.c | 19 ++++++++++++-------
xen/arch/x86/mm/mem_sharing.c | 1 -
xen/arch/x86/mm/p2m.c | 1 +
xen/include/asm-x86/mem_event.h | 1 +
xen/include/xen/sched.h | 1 +
5 files changed, 15 insertions(+), 8 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -37,8 +37,6 @@
#define mem_event_ring_lock(_d) spin_lock(&(_d)->mem_event.ring_lock)
#define mem_event_ring_unlock(_d) spin_unlock(&(_d)->mem_event.ring_lock)
-#define MEM_EVENT_RING_THRESHOLD 4
-
static int mem_event_enable(struct domain *d, mfn_t ring_mfn, mfn_t shared_mfn)
{
int rc;
@@ -109,6 +107,7 @@ void mem_event_put_request(struct domain
req_prod++;
/* Update ring */
+ d->mem_event.req_producers--;
front_ring->req_prod_pvt = req_prod;
RING_PUSH_REQUESTS(front_ring);
@@ -153,11 +152,18 @@ void mem_event_mark_and_pause(struct vcp
vcpu_sleep_nosync(v);
}
+void mem_event_put_req_producers(struct domain *d)
+{
+ mem_event_ring_lock(d);
+ d->mem_event.req_producers--;
+ mem_event_ring_unlock(d);
+}
+
int mem_event_check_ring(struct domain *d)
{
struct vcpu *curr = current;
int free_requests;
- int ring_full;
+ int ring_full = 1;
if ( !d->mem_event.ring_page )
return -1;
@@ -165,12 +171,11 @@ int mem_event_check_ring(struct domain *
mem_event_ring_lock(d);
free_requests = RING_FREE_REQUESTS(&d->mem_event.front_ring);
- if ( unlikely(free_requests < 2) )
+ if ( d->mem_event.req_producers < free_requests )
{
- gdprintk(XENLOG_INFO, "free request slots: %d\n", free_requests);
- WARN_ON(free_requests == 0);
+ d->mem_event.req_producers++;
+ ring_full = 0;
}
- ring_full = free_requests < MEM_EVENT_RING_THRESHOLD ? 1 : 0;
if ( (curr->domain->domain_id == d->domain_id) && ring_full )
{
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
@@ -322,7 +322,6 @@ static struct page_info* mem_sharing_all
req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
}
- /* XXX: Need to reserve a request, not just check the ring! */
if(mem_event_check_ring(d)) return page;
req.gfn = gfn;
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2970,6 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_
else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
{
/* gfn is already on its way back and vcpu is not paused */
+ mem_event_put_req_producers(d);
return;
}
Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/asm-x86/mem_event.h
+++ xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
@@ -27,6 +27,7 @@
/* Pauses VCPU while marking pause flag for mem event */
void mem_event_mark_and_pause(struct vcpu *v);
int mem_event_check_ring(struct domain *d);
+void mem_event_put_req_producers(struct domain *d);
void mem_event_put_request(struct domain *d, mem_event_request_t *req);
void mem_event_get_response(struct domain *d, mem_event_response_t *rsp);
void mem_event_unpause_vcpus(struct domain *d);
Index: xen-4.1.2-testing/xen/include/xen/sched.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/xen/sched.h
+++ xen-4.1.2-testing/xen/include/xen/sched.h
@@ -190,6 +190,7 @@ struct mem_event_domain
{
/* ring lock */
spinlock_t ring_lock;
+ unsigned int req_producers;
/* shared page */
mem_event_shared_page_t *shared_page;
/* shared ring page */
++++++ 23818-mem_event_use_mem_event_mark_and_pause_in_mem_event_check_ring.patch ++++++
changeset: 23818:0268e7380953
user: Olaf Hering <olaf(a)aepfle.de>
date: Mon Sep 05 15:10:28 2011 +0100
files: xen/arch/x86/mm/mem_event.c
description:
mem_event: use mem_event_mark_and_pause() in mem_event_check_ring()
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
xen/arch/x86/mm/mem_event.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -178,10 +178,7 @@ int mem_event_check_ring(struct domain *
}
if ( (curr->domain->domain_id == d->domain_id) && ring_full )
- {
- set_bit(_VPF_mem_event, &curr->pause_flags);
- vcpu_sleep_nosync(curr);
- }
+ mem_event_mark_and_pause(curr);
mem_event_ring_unlock(d);
++++++ 23827-xenpaging_use_batch_of_pages_during_final_page-in.patch ++++++
changeset: 23827:d1d6abc1db20
user: Olaf Hering <olaf(a)aepfle.de>
date: Tue Sep 13 10:25:32 2011 +0100
files: tools/xenpaging/pagein.c tools/xenpaging/xenpaging.c tools/xenpaging/xenpaging.h
description:
xenpaging: use batch of pages during final page-in
Map up to RING_SIZE pages in exit path to fill the ring instead of
populating one page at a time.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
tools/xenpaging/pagein.c | 36 ++++++++++++++++++++++++------------
tools/xenpaging/xenpaging.c | 18 +++++++++++++-----
tools/xenpaging/xenpaging.h | 7 +++++--
3 files changed, 42 insertions(+), 19 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/pagein.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/pagein.c
+++ xen-4.1.2-testing/tools/xenpaging/pagein.c
@@ -1,14 +1,16 @@
/* Trigger a page-in in a separate thread-of-execution to avoid deadlock */
#include <pthread.h>
-#include "xc_private.h"
+#include <xc_private.h>
+#include "xenpaging.h"
struct page_in_args {
domid_t dom;
+ unsigned long *pagein_queue;
xc_interface *xch;
};
static struct page_in_args page_in_args;
-static unsigned long page_in_gfn;
+static unsigned long page_in_request;
static unsigned int page_in_possible;
static pthread_t page_in_thread;
@@ -19,19 +21,28 @@ static void *page_in(void *arg)
{
struct page_in_args *pia = arg;
void *page;
- xen_pfn_t gfn;
+ int i, num;
+ xen_pfn_t gfns[XENPAGING_PAGEIN_QUEUE_SIZE];
while (1)
{
pthread_mutex_lock(&page_in_mutex);
- while (!page_in_gfn)
+ while (!page_in_request)
pthread_cond_wait(&page_in_cond, &page_in_mutex);
- gfn = page_in_gfn;
- page_in_gfn = 0;
+ num = 0;
+ for (i = 0; i < XENPAGING_PAGEIN_QUEUE_SIZE; i++)
+ {
+ if (!pia->pagein_queue[i])
+ continue;
+ gfns[num] = pia->pagein_queue[i];
+ pia->pagein_queue[i] = 0;
+ num++;
+ }
+ page_in_request = 0;
pthread_mutex_unlock(&page_in_mutex);
/* Ignore errors */
- page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, &gfn, 1);
+ page = xc_map_foreign_pages(pia->xch, pia->dom, PROT_READ, gfns, num);
if (page)
munmap(page, PAGE_SIZE);
}
@@ -39,21 +50,22 @@ static void *page_in(void *arg)
pthread_exit(NULL);
}
-void page_in_trigger(unsigned long gfn)
+void page_in_trigger(void)
{
if (!page_in_possible)
return;
pthread_mutex_lock(&page_in_mutex);
- page_in_gfn = gfn;
+ page_in_request = 1;
pthread_mutex_unlock(&page_in_mutex);
pthread_cond_signal(&page_in_cond);
}
-void create_page_in_thread(domid_t domain_id, xc_interface *xch)
+void create_page_in_thread(xenpaging_t *paging)
{
- page_in_args.dom = domain_id;
- page_in_args.xch = xch;
+ page_in_args.dom = paging->mem_event.domain_id;
+ page_in_args.pagein_queue = paging->pagein_queue;
+ page_in_args.xch = paging->xc_handle;
if (pthread_create(&page_in_thread, NULL, page_in, &page_in_args) == 0)
page_in_possible = 1;
}
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -648,7 +648,7 @@ int main(int argc, char *argv[])
sigaction(SIGALRM, &act, NULL);
/* listen for page-in events to stop pager */
- create_page_in_thread(paging->mem_event.domain_id, xch);
+ create_page_in_thread(paging);
/* Evict pages */
for ( i = 0; i < paging->num_pages; i++ )
@@ -764,16 +764,24 @@ int main(int argc, char *argv[])
/* Write all pages back into the guest */
if ( interrupted == SIGTERM || interrupted == SIGINT )
{
+ int num = 0;
for ( i = 0; i < paging->domain_info->max_pages; i++ )
{
if ( test_bit(i, paging->bitmap) )
{
- page_in_trigger(i);
- break;
+ paging->pagein_queue[num] = i;
+ num++;
+ if ( num == XENPAGING_PAGEIN_QUEUE_SIZE )
+ break;
}
}
- /* If no more pages to process, exit loop */
- if ( i == paging->domain_info->max_pages )
+ /*
+ * One more round if there are still pages to process.
+ * If no more pages to process, exit loop.
+ */
+ if ( num )
+ page_in_trigger();
+ else if ( i == paging->domain_info->max_pages )
break;
}
else
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.h
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.h
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.h
@@ -29,6 +29,8 @@
#include <xen/event_channel.h>
#include <xen/mem_event.h>
+#define XENPAGING_PAGEIN_QUEUE_SIZE 64
+
typedef struct mem_event {
domid_t domain_id;
xc_evtchn *xce_handle;
@@ -49,6 +51,7 @@ typedef struct xenpaging {
mem_event_t mem_event;
int num_pages;
int policy_mru_size;
+ unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE];
} xenpaging_t;
@@ -58,8 +61,8 @@ typedef struct xenpaging_victim {
} xenpaging_victim_t;
-extern void create_page_in_thread(domid_t domain_id, xc_interface *xch);
-extern void page_in_trigger(unsigned long gfn);
+extern void create_page_in_thread(xenpaging_t *paging);
+extern void page_in_trigger(void);
#endif // __XEN_PAGING_H__
++++++ 23841-mem_event_pass_mem_event_domain_pointer_to_mem_event_functions.patch ++++++
changeset: 23841:ed7586b1d515
user: Olaf Hering <olaf(a)aepfle.de>
date: Fri Sep 16 12:13:31 2011 +0100
files: xen/arch/x86/hvm/hvm.c xen/arch/x86/mm/mem_event.c xen/arch/x86/mm/mem_sharing.c xen/arch/x86/mm/p2m.c xen/include/asm-x86/mem_event.h
description:
mem_event: pass mem_event_domain pointer to mem_event functions
Pass a struct mem_event_domain pointer to the various mem_event
functions. This will be used in a subsequent patch which creates
different ring buffers for the memshare, xenpaging and memaccess
functionality.
Remove the struct domain argument from some functions.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/hvm/hvm.c | 4 -
xen/arch/x86/mm/mem_event.c | 95 ++++++++++++++++++++--------------------
xen/arch/x86/mm/mem_sharing.c | 6 +-
xen/arch/x86/mm/p2m.c | 18 +++----
xen/include/asm-x86/mem_event.h | 8 +--
5 files changed, 66 insertions(+), 65 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
@@ -3909,7 +3909,7 @@ static int hvm_memory_event_traps(long p
if ( (p & HVMPME_onchangeonly) && (value == old) )
return 1;
- rc = mem_event_check_ring(d);
+ rc = mem_event_check_ring(d, &d->mem_event);
if ( rc )
return rc;
@@ -3932,7 +3932,7 @@ static int hvm_memory_event_traps(long p
req.gla_valid = 1;
}
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
return 1;
}
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -33,21 +33,21 @@
#define xen_rmb() rmb()
#define xen_wmb() wmb()
-#define mem_event_ring_lock_init(_d) spin_lock_init(&(_d)->mem_event.ring_lock)
-#define mem_event_ring_lock(_d) spin_lock(&(_d)->mem_event.ring_lock)
-#define mem_event_ring_unlock(_d) spin_unlock(&(_d)->mem_event.ring_lock)
+#define mem_event_ring_lock_init(_med) spin_lock_init(&(_med)->ring_lock)
+#define mem_event_ring_lock(_med) spin_lock(&(_med)->ring_lock)
+#define mem_event_ring_unlock(_med) spin_unlock(&(_med)->ring_lock)
-static int mem_event_enable(struct domain *d, mfn_t ring_mfn, mfn_t shared_mfn)
+static int mem_event_enable(struct domain *d, struct mem_event_domain *med, mfn_t ring_mfn, mfn_t shared_mfn)
{
int rc;
/* Map ring and shared pages */
- d->mem_event.ring_page = map_domain_page(mfn_x(ring_mfn));
- if ( d->mem_event.ring_page == NULL )
+ med->ring_page = map_domain_page(mfn_x(ring_mfn));
+ if ( med->ring_page == NULL )
goto err;
- d->mem_event.shared_page = map_domain_page(mfn_x(shared_mfn));
- if ( d->mem_event.shared_page == NULL )
+ med->shared_page = map_domain_page(mfn_x(shared_mfn));
+ if ( med->shared_page == NULL )
goto err_ring;
/* Allocate event channel */
@@ -56,15 +56,15 @@ static int mem_event_enable(struct domai
if ( rc < 0 )
goto err_shared;
- ((mem_event_shared_page_t *)d->mem_event.shared_page)->port = rc;
- d->mem_event.xen_port = rc;
+ ((mem_event_shared_page_t *)med->shared_page)->port = rc;
+ med->xen_port = rc;
/* Prepare ring buffer */
- FRONT_RING_INIT(&d->mem_event.front_ring,
- (mem_event_sring_t *)d->mem_event.ring_page,
+ FRONT_RING_INIT(&med->front_ring,
+ (mem_event_sring_t *)med->ring_page,
PAGE_SIZE);
- mem_event_ring_lock_init(d);
+ mem_event_ring_lock_init(med);
/* Wake any VCPUs paused for memory events */
mem_event_unpause_vcpus(d);
@@ -72,34 +72,34 @@ static int mem_event_enable(struct domai
return 0;
err_shared:
- unmap_domain_page(d->mem_event.shared_page);
- d->mem_event.shared_page = NULL;
+ unmap_domain_page(med->shared_page);
+ med->shared_page = NULL;
err_ring:
- unmap_domain_page(d->mem_event.ring_page);
- d->mem_event.ring_page = NULL;
+ unmap_domain_page(med->ring_page);
+ med->ring_page = NULL;
err:
return 1;
}
-static int mem_event_disable(struct domain *d)
+static int mem_event_disable(struct mem_event_domain *med)
{
- unmap_domain_page(d->mem_event.ring_page);
- d->mem_event.ring_page = NULL;
+ unmap_domain_page(med->ring_page);
+ med->ring_page = NULL;
- unmap_domain_page(d->mem_event.shared_page);
- d->mem_event.shared_page = NULL;
+ unmap_domain_page(med->shared_page);
+ med->shared_page = NULL;
return 0;
}
-void mem_event_put_request(struct domain *d, mem_event_request_t *req)
+void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req)
{
mem_event_front_ring_t *front_ring;
RING_IDX req_prod;
- mem_event_ring_lock(d);
+ mem_event_ring_lock(med);
- front_ring = &d->mem_event.front_ring;
+ front_ring = &med->front_ring;
req_prod = front_ring->req_prod_pvt;
/* Copy request */
@@ -107,23 +107,23 @@ void mem_event_put_request(struct domain
req_prod++;
/* Update ring */
- d->mem_event.req_producers--;
+ med->req_producers--;
front_ring->req_prod_pvt = req_prod;
RING_PUSH_REQUESTS(front_ring);
- mem_event_ring_unlock(d);
+ mem_event_ring_unlock(med);
- notify_via_xen_event_channel(d, d->mem_event.xen_port);
+ notify_via_xen_event_channel(d, med->xen_port);
}
-void mem_event_get_response(struct domain *d, mem_event_response_t *rsp)
+void mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp)
{
mem_event_front_ring_t *front_ring;
RING_IDX rsp_cons;
- mem_event_ring_lock(d);
+ mem_event_ring_lock(med);
- front_ring = &d->mem_event.front_ring;
+ front_ring = &med->front_ring;
rsp_cons = front_ring->rsp_cons;
/* Copy response */
@@ -134,7 +134,7 @@ void mem_event_get_response(struct domai
front_ring->rsp_cons = rsp_cons;
front_ring->sring->rsp_event = rsp_cons + 1;
- mem_event_ring_unlock(d);
+ mem_event_ring_unlock(med);
}
void mem_event_unpause_vcpus(struct domain *d)
@@ -152,35 +152,35 @@ void mem_event_mark_and_pause(struct vcp
vcpu_sleep_nosync(v);
}
-void mem_event_put_req_producers(struct domain *d)
+void mem_event_put_req_producers(struct mem_event_domain *med)
{
- mem_event_ring_lock(d);
- d->mem_event.req_producers--;
- mem_event_ring_unlock(d);
+ mem_event_ring_lock(med);
+ med->req_producers--;
+ mem_event_ring_unlock(med);
}
-int mem_event_check_ring(struct domain *d)
+int mem_event_check_ring(struct domain *d, struct mem_event_domain *med)
{
struct vcpu *curr = current;
int free_requests;
int ring_full = 1;
- if ( !d->mem_event.ring_page )
+ if ( !med->ring_page )
return -1;
- mem_event_ring_lock(d);
+ mem_event_ring_lock(med);
- free_requests = RING_FREE_REQUESTS(&d->mem_event.front_ring);
- if ( d->mem_event.req_producers < free_requests )
+ free_requests = RING_FREE_REQUESTS(&med->front_ring);
+ if ( med->req_producers < free_requests )
{
- d->mem_event.req_producers++;
+ med->req_producers++;
ring_full = 0;
}
- if ( (curr->domain->domain_id == d->domain_id) && ring_full )
+ if ( ring_full && (curr->domain == d) )
mem_event_mark_and_pause(curr);
- mem_event_ring_unlock(d);
+ mem_event_ring_unlock(med);
return ring_full;
}
@@ -230,6 +230,7 @@ int mem_event_domctl(struct domain *d, x
{
struct domain *dom_mem_event = current->domain;
struct vcpu *v = current;
+ struct mem_event_domain *med = &d->mem_event;
unsigned long ring_addr = mec->ring_addr;
unsigned long shared_addr = mec->shared_addr;
l1_pgentry_t l1e;
@@ -242,7 +243,7 @@ int mem_event_domctl(struct domain *d, x
* the cache is in an undefined state and so is the guest
*/
rc = -EBUSY;
- if ( d->mem_event.ring_page )
+ if ( med->ring_page )
break;
/* Currently only EPT is supported */
@@ -270,7 +271,7 @@ int mem_event_domctl(struct domain *d, x
break;
rc = -EINVAL;
- if ( mem_event_enable(d, ring_mfn, shared_mfn) != 0 )
+ if ( mem_event_enable(d, med, ring_mfn, shared_mfn) != 0 )
break;
rc = 0;
@@ -279,7 +280,7 @@ int mem_event_domctl(struct domain *d, x
case XEN_DOMCTL_MEM_EVENT_OP_DISABLE:
{
- rc = mem_event_disable(d);
+ rc = mem_event_disable(&d->mem_event);
}
break;
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
@@ -322,12 +322,12 @@ static struct page_info* mem_sharing_all
req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
}
- if(mem_event_check_ring(d)) return page;
+ if(mem_event_check_ring(d, &d->mem_event)) return page;
req.gfn = gfn;
req.p2mt = p2m_ram_shared;
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
return page;
}
@@ -342,7 +342,7 @@ int mem_sharing_sharing_resume(struct do
mem_event_response_t rsp;
/* Get request off the ring */
- mem_event_get_response(d, &rsp);
+ mem_event_get_response(&d->mem_event, &rsp);
/* Unpause domain/vcpu */
if( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2923,7 +2923,7 @@ void p2m_mem_paging_drop_page(struct p2m
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
- if ( mem_event_check_ring(d) == 0)
+ if ( mem_event_check_ring(d, &d->mem_event) == 0)
{
/* Send release notification to pager */
memset(&req, 0, sizeof(req));
@@ -2931,7 +2931,7 @@ void p2m_mem_paging_drop_page(struct p2m
req.gfn = gfn;
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
}
}
@@ -2943,7 +2943,7 @@ void p2m_mem_paging_populate(struct p2m_
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
- if ( mem_event_check_ring(d) )
+ if ( mem_event_check_ring(d, &d->mem_event) )
return;
memset(&req, 0, sizeof(req));
@@ -2970,7 +2970,7 @@ void p2m_mem_paging_populate(struct p2m_
else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
{
/* gfn is already on its way back and vcpu is not paused */
- mem_event_put_req_producers(d);
+ mem_event_put_req_producers(&d->mem_event);
return;
}
@@ -2979,7 +2979,7 @@ void p2m_mem_paging_populate(struct p2m_
req.p2mt = p2mt;
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
}
int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn)
@@ -3008,7 +3008,7 @@ void p2m_mem_paging_resume(struct p2m_do
mfn_t mfn;
/* Pull the response off the ring */
- mem_event_get_response(d, &rsp);
+ mem_event_get_response(&d->mem_event, &rsp);
/* Fix p2m entry if the page was not dropped */
if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
@@ -3055,7 +3055,7 @@ void p2m_mem_access_check(unsigned long
p2m_unlock(p2m);
/* Otherwise, check if there is a memory event listener, and send the message along */
- res = mem_event_check_ring(d);
+ res = mem_event_check_ring(d, &d->mem_event);
if ( res < 0 )
{
/* No listener */
@@ -3099,7 +3099,7 @@ void p2m_mem_access_check(unsigned long
req.vcpu_id = v->vcpu_id;
- mem_event_put_request(d, &req);
+ mem_event_put_request(d, &d->mem_event, &req);
/* VCPU paused, mem event request sent */
}
@@ -3109,7 +3109,7 @@ void p2m_mem_access_resume(struct p2m_do
struct domain *d = p2m->domain;
mem_event_response_t rsp;
- mem_event_get_response(d, &rsp);
+ mem_event_get_response(&d->mem_event, &rsp);
/* Unpause domain */
if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED )
Index: xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/asm-x86/mem_event.h
+++ xen-4.1.2-testing/xen/include/asm-x86/mem_event.h
@@ -26,10 +26,10 @@
/* Pauses VCPU while marking pause flag for mem event */
void mem_event_mark_and_pause(struct vcpu *v);
-int mem_event_check_ring(struct domain *d);
-void mem_event_put_req_producers(struct domain *d);
-void mem_event_put_request(struct domain *d, mem_event_request_t *req);
-void mem_event_get_response(struct domain *d, mem_event_response_t *rsp);
+int mem_event_check_ring(struct domain *d, struct mem_event_domain *med);
+void mem_event_put_req_producers(struct mem_event_domain *med);
+void mem_event_put_request(struct domain *d, struct mem_event_domain *med, mem_event_request_t *req);
+void mem_event_get_response(struct mem_event_domain *med, mem_event_response_t *rsp);
void mem_event_unpause_vcpus(struct domain *d);
int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
++++++ 23842-mem_event_use_different_ringbuffers_for_share_paging_and_access.patch ++++++
++++ 868 lines (skipped)
++++++ 23874-xenpaging_track_number_of_paged_pages_in_struct_domain.patch ++++++
changeset: 23874:651aed73b39c
user: Olaf Hering <olafiaepfle.de>
date: Mon Sep 26 22:19:42 2011 +0100
files: tools/libxc/xc_domain.c tools/libxc/xenctrl.h xen/arch/x86/mm/p2m.c xen/common/domctl.c xen/include/public/domctl.h xen/include/xen/sched.h
description:
xenpaging: track number of paged pages in struct domain
The toolstack should know how many pages are paged-out at a given point
in time so it could make smarter decisions about how many pages should
be paged or ballooned.
Add a new member to xen_domctl_getdomaininfo and bump interface version.
Use the new member in xc_dominfo_t.
The SONAME of libxc should be changed if this patch gets applied.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Ian Campbell <ian.campbell(a)citrix.com>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/libxc/xc_domain.c | 1 +
tools/libxc/xenctrl.h | 1 +
xen/arch/x86/mm/p2m.c | 5 +++++
xen/common/domctl.c | 1 +
xen/include/public/domctl.h | 3 ++-
xen/include/xen/sched.h | 1 +
6 files changed, 11 insertions(+), 1 deletion(-)
Index: xen-4.1.2-testing/tools/libxc/xc_domain.c
===================================================================
--- xen-4.1.2-testing.orig/tools/libxc/xc_domain.c
+++ xen-4.1.2-testing/tools/libxc/xc_domain.c
@@ -235,6 +235,7 @@ int xc_domain_getinfo(xc_interface *xch,
info->ssidref = domctl.u.getdomaininfo.ssidref;
info->nr_pages = domctl.u.getdomaininfo.tot_pages;
info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
+ info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
info->shared_info_frame = domctl.u.getdomaininfo.shared_info_frame;
info->cpu_time = domctl.u.getdomaininfo.cpu_time;
Index: xen-4.1.2-testing/tools/libxc/xenctrl.h
===================================================================
--- xen-4.1.2-testing.orig/tools/libxc/xenctrl.h
+++ xen-4.1.2-testing/tools/libxc/xenctrl.h
@@ -353,6 +353,7 @@ typedef struct xc_dominfo {
unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
unsigned long nr_pages; /* current number, not maximum */
unsigned long nr_shared_pages;
+ unsigned long nr_paged_pages;
unsigned long shared_info_frame;
uint64_t cpu_time;
unsigned long max_memkb;
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2913,6 +2913,9 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Put the page back so it gets freed */
put_page(page);
+ /* Track number of paged gfns */
+ atomic_inc(&p2m->domain->paged_pages);
+
return 0;
}
@@ -2997,6 +3000,8 @@ int p2m_mem_paging_prep(struct p2m_domai
audit_p2m(p2m, 1);
p2m_unlock(p2m);
+ atomic_dec(&p2m->domain->paged_pages);
+
return 0;
}
Index: xen-4.1.2-testing/xen/common/domctl.c
===================================================================
--- xen-4.1.2-testing.orig/xen/common/domctl.c
+++ xen-4.1.2-testing/xen/common/domctl.c
@@ -139,6 +139,7 @@ void getdomaininfo(struct domain *d, str
info->tot_pages = d->tot_pages;
info->max_pages = d->max_pages;
info->shr_pages = atomic_read(&d->shr_pages);
+ info->paged_pages = atomic_read(&d->paged_pages);
info->shared_info_frame = mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_SHIFT);
BUG_ON(SHARED_M2P(info->shared_info_frame));
Index: xen-4.1.2-testing/xen/include/public/domctl.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/public/domctl.h
+++ xen-4.1.2-testing/xen/include/public/domctl.h
@@ -35,7 +35,7 @@
#include "xen.h"
#include "grant_table.h"
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000007
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
/*
* NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
uint64_aligned_t tot_pages;
uint64_aligned_t max_pages;
uint64_aligned_t shr_pages;
+ uint64_aligned_t paged_pages;
uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
uint64_aligned_t cpu_time;
uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
Index: xen-4.1.2-testing/xen/include/xen/sched.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/xen/sched.h
+++ xen-4.1.2-testing/xen/include/xen/sched.h
@@ -215,6 +215,7 @@ struct domain
unsigned int tot_pages; /* number of pages currently possesed */
unsigned int max_pages; /* maximum value for tot_pages */
atomic_t shr_pages; /* number of shared pages */
+ atomic_t paged_pages; /* number of paged-out pages */
unsigned int xenheap_pages; /* # pages allocated from Xen heap */
unsigned int max_vcpus;
++++++ 23897-x86-mce-offline-again.patch ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -10,8 +10,10 @@
Signed-off-by: Liu, Jinsong <jinsong.liu(a)intel.com>
Committed-by: Keir Fraser <keir(a)xen.org>
---- a/xen/arch/x86/cpu/mcheck/mce_intel.c
-+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce_intel.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/mce_intel.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -639,6 +639,8 @@ static void intel_memerr_dhandler(int bn
/* This is free page */
if (status & PG_OFFLINE_OFFLINED)
@@ -21,8 +23,10 @@
else if (status & PG_OFFLINE_PENDING) {
/* This page has owner */
if (status & PG_OFFLINE_OWNED) {
---- a/xen/common/page_alloc.c
-+++ b/xen/common/page_alloc.c
+Index: xen-4.1.2-testing/xen/common/page_alloc.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/page_alloc.c
++++ xen-4.1.2-testing/xen/common/page_alloc.c
@@ -38,6 +38,7 @@
#include <xen/tmem.h>
#include <xen/tmem_xen.h>
@@ -31,7 +35,7 @@
#include <asm/page.h>
#include <asm/numa.h>
#include <asm/flushtlb.h>
-@@ -704,6 +705,19 @@ int offline_page(unsigned long mfn, int
+@@ -708,6 +709,19 @@ int offline_page(unsigned long mfn, int
return -EINVAL;
}
@@ -51,8 +55,10 @@
spin_lock(&heap_lock);
old_info = mark_page_offline(pg, broken);
---- a/xen/include/public/sysctl.h
-+++ b/xen/include/public/sysctl.h
+Index: xen-4.1.2-testing/xen/include/public/sysctl.h
+===================================================================
+--- xen-4.1.2-testing.orig/xen/include/public/sysctl.h
++++ xen-4.1.2-testing/xen/include/public/sysctl.h
@@ -399,6 +399,7 @@ struct xen_sysctl_page_offline_op {
#define PG_OFFLINE_OFFLINED (0x1UL << 1)
#define PG_OFFLINE_PENDING (0x1UL << 2)
++++++ 23904-xenpaging_use_p2m-get_entry_in_p2m_mem_paging_functions.patch ++++++
changeset: 23904:ecab267b85ef
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 12:33:17 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: use p2m->get_entry() in p2m_mem_paging functions
Use p2m->get_entry() in the p2m_mem_paging functions. This preserves the
p2m_access type when gfn is updated with set_p2m_entry().
Its also a preparation for locking fixes in a subsequent patch.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2839,10 +2839,11 @@ int p2m_mem_paging_nominate(struct p2m_d
{
struct page_info *page;
p2m_type_t p2mt;
+ p2m_access_t a;
mfn_t mfn;
int ret;
- mfn = gfn_to_mfn(p2m, gfn, &p2mt);
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
/* Check if mfn is valid */
ret = -EINVAL;
@@ -2869,7 +2870,7 @@ int p2m_mem_paging_nominate(struct p2m_d
/* Fix p2m entry */
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_out, p2m->default_access);
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_out, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -2883,11 +2884,12 @@ int p2m_mem_paging_evict(struct p2m_doma
{
struct page_info *page;
p2m_type_t p2mt;
+ p2m_access_t a;
mfn_t mfn;
struct domain *d = p2m->domain;
/* Get mfn */
- mfn = gfn_to_mfn(p2m, gfn, &p2mt);
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( unlikely(!mfn_valid(mfn)) )
return -EINVAL;
@@ -2906,7 +2908,7 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Remove mapping from p2m table */
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, p2m->default_access);
+ set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -2943,6 +2945,7 @@ void p2m_mem_paging_populate(struct p2m_
struct vcpu *v = current;
mem_event_request_t req;
p2m_type_t p2mt;
+ p2m_access_t a;
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
@@ -2955,11 +2958,11 @@ void p2m_mem_paging_populate(struct p2m_
/* Fix p2m mapping */
/* XXX: It seems inefficient to have this here, as it's only needed
* in one case (ept guest accessing paging out page) */
- gfn_to_mfn(p2m, gfn, &p2mt);
+ p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( p2mt == p2m_ram_paged )
{
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, p2m->default_access);
+ set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
}
@@ -2988,7 +2991,10 @@ void p2m_mem_paging_populate(struct p2m_
int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
+ p2m_type_t p2mt;
+ p2m_access_t a;
+ p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
/* Get a free page */
page = alloc_domheap_page(p2m->domain, 0);
if ( unlikely(page == NULL) )
@@ -2996,7 +3002,7 @@ int p2m_mem_paging_prep(struct p2m_domai
/* Fix p2m mapping */
p2m_lock(p2m);
- set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, p2m->default_access);
+ set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, a);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -3010,6 +3016,7 @@ void p2m_mem_paging_resume(struct p2m_do
struct domain *d = p2m->domain;
mem_event_response_t rsp;
p2m_type_t p2mt;
+ p2m_access_t a;
mfn_t mfn;
/* Pull the response off the ring */
@@ -3018,9 +3025,9 @@ void p2m_mem_paging_resume(struct p2m_do
/* Fix p2m entry if the page was not dropped */
if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
{
- mfn = gfn_to_mfn(p2m, rsp.gfn, &p2mt);
+ mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
p2m_lock(p2m);
- set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, p2m->default_access);
+ set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
++++++ 23905-xenpaging_fix_locking_in_p2m_mem_paging_functions.patch ++++++
changeset: 23905:50ee6be56460
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 12:33:17 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: fix locking in p2m_mem_paging functions
As suggested by <hongkaixing(a)huawei.com>, query and adjust the p2mt
under the p2m_lock to prevent races with PoD.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 42 ++++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 16 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2843,6 +2843,8 @@ int p2m_mem_paging_nominate(struct p2m_d
mfn_t mfn;
int ret;
+ p2m_unlock(p2m);
+
mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
/* Check if mfn is valid */
@@ -2869,14 +2871,12 @@ int p2m_mem_paging_nominate(struct p2m_d
goto out;
/* Fix p2m entry */
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_out, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
-
ret = 0;
out:
+ p2m_unlock(p2m);
return ret;
}
@@ -2887,30 +2887,31 @@ int p2m_mem_paging_evict(struct p2m_doma
p2m_access_t a;
mfn_t mfn;
struct domain *d = p2m->domain;
+ int ret = -EINVAL;
+
+ p2m_lock(p2m);
/* Get mfn */
mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( unlikely(!mfn_valid(mfn)) )
- return -EINVAL;
+ goto out;
if ( (p2mt == p2m_ram_paged) || (p2mt == p2m_ram_paging_in) ||
(p2mt == p2m_ram_paging_in_start) )
- return -EINVAL;
+ goto out;
/* Get the page so it doesn't get modified under Xen's feet */
page = mfn_to_page(mfn);
if ( unlikely(!get_page(page, d)) )
- return -EINVAL;
+ goto out;
/* Decrement guest domain's ref count of the page */
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
/* Remove mapping from p2m table */
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
/* Put the page back so it gets freed */
put_page(page);
@@ -2918,7 +2919,11 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Track number of paged gfns */
atomic_inc(&p2m->domain->paged_pages);
- return 0;
+ ret = 0;
+
+ out:
+ p2m_unlock(p2m);
+ return ret;
}
void p2m_mem_paging_drop_page(struct p2m_domain *p2m, unsigned long gfn)
@@ -2958,14 +2963,14 @@ void p2m_mem_paging_populate(struct p2m_
/* Fix p2m mapping */
/* XXX: It seems inefficient to have this here, as it's only needed
* in one case (ept guest accessing paging out page) */
+ p2m_lock(p2m);
p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( p2mt == p2m_ram_paged )
{
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
}
+ p2m_unlock(p2m);
/* Pause domain */
if ( v->domain->domain_id == d->domain_id )
@@ -2993,22 +2998,27 @@ int p2m_mem_paging_prep(struct p2m_domai
struct page_info *page;
p2m_type_t p2mt;
p2m_access_t a;
+ int ret = -ENOMEM;
+
+ p2m_lock(p2m);
p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+
/* Get a free page */
page = alloc_domheap_page(p2m->domain, 0);
if ( unlikely(page == NULL) )
- return -ENOMEM;
+ goto out;
/* Fix p2m mapping */
- p2m_lock(p2m);
set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, a);
audit_p2m(p2m, 1);
- p2m_unlock(p2m);
atomic_dec(&p2m->domain->paged_pages);
- return 0;
+ ret = 0;
+ out:
+ p2m_unlock(p2m);
+ return ret;
}
void p2m_mem_paging_resume(struct p2m_domain *p2m)
@@ -3025,8 +3035,8 @@ void p2m_mem_paging_resume(struct p2m_do
/* Fix p2m entry if the page was not dropped */
if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
{
- mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
p2m_lock(p2m);
+ mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
audit_p2m(p2m, 1);
++++++ 23906-xenpaging_remove_confusing_comment_from_p2m_mem_paging_populate.patch ++++++
changeset: 23906:7bf85c3fd9f0
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 12:33:17 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: remove confusing comment from p2m_mem_paging_populate
Currently there is no way to avoid the double check of the p2mt
because p2m_mem_paging_populate() is called from many places without
the p2m_lock held. Upcoming changes will move the function into
gfn_to_mfn(), so its interface could be changed and the extra
p2m_lock/get_entry can be removed.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 2 --
1 file changed, 2 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2961,8 +2961,6 @@ void p2m_mem_paging_populate(struct p2m_
req.type = MEM_EVENT_TYPE_PAGING;
/* Fix p2m mapping */
- /* XXX: It seems inefficient to have this here, as it's only needed
- * in one case (ept guest accessing paging out page) */
p2m_lock(p2m);
p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
if ( p2mt == p2m_ram_paged )
++++++ 23908-p2m_query-modify_p2mt_with_p2m_lock_held.patch ++++++
changeset: 23908:88b6e08b8aa8
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 06 14:15:43 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
p2m: query/modify p2mt with p2m_lock held
Query and update the p2mt in set_mmio_p2m_entry, clear_mmio_p2m_entry
and set_shared_p2m_entry with the p2m_lock held.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2751,9 +2751,11 @@ set_mmio_p2m_entry(struct p2m_domain *p2
if ( !paging_mode_translate(p2m->domain) )
return 0;
+ p2m_lock(p2m);
omfn = gfn_to_mfn_query(p2m, gfn, &ot);
if ( p2m_is_grant(ot) )
{
+ p2m_unlock(p2m);
domain_crash(p2m->domain);
return 0;
}
@@ -2764,7 +2766,6 @@ set_mmio_p2m_entry(struct p2m_domain *p2
}
P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn));
- p2m_lock(p2m);
rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_mmio_direct, p2m->default_access);
audit_p2m(p2m, 1);
p2m_unlock(p2m);
@@ -2785,18 +2786,20 @@ clear_mmio_p2m_entry(struct p2m_domain *
if ( !paging_mode_translate(p2m->domain) )
return 0;
- mfn = gfn_to_mfn(p2m, gfn, &t);
+ p2m_lock(p2m);
+ mfn = gfn_to_mfn_query(p2m, gfn, &t);
/* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) )
{
gdprintk(XENLOG_ERR,
"clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);
- return 0;
+ goto out;
}
- p2m_lock(p2m);
rc = set_p2m_entry(p2m, gfn, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access);
audit_p2m(p2m, 1);
+
+out:
p2m_unlock(p2m);
return rc;
@@ -2813,6 +2816,8 @@ set_shared_p2m_entry(struct p2m_domain *
if ( !paging_mode_translate(p2m->domain) )
return 0;
+ if ( need_lock )
+ p2m_lock(p2m);
omfn = gfn_to_mfn_query(p2m, gfn, &ot);
/* At the moment we only allow p2m change if gfn has already been made
* sharable first */
@@ -2822,8 +2827,6 @@ set_shared_p2m_entry(struct p2m_domain *
set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
- if ( need_lock )
- p2m_lock(p2m);
rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_shared, p2m->default_access);
if ( need_lock )
p2m_unlock(p2m);
++++++ 23943-xenpaging_clear_page_content_after_evict.patch ++++++
changeset: 23943:1185ae04b5aa
user: Olaf Hering <olaf(a)aepfle.de>
date: Tue Oct 11 10:46:28 2011 +0100
files: tools/xenpaging/xenpaging.c xen/arch/x86/mm/p2m.c
description:
xenpaging: clear page content after evict
If the guest happens to read from the gfn while xenpaging is in the process of
evicting the page, the guest may read zeros instead of actual data.
Also if eviction fails the page content will be corrupted and xenpaging wont
attempt to restore the page.
Remove page scrubbing from pager and do it after successful eviction.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Ian Jackson <ian.jackson(a)eu.citrix.com>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/xenpaging/xenpaging.c | 3 ---
xen/arch/x86/mm/p2m.c | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -455,9 +455,6 @@ static int xenpaging_evict_page(xenpagin
goto out;
}
- /* Clear page */
- memset(page, 0, PAGE_SIZE);
-
munmap(page, PAGE_SIZE);
/* Tell Xen to evict page */
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2916,6 +2916,9 @@ int p2m_mem_paging_evict(struct p2m_doma
set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paged, a);
audit_p2m(p2m, 1);
+ /* Clear content before returning the page to Xen */
+ scrub_one_page(page);
+
/* Put the page back so it gets freed */
put_page(page);
++++++ 23953-xenpaging_handle_evict_failures.patch ++++++
changeset: 23953:eda18b27de6e
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 13 12:21:10 2011 +0100
files: tools/xenpaging/xenpaging.c xen/arch/x86/mm.c xen/arch/x86/mm/p2m.c xen/include/public/mem_event.h
description:
xenpaging: handle evict failures
Evict of a nominated gfn must fail if some other process mapped the
page without checking the p2mt of that gfn first.
Add a check to cancel eviction if the page usage count is not 1.
Handle the possible eviction failure in the page-in paths.
After nominate and before evict, something may check the p2mt and call
populate. Handle this case and let the gfn enter the page-in path. The
gfn may still be connected to a mfn, so there is no need to allocate a
new page in prep.
Adjust do_mmu_update to return -ENOENT only if the gfn has entered the
page-in path and if it is not yet connected to a mfn. Otherwise
linux_privcmd_map_foreign_bulk() may loop forever.
Add MEM_EVENT_FLAG_EVICT_FAIL to inform pager that a page-in request for
a possible not-evicted page was sent. xenpaging does currently not need
that flag because failure to evict a gfn will be caught.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/xenpaging/xenpaging.c | 10 ++++---
xen/arch/x86/mm.c | 8 ++---
xen/arch/x86/mm/p2m.c | 55 +++++++++++++++++++++++++++++------------
xen/include/public/mem_event.h | 1
4 files changed, 50 insertions(+), 24 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -734,10 +734,12 @@ int main(int argc, char *argv[])
}
else
{
- DPRINTF("page already populated (domain = %d; vcpu = %d;"
- " gfn = %"PRIx64"; paused = %d)\n",
- paging->mem_event.domain_id, req.vcpu_id,
- req.gfn, req.flags & MEM_EVENT_FLAG_VCPU_PAUSED);
+ DPRINTF("page %s populated (domain = %d; vcpu = %d;"
+ " gfn = %"PRIx64"; paused = %d; evict_fail = %d)\n",
+ req.flags & MEM_EVENT_FLAG_EVICT_FAIL ? "not" : "already",
+ paging->mem_event.domain_id, req.vcpu_id, req.gfn,
+ !!(req.flags & MEM_EVENT_FLAG_VCPU_PAUSED) ,
+ !!(req.flags & MEM_EVENT_FLAG_EVICT_FAIL) );
/* Tell Xen to resume the vcpu */
/* XXX: Maybe just check if the vcpu was paused? */
Index: xen-4.1.2-testing/xen/arch/x86/mm.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
+++ xen-4.1.2-testing/xen/arch/x86/mm.c
@@ -3502,7 +3502,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l1e_p2mt )
+ else if ( p2m_ram_paging_in_start == l1e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
@@ -3543,7 +3543,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l2e_p2mt )
+ else if ( p2m_ram_paging_in_start == l2e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
@@ -3572,7 +3572,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l3e_p2mt )
+ else if ( p2m_ram_paging_in_start == l3e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
@@ -3602,7 +3602,7 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
- else if ( p2m_ram_paging_in_start == l4e_p2mt )
+ else if ( p2m_ram_paging_in_start == l4e_p2mt && !mfn_valid(mfn) )
{
rc = -ENOENT;
break;
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2899,15 +2899,24 @@ int p2m_mem_paging_evict(struct p2m_doma
if ( unlikely(!mfn_valid(mfn)) )
goto out;
- if ( (p2mt == p2m_ram_paged) || (p2mt == p2m_ram_paging_in) ||
- (p2mt == p2m_ram_paging_in_start) )
+ /* Allow only nominated pages */
+ if ( p2mt != p2m_ram_paging_out )
goto out;
+ ret = -EBUSY;
/* Get the page so it doesn't get modified under Xen's feet */
page = mfn_to_page(mfn);
if ( unlikely(!get_page(page, d)) )
goto out;
+ /* Check page count and type once more */
+ if ( (page->count_info & (PGC_count_mask | PGC_allocated)) !=
+ (2 | PGC_allocated) )
+ goto out_put;
+
+ if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_none )
+ goto out_put;
+
/* Decrement guest domain's ref count of the page */
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
@@ -2919,14 +2928,15 @@ int p2m_mem_paging_evict(struct p2m_doma
/* Clear content before returning the page to Xen */
scrub_one_page(page);
- /* Put the page back so it gets freed */
- put_page(page);
-
/* Track number of paged gfns */
atomic_inc(&p2m->domain->paged_pages);
ret = 0;
+ out_put:
+ /* Put the page back so it gets freed */
+ put_page(page);
+
out:
p2m_unlock(p2m);
return ret;
@@ -2957,6 +2967,7 @@ void p2m_mem_paging_populate(struct p2m_
mem_event_request_t req;
p2m_type_t p2mt;
p2m_access_t a;
+ mfn_t mfn;
struct domain *d = p2m->domain;
/* Check that there's space on the ring for this request */
@@ -2968,20 +2979,26 @@ void p2m_mem_paging_populate(struct p2m_
/* Fix p2m mapping */
p2m_lock(p2m);
- p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
- if ( p2mt == p2m_ram_paged )
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+ /* Allow only nominated or evicted pages to enter page-in path */
+ if ( p2mt == p2m_ram_paging_out || p2mt == p2m_ram_paged )
{
- set_p2m_entry(p2m, gfn, _mfn(PAGING_MFN), 0, p2m_ram_paging_in_start, a);
+ /* Evict will fail now, tag this request for pager */
+ if ( p2mt == p2m_ram_paging_out )
+ req.flags |= MEM_EVENT_FLAG_EVICT_FAIL;
+
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_in_start, a);
audit_p2m(p2m, 1);
}
p2m_unlock(p2m);
- /* Pause domain */
- if ( v->domain->domain_id == d->domain_id )
+ /* Pause domain if request came from guest and gfn has paging type */
+ if ( p2m_is_paging(p2mt) && v->domain->domain_id == d->domain_id )
{
vcpu_pause_nosync(v);
req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
}
+ /* No need to inform pager if the gfn is not in the page-out path */
else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
{
/* gfn is already on its way back and vcpu is not paused */
@@ -3002,19 +3019,25 @@ int p2m_mem_paging_prep(struct p2m_domai
struct page_info *page;
p2m_type_t p2mt;
p2m_access_t a;
+ mfn_t mfn;
int ret = -ENOMEM;
p2m_lock(p2m);
- p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+ mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
- /* Get a free page */
- page = alloc_domheap_page(p2m->domain, 0);
- if ( unlikely(page == NULL) )
- goto out;
+ /* Allocate a page if the gfn does not have one yet */
+ if ( !mfn_valid(mfn) )
+ {
+ /* Get a free page */
+ page = alloc_domheap_page(p2m->domain, 0);
+ if ( unlikely(page == NULL) )
+ goto out;
+ mfn = page_to_mfn(page);
+ }
/* Fix p2m mapping */
- set_p2m_entry(p2m, gfn, page_to_mfn(page), 0, p2m_ram_paging_in, a);
+ set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_paging_in, a);
audit_p2m(p2m, 1);
atomic_dec(&p2m->domain->paged_pages);
Index: xen-4.1.2-testing/xen/include/public/mem_event.h
===================================================================
--- xen-4.1.2-testing.orig/xen/include/public/mem_event.h
+++ xen-4.1.2-testing/xen/include/public/mem_event.h
@@ -38,6 +38,7 @@
/* Memory event flags */
#define MEM_EVENT_FLAG_VCPU_PAUSED (1 << 0)
#define MEM_EVENT_FLAG_DROP_PAGE (1 << 1)
+#define MEM_EVENT_FLAG_EVICT_FAIL (1 << 2)
/* Reasons for the memory event request */
#define MEM_EVENT_REASON_UNKNOWN 0 /* typical reason */
++++++ 23978-xenpaging_check_p2mt_in_p2m_mem_paging_functions.patch ++++++
changeset: 23978:fd3fa0a85020
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 20 11:25:55 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: check p2mt in p2m_mem_paging functions
Add checks to forward the p2m_ram_paging* state properly during page-in.
Resume can be called several times if several vcpus called populate for
the gfn. Finish resume only once.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -3020,16 +3020,22 @@ int p2m_mem_paging_prep(struct p2m_domai
p2m_type_t p2mt;
p2m_access_t a;
mfn_t mfn;
- int ret = -ENOMEM;
+ int ret;
p2m_lock(p2m);
mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query);
+ ret = -ENOENT;
+ /* Allow only missing pages */
+ if ( p2mt != p2m_ram_paging_in_start )
+ goto out;
+
/* Allocate a page if the gfn does not have one yet */
if ( !mfn_valid(mfn) )
{
/* Get a free page */
+ ret = -ENOMEM;
page = alloc_domheap_page(p2m->domain, 0);
if ( unlikely(page == NULL) )
goto out;
@@ -3064,9 +3070,15 @@ void p2m_mem_paging_resume(struct p2m_do
{
p2m_lock(p2m);
mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query);
- set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
- set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
- audit_p2m(p2m, 1);
+ /* Allow only pages which were prepared properly, or pages which
+ * were nominated but not evicted */
+ if ( mfn_valid(mfn) &&
+ (p2mt == p2m_ram_paging_in || p2mt == p2m_ram_paging_in_start) )
+ {
+ set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
+ set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
+ audit_p2m(p2m, 1);
+ }
p2m_unlock(p2m);
}
++++++ 23979-xenpaging_document_p2m_mem_paging_functions.patch ++++++
changeset: 23979:18306b054799
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 20 11:25:58 2011 +0100
files: xen/arch/x86/mm/p2m.c
description:
xenpaging: document p2m_mem_paging functions
Add some documentation for each of the p2m_mem_paging functions to describe
what they ought to do.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
xen/arch/x86/mm/p2m.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
@@ -2838,6 +2838,24 @@ set_shared_p2m_entry(struct p2m_domain *
}
#ifdef __x86_64__
+/**
+ * p2m_mem_paging_nominate - Mark a guest page as to-be-paged-out
+ * @d: guest domain
+ * @gfn: guest page to nominate
+ *
+ * Returns 0 for success or negative errno values if gfn is not pageable.
+ *
+ * p2m_mem_paging_nominate() is called by the pager and checks if a guest page
+ * can be paged out. If the following conditions are met the p2mt will be
+ * changed:
+ * - the gfn is backed by a mfn
+ * - the p2mt of the gfn is pageable
+ * - the mfn is not used for IO
+ * - the mfn has exactly one user and has no special meaning
+ *
+ * Once the p2mt is changed the page is readonly for the guest. On success the
+ * pager can write the page contents to disk and later evict the page.
+ */
int p2m_mem_paging_nominate(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
@@ -2883,6 +2901,25 @@ int p2m_mem_paging_nominate(struct p2m_d
return ret;
}
+/**
+ * p2m_mem_paging_evict - Mark a guest page as paged-out
+ * @d: guest domain
+ * @gfn: guest page to evict
+ *
+ * Returns 0 for success or negative errno values if eviction is not possible.
+ *
+ * p2m_mem_paging_evict() is called by the pager and will free a guest page and
+ * release it back to Xen. If the following conditions are met the page can be
+ * freed:
+ * - the gfn is backed by a mfn
+ * - the gfn was nominated
+ * - the mfn has still exactly one user and has no special meaning
+ *
+ * After successful nomination some other process could have mapped the page. In
+ * this case eviction can not be done. If the gfn was populated before the pager
+ * could evict it, eviction can not be done either. In this case the gfn is
+ * still backed by a mfn.
+ */
int p2m_mem_paging_evict(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
@@ -2942,6 +2979,15 @@ int p2m_mem_paging_evict(struct p2m_doma
return ret;
}
+/**
+ * p2m_mem_paging_drop_page - Tell pager to drop its reference to a paged page
+ * @d: guest domain
+ * @gfn: guest page to drop
+ *
+ * p2m_mem_paging_drop_page() will notify the pager that a paged-out gfn was
+ * released by the guest. The pager is supposed to drop its reference of the
+ * gfn.
+ */
void p2m_mem_paging_drop_page(struct p2m_domain *p2m, unsigned long gfn)
{
struct vcpu *v = current;
@@ -2961,6 +3007,27 @@ void p2m_mem_paging_drop_page(struct p2m
}
}
+/**
+ * p2m_mem_paging_populate - Tell pager to populete a paged page
+ * @d: guest domain
+ * @gfn: guest page in paging state
+ *
+ * p2m_mem_paging_populate() will notify the pager that a page in any of the
+ * paging states needs to be written back into the guest.
+ * This function needs to be called whenever gfn_to_mfn() returns any of the p2m
+ * paging types because the gfn may not be backed by a mfn.
+ *
+ * The gfn can be in any of the paging states, but the pager needs only be
+ * notified when the gfn is in the paging-out path (paging_out or paged). This
+ * function may be called more than once from several vcpus. If the vcpu belongs
+ * to the guest, the vcpu must be stopped and the pager notified that the vcpu
+ * was stopped. The pager needs to handle several requests for the same gfn.
+ *
+ * If the gfn is not in the paging-out path and the vcpu does not belong to the
+ * guest, nothing needs to be done and the function assumes that a request was
+ * already sent to the pager. In this case the caller has to try again until the
+ * gfn is fully paged in again.
+ */
void p2m_mem_paging_populate(struct p2m_domain *p2m, unsigned long gfn)
{
struct vcpu *v = current;
@@ -3014,6 +3081,17 @@ void p2m_mem_paging_populate(struct p2m_
mem_event_put_request(d, &d->mem_paging, &req);
}
+/**
+ * p2m_mem_paging_prep - Allocate a new page for the guest
+ * @d: guest domain
+ * @gfn: guest page in paging state
+ *
+ * p2m_mem_paging_prep() will allocate a new page for the guest if the gfn is
+ * not backed by a mfn. It is called by the pager.
+ * It is required that the gfn was already populated. The gfn may already have a
+ * mfn if populate was called for gfn which was nominated but not evicted. In
+ * this case only the p2mt needs to be forwarded.
+ */
int p2m_mem_paging_prep(struct p2m_domain *p2m, unsigned long gfn)
{
struct page_info *page;
@@ -3054,6 +3132,21 @@ int p2m_mem_paging_prep(struct p2m_domai
return ret;
}
+/**
+ * p2m_mem_paging_resume - Resume guest gfn and vcpus
+ * @d: guest domain
+ * @gfn: guest page in paging state
+ *
+ * p2m_mem_paging_resume() will forward the p2mt of a gfn to ram_rw and all
+ * waiting vcpus will be unpaused again. It is called by the pager.
+ *
+ * The gfn was previously either evicted and populated, or nominated and
+ * populated. If the page was evicted the p2mt will be p2m_ram_paging_in. If
+ * the page was just nominated the p2mt will be p2m_ram_paging_in_start because
+ * the pager did not call p2m_mem_paging_prep().
+ *
+ * If the gfn was dropped the vcpu needs to be unpaused.
+ */
void p2m_mem_paging_resume(struct p2m_domain *p2m)
{
struct domain *d = p2m->domain;
++++++ 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch ++++++
changeset: 23980:a06609840ff1
user: Olaf Hering <olaf(a)aepfle.de>
date: Thu Oct 20 11:25:58 2011 +0100
files: tools/xenpaging/xenpaging.c xen/arch/x86/mm/mem_event.c
description:
xenpaging: disallow paging in a PoD guest
Disallow xenpaging in a PoD guest until coexistance between the two features
is properly implemented.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Acked-by: Tim Deegan <tim(a)xen.org>
Committed-by: Tim Deegan <tim(a)xen.org>
---
tools/xenpaging/xenpaging.c | 3 +++
xen/arch/x86/mm/mem_event.c | 6 ++++++
2 files changed, 9 insertions(+)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -246,6 +246,9 @@ static xenpaging_t *xenpaging_init(domid
case ENODEV:
ERROR("EPT not supported for this guest");
break;
+ case EXDEV:
+ ERROR("xenpaging not supported in a PoD guest");
+ break;
default:
ERROR("Error initialising shared page: %s", strerror(errno));
break;
Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_event.c
+++ xen-4.1.2-testing/xen/arch/x86/mm/mem_event.c
@@ -253,6 +253,7 @@ int mem_event_domctl(struct domain *d, x
case XEN_DOMCTL_MEM_EVENT_OP_PAGING:
{
struct mem_event_domain *med = &d->mem_paging;
+ struct p2m_domain *p2m = p2m_get_hostp2m(d);
rc = -ENODEV;
/* Only HAP is supported */
if ( !hap_enabled(d) )
@@ -262,6 +263,11 @@ int mem_event_domctl(struct domain *d, x
if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
break;
+ rc = -EXDEV;
+ /* Disallow paging in a PoD guest */
+ if ( p2m->pod.entry_count )
+ break;
+
switch( mec->op )
{
case XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE:
++++++ 23993-x86-microcode-amd-fix-23871.patch ++++++
# HG changeset patch
# User Jan Beulich <jbeulich(a)novell.com>
# Date 1319475620 -3600
# Node ID e458dfc35b8d3be04a9b72c30ff97163e27a7314
# Parent ffe861c1d5dfa8f4485052e5600e06124105033f
x86/ucode-amd: fix regression from c/s 23871:503ee256fecf
microcode_fits() must return distinct values for the success and
no-fit-but-no-error cases, so the caller can react accordingly. Make
it return 1 in the success case, and adjust its single caller.
Also remove an impossible code path - install_equiv_cpu_table(), which
gets called prior to microcode_fits(), never leaves equiv_cpu_table
being NULL without also returning an error.
Note that this is still awaiting testing on a system where the
regression was actually observed (which also requires a new enough
microcode_ctl package). Note also that this will need to be
backported to 4.0 and 4.1 (or the broken c/s that got backported
there reverted).
Signed-off-by: Jan Beulich <jbeulich(a)novell.com>
Committed-by: Keir Fraser <keir(a)xen.org>
Index: xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
===================================================================
--- xen-4.1.2-testing.orig/xen/arch/x86/microcode_amd.c
+++ xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
@@ -76,14 +76,6 @@ static int microcode_fits(void *mc, int
/* We should bind the task to the CPU */
BUG_ON(cpu != raw_smp_processor_id());
- if ( equiv_cpu_table == NULL )
- {
- printk(KERN_INFO "microcode: CPU%d microcode update with "
- "version 0x%x (current=0x%x)\n",
- cpu, mc_header->patch_id, uci->cpu_sig.rev);
- goto out;
- }
-
current_cpu_id = cpuid_eax(0x00000001);
for ( i = 0; equiv_cpu_table[i].installed_cpu != 0; i++ )
@@ -96,7 +88,7 @@ static int microcode_fits(void *mc, int
}
if ( !equiv_cpu_id )
- return 0;
+ return 0;
if ( (mc_header->processor_rev_id) != equiv_cpu_id )
{
@@ -113,8 +105,7 @@ static int microcode_fits(void *mc, int
"update with version 0x%x (current=0x%x)\n",
cpu, mc_header->patch_id, uci->cpu_sig.rev);
-out:
- return 0;
+ return 1;
}
static int apply_microcode(int cpu)
@@ -289,7 +280,7 @@ static int cpu_request_microcode(int cpu
while ( (ret = get_next_ucode_from_buffer_amd(mc, buf, size, &offset)) == 0)
{
error = microcode_fits(mc, cpu);
- if (error != 0)
+ if (error <= 0)
continue;
error = apply_microcode(cpu);
++++++ udev-rules.patch ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -7,5 +7,5 @@
KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600"
KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600"
-SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
-+SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", TEST="/proc/xen", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
++SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", TEST=="/proc/xen", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"
++++++ xen-4.1.2-testing-src.tar.bz2 ++++++
/work/SRC/openSUSE:Factory/xen/xen-4.1.2-testing-src.tar.bz2 /work/SRC/openSUSE:Factory/.xen.new/xen-4.1.2-testing-src.tar.bz2 differ: char 11, line 1
++++++ xen-config.diff ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -9,9 +9,9 @@
-CONFIG_QEMU ?= $(QEMU_REMOTE)
+CONFIG_QEMU ?= ioemu-qemu-xen
- QEMU_TAG := xen-4.1.2-rc3
+ QEMU_TAG := xen-4.1.2
#QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599
-@@ -187,7 +187,7 @@ QEMU_TAG := xen-4.1.2-rc3
+@@ -187,7 +187,7 @@ QEMU_TAG := xen-4.1.2
# Optional components
XENSTAT_XENTOP ?= y
VTPM_TOOLS ?= n
++++++ xen-warnings-unused.diff ++++++
--- /var/tmp/diff_new_pack.HwUj1m/_old 2011-10-29 06:50:37.000000000 +0200
+++ /var/tmp/diff_new_pack.HwUj1m/_new 2011-10-29 06:50:37.000000000 +0200
@@ -1,5 +1,7 @@
---- a/tools/libxc/xc_tmem.c
-+++ b/tools/libxc/xc_tmem.c
+Index: xen-4.1.2-testing/tools/libxc/xc_tmem.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxc/xc_tmem.c
++++ xen-4.1.2-testing/tools/libxc/xc_tmem.c
@@ -390,7 +390,8 @@ static int xc_tmem_restore_new_pool(
int xc_tmem_restore(xc_interface *xch, int dom, int io_fd)
@@ -10,8 +12,10 @@
uint32_t this_max_pools, this_version;
uint32_t pool_id;
uint32_t minusone;
---- a/tools/libxc/xc_domain_restore.c
-+++ b/tools/libxc/xc_domain_restore.c
+Index: xen-4.1.2-testing/tools/libxc/xc_domain_restore.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxc/xc_domain_restore.c
++++ xen-4.1.2-testing/tools/libxc/xc_domain_restore.c
@@ -1087,7 +1087,6 @@ int xc_domain_restore(xc_interface *xch,
int vcpuextstate = 0;
uint32_t vcpuextstate_size = 0;
@@ -28,8 +32,10 @@
n = m = 0;
loadpages:
---- a/tools/misc/gtraceview.c
-+++ b/tools/misc/gtraceview.c
+Index: xen-4.1.2-testing/tools/misc/gtraceview.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/misc/gtraceview.c
++++ xen-4.1.2-testing/tools/misc/gtraceview.c
@@ -622,7 +622,8 @@ void crt_init(void)
void nr_addch(int nr, int ch)
{
@@ -40,8 +46,10 @@
getyx(stdscr, y, x);
for (i = 0; i < nr; i++) {
if (x == COLS-1)
---- a/tools/xcutils/xc_restore.c
-+++ b/tools/xcutils/xc_restore.c
+Index: xen-4.1.2-testing/tools/xcutils/xc_restore.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/xcutils/xc_restore.c
++++ xen-4.1.2-testing/tools/xcutils/xc_restore.c
@@ -19,7 +19,8 @@ int
main(int argc, char **argv)
{
@@ -52,8 +60,10 @@
xc_interface *xch;
int io_fd, ret;
int superpages;
---- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
-+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+Index: xen-4.1.2-testing/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
++++ xen-4.1.2-testing/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -1064,7 +1064,7 @@ uint32_t HashLogEvent32(struct hlei *hle
uint32_t rc = 0;
uint16_t size;
@@ -63,8 +73,10 @@
uint32_t hashdataptr;
uint32_t hashdatalen;
---- a/tools/console/client/main.c
-+++ b/tools/console/client/main.c
+Index: xen-4.1.2-testing/tools/console/client/main.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/console/client/main.c
++++ xen-4.1.2-testing/tools/console/client/main.c
@@ -277,7 +277,8 @@ int main(int argc, char **argv)
};
@@ -75,8 +87,10 @@
struct xs_handle *xs;
char *end;
console_type type = CONSOLE_INVAL;
---- a/tools/xenstat/xentop/xentop.c
-+++ b/tools/xenstat/xentop/xentop.c
+Index: xen-4.1.2-testing/tools/xenstat/xentop/xentop.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/xenstat/xentop/xentop.c
++++ xen-4.1.2-testing/tools/xenstat/xentop/xentop.c
@@ -272,7 +272,8 @@ static void fail(const char *str)
/* Return the row containing the cursor. */
static int current_row(void)
@@ -97,9 +111,11 @@
getmaxyx(stdscr, y, x);
return y;
}
---- a/tools/libxl/libxlu_cfg.c
-+++ b/tools/libxl/libxlu_cfg.c
-@@ -348,7 +348,7 @@ char *xlu__cfgl_dequote(CfgParseContext
+Index: xen-4.1.2-testing/tools/libxl/libxlu_cfg.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxlu_cfg.c
++++ xen-4.1.2-testing/tools/libxl/libxlu_cfg.c
+@@ -348,7 +348,7 @@ char *xlu__cfgl_dequote(CfgParseContext
#define NUMERIC_CHAR(minlen,maxlen,base,basetext) do{ \
char numbuf[(maxlen)+1], *ep; \
@@ -108,9 +124,11 @@
\
strncpy(numbuf,p,(maxlen)); \
numbuf[(maxlen)]= 0; \
---- a/tools/libxl/libxl.c
-+++ b/tools/libxl/libxl.c
-@@ -221,7 +221,7 @@ int libxl_domain_rename(libxl_ctx *ctx,
+Index: xen-4.1.2-testing/tools/libxl/libxl.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl.c
++++ xen-4.1.2-testing/tools/libxl/libxl.c
+@@ -221,7 +221,7 @@ int libxl_domain_rename(libxl_ctx *ctx,
int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid)
{
libxl__gc gc = LIBXL_INIT_GC(ctx);
@@ -137,8 +155,10 @@
libxl__sprintf(&gc, "%s/device/vif", dompath), &nb_nics);
if (!l)
goto err;
---- a/tools/libxl/libxl_pci.c
-+++ b/tools/libxl/libxl_pci.c
+Index: xen-4.1.2-testing/tools/libxl/libxl_pci.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl_pci.c
++++ xen-4.1.2-testing/tools/libxl/libxl_pci.c
@@ -240,7 +240,7 @@ static int libxl_create_pci_backend(libx
flexarray_t *front = NULL;
flexarray_t *back = NULL;
@@ -157,8 +177,10 @@
LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Creating pci backend");
/* add pci device */
---- a/tools/libxl/libxl_dom.c
-+++ b/tools/libxl/libxl_dom.c
+Index: xen-4.1.2-testing/tools/libxl/libxl_dom.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl_dom.c
++++ xen-4.1.2-testing/tools/libxl/libxl_dom.c
@@ -265,14 +265,13 @@ int libxl__build_hvm(libxl_ctx *ctx, uin
libxl_domain_build_info *info, libxl_domain_build_state *state)
{
@@ -183,8 +205,10 @@
out:
libxl__free_all(&gc);
return 0;
---- a/tools/libxl/libxl_utils.c
-+++ b/tools/libxl/libxl_utils.c
+Index: xen-4.1.2-testing/tools/libxl/libxl_utils.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/libxl_utils.c
++++ xen-4.1.2-testing/tools/libxl/libxl_utils.c
@@ -531,7 +531,7 @@ int libxl_devid_to_device_disk(libxl_ctx
libxl__gc gc = LIBXL_INIT_GC(ctx);
char *val;
@@ -194,8 +218,10 @@
int rc = ERROR_INVAL;
devid_n = libxl__device_disk_dev_number(devid);
---- a/tools/libxl/xl_cmdimpl.c
-+++ b/tools/libxl/xl_cmdimpl.c
+Index: xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/libxl/xl_cmdimpl.c
++++ xen-4.1.2-testing/tools/libxl/xl_cmdimpl.c
@@ -5448,7 +5448,7 @@ int main_cpupoollist(int argc, char **ar
{"cpus", 0, 0, 'c'},
{0, 0, 0, 0}
@@ -205,8 +231,10 @@
int opt_cpus = 0;
const char *pool = NULL;
libxl_cpupoolinfo *poolinfo;
---- a/tools/debugger/gdbsx/gx/gx_comm.c
-+++ b/tools/debugger/gdbsx/gx/gx_comm.c
+Index: xen-4.1.2-testing/tools/debugger/gdbsx/gx/gx_comm.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/debugger/gdbsx/gx/gx_comm.c
++++ xen-4.1.2-testing/tools/debugger/gdbsx/gx/gx_comm.c
@@ -163,7 +163,7 @@ readchar(void)
static char buf[BUFSIZ];
static int bufcnt = 0;
@@ -216,8 +244,10 @@
if (bufcnt-- > 0)
return *bufp++ & 0x7f;
---- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
-+++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
+Index: xen-4.1.2-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
++++ xen-4.1.2-testing/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
@@ -820,7 +820,7 @@ static int create_suspend_thread(checkpo
static void stop_suspend_thread(checkpoint_state* s)
@@ -227,8 +257,10 @@
s->done = 1;
---- a/tools/python/xen/lowlevel/netlink/libnetlink.c
-+++ b/tools/python/xen/lowlevel/netlink/libnetlink.c
+Index: xen-4.1.2-testing/tools/python/xen/lowlevel/netlink/libnetlink.c
+===================================================================
+--- xen-4.1.2-testing.orig/tools/python/xen/lowlevel/netlink/libnetlink.c
++++ xen-4.1.2-testing/tools/python/xen/lowlevel/netlink/libnetlink.c
@@ -433,7 +433,8 @@ int rtnl_from_file(FILE *rtnl, rtnl_filt
nladdr.nl_groups = 0;
@@ -239,8 +271,10 @@
int l;
status = fread(&buf, 1, sizeof(*h), rtnl);
---- a/xen/arch/x86/msi.c
-+++ b/xen/arch/x86/msi.c
+Index: xen-4.1.2-testing/xen/arch/x86/msi.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/msi.c
++++ xen-4.1.2-testing/xen/arch/x86/msi.c
@@ -799,7 +799,7 @@ static void __pci_disable_msi(struct msi
{
struct pci_dev *dev;
@@ -250,9 +284,11 @@
u8 bus, slot, func;
dev = entry->dev;
---- a/xen/arch/x86/microcode_amd.c
-+++ b/xen/arch/x86/microcode_amd.c
-@@ -160,7 +160,7 @@ static int apply_microcode(int cpu)
+Index: xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/microcode_amd.c
++++ xen-4.1.2-testing/xen/arch/x86/microcode_amd.c
+@@ -151,7 +151,7 @@ static int apply_microcode(int cpu)
static int get_next_ucode_from_buffer_amd(void *mc, const void *buf,
size_t size, unsigned long *offset)
{
@@ -261,8 +297,10 @@
size_t total_size;
const uint8_t *bufp = buf;
unsigned long off;
---- a/xen/common/cpupool.c
-+++ b/xen/common/cpupool.c
+Index: xen-4.1.2-testing/xen/common/cpupool.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/cpupool.c
++++ xen-4.1.2-testing/xen/common/cpupool.c
@@ -356,7 +356,7 @@ int cpupool_add_domain(struct domain *d,
{
struct cpupool *c;
@@ -283,8 +321,10 @@
if ( d->cpupool == NULL )
return;
---- a/xen/common/grant_table.c
-+++ b/xen/common/grant_table.c
+Index: xen-4.1.2-testing/xen/common/grant_table.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/grant_table.c
++++ xen-4.1.2-testing/xen/common/grant_table.c
@@ -765,7 +765,7 @@ __gnttab_unmap_common(
struct domain *ld, *rd;
struct active_grant_entry *act;
@@ -294,8 +334,10 @@
ld = current->domain;
---- a/xen/common/kexec.c
-+++ b/xen/common/kexec.c
+Index: xen-4.1.2-testing/xen/common/kexec.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/kexec.c
++++ xen-4.1.2-testing/xen/common/kexec.c
@@ -569,7 +569,8 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
{
xen_kexec_exec_t exec;
@@ -306,8 +348,10 @@
if ( unlikely(copy_from_guest(&exec, uarg, 1)) )
return -EFAULT;
---- a/xen/drivers/passthrough/vtd/intremap.c
-+++ b/xen/drivers/passthrough/vtd/intremap.c
+Index: xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/drivers/passthrough/vtd/intremap.c
++++ xen-4.1.2-testing/xen/drivers/passthrough/vtd/intremap.c
@@ -367,7 +367,7 @@ unsigned int io_apic_read_remap_rte(
unsigned int ioapic_pin = (reg - 0x10) / 2;
int index;
@@ -326,8 +370,10 @@
iommu = drhd->iommu;
qi_ctrl = iommu_qi_ctrl(iommu);
---- a/xen/common/sched_credit2.c
-+++ b/xen/common/sched_credit2.c
+Index: xen-4.1.2-testing/xen/common/sched_credit2.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/sched_credit2.c
++++ xen-4.1.2-testing/xen/common/sched_credit2.c
@@ -1854,7 +1854,8 @@ static void deactivate_runqueue(struct c
static void init_pcpu(const struct scheduler *ops, int cpu)
@@ -338,9 +384,11 @@
struct csched_private *prv = CSCHED_PRIV(ops);
struct csched_runqueue_data *rqd;
spinlock_t *old_lock;
---- a/xen/common/unlzo.c
-+++ b/xen/common/unlzo.c
-@@ -68,7 +68,7 @@ static int INIT parse_header(u8 *input,
+Index: xen-4.1.2-testing/xen/common/unlzo.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/unlzo.c
++++ xen-4.1.2-testing/xen/common/unlzo.c
+@@ -68,7 +68,7 @@ static int INIT parse_header(u8 *input,
{
int l;
u8 *parse = input;
@@ -349,8 +397,10 @@
u16 version;
/* read magic: 9 first bits */
---- a/xen/arch/x86/time.c
-+++ b/xen/arch/x86/time.c
+Index: xen-4.1.2-testing/xen/arch/x86/time.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/time.c
++++ xen-4.1.2-testing/xen/arch/x86/time.c
@@ -1009,7 +1009,8 @@ static void local_time_calibration(void)
* System timestamps, extrapolated from local and master oscillators,
* taken during this calibration and the previous calibration.
@@ -361,8 +411,10 @@
s_time_t prev_master_stime, curr_master_stime;
/* TSC timestamps taken during this calibration and prev calibration. */
---- a/xen/arch/x86/cpu/amd.c
-+++ b/xen/arch/x86/cpu/amd.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/amd.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/amd.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/amd.c
@@ -391,7 +391,7 @@ static void __devinit init_amd(struct cp
{
u32 l, h;
@@ -372,9 +424,11 @@
#ifdef CONFIG_SMP
unsigned long long value;
---- a/xen/arch/x86/mm/p2m.c
-+++ b/xen/arch/x86/mm/p2m.c
-@@ -2338,7 +2338,7 @@ p2m_remove_page(struct p2m_domain *p2m,
+Index: xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm/p2m.c
++++ xen-4.1.2-testing/xen/arch/x86/mm/p2m.c
+@@ -2338,7 +2338,7 @@ p2m_remove_page(struct p2m_domain *p2m,
unsigned int page_order)
{
unsigned long i;
@@ -392,8 +446,10 @@
int pod_count = 0;
int rc = 0;
---- a/xen/arch/x86/hvm/emulate.c
-+++ b/xen/arch/x86/hvm/emulate.c
+Index: xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/emulate.c
++++ xen-4.1.2-testing/xen/arch/x86/hvm/emulate.c
@@ -59,7 +59,7 @@ static int hvmemul_do_io(
ioreq_t *p = get_ioreq(curr);
unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
@@ -403,8 +459,10 @@
int rc;
/* Check for paged out page */
---- a/xen/arch/x86/hvm/hvm.c
-+++ b/xen/arch/x86/hvm/hvm.c
+Index: xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/hvm.c
++++ xen-4.1.2-testing/xen/arch/x86/hvm/hvm.c
@@ -253,7 +253,8 @@ void hvm_migrate_timers(struct vcpu *v)
void hvm_migrate_pirqs(struct vcpu *v)
@@ -424,8 +482,10 @@
mfn = gfn_to_mfn_unshare(p2m, pfn, &t, 0);
if ( p2m_is_paging(t) )
{
---- a/xen/arch/x86/acpi/cpu_idle.c
-+++ b/xen/arch/x86/acpi/cpu_idle.c
+Index: xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/acpi/cpu_idle.c
++++ xen-4.1.2-testing/xen/arch/x86/acpi/cpu_idle.c
@@ -275,7 +275,7 @@ static void acpi_processor_ffh_cstate_en
static void acpi_idle_do_entry(struct acpi_processor_cx *cx)
@@ -435,8 +495,10 @@
switch ( cx->entry_method )
{
---- a/xen/arch/x86/cpu/intel_cacheinfo.c
-+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/intel_cacheinfo.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/intel_cacheinfo.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -170,7 +170,8 @@ unsigned int __cpuinit init_intel_cachei
unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
@@ -447,9 +509,11 @@
if (c->cpuid_level > 3) {
static int is_initialized;
---- a/xen/arch/x86/mm/mem_sharing.c
-+++ b/xen/arch/x86/mm/mem_sharing.c
-@@ -376,7 +376,7 @@ int mem_sharing_debug_gfn(struct domain
+Index: xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm/mem_sharing.c
++++ xen-4.1.2-testing/xen/arch/x86/mm/mem_sharing.c
+@@ -375,7 +375,7 @@ int mem_sharing_debug_gfn(struct domain
{
p2m_type_t p2mt;
mfn_t mfn;
@@ -458,8 +522,10 @@
mfn = gfn_to_mfn(p2m_get_hostp2m(d), gfn, &p2mt);
page = mfn_to_page(mfn);
---- a/xen/arch/x86/hvm/viridian.c
-+++ b/xen/arch/x86/hvm/viridian.c
+Index: xen-4.1.2-testing/xen/arch/x86/hvm/viridian.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/viridian.c
++++ xen-4.1.2-testing/xen/arch/x86/hvm/viridian.c
@@ -270,7 +270,7 @@ int rdmsr_viridian_regs(uint32_t idx, ui
int viridian_hypercall(struct cpu_user_regs *regs)
{
@@ -469,9 +535,11 @@
uint16_t status = HV_STATUS_SUCCESS;
union hypercall_input {
---- a/xen/arch/x86/mm.c
-+++ b/xen/arch/x86/mm.c
-@@ -4904,7 +4904,7 @@ static int ptwr_emulated_update(
+Index: xen-4.1.2-testing/xen/arch/x86/mm.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm.c
++++ xen-4.1.2-testing/xen/arch/x86/mm.c
+@@ -4906,7 +4906,7 @@ static int ptwr_emulated_update(
{
unsigned long mfn;
unsigned long unaligned_addr = addr;
@@ -480,8 +548,10 @@
l1_pgentry_t pte, ol1e, nl1e, *pl1e;
struct vcpu *v = current;
struct domain *d = v->domain;
---- a/xen/arch/x86/x86_64/mm.c
-+++ b/xen/arch/x86/x86_64/mm.c
+Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c
++++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c
@@ -436,7 +436,8 @@ void destroy_m2p_mapping(struct mem_hota
static int setup_compat_m2p_table(struct mem_hotadd_info *info)
{
@@ -492,8 +562,10 @@
l3_pgentry_t *l3_ro_mpt = NULL;
l2_pgentry_t *l2_ro_mpt = NULL;
struct page_info *l1_pg;
---- a/xen/arch/x86/cpu/mcheck/mce.c
-+++ b/xen/arch/x86/cpu/mcheck/mce.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/mce.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/mce.c
@@ -151,7 +151,6 @@ static struct mcinfo_bank *mca_init_bank
struct mc_info *mi, int bank)
{
@@ -510,7 +582,7 @@
if (mib->mc_status & MCi_STATUS_MISCV)
mib->mc_misc = mca_rdmsr(MSR_IA32_MCx_MISC(bank));
-@@ -281,7 +279,7 @@ mctelem_cookie_t mcheck_mca_logout(enum
+@@ -281,7 +279,7 @@ mctelem_cookie_t mcheck_mca_logout(enum
recover = (mc_recoverable_scan)? 1: 0;
for (i = 0; i < 32 && i < nr_mce_banks; i++) {
@@ -528,8 +600,10 @@
uint64_t hwcr = 0;
int intpose;
int i;
---- a/xen/common/tmem.c
-+++ b/xen/common/tmem.c
+Index: xen-4.1.2-testing/xen/common/tmem.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/tmem.c
++++ xen-4.1.2-testing/xen/common/tmem.c
@@ -1351,7 +1351,8 @@ obj_unlock:
static int tmem_evict(void)
{
@@ -550,8 +624,10 @@
client_t *client = pool->client;
int ret = client->frozen ? -EFROZEN : -ENOMEM;
---- a/xen/common/tmem_xen.c
-+++ b/xen/common/tmem_xen.c
+Index: xen-4.1.2-testing/xen/common/tmem_xen.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/common/tmem_xen.c
++++ xen-4.1.2-testing/xen/common/tmem_xen.c
@@ -177,7 +177,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
EXPORT int tmh_compress_from_client(tmem_cli_mfn_t cmfn,
void **out_va, size_t *out_len, void *cli_va)
@@ -589,8 +665,10 @@
tmh->persistent_pool = xmem_pool_create(name, tmh_persistent_pool_page_get,
tmh_persistent_pool_page_put, PAGE_SIZE, 0, PAGE_SIZE);
if ( tmh->persistent_pool == NULL )
---- a/xen/arch/x86/cpu/mcheck/vmce.c
-+++ b/xen/arch/x86/cpu/mcheck/vmce.c
+Index: xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/cpu/mcheck/vmce.c
++++ xen-4.1.2-testing/xen/arch/x86/cpu/mcheck/vmce.c
@@ -574,7 +574,7 @@ int is_vmce_ready(struct mcinfo_bank *ba
*/
int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn)
@@ -600,9 +678,11 @@
struct p2m_domain *p2m;
p2m_type_t pt;
---- a/xen/arch/x86/mm/shadow/multi.c
-+++ b/xen/arch/x86/mm/shadow/multi.c
-@@ -124,7 +124,7 @@ set_shadow_status(struct vcpu *v, mfn_t
+Index: xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/mm/shadow/multi.c
++++ xen-4.1.2-testing/xen/arch/x86/mm/shadow/multi.c
+@@ -124,7 +124,7 @@ set_shadow_status(struct vcpu *v, mfn_t
/* Put a shadow into the hash table */
{
struct domain *d = v->domain;
@@ -620,8 +700,10 @@
shadow_l1e_t *sl1p, sl1e;
struct page_info *sp;
---- a/xen/arch/x86/domain_build.c
-+++ b/xen/arch/x86/domain_build.c
+Index: xen-4.1.2-testing/xen/arch/x86/domain_build.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/domain_build.c
++++ xen-4.1.2-testing/xen/arch/x86/domain_build.c
@@ -378,8 +378,7 @@ int __init construct_dom0(
return rc;
@@ -632,9 +714,11 @@
machine = elf_uval(&elf, elf.ehdr, e_machine);
switch (CONFIG_PAGING_LEVELS) {
case 3: /* x86_32p */
---- a/xen/arch/x86/traps.c
-+++ b/xen/arch/x86/traps.c
-@@ -1853,7 +1853,11 @@ static int emulate_privileged_op(struct
+Index: xen-4.1.2-testing/xen/arch/x86/traps.c
+===================================================================
+--- xen-4.1.2-testing.orig/xen/arch/x86/traps.c
++++ xen-4.1.2-testing/xen/arch/x86/traps.c
+@@ -1854,7 +1854,11 @@ static int emulate_privileged_op(struct
struct vcpu *v = current;
unsigned long *reg, eip = regs->eip;
u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0, lock = 0, rex = 0;
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package vm-install for openSUSE:12.1 checked in at 2011-10-29 06:50:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1/vm-install (Old)
and /work/SRC/openSUSE:12.1/.vm-install.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vm-install", Maintainer is "CARNOLD(a)suse.com"
Changes:
--------
--- /work/SRC/openSUSE:12.1/vm-install/vm-install.changes 2011-10-24 13:32:18.000000000 +0200
+++ /work/SRC/openSUSE:12.1/.vm-install.new/vm-install.changes 2011-10-29 06:50:16.000000000 +0200
@@ -1,0 +2,10 @@
+Wed Oct 26 14:41:12 MDT 2011 - carnold(a)novell.com
+
+- KVM: Fix for selecting autoyast file for installation
+
+-------------------------------------------------------------------
+Mon Oct 24 09:38:07 MDT 2011 - carnold(a)novell.com
+
+- Updated many language files
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vm-install-0.5.7.tar.bz2 ++++++
++++ 1981 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package vm-install for openSUSE:Factory checked in at 2011-10-29 06:50:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/vm-install (Old)
and /work/SRC/openSUSE:Factory/.vm-install.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vm-install", Maintainer is "CARNOLD(a)suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/vm-install/vm-install.changes 2011-10-19 13:52:44.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.vm-install.new/vm-install.changes 2011-10-29 06:50:15.000000000 +0200
@@ -1,0 +2,10 @@
+Wed Oct 26 14:41:12 MDT 2011 - carnold(a)novell.com
+
+- KVM: Fix for selecting autoyast file for installation
+
+-------------------------------------------------------------------
+Mon Oct 24 09:38:07 MDT 2011 - carnold(a)novell.com
+
+- Updated many language files
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vm-install-0.5.7.tar.bz2 ++++++
++++ 1981 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package tracker for openSUSE:12.1 checked in at 2011-10-29 06:50:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1/tracker (Old)
and /work/SRC/openSUSE:12.1/.tracker.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tracker", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:12.1/tracker/tracker-extras.changes 2011-10-24 13:29:50.000000000 +0200
+++ /work/SRC/openSUSE:12.1/.tracker.new/tracker-extras.changes 2011-10-29 06:50:05.000000000 +0200
@@ -1,0 +2,24 @@
+Fri Oct 28 19:39:58 UTC 2011 - vuntz(a)opensuse.org
+
+- Fix previous change: usage of X-SuSE-ControlCenter-Personal
+ actually makes the build fail. Use X-SuSE-Core-System instead.
+
+-------------------------------------------------------------------
+Fri Oct 28 14:09:18 UTC 2011 - badshah400(a)gmail.com
+
+- Replace category SystemSetup by X-SuSE-ControlCenter-Personal to
+ suppress rpmlint warnings.
+
+-------------------------------------------------------------------
+Fri Oct 28 10:17:53 UTC 2011 - badshah400(a)gmail.com
+
+- Categorise tracker-gui as System Tools using
+ %suse_update_desktop_file to replace existing categories
+ (bnc#714333)
+
+-------------------------------------------------------------------
+Fri Oct 14 15:39:40 UTC 2011 - fcrozat(a)suse.com
+
+- Only enable thunderbird support for 12.1 or later.
+
+-------------------------------------------------------------------
tracker.changes: same change
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ tracker-extras.spec ++++++
--- /var/tmp/diff_new_pack.RfqyYl/_old 2011-10-29 06:50:05.000000000 +0200
+++ /var/tmp/diff_new_pack.RfqyYl/_new 2011-10-29 06:50:05.000000000 +0200
@@ -36,7 +36,11 @@
%define build_miner_flickr 1
%define build_miner_rss 1
%define build_nautilus 1
+%if 0%{?suse_version} > 1140
%define build_thunderbird 1
+%else
+%define build_thunderbird 0
+%endif
%endif
%define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
@@ -536,7 +540,7 @@
%suse_update_desktop_file %{buildroot}%{_datadir}/tracker/miners/tracker-miner-rss.desktop
%endif
%if %{build_gui}
-%suse_update_desktop_file tracker-preferences X-SuSE-ControlCenter-Personal
+%suse_update_desktop_file -r tracker-preferences System X-SuSE-Core-System
%suse_update_desktop_file tracker-needle DesktopUtility
%endif
%if %{build_thunderbird}
++++++ tracker.spec ++++++
--- /var/tmp/diff_new_pack.RfqyYl/_old 2011-10-29 06:50:05.000000000 +0200
+++ /var/tmp/diff_new_pack.RfqyYl/_new 2011-10-29 06:50:05.000000000 +0200
@@ -36,7 +36,11 @@
%define build_miner_flickr 1
%define build_miner_rss 1
%define build_nautilus 1
+%if 0%{?suse_version} > 1140
%define build_thunderbird 1
+%else
+%define build_thunderbird 0
+%endif
%endif
%define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
@@ -534,7 +538,7 @@
%suse_update_desktop_file %{buildroot}%{_datadir}/tracker/miners/tracker-miner-rss.desktop
%endif
%if %{build_gui}
-%suse_update_desktop_file tracker-preferences X-SuSE-ControlCenter-Personal
+%suse_update_desktop_file -r tracker-preferences System X-SuSE-Core-System
%suse_update_desktop_file tracker-needle DesktopUtility
%endif
%if %{build_thunderbird}
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package tracker for openSUSE:Factory checked in at 2011-10-29 06:50:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tracker (Old)
and /work/SRC/openSUSE:Factory/.tracker.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tracker", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/tracker/tracker-extras.changes 2011-10-29 00:18:00.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.tracker.new/tracker-extras.changes 2011-10-29 06:50:03.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Oct 28 19:39:58 UTC 2011 - vuntz(a)opensuse.org
+
+- Fix previous change: usage of X-SuSE-ControlCenter-Personal
+ actually makes the build fail. Use X-SuSE-Core-System instead.
+
+-------------------------------------------------------------------
@@ -5 +11 @@
- suppress rpmlint warnings
+ suppress rpmlint warnings.
tracker.changes: same change
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ tracker-extras.spec ++++++
--- /var/tmp/diff_new_pack.dioZaI/_old 2011-10-29 06:50:04.000000000 +0200
+++ /var/tmp/diff_new_pack.dioZaI/_new 2011-10-29 06:50:04.000000000 +0200
@@ -540,7 +540,7 @@
%suse_update_desktop_file %{buildroot}%{_datadir}/tracker/miners/tracker-miner-rss.desktop
%endif
%if %{build_gui}
-%suse_update_desktop_file -r tracker-preferences System X-SuSE-ControlCenter-Personal
+%suse_update_desktop_file -r tracker-preferences System X-SuSE-Core-System
%suse_update_desktop_file tracker-needle DesktopUtility
%endif
%if %{build_thunderbird}
++++++ tracker.spec ++++++
--- /var/tmp/diff_new_pack.dioZaI/_old 2011-10-29 06:50:04.000000000 +0200
+++ /var/tmp/diff_new_pack.dioZaI/_new 2011-10-29 06:50:04.000000000 +0200
@@ -538,7 +538,7 @@
%suse_update_desktop_file %{buildroot}%{_datadir}/tracker/miners/tracker-miner-rss.desktop
%endif
%if %{build_gui}
-%suse_update_desktop_file -r tracker-preferences System X-SuSE-ControlCenter-Personal
+%suse_update_desktop_file -r tracker-preferences System X-SuSE-Core-System
%suse_update_desktop_file tracker-needle DesktopUtility
%endif
%if %{build_thunderbird}
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package gtk3 for openSUSE:12.1 checked in at 2011-10-29 06:49:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1/gtk3 (Old)
and /work/SRC/openSUSE:12.1/.gtk3.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gtk3", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:12.1/gtk3/gtk3.changes 2011-10-24 12:50:15.000000000 +0200
+++ /work/SRC/openSUSE:12.1/.gtk3.new/gtk3.changes 2011-10-29 06:49:54.000000000 +0200
@@ -1,0 +2,8 @@
+Fri Oct 28 12:50:50 UTC 2011 - vuntz(a)opensuse.org
+
+- Add gtk3-immodule-fallback.patch: make it possible to specify
+ fallback input method modules in the GTK_IM_MODULE environment
+ variable. This is useful in case a module doesn't exist for both
+ gtk2 and gtk3. Fix bnc#723382.
+
+-------------------------------------------------------------------
New:
----
gtk3-immodule-fallback.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gtk3.spec ++++++
--- /var/tmp/diff_new_pack.MNnMGr/_old 2011-10-29 06:49:55.000000000 +0200
+++ /var/tmp/diff_new_pack.MNnMGr/_new 2011-10-29 06:49:55.000000000 +0200
@@ -41,6 +41,8 @@
Patch1: gtk3-path-local.patch
# PATCH-FIX-UPSTREAM gtk3-bnc130159-bgo319483-async-font-selection.patch bnc130159 bgo319483 federico(a)novell.com - Load fonts asynchronously in GtkFontSelection to make it appear faster for CJK languages
Patch3: gtk3-bnc130159-bgo319483-async-font-selection.patch
+# PATCH-FEATURE-UPSTREAM gtk3-immodule-fallback.patch bgo#603559 bnc#723382 vuntz(a)opensuse.org -- Make it possible to specify fallback im modules in GTK_IM_MODULE; useful in case a module doesn't exist for both gtk2 and gtk3
+Patch4: gtk3-immodule-fallback.patch
BuildRequires: fdupes
BuildRequires: cups-devel
BuildRequires: pkgconfig(atk) >= 2.1.5
@@ -284,6 +286,7 @@
%endif
%patch1 -p0
%patch3 -p1
+%patch4 -p1
%build
%configure \
++++++ gtk3-immodule-fallback.patch ++++++
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 593a868..c5bd139 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -648,6 +648,26 @@ match_locale (const gchar *locale,
return 0;
}
+static const gchar *
+lookup_immodule (gchar **immodules_list)
+{
+ while (immodules_list && *immodules_list)
+ {
+ if (g_strcmp0 (*immodules_list, SIMPLE_ID) == 0)
+ return SIMPLE_ID;
+ else
+ {
+ GtkIMModule *module;
+ module = g_hash_table_lookup (contexts_hash, *immodules_list);
+ if (module)
+ return module->contexts[0]->context_id;
+ }
+ immodules_list++;
+ }
+
+ return NULL;
+}
+
/**
* _gtk_im_module_get_default_context_id:
* @client_window: a window
@@ -664,7 +684,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
const gchar *context_id = NULL;
gint best_goodness = 0;
gint i;
- gchar *tmp_locale, *tmp;
+ gchar *tmp_locale, *tmp, **immodules;
const gchar *envvar;
GdkScreen *screen;
GtkSettings *settings;
@@ -672,11 +692,16 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
if (!contexts_hash)
gtk_im_module_initialize ();
- envvar = g_getenv ("GTK_IM_MODULE");
- if (envvar &&
- (strcmp (envvar, SIMPLE_ID) == 0 ||
- g_hash_table_lookup (contexts_hash, envvar)))
- return envvar;
+ envvar = g_getenv("GTK_IM_MODULE");
+ if (envvar)
+ {
+ immodules = g_strsplit(envvar, ":", 0);
+ context_id = lookup_immodule(immodules);
+ g_strfreev(immodules);
+
+ if (context_id)
+ return context_id;
+ }
/* Check if the certain immodule is set in XSETTINGS.
*/
@@ -687,15 +712,9 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
if (tmp)
{
- if (strcmp (tmp, SIMPLE_ID) == 0)
- context_id = SIMPLE_ID;
- else
- {
- GtkIMModule *module;
- module = g_hash_table_lookup (contexts_hash, tmp);
- if (module)
- context_id = module->contexts[0]->context_id;
- }
+ immodules = g_strsplit(tmp, ":", 0);
+ context_id = lookup_immodule(immodules);
+ g_strfreev(immodules);
g_free (tmp);
if (context_id)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package gtk3 for openSUSE:Factory checked in at 2011-10-29 06:49:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gtk3 (Old)
and /work/SRC/openSUSE:Factory/.gtk3.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gtk3", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/gtk3/gtk3.changes 2011-10-16 12:50:04.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.gtk3.new/gtk3.changes 2011-10-29 06:49:51.000000000 +0200
@@ -1,0 +2,8 @@
+Fri Oct 28 12:50:50 UTC 2011 - vuntz(a)opensuse.org
+
+- Add gtk3-immodule-fallback.patch: make it possible to specify
+ fallback input method modules in the GTK_IM_MODULE environment
+ variable. This is useful in case a module doesn't exist for both
+ gtk2 and gtk3. Fix bnc#723382.
+
+-------------------------------------------------------------------
New:
----
gtk3-immodule-fallback.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gtk3.spec ++++++
--- /var/tmp/diff_new_pack.fEYKkw/_old 2011-10-29 06:49:53.000000000 +0200
+++ /var/tmp/diff_new_pack.fEYKkw/_new 2011-10-29 06:49:53.000000000 +0200
@@ -41,6 +41,8 @@
Patch1: gtk3-path-local.patch
# PATCH-FIX-UPSTREAM gtk3-bnc130159-bgo319483-async-font-selection.patch bnc130159 bgo319483 federico(a)novell.com - Load fonts asynchronously in GtkFontSelection to make it appear faster for CJK languages
Patch3: gtk3-bnc130159-bgo319483-async-font-selection.patch
+# PATCH-FEATURE-UPSTREAM gtk3-immodule-fallback.patch bgo#603559 bnc#723382 vuntz(a)opensuse.org -- Make it possible to specify fallback im modules in GTK_IM_MODULE; useful in case a module doesn't exist for both gtk2 and gtk3
+Patch4: gtk3-immodule-fallback.patch
BuildRequires: fdupes
BuildRequires: cups-devel
BuildRequires: pkgconfig(atk) >= 2.1.5
@@ -284,6 +286,7 @@
%endif
%patch1 -p0
%patch3 -p1
+%patch4 -p1
%build
%configure \
++++++ gtk3-immodule-fallback.patch ++++++
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 593a868..c5bd139 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -648,6 +648,26 @@ match_locale (const gchar *locale,
return 0;
}
+static const gchar *
+lookup_immodule (gchar **immodules_list)
+{
+ while (immodules_list && *immodules_list)
+ {
+ if (g_strcmp0 (*immodules_list, SIMPLE_ID) == 0)
+ return SIMPLE_ID;
+ else
+ {
+ GtkIMModule *module;
+ module = g_hash_table_lookup (contexts_hash, *immodules_list);
+ if (module)
+ return module->contexts[0]->context_id;
+ }
+ immodules_list++;
+ }
+
+ return NULL;
+}
+
/**
* _gtk_im_module_get_default_context_id:
* @client_window: a window
@@ -664,7 +684,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
const gchar *context_id = NULL;
gint best_goodness = 0;
gint i;
- gchar *tmp_locale, *tmp;
+ gchar *tmp_locale, *tmp, **immodules;
const gchar *envvar;
GdkScreen *screen;
GtkSettings *settings;
@@ -672,11 +692,16 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
if (!contexts_hash)
gtk_im_module_initialize ();
- envvar = g_getenv ("GTK_IM_MODULE");
- if (envvar &&
- (strcmp (envvar, SIMPLE_ID) == 0 ||
- g_hash_table_lookup (contexts_hash, envvar)))
- return envvar;
+ envvar = g_getenv("GTK_IM_MODULE");
+ if (envvar)
+ {
+ immodules = g_strsplit(envvar, ":", 0);
+ context_id = lookup_immodule(immodules);
+ g_strfreev(immodules);
+
+ if (context_id)
+ return context_id;
+ }
/* Check if the certain immodule is set in XSETTINGS.
*/
@@ -687,15 +712,9 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
if (tmp)
{
- if (strcmp (tmp, SIMPLE_ID) == 0)
- context_id = SIMPLE_ID;
- else
- {
- GtkIMModule *module;
- module = g_hash_table_lookup (contexts_hash, tmp);
- if (module)
- context_id = module->contexts[0]->context_id;
- }
+ immodules = g_strsplit(tmp, ":", 0);
+ context_id = lookup_immodule(immodules);
+ g_strfreev(immodules);
g_free (tmp);
if (context_id)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package bundle-lang-common for openSUSE:12.1 checked in at 2011-10-29 06:49:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1/bundle-lang-common (Old)
and /work/SRC/openSUSE:12.1/.bundle-lang-common.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bundle-lang-common", Maintainer is "coolo(a)suse.com"
Changes:
--------
--- /work/SRC/openSUSE:12.1/bundle-lang-common/bundle-lang-common.changes 2011-10-29 00:21:26.000000000 +0200
+++ /work/SRC/openSUSE:12.1/.bundle-lang-common.new/bundle-lang-common.changes 2011-10-29 06:49:45.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Oct 28 19:01:06 UTC 2011 - vuntz(a)opensuse.org
+
+- Update for renaming of gnome-shell-extensions-lang to
+ gnome-shell-extensions-common-lang.
+
+-------------------------------------------------------------------
bundle-lang-gnome-extras.changes: same change
bundle-lang-gnome.changes: same change
bundle-lang-kde.changes: same change
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ bundle-lang-gnome-extras.spec ++++++
--- /var/tmp/diff_new_pack.tbT13X/_old 2011-10-29 06:49:46.000000000 +0200
+++ /var/tmp/diff_new_pack.tbT13X/_new 2011-10-29 06:49:46.000000000 +0200
@@ -112,7 +112,7 @@
BuildRequires: gnote-lang
BuildRequires: gnome-themes-standard-lang
BuildRequires: gnome-subtitles-lang
-BuildRequires: gnome-shell-extensions-lang
+BuildRequires: gnome-shell-extensions-common-lang
BuildRequires: gnome-search-tool-lang
BuildRequires: gnome-schedule-lang
BuildRequires: gnome-pilot-lang
@@ -376,8 +376,8 @@
Provides: locale(gnome-schedule:en)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:en)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:en)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:en)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:en)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -726,8 +726,8 @@
Provides: locale(gnome-schedule:de)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:de)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:de)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:de)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:de)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -1076,8 +1076,8 @@
Provides: locale(gnome-schedule:es)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:es)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:es)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:es)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:es)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -1426,8 +1426,8 @@
Provides: locale(gnome-schedule:it)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:it)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:it)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:it)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:it)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -1776,8 +1776,8 @@
Provides: locale(gnome-schedule:fr)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:fr)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:fr)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:fr)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:fr)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -2126,8 +2126,8 @@
Provides: locale(gnome-schedule:ja)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:ja)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:ja)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:ja)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:ja)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -2476,8 +2476,8 @@
Provides: locale(gnome-schedule:zh)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:zh)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:zh)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:zh)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:zh)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -2826,8 +2826,8 @@
Provides: locale(gnome-schedule:nl)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:nl)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:nl)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:nl)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:nl)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -3176,8 +3176,8 @@
Provides: locale(gnome-schedule:cs)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:cs)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:cs)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:cs)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:cs)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -3605,9 +3605,9 @@
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:pt)
Provides: locale(gnome-search-tool:pt_BR)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:pt)
-Provides: locale(gnome-shell-extensions:pt_BR)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:pt)
+Provides: locale(gnome-shell-extensions-common:pt_BR)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:pt)
Provides: locale(gnome-subtitles:pt_BR)
@@ -4047,8 +4047,8 @@
Provides: locale(gnome-schedule:pl)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:pl)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:pl)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:pl)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:pl)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -4397,8 +4397,8 @@
Provides: locale(gnome-schedule:ca)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:ca)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:ca)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:ca)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:ca)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -4747,8 +4747,8 @@
Provides: locale(gnome-schedule:ar)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:ar)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:ar)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:ar)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:ar)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -5097,8 +5097,8 @@
Provides: locale(gnome-schedule:hu)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:hu)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:hu)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:hu)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:hu)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -5447,8 +5447,8 @@
Provides: locale(gnome-schedule:ko)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:ko)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:ko)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:ko)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:ko)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -5797,8 +5797,8 @@
Provides: locale(gnome-schedule:da)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:da)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:da)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:da)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:da)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -6147,8 +6147,8 @@
Provides: locale(gnome-schedule:sv)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:sv)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:sv)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:sv)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:sv)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -6497,8 +6497,8 @@
Provides: locale(gnome-schedule:ru)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:ru)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:ru)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:ru)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:ru)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -6847,8 +6847,8 @@
Provides: locale(gnome-schedule:fi)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:fi)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:fi)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:fi)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:fi)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -7197,8 +7197,8 @@
Provides: locale(gnome-schedule:nb)
Provides: gnome-search-tool-lang = %(rpm -q --queryformat '%{VERSION}' gnome-search-tool-lang)
Provides: locale(gnome-search-tool:nb)
-Provides: gnome-shell-extensions-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-lang)
-Provides: locale(gnome-shell-extensions:nb)
+Provides: gnome-shell-extensions-common-lang = %(rpm -q --queryformat '%{VERSION}' gnome-shell-extensions-common-lang)
+Provides: locale(gnome-shell-extensions-common:nb)
Provides: gnome-subtitles-lang = %(rpm -q --queryformat '%{VERSION}' gnome-subtitles-lang)
Provides: locale(gnome-subtitles:nb)
Provides: gnome-themes-standard-lang = %(rpm -q --queryformat '%{VERSION}' gnome-themes-standard-lang)
@@ -7485,7 +7485,7 @@
packages="$packages gnote-lang"
packages="$packages gnome-themes-standard-lang"
packages="$packages gnome-subtitles-lang"
-packages="$packages gnome-shell-extensions-lang"
+packages="$packages gnome-shell-extensions-common-lang"
packages="$packages gnome-search-tool-lang"
packages="$packages gnome-schedule-lang"
packages="$packages gnome-pilot-lang"
bundle-lang-kde.spec: same change
bundle-lang-other.spec: same change
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0