This commit is contained in:
parent
258bc46c96
commit
997dde689d
1421
18412-x86-page-type-preemptible.patch
Normal file
1421
18412-x86-page-type-preemptible.patch
Normal file
File diff suppressed because it is too large
Load Diff
51
18420-x86-page-type-preemptible-fix.patch
Normal file
51
18420-x86-page-type-preemptible-fix.patch
Normal file
@ -0,0 +1,51 @@
|
||||
# HG changeset patch
|
||||
# User Keir Fraser <keir.fraser@citrix.com>
|
||||
# Date 1220450168 -3600
|
||||
# Node ID c9db93b0660ae644491c862e47744a2349ba630f
|
||||
# Parent 1e98ea5c860438a227e135701e6439b22826f52f
|
||||
x86: Fix interpretation of get_l*e_linear_pagetable().
|
||||
|
||||
Broken by get_page_type() preemption patch (c/s 18412).
|
||||
|
||||
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
||||
|
||||
Index: xen-3.3.0-testing/xen/arch/x86/mm.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/xen/arch/x86/mm.c
|
||||
+++ xen-3.3.0-testing/xen/arch/x86/mm.c
|
||||
@@ -762,9 +762,8 @@ get_page_from_l2e(
|
||||
|
||||
rc = get_page_and_type_from_pagenr(
|
||||
l2e_get_pfn(l2e), PGT_l1_page_table, d, 0);
|
||||
- if ( unlikely(rc) && rc != -EAGAIN &&
|
||||
- get_l2_linear_pagetable(l2e, pfn, d) )
|
||||
- rc = -EINVAL;
|
||||
+ if ( unlikely(rc == -EINVAL) && get_l2_linear_pagetable(l2e, pfn, d) )
|
||||
+ rc = 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -788,9 +787,8 @@ get_page_from_l3e(
|
||||
|
||||
rc = get_page_and_type_from_pagenr(
|
||||
l3e_get_pfn(l3e), PGT_l2_page_table, d, preemptible);
|
||||
- if ( unlikely(rc) && rc != -EAGAIN && rc != -EINTR &&
|
||||
- get_l3_linear_pagetable(l3e, pfn, d) )
|
||||
- rc = -EINVAL;
|
||||
+ if ( unlikely(rc == -EINVAL) && get_l3_linear_pagetable(l3e, pfn, d) )
|
||||
+ rc = 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -814,9 +812,8 @@ get_page_from_l4e(
|
||||
|
||||
rc = get_page_and_type_from_pagenr(
|
||||
l4e_get_pfn(l4e), PGT_l3_page_table, d, preemptible);
|
||||
- if ( unlikely(rc) && rc != -EAGAIN && rc != -EINTR &&
|
||||
- get_l4_linear_pagetable(l4e, pfn, d) )
|
||||
- rc = -EINVAL;
|
||||
+ if ( unlikely(rc == -EINVAL) && get_l4_linear_pagetable(l4e, pfn, d) )
|
||||
+ rc = 0;
|
||||
|
||||
return rc;
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
Index: xen-3.3.1-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
|
||||
@@ -2255,7 +2255,7 @@ class XendDomainInfo:
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -2277,7 +2277,7 @@ class XendDomainInfo:
|
||||
vtd_mem = ((vtd_mem + 1023) / 1024) * 1024
|
||||
|
||||
# Make sure there's enough RAM available for the domain
|
||||
|
741
blktap-pv-cdrom.patch
Normal file
741
blktap-pv-cdrom.patch
Normal file
@ -0,0 +1,741 @@
|
||||
Index: xen-3.3.1-testing/tools/blktap/drivers/block-cdrom.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ xen-3.3.1-testing/tools/blktap/drivers/block-cdrom.c 2008-09-10 14:22:17.000000000 -0600
|
||||
@@ -0,0 +1,533 @@
|
||||
+/* block-cdrom.c
|
||||
+ *
|
||||
+ * simple slow synchronous cdrom disk implementation. Based off
|
||||
+ * of block-sync.c
|
||||
+ *
|
||||
+ * (c) 2006 Andrew Warfield and Julian Chesterfield
|
||||
+ * (c) 2008 Novell Inc. <plc@novell.com>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License version 2
|
||||
+ * as published by the Free Software Foundation; or, when distributed
|
||||
+ * separately from the Linux kernel or incorporated into other
|
||||
+ * software packages, subject to the following license:
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
+ * of this source file (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use, copy, modify,
|
||||
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
+ * and to permit persons to whom the Software is furnished to do so, subject to
|
||||
+ * the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be included in
|
||||
+ * all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
+ * IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+#include <string.h>
|
||||
+#include <linux/cdrom.h>
|
||||
+#include <sys/statvfs.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <linux/fs.h>
|
||||
+
|
||||
+#include "tapdisk.h"
|
||||
+#include <xen/io/cdromif.h>
|
||||
+
|
||||
+struct tdcdrom_state {
|
||||
+ int fd;
|
||||
+ int xs_fd; /* for xen event polling */
|
||||
+ int media_present;
|
||||
+ int media_changed;
|
||||
+ struct xs_handle *xs_handle;
|
||||
+ char *dev_name;
|
||||
+ int dev_type;
|
||||
+ td_flag_t flags;
|
||||
+};
|
||||
+
|
||||
+#define BLOCK_DEVICE 0
|
||||
+#define FILE_DEVICE 1
|
||||
+#define CDROM_DEFAULT_SECTOR_SIZE 2048
|
||||
+#define CDROM_DEFAULT_SIZE 2000000000
|
||||
+
|
||||
+/*Get Image size, secsize*/
|
||||
+static void get_image_info(struct disk_driver *dd)
|
||||
+{
|
||||
+ int ret;
|
||||
+ long size;
|
||||
+ unsigned long total_size;
|
||||
+ struct statvfs statBuf;
|
||||
+ struct stat stat;
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+
|
||||
+ s->size = 0;
|
||||
+ s->sector_size = CDROM_DEFAULT_SECTOR_SIZE;
|
||||
+ s->info = (VDISK_CDROM | VDISK_REMOVABLE | VDISK_READONLY);
|
||||
+ prv->media_present = 0;
|
||||
+
|
||||
+ ret = fstat(prv->fd, &stat);
|
||||
+ if (ret != 0) {
|
||||
+ DPRINTF("ERROR: fstat failed, Couldn't stat image");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (S_ISBLK(stat.st_mode)) {
|
||||
+ /*Accessing block device directly*/
|
||||
+ int status;
|
||||
+
|
||||
+ prv->dev_type = BLOCK_DEVICE;
|
||||
+ status = ioctl(prv->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
|
||||
+ if (status == CDS_DISC_OK) {
|
||||
+ prv->media_present = 1;
|
||||
+ if ((ret =ioctl(prv->fd,BLKGETSIZE,&s->size))!=0) {
|
||||
+ DPRINTF("ERR: BLKGETSIZE failed, couldn't stat image");
|
||||
+ s->size = CDROM_DEFAULT_SIZE;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ s->size = CDROM_DEFAULT_SIZE;
|
||||
+ }
|
||||
+ /*Get the sector size*/
|
||||
+#if defined(BLKSSZGET)
|
||||
+ {
|
||||
+ int arg;
|
||||
+ s->sector_size = CDROM_DEFAULT_SECTOR_SIZE;
|
||||
+ ioctl(prv->fd, BLKSSZGET, &s->sector_size);
|
||||
+
|
||||
+ if (s->sector_size != CDROM_DEFAULT_SECTOR_SIZE)
|
||||
+ DPRINTF("Note: sector size is %ld (not %d)\n",
|
||||
+ s->sector_size, CDROM_DEFAULT_SECTOR_SIZE);
|
||||
+ }
|
||||
+#else
|
||||
+ s->sector_size = CDROM_DEFAULT_SECTOR_SIZE;
|
||||
+#endif
|
||||
+ DPRINTF("Block Device: Image size: %llu",
|
||||
+ (long long unsigned)s->size);
|
||||
+ DPRINTF("\t media_present: %d sector_size: %lu\n",
|
||||
+ prv->media_present, s->sector_size);
|
||||
+ } else {
|
||||
+ /*Local file? try fstat instead*/
|
||||
+ prv->dev_type = FILE_DEVICE;
|
||||
+ prv->media_present = 1;
|
||||
+ s->size = (stat.st_size >> SECTOR_SHIFT);
|
||||
+ s->sector_size = DEFAULT_SECTOR_SIZE;
|
||||
+ DPRINTF("Local File: Image size: %llu\n",
|
||||
+ (long long unsigned)s->size);
|
||||
+ }
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static inline void init_fds(struct disk_driver *dd)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+
|
||||
+ for(i = 0; i < MAX_IOFD; i++)
|
||||
+ dd->io_fd[i] = 0;
|
||||
+
|
||||
+ prv->xs_handle = xs_daemon_open();
|
||||
+ prv->xs_fd = xs_fileno(prv->xs_handle);
|
||||
+ dd->io_fd[0] = prv->xs_fd;
|
||||
+}
|
||||
+
|
||||
+void open_device (struct disk_driver *dd)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ int o_flags;
|
||||
+
|
||||
+ o_flags = O_NONBLOCK | O_DIRECT | O_LARGEFILE |
|
||||
+ ((prv->flags == TD_RDONLY) ? O_RDONLY : O_RDWR);
|
||||
+
|
||||
+ if (prv->fd < 0) {
|
||||
+ prv->fd = open(prv->dev_name, o_flags);
|
||||
+ if ( (prv->fd == -1) && (errno == EINVAL) ) {
|
||||
+ /* Maybe O_DIRECT isn't supported. */
|
||||
+ o_flags &= ~O_DIRECT;
|
||||
+ prv->fd = open(prv->dev_name, o_flags);
|
||||
+ if (prv->fd != -1) {
|
||||
+ DPRINTF("WARNING: Accessing image without O_DIRECT! (%s)\n", prv->dev_name);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (prv->fd != -1) {
|
||||
+
|
||||
+ get_image_info(dd);
|
||||
+
|
||||
+ if (prv->dev_type == BLOCK_DEVICE) {
|
||||
+ int status;
|
||||
+ status = ioctl(prv->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
|
||||
+ switch (status) {
|
||||
+ case CDS_DISC_OK:
|
||||
+ prv->media_present = 1;
|
||||
+ break;
|
||||
+ default:
|
||||
+ prv->media_present = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ prv->media_present = 1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Main entry point, called when first loaded
|
||||
+ */
|
||||
+int tdcdrom_open (struct disk_driver *dd, const char *name, td_flag_t flags)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+
|
||||
+ asprintf(&prv->dev_name, "%s", name);
|
||||
+ prv->fd = -1;
|
||||
+ prv->media_changed = 0;
|
||||
+ prv->media_present = 0;
|
||||
+ prv->flags = flags;
|
||||
+ init_fds(dd);
|
||||
+
|
||||
+ open_device(dd);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_queue_read(struct disk_driver *dd, uint64_t sector,
|
||||
+ int nb_sectors, char *buf, td_callback_t cb,
|
||||
+ int id, void *private)
|
||||
+{
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ int size = nb_sectors * s->sector_size;
|
||||
+ uint64_t offset = sector * (uint64_t)s->sector_size;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (prv->fd == -1 || prv->media_present == 0) {
|
||||
+ ret = 0 - ENOMEDIUM;
|
||||
+ return cb(dd, (ret < 0) ? ret: 0, sector, nb_sectors, id, private);
|
||||
+ }
|
||||
+ size = nb_sectors * 512;
|
||||
+ offset = sector * (uint64_t)512;
|
||||
+ ret = lseek(prv->fd, offset, SEEK_SET);
|
||||
+ if (ret != (off_t)-1) {
|
||||
+ ret = read(prv->fd, buf, size);
|
||||
+ if (ret != size) {
|
||||
+ ret = 0 - errno;
|
||||
+ } else {
|
||||
+ ret = 1;
|
||||
+ }
|
||||
+ } else ret = 0 - errno;
|
||||
+
|
||||
+ return cb(dd, (ret < 0) ? ret: 0, sector, nb_sectors, id, private);
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_queue_write(struct disk_driver *dd, uint64_t sector,
|
||||
+ int nb_sectors, char *buf, td_callback_t cb,
|
||||
+ int id, void *private)
|
||||
+{
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ int size = nb_sectors * s->sector_size;
|
||||
+ uint64_t offset = sector * (uint64_t)s->sector_size;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (prv->fd == -1 || prv->media_present == 0) {
|
||||
+ ret = 0 - ENOMEDIUM;
|
||||
+ return cb(dd, (ret < 0) ? ret: 0, sector, nb_sectors, id, private);
|
||||
+ }
|
||||
+ ret = lseek(prv->fd, offset, SEEK_SET);
|
||||
+ if (ret != (off_t)-1) {
|
||||
+ ret = write(prv->fd, buf, size);
|
||||
+ if (ret != size) {
|
||||
+ ret = 0 - errno;
|
||||
+ } else {
|
||||
+ ret = 1;
|
||||
+ }
|
||||
+ } else ret = 0 - errno;
|
||||
+
|
||||
+ return cb(dd, (ret < 0) ? ret : 0, sector, nb_sectors, id, private);
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_queue_packet(struct disk_driver *dd, uint64_t sector,
|
||||
+ int nb_sectors, char *buf, td_callback_t cb,
|
||||
+ int id, void *private)
|
||||
+{
|
||||
+ struct td_state *s = dd->td_state;
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ int size = nb_sectors * s->sector_size;
|
||||
+ uint64_t offset = sector * (uint64_t)s->sector_size;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ union xen_block_packet *sp;
|
||||
+ struct xen_cdrom_packet *xcp;
|
||||
+ struct xen_cdrom_support *xcs;
|
||||
+ struct xen_cdrom_open *xco;
|
||||
+ struct xen_cdrom_media_info *xcmi;
|
||||
+ struct xen_cdrom_media_changed *xcmc;
|
||||
+ struct cdrom_generic_command cgc;
|
||||
+ struct vcd_generic_command * vgc;
|
||||
+ struct request_sense sense;
|
||||
+
|
||||
+ sp = (union xen_block_packet *)buf;
|
||||
+ sp->err = 0;
|
||||
+ sp->ret = 0;
|
||||
+ switch(sp->type) {
|
||||
+ case XEN_TYPE_CDROM_SUPPORT:
|
||||
+ xcs = &(sp->xcs);
|
||||
+ xcs->supported = 1;
|
||||
+ break;
|
||||
+ case XEN_TYPE_CDROM_PACKET:
|
||||
+ xcp = &(sp->xcp);
|
||||
+ vgc = (struct vcd_generic_command *)(buf + PACKET_PAYLOAD_OFFSET);
|
||||
+
|
||||
+ memset( &cgc, 0, sizeof(struct cdrom_generic_command));
|
||||
+ memcpy(cgc.cmd, vgc->cmd, CDROM_PACKET_SIZE);
|
||||
+ cgc.stat = vgc->stat;
|
||||
+ cgc.data_direction = vgc->data_direction;
|
||||
+ cgc.quiet = vgc->quiet;
|
||||
+ cgc.timeout = vgc->timeout;
|
||||
+
|
||||
+ if (prv->fd == -1) {
|
||||
+ xcp = &(sp->xcp);
|
||||
+ xcp->ret = -1;
|
||||
+ xcp->err = 0 - ENODEV;
|
||||
+ return cb(dd, (ret < 0) ? ret: 0, sector, nb_sectors, id, private);
|
||||
+ }
|
||||
+ if (prv->dev_type == FILE_DEVICE) {
|
||||
+ DPRINTF("%s() FILE_DEVICE inappropriate packetcmd \n",__func__);
|
||||
+ return cb(dd, (ret < 0) ? ret: 0, sector, nb_sectors, id, private);
|
||||
+ }
|
||||
+ switch ( cgc.cmd[0]) {
|
||||
+ case GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
|
||||
+ {
|
||||
+ int lock;
|
||||
+ lock = cgc.cmd[4] & 1;
|
||||
+ if (ioctl (prv->fd, CDROM_LOCKDOOR, lock) < 0) {
|
||||
+ xcp->err = -(errno);
|
||||
+ xcp->ret = -1;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ case GPCMD_START_STOP_UNIT:
|
||||
+ {
|
||||
+ int start, eject;
|
||||
+ start = cgc.cmd[4] & 1;
|
||||
+ eject = (cgc.cmd[4] >> 1) & 1;
|
||||
+ if (eject && !start) {
|
||||
+ if (ioctl (prv->fd, CDROMEJECT, NULL) < 0) {
|
||||
+ xcp->err = -(errno);
|
||||
+ xcp->ret = -1;
|
||||
+ }
|
||||
+ } else if (eject && start) {
|
||||
+ if (ioctl (prv->fd, CDROMCLOSETRAY, NULL) < 0) {
|
||||
+ xcp->err = -(errno);
|
||||
+ xcp->ret = -1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ {
|
||||
+ if (vgc->sense_offset) {
|
||||
+ cgc.sense = &sense;
|
||||
+ }
|
||||
+ if (vgc->buffer_offset) {
|
||||
+ cgc.buffer = malloc(vgc->buflen);
|
||||
+ memcpy(cgc.buffer, (char *)sp + PACKET_BUFFER_OFFSET, vgc->buflen);
|
||||
+ cgc.buflen = vgc->buflen;
|
||||
+ }
|
||||
+ if (ioctl (prv->fd, CDROM_SEND_PACKET, &cgc) < 0 ) {
|
||||
+ xcp->err = -(errno);
|
||||
+ xcp->ret = -1;
|
||||
+ }
|
||||
+ if (cgc.sense) {
|
||||
+ memcpy((char *)sp + PACKET_SENSE_OFFSET, cgc.sense, sizeof(struct request_sense));
|
||||
+ }
|
||||
+ if (cgc.buffer) {
|
||||
+ vgc->buflen = cgc.buflen;
|
||||
+ memcpy((char *)sp + PACKET_BUFFER_OFFSET, cgc.buffer, cgc.buflen);
|
||||
+ free(cgc.buffer);
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ case XEN_TYPE_CDROM_OPEN:
|
||||
+ {
|
||||
+ char *buf = NULL;
|
||||
+ unsigned int len;
|
||||
+ struct stat statbuf;
|
||||
+ int major = 0;
|
||||
+ int minor = 0;
|
||||
+ char *num;
|
||||
+
|
||||
+ if (stat (prv->dev_name, &statbuf) == 0) {
|
||||
+ major = major (statbuf.st_rdev);
|
||||
+ minor = minor (statbuf.st_rdev);
|
||||
+ }
|
||||
+ xco = &(sp->xco);
|
||||
+ if (xco->payload_offset) {
|
||||
+ char * nodename;
|
||||
+ char media_present[2];
|
||||
+ nodename = (char *)sp + xco->payload_offset;
|
||||
+ asprintf(&buf, "%s/media-present", nodename);
|
||||
+ if (!xs_read(prv->xs_handle, XBT_NULL, buf, &len)) {
|
||||
+ sprintf(media_present, "%d", prv->media_present);
|
||||
+ xs_write(prv->xs_handle, XBT_NULL, buf, media_present, strlen(media_present));
|
||||
+ xs_watch(prv->xs_handle, buf, "media-present");
|
||||
+ asprintf(&buf, "%s/params", nodename);
|
||||
+ xs_watch(prv->xs_handle, buf, "params");
|
||||
+ asprintf(&num, "%x:%x", major, minor);
|
||||
+ asprintf(&buf, "%s/physical-device", nodename);
|
||||
+ xs_write(prv->xs_handle, XBT_NULL, buf, num, strlen(num));
|
||||
+ }
|
||||
+ free(buf);
|
||||
+ }
|
||||
+
|
||||
+ xco->media_present = prv->media_present;
|
||||
+ xco->sectors = 0;
|
||||
+ xco->sector_size = 2048;
|
||||
+ if (prv->media_present && prv->fd != -1 ) {
|
||||
+ get_image_info(dd);
|
||||
+ xco->sectors = s->size;
|
||||
+ xco->sector_size = s->sector_size;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ case XEN_TYPE_CDROM_MEDIA_CHANGED:
|
||||
+ xcmc = &(sp->xcmc);
|
||||
+ xcmc->media_changed = prv->media_changed;
|
||||
+ prv->media_changed = 0;
|
||||
+ break;
|
||||
+ default:
|
||||
+ xcp = &(sp->xcp);
|
||||
+ xcp->err = -EINVAL;
|
||||
+ xcp->ret = -1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return cb(dd, (ret < 0) ? ret: 0, sector, nb_sectors, id, private);
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_submit(struct disk_driver *dd)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_close(struct disk_driver *dd)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+
|
||||
+ if (prv->fd != -1) {
|
||||
+ close(prv->fd);
|
||||
+ prv->fd = -1;
|
||||
+ }
|
||||
+ prv->xs_fd = -1;
|
||||
+ xs_daemon_close(prv->xs_handle);
|
||||
+ free(prv->dev_name);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void tdcdrom_process_media_change_event(struct disk_driver *dd, char **vec)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ char *media_present = NULL;
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ media_present = xs_read(prv->xs_handle, XBT_NULL, vec[XS_WATCH_PATH], &len);
|
||||
+ if (strcmp(media_present, "0") == 0) {
|
||||
+ close(prv->fd);
|
||||
+ prv->fd = -1;
|
||||
+ prv->media_present = 0;
|
||||
+ }
|
||||
+ else {
|
||||
+ open_device(dd);
|
||||
+ prv->media_changed = 1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void tdcrom_process_params_event(struct disk_driver *dd, char **vec)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ char * params = NULL;
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ params = xs_read(prv->xs_handle, XBT_NULL, vec[XS_WATCH_PATH], &len);
|
||||
+ if (params != NULL) {
|
||||
+ char *cp = strchr(params, ':');
|
||||
+ if (cp) {
|
||||
+ cp++;
|
||||
+ if (prv->dev_name)
|
||||
+ free(prv->dev_name);
|
||||
+ asprintf(&prv->dev_name, "%s", cp);
|
||||
+ if (prv->fd != -1) {
|
||||
+ close(prv->fd);
|
||||
+ prv->fd = -1;
|
||||
+ }
|
||||
+ open_device(dd);
|
||||
+ prv->media_changed = 1;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_do_callbacks(struct disk_driver *dd, int sid)
|
||||
+{
|
||||
+ struct tdcdrom_state *prv = (struct tdcdrom_state *)dd->private;
|
||||
+ char **vec;
|
||||
+ unsigned int num;
|
||||
+
|
||||
+ vec = xs_read_watch(prv->xs_handle, &num);
|
||||
+ if (!vec)
|
||||
+ return 1;
|
||||
+
|
||||
+ if (!strcmp(vec[XS_WATCH_TOKEN], "media-present")) {
|
||||
+ tdcdrom_process_media_change_event(dd, vec);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (!strcmp(vec[XS_WATCH_TOKEN], "params")) {
|
||||
+ tdcrom_process_params_event(dd, vec);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ out:
|
||||
+ free(vec);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_get_parent_id(struct disk_driver *dd, struct disk_id *id)
|
||||
+{
|
||||
+ return TD_NO_PARENT;
|
||||
+}
|
||||
+
|
||||
+int tdcdrom_validate_parent(struct disk_driver *dd,
|
||||
+ struct disk_driver *parent, td_flag_t flags)
|
||||
+{
|
||||
+ return -EINVAL;
|
||||
+}
|
||||
+
|
||||
+struct tap_disk tapdisk_cdrom = {
|
||||
+ .disk_type = "tapdisk_cdrom",
|
||||
+ .private_data_size = sizeof(struct tdcdrom_state),
|
||||
+ .td_open = tdcdrom_open,
|
||||
+ .td_queue_read = tdcdrom_queue_read,
|
||||
+ .td_queue_packet = tdcdrom_queue_packet,
|
||||
+ .td_queue_write = tdcdrom_queue_write,
|
||||
+ .td_submit = tdcdrom_submit,
|
||||
+ .td_close = tdcdrom_close,
|
||||
+ .td_do_callbacks = tdcdrom_do_callbacks,
|
||||
+ .td_get_parent_id = tdcdrom_get_parent_id,
|
||||
+ .td_validate_parent = tdcdrom_validate_parent
|
||||
+};
|
||||
Index: xen-3.3.1-testing/xen/include/public/io/cdromif.h
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ xen-3.3.1-testing/xen/include/public/io/cdromif.h 2008-09-10 13:19:09.000000000 -0600
|
||||
@@ -0,0 +1,122 @@
|
||||
+/******************************************************************************
|
||||
+ * cdromif.h
|
||||
+ *
|
||||
+ * Shared definitions between backend driver and Xen guest Virtual CDROM
|
||||
+ * block device.
|
||||
+ *
|
||||
+ * Copyright (c) 2008, Pat Campell plc@novell.com
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
+ * of this source file (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use, copy, modify,
|
||||
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
+ * and to permit persons to whom the Software is furnished to do so, subject to
|
||||
+ * the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be included in
|
||||
+ * all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
+ * IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#ifndef __XEN_PUBLIC_IO_CDROMIF_H__
|
||||
+#define __XEN_PUBLIC_IO_CDROMIF_H__
|
||||
+
|
||||
+/*
|
||||
+ * Queries backend for CDROM support
|
||||
+ */
|
||||
+#define XEN_TYPE_CDROM_SUPPORT _IO('c', 1)
|
||||
+
|
||||
+struct xen_cdrom_support
|
||||
+{
|
||||
+ uint32_t type;
|
||||
+ int8_t ret; /* returned, 0 succeded, -1 error */
|
||||
+ int8_t err; /* returned, backend errno */
|
||||
+ int8_t supported; /* returned, 1 supported */
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Opens backend device, returns drive geometry or
|
||||
+ * any encountered errors
|
||||
+ */
|
||||
+#define XEN_TYPE_CDROM_OPEN _IO('c', 2)
|
||||
+
|
||||
+struct xen_cdrom_open
|
||||
+{
|
||||
+ uint32_t type;
|
||||
+ int8_t ret;
|
||||
+ int8_t err;
|
||||
+ int8_t pad;
|
||||
+ int8_t media_present; /* returned */
|
||||
+ uint32_t sectors; /* returned */
|
||||
+ uint32_t sector_size; /* returned */
|
||||
+ int32_t payload_offset; /* offset to backend node name payload */
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Queries backend for media changed status
|
||||
+ */
|
||||
+#define XEN_TYPE_CDROM_MEDIA_CHANGED _IO('c', 3)
|
||||
+
|
||||
+struct xen_cdrom_media_changed
|
||||
+{
|
||||
+ uint32_t type;
|
||||
+ int8_t ret;
|
||||
+ int8_t err;
|
||||
+ int8_t media_changed; /* returned */
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Sends vcd generic CDROM packet to backend, followed
|
||||
+ * immediately by the vcd_generic_command payload
|
||||
+ */
|
||||
+#define XEN_TYPE_CDROM_PACKET _IO('c', 4)
|
||||
+
|
||||
+struct xen_cdrom_packet
|
||||
+{
|
||||
+ uint32_t type;
|
||||
+ int8_t ret;
|
||||
+ int8_t err;
|
||||
+ int8_t pad[2];
|
||||
+ int32_t payload_offset; /* offset to struct vcd_generic_command payload */
|
||||
+};
|
||||
+
|
||||
+/* CDROM_PACKET_COMMAND, payload for XEN_TYPE_CDROM_PACKET */
|
||||
+struct vcd_generic_command
|
||||
+{
|
||||
+ uint8_t cmd[CDROM_PACKET_SIZE];
|
||||
+ uint8_t pad[4];
|
||||
+ uint32_t buffer_offset;
|
||||
+ uint32_t buflen;
|
||||
+ int32_t stat;
|
||||
+ uint32_t sense_offset;
|
||||
+ uint8_t data_direction;
|
||||
+ uint8_t pad1[3];
|
||||
+ int32_t quiet;
|
||||
+ int32_t timeout;
|
||||
+};
|
||||
+
|
||||
+union xen_block_packet
|
||||
+{
|
||||
+ uint32_t type;
|
||||
+ int8_t ret;
|
||||
+ int8_t err;
|
||||
+ struct xen_cdrom_support xcs;
|
||||
+ struct xen_cdrom_open xco;
|
||||
+ struct xen_cdrom_media_changed xcmc;
|
||||
+ struct xen_cdrom_packet xcp;
|
||||
+};
|
||||
+
|
||||
+#define PACKET_PAYLOAD_OFFSET (sizeof(struct xen_cdrom_packet))
|
||||
+#define PACKET_SENSE_OFFSET (PACKET_PAYLOAD_OFFSET + sizeof(struct vcd_generic_command))
|
||||
+#define PACKET_BUFFER_OFFSET (PACKET_SENSE_OFFSET + sizeof(struct request_sense))
|
||||
+#define MAX_PACKET_DATA (PAGE_SIZE - sizeof(struct xen_cdrom_packet) - \
|
||||
+ sizeof(struct vcd_generic_command) - sizeof(struct request_sense))
|
||||
+
|
||||
+#endif
|
||||
Index: xen-3.3.1-testing/tools/blktap/drivers/Makefile
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/blktap/drivers/Makefile 2008-09-10 11:28:21.000000000 -0600
|
||||
+++ xen-3.3.1-testing/tools/blktap/drivers/Makefile 2008-09-10 13:31:58.000000000 -0600
|
||||
@@ -24,8 +24,9 @@
|
||||
$(warning *** libgcrypt not installed: falling back to libcrypto ***)
|
||||
endif
|
||||
|
||||
-LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) -L../lib -lblktap
|
||||
-LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz
|
||||
+LDFLAGS_xen := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore)
|
||||
+LDFLAGS_blktapctrl := $(LDFLAGS_xen) -L../lib -lblktap
|
||||
+LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz $(LDFLAGS_xen)
|
||||
|
||||
BLK-OBJS-y := block-aio.o
|
||||
BLK-OBJS-y += block-sync.o
|
||||
@@ -33,6 +34,7 @@
|
||||
BLK-OBJS-y += block-ram.o
|
||||
BLK-OBJS-y += block-qcow.o
|
||||
BLK-OBJS-y += block-qcow2.o
|
||||
+BLK-OBJS-y += block-cdrom.o
|
||||
BLK-OBJS-y += aes.o
|
||||
BLK-OBJS-y += tapaio.o
|
||||
BLK-OBJS-$(CONFIG_Linux) += blk_linux.o
|
||||
Index: xen-3.3.1-testing/tools/blktap/drivers/tapdisk.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/blktap/drivers/tapdisk.h 2008-09-10 11:28:24.000000000 -0600
|
||||
+++ xen-3.3.1-testing/tools/blktap/drivers/tapdisk.h 2008-09-10 14:09:34.000000000 -0600
|
||||
@@ -137,6 +137,9 @@
|
||||
int (*td_get_parent_id) (struct disk_driver *dd, struct disk_id *id);
|
||||
int (*td_validate_parent)(struct disk_driver *dd,
|
||||
struct disk_driver *p, td_flag_t flags);
|
||||
+ int (*td_queue_packet) (struct disk_driver *dd, uint64_t sector,
|
||||
+ int nb_sectors, char *buf, td_callback_t cb,
|
||||
+ int id, void *prv);
|
||||
};
|
||||
|
||||
typedef struct disk_info {
|
||||
@@ -160,6 +163,7 @@
|
||||
extern struct tap_disk tapdisk_ram;
|
||||
extern struct tap_disk tapdisk_qcow;
|
||||
extern struct tap_disk tapdisk_qcow2;
|
||||
+extern struct tap_disk tapdisk_cdrom;
|
||||
|
||||
|
||||
/*Define Individual Disk Parameters here */
|
||||
@@ -240,6 +244,17 @@
|
||||
#endif
|
||||
};
|
||||
|
||||
+static disk_info_t cdrom_disk = {
|
||||
+ DISK_TYPE_CDROM,
|
||||
+ "raw image (cdrom)",
|
||||
+ "cdrom",
|
||||
+ 0,
|
||||
+ 1,
|
||||
+#ifdef TAPDISK
|
||||
+ &tapdisk_cdrom,
|
||||
+#endif
|
||||
+};
|
||||
+
|
||||
/*Main disk info array */
|
||||
static disk_info_t *dtypes[] = {
|
||||
&aio_disk,
|
||||
Index: xen-3.3.1-testing/tools/blktap/lib/blktaplib.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/tools/blktap/lib/blktaplib.h 2008-09-10 11:28:24.000000000 -0600
|
||||
+++ xen-3.3.1-testing/tools/blktap/lib/blktaplib.h 2008-09-10 13:45:24.000000000 -0600
|
||||
@@ -221,6 +221,7 @@
|
||||
#define DISK_TYPE_QCOW 4
|
||||
#define DISK_TYPE_QCOW2 5
|
||||
#define DISK_TYPE_IOEMU 6
|
||||
+#define DISK_TYPE_CDROM 7
|
||||
|
||||
/* xenstore/xenbus: */
|
||||
#define DOMNAME "Domain-0"
|
14
blktap.patch
14
blktap.patch
@ -1,11 +1,11 @@
|
||||
bug #239173
|
||||
bug #242953
|
||||
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
Index: xen-3.3.1-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
|
||||
@@ -2606,7 +2606,7 @@ class XendDomainInfo:
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -2618,7 +2618,7 @@ class XendDomainInfo:
|
||||
(fn, BOOTLOADER_LOOPBACK_DEVICE))
|
||||
|
||||
vbd = {
|
||||
@ -14,10 +14,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
'device': BOOTLOADER_LOOPBACK_DEVICE,
|
||||
}
|
||||
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/xenstore.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/ioemu-remote/xenstore.c
|
||||
+++ xen-3.3.0-testing/tools/ioemu-remote/xenstore.c
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/xenstore.c
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/xenstore.c
|
||||
@@ -151,9 +151,9 @@ void xenstore_parse_domain_config(int hv
|
||||
{
|
||||
char **e = NULL;
|
||||
|
@ -2,15 +2,36 @@ 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
|
||||
@@ -474,6 +474,7 @@ static int launch_tapdisk_provider(char
|
||||
@@ -65,6 +65,8 @@
|
||||
#define MAX_RAND_VAL 0xFFFF
|
||||
#define MAX_ATTEMPTS 10
|
||||
|
||||
+#undef ALWAYS_USE_IOEMU
|
||||
+
|
||||
int run = 1;
|
||||
int max_timeout = MAX_TIMEOUT;
|
||||
int ctlfd = 0;
|
||||
@@ -174,7 +176,10 @@ static int test_path(char *path, char **
|
||||
}
|
||||
|
||||
if (found) {
|
||||
- *type = dtypes[i]->idnum;
|
||||
+ if (dtypes[i]->use_ioemu)
|
||||
+ *type = DISK_TYPE_IOEMU;
|
||||
+ else
|
||||
+ *type = dtypes[i]->idnum;
|
||||
|
||||
if (dtypes[i]->single_handler == 1) {
|
||||
/* Check whether tapdisk process
|
||||
@@ -474,6 +479,7 @@ static int launch_tapdisk_provider(char
|
||||
return child;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
+#ifndef ALWAYS_USE_IOEMU
|
||||
static int launch_tapdisk(char *wrctldev, char *rdctldev)
|
||||
{
|
||||
char *argv[] = { "tapdisk", wrctldev, rdctldev, NULL };
|
||||
@@ -483,6 +484,7 @@ static int launch_tapdisk(char *wrctldev
|
||||
@@ -483,6 +489,7 @@ static int launch_tapdisk(char *wrctldev
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -18,15 +39,15 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
|
||||
|
||||
static int launch_tapdisk_ioemu(void)
|
||||
{
|
||||
@@ -554,6 +556,7 @@ static int connect_qemu(blkif_t *blkif,
|
||||
@@ -554,6 +561,7 @@ static int connect_qemu(blkif_t *blkif,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
+#ifndef ALWAYS_USE_IOEMU
|
||||
/* Launch tapdisk instance */
|
||||
static int connect_tapdisk(blkif_t *blkif, int minor)
|
||||
{
|
||||
@@ -597,6 +600,7 @@ fail:
|
||||
@@ -597,6 +605,7 @@ fail:
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -34,22 +55,91 @@ Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
|
||||
|
||||
static int blktapctrl_new_blkif(blkif_t *blkif)
|
||||
{
|
||||
@@ -621,6 +625,7 @@ static int blktapctrl_new_blkif(blkif_t
|
||||
@@ -621,6 +630,10 @@ static int blktapctrl_new_blkif(blkif_t
|
||||
blkif->cookie = next_cookie++;
|
||||
|
||||
if (!exist) {
|
||||
+#if 0
|
||||
+#ifdef ALWAYS_USE_IOEMU
|
||||
+ if (connect_qemu(blkif, blkif->domid))
|
||||
+ goto fail;
|
||||
+#else
|
||||
if (type == DISK_TYPE_IOEMU) {
|
||||
if (connect_qemu(blkif, blkif->domid))
|
||||
goto fail;
|
||||
@@ -628,6 +633,10 @@ static int blktapctrl_new_blkif(blkif_t
|
||||
@@ -628,6 +641,7 @@ static int blktapctrl_new_blkif(blkif_t
|
||||
if (connect_tapdisk(blkif, minor))
|
||||
goto fail;
|
||||
}
|
||||
+#else
|
||||
+ if (connect_qemu(blkif, blkif->domid))
|
||||
+ goto fail;
|
||||
+#endif
|
||||
|
||||
} else {
|
||||
DPRINTF("Process exists!\n");
|
||||
Index: xen-3.3.0-testing/tools/blktap/drivers/tapdisk.h
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/blktap/drivers/tapdisk.h
|
||||
+++ xen-3.3.0-testing/tools/blktap/drivers/tapdisk.h
|
||||
@@ -145,6 +145,8 @@ typedef struct disk_info {
|
||||
char handle[10]; /* xend handle, e.g. 'ram' */
|
||||
int single_handler; /* is there a single controller for all */
|
||||
/* instances of disk type? */
|
||||
+ int use_ioemu; /* backend provider: 0 = tapdisk; 1 = ioemu */
|
||||
+
|
||||
#ifdef TAPDISK
|
||||
struct tap_disk *drv;
|
||||
#endif
|
||||
@@ -166,6 +168,7 @@ static disk_info_t aio_disk = {
|
||||
"raw image (aio)",
|
||||
"aio",
|
||||
0,
|
||||
+ 1,
|
||||
#ifdef TAPDISK
|
||||
&tapdisk_aio,
|
||||
#endif
|
||||
@@ -176,6 +179,7 @@ static disk_info_t sync_disk = {
|
||||
"raw image (sync)",
|
||||
"sync",
|
||||
0,
|
||||
+ 1,
|
||||
#ifdef TAPDISK
|
||||
&tapdisk_sync,
|
||||
#endif
|
||||
@@ -186,6 +190,7 @@ static disk_info_t vmdk_disk = {
|
||||
"vmware image (vmdk)",
|
||||
"vmdk",
|
||||
1,
|
||||
+ 1,
|
||||
#ifdef TAPDISK
|
||||
&tapdisk_vmdk,
|
||||
#endif
|
||||
@@ -196,6 +201,7 @@ static disk_info_t ram_disk = {
|
||||
"ramdisk image (ram)",
|
||||
"ram",
|
||||
1,
|
||||
+ 0,
|
||||
#ifdef TAPDISK
|
||||
&tapdisk_ram,
|
||||
#endif
|
||||
@@ -206,6 +212,7 @@ static disk_info_t qcow_disk = {
|
||||
"qcow disk (qcow)",
|
||||
"qcow",
|
||||
0,
|
||||
+ 1,
|
||||
#ifdef TAPDISK
|
||||
&tapdisk_qcow,
|
||||
#endif
|
||||
@@ -216,6 +223,7 @@ static disk_info_t qcow2_disk = {
|
||||
"qcow2 disk (qcow2)",
|
||||
"qcow2",
|
||||
0,
|
||||
+ 1,
|
||||
#ifdef TAPDISK
|
||||
&tapdisk_qcow2,
|
||||
#endif
|
||||
@@ -226,6 +234,7 @@ static disk_info_t ioemu_disk = {
|
||||
"ioemu disk",
|
||||
"ioemu",
|
||||
1,
|
||||
+ 1,
|
||||
#ifdef TAPDISK
|
||||
NULL
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/Makefile
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/Makefile
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/ioemu-remote/Makefile
|
||||
+++ xen-3.3.0-testing/tools/ioemu-remote/Makefile
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/Makefile
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/Makefile
|
||||
@@ -31,13 +31,6 @@ subdir-%: libqemu_common.a
|
||||
|
||||
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
|
||||
@ -16,28 +16,33 @@ Index: xen-3.3.0-testing/tools/ioemu-remote/Makefile
|
||||
#######################################################################
|
||||
# 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
|
||||
@@ -46,6 +39,21 @@ 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
|
||||
+
|
||||
+hw/tapdisk-xen_blktap.o: hw/xen_blktap.c
|
||||
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG -DQEMU_TOOL -c -o $@ $<
|
||||
+tapdisk-ioemu.o: tapdisk-ioemu.c
|
||||
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG -DQEMU_TOOL -c -o $@ $<
|
||||
+
|
||||
+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)
|
||||
+tapdisk-ioemu: tapdisk-ioemu.o $(BLOCK_OBJS) qemu-img-block.o qemu-img-block-raw-posix.o hw/tapdisk-xen_blktap.o
|
||||
+ $(CC) $(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
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/configure
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/configure
|
||||
@@ -1144,7 +1144,7 @@ fi
|
||||
|
||||
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
|
||||
|
||||
|
98
dump-exec-state.patch
Normal file
98
dump-exec-state.patch
Normal file
@ -0,0 +1,98 @@
|
||||
Index: xen-3.3.0-testing/xen/arch/ia64/linux-xen/smp.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/xen/arch/ia64/linux-xen/smp.c
|
||||
+++ xen-3.3.0-testing/xen/arch/ia64/linux-xen/smp.c
|
||||
@@ -175,7 +175,7 @@ handle_IPI (int irq, void *dev_id, struc
|
||||
* At this point the structure may be gone unless
|
||||
* wait is true.
|
||||
*/
|
||||
- (*func)(info);
|
||||
+ (*func)(info ?: regs);
|
||||
|
||||
/* Notify the sending CPU that the task is done. */
|
||||
mb();
|
||||
Index: xen-3.3.0-testing/xen/arch/x86/smp.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/xen/arch/x86/smp.c
|
||||
+++ xen-3.3.0-testing/xen/arch/x86/smp.c
|
||||
@@ -357,7 +357,7 @@ fastcall void smp_call_function_interrup
|
||||
|
||||
if ( call_data->wait )
|
||||
{
|
||||
- (*func)(info);
|
||||
+ (*func)(info ?: regs);
|
||||
mb();
|
||||
atomic_inc(&call_data->finished);
|
||||
}
|
||||
@@ -365,7 +365,7 @@ fastcall void smp_call_function_interrup
|
||||
{
|
||||
mb();
|
||||
atomic_inc(&call_data->started);
|
||||
- (*func)(info);
|
||||
+ (*func)(info ?: regs);
|
||||
}
|
||||
|
||||
irq_exit();
|
||||
Index: xen-3.3.0-testing/xen/common/keyhandler.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/xen/common/keyhandler.c
|
||||
+++ xen-3.3.0-testing/xen/common/keyhandler.c
|
||||
@@ -91,14 +91,25 @@ static void show_handlers(unsigned char
|
||||
key_table[i].desc);
|
||||
}
|
||||
|
||||
-static void __dump_execstate(void *unused)
|
||||
+static void __dump_execstate(void *_regs)
|
||||
{
|
||||
- dump_execution_state();
|
||||
- printk("*** Dumping CPU%d guest state: ***\n", smp_processor_id());
|
||||
+ struct cpu_user_regs *regs = _regs;
|
||||
+ unsigned int cpu = smp_processor_id();
|
||||
+
|
||||
+ if ( !guest_mode(regs) )
|
||||
+ {
|
||||
+ printk("\n*** Dumping CPU%u host state: ***\n", cpu);
|
||||
+ show_execution_state(regs);
|
||||
+ }
|
||||
if ( is_idle_vcpu(current) )
|
||||
- printk("No guest context (CPU is idle).\n");
|
||||
+ printk("No guest context (CPU%u is idle).\n", cpu);
|
||||
else
|
||||
+ {
|
||||
+ printk("*** Dumping CPU%u guest state (d%d:v%d): ***\n",
|
||||
+ smp_processor_id(), current->domain->domain_id,
|
||||
+ current->vcpu_id);
|
||||
show_execution_state(guest_cpu_user_regs());
|
||||
+ }
|
||||
}
|
||||
|
||||
static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
|
||||
@@ -111,14 +122,12 @@ static void dump_registers(unsigned char
|
||||
printk("'%c' pressed -> dumping registers\n", key);
|
||||
|
||||
/* Get local execution state out immediately, in case we get stuck. */
|
||||
- printk("\n*** Dumping CPU%d host state: ***\n", smp_processor_id());
|
||||
- __dump_execstate(NULL);
|
||||
+ __dump_execstate(regs);
|
||||
|
||||
for_each_online_cpu ( cpu )
|
||||
{
|
||||
if ( cpu == smp_processor_id() )
|
||||
continue;
|
||||
- printk("\n*** Dumping CPU%d host state: ***\n", cpu);
|
||||
on_selected_cpus(cpumask_of_cpu(cpu), __dump_execstate, NULL, 1, 1);
|
||||
}
|
||||
|
||||
Index: xen-3.3.0-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/xen/include/asm-ia64/linux-xen/asm/ptrace.h
|
||||
+++ xen-3.3.0-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h
|
||||
@@ -278,7 +278,7 @@ struct switch_stack {
|
||||
# define ia64_task_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
|
||||
# define ia64_psr(regs) ((struct ia64_psr *) &(regs)->cr_ipsr)
|
||||
#ifdef XEN
|
||||
-# define guest_mode(regs) (ia64_psr(regs)->cpl != 0)
|
||||
+# define guest_mode(regs) (ia64_psr(regs)->cpl && !ia64_psr(regs)->vm)
|
||||
# define guest_kernel_mode(regs) (ia64_psr(regs)->cpl == CONFIG_CPL0_EMUL)
|
||||
# define vmx_guest_kernel_mode(regs) (ia64_psr(regs)->cpl == 0)
|
||||
# define regs_increment_iip(regs) \
|
@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c
|
||||
+++ xen-3.3.1-testing/tools/python/xen/lowlevel/xc/xc.c
|
||||
@@ -872,14 +872,14 @@ static PyObject *pyxc_hvm_build(XcObject
|
||||
int i;
|
||||
#endif
|
||||
@ -11,7 +11,7 @@ Index: xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
|
||||
|
||||
static char *kwd_list[] = { "domid",
|
||||
- "memsize", "image", "vcpus", "acpi",
|
||||
+ "memsize", "image", "vcpus", "extid", "acpi",
|
||||
+ "memsize", "image", "vcpus", "extid", "acpi",
|
||||
"apic", NULL };
|
||||
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iii", kwd_list,
|
||||
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
|
||||
@ -29,27 +29,27 @@ Index: xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
|
||||
|
||||
return Py_BuildValue("{}");
|
||||
}
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -141,6 +141,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
|
||||
'monitor': int,
|
||||
'nographic': int,
|
||||
'pae' : int,
|
||||
+ 'extid' : int,
|
||||
+ 'extid': int,
|
||||
'rtc_timeoffset': int,
|
||||
'serial': str,
|
||||
'sdl': int,
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/image.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/image.py
|
||||
@@ -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.extid = int(vmConfig['platform'].get('extid', 0))
|
||||
self.guest_os_type = vmConfig['platform'].get('guest_os_type')
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
|
||||
log.debug("store_evtchn = %d", store_evtchn)
|
||||
log.debug("memsize = %d", mem_mb)
|
||||
log.debug("vcpus = %d", self.vm.getVCpuCount())
|
||||
+ log.debug("extid = %d", self.extid)
|
||||
+ log.debug("extid = %d", self.extid)
|
||||
log.debug("acpi = %d", self.acpi)
|
||||
log.debug("apic = %d", self.apic)
|
||||
|
||||
@ -65,14 +65,14 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
|
||||
image = self.loader,
|
||||
memsize = mem_mb,
|
||||
vcpus = self.vm.getVCpuCount(),
|
||||
+ extid = self.extid,
|
||||
+ extid = self.extid,
|
||||
acpi = self.acpi,
|
||||
apic = self.apic)
|
||||
rc['notes'] = { 'SUSPEND_CANCEL': 1 }
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xm/create.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xm/create.py
|
||||
@@ -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.""")
|
201
hv_xen_base.patch
Normal file
201
hv_xen_base.patch
Normal file
@ -0,0 +1,201 @@
|
||||
%patch
|
||||
Index: xen-3.3.1-testing/xen/include/asm-x86/hvm/domain.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/include/asm-x86/hvm/domain.h
|
||||
+++ xen-3.3.1-testing/xen/include/asm-x86/hvm/domain.h
|
||||
@@ -82,6 +82,7 @@ struct hvm_domain {
|
||||
struct vmx_domain vmx;
|
||||
struct svm_domain svm;
|
||||
};
|
||||
+ void *hyperv_handle; /* will be NULL on creation*/
|
||||
};
|
||||
|
||||
#endif /* __ASM_X86_HVM_DOMAIN_H__ */
|
||||
Index: xen-3.3.1-testing/xen/arch/x86/hvm/Makefile
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/Makefile
|
||||
+++ xen-3.3.1-testing/xen/arch/x86/hvm/Makefile
|
||||
@@ -1,5 +1,6 @@
|
||||
subdir-y += svm
|
||||
subdir-y += vmx
|
||||
+subdir-y += hyperv
|
||||
|
||||
obj-y += emulate.o
|
||||
obj-y += hvm.o
|
||||
Index: xen-3.3.1-testing/xen/arch/x86/hvm/hvm.c
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/hvm.c
|
||||
+++ xen-3.3.1-testing/xen/arch/x86/hvm/hvm.c
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <asm/mc146818rtc.h>
|
||||
#include <asm/spinlock.h>
|
||||
#include <asm/hvm/hvm.h>
|
||||
+#include <asm/hvm/hvm_extensions.h>
|
||||
#include <asm/hvm/vpt.h>
|
||||
#include <asm/hvm/support.h>
|
||||
#include <asm/hvm/cacheattr.h>
|
||||
@@ -361,6 +362,7 @@ void hvm_domain_relinquish_resources(str
|
||||
|
||||
void hvm_domain_destroy(struct domain *d)
|
||||
{
|
||||
+ hyperx_intercept_domain_destroy(d);
|
||||
hvm_funcs.domain_destroy(d);
|
||||
rtc_deinit(d);
|
||||
stdvga_deinit(d);
|
||||
@@ -645,8 +647,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
|
||||
{
|
||||
int rc;
|
||||
|
||||
+ if ((rc = hyperx_intercept_vcpu_initialize(v)) != 0)
|
||||
+ goto fail1;
|
||||
+
|
||||
if ( (rc = vlapic_init(v)) != 0 )
|
||||
+ {
|
||||
+ hyperx_intercept_vcpu_destroy(v);
|
||||
goto fail1;
|
||||
+ }
|
||||
|
||||
if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
|
||||
goto fail2;
|
||||
@@ -693,6 +701,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
|
||||
hvm_funcs.vcpu_destroy(v);
|
||||
fail2:
|
||||
vlapic_destroy(v);
|
||||
+ hyperx_intercept_vcpu_destroy(v);
|
||||
fail1:
|
||||
return rc;
|
||||
}
|
||||
@@ -1647,7 +1656,7 @@ void hvm_cpuid(unsigned int input, unsig
|
||||
struct vcpu *v = current;
|
||||
|
||||
if ( cpuid_hypervisor_leaves(input, eax, ebx, ecx, edx) )
|
||||
- return;
|
||||
+ goto hvm_cpuid_done;
|
||||
|
||||
domain_cpuid(v->domain, input, *ecx, eax, ebx, ecx, edx);
|
||||
|
||||
@@ -1659,6 +1668,8 @@ void hvm_cpuid(unsigned int input, unsig
|
||||
if ( vlapic_hw_disabled(vcpu_vlapic(v)) )
|
||||
__clear_bit(X86_FEATURE_APIC & 31, edx);
|
||||
}
|
||||
+hvm_cpuid_done:
|
||||
+ hyperx_intercept_do_cpuid(input, eax, ebx, ecx, edx);
|
||||
}
|
||||
|
||||
void hvm_rdtsc_intercept(struct cpu_user_regs *regs)
|
||||
@@ -1749,6 +1760,8 @@ int hvm_msr_read_intercept(struct cpu_us
|
||||
break;
|
||||
|
||||
default:
|
||||
+ if (hyperx_intercept_do_msr_read(ecx, regs))
|
||||
+ return X86EMUL_OKAY;
|
||||
return hvm_funcs.msr_read_intercept(regs);
|
||||
}
|
||||
|
||||
@@ -1837,6 +1850,8 @@ int hvm_msr_write_intercept(struct cpu_u
|
||||
break;
|
||||
|
||||
default:
|
||||
+ if (hyperx_intercept_do_msr_write(ecx, regs))
|
||||
+ return X86EMUL_OKAY;
|
||||
return hvm_funcs.msr_write_intercept(regs);
|
||||
}
|
||||
|
||||
@@ -1963,6 +1978,10 @@ int hvm_do_hypercall(struct cpu_user_reg
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
+ if (hyperx_intercept_do_hypercall(regs))
|
||||
+ {
|
||||
+ return HVM_HCALL_completed;
|
||||
+ }
|
||||
|
||||
if ( (eax >= NR_hypercalls) || !hvm_hypercall32_table[eax] )
|
||||
{
|
||||
@@ -2476,6 +2495,15 @@ long do_hvm_op(unsigned long op, XEN_GUE
|
||||
rc = -EINVAL;
|
||||
|
||||
break;
|
||||
+ case HVM_PARAM_EXTEND_HYPERVISOR:
|
||||
+ if ((a.value == 1) && hyperv_initialize(d))
|
||||
+ {
|
||||
+ if (a.value != 1)
|
||||
+ rc = -EINVAL;
|
||||
+ else
|
||||
+ rc = -ENOMEM;
|
||||
+ goto param_fail;
|
||||
+ }
|
||||
}
|
||||
|
||||
if ( rc == 0 )
|
||||
Index: xen-3.3.1-testing/xen/include/public/arch-x86/hvm/save.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/include/public/arch-x86/hvm/save.h
|
||||
+++ xen-3.3.1-testing/xen/include/public/arch-x86/hvm/save.h
|
||||
@@ -38,7 +38,7 @@ struct hvm_save_header {
|
||||
uint32_t version; /* File format version */
|
||||
uint64_t changeset; /* Version of Xen that saved this file */
|
||||
uint32_t cpuid; /* CPUID[0x01][%eax] on the saving machine */
|
||||
- uint32_t pad0;
|
||||
+ uint32_t pad0;
|
||||
};
|
||||
|
||||
DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
|
||||
@@ -421,9 +421,22 @@ struct hvm_hw_mtrr {
|
||||
|
||||
DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct hvm_hw_mtrr);
|
||||
|
||||
+struct hvm_hyperv_dom {
|
||||
+ uint64_t guestid_msr;
|
||||
+ uint64_t hypercall_msr;
|
||||
+ uint32_t long_mode;
|
||||
+ uint32_t ext_id;
|
||||
+};
|
||||
+DECLARE_HVM_SAVE_TYPE(HYPERV_DOM, 15, struct hvm_hyperv_dom);
|
||||
+
|
||||
+struct hvm_hyperv_cpu {
|
||||
+ uint64_t control_msr;
|
||||
+ uint64_t version_msr;
|
||||
+};
|
||||
+DECLARE_HVM_SAVE_TYPE(HYPERV_CPU, 16, struct hvm_hyperv_cpu);
|
||||
/*
|
||||
* Largest type-code in use
|
||||
*/
|
||||
-#define HVM_SAVE_CODE_MAX 14
|
||||
+#define HVM_SAVE_CODE_MAX 16
|
||||
|
||||
#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
|
||||
Index: xen-3.3.1-testing/xen/arch/x86/hvm/vlapic.c
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/vlapic.c
|
||||
+++ xen-3.3.1-testing/xen/arch/x86/hvm/vlapic.c
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <asm/hvm/hvm.h>
|
||||
#include <asm/hvm/io.h>
|
||||
#include <asm/hvm/support.h>
|
||||
+#include <asm/hvm/hvm_extensions.h>
|
||||
#include <asm/hvm/vmx/vmx.h>
|
||||
#include <public/hvm/ioreq.h>
|
||||
#include <public/hvm/params.h>
|
||||
@@ -307,6 +308,7 @@ static int vlapic_accept_sipi(struct vcp
|
||||
hvm_vcpu_reset_state(v, trampoline_vector << 8, 0);
|
||||
|
||||
vcpu_unpause(v);
|
||||
+ hyperx_intercept_vcpu_up(v);
|
||||
|
||||
return X86EMUL_OKAY;
|
||||
}
|
||||
Index: xen-3.3.1-testing/xen/include/public/hvm/params.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/include/public/hvm/params.h
|
||||
+++ xen-3.3.1-testing/xen/include/public/hvm/params.h
|
||||
@@ -93,6 +93,8 @@
|
||||
/* ACPI S state: currently support S0 and S3 on x86. */
|
||||
#define HVM_PARAM_ACPI_S_STATE 14
|
||||
|
||||
-#define HVM_NR_PARAMS 15
|
||||
+#define HVM_PARAM_EXTEND_HYPERVISOR 15
|
||||
+
|
||||
+#define HVM_NR_PARAMS 16
|
||||
|
||||
#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
|
1699
hv_xen_extension.patch
Normal file
1699
hv_xen_extension.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
||||
### BEGIN INIT INFO
|
||||
# Provides: xendomains
|
||||
# Required-Start: $syslog $remote_fs xend
|
||||
# Should-Start: iscsi
|
||||
# Should-Start: iscsi o2cb ocfs2
|
||||
# Required-Stop: $syslog $remote_fs xend
|
||||
# Should-Stop: iscsi
|
||||
# Default-Start: 3 5
|
||||
|
@ -1,447 +0,0 @@
|
||||
%patch
|
||||
Index: xen-3.2.1-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
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <asm/hvm/vpt.h>
|
||||
#include <asm/hvm/trace.h>
|
||||
#include <asm/hap.h>
|
||||
+#include <asm/hvm/hvm_extensions.h>
|
||||
|
||||
u32 svm_feature_flags;
|
||||
|
||||
@@ -78,6 +79,7 @@ static void *hsa[NR_CPUS] __read_mostly;
|
||||
/* vmcb used for extended host state */
|
||||
static void *root_vmcb[NR_CPUS] __read_mostly;
|
||||
|
||||
+
|
||||
static void inline __update_guest_eip(
|
||||
struct cpu_user_regs *regs, unsigned int inst_len)
|
||||
{
|
||||
@@ -888,7 +890,7 @@ static struct hvm_function_table svm_fun
|
||||
.set_tsc_offset = svm_set_tsc_offset,
|
||||
.inject_exception = svm_inject_exception,
|
||||
.init_hypercall_page = svm_init_hypercall_page,
|
||||
- .event_pending = svm_event_pending
|
||||
+ .event_pending = svm_event_pending,
|
||||
};
|
||||
|
||||
int start_svm(struct cpuinfo_x86 *c)
|
||||
@@ -1055,6 +1057,7 @@ static void svm_vmexit_do_cpuid(struct v
|
||||
HVMTRACE_3D(CPUID, v, input,
|
||||
((uint64_t)eax << 32) | ebx, ((uint64_t)ecx << 32) | edx);
|
||||
|
||||
+ ext_intercept_do_cpuid(input, regs);
|
||||
inst_len = __get_instruction_length(v, INSTR_CPUID, NULL);
|
||||
__update_guest_eip(regs, inst_len);
|
||||
}
|
||||
@@ -1757,6 +1760,11 @@ static void svm_do_msr_access(
|
||||
/* is it a read? */
|
||||
if (vmcb->exitinfo1 == 0)
|
||||
{
|
||||
+ if (ext_intercept_do_msr_read(ecx, regs))
|
||||
+ {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
switch (ecx) {
|
||||
case MSR_IA32_TSC:
|
||||
msr_content = hvm_get_guest_time(v);
|
||||
@@ -1847,6 +1855,11 @@ static void svm_do_msr_access(
|
||||
}
|
||||
else
|
||||
{
|
||||
+ if (ext_intercept_do_msr_write(ecx, regs))
|
||||
+ {
|
||||
+ goto done_1;
|
||||
+ }
|
||||
+
|
||||
msr_content = (u32)regs->eax | ((u64)regs->edx << 32);
|
||||
|
||||
hvmtrace_msr_write(v, ecx, msr_content);
|
||||
@@ -1907,6 +1920,7 @@ static void svm_do_msr_access(
|
||||
}
|
||||
break;
|
||||
}
|
||||
+done_1:
|
||||
|
||||
inst_len = __get_instruction_length(v, INSTR_WRMSR, NULL);
|
||||
}
|
||||
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vmx.c
|
||||
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <asm/hvm/vpt.h>
|
||||
#include <public/hvm/save.h>
|
||||
#include <asm/hvm/trace.h>
|
||||
+#include <asm/hvm/hvm_extensions.h>
|
||||
|
||||
enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
|
||||
|
||||
@@ -61,6 +62,7 @@ static void vmx_install_vlapic_mapping(s
|
||||
static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr);
|
||||
static void vmx_update_guest_efer(struct vcpu *v);
|
||||
|
||||
+
|
||||
static int vmx_domain_initialise(struct domain *d)
|
||||
{
|
||||
return vmx_alloc_vlapic_mapping(d);
|
||||
@@ -1248,7 +1250,8 @@ void vmx_cpuid_intercept(
|
||||
unsigned int count = *ecx;
|
||||
|
||||
#ifdef VMXASSIST
|
||||
- if ( input == 0x40000003 )
|
||||
+ if (( input == 0x40000003 ) &&
|
||||
+ (vmx_guest_x86_mode(current) == 0))
|
||||
{
|
||||
/*
|
||||
* NB. Unsupported interface for private use of VMXASSIST only.
|
||||
@@ -1319,12 +1322,13 @@ void vmx_cpuid_intercept(
|
||||
|
||||
static void vmx_do_cpuid(struct cpu_user_regs *regs)
|
||||
{
|
||||
- unsigned int eax, ebx, ecx, edx;
|
||||
+ unsigned int eax, ebx, ecx, edx, input;
|
||||
|
||||
eax = regs->eax;
|
||||
ebx = regs->ebx;
|
||||
ecx = regs->ecx;
|
||||
edx = regs->edx;
|
||||
+ input = eax;
|
||||
|
||||
vmx_cpuid_intercept(&eax, &ebx, &ecx, &edx);
|
||||
|
||||
@@ -1332,6 +1336,7 @@ static void vmx_do_cpuid(struct cpu_user
|
||||
regs->ebx = ebx;
|
||||
regs->ecx = ecx;
|
||||
regs->edx = edx;
|
||||
+ ext_intercept_do_cpuid(input, regs);
|
||||
}
|
||||
|
||||
#define CASE_GET_REG_P(REG, reg) \
|
||||
@@ -2316,6 +2321,9 @@ int vmx_msr_read_intercept(struct cpu_us
|
||||
|
||||
HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%x", ecx);
|
||||
|
||||
+ if (ext_intercept_do_msr_read(ecx, regs))
|
||||
+ goto done;
|
||||
+
|
||||
switch ( ecx )
|
||||
{
|
||||
case MSR_IA32_TSC:
|
||||
@@ -2499,6 +2507,9 @@ int vmx_msr_write_intercept(struct cpu_u
|
||||
HVM_DBG_LOG(DBG_LEVEL_1, "ecx=%x, eax=%x, edx=%x",
|
||||
ecx, (u32)regs->eax, (u32)regs->edx);
|
||||
|
||||
+ if (ext_intercept_do_msr_write(ecx, regs))
|
||||
+ return 1;
|
||||
+
|
||||
msr_content = (u32)regs->eax | ((u64)regs->edx << 32);
|
||||
|
||||
hvmtrace_msr_write(v, ecx, msr_content);
|
||||
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/domain.h
|
||||
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
|
||||
@@ -74,6 +74,10 @@ struct hvm_domain {
|
||||
/* Pass-through */
|
||||
struct hvm_iommu hvm_iommu;
|
||||
|
||||
+ /* Hvm extension handle */
|
||||
+ void *ext_handle; /* will be NULL on creation (memset)*/
|
||||
+ struct extension_intercept_vector *ext_vector;
|
||||
+
|
||||
bool_t hap_enabled;
|
||||
};
|
||||
|
||||
Index: xen-3.2.1-testing/xen/include/public/hvm/params.h
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/xen/include/public/hvm/params.h
|
||||
+++ xen-3.2.1-testing/xen/include/public/hvm/params.h
|
||||
@@ -50,10 +50,12 @@
|
||||
|
||||
#define HVM_PARAM_BUFIOREQ_PFN 6
|
||||
|
||||
+#define HVM_PARAM_EXTEND_HYPERVISOR 7
|
||||
+
|
||||
#ifdef __ia64__
|
||||
-#define HVM_PARAM_NVRAM_FD 7
|
||||
-#define HVM_PARAM_VHPT_SIZE 8
|
||||
-#define HVM_PARAM_BUFPIOREQ_PFN 9
|
||||
+#define HVM_PARAM_NVRAM_FD 8
|
||||
+#define HVM_PARAM_VHPT_SIZE 9
|
||||
+#define HVM_PARAM_BUFPIOREQ_PFN 10
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -75,15 +77,16 @@
|
||||
* Missed interrupts are collapsed together and delivered as one 'late tick'.
|
||||
* Guest time always tracks wallclock (i.e., real) time.
|
||||
*/
|
||||
-#define HVM_PARAM_TIMER_MODE 10
|
||||
+//KYS Check the modifications done to this file
|
||||
+#define HVM_PARAM_TIMER_MODE 11
|
||||
#define HVMPTM_delay_for_missed_ticks 0
|
||||
#define HVMPTM_no_delay_for_missed_ticks 1
|
||||
#define HVMPTM_no_missed_ticks_pending 2
|
||||
#define HVMPTM_one_missed_tick_pending 3
|
||||
|
||||
/* Boolean: Enable virtual HPET (high-precision event timer)? (x86-only) */
|
||||
-#define HVM_PARAM_HPET_ENABLED 11
|
||||
+#define HVM_PARAM_HPET_ENABLED 12
|
||||
|
||||
-#define HVM_NR_PARAMS 12
|
||||
+#define HVM_NR_PARAMS 13
|
||||
|
||||
#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
|
||||
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConstants.py
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConstants.py
|
||||
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConstants.py
|
||||
@@ -43,11 +43,12 @@ HVM_PARAM_STORE_EVTCHN = 2
|
||||
HVM_PARAM_PAE_ENABLED = 4
|
||||
HVM_PARAM_IOREQ_PFN = 5
|
||||
HVM_PARAM_BUFIOREQ_PFN = 6
|
||||
-HVM_PARAM_NVRAM_FD = 7
|
||||
-HVM_PARAM_VHPT_SIZE = 8
|
||||
-HVM_PARAM_BUFPIOREQ_PFN = 9
|
||||
-HVM_PARAM_TIMER_MODE = 10
|
||||
-HVM_PARAM_HPET_ENABLED = 11
|
||||
+HVM_PARAM_EXTEND_HYPERVISOR = 7
|
||||
+HVM_PARAM_NVRAM_FD = 8
|
||||
+HVM_PARAM_VHPT_SIZE = 9
|
||||
+HVM_PARAM_BUFPIOREQ_PFN = 10
|
||||
+HVM_PARAM_TIMER_MODE = 11
|
||||
+HVM_PARAM_HPET_ENABLED = 12
|
||||
|
||||
restart_modes = [
|
||||
"restart",
|
||||
Index: xen-3.2.1-testing/xen/arch/x86/hvm/Makefile
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/Makefile
|
||||
+++ xen-3.2.1-testing/xen/arch/x86/hvm/Makefile
|
||||
@@ -1,5 +1,6 @@
|
||||
subdir-y += svm
|
||||
subdir-y += vmx
|
||||
+subdir-y += hvm_ext
|
||||
|
||||
obj-y += hvm.o
|
||||
obj-y += i8254.o
|
||||
Index: xen-3.2.1-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
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <asm/mc146818rtc.h>
|
||||
#include <asm/spinlock.h>
|
||||
#include <asm/hvm/hvm.h>
|
||||
+#include <asm/hvm/hvm_extensions.h>
|
||||
#include <asm/hvm/vpt.h>
|
||||
#include <asm/hvm/support.h>
|
||||
#include <asm/hvm/cacheattr.h>
|
||||
@@ -103,6 +104,7 @@ void hvm_migrate_timers(struct vcpu *v)
|
||||
rtc_migrate_timers(v);
|
||||
hpet_migrate_timers(v);
|
||||
pt_migrate(v);
|
||||
+ ext_intercept_do_migrate_timers(v);
|
||||
}
|
||||
|
||||
void hvm_do_resume(struct vcpu *v)
|
||||
@@ -266,6 +268,7 @@ void hvm_domain_relinquish_resources(str
|
||||
|
||||
void hvm_domain_destroy(struct domain *d)
|
||||
{
|
||||
+ ext_intercept_domain_destroy(d);
|
||||
hvm_funcs.domain_destroy(d);
|
||||
vioapic_deinit(d);
|
||||
hvm_destroy_cacheattr_region_list(d);
|
||||
@@ -434,8 +437,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
|
||||
{
|
||||
int rc;
|
||||
|
||||
+ if ((rc = ext_intercept_vcpu_initialize(v)) != 0)
|
||||
+ goto fail1;
|
||||
+
|
||||
if ( (rc = vlapic_init(v)) != 0 )
|
||||
+ {
|
||||
+ ext_intercept_vcpu_destroy(v);
|
||||
goto fail1;
|
||||
+ }
|
||||
|
||||
if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
|
||||
goto fail2;
|
||||
@@ -483,6 +492,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
|
||||
hvm_funcs.vcpu_destroy(v);
|
||||
fail2:
|
||||
vlapic_destroy(v);
|
||||
+ ext_intercept_vcpu_destroy(v);
|
||||
fail1:
|
||||
return rc;
|
||||
}
|
||||
@@ -491,6 +501,7 @@ void hvm_vcpu_destroy(struct vcpu *v)
|
||||
{
|
||||
xfree(v->arch.hvm_vcpu.mtrr.var_ranges);
|
||||
|
||||
+ ext_intercept_vcpu_destroy(v);
|
||||
vlapic_destroy(v);
|
||||
hvm_funcs.vcpu_destroy(v);
|
||||
|
||||
@@ -1601,6 +1612,10 @@ int hvm_do_hypercall(struct cpu_user_reg
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
+ if (ext_intercept_do_hypercall(regs))
|
||||
+ {
|
||||
+ return HVM_HCALL_completed;
|
||||
+ }
|
||||
|
||||
if ( (eax >= NR_hypercalls) || !hvm_hypercall32_table[eax] )
|
||||
{
|
||||
@@ -1755,6 +1770,7 @@ int hvm_bringup_ap(int vcpuid, int tramp
|
||||
vcpu_wake(v);
|
||||
|
||||
gdprintk(XENLOG_INFO, "AP %d bringup succeeded.\n", vcpuid);
|
||||
+ ext_intercept_vcpu_up(v);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1992,6 +2008,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
|
||||
if ( a.value > HVMPTM_one_missed_tick_pending )
|
||||
goto param_fail;
|
||||
break;
|
||||
+ case HVM_PARAM_EXTEND_HYPERVISOR:
|
||||
+ if (hvm_ext_bind(d, (int)a.value))
|
||||
+ goto param_fail;
|
||||
}
|
||||
d->arch.hvm_domain.params[a.index] = a.value;
|
||||
rc = 0;
|
||||
Index: xen-3.2.1-testing/xen/arch/x86/x86_64/asm-offsets.c
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/asm-offsets.c
|
||||
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/asm-offsets.c
|
||||
@@ -148,4 +148,7 @@ void __dummy__(void)
|
||||
BLANK();
|
||||
|
||||
OFFSET(CPUINFO_ext_features, struct cpuinfo_x86, x86_capability[1]);
|
||||
+ BLANK();
|
||||
+
|
||||
+ OFFSET(DOM_ext_vector, struct domain, arch.hvm_domain.ext_vector);
|
||||
}
|
||||
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/entry.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)
|
||||
GET_CURRENT(%rbx)
|
||||
+ mov VCPU_domain(%rbx),%rax
|
||||
+ mov DOM_ext_vector(%rax),%rdx
|
||||
+ test %rdx,%rdx
|
||||
+ je vmx_no_ext_vector
|
||||
+ sti
|
||||
+ callq *(%rdx)
|
||||
+vmx_no_ext_vector:
|
||||
+
|
||||
cli # tests must not race interrupts
|
||||
|
||||
movl VCPU_processor(%rbx),%eax
|
||||
Index: xen-3.2.1-testing/xen/arch/x86/hvm/svm/entry.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)
|
||||
GET_CURRENT(%rbx)
|
||||
+ mov VCPU_domain(%rbx),%rax
|
||||
+ mov DOM_ext_vector(%rax),%rdx
|
||||
+ test %rdx,%rdx
|
||||
+ je svm_no_ext_vector
|
||||
+ sti
|
||||
+ callq *(%rdx)
|
||||
+svm_no_ext_vector:
|
||||
+
|
||||
CLGI
|
||||
|
||||
movl VCPU_processor(%rbx),%eax
|
||||
Index: xen-3.2.1-testing/xen/arch/x86/hvm/save.c
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/save.c
|
||||
+++ xen-3.2.1-testing/xen/arch/x86/hvm/save.c
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <asm/hvm/support.h>
|
||||
#include <public/hvm/save.h>
|
||||
+#include <public/hvm/params.h>
|
||||
+#include <asm/hvm/hvm_extensions.h>
|
||||
|
||||
void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr)
|
||||
{
|
||||
@@ -31,8 +33,7 @@ void arch_hvm_save(struct domain *d, str
|
||||
/* Save some CPUID bits */
|
||||
cpuid(1, &eax, &ebx, &ecx, &edx);
|
||||
hdr->cpuid = eax;
|
||||
-
|
||||
- hdr->pad0 = 0;
|
||||
+ hdr->ext_id = d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR];
|
||||
}
|
||||
|
||||
int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
|
||||
@@ -61,6 +62,9 @@ int arch_hvm_load(struct domain *d, stru
|
||||
|
||||
/* VGA state is not saved/restored, so we nobble the cache. */
|
||||
d->arch.hvm_domain.stdvga.cache = 0;
|
||||
+ d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] = hdr->ext_id;
|
||||
+ if (hvm_ext_bind(d, hdr->ext_id))
|
||||
+ return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Index: xen-3.2.1-testing/xen/include/public/arch-x86/hvm/save.h
|
||||
===================================================================
|
||||
--- xen-3.2.1-testing.orig/xen/include/public/arch-x86/hvm/save.h
|
||||
+++ xen-3.2.1-testing/xen/include/public/arch-x86/hvm/save.h
|
||||
@@ -38,7 +38,7 @@ struct hvm_save_header {
|
||||
uint32_t version; /* File format version */
|
||||
uint64_t changeset; /* Version of Xen that saved this file */
|
||||
uint32_t cpuid; /* CPUID[0x01][%eax] on the saving machine */
|
||||
- uint32_t pad0;
|
||||
+ uint32_t ext_id; /* extension ID */
|
||||
};
|
||||
|
||||
DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
|
||||
@@ -422,9 +422,30 @@ struct hvm_hw_mtrr {
|
||||
|
||||
DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct hvm_hw_mtrr);
|
||||
|
||||
+struct hvm_ns_veridian_dom {
|
||||
+ uint64_t guestid_msr;
|
||||
+ uint64_t hypercall_msr;
|
||||
+ uint32_t long_mode;
|
||||
+ uint32_t pad0;
|
||||
+};
|
||||
+DECLARE_HVM_SAVE_TYPE(NS_VERIDIAN_DOM, 15, struct hvm_ns_veridian_dom);
|
||||
+
|
||||
+struct hvm_ns_veridian_cpu {
|
||||
+ uint64_t control_msr;
|
||||
+ uint64_t version_msr;
|
||||
+ uint64_t sief_msr;
|
||||
+ uint64_t simp_msr;
|
||||
+ uint64_t eom_msr;
|
||||
+ uint64_t int_msr[16];
|
||||
+ struct {
|
||||
+ uint64_t config;
|
||||
+ uint64_t count;
|
||||
+ } timers[4];
|
||||
+};
|
||||
+DECLARE_HVM_SAVE_TYPE(NS_VERIDIAN_CPU, 16, struct hvm_ns_veridian_cpu);
|
||||
/*
|
||||
* Largest type-code in use
|
||||
*/
|
||||
-#define HVM_SAVE_CODE_MAX 14
|
||||
+#define HVM_SAVE_CODE_MAX 16
|
||||
|
||||
#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
|
File diff suppressed because it is too large
Load Diff
163
poll-single-port.patch
Normal file
163
poll-single-port.patch
Normal file
@ -0,0 +1,163 @@
|
||||
Index: xen-3.3.1-testing/xen/common/domain.c
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/common/domain.c
|
||||
+++ xen-3.3.1-testing/xen/common/domain.c
|
||||
@@ -209,6 +209,7 @@ struct domain *domain_create(
|
||||
atomic_set(&d->refcnt, 1);
|
||||
spin_lock_init(&d->domain_lock);
|
||||
spin_lock_init(&d->page_alloc_lock);
|
||||
+ spin_lock_init(&d->poll_lock);
|
||||
spin_lock_init(&d->shutdown_lock);
|
||||
spin_lock_init(&d->hypercall_deadlock_mutex);
|
||||
INIT_LIST_HEAD(&d->page_list);
|
||||
@@ -653,7 +654,7 @@ void vcpu_reset(struct vcpu *v)
|
||||
|
||||
v->fpu_initialised = 0;
|
||||
v->fpu_dirtied = 0;
|
||||
- v->is_polling = 0;
|
||||
+ v->poll_evtchn = 0;
|
||||
v->is_initialised = 0;
|
||||
v->nmi_pending = 0;
|
||||
v->mce_pending = 0;
|
||||
Index: xen-3.3.1-testing/xen/common/event_channel.c
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/common/event_channel.c
|
||||
+++ xen-3.3.1-testing/xen/common/event_channel.c
|
||||
@@ -545,6 +545,7 @@ out:
|
||||
static int evtchn_set_pending(struct vcpu *v, int port)
|
||||
{
|
||||
struct domain *d = v->domain;
|
||||
+ unsigned long flags;
|
||||
|
||||
/*
|
||||
* The following bit operations must happen in strict order.
|
||||
@@ -564,19 +565,36 @@ static int evtchn_set_pending(struct vcp
|
||||
}
|
||||
|
||||
/* Check if some VCPU might be polling for this event. */
|
||||
- if ( unlikely(d->is_polling) )
|
||||
+ if ( likely(!d->is_polling) )
|
||||
+ return 0;
|
||||
+
|
||||
+ spin_lock_irqsave(&d->poll_lock, flags);
|
||||
+
|
||||
+ if ( likely(d->is_polling) )
|
||||
{
|
||||
- d->is_polling = 0;
|
||||
+ bool_t is_polling = 0;
|
||||
+
|
||||
+ d->is_polling = -1;
|
||||
smp_mb(); /* check vcpu poll-flags /after/ clearing domain poll-flag */
|
||||
for_each_vcpu ( d, v )
|
||||
{
|
||||
- if ( !v->is_polling )
|
||||
+ int poll_evtchn = v->poll_evtchn;
|
||||
+
|
||||
+ if ( !poll_evtchn )
|
||||
+ continue;
|
||||
+ if ( poll_evtchn > 0 && poll_evtchn != port )
|
||||
+ {
|
||||
+ is_polling = 1;
|
||||
continue;
|
||||
- v->is_polling = 0;
|
||||
+ }
|
||||
+ v->poll_evtchn = 0;
|
||||
vcpu_unblock(v);
|
||||
}
|
||||
+ cmpxchg(&d->is_polling, -1, is_polling);
|
||||
}
|
||||
|
||||
+ spin_unlock_irqrestore(&d->poll_lock, flags);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
Index: xen-3.3.1-testing/xen/common/schedule.c
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/common/schedule.c
|
||||
+++ xen-3.3.1-testing/xen/common/schedule.c
|
||||
@@ -348,7 +348,7 @@ static long do_poll(struct sched_poll *s
|
||||
return -EFAULT;
|
||||
|
||||
set_bit(_VPF_blocked, &v->pause_flags);
|
||||
- v->is_polling = 1;
|
||||
+ v->poll_evtchn = -1;
|
||||
d->is_polling = 1;
|
||||
|
||||
/* Check for events /after/ setting flags: avoids wakeup waiting race. */
|
||||
@@ -369,6 +369,9 @@ static long do_poll(struct sched_poll *s
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if ( i == 1 )
|
||||
+ v->poll_evtchn = port;
|
||||
+
|
||||
if ( sched_poll->timeout != 0 )
|
||||
set_timer(&v->poll_timer, sched_poll->timeout);
|
||||
|
||||
@@ -378,7 +381,7 @@ static long do_poll(struct sched_poll *s
|
||||
return 0;
|
||||
|
||||
out:
|
||||
- v->is_polling = 0;
|
||||
+ v->poll_evtchn = 0;
|
||||
clear_bit(_VPF_blocked, &v->pause_flags);
|
||||
return rc;
|
||||
}
|
||||
@@ -760,10 +763,10 @@ static void poll_timer_fn(void *data)
|
||||
{
|
||||
struct vcpu *v = data;
|
||||
|
||||
- if ( !v->is_polling )
|
||||
+ if ( !v->poll_evtchn )
|
||||
return;
|
||||
|
||||
- v->is_polling = 0;
|
||||
+ v->poll_evtchn = 0;
|
||||
vcpu_unblock(v);
|
||||
}
|
||||
|
||||
Index: xen-3.3.1-testing/xen/include/xen/sched.h
|
||||
===================================================================
|
||||
--- xen-3.3.1-testing.orig/xen/include/xen/sched.h
|
||||
+++ xen-3.3.1-testing/xen/include/xen/sched.h
|
||||
@@ -106,8 +106,6 @@ struct vcpu
|
||||
bool_t fpu_initialised;
|
||||
/* Has the FPU been used since it was last saved? */
|
||||
bool_t fpu_dirtied;
|
||||
- /* Is this VCPU polling any event channels (SCHEDOP_poll)? */
|
||||
- bool_t is_polling;
|
||||
/* Initialization completed for this VCPU? */
|
||||
bool_t is_initialised;
|
||||
/* Currently running on a CPU? */
|
||||
@@ -137,6 +135,11 @@ struct vcpu
|
||||
unsigned long pause_flags;
|
||||
atomic_t pause_count;
|
||||
|
||||
+ /* Is this VCPU polling any event channels (SCHEDOP_poll)?
|
||||
+ * Positive values indicate a single, negative values multiple channels
|
||||
+ * being polled. */
|
||||
+ int poll_evtchn;
|
||||
+
|
||||
/* IRQ-safe virq_lock protects against delivering VIRQ to stale evtchn. */
|
||||
u16 virq_to_evtchn[NR_VIRQS];
|
||||
spinlock_t virq_lock;
|
||||
@@ -210,7 +213,7 @@ struct domain
|
||||
/* Is this guest being debugged by dom0? */
|
||||
bool_t debugger_attached;
|
||||
/* Are any VCPUs polling event channels (SCHEDOP_poll)? */
|
||||
- bool_t is_polling;
|
||||
+ signed char is_polling;
|
||||
/* Is this guest dying (i.e., a zombie)? */
|
||||
enum { DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } is_dying;
|
||||
/* Domain is paused by controller software? */
|
||||
@@ -218,6 +221,9 @@ struct domain
|
||||
/* Domain's VCPUs are pinned 1:1 to physical CPUs? */
|
||||
bool_t is_pinned;
|
||||
|
||||
+ /* Protects is_polling modification in evtchn_set_pending(). */
|
||||
+ spinlock_t poll_lock;
|
||||
+
|
||||
/* Guest has shut down (inc. reason code)? */
|
||||
spinlock_t shutdown_lock;
|
||||
bool_t is_shutting_down; /* in process of shutting down? */
|
@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/image.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/image.py
|
||||
@@ -476,6 +476,10 @@ class ImageHandler:
|
||||
# but this can easily lead to very rapid restart loops against
|
||||
# which we currently have no protection
|
||||
@ -13,10 +13,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
|
||||
def recreate(self):
|
||||
if self.device_model is None:
|
||||
return
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/server/blkif.py
|
||||
Index: xen-3.3.1-testing/tools/python/xen/xend/server/blkif.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/blkif.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/blkif.py
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/blkif.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/server/blkif.py
|
||||
@@ -78,6 +78,9 @@ class BlkifController(DevController):
|
||||
if uuid:
|
||||
back['uuid'] = uuid
|
||||
@ -27,11 +27,11 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/blkif.py
|
||||
if security.on() == xsconstants.XS_POLICY_ACM:
|
||||
self.do_access_control(config, uname)
|
||||
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
Index: xen-3.3.1-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
@@ -95,6 +95,34 @@ class SrvDomain(SrvDir):
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/SrvDomain.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
@@ -95,6 +95,31 @@ class SrvDomain(SrvDir):
|
||||
def do_save(self, _, req):
|
||||
return self.xd.domain_save(self.dom.domid, req.args['file'][0])
|
||||
|
||||
@ -40,36 +40,42 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
+ return req.threadRequest(self.do_snapshot_create, op, req)
|
||||
+
|
||||
+ def do_snapshot_create(self, _, req):
|
||||
+ return self.xd.domain_snapshot_create(self.dom.domid, req.args)
|
||||
+ return self.xd.domain_snapshot_create(self.dom.domid, req.args['name'][0])
|
||||
+
|
||||
+ def op_snapshot_list(self, op, req):
|
||||
+ self.acceptCommand(req)
|
||||
+ return req.threadRequest(self.do_snapshot_list, op, req)
|
||||
+
|
||||
+ def do_snapshot_list(self, _, req):
|
||||
+ return self.xd.domain_snapshot_list(self.dom.domid)
|
||||
+ return self.xd.domain_snapshot_list(self.dom.getName())
|
||||
+
|
||||
+ def op_snapshot_apply(self, op, req):
|
||||
+ self.acceptCommand(req)
|
||||
+ return req.threadRequest(self.do_snapshot_apply, op, req)
|
||||
+
|
||||
+ def do_snapshot_apply(self, _, req):
|
||||
+ return self.xd.domain_snapshot_apply(self.dom.domid, req.args)
|
||||
+ return self.xd.domain_snapshot_apply(self.dom.getName(), req.args['name'][0])
|
||||
+
|
||||
+ def op_snapshot_delete(self, op, req):
|
||||
+ self.acceptCommand(req)
|
||||
+ return req.threadRequest(self.do_snapshot_delete, op, req)
|
||||
+
|
||||
+ def do_snapshot_delete(self, _, req):
|
||||
+ return self.xd.domain_snapshot_delete(self.dom.domid, req.args)
|
||||
+ return self.xd.domain_snapshot_delete(self.dom.getName(), req.args['name'][0])
|
||||
+
|
||||
def op_dump(self, op, req):
|
||||
self.acceptCommand(req)
|
||||
return req.threadRequest(self.do_dump, op, req)
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendCheckpoint.py
|
||||
@@ -230,7 +255,7 @@ class SrvDomain(SrvDir):
|
||||
def render_GET(self, req):
|
||||
op = req.args.get('op')
|
||||
|
||||
- if op and op[0] in ['vcpuinfo']:
|
||||
+ if op and op[0] in ['vcpuinfo', 'snapshot_list']:
|
||||
return self.perform(req)
|
||||
|
||||
#
|
||||
Index: xen-3.3.1-testing/tools/python/xen/xend/XendCheckpoint.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/XendCheckpoint.py
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendCheckpoint.py
|
||||
@@ -65,10 +65,12 @@ def insert_after(list, pred, value):
|
||||
return
|
||||
|
||||
@ -279,10 +285,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendCheckpoint.py
|
||||
if not paused:
|
||||
dominfo.unpause()
|
||||
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -208,6 +208,7 @@ XENAPI_CFG_TYPES = {
|
||||
'cpuid' : dict,
|
||||
'cpuid_check' : dict,
|
||||
@ -291,10 +297,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
|
||||
}
|
||||
|
||||
# List of legacy configuration keys that have no equivalent in the
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomain.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomain.py
|
||||
@@ -52,6 +52,7 @@ from xen.xend.xenstore.xstransact import
|
||||
from xen.xend.xenstore.xswatch import xswatch
|
||||
from xen.util import mkdir
|
||||
@ -303,7 +309,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
|
||||
|
||||
xc = xen.lowlevel.xc.xc()
|
||||
xoptions = XendOptions.instance()
|
||||
@@ -1396,6 +1397,164 @@ class XendDomain:
|
||||
@@ -1400,6 +1401,164 @@ class XendDomain:
|
||||
raise XendError("can't write guest state file %s: %s" %
|
||||
(dst, ex[1]))
|
||||
|
||||
@ -468,10 +474,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
|
||||
def domain_pincpu(self, domid, vcpu, cpumap):
|
||||
"""Set which cpus vcpu can use
|
||||
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xm/main.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xm/main.py
|
||||
@@ -122,6 +122,14 @@ SUBCOMMAND_HELP = {
|
||||
'Restore a domain from a saved state.'),
|
||||
'save' : ('[-c] <Domain> <CheckpointFile>',
|
||||
|
@ -1,8 +1,22 @@
|
||||
Index: xen-3.3.0-testing/xen/arch/x86/hvm/hvm.c
|
||||
Index: xen-3.3.1-testing/xen/arch/x86/hvm/hvm.c
|
||||
===================================================================
|
||||
--- 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)
|
||||
--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/hvm.c
|
||||
+++ xen-3.3.1-testing/xen/arch/x86/hvm/hvm.c
|
||||
@@ -525,11 +525,12 @@ static int hvm_load_cpu_ctxt(struct doma
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- if ( (ctxt.msr_efer & ~(EFER_FFXSE | EFER_LME | EFER_LMA |
|
||||
+ if ( (ctxt.msr_efer & ~(EFER_FFXSE | EFER_LMSLE | EFER_LME | EFER_LMA |
|
||||
EFER_NX | EFER_SCE)) ||
|
||||
((sizeof(long) != 8) && (ctxt.msr_efer & EFER_LME)) ||
|
||||
(!cpu_has_nx && (ctxt.msr_efer & EFER_NX)) ||
|
||||
(!cpu_has_syscall && (ctxt.msr_efer & EFER_SCE)) ||
|
||||
+ (!cpu_has_lmsl && (ctxt.msr_efer & EFER_LMSLE)) ||
|
||||
(!cpu_has_ffxsr && (ctxt.msr_efer & EFER_FFXSE)) ||
|
||||
((ctxt.msr_efer & (EFER_LME|EFER_LMA)) == EFER_LMA) )
|
||||
{
|
||||
@@ -790,10 +791,11 @@ int hvm_set_efer(uint64_t value)
|
||||
|
||||
value &= ~EFER_LMA;
|
||||
|
||||
@ -15,10 +29,10 @@ Index: xen-3.3.0-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.3.0-testing/xen/arch/x86/hvm/svm/svm.c
|
||||
Index: xen-3.3.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
|
||||
--- xen-3.3.1-testing.orig/xen/arch/x86/hvm/svm/svm.c
|
||||
+++ xen-3.3.1-testing/xen/arch/x86/hvm/svm/svm.c
|
||||
@@ -53,6 +53,11 @@
|
||||
|
||||
u32 svm_feature_flags;
|
||||
@ -54,10 +68,10 @@ Index: xen-3.3.0-testing/xen/arch/x86/hvm/svm/svm.c
|
||||
if ( cpu != 0 )
|
||||
return 1;
|
||||
|
||||
Index: xen-3.3.0-testing/xen/include/asm-x86/hvm/hvm.h
|
||||
Index: xen-3.3.1-testing/xen/include/asm-x86/hvm/hvm.h
|
||||
===================================================================
|
||||
--- 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
|
||||
--- xen-3.3.1-testing.orig/xen/include/asm-x86/hvm/hvm.h
|
||||
+++ xen-3.3.1-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;
|
||||
|
21
tools-gdbserver-build.diff
Normal file
21
tools-gdbserver-build.diff
Normal file
@ -0,0 +1,21 @@
|
||||
diff -r 0eab1869ef66 tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
|
||||
--- a/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in Thu Sep 04 11:42:38 2008 +0100
|
||||
+++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in Thu Sep 11 15:45:31 2008 -0600
|
||||
@@ -90,7 +90,7 @@ GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS
|
||||
GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
|
||||
#PROFILE_CFLAGS = -pg
|
||||
|
||||
-WARN_CFLAGS = -Wall
|
||||
+WARN_CFLAGS = -Wall -Wno-sequence-point
|
||||
|
||||
# CFLAGS is specifically reserved for setting from the command line
|
||||
# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
|
||||
@@ -260,7 +260,7 @@ linux-low.o: linux-low.c $(linux_low_h)
|
||||
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
|
||||
|
||||
linux-xen-low.o: linux-xen-low.c $(linux_low_h) $(server_h)
|
||||
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
|
||||
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) -I../../../../../include/ $< @USE_THREAD_DB@
|
||||
|
||||
linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h)
|
||||
linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h)
|
141
x86-microcode.patch
Normal file
141
x86-microcode.patch
Normal file
@ -0,0 +1,141 @@
|
||||
Index: xen-3.3.0-testing/xen/arch/x86/microcode.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/xen/arch/x86/microcode.c
|
||||
+++ xen-3.3.0-testing/xen/arch/x86/microcode.c
|
||||
@@ -98,7 +98,7 @@ MODULE_LICENSE("GPL");
|
||||
static int verbose;
|
||||
boolean_param("microcode.verbose", verbose);
|
||||
|
||||
-#define MICROCODE_VERSION "1.14a"
|
||||
+#define MICROCODE_VERSION "1.14b"
|
||||
|
||||
#define DEFAULT_UCODE_DATASIZE (2000) /* 2000 bytes */
|
||||
#define MC_HEADER_SIZE (sizeof (microcode_header_t)) /* 48 bytes */
|
||||
@@ -118,9 +118,6 @@ boolean_param("microcode.verbose", verbo
|
||||
|
||||
#define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE)
|
||||
|
||||
-/* serialize access to the physical write to MSR 0x79 */
|
||||
-static DEFINE_SPINLOCK(microcode_update_lock);
|
||||
-
|
||||
/* no concurrent ->write()s are allowed on /dev/cpu/microcode */
|
||||
static DEFINE_MUTEX(microcode_mutex);
|
||||
|
||||
@@ -376,25 +373,10 @@ out:
|
||||
|
||||
static void do_update_one (void * unused)
|
||||
{
|
||||
- unsigned long flags;
|
||||
unsigned int val[2];
|
||||
int cpu_num = smp_processor_id();
|
||||
struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;
|
||||
|
||||
- if (uci->mc == NULL) {
|
||||
- if (verbose) {
|
||||
- if (uci->err == MC_SUCCESS)
|
||||
- printk(KERN_INFO "microcode: CPU%d already at revision 0x%x\n",
|
||||
- cpu_num, uci->rev);
|
||||
- else
|
||||
- printk(KERN_INFO "microcode: No new microcode data for CPU%d\n", cpu_num);
|
||||
- }
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* serialize access to the physical write to MSR 0x79 */
|
||||
- spin_lock_irqsave(µcode_update_lock, flags);
|
||||
-
|
||||
/* write microcode via MSR 0x79 */
|
||||
wrmsr(MSR_IA32_UCODE_WRITE,
|
||||
(unsigned long) uci->mc->bits,
|
||||
@@ -409,7 +391,6 @@ static void do_update_one (void * unused
|
||||
|
||||
/* notify the caller of success on this cpu */
|
||||
uci->err = MC_SUCCESS;
|
||||
- spin_unlock_irqrestore(µcode_update_lock, flags);
|
||||
printk(KERN_INFO "microcode: CPU%d updated from revision "
|
||||
"0x%x to 0x%x, date = %08x \n",
|
||||
cpu_num, uci->rev, val[1], uci->mc->hdr.date);
|
||||
@@ -418,40 +399,65 @@ static void do_update_one (void * unused
|
||||
|
||||
static int do_microcode_update (void)
|
||||
{
|
||||
- int i, error;
|
||||
+ int i, j, error;
|
||||
+ cpumask_t cpu_mask = cpu_online_map;
|
||||
|
||||
- if (on_each_cpu(collect_cpu_info, NULL, 1, 1) != 0) {
|
||||
- printk(KERN_ERR "microcode: Error! Could not run on all processors\n");
|
||||
- error = -EIO;
|
||||
- goto out;
|
||||
+ for_each_cpu_mask(i, cpu_mask) {
|
||||
+ if (on_selected_cpus(cpumask_of_cpu(i), collect_cpu_info, NULL, 1, 1) != 0) {
|
||||
+ printk(KERN_ERR "microcode: Error! Could not run on all processors\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
}
|
||||
|
||||
if ((error = find_matching_ucodes())) {
|
||||
printk(KERN_ERR "microcode: Error in the microcode data\n");
|
||||
- goto out_free;
|
||||
+ cpus_clear(cpu_mask);
|
||||
}
|
||||
|
||||
- if (on_each_cpu(do_update_one, NULL, 1, 1) != 0) {
|
||||
- printk(KERN_ERR "microcode: Error! Could not run on all processors\n");
|
||||
- error = -EIO;
|
||||
+ for (; (i = any_online_cpu(cpu_mask)) < NR_CPUS; cpu_clear(i, cpu_mask)) {
|
||||
+ if (ucode_cpu_info[i].mc == NULL) {
|
||||
+ if (verbose) {
|
||||
+ switch (ucode_cpu_info[i].err) {
|
||||
+ case MC_SUCCESS:
|
||||
+ printk(KERN_INFO "microcode: CPU%d already at revision 0x%x\n",
|
||||
+ i, ucode_cpu_info[i].rev);
|
||||
+ break;
|
||||
+ case MC_IGNORED:
|
||||
+ printk(KERN_WARNING "microcode: CPU%d not 'upgrading' to earlier revision"
|
||||
+ " 0x%x (current=0x%x)\n", i, ucode_cpu_info[i].cksum, ucode_cpu_info[i].rev);
|
||||
+ break;
|
||||
+ default:
|
||||
+ printk(KERN_INFO "microcode: No new microcode data for CPU%d\n", i);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ } else if (on_selected_cpus(cpumask_of_cpu(i), do_update_one, NULL, 1, 1) != 0) {
|
||||
+ printk(KERN_ERR "microcode: Error! Could not run on processor %d\n", i);
|
||||
+ error = -EIO;
|
||||
+ } else if (ucode_cpu_info[i].err == MC_SUCCESS) {
|
||||
+ cpus_andnot(cpu_mask, cpu_mask, cpu_sibling_map[i]);
|
||||
+ for_each_cpu_mask(j, cpu_sibling_map[i]) {
|
||||
+ if (j != i) {
|
||||
+ ucode_cpu_info[j].err = MC_SUCCESS;
|
||||
+ ASSERT(ucode_cpu_info[j].mc == ucode_cpu_info[i].mc);
|
||||
+ ucode_cpu_info[j].mc = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
-out_free:
|
||||
- for_each_online_cpu(i) {
|
||||
+ for (i = 0; i < NR_CPUS; i++) {
|
||||
if (ucode_cpu_info[i].mc) {
|
||||
- int j;
|
||||
void *tmp = ucode_cpu_info[i].mc;
|
||||
- vfree(tmp);
|
||||
- for_each_online_cpu(j) {
|
||||
+
|
||||
+ for (j = 0; j < NR_CPUS; j++) {
|
||||
if (ucode_cpu_info[j].mc == tmp)
|
||||
ucode_cpu_info[j].mc = NULL;
|
||||
}
|
||||
+ vfree(tmp);
|
||||
}
|
||||
- if (ucode_cpu_info[i].err == MC_IGNORED && verbose)
|
||||
- printk(KERN_WARNING "microcode: CPU%d not 'upgrading' to earlier revision"
|
||||
- " 0x%x (current=0x%x)\n", i, ucode_cpu_info[i].cksum, ucode_cpu_info[i].rev);
|
||||
}
|
||||
-out:
|
||||
+
|
||||
return error;
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ Index: xen-3.3.0-testing/xen/include/asm-x86/mm.h
|
||||
===================================================================
|
||||
--- 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);
|
||||
@@ -307,6 +307,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))))
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c53af8d91df0454b584aa771232a715bd068467c2841a3d44812fd9e70cb497e
|
||||
size 9822192
|
3
xen-3.3.1-testing-src.tar.bz2
Normal file
3
xen-3.3.1-testing-src.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:54669aeece8872bda13bb98fc0afa03d82fd439f4e234935d8174657a2ee0f08
|
||||
size 22688672
|
@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/util/blkif.py
|
||||
Index: xen-3.3.1-testing/tools/python/xen/util/blkif.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/util/blkif.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/util/blkif.py
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/util/blkif.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/util/blkif.py
|
||||
@@ -71,23 +71,24 @@ def blkdev_segment(name):
|
||||
'type' : 'Disk' }
|
||||
return val
|
||||
@ -32,11 +32,11 @@ Index: xen-3.3.0-testing/tools/python/xen/util/blkif.py
|
||||
|
||||
def mount_mode(name):
|
||||
mode = None
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/server/DevController.py
|
||||
Index: xen-3.3.1-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
|
||||
@@ -612,6 +612,31 @@ class DevController:
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/DevController.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/server/DevController.py
|
||||
@@ -604,6 +604,31 @@ class DevController:
|
||||
return (Missing, None)
|
||||
|
||||
|
||||
@ -68,10 +68,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/server/DevController.py
|
||||
def backendPath(self, backdom, devid):
|
||||
"""Construct backend path given the backend domain and device id.
|
||||
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendBootloader.py
|
||||
Index: xen-3.3.1-testing/tools/python/xen/xend/XendBootloader.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendBootloader.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/XendBootloader.py
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendBootloader.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendBootloader.py
|
||||
@@ -12,8 +12,9 @@
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
@ -126,10 +126,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendBootloader.py
|
||||
+ if m:
|
||||
+ return vdisk == m.group(1) or vdisk == m.group(2)
|
||||
+ return True
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -35,7 +35,7 @@ from types import StringTypes
|
||||
|
||||
import xen.lowlevel.xc
|
||||
@ -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
|
||||
@@ -1875,6 +1875,10 @@ class XendDomainInfo:
|
||||
@@ -1897,6 +1897,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)
|
||||
@@ -2557,8 +2561,11 @@ class XendDomainInfo:
|
||||
@@ -2569,8 +2573,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"
|
||||
@@ -2569,13 +2576,10 @@ class XendDomainInfo:
|
||||
@@ -2581,13 +2588,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))
|
||||
@@ -2587,7 +2591,9 @@ class XendDomainInfo:
|
||||
@@ -2599,7 +2603,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:
|
||||
@@ -2598,7 +2604,7 @@ class XendDomainInfo:
|
||||
@@ -2610,7 +2616,7 @@ class XendDomainInfo:
|
||||
log.info("Unmounting %s from %s." %
|
||||
(fn, BOOTLOADER_LOOPBACK_DEVICE))
|
||||
|
||||
|
@ -1,21 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/vl.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/examples/xend-config.sxp
|
||||
+++ xen-3.3.0-testing/tools/examples/xend-config.sxp
|
||||
@@ -141,7 +141,8 @@
|
||||
#
|
||||
# (network-script 'network-bridge netdev=eth1')
|
||||
#
|
||||
-# The bridge is named xenbr0, by default. To rename the bridge, use
|
||||
+# The bridge is named to match the outgoing interface, by default. For example,
|
||||
+# eth1 is on xenbr1. To rename the bridge, use
|
||||
#
|
||||
# (network-script 'network-bridge bridge=<name>')
|
||||
#
|
||||
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
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/vl.c
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/vl.c
|
||||
@@ -134,8 +134,8 @@ int inet_aton(const char *cp, struct in_
|
||||
#include "exec-all.h"
|
||||
|
||||
@ -42,10 +28,10 @@ Index: xen-3.3.0-testing/tools/ioemu-remote/vl.c
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/image.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/image.py
|
||||
@@ -764,14 +764,16 @@ class HVMImageHandler(ImageHandler):
|
||||
mac = devinfo.get('mac')
|
||||
if mac is None:
|
||||
@ -66,10 +52,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
|
||||
|
||||
if nics == 0:
|
||||
ret.append("-net")
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/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
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/i386-dm/qemu-ifup
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/ide.c
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/hw/ide.c
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/ioemu-remote/hw/ide.c
|
||||
+++ xen-3.3.0-testing/tools/ioemu-remote/hw/ide.c
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/hw/ide.c
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/hw/ide.c
|
||||
@@ -485,6 +485,9 @@ typedef struct PCIIDEState {
|
||||
} PCIIDEState;
|
||||
|
||||
@ -62,11 +62,11 @@ Index: xen-3.3.0-testing/tools/ioemu-remote/hw/ide.c
|
||||
pci_conf = d->dev.config;
|
||||
pci_conf[0x00] = 0x86; // Intel
|
||||
pci_conf[0x01] = 0x80;
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/pci.c
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/hw/pci.c
|
||||
===================================================================
|
||||
--- 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 *
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/hw/pci.c
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/hw/pci.c
|
||||
@@ -648,6 +648,28 @@ void pci_nic_init(PCIBus *bus, NICInfo *
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,10 +95,10 @@ Index: xen-3.3.0-testing/tools/ioemu-remote/hw/pci.c
|
||||
typedef struct {
|
||||
PCIDevice dev;
|
||||
PCIBus *bus;
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_platform.c
|
||||
Index: xen-3.3.1-testing/tools/ioemu-remote/hw/xen_platform.c
|
||||
===================================================================
|
||||
--- 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
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/hw/xen_platform.c
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/hw/xen_platform.c
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "hw.h"
|
||||
#include "pci.h"
|
||||
@ -162,10 +162,10 @@ Index: xen-3.3.0-testing/tools/ioemu-remote/hw/xen_platform.c
|
||||
}
|
||||
|
||||
static uint32_t platform_mmio_read(void *opaque, target_phys_addr_t addr)
|
||||
Index: xen-3.3.0-testing/tools/ioemu-remote/vl.c
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/vl.c
|
||||
+++ xen-3.3.1-testing/tools/ioemu-remote/vl.c
|
||||
@@ -259,6 +259,20 @@ static int event_pending = 1;
|
||||
|
||||
#include "xen-vl-extra.c"
|
||||
@ -262,10 +262,10 @@ Index: xen-3.3.0-testing/tools/ioemu-remote/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-remote/sysemu.h
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/ioemu-remote/sysemu.h
|
||||
+++ xen-3.3.1-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);
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendNode.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendNode.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendNode.py
|
||||
@@ -650,11 +650,35 @@ class XendNode:
|
||||
|
||||
info['cpu_mhz'] = info['cpu_khz'] / 1000
|
||||
@ -53,10 +53,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendNode.py
|
||||
'node_to_cpu',
|
||||
'node_to_memory'
|
||||
]
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/balloon.py
|
||||
Index: xen-3.3.1-testing/tools/python/xen/xend/balloon.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/balloon.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/balloon.py
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/balloon.py
|
||||
+++ xen-3.3.1-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',
|
||||
@ -90,11 +90,11 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/balloon.py
|
||||
def free(need_mem):
|
||||
"""Balloon out memory from the privileged domain so that there is the
|
||||
specified required amount (in KiB) free.
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
Index: xen-3.3.1-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
|
||||
@@ -1016,6 +1016,27 @@ class XendDomainInfo:
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -1038,6 +1038,27 @@ class XendDomainInfo:
|
||||
|
||||
return None
|
||||
|
||||
@ -122,10 +122,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
def setMemoryTarget(self, target):
|
||||
"""Set the memory target of this domain.
|
||||
@param target: In MiB.
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
Index: xen-3.3.1-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py
|
||||
+++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/SrvDomain.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/server/SrvDomain.py
|
||||
@@ -171,7 +171,7 @@ class SrvDomain(SrvDir):
|
||||
|
||||
|
||||
|
164
xen-updown.sh
Normal file
164
xen-updown.sh
Normal file
@ -0,0 +1,164 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
usage () {
|
||||
echo $@
|
||||
echo "usage: $0 [<config>] <interface> [-o <options>]"
|
||||
echo ""
|
||||
echo "Options are:"
|
||||
echo " debug : be verbose"
|
||||
echo " rc : indicates that we are called from rcnetwork"
|
||||
echo ""
|
||||
echo "Any another options are ignored"
|
||||
exit $R_USAGE
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# change the working direcory and source some common files
|
||||
#
|
||||
R_INTERNAL=1 # internal error, e.g. no config or missing scripts
|
||||
cd /etc/sysconfig/network || exit $R_INTERNAL
|
||||
test -f ./config && . ./config
|
||||
test -f scripts/functions && . scripts/functions || exit $R_INTERNAL
|
||||
|
||||
######################################################################
|
||||
# check arguments and how we are called (in case of links)
|
||||
#
|
||||
SCRIPTNAME=${0}
|
||||
debug $*
|
||||
case $1 in ""|-h|*help*) usage ;; esac
|
||||
CONFIG="$1"
|
||||
shift
|
||||
if [ "x$1" != x -a "x$1" != "x-o" ] ; then
|
||||
INTERFACE="$1"
|
||||
else
|
||||
INTERFACE="$CONFIG"
|
||||
fi
|
||||
shift
|
||||
test "x$1" = "x-o" && shift
|
||||
DEBUG=no
|
||||
RUN_FROM_RC=no
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
debug) DEBUG=yes ;;
|
||||
rc) RUN_FROM_RC=yes ;;
|
||||
*) debug unknown option $1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# usage: ifprint <err_mesg|mesg|...> message....
|
||||
ifprint() {
|
||||
func=$1 ; shift
|
||||
test "x$func" = x && return 1
|
||||
if [ "$RUN_FROM_RC" = yes -a "$INTERFACE" != all ] ; then
|
||||
$func "`printf " %-9s " "$INTERFACE"`$*"
|
||||
else
|
||||
$func "$*"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# xen related code
|
||||
#
|
||||
|
||||
# check if xen is running
|
||||
is_xend_running() {
|
||||
test -x /etc/init.d/xend && \
|
||||
/etc/init.d/xend status &>/dev/null && return 0
|
||||
return 1
|
||||
}
|
||||
exit_if_xend_not_running() {
|
||||
is_xend_running || {
|
||||
debug "$0: xend is not running - nothing to do"
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
# (modified) functions from /etc/init.d/xendomains
|
||||
parseln()
|
||||
{
|
||||
name=${1:0:$((${#1}-36))}
|
||||
name=${name%% *}
|
||||
rest="${1: -36}"
|
||||
id=${rest:0:4}
|
||||
id=`echo $id`
|
||||
mem=${rest:4:6}
|
||||
mem=`echo $mem`
|
||||
vcpu=${rest:10:6}
|
||||
vcpu=`echo $vcpu`
|
||||
state=${rest:16:11}
|
||||
state=`echo $state`
|
||||
tm=${rest:27}
|
||||
tm=`echo $tm`
|
||||
}
|
||||
|
||||
xm_list()
|
||||
{
|
||||
TERM=vt100 xm list | grep -v '^Name *ID'
|
||||
}
|
||||
|
||||
# For the specified vm, return a list of vifs that are connected to $INTERFACE
|
||||
list_vifs()
|
||||
{
|
||||
id=$1
|
||||
vifs=()
|
||||
for vif in $(ls -1 "/sys/class/net/$INTERFACE/brif/"); do
|
||||
tmp="`echo ${vif} | egrep "^(tap|vif)$id\..*"`"
|
||||
if [ ! -z ${tmp} ]; then
|
||||
vifs=(${vifs[@]} ${tmp})
|
||||
fi
|
||||
done
|
||||
echo "${vifs[@]}"
|
||||
}
|
||||
|
||||
# Write list of concerned vifs to state file
|
||||
save_sysconfig_state()
|
||||
{
|
||||
[ -d "${RUN_FILES_BASE}/xen/" ] || \
|
||||
mkdir -p "${RUN_FILES_BASE}/xen/" || return 1
|
||||
|
||||
rm -f "${RUN_FILES_BASE}/xen/$INTERFACE" && {
|
||||
echo "VIFS='${vifs[@]}'"
|
||||
} > "${RUN_FILES_BASE}/xen/$INTERFACE"
|
||||
}
|
||||
|
||||
case $SCRIPTNAME in
|
||||
*if-up.d*)
|
||||
exit_if_xend_not_running
|
||||
|
||||
for IF in $(ls -1 "${RUN_FILES_BASE}/xen/") ; do
|
||||
. "${RUN_FILES_BASE}/xen/$INTERFACE" || continue
|
||||
|
||||
for vif in ${VIFS}; do
|
||||
test -d "/sys/class/net/${vif}" || continue
|
||||
if ! is_iface_up ${vif} ; then
|
||||
ip link set dev ${vif} up
|
||||
fi
|
||||
brctl addif ${INTERFACE} ${vif} 2>&1 > /dev/null
|
||||
done
|
||||
# remove sysconfig state
|
||||
rm -f "${RUN_FILES_BASE}/xen/$INTERFACE"
|
||||
done
|
||||
;;
|
||||
*if-down.d*)
|
||||
exit_if_xend_not_running
|
||||
|
||||
# Remember vifs attached to $INTERFACE
|
||||
vifs=()
|
||||
num=0
|
||||
while read LN; do
|
||||
parseln "$LN"
|
||||
[ "$id" = 0 ] && continue
|
||||
[ -z "$state" ] && continue
|
||||
|
||||
vifs=(${vifs[@]} $(list_vifs $id))
|
||||
done < <(xm_list)
|
||||
|
||||
[ -z "${vifs[*]}" ] || save_sysconfig_state
|
||||
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
37
xen.changes
37
xen.changes
@ -1,3 +1,40 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 11 12:42:05 MDT 2008 - brogers@novell.com
|
||||
|
||||
- Added gdbserver-xen to the set of tools we build.
|
||||
fate#302942
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 11 10:32:17 MDT 2008 - jfehlig@novell.com
|
||||
|
||||
- Added ocfs2 to Should-Start in xendomains init script
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 10 20:47:45 MDT 2008 - plc@novell.com
|
||||
|
||||
- Added pv cdrom support to blktap
|
||||
fate#300964
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 10 14:06:51 MDT 2008 - jfehlig@novell.com
|
||||
|
||||
- Removed invocation of network-bridge script from xend-config.sxp.
|
||||
Networks are now created through yast2-network package.
|
||||
- Added sysconfig hook script for Xen to cope with ifup/ifdown
|
||||
events on network devices (e.g. bridges) in use by virtual
|
||||
machines.
|
||||
fate#303386
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 8 08:53:25 MDT 2008 - carnold@novell.com
|
||||
|
||||
- Updated to xen version 3.3.1 RC changeset 18390.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 3 21:07:56 CEST 2008 - kwolf@suse.de
|
||||
|
||||
- Snapshots: Fix xend API functions for libvirt usage
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 1 08:56:32 MDT 2008 - carnold@novell.com
|
||||
|
||||
|
85
xen.spec
85
xen.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package xen (Version 3.3.0_18358_02)
|
||||
# spec file for package xen (Version 3.3.1_18390_01)
|
||||
#
|
||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -21,8 +21,8 @@
|
||||
Name: xen
|
||||
%define xvers 3.3
|
||||
%define xvermaj 3
|
||||
%define changeset 18358
|
||||
%define xen_build_dir xen-3.3.0-testing
|
||||
%define changeset 18390
|
||||
%define xen_build_dir xen-3.3.1-testing
|
||||
%if %sles_version
|
||||
%define with_kmp 1
|
||||
%else
|
||||
@ -40,14 +40,14 @@ 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_18358_02
|
||||
Release: 2
|
||||
Version: 3.3.1_18390_01
|
||||
Release: 1
|
||||
License: GPL v2 only
|
||||
Group: System/Kernel
|
||||
AutoReqProv: on
|
||||
PreReq: %insserv_prereq %fillup_prereq
|
||||
Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
|
||||
Source0: xen-3.3.0-testing-src.tar.bz2
|
||||
Source0: xen-3.3.1-testing-src.tar.bz2
|
||||
Source2: README.SuSE
|
||||
Source3: boot.xen
|
||||
Source4: boot.local.xenU
|
||||
@ -66,7 +66,11 @@ Source18: init.xen_loop
|
||||
# Xen API remote authentication sources
|
||||
Source23: etc_pam.d_xen-api
|
||||
Source24: xenapiusers
|
||||
# sysconfig hook script for Xen
|
||||
Source25: xen-updown.sh
|
||||
# Upstream patches
|
||||
Patch0: 18412-x86-page-type-preemptible.patch
|
||||
Patch1: 18420-x86-page-type-preemptible-fix.patch
|
||||
# Our patches
|
||||
Patch100: xen-config.diff
|
||||
Patch101: xend-config.diff
|
||||
@ -111,6 +115,7 @@ Patch156: blktap.patch
|
||||
Patch157: xen-api-auth.patch
|
||||
Patch158: xen-qemu-iscsi-fix.patch
|
||||
Patch159: xend-vif-fix.patch
|
||||
Patch160: tools-gdbserver-build.diff
|
||||
# Patches for snapshot support
|
||||
Patch170: qemu-img-snapshot.patch
|
||||
Patch171: ioemu-blktap-fix-open.patch
|
||||
@ -126,18 +131,22 @@ Patch184: ioemu-blktap-barriers.patch
|
||||
# Jim's domain lock patch
|
||||
Patch190: xend-domain-lock.patch
|
||||
# Patches from Jan
|
||||
Patch240: x86-show-page-walk-early.patch
|
||||
Patch241: svm-lmsl.patch
|
||||
Patch242: x86-extra-trap-info.patch
|
||||
Patch240: poll-single-port.patch
|
||||
Patch241: dump-exec-state.patch
|
||||
Patch242: x86-show-page-walk-early.patch
|
||||
Patch243: svm-lmsl.patch
|
||||
Patch244: x86-extra-trap-info.patch
|
||||
Patch245: x86-microcode.patch
|
||||
Patch250: 32on64-extra-mem.patch
|
||||
# PV Driver Patches
|
||||
Patch350: pv-driver-build.patch
|
||||
Patch351: xen-ioemu-hvm-pv-support.diff
|
||||
Patch352: pvdrv_emulation_control.patch
|
||||
Patch353: blktap-pv-cdrom.patch
|
||||
# novell_shim patches
|
||||
Patch400: ns_tools.patch
|
||||
Patch401: ns_xen_base.patch
|
||||
Patch402: ns_xen_extension.patch
|
||||
Patch400: hv_tools.patch
|
||||
Patch401: hv_xen_base.patch
|
||||
Patch402: hv_xen_extension.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()")
|
||||
@ -469,6 +478,8 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup -q -n %xen_build_dir
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch100 -p1
|
||||
%patch101 -p1
|
||||
%patch102 -p1
|
||||
@ -512,6 +523,7 @@ Authors:
|
||||
%patch157 -p1
|
||||
%patch158 -p1
|
||||
%patch159 -p1
|
||||
%patch160 -p1
|
||||
%patch170 -p1
|
||||
%patch171 -p1
|
||||
%patch172 -p1
|
||||
@ -527,16 +539,20 @@ Authors:
|
||||
%patch240 -p1
|
||||
%patch241 -p1
|
||||
%patch242 -p1
|
||||
%patch243 -p1
|
||||
%patch244 -p1
|
||||
%patch245 -p1
|
||||
%patch250 -p1
|
||||
%patch350 -p1
|
||||
%patch351 -p1
|
||||
%patch352 -p1
|
||||
%patch353 -p1
|
||||
# Don't use shim for now
|
||||
#%ifarch x86_64
|
||||
#%patch400 -p1
|
||||
#%patch401 -p1
|
||||
#%patch402 -p1
|
||||
#%endif
|
||||
%ifarch x86_64
|
||||
%patch400 -p1
|
||||
%patch401 -p1
|
||||
%patch402 -p1
|
||||
%endif
|
||||
|
||||
%build
|
||||
XEN_EXTRAVERSION=%version-%release
|
||||
@ -548,6 +564,10 @@ export CFLAGS="${RPM_OPT_FLAGS}"
|
||||
export RPM_OPT_FLAGS
|
||||
make -C tools/include/xen-foreign
|
||||
make tools docs
|
||||
cd tools/debugger/gdb
|
||||
# there are code problems that don't pass the 02-check-gcc-output, hence bitbucket
|
||||
./gdbbuild 1>/dev/null 2>/dev/null
|
||||
cd ../../..
|
||||
%if %{?with_kmp}0
|
||||
# pv driver modules
|
||||
export XL=/usr/src/linux
|
||||
@ -610,6 +630,7 @@ make -C tools/include/xen-foreign
|
||||
export XEN_PYTHON_NATIVE_INSTALL=1
|
||||
make -C tools install \
|
||||
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir}
|
||||
cp tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/gdb/gdbserver/gdbserver-xen $RPM_BUILD_ROOT/usr/bin/gdbserver-xen
|
||||
make -C tools/misc/serial-split install \
|
||||
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir}
|
||||
%ifarch x86_64
|
||||
@ -656,6 +677,13 @@ install -m755 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE16 %SOURCE17 $RPM_BUILD_ROOT/
|
||||
install -d $RPM_BUILD_ROOT/etc/pam.d
|
||||
install -m644 %SOURCE23 $RPM_BUILD_ROOT/etc/pam.d/xen-api
|
||||
install -m644 %SOURCE24 $RPM_BUILD_ROOT/etc/xen/
|
||||
# sysconfig hook for Xen
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d
|
||||
install -m755 %SOURCE25 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
|
||||
ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/xen
|
||||
ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d/xen
|
||||
# logrotate
|
||||
install -m644 -D %SOURCE7 $RPM_BUILD_ROOT/etc/logrotate.d/xen
|
||||
# directories
|
||||
@ -722,6 +750,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug
|
||||
/usr/bin/pygrub
|
||||
/usr/bin/qemu-img-xen
|
||||
/usr/bin/tapdisk-ioemu
|
||||
/usr/bin/gdbserver-xen
|
||||
/usr/sbin/blktapctrl
|
||||
/usr/sbin/flask-loadpolicy
|
||||
/usr/sbin/img2qcow
|
||||
@ -783,6 +812,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug
|
||||
%dir /etc/udev
|
||||
%dir /etc/udev/rules.d
|
||||
/etc/udev/rules.d/40-xen.rules
|
||||
/etc/sysconfig/network/scripts/xen-updown.sh
|
||||
/etc/sysconfig/network/if-up.d/xen
|
||||
/etc/sysconfig/network/if-down.d/xen
|
||||
%dir %{_defaultdocdir}/xen
|
||||
%{_defaultdocdir}/xen/COPYING
|
||||
%{_defaultdocdir}/xen/README.SuSE
|
||||
@ -865,6 +897,25 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug
|
||||
/sbin/ldconfig
|
||||
|
||||
%changelog
|
||||
* Thu Sep 11 2008 brogers@novell.com
|
||||
- Added gdbserver-xen to the set of tools we build.
|
||||
fate#302942
|
||||
* Thu Sep 11 2008 jfehlig@novell.com
|
||||
- Added ocfs2 to Should-Start in xendomains init script
|
||||
* Wed Sep 10 2008 plc@novell.com
|
||||
- Added pv cdrom support to blktap
|
||||
fate#300964
|
||||
* Wed Sep 10 2008 jfehlig@novell.com
|
||||
- Removed invocation of network-bridge script from xend-config.sxp.
|
||||
Networks are now created through yast2-network package.
|
||||
- Added sysconfig hook script for Xen to cope with ifup/ifdown
|
||||
events on network devices (e.g. bridges) in use by virtual
|
||||
machines.
|
||||
fate#303386
|
||||
* Mon Sep 08 2008 carnold@novell.com
|
||||
- Updated to xen version 3.3.1 RC changeset 18390.
|
||||
* Wed Sep 03 2008 kwolf@suse.de
|
||||
- Snapshots: Fix xend API functions for libvirt usage
|
||||
* Mon Sep 01 2008 carnold@novell.com
|
||||
- Fix problems building KMPs against the 2.6.27 kernel.
|
||||
* Fri Aug 29 2008 plc@novell.com
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
Index: xen-3.3.1-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
|
||||
@@ -3242,6 +3242,14 @@ class XendDomainInfo:
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -3254,6 +3254,14 @@ class XendDomainInfo:
|
||||
if not config.has_key('backend'):
|
||||
config['backend'] = "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
|
@ -46,7 +46,31 @@ Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
|
||||
#(xend-relocation-ssl-server no)
|
||||
|
||||
#(xend-unix-path /var/lib/xend/xend-socket)
|
||||
@@ -181,7 +182,7 @@
|
||||
@@ -140,7 +141,8 @@
|
||||
#
|
||||
# (network-script 'network-bridge netdev=eth1')
|
||||
#
|
||||
-# The bridge is named xenbr0, by default. To rename the bridge, use
|
||||
+# The bridge takes on the ethernet device name by default. To rename the
|
||||
+# bridge, use
|
||||
#
|
||||
# (network-script 'network-bridge bridge=<name>')
|
||||
#
|
||||
@@ -149,7 +151,12 @@
|
||||
# two fake interfaces per guest domain. To do things like this, write
|
||||
# yourself a wrapper script, and call network-bridge from it, as appropriate.
|
||||
#
|
||||
-(network-script network-bridge)
|
||||
+# SuSE users note:
|
||||
+# On openSUSE >= 11.1 and SLES >= 11, networks should be configured using
|
||||
+# native platform tool - YaST. vif-bridge and qemu-ifup can be used to
|
||||
+# connect vifs to the YaST-managed networks.
|
||||
+#(network-script network-bridge)
|
||||
+(network-script )
|
||||
|
||||
# The script used to control virtual interfaces. This can be overridden on a
|
||||
# per-vif basis when creating a domain or a configuring a new vif. The
|
||||
@@ -181,7 +188,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.
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
Index: xen-3.3.1-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
|
||||
@@ -1864,7 +1864,7 @@ class XendDomainInfo:
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -1886,7 +1886,7 @@ class XendDomainInfo:
|
||||
try:
|
||||
if not corefile:
|
||||
this_time = time.strftime("%Y-%m%d-%H%M.%S", time.localtime())
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: xen-3.3.0-testing/tools/examples/domain-lock
|
||||
Index: xen-3.3.1-testing/tools/examples/domain-lock
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ xen-3.3.0-testing/tools/examples/domain-lock
|
||||
+++ xen-3.3.1-testing/tools/examples/domain-lock
|
||||
@@ -0,0 +1,86 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
@ -89,10 +89,10 @@ Index: xen-3.3.0-testing/tools/examples/domain-lock
|
||||
+ get_status $vm_path
|
||||
+ ;;
|
||||
+esac
|
||||
Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/examples/xend-config.sxp
|
||||
+++ xen-3.3.1-testing/tools/examples/xend-config.sxp
|
||||
@@ -250,4 +250,44 @@
|
||||
|
||||
# Path where persistent domain configuration is stored.
|
||||
@ -138,10 +138,10 @@ Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
|
||||
+# 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
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -30,11 +30,13 @@ import threading
|
||||
import re
|
||||
import copy
|
||||
@ -157,7 +157,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
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:
|
||||
@@ -443,6 +445,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:
|
||||
@ -165,7 +165,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
XendTask.log_progress(0, 30, self._constructDomain)
|
||||
XendTask.log_progress(31, 60, self._initDomain)
|
||||
|
||||
@@ -453,6 +456,7 @@ class XendDomainInfo:
|
||||
@@ -475,6 +478,7 @@ class XendDomainInfo:
|
||||
state = self._stateGet()
|
||||
if state in (DOM_STATE_SUSPENDED, DOM_STATE_HALTED):
|
||||
try:
|
||||
@ -173,7 +173,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
self._constructDomain()
|
||||
self._storeVmDetails()
|
||||
self._createDevices()
|
||||
@@ -2317,6 +2321,11 @@ class XendDomainInfo:
|
||||
@@ -2339,6 +2343,11 @@ class XendDomainInfo:
|
||||
|
||||
self._stateSet(DOM_STATE_HALTED)
|
||||
self.domid = None # Do not push into _stateSet()!
|
||||
@ -185,7 +185,7 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
finally:
|
||||
self.refresh_shutdown_lock.release()
|
||||
|
||||
@@ -3555,6 +3564,74 @@ class XendDomainInfo:
|
||||
@@ -3567,6 +3576,74 @@ class XendDomainInfo:
|
||||
def has_device(self, dev_class, dev_uuid):
|
||||
return (dev_uuid in self.info['%s_refs' % dev_class.lower()])
|
||||
|
||||
@ -260,11 +260,11 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
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
|
||||
Index: xen-3.3.1-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
|
||||
@@ -1295,6 +1295,7 @@ class XendDomain:
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendDomain.py
|
||||
+++ xen-3.3.1-testing/tools/python/xen/xend/XendDomain.py
|
||||
@@ -1299,6 +1299,7 @@ class XendDomain:
|
||||
POWER_STATE_NAMES[DOM_STATE_RUNNING],
|
||||
POWER_STATE_NAMES[dominfo._stateGet()])
|
||||
|
||||
@ -272,10 +272,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
|
||||
""" The following call may raise a XendError exception """
|
||||
dominfo.testMigrateDevices(True, dst)
|
||||
|
||||
Index: xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
|
||||
Index: xen-3.3.1-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
|
||||
--- xen-3.3.1-testing.orig/tools/python/xen/xend/XendOptions.py
|
||||
+++ xen-3.3.1-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
|
||||
@ -314,10 +314,10 @@ Index: xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
|
||||
|
||||
class XendOptionsFile(XendOptions):
|
||||
|
||||
Index: xen-3.3.0-testing/tools/examples/Makefile
|
||||
Index: xen-3.3.1-testing/tools/examples/Makefile
|
||||
===================================================================
|
||||
--- xen-3.3.0-testing.orig/tools/examples/Makefile
|
||||
+++ xen-3.3.0-testing/tools/examples/Makefile
|
||||
--- xen-3.3.1-testing.orig/tools/examples/Makefile
|
||||
+++ xen-3.3.1-testing/tools/examples/Makefile
|
||||
@@ -35,6 +35,7 @@ XEN_SCRIPTS += vtpm vtpm-delete
|
||||
XEN_SCRIPTS += xen-hotplug-cleanup
|
||||
XEN_SCRIPTS += external-device-migrate
|
||||
|
Loading…
x
Reference in New Issue
Block a user