OBS User unknown 2008-08-17 22:24:29 +00:00 committed by Git OBS Bridge
parent f5d6338f4d
commit 8cefe055e5
67 changed files with 1102 additions and 2615 deletions

View File

@ -1,13 +1,13 @@
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1844,7 +1844,7 @@ class XendDomainInfo:
xc.domain_setmaxmem(self.domid, maxmem)
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2251,7 +2251,7 @@ class XendDomainInfo:
vtd_mem = ((vtd_mem + 1023) / 1024) * 1024
# Make sure there's enough RAM available for the domain
- balloon.free(memory + shadow)
+ balloon.free(memory + shadow + 512)
- balloon.free(memory + shadow + vtd_mem)
+ balloon.free(memory + shadow + vtd_mem + 512)
# Set up the shadow memory
shadow_cur = xc.shadow_mem_control(self.domid, shadow / 1024)

View File

@ -5,7 +5,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2586,7 +2586,7 @@ class XendDomainInfo:
@@ -2606,7 +2606,7 @@ class XendDomainInfo:
(fn, BOOTLOADER_LOOPBACK_DEVICE))
vbd = {
@ -14,23 +14,23 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
'device': BOOTLOADER_LOOPBACK_DEVICE,
}
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
Index: xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -85,9 +85,9 @@ void xenstore_parse_domain_config(int hv
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
@@ -151,9 +151,9 @@ void xenstore_parse_domain_config(int hv
{
char **e = NULL;
char *buf = NULL, *path;
- char *fpath = NULL, *bpath = NULL,
+ char *fpath = NULL, *bpath = NULL, *btype = NULL,
*dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
- int i, is_scsi, is_hdN = 0;
+ int i, is_scsi, is_tap, is_hdN = 0;
- int i, any_hdN = 0, ret;
+ int i, any_hdN = 0, ret, is_tap;
unsigned int len, num, hd_index, pci_devid = 0;
BlockDriverState *bs;
BlockDriver *format;
@@ -122,6 +122,14 @@ void xenstore_parse_domain_config(int hv
@@ -188,6 +188,14 @@ void xenstore_parse_domain_config(int hv
bpath = xs_read(xsh, XBT_NULL, buf, &len);
if (bpath == NULL)
continue;
@ -45,7 +45,7 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
/* read the name of the device */
if (pasprintf(&buf, "%s/dev", bpath) == -1)
continue;
@@ -364,6 +372,7 @@ void xenstore_parse_domain_config(int hv
@@ -429,6 +437,7 @@ void xenstore_parse_domain_config(int hv
free(type);
free(params);
free(dev);

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
@@ -503,6 +503,7 @@ static int launch_tapdisk_provider(char
@@ -474,6 +474,7 @@ static int launch_tapdisk_provider(char
return child;
}
@ -10,7 +10,7 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
static int launch_tapdisk(char *wrctldev, char *rdctldev)
{
char *argv[] = { "tapdisk", wrctldev, rdctldev, NULL };
@@ -512,6 +513,7 @@ static int launch_tapdisk(char *wrctldev
@@ -483,6 +484,7 @@ static int launch_tapdisk(char *wrctldev
return 0;
}
@ -18,7 +18,7 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
static int launch_tapdisk_ioemu(void)
{
@@ -583,6 +585,7 @@ static int connect_qemu(blkif_t *blkif,
@@ -554,6 +556,7 @@ static int connect_qemu(blkif_t *blkif,
return 0;
}
@ -26,15 +26,15 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
/* Launch tapdisk instance */
static int connect_tapdisk(blkif_t *blkif, int minor)
{
@@ -626,6 +629,7 @@ fail:
@@ -597,6 +600,7 @@ fail:
return ret;
}
+#endif
int blktapctrl_new_blkif(blkif_t *blkif)
static int blktapctrl_new_blkif(blkif_t *blkif)
{
@@ -650,6 +654,7 @@ int blktapctrl_new_blkif(blkif_t *blkif)
@@ -621,6 +625,7 @@ static int blktapctrl_new_blkif(blkif_t
blkif->cookie = next_cookie++;
if (!exist) {
@ -42,7 +42,7 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
if (type == DISK_TYPE_IOEMU) {
if (connect_qemu(blkif, blkif->domid))
goto fail;
@@ -657,6 +662,10 @@ int blktapctrl_new_blkif(blkif_t *blkif)
@@ -628,6 +633,10 @@ static int blktapctrl_new_blkif(blkif_t
if (connect_tapdisk(blkif, minor))
goto fail;
}

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/examples/block
Index: xen-3.3.0-testing/tools/examples/block
===================================================================
--- xen-3.2-testing.orig/tools/examples/block
+++ xen-3.2-testing/tools/examples/block
@@ -217,11 +217,14 @@ case "$command" in
--- xen-3.3.0-testing.orig/tools/examples/block
+++ xen-3.3.0-testing/tools/examples/block
@@ -225,11 +225,14 @@ case "$command" in
;;
file)
@ -17,7 +17,7 @@ Index: xen-3.2-testing/tools/examples/block
claim_lock "block"
@@ -330,12 +333,12 @@ mount it read-write in a guest domain."
@@ -338,12 +341,12 @@ mount it read-write in a guest domain."
fatal 'Failed to find an unused loop device'
fi

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/examples/block
Index: xen-3.3.0-testing/tools/examples/block
===================================================================
--- xen-3.2-testing.orig/tools/examples/block
+++ xen-3.2-testing/tools/examples/block
@@ -233,107 +233,111 @@ case "$command" in
--- xen-3.3.0-testing.orig/tools/examples/block
+++ xen-3.3.0-testing/tools/examples/block
@@ -241,107 +241,111 @@ case "$command" in
mount it read-write in a guest domain."
fi
@ -188,7 +188,7 @@ Index: xen-3.2-testing/tools/examples/block
xenstore_write "$XENBUS_PATH/node" "$loopdev"
write_dev "$loopdev"
release_lock "block"
@@ -356,8 +360,18 @@ mount it read-write in a guest domain."
@@ -364,8 +368,18 @@ mount it read-write in a guest domain."
file)
node=$(xenstore_read "$XENBUS_PATH/node")

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/examples/network-bridge
Index: xen-3.3.0-testing/tools/examples/network-bridge
===================================================================
--- xen-3.2-testing.orig/tools/examples/network-bridge
+++ xen-3.2-testing/tools/examples/network-bridge
@@ -230,6 +230,9 @@ op_start () {
--- xen-3.3.0-testing.orig/tools/examples/network-bridge
+++ xen-3.3.0-testing/tools/examples/network-bridge
@@ -241,6 +241,9 @@ op_start () {
return
fi
@ -12,7 +12,7 @@ Index: xen-3.2-testing/tools/examples/network-bridge
vlans=$(find_active_vlans "${netdev}")
for vlan in $vlans ; do ifdown $vlan ; done
@@ -243,13 +246,27 @@ op_start () {
@@ -254,13 +257,27 @@ op_start () {
ip link set ${netdev} down
ip addr flush ${netdev}
fi

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/examples/network-bridge
Index: xen-3.3.0-testing/tools/examples/network-bridge
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/network-bridge
+++ xen-3.2.1-testing/tools/examples/network-bridge
@@ -242,18 +242,18 @@ op_stop () {
--- xen-3.3.0-testing.orig/tools/examples/network-bridge
+++ xen-3.3.0-testing/tools/examples/network-bridge
@@ -253,18 +253,18 @@ op_stop () {
transfer_addrs ${bridge} ${pdev}
if ! ifdown ${bridge}; then
get_ip_info ${bridge}

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/examples/network-bridge
Index: xen-3.3.0-testing/tools/examples/network-bridge
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/network-bridge
+++ xen-3.2.1-testing/tools/examples/network-bridge
@@ -238,6 +238,11 @@ op_start () {
--- xen-3.3.0-testing.orig/tools/examples/network-bridge
+++ xen-3.3.0-testing/tools/examples/network-bridge
@@ -249,6 +249,11 @@ op_start () {
create_bridge ${tdev}
@ -14,7 +14,7 @@ Index: xen-3.2.1-testing/tools/examples/network-bridge
preiftransfer ${netdev}
transfer_addrs ${netdev} ${tdev}
if ! ifdown ${netdev}; then
@@ -302,6 +307,13 @@ op_stop () {
@@ -313,6 +318,13 @@ op_stop () {
ip link set ${pdev} name ${netdev}
do_ifup ${netdev}

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/examples/network-bridge
Index: xen-3.3.0-testing/tools/examples/network-bridge
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/network-bridge
+++ xen-3.2.1-testing/tools/examples/network-bridge
@@ -180,6 +180,28 @@ antispoofing () {
--- xen-3.3.0-testing.orig/tools/examples/network-bridge
+++ xen-3.3.0-testing/tools/examples/network-bridge
@@ -191,6 +191,28 @@ antispoofing () {
iptables -A FORWARD -m physdev --physdev-in ${pdev} -j ACCEPT
}
@ -31,7 +31,7 @@ Index: xen-3.2.1-testing/tools/examples/network-bridge
# Usage: show_status dev bridge
# Print ifconfig and routes.
show_status () {
@@ -208,6 +230,9 @@ op_start () {
@@ -219,6 +241,9 @@ op_start () {
return
fi
@ -41,7 +41,7 @@ Index: xen-3.2.1-testing/tools/examples/network-bridge
create_bridge ${tdev}
preiftransfer ${netdev}
@@ -226,6 +251,8 @@ op_start () {
@@ -237,6 +262,8 @@ op_start () {
add_to_bridge2 ${bridge} ${pdev}
do_ifup ${bridge}
@ -50,7 +50,7 @@ Index: xen-3.2.1-testing/tools/examples/network-bridge
if [ ${antispoof} = 'yes' ] ; then
antispoofing
fi
@@ -239,6 +266,9 @@ op_stop () {
@@ -250,6 +277,9 @@ op_stop () {
return
fi
@ -60,7 +60,7 @@ Index: xen-3.2.1-testing/tools/examples/network-bridge
transfer_addrs ${bridge} ${pdev}
if ! ifdown ${bridge}; then
get_ip_info ${bridge}
@@ -254,6 +284,8 @@ op_stop () {
@@ -265,6 +295,8 @@ op_stop () {
ip link set ${pdev} down
ip link set ${pdev} name ${netdev}
do_ifup ${netdev}

48
build-tapdisk-ioemu.patch Normal file
View File

@ -0,0 +1,48 @@
Index: xen-3.3.0-testing/tools/ioemu-remote/Makefile
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu-remote/Makefile
+++ xen-3.3.0-testing/tools/ioemu-remote/Makefile
@@ -31,13 +31,6 @@ subdir-%: libqemu_common.a
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/include
-tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c
- $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
-
#######################################################################
# BLOCK_OBJS is code used by both qemu system emulation and qemu-img
@@ -46,6 +39,16 @@ BLOCK_OBJS+=block-cow.o block-qcow.o aes
BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
BLOCK_OBJS+=block-qcow2.o block-parallels.o
+#######################################################################
+# tapdisk-ioemu
+
+tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
+tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
+tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
+tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/include
+tapdisk-ioemu: tapdisk-ioemu.c $(BLOCK_OBJS) qemu-img-block.o qemu-img-block-raw-posix.o hw/xen_blktap.c
+ $(CC) -DQEMU_TOOL -DQEMU_IMG $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
+
######################################################################
# libqemu_common.a: Target independent part of system emulation. The
# long term path is to suppress *all* target specific code in case of
Index: xen-3.3.0-testing/tools/ioemu-remote/configure
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu-remote/configure
+++ xen-3.3.0-testing/tools/ioemu-remote/configure
@@ -1150,7 +1150,7 @@ fi
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
-tools=
+tools="tapdisk-ioemu"
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
tools="qemu-img\$(EXESUF) $tools"
fi

View File

@ -1,7 +1,7 @@
Index: xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
===================================================================
--- /dev/null
+++ xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py 2008-08-12 07:36:39.000000000 -0600
@@ -0,0 +1,238 @@
+#!/usr/bin/env python
+# -*- mode: python; -*-
@ -243,8 +243,8 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
+
Index: xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
===================================================================
--- /dev/null
+++ xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py 2008-08-12 07:36:39.000000000 -0600
@@ -0,0 +1,125 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
@ -373,9 +373,9 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
+ watcher.shutdown()
Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvServer.py
+++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
@@ -56,6 +56,7 @@ from xen.web.SrvDir import SrvDir
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvServer.py 2008-08-11 12:44:35.000000000 -0600
+++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py 2008-08-12 07:36:39.000000000 -0600
@@ -56,6 +56,7 @@
from SrvRoot import SrvRoot
from XMLRPCServer import XMLRPCServer
@ -383,7 +383,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
xoptions = XendOptions.instance()
@@ -245,6 +246,8 @@ def _loadConfig(servers, root, reload):
@@ -245,6 +246,8 @@
if xoptions.get_xend_unix_xmlrpc_server():
servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False))
@ -392,28 +392,28 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
def create():
root = SrvDir()
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
Index: xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -230,6 +230,16 @@ void xenstore_parse_domain_config(int hv
*/
waitForDevice(params);
}
+ /* if pyhsical CDROM put a watch on media-present after creating it */
+ if (type && !strcmp(type, "cdrom") && drv && !strcmp(drv, "phy")) {
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
+ if (bdrv_is_inserted(bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)]))
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
+ else
+ xs_write(xsh, XBT_NULL, buf, "0", strlen("0"));
+ xs_watch(xsh, buf, "media-present");
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xenstore.c 2008-08-11 12:36:15.000000000 -0600
+++ xen-3.3.0-testing/tools/ioemu-remote/xenstore.c 2008-08-12 07:48:22.000000000 -0600
@@ -297,6 +297,16 @@
bdrv_set_type_hint(bs, BDRV_TYPE_CDROM);
if (pasprintf(&buf, "%s/params", bpath) != -1)
xs_watch(xsh, buf, dev);
+ /* if pyhsical put a watch on media-present */
+ if (drv && !strcmp(drv, "phy")) {
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
+ if (bdrv_is_inserted(bs))
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
+ else
+ xs_write(xsh, XBT_NULL, buf, "0", strlen("0"));
+ xs_watch(xsh, buf, "media-present");
+ }
+ }
+ }
}
bs = bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)] = bdrv_new(dev);
@@ -566,6 +576,50 @@ void xenstore_record_dm_state(char *stat
/* open device now if media present */
@@ -631,6 +641,50 @@
xenstore_record_dm("state", state);
}
@ -464,7 +464,7 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
void xenstore_process_event(void *opaque)
{
char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
@@ -585,6 +639,11 @@ void xenstore_process_event(void *opaque
@@ -650,6 +704,11 @@
goto out;
}
@ -476,31 +476,3 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
if (strncmp(vec[XS_WATCH_TOKEN], "hd", 2) ||
strlen(vec[XS_WATCH_TOKEN]) != 3)
goto out;
Index: xen-3.3.0-testing/tools/ioemu/hw/ide.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/ide.c
+++ xen-3.3.0-testing/tools/ioemu/hw/ide.c
@@ -361,6 +361,7 @@ typedef struct IDEState {
uint8_t *io_buffer;
QEMUTimer *sector_write_timer; /* only used for win2k instal hack */
uint32_t irq_count; /* counts IRQs when using win2k install hack */
+ uint8_t send_ua; /* send SENSE_UNIT_ATTENTION on next ready */
} IDEState;
#define BM_STATUS_DMAING 0x01
@@ -1462,8 +1463,15 @@ static void ide_atapi_cmd(IDEState *s)
ASC_MEDIUM_MAY_HAVE_CHANGED);
break;
}
+ if (s->send_ua) {
+ ide_atapi_cmd_error(s, SENSE_UNIT_ATTENTION,
+ ASC_MEDIUM_NOT_PRESENT);
+ s->send_ua = 0;
+ break;
+ }
ide_atapi_cmd_ok(s);
} else {
+ s->send_ua = 1;
ide_atapi_cmd_error(s, SENSE_NOT_READY,
ASC_MEDIUM_NOT_PRESENT);
xenstore_check_new_media_present(1000);

View File

@ -1,165 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/ia64/xen/hypercall.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/ia64/xen/hypercall.c
+++ xen-3.2.1-testing/xen/arch/ia64/xen/hypercall.c
@@ -34,9 +34,6 @@
#include <xen/perfc.h>
#include <public/arch-ia64/debug_op.h>
-extern long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg);
-extern long do_callback_op(int cmd, XEN_GUEST_HANDLE(void) arg);
-
static IA64FAULT
xen_hypercall (struct pt_regs *regs)
{
@@ -457,7 +454,7 @@ static long unregister_guest_callback(st
/* First time to add callback to xen/ia64, so let's just stick to
* the newer callback interface.
*/
-long do_callback_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+long do_callback_op(int cmd, XEN_GUEST_HANDLE(cvoid) arg)
{
long ret;
Index: xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
@@ -419,7 +419,7 @@ static long unregister_guest_callback(st
}
-long do_callback_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+long do_callback_op(int cmd, XEN_GUEST_HANDLE(cvoid) arg)
{
long ret;
Index: xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
@@ -470,7 +470,7 @@ static long unregister_guest_callback(st
}
-long do_callback_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+long do_callback_op(int cmd, XEN_GUEST_HANDLE(cvoid) arg)
{
long ret;
Index: xen-3.2.1-testing/xen/include/asm-x86/guest_access.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/guest_access.h
+++ xen-3.2.1-testing/xen/include/asm-x86/guest_access.h
@@ -34,7 +34,8 @@
*/
#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \
const typeof(*(ptr)) *_s = (ptr); \
- char (*_d)[sizeof(*_s)] = (void *)(hnd).p; \
+ void *_p = (hnd).p; \
+ char (*_d)[sizeof(*_s)] = _p; \
((void)((hnd).p == (ptr))); \
is_hvm_vcpu(current) ? \
copy_to_user_hvm(_d+(off), _s, sizeof(*_s)*(nr)) : \
@@ -82,7 +83,8 @@
#define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \
const typeof(*(ptr)) *_s = (ptr); \
- char (*_d)[sizeof(*_s)] = (void *)(hnd).p; \
+ void *_p = (hnd).p; \
+ char (*_d)[sizeof(*_s)] = _p; \
((void)((hnd).p == (ptr))); \
is_hvm_vcpu(current) ? \
copy_to_user_hvm(_d+(off), _s, sizeof(*_s)*(nr)) : \
Index: xen-3.2.1-testing/xen/include/public/arch-ia64.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/arch-ia64.h
+++ xen-3.2.1-testing/xen/include/public/arch-ia64.h
@@ -53,18 +53,7 @@
#endif
#ifndef __ASSEMBLY__
-/* Guest handles for primitive C types. */
-__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
-__DEFINE_XEN_GUEST_HANDLE(uint, unsigned int);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
-__DEFINE_XEN_GUEST_HANDLE(u64, unsigned long);
-DEFINE_XEN_GUEST_HANDLE(char);
-DEFINE_XEN_GUEST_HANDLE(int);
-DEFINE_XEN_GUEST_HANDLE(long);
-DEFINE_XEN_GUEST_HANDLE(void);
-
typedef unsigned long xen_pfn_t;
-DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
#define PRI_xen_pfn "lx"
#endif
Index: xen-3.2.1-testing/xen/include/public/arch-powerpc.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/arch-powerpc.h
+++ xen-3.2.1-testing/xen/include/public/arch-powerpc.h
@@ -49,17 +49,7 @@
#endif
#ifndef __ASSEMBLY__
-/* Guest handles for primitive C types. */
-__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
-__DEFINE_XEN_GUEST_HANDLE(uint, unsigned int);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
-DEFINE_XEN_GUEST_HANDLE(char);
-DEFINE_XEN_GUEST_HANDLE(int);
-DEFINE_XEN_GUEST_HANDLE(long);
-DEFINE_XEN_GUEST_HANDLE(void);
-
typedef unsigned long long xen_pfn_t;
-DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
#define PRI_xen_pfn "llx"
#endif
Index: xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/arch-x86/xen.h
+++ xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
@@ -55,17 +55,7 @@
#endif
#ifndef __ASSEMBLY__
-/* Guest handles for primitive C types. */
-__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
-__DEFINE_XEN_GUEST_HANDLE(uint, unsigned int);
-__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
-DEFINE_XEN_GUEST_HANDLE(char);
-DEFINE_XEN_GUEST_HANDLE(int);
-DEFINE_XEN_GUEST_HANDLE(long);
-DEFINE_XEN_GUEST_HANDLE(void);
-
typedef unsigned long xen_pfn_t;
-DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
#define PRI_xen_pfn "lx"
#endif
Index: xen-3.2.1-testing/xen/include/public/xen.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/xen.h
+++ xen-3.2.1-testing/xen/include/public/xen.h
@@ -39,6 +39,20 @@
#error "Unsupported architecture"
#endif
+#ifndef __ASSEMBLY__
+/* Guest handles for primitive C types. */
+DEFINE_XEN_GUEST_HANDLE(char);
+__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
+DEFINE_XEN_GUEST_HANDLE(int);
+__DEFINE_XEN_GUEST_HANDLE(uint, unsigned int);
+DEFINE_XEN_GUEST_HANDLE(long);
+__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
+DEFINE_XEN_GUEST_HANDLE(void);
+__DEFINE_XEN_GUEST_HANDLE(cvoid, const void);
+
+DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
+#endif
+
/*
* HYPERCALLS
*/

View File

@ -1,49 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/traps.c
@@ -49,6 +49,7 @@
#include <xen/trace.h>
#include <asm/paging.h>
#include <asm/system.h>
+#include <asm/hypercall.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/desc.h>
@@ -2884,7 +2885,7 @@ long unregister_guest_nmi_callback(void)
return 0;
}
-long do_set_trap_table(XEN_GUEST_HANDLE(trap_info_t) traps)
+long do_set_trap_table(XEN_GUEST_HANDLE(const_trap_info_t) traps)
{
struct trap_info cur;
struct vcpu *curr = current;
Index: xen-3.2.1-testing/xen/include/asm-x86/hypercall.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hypercall.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hypercall.h
@@ -32,9 +32,10 @@ extern long
do_physdev_op_compat(
XEN_GUEST_HANDLE(physdev_op_t) uop);
+__DEFINE_XEN_GUEST_HANDLE(const_trap_info_t, const trap_info_t);
extern long
do_set_trap_table(
- XEN_GUEST_HANDLE(trap_info_t) traps);
+ XEN_GUEST_HANDLE(const_trap_info_t) traps);
extern int
do_mmu_update(
Index: xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/arch-x86/xen.h
+++ xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
@@ -100,7 +100,6 @@ struct trap_info {
unsigned long address; /* code offset */
};
typedef struct trap_info trap_info_t;
-DEFINE_XEN_GUEST_HANDLE(trap_info_t);
typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */

View File

@ -1,18 +0,0 @@
Index: xen-3.2-testing/tools/ioemu/hw/ide.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/hw/ide.c
+++ xen-3.2-testing/tools/ioemu/hw/ide.c
@@ -1023,12 +1023,12 @@ static void ide_write_dma_cb(void *opaqu
/* end of transfer ? */
if (s->nsector == 0) {
+ eot:
/* Ensure the data hit disk before telling the guest OS so. */
if (!s->write_cache)
bdrv_flush(s->bs);
s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
- eot:
bm->status &= ~BM_STATUS_DMAING;
bm->status |= BM_STATUS_INT;
bm->dma_cb = NULL;

View File

@ -1,8 +1,8 @@
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -349,6 +349,15 @@ static void qemu_send_responses(void* op
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -357,6 +357,15 @@ static void qemu_send_responses(void* op
}
/**
@ -18,7 +18,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
* Callback function for the IO message pipe. Reads requests from the ring
* and processes them (call qemu read/write functions).
*
@@ -367,6 +376,7 @@ static void handle_blktap_iomsg(void* pr
@@ -375,6 +384,7 @@ static void handle_blktap_iomsg(void* pr
blkif_t *blkif = s->blkif;
tapdev_info_t *info = s->ring_info;
int page_size = getpagesize();
@ -26,7 +26,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
struct aiocb_info *aiocb_info;
@@ -399,7 +409,7 @@ static void handle_blktap_iomsg(void* pr
@@ -407,7 +417,7 @@ static void handle_blktap_iomsg(void* pr
/* Don't allow writes on readonly devices */
if ((s->flags & TD_RDONLY) &&
@ -35,7 +35,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
blkif->pending_list[idx].status = BLKIF_RSP_ERROR;
goto send_response;
}
@@ -420,7 +430,7 @@ static void handle_blktap_iomsg(void* pr
@@ -428,7 +438,7 @@ static void handle_blktap_iomsg(void* pr
DPRINTF("Sector request failed:\n");
DPRINTF("%s request, idx [%d,%d] size [%llu], "
"sector [%llu,%llu]\n",
@ -44,7 +44,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
"WRITE" : "READ"),
idx,i,
(long long unsigned)
@@ -433,8 +443,14 @@ static void handle_blktap_iomsg(void* pr
@@ -441,8 +451,14 @@ static void handle_blktap_iomsg(void* pr
blkif->pending_list[idx].secs_pending += nsects;
@ -60,7 +60,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
case BLKIF_OP_WRITE:
aiocb_info = malloc(sizeof(*aiocb_info));
@@ -454,6 +470,10 @@ static void handle_blktap_iomsg(void* pr
@@ -462,6 +478,10 @@ static void handle_blktap_iomsg(void* pr
DPRINTF("ERROR: bdrv_write() == NULL\n");
goto send_response;
}

106
ioemu-blktap-fix-open.patch Normal file
View File

@ -0,0 +1,106 @@
commit 51259318c6d40d5dd962c92c561826714361120a
Author: Kevin Wolf <kwolf@suse.de>
Date: Wed Jul 23 10:51:07 2008 +0200
qemu-xen: Fix open_disk for blktap disks
Signed-off-by: Kevin Wolf <kwolf@suse.de>
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -32,6 +32,11 @@
#include <errno.h>
#include <stdlib.h>
+#ifndef QEMU_TOOL
+#include "qemu-common.h"
+#include "sysemu.h"
+#endif
+
#include "xen_blktap.h"
#include "block_int.h"
#include "qemu-char.h"
@@ -217,13 +222,15 @@ static int map_new_dev(struct td_state *
static int open_disk(struct td_state *s, char *path, int readonly)
{
- struct disk_id id;
BlockDriverState* bs;
+ char* devname;
+ static int devnumber = 0;
+ int i;
- DPRINTF("Opening %s\n", path);
- bs = calloc(1, sizeof(*bs));
-
- memset(&id, 0, sizeof(struct disk_id));
+ DPRINTF("Opening %s as blktap%d\n", path, devnumber);
+ asprintf(&devname, "blktap%d", devnumber++);
+ bs = bdrv_new(devname);
+ free(devname);
if (bdrv_open(bs, path, 0) != 0) {
fprintf(stderr, "Could not open image file %s\n", path);
@@ -237,6 +244,18 @@ static int open_disk(struct td_state *s,
s->info = ((s->flags & TD_RDONLY) ? VDISK_READONLY : 0);
+#ifndef QEMU_TOOL
+ for (i = 0; i < MAX_DRIVES + 1; i++) {
+ if (drives_table[i].bdrv == NULL) {
+ drives_table[i].bdrv = bs;
+ drives_table[i].type = IF_BLKTAP;
+ drives_table[i].bus = 0;
+ drives_table[i].unit = 0;
+ break;
+ }
+ }
+#endif
+
return 0;
}
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.h
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.h
@@ -30,11 +30,6 @@ typedef uint32_t td_flag_t;
#define TD_RDONLY 1
-struct disk_id {
- char *name;
- int drivertype;
-};
-
/* This structure represents the state of an active virtual disk. */
struct td_state {
BlockDriverState* bs;
Index: xen-3.3.0-testing/tools/ioemu-remote/sysemu.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu-remote/sysemu.h
+++ xen-3.3.0-testing/tools/ioemu-remote/sysemu.h
@@ -116,6 +116,7 @@ extern unsigned int nb_prom_envs;
#endif
typedef enum {
+ IF_BLKTAP,
IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD
} BlockInterfaceType;
Index: xen-3.3.0-testing/tools/ioemu-remote/vl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu-remote/vl.c
+++ xen-3.3.0-testing/tools/ioemu-remote/vl.c
@@ -5414,6 +5414,9 @@ static int drive_init(struct drive_opt *
case IF_PFLASH:
case IF_MTD:
break;
+ case IF_BLKTAP:
+ /* Cannot happen - silence gcc warning */
+ break;
}
if (!file[0])
return 0;

View File

@ -23,7 +23,7 @@ Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
@@ -205,6 +205,17 @@ typedef struct msg_pid {
@@ -211,6 +211,17 @@ typedef struct msg_pid {
#define CTLMSG_PID 9
#define CTLMSG_PID_RSP 10
@ -41,29 +41,25 @@ Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
/* xenstore/xenbus: */
#define DOMNAME "Domain-0"
int setup_probe_watch(struct xs_handle *h);
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -218,21 +218,34 @@ static int map_new_dev(struct td_state *
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -222,9 +222,10 @@ static int map_new_dev(struct td_state *
return -1;
}
-static int open_disk(struct td_state *s, char *path, int readonly)
+static int open_disk(struct td_state *s, char *path, int driver, int readonly)
{
struct disk_id id;
BlockDriverState* bs;
-
-#ifndef QEMU_TOOL
+ BlockDriver* drv;
char* devname;
static int devnumber = 0;
int i;
-#endif
DPRINTF("Opening %s\n", path);
bs = bdrv_new("blktap");
memset(&id, 0, sizeof(struct disk_id));
@@ -234,7 +235,22 @@ static int open_disk(struct td_state *s,
bs = bdrv_new(devname);
free(devname);
- if (bdrv_open(bs, path, 0) != 0) {
+ /* Search for disk driver */
@ -85,7 +81,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
fprintf(stderr, "Could not open image file %s\n", path);
return -ENOMEM;
}
@@ -524,7 +537,7 @@ static void handle_blktap_ctrlmsg(void*
@@ -529,7 +545,7 @@ static void handle_blktap_ctrlmsg(void*
s = state_init();
/*Open file*/
@ -94,11 +90,11 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
msglen = sizeof(msg_hdr_t);
msg->type = CTLMSG_IMG_FAIL;
msg->len = msglen;
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.h
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.h
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.h
@@ -54,4 +54,19 @@ typedef struct fd_list_entry {
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.h
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.h
@@ -50,4 +50,19 @@ typedef struct fd_list_entry {
struct fd_list_entry **pprev, *next;
} fd_list_entry_t;

View File

@ -1,7 +1,7 @@
Index: xen-3.3.0-testing/tools/ioemu/block-qcow2.c
Index: xen-3.3.0-testing/tools/ioemu-remote/block-qcow2.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/block-qcow2.c
+++ xen-3.3.0-testing/tools/ioemu/block-qcow2.c
--- xen-3.3.0-testing.orig/tools/ioemu-remote/block-qcow2.c
+++ xen-3.3.0-testing/tools/ioemu-remote/block-qcow2.c
@@ -808,6 +808,8 @@ static void qcow_aio_read_cb(void *opaqu
BlockDriverState *bs = acb->common.bs;
BDRVQcowState *s = bs->opaque;

View File

@ -1,30 +0,0 @@
Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -261,6 +261,8 @@ class ImageHandler:
ret.append('-nographic')
return ret
+ keymap = vmConfig['platform'].get("keymap")
+
vnc_config = {}
has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
@@ -268,6 +270,8 @@ class ImageHandler:
for dev_uuid in vmConfig['console_refs']:
dev_type, dev_info = vmConfig['devices'][dev_uuid]
if dev_type == 'vfb':
+ if 'keymap' in dev_info:
+ keymap = dev_info.get('keymap',{})
vfb_type = dev_info.get('type', {})
if vfb_type == 'sdl':
self.display = dev_info.get('display', {})
@@ -279,7 +283,6 @@ class ImageHandler:
has_vnc = True
break
- keymap = vmConfig['platform'].get("keymap")
if keymap:
ret.append("-k")
ret.append(keymap)

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
@@ -855,14 +855,14 @@ static PyObject *pyxc_hvm_build(XcObject
@@ -872,14 +872,14 @@ static PyObject *pyxc_hvm_build(XcObject
int i;
#endif
char *image;
@ -21,7 +21,7 @@ Index: xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
return NULL;
if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 )
@@ -887,6 +887,7 @@ static PyObject *pyxc_hvm_build(XcObject
@@ -904,6 +904,7 @@ static PyObject *pyxc_hvm_build(XcObject
va_hvm->checksum = -sum;
munmap(va_map, XC_PAGE_SIZE);
#endif
@ -33,7 +33,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
@@ -139,6 +139,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
@@ -141,6 +141,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
'monitor': int,
'nographic': int,
'pae' : int,
@ -45,15 +45,15 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -538,6 +538,7 @@ class HVMImageHandler(ImageHandler):
@@ -697,6 +697,7 @@ class HVMImageHandler(ImageHandler):
self.apic = int(vmConfig['platform'].get('apic', 0))
self.acpi = int(vmConfig['platform'].get('acpi', 0))
+ self.extid = int(vmConfig['platform'].get('extid', 0))
self.guest_os_type = vmConfig['platform'].get('guest_os_type')
self.vmConfig = vmConfig
@@ -671,6 +672,7 @@ class HVMImageHandler(ImageHandler):
@@ -803,6 +804,7 @@ class HVMImageHandler(ImageHandler):
log.debug("store_evtchn = %d", store_evtchn)
log.debug("memsize = %d", mem_mb)
log.debug("vcpus = %d", self.vm.getVCpuCount())
@ -61,7 +61,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
log.debug("acpi = %d", self.acpi)
log.debug("apic = %d", self.apic)
@@ -678,6 +680,7 @@ class HVMImageHandler(ImageHandler):
@@ -810,6 +812,7 @@ class HVMImageHandler(ImageHandler):
image = self.loader,
memsize = mem_mb,
vcpus = self.vm.getVCpuCount(),
@ -73,7 +73,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -207,6 +207,10 @@ gopts.var('timer_mode', val='TIMER_MODE'
@@ -218,6 +218,10 @@ gopts.var('timer_mode', val='TIMER_MODE'
use="""Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time.""")
@ -84,7 +84,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
gopts.var('acpi', val='ACPI',
fn=set_int, default=1,
use="Disable or enable ACPI of HVM domain.")
@@ -760,7 +764,7 @@ def configure_vifs(config_devs, vals):
@@ -851,7 +855,7 @@ def configure_vifs(config_devs, vals):
def configure_hvm(config_image, vals):
"""Create the config for HVM devices.
"""

View File

@ -329,10 +329,10 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_64/asm-offsets.c
+
+ OFFSET(DOM_ext_vector, struct domain, arch.hvm_domain.ext_vector);
}
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/x86_64/exits.S
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/entry.S
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/x86_64/exits.S
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/x86_64/exits.S
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/entry.S
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/x86_64/entry.S
@@ -116,6 +116,14 @@ vmx_process_softirqs:
ALIGN
ENTRY(vmx_asm_do_vmentry)
@ -348,10 +348,10 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/x86_64/exits.S
cli # tests must not race interrupts
movl VCPU_processor(%rbx),%eax
Index: xen-3.2.1-testing/xen/arch/x86/hvm/svm/x86_64/exits.S
Index: xen-3.2.1-testing/xen/arch/x86/hvm/svm/entry.S
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/svm/x86_64/exits.S
+++ xen-3.2.1-testing/xen/arch/x86/hvm/svm/x86_64/exits.S
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/svm/entry.S
+++ xen-3.2.1-testing/xen/arch/x86/hvm/svm/entry.S
@@ -37,6 +37,14 @@
ENTRY(svm_asm_do_resume)

View File

@ -1,7 +1,7 @@
Index: xen-3.2-testing/unmodified_drivers/linux-2.6/mkbuildtree
Index: xen-3.3.0-testing/unmodified_drivers/linux-2.6/mkbuildtree
===================================================================
--- xen-3.2-testing.orig/unmodified_drivers/linux-2.6/mkbuildtree
+++ xen-3.2-testing/unmodified_drivers/linux-2.6/mkbuildtree
--- xen-3.3.0-testing.orig/unmodified_drivers/linux-2.6/mkbuildtree
+++ xen-3.3.0-testing/unmodified_drivers/linux-2.6/mkbuildtree
@@ -40,7 +40,7 @@ ln -sf ${XL}/drivers/xen/core/reboot.c p
mkdir -p include/asm include/xen
@ -11,10 +11,10 @@ Index: xen-3.2-testing/unmodified_drivers/linux-2.6/mkbuildtree
# Need to be quite careful here: we don't want the files we link in to
# risk overriding the native Linux ones (in particular, system.h must
Index: xen-3.2-testing/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
Index: xen-3.3.0-testing/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
===================================================================
--- xen-3.2-testing.orig/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
+++ xen-3.2-testing/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
--- xen-3.3.0-testing.orig/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
+++ xen-3.3.0-testing/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
@@ -151,7 +151,7 @@ typedef irqreturn_t (*irq_handler_t)(int
#endif
#endif
@ -24,10 +24,10 @@ Index: xen-3.2-testing/unmodified_drivers/linux-2.6/compat-include/xen/platform-
#define setup_xen_features xen_setup_features
#endif
Index: xen-3.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
Index: xen-3.3.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
===================================================================
--- xen-3.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
+++ xen-3.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
--- xen-3.3.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
+++ xen-3.3.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
@@ -119,7 +119,9 @@ void *kzalloc(size_t size, int flags)
EXPORT_SYMBOL(kzalloc);
#endif

View File

@ -1,88 +0,0 @@
Index: 2008-01-07/unmodified_drivers/linux-2.6/mkbuildtree
===================================================================
--- 2008-01-07.orig/unmodified_drivers/linux-2.6/mkbuildtree 2007-10-09 11:46:22.000000000 +0200
+++ 2008-01-07/unmodified_drivers/linux-2.6/mkbuildtree 2008-01-17 17:32:01.000000000 +0100
@@ -8,27 +8,28 @@ else
echo "This may be overridden on the command line (i386,x86_64,ia64)."
fi
-C=$PWD
+C=$(cd $(dirname $0) && pwd)
+R=${C%/*/*}
if [ -n "$XEN" -a -d "$XEN" ]; then
XEN=$(cd $XEN && pwd)
else
- XEN=$C/../../xen
+ XEN=$R/xen
fi
+echo "Xen tree: $XEN"
if [ -n "$XL" -a -d "$XL" ]; then
XL=$(cd $XL && pwd)
else
- XL=$C/../../linux-2.6.18-xen.hg
+ XL=$R/linux-2.6.18-xen.hg
fi
+echo "Linux tree: $XL"
-for d in $(find ${XL}/drivers/xen/ -maxdepth 1 -type d | sed -e 1d); do
- if ! echo $d | egrep -q back; then
- lndir $d $(basename $d) > /dev/null 2>&1
- fi
- if ! echo $d | egrep -q ball; then
- lndir $d $(basename $d) > /dev/null 2>&1
- fi
+cd $C
+
+for d in $(find ${XL}/drivers/xen/ -mindepth 1 -maxdepth 1 -type d); do
+ test -d $(basename $d) || continue
+ lndir $d $(basename $d) > /dev/null 2>&1
done
ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci
@@ -44,23 +45,27 @@ ln -nsf ${XEN}/include/public include/xe
# Need to be quite careful here: we don't want the files we link in to
# risk overriding the native Linux ones (in particular, system.h must
# be native and not xenolinux).
-case "$uname"
-in
-"x86_64")
- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypervisor.h include/asm
- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypercall.h include/asm
- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/synch_bitops.h include/asm
- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/maddr.h include/asm
- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/gnttab_dma.h include/asm
- mkdir -p include/asm-i386
- lndir -silent ${XL}/include/asm-i386 include/asm-i386
- ;;
-i[34567]86)
- ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypervisor.h include/asm
- ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypercall.h include/asm
- ln -sf ${XL}/include/asm-i386/mach-xen/asm/synch_bitops.h include/asm
- ln -sf ${XL}/include/asm-i386/mach-xen/asm/maddr.h include/asm
- ln -sf ${XL}/include/asm-i386/mach-xen/asm/gnttab_dma.h include/asm
+case "$uname" in
+i[34567]86|x86_64)
+ if [ -d ${XL}/include/asm-x86 ]; then
+ ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm
+ ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm
+ ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm
+ ln -sf ${XL}/include/asm-x86/mach-xen/asm/maddr*.h include/asm
+ ln -sf ${XL}/include/asm-x86/mach-xen/asm/gnttab_dma.h include/asm
+ else
+ if [ $uname = x86_64 ]; then
+ mkdir -p include/asm-i386
+ lndir -silent ${XL}/include/asm-i386 include/asm-i386
+ else
+ uname=i386
+ fi
+ ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypervisor.h include/asm
+ ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypercall.h include/asm
+ ln -sf ${XL}/include/asm-$uname/mach-xen/asm/synch_bitops.h include/asm
+ ln -sf ${XL}/include/asm-$uname/mach-xen/asm/maddr.h include/asm
+ ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
+ fi
;;
"ia64")
ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm

View File

@ -1,39 +0,0 @@
Index: xen-3.3.0-testing/tools/ioemu/hw/xenfb.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xenfb.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xenfb.c
@@ -1220,6 +1220,25 @@ static void xenfb_mouse_event(void *opaq
} \
}
+/* 32 bit to 16 bit pixel munging, dst algo came from RealVNC transInitTempl.h */
+#define BLT_32_16(SRC_T,DST_T,RRS,GRS,BRS,RLS,GLS,BLS,RIM,GIM,BIM,ROM,GOM,BOM) \
+ for (line = y ; line < h ; line++) { \
+ SRC_T *src = (SRC_T *)(xenfb->pixels \
+ + (line * xenfb->row_stride) \
+ + (x * xenfb->depth / 8)); \
+ DST_T *dst = (DST_T *)(xenfb->ds->data \
+ + (line * xenfb->ds->linesize) \
+ + (x * xenfb->ds->depth / 8)); \
+ int col; \
+ for (col = x ; col < w ; col++) { \
+ *dst = ((((*src >> RRS & RIM) * ROM + RIM/2) / RIM) << RLS) | \
+ ((((*src >> GRS & GIM) * GOM + GIM/2) / GIM) << GLS ) | \
+ ((((*src >> BRS & BIM) * BOM + BIM/2) / BIM) << BLS); \
+ src++; \
+ dst++; \
+ } \
+ }
+
/* This copies data from the guest framebuffer region, into QEMU's copy
* NB. QEMU's copy is stored in the pixel format of a) the local X
@@ -1258,7 +1277,7 @@ static void xenfb_guest_copy(struct xenf
if (xenfb->ds->depth == 8) {
BLT(uint32_t, uint8_t, 8, 8, 8, 3, 3, 2);
} else if (xenfb->ds->depth == 16) {
- BLT(uint32_t, uint16_t, 8, 8, 8, 5, 6, 5);
+ BLT_32_16(uint32_t, uint16_t, 16, 8, 0, 11, 5, 0, 255, 255, 255, 31, 63, 31);
} else if (xenfb->ds->depth == 32) {
BLT(uint32_t, uint32_t, 8, 8, 8, 8, 8, 8);
}

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/ioemu/hw/xen_platform.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_platform.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/hw/xen_platform.c
+++ xen-3.2-testing/tools/ioemu/hw/xen_platform.c
@@ -57,6 +57,19 @@ static void platform_ioport_write(void *
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_platform.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_platform.c
@@ -101,6 +101,19 @@ static void platform_ioport_write(void *
net_tap_shutdown_all();
fprintf(logfile, "Done.\n");
break;

View File

@ -1,10 +1,10 @@
Index: xen-3.3.0-testing/tools/ioemu/block.c
Index: xen-3.3.0-testing/tools/ioemu-remote/block.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/block.c
+++ xen-3.3.0-testing/tools/ioemu/block.c
@@ -607,6 +607,9 @@ int bdrv_write(BlockDriverState *bs, int
else
--- xen-3.3.0-testing.orig/tools/ioemu-remote/block.c
+++ xen-3.3.0-testing/tools/ioemu-remote/block.c
@@ -630,6 +630,9 @@ int bdrv_write(BlockDriverState *bs, int
return 0;
}
} else {
+ unsigned int ns = sector_num * 512;
+ if (ns < 0)
@ -12,190 +12,24 @@ Index: xen-3.3.0-testing/tools/ioemu/block.c
return drv->bdrv_write(bs, sector_num, buf, nb_sectors);
}
}
Index: xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/ne2000.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/cirrus_vga.c
+++ xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga.c
@@ -220,6 +220,20 @@
#define CIRRUS_HOOK_NOT_HANDLED 0
#define CIRRUS_HOOK_HANDLED 1
+#define BLTUNSAFE(s) \
+ ( \
+ ( /* check dst is within bounds */ \
+ (s)->cirrus_blt_height * (s)->cirrus_blt_dstpitch \
+ + ((s)->cirrus_blt_dstaddr & (s)->cirrus_addr_mask) > \
+ (s)->vram_size \
+ ) || \
+ ( /* check src is within bounds */ \
+ (s)->cirrus_blt_height * (s)->cirrus_blt_srcpitch \
+ + ((s)->cirrus_blt_srcaddr & (s)->cirrus_addr_mask) > \
+ (s)->vram_size \
+ ) \
+ )
+
struct CirrusVGAState;
typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
uint8_t * dst, const uint8_t * src,
@@ -595,7 +609,7 @@ static void cirrus_invalidate_region(Cir
for (y = 0; y < lines; y++) {
off_cur = off_begin;
- off_cur_end = off_cur + bytesperline;
+ off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask;
off_cur &= TARGET_PAGE_MASK;
while (off_cur < off_cur_end) {
cpu_physical_memory_set_dirty(s->vram_offset +
@@ -611,7 +625,11 @@ static int cirrus_bitblt_common_patternc
{
uint8_t *dst;
- dst = s->vram_ptr + s->cirrus_blt_dstaddr;
+ dst = s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
+
+ if (BLTUNSAFE(s))
+ return 0;
+
(*s->cirrus_rop) (s, dst, src,
s->cirrus_blt_dstpitch, 0,
s->cirrus_blt_width, s->cirrus_blt_height);
@@ -627,8 +645,11 @@ static int cirrus_bitblt_solidfill(Cirru
{
cirrus_fill_t rop_func;
+ if (BLTUNSAFE(s))
+ return 0;
+
rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
- rop_func(s, s->vram_ptr + s->cirrus_blt_dstaddr,
+ rop_func(s, s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
s->cirrus_blt_dstpitch,
s->cirrus_blt_width, s->cirrus_blt_height);
cirrus_invalidate_region(s, s->cirrus_blt_dstaddr,
@@ -647,8 +668,8 @@ static int cirrus_bitblt_solidfill(Cirru
static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
{
return cirrus_bitblt_common_patterncopy(s,
- s->vram_ptr +
- (s->cirrus_blt_srcaddr & ~7));
+ s->vram_ptr + ((s->cirrus_blt_srcaddr & ~7) &
+ s->cirrus_addr_mask));
}
static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
@@ -698,8 +719,10 @@ static void cirrus_do_copy(CirrusVGAStat
if (notify)
vga_hw_update();
- (*s->cirrus_rop) (s, s->vram_ptr + s->cirrus_blt_dstaddr,
- s->vram_ptr + s->cirrus_blt_srcaddr,
+ (*s->cirrus_rop) (s, s->vram_ptr +
+ (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
+ s->vram_ptr +
+ (s->cirrus_blt_srcaddr & s->cirrus_addr_mask),
s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
s->cirrus_blt_width, s->cirrus_blt_height);
@@ -725,8 +748,14 @@ static int cirrus_bitblt_videotovideo_co
s->cirrus_blt_srcaddr - s->start_addr,
s->cirrus_blt_width, s->cirrus_blt_height);
} else {
- (*s->cirrus_rop) (s, s->vram_ptr + s->cirrus_blt_dstaddr,
- s->vram_ptr + s->cirrus_blt_srcaddr,
+
+ if (BLTUNSAFE(s))
+ return 0;
+
+ (*s->cirrus_rop) (s, s->vram_ptr +
+ (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
+ s->vram_ptr +
+ (s->cirrus_blt_srcaddr & s->cirrus_addr_mask),
s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
s->cirrus_blt_width, s->cirrus_blt_height);
@@ -758,8 +787,9 @@ static void cirrus_bitblt_cputovideo_nex
} else {
/* at least one scan line */
do {
- (*s->cirrus_rop)(s, s->vram_ptr + s->cirrus_blt_dstaddr,
- s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);
+ (*s->cirrus_rop)(s, s->vram_ptr +
+ (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
+ s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);
cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,
s->cirrus_blt_width, 1);
s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;
@@ -1875,7 +1905,7 @@ static void cirrus_mem_writeb_mode4and5_
unsigned val = mem_value;
uint8_t *dst;
- dst = s->vram_ptr + offset;
+ dst = s->vram_ptr + (offset &= s->cirrus_addr_mask);
for (x = 0; x < 8; x++) {
if (val & 0x80) {
*dst = s->cirrus_shadow_gr1;
@@ -1898,7 +1928,7 @@ static void cirrus_mem_writeb_mode4and5_
unsigned val = mem_value;
uint8_t *dst;
- dst = s->vram_ptr + offset;
+ dst = s->vram_ptr + (offset &= s->cirrus_addr_mask);
for (x = 0; x < 8; x++) {
if (val & 0x80) {
*dst = s->cirrus_shadow_gr1;
Index: xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga_rop.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/cirrus_vga_rop.h
+++ xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga_rop.h
@@ -49,6 +49,12 @@ glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(C
src = src_ - src_base;
dstpitch -= bltwidth;
srcpitch -= bltwidth;
+
+ if (dstpitch < 0 || srcpitch < 0) {
+ /* is 0 valid? srcpitch == 0 could be useful */
+ return;
+ }
+
for (y = 0; y < bltheight; y++) {
for (x = 0; x < bltwidth; x++) {
ROP_OP(*(dst_base + m(dst)), *(src_base + m(src)));
Index: xen-3.3.0-testing/tools/ioemu/hw/i8259.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/i8259.c
+++ xen-3.3.0-testing/tools/ioemu/hw/i8259.c
@@ -299,9 +299,11 @@ static void pic_ioport_write(void *opaqu
s->init_state = 1;
s->init4 = val & 1;
if (val & 0x02)
- hw_error("single mode not supported");
+ /* hw_error("single mode not supported"); */
+ return;
if (val & 0x08)
- hw_error("level sensitive irq not supported");
+ /* hw_error("level sensitive irq not supported"); */
+ return;
} else if (val & 0x08) {
if (val & 0x04)
s->poll = 1;
Index: xen-3.3.0-testing/tools/ioemu/hw/ne2000.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/ne2000.c
+++ xen-3.3.0-testing/tools/ioemu/hw/ne2000.c
@@ -221,7 +221,7 @@ static int ne2000_can_receive(void *opaq
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/ne2000.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/ne2000.c
@@ -218,7 +218,7 @@ static int ne2000_can_receive(void *opaq
NE2000State *s = opaque;
if (s->cmd & E8390_STOP)
- return 1;
+ return 0;
return !ne2000_buffer_full(s);
}
Index: xen-3.3.0-testing/tools/ioemu/hw/pc.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/pc.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/pc.c
+++ xen-3.3.0-testing/tools/ioemu/hw/pc.c
@@ -313,7 +313,8 @@ void bochs_bios_write(void *opaque, uint
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/pc.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/pc.c
@@ -387,7 +387,8 @@ static void bochs_bios_write(void *opaqu
case 0x400:
case 0x401:
fprintf(stderr, "BIOS panic at rombios.c, line %d\n", val);
@ -205,7 +39,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/pc.c
case 0x402:
case 0x403:
#ifdef DEBUG_BIOS
@@ -336,8 +337,9 @@ void bochs_bios_write(void *opaque, uint
@@ -410,8 +411,9 @@ static void bochs_bios_write(void *opaqu
/* LGPL'ed VGA BIOS messages */
case 0x501:
case 0x502:
@ -216,33 +50,19 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/pc.c
case 0x500:
case 0x503:
#ifdef DEBUG_BIOS
Index: xen-3.3.0-testing/tools/ioemu/target-i386/translate.c
Index: xen-3.3.0-testing/tools/ioemu-remote/target-i386/translate.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/target-i386/translate.c
+++ xen-3.3.0-testing/tools/ioemu/target-i386/translate.c
@@ -5326,7 +5326,12 @@ static target_ulong disas_insn(DisasCont
if (CODE64(s))
goto illegal_op;
val = ldub_code(s->pc++);
- gen_op_aam(val);
+ /* taviso: operand can be zero */
+ if (val) {
+ gen_op_aam(val);
+ } else {
+ gen_exception(s, EXCP00_DIVZ, s->pc - s->cs_base);
+ }
s->cc_op = CC_OP_LOGICB;
break;
case 0xd5: /* aad */
@@ -5374,6 +5379,7 @@ static target_ulong disas_insn(DisasCont
--- xen-3.3.0-testing.orig/tools/ioemu-remote/target-i386/translate.c
+++ xen-3.3.0-testing/tools/ioemu-remote/target-i386/translate.c
@@ -5661,6 +5661,7 @@ static target_ulong disas_insn(DisasCont
gen_jmp_im(pc_start - s->cs_base);
gen_op_into(s->pc - pc_start);
break;
+#ifdef WANT_ICEBP
case 0xf1: /* icebp (undocumented, exits to external debugger) */
#if 1
gen_debug(s, pc_start - s->cs_base);
@@ -5383,6 +5389,7 @@ static target_ulong disas_insn(DisasCont
if (gen_svm_check_intercept(s, pc_start, SVM_EXIT_ICEBP))
break;
@@ -5672,6 +5673,7 @@ static target_ulong disas_insn(DisasCont
cpu_set_log(CPU_LOG_INT | CPU_LOG_TB_IN_ASM);
#endif
break;
@ -250,11 +70,11 @@ Index: xen-3.3.0-testing/tools/ioemu/target-i386/translate.c
case 0xfa: /* cli */
if (!s->vm86) {
if (s->cpl <= s->iopl) {
Index: xen-3.3.0-testing/tools/ioemu/vl.c
Index: xen-3.3.0-testing/tools/ioemu-remote/vl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -3636,8 +3636,8 @@ typedef struct NetSocketState {
--- xen-3.3.0-testing.orig/tools/ioemu-remote/vl.c
+++ xen-3.3.0-testing/tools/ioemu-remote/vl.c
@@ -4380,8 +4380,8 @@ typedef struct NetSocketState {
VLANClientState *vc;
int fd;
int state; /* 0 = getting length, 1 = getting data */
@ -265,7 +85,7 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
uint8_t buf[4096];
struct sockaddr_in dgram_dst; /* contains inet host and port destination iff connectionless (SOCK_DGRAM) */
} NetSocketState;
@@ -3668,7 +3668,8 @@ static void net_socket_receive_dgram(voi
@@ -4412,7 +4412,8 @@ static void net_socket_receive_dgram(voi
static void net_socket_send(void *opaque)
{
NetSocketState *s = opaque;
@ -275,7 +95,7 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
uint8_t buf1[4096];
const uint8_t *buf;
@@ -3707,7 +3708,15 @@ static void net_socket_send(void *opaque
@@ -4451,7 +4452,15 @@ static void net_socket_send(void *opaque
l = s->packet_len - s->index;
if (l > size)
l = size;

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/examples/Makefile
===================================================================
--- xen-3.3.0-testing.orig/tools/examples/Makefile
+++ xen-3.3.0-testing/tools/examples/Makefile
@@ -54,7 +54,7 @@ install-initd:
@@ -71,7 +71,7 @@ install-initd:
[ -d $(DESTDIR)/var/adm/fillup-templates ] || $(INSTALL_DIR) $(DESTDIR)/var/adm/fillup-templates/
$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d

View File

@ -1,7 +1,7 @@
Index: xen-unstable/tools/misc/serial-split/Makefile
Index: xen-3.3.0-testing/tools/misc/serial-split/Makefile
===================================================================
--- /dev/null
+++ xen-unstable/tools/misc/serial-split/Makefile
+++ xen-3.3.0-testing/tools/misc/serial-split/Makefile
@@ -0,0 +1,20 @@
+CC ?= gcc
+CFLAGS ?= -Wall -Os
@ -23,10 +23,10 @@ Index: xen-unstable/tools/misc/serial-split/Makefile
+
+%.o: %.c Makefile
+ $(CC) $(CFLAGS) -c -o $@ $<
Index: xen-unstable/tools/misc/serial-split/serial-split.c
Index: xen-3.3.0-testing/tools/misc/serial-split/serial-split.c
===================================================================
--- /dev/null
+++ xen-unstable/tools/misc/serial-split/serial-split.c
+++ xen-3.3.0-testing/tools/misc/serial-split/serial-split.c
@@ -0,0 +1,422 @@
+/*
+ * serial-split.c

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
@@ -334,6 +334,7 @@ static int write_msg(int fd, int msgtype
@@ -305,6 +305,7 @@ static int write_msg(int fd, int msgtype
msg_dev = (msg_newdev_t *)(buf + sizeof(msg_hdr_t));
msg_dev->devnum = blkif->minor;
msg_dev->domid = blkif->domid;
@ -14,7 +14,7 @@ Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
@@ -183,6 +183,7 @@ typedef struct msg_hdr {
@@ -189,6 +189,7 @@ typedef struct msg_hdr {
typedef struct msg_newdev {
uint8_t devnum;
uint16_t domid;
@ -22,11 +22,11 @@ Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
} msg_newdev_t;
typedef struct msg_pid {
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -65,6 +65,8 @@ int write_fd;
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -69,6 +69,8 @@ int write_fd;
static pid_t process;
fd_list_entry_t *fd_start = NULL;
@ -35,7 +35,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
static void handle_blktap_iomsg(void* private);
struct aiocb_info {
@@ -497,6 +499,10 @@ static void handle_blktap_ctrlmsg(void*
@@ -502,6 +504,10 @@ static void handle_blktap_ctrlmsg(void*
char buf[MSG_SIZE];
@ -46,7 +46,7 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
length = read(read_fd, buf, MSG_SIZE);
if (length > 0 && length >= sizeof(msg_hdr_t))
@@ -552,7 +558,18 @@ static void handle_blktap_ctrlmsg(void*
@@ -557,7 +563,18 @@ static void handle_blktap_ctrlmsg(void*
if (s != NULL) {
ret = ((map_new_dev(s, msg_dev->devnum)
== msg_dev->devnum ? 0: -1));
@ -66,23 +66,11 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
memset(buf, 0x00, MSG_SIZE);
msglen = sizeof(msg_hdr_t);
Index: xen-3.3.0-testing/tools/ioemu/vl.c
Index: xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -5233,7 +5233,6 @@ the_end:
return ret;
}
-
#else
void do_savevm(const char *name)
{
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -26,6 +26,8 @@ static QEMUTimer *insert_timer = NULL;
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
@@ -37,6 +37,8 @@ static QEMUTimer *insert_timer = NULL;
#define UWAIT_MAX (30*1000000) /* thirty seconds */
#define UWAIT (100000) /* 1/10th second */
@ -91,10 +79,10 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
static int pasprintf(char **buf, const char *fmt, ...)
{
va_list ap;
@@ -311,8 +313,17 @@ void xenstore_parse_domain_config(int hv
}
@@ -373,8 +375,17 @@ void xenstore_parse_domain_config(int hv
}
}
pstrcpy(bs->filename, sizeof(bs->filename), params);
- if (bdrv_open2(bs, params, 0 /* snapshot */, format) < 0)
+ if (bdrv_open2(bs, params, 0 /* snapshot */, format) < 0) {
fprintf(stderr, "qemu: could not open vbd '%s' or hard disk image '%s' (drv '%s' format '%s')\n", buf, params, drv ? drv : "?", format ? format->format_name : "0");
@ -108,9 +96,9 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
+ }
+ }
}
}
@@ -406,6 +417,23 @@ void xenstore_parse_domain_config(int hv
drives_table[nb_drives].bdrv = bs;
@@ -471,6 +482,23 @@ void xenstore_parse_domain_config(int hv
return;
}

View File

@ -1,21 +1,30 @@
Index: xen-3.3.0-testing/tools/ioemu/vl.c
Index: xen-3.3.0-testing/tools/ioemu-remote/xen-vl-extra.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -108,6 +108,8 @@
#include "exec-all.h"
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xen-vl-extra.c
+++ xen-3.3.0-testing/tools/ioemu-remote/xen-vl-extra.c
@@ -8,12 +8,18 @@
* there is only one place where this file is included. */
#include "qemu-xen.h"
+#include "block_int.h"
/* forward declarations of things in vl.c */
static int qemu_savevm_state(QEMUFile *f);
static int qemu_loadvm_state(QEMUFile *f);
+static int bdrv_can_snapshot(BlockDriverState *bs);
+static int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,
+ const char *name);
+
#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup"
#ifdef _BSD
#define DEFAULT_BRIDGE "bridge0"
@@ -5155,6 +5157,83 @@ void do_loadvm(const char *name)
if (saved_vm_running)
+
/* We use simpler state save/load functions for Xen */
void do_savevm(const char *name)
@@ -85,6 +91,81 @@ void do_loadvm(const char *name)
vm_start();
}
+
+int save_disk_snapshots(const char* name)
+{
+ BlockDriverState *bs;
@ -32,8 +41,8 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
+ qemu_aio_flush();
+
+ /* Ensure that all images support snapshots or are read-only */
+ for(i = 0; i < MAX_DISKS; i++) {
+ bs = bs_table[i];
+ for(i = 0; i < MAX_DRIVES; i++) {
+ bs = drives_table[i].bdrv;
+
+ if (!bs || !bs->drv)
+ continue;
@ -55,8 +64,8 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
+ sn.vm_clock_nsec = qemu_get_clock(vm_clock);
+ pstrcpy(sn.name, sizeof(sn.name), name);
+
+ for(i = 0; i < MAX_DISKS; i++) {
+ bs = bs_table[i];
+ for(i = 0; i < MAX_DRIVES; i++) {
+ bs = drives_table[i].bdrv;
+
+ /* No snapshots on read-only images */
+ if (!bs || !bs->drv || bdrv_is_read_only(bs))
@ -91,32 +100,31 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
+ return ret;
+}
+
+
#else
void do_savevm(const char *name)
{
Index: xen-3.3.0-testing/tools/ioemu/target-i386-dm/helper2.c
struct qemu_alarm_timer;
static int unix_start_timer(struct qemu_alarm_timer *t) { return 0; }
static void unix_stop_timer(struct qemu_alarm_timer *t) { }
Index: xen-3.3.0-testing/tools/ioemu-remote/i386-dm/helper2.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/target-i386-dm/helper2.c
+++ xen-3.3.0-testing/tools/ioemu/target-i386-dm/helper2.c
@@ -92,6 +92,9 @@ int send_vcpu = 0;
--- xen-3.3.0-testing.orig/tools/ioemu-remote/i386-dm/helper2.c
+++ xen-3.3.0-testing/tools/ioemu-remote/i386-dm/helper2.c
@@ -101,6 +101,9 @@ int send_vcpu = 0;
#define NR_CPUS 32
evtchn_port_t ioreq_local_port[NR_CPUS];
+/** Name of the snapshot which should be saved */
+char* snapshot_name;
+
CPUX86State *cpu_x86_init(void)
CPUX86State *cpu_x86_init(const char *cpu_model)
{
CPUX86State *env;
@@ -556,9 +559,24 @@ int main_loop(void)
@@ -574,9 +577,24 @@ int main_loop(void)
main_loop_wait(1); /* For the select() on events */
/* Save the device state */
- asprintf(&qemu_file, "/var/lib/xen/qemu-save.%d", domid);
- do_savevm(qemu_file);
- free(qemu_file);
+ switch (suspend_requested) {
+ switch (xen_pause_requested) {
+ case SUSPEND_SAVEVM:
+ asprintf(&qemu_file, "/var/lib/xen/qemu-save.%d", domid);
+ do_savevm(qemu_file);
@ -137,60 +145,55 @@ Index: xen-3.3.0-testing/tools/ioemu/target-i386-dm/helper2.c
xenstore_record_dm_state("paused");
Index: xen-3.3.0-testing/tools/ioemu/vl.h
Index: xen-3.3.0-testing/tools/ioemu-remote/qemu-xen.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.h
+++ xen-3.3.0-testing/tools/ioemu/vl.h
@@ -59,7 +59,6 @@
extern int qemu_ftruncate64(int, int64_t);
#define ftruncate qemu_ftruncate64
-
static inline char *realpath(const char *path, char *resolved_path)
{
_fullpath(resolved_path, path, _MAX_PATH);
@@ -72,6 +71,11 @@ static inline char *realpath(const char
#define PRIo64 "I64o"
#endif
--- xen-3.3.0-testing.orig/tools/ioemu-remote/qemu-xen.h
+++ xen-3.3.0-testing/tools/ioemu-remote/qemu-xen.h
@@ -14,6 +14,15 @@ void qemu_invalidate_map_cache(void)
#define mapcache_lock() ((void)0)
#define mapcache_unlock() ((void)0)
+/* Reason for xen_pause_requested */
+enum {
+ SUSPEND_SAVEVM = 1,
+ SUSPEND_SNAPSHOT = 2
+};
+
#ifdef QEMU_TOOL
/* we use QEMU_TOOL in the command line tools which do not depend on
@@ -557,6 +561,8 @@ void do_loadvm(const char *name);
void do_delvm(const char *name);
void do_info_snapshots(void);
+/* xen-vl-extra.c */
+int save_disk_snapshots(const char* name);
+
/* bottom halves */
typedef void QEMUBHFunc(void *opaque);
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
/* helper2.c */
extern long time_offset;
void timeoffset_get(void);
Index: xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -536,6 +536,7 @@ static void xenstore_process_dm_command_
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
@@ -24,6 +24,7 @@
#include "exec-all.h"
#include "sysemu.h"
+#include "qemu-xen.h"
#include "hw.h"
#include "pci.h"
@@ -598,6 +599,7 @@ static void xenstore_process_dm_command_
{
char *path = NULL, *command = NULL, *par = NULL;
unsigned int len;
extern int suspend_requested;
+ extern char* snapshot_name;
if (pasprintf(&path,
"/local/domain/0/device-model/%u/command", domid) == -1) {
@@ -548,7 +549,18 @@ static void xenstore_process_dm_command_
@@ -610,7 +612,18 @@ static void xenstore_process_dm_command_
if (!strncmp(command, "save", len)) {
fprintf(logfile, "dm-command: pause and save state\n");
- suspend_requested = 1;
+ suspend_requested = SUSPEND_SAVEVM;
- xen_pause_requested = 1;
+ xen_pause_requested = SUSPEND_SAVEVM;
+ } else if (!strncmp(command, "snapshot", len)) {
+ fprintf(logfile, "dm-command: pause and snapshot disks\n");
+ suspend_requested = SUSPEND_SNAPSHOT;
+ xen_pause_requested = SUSPEND_SNAPSHOT;
+
+ if (pasprintf(&path,
+ "/local/domain/0/device-model/%u/parameter", domid) == -1) {
@ -201,38 +204,4 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
+ snapshot_name = xs_read(xsh, XBT_NULL, path, &len);
} else if (!strncmp(command, "continue", len)) {
fprintf(logfile, "dm-command: continue after state save\n");
suspend_requested = 0;
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -221,8 +221,12 @@ static int open_disk(struct td_state *s,
struct disk_id id;
BlockDriverState* bs;
+#ifndef QEMU_TOOL
+ int i;
+#endif
+
DPRINTF("Opening %s\n", path);
- bs = calloc(1, sizeof(*bs));
+ bs = bdrv_new("blktap");
memset(&id, 0, sizeof(struct disk_id));
@@ -238,6 +242,15 @@ static int open_disk(struct td_state *s,
s->info = ((s->flags & TD_RDONLY) ? VDISK_READONLY : 0);
+#ifndef QEMU_TOOL
+ for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) {
+ if (bs_table[i] == NULL) {
+ bs_table[i] = bs;
+ break;
+ }
+ }
+#endif
+
return 0;
}
xen_pause_requested = 0;

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -481,6 +481,10 @@ class ImageHandler:
@@ -476,6 +476,10 @@ class ImageHandler:
# but this can easily lead to very rapid restart loops against
# which we currently have no protection
@ -283,10 +283,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
@@ -207,6 +207,7 @@ XENAPI_CFG_TYPES = {
'pci': str,
@@ -208,6 +208,7 @@ XENAPI_CFG_TYPES = {
'cpuid' : dict,
'cpuid_check' : dict,
'machine_address_size': int,
+ 'snapshotname': str,
}
@ -448,7 +448,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-3.3.0-testing/tools/python/xen/xm/main.py
@@ -113,6 +113,14 @@ SUBCOMMAND_HELP = {
@@ -122,6 +122,14 @@ SUBCOMMAND_HELP = {
'Restore a domain from a saved state.'),
'save' : ('[-c] <Domain> <CheckpointFile>',
'Save a domain state to restore later.'),
@ -463,7 +463,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
'shutdown' : ('<Domain> [-waRH]', 'Shutdown a domain.'),
'top' : ('', 'Monitor a host and the domains in real time.'),
'unpause' : ('<Domain>', 'Unpause a paused domain.'),
@@ -262,6 +270,9 @@ SUBCOMMAND_OPTIONS = {
@@ -278,6 +286,9 @@ SUBCOMMAND_OPTIONS = {
'save': (
('-c', '--checkpoint', 'Leave domain running after creating snapshot'),
),
@ -473,7 +473,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
'restore': (
('-p', '--paused', 'Do not unpause domain after restoring it'),
),
@@ -287,6 +298,10 @@ common_commands = [
@@ -304,6 +315,10 @@ common_commands = [
"restore",
"resume",
"save",
@ -484,7 +484,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
"shell",
"shutdown",
"start",
@@ -317,6 +332,10 @@ domain_commands = [
@@ -335,6 +350,10 @@ domain_commands = [
"restore",
"resume",
"save",
@ -495,7 +495,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
"shutdown",
"start",
"suspend",
@@ -707,6 +726,62 @@ def xm_event_monitor(args):
@@ -726,6 +745,62 @@ def xm_event_monitor(args):
#
#########################################################################
@ -558,7 +558,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
def xm_save(args):
arg_check(args, "save", 2, 3)
@@ -2600,6 +2675,10 @@ commands = {
@@ -2757,6 +2832,10 @@ commands = {
"restore": xm_restore,
"resume": xm_resume,
"save": xm_save,

View File

@ -2,10 +2,10 @@ Make our PV drivers "Novell supported modules"
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Index: xen-3.0.4-testing/unmodified_drivers/linux-2.6/Module.supported
Index: xen-3.3.0-testing/unmodified_drivers/linux-2.6/Module.supported
===================================================================
--- /dev/null
+++ xen-3.0.4-testing/unmodified_drivers/linux-2.6/Module.supported
+++ xen-3.3.0-testing/unmodified_drivers/linux-2.6/Module.supported
@@ -0,0 +1,4 @@
+xen-vbd
+xen-platform-pci

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
Index: xen-3.3.0-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
@@ -595,10 +595,11 @@ int hvm_set_efer(uint64_t value)
--- xen-3.3.0-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.3.0-testing/xen/arch/x86/hvm/hvm.c
@@ -789,10 +789,11 @@ int hvm_set_efer(uint64_t value)
value &= ~EFER_LMA;
@ -15,10 +15,10 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
(!cpu_has_ffxsr && (value & EFER_FFXSE)) )
{
gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
Index: xen-3.2.1-testing/xen/arch/x86/hvm/svm/svm.c
Index: xen-3.3.0-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/svm/svm.c
--- xen-3.3.0-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.3.0-testing/xen/arch/x86/hvm/svm/svm.c
@@ -53,6 +53,11 @@
u32 svm_feature_flags;
@ -31,7 +31,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/svm/svm.c
#define set_segment_register(name, value) \
asm volatile ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
@@ -923,6 +928,22 @@ int start_svm(struct cpuinfo_x86 *c)
@@ -853,6 +858,22 @@ int start_svm(struct cpuinfo_x86 *c)
/* Initialize core's ASID handling. */
svm_asid_init(c);
@ -54,11 +54,11 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/svm/svm.c
if ( cpu != 0 )
return 1;
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/hvm.h
Index: xen-3.3.0-testing/xen/include/asm-x86/hvm/hvm.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/hvm.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/hvm.h
@@ -127,6 +127,12 @@ struct hvm_function_table {
--- xen-3.3.0-testing.orig/xen/include/asm-x86/hvm/hvm.h
+++ xen-3.3.0-testing/xen/include/asm-x86/hvm/hvm.h
@@ -133,6 +133,12 @@ struct hvm_function_table {
extern struct hvm_function_table hvm_funcs;
extern int hvm_enabled;

View File

@ -1,26 +0,0 @@
Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
@@ -127,7 +127,7 @@ static int get_new_dev(int *major, int *
char *devname;
tr.domid = blkif->domid;
- tr.busid = blkif->be_id;
+ tr.busid = (unsigned short) blkif->be_id;
ret = ioctl(ctlfd, BLKTAP_IOCTL_NEWINTF, tr );
if ( (ret <= 0)||(ret > MAX_TAP_DEV) ) {
Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
@@ -161,7 +161,7 @@ typedef struct tapdev_info {
typedef struct domid_translate {
unsigned short domid;
- uint32_t busid;
+ unsigned short busid;
} domid_translate_t ;
typedef struct image {

View File

@ -1,60 +0,0 @@
Index: xen-3.3.0-testing/tools/ioemu/sdl_keysym.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/sdl_keysym.h
+++ xen-3.3.0-testing/tools/ioemu/sdl_keysym.h
@@ -274,5 +274,27 @@ static name2keysym_t name2keysym[]={
{"Pause", SDLK_PAUSE},
{"Escape", SDLK_ESCAPE},
+ /* dead keys */
+{"dead_grave", 0xfe50},
+{"dead_acute", 0xfe51},
+{"dead_circumflex", 0xfe52},
+{"dead_tilde", 0xfe53},
+{"dead_macron", 0xfe54},
+{"dead_brev", 0xfe55},
+{"dead_abovedot", 0xfe56},
+{"dead_diaeresis", 0xfe57},
+{"dead_abovering", 0xfe58},
+{"dead_doubleacute", 0xfe59},
+{"dead_caron", 0xfe5a},
+{"dead_cedilla", 0xfe5b},
+{"dead_ogonek", 0xfe5c},
+{"dead_iota", 0xfe5d},
+{"dead_voiced_sound", 0xfe5e},
+{"dead_semivoiced_sound", 0xfe5f},
+{"dead_belowdot", 0xfe60},
+{"dead_hook", 0xfe61},
+{"dead_horn", 0xfe62},
+
{0,0},
};
+
Index: xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendOptions.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
@@ -359,6 +359,9 @@ class XendOptions:
self.qemu_dm_logrotate_count)
+ def get_keymap(self):
+ return self.get_config_value('keymap', None)
+
class XendOptionsFile(XendOptions):
"""Default path to the config file."""
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1912,6 +1912,9 @@ class XendDomainInfo:
if devclass in XendDevices.valid_devices() and devclass != 'vscsi':
log.info("createDevice: %s : %s" % (devclass, scrub_password(config)))
dev_uuid = config.get('uuid')
+ if 'keymap' not in config:
+ if 'keymap' in self.info['platform']:
+ config['keymap'] = self.info['platform']['keymap']
devid = self._createDevice(devclass, config)
# store devid in XendConfig for caching reasons

View File

@ -1,125 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/x86_64/domain.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/domain.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/domain.c
@@ -9,11 +9,23 @@
#include <asm/hypercall.h>
#include <compat/vcpu.h>
+#define xen_vcpu_info vcpu_info
+CHECK_SIZE_(struct, vcpu_info);
+#undef xen_vcpu_info
+
+#define xen_vcpu_register_vcpu_info vcpu_register_vcpu_info
+CHECK_vcpu_register_vcpu_info;
+#undef xen_vcpu_register_vcpu_info
+
+#define xen_vcpu_get_physid vcpu_get_physid
+CHECK_vcpu_get_physid;
+#undef xen_vcpu_get_physid
+
int
arch_compat_vcpu_op(
int cmd, struct vcpu *v, XEN_GUEST_HANDLE(void) arg)
{
- long rc = 0;
+ int rc = -ENOSYS;
switch ( cmd )
{
@@ -51,8 +63,9 @@ arch_compat_vcpu_op(
break;
}
- default:
- rc = -ENOSYS;
+ case VCPUOP_register_vcpu_info:
+ case VCPUOP_get_physid:
+ rc = arch_do_vcpu_op(cmd, v, arg);
break;
}
Index: xen-3.2.1-testing/xen/common/compat/domain.c
===================================================================
--- xen-3.2.1-testing.orig/xen/common/compat/domain.c
+++ xen-3.2.1-testing/xen/common/compat/domain.c
@@ -11,11 +11,15 @@
#include <xen/hypercall.h>
#include <compat/vcpu.h>
+#define xen_vcpu_set_periodic_timer vcpu_set_periodic_timer
+CHECK_vcpu_set_periodic_timer;
+#undef xen_vcpu_set_periodic_timer
+
int compat_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE(void) arg)
{
struct domain *d = current->domain;
struct vcpu *v;
- long rc = 0;
+ int rc = 0;
if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
return -EINVAL;
@@ -57,7 +61,6 @@ int compat_vcpu_op(int cmd, int vcpuid,
case VCPUOP_is_up:
case VCPUOP_set_periodic_timer:
case VCPUOP_stop_periodic_timer:
- case VCPUOP_set_singleshot_timer:
case VCPUOP_stop_singleshot_timer:
case VCPUOP_send_nmi:
rc = do_vcpu_op(cmd, vcpuid, arg);
@@ -77,6 +80,19 @@ int compat_vcpu_op(int cmd, int vcpuid,
break;
}
+ case VCPUOP_set_singleshot_timer:
+ {
+ struct compat_vcpu_set_singleshot_timer cmp;
+ struct vcpu_set_singleshot_timer *nat;
+
+ if ( copy_from_guest(&cmp, arg, 1) )
+ return -EFAULT;
+ nat = (void *)COMPAT_ARG_XLAT_VIRT_START(current->vcpu_id);
+ XLAT_vcpu_set_singleshot_timer(nat, &cmp);
+ rc = do_vcpu_op(cmd, vcpuid, guest_handle_from_ptr(nat, void));
+ break;
+ }
+
default:
rc = arch_compat_vcpu_op(cmd, v, arg);
break;
Index: xen-3.2.1-testing/xen/include/xlat.lst
===================================================================
--- xen-3.2.1-testing.orig/xen/include/xlat.lst
+++ xen-3.2.1-testing/xen/include/xlat.lst
@@ -5,6 +5,7 @@
? mmu_update xen.h
! mmuext_op xen.h
! start_info xen.h
+? vcpu_info xen.h
? vcpu_time_info xen.h
! cpu_user_regs arch-x86/xen-@arch@.h
! trap_info arch-x86/xen.h
@@ -40,6 +41,10 @@
? sched_remote_shutdown sched.h
? sched_shutdown sched.h
? t_buf trace.h
+? vcpu_get_physid vcpu.h
+? vcpu_register_vcpu_info vcpu.h
! vcpu_runstate_info vcpu.h
+? vcpu_set_periodic_timer vcpu.h
+! vcpu_set_singleshot_timer vcpu.h
? xenoprof_init xenoprof.h
? xenoprof_passive xenoprof.h
Index: xen-3.2.1-testing/xen/tools/get-fields.sh
===================================================================
--- xen-3.2.1-testing.orig/xen/tools/get-fields.sh
+++ xen-3.2.1-testing/xen/tools/get-fields.sh
@@ -310,7 +310,6 @@ build_body ()
done
echo " \\"
echo "} while (0)"
- echo ""
}
check_field ()

View File

@ -1,70 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/domain.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/domain.c
+++ xen-3.2.1-testing/xen/arch/x86/domain.c
@@ -1709,6 +1709,23 @@ static int relinquish_memory(
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
+ y = page->u.inuse.type_info;
+
+ /*
+ * Forcibly drop reference counts of page tables above top most (which
+ * were skipped to prevent long latencies due to deep recursion - see
+ * the special treatment in free_lX_table()).
+ */
+ if ( type < PGT_root_page_table &&
+ unlikely(((y + PGT_type_mask) &
+ (PGT_type_mask|PGT_validated)) == type) ) {
+ BUG_ON((y & PGT_count_mask) >= (page->count_info & PGC_count_mask));
+ while ( y & PGT_count_mask ) {
+ put_page_and_type(page);
+ y = page->u.inuse.type_info;
+ }
+ }
+
/*
* Forcibly invalidate top-most, still valid page tables at this point
* to break circular 'linear page table' references. This is okay
@@ -1716,7 +1733,6 @@ static int relinquish_memory(
* is now dead. Thus top-most valid tables are not in use so a non-zero
* count means circular reference.
*/
- y = page->u.inuse.type_info;
for ( ; ; )
{
x = y;
@@ -1880,6 +1896,9 @@ int domain_relinquish_resources(struct d
/* fallthrough */
case RELMEM_done:
+ ret = relinquish_memory(d, &d->page_list, PGT_l1_page_table);
+ if ( ret )
+ return ret;
break;
default:
Index: xen-3.2.1-testing/xen/arch/x86/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/mm.c
@@ -1305,6 +1305,9 @@ static void free_l3_table(struct page_in
l3_pgentry_t *pl3e;
int i;
+ if(d->arch.relmem == RELMEM_dom_l3)
+ return;
+
pl3e = map_domain_page(pfn);
for ( i = 0; i < L3_PAGETABLE_ENTRIES; i++ )
@@ -1328,6 +1331,9 @@ static void free_l4_table(struct page_in
l4_pgentry_t *pl4e = page_to_virt(page);
int i;
+ if(d->arch.relmem == RELMEM_dom_l4)
+ return;
+
for ( i = 0; i < L4_PAGETABLE_ENTRIES; i++ )
if ( is_guest_l4_slot(d, i) )
put_page_from_l4e(pl4e[i], pfn);

View File

@ -1,555 +0,0 @@
The use of the domain lock in do_mmuext_op() and do_set_gdt() still needs
looking at, as do the assertions of the lock being held in
create_grant_{pte,va}_mapping().
Index: xen-3.2.1-testing/xen/arch/x86/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/mm.c
@@ -1335,6 +1335,37 @@ static void free_l4_table(struct page_in
#endif
+static void lock_page(struct page_info *page)
+{
+ unsigned long x, y;
+
+ y = page->u.inuse.type_info;
+ do {
+ for ( ; ; )
+ {
+ ASSERT(y & PGT_count_mask);
+ if (likely(y & PGT_validated) && likely(!(y & PGT_locked)))
+ break;
+ cpu_relax();
+ y = page->u.inuse.type_info;
+ }
+ x = y;
+ }
+ while ( (y = cmpxchg(&page->u.inuse.type_info, x, x | PGT_locked)) != x );
+}
+
+static void unlock_page(struct page_info *page)
+{
+ unsigned long x, y;
+
+ y = page->u.inuse.type_info;
+ do {
+ ASSERT(y & PGT_locked);
+ ASSERT(y & PGT_count_mask);
+ x = y;
+ }
+ while ( (y = cmpxchg(&page->u.inuse.type_info, x, x & ~PGT_locked)) != x );
+}
/* How to write an entry to the guest pagetables.
* Returns 0 for failure (pointer not valid), 1 for success. */
@@ -1396,24 +1427,33 @@ static int mod_l1_entry(l1_pgentry_t *pl
struct vcpu *curr = current;
struct domain *d = curr->domain;
unsigned long mfn;
+ struct page_info *l1pg = mfn_to_page(gl1mfn);
+ int rc = 1;
+
+ lock_page(l1pg);
if ( unlikely(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) != 0) )
- return 0;
+ return unlock_page(l1pg), 0;
if ( unlikely(paging_mode_refcounts(d)) )
- return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr, preserve_ad);
+ {
+ rc = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr, preserve_ad);
+ unlock_page(l1pg);
+ return rc;
+ }
if ( l1e_get_flags(nl1e) & _PAGE_PRESENT )
{
/* Translate foreign guest addresses. */
mfn = gmfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e));
if ( unlikely(mfn == INVALID_MFN) )
- return 0;
+ return unlock_page(l1pg), 0;
ASSERT((mfn & ~(PADDR_MASK >> PAGE_SHIFT)) == 0);
nl1e = l1e_from_pfn(mfn, l1e_get_flags(nl1e));
if ( unlikely(l1e_get_flags(nl1e) & l1_disallow_mask(d)) )
{
+ unlock_page(l1pg);
MEM_LOG("Bad L1 flags %x",
l1e_get_flags(nl1e) & l1_disallow_mask(d));
return 0;
@@ -1423,30 +1463,33 @@ static int mod_l1_entry(l1_pgentry_t *pl
if ( !l1e_has_changed(ol1e, nl1e, _PAGE_RW | _PAGE_PRESENT) )
{
adjust_guest_l1e(nl1e, d);
- return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
- preserve_ad);
+ rc = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
+ preserve_ad);
+ unlock_page(l1pg);
+ return rc;
}
if ( unlikely(!get_page_from_l1e(nl1e, FOREIGNDOM)) )
- return 0;
+ return unlock_page(l1pg), 0;
adjust_guest_l1e(nl1e, d);
if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
preserve_ad)) )
{
- put_page_from_l1e(nl1e, d);
- return 0;
+ ol1e = nl1e;
+ rc = 0;
}
}
- else
+ else if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
+ preserve_ad)) )
{
- if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
- preserve_ad)) )
- return 0;
+ unlock_page(l1pg);
+ return 0;
}
+ unlock_page(l1pg);
put_page_from_l1e(ol1e, d);
- return 1;
+ return rc;
}
@@ -1460,6 +1503,8 @@ static int mod_l2_entry(l2_pgentry_t *pl
l2_pgentry_t ol2e;
struct vcpu *curr = current;
struct domain *d = curr->domain;
+ struct page_info *l2pg = mfn_to_page(pfn);
+ int rc = 1;
if ( unlikely(!is_guest_l2_slot(d, type, pgentry_ptr_to_slot(pl2e))) )
{
@@ -1467,13 +1512,16 @@ static int mod_l2_entry(l2_pgentry_t *pl
return 0;
}
+ lock_page(l2pg);
+
if ( unlikely(__copy_from_user(&ol2e, pl2e, sizeof(ol2e)) != 0) )
- return 0;
+ return unlock_page(l2pg), 0;
if ( l2e_get_flags(nl2e) & _PAGE_PRESENT )
{
if ( unlikely(l2e_get_flags(nl2e) & L2_DISALLOW_MASK) )
{
+ unlock_page(l2pg);
MEM_LOG("Bad L2 flags %x",
l2e_get_flags(nl2e) & L2_DISALLOW_MASK);
return 0;
@@ -1483,28 +1531,32 @@ static int mod_l2_entry(l2_pgentry_t *pl
if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
{
adjust_guest_l2e(nl2e, d);
- return UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr, preserve_ad);
+ rc = UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr, preserve_ad);
+ unlock_page(l2pg);
+ return rc;
}
if ( unlikely(!get_page_from_l2e(nl2e, pfn, d)) )
- return 0;
+ return unlock_page(l2pg), 0;
adjust_guest_l2e(nl2e, d);
if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr,
preserve_ad)) )
{
- put_page_from_l2e(nl2e, pfn);
- return 0;
+ ol2e = nl2e;
+ rc = 0;
}
}
else if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr,
preserve_ad)) )
{
+ unlock_page(l2pg);
return 0;
}
+ unlock_page(l2pg);
put_page_from_l2e(ol2e, pfn);
- return 1;
+ return rc;
}
#if CONFIG_PAGING_LEVELS >= 3
@@ -1518,7 +1570,8 @@ static int mod_l3_entry(l3_pgentry_t *pl
l3_pgentry_t ol3e;
struct vcpu *curr = current;
struct domain *d = curr->domain;
- int okay;
+ struct page_info *l3pg = mfn_to_page(pfn);
+ int okay, rc = 1;
if ( unlikely(!is_guest_l3_slot(pgentry_ptr_to_slot(pl3e))) )
{
@@ -1535,13 +1588,16 @@ static int mod_l3_entry(l3_pgentry_t *pl
return 0;
#endif
+ lock_page(l3pg);
+
if ( unlikely(__copy_from_user(&ol3e, pl3e, sizeof(ol3e)) != 0) )
- return 0;
+ return unlock_page(l3pg), 0;
if ( l3e_get_flags(nl3e) & _PAGE_PRESENT )
{
if ( unlikely(l3e_get_flags(nl3e) & l3_disallow_mask(d)) )
{
+ unlock_page(l3pg);
MEM_LOG("Bad L3 flags %x",
l3e_get_flags(nl3e) & l3_disallow_mask(d));
return 0;
@@ -1551,23 +1607,26 @@ static int mod_l3_entry(l3_pgentry_t *pl
if ( !l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT) )
{
adjust_guest_l3e(nl3e, d);
- return UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr, preserve_ad);
+ rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr, preserve_ad);
+ unlock_page(l3pg);
+ return rc;
}
if ( unlikely(!get_page_from_l3e(nl3e, pfn, d)) )
- return 0;
+ return unlock_page(l3pg), 0;
adjust_guest_l3e(nl3e, d);
if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr,
preserve_ad)) )
{
- put_page_from_l3e(nl3e, pfn);
- return 0;
+ ol3e = nl3e;
+ rc = 0;
}
}
else if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr,
preserve_ad)) )
{
+ unlock_page(l3pg);
return 0;
}
@@ -1576,8 +1635,9 @@ static int mod_l3_entry(l3_pgentry_t *pl
pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
+ unlock_page(l3pg);
put_page_from_l3e(ol3e, pfn);
- return 1;
+ return rc;
}
#endif
@@ -1593,6 +1653,8 @@ static int mod_l4_entry(l4_pgentry_t *pl
struct vcpu *curr = current;
struct domain *d = curr->domain;
l4_pgentry_t ol4e;
+ struct page_info *l4pg = mfn_to_page(pfn);
+ int rc = 1;
if ( unlikely(!is_guest_l4_slot(d, pgentry_ptr_to_slot(pl4e))) )
{
@@ -1600,13 +1662,16 @@ static int mod_l4_entry(l4_pgentry_t *pl
return 0;
}
+ lock_page(l4pg);
+
if ( unlikely(__copy_from_user(&ol4e, pl4e, sizeof(ol4e)) != 0) )
- return 0;
+ return unlock_page(l4pg), 0;
if ( l4e_get_flags(nl4e) & _PAGE_PRESENT )
{
if ( unlikely(l4e_get_flags(nl4e) & L4_DISALLOW_MASK) )
{
+ unlock_page(l4pg);
MEM_LOG("Bad L4 flags %x",
l4e_get_flags(nl4e) & L4_DISALLOW_MASK);
return 0;
@@ -1616,28 +1681,32 @@ static int mod_l4_entry(l4_pgentry_t *pl
if ( !l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT) )
{
adjust_guest_l4e(nl4e, d);
- return UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr, preserve_ad);
+ rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr, preserve_ad);
+ unlock_page(l4pg);
+ return rc;
}
if ( unlikely(!get_page_from_l4e(nl4e, pfn, d)) )
- return 0;
+ return unlock_page(l4pg), 0;
adjust_guest_l4e(nl4e, d);
if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr,
preserve_ad)) )
{
- put_page_from_l4e(nl4e, pfn);
- return 0;
+ ol4e = nl4e;
+ rc = 0;
}
}
else if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr,
preserve_ad)) )
{
+ unlock_page(l4pg);
return 0;
}
+ unlock_page(l4pg);
put_page_from_l4e(ol4e, pfn);
- return 1;
+ return rc;
}
#endif
@@ -2460,8 +2529,6 @@ int do_mmu_update(
domain_mmap_cache_init(&mapcache);
- LOCK_BIGLOCK(d);
-
for ( i = 0; i < count; i++ )
{
if ( hypercall_preempt_check() )
@@ -2632,8 +2699,6 @@ int do_mmu_update(
process_deferred_ops();
- UNLOCK_BIGLOCK(d);
-
domain_mmap_cache_destroy(&mapcache);
perfc_add(num_page_updates, i);
@@ -2686,14 +2751,19 @@ static int create_grant_pte_mapping(
goto failed;
}
+ lock_page(page);
+
ol1e = *(l1_pgentry_t *)va;
if ( !UPDATE_ENTRY(l1, (l1_pgentry_t *)va, ol1e, nl1e, mfn, v, 0) )
{
+ unlock_page(page);
put_page_type(page);
rc = GNTST_general_error;
goto failed;
}
+ unlock_page(page);
+
if ( !paging_mode_refcounts(d) )
put_page_from_l1e(ol1e, d);
@@ -2737,16 +2807,14 @@ static int destroy_grant_pte_mapping(
goto failed;
}
- if ( __copy_from_user(&ol1e, (l1_pgentry_t *)va, sizeof(ol1e)) )
- {
- put_page_type(page);
- rc = GNTST_general_error;
- goto failed;
- }
+ lock_page(page);
+
+ ol1e = *(l1_pgentry_t *)va;
/* Check that the virtual address supplied is actually mapped to frame. */
if ( unlikely((l1e_get_intpte(ol1e) >> PAGE_SHIFT) != frame) )
{
+ unlock_page(page);
MEM_LOG("PTE entry %lx for address %"PRIx64" doesn't match frame %lx",
(unsigned long)l1e_get_intpte(ol1e), addr, frame);
put_page_type(page);
@@ -2761,12 +2829,14 @@ static int destroy_grant_pte_mapping(
d->vcpu[0] /* Change if we go to per-vcpu shadows. */,
0)) )
{
+ unlock_page(page);
MEM_LOG("Cannot delete PTE entry at %p", va);
put_page_type(page);
rc = GNTST_general_error;
goto failed;
}
+ unlock_page(page);
put_page_type(page);
failed:
@@ -2782,6 +2852,7 @@ static int create_grant_va_mapping(
l1_pgentry_t *pl1e, ol1e;
struct domain *d = v->domain;
unsigned long gl1mfn;
+ struct page_info *l1pg;
int okay;
ASSERT(spin_is_locked(&d->big_lock));
@@ -2794,8 +2865,11 @@ static int create_grant_va_mapping(
MEM_LOG("Could not find L1 PTE for address %lx", va);
return GNTST_general_error;
}
+ l1pg = mfn_to_page(gl1mfn);
+ lock_page(l1pg);
ol1e = *pl1e;
okay = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v, 0);
+ unlock_page(l1pg);
guest_unmap_l1e(v, pl1e);
pl1e = NULL;
@@ -2813,6 +2887,7 @@ static int replace_grant_va_mapping(
{
l1_pgentry_t *pl1e, ol1e;
unsigned long gl1mfn;
+ struct page_info *l1pg;
int rc = 0;
pl1e = guest_map_l1e(v, addr, &gl1mfn);
@@ -2821,11 +2896,15 @@ static int replace_grant_va_mapping(
MEM_LOG("Could not find L1 PTE for address %lx", addr);
return GNTST_general_error;
}
+
+ l1pg = mfn_to_page(gl1mfn);
+ lock_page(l1pg);
ol1e = *pl1e;
/* Check that the virtual address supplied is actually mapped to frame. */
if ( unlikely(l1e_get_pfn(ol1e) != frame) )
{
+ unlock_page(l1pg);
MEM_LOG("PTE entry %lx for address %lx doesn't match frame %lx",
l1e_get_pfn(ol1e), addr, frame);
rc = GNTST_general_error;
@@ -2835,11 +2914,14 @@ static int replace_grant_va_mapping(
/* Delete pagetable entry. */
if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v, 0)) )
{
+ unlock_page(l1pg);
MEM_LOG("Cannot delete PTE entry at %p", (unsigned long *)pl1e);
rc = GNTST_general_error;
goto out;
}
+ unlock_page(l1pg);
+
out:
guest_unmap_l1e(v, pl1e);
return rc;
@@ -2874,6 +2956,7 @@ int replace_grant_host_mapping(
struct vcpu *curr = current;
l1_pgentry_t *pl1e, ol1e;
unsigned long gl1mfn;
+ struct page_info *l1pg;
int rc;
if ( flags & GNTMAP_contains_pte )
@@ -2895,16 +2978,21 @@ int replace_grant_host_mapping(
(unsigned long)new_addr);
return GNTST_general_error;
}
+
+ l1pg = mfn_to_page(gl1mfn);
+ lock_page(l1pg);
ol1e = *pl1e;
if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, l1e_empty(),
gl1mfn, curr, 0)) )
{
+ unlock_page(l1pg);
MEM_LOG("Cannot delete PTE entry at %p", (unsigned long *)pl1e);
guest_unmap_l1e(curr, pl1e);
return GNTST_general_error;
}
+ unlock_page(l1pg);
guest_unmap_l1e(curr, pl1e);
rc = replace_grant_va_mapping(addr, frame, ol1e, curr);
@@ -2982,8 +3070,6 @@ int do_update_va_mapping(unsigned long v
if ( rc )
return rc;
- LOCK_BIGLOCK(d);
-
pl1e = guest_map_l1e(v, va, &gl1mfn);
if ( unlikely(!pl1e || !mod_l1_entry(pl1e, val, gl1mfn, 0)) )
@@ -2995,8 +3081,6 @@ int do_update_va_mapping(unsigned long v
process_deferred_ops();
- UNLOCK_BIGLOCK(d);
-
switch ( flags & UVMF_FLUSHTYPE_MASK )
{
case UVMF_TLB_FLUSH:
@@ -3632,8 +3716,6 @@ int ptwr_do_page_fault(struct vcpu *v, u
struct ptwr_emulate_ctxt ptwr_ctxt;
int rc;
- LOCK_BIGLOCK(d);
-
/* Attempt to read the PTE that maps the VA being accessed. */
guest_get_eff_l1e(v, addr, &pte);
page = l1e_get_page(pte);
@@ -3652,16 +3734,16 @@ int ptwr_do_page_fault(struct vcpu *v, u
ptwr_ctxt.cr2 = addr;
ptwr_ctxt.pte = pte;
+ lock_page(page);
rc = x86_emulate(&ptwr_ctxt.ctxt, &ptwr_emulate_ops);
+ unlock_page(page);
if ( rc == X86EMUL_UNHANDLEABLE )
goto bail;
- UNLOCK_BIGLOCK(d);
perfc_incr(ptwr_emulations);
return EXCRET_fault_fixed;
bail:
- UNLOCK_BIGLOCK(d);
return 0;
}
Index: xen-3.2.1-testing/xen/include/asm-x86/mm.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/mm.h
+++ xen-3.2.1-testing/xen/include/asm-x86/mm.h
@@ -83,9 +83,12 @@ struct page_info
/* PAE only: is this an L2 page directory containing Xen-private mappings? */
#define _PGT_pae_xen_l2 26
#define PGT_pae_xen_l2 (1U<<_PGT_pae_xen_l2)
+ /* The page is currently locked for modification. */
+#define _PGT_locked 25
+#define PGT_locked (1U<<_PGT_locked)
- /* 26-bit count of uses of this frame as its current type. */
-#define PGT_count_mask ((1U<<26)-1)
+ /* 25-bit count of uses of this frame as its current type. */
+#define PGT_count_mask ((1U<<25)-1)
/* Cleared when the owning guest 'frees' this page. */
#define _PGC_allocated 31

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/xen/arch/x86/traps.c
Index: xen-3.3.0-testing/xen/arch/x86/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/traps.c
@@ -1187,6 +1187,7 @@ asmlinkage void do_early_page_fault(stru
--- xen-3.3.0-testing.orig/xen/arch/x86/traps.c
+++ xen-3.3.0-testing/xen/arch/x86/traps.c
@@ -1261,6 +1261,7 @@ asmlinkage void do_early_page_fault(stru
unsigned long *stk = (unsigned long *)regs;
printk("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n",
regs->cs, _p(regs->eip), _p(cr2), regs->error_code);
@ -10,11 +10,11 @@ Index: xen-3.2.1-testing/xen/arch/x86/traps.c
printk("Stack dump: ");
while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
printk("%p ", _p(*stk++));
Index: xen-3.2.1-testing/xen/arch/x86/x86_32/mm.c
Index: xen-3.3.0-testing/xen/arch/x86/x86_32/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_32/mm.c
@@ -41,6 +41,7 @@ l2_pgentry_t __attribute__ ((__section__
--- xen-3.3.0-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-3.3.0-testing/xen/arch/x86/x86_32/mm.c
@@ -38,6 +38,7 @@ extern l1_pgentry_t l1_identmap[L1_PAGET
unsigned int PAGE_HYPERVISOR = __PAGE_HYPERVISOR;
unsigned int PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
@ -22,7 +22,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_32/mm.c
static unsigned long mpt_size;
void *alloc_xen_pagetable(void)
@@ -112,6 +113,8 @@ void __init paging_init(void)
@@ -105,6 +106,8 @@ void __init paging_init(void)
pg, (__PAGE_HYPERVISOR | _PAGE_PSE) & ~_PAGE_RW));
}
@ -31,11 +31,11 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_32/mm.c
/* Fill with an obvious debug pattern. */
for ( i = 0; i < (mpt_size / BYTES_PER_LONG); i++)
set_gpfn_from_mfn(i, 0x55555555);
Index: xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
Index: xen-3.3.0-testing/xen/arch/x86/x86_32/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
@@ -132,7 +132,8 @@ void show_page_walk(unsigned long addr)
--- xen-3.3.0-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-3.3.0-testing/xen/arch/x86/x86_32/traps.c
@@ -160,7 +160,8 @@ void show_page_walk(unsigned long addr)
l3t += (cr3 & 0xFE0UL) >> 3;
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
@ -45,7 +45,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
unmap_domain_page(l3t);
@@ -143,7 +144,8 @@ void show_page_walk(unsigned long addr)
@@ -170,7 +171,8 @@ void show_page_walk(unsigned long addr)
l2t = map_domain_page(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
@ -55,7 +55,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -155,7 +157,8 @@ void show_page_walk(unsigned long addr)
@@ -182,7 +184,8 @@ void show_page_walk(unsigned long addr)
l1t = map_domain_page(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
@ -65,10 +65,10 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
unmap_domain_page(l1t);
Index: xen-3.2.1-testing/xen/arch/x86/x86_64/mm.c
Index: xen-3.3.0-testing/xen/arch/x86/x86_64/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/mm.c
--- xen-3.3.0-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-3.3.0-testing/xen/arch/x86/x86_64/mm.c
@@ -32,6 +32,7 @@
#include <asm/msr.h>
#include <public/memory.h>
@ -77,7 +77,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_64/mm.c
#ifdef CONFIG_COMPAT
unsigned int m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
#endif
@@ -144,6 +145,8 @@ void __init paging_init(void)
@@ -151,6 +152,8 @@ void __init paging_init(void)
l2_ro_mpt++;
}
@ -86,11 +86,11 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_64/mm.c
/* Create user-accessible L2 directory to map the MPT for compat guests. */
BUILD_BUG_ON(l4_table_offset(RDWR_MPT_VIRT_START) !=
l4_table_offset(HIRO_COMPAT_MPT_VIRT_START));
Index: xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
Index: xen-3.3.0-testing/xen/arch/x86/x86_64/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
@@ -136,7 +136,8 @@ void show_page_walk(unsigned long addr)
--- xen-3.3.0-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-3.3.0-testing/xen/arch/x86/x86_64/traps.c
@@ -174,7 +174,8 @@ void show_page_walk(unsigned long addr)
l4t = mfn_to_virt(mfn);
l4e = l4t[l4_table_offset(addr)];
mfn = l4e_get_pfn(l4e);
@ -100,17 +100,17 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
printk(" L4[0x%03lx] = %"PRIpte" %016lx\n",
l4_table_offset(addr), l4e_get_intpte(l4e), pfn);
if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) )
@@ -145,7 +146,8 @@ void show_page_walk(unsigned long addr)
@@ -183,7 +184,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) && mpt_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L3[0x%03lx] = %"PRIpte" %016lx\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
@@ -154,7 +156,8 @@ void show_page_walk(unsigned long addr)
printk(" L3[0x%03lx] = %"PRIpte" %016lx%s\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn,
(l3e_get_flags(l3e) & _PAGE_PSE) ? " (PSE)" : "");
@@ -194,7 +196,8 @@ void show_page_walk(unsigned long addr)
l2t = mfn_to_virt(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
@ -120,7 +120,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
printk(" L2[0x%03lx] = %"PRIpte" %016lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -165,7 +168,8 @@ void show_page_walk(unsigned long addr)
@@ -205,7 +208,8 @@ void show_page_walk(unsigned long addr)
l1t = mfn_to_virt(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
@ -130,11 +130,11 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
printk(" L1[0x%03lx] = %"PRIpte" %016lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
}
Index: xen-3.2.1-testing/xen/include/asm-x86/mm.h
Index: xen-3.3.0-testing/xen/include/asm-x86/mm.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/mm.h
+++ xen-3.2.1-testing/xen/include/asm-x86/mm.h
@@ -267,6 +267,7 @@ TYPE_SAFE(unsigned long,mfn);
--- xen-3.3.0-testing.orig/xen/include/asm-x86/mm.h
+++ xen-3.3.0-testing/xen/include/asm-x86/mm.h
@@ -277,6 +277,7 @@ TYPE_SAFE(unsigned long,mfn);
#define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START)
#define INVALID_M2P_ENTRY (~0UL)
#define VALID_M2P(_e) (!((_e) & (1UL<<(BITS_PER_LONG-1))))

View File

@ -1,342 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/mm.c
@@ -3594,6 +3594,7 @@ static int ptwr_emulated_cmpxchg(
container_of(ctxt, struct ptwr_emulate_ctxt, ctxt));
}
+#ifdef __i386__
static int ptwr_emulated_cmpxchg8b(
enum x86_segment seg,
unsigned long offset,
@@ -3609,13 +3610,16 @@ static int ptwr_emulated_cmpxchg8b(
offset, ((u64)old_hi << 32) | old, ((u64)new_hi << 32) | new, 8, 1,
container_of(ctxt, struct ptwr_emulate_ctxt, ctxt));
}
+#else
+#define ptwr_emulated_cmpxchg8b NULL
+#endif
static struct x86_emulate_ops ptwr_emulate_ops = {
.read = ptwr_emulated_read,
.insn_fetch = ptwr_emulated_read,
.write = ptwr_emulated_write,
.cmpxchg = ptwr_emulated_cmpxchg,
- .cmpxchg8b = ptwr_emulated_cmpxchg8b
+ .cmpxchg2 = ptwr_emulated_cmpxchg8b
};
/* Write page fault handler: check if guest is trying to modify a PTE. */
Index: xen-3.2.1-testing/xen/arch/x86/mm/shadow/common.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/shadow/common.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/shadow/common.c
@@ -261,6 +261,7 @@ hvm_emulate_cmpxchg(enum x86_segment seg
v, addr, old, new, bytes, sh_ctxt);
}
+#ifdef __i386__
static int
hvm_emulate_cmpxchg8b(enum x86_segment seg,
unsigned long offset,
@@ -287,13 +288,16 @@ hvm_emulate_cmpxchg8b(enum x86_segment s
return v->arch.paging.mode->shadow.x86_emulate_cmpxchg8b(
v, addr, old_lo, old_hi, new_lo, new_hi, sh_ctxt);
}
+#else
+#define hvm_emulate_cmpxchg8b NULL
+#endif
static struct x86_emulate_ops hvm_shadow_emulator_ops = {
.read = hvm_emulate_read,
.insn_fetch = hvm_emulate_insn_fetch,
.write = hvm_emulate_write,
.cmpxchg = hvm_emulate_cmpxchg,
- .cmpxchg8b = hvm_emulate_cmpxchg8b,
+ .cmpxchg2 = hvm_emulate_cmpxchg8b,
};
static int
@@ -351,6 +355,7 @@ pv_emulate_cmpxchg(enum x86_segment seg,
v, offset, old, new, bytes, sh_ctxt);
}
+#ifdef __i386__
static int
pv_emulate_cmpxchg8b(enum x86_segment seg,
unsigned long offset,
@@ -368,13 +373,16 @@ pv_emulate_cmpxchg8b(enum x86_segment se
return v->arch.paging.mode->shadow.x86_emulate_cmpxchg8b(
v, offset, old_lo, old_hi, new_lo, new_hi, sh_ctxt);
}
+#else
+#define pv_emulate_cmpxchg8b NULL
+#endif
static struct x86_emulate_ops pv_shadow_emulator_ops = {
.read = pv_emulate_read,
.insn_fetch = pv_emulate_read,
.write = pv_emulate_write,
.cmpxchg = pv_emulate_cmpxchg,
- .cmpxchg8b = pv_emulate_cmpxchg8b,
+ .cmpxchg2 = pv_emulate_cmpxchg8b,
};
struct x86_emulate_ops *shadow_init_emulation(
@@ -388,7 +396,12 @@ struct x86_emulate_ops *shadow_init_emul
if ( !is_hvm_vcpu(v) )
{
+#ifndef CONFIG_COMPAT
sh_ctxt->ctxt.addr_size = sh_ctxt->ctxt.sp_size = BITS_PER_LONG;
+#else
+ sh_ctxt->ctxt.addr_size = sh_ctxt->ctxt.sp_size =
+ !is_pv_32on64_vcpu(v) ? BITS_PER_LONG : COMPAT_BITS_PER_LONG;
+#endif
return &pv_shadow_emulator_ops;
}
Index: xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/shadow/multi.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
@@ -4244,7 +4244,8 @@ sh_x86_emulate_cmpxchg(struct vcpu *v, u
return rv;
}
-int
+#ifdef __i386__
+static int
sh_x86_emulate_cmpxchg8b(struct vcpu *v, unsigned long vaddr,
unsigned long old_lo, unsigned long old_hi,
unsigned long new_lo, unsigned long new_hi,
@@ -4280,6 +4281,7 @@ sh_x86_emulate_cmpxchg8b(struct vcpu *v,
shadow_unlock(v->domain);
return rv;
}
+#endif
/**************************************************************************/
@@ -4566,7 +4568,9 @@ struct paging_mode sh_paging_mode = {
.shadow.detach_old_tables = sh_detach_old_tables,
.shadow.x86_emulate_write = sh_x86_emulate_write,
.shadow.x86_emulate_cmpxchg = sh_x86_emulate_cmpxchg,
+#ifdef __i386__
.shadow.x86_emulate_cmpxchg8b = sh_x86_emulate_cmpxchg8b,
+#endif
.shadow.make_monitor_table = sh_make_monitor_table,
.shadow.destroy_monitor_table = sh_destroy_monitor_table,
#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
Index: xen-3.2.1-testing/xen/arch/x86/x86_emulate.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_emulate.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_emulate.c
@@ -31,7 +31,10 @@
#include <xen/types.h>
#include <xen/lib.h>
#include <asm/regs.h>
+#include <asm/processor.h>
#undef cmpxchg
+#undef cpuid
+#undef wbinvd
#endif
#include <asm-x86/x86_emulate.h>
@@ -3330,60 +3333,64 @@ x86_emulate(
src.val = x86_seg_gs;
goto pop_seg;
- case 0xc7: /* Grp9 (cmpxchg8b) */
-#if defined(__i386__)
- {
- unsigned long old_lo, old_hi;
+ case 0xc7: /* Grp9 (cmpxchg{8,16}b) */
generate_exception_if((modrm_reg & 7) != 1, EXC_UD);
generate_exception_if(ea.type != OP_MEM, EXC_UD);
- if ( (rc = ops->read(ea.mem.seg, ea.mem.off+0, &old_lo, 4, ctxt)) ||
- (rc = ops->read(ea.mem.seg, ea.mem.off+4, &old_hi, 4, ctxt)) )
- goto done;
- if ( (old_lo != _regs.eax) || (old_hi != _regs.edx) )
- {
- _regs.eax = old_lo;
- _regs.edx = old_hi;
- _regs.eflags &= ~EFLG_ZF;
- }
- else if ( ops->cmpxchg8b == NULL )
- {
- rc = X86EMUL_UNHANDLEABLE;
- goto done;
- }
- else
+#ifdef __x86_64__
+ if ( op_bytes != 8 )
{
- if ( (rc = ops->cmpxchg8b(ea.mem.seg, ea.mem.off, old_lo, old_hi,
- _regs.ebx, _regs.ecx, ctxt)) != 0 )
+ unsigned long old, new;
+
+ if ( (rc = ops->read(ea.mem.seg, ea.mem.off, &old, 8, ctxt)) != 0 )
goto done;
- _regs.eflags |= EFLG_ZF;
- }
- break;
- }
-#elif defined(__x86_64__)
- {
- unsigned long old, new;
- generate_exception_if((modrm_reg & 7) != 1, EXC_UD);
- generate_exception_if(ea.type != OP_MEM, EXC_UD);
- if ( (rc = ops->read(ea.mem.seg, ea.mem.off, &old, 8, ctxt)) != 0 )
- goto done;
- if ( ((uint32_t)(old>>0) != (uint32_t)_regs.eax) ||
- ((uint32_t)(old>>32) != (uint32_t)_regs.edx) )
- {
- _regs.eax = (uint32_t)(old>>0);
- _regs.edx = (uint32_t)(old>>32);
- _regs.eflags &= ~EFLG_ZF;
+ if ( ((uint32_t)(old>>0) != (uint32_t)_regs.eax) ||
+ ((uint32_t)(old>>32) != (uint32_t)_regs.edx) )
+ {
+ _regs.eax = (uint32_t)(old>>0);
+ _regs.edx = (uint32_t)(old>>32);
+ _regs.eflags &= ~EFLG_ZF;
+ }
+ else
+ {
+ new = (_regs.ecx<<32)|(uint32_t)_regs.ebx;
+ if ( (rc = ops->cmpxchg(ea.mem.seg, ea.mem.off, old,
+ new, 8, ctxt)) != 0 )
+ goto done;
+ _regs.eflags |= EFLG_ZF;
+ }
}
+ else if ( !cpu_has_cmpxchg16b )
+ generate_exception_if(1, EXC_UD);
else
+#endif
{
- new = (_regs.ecx<<32)|(uint32_t)_regs.ebx;
- if ( (rc = ops->cmpxchg(ea.mem.seg, ea.mem.off, old,
- new, 8, ctxt)) != 0 )
+ unsigned long old_lo, old_hi;
+
+ if ( (rc = ops->read(ea.mem.seg, ea.mem.off,
+ &old_lo, sizeof(old_lo), ctxt)) ||
+ (rc = ops->read(ea.mem.seg, ea.mem.off+sizeof(old_lo),
+ &old_hi, sizeof(old_lo), ctxt)) )
goto done;
- _regs.eflags |= EFLG_ZF;
+ if ( (old_lo != _regs.eax) || (old_hi != _regs.edx) )
+ {
+ _regs.eax = old_lo;
+ _regs.edx = old_hi;
+ _regs.eflags &= ~EFLG_ZF;
+ }
+ else if ( ops->cmpxchg2 == NULL )
+ {
+ rc = X86EMUL_UNHANDLEABLE;
+ goto done;
+ }
+ else
+ {
+ if ( (rc = ops->cmpxchg2(ea.mem.seg, ea.mem.off, old_lo, old_hi,
+ _regs.ebx, _regs.ecx, ctxt)) != 0 )
+ goto done;
+ _regs.eflags |= EFLG_ZF;
+ }
}
break;
- }
-#endif
case 0xc8 ... 0xcf: /* bswap */
dst.type = OP_REG;
@@ -3393,7 +3400,7 @@ x86_emulate(
{
default: /* case 2: */
/* Undefined behaviour. Writes zero on all tested CPUs. */
- dst.val = 0;
+ __asm__("data16 bswap %k0" : "+r" (dst.val));
break;
case 4:
#ifdef __x86_64__
Index: xen-3.2.1-testing/xen/include/asm-x86/cpufeature.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/cpufeature.h
+++ xen-3.2.1-testing/xen/include/asm-x86/cpufeature.h
@@ -149,6 +149,7 @@
#define cpu_has_cyrix_arr boot_cpu_has(X86_FEATURE_CYRIX_ARR)
#define cpu_has_centaur_mcr boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH)
+#define cpu_has_cmpxchg16b 0
#define cpu_has_page1gb 0
#define cpu_has_efer (boot_cpu_data.x86_capability[1] & 0x20100800)
#else /* __x86_64__ */
@@ -175,6 +176,7 @@
#define cpu_has_cyrix_arr 0
#define cpu_has_centaur_mcr 0
#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH)
+#define cpu_has_cmpxchg16b boot_cpu_has(X86_FEATURE_CX16)
#define cpu_has_page1gb boot_cpu_has(X86_FEATURE_PAGE1GB)
#define cpu_has_efer 1
#endif
Index: xen-3.2.1-testing/xen/include/asm-x86/x86_emulate.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/x86_emulate.h
+++ xen-3.2.1-testing/xen/include/asm-x86/x86_emulate.h
@@ -104,8 +104,9 @@ struct segment_register {
* some out-of-band mechanism, unknown to the emulator. The memop signals
* failure by returning X86EMUL_EXCEPTION to the emulator, which will
* then immediately bail.
- * 2. Valid access sizes are 1, 2, 4 and 8 bytes. On x86/32 systems only
- * cmpxchg8b_emulated need support 8-byte accesses.
+ * 2. Valid access sizes are 1, 2, 4, 8, and 16 bytes. On x86/32 systems only
+ * cmpxchg2_emulated need support 8-byte accesses. On x86/64 systems only
+ * cmpxchg2_emulated need support 16-byte accesses.
* 3. The emulator cannot handle 64-bit mode emulation on an x86/32 system.
*/
struct x86_emulate_ops
@@ -165,16 +166,17 @@ struct x86_emulate_ops
struct x86_emulate_ctxt *ctxt);
/*
- * cmpxchg8b: Emulate an atomic (LOCKed) CMPXCHG8B operation.
+ * cmpxchg2: Emulate an atomic (LOCKed) CMPXCHG{8,16}B operation.
* @old: [IN ] Value expected to be current at @addr.
* @new: [IN ] Value to write to @addr.
* NOTES:
- * 1. This function is only ever called when emulating a real CMPXCHG8B.
- * 2. This function is *never* called on x86/64 systems.
- * 2. Not defining this function (i.e., specifying NULL) is equivalent
+ * 1. This function is only ever called when emulating a real CMPXCHG{8,16}B.
+ * 2. This function is *never* called on x86/64 systems for emulating
+ * CMPXCHG8B.
+ * 3. Not defining this function (i.e., specifying NULL) is equivalent
* to defining a function that always returns X86EMUL_UNHANDLEABLE.
*/
- int (*cmpxchg8b)(
+ int (*cmpxchg2)(
enum x86_segment seg,
unsigned long offset,
unsigned long old_lo,
Index: xen-3.2.1-testing/xen/include/asm-x86/paging.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/paging.h
+++ xen-3.2.1-testing/xen/include/asm-x86/paging.h
@@ -83,12 +83,14 @@ struct shadow_paging_mode {
unsigned long new,
unsigned int bytes,
struct sh_emulate_ctxt *sh_ctxt);
+#ifdef __i386__
int (*x86_emulate_cmpxchg8b )(struct vcpu *v, unsigned long va,
unsigned long old_lo,
unsigned long old_hi,
unsigned long new_lo,
unsigned long new_hi,
struct sh_emulate_ctxt *sh_ctxt);
+#endif
mfn_t (*make_monitor_table )(struct vcpu *v);
void (*destroy_monitor_table )(struct vcpu *v, mfn_t mmfn);
int (*guess_wrmap )(struct vcpu *v,

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b3dcdef0709301c1e6ad4f590b10f1734e33d6979942364cbf186a2074689b4b
size 7051282
oid sha256:e63df7fa5cc4d603cf44b7562d2f03f0784f2951389eb44b752897f67b1ed24e
size 9818013

View File

@ -1,6 +1,7 @@
diff -r 854b4e5a009f tools/python/xen/xend/XendAuthSessions.py
--- a/tools/python/xen/xend/XendAuthSessions.py Tue Feb 05 16:42:18 2008 -0700
+++ b/tools/python/xen/xend/XendAuthSessions.py Fri Feb 22 17:24:01 2008 -0700
Index: xen-3.3.0-testing/tools/python/xen/xend/XendAuthSessions.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendAuthSessions.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendAuthSessions.py
@@ -84,7 +84,7 @@ class XendAuthSessions:
# if PAM doesn't exist, let's ignore it
return False

View File

@ -2,7 +2,24 @@ Index: xen-3.3.0-testing/Config.mk
===================================================================
--- xen-3.3.0-testing.orig/Config.mk
+++ xen-3.3.0-testing/Config.mk
@@ -89,7 +89,7 @@ CONFIG_QEMU ?= ioemu
@@ -84,20 +84,20 @@ QEMU_REMOTE=http://xenbits.xensource.com
# Specify which qemu-dm to use. This may be `ioemu' to use the old
# Mercurial in-tree version, or a local directory, or a git URL.
-# CONFIG_QEMU ?= ioemu
+CONFIG_QEMU ?= ioemu-remote
# CONFIG_QEMU ?= ../qemu-xen.git
-ifeq ($(XEN_TARGET_ARCH),ia64)
-CONFIG_QEMU ?= ioemu
-else
-CONFIG_QEMU ?= $(QEMU_REMOTE)
-endif
+# ifeq ($(XEN_TARGET_ARCH),ia64)
+# CONFIG_QEMU ?= ioemu
+# else
+# CONFIG_QEMU ?= $(QEMU_REMOTE)
+# endif
# Optional components
XENSTAT_XENTOP ?= y
VTPM_TOOLS ?= n
@ -11,3 +28,6 @@ Index: xen-3.3.0-testing/Config.mk
PYTHON_TOOLS ?= y
CONFIG_MINITERM ?= n
CONFIG_LOMOUNT ?= n
--include $(XEN_ROOT)/.config
+#-include $(XEN_ROOT)/.config

View File

@ -3,12 +3,12 @@ Index: xen-3.3.0-testing/docs/Makefile
--- xen-3.3.0-testing.orig/docs/Makefile
+++ xen-3.3.0-testing/docs/Makefile
@@ -90,7 +90,8 @@ install: all
$(INSTALL_DIR) $(DESTDIR)$(mandir)
cp -dR man1 $(DESTDIR)$(mandir)
cp -dR man5 $(DESTDIR)$(mandir)
- [ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir)
+ $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)/html
+ cp -dR html.done/* $(DESTDIR)$(pkgdocdir)/html
$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
cp -dR man1 $(DESTDIR)$(MANDIR)
cp -dR man5 $(DESTDIR)$(MANDIR)
- [ ! -d html ] || cp -dR html $(DESTDIR)$(DOCDIR)
+ $(INSTALL_DIR) $(DESTDIR)$(DOCDIR)/html
+ cp -dR html.done/* $(DESTDIR)$(DOCDIR)/html
pdf/%.pdf: ps/%.ps
$(INSTALL_DIR) $(@D)
@ -26,7 +26,7 @@ Index: xen-3.3.0-testing/tools/examples/Makefile
===================================================================
--- xen-3.3.0-testing.orig/tools/examples/Makefile
+++ xen-3.3.0-testing/tools/examples/Makefile
@@ -39,18 +39,6 @@ XEN_HOTPLUG_SCRIPTS = xen-backend.agent
@@ -47,18 +47,6 @@ XEN_HOTPLUG_SCRIPTS = xen-backend.agent
UDEV_RULES_DIR = /etc/udev
UDEV_RULES = xen-backend.rules
@ -45,13 +45,16 @@ Index: xen-3.3.0-testing/tools/examples/Makefile
.PHONY: all
all:
@@ -58,15 +46,15 @@ all:
@@ -66,7 +54,7 @@ all:
build:
.PHONY: install
-install: all install-initd install-configs install-scripts $(HOTPLUGS)
+install: all install-initd install-configs install-scripts install-udev
-install: all install-readmes install-initd install-configs install-scripts $(HOTPLUGS)
+install: all install-readmes install-initd install-configs install-scripts install-udev
.PHONY: install-readmes
install-readmes:
@@ -80,10 +68,10 @@ install-readmes:
.PHONY: install-initd
install-initd:
[ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
@ -64,7 +67,7 @@ Index: xen-3.3.0-testing/tools/examples/Makefile
.PHONY: install-configs
install-configs: $(XEN_CONFIGS)
@@ -107,8 +95,7 @@ install-udev:
@@ -124,8 +112,7 @@ install-udev:
$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
set -e; for i in $(UDEV_RULES); \
do \
@ -116,19 +119,6 @@ Index: xen-3.3.0-testing/tools/python/Makefile
endif
install-dtd: all
Index: xen-3.3.0-testing/docs/Docs.mk
===================================================================
--- xen-3.3.0-testing.orig/docs/Docs.mk
+++ xen-3.3.0-testing/docs/Docs.mk
@@ -8,6 +8,6 @@ POD2MAN := pod2man
DOT := dot
NEATO := neato
-pkgdocdir := /usr/share/doc/xen
-mandir := /usr/share/man
+pkgdocdir := $(DOCDIR)
+mandir := $(MANDIR)
Index: xen-3.3.0-testing/tools/xenstore/Makefile
===================================================================
--- xen-3.3.0-testing.orig/tools/xenstore/Makefile

View File

@ -5,11 +5,11 @@ the "sendkey" command, among other useful things), remove all console
commands that can read/write dom0's state.
Index: xen-3.3.0-testing/tools/ioemu/monitor.c
Index: xen-3.3.0-testing/tools/ioemu-remote/monitor.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/monitor.c
+++ xen-3.3.0-testing/tools/ioemu/monitor.c
@@ -1231,6 +1231,7 @@ static term_cmd_t term_cmds[] = {
--- xen-3.3.0-testing.orig/tools/ioemu-remote/monitor.c
+++ xen-3.3.0-testing/tools/ioemu-remote/monitor.c
@@ -1320,6 +1320,7 @@ static term_cmd_t term_cmds[] = {
"device|all", "commit changes to the disk images (if -snapshot is used) or backing files" },
{ "info", "s?", do_info,
"subcommand", "show various information about the system state" },
@ -17,20 +17,20 @@ Index: xen-3.3.0-testing/tools/ioemu/monitor.c
{ "q|quit", "", do_quit,
"", "quit the emulator" },
{ "eject", "-fB", do_eject,
@@ -1241,6 +1242,7 @@ static term_cmd_t term_cmds[] = {
"filename", "save screen into PPM image 'filename'" },
@@ -1332,6 +1333,7 @@ static term_cmd_t term_cmds[] = {
"filename", "output logs to 'filename'" },
{ "log", "s", do_log,
"item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" },
"item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" },
+#endif
#ifndef CONFIG_DM
{ "savevm", "s?", do_savevm,
"tag|id", "save a VM snapshot. If no tag or id are provided, a new snapshot is created" },
@@ -1274,12 +1276,14 @@ static term_cmd_t term_cmds[] = {
{ "system_powerdown", "", do_system_powerdown,
"tag|id", "save a VM snapshot. If no tag or id are provided, a new snapshot is created" },
{ "loadvm", "s", do_loadvm,
@@ -1361,12 +1363,14 @@ static term_cmd_t term_cmds[] = {
"", "reset the system" },
{ "system_powerdown", "", do_system_powerdown,
"", "send system power down event" },
#endif /* !CONFIG_DM */
+#ifdef CONFIG_TRUSTED_CLIENT
{ "sum", "ii", do_sum,
{ "sum", "ii", do_sum,
"addr size", "compute the checksum of a memory region" },
{ "usb_add", "s", do_usb_add,
"device", "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')" },
@ -40,7 +40,7 @@ Index: xen-3.3.0-testing/tools/ioemu/monitor.c
#ifdef CONFIG_PHP_DEBUG
{ "pci_add", "s", do_pci_add,
"device", "insert PCI pass-through device by BDF,e.g. (dom, bus, dev, func) by hex '0x0, 0x3, 0x0, 0x0'" },
@@ -1296,6 +1300,7 @@ static term_cmd_t term_cmds[] = {
@@ -1381,6 +1385,7 @@ static term_cmd_t term_cmds[] = {
"state", "change mouse button state (1=L, 2=M, 4=R)" },
{ "mouse_set", "i", do_mouse_set,
"index", "set which mouse device receives events" },
@ -48,26 +48,26 @@ Index: xen-3.3.0-testing/tools/ioemu/monitor.c
#ifdef HAS_AUDIO
{ "wavcapture", "si?i?i?", do_wav_capture,
"path [frequency bits channels]",
@@ -1303,6 +1308,7 @@ static term_cmd_t term_cmds[] = {
@@ -1388,6 +1393,7 @@ static term_cmd_t term_cmds[] = {
#endif
{ "stopcapture", "i", do_stop_capture,
"capture index", "stop capture" },
+#endif
#ifndef CONFIG_DM
{ "memsave", "lis", do_memory_save,
{ "memsave", "lis", do_memory_save,
"addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", },
@@ -1345,6 +1351,7 @@ static term_cmd_t info_cmds[] = {
#endif /* !CONFIG_DM */
{ "pmemsave", "lis", do_physical_memory_save,
@@ -1434,6 +1440,7 @@ static term_cmd_t info_cmds[] = {
"", "show kqemu information", },
{ "usb", "", usb_info,
"", "show guest USB devices", },
+#ifdef CONFIG_TRUSTED_CLIENT
{ "usbhost", "", usb_host_info,
"", "show host USB devices", },
{ "profile", "", do_info_profile,
@@ -1361,6 +1368,7 @@ static term_cmd_t info_cmds[] = {
{ "hvmiopage", "", sp_info,
"", "show HVM device model shared page info" },
#endif /* CONFIG_DM */
@@ -1458,6 +1465,7 @@ static term_cmd_t info_cmds[] = {
{ "slirp", "", do_info_slirp,
"", "show SLIRP statistics", },
#endif
+#endif
{ NULL, NULL, },
};

View File

@ -9,7 +9,7 @@ Index: xen-3.3.0-testing/tools/python/xen/util/blkif.py
-def _parse_uname(uname):
- fn = taptype = None
+def parse_uname(uname):
+ fn = tpy = taptype = None
+ fn = typ = taptype = None
if uname.find(":") != -1:
(typ, fn) = uname.split(":", 1)
if typ == "phy" and not fn.startswith("/"):
@ -36,7 +36,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/DevController.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/DevController.py
+++ xen-3.3.0-testing/tools/python/xen/xend/server/DevController.py
@@ -604,6 +604,31 @@ class DevController:
@@ -612,6 +612,31 @@ class DevController:
return (Missing, None)
@ -148,7 +148,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
from xen.xend.XendError import XendError, VmError
from xen.xend.XendDevices import XendDevices
from xen.xend.XendTask import XendTask
@@ -1863,6 +1863,10 @@ class XendDomainInfo:
@@ -1875,6 +1875,10 @@ class XendDomainInfo:
deviceClass, config = self.info['devices'].get(dev_uuid)
self._waitForDevice(deviceClass, config['devid'])
@ -159,7 +159,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
def _waitForDevice_destroy(self, deviceClass, devid, backpath):
return self.getDeviceController(deviceClass).waitForDevice_destroy(
devid, backpath)
@@ -2534,8 +2538,11 @@ class XendDomainInfo:
@@ -2557,8 +2561,11 @@ class XendDomainInfo:
blexec = osdep.pygrub_path
blcfg = None
@ -173,7 +173,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
if not disks:
msg = "Had a bootloader specified, but no disks are bootable"
@@ -2546,13 +2553,10 @@ class XendDomainInfo:
@@ -2569,13 +2576,10 @@ class XendDomainInfo:
devtype = devinfo[0]
disk = devinfo[1]['uname']
@ -190,7 +190,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
log.info("Mounting %s on %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE))
@@ -2564,7 +2568,9 @@ class XendDomainInfo:
@@ -2587,7 +2591,9 @@ class XendDomainInfo:
from xen.xend import XendDomain
dom0 = XendDomain.instance().privilegedDomain()
@ -201,7 +201,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
fn = BOOTLOADER_LOOPBACK_DEVICE
try:
@@ -2575,7 +2581,7 @@ class XendDomainInfo:
@@ -2598,7 +2604,7 @@ class XendDomainInfo:
log.info("Unmounting %s from %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE))

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
===================================================================
--- xen-3.3.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.3.0-testing/tools/examples/xend-config.sxp
@@ -142,7 +142,8 @@
@@ -141,7 +141,8 @@
#
# (network-script 'network-bridge netdev=eth1')
#
@ -12,31 +12,33 @@ Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
#
# (network-script 'network-bridge bridge=<name>')
#
Index: xen-3.3.0-testing/tools/ioemu/vl.c
Index: xen-3.3.0-testing/tools/ioemu-remote/vl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -111,8 +111,6 @@
#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup"
#ifdef _BSD
#define DEFAULT_BRIDGE "bridge0"
-#else
-#define DEFAULT_BRIDGE "xenbr0"
--- xen-3.3.0-testing.orig/tools/ioemu-remote/vl.c
+++ xen-3.3.0-testing/tools/ioemu-remote/vl.c
@@ -134,8 +134,8 @@ int inet_aton(const char *cp, struct in_
#include "exec-all.h"
#ifndef DEFAULT_NETWORK_SCRIPT
-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
+#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup"
+#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/xen/qemu-ifdown"
#endif
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
@@ -4183,10 +4181,10 @@ static int net_client_init(const char *s
if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) {
pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT);
@@ -4997,10 +4997,10 @@ static int net_client_init(const char *s
pstrcpy(down_script, sizeof(down_script), DEFAULT_NETWORK_DOWN_SCRIPT);
}
- if (get_param_value(bridge, sizeof(bridge), "bridge", p) == 0) {
- pstrcpy(bridge, sizeof(bridge), DEFAULT_BRIDGE);
if (get_param_value(script_arg, sizeof(script_arg), "scriptarg", p) == 0 &&
- get_param_value(script_arg, sizeof(script_arg), "bridge", p) == 0) { /* deprecated; for xend compatibility */
- pstrcpy(script_arg, sizeof(script_arg), "");
- }
- ret = net_tap_init(vlan, ifname, setup_script, bridge);
+ if (get_param_value(bridge, sizeof(bridge), "bridge", p) == 0)
+ ret = net_tap_init(vlan, ifname, setup_script, NULL);
- ret = net_tap_init(vlan, ifname, setup_script, down_script, script_arg);
+ get_param_value(script_arg, sizeof(script_arg), "bridge", p) == 0) /* deprecated; for xend compatibility */
+ ret = net_tap_init(vlan, ifname, setup_script, NULL, NULL);
+ else
+ ret = net_tap_init(vlan, ifname, setup_script, bridge);
+ ret = net_tap_init(vlan, ifname, setup_script, down_script, script_arg);
}
} else
#endif
@ -44,7 +46,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -766,15 +766,17 @@ class HVMImageHandler(ImageHandler):
@@ -764,14 +764,16 @@ class HVMImageHandler(ImageHandler):
mac = devinfo.get('mac')
if mac is None:
raise VmError("MAC address not specified or generated.")
@ -57,19 +59,17 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
ret.append("-net")
- ret.append("tap,vlan=%d,ifname=tap%d.%d,bridge=%s" %
- (nics, self.vm.getDomid(), nics-1, bridge))
-
+ net = "tap,vlan=%d,ifname=tap%d.%d" % (nics, self.vm.getDomid(), nics-1)
+ if bridge:
+ net += ",bridge=%s" % bridge
+ ret.append(net)
+
return ret
def getDeviceModelArgs(self, restore = False):
Index: xen-3.3.0-testing/tools/ioemu/target-i386-dm/qemu-ifup
if nics == 0:
ret.append("-net")
Index: xen-3.3.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/target-i386-dm/qemu-ifup
+++ xen-3.3.0-testing/tools/ioemu/target-i386-dm/qemu-ifup
--- xen-3.3.0-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup
+++ xen-3.3.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup
@@ -1,11 +1,11 @@
#!/bin/sh

View File

@ -4,7 +4,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -869,7 +869,7 @@ class X86_HVM_ImageHandler(HVMImageHandl
@@ -871,7 +871,7 @@ class X86_HVM_ImageHandler(HVMImageHandl
def configure(self, vmConfig):
HVMImageHandler.configure(self, vmConfig)

View File

@ -1,19 +1,19 @@
Index: xen-3.3.0-testing/tools/ioemu/hw/ide.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/ide.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/ide.c
+++ xen-3.3.0-testing/tools/ioemu/hw/ide.c
@@ -406,6 +406,9 @@ typedef struct PCIIDEState {
int type; /* see IDE_TYPE_xxx */
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/ide.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/ide.c
@@ -485,6 +485,9 @@ typedef struct PCIIDEState {
} PCIIDEState;
+static PCIIDEState *principal_ide_controller;
+extern FILE *logfile;
+
#if defined(__ia64__)
#include <xen/hvm/ioreq.h>
@@ -2305,6 +2308,27 @@ static void ide_reset(IDEState *s)
ide_dummy_transfer_stop(s);
@@ -2778,6 +2781,27 @@ static void ide_reset(IDEState *s)
s->media_changed = 0;
}
+void ide_unplug_harddisks(void)
@ -40,41 +40,33 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/ide.c
struct partition {
uint8_t boot_ind; /* 0x80 - active */
uint8_t head; /* starting head */
@@ -2707,6 +2731,9 @@ void pci_cmd646_ide_init(PCIBus *bus, Bl
@@ -3290,6 +3314,10 @@ void pci_cmd646_ide_init(PCIBus *bus, Bl
sizeof(PCIIDEState),
-1,
-1,
NULL, NULL);
+ if (principal_ide_controller)
+ abort();
+ abort();
+ principal_ide_controller = d;
+
d->type = IDE_TYPE_CMD646;
pci_conf = d->dev.config;
pci_conf[0x00] = 0x95; // CMD646
@@ -2884,6 +2911,9 @@ void pci_piix_ide_init(PCIBus *bus, Bloc
NULL, NULL);
d->type = IDE_TYPE_PIIX3;
+ if (principal_ide_controller)
+ abort();
+ principal_ide_controller = d;
pci_conf = d->dev.config;
pci_conf[0x00] = 0x86; // Intel
pci_conf[0x01] = 0x80;
@@ -2930,6 +2960,9 @@ void pci_piix3_ide_init(PCIBus *bus, Blo
@@ -3421,6 +3449,10 @@ void pci_piix3_ide_init(PCIBus *bus, Blo
NULL, NULL);
d->type = IDE_TYPE_PIIX3;
+ if (principal_ide_controller)
+ abort();
+ principal_ide_controller = d;
+
pci_conf = d->dev.config;
pci_conf[0x00] = 0x86; // Intel
pci_conf[0x01] = 0x80;
Index: xen-3.3.0-testing/tools/ioemu/hw/pci.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/pci.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/pci.c
+++ xen-3.3.0-testing/tools/ioemu/hw/pci.c
@@ -594,6 +594,28 @@ void pci_nic_init(PCIBus *bus, NICInfo *
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/pci.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/pci.c
@@ -653,6 +653,28 @@ void pci_nic_init(PCIBus *bus, NICInfo *
}
}
@ -103,19 +95,22 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/pci.c
typedef struct {
PCIDevice dev;
PCIBus *bus;
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_platform.c
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_platform.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_platform.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_platform.c
@@ -23,15 +23,53 @@
* THE SOFTWARE.
*/
#include "vl.h"
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/xen_platform.c
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/xen_platform.c
@@ -26,6 +26,8 @@
#include "hw.h"
#include "pci.h"
#include "irq.h"
+#include "sysemu.h"
+#include <xc_private.h>
#include <xenguest.h>
extern FILE *logfile;
@@ -71,12 +73,53 @@ static void xen_platform_ioport_writeb(v
}
}
+static uint32_t ioport_base;
+
@ -152,23 +147,28 @@ Index: xen-3.3.0-testing/tools/ioemu/hw/xen_platform.c
+ }
+}
+
static void platform_ioport_map(PCIDevice *pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
static void platform_ioport_map(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type)
{
- /* nothing yet */
+ ioport_base = addr;
+
+ register_ioport_write(addr, 16, 4, platform_ioport_write, NULL);
+/*
PCIXenPlatformState *d = (PCIXenPlatformState *)pci_dev;
+
register_ioport_write(addr, size, 1, xen_platform_ioport_writeb, d);
register_ioport_read(addr, size, 1, xen_platform_ioport_readb, d);
+*/
}
static uint32_t platform_mmio_read(void *opaque, target_phys_addr_t addr)
Index: xen-3.3.0-testing/tools/ioemu/vl.c
Index: xen-3.3.0-testing/tools/ioemu-remote/vl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -217,6 +217,20 @@ extern int domid;
--- xen-3.3.0-testing.orig/tools/ioemu-remote/vl.c
+++ xen-3.3.0-testing/tools/ioemu-remote/vl.c
@@ -259,6 +259,20 @@ static int event_pending = 1;
PCI_EMULATION_INFO *PciEmulationInfoHead = NULL;
#include "xen-vl-extra.c"
+typedef struct IOHandlerRecord {
+ int fd;
@ -187,15 +187,15 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
/***********************************************************/
/* x86 ISA bus support */
@@ -3449,6 +3463,7 @@ void net_slirp_smb(const char *exported_
typedef struct TAPState {
VLANClientState *vc;
@@ -4054,6 +4068,7 @@ typedef struct TAPState {
int fd;
char down_script[1024];
char script_arg[1024];
+ struct TAPState *next;
} TAPState;
static void tap_receive(void *opaque, const uint8_t *buf, int size)
@@ -3476,6 +3491,36 @@ static void tap_send(void *opaque)
@@ -4089,6 +4104,36 @@ static void tap_send(void *opaque)
}
}
@ -232,7 +232,7 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
/* fd support */
static TAPState *net_tap_fd_init(VLANState *vlan, int fd)
@@ -3487,6 +3532,8 @@ static TAPState *net_tap_fd_init(VLANSta
@@ -4100,6 +4145,8 @@ static TAPState *net_tap_fd_init(VLANSta
return NULL;
s->fd = fd;
s->vc = qemu_new_vlan_client(vlan, tap_receive, NULL, s);
@ -241,7 +241,7 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
qemu_set_fd_handler(s->fd, tap_send, NULL, s);
snprintf(s->vc->info_str, sizeof(s->vc->info_str), "tap: fd=%d", fd);
return s;
@@ -4500,20 +4547,6 @@ void dumb_display_init(DisplayState *ds)
@@ -5672,20 +5719,6 @@ static void dumb_display_init(DisplaySta
#define MAX_IO_HANDLERS 64
@ -261,17 +261,18 @@ Index: xen-3.3.0-testing/tools/ioemu/vl.c
-
/* XXX: fd_read_poll should be suppressed, but an API change is
necessary in the character devices to suppress fd_can_read(). */
int qemu_set_fd_handler2(int fd,
Index: xen-3.3.0-testing/tools/ioemu/vl.h
int qemu_set_fd_handler2(int fd,
Index: xen-3.3.0-testing/tools/ioemu-remote/sysemu.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.h
+++ xen-3.3.0-testing/tools/ioemu/vl.h
@@ -1578,6 +1578,8 @@ void kqemu_record_dump(void);
extern char domain_name[];
--- xen-3.3.0-testing.orig/tools/ioemu-remote/sysemu.h
+++ xen-3.3.0-testing/tools/ioemu-remote/sysemu.h
@@ -49,6 +49,9 @@ void do_loadvm(const char *name);
void do_delvm(const char *name);
void do_info_snapshots(void);
void destroy_hvm_domain(void);
+void net_tap_shutdown_all(void);
+void pci_unplug_netifs(void);
+
void main_loop_wait(int timeout);
#ifdef __ia64__
static inline void xc_domain_shutdown_hook(int xc_handle, uint32_t domid)
/* Polling handling */

View File

@ -54,6 +54,6 @@ Index: xen-3.3.0-testing/xen/common/page_alloc.c
+custom_param("lowmem_emergency_pool", parse_lowmem_emergency_pool);
+
+/*
* Bit width of the DMA heap.
* Bit width of the DMA heap -- used to override NUMA-node-first.
* allocation strategy, which can otherwise exhaust low memory.
*/
static unsigned int dma_bitsize = CONFIG_DMA_BITSIZE;

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendNode.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendNode.py
@@ -649,11 +649,35 @@ class XendNode:
@@ -650,11 +650,35 @@ class XendNode:
info['cpu_mhz'] = info['cpu_khz'] / 1000
@ -43,7 +43,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendNode.py
ITEM_ORDER = ['nr_cpus',
'nr_nodes',
@@ -664,6 +688,9 @@ class XendNode:
@@ -665,6 +689,9 @@ class XendNode:
'virt_caps',
'total_memory',
'free_memory',
@ -59,13 +59,13 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/balloon.py
+++ xen-3.3.0-testing/tools/python/xen/xend/balloon.py
@@ -41,6 +41,8 @@ SLEEP_TIME_GROWTH = 0.1
# label actually shown in the PROC_XEN_BALLOON file.
labels = { 'current' : 'Current allocation',
'target' : 'Requested target',
+ 'min-target' : 'Minimum target',
+ 'max-target' : 'Maximum target',
'low-balloon' : 'Low-mem balloon',
'high-balloon' : 'High-mem balloon',
'limit' : 'Xen hard limit' }
#labels = { 'current' : 'Current allocation',
# 'target' : 'Requested target',
+# 'min-target' : 'Minimum target',
+# 'max-target' : 'Maximum target',
# 'low-balloon' : 'Low-mem balloon',
# 'high-balloon' : 'High-mem balloon',
# 'limit' : 'Xen hard limit' }
@@ -67,6 +69,23 @@ def get_dom0_target_alloc():
raise VmError('Failed to query target memory allocation of dom0.')
return kb
@ -94,7 +94,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1010,6 +1010,27 @@ class XendDomainInfo:
@@ -1016,6 +1016,27 @@ class XendDomainInfo:
return None

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -1044,9 +1044,8 @@ def preprocess_access_control(vals):
@@ -1066,9 +1066,8 @@ def preprocess_access_control(vals):
def preprocess_ip(vals):
if vals.ip or vals.dhcp != 'off':

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -68,7 +68,7 @@ gopts.opt('quiet', short='q',
@@ -70,7 +70,7 @@ gopts.opt('quiet', short='q',
use="Quiet.")
gopts.opt('path', val='PATH',

View File

@ -1,16 +1,17 @@
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
Index: xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -88,6 +88,7 @@ void xenstore_parse_domain_config(int hv
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
@@ -153,7 +153,7 @@ void xenstore_parse_domain_config(int hv
char *buf = NULL, *path;
char *fpath = NULL, *bpath = NULL, *btype = NULL,
*dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
int i, is_scsi, is_tap, is_hdN = 0;
+ int j;
- int i, any_hdN = 0, ret, is_tap;
+ int i, j, any_hdN = 0, ret, is_tap;
unsigned int len, num, hd_index, pci_devid = 0;
BlockDriverState *bs;
BlockDriver *format;
@@ -179,12 +180,7 @@ void xenstore_parse_domain_config(int hv
@@ -238,12 +238,7 @@ void xenstore_parse_domain_config(int hv
continue;
free(type);
type = xs_read(xsh, XBT_NULL, buf, &len);
@ -24,7 +25,7 @@ Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
/* read the name of the device */
if (pasprintf(&buf, "%s/type", bpath) == -1)
continue;
@@ -192,6 +188,35 @@ void xenstore_parse_domain_config(int hv
@@ -251,6 +246,35 @@ void xenstore_parse_domain_config(int hv
drv = xs_read(xsh, XBT_NULL, buf, &len);
if (drv == NULL)
continue;

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -1138,8 +1138,7 @@ def spawn_vnc(display):
@@ -1122,8 +1122,7 @@ def spawn_vnc(display):
returns the port that the vncviewer is listening on and sets the global
vncpid. On failure, returns 0. Note that vncviewer is daemonized.
"""
@ -10,5 +10,5 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
- "-listen", "%d" % (VNC_BASE_PORT + display) ])
+ vncargs = (["vncviewer", "-listen", "%d" % (display) ])
global vncpid
vncpid = daemonize("vncviewer", vncargs)
vncpid = utils.daemonize("vncviewer", vncargs)
if vncpid == 0:

View File

@ -1,53 +0,0 @@
Index: xen-3.3.0-testing/tools/ioemu/vnc.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vnc.c
+++ xen-3.3.0-testing/tools/ioemu/vnc.c
@@ -278,6 +278,7 @@ static void dequeue_framebuffer_update(V
static int is_empty_queue(VncState *vs);
static void free_queue(VncState *vs);
static void vnc_colourdepth(DisplayState *ds, int depth);
+static void vnc_write_newsize(VncState *vs);
#if 0
static inline void vnc_set_bit(uint32_t *d, int k)
@@ -407,11 +408,7 @@ static void vnc_dpy_resize_shared(Displa
vs->width = ds->width;
vs->height = ds->height;
if (vs->update_requested) {
- vnc_write_u8(vs, 0); /* msg id */
- vnc_write_u8(vs, 0);
- vnc_write_u16(vs, 1); /* number of rects */
- vnc_framebuffer_update(vs, 0, 0, ds->width, ds->height, -223);
- vnc_flush(vs);
+ vnc_write_newsize(vs);
vs->update_requested--;
} else {
enqueue_framebuffer_update(vs, 0, 0, ds->width, ds->height, -223);
@@ -429,6 +426,15 @@ static void vnc_dpy_resize(DisplayState
vnc_dpy_resize_shared(ds, w, h, 0, w * (ds->depth / 8), NULL);
}
+static void vnc_write_newsize(VncState *vs)
+{
+ vnc_write_u8(vs, 0); /* msg id */
+ vnc_write_u8(vs, 0);
+ vnc_write_u16(vs, 1); /* number of rects */
+ vnc_framebuffer_update(vs, 0, 0, vs->ds->width, vs->ds->height, -223);
+ vnc_flush(vs);
+}
+
/* fastest code */
static void vnc_write_pixels_copy(VncState *vs, void *pixels, int size)
{
@@ -1510,6 +1516,11 @@ static void set_encodings(VncState *vs,
break;
case -223: /* DesktopResize */
vs->has_resize = 1;
+ if (vs->width != vs->ds->width || vs->height != vs->ds->height) {
+ vnc_write_newsize(vs);
+ vs->width = vs->ds->width;
+ vs->height = vs->ds->height;
+ }
break;
case -257:
vs->has_pointer_type_change = 1;

View File

@ -92,7 +92,7 @@ Index: xen-3.3.0-testing/tools/xenstore/xenstored_core.c
TDB_CONTEXT *tdb_context(struct connection *conn)
{
@@ -1803,10 +1803,10 @@ int main(int argc, char *argv[])
@@ -1786,10 +1786,10 @@ int main(int argc, char *argv[])
remove_local = false;
break;
case 'S':
@ -175,25 +175,3 @@ Index: xen-3.3.0-testing/tools/libxen/src/xen_common.c
}
Index: xen-3.3.0-testing/tools/ioemu/hw/pass-through.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/pass-through.c
+++ xen-3.3.0-testing/tools/ioemu/hw/pass-through.c
@@ -1389,7 +1389,7 @@ static int pt_register_regions(struct pt
return 0;
}
-static int pt_unregister_regions(struct pt_dev *assigned_device)
+static void pt_unregister_regions(struct pt_dev *assigned_device)
{
int i, type, ret;
uint32_t e_size;
@@ -1434,7 +1434,7 @@ static int pt_unregister_regions(struct
}
}
-
+
}
uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)

View File

@ -5,7 +5,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-3.3.0-testing/tools/python/xen/xm/main.py
@@ -1871,6 +1871,10 @@ def xm_debug_keys(args):
@@ -1933,6 +1933,10 @@ def xm_debug_keys(args):
def xm_top(args):
arg_check(args, "top", 0)

View File

@ -1,7 +1,7 @@
Index: xen-3.3.0-testing/tools/examples/Makefile
Index: xen-4.0.0-testing/tools/examples/Makefile
===================================================================
--- xen-3.3.0-testing.orig/tools/examples/Makefile
+++ xen-3.3.0-testing/tools/examples/Makefile
--- xen-4.0.0-testing.orig/tools/examples/Makefile
+++ xen-4.0.0-testing/tools/examples/Makefile
@@ -13,7 +13,7 @@ XEN_CONFIGS += xm-config.xml
XEN_CONFIGS += xmexample1
XEN_CONFIGS += xmexample2

View File

@ -1,3 +1,44 @@
-------------------------------------------------------------------
Thu Aug 14 17:58:06 MDT 2008 - jfehlig@novell.com
- Added patch to prevent starting same domU from multiple hosts.
Feature is disabled by default - see /etc/xen/xend-config.sxp.
fate#305062
-------------------------------------------------------------------
Mon Aug 11 16:42:18 MDT 2008 - jfehlig@novell.com
- Added python-openssl to Requires list for xen-tools. This
package is required if SSL relocation is enabled by user.
-------------------------------------------------------------------
Mon Aug 11 14:44:03 MDT 2008 - carnold@novell.com
- Updated to xen-unstable changeset 18309. Pre 3.3.0-rc4.
-------------------------------------------------------------------
Sat Aug 9 13:22:37 MDT 2008 - jfehlig@novell.com
- Disabled xend-relocation-ssl-server for now. Certificates must
be created and feature needs testing.
-------------------------------------------------------------------
Fri Aug 8 15:34:04 MDT 2008 - carnold@novell.com
- Update to xen-unstable changeset 18269 post RC3. Reverse
version back to 3.3.0 from 4.0.0.
-------------------------------------------------------------------
Wed Aug 6 10:30:51 MDT 2008 - carnold@novell.com
- Updated to xen-unstable changeset 18242. Version changes from
3.3.0 to 4.0.0
-------------------------------------------------------------------
Thu Aug 4 10:25:01 MDT 2008 - carnold@novell.com
- Updated to xen-unstable changeset 18210. Post 3.3.0-rc2.
-------------------------------------------------------------------
Tue Jul 8 16:39:42 MDT 2008 - carnold@novell.com

144
xen.spec
View File

@ -1,10 +1,17 @@
#
# spec file for package xen (Version 3.3.0_17990_01)
# spec file for package xen (Version 3.3.0_18314_02)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@ -14,14 +21,14 @@
Name: xen
%define xvers 3.3
%define xvermaj 3
%define changeset 17990
%define changeset 18314
%define xen_build_dir xen-3.3.0-testing
%if %sles_version
%define with_kmp 1
%else
%define with_kmp 0
%endif
BuildRequires: LibVNCServer-devel SDL-devel automake bin86 curl-devel dev86 graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel pciutils-devel python-devel transfig
BuildRequires: LibVNCServer-devel SDL-devel automake bin86 curl-devel dev86 git graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel pciutils-devel python-devel transfig
%if %suse_version >= 1030
BuildRequires: texlive texlive-latex
%else
@ -33,7 +40,7 @@ BuildRequires: glibc-32bit glibc-devel-32bit
%if %{?with_kmp}0
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
Version: 3.3.0_17990_01
Version: 3.3.0_18314_02
Release: 1
License: GPL v2 only
Group: System/Kernel
@ -66,11 +73,11 @@ Patch101: xend-config.diff
Patch102: xen-destdir.diff
Patch103: xen-rpmoptflags.diff
Patch104: xen-warnings.diff
Patch105: xen-changeset.diff
Patch106: xen-paths.diff
Patch107: xen-xmexample.diff
Patch108: xen-xmexample-nbd.diff
Patch109: xen-fixme-doc.diff
Patch106: xen-changeset.diff
Patch107: xen-paths.diff
Patch108: xen-xmexample.diff
Patch109: xen-xmexample-nbd.diff
Patch110: xen-fixme-doc.diff
Patch111: xen-domUloader.diff
Patch112: xen-no-dummy-nfs-ip.diff
Patch113: serial-split.patch
@ -93,8 +100,7 @@ Patch134: xenapi-console-protocol.patch
Patch135: xen-disable-qemu-monitor.diff
Patch136: supported_module.diff
Patch137: qemu-security-etch1.diff
Patch138: vnc-i18n-keys.diff
Patch139: rpmlint.diff
Patch138: rpmlint.diff
Patch140: cdrom-removable.patch
Patch150: bridge-opensuse.patch
Patch151: bridge-vlan.diff
@ -104,33 +110,24 @@ Patch154: bridge-record-creation.patch
Patch155: xend-core-dump-loc.diff
Patch156: blktap.patch
Patch157: xen-api-auth.patch
Patch158: pv_32_16_color_trans.patch
Patch159: xen-qemu-iscsi-fix.patch
Patch160: keymap-vm.patch
Patch161: xen-vnc-resize.patch
Patch158: xen-qemu-iscsi-fix.patch
# Patches for snapshot support
Patch169: ioemu-blktap-fix-open.patch
Patch170: snapshot-ioemu-save.patch
Patch171: snapshot-ioemu-restore.patch
Patch172: snapshot-xend.patch
Patch173: ioemu-qcow2-multiblock-aio.patch
Patch174: ioemu-blktap-image-format.patch
Patch175: blktapctrl-default-to-ioemu.patch
Patch176: ioemu-blktap-barriers.patch
# Maybe later
Patch200: hvm-ide-flush-o_direct.patch
Patch175: build-tapdisk-ioemu.patch
Patch176: blktapctrl-default-to-ioemu.patch
Patch177: ioemu-blktap-barriers.patch
# Jim's domain lock patch
Patch190: xend-domain-lock.patch
# Patches from Jan
Patch240: xenctx.patch
Patch241: const-callback-arg.patch
Patch242: const-set-trap-table-arg.patch
Patch243: pv-drv-mkbuildtree.patch
Patch244: x86-compat-vcpu-op.patch
Patch245: x86-show-page-walk-early.patch
Patch246: svm-lmsl.patch
Patch247: x86_emulate.patch
Patch248: x86-pgtable-no-biglock.patch
Patch249: x86-extra-trap-info.patch
Patch240: x86-show-page-walk-early.patch
Patch241: svm-lmsl.patch
Patch242: x86-extra-trap-info.patch
Patch250: 32on64-extra-mem.patch
Patch251: x86-domain-shutdown-latency.patch
# PV Driver Patches
Patch350: pv-driver-build.patch
Patch351: xen-ioemu-hvm-pv-support.diff
@ -139,8 +136,6 @@ Patch352: pvdrv_emulation_control.patch
Patch400: ns_tools.patch
Patch401: ns_xen_base.patch
Patch402: ns_xen_extension.patch
# Temporary patch - remove as soon as kernel is updated
Patch900: tmp-revert-blktapctrl.patch
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
@ -257,7 +252,7 @@ License: GPL v2 or later
Summary: Xen Virtualization: Control tools for domain 0
Group: System/Kernel
Requires: xen-libs = %{version}
Requires: bridge-utils multipath-tools python python-curses python-pam python-xml pyxml
Requires: bridge-utils multipath-tools python python-curses python-openssl python-pam python-xml pyxml
#Requires: ipcalc
# subpackage existed in 10.3
Provides: xen-tools-ioemu = 3.2
@ -476,11 +471,11 @@ Authors:
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
#%patch109 -p1 Not Needed
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
@ -504,20 +499,17 @@ Authors:
%patch136 -p1
%patch137 -p1
%patch138 -p1
%patch139 -p1
%patch140 -p1
%patch150 -p1
%patch151 -p1
%patch152 -p1
#%patch153 -p1
#%patch153 -p1 hostonly
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch158 -p1
%patch159 -p1
%patch160 -p1
%patch161 -p1
%patch169 -p1
%patch170 -p1
%patch171 -p1
%patch172 -p1
@ -525,19 +517,12 @@ Authors:
%patch174 -p1
%patch175 -p1
%patch176 -p1
#%patch200 -p1
#%patch240 -p1 Upstream?
#%patch241 -p1 Upstream?
#%patch242 -p1 Upstream?
#%patch243 -p1 Upstream?
#%patch244 -p1 Upstream?
#%patch245 -p1 Upstream?
#%patch246 -p1 if upstream, has since been modified
#%patch247 -p1 ??
#%patch248 -p1 Upstream?
%patch249 -p1
#%patch250 -p1 Upstream?
#%patch251 -p1 Upstream?
%patch177 -p1
%patch190 -p1
%patch240 -p1
%patch241 -p1
%patch242 -p1
%patch250 -p1
%patch350 -p1
%patch351 -p1
%patch352 -p1
@ -547,7 +532,6 @@ Authors:
#%patch401 -p1
#%patch402 -p1
#%endif
%patch900 -p1
%build
XEN_EXTRAVERSION=%version-%release
@ -652,12 +636,12 @@ ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -m644 %SOURCE18 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop
# example config
mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples}
mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples,scripts}
mv $RPM_BUILD_ROOT/etc/xen/xmexample* $RPM_BUILD_ROOT/etc/xen/examples
rm $RPM_BUILD_ROOT/etc/xen/examples/*nbd
rm -f $RPM_BUILD_ROOT/etc/xen/examples/*nbd
install -m644 %SOURCE9 %SOURCE10 $RPM_BUILD_ROOT/etc/xen/examples/
# scripts
rm $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd
rm -f $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd
install -m755 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE16 %SOURCE17 $RPM_BUILD_ROOT/etc/xen/scripts/
# Xen API remote authentication files
install -d $RPM_BUILD_ROOT/etc/pam.d
@ -680,15 +664,19 @@ ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
# Bootloader
install -m755 %SOURCE8 $RPM_BUILD_ROOT/usr/lib/xen/boot/
# udev support
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules
#%find_lang xen-vm # po files are misnamed upstream
# Clean up unpackaged files
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/qemu/
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/xen/qemu/
rm -rf $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ps
rm $RPM_BUILD_ROOT/%{_mandir}/man1/qemu.*
rm $RPM_BUILD_ROOT/usr/sbin/netfix
rm $RPM_BUILD_ROOT/usr/lib*/xen/bin/qemu-dm.debug
rm -rf $RPM_BUILD_ROOT/usr/share/xen/man/man1/qemu/qemu*
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc32
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc64
rm -f $RPM_BUILD_ROOT/usr/sbin/netfix
rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
rm -rf $RPM_BUILD_ROOT/html
rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.*
%files
%defattr(-,root,root)
@ -721,6 +709,8 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/usr/bin/xenstore*
/usr/bin/xentrace*
/usr/bin/pygrub
/usr/bin/qemu-img-xen
/usr/bin/tapdisk-ioemu
/usr/sbin/blktapctrl
/usr/sbin/flask-loadpolicy
/usr/sbin/img2qcow
@ -729,10 +719,10 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/usr/sbin/rcxend
/usr/sbin/rcxendomains
/usr/sbin/tapdisk
/usr/sbin/tapdisk-ioemu
/usr/sbin/xen*
/usr/sbin/xm
/usr/sbin/xsview
/usr/sbin/fs-backend
%dir %{_libdir}/xen
%dir %{_libdir}/xen/bin
%ifarch x86_64
@ -771,6 +761,7 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/etc/xen/images
/etc/xen/qemu-ifup
/etc/xen/scripts
/etc/xen/README*
%config /etc/xen/vm
%config /etc/xen/*.sxp
%config /etc/xen/*.xml
@ -791,9 +782,12 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
%dir %pysite/grub
# formerly tools-ioemu
%dir %{_datadir}/xen
%dir %{_datadir}/xen/man
%dir %{_datadir}/xen/man/man1
%dir %{_datadir}/xen/qemu
%dir %{_datadir}/xen/qemu/keymaps
%{_datadir}/xen/qemu/keymaps/*
%{_datadir}/xen/qemu/*
%{_datadir}/xen/man/man1/*
%{_libdir}/xen/bin/qemu-dm
%ifarch x86_64
/usr/lib/xen/bin/qemu-dm
@ -860,6 +854,26 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/sbin/ldconfig
%changelog
* Thu Aug 14 2008 jfehlig@novell.com
- Added patch to prevent starting same domU from multiple hosts.
Feature is disabled by default - see /etc/xen/xend-config.sxp.
fate#305062
* Mon Aug 11 2008 jfehlig@novell.com
- Added python-openssl to Requires list for xen-tools. This
package is required if SSL relocation is enabled by user.
* Mon Aug 11 2008 carnold@novell.com
- Updated to xen-unstable changeset 18309. Pre 3.3.0-rc4.
* Sat Aug 09 2008 jfehlig@novell.com
- Disabled xend-relocation-ssl-server for now. Certificates must
be created and feature needs testing.
* Fri Aug 08 2008 carnold@novell.com
- Update to xen-unstable changeset 18269 post RC3. Reverse
version back to 3.3.0 from 4.0.0.
* Wed Aug 06 2008 carnold@novell.com
- Updated to xen-unstable changeset 18242. Version changes from
3.3.0 to 4.0.0
* Mon Aug 04 2008 carnold@novell.com
- Updated to xen-unstable changeset 18210. Post 3.3.0-rc2.
* Tue Jul 08 2008 carnold@novell.com
- Updated to xen-unstable changeset 17990.
* Tue Jul 08 2008 kwolf@suse.de

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -3216,6 +3216,14 @@ class XendDomainInfo:
@@ -3242,6 +3242,14 @@ class XendDomainInfo:
if not config.has_key('backend'):
config['backend'] = "00000000-0000-0000-0000-000000000000"

View File

@ -1,163 +0,0 @@
Index: 2007-12-10/tools/xentrace/xenctx.c
===================================================================
--- 2007-12-10.orig/tools/xentrace/xenctx.c 2007-11-26 16:57:02.000000000 +0100
+++ 2007-12-10/tools/xentrace/xenctx.c 2007-12-10 09:19:27.000000000 +0100
@@ -29,6 +29,7 @@ int xc_handle = 0;
int domid = 0;
int frame_ptrs = 0;
int stack_trace = 0;
+int disp_all = 0;
#if defined (__i386__)
#if defined (__OpenBSD__)
@@ -243,12 +244,23 @@ void print_flags(uint64_t flags)
{
int i;
- printf("flags: %08" PRIx64, flags);
+ printf("\nflags: %08" PRIx64, flags);
for (i = 21; i >= 0; i--) {
char *s = flag_values[i][(flags >> i) & 1];
if (s != NULL)
printf(" %s", s);
}
+ printf("\n");
+}
+
+void print_special(unsigned long *regs, const char *name, unsigned int mask)
+{
+ unsigned int i;
+
+ printf("\n");
+ for (i = 0; mask; mask >>= 1, ++i)
+ if (mask & 1)
+ printf("%s%u: " FMT_SIZE_T "\n", name, i, (size_t)regs[i]);
}
#endif
@@ -257,12 +269,10 @@ void print_ctx(vcpu_guest_context_t *ctx
{
struct cpu_user_regs *regs = &ctx1->user_regs;
- printf("eip: %08x ", regs->eip);
+ printf("cs:eip: %04x:%08x ", regs->cs, regs->eip);
print_symbol(regs->eip);
print_flags(regs->eflags);
- printf("\n");
-
- printf("esp: %08x\n", regs->esp);
+ printf("ss:esp: %04x:%08x\n", regs->ss, regs->esp);
printf("eax: %08x\t", regs->eax);
printf("ebx: %08x\t", regs->ebx);
@@ -273,47 +283,59 @@ void print_ctx(vcpu_guest_context_t *ctx
printf("edi: %08x\t", regs->edi);
printf("ebp: %08x\n", regs->ebp);
- printf(" cs: %08x\t", regs->cs);
- printf(" ds: %08x\t", regs->ds);
- printf(" fs: %08x\t", regs->fs);
- printf(" gs: %08x\n", regs->gs);
+ printf(" ds: %04x\t", regs->ds);
+ printf(" es: %04x\t", regs->es);
+ printf(" fs: %04x\t", regs->fs);
+ printf(" gs: %04x\n", regs->gs);
+ if (disp_all) {
+ print_special(ctx1->ctrlreg, "cr", 0x1d);
+ print_special(ctx1->debugreg, "dr", 0xcf);
+ }
}
#elif defined(__x86_64__)
void print_ctx(vcpu_guest_context_t *ctx1)
{
struct cpu_user_regs *regs = &ctx1->user_regs;
- printf("rip: %08lx ", regs->rip);
+ printf("rip: %016lx ", regs->rip);
print_symbol(regs->rip);
print_flags(regs->rflags);
- printf("\n");
- printf("rsp: %08lx\n", regs->rsp);
-
- printf("rax: %08lx\t", regs->rax);
- printf("rbx: %08lx\t", regs->rbx);
- printf("rcx: %08lx\t", regs->rcx);
- printf("rdx: %08lx\n", regs->rdx);
-
- printf("rsi: %08lx\t", regs->rsi);
- printf("rdi: %08lx\t", regs->rdi);
- printf("rbp: %08lx\n", regs->rbp);
-
- printf(" r8: %08lx\t", regs->r8);
- printf(" r9: %08lx\t", regs->r9);
- printf("r10: %08lx\t", regs->r10);
- printf("r11: %08lx\n", regs->r11);
-
- printf("r12: %08lx\t", regs->r12);
- printf("r13: %08lx\t", regs->r13);
- printf("r14: %08lx\t", regs->r14);
- printf("r15: %08lx\n", regs->r15);
-
- printf(" cs: %04x\t", regs->cs);
- printf(" ds: %04x\t", regs->ds);
- printf(" fs: %04x\t", regs->fs);
- printf(" gs: %04x\n", regs->gs);
+ printf("rsp: %016lx\n", regs->rsp);
+ printf("rax: %016lx\t", regs->rax);
+ printf("rcx: %016lx\t", regs->rcx);
+ printf("rdx: %016lx\n", regs->rdx);
+
+ printf("rbx: %016lx\t", regs->rbx);
+ printf("rsi: %016lx\t", regs->rsi);
+ printf("rdi: %016lx\n", regs->rdi);
+
+ printf("rbp: %016lx\t", regs->rbp);
+ printf(" r8: %016lx\t", regs->r8);
+ printf(" r9: %016lx\n", regs->r9);
+
+ printf("r10: %016lx\t", regs->r10);
+ printf("r11: %016lx\t", regs->r11);
+ printf("r12: %016lx\n", regs->r12);
+
+ printf("r13: %016lx\t", regs->r13);
+ printf("r14: %016lx\t", regs->r14);
+ printf("r15: %016lx\n", regs->r15);
+
+ printf(" cs: %04x\t", regs->cs);
+ printf(" ss: %04x\t", regs->ss);
+ printf(" ds: %04x\t", regs->ds);
+ printf(" es: %04x\n", regs->es);
+
+ printf(" fs: %04x @ %016lx\n", regs->fs, ctx1->fs_base);
+ printf(" gs: %04x @ %016lx/%016lx\n", regs->gs,
+ ctx1->gs_base_kernel, ctx1->gs_base_user);
+
+ if (disp_all) {
+ print_special(ctx1->ctrlreg, "cr", 0x1d);
+ print_special(ctx1->debugreg, "dr", 0xcf);
+ }
}
#elif defined(__ia64__)
@@ -742,6 +764,8 @@ void usage(void)
#ifdef __ia64__
printf(" -r LIST, --regs=LIST display more registers.\n");
printf(" -a --all same as --regs=tlb,cr,ar,br,bk\n");
+#else
+ printf(" -a --all display more registers\n");
#endif
}
@@ -811,6 +835,10 @@ int main(int argc, char **argv)
disp_bank_regs = 1;
disp_tlb = 1;
break;
+#else
+ case 'a':
+ disp_all = 1;
+ break;
#endif
case 'h':
usage();

View File

@ -31,7 +31,7 @@ Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
===================================================================
--- xen-3.3.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.3.0-testing/tools/examples/xend-config.sxp
@@ -54,12 +54,14 @@
@@ -54,11 +54,12 @@
#(xend-http-server no)
@ -43,13 +43,10 @@ Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
+# encryption and authentication.
#(xend-relocation-server no)
-(xend-relocation-server yes)
-#(xend-relocation-ssl-server no)
+# Enable xend-relocation-ssl-server for encrypted relocations.
+(xend-relocation-ssl-server yes)
#(xend-relocation-ssl-server no)
#(xend-unix-path /var/lib/xend/xend-socket)
@@ -181,7 +183,7 @@
@@ -181,7 +182,7 @@
# dom0-min-mem is the lowest permissible memory level (in MB) for dom0.
# This is a minimum both for auto-ballooning (as enabled by
# enable-dom0-ballooning below) and for xm mem-set when applied to dom0.

View File

@ -2,7 +2,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1852,7 +1852,7 @@ class XendDomainInfo:
@@ -1864,7 +1864,7 @@ class XendDomainInfo:
try:
if not corefile:
this_time = time.strftime("%Y-%m%d-%H%M.%S", time.localtime())

328
xend-domain-lock.patch Normal file
View File

@ -0,0 +1,328 @@
Index: xen-3.3.0-testing/tools/examples/domain-lock
===================================================================
--- /dev/null
+++ xen-3.3.0-testing/tools/examples/domain-lock
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+set +x
+
+usage() {
+ echo "usage: domain-lock [-l|-u|-s] -p <vm-config-path> [-n <vm-name>] [-i <vm-uuid>] [-h <vm-host>]"
+ echo ""
+ echo "-l lock"
+ echo "-u unlock"
+ echo "-s status (default)"
+ echo "-p Required argument indicating path for lock file"
+ echo "-n Virtual Machine name"
+ echo "-i Virtual Machine Id or UUID"
+ echo "-h Virtual Machine Server (Host) name"
+ exit 1
+}
+
+create_lock() {
+ local path=$1
+ local name=$2
+ local uuid=$3
+ local host=$4
+
+ path=$path/lock
+ cat > $path <<EOF
+$name $uuid $host
+EOF
+}
+
+remove_lock(){
+ local path=$1/lock
+
+ rm -f $path
+}
+
+get_status() {
+ local path=$1/lock
+
+ [ -f $path ] || exit 1
+ echo `cat $path`
+}
+
+mode="status"
+
+while getopts ":lusp:n:i:h:" opt; do
+ case $opt in
+ l )
+ mode="lock"
+ ;;
+ u )
+ mode="unlock"
+ ;;
+ s )
+ mode="status"
+ ;;
+ p )
+ vm_path=$OPTARG
+ ;;
+ n )
+ vm_name=$OPTARG
+ ;;
+ i )
+ vm_uuid=$OPTARG
+ ;;
+ h )
+ vm_host=$OPTARG
+ ;;
+ \? )
+ usage
+ ;;
+ esac
+done
+
+[ -z $vm_path ] && usage
+
+case $mode in
+ lock )
+ create_lock $vm_path $vm_name $vm_uuid $vm_host
+ ;;
+ unlock )
+ remove_lock $vm_path
+ ;;
+ status )
+ get_status $vm_path
+ ;;
+esac
Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
===================================================================
--- xen-3.3.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.3.0-testing/tools/examples/xend-config.sxp
@@ -250,4 +250,44 @@
# Path where persistent domain configuration is stored.
# Default is /var/lib/xend/domains/
+#
#(xend-domains-path /var/lib/xend/domains)
+
+# Create a lock file when domains are started. Lock file is
+# placed in xend-domains-path/<domain_uuid> on domain startup
+# and removed when domain is stopped. By default, a lock file
+# is not created. Set to yes to enable lock file creation.
+#
+#(xend-domain-lock no)
+
+# Path where domain lock is stored if xend-domain-lock is enabled.
+# Note: This path must be accessible to all VM Servers participating
+# in domain locking, e.g. by specifying a shared mount point.
+# Lock is placed in <xend-domain-lock-path>/<domain-uuid>.
+# Default is /var/lib/xend/domains/
+#
+#(xend-domain-lock-path /var/lib/xend/domains)
+
+# External locking utility for acquiring/releasing domain lock.
+# By default /etc/xen/scripts/domain-lock will be used if
+# xend-domain-lock is set to yes. Set to path of custom
+# locking utility to override the default. Locking utility
+# should accept
+# <-l | -u | -s> -p <vm-config-path> [-n <vm-name>] [-i <vm-id>]
+# [-h <vm-host>]
+# command line options. Utility should return zero on success,
+# non-zero on error.
+# -l lock Acquire (create) lock file
+# -u unlock Remove lock file
+# -s status Default action. If lock file exists, print contents on
+# stdout and return 0)
+# -p path Required. Path where lock file should be written.
+# -n vm-name Name of domain
+# -i vm-id Id or UUID of domain
+# -h vm-host Name of host machine (dom0)
+#
+# The /etc/xen/scripts/domain-lock default utility will create
+# <xend-domain-lock-path>/<vm-uuid>/lock and write <vm-name>, <vm-id>,
+# and <vm-host> (if supplied) to the lock file in that order.
+#
+#(xend-domain-lock-utility domain-lock)
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -30,11 +30,13 @@ import threading
import re
import copy
import os
+import stat
+import shutil
import traceback
from types import StringTypes
import xen.lowlevel.xc
-from xen.util import asserts
+from xen.util import asserts, mkdir
from xen.util.blkif import parse_uname
import xen.util.xsm.xsm as security
from xen.util import xsconstants
@@ -421,6 +423,7 @@ class XendDomainInfo:
if self._stateGet() in (XEN_API_VM_POWER_STATE_HALTED, XEN_API_VM_POWER_STATE_SUSPENDED, XEN_API_VM_POWER_STATE_CRASHED):
try:
+ self.acquire_running_lock();
XendTask.log_progress(0, 30, self._constructDomain)
XendTask.log_progress(31, 60, self._initDomain)
@@ -453,6 +456,7 @@ class XendDomainInfo:
state = self._stateGet()
if state in (DOM_STATE_SUSPENDED, DOM_STATE_HALTED):
try:
+ self.acquire_running_lock();
self._constructDomain()
self._storeVmDetails()
self._createDevices()
@@ -2317,6 +2321,11 @@ class XendDomainInfo:
self._stateSet(DOM_STATE_HALTED)
self.domid = None # Do not push into _stateSet()!
+
+ try:
+ self.release_running_lock()
+ except:
+ log.exception("Failed to release domain lock.")
finally:
self.refresh_shutdown_lock.release()
@@ -3555,6 +3564,74 @@ class XendDomainInfo:
def has_device(self, dev_class, dev_uuid):
return (dev_uuid in self.info['%s_refs' % dev_class.lower()])
+ # Check if domain has a lock file present
+ def is_dom_locked(self, path):
+ status = os.system('%s -s -p %s' % \
+ (xoptions.get_xend_domain_lock_utility(), \
+ path))
+
+ return status == 0
+
+ # Return name of host contained in lock file. Host should be last
+ # entry in the lock file.
+ def get_lock_host(self, path):
+ fin = os.popen(xoptions.get_xend_domain_lock_utility() + \
+ ' -s -p ' + path, 'r')
+ hostname = "unknown"
+
+ try:
+ line = fin.readline()
+ hostname = line.split()[-1]
+ finally:
+ fin.close()
+ return hostname
+
+ # Acquire a lock for the domain. No-op if domain locking is turned off.
+ def acquire_running_lock(self):
+ if not xoptions.get_xend_domain_lock():
+ return
+
+ path = xoptions.get_xend_domain_lock_path()
+ path = os.path.join(path, self.get_uuid())
+
+ if self.is_dom_locked(path):
+ raise XendError("The VM is locked and appears to be running on host %s." % self.get_lock_host(path))
+
+ try:
+ if not os.path.exists(path):
+ mkdir.parents(path, stat.S_IRWXU)
+ except:
+ log.exception("%s could not be created." % path)
+ raise XendError("%s could not be created." % path)
+
+ status = os.system('%s -l -p %s -n %s -i %s -h %s' % \
+ (xoptions.get_xend_domain_lock_utility(), \
+ path, \
+ self.info['name_label'], \
+ self.info['uuid'], \
+ XendNode.instance().get_name()))
+ if status != 0:
+ raise XendError('Acquire running lock failed: %s' % status)
+
+ # Release lock for domain. Should be called at end of domain cleanup
+ def release_running_lock(self):
+ if not xoptions.get_xend_domain_lock():
+ return
+
+ path = xoptions.get_xend_domain_lock_path()
+ path = os.path.join(path, self.get_uuid())
+ status = os.system('%s -u -p %s' % \
+ (xoptions.get_xend_domain_lock_utility(), \
+ path))
+ if status != 0:
+ log.exception("Release running lock failed: %s" % status)
+ try:
+ if len(os.listdir(path)) == 0:
+ shutil.rmtree(path)
+ except:
+ log.exception("Failed to remove unmanaged directory %s." % path)
+
+
def __str__(self):
return '<domain id=%s name=%s memory=%s state=%s>' % \
(str(self.domid), self.info['name_label'],
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
@@ -1294,6 +1294,7 @@ class XendDomain:
POWER_STATE_NAMES[DOM_STATE_RUNNING],
POWER_STATE_NAMES[dominfo._stateGet()])
+ dominfo.release_running_lock();
""" The following call may raise a XendError exception """
dominfo.testMigrateDevices(True, dst)
Index: xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendOptions.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
@@ -135,6 +135,17 @@ class XendOptions:
"""Default rotation count of qemu-dm log file."""
qemu_dm_logrotate_count = 10
+ """Default for the flag indicating whether xend should create
+ a lock file for domains when they are started."""
+ xend_domain_lock = 'no'
+
+ """Default domain lock storage path."""
+ xend_domain_lock_path_default = '/var/lib/xend/domains'
+
+ """Default script to acquire/release domain lock"""
+ xend_domain_lock_utility = osdep.scripts_dir + "/domain-lock"
+
+
def __init__(self):
self.configure()
@@ -358,6 +369,19 @@ class XendOptions:
return self.get_config_int("qemu-dm-logrotate-count",
self.qemu_dm_logrotate_count)
+ def get_xend_domain_lock(self):
+ """Get the flag indicating whether xend should create a lock file
+ for domains when they are started."""
+ return self.get_config_bool("xend-domain-lock", self.xend_domain_lock)
+
+ def get_xend_domain_lock_path(self):
+ """ Get the path for domain lock storage
+ """
+ return self.get_config_string("xend-domain-lock-path", self.xend_domain_lock_path_default)
+
+ def get_xend_domain_lock_utility(self):
+ return self.get_config_string('xend-domain-lock-utility', self.xend_domain_lock_utility)
+
class XendOptionsFile(XendOptions):
Index: xen-3.3.0-testing/tools/examples/Makefile
===================================================================
--- xen-3.3.0-testing.orig/tools/examples/Makefile
+++ xen-3.3.0-testing/tools/examples/Makefile
@@ -36,6 +36,7 @@ XEN_SCRIPTS += vtpm vtpm-delete
XEN_SCRIPTS += xen-hotplug-cleanup
XEN_SCRIPTS += external-device-migrate
XEN_SCRIPTS += vscsi
+XEN_SCRIPTS += domain-lock
XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh

View File

@ -1,7 +1,7 @@
Index: xen-unstable/tools/xm-test/tests/save/01_save_basic_pos.py
Index: xen-3.3.0-testing/tools/xm-test/tests/save/01_save_basic_pos.py
===================================================================
--- xen-unstable.orig/tools/xm-test/tests/save/01_save_basic_pos.py
+++ xen-unstable/tools/xm-test/tests/save/01_save_basic_pos.py
--- xen-3.3.0-testing.orig/tools/xm-test/tests/save/01_save_basic_pos.py
+++ xen-3.3.0-testing/tools/xm-test/tests/save/01_save_basic_pos.py
@@ -35,3 +35,9 @@ if s != 0:
# Make sure it's gone
if isDomainRunning(domain.getName()):