From xen-changelog-bounces@lists.xen.org Wed Oct 01 23:55:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Oct 2014 23:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZTjp-0000oL-UM; Wed, 01 Oct 2014 23:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZTjn-0000oC-RK
	for xen-changelog@lists.xensource.com; Wed, 01 Oct 2014 23:55:16 +0000
Received: from [85.158.143.35:43292] by server-2.bemta-4.messagelabs.com id
	F7/78-04525-3649C245; Wed, 01 Oct 2014 23:55:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1412207709!5249919!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12830 invoked from network); 1 Oct 2014 23:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2014 23:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZTje-0001op-0h
	for xen-changelog@lists.xensource.com; Wed, 01 Oct 2014 23:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZTjd-0007cq-Mt
	for xen-changelog@lists.xensource.com; Wed, 01 Oct 2014 23:55:05 +0000
Date: Wed, 01 Oct 2014 23:55:05 +0000
Message-Id: <E1XZTjd-0007cq-Mt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge tag 'v2.0.2' into
	master
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

=== This changeset includes merge from high-traffic branch ===
Commits on that branch are not reported individually.

commit c9d8f8b755e8960edf7725e05f3e6ac743a5e12e
Merge: ea772ca487e219e5d5b82d50da460c4145238038 f053f6b83d01b47adf3b8f29eb0c0769755d1f9c
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Sep 24 15:25:27 2014 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Wed Sep 24 15:25:27 2014 +0100

    Merge tag 'v2.0.2' into master

 VERSION                         |    2 +-
 arch_init.c                     |  110 ++++++++++++-----------
 async.c                         |   14 ++-
 block.c                         |   34 ++++---
 block/mirror.c                  |   19 +++-
 block/qapi.c                    |    1 +
 block/qcow.c                    |   44 ++++++++--
 block/qcow2.c                   |    3 +-
 block/sheepdog.c                |    4 +-
 block/vvfat.c                   |    6 +-
 blockdev-nbd.c                  |    9 ++-
 blockdev.c                      |   23 ++++-
 blockjob.c                      |   14 +++
 configure                       |    2 +-
 coroutine-win32.c               |   13 +++-
 cputlb.c                        |    6 +-
 disas/Makefile.objs             |    2 +-
 hw/arm/boot.c                   |    8 ++-
 hw/arm/omap1.c                  |   14 ++--
 hw/arm/omap2.c                  |    2 +-
 hw/arm/pxa2xx.c                 |   12 ++-
 hw/arm/spitz.c                  |    4 +-
 hw/arm/z2.c                     |    2 +-
 hw/char/cadence_uart.c          |   15 +++-
 hw/char/virtio-serial-bus.c     |   16 ++--
 hw/core/irq.c                   |    4 +-
 hw/core/qdev.c                  |   45 +++++-----
 hw/display/ssd0323.c            |   24 +++++
 hw/dma/omap_dma.c               |    4 +-
 hw/gpio/zaurus.c                |   10 ++
 hw/i386/acpi-build.c            |    7 +-
 hw/i386/kvm/pci-assign.c        |   12 ++--
 hw/i386/pc.c                    |    2 +-
 hw/i386/pc_piix.c               |   20 +++--
 hw/i386/pc_q35.c                |   12 ++--
 hw/i386/smbios.c                |   18 +++--
 hw/ide/ahci.c                   |    2 +-
 hw/ide/microdrive.c             |    2 +-
 hw/input/tsc210x.c              |   12 +++
 hw/intc/i8259.c                 |    4 +-
 hw/intc/openpic.c               |   16 +++-
 hw/misc/cbus.c                  |    6 +-
 hw/misc/imx_ccm.c               |    1 +
 hw/net/stellaris_enet.c         |   23 ++++--
 hw/net/virtio-net.c             |   37 +++++++-
 hw/pci/pci.c                    |    2 +-
 hw/pci/pcie_aer.c               |   10 ++-
 hw/pcmcia/pxa2xx.c              |    2 +-
 hw/ppc/spapr_pci.c              |   15 +++
 hw/s390x/css.c                  |   24 ++++-
 hw/scsi/megasas.c               |   17 ++++
 hw/scsi/mfi.h                   |    9 ++
 hw/scsi/scsi-disk.c             |    2 +-
 hw/scsi/vhost-scsi.c            |    8 ++-
 hw/scsi/virtio-scsi.c           |   26 ++++--
 hw/sd/omap_mmc.c                |    2 +-
 hw/sd/sdhci.c                   |    8 +-
 hw/sd/ssi-sd.c                  |    9 ++
 hw/sh4/sh7750.c                 |    3 +-
 hw/ssi/pl022.c                  |   14 +++
 hw/timer/hpet.c                 |   13 +++
 hw/timer/i8254.c                |    4 +-
 hw/timer/mc146818rtc.c          |    2 +-
 hw/timer/omap_gptimer.c         |    4 +-
 hw/usb/bus.c                    |    4 +-
 hw/usb/dev-bluetooth.c          |   24 ++++--
 hw/usb/hcd-xhci.c               |    1 +
 hw/virtio/vhost.c               |   10 ++-
 hw/virtio/virtio.c              |   33 ++++++-
 hw/xtensa/xtensa_lx60.c         |    8 +-
 include/block/blockjob.h        |    8 ++
 include/hw/i386/smbios.h        |    6 +-
 include/hw/virtio/virtio-net.h  |    4 +-
 include/hw/virtio/virtio-scsi.h |    7 ++-
 include/migration/vmstate.h     |    9 ++
 kvm-all.c                       |    7 +-
 linux-user/elfload.c            |  117 ++++++++++++++++++++----
 linux-user/syscall.c            |   16 ++++
 migration-rdma.c                |   20 ++--
 migration.c                     |    2 +-
 nbd.c                           |    7 +-
 po/Makefile                     |    4 +-
 qapi-schema.json                |    7 +-
 qapi/qapi-dealloc-visitor.c     |    4 +-
 qdev-monitor.c                  |    2 +-
 qemu-img.c                      |    2 +-
 qemu-io.c                       |    2 +
 qemu-nbd.c                      |    5 +-
 qga/commands-win32.c            |    6 +-
 qmp-commands.hx                 |    5 +-
 target-arm/helper.c             |    8 +-
 target-arm/translate-a64.c      |    5 +-
 target-arm/translate.c          |   34 +++++---
 target-i386/cpu.c               |   22 +++--
 target-i386/cpu.h               |   11 ++-
 target-s390x/kvm.c              |  190 +++++++++++++++++++++++----------------
 target-xtensa/translate.c       |    4 +-
 tcg/i386/tcg-target.c           |    3 +-
 tests/qemu-iotests/040          |   38 ++++++---
 tests/qemu-iotests/040.out      |    4 +-
 tests/qemu-iotests/041          |   16 +++-
 tests/qemu-iotests/041.out      |    4 +-
 tests/qemu-iotests/092          |   98 ++++++++++++++++++++
 tests/qemu-iotests/092.out      |   38 ++++++++
 tests/qemu-iotests/group        |    1 +
 trace-events                    |    5 +
 ui/curses.c                     |    4 +-
 vmstate.c                       |  117 ++++++++++++++-----------
 108 files changed, 1248 insertions(+), 488 deletions(-)

diff --git a/VERSION b/VERSION
index 227cea2..e9307ca 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.0.0
+2.0.2
diff --git a/arch_init.c b/arch_init.c
index 60c975d..3ec70de 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -992,70 +992,68 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
 {
     ram_addr_t addr;
     int flags, ret = 0;
-    int error;
     static uint64_t seq_iter;
 
     seq_iter++;
 
-    if (version_id < 4 || version_id > 4) {
-        return -EINVAL;
+    if (version_id != 4) {
+        ret = -EINVAL;
     }
 
-    do {
+    while (!ret) {
         addr = qemu_get_be64(f);
 
         flags = addr & ~TARGET_PAGE_MASK;
         addr &= TARGET_PAGE_MASK;
 
         if (flags & RAM_SAVE_FLAG_MEM_SIZE) {
-            if (version_id == 4) {
-                /* Synchronize RAM block list */
-                char id[256];
-                ram_addr_t length;
-                ram_addr_t total_ram_bytes = addr;
-
-                while (total_ram_bytes) {
-                    RAMBlock *block;
-                    uint8_t len;
-
-                    len = qemu_get_byte(f);
-                    qemu_get_buffer(f, (uint8_t *)id, len);
-                    id[len] = 0;
-                    length = qemu_get_be64(f);
-
-                    QTAILQ_FOREACH(block, &ram_list.blocks, next) {
-                        if (!strncmp(id, block->idstr, sizeof(id))) {
-                            if (block->length != length) {
-                                fprintf(stderr,
-                                        "Length mismatch: %s: " RAM_ADDR_FMT
-                                        " in != " RAM_ADDR_FMT "\n", id, length,
-                                        block->length);
-                                ret =  -EINVAL;
-                                goto done;
-                            }
-                            break;
+            /* Synchronize RAM block list */
+            char id[256];
+            ram_addr_t length;
+            ram_addr_t total_ram_bytes = addr;
+
+            while (total_ram_bytes) {
+                RAMBlock *block;
+                uint8_t len;
+
+                len = qemu_get_byte(f);
+                qemu_get_buffer(f, (uint8_t *)id, len);
+                id[len] = 0;
+                length = qemu_get_be64(f);
+
+                QTAILQ_FOREACH(block, &ram_list.blocks, next) {
+                    if (!strncmp(id, block->idstr, sizeof(id))) {
+                        if (block->length != length) {
+                            fprintf(stderr,
+                                    "Length mismatch: %s: " RAM_ADDR_FMT
+                                    " in != " RAM_ADDR_FMT "\n", id, length,
+                                    block->length);
+                            ret =  -EINVAL;
                         }
+                        break;
                     }
+                }
 
-                    if (!block) {
-                        fprintf(stderr, "Unknown ramblock \"%s\", cannot "
-                                "accept migration\n", id);
-                        ret = -EINVAL;
-                        goto done;
-                    }
-
-                    total_ram_bytes -= length;
+                if (!block) {
+                    fprintf(stderr, "Unknown ramblock \"%s\", cannot "
+                            "accept migration\n", id);
+                    ret = -EINVAL;
+                }
+                if (ret) {
+                    break;
                 }
-            }
-        }
 
-        if (flags & RAM_SAVE_FLAG_COMPRESS) {
+                total_ram_bytes -= length;
+            }
+        } else if (flags & RAM_SAVE_FLAG_COMPRESS) {
             void *host;
             uint8_t ch;
 
             host = host_from_stream_offset(f, addr, flags);
             if (!host) {
-                return -EINVAL;
+                error_report("Illegal RAM offset " RAM_ADDR_FMT, addr);
+                ret = -EINVAL;
+                break;
             }
 
             ch = qemu_get_byte(f);
@@ -1065,31 +1063,39 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
 
             host = host_from_stream_offset(f, addr, flags);
             if (!host) {
-                return -EINVAL;
+                error_report("Illegal RAM offset " RAM_ADDR_FMT, addr);
+                ret = -EINVAL;
+                break;
             }
 
             qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
         } else if (flags & RAM_SAVE_FLAG_XBZRLE) {
             void *host = host_from_stream_offset(f, addr, flags);
             if (!host) {
-                return -EINVAL;
+                error_report("Illegal RAM offset " RAM_ADDR_FMT, addr);
+                ret = -EINVAL;
+                break;
             }
 
             if (load_xbzrle(f, addr, host) < 0) {
+                error_report("Failed to decompress XBZRLE page at "
+                             RAM_ADDR_FMT, addr);
                 ret = -EINVAL;
-                goto done;
+                break;
             }
         } else if (flags & RAM_SAVE_FLAG_HOOK) {
             ram_control_load_hook(f, flags);
+        } else if (flags & RAM_SAVE_FLAG_EOS) {
+            /* normal exit */
+            break;
+        } else {
+            error_report("Unknown migration flags: %#x", flags);
+            ret = -EINVAL;
+            break;
         }
-        error = qemu_file_get_error(f);
-        if (error) {
-            ret = error;
-            goto done;
-        }
-    } while (!(flags & RAM_SAVE_FLAG_EOS));
+        ret = qemu_file_get_error(f);
+    }
 
-done:
     DPRINTF("Completed load of VM with exit code %d seq iteration "
             "%" PRIu64 "\n", ret, seq_iter);
     return ret;
diff --git a/async.c b/async.c
index 6930185..5b6fe6b 100644
--- a/async.c
+++ b/async.c
@@ -117,15 +117,21 @@ void qemu_bh_schedule_idle(QEMUBH *bh)
 
 void qemu_bh_schedule(QEMUBH *bh)
 {
+    AioContext *ctx;
+
     if (bh->scheduled)
         return;
+    ctx = bh->ctx;
     bh->idle = 0;
-    /* Make sure that idle & any writes needed by the callback are done
-     * before the locations are read in the aio_bh_poll.
+    /* Make sure that:
+     * 1. idle & any writes needed by the callback are done before the
+     *    locations are read in the aio_bh_poll.
+     * 2. ctx is loaded before scheduled is set and the callback has a chance
+     *    to execute.
      */
-    smp_wmb();
+    smp_mb();
     bh->scheduled = 1;
-    aio_notify(bh->ctx);
+    aio_notify(ctx);
 }
 
 
diff --git a/block.c b/block.c
index 990a754..5448430 100644
--- a/block.c
+++ b/block.c
@@ -1058,14 +1058,14 @@ fail:
  */
 int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
 {
-    char backing_filename[PATH_MAX];
-    int back_flags, ret;
+    char *backing_filename = g_malloc0(PATH_MAX);
+    int back_flags, ret = 0;
     BlockDriver *back_drv = NULL;
     Error *local_err = NULL;
 
     if (bs->backing_hd != NULL) {
         QDECREF(options);
-        return 0;
+        goto free_exit;
     }
 
     /* NULL means an empty set of options */
@@ -1078,10 +1078,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
         backing_filename[0] = '\0';
     } else if (bs->backing_file[0] == '\0' && qdict_size(options) == 0) {
         QDECREF(options);
-        return 0;
+        goto free_exit;
     } else {
-        bdrv_get_full_backing_filename(bs, backing_filename,
-                                       sizeof(backing_filename));
+        bdrv_get_full_backing_filename(bs, backing_filename, PATH_MAX);
     }
 
     if (bs->backing_format[0] != '\0') {
@@ -1102,7 +1101,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
         error_setg(errp, "Could not open backing file: %s",
                    error_get_pretty(local_err));
         error_free(local_err);
-        return ret;
+        goto free_exit;
     }
 
     if (bs->backing_hd->file) {
@@ -1113,7 +1112,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
     /* Recalculate the BlockLimits with the backing file */
     bdrv_refresh_limits(bs);
 
-    return 0;
+free_exit:
+    g_free(backing_filename);
+    return ret;
 }
 
 /*
@@ -1157,6 +1158,7 @@ int bdrv_open_image(BlockDriverState **pbs, const char *filename,
                        bdref_key);
             ret = -EINVAL;
         }
+        QDECREF(image_options);
         goto done;
     }
 
@@ -1170,8 +1172,7 @@ done:
 void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
 {
     /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
-    char tmp_filename[PATH_MAX + 1];
-
+    char *tmp_filename = g_malloc0(PATH_MAX + 1);
     int64_t total_size;
     BlockDriver *bdrv_qcow2;
     QEMUOptionParameter *create_options;
@@ -1187,15 +1188,15 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
     total_size = bdrv_getlength(bs);
     if (total_size < 0) {
         error_setg_errno(errp, -total_size, "Could not get image size");
-        return;
+        goto out;
     }
     total_size &= BDRV_SECTOR_MASK;
 
     /* Create the temporary image */
-    ret = get_tmp_filename(tmp_filename, sizeof(tmp_filename));
+    ret = get_tmp_filename(tmp_filename, PATH_MAX + 1);
     if (ret < 0) {
         error_setg_errno(errp, -ret, "Could not get temporary filename");
-        return;
+        goto out;
     }
 
     bdrv_qcow2 = bdrv_find_format("qcow2");
@@ -1211,7 +1212,7 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
                          "'%s': %s", tmp_filename,
                          error_get_pretty(local_err));
         error_free(local_err);
-        return;
+        goto out;
     }
 
     /* Prepare a new options QDict for the temporary file */
@@ -1228,10 +1229,13 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
                     bs->open_flags & ~BDRV_O_SNAPSHOT, bdrv_qcow2, &local_err);
     if (ret < 0) {
         error_propagate(errp, local_err);
-        return;
+        goto out;
     }
 
     bdrv_append(bs_snapshot, bs);
+
+out:
+    g_free(tmp_filename);
 }
 
 /*
diff --git a/block/mirror.c b/block/mirror.c
index 0ef41f9..6e502e3 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -259,9 +259,11 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
     next_sector = sector_num;
     while (nb_chunks-- > 0) {
         MirrorBuffer *buf = QSIMPLEQ_FIRST(&s->buf_free);
+        size_t remaining = (nb_sectors * BDRV_SECTOR_SIZE) - op->qiov.size;
+
         QSIMPLEQ_REMOVE_HEAD(&s->buf_free, next);
         s->buf_free_count--;
-        qemu_iovec_add(&op->qiov, buf, s->granularity);
+        qemu_iovec_add(&op->qiov, buf, MIN(s->granularity, remaining));
 
         /* Advance the HBitmapIter in parallel, so that we do not examine
          * the same sector twice.
@@ -324,9 +326,18 @@ static void coroutine_fn mirror_run(void *opaque)
     }
 
     s->common.len = bdrv_getlength(bs);
-    if (s->common.len <= 0) {
-        block_job_completed(&s->common, s->common.len);
-        return;
+    if (s->common.len < 0) {
+        ret = s->common.len;
+        goto immediate_exit;
+    } else if (s->common.len == 0) {
+        /* Report BLOCK_JOB_READY and wait for complete. */
+        block_job_ready(&s->common);
+        s->synced = true;
+        while (!block_job_is_cancelled(&s->common) && !s->should_complete) {
+            block_job_yield(&s->common);
+        }
+        s->common.cancelled = false;
+        goto immediate_exit;
     }
 
     length = (bdrv_getlength(bs) + s->granularity - 1) / s->granularity;
diff --git a/block/qapi.c b/block/qapi.c
index 8f2b4db..a69c00d 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -474,6 +474,7 @@ static void dump_qobject(fprintf_function func_fprintf, void *f,
         case QTYPE_QERROR: {
             QString *value = qerror_human((QError *)obj);
             func_fprintf(f, "%s", qstring_get_str(value));
+            QDECREF(value);
             break;
         }
         case QTYPE_NONE:
diff --git a/block/qcow.c b/block/qcow.c
index d5a7d5f..c0a3b89 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -48,9 +48,10 @@ typedef struct QCowHeader {
     uint64_t size; /* in bytes */
     uint8_t cluster_bits;
     uint8_t l2_bits;
+    uint16_t padding;
     uint32_t crypt_method;
     uint64_t l1_table_offset;
-} QCowHeader;
+} QEMU_PACKED QCowHeader;
 
 #define L2_CACHE_SIZE 16
 
@@ -60,7 +61,7 @@ typedef struct BDRVQcowState {
     int cluster_sectors;
     int l2_bits;
     int l2_size;
-    int l1_size;
+    unsigned int l1_size;
     uint64_t cluster_offset_mask;
     uint64_t l1_table_offset;
     uint64_t *l1_table;
@@ -96,7 +97,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
     BDRVQcowState *s = bs->opaque;
-    int len, i, shift, ret;
+    unsigned int len, i, shift;
+    int ret;
     QCowHeader header;
 
     ret = bdrv_pread(bs->file, 0, &header, sizeof(header));
@@ -126,11 +128,25 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
         goto fail;
     }
 
-    if (header.size <= 1 || header.cluster_bits < 9) {
-        error_setg(errp, "invalid value in qcow header");
+    if (header.size <= 1) {
+        error_setg(errp, "Image size is too small (must be at least 2 bytes)");
+        ret = -EINVAL;
+        goto fail;
+    }
+    if (header.cluster_bits < 9 || header.cluster_bits > 16) {
+        error_setg(errp, "Cluster size must be between 512 and 64k");
+        ret = -EINVAL;
+        goto fail;
+    }
+
+    /* l2_bits specifies number of entries; storing a uint64_t in each entry,
+     * so bytes = num_entries << 3. */
+    if (header.l2_bits < 9 - 3 || header.l2_bits > 16 - 3) {
+        error_setg(errp, "L2 table size must be between 512 and 64k");
         ret = -EINVAL;
         goto fail;
     }
+
     if (header.crypt_method > QCOW_CRYPT_AES) {
         error_setg(errp, "invalid encryption method in qcow header");
         ret = -EINVAL;
@@ -150,7 +166,19 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
 
     /* read the level 1 table */
     shift = s->cluster_bits + s->l2_bits;
-    s->l1_size = (header.size + (1LL << shift) - 1) >> shift;
+    if (header.size > UINT64_MAX - (1LL << shift)) {
+        error_setg(errp, "Image too large");
+        ret = -EINVAL;
+        goto fail;
+    } else {
+        uint64_t l1_size = (header.size + (1LL << shift) - 1) >> shift;
+        if (l1_size > INT_MAX / sizeof(uint64_t)) {
+            error_setg(errp, "Image too large");
+            ret = -EINVAL;
+            goto fail;
+        }
+        s->l1_size = l1_size;
+    }
 
     s->l1_table_offset = header.l1_table_offset;
     s->l1_table = g_malloc(s->l1_size * sizeof(uint64_t));
@@ -174,7 +202,9 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     if (header.backing_file_offset != 0) {
         len = header.backing_file_size;
         if (len > 1023) {
-            len = 1023;
+            error_setg(errp, "Backing file name too long");
+            ret = -EINVAL;
+            goto fail;
         }
         ret = bdrv_pread(bs->file, header.backing_file_offset,
                    bs->backing_file, len);
diff --git a/block/qcow2.c b/block/qcow2.c
index e903d97..57c353d 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1306,6 +1306,7 @@ static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp)
     options = qdict_clone_shallow(bs->options);
 
     ret = qcow2_open(bs, options, flags, &local_err);
+    QDECREF(options);
     if (local_err) {
         error_setg(errp, "Could not reopen qcow2 layer: %s",
                    error_get_pretty(local_err));
@@ -1316,8 +1317,6 @@ static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp)
         return;
     }
 
-    QDECREF(options);
-
     if (crypt_method) {
         s->crypt_method = crypt_method;
         memcpy(&s->aes_encrypt_key, &aes_encrypt_key, sizeof(aes_encrypt_key));
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 0eb33ee..7dcebce 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2149,6 +2149,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
     strncpy(s->inode.tag, sn_info->name, sizeof(s->inode.tag));
     /* we don't need to update entire object */
     datalen = SD_INODE_SIZE - sizeof(s->inode.data_vdi_id);
+    inode = g_malloc(datalen);
 
     /* refresh inode. */
     fd = connect_to_sdog(s);
@@ -2171,8 +2172,6 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
         goto cleanup;
     }
 
-    inode = (SheepdogInode *)g_malloc(datalen);
-
     ret = read_object(fd, (char *)inode, vid_to_vdi_oid(new_vid),
                       s->inode.nr_copies, datalen, 0, s->cache_flags);
 
@@ -2186,6 +2185,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
             s->inode.name, s->inode.snap_id, s->inode.vdi_id);
 
 cleanup:
+    g_free(inode);
     closesocket(fd);
     return ret;
 }
diff --git a/block/vvfat.c b/block/vvfat.c
index 1978c9e..91c63f7 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -787,7 +787,9 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
 	    s->current_mapping->path=buffer;
 	    s->current_mapping->read_only =
 		(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
-	}
+        } else {
+            g_free(buffer);
+        }
     }
     closedir(dir);
 
@@ -1864,7 +1866,7 @@ static int check_directory_consistency(BDRVVVFATState *s,
 
 	if (s->used_clusters[cluster_num] & USED_ANY) {
 	    fprintf(stderr, "cluster %d used more than once\n", (int)cluster_num);
-	    return 0;
+            goto fail;
 	}
 	s->used_clusters[cluster_num] = USED_DIRECTORY;
 
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index 922cf56..b3a2474 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -27,8 +27,9 @@ static void nbd_accept(void *opaque)
     socklen_t addr_len = sizeof(addr);
 
     int fd = accept(server_fd, (struct sockaddr *)&addr, &addr_len);
-    if (fd >= 0) {
-        nbd_client_new(NULL, fd, nbd_client_put);
+    if (fd >= 0 && !nbd_client_new(NULL, fd, nbd_client_put)) {
+        shutdown(fd, 2);
+        close(fd);
     }
 }
 
@@ -91,6 +92,10 @@ void qmp_nbd_server_add(const char *device, bool has_writable, bool writable,
         error_set(errp, QERR_DEVICE_NOT_FOUND, device);
         return;
     }
+    if (!bdrv_is_inserted(bs)) {
+        error_set(errp, QERR_DEVICE_HAS_NO_MEDIUM, device);
+        return;
+    }
 
     if (!has_writable) {
         writable = false;
diff --git a/blockdev.c b/blockdev.c
index 5dd01ea..4d98224 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -332,7 +332,7 @@ static DriveInfo *blockdev_init(const char *file, QDict *bs_opts,
     opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, &error);
     if (error) {
         error_propagate(errp, error);
-        return NULL;
+        goto err_no_opts;
     }
 
     qemu_opts_absorb_qdict(opts, bs_opts, &error);
@@ -527,8 +527,9 @@ err:
     QTAILQ_REMOVE(&drives, dinfo, next);
     g_free(dinfo);
 early_err:
-    QDECREF(bs_opts);
     qemu_opts_del(opts);
+err_no_opts:
+    QDECREF(bs_opts);
     return NULL;
 }
 
@@ -902,6 +903,7 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type)
 
     /* Actual block device init: Functionality shared with blockdev-add */
     dinfo = blockdev_init(filename, bs_opts, &local_err);
+    bs_opts = NULL;
     if (dinfo == NULL) {
         if (local_err) {
             qerror_report_err(local_err);
@@ -939,6 +941,7 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type)
 
 fail:
     qemu_opts_del(legacy_opts);
+    QDECREF(bs_opts);
     return dinfo;
 }
 
@@ -1864,7 +1867,8 @@ void qmp_block_stream(const char *device, bool has_base,
 }
 
 void qmp_block_commit(const char *device,
-                      bool has_base, const char *base, const char *top,
+                      bool has_base, const char *base,
+                      bool has_top, const char *top,
                       bool has_speed, int64_t speed,
                       Error **errp)
 {
@@ -1883,6 +1887,11 @@ void qmp_block_commit(const char *device,
     /* drain all i/o before commits */
     bdrv_drain_all();
 
+    /* Important Note:
+     *  libvirt relies on the DeviceNotFound error class in order to probe for
+     *  live commit feature versions; for this to work, we must make sure to
+     *  perform the device lookup before any generic errors that may occur in a
+     *  scenario in which all optional arguments are omitted. */
     bs = bdrv_find(device);
     if (!bs) {
         error_set(errp, QERR_DEVICE_NOT_FOUND, device);
@@ -1892,7 +1901,7 @@ void qmp_block_commit(const char *device,
     /* default top_bs is the active layer */
     top_bs = bs;
 
-    if (top) {
+    if (has_top && top) {
         if (strcmp(bs->filename, top) != 0) {
             top_bs = bdrv_find_backing_image(bs, top);
         }
@@ -1914,6 +1923,12 @@ void qmp_block_commit(const char *device,
         return;
     }
 
+    /* Do not allow attempts to commit an image into itself */
+    if (top_bs == base_bs) {
+        error_setg(errp, "cannot commit an image into itself");
+        return;
+    }
+
     if (top_bs == bs) {
         commit_active_start(bs, base_bs, speed, on_error, block_job_cb,
                             bs, &local_err);
diff --git a/blockjob.c b/blockjob.c
index b3ce14c..bf10f82 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -206,6 +206,20 @@ void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns)
     job->busy = true;
 }
 
+void block_job_yield(BlockJob *job)
+{
+    assert(job->busy);
+
+    /* Check cancellation *before* setting busy = false, too!  */
+    if (block_job_is_cancelled(job)) {
+        return;
+    }
+
+    job->busy = false;
+    qemu_coroutine_yield();
+    job->busy = true;
+}
+
 BlockJobInfo *block_job_query(BlockJob *job)
 {
     BlockJobInfo *info = g_new0(BlockJobInfo, 1);
diff --git a/configure b/configure
index 69b9f56..ffce604 100755
--- a/configure
+++ b/configure
@@ -2624,7 +2624,7 @@ done
 if test "$modules" = yes; then
     shacmd_probe="sha1sum sha1 shasum"
     for c in $shacmd_probe; do
-        if which $c &>/dev/null; then
+        if which $c >/dev/null 2>&1; then
             shacmd="$c"
             break
         fi
diff --git a/coroutine-win32.c b/coroutine-win32.c
index edc1f72..17ace37 100644
--- a/coroutine-win32.c
+++ b/coroutine-win32.c
@@ -36,8 +36,17 @@ typedef struct
 static __thread CoroutineWin32 leader;
 static __thread Coroutine *current;
 
-CoroutineAction qemu_coroutine_switch(Coroutine *from_, Coroutine *to_,
-                                      CoroutineAction action)
+/* This function is marked noinline to prevent GCC from inlining it
+ * into coroutine_trampoline(). If we allow it to do that then it
+ * hoists the code to get the address of the TLS variable "current"
+ * out of the while() loop. This is an invalid transformation because
+ * the SwitchToFiber() call may be called when running thread A but
+ * return in thread B, and so we might be in a different thread
+ * context each time round the loop.
+ */
+CoroutineAction __attribute__((noinline))
+qemu_coroutine_switch(Coroutine *from_, Coroutine *to_,
+                      CoroutineAction action)
 {
     CoroutineWin32 *from = DO_UPCAST(CoroutineWin32, base, from_);
     CoroutineWin32 *to = DO_UPCAST(CoroutineWin32, base, to_);
diff --git a/cputlb.c b/cputlb.c
index 7bd3573..214c945 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -331,8 +331,10 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr)
 }
 
 #define MMUSUFFIX _cmmu
-#undef GETPC
-#define GETPC() ((uintptr_t)0)
+#undef GETPC_ADJ
+#define GETPC_ADJ 0
+#undef GETRA
+#define GETRA() ((uintptr_t)0)
 #define SOFTMMU_CODE_ACCESS
 
 #define SHIFT 0
diff --git a/disas/Makefile.objs b/disas/Makefile.objs
index 41c2374..a70c592 100644
--- a/disas/Makefile.objs
+++ b/disas/Makefile.objs
@@ -4,7 +4,7 @@ common-obj-$(CONFIG_ARM_DIS) += arm.o
 common-obj-$(CONFIG_ARM_A64_DIS) += arm-a64.o
 common-obj-$(CONFIG_ARM_A64_DIS) += libvixl/
 libvixldir = $(SRC_PATH)/disas/libvixl
-$(obj)/arm-a64.o: QEMU_CFLAGS += -I$(libvixldir)
+$(obj)/arm-a64.o: QEMU_CFLAGS := -I$(libvixldir) $(QEMU_CFLAGS)
 common-obj-$(CONFIG_CRIS_DIS) += cris.o
 common-obj-$(CONFIG_HPPA_DIS) += hppa.o
 common-obj-$(CONFIG_I386_DIS) += i386.o
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 3d1f4a2..1241761 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -417,8 +417,12 @@ static void do_cpu_reset(void *opaque)
     if (info) {
         if (!info->is_linux) {
             /* Jump to the entry point.  */
-            env->regs[15] = info->entry & 0xfffffffe;
-            env->thumb = info->entry & 1;
+            if (env->aarch64) {
+                env->pc = info->entry;
+            } else {
+                env->regs[15] = info->entry & 0xfffffffe;
+                env->thumb = info->entry & 1;
+            }
         } else {
             if (CPU(cpu) == first_cpu) {
                 if (env->aarch64) {
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index b433748..9f5d159 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -172,7 +172,7 @@ static void omap_timer_clk_update(void *opaque, int line, int on)
 static void omap_timer_clk_setup(struct omap_mpu_timer_s *timer)
 {
     omap_clk_adduser(timer->clk,
-                    qemu_allocate_irqs(omap_timer_clk_update, timer, 1)[0]);
+                    qemu_allocate_irq(omap_timer_clk_update, timer, 0));
     timer->rate = omap_clk_getrate(timer->clk);
 }
 
@@ -2098,7 +2098,7 @@ static struct omap_mpuio_s *omap_mpuio_init(MemoryRegion *memory,
                           "omap-mpuio", 0x800);
     memory_region_add_subregion(memory, base, &s->iomem);
 
-    omap_clk_adduser(clk, qemu_allocate_irqs(omap_mpuio_onoff, s, 1)[0]);
+    omap_clk_adduser(clk, qemu_allocate_irq(omap_mpuio_onoff, s, 0));
 
     return s;
 }
@@ -2401,7 +2401,7 @@ static struct omap_pwl_s *omap_pwl_init(MemoryRegion *system_memory,
                           "omap-pwl", 0x800);
     memory_region_add_subregion(system_memory, base, &s->iomem);
 
-    omap_clk_adduser(clk, qemu_allocate_irqs(omap_pwl_clk_update, s, 1)[0]);
+    omap_clk_adduser(clk, qemu_allocate_irq(omap_pwl_clk_update, s, 0));
     return s;
 }
 
@@ -3485,8 +3485,8 @@ static void omap_mcbsp_i2s_start(void *opaque, int line, int level)
 void omap_mcbsp_i2s_attach(struct omap_mcbsp_s *s, I2SCodec *slave)
 {
     s->codec = slave;
-    slave->rx_swallow = qemu_allocate_irqs(omap_mcbsp_i2s_swallow, s, 1)[0];
-    slave->tx_start = qemu_allocate_irqs(omap_mcbsp_i2s_start, s, 1)[0];
+    slave->rx_swallow = qemu_allocate_irq(omap_mcbsp_i2s_swallow, s, 0);
+    slave->tx_start = qemu_allocate_irq(omap_mcbsp_i2s_start, s, 0);
 }
 
 /* LED Pulse Generators */
@@ -3634,7 +3634,7 @@ static struct omap_lpg_s *omap_lpg_init(MemoryRegion *system_memory,
     memory_region_init_io(&s->iomem, NULL, &omap_lpg_ops, s, "omap-lpg", 0x800);
     memory_region_add_subregion(system_memory, base, &s->iomem);
 
-    omap_clk_adduser(clk, qemu_allocate_irqs(omap_lpg_clk_update, s, 1)[0]);
+    omap_clk_adduser(clk, qemu_allocate_irq(omap_lpg_clk_update, s, 0));
 
     return s;
 }
@@ -3848,7 +3848,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory,
     s->sdram_size = sdram_size;
     s->sram_size = OMAP15XX_SRAM_SIZE;
 
-    s->wakeup = qemu_allocate_irqs(omap_mpu_wakeup, s, 1)[0];
+    s->wakeup = qemu_allocate_irq(omap_mpu_wakeup, s, 0);
 
     /* Clocks */
     omap_clk_init(s);
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index 36efde0..dc53a7a 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -2260,7 +2260,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem,
     s->sdram_size = sdram_size;
     s->sram_size = OMAP242X_SRAM_SIZE;
 
-    s->wakeup = qemu_allocate_irqs(omap_mpu_wakeup, s, 1)[0];
+    s->wakeup = qemu_allocate_irq(omap_mpu_wakeup, s, 0);
 
     /* Clocks */
     omap_clk_init(s);
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index 0429148..c652147 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -732,7 +732,7 @@ static void pxa2xx_ssp_save(QEMUFile *f, void *opaque)
 static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id)
 {
     PXA2xxSSPState *s = (PXA2xxSSPState *) opaque;
-    int i;
+    int i, v;
 
     s->enable = qemu_get_be32(f);
 
@@ -746,7 +746,11 @@ static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id)
     qemu_get_8s(f, &s->ssrsa);
     qemu_get_8s(f, &s->ssacd);
 
-    s->rx_level = qemu_get_byte(f);
+    v = qemu_get_byte(f);
+    if (v < 0 || v > ARRAY_SIZE(s->rx_fifo)) {
+        return -EINVAL;
+    }
+    s->rx_level = v;
     s->rx_start = 0;
     for (i = 0; i < s->rx_level; i ++)
         s->rx_fifo[i] = qemu_get_byte(f);
@@ -2055,7 +2059,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
         fprintf(stderr, "Unable to find CPU definition\n");
         exit(1);
     }
-    s->reset = qemu_allocate_irqs(pxa2xx_reset, s, 1)[0];
+    s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0);
 
     /* SDRAM & Internal Memory Storage */
     memory_region_init_ram(&s->sdram, NULL, "pxa270.sdram", sdram_size);
@@ -2186,7 +2190,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size)
         fprintf(stderr, "Unable to find CPU definition\n");
         exit(1);
     }
-    s->reset = qemu_allocate_irqs(pxa2xx_reset, s, 1)[0];
+    s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0);
 
     /* SDRAM & Internal Memory Storage */
     memory_region_init_ram(&s->sdram, NULL, "pxa255.sdram", sdram_size);
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 392ca84..713d021 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -744,7 +744,7 @@ static void spitz_i2c_setup(PXA2xxState *cpu)
 
     spitz_wm8750_addr(wm, 0, 0);
     qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_WM,
-                    qemu_allocate_irqs(spitz_wm8750_addr, wm, 1)[0]);
+                          qemu_allocate_irq(spitz_wm8750_addr, wm, 0));
     /* .. and to the sound interface.  */
     cpu->i2s->opaque = wm;
     cpu->i2s->codec_out = wm8750_dac_dat;
@@ -850,7 +850,7 @@ static void spitz_gpio_setup(PXA2xxState *cpu, int slots)
      * wouldn't guarantee that a guest ever exits the loop.
      */
     spitz_hsync = 0;
-    lcd_hsync = qemu_allocate_irqs(spitz_lcd_hsync_handler, cpu, 1)[0];
+    lcd_hsync = qemu_allocate_irq(spitz_lcd_hsync_handler, cpu, 0);
     pxa2xx_gpio_read_notifier(cpu->gpio, lcd_hsync);
     pxa2xx_lcd_vsync_notifier(cpu->lcd, lcd_hsync);
 
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 67c1be8..ef5424d 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -365,7 +365,7 @@ static void z2_init(QEMUMachineInitArgs *args)
     wm8750_data_req_set(wm, mpu->i2s->data_req, mpu->i2s);
 
     qdev_connect_gpio_out(mpu->gpio, Z2_GPIO_LCD_CS,
-        qemu_allocate_irqs(z2_lcd_cs, z2_lcd, 1)[0]);
+                          qemu_allocate_irq(z2_lcd_cs, z2_lcd, 0));
 
     z2_binfo.kernel_filename = kernel_filename;
     z2_binfo.kernel_cmdline = kernel_cmdline;
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 1f3d162..ce20e1a 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -175,8 +175,10 @@ static void uart_send_breaks(UartState *s)
 {
     int break_enabled = 1;
 
-    qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_BREAK,
-                               &break_enabled);
+    if (s->chr) {
+        qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_BREAK,
+                                   &break_enabled);
+    }
 }
 
 static void uart_parameters_setup(UartState *s)
@@ -227,7 +229,9 @@ static void uart_parameters_setup(UartState *s)
 
     packet_size += ssp.data_bits + ssp.stop_bits;
     s->char_tx_time = (get_ticks_per_sec() / ssp.speed) * packet_size;
-    qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
+    if (s->chr) {
+        qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
+    }
 }
 
 static int uart_can_receive(void *opaque)
@@ -295,6 +299,7 @@ static gboolean cadence_uart_xmit(GIOChannel *chan, GIOCondition cond,
     /* instant drain the fifo when there's no back-end */
     if (!s->chr) {
         s->tx_count = 0;
+        return FALSE;
     }
 
     if (!s->tx_count) {
@@ -375,7 +380,9 @@ static void uart_read_rx_fifo(UartState *s, uint32_t *c)
         *c = s->rx_fifo[rx_rpos];
         s->rx_count--;
 
-        qemu_chr_accept_input(s->chr);
+        if (s->chr) {
+            qemu_chr_accept_input(s->chr);
+        }
     } else {
         *c = 0;
     }
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index 2b647b6..ee1ba16 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -670,6 +670,7 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
     uint32_t max_nr_ports, nr_active_ports, ports_map;
     unsigned int i;
     int ret;
+    uint32_t tmp;
 
     if (version_id > 3) {
         return -EINVAL;
@@ -685,17 +686,12 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
         return 0;
     }
 
-    /* The config space */
-    qemu_get_be16s(f, &s->config.cols);
-    qemu_get_be16s(f, &s->config.rows);
-
-    qemu_get_be32s(f, &max_nr_ports);
-    tswap32s(&max_nr_ports);
-    if (max_nr_ports > tswap32(s->config.max_nr_ports)) {
-        /* Source could have had more ports than us. Fail migration. */
-        return -EINVAL;
-    }
+    /* Unused */
+    qemu_get_be16s(f, (uint16_t *) &tmp);
+    qemu_get_be16s(f, (uint16_t *) &tmp);
+    qemu_get_be32s(f, &tmp);
 
+    max_nr_ports = tswap32(s->config.max_nr_ports);
     for (i = 0; i < (max_nr_ports + 31) / 32; i++) {
         qemu_get_be32s(f, &ports_map);
 
diff --git a/hw/core/irq.c b/hw/core/irq.c
index 03c8cb3..3d284c6 100644
--- a/hw/core/irq.c
+++ b/hw/core/irq.c
@@ -102,7 +102,7 @@ qemu_irq qemu_irq_invert(qemu_irq irq)
 {
     /* The default state for IRQs is low, so raise the output now.  */
     qemu_irq_raise(irq);
-    return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];
+    return qemu_allocate_irq(qemu_notirq, irq, 0);
 }
 
 static void qemu_splitirq(void *opaque, int line, int level)
@@ -117,7 +117,7 @@ qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2)
     qemu_irq *s = g_malloc0(2 * sizeof(qemu_irq));
     s[0] = irq1;
     s[1] = irq2;
-    return qemu_allocate_irqs(qemu_splitirq, s, 1)[0];
+    return qemu_allocate_irq(qemu_splitirq, s, 0);
 }
 
 static void proxy_irq_handler(void *opaque, int n, int level)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 60f9df1..79db470 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -174,14 +174,14 @@ int qdev_init(DeviceState *dev)
     return 0;
 }
 
-static void device_realize(DeviceState *dev, Error **err)
+static void device_realize(DeviceState *dev, Error **errp)
 {
     DeviceClass *dc = DEVICE_GET_CLASS(dev);
 
     if (dc->init) {
         int rc = dc->init(dev);
         if (rc < 0) {
-            error_setg(err, "Device initialization failed.");
+            error_setg(errp, "Device initialization failed.");
             return;
         }
     }
@@ -504,43 +504,46 @@ static void bus_unparent(Object *obj)
     }
 }
 
-static bool bus_get_realized(Object *obj, Error **err)
+static bool bus_get_realized(Object *obj, Error **errp)
 {
     BusState *bus = BUS(obj);
 
     return bus->realized;
 }
 
-static void bus_set_realized(Object *obj, bool value, Error **err)
+static void bus_set_realized(Object *obj, bool value, Error **errp)
 {
     BusState *bus = BUS(obj);
     BusClass *bc = BUS_GET_CLASS(bus);
+    BusChild *kid;
     Error *local_err = NULL;
 
     if (value && !bus->realized) {
         if (bc->realize) {
             bc->realize(bus, &local_err);
+        }
 
+        /* TODO: recursive realization */
+    } else if (!value && bus->realized) {
+        QTAILQ_FOREACH(kid, &bus->children, sibling) {
+            DeviceState *dev = kid->child;
+            object_property_set_bool(OBJECT(dev), false, "realized",
+                                     &local_err);
             if (local_err != NULL) {
-                goto error;
+                break;
             }
-
         }
-    } else if (!value && bus->realized) {
-        if (bc->unrealize) {
+        if (bc->unrealize && local_err == NULL) {
             bc->unrealize(bus, &local_err);
-
-            if (local_err != NULL) {
-                goto error;
-            }
         }
     }
 
-    bus->realized = value;
-    return;
+    if (local_err != NULL) {
+        error_propagate(errp, local_err);
+        return;
+    }
 
-error:
-    error_propagate(err, local_err);
+    bus->realized = value;
 }
 
 void qbus_create_inplace(void *bus, size_t size, const char *typename,
@@ -724,13 +727,13 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,
     }
 }
 
-static bool device_get_realized(Object *obj, Error **err)
+static bool device_get_realized(Object *obj, Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
     return dev->realized;
 }
 
-static void device_set_realized(Object *obj, bool value, Error **err)
+static void device_set_realized(Object *obj, bool value, Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
     DeviceClass *dc = DEVICE_GET_CLASS(dev);
@@ -738,7 +741,7 @@ static void device_set_realized(Object *obj, bool value, Error **err)
     Error *local_err = NULL;
 
     if (dev->hotplugged && !dc->hotpluggable) {
-        error_set(err, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj));
+        error_set(errp, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj));
         return;
     }
 
@@ -797,14 +800,14 @@ static void device_set_realized(Object *obj, bool value, Error **err)
     }
 
     if (local_err != NULL) {
-        error_propagate(err, local_err);
+        error_propagate(errp, local_err);
         return;
     }
 
     dev->realized = value;
 }
 
-static bool device_get_hotpluggable(Object *obj, Error **err)
+static bool device_get_hotpluggable(Object *obj, Error **errp)
 {
     DeviceClass *dc = DEVICE_GET_CLASS(obj);
     DeviceState *dev = DEVICE(obj);
diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c
index 971152e..9727007 100644
--- a/hw/display/ssd0323.c
+++ b/hw/display/ssd0323.c
@@ -312,18 +312,42 @@ static int ssd0323_load(QEMUFile *f, void *opaque, int version_id)
         return -EINVAL;
 
     s->cmd_len = qemu_get_be32(f);
+    if (s->cmd_len < 0 || s->cmd_len > ARRAY_SIZE(s->cmd_data)) {
+        return -EINVAL;
+    }
     s->cmd = qemu_get_be32(f);
     for (i = 0; i < 8; i++)
         s->cmd_data[i] = qemu_get_be32(f);
     s->row = qemu_get_be32(f);
+    if (s->row < 0 || s->row >= 80) {
+        return -EINVAL;
+    }
     s->row_start = qemu_get_be32(f);
+    if (s->row_start < 0 || s->row_start >= 80) {
+        return -EINVAL;
+    }
     s->row_end = qemu_get_be32(f);
+    if (s->row_end < 0 || s->row_end >= 80) {
+        return -EINVAL;
+    }
     s->col = qemu_get_be32(f);
+    if (s->col < 0 || s->col >= 64) {
+        return -EINVAL;
+    }
     s->col_start = qemu_get_be32(f);
+    if (s->col_start < 0 || s->col_start >= 64) {
+        return -EINVAL;
+    }
     s->col_end = qemu_get_be32(f);
+    if (s->col_end < 0 || s->col_end >= 64) {
+        return -EINVAL;
+    }
     s->redraw = qemu_get_be32(f);
     s->remap = qemu_get_be32(f);
     s->mode = qemu_get_be32(f);
+    if (s->mode != SSD0323_CMD && s->mode != SSD0323_DATA) {
+        return -EINVAL;
+    }
     qemu_get_buffer(f, s->framebuffer, sizeof(s->framebuffer));
 
     ss->cs = qemu_get_be32(f);
diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c
index 0e8cccd..bb02279 100644
--- a/hw/dma/omap_dma.c
+++ b/hw/dma/omap_dma.c
@@ -1660,7 +1660,7 @@ struct soc_dma_s *omap_dma_init(hwaddr base, qemu_irq *irqs,
     }
 
     omap_dma_setcaps(s);
-    omap_clk_adduser(s->clk, qemu_allocate_irqs(omap_dma_clk_update, s, 1)[0]);
+    omap_clk_adduser(s->clk, qemu_allocate_irq(omap_dma_clk_update, s, 0));
     omap_dma_reset(s->dma);
     omap_dma_clk_update(s, 0, 1);
 
@@ -2082,7 +2082,7 @@ struct soc_dma_s *omap_dma4_init(hwaddr base, qemu_irq *irqs,
     s->intr_update = omap_dma_interrupts_4_update;
 
     omap_dma_setcaps(s);
-    omap_clk_adduser(s->clk, qemu_allocate_irqs(omap_dma_clk_update, s, 1)[0]);
+    omap_clk_adduser(s->clk, qemu_allocate_irq(omap_dma_clk_update, s, 0));
     omap_dma_reset(s->dma);
     omap_dma_clk_update(s, 0, !!s->dma->freq);
 
diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c
index dc79a8b..8e2ce04 100644
--- a/hw/gpio/zaurus.c
+++ b/hw/gpio/zaurus.c
@@ -203,6 +203,15 @@ static bool is_version_0 (void *opaque, int version_id)
     return version_id == 0;
 }
 
+static bool vmstate_scoop_validate(void *opaque, int version_id)
+{
+    ScoopInfo *s = opaque;
+
+    return !(s->prev_level & 0xffff0000) &&
+        !(s->gpio_level & 0xffff0000) &&
+        !(s->gpio_dir & 0xffff0000);
+}
+
 static const VMStateDescription vmstate_scoop_regs = {
     .name = "scoop",
     .version_id = 1,
@@ -215,6 +224,7 @@ static const VMStateDescription vmstate_scoop_regs = {
         VMSTATE_UINT32(gpio_level, ScoopInfo),
         VMSTATE_UINT32(gpio_dir, ScoopInfo),
         VMSTATE_UINT32(prev_level, ScoopInfo),
+        VMSTATE_VALIDATE("irq levels are 16 bit", vmstate_scoop_validate),
         VMSTATE_UINT16(mcr, ScoopInfo),
         VMSTATE_UINT16(cdr, ScoopInfo),
         VMSTATE_UINT16(ccr, ScoopInfo),
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index c98df88..985a188 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1410,15 +1410,16 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     /* ACPI tables pointed to by RSDT */
     acpi_add_table(table_offsets, tables->table_data);
     build_fadt(tables->table_data, tables->linker, &pm, facs, dsdt);
-    acpi_add_table(table_offsets, tables->table_data);
 
+    acpi_add_table(table_offsets, tables->table_data);
     build_ssdt(tables->table_data, tables->linker, &cpu, &pm, &misc, &pci,
                guest_info);
-    acpi_add_table(table_offsets, tables->table_data);
 
-    build_madt(tables->table_data, tables->linker, &cpu, guest_info);
     acpi_add_table(table_offsets, tables->table_data);
+    build_madt(tables->table_data, tables->linker, &cpu, guest_info);
+
     if (misc.has_hpet) {
+        acpi_add_table(table_offsets, tables->table_data);
         build_hpet(tables->table_data, tables->linker);
     }
     if (guest_info->numa_nodes) {
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index a825871..76aa86e 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -1258,6 +1258,7 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
     if (pos != 0 && kvm_device_msix_supported(kvm_state)) {
         int bar_nr;
         uint32_t msix_table_entry;
+        uint16_t msix_max;
 
         if (!check_irqchip_in_kernel()) {
             return -ENOTSUP;
@@ -1269,9 +1270,10 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
         }
         pci_dev->msix_cap = pos;
 
-        pci_set_word(pci_dev->config + pos + PCI_MSIX_FLAGS,
-                     pci_get_word(pci_dev->config + pos + PCI_MSIX_FLAGS) &
-                     PCI_MSIX_FLAGS_QSIZE);
+        msix_max = (pci_get_word(pci_dev->config + pos + PCI_MSIX_FLAGS) &
+                    PCI_MSIX_FLAGS_QSIZE) + 1;
+        msix_max = MIN(msix_max, KVM_MAX_MSIX_PER_DEV);
+        pci_set_word(pci_dev->config + pos + PCI_MSIX_FLAGS, msix_max - 1);
 
         /* Only enable and function mask bits are writable */
         pci_set_word(pci_dev->wmask + pos + PCI_MSIX_FLAGS,
@@ -1281,9 +1283,7 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
         bar_nr = msix_table_entry & PCI_MSIX_FLAGS_BIRMASK;
         msix_table_entry &= ~PCI_MSIX_FLAGS_BIRMASK;
         dev->msix_table_addr = pci_region[bar_nr].base_addr + msix_table_entry;
-        dev->msix_max = pci_get_word(pci_dev->config + pos + PCI_MSIX_FLAGS);
-        dev->msix_max &= PCI_MSIX_FLAGS_QSIZE;
-        dev->msix_max += 1;
+        dev->msix_max = msix_max;
     }
 
     /* Minimal PM support, nothing writable, device appears to NAK changes */
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 30d3bfa..c9dcd98 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -655,7 +655,7 @@ static FWCfgState *bochs_bios_init(void)
                      acpi_tables, acpi_tables_len);
     fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override());
 
-    smbios_table = smbios_get_table(&smbios_len);
+    smbios_table = smbios_get_table_legacy(&smbios_len);
     if (smbios_table)
         fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
                          smbios_table, smbios_len);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1b3cd18..ce708c7 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -63,7 +63,7 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
 static bool has_pci_info;
 static bool has_acpi_build = true;
-static bool smbios_type1_defaults = true;
+static bool smbios_defaults = true;
 /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
  * host addresses aligned at 1Gbyte boundaries.  This way we can use 1GByte
  * pages in the host.
@@ -166,10 +166,10 @@ static void pc_init1(QEMUMachineInitArgs *args,
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = !pci_enabled;
 
-    if (smbios_type1_defaults) {
+    if (smbios_defaults) {
         /* These values are guest ABI, do not change */
-        smbios_set_type1_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
-                                  args->machine->name);
+        smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
+                            args->machine->name);
     }
 
     /* allocate ram and load rom/bios */
@@ -294,7 +294,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_7(QEMUMachineInitArgs *args)
 {
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
     gigabyte_align = false;
     option_rom_has_mr = true;
     x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
@@ -375,7 +375,10 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     has_acpi_build = false;
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
+    gigabyte_align = false;
+    option_rom_has_mr = true;
+    rom_file_has_mr = false;
     x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
     enable_compat_apic_id_mode();
     pc_init1(args, 1, 0);
@@ -385,7 +388,10 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     has_acpi_build = false;
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
+    gigabyte_align = false;
+    option_rom_has_mr = true;
+    rom_file_has_mr = false;
     if (!args->cpu_model) {
         args->cpu_model = "486";
     }
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index c529e02..c6187a4 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -53,7 +53,7 @@ extern uint64_t max_ram_below_4g;
 
 static bool has_pci_info;
 static bool has_acpi_build = true;
-static bool smbios_type1_defaults = true;
+static bool smbios_defaults = true;
 /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
  * host addresses aligned at 1Gbyte boundaries.  This way we can use 1GByte
  * pages in the host.
@@ -153,10 +153,10 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     guest_info->isapc_ram_fw = false;
     guest_info->has_acpi_build = has_acpi_build;
 
-    if (smbios_type1_defaults) {
+    if (smbios_defaults) {
         /* These values are guest ABI, do not change */
-        smbios_set_type1_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
-                                  args->machine->name);
+        smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
+                            args->machine->name);
     }
 
     /* allocate ram and load rom/bios */
@@ -265,7 +265,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_7(QEMUMachineInitArgs *args)
 {
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
     gigabyte_align = false;
     option_rom_has_mr = true;
     x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
@@ -374,7 +374,7 @@ static QEMUMachine pc_q35_machine_v1_4 = {
     .name = "pc-q35-1.4",
     .init = pc_q35_init_1_4,
     .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_4,
+        PC_Q35_COMPAT_1_4,
         { /* end of list */ }
     },
 };
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index e8f41ad..e734d4c 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -21,9 +21,8 @@
 #include "hw/i386/smbios.h"
 #include "hw/loader.h"
 
-/*
- * Structures shared with the BIOS
- */
+
+/* legacy structures and constants for <= 2.0 machines */
 struct smbios_header {
     uint16_t length;
     uint8_t type;
@@ -46,6 +45,9 @@ struct smbios_table {
 
 static uint8_t *smbios_entries;
 static size_t smbios_entries_len;
+/* end: legacy structures & constants for <= 2.0 machines */
+
+
 static int smbios_type4_count = 0;
 static bool smbios_immutable;
 
@@ -187,6 +189,8 @@ static void smbios_check_collision(int type, int entry)
     }
 }
 
+
+/* legacy setup functions for <= 2.0 machines */
 static void smbios_add_field(int type, int offset, const void *data, size_t len)
 {
     struct smbios_field *field;
@@ -256,8 +260,8 @@ static void smbios_build_type_1_fields(void)
     }
 }
 
-void smbios_set_type1_defaults(const char *manufacturer,
-                               const char *product, const char *version)
+void smbios_set_defaults(const char *manufacturer, const char *product,
+                         const char *version)
 {
     if (!type1.manufacturer) {
         type1.manufacturer = manufacturer;
@@ -270,7 +274,7 @@ void smbios_set_type1_defaults(const char *manufacturer,
     }
 }
 
-uint8_t *smbios_get_table(size_t *length)
+uint8_t *smbios_get_table_legacy(size_t *length)
 {
     if (!smbios_immutable) {
         smbios_build_type_0_fields();
@@ -281,6 +285,8 @@ uint8_t *smbios_get_table(size_t *length)
     *length = smbios_entries_len;
     return smbios_entries;
 }
+/* end: legacy setup functions for <= 2.0 machines */
+
 
 static void save_opt(const char **dest, QemuOpts *opts, const char *name)
 {
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index bfe633f..457a7a1 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1293,7 +1293,7 @@ const VMStateDescription vmstate_ahci = {
         VMSTATE_UINT32(control_regs.impl, AHCIState),
         VMSTATE_UINT32(control_regs.version, AHCIState),
         VMSTATE_UINT32(idp_index, AHCIState),
-        VMSTATE_INT32(ports, AHCIState),
+        VMSTATE_INT32_EQUAL(ports, AHCIState),
         VMSTATE_END_OF_LIST()
     },
 };
diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c
index 21d6495..c73c5a7 100644
--- a/hw/ide/microdrive.c
+++ b/hw/ide/microdrive.c
@@ -594,7 +594,7 @@ static void microdrive_realize(DeviceState *dev, Error **errp)
 {
     MicroDriveState *md = MICRODRIVE(dev);
 
-    ide_init2(&md->bus, qemu_allocate_irqs(md_set_irq, md, 1)[0]);
+    ide_init2(&md->bus, qemu_allocate_irq(md_set_irq, md, 0));
 }
 
 static void microdrive_init(Object *obj)
diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c
index 485c9e5..aa5b688 100644
--- a/hw/input/tsc210x.c
+++ b/hw/input/tsc210x.c
@@ -1070,9 +1070,21 @@ static int tsc210x_load(QEMUFile *f, void *opaque, int version_id)
     s->enabled = qemu_get_byte(f);
     s->host_mode = qemu_get_byte(f);
     s->function = qemu_get_byte(f);
+    if (s->function < 0 || s->function >= ARRAY_SIZE(mode_regs)) {
+        return -EINVAL;
+    }
     s->nextfunction = qemu_get_byte(f);
+    if (s->nextfunction < 0 || s->nextfunction >= ARRAY_SIZE(mode_regs)) {
+        return -EINVAL;
+    }
     s->precision = qemu_get_byte(f);
+    if (s->precision < 0 || s->precision >= ARRAY_SIZE(resolution)) {
+        return -EINVAL;
+    }
     s->nextprecision = qemu_get_byte(f);
+    if (s->nextprecision < 0 || s->nextprecision >= ARRAY_SIZE(resolution)) {
+        return -EINVAL;
+    }
     s->filter = qemu_get_byte(f);
     s->pin_func = qemu_get_byte(f);
     s->ref = qemu_get_byte(f);
diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index c6f248b..ec01393 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -412,7 +412,7 @@ static const MemoryRegionOps pic_elcr_ioport_ops = {
     },
 };
 
-static void pic_realize(DeviceState *dev, Error **err)
+static void pic_realize(DeviceState *dev, Error **errp)
 {
     PICCommonState *s = PIC_COMMON(dev);
     PICClass *pc = PIC_GET_CLASS(dev);
@@ -425,7 +425,7 @@ static void pic_realize(DeviceState *dev, Error **err)
     qdev_init_gpio_out(dev, s->int_out, ARRAY_SIZE(s->int_out));
     qdev_init_gpio_in(dev, pic_set_irq, 8);
 
-    pc->parent_realize(dev, err);
+    pc->parent_realize(dev, errp);
 }
 
 void pic_info(Monitor *mon, const QDict *qdict)
diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c
index be76fbd..17136c9 100644
--- a/hw/intc/openpic.c
+++ b/hw/intc/openpic.c
@@ -41,6 +41,7 @@
 #include "hw/sysbus.h"
 #include "hw/pci/msi.h"
 #include "qemu/bitops.h"
+#include "qapi/qmp/qerror.h"
 
 //#define DEBUG_OPENPIC
 
@@ -1416,7 +1417,7 @@ static void openpic_load_IRQ_queue(QEMUFile* f, IRQQueue *q)
 static int openpic_load(QEMUFile* f, void *opaque, int version_id)
 {
     OpenPICState *opp = (OpenPICState *)opaque;
-    unsigned int i;
+    unsigned int i, nb_cpus;
 
     if (version_id != 1) {
         return -EINVAL;
@@ -1428,7 +1429,11 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id)
     qemu_get_be32s(f, &opp->spve);
     qemu_get_be32s(f, &opp->tfrr);
 
-    qemu_get_be32s(f, &opp->nb_cpus);
+    qemu_get_be32s(f, &nb_cpus);
+    if (opp->nb_cpus != nb_cpus) {
+        return -EINVAL;
+    }
+    assert(nb_cpus > 0 && nb_cpus <= MAX_CPU);
 
     for (i = 0; i < opp->nb_cpus; i++) {
         qemu_get_sbe32s(f, &opp->dst[i].ctpr);
@@ -1567,6 +1572,13 @@ static void openpic_realize(DeviceState *dev, Error **errp)
         {NULL}
     };
 
+    if (opp->nb_cpus > MAX_CPU) {
+        error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
+                  TYPE_OPENPIC, "nb_cpus", (uint64_t)opp->nb_cpus,
+                  (uint64_t)0, (uint64_t)MAX_CPU);
+        return;
+    }
+
     switch (opp->model) {
     case OPENPIC_MODEL_FSL_MPIC_20:
     default:
diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index 29b467b..495d507 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -135,9 +135,9 @@ CBus *cbus_init(qemu_irq dat)
     CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
 
     s->dat_out = dat;
-    s->cbus.clk = qemu_allocate_irqs(cbus_clk, s, 1)[0];
-    s->cbus.dat = qemu_allocate_irqs(cbus_dat, s, 1)[0];
-    s->cbus.sel = qemu_allocate_irqs(cbus_sel, s, 1)[0];
+    s->cbus.clk = qemu_allocate_irq(cbus_clk, s, 0);
+    s->cbus.dat = qemu_allocate_irq(cbus_dat, s, 0);
+    s->cbus.sel = qemu_allocate_irq(cbus_sel, s, 0);
 
     s->sel = 1;
     s->clk = 0;
diff --git a/hw/misc/imx_ccm.c b/hw/misc/imx_ccm.c
index 63e33a4..449183d 100644
--- a/hw/misc/imx_ccm.c
+++ b/hw/misc/imx_ccm.c
@@ -68,6 +68,7 @@ static const VMStateDescription vmstate_imx_ccm = {
         VMSTATE_UINT32(pmcr0, IMXCCMState),
         VMSTATE_UINT32(pmcr1, IMXCCMState),
         VMSTATE_UINT32(pll_refclk_freq, IMXCCMState),
+        VMSTATE_END_OF_LIST()
     },
     .post_load = imx_ccm_post_load,
 };
diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
index d04e6a4..9cc6262 100644
--- a/hw/net/stellaris_enet.c
+++ b/hw/net/stellaris_enet.c
@@ -8,6 +8,7 @@
  */
 #include "hw/sysbus.h"
 #include "net/net.h"
+#include "migration/migration.h"
 #include <zlib.h>
 
 //#define DEBUG_STELLARIS_ENET 1
@@ -75,6 +76,7 @@ typedef struct {
     NICConf conf;
     qemu_irq irq;
     MemoryRegion mmio;
+    Error *migration_blocker;
 } stellaris_enet_state;
 
 static void stellaris_enet_update(stellaris_enet_state *s)
@@ -253,17 +255,19 @@ static void stellaris_enet_write(void *opaque, hwaddr offset,
                 s->tx_fifo[s->tx_fifo_len++] = value >> 24;
             }
         } else {
-            s->tx_fifo[s->tx_fifo_len++] = value;
-            s->tx_fifo[s->tx_fifo_len++] = value >> 8;
-            s->tx_fifo[s->tx_fifo_len++] = value >> 16;
-            s->tx_fifo[s->tx_fifo_len++] = value >> 24;
+            if (s->tx_fifo_len + 4 <= ARRAY_SIZE(s->tx_fifo)) {
+                s->tx_fifo[s->tx_fifo_len++] = value;
+                s->tx_fifo[s->tx_fifo_len++] = value >> 8;
+                s->tx_fifo[s->tx_fifo_len++] = value >> 16;
+                s->tx_fifo[s->tx_fifo_len++] = value >> 24;
+            }
             if (s->tx_fifo_len >= s->tx_frame_len) {
                 /* We don't implement explicit CRC, so just chop it off.  */
                 if ((s->tctl & SE_TCTL_CRC) == 0)
                     s->tx_frame_len -= 4;
                 if ((s->tctl & SE_TCTL_PADEN) && s->tx_frame_len < 60) {
                     memset(&s->tx_fifo[s->tx_frame_len], 0, 60 - s->tx_frame_len);
-                    s->tx_fifo_len = 60;
+                    s->tx_frame_len = 60;
                 }
                 qemu_send_packet(qemu_get_queue(s->nic), s->tx_fifo,
                                  s->tx_frame_len);
@@ -360,7 +364,7 @@ static int stellaris_enet_load(QEMUFile *f, void *opaque, int version_id)
     stellaris_enet_state *s = (stellaris_enet_state *)opaque;
     int i;
 
-    if (version_id != 1)
+    if (1)
         return -EINVAL;
 
     s->ris = qemu_get_be32(f);
@@ -421,6 +425,10 @@ static int stellaris_enet_init(SysBusDevice *sbd)
     stellaris_enet_reset(s);
     register_savevm(dev, "stellaris_enet", -1, 1,
                     stellaris_enet_save, stellaris_enet_load, s);
+
+    error_setg(&s->migration_blocker,
+            "stellaris_enet does not support migration");
+    migrate_add_blocker(s->migration_blocker);
     return 0;
 }
 
@@ -428,6 +436,9 @@ static void stellaris_enet_unrealize(DeviceState *dev, Error **errp)
 {
     stellaris_enet_state *s = STELLARIS_ENET(dev);
 
+    migrate_del_blocker(s->migration_blocker);
+    error_free(s->migration_blocker);
+
     unregister_savevm(DEVICE(s), "stellaris_enet", s);
 
     memory_region_destroy(&s->mmio);
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 33bd233..2ac6ce5 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -863,6 +863,14 @@ static int virtio_net_has_buffers(VirtIONetQueue *q, int bufsize)
     return 1;
 }
 
+static void virtio_net_hdr_swap(struct virtio_net_hdr *hdr)
+{
+    tswap16s(&hdr->hdr_len);
+    tswap16s(&hdr->gso_size);
+    tswap16s(&hdr->csum_start);
+    tswap16s(&hdr->csum_offset);
+}
+
 /* dhclient uses AF_PACKET but doesn't pass auxdata to the kernel so
  * it never finds out that the packets don't have valid checksums.  This
  * causes dhclient to get upset.  Fedora's carried a patch for ages to
@@ -898,6 +906,7 @@ static void receive_header(VirtIONet *n, const struct iovec *iov, int iov_cnt,
         void *wbuf = (void *)buf;
         work_around_broken_dhclient(wbuf, wbuf + n->host_hdr_len,
                                     size - n->host_hdr_len);
+        virtio_net_hdr_swap(wbuf);
         iov_from_buf(iov, iov_cnt, 0, buf, sizeof(struct virtio_net_hdr));
     } else {
         struct virtio_net_hdr hdr = {
@@ -1106,6 +1115,14 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
             exit(1);
         }
 
+        if (n->has_vnet_hdr) {
+            if (out_sg[0].iov_len < n->guest_hdr_len) {
+                error_report("virtio-net header incorrect");
+                exit(1);
+            }
+            virtio_net_hdr_swap((void *) out_sg[0].iov_base);
+        }
+
         /*
          * If host wants to see the guest header as is, we can
          * pass it on unchanged. Otherwise, copy just the parts
@@ -1362,10 +1379,17 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
         if (n->mac_table.in_use <= MAC_TABLE_ENTRIES) {
             qemu_get_buffer(f, n->mac_table.macs,
                             n->mac_table.in_use * ETH_ALEN);
-        } else if (n->mac_table.in_use) {
-            uint8_t *buf = g_malloc0(n->mac_table.in_use);
-            qemu_get_buffer(f, buf, n->mac_table.in_use * ETH_ALEN);
-            g_free(buf);
+        } else {
+            int64_t i;
+
+            /* Overflow detected - can happen if source has a larger MAC table.
+             * We simply set overflow flag so there's no need to maintain the
+             * table of addresses, discard them all.
+             * Note: 64 bit math to avoid integer overflow.
+             */
+            for (i = 0; i < (int64_t)n->mac_table.in_use * ETH_ALEN; ++i) {
+                qemu_get_byte(f);
+            }
             n->mac_table.multi_overflow = n->mac_table.uni_overflow = 1;
             n->mac_table.in_use = 0;
         }
@@ -1407,6 +1431,11 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
         }
 
         n->curr_queues = qemu_get_be16(f);
+        if (n->curr_queues > n->max_queues) {
+            error_report("virtio-net: curr_queues %x > max_queues %x",
+                         n->curr_queues, n->max_queues);
+            return -1;
+        }
         for (i = 1; i < n->curr_queues; i++) {
             n->vqs[i].tx_waiting = qemu_get_be32(f);
         }
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2a9f08e..e05d60c 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -830,6 +830,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     }
 
     pci_dev->bus = bus;
+    pci_dev->devfn = devfn;
     dma_as = pci_device_iommu_address_space(pci_dev);
 
     memory_region_init_alias(&pci_dev->bus_master_enable_region,
@@ -839,7 +840,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     address_space_init(&pci_dev->bus_master_as, &pci_dev->bus_master_enable_region,
                        name);
 
-    pci_dev->devfn = devfn;
     pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
     pci_dev->irq_state = 0;
     pci_config_alloc(pci_dev);
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index 991502e..535be2c 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -795,6 +795,13 @@ static const VMStateDescription vmstate_pcie_aer_err = {
     }
 };
 
+static bool pcie_aer_state_log_num_valid(void *opaque, int version_id)
+{
+    PCIEAERLog *s = opaque;
+
+    return s->log_num <= s->log_max;
+}
+
 const VMStateDescription vmstate_pcie_aer_log = {
     .name = "PCIE_AER_ERROR_LOG",
     .version_id = 1,
@@ -802,7 +809,8 @@ const VMStateDescription vmstate_pcie_aer_log = {
     .minimum_version_id_old = 1,
     .fields     = (VMStateField[]) {
         VMSTATE_UINT16(log_num, PCIEAERLog),
-        VMSTATE_UINT16(log_max, PCIEAERLog),
+        VMSTATE_UINT16_EQUAL(log_max, PCIEAERLog),
+        VMSTATE_VALIDATE("log_num <= log_max", pcie_aer_state_log_num_valid),
         VMSTATE_STRUCT_VARRAY_POINTER_UINT16(log, PCIEAERLog, log_num,
                               vmstate_pcie_aer_err, PCIEAERErr),
         VMSTATE_END_OF_LIST()
diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c
index 96f3774..55e8a2a 100644
--- a/hw/pcmcia/pxa2xx.c
+++ b/hw/pcmcia/pxa2xx.c
@@ -195,7 +195,7 @@ static void pxa2xx_pcmcia_initfn(Object *obj)
     memory_region_add_subregion(&s->container_mem, 0x0c000000,
                                 &s->common_iomem);
 
-    s->slot.irq = qemu_allocate_irqs(pxa2xx_pcmcia_set_irq, s, 1)[0];
+    s->slot.irq = qemu_allocate_irq(pxa2xx_pcmcia_set_irq, s, 0);
 
     object_property_add_link(obj, "card", TYPE_PCMCIA_CARD,
                              (Object **)&s->card,
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index cbef095..000c94f 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -343,6 +343,21 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr,
 
     /* There is no cached config, allocate MSIs */
     if (!phb->msi_table[ndev].nvec) {
+        int max_irqs = 0;
+        if (ret_intr_type == RTAS_TYPE_MSI) {
+            max_irqs = msi_nr_vectors_allocated(pdev);
+        } else if (ret_intr_type == RTAS_TYPE_MSIX) {
+            max_irqs = pdev->msix_entries_nr;
+        }
+        if (!max_irqs) {
+            error_report("Requested interrupt type %d is not enabled for device#%d",
+                         ret_intr_type, ndev);
+            rtas_st(rets, 0, -1); /* Hardware error */
+            return;
+        }
+        if (req_num > max_irqs) {
+            req_num = max_irqs;
+        }
         irq = spapr_allocate_irq_block(req_num, false,
                                        ret_intr_type == RTAS_TYPE_MSI);
         if (irq < 0) {
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 7074d2b..d68a29a 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -734,9 +734,11 @@ out:
     return ret;
 }
 
-static void copy_irb_to_guest(IRB *dest, const IRB *src)
+static void copy_irb_to_guest(IRB *dest, const IRB *src, PMCW *pmcw)
 {
     int i;
+    uint16_t stctl = src->scsw.ctrl & SCSW_CTRL_MASK_STCTL;
+    uint16_t actl = src->scsw.ctrl & SCSW_CTRL_MASK_ACTL;
 
     copy_scsw_to_guest(&dest->scsw, &src->scsw);
 
@@ -746,8 +748,22 @@ static void copy_irb_to_guest(IRB *dest, const IRB *src)
     for (i = 0; i < ARRAY_SIZE(dest->ecw); i++) {
         dest->ecw[i] = cpu_to_be32(src->ecw[i]);
     }
-    for (i = 0; i < ARRAY_SIZE(dest->emw); i++) {
-        dest->emw[i] = cpu_to_be32(src->emw[i]);
+    /* extended measurements enabled? */
+    if ((src->scsw.flags & SCSW_FLAGS_MASK_ESWF) ||
+        !(pmcw->flags & PMCW_FLAGS_MASK_TF) ||
+        !(pmcw->chars & PMCW_CHARS_MASK_XMWME)) {
+        return;
+    }
+    /* extended measurements pending? */
+    if (!(stctl & SCSW_STCTL_STATUS_PEND)) {
+        return;
+    }
+    if ((stctl & SCSW_STCTL_PRIMARY) ||
+        (stctl == SCSW_STCTL_SECONDARY) ||
+        ((stctl & SCSW_STCTL_INTERMEDIATE) && (actl & SCSW_ACTL_SUSP))) {
+        for (i = 0; i < ARRAY_SIZE(dest->emw); i++) {
+            dest->emw[i] = cpu_to_be32(src->emw[i]);
+        }
     }
 }
 
@@ -793,7 +809,7 @@ int css_do_tsch(SubchDev *sch, IRB *target_irb)
         }
     }
     /* Store the irb to the guest. */
-    copy_irb_to_guest(target_irb, &irb);
+    copy_irb_to_guest(target_irb, &irb, p);
 
     /* Clear conditions on subchannel, if applicable. */
     if (stctl & SCSW_STCTL_STATUS_PEND) {
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index e6e1ffd..1781525 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -1106,6 +1106,21 @@ static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd)
     return MFI_STAT_OK;
 }
 
+static int megasas_dcmd_ld_list_query(MegasasState *s, MegasasCmd *cmd)
+{
+    uint16_t flags;
+
+    /* mbox0 contains flags */
+    flags = le16_to_cpu(cmd->frame->dcmd.mbox[0]);
+    trace_megasas_dcmd_ld_list_query(cmd->index, flags);
+    if (flags == MR_LD_QUERY_TYPE_ALL ||
+        flags == MR_LD_QUERY_TYPE_EXPOSED_TO_HOST) {
+        return megasas_dcmd_ld_get_list(s, cmd);
+    }
+
+    return MFI_STAT_OK;
+}
+
 static int megasas_ld_get_info_submit(SCSIDevice *sdev, int lun,
                                       MegasasCmd *cmd)
 {
@@ -1409,6 +1424,8 @@ static const struct dcmd_cmd_tbl_t {
       megasas_dcmd_dummy },
     { MFI_DCMD_LD_GET_LIST, "LD_GET_LIST",
       megasas_dcmd_ld_get_list},
+    { MFI_DCMD_LD_LIST_QUERY, "LD_LIST_QUERY",
+      megasas_dcmd_ld_list_query },
     { MFI_DCMD_LD_GET_INFO, "LD_GET_INFO",
       megasas_dcmd_ld_get_info },
     { MFI_DCMD_LD_GET_PROP, "LD_GET_PROP",
diff --git a/hw/scsi/mfi.h b/hw/scsi/mfi.h
index cd8355b..a3034f6 100644
--- a/hw/scsi/mfi.h
+++ b/hw/scsi/mfi.h
@@ -164,6 +164,7 @@ typedef enum {
     MFI_DCMD_PD_BLINK =                 0x02070100,
     MFI_DCMD_PD_UNBLINK =               0x02070200,
     MFI_DCMD_LD_GET_LIST =              0x03010000,
+    MFI_DCMD_LD_LIST_QUERY =            0x03010100,
     MFI_DCMD_LD_GET_INFO =              0x03020000,
     MFI_DCMD_LD_GET_PROP =              0x03030000,
     MFI_DCMD_LD_SET_PROP =              0x03040000,
@@ -411,6 +412,14 @@ typedef enum {
     MR_PD_QUERY_TYPE_EXPOSED_TO_HOST =  5, /*query for system drives */
 } mfi_pd_query_type;
 
+typedef enum {
+    MR_LD_QUERY_TYPE_ALL =              0,
+    MR_LD_QUERY_TYPE_EXPOSED_TO_HOST =  1,
+    MR_LD_QUERY_TYPE_USED_TGT_IDS =     2,
+    MR_LD_QUERY_TYPE_CLUSTER_ACCESS =   3,
+    MR_LD_QUERY_TYPE_CLUSTER_LOCALE =   4,
+} mfi_ld_query_type;
+
 /*
  * Other propertities and definitions
  */
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 48a28ae..da8c436 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2520,7 +2520,7 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag,
 	 * ones (such as WRITE SAME or EXTENDED COPY, etc.).  So, without
 	 * O_DIRECT everything must go through SG_IO.
          */
-        if (bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE) {
+        if (!(bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE)) {
             break;
         }
 
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 3983a5b..9099192 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -196,6 +196,10 @@ static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val)
     }
 }
 
+static void vhost_dummy_handle_output(VirtIODevice *vdev, VirtQueue *vq)
+{
+}
+
 static void vhost_scsi_realize(DeviceState *dev, Error **errp)
 {
     VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev);
@@ -217,7 +221,9 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp)
         }
     }
 
-    virtio_scsi_common_realize(dev, &err);
+    virtio_scsi_common_realize(dev, &err, vhost_dummy_handle_output,
+                               vhost_dummy_handle_output,
+                               vhost_dummy_handle_output);
     if (err != NULL) {
         error_propagate(errp, err);
         return;
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index b0d7517..d183cd0 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -147,6 +147,15 @@ static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
     qemu_get_be32s(f, &n);
     assert(n < vs->conf.num_queues);
     qemu_get_buffer(f, (unsigned char *)&req->elem, sizeof(req->elem));
+    /* TODO: add a way for SCSIBusInfo's load_request to fail,
+     * and fail migration instead of asserting here.
+     * When we do, we might be able to re-enable NDEBUG below.
+     */
+#ifdef NDEBUG
+#error building with NDEBUG is not supported
+#endif
+    assert(req->elem.in_num <= ARRAY_SIZE(req->elem.in_sg));
+    assert(req->elem.out_num <= ARRAY_SIZE(req->elem.out_sg));
     virtio_scsi_parse_req(s, vs->cmd_vqs[n], req);
 
     scsi_req_ref(sreq);
@@ -489,7 +498,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
                                    uint32_t event, uint32_t reason)
 {
     VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
-    VirtIOSCSIReq *req = virtio_scsi_pop_req(s, vs->event_vq);
+    VirtIOSCSIReq *req;
     VirtIOSCSIEvent *evt;
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
     int in_size;
@@ -498,6 +507,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
         return;
     }
 
+    req = virtio_scsi_pop_req(s, vs->event_vq);
     if (!req) {
         s->events_dropped = true;
         return;
@@ -595,7 +605,9 @@ static struct SCSIBusInfo virtio_scsi_scsi_info = {
     .load_request = virtio_scsi_load_request,
 };
 
-void virtio_scsi_common_realize(DeviceState *dev, Error **errp)
+void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
+                                HandleOutput ctrl, HandleOutput evt,
+                                HandleOutput cmd)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOSCSICommon *s = VIRTIO_SCSI_COMMON(dev);
@@ -609,12 +621,12 @@ void virtio_scsi_common_realize(DeviceState *dev, Error **errp)
     s->cdb_size = VIRTIO_SCSI_CDB_SIZE;
 
     s->ctrl_vq = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,
-                                  virtio_scsi_handle_ctrl);
+                                  ctrl);
     s->event_vq = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,
-                                   virtio_scsi_handle_event);
+                                   evt);
     for (i = 0; i < s->conf.num_queues; i++) {
         s->cmd_vqs[i] = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,
-                                         virtio_scsi_handle_cmd);
+                                         cmd);
     }
 }
 
@@ -625,7 +637,9 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)
     static int virtio_scsi_id;
     Error *err = NULL;
 
-    virtio_scsi_common_realize(dev, &err);
+    virtio_scsi_common_realize(dev, &err, virtio_scsi_handle_ctrl,
+                               virtio_scsi_handle_event,
+                               virtio_scsi_handle_cmd);
     if (err != NULL) {
         error_propagate(errp, err);
         return;
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c
index 937a478..6c92149 100644
--- a/hw/sd/omap_mmc.c
+++ b/hw/sd/omap_mmc.c
@@ -625,7 +625,7 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
         exit(1);
     }
 
-    s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0];
+    s->cdet = qemu_allocate_irq(omap_mmc_cover_cb, s, 0);
     sd_set_cb(s->card, NULL, s->cdet);
 
     return s;
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 843e697..e79a886 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1168,8 +1168,8 @@ static void sdhci_initfn(Object *obj)
     if (s->card == NULL) {
         exit(1);
     }
-    s->eject_cb = qemu_allocate_irqs(sdhci_insert_eject_cb, s, 1)[0];
-    s->ro_cb = qemu_allocate_irqs(sdhci_card_readonly_cb, s, 1)[0];
+    s->eject_cb = qemu_allocate_irq(sdhci_insert_eject_cb, s, 0);
+    s->ro_cb = qemu_allocate_irq(sdhci_card_readonly_cb, s, 0);
     sd_set_cb(s->card, s->ro_cb, s->eject_cb);
 
     s->insert_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, sdhci_raise_insertion_irq, s);
@@ -1184,8 +1184,8 @@ static void sdhci_uninitfn(Object *obj)
     timer_free(s->insert_timer);
     timer_del(s->transfer_timer);
     timer_free(s->transfer_timer);
-    qemu_free_irqs(&s->eject_cb);
-    qemu_free_irqs(&s->ro_cb);
+    qemu_free_irq(s->eject_cb);
+    qemu_free_irq(s->ro_cb);
 
     if (s->fifo_buffer) {
         g_free(s->fifo_buffer);
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index 3273c8a..b012e57 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -230,8 +230,17 @@ static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id)
     for (i = 0; i < 5; i++)
         s->response[i] = qemu_get_be32(f);
     s->arglen = qemu_get_be32(f);
+    if (s->mode == SSI_SD_CMDARG &&
+        (s->arglen < 0 || s->arglen >= ARRAY_SIZE(s->cmdarg))) {
+        return -EINVAL;
+    }
     s->response_pos = qemu_get_be32(f);
     s->stopping = qemu_get_be32(f);
+    if (s->mode == SSI_SD_RESPONSE &&
+        (s->response_pos < 0 || s->response_pos >= ARRAY_SIZE(s->response) ||
+        (!s->stopping && s->arglen > ARRAY_SIZE(s->response)))) {
+        return -EINVAL;
+    }
 
     ss->cs = qemu_get_be32(f);
 
diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c
index 4a39357..5dda5de 100644
--- a/hw/sh4/sh7750.c
+++ b/hw/sh4/sh7750.c
@@ -838,6 +838,5 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem)
 qemu_irq sh7750_irl(SH7750State *s)
 {
     sh_intc_toggle_source(sh_intc_source(&s->intc, IRL), 1, 0); /* enable */
-    return qemu_allocate_irqs(sh_intc_set_irl, sh_intc_source(&s->intc, IRL),
-                               1)[0];
+    return qemu_allocate_irq(sh_intc_set_irl, sh_intc_source(&s->intc, IRL), 0);
 }
diff --git a/hw/ssi/pl022.c b/hw/ssi/pl022.c
index fd479ef..b19bc71 100644
--- a/hw/ssi/pl022.c
+++ b/hw/ssi/pl022.c
@@ -240,11 +240,25 @@ static const MemoryRegionOps pl022_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
+static int pl022_post_load(void *opaque, int version_id)
+{
+    PL022State *s = opaque;
+
+    if (s->tx_fifo_head < 0 ||
+        s->tx_fifo_head >= ARRAY_SIZE(s->tx_fifo) ||
+        s->rx_fifo_head < 0 ||
+        s->rx_fifo_head >= ARRAY_SIZE(s->rx_fifo)) {
+        return -1;
+    }
+    return 0;
+}
+
 static const VMStateDescription vmstate_pl022 = {
     .name = "pl022_ssp",
     .version_id = 1,
     .minimum_version_id = 1,
     .minimum_version_id_old = 1,
+    .post_load = pl022_post_load,
     .fields      = (VMStateField[]) {
         VMSTATE_UINT32(cr0, PL022State),
         VMSTATE_UINT32(cr1, PL022State),
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index e15d6bc..2792f89 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -239,6 +239,18 @@ static int hpet_pre_load(void *opaque)
     return 0;
 }
 
+static bool hpet_validate_num_timers(void *opaque, int version_id)
+{
+    HPETState *s = opaque;
+
+    if (s->num_timers < HPET_MIN_TIMERS) {
+        return false;
+    } else if (s->num_timers > HPET_MAX_TIMERS) {
+        return false;
+    }
+    return true;
+}
+
 static int hpet_post_load(void *opaque, int version_id)
 {
     HPETState *s = opaque;
@@ -307,6 +319,7 @@ static const VMStateDescription vmstate_hpet = {
         VMSTATE_UINT64(isr, HPETState),
         VMSTATE_UINT64(hpet_counter, HPETState),
         VMSTATE_UINT8_V(num_timers, HPETState, 2),
+        VMSTATE_VALIDATE("num_timers in range", hpet_validate_num_timers),
         VMSTATE_STRUCT_VARRAY_UINT8(timer, HPETState, num_timers, 0,
                                     vmstate_hpet_timer, HPETTimer),
         VMSTATE_END_OF_LIST()
diff --git a/hw/timer/i8254.c b/hw/timer/i8254.c
index 28152d8..3450c98 100644
--- a/hw/timer/i8254.c
+++ b/hw/timer/i8254.c
@@ -322,7 +322,7 @@ static void pit_post_load(PITCommonState *s)
     }
 }
 
-static void pit_realizefn(DeviceState *dev, Error **err)
+static void pit_realizefn(DeviceState *dev, Error **errp)
 {
     PITCommonState *pit = PIT_COMMON(dev);
     PITClass *pc = PIT_GET_CLASS(dev);
@@ -338,7 +338,7 @@ static void pit_realizefn(DeviceState *dev, Error **err)
 
     qdev_init_gpio_in(dev, pit_irq_control, 1);
 
-    pc->parent_realize(dev, err);
+    pc->parent_realize(dev, errp);
 }
 
 static Property pit_properties[] = {
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 8509309..abcbcae 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -852,7 +852,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     check_update_timer(s);
 
     s->clock_reset_notifier.notify = rtc_notify_clock_reset;
-    qemu_clock_register_reset_notifier(QEMU_CLOCK_REALTIME,
+    qemu_clock_register_reset_notifier(rtc_clock,
                                        &s->clock_reset_notifier);
 
     s->suspend_notifier.notify = rtc_notify_suspend;
diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c
index 016207f..b7f3d49 100644
--- a/hw/timer/omap_gptimer.c
+++ b/hw/timer/omap_gptimer.c
@@ -227,7 +227,7 @@ static void omap_gp_timer_clk_update(void *opaque, int line, int on)
 static void omap_gp_timer_clk_setup(struct omap_gp_timer_s *timer)
 {
     omap_clk_adduser(timer->clk,
-                    qemu_allocate_irqs(omap_gp_timer_clk_update, timer, 1)[0]);
+                     qemu_allocate_irq(omap_gp_timer_clk_update, timer, 0));
     timer->rate = omap_clk_getrate(timer->clk);
 }
 
@@ -476,7 +476,7 @@ struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta,
     s->clk = fclk;
     s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_gp_timer_tick, s);
     s->match = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_gp_timer_match, s);
-    s->in = qemu_allocate_irqs(omap_gp_timer_input, s, 1)[0];
+    s->in = qemu_allocate_irq(omap_gp_timer_input, s, 0);
     omap_gp_timer_reset(s);
     omap_gp_timer_clk_setup(s);
 
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index fe70429..e48b19f 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -49,7 +49,9 @@ static int usb_device_post_load(void *opaque, int version_id)
     } else {
         dev->attached = 1;
     }
-    if (dev->setup_index >= sizeof(dev->data_buf) ||
+    if (dev->setup_index < 0 ||
+        dev->setup_len < 0 ||
+        dev->setup_index >= sizeof(dev->data_buf) ||
         dev->setup_len >= sizeof(dev->data_buf)) {
         return -EINVAL;
     }
diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
index a9661d2..a76e581 100644
--- a/hw/usb/dev-bluetooth.c
+++ b/hw/usb/dev-bluetooth.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu-common.h"
+#include "qemu/error-report.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
 #include "sysemu/bt.h"
@@ -506,6 +507,14 @@ static int usb_bt_initfn(USBDevice *dev)
 
     usb_desc_create_serial(dev);
     usb_desc_init(dev);
+    s->dev.opaque = s;
+    if (!s->hci) {
+        s->hci = bt_new_hci(qemu_find_bt_vlan(0));
+    }
+    s->hci->opaque = s;
+    s->hci->evt_recv = usb_bt_out_hci_packet_event;
+    s->hci->acl_recv = usb_bt_out_hci_packet_acl;
+    usb_bt_handle_reset(&s->dev);
     s->intr = usb_ep_get(dev, USB_TOKEN_IN, USB_EVT_EP);
 
     return 0;
@@ -516,6 +525,7 @@ static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline)
     USBDevice *dev;
     struct USBBtState *s;
     HCIInfo *hci;
+    const char *name = "usb-bt-dongle";
 
     if (*cmdline) {
         hci = hci_init(cmdline);
@@ -525,19 +535,17 @@ static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline)
 
     if (!hci)
         return NULL;
-    dev = usb_create_simple(bus, "usb-bt-dongle");
+    dev = usb_create(bus, name);
     if (!dev) {
+        error_report("Failed to create USB device '%s'", name);
         return NULL;
     }
     s = DO_UPCAST(struct USBBtState, dev, dev);
-    s->dev.opaque = s;
-
     s->hci = hci;
-    s->hci->opaque = s;
-    s->hci->evt_recv = usb_bt_out_hci_packet_event;
-    s->hci->acl_recv = usb_bt_out_hci_packet_acl;
-
-    usb_bt_handle_reset(&s->dev);
+    if (qdev_init(&dev->qdev) < 0) {
+        error_report("Failed to initialize USB device '%s'", name);
+        return NULL;
+    }
 
     return dev;
 }
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index ef3177a..0ceb10d 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3703,6 +3703,7 @@ static const VMStateDescription vmstate_xhci_event = {
         VMSTATE_UINT32(flags,  XHCIEvent),
         VMSTATE_UINT8(slotid,  XHCIEvent),
         VMSTATE_UINT8(epid,    XHCIEvent),
+        VMSTATE_END_OF_LIST()
     }
 };
 
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 9e336ad..1d349e0 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -309,7 +309,9 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
                                       uint64_t size)
 {
     int i;
-    for (i = 0; i < dev->nvqs; ++i) {
+    int r = 0;
+
+    for (i = 0; !r && i < dev->nvqs; ++i) {
         struct vhost_virtqueue *vq = dev->vqs + i;
         hwaddr l;
         void *p;
@@ -321,15 +323,15 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
         p = cpu_physical_memory_map(vq->ring_phys, &l, 1);
         if (!p || l != vq->ring_size) {
             fprintf(stderr, "Unable to map ring buffer for ring %d\n", i);
-            return -ENOMEM;
+            r = -ENOMEM;
         }
         if (p != vq->ring) {
             fprintf(stderr, "Ring buffer relocated for ring %d\n", i);
-            return -EBUSY;
+            r = -EBUSY;
         }
         cpu_physical_memory_unmap(p, l, 0, 0);
     }
-    return 0;
+    return r;
 }
 
 static struct vhost_memory_region *vhost_dev_find_reg(struct vhost_dev *dev,
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index aeabf3a..3e4b70c 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -430,6 +430,12 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
     unsigned int i;
     hwaddr len;
 
+    if (num_sg > VIRTQUEUE_MAX_SIZE) {
+        error_report("virtio: map attempt out of bounds: %zd > %d",
+                     num_sg, VIRTQUEUE_MAX_SIZE);
+        exit(1);
+    }
+
     for (i = 0; i < num_sg; i++) {
         len = sg[i].iov_len;
         sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);
@@ -891,7 +897,9 @@ int virtio_set_features(VirtIODevice *vdev, uint32_t val)
 
 int virtio_load(VirtIODevice *vdev, QEMUFile *f)
 {
-    int num, i, ret;
+    int i, ret;
+    int32_t config_len;
+    uint32_t num;
     uint32_t features;
     uint32_t supported_features;
     BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
@@ -906,6 +914,9 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f)
     qemu_get_8s(f, &vdev->status);
     qemu_get_8s(f, &vdev->isr);
     qemu_get_be16s(f, &vdev->queue_sel);
+    if (vdev->queue_sel >= VIRTIO_PCI_QUEUE_MAX) {
+        return -1;
+    }
     qemu_get_be32s(f, &features);
 
     if (virtio_set_features(vdev, features) < 0) {
@@ -914,11 +925,27 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f)
                      features, supported_features);
         return -1;
     }
-    vdev->config_len = qemu_get_be32(f);
-    qemu_get_buffer(f, vdev->config, vdev->config_len);
+    config_len = qemu_get_be32(f);
+
+    /*
+     * There are cases where the incoming config can be bigger or smaller
+     * than what we have; so load what we have space for, and skip
+     * any excess that's in the stream.
+     */
+    qemu_get_buffer(f, vdev->config, MIN(config_len, vdev->config_len));
+
+    while (config_len > vdev->config_len) {
+        qemu_get_byte(f);
+        config_len--;
+    }
 
     num = qemu_get_be32(f);
 
+    if (num > VIRTIO_PCI_QUEUE_MAX) {
+        error_report("Invalid number of PCI queues: 0x%x", num);
+        return -1;
+    }
+
     for (i = 0; i < num; i++) {
         vdev->vq[i].vring.num = qemu_get_be32(f);
         if (k->has_variable_vring_alignment) {
diff --git a/hw/xtensa/xtensa_lx60.c b/hw/xtensa/xtensa_lx60.c
index 49c58d1..fc6a513 100644
--- a/hw/xtensa/xtensa_lx60.c
+++ b/hw/xtensa/xtensa_lx60.c
@@ -42,6 +42,7 @@
 typedef struct LxBoardDesc {
     hwaddr flash_base;
     size_t flash_size;
+    size_t flash_boot_base;
     size_t flash_sector_size;
     size_t sram_size;
 } LxBoardDesc;
@@ -266,9 +267,9 @@ static void lx_init(const LxBoardDesc *board, QEMUMachineInitArgs *args)
             MemoryRegion *flash_io = g_malloc(sizeof(*flash_io));
 
             memory_region_init_alias(flash_io, NULL, "lx60.flash",
-                    flash_mr, 0,
-                    board->flash_size < 0x02000000 ?
-                    board->flash_size : 0x02000000);
+                    flash_mr, board->flash_boot_base,
+                    board->flash_size - board->flash_boot_base < 0x02000000 ?
+                    board->flash_size - board->flash_boot_base : 0x02000000);
             memory_region_add_subregion(system_memory, 0xfe000000,
                     flash_io);
         }
@@ -313,6 +314,7 @@ static void xtensa_kc705_init(QEMUMachineInitArgs *args)
     static const LxBoardDesc kc705_board = {
         .flash_base = 0xf0000000,
         .flash_size = 0x08000000,
+        .flash_boot_base = 0x06000000,
         .flash_sector_size = 0x20000,
         .sram_size = 0x2000000,
     };
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index d76de62..395be5b 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -144,6 +144,14 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
 void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns);
 
 /**
+ * block_job_yield:
+ * @job: The job that calls the function.
+ *
+ * Yield the block job coroutine.
+ */
+void block_job_yield(BlockJob *job);
+
+/**
  * block_job_completed:
  * @job: The job being completed.
  * @ret: The status code.
diff --git a/include/hw/i386/smbios.h b/include/hw/i386/smbios.h
index 18fb970..f808199 100644
--- a/include/hw/i386/smbios.h
+++ b/include/hw/i386/smbios.h
@@ -16,9 +16,9 @@
 #include "qemu/option.h"
 
 void smbios_entry_add(QemuOpts *opts);
-void smbios_set_type1_defaults(const char *manufacturer,
-                               const char *product, const char *version);
-uint8_t *smbios_get_table(size_t *length);
+void smbios_set_defaults(const char *manufacturer, const char *product,
+                         const char *version);
+uint8_t *smbios_get_table_legacy(size_t *length);
 
 /*
  * SMBIOS spec defined tables
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index df60f16..4b32440 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -176,8 +176,8 @@ typedef struct VirtIONet {
     uint8_t nobcast;
     uint8_t vhost_started;
     struct {
-        int in_use;
-        int first_multi;
+        uint32_t in_use;
+        uint32_t first_multi;
         uint8_t multi_overflow;
         uint8_t uni_overflow;
         uint8_t *macs;
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index 42b1024..e81a643 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -186,7 +186,12 @@ typedef struct {
     DEFINE_PROP_BIT("param_change", _state, _feature_field,                    \
                                             VIRTIO_SCSI_F_CHANGE, true)
 
-void virtio_scsi_common_realize(DeviceState *dev, Error **errp);
+typedef void (*HandleOutput)(VirtIODevice *, VirtQueue *);
+
+void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
+                                HandleOutput ctrl, HandleOutput evt,
+                                HandleOutput cmd);
+
 void virtio_scsi_common_unrealize(DeviceState *dev, Error **errp);
 
 #endif /* _QEMU_VIRTIO_SCSI_H */
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index e7e1705..5b71370 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -100,6 +100,7 @@ enum VMStateFlags {
     VMS_MULTIPLY         = 0x200,  /* multiply "size" field by field_size */
     VMS_VARRAY_UINT8     = 0x400,  /* Array with size in uint8_t field*/
     VMS_VARRAY_UINT32    = 0x800,  /* Array with size in uint32_t field*/
+    VMS_MUST_EXIST       = 0x1000, /* Field must exist in input */
 };
 
 typedef struct {
@@ -203,6 +204,14 @@ extern const VMStateInfo vmstate_info_bitmap;
     .offset       = vmstate_offset_value(_state, _field, _type),     \
 }
 
+/* Validate state using a boolean predicate. */
+#define VMSTATE_VALIDATE(_name, _test) { \
+    .name         = (_name),                                         \
+    .field_exists = (_test),                                         \
+    .flags        = VMS_ARRAY | VMS_MUST_EXIST,                      \
+    .num          = 0, /* 0 elements: no data, only run _test */     \
+}
+
 #define VMSTATE_POINTER(_field, _state, _version, _info, _type) {    \
     .name       = (stringify(_field)),                               \
     .version_id = (_version),                                        \
diff --git a/kvm-all.c b/kvm-all.c
index 82a9119..2754c15 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -948,7 +948,7 @@ void kvm_init_irq_routing(KVMState *s)
 {
     int gsi_count, i;
 
-    gsi_count = kvm_check_extension(s, KVM_CAP_IRQ_ROUTING);
+    gsi_count = kvm_check_extension(s, KVM_CAP_IRQ_ROUTING) - 1;
     if (gsi_count > 0) {
         unsigned int gsi_bits, i;
 
@@ -2022,12 +2022,13 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
 {
     struct kvm_sw_breakpoint *bp, *next;
     KVMState *s = cpu->kvm_state;
+    CPUState *tmpcpu;
 
     QTAILQ_FOREACH_SAFE(bp, &s->kvm_sw_breakpoints, entry, next) {
         if (kvm_arch_remove_sw_breakpoint(cpu, bp) != 0) {
             /* Try harder to find a CPU that currently sees the breakpoint. */
-            CPU_FOREACH(cpu) {
-                if (kvm_arch_remove_sw_breakpoint(cpu, bp) == 0) {
+            CPU_FOREACH(tmpcpu) {
+                if (kvm_arch_remove_sw_breakpoint(tmpcpu, bp) == 0) {
                     break;
                 }
             }
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index d2380b6..e1ff346 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -267,17 +267,15 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
 
 #ifdef TARGET_ARM
 
+#ifndef TARGET_AARCH64
+/* 32 bit ARM definitions */
+
 #define ELF_START_MMAP 0x80000000
 
 #define elf_check_arch(x) ((x) == ELF_MACHINE)
 
 #define ELF_ARCH        ELF_MACHINE
-
-#ifdef TARGET_AARCH64
-#define ELF_CLASS       ELFCLASS64
-#else
 #define ELF_CLASS       ELFCLASS32
-#endif
 
 static inline void init_thread(struct target_pt_regs *regs,
                                struct image_info *infop)
@@ -285,10 +283,6 @@ static inline void init_thread(struct target_pt_regs *regs,
     abi_long stack = infop->start_stack;
     memset(regs, 0, sizeof(*regs));
 
-#ifdef TARGET_AARCH64
-    regs->pc = infop->entry & ~0x3ULL;
-    regs->sp = stack;
-#else
     regs->ARM_cpsr = 0x10;
     if (infop->entry & 1)
         regs->ARM_cpsr |= CPSR_T;
@@ -302,7 +296,6 @@ static inline void init_thread(struct target_pt_regs *regs,
     /* For uClinux PIC binaries.  */
     /* XXX: Linux does this only on ARM with no MMU (do we care ?) */
     regs->ARM_r10 = infop->start_data;
-#endif
 }
 
 #define ELF_NREG    18
@@ -346,13 +339,20 @@ enum
     ARM_HWCAP_ARM_EDSP      = 1 << 7,
     ARM_HWCAP_ARM_JAVA      = 1 << 8,
     ARM_HWCAP_ARM_IWMMXT    = 1 << 9,
-    ARM_HWCAP_ARM_THUMBEE   = 1 << 10,
-    ARM_HWCAP_ARM_NEON      = 1 << 11,
-    ARM_HWCAP_ARM_VFPv3     = 1 << 12,
-    ARM_HWCAP_ARM_VFPv3D16  = 1 << 13,
+    ARM_HWCAP_ARM_CRUNCH    = 1 << 10,
+    ARM_HWCAP_ARM_THUMBEE   = 1 << 11,
+    ARM_HWCAP_ARM_NEON      = 1 << 12,
+    ARM_HWCAP_ARM_VFPv3     = 1 << 13,
+    ARM_HWCAP_ARM_VFPv3D16  = 1 << 14,
+    ARM_HWCAP_ARM_TLS       = 1 << 15,
+    ARM_HWCAP_ARM_VFPv4     = 1 << 16,
+    ARM_HWCAP_ARM_IDIVA     = 1 << 17,
+    ARM_HWCAP_ARM_IDIVT     = 1 << 18,
+    ARM_HWCAP_ARM_VFPD32    = 1 << 19,
+    ARM_HWCAP_ARM_LPAE      = 1 << 20,
+    ARM_HWCAP_ARM_EVTSTRM   = 1 << 21,
 };
 
-#ifndef TARGET_AARCH64
 /* The commpage only exists for 32 bit kernels */
 
 #define TARGET_HAS_VALIDATE_GUEST_SPACE
@@ -414,7 +414,6 @@ static int validate_guest_space(unsigned long guest_base,
 
     return 1; /* All good */
 }
-#endif
 
 #define ELF_HWCAP get_elf_hwcap()
 
@@ -427,23 +426,103 @@ static uint32_t get_elf_hwcap(void)
     hwcaps |= ARM_HWCAP_ARM_HALF;
     hwcaps |= ARM_HWCAP_ARM_THUMB;
     hwcaps |= ARM_HWCAP_ARM_FAST_MULT;
-    hwcaps |= ARM_HWCAP_ARM_FPA;
 
     /* probe for the extra features */
 #define GET_FEATURE(feat, hwcap) \
     do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0)
+    /* EDSP is in v5TE and above, but all our v5 CPUs are v5TE */
+    GET_FEATURE(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP);
     GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP);
     GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT);
     GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE);
     GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON);
     GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3);
-    GET_FEATURE(ARM_FEATURE_VFP_FP16, ARM_HWCAP_ARM_VFPv3D16);
+    GET_FEATURE(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS);
+    GET_FEATURE(ARM_FEATURE_VFP4, ARM_HWCAP_ARM_VFPv4);
+    GET_FEATURE(ARM_FEATURE_ARM_DIV, ARM_HWCAP_ARM_IDIVA);
+    GET_FEATURE(ARM_FEATURE_THUMB_DIV, ARM_HWCAP_ARM_IDIVT);
+    /* All QEMU's VFPv3 CPUs have 32 registers, see VFP_DREG in translate.c.
+     * Note that the ARM_HWCAP_ARM_VFPv3D16 bit is always the inverse of
+     * ARM_HWCAP_ARM_VFPD32 (and so always clear for QEMU); it is unrelated
+     * to our VFP_FP16 feature bit.
+     */
+    GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPD32);
+    GET_FEATURE(ARM_FEATURE_LPAE, ARM_HWCAP_ARM_LPAE);
 #undef GET_FEATURE
 
     return hwcaps;
 }
 
-#endif
+#else
+/* 64 bit ARM definitions */
+#define ELF_START_MMAP 0x80000000
+
+#define elf_check_arch(x) ((x) == ELF_MACHINE)
+
+#define ELF_ARCH        ELF_MACHINE
+#define ELF_CLASS       ELFCLASS64
+#define ELF_PLATFORM    "aarch64"
+
+static inline void init_thread(struct target_pt_regs *regs,
+                               struct image_info *infop)
+{
+    abi_long stack = infop->start_stack;
+    memset(regs, 0, sizeof(*regs));
+
+    regs->pc = infop->entry & ~0x3ULL;
+    regs->sp = stack;
+}
+
+#define ELF_NREG    34
+typedef target_elf_greg_t  target_elf_gregset_t[ELF_NREG];
+
+static void elf_core_copy_regs(target_elf_gregset_t *regs,
+                               const CPUARMState *env)
+{
+    int i;
+
+    for (i = 0; i < 32; i++) {
+        (*regs)[i] = tswapreg(env->xregs[i]);
+    }
+    (*regs)[32] = tswapreg(env->pc);
+    (*regs)[33] = tswapreg(pstate_read((CPUARMState *)env));
+}
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE       4096
+
+enum {
+    ARM_HWCAP_A64_FP            = 1 << 0,
+    ARM_HWCAP_A64_ASIMD         = 1 << 1,
+    ARM_HWCAP_A64_EVTSTRM       = 1 << 2,
+    ARM_HWCAP_A64_AES           = 1 << 3,
+    ARM_HWCAP_A64_PMULL         = 1 << 4,
+    ARM_HWCAP_A64_SHA1          = 1 << 5,
+    ARM_HWCAP_A64_SHA2          = 1 << 6,
+    ARM_HWCAP_A64_CRC32         = 1 << 7,
+};
+
+#define ELF_HWCAP get_elf_hwcap()
+
+static uint32_t get_elf_hwcap(void)
+{
+    ARMCPU *cpu = ARM_CPU(thread_cpu);
+    uint32_t hwcaps = 0;
+
+    hwcaps |= ARM_HWCAP_A64_FP;
+    hwcaps |= ARM_HWCAP_A64_ASIMD;
+
+    /* probe for the extra features */
+#define GET_FEATURE(feat, hwcap) \
+    do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0)
+    GET_FEATURE(ARM_FEATURE_V8_AES, ARM_HWCAP_A64_PMULL);
+#undef GET_FEATURE
+
+    return hwcaps;
+}
+
+#endif /* not TARGET_AARCH64 */
+#endif /* TARGET_ARM */
 
 #ifdef TARGET_UNICORE32
 
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9864813..2d28bdb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7499,6 +7499,22 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sys_sched_getaffinity(arg1, mask_size, mask));
 
             if (!is_error(ret)) {
+                if (ret > arg2) {
+                    /* More data returned than the caller's buffer will fit.
+                     * This only happens if sizeof(abi_long) < sizeof(long)
+                     * and the caller passed us a buffer holding an odd number
+                     * of abi_longs. If the host kernel is actually using the
+                     * extra 4 bytes then fail EINVAL; otherwise we can just
+                     * ignore them and only copy the interesting part.
+                     */
+                    int numcpus = sysconf(_SC_NPROCESSORS_CONF);
+                    if (numcpus > arg2 * 8) {
+                        ret = -TARGET_EINVAL;
+                        break;
+                    }
+                    ret = arg2;
+                }
+
                 if (copy_to_user(arg3, mask, ret)) {
                     goto efault;
                 }
diff --git a/migration-rdma.c b/migration-rdma.c
index eeb4302..5cd90bd 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -1589,13 +1589,11 @@ static int qemu_rdma_post_send_control(RDMAContext *rdma, uint8_t *buf,
     }
 
 
-    if (ibv_post_send(rdma->qp, &send_wr, &bad_wr)) {
-        return -1;
-    }
+    ret = ibv_post_send(rdma->qp, &send_wr, &bad_wr);
 
-    if (ret < 0) {
+    if (ret > 0) {
         fprintf(stderr, "Failed to use post IB SEND for control!\n");
-        return ret;
+        return -ret;
     }
 
     ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_SEND_CONTROL, NULL);
@@ -2237,10 +2235,6 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
         }
     }
 
-    if (rdma->qp) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 01 23:55:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Oct 2014 23:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZTjp-0000oL-UM; Wed, 01 Oct 2014 23:55:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZTjn-0000oC-RK
	for xen-changelog@lists.xensource.com; Wed, 01 Oct 2014 23:55:16 +0000
Received: from [85.158.143.35:43292] by server-2.bemta-4.messagelabs.com id
	F7/78-04525-3649C245; Wed, 01 Oct 2014 23:55:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1412207709!5249919!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12830 invoked from network); 1 Oct 2014 23:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2014 23:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZTje-0001op-0h
	for xen-changelog@lists.xensource.com; Wed, 01 Oct 2014 23:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZTjd-0007cq-Mt
	for xen-changelog@lists.xensource.com; Wed, 01 Oct 2014 23:55:05 +0000
Date: Wed, 01 Oct 2014 23:55:05 +0000
Message-Id: <E1XZTjd-0007cq-Mt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge tag 'v2.0.2' into
	master
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

=== This changeset includes merge from high-traffic branch ===
Commits on that branch are not reported individually.

commit c9d8f8b755e8960edf7725e05f3e6ac743a5e12e
Merge: ea772ca487e219e5d5b82d50da460c4145238038 f053f6b83d01b47adf3b8f29eb0c0769755d1f9c
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Sep 24 15:25:27 2014 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Wed Sep 24 15:25:27 2014 +0100

    Merge tag 'v2.0.2' into master

 VERSION                         |    2 +-
 arch_init.c                     |  110 ++++++++++++-----------
 async.c                         |   14 ++-
 block.c                         |   34 ++++---
 block/mirror.c                  |   19 +++-
 block/qapi.c                    |    1 +
 block/qcow.c                    |   44 ++++++++--
 block/qcow2.c                   |    3 +-
 block/sheepdog.c                |    4 +-
 block/vvfat.c                   |    6 +-
 blockdev-nbd.c                  |    9 ++-
 blockdev.c                      |   23 ++++-
 blockjob.c                      |   14 +++
 configure                       |    2 +-
 coroutine-win32.c               |   13 +++-
 cputlb.c                        |    6 +-
 disas/Makefile.objs             |    2 +-
 hw/arm/boot.c                   |    8 ++-
 hw/arm/omap1.c                  |   14 ++--
 hw/arm/omap2.c                  |    2 +-
 hw/arm/pxa2xx.c                 |   12 ++-
 hw/arm/spitz.c                  |    4 +-
 hw/arm/z2.c                     |    2 +-
 hw/char/cadence_uart.c          |   15 +++-
 hw/char/virtio-serial-bus.c     |   16 ++--
 hw/core/irq.c                   |    4 +-
 hw/core/qdev.c                  |   45 +++++-----
 hw/display/ssd0323.c            |   24 +++++
 hw/dma/omap_dma.c               |    4 +-
 hw/gpio/zaurus.c                |   10 ++
 hw/i386/acpi-build.c            |    7 +-
 hw/i386/kvm/pci-assign.c        |   12 ++--
 hw/i386/pc.c                    |    2 +-
 hw/i386/pc_piix.c               |   20 +++--
 hw/i386/pc_q35.c                |   12 ++--
 hw/i386/smbios.c                |   18 +++--
 hw/ide/ahci.c                   |    2 +-
 hw/ide/microdrive.c             |    2 +-
 hw/input/tsc210x.c              |   12 +++
 hw/intc/i8259.c                 |    4 +-
 hw/intc/openpic.c               |   16 +++-
 hw/misc/cbus.c                  |    6 +-
 hw/misc/imx_ccm.c               |    1 +
 hw/net/stellaris_enet.c         |   23 ++++--
 hw/net/virtio-net.c             |   37 +++++++-
 hw/pci/pci.c                    |    2 +-
 hw/pci/pcie_aer.c               |   10 ++-
 hw/pcmcia/pxa2xx.c              |    2 +-
 hw/ppc/spapr_pci.c              |   15 +++
 hw/s390x/css.c                  |   24 ++++-
 hw/scsi/megasas.c               |   17 ++++
 hw/scsi/mfi.h                   |    9 ++
 hw/scsi/scsi-disk.c             |    2 +-
 hw/scsi/vhost-scsi.c            |    8 ++-
 hw/scsi/virtio-scsi.c           |   26 ++++--
 hw/sd/omap_mmc.c                |    2 +-
 hw/sd/sdhci.c                   |    8 +-
 hw/sd/ssi-sd.c                  |    9 ++
 hw/sh4/sh7750.c                 |    3 +-
 hw/ssi/pl022.c                  |   14 +++
 hw/timer/hpet.c                 |   13 +++
 hw/timer/i8254.c                |    4 +-
 hw/timer/mc146818rtc.c          |    2 +-
 hw/timer/omap_gptimer.c         |    4 +-
 hw/usb/bus.c                    |    4 +-
 hw/usb/dev-bluetooth.c          |   24 ++++--
 hw/usb/hcd-xhci.c               |    1 +
 hw/virtio/vhost.c               |   10 ++-
 hw/virtio/virtio.c              |   33 ++++++-
 hw/xtensa/xtensa_lx60.c         |    8 +-
 include/block/blockjob.h        |    8 ++
 include/hw/i386/smbios.h        |    6 +-
 include/hw/virtio/virtio-net.h  |    4 +-
 include/hw/virtio/virtio-scsi.h |    7 ++-
 include/migration/vmstate.h     |    9 ++
 kvm-all.c                       |    7 +-
 linux-user/elfload.c            |  117 ++++++++++++++++++++----
 linux-user/syscall.c            |   16 ++++
 migration-rdma.c                |   20 ++--
 migration.c                     |    2 +-
 nbd.c                           |    7 +-
 po/Makefile                     |    4 +-
 qapi-schema.json                |    7 +-
 qapi/qapi-dealloc-visitor.c     |    4 +-
 qdev-monitor.c                  |    2 +-
 qemu-img.c                      |    2 +-
 qemu-io.c                       |    2 +
 qemu-nbd.c                      |    5 +-
 qga/commands-win32.c            |    6 +-
 qmp-commands.hx                 |    5 +-
 target-arm/helper.c             |    8 +-
 target-arm/translate-a64.c      |    5 +-
 target-arm/translate.c          |   34 +++++---
 target-i386/cpu.c               |   22 +++--
 target-i386/cpu.h               |   11 ++-
 target-s390x/kvm.c              |  190 +++++++++++++++++++++++----------------
 target-xtensa/translate.c       |    4 +-
 tcg/i386/tcg-target.c           |    3 +-
 tests/qemu-iotests/040          |   38 ++++++---
 tests/qemu-iotests/040.out      |    4 +-
 tests/qemu-iotests/041          |   16 +++-
 tests/qemu-iotests/041.out      |    4 +-
 tests/qemu-iotests/092          |   98 ++++++++++++++++++++
 tests/qemu-iotests/092.out      |   38 ++++++++
 tests/qemu-iotests/group        |    1 +
 trace-events                    |    5 +
 ui/curses.c                     |    4 +-
 vmstate.c                       |  117 ++++++++++++++-----------
 108 files changed, 1248 insertions(+), 488 deletions(-)

diff --git a/VERSION b/VERSION
index 227cea2..e9307ca 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.0.0
+2.0.2
diff --git a/arch_init.c b/arch_init.c
index 60c975d..3ec70de 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -992,70 +992,68 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
 {
     ram_addr_t addr;
     int flags, ret = 0;
-    int error;
     static uint64_t seq_iter;
 
     seq_iter++;
 
-    if (version_id < 4 || version_id > 4) {
-        return -EINVAL;
+    if (version_id != 4) {
+        ret = -EINVAL;
     }
 
-    do {
+    while (!ret) {
         addr = qemu_get_be64(f);
 
         flags = addr & ~TARGET_PAGE_MASK;
         addr &= TARGET_PAGE_MASK;
 
         if (flags & RAM_SAVE_FLAG_MEM_SIZE) {
-            if (version_id == 4) {
-                /* Synchronize RAM block list */
-                char id[256];
-                ram_addr_t length;
-                ram_addr_t total_ram_bytes = addr;
-
-                while (total_ram_bytes) {
-                    RAMBlock *block;
-                    uint8_t len;
-
-                    len = qemu_get_byte(f);
-                    qemu_get_buffer(f, (uint8_t *)id, len);
-                    id[len] = 0;
-                    length = qemu_get_be64(f);
-
-                    QTAILQ_FOREACH(block, &ram_list.blocks, next) {
-                        if (!strncmp(id, block->idstr, sizeof(id))) {
-                            if (block->length != length) {
-                                fprintf(stderr,
-                                        "Length mismatch: %s: " RAM_ADDR_FMT
-                                        " in != " RAM_ADDR_FMT "\n", id, length,
-                                        block->length);
-                                ret =  -EINVAL;
-                                goto done;
-                            }
-                            break;
+            /* Synchronize RAM block list */
+            char id[256];
+            ram_addr_t length;
+            ram_addr_t total_ram_bytes = addr;
+
+            while (total_ram_bytes) {
+                RAMBlock *block;
+                uint8_t len;
+
+                len = qemu_get_byte(f);
+                qemu_get_buffer(f, (uint8_t *)id, len);
+                id[len] = 0;
+                length = qemu_get_be64(f);
+
+                QTAILQ_FOREACH(block, &ram_list.blocks, next) {
+                    if (!strncmp(id, block->idstr, sizeof(id))) {
+                        if (block->length != length) {
+                            fprintf(stderr,
+                                    "Length mismatch: %s: " RAM_ADDR_FMT
+                                    " in != " RAM_ADDR_FMT "\n", id, length,
+                                    block->length);
+                            ret =  -EINVAL;
                         }
+                        break;
                     }
+                }
 
-                    if (!block) {
-                        fprintf(stderr, "Unknown ramblock \"%s\", cannot "
-                                "accept migration\n", id);
-                        ret = -EINVAL;
-                        goto done;
-                    }
-
-                    total_ram_bytes -= length;
+                if (!block) {
+                    fprintf(stderr, "Unknown ramblock \"%s\", cannot "
+                            "accept migration\n", id);
+                    ret = -EINVAL;
+                }
+                if (ret) {
+                    break;
                 }
-            }
-        }
 
-        if (flags & RAM_SAVE_FLAG_COMPRESS) {
+                total_ram_bytes -= length;
+            }
+        } else if (flags & RAM_SAVE_FLAG_COMPRESS) {
             void *host;
             uint8_t ch;
 
             host = host_from_stream_offset(f, addr, flags);
             if (!host) {
-                return -EINVAL;
+                error_report("Illegal RAM offset " RAM_ADDR_FMT, addr);
+                ret = -EINVAL;
+                break;
             }
 
             ch = qemu_get_byte(f);
@@ -1065,31 +1063,39 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
 
             host = host_from_stream_offset(f, addr, flags);
             if (!host) {
-                return -EINVAL;
+                error_report("Illegal RAM offset " RAM_ADDR_FMT, addr);
+                ret = -EINVAL;
+                break;
             }
 
             qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
         } else if (flags & RAM_SAVE_FLAG_XBZRLE) {
             void *host = host_from_stream_offset(f, addr, flags);
             if (!host) {
-                return -EINVAL;
+                error_report("Illegal RAM offset " RAM_ADDR_FMT, addr);
+                ret = -EINVAL;
+                break;
             }
 
             if (load_xbzrle(f, addr, host) < 0) {
+                error_report("Failed to decompress XBZRLE page at "
+                             RAM_ADDR_FMT, addr);
                 ret = -EINVAL;
-                goto done;
+                break;
             }
         } else if (flags & RAM_SAVE_FLAG_HOOK) {
             ram_control_load_hook(f, flags);
+        } else if (flags & RAM_SAVE_FLAG_EOS) {
+            /* normal exit */
+            break;
+        } else {
+            error_report("Unknown migration flags: %#x", flags);
+            ret = -EINVAL;
+            break;
         }
-        error = qemu_file_get_error(f);
-        if (error) {
-            ret = error;
-            goto done;
-        }
-    } while (!(flags & RAM_SAVE_FLAG_EOS));
+        ret = qemu_file_get_error(f);
+    }
 
-done:
     DPRINTF("Completed load of VM with exit code %d seq iteration "
             "%" PRIu64 "\n", ret, seq_iter);
     return ret;
diff --git a/async.c b/async.c
index 6930185..5b6fe6b 100644
--- a/async.c
+++ b/async.c
@@ -117,15 +117,21 @@ void qemu_bh_schedule_idle(QEMUBH *bh)
 
 void qemu_bh_schedule(QEMUBH *bh)
 {
+    AioContext *ctx;
+
     if (bh->scheduled)
         return;
+    ctx = bh->ctx;
     bh->idle = 0;
-    /* Make sure that idle & any writes needed by the callback are done
-     * before the locations are read in the aio_bh_poll.
+    /* Make sure that:
+     * 1. idle & any writes needed by the callback are done before the
+     *    locations are read in the aio_bh_poll.
+     * 2. ctx is loaded before scheduled is set and the callback has a chance
+     *    to execute.
      */
-    smp_wmb();
+    smp_mb();
     bh->scheduled = 1;
-    aio_notify(bh->ctx);
+    aio_notify(ctx);
 }
 
 
diff --git a/block.c b/block.c
index 990a754..5448430 100644
--- a/block.c
+++ b/block.c
@@ -1058,14 +1058,14 @@ fail:
  */
 int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
 {
-    char backing_filename[PATH_MAX];
-    int back_flags, ret;
+    char *backing_filename = g_malloc0(PATH_MAX);
+    int back_flags, ret = 0;
     BlockDriver *back_drv = NULL;
     Error *local_err = NULL;
 
     if (bs->backing_hd != NULL) {
         QDECREF(options);
-        return 0;
+        goto free_exit;
     }
 
     /* NULL means an empty set of options */
@@ -1078,10 +1078,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
         backing_filename[0] = '\0';
     } else if (bs->backing_file[0] == '\0' && qdict_size(options) == 0) {
         QDECREF(options);
-        return 0;
+        goto free_exit;
     } else {
-        bdrv_get_full_backing_filename(bs, backing_filename,
-                                       sizeof(backing_filename));
+        bdrv_get_full_backing_filename(bs, backing_filename, PATH_MAX);
     }
 
     if (bs->backing_format[0] != '\0') {
@@ -1102,7 +1101,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
         error_setg(errp, "Could not open backing file: %s",
                    error_get_pretty(local_err));
         error_free(local_err);
-        return ret;
+        goto free_exit;
     }
 
     if (bs->backing_hd->file) {
@@ -1113,7 +1112,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
     /* Recalculate the BlockLimits with the backing file */
     bdrv_refresh_limits(bs);
 
-    return 0;
+free_exit:
+    g_free(backing_filename);
+    return ret;
 }
 
 /*
@@ -1157,6 +1158,7 @@ int bdrv_open_image(BlockDriverState **pbs, const char *filename,
                        bdref_key);
             ret = -EINVAL;
         }
+        QDECREF(image_options);
         goto done;
     }
 
@@ -1170,8 +1172,7 @@ done:
 void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
 {
     /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
-    char tmp_filename[PATH_MAX + 1];
-
+    char *tmp_filename = g_malloc0(PATH_MAX + 1);
     int64_t total_size;
     BlockDriver *bdrv_qcow2;
     QEMUOptionParameter *create_options;
@@ -1187,15 +1188,15 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
     total_size = bdrv_getlength(bs);
     if (total_size < 0) {
         error_setg_errno(errp, -total_size, "Could not get image size");
-        return;
+        goto out;
     }
     total_size &= BDRV_SECTOR_MASK;
 
     /* Create the temporary image */
-    ret = get_tmp_filename(tmp_filename, sizeof(tmp_filename));
+    ret = get_tmp_filename(tmp_filename, PATH_MAX + 1);
     if (ret < 0) {
         error_setg_errno(errp, -ret, "Could not get temporary filename");
-        return;
+        goto out;
     }
 
     bdrv_qcow2 = bdrv_find_format("qcow2");
@@ -1211,7 +1212,7 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
                          "'%s': %s", tmp_filename,
                          error_get_pretty(local_err));
         error_free(local_err);
-        return;
+        goto out;
     }
 
     /* Prepare a new options QDict for the temporary file */
@@ -1228,10 +1229,13 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp)
                     bs->open_flags & ~BDRV_O_SNAPSHOT, bdrv_qcow2, &local_err);
     if (ret < 0) {
         error_propagate(errp, local_err);
-        return;
+        goto out;
     }
 
     bdrv_append(bs_snapshot, bs);
+
+out:
+    g_free(tmp_filename);
 }
 
 /*
diff --git a/block/mirror.c b/block/mirror.c
index 0ef41f9..6e502e3 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -259,9 +259,11 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
     next_sector = sector_num;
     while (nb_chunks-- > 0) {
         MirrorBuffer *buf = QSIMPLEQ_FIRST(&s->buf_free);
+        size_t remaining = (nb_sectors * BDRV_SECTOR_SIZE) - op->qiov.size;
+
         QSIMPLEQ_REMOVE_HEAD(&s->buf_free, next);
         s->buf_free_count--;
-        qemu_iovec_add(&op->qiov, buf, s->granularity);
+        qemu_iovec_add(&op->qiov, buf, MIN(s->granularity, remaining));
 
         /* Advance the HBitmapIter in parallel, so that we do not examine
          * the same sector twice.
@@ -324,9 +326,18 @@ static void coroutine_fn mirror_run(void *opaque)
     }
 
     s->common.len = bdrv_getlength(bs);
-    if (s->common.len <= 0) {
-        block_job_completed(&s->common, s->common.len);
-        return;
+    if (s->common.len < 0) {
+        ret = s->common.len;
+        goto immediate_exit;
+    } else if (s->common.len == 0) {
+        /* Report BLOCK_JOB_READY and wait for complete. */
+        block_job_ready(&s->common);
+        s->synced = true;
+        while (!block_job_is_cancelled(&s->common) && !s->should_complete) {
+            block_job_yield(&s->common);
+        }
+        s->common.cancelled = false;
+        goto immediate_exit;
     }
 
     length = (bdrv_getlength(bs) + s->granularity - 1) / s->granularity;
diff --git a/block/qapi.c b/block/qapi.c
index 8f2b4db..a69c00d 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -474,6 +474,7 @@ static void dump_qobject(fprintf_function func_fprintf, void *f,
         case QTYPE_QERROR: {
             QString *value = qerror_human((QError *)obj);
             func_fprintf(f, "%s", qstring_get_str(value));
+            QDECREF(value);
             break;
         }
         case QTYPE_NONE:
diff --git a/block/qcow.c b/block/qcow.c
index d5a7d5f..c0a3b89 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -48,9 +48,10 @@ typedef struct QCowHeader {
     uint64_t size; /* in bytes */
     uint8_t cluster_bits;
     uint8_t l2_bits;
+    uint16_t padding;
     uint32_t crypt_method;
     uint64_t l1_table_offset;
-} QCowHeader;
+} QEMU_PACKED QCowHeader;
 
 #define L2_CACHE_SIZE 16
 
@@ -60,7 +61,7 @@ typedef struct BDRVQcowState {
     int cluster_sectors;
     int l2_bits;
     int l2_size;
-    int l1_size;
+    unsigned int l1_size;
     uint64_t cluster_offset_mask;
     uint64_t l1_table_offset;
     uint64_t *l1_table;
@@ -96,7 +97,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
     BDRVQcowState *s = bs->opaque;
-    int len, i, shift, ret;
+    unsigned int len, i, shift;
+    int ret;
     QCowHeader header;
 
     ret = bdrv_pread(bs->file, 0, &header, sizeof(header));
@@ -126,11 +128,25 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
         goto fail;
     }
 
-    if (header.size <= 1 || header.cluster_bits < 9) {
-        error_setg(errp, "invalid value in qcow header");
+    if (header.size <= 1) {
+        error_setg(errp, "Image size is too small (must be at least 2 bytes)");
+        ret = -EINVAL;
+        goto fail;
+    }
+    if (header.cluster_bits < 9 || header.cluster_bits > 16) {
+        error_setg(errp, "Cluster size must be between 512 and 64k");
+        ret = -EINVAL;
+        goto fail;
+    }
+
+    /* l2_bits specifies number of entries; storing a uint64_t in each entry,
+     * so bytes = num_entries << 3. */
+    if (header.l2_bits < 9 - 3 || header.l2_bits > 16 - 3) {
+        error_setg(errp, "L2 table size must be between 512 and 64k");
         ret = -EINVAL;
         goto fail;
     }
+
     if (header.crypt_method > QCOW_CRYPT_AES) {
         error_setg(errp, "invalid encryption method in qcow header");
         ret = -EINVAL;
@@ -150,7 +166,19 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
 
     /* read the level 1 table */
     shift = s->cluster_bits + s->l2_bits;
-    s->l1_size = (header.size + (1LL << shift) - 1) >> shift;
+    if (header.size > UINT64_MAX - (1LL << shift)) {
+        error_setg(errp, "Image too large");
+        ret = -EINVAL;
+        goto fail;
+    } else {
+        uint64_t l1_size = (header.size + (1LL << shift) - 1) >> shift;
+        if (l1_size > INT_MAX / sizeof(uint64_t)) {
+            error_setg(errp, "Image too large");
+            ret = -EINVAL;
+            goto fail;
+        }
+        s->l1_size = l1_size;
+    }
 
     s->l1_table_offset = header.l1_table_offset;
     s->l1_table = g_malloc(s->l1_size * sizeof(uint64_t));
@@ -174,7 +202,9 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     if (header.backing_file_offset != 0) {
         len = header.backing_file_size;
         if (len > 1023) {
-            len = 1023;
+            error_setg(errp, "Backing file name too long");
+            ret = -EINVAL;
+            goto fail;
         }
         ret = bdrv_pread(bs->file, header.backing_file_offset,
                    bs->backing_file, len);
diff --git a/block/qcow2.c b/block/qcow2.c
index e903d97..57c353d 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1306,6 +1306,7 @@ static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp)
     options = qdict_clone_shallow(bs->options);
 
     ret = qcow2_open(bs, options, flags, &local_err);
+    QDECREF(options);
     if (local_err) {
         error_setg(errp, "Could not reopen qcow2 layer: %s",
                    error_get_pretty(local_err));
@@ -1316,8 +1317,6 @@ static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp)
         return;
     }
 
-    QDECREF(options);
-
     if (crypt_method) {
         s->crypt_method = crypt_method;
         memcpy(&s->aes_encrypt_key, &aes_encrypt_key, sizeof(aes_encrypt_key));
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 0eb33ee..7dcebce 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2149,6 +2149,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
     strncpy(s->inode.tag, sn_info->name, sizeof(s->inode.tag));
     /* we don't need to update entire object */
     datalen = SD_INODE_SIZE - sizeof(s->inode.data_vdi_id);
+    inode = g_malloc(datalen);
 
     /* refresh inode. */
     fd = connect_to_sdog(s);
@@ -2171,8 +2172,6 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
         goto cleanup;
     }
 
-    inode = (SheepdogInode *)g_malloc(datalen);
-
     ret = read_object(fd, (char *)inode, vid_to_vdi_oid(new_vid),
                       s->inode.nr_copies, datalen, 0, s->cache_flags);
 
@@ -2186,6 +2185,7 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
             s->inode.name, s->inode.snap_id, s->inode.vdi_id);
 
 cleanup:
+    g_free(inode);
     closesocket(fd);
     return ret;
 }
diff --git a/block/vvfat.c b/block/vvfat.c
index 1978c9e..91c63f7 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -787,7 +787,9 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
 	    s->current_mapping->path=buffer;
 	    s->current_mapping->read_only =
 		(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
-	}
+        } else {
+            g_free(buffer);
+        }
     }
     closedir(dir);
 
@@ -1864,7 +1866,7 @@ static int check_directory_consistency(BDRVVVFATState *s,
 
 	if (s->used_clusters[cluster_num] & USED_ANY) {
 	    fprintf(stderr, "cluster %d used more than once\n", (int)cluster_num);
-	    return 0;
+            goto fail;
 	}
 	s->used_clusters[cluster_num] = USED_DIRECTORY;
 
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index 922cf56..b3a2474 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -27,8 +27,9 @@ static void nbd_accept(void *opaque)
     socklen_t addr_len = sizeof(addr);
 
     int fd = accept(server_fd, (struct sockaddr *)&addr, &addr_len);
-    if (fd >= 0) {
-        nbd_client_new(NULL, fd, nbd_client_put);
+    if (fd >= 0 && !nbd_client_new(NULL, fd, nbd_client_put)) {
+        shutdown(fd, 2);
+        close(fd);
     }
 }
 
@@ -91,6 +92,10 @@ void qmp_nbd_server_add(const char *device, bool has_writable, bool writable,
         error_set(errp, QERR_DEVICE_NOT_FOUND, device);
         return;
     }
+    if (!bdrv_is_inserted(bs)) {
+        error_set(errp, QERR_DEVICE_HAS_NO_MEDIUM, device);
+        return;
+    }
 
     if (!has_writable) {
         writable = false;
diff --git a/blockdev.c b/blockdev.c
index 5dd01ea..4d98224 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -332,7 +332,7 @@ static DriveInfo *blockdev_init(const char *file, QDict *bs_opts,
     opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, &error);
     if (error) {
         error_propagate(errp, error);
-        return NULL;
+        goto err_no_opts;
     }
 
     qemu_opts_absorb_qdict(opts, bs_opts, &error);
@@ -527,8 +527,9 @@ err:
     QTAILQ_REMOVE(&drives, dinfo, next);
     g_free(dinfo);
 early_err:
-    QDECREF(bs_opts);
     qemu_opts_del(opts);
+err_no_opts:
+    QDECREF(bs_opts);
     return NULL;
 }
 
@@ -902,6 +903,7 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type)
 
     /* Actual block device init: Functionality shared with blockdev-add */
     dinfo = blockdev_init(filename, bs_opts, &local_err);
+    bs_opts = NULL;
     if (dinfo == NULL) {
         if (local_err) {
             qerror_report_err(local_err);
@@ -939,6 +941,7 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type)
 
 fail:
     qemu_opts_del(legacy_opts);
+    QDECREF(bs_opts);
     return dinfo;
 }
 
@@ -1864,7 +1867,8 @@ void qmp_block_stream(const char *device, bool has_base,
 }
 
 void qmp_block_commit(const char *device,
-                      bool has_base, const char *base, const char *top,
+                      bool has_base, const char *base,
+                      bool has_top, const char *top,
                       bool has_speed, int64_t speed,
                       Error **errp)
 {
@@ -1883,6 +1887,11 @@ void qmp_block_commit(const char *device,
     /* drain all i/o before commits */
     bdrv_drain_all();
 
+    /* Important Note:
+     *  libvirt relies on the DeviceNotFound error class in order to probe for
+     *  live commit feature versions; for this to work, we must make sure to
+     *  perform the device lookup before any generic errors that may occur in a
+     *  scenario in which all optional arguments are omitted. */
     bs = bdrv_find(device);
     if (!bs) {
         error_set(errp, QERR_DEVICE_NOT_FOUND, device);
@@ -1892,7 +1901,7 @@ void qmp_block_commit(const char *device,
     /* default top_bs is the active layer */
     top_bs = bs;
 
-    if (top) {
+    if (has_top && top) {
         if (strcmp(bs->filename, top) != 0) {
             top_bs = bdrv_find_backing_image(bs, top);
         }
@@ -1914,6 +1923,12 @@ void qmp_block_commit(const char *device,
         return;
     }
 
+    /* Do not allow attempts to commit an image into itself */
+    if (top_bs == base_bs) {
+        error_setg(errp, "cannot commit an image into itself");
+        return;
+    }
+
     if (top_bs == bs) {
         commit_active_start(bs, base_bs, speed, on_error, block_job_cb,
                             bs, &local_err);
diff --git a/blockjob.c b/blockjob.c
index b3ce14c..bf10f82 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -206,6 +206,20 @@ void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns)
     job->busy = true;
 }
 
+void block_job_yield(BlockJob *job)
+{
+    assert(job->busy);
+
+    /* Check cancellation *before* setting busy = false, too!  */
+    if (block_job_is_cancelled(job)) {
+        return;
+    }
+
+    job->busy = false;
+    qemu_coroutine_yield();
+    job->busy = true;
+}
+
 BlockJobInfo *block_job_query(BlockJob *job)
 {
     BlockJobInfo *info = g_new0(BlockJobInfo, 1);
diff --git a/configure b/configure
index 69b9f56..ffce604 100755
--- a/configure
+++ b/configure
@@ -2624,7 +2624,7 @@ done
 if test "$modules" = yes; then
     shacmd_probe="sha1sum sha1 shasum"
     for c in $shacmd_probe; do
-        if which $c &>/dev/null; then
+        if which $c >/dev/null 2>&1; then
             shacmd="$c"
             break
         fi
diff --git a/coroutine-win32.c b/coroutine-win32.c
index edc1f72..17ace37 100644
--- a/coroutine-win32.c
+++ b/coroutine-win32.c
@@ -36,8 +36,17 @@ typedef struct
 static __thread CoroutineWin32 leader;
 static __thread Coroutine *current;
 
-CoroutineAction qemu_coroutine_switch(Coroutine *from_, Coroutine *to_,
-                                      CoroutineAction action)
+/* This function is marked noinline to prevent GCC from inlining it
+ * into coroutine_trampoline(). If we allow it to do that then it
+ * hoists the code to get the address of the TLS variable "current"
+ * out of the while() loop. This is an invalid transformation because
+ * the SwitchToFiber() call may be called when running thread A but
+ * return in thread B, and so we might be in a different thread
+ * context each time round the loop.
+ */
+CoroutineAction __attribute__((noinline))
+qemu_coroutine_switch(Coroutine *from_, Coroutine *to_,
+                      CoroutineAction action)
 {
     CoroutineWin32 *from = DO_UPCAST(CoroutineWin32, base, from_);
     CoroutineWin32 *to = DO_UPCAST(CoroutineWin32, base, to_);
diff --git a/cputlb.c b/cputlb.c
index 7bd3573..214c945 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -331,8 +331,10 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr)
 }
 
 #define MMUSUFFIX _cmmu
-#undef GETPC
-#define GETPC() ((uintptr_t)0)
+#undef GETPC_ADJ
+#define GETPC_ADJ 0
+#undef GETRA
+#define GETRA() ((uintptr_t)0)
 #define SOFTMMU_CODE_ACCESS
 
 #define SHIFT 0
diff --git a/disas/Makefile.objs b/disas/Makefile.objs
index 41c2374..a70c592 100644
--- a/disas/Makefile.objs
+++ b/disas/Makefile.objs
@@ -4,7 +4,7 @@ common-obj-$(CONFIG_ARM_DIS) += arm.o
 common-obj-$(CONFIG_ARM_A64_DIS) += arm-a64.o
 common-obj-$(CONFIG_ARM_A64_DIS) += libvixl/
 libvixldir = $(SRC_PATH)/disas/libvixl
-$(obj)/arm-a64.o: QEMU_CFLAGS += -I$(libvixldir)
+$(obj)/arm-a64.o: QEMU_CFLAGS := -I$(libvixldir) $(QEMU_CFLAGS)
 common-obj-$(CONFIG_CRIS_DIS) += cris.o
 common-obj-$(CONFIG_HPPA_DIS) += hppa.o
 common-obj-$(CONFIG_I386_DIS) += i386.o
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 3d1f4a2..1241761 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -417,8 +417,12 @@ static void do_cpu_reset(void *opaque)
     if (info) {
         if (!info->is_linux) {
             /* Jump to the entry point.  */
-            env->regs[15] = info->entry & 0xfffffffe;
-            env->thumb = info->entry & 1;
+            if (env->aarch64) {
+                env->pc = info->entry;
+            } else {
+                env->regs[15] = info->entry & 0xfffffffe;
+                env->thumb = info->entry & 1;
+            }
         } else {
             if (CPU(cpu) == first_cpu) {
                 if (env->aarch64) {
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index b433748..9f5d159 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -172,7 +172,7 @@ static void omap_timer_clk_update(void *opaque, int line, int on)
 static void omap_timer_clk_setup(struct omap_mpu_timer_s *timer)
 {
     omap_clk_adduser(timer->clk,
-                    qemu_allocate_irqs(omap_timer_clk_update, timer, 1)[0]);
+                    qemu_allocate_irq(omap_timer_clk_update, timer, 0));
     timer->rate = omap_clk_getrate(timer->clk);
 }
 
@@ -2098,7 +2098,7 @@ static struct omap_mpuio_s *omap_mpuio_init(MemoryRegion *memory,
                           "omap-mpuio", 0x800);
     memory_region_add_subregion(memory, base, &s->iomem);
 
-    omap_clk_adduser(clk, qemu_allocate_irqs(omap_mpuio_onoff, s, 1)[0]);
+    omap_clk_adduser(clk, qemu_allocate_irq(omap_mpuio_onoff, s, 0));
 
     return s;
 }
@@ -2401,7 +2401,7 @@ static struct omap_pwl_s *omap_pwl_init(MemoryRegion *system_memory,
                           "omap-pwl", 0x800);
     memory_region_add_subregion(system_memory, base, &s->iomem);
 
-    omap_clk_adduser(clk, qemu_allocate_irqs(omap_pwl_clk_update, s, 1)[0]);
+    omap_clk_adduser(clk, qemu_allocate_irq(omap_pwl_clk_update, s, 0));
     return s;
 }
 
@@ -3485,8 +3485,8 @@ static void omap_mcbsp_i2s_start(void *opaque, int line, int level)
 void omap_mcbsp_i2s_attach(struct omap_mcbsp_s *s, I2SCodec *slave)
 {
     s->codec = slave;
-    slave->rx_swallow = qemu_allocate_irqs(omap_mcbsp_i2s_swallow, s, 1)[0];
-    slave->tx_start = qemu_allocate_irqs(omap_mcbsp_i2s_start, s, 1)[0];
+    slave->rx_swallow = qemu_allocate_irq(omap_mcbsp_i2s_swallow, s, 0);
+    slave->tx_start = qemu_allocate_irq(omap_mcbsp_i2s_start, s, 0);
 }
 
 /* LED Pulse Generators */
@@ -3634,7 +3634,7 @@ static struct omap_lpg_s *omap_lpg_init(MemoryRegion *system_memory,
     memory_region_init_io(&s->iomem, NULL, &omap_lpg_ops, s, "omap-lpg", 0x800);
     memory_region_add_subregion(system_memory, base, &s->iomem);
 
-    omap_clk_adduser(clk, qemu_allocate_irqs(omap_lpg_clk_update, s, 1)[0]);
+    omap_clk_adduser(clk, qemu_allocate_irq(omap_lpg_clk_update, s, 0));
 
     return s;
 }
@@ -3848,7 +3848,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory,
     s->sdram_size = sdram_size;
     s->sram_size = OMAP15XX_SRAM_SIZE;
 
-    s->wakeup = qemu_allocate_irqs(omap_mpu_wakeup, s, 1)[0];
+    s->wakeup = qemu_allocate_irq(omap_mpu_wakeup, s, 0);
 
     /* Clocks */
     omap_clk_init(s);
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index 36efde0..dc53a7a 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -2260,7 +2260,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem,
     s->sdram_size = sdram_size;
     s->sram_size = OMAP242X_SRAM_SIZE;
 
-    s->wakeup = qemu_allocate_irqs(omap_mpu_wakeup, s, 1)[0];
+    s->wakeup = qemu_allocate_irq(omap_mpu_wakeup, s, 0);
 
     /* Clocks */
     omap_clk_init(s);
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index 0429148..c652147 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -732,7 +732,7 @@ static void pxa2xx_ssp_save(QEMUFile *f, void *opaque)
 static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id)
 {
     PXA2xxSSPState *s = (PXA2xxSSPState *) opaque;
-    int i;
+    int i, v;
 
     s->enable = qemu_get_be32(f);
 
@@ -746,7 +746,11 @@ static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id)
     qemu_get_8s(f, &s->ssrsa);
     qemu_get_8s(f, &s->ssacd);
 
-    s->rx_level = qemu_get_byte(f);
+    v = qemu_get_byte(f);
+    if (v < 0 || v > ARRAY_SIZE(s->rx_fifo)) {
+        return -EINVAL;
+    }
+    s->rx_level = v;
     s->rx_start = 0;
     for (i = 0; i < s->rx_level; i ++)
         s->rx_fifo[i] = qemu_get_byte(f);
@@ -2055,7 +2059,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
         fprintf(stderr, "Unable to find CPU definition\n");
         exit(1);
     }
-    s->reset = qemu_allocate_irqs(pxa2xx_reset, s, 1)[0];
+    s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0);
 
     /* SDRAM & Internal Memory Storage */
     memory_region_init_ram(&s->sdram, NULL, "pxa270.sdram", sdram_size);
@@ -2186,7 +2190,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size)
         fprintf(stderr, "Unable to find CPU definition\n");
         exit(1);
     }
-    s->reset = qemu_allocate_irqs(pxa2xx_reset, s, 1)[0];
+    s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0);
 
     /* SDRAM & Internal Memory Storage */
     memory_region_init_ram(&s->sdram, NULL, "pxa255.sdram", sdram_size);
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 392ca84..713d021 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -744,7 +744,7 @@ static void spitz_i2c_setup(PXA2xxState *cpu)
 
     spitz_wm8750_addr(wm, 0, 0);
     qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_WM,
-                    qemu_allocate_irqs(spitz_wm8750_addr, wm, 1)[0]);
+                          qemu_allocate_irq(spitz_wm8750_addr, wm, 0));
     /* .. and to the sound interface.  */
     cpu->i2s->opaque = wm;
     cpu->i2s->codec_out = wm8750_dac_dat;
@@ -850,7 +850,7 @@ static void spitz_gpio_setup(PXA2xxState *cpu, int slots)
      * wouldn't guarantee that a guest ever exits the loop.
      */
     spitz_hsync = 0;
-    lcd_hsync = qemu_allocate_irqs(spitz_lcd_hsync_handler, cpu, 1)[0];
+    lcd_hsync = qemu_allocate_irq(spitz_lcd_hsync_handler, cpu, 0);
     pxa2xx_gpio_read_notifier(cpu->gpio, lcd_hsync);
     pxa2xx_lcd_vsync_notifier(cpu->lcd, lcd_hsync);
 
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 67c1be8..ef5424d 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -365,7 +365,7 @@ static void z2_init(QEMUMachineInitArgs *args)
     wm8750_data_req_set(wm, mpu->i2s->data_req, mpu->i2s);
 
     qdev_connect_gpio_out(mpu->gpio, Z2_GPIO_LCD_CS,
-        qemu_allocate_irqs(z2_lcd_cs, z2_lcd, 1)[0]);
+                          qemu_allocate_irq(z2_lcd_cs, z2_lcd, 0));
 
     z2_binfo.kernel_filename = kernel_filename;
     z2_binfo.kernel_cmdline = kernel_cmdline;
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 1f3d162..ce20e1a 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -175,8 +175,10 @@ static void uart_send_breaks(UartState *s)
 {
     int break_enabled = 1;
 
-    qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_BREAK,
-                               &break_enabled);
+    if (s->chr) {
+        qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_BREAK,
+                                   &break_enabled);
+    }
 }
 
 static void uart_parameters_setup(UartState *s)
@@ -227,7 +229,9 @@ static void uart_parameters_setup(UartState *s)
 
     packet_size += ssp.data_bits + ssp.stop_bits;
     s->char_tx_time = (get_ticks_per_sec() / ssp.speed) * packet_size;
-    qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
+    if (s->chr) {
+        qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
+    }
 }
 
 static int uart_can_receive(void *opaque)
@@ -295,6 +299,7 @@ static gboolean cadence_uart_xmit(GIOChannel *chan, GIOCondition cond,
     /* instant drain the fifo when there's no back-end */
     if (!s->chr) {
         s->tx_count = 0;
+        return FALSE;
     }
 
     if (!s->tx_count) {
@@ -375,7 +380,9 @@ static void uart_read_rx_fifo(UartState *s, uint32_t *c)
         *c = s->rx_fifo[rx_rpos];
         s->rx_count--;
 
-        qemu_chr_accept_input(s->chr);
+        if (s->chr) {
+            qemu_chr_accept_input(s->chr);
+        }
     } else {
         *c = 0;
     }
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index 2b647b6..ee1ba16 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -670,6 +670,7 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
     uint32_t max_nr_ports, nr_active_ports, ports_map;
     unsigned int i;
     int ret;
+    uint32_t tmp;
 
     if (version_id > 3) {
         return -EINVAL;
@@ -685,17 +686,12 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
         return 0;
     }
 
-    /* The config space */
-    qemu_get_be16s(f, &s->config.cols);
-    qemu_get_be16s(f, &s->config.rows);
-
-    qemu_get_be32s(f, &max_nr_ports);
-    tswap32s(&max_nr_ports);
-    if (max_nr_ports > tswap32(s->config.max_nr_ports)) {
-        /* Source could have had more ports than us. Fail migration. */
-        return -EINVAL;
-    }
+    /* Unused */
+    qemu_get_be16s(f, (uint16_t *) &tmp);
+    qemu_get_be16s(f, (uint16_t *) &tmp);
+    qemu_get_be32s(f, &tmp);
 
+    max_nr_ports = tswap32(s->config.max_nr_ports);
     for (i = 0; i < (max_nr_ports + 31) / 32; i++) {
         qemu_get_be32s(f, &ports_map);
 
diff --git a/hw/core/irq.c b/hw/core/irq.c
index 03c8cb3..3d284c6 100644
--- a/hw/core/irq.c
+++ b/hw/core/irq.c
@@ -102,7 +102,7 @@ qemu_irq qemu_irq_invert(qemu_irq irq)
 {
     /* The default state for IRQs is low, so raise the output now.  */
     qemu_irq_raise(irq);
-    return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];
+    return qemu_allocate_irq(qemu_notirq, irq, 0);
 }
 
 static void qemu_splitirq(void *opaque, int line, int level)
@@ -117,7 +117,7 @@ qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2)
     qemu_irq *s = g_malloc0(2 * sizeof(qemu_irq));
     s[0] = irq1;
     s[1] = irq2;
-    return qemu_allocate_irqs(qemu_splitirq, s, 1)[0];
+    return qemu_allocate_irq(qemu_splitirq, s, 0);
 }
 
 static void proxy_irq_handler(void *opaque, int n, int level)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 60f9df1..79db470 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -174,14 +174,14 @@ int qdev_init(DeviceState *dev)
     return 0;
 }
 
-static void device_realize(DeviceState *dev, Error **err)
+static void device_realize(DeviceState *dev, Error **errp)
 {
     DeviceClass *dc = DEVICE_GET_CLASS(dev);
 
     if (dc->init) {
         int rc = dc->init(dev);
         if (rc < 0) {
-            error_setg(err, "Device initialization failed.");
+            error_setg(errp, "Device initialization failed.");
             return;
         }
     }
@@ -504,43 +504,46 @@ static void bus_unparent(Object *obj)
     }
 }
 
-static bool bus_get_realized(Object *obj, Error **err)
+static bool bus_get_realized(Object *obj, Error **errp)
 {
     BusState *bus = BUS(obj);
 
     return bus->realized;
 }
 
-static void bus_set_realized(Object *obj, bool value, Error **err)
+static void bus_set_realized(Object *obj, bool value, Error **errp)
 {
     BusState *bus = BUS(obj);
     BusClass *bc = BUS_GET_CLASS(bus);
+    BusChild *kid;
     Error *local_err = NULL;
 
     if (value && !bus->realized) {
         if (bc->realize) {
             bc->realize(bus, &local_err);
+        }
 
+        /* TODO: recursive realization */
+    } else if (!value && bus->realized) {
+        QTAILQ_FOREACH(kid, &bus->children, sibling) {
+            DeviceState *dev = kid->child;
+            object_property_set_bool(OBJECT(dev), false, "realized",
+                                     &local_err);
             if (local_err != NULL) {
-                goto error;
+                break;
             }
-
         }
-    } else if (!value && bus->realized) {
-        if (bc->unrealize) {
+        if (bc->unrealize && local_err == NULL) {
             bc->unrealize(bus, &local_err);
-
-            if (local_err != NULL) {
-                goto error;
-            }
         }
     }
 
-    bus->realized = value;
-    return;
+    if (local_err != NULL) {
+        error_propagate(errp, local_err);
+        return;
+    }
 
-error:
-    error_propagate(err, local_err);
+    bus->realized = value;
 }
 
 void qbus_create_inplace(void *bus, size_t size, const char *typename,
@@ -724,13 +727,13 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,
     }
 }
 
-static bool device_get_realized(Object *obj, Error **err)
+static bool device_get_realized(Object *obj, Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
     return dev->realized;
 }
 
-static void device_set_realized(Object *obj, bool value, Error **err)
+static void device_set_realized(Object *obj, bool value, Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
     DeviceClass *dc = DEVICE_GET_CLASS(dev);
@@ -738,7 +741,7 @@ static void device_set_realized(Object *obj, bool value, Error **err)
     Error *local_err = NULL;
 
     if (dev->hotplugged && !dc->hotpluggable) {
-        error_set(err, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj));
+        error_set(errp, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj));
         return;
     }
 
@@ -797,14 +800,14 @@ static void device_set_realized(Object *obj, bool value, Error **err)
     }
 
     if (local_err != NULL) {
-        error_propagate(err, local_err);
+        error_propagate(errp, local_err);
         return;
     }
 
     dev->realized = value;
 }
 
-static bool device_get_hotpluggable(Object *obj, Error **err)
+static bool device_get_hotpluggable(Object *obj, Error **errp)
 {
     DeviceClass *dc = DEVICE_GET_CLASS(obj);
     DeviceState *dev = DEVICE(obj);
diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c
index 971152e..9727007 100644
--- a/hw/display/ssd0323.c
+++ b/hw/display/ssd0323.c
@@ -312,18 +312,42 @@ static int ssd0323_load(QEMUFile *f, void *opaque, int version_id)
         return -EINVAL;
 
     s->cmd_len = qemu_get_be32(f);
+    if (s->cmd_len < 0 || s->cmd_len > ARRAY_SIZE(s->cmd_data)) {
+        return -EINVAL;
+    }
     s->cmd = qemu_get_be32(f);
     for (i = 0; i < 8; i++)
         s->cmd_data[i] = qemu_get_be32(f);
     s->row = qemu_get_be32(f);
+    if (s->row < 0 || s->row >= 80) {
+        return -EINVAL;
+    }
     s->row_start = qemu_get_be32(f);
+    if (s->row_start < 0 || s->row_start >= 80) {
+        return -EINVAL;
+    }
     s->row_end = qemu_get_be32(f);
+    if (s->row_end < 0 || s->row_end >= 80) {
+        return -EINVAL;
+    }
     s->col = qemu_get_be32(f);
+    if (s->col < 0 || s->col >= 64) {
+        return -EINVAL;
+    }
     s->col_start = qemu_get_be32(f);
+    if (s->col_start < 0 || s->col_start >= 64) {
+        return -EINVAL;
+    }
     s->col_end = qemu_get_be32(f);
+    if (s->col_end < 0 || s->col_end >= 64) {
+        return -EINVAL;
+    }
     s->redraw = qemu_get_be32(f);
     s->remap = qemu_get_be32(f);
     s->mode = qemu_get_be32(f);
+    if (s->mode != SSD0323_CMD && s->mode != SSD0323_DATA) {
+        return -EINVAL;
+    }
     qemu_get_buffer(f, s->framebuffer, sizeof(s->framebuffer));
 
     ss->cs = qemu_get_be32(f);
diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c
index 0e8cccd..bb02279 100644
--- a/hw/dma/omap_dma.c
+++ b/hw/dma/omap_dma.c
@@ -1660,7 +1660,7 @@ struct soc_dma_s *omap_dma_init(hwaddr base, qemu_irq *irqs,
     }
 
     omap_dma_setcaps(s);
-    omap_clk_adduser(s->clk, qemu_allocate_irqs(omap_dma_clk_update, s, 1)[0]);
+    omap_clk_adduser(s->clk, qemu_allocate_irq(omap_dma_clk_update, s, 0));
     omap_dma_reset(s->dma);
     omap_dma_clk_update(s, 0, 1);
 
@@ -2082,7 +2082,7 @@ struct soc_dma_s *omap_dma4_init(hwaddr base, qemu_irq *irqs,
     s->intr_update = omap_dma_interrupts_4_update;
 
     omap_dma_setcaps(s);
-    omap_clk_adduser(s->clk, qemu_allocate_irqs(omap_dma_clk_update, s, 1)[0]);
+    omap_clk_adduser(s->clk, qemu_allocate_irq(omap_dma_clk_update, s, 0));
     omap_dma_reset(s->dma);
     omap_dma_clk_update(s, 0, !!s->dma->freq);
 
diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c
index dc79a8b..8e2ce04 100644
--- a/hw/gpio/zaurus.c
+++ b/hw/gpio/zaurus.c
@@ -203,6 +203,15 @@ static bool is_version_0 (void *opaque, int version_id)
     return version_id == 0;
 }
 
+static bool vmstate_scoop_validate(void *opaque, int version_id)
+{
+    ScoopInfo *s = opaque;
+
+    return !(s->prev_level & 0xffff0000) &&
+        !(s->gpio_level & 0xffff0000) &&
+        !(s->gpio_dir & 0xffff0000);
+}
+
 static const VMStateDescription vmstate_scoop_regs = {
     .name = "scoop",
     .version_id = 1,
@@ -215,6 +224,7 @@ static const VMStateDescription vmstate_scoop_regs = {
         VMSTATE_UINT32(gpio_level, ScoopInfo),
         VMSTATE_UINT32(gpio_dir, ScoopInfo),
         VMSTATE_UINT32(prev_level, ScoopInfo),
+        VMSTATE_VALIDATE("irq levels are 16 bit", vmstate_scoop_validate),
         VMSTATE_UINT16(mcr, ScoopInfo),
         VMSTATE_UINT16(cdr, ScoopInfo),
         VMSTATE_UINT16(ccr, ScoopInfo),
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index c98df88..985a188 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1410,15 +1410,16 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     /* ACPI tables pointed to by RSDT */
     acpi_add_table(table_offsets, tables->table_data);
     build_fadt(tables->table_data, tables->linker, &pm, facs, dsdt);
-    acpi_add_table(table_offsets, tables->table_data);
 
+    acpi_add_table(table_offsets, tables->table_data);
     build_ssdt(tables->table_data, tables->linker, &cpu, &pm, &misc, &pci,
                guest_info);
-    acpi_add_table(table_offsets, tables->table_data);
 
-    build_madt(tables->table_data, tables->linker, &cpu, guest_info);
     acpi_add_table(table_offsets, tables->table_data);
+    build_madt(tables->table_data, tables->linker, &cpu, guest_info);
+
     if (misc.has_hpet) {
+        acpi_add_table(table_offsets, tables->table_data);
         build_hpet(tables->table_data, tables->linker);
     }
     if (guest_info->numa_nodes) {
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index a825871..76aa86e 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -1258,6 +1258,7 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
     if (pos != 0 && kvm_device_msix_supported(kvm_state)) {
         int bar_nr;
         uint32_t msix_table_entry;
+        uint16_t msix_max;
 
         if (!check_irqchip_in_kernel()) {
             return -ENOTSUP;
@@ -1269,9 +1270,10 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
         }
         pci_dev->msix_cap = pos;
 
-        pci_set_word(pci_dev->config + pos + PCI_MSIX_FLAGS,
-                     pci_get_word(pci_dev->config + pos + PCI_MSIX_FLAGS) &
-                     PCI_MSIX_FLAGS_QSIZE);
+        msix_max = (pci_get_word(pci_dev->config + pos + PCI_MSIX_FLAGS) &
+                    PCI_MSIX_FLAGS_QSIZE) + 1;
+        msix_max = MIN(msix_max, KVM_MAX_MSIX_PER_DEV);
+        pci_set_word(pci_dev->config + pos + PCI_MSIX_FLAGS, msix_max - 1);
 
         /* Only enable and function mask bits are writable */
         pci_set_word(pci_dev->wmask + pos + PCI_MSIX_FLAGS,
@@ -1281,9 +1283,7 @@ static int assigned_device_pci_cap_init(PCIDevice *pci_dev)
         bar_nr = msix_table_entry & PCI_MSIX_FLAGS_BIRMASK;
         msix_table_entry &= ~PCI_MSIX_FLAGS_BIRMASK;
         dev->msix_table_addr = pci_region[bar_nr].base_addr + msix_table_entry;
-        dev->msix_max = pci_get_word(pci_dev->config + pos + PCI_MSIX_FLAGS);
-        dev->msix_max &= PCI_MSIX_FLAGS_QSIZE;
-        dev->msix_max += 1;
+        dev->msix_max = msix_max;
     }
 
     /* Minimal PM support, nothing writable, device appears to NAK changes */
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 30d3bfa..c9dcd98 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -655,7 +655,7 @@ static FWCfgState *bochs_bios_init(void)
                      acpi_tables, acpi_tables_len);
     fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override());
 
-    smbios_table = smbios_get_table(&smbios_len);
+    smbios_table = smbios_get_table_legacy(&smbios_len);
     if (smbios_table)
         fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
                          smbios_table, smbios_len);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1b3cd18..ce708c7 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -63,7 +63,7 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
 static bool has_pci_info;
 static bool has_acpi_build = true;
-static bool smbios_type1_defaults = true;
+static bool smbios_defaults = true;
 /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
  * host addresses aligned at 1Gbyte boundaries.  This way we can use 1GByte
  * pages in the host.
@@ -166,10 +166,10 @@ static void pc_init1(QEMUMachineInitArgs *args,
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = !pci_enabled;
 
-    if (smbios_type1_defaults) {
+    if (smbios_defaults) {
         /* These values are guest ABI, do not change */
-        smbios_set_type1_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
-                                  args->machine->name);
+        smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
+                            args->machine->name);
     }
 
     /* allocate ram and load rom/bios */
@@ -294,7 +294,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_7(QEMUMachineInitArgs *args)
 {
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
     gigabyte_align = false;
     option_rom_has_mr = true;
     x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
@@ -375,7 +375,10 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     has_acpi_build = false;
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
+    gigabyte_align = false;
+    option_rom_has_mr = true;
+    rom_file_has_mr = false;
     x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
     enable_compat_apic_id_mode();
     pc_init1(args, 1, 0);
@@ -385,7 +388,10 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     has_acpi_build = false;
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
+    gigabyte_align = false;
+    option_rom_has_mr = true;
+    rom_file_has_mr = false;
     if (!args->cpu_model) {
         args->cpu_model = "486";
     }
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index c529e02..c6187a4 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -53,7 +53,7 @@ extern uint64_t max_ram_below_4g;
 
 static bool has_pci_info;
 static bool has_acpi_build = true;
-static bool smbios_type1_defaults = true;
+static bool smbios_defaults = true;
 /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
  * host addresses aligned at 1Gbyte boundaries.  This way we can use 1GByte
  * pages in the host.
@@ -153,10 +153,10 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     guest_info->isapc_ram_fw = false;
     guest_info->has_acpi_build = has_acpi_build;
 
-    if (smbios_type1_defaults) {
+    if (smbios_defaults) {
         /* These values are guest ABI, do not change */
-        smbios_set_type1_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
-                                  args->machine->name);
+        smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
+                            args->machine->name);
     }
 
     /* allocate ram and load rom/bios */
@@ -265,7 +265,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_7(QEMUMachineInitArgs *args)
 {
-    smbios_type1_defaults = false;
+    smbios_defaults = false;
     gigabyte_align = false;
     option_rom_has_mr = true;
     x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
@@ -374,7 +374,7 @@ static QEMUMachine pc_q35_machine_v1_4 = {
     .name = "pc-q35-1.4",
     .init = pc_q35_init_1_4,
     .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_4,
+        PC_Q35_COMPAT_1_4,
         { /* end of list */ }
     },
 };
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index e8f41ad..e734d4c 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -21,9 +21,8 @@
 #include "hw/i386/smbios.h"
 #include "hw/loader.h"
 
-/*
- * Structures shared with the BIOS
- */
+
+/* legacy structures and constants for <= 2.0 machines */
 struct smbios_header {
     uint16_t length;
     uint8_t type;
@@ -46,6 +45,9 @@ struct smbios_table {
 
 static uint8_t *smbios_entries;
 static size_t smbios_entries_len;
+/* end: legacy structures & constants for <= 2.0 machines */
+
+
 static int smbios_type4_count = 0;
 static bool smbios_immutable;
 
@@ -187,6 +189,8 @@ static void smbios_check_collision(int type, int entry)
     }
 }
 
+
+/* legacy setup functions for <= 2.0 machines */
 static void smbios_add_field(int type, int offset, const void *data, size_t len)
 {
     struct smbios_field *field;
@@ -256,8 +260,8 @@ static void smbios_build_type_1_fields(void)
     }
 }
 
-void smbios_set_type1_defaults(const char *manufacturer,
-                               const char *product, const char *version)
+void smbios_set_defaults(const char *manufacturer, const char *product,
+                         const char *version)
 {
     if (!type1.manufacturer) {
         type1.manufacturer = manufacturer;
@@ -270,7 +274,7 @@ void smbios_set_type1_defaults(const char *manufacturer,
     }
 }
 
-uint8_t *smbios_get_table(size_t *length)
+uint8_t *smbios_get_table_legacy(size_t *length)
 {
     if (!smbios_immutable) {
         smbios_build_type_0_fields();
@@ -281,6 +285,8 @@ uint8_t *smbios_get_table(size_t *length)
     *length = smbios_entries_len;
     return smbios_entries;
 }
+/* end: legacy setup functions for <= 2.0 machines */
+
 
 static void save_opt(const char **dest, QemuOpts *opts, const char *name)
 {
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index bfe633f..457a7a1 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1293,7 +1293,7 @@ const VMStateDescription vmstate_ahci = {
         VMSTATE_UINT32(control_regs.impl, AHCIState),
         VMSTATE_UINT32(control_regs.version, AHCIState),
         VMSTATE_UINT32(idp_index, AHCIState),
-        VMSTATE_INT32(ports, AHCIState),
+        VMSTATE_INT32_EQUAL(ports, AHCIState),
         VMSTATE_END_OF_LIST()
     },
 };
diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c
index 21d6495..c73c5a7 100644
--- a/hw/ide/microdrive.c
+++ b/hw/ide/microdrive.c
@@ -594,7 +594,7 @@ static void microdrive_realize(DeviceState *dev, Error **errp)
 {
     MicroDriveState *md = MICRODRIVE(dev);
 
-    ide_init2(&md->bus, qemu_allocate_irqs(md_set_irq, md, 1)[0]);
+    ide_init2(&md->bus, qemu_allocate_irq(md_set_irq, md, 0));
 }
 
 static void microdrive_init(Object *obj)
diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c
index 485c9e5..aa5b688 100644
--- a/hw/input/tsc210x.c
+++ b/hw/input/tsc210x.c
@@ -1070,9 +1070,21 @@ static int tsc210x_load(QEMUFile *f, void *opaque, int version_id)
     s->enabled = qemu_get_byte(f);
     s->host_mode = qemu_get_byte(f);
     s->function = qemu_get_byte(f);
+    if (s->function < 0 || s->function >= ARRAY_SIZE(mode_regs)) {
+        return -EINVAL;
+    }
     s->nextfunction = qemu_get_byte(f);
+    if (s->nextfunction < 0 || s->nextfunction >= ARRAY_SIZE(mode_regs)) {
+        return -EINVAL;
+    }
     s->precision = qemu_get_byte(f);
+    if (s->precision < 0 || s->precision >= ARRAY_SIZE(resolution)) {
+        return -EINVAL;
+    }
     s->nextprecision = qemu_get_byte(f);
+    if (s->nextprecision < 0 || s->nextprecision >= ARRAY_SIZE(resolution)) {
+        return -EINVAL;
+    }
     s->filter = qemu_get_byte(f);
     s->pin_func = qemu_get_byte(f);
     s->ref = qemu_get_byte(f);
diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index c6f248b..ec01393 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -412,7 +412,7 @@ static const MemoryRegionOps pic_elcr_ioport_ops = {
     },
 };
 
-static void pic_realize(DeviceState *dev, Error **err)
+static void pic_realize(DeviceState *dev, Error **errp)
 {
     PICCommonState *s = PIC_COMMON(dev);
     PICClass *pc = PIC_GET_CLASS(dev);
@@ -425,7 +425,7 @@ static void pic_realize(DeviceState *dev, Error **err)
     qdev_init_gpio_out(dev, s->int_out, ARRAY_SIZE(s->int_out));
     qdev_init_gpio_in(dev, pic_set_irq, 8);
 
-    pc->parent_realize(dev, err);
+    pc->parent_realize(dev, errp);
 }
 
 void pic_info(Monitor *mon, const QDict *qdict)
diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c
index be76fbd..17136c9 100644
--- a/hw/intc/openpic.c
+++ b/hw/intc/openpic.c
@@ -41,6 +41,7 @@
 #include "hw/sysbus.h"
 #include "hw/pci/msi.h"
 #include "qemu/bitops.h"
+#include "qapi/qmp/qerror.h"
 
 //#define DEBUG_OPENPIC
 
@@ -1416,7 +1417,7 @@ static void openpic_load_IRQ_queue(QEMUFile* f, IRQQueue *q)
 static int openpic_load(QEMUFile* f, void *opaque, int version_id)
 {
     OpenPICState *opp = (OpenPICState *)opaque;
-    unsigned int i;
+    unsigned int i, nb_cpus;
 
     if (version_id != 1) {
         return -EINVAL;
@@ -1428,7 +1429,11 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id)
     qemu_get_be32s(f, &opp->spve);
     qemu_get_be32s(f, &opp->tfrr);
 
-    qemu_get_be32s(f, &opp->nb_cpus);
+    qemu_get_be32s(f, &nb_cpus);
+    if (opp->nb_cpus != nb_cpus) {
+        return -EINVAL;
+    }
+    assert(nb_cpus > 0 && nb_cpus <= MAX_CPU);
 
     for (i = 0; i < opp->nb_cpus; i++) {
         qemu_get_sbe32s(f, &opp->dst[i].ctpr);
@@ -1567,6 +1572,13 @@ static void openpic_realize(DeviceState *dev, Error **errp)
         {NULL}
     };
 
+    if (opp->nb_cpus > MAX_CPU) {
+        error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
+                  TYPE_OPENPIC, "nb_cpus", (uint64_t)opp->nb_cpus,
+                  (uint64_t)0, (uint64_t)MAX_CPU);
+        return;
+    }
+
     switch (opp->model) {
     case OPENPIC_MODEL_FSL_MPIC_20:
     default:
diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index 29b467b..495d507 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -135,9 +135,9 @@ CBus *cbus_init(qemu_irq dat)
     CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
 
     s->dat_out = dat;
-    s->cbus.clk = qemu_allocate_irqs(cbus_clk, s, 1)[0];
-    s->cbus.dat = qemu_allocate_irqs(cbus_dat, s, 1)[0];
-    s->cbus.sel = qemu_allocate_irqs(cbus_sel, s, 1)[0];
+    s->cbus.clk = qemu_allocate_irq(cbus_clk, s, 0);
+    s->cbus.dat = qemu_allocate_irq(cbus_dat, s, 0);
+    s->cbus.sel = qemu_allocate_irq(cbus_sel, s, 0);
 
     s->sel = 1;
     s->clk = 0;
diff --git a/hw/misc/imx_ccm.c b/hw/misc/imx_ccm.c
index 63e33a4..449183d 100644
--- a/hw/misc/imx_ccm.c
+++ b/hw/misc/imx_ccm.c
@@ -68,6 +68,7 @@ static const VMStateDescription vmstate_imx_ccm = {
         VMSTATE_UINT32(pmcr0, IMXCCMState),
         VMSTATE_UINT32(pmcr1, IMXCCMState),
         VMSTATE_UINT32(pll_refclk_freq, IMXCCMState),
+        VMSTATE_END_OF_LIST()
     },
     .post_load = imx_ccm_post_load,
 };
diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
index d04e6a4..9cc6262 100644
--- a/hw/net/stellaris_enet.c
+++ b/hw/net/stellaris_enet.c
@@ -8,6 +8,7 @@
  */
 #include "hw/sysbus.h"
 #include "net/net.h"
+#include "migration/migration.h"
 #include <zlib.h>
 
 //#define DEBUG_STELLARIS_ENET 1
@@ -75,6 +76,7 @@ typedef struct {
     NICConf conf;
     qemu_irq irq;
     MemoryRegion mmio;
+    Error *migration_blocker;
 } stellaris_enet_state;
 
 static void stellaris_enet_update(stellaris_enet_state *s)
@@ -253,17 +255,19 @@ static void stellaris_enet_write(void *opaque, hwaddr offset,
                 s->tx_fifo[s->tx_fifo_len++] = value >> 24;
             }
         } else {
-            s->tx_fifo[s->tx_fifo_len++] = value;
-            s->tx_fifo[s->tx_fifo_len++] = value >> 8;
-            s->tx_fifo[s->tx_fifo_len++] = value >> 16;
-            s->tx_fifo[s->tx_fifo_len++] = value >> 24;
+            if (s->tx_fifo_len + 4 <= ARRAY_SIZE(s->tx_fifo)) {
+                s->tx_fifo[s->tx_fifo_len++] = value;
+                s->tx_fifo[s->tx_fifo_len++] = value >> 8;
+                s->tx_fifo[s->tx_fifo_len++] = value >> 16;
+                s->tx_fifo[s->tx_fifo_len++] = value >> 24;
+            }
             if (s->tx_fifo_len >= s->tx_frame_len) {
                 /* We don't implement explicit CRC, so just chop it off.  */
                 if ((s->tctl & SE_TCTL_CRC) == 0)
                     s->tx_frame_len -= 4;
                 if ((s->tctl & SE_TCTL_PADEN) && s->tx_frame_len < 60) {
                     memset(&s->tx_fifo[s->tx_frame_len], 0, 60 - s->tx_frame_len);
-                    s->tx_fifo_len = 60;
+                    s->tx_frame_len = 60;
                 }
                 qemu_send_packet(qemu_get_queue(s->nic), s->tx_fifo,
                                  s->tx_frame_len);
@@ -360,7 +364,7 @@ static int stellaris_enet_load(QEMUFile *f, void *opaque, int version_id)
     stellaris_enet_state *s = (stellaris_enet_state *)opaque;
     int i;
 
-    if (version_id != 1)
+    if (1)
         return -EINVAL;
 
     s->ris = qemu_get_be32(f);
@@ -421,6 +425,10 @@ static int stellaris_enet_init(SysBusDevice *sbd)
     stellaris_enet_reset(s);
     register_savevm(dev, "stellaris_enet", -1, 1,
                     stellaris_enet_save, stellaris_enet_load, s);
+
+    error_setg(&s->migration_blocker,
+            "stellaris_enet does not support migration");
+    migrate_add_blocker(s->migration_blocker);
     return 0;
 }
 
@@ -428,6 +436,9 @@ static void stellaris_enet_unrealize(DeviceState *dev, Error **errp)
 {
     stellaris_enet_state *s = STELLARIS_ENET(dev);
 
+    migrate_del_blocker(s->migration_blocker);
+    error_free(s->migration_blocker);
+
     unregister_savevm(DEVICE(s), "stellaris_enet", s);
 
     memory_region_destroy(&s->mmio);
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 33bd233..2ac6ce5 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -863,6 +863,14 @@ static int virtio_net_has_buffers(VirtIONetQueue *q, int bufsize)
     return 1;
 }
 
+static void virtio_net_hdr_swap(struct virtio_net_hdr *hdr)
+{
+    tswap16s(&hdr->hdr_len);
+    tswap16s(&hdr->gso_size);
+    tswap16s(&hdr->csum_start);
+    tswap16s(&hdr->csum_offset);
+}
+
 /* dhclient uses AF_PACKET but doesn't pass auxdata to the kernel so
  * it never finds out that the packets don't have valid checksums.  This
  * causes dhclient to get upset.  Fedora's carried a patch for ages to
@@ -898,6 +906,7 @@ static void receive_header(VirtIONet *n, const struct iovec *iov, int iov_cnt,
         void *wbuf = (void *)buf;
         work_around_broken_dhclient(wbuf, wbuf + n->host_hdr_len,
                                     size - n->host_hdr_len);
+        virtio_net_hdr_swap(wbuf);
         iov_from_buf(iov, iov_cnt, 0, buf, sizeof(struct virtio_net_hdr));
     } else {
         struct virtio_net_hdr hdr = {
@@ -1106,6 +1115,14 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
             exit(1);
         }
 
+        if (n->has_vnet_hdr) {
+            if (out_sg[0].iov_len < n->guest_hdr_len) {
+                error_report("virtio-net header incorrect");
+                exit(1);
+            }
+            virtio_net_hdr_swap((void *) out_sg[0].iov_base);
+        }
+
         /*
          * If host wants to see the guest header as is, we can
          * pass it on unchanged. Otherwise, copy just the parts
@@ -1362,10 +1379,17 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
         if (n->mac_table.in_use <= MAC_TABLE_ENTRIES) {
             qemu_get_buffer(f, n->mac_table.macs,
                             n->mac_table.in_use * ETH_ALEN);
-        } else if (n->mac_table.in_use) {
-            uint8_t *buf = g_malloc0(n->mac_table.in_use);
-            qemu_get_buffer(f, buf, n->mac_table.in_use * ETH_ALEN);
-            g_free(buf);
+        } else {
+            int64_t i;
+
+            /* Overflow detected - can happen if source has a larger MAC table.
+             * We simply set overflow flag so there's no need to maintain the
+             * table of addresses, discard them all.
+             * Note: 64 bit math to avoid integer overflow.
+             */
+            for (i = 0; i < (int64_t)n->mac_table.in_use * ETH_ALEN; ++i) {
+                qemu_get_byte(f);
+            }
             n->mac_table.multi_overflow = n->mac_table.uni_overflow = 1;
             n->mac_table.in_use = 0;
         }
@@ -1407,6 +1431,11 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
         }
 
         n->curr_queues = qemu_get_be16(f);
+        if (n->curr_queues > n->max_queues) {
+            error_report("virtio-net: curr_queues %x > max_queues %x",
+                         n->curr_queues, n->max_queues);
+            return -1;
+        }
         for (i = 1; i < n->curr_queues; i++) {
             n->vqs[i].tx_waiting = qemu_get_be32(f);
         }
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2a9f08e..e05d60c 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -830,6 +830,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     }
 
     pci_dev->bus = bus;
+    pci_dev->devfn = devfn;
     dma_as = pci_device_iommu_address_space(pci_dev);
 
     memory_region_init_alias(&pci_dev->bus_master_enable_region,
@@ -839,7 +840,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     address_space_init(&pci_dev->bus_master_as, &pci_dev->bus_master_enable_region,
                        name);
 
-    pci_dev->devfn = devfn;
     pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
     pci_dev->irq_state = 0;
     pci_config_alloc(pci_dev);
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index 991502e..535be2c 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -795,6 +795,13 @@ static const VMStateDescription vmstate_pcie_aer_err = {
     }
 };
 
+static bool pcie_aer_state_log_num_valid(void *opaque, int version_id)
+{
+    PCIEAERLog *s = opaque;
+
+    return s->log_num <= s->log_max;
+}
+
 const VMStateDescription vmstate_pcie_aer_log = {
     .name = "PCIE_AER_ERROR_LOG",
     .version_id = 1,
@@ -802,7 +809,8 @@ const VMStateDescription vmstate_pcie_aer_log = {
     .minimum_version_id_old = 1,
     .fields     = (VMStateField[]) {
         VMSTATE_UINT16(log_num, PCIEAERLog),
-        VMSTATE_UINT16(log_max, PCIEAERLog),
+        VMSTATE_UINT16_EQUAL(log_max, PCIEAERLog),
+        VMSTATE_VALIDATE("log_num <= log_max", pcie_aer_state_log_num_valid),
         VMSTATE_STRUCT_VARRAY_POINTER_UINT16(log, PCIEAERLog, log_num,
                               vmstate_pcie_aer_err, PCIEAERErr),
         VMSTATE_END_OF_LIST()
diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c
index 96f3774..55e8a2a 100644
--- a/hw/pcmcia/pxa2xx.c
+++ b/hw/pcmcia/pxa2xx.c
@@ -195,7 +195,7 @@ static void pxa2xx_pcmcia_initfn(Object *obj)
     memory_region_add_subregion(&s->container_mem, 0x0c000000,
                                 &s->common_iomem);
 
-    s->slot.irq = qemu_allocate_irqs(pxa2xx_pcmcia_set_irq, s, 1)[0];
+    s->slot.irq = qemu_allocate_irq(pxa2xx_pcmcia_set_irq, s, 0);
 
     object_property_add_link(obj, "card", TYPE_PCMCIA_CARD,
                              (Object **)&s->card,
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index cbef095..000c94f 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -343,6 +343,21 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr,
 
     /* There is no cached config, allocate MSIs */
     if (!phb->msi_table[ndev].nvec) {
+        int max_irqs = 0;
+        if (ret_intr_type == RTAS_TYPE_MSI) {
+            max_irqs = msi_nr_vectors_allocated(pdev);
+        } else if (ret_intr_type == RTAS_TYPE_MSIX) {
+            max_irqs = pdev->msix_entries_nr;
+        }
+        if (!max_irqs) {
+            error_report("Requested interrupt type %d is not enabled for device#%d",
+                         ret_intr_type, ndev);
+            rtas_st(rets, 0, -1); /* Hardware error */
+            return;
+        }
+        if (req_num > max_irqs) {
+            req_num = max_irqs;
+        }
         irq = spapr_allocate_irq_block(req_num, false,
                                        ret_intr_type == RTAS_TYPE_MSI);
         if (irq < 0) {
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 7074d2b..d68a29a 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -734,9 +734,11 @@ out:
     return ret;
 }
 
-static void copy_irb_to_guest(IRB *dest, const IRB *src)
+static void copy_irb_to_guest(IRB *dest, const IRB *src, PMCW *pmcw)
 {
     int i;
+    uint16_t stctl = src->scsw.ctrl & SCSW_CTRL_MASK_STCTL;
+    uint16_t actl = src->scsw.ctrl & SCSW_CTRL_MASK_ACTL;
 
     copy_scsw_to_guest(&dest->scsw, &src->scsw);
 
@@ -746,8 +748,22 @@ static void copy_irb_to_guest(IRB *dest, const IRB *src)
     for (i = 0; i < ARRAY_SIZE(dest->ecw); i++) {
         dest->ecw[i] = cpu_to_be32(src->ecw[i]);
     }
-    for (i = 0; i < ARRAY_SIZE(dest->emw); i++) {
-        dest->emw[i] = cpu_to_be32(src->emw[i]);
+    /* extended measurements enabled? */
+    if ((src->scsw.flags & SCSW_FLAGS_MASK_ESWF) ||
+        !(pmcw->flags & PMCW_FLAGS_MASK_TF) ||
+        !(pmcw->chars & PMCW_CHARS_MASK_XMWME)) {
+        return;
+    }
+    /* extended measurements pending? */
+    if (!(stctl & SCSW_STCTL_STATUS_PEND)) {
+        return;
+    }
+    if ((stctl & SCSW_STCTL_PRIMARY) ||
+        (stctl == SCSW_STCTL_SECONDARY) ||
+        ((stctl & SCSW_STCTL_INTERMEDIATE) && (actl & SCSW_ACTL_SUSP))) {
+        for (i = 0; i < ARRAY_SIZE(dest->emw); i++) {
+            dest->emw[i] = cpu_to_be32(src->emw[i]);
+        }
     }
 }
 
@@ -793,7 +809,7 @@ int css_do_tsch(SubchDev *sch, IRB *target_irb)
         }
     }
     /* Store the irb to the guest. */
-    copy_irb_to_guest(target_irb, &irb);
+    copy_irb_to_guest(target_irb, &irb, p);
 
     /* Clear conditions on subchannel, if applicable. */
     if (stctl & SCSW_STCTL_STATUS_PEND) {
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index e6e1ffd..1781525 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -1106,6 +1106,21 @@ static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd)
     return MFI_STAT_OK;
 }
 
+static int megasas_dcmd_ld_list_query(MegasasState *s, MegasasCmd *cmd)
+{
+    uint16_t flags;
+
+    /* mbox0 contains flags */
+    flags = le16_to_cpu(cmd->frame->dcmd.mbox[0]);
+    trace_megasas_dcmd_ld_list_query(cmd->index, flags);
+    if (flags == MR_LD_QUERY_TYPE_ALL ||
+        flags == MR_LD_QUERY_TYPE_EXPOSED_TO_HOST) {
+        return megasas_dcmd_ld_get_list(s, cmd);
+    }
+
+    return MFI_STAT_OK;
+}
+
 static int megasas_ld_get_info_submit(SCSIDevice *sdev, int lun,
                                       MegasasCmd *cmd)
 {
@@ -1409,6 +1424,8 @@ static const struct dcmd_cmd_tbl_t {
       megasas_dcmd_dummy },
     { MFI_DCMD_LD_GET_LIST, "LD_GET_LIST",
       megasas_dcmd_ld_get_list},
+    { MFI_DCMD_LD_LIST_QUERY, "LD_LIST_QUERY",
+      megasas_dcmd_ld_list_query },
     { MFI_DCMD_LD_GET_INFO, "LD_GET_INFO",
       megasas_dcmd_ld_get_info },
     { MFI_DCMD_LD_GET_PROP, "LD_GET_PROP",
diff --git a/hw/scsi/mfi.h b/hw/scsi/mfi.h
index cd8355b..a3034f6 100644
--- a/hw/scsi/mfi.h
+++ b/hw/scsi/mfi.h
@@ -164,6 +164,7 @@ typedef enum {
     MFI_DCMD_PD_BLINK =                 0x02070100,
     MFI_DCMD_PD_UNBLINK =               0x02070200,
     MFI_DCMD_LD_GET_LIST =              0x03010000,
+    MFI_DCMD_LD_LIST_QUERY =            0x03010100,
     MFI_DCMD_LD_GET_INFO =              0x03020000,
     MFI_DCMD_LD_GET_PROP =              0x03030000,
     MFI_DCMD_LD_SET_PROP =              0x03040000,
@@ -411,6 +412,14 @@ typedef enum {
     MR_PD_QUERY_TYPE_EXPOSED_TO_HOST =  5, /*query for system drives */
 } mfi_pd_query_type;
 
+typedef enum {
+    MR_LD_QUERY_TYPE_ALL =              0,
+    MR_LD_QUERY_TYPE_EXPOSED_TO_HOST =  1,
+    MR_LD_QUERY_TYPE_USED_TGT_IDS =     2,
+    MR_LD_QUERY_TYPE_CLUSTER_ACCESS =   3,
+    MR_LD_QUERY_TYPE_CLUSTER_LOCALE =   4,
+} mfi_ld_query_type;
+
 /*
  * Other propertities and definitions
  */
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 48a28ae..da8c436 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2520,7 +2520,7 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag,
 	 * ones (such as WRITE SAME or EXTENDED COPY, etc.).  So, without
 	 * O_DIRECT everything must go through SG_IO.
          */
-        if (bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE) {
+        if (!(bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE)) {
             break;
         }
 
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 3983a5b..9099192 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -196,6 +196,10 @@ static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val)
     }
 }
 
+static void vhost_dummy_handle_output(VirtIODevice *vdev, VirtQueue *vq)
+{
+}
+
 static void vhost_scsi_realize(DeviceState *dev, Error **errp)
 {
     VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev);
@@ -217,7 +221,9 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp)
         }
     }
 
-    virtio_scsi_common_realize(dev, &err);
+    virtio_scsi_common_realize(dev, &err, vhost_dummy_handle_output,
+                               vhost_dummy_handle_output,
+                               vhost_dummy_handle_output);
     if (err != NULL) {
         error_propagate(errp, err);
         return;
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index b0d7517..d183cd0 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -147,6 +147,15 @@ static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
     qemu_get_be32s(f, &n);
     assert(n < vs->conf.num_queues);
     qemu_get_buffer(f, (unsigned char *)&req->elem, sizeof(req->elem));
+    /* TODO: add a way for SCSIBusInfo's load_request to fail,
+     * and fail migration instead of asserting here.
+     * When we do, we might be able to re-enable NDEBUG below.
+     */
+#ifdef NDEBUG
+#error building with NDEBUG is not supported
+#endif
+    assert(req->elem.in_num <= ARRAY_SIZE(req->elem.in_sg));
+    assert(req->elem.out_num <= ARRAY_SIZE(req->elem.out_sg));
     virtio_scsi_parse_req(s, vs->cmd_vqs[n], req);
 
     scsi_req_ref(sreq);
@@ -489,7 +498,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
                                    uint32_t event, uint32_t reason)
 {
     VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
-    VirtIOSCSIReq *req = virtio_scsi_pop_req(s, vs->event_vq);
+    VirtIOSCSIReq *req;
     VirtIOSCSIEvent *evt;
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
     int in_size;
@@ -498,6 +507,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
         return;
     }
 
+    req = virtio_scsi_pop_req(s, vs->event_vq);
     if (!req) {
         s->events_dropped = true;
         return;
@@ -595,7 +605,9 @@ static struct SCSIBusInfo virtio_scsi_scsi_info = {
     .load_request = virtio_scsi_load_request,
 };
 
-void virtio_scsi_common_realize(DeviceState *dev, Error **errp)
+void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
+                                HandleOutput ctrl, HandleOutput evt,
+                                HandleOutput cmd)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOSCSICommon *s = VIRTIO_SCSI_COMMON(dev);
@@ -609,12 +621,12 @@ void virtio_scsi_common_realize(DeviceState *dev, Error **errp)
     s->cdb_size = VIRTIO_SCSI_CDB_SIZE;
 
     s->ctrl_vq = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,
-                                  virtio_scsi_handle_ctrl);
+                                  ctrl);
     s->event_vq = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,
-                                   virtio_scsi_handle_event);
+                                   evt);
     for (i = 0; i < s->conf.num_queues; i++) {
         s->cmd_vqs[i] = virtio_add_queue(vdev, VIRTIO_SCSI_VQ_SIZE,
-                                         virtio_scsi_handle_cmd);
+                                         cmd);
     }
 }
 
@@ -625,7 +637,9 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)
     static int virtio_scsi_id;
     Error *err = NULL;
 
-    virtio_scsi_common_realize(dev, &err);
+    virtio_scsi_common_realize(dev, &err, virtio_scsi_handle_ctrl,
+                               virtio_scsi_handle_event,
+                               virtio_scsi_handle_cmd);
     if (err != NULL) {
         error_propagate(errp, err);
         return;
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c
index 937a478..6c92149 100644
--- a/hw/sd/omap_mmc.c
+++ b/hw/sd/omap_mmc.c
@@ -625,7 +625,7 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
         exit(1);
     }
 
-    s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0];
+    s->cdet = qemu_allocate_irq(omap_mmc_cover_cb, s, 0);
     sd_set_cb(s->card, NULL, s->cdet);
 
     return s;
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 843e697..e79a886 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1168,8 +1168,8 @@ static void sdhci_initfn(Object *obj)
     if (s->card == NULL) {
         exit(1);
     }
-    s->eject_cb = qemu_allocate_irqs(sdhci_insert_eject_cb, s, 1)[0];
-    s->ro_cb = qemu_allocate_irqs(sdhci_card_readonly_cb, s, 1)[0];
+    s->eject_cb = qemu_allocate_irq(sdhci_insert_eject_cb, s, 0);
+    s->ro_cb = qemu_allocate_irq(sdhci_card_readonly_cb, s, 0);
     sd_set_cb(s->card, s->ro_cb, s->eject_cb);
 
     s->insert_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, sdhci_raise_insertion_irq, s);
@@ -1184,8 +1184,8 @@ static void sdhci_uninitfn(Object *obj)
     timer_free(s->insert_timer);
     timer_del(s->transfer_timer);
     timer_free(s->transfer_timer);
-    qemu_free_irqs(&s->eject_cb);
-    qemu_free_irqs(&s->ro_cb);
+    qemu_free_irq(s->eject_cb);
+    qemu_free_irq(s->ro_cb);
 
     if (s->fifo_buffer) {
         g_free(s->fifo_buffer);
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index 3273c8a..b012e57 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -230,8 +230,17 @@ static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id)
     for (i = 0; i < 5; i++)
         s->response[i] = qemu_get_be32(f);
     s->arglen = qemu_get_be32(f);
+    if (s->mode == SSI_SD_CMDARG &&
+        (s->arglen < 0 || s->arglen >= ARRAY_SIZE(s->cmdarg))) {
+        return -EINVAL;
+    }
     s->response_pos = qemu_get_be32(f);
     s->stopping = qemu_get_be32(f);
+    if (s->mode == SSI_SD_RESPONSE &&
+        (s->response_pos < 0 || s->response_pos >= ARRAY_SIZE(s->response) ||
+        (!s->stopping && s->arglen > ARRAY_SIZE(s->response)))) {
+        return -EINVAL;
+    }
 
     ss->cs = qemu_get_be32(f);
 
diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c
index 4a39357..5dda5de 100644
--- a/hw/sh4/sh7750.c
+++ b/hw/sh4/sh7750.c
@@ -838,6 +838,5 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem)
 qemu_irq sh7750_irl(SH7750State *s)
 {
     sh_intc_toggle_source(sh_intc_source(&s->intc, IRL), 1, 0); /* enable */
-    return qemu_allocate_irqs(sh_intc_set_irl, sh_intc_source(&s->intc, IRL),
-                               1)[0];
+    return qemu_allocate_irq(sh_intc_set_irl, sh_intc_source(&s->intc, IRL), 0);
 }
diff --git a/hw/ssi/pl022.c b/hw/ssi/pl022.c
index fd479ef..b19bc71 100644
--- a/hw/ssi/pl022.c
+++ b/hw/ssi/pl022.c
@@ -240,11 +240,25 @@ static const MemoryRegionOps pl022_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
+static int pl022_post_load(void *opaque, int version_id)
+{
+    PL022State *s = opaque;
+
+    if (s->tx_fifo_head < 0 ||
+        s->tx_fifo_head >= ARRAY_SIZE(s->tx_fifo) ||
+        s->rx_fifo_head < 0 ||
+        s->rx_fifo_head >= ARRAY_SIZE(s->rx_fifo)) {
+        return -1;
+    }
+    return 0;
+}
+
 static const VMStateDescription vmstate_pl022 = {
     .name = "pl022_ssp",
     .version_id = 1,
     .minimum_version_id = 1,
     .minimum_version_id_old = 1,
+    .post_load = pl022_post_load,
     .fields      = (VMStateField[]) {
         VMSTATE_UINT32(cr0, PL022State),
         VMSTATE_UINT32(cr1, PL022State),
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index e15d6bc..2792f89 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -239,6 +239,18 @@ static int hpet_pre_load(void *opaque)
     return 0;
 }
 
+static bool hpet_validate_num_timers(void *opaque, int version_id)
+{
+    HPETState *s = opaque;
+
+    if (s->num_timers < HPET_MIN_TIMERS) {
+        return false;
+    } else if (s->num_timers > HPET_MAX_TIMERS) {
+        return false;
+    }
+    return true;
+}
+
 static int hpet_post_load(void *opaque, int version_id)
 {
     HPETState *s = opaque;
@@ -307,6 +319,7 @@ static const VMStateDescription vmstate_hpet = {
         VMSTATE_UINT64(isr, HPETState),
         VMSTATE_UINT64(hpet_counter, HPETState),
         VMSTATE_UINT8_V(num_timers, HPETState, 2),
+        VMSTATE_VALIDATE("num_timers in range", hpet_validate_num_timers),
         VMSTATE_STRUCT_VARRAY_UINT8(timer, HPETState, num_timers, 0,
                                     vmstate_hpet_timer, HPETTimer),
         VMSTATE_END_OF_LIST()
diff --git a/hw/timer/i8254.c b/hw/timer/i8254.c
index 28152d8..3450c98 100644
--- a/hw/timer/i8254.c
+++ b/hw/timer/i8254.c
@@ -322,7 +322,7 @@ static void pit_post_load(PITCommonState *s)
     }
 }
 
-static void pit_realizefn(DeviceState *dev, Error **err)
+static void pit_realizefn(DeviceState *dev, Error **errp)
 {
     PITCommonState *pit = PIT_COMMON(dev);
     PITClass *pc = PIT_GET_CLASS(dev);
@@ -338,7 +338,7 @@ static void pit_realizefn(DeviceState *dev, Error **err)
 
     qdev_init_gpio_in(dev, pit_irq_control, 1);
 
-    pc->parent_realize(dev, err);
+    pc->parent_realize(dev, errp);
 }
 
 static Property pit_properties[] = {
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 8509309..abcbcae 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -852,7 +852,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     check_update_timer(s);
 
     s->clock_reset_notifier.notify = rtc_notify_clock_reset;
-    qemu_clock_register_reset_notifier(QEMU_CLOCK_REALTIME,
+    qemu_clock_register_reset_notifier(rtc_clock,
                                        &s->clock_reset_notifier);
 
     s->suspend_notifier.notify = rtc_notify_suspend;
diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c
index 016207f..b7f3d49 100644
--- a/hw/timer/omap_gptimer.c
+++ b/hw/timer/omap_gptimer.c
@@ -227,7 +227,7 @@ static void omap_gp_timer_clk_update(void *opaque, int line, int on)
 static void omap_gp_timer_clk_setup(struct omap_gp_timer_s *timer)
 {
     omap_clk_adduser(timer->clk,
-                    qemu_allocate_irqs(omap_gp_timer_clk_update, timer, 1)[0]);
+                     qemu_allocate_irq(omap_gp_timer_clk_update, timer, 0));
     timer->rate = omap_clk_getrate(timer->clk);
 }
 
@@ -476,7 +476,7 @@ struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta,
     s->clk = fclk;
     s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_gp_timer_tick, s);
     s->match = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_gp_timer_match, s);
-    s->in = qemu_allocate_irqs(omap_gp_timer_input, s, 1)[0];
+    s->in = qemu_allocate_irq(omap_gp_timer_input, s, 0);
     omap_gp_timer_reset(s);
     omap_gp_timer_clk_setup(s);
 
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index fe70429..e48b19f 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -49,7 +49,9 @@ static int usb_device_post_load(void *opaque, int version_id)
     } else {
         dev->attached = 1;
     }
-    if (dev->setup_index >= sizeof(dev->data_buf) ||
+    if (dev->setup_index < 0 ||
+        dev->setup_len < 0 ||
+        dev->setup_index >= sizeof(dev->data_buf) ||
         dev->setup_len >= sizeof(dev->data_buf)) {
         return -EINVAL;
     }
diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
index a9661d2..a76e581 100644
--- a/hw/usb/dev-bluetooth.c
+++ b/hw/usb/dev-bluetooth.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu-common.h"
+#include "qemu/error-report.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
 #include "sysemu/bt.h"
@@ -506,6 +507,14 @@ static int usb_bt_initfn(USBDevice *dev)
 
     usb_desc_create_serial(dev);
     usb_desc_init(dev);
+    s->dev.opaque = s;
+    if (!s->hci) {
+        s->hci = bt_new_hci(qemu_find_bt_vlan(0));
+    }
+    s->hci->opaque = s;
+    s->hci->evt_recv = usb_bt_out_hci_packet_event;
+    s->hci->acl_recv = usb_bt_out_hci_packet_acl;
+    usb_bt_handle_reset(&s->dev);
     s->intr = usb_ep_get(dev, USB_TOKEN_IN, USB_EVT_EP);
 
     return 0;
@@ -516,6 +525,7 @@ static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline)
     USBDevice *dev;
     struct USBBtState *s;
     HCIInfo *hci;
+    const char *name = "usb-bt-dongle";
 
     if (*cmdline) {
         hci = hci_init(cmdline);
@@ -525,19 +535,17 @@ static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline)
 
     if (!hci)
         return NULL;
-    dev = usb_create_simple(bus, "usb-bt-dongle");
+    dev = usb_create(bus, name);
     if (!dev) {
+        error_report("Failed to create USB device '%s'", name);
         return NULL;
     }
     s = DO_UPCAST(struct USBBtState, dev, dev);
-    s->dev.opaque = s;
-
     s->hci = hci;
-    s->hci->opaque = s;
-    s->hci->evt_recv = usb_bt_out_hci_packet_event;
-    s->hci->acl_recv = usb_bt_out_hci_packet_acl;
-
-    usb_bt_handle_reset(&s->dev);
+    if (qdev_init(&dev->qdev) < 0) {
+        error_report("Failed to initialize USB device '%s'", name);
+        return NULL;
+    }
 
     return dev;
 }
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index ef3177a..0ceb10d 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3703,6 +3703,7 @@ static const VMStateDescription vmstate_xhci_event = {
         VMSTATE_UINT32(flags,  XHCIEvent),
         VMSTATE_UINT8(slotid,  XHCIEvent),
         VMSTATE_UINT8(epid,    XHCIEvent),
+        VMSTATE_END_OF_LIST()
     }
 };
 
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 9e336ad..1d349e0 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -309,7 +309,9 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
                                       uint64_t size)
 {
     int i;
-    for (i = 0; i < dev->nvqs; ++i) {
+    int r = 0;
+
+    for (i = 0; !r && i < dev->nvqs; ++i) {
         struct vhost_virtqueue *vq = dev->vqs + i;
         hwaddr l;
         void *p;
@@ -321,15 +323,15 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
         p = cpu_physical_memory_map(vq->ring_phys, &l, 1);
         if (!p || l != vq->ring_size) {
             fprintf(stderr, "Unable to map ring buffer for ring %d\n", i);
-            return -ENOMEM;
+            r = -ENOMEM;
         }
         if (p != vq->ring) {
             fprintf(stderr, "Ring buffer relocated for ring %d\n", i);
-            return -EBUSY;
+            r = -EBUSY;
         }
         cpu_physical_memory_unmap(p, l, 0, 0);
     }
-    return 0;
+    return r;
 }
 
 static struct vhost_memory_region *vhost_dev_find_reg(struct vhost_dev *dev,
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index aeabf3a..3e4b70c 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -430,6 +430,12 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
     unsigned int i;
     hwaddr len;
 
+    if (num_sg > VIRTQUEUE_MAX_SIZE) {
+        error_report("virtio: map attempt out of bounds: %zd > %d",
+                     num_sg, VIRTQUEUE_MAX_SIZE);
+        exit(1);
+    }
+
     for (i = 0; i < num_sg; i++) {
         len = sg[i].iov_len;
         sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);
@@ -891,7 +897,9 @@ int virtio_set_features(VirtIODevice *vdev, uint32_t val)
 
 int virtio_load(VirtIODevice *vdev, QEMUFile *f)
 {
-    int num, i, ret;
+    int i, ret;
+    int32_t config_len;
+    uint32_t num;
     uint32_t features;
     uint32_t supported_features;
     BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
@@ -906,6 +914,9 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f)
     qemu_get_8s(f, &vdev->status);
     qemu_get_8s(f, &vdev->isr);
     qemu_get_be16s(f, &vdev->queue_sel);
+    if (vdev->queue_sel >= VIRTIO_PCI_QUEUE_MAX) {
+        return -1;
+    }
     qemu_get_be32s(f, &features);
 
     if (virtio_set_features(vdev, features) < 0) {
@@ -914,11 +925,27 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f)
                      features, supported_features);
         return -1;
     }
-    vdev->config_len = qemu_get_be32(f);
-    qemu_get_buffer(f, vdev->config, vdev->config_len);
+    config_len = qemu_get_be32(f);
+
+    /*
+     * There are cases where the incoming config can be bigger or smaller
+     * than what we have; so load what we have space for, and skip
+     * any excess that's in the stream.
+     */
+    qemu_get_buffer(f, vdev->config, MIN(config_len, vdev->config_len));
+
+    while (config_len > vdev->config_len) {
+        qemu_get_byte(f);
+        config_len--;
+    }
 
     num = qemu_get_be32(f);
 
+    if (num > VIRTIO_PCI_QUEUE_MAX) {
+        error_report("Invalid number of PCI queues: 0x%x", num);
+        return -1;
+    }
+
     for (i = 0; i < num; i++) {
         vdev->vq[i].vring.num = qemu_get_be32(f);
         if (k->has_variable_vring_alignment) {
diff --git a/hw/xtensa/xtensa_lx60.c b/hw/xtensa/xtensa_lx60.c
index 49c58d1..fc6a513 100644
--- a/hw/xtensa/xtensa_lx60.c
+++ b/hw/xtensa/xtensa_lx60.c
@@ -42,6 +42,7 @@
 typedef struct LxBoardDesc {
     hwaddr flash_base;
     size_t flash_size;
+    size_t flash_boot_base;
     size_t flash_sector_size;
     size_t sram_size;
 } LxBoardDesc;
@@ -266,9 +267,9 @@ static void lx_init(const LxBoardDesc *board, QEMUMachineInitArgs *args)
             MemoryRegion *flash_io = g_malloc(sizeof(*flash_io));
 
             memory_region_init_alias(flash_io, NULL, "lx60.flash",
-                    flash_mr, 0,
-                    board->flash_size < 0x02000000 ?
-                    board->flash_size : 0x02000000);
+                    flash_mr, board->flash_boot_base,
+                    board->flash_size - board->flash_boot_base < 0x02000000 ?
+                    board->flash_size - board->flash_boot_base : 0x02000000);
             memory_region_add_subregion(system_memory, 0xfe000000,
                     flash_io);
         }
@@ -313,6 +314,7 @@ static void xtensa_kc705_init(QEMUMachineInitArgs *args)
     static const LxBoardDesc kc705_board = {
         .flash_base = 0xf0000000,
         .flash_size = 0x08000000,
+        .flash_boot_base = 0x06000000,
         .flash_sector_size = 0x20000,
         .sram_size = 0x2000000,
     };
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index d76de62..395be5b 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -144,6 +144,14 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
 void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns);
 
 /**
+ * block_job_yield:
+ * @job: The job that calls the function.
+ *
+ * Yield the block job coroutine.
+ */
+void block_job_yield(BlockJob *job);
+
+/**
  * block_job_completed:
  * @job: The job being completed.
  * @ret: The status code.
diff --git a/include/hw/i386/smbios.h b/include/hw/i386/smbios.h
index 18fb970..f808199 100644
--- a/include/hw/i386/smbios.h
+++ b/include/hw/i386/smbios.h
@@ -16,9 +16,9 @@
 #include "qemu/option.h"
 
 void smbios_entry_add(QemuOpts *opts);
-void smbios_set_type1_defaults(const char *manufacturer,
-                               const char *product, const char *version);
-uint8_t *smbios_get_table(size_t *length);
+void smbios_set_defaults(const char *manufacturer, const char *product,
+                         const char *version);
+uint8_t *smbios_get_table_legacy(size_t *length);
 
 /*
  * SMBIOS spec defined tables
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index df60f16..4b32440 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -176,8 +176,8 @@ typedef struct VirtIONet {
     uint8_t nobcast;
     uint8_t vhost_started;
     struct {
-        int in_use;
-        int first_multi;
+        uint32_t in_use;
+        uint32_t first_multi;
         uint8_t multi_overflow;
         uint8_t uni_overflow;
         uint8_t *macs;
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index 42b1024..e81a643 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -186,7 +186,12 @@ typedef struct {
     DEFINE_PROP_BIT("param_change", _state, _feature_field,                    \
                                             VIRTIO_SCSI_F_CHANGE, true)
 
-void virtio_scsi_common_realize(DeviceState *dev, Error **errp);
+typedef void (*HandleOutput)(VirtIODevice *, VirtQueue *);
+
+void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
+                                HandleOutput ctrl, HandleOutput evt,
+                                HandleOutput cmd);
+
 void virtio_scsi_common_unrealize(DeviceState *dev, Error **errp);
 
 #endif /* _QEMU_VIRTIO_SCSI_H */
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index e7e1705..5b71370 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -100,6 +100,7 @@ enum VMStateFlags {
     VMS_MULTIPLY         = 0x200,  /* multiply "size" field by field_size */
     VMS_VARRAY_UINT8     = 0x400,  /* Array with size in uint8_t field*/
     VMS_VARRAY_UINT32    = 0x800,  /* Array with size in uint32_t field*/
+    VMS_MUST_EXIST       = 0x1000, /* Field must exist in input */
 };
 
 typedef struct {
@@ -203,6 +204,14 @@ extern const VMStateInfo vmstate_info_bitmap;
     .offset       = vmstate_offset_value(_state, _field, _type),     \
 }
 
+/* Validate state using a boolean predicate. */
+#define VMSTATE_VALIDATE(_name, _test) { \
+    .name         = (_name),                                         \
+    .field_exists = (_test),                                         \
+    .flags        = VMS_ARRAY | VMS_MUST_EXIST,                      \
+    .num          = 0, /* 0 elements: no data, only run _test */     \
+}
+
 #define VMSTATE_POINTER(_field, _state, _version, _info, _type) {    \
     .name       = (stringify(_field)),                               \
     .version_id = (_version),                                        \
diff --git a/kvm-all.c b/kvm-all.c
index 82a9119..2754c15 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -948,7 +948,7 @@ void kvm_init_irq_routing(KVMState *s)
 {
     int gsi_count, i;
 
-    gsi_count = kvm_check_extension(s, KVM_CAP_IRQ_ROUTING);
+    gsi_count = kvm_check_extension(s, KVM_CAP_IRQ_ROUTING) - 1;
     if (gsi_count > 0) {
         unsigned int gsi_bits, i;
 
@@ -2022,12 +2022,13 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
 {
     struct kvm_sw_breakpoint *bp, *next;
     KVMState *s = cpu->kvm_state;
+    CPUState *tmpcpu;
 
     QTAILQ_FOREACH_SAFE(bp, &s->kvm_sw_breakpoints, entry, next) {
         if (kvm_arch_remove_sw_breakpoint(cpu, bp) != 0) {
             /* Try harder to find a CPU that currently sees the breakpoint. */
-            CPU_FOREACH(cpu) {
-                if (kvm_arch_remove_sw_breakpoint(cpu, bp) == 0) {
+            CPU_FOREACH(tmpcpu) {
+                if (kvm_arch_remove_sw_breakpoint(tmpcpu, bp) == 0) {
                     break;
                 }
             }
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index d2380b6..e1ff346 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -267,17 +267,15 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
 
 #ifdef TARGET_ARM
 
+#ifndef TARGET_AARCH64
+/* 32 bit ARM definitions */
+
 #define ELF_START_MMAP 0x80000000
 
 #define elf_check_arch(x) ((x) == ELF_MACHINE)
 
 #define ELF_ARCH        ELF_MACHINE
-
-#ifdef TARGET_AARCH64
-#define ELF_CLASS       ELFCLASS64
-#else
 #define ELF_CLASS       ELFCLASS32
-#endif
 
 static inline void init_thread(struct target_pt_regs *regs,
                                struct image_info *infop)
@@ -285,10 +283,6 @@ static inline void init_thread(struct target_pt_regs *regs,
     abi_long stack = infop->start_stack;
     memset(regs, 0, sizeof(*regs));
 
-#ifdef TARGET_AARCH64
-    regs->pc = infop->entry & ~0x3ULL;
-    regs->sp = stack;
-#else
     regs->ARM_cpsr = 0x10;
     if (infop->entry & 1)
         regs->ARM_cpsr |= CPSR_T;
@@ -302,7 +296,6 @@ static inline void init_thread(struct target_pt_regs *regs,
     /* For uClinux PIC binaries.  */
     /* XXX: Linux does this only on ARM with no MMU (do we care ?) */
     regs->ARM_r10 = infop->start_data;
-#endif
 }
 
 #define ELF_NREG    18
@@ -346,13 +339,20 @@ enum
     ARM_HWCAP_ARM_EDSP      = 1 << 7,
     ARM_HWCAP_ARM_JAVA      = 1 << 8,
     ARM_HWCAP_ARM_IWMMXT    = 1 << 9,
-    ARM_HWCAP_ARM_THUMBEE   = 1 << 10,
-    ARM_HWCAP_ARM_NEON      = 1 << 11,
-    ARM_HWCAP_ARM_VFPv3     = 1 << 12,
-    ARM_HWCAP_ARM_VFPv3D16  = 1 << 13,
+    ARM_HWCAP_ARM_CRUNCH    = 1 << 10,
+    ARM_HWCAP_ARM_THUMBEE   = 1 << 11,
+    ARM_HWCAP_ARM_NEON      = 1 << 12,
+    ARM_HWCAP_ARM_VFPv3     = 1 << 13,
+    ARM_HWCAP_ARM_VFPv3D16  = 1 << 14,
+    ARM_HWCAP_ARM_TLS       = 1 << 15,
+    ARM_HWCAP_ARM_VFPv4     = 1 << 16,
+    ARM_HWCAP_ARM_IDIVA     = 1 << 17,
+    ARM_HWCAP_ARM_IDIVT     = 1 << 18,
+    ARM_HWCAP_ARM_VFPD32    = 1 << 19,
+    ARM_HWCAP_ARM_LPAE      = 1 << 20,
+    ARM_HWCAP_ARM_EVTSTRM   = 1 << 21,
 };
 
-#ifndef TARGET_AARCH64
 /* The commpage only exists for 32 bit kernels */
 
 #define TARGET_HAS_VALIDATE_GUEST_SPACE
@@ -414,7 +414,6 @@ static int validate_guest_space(unsigned long guest_base,
 
     return 1; /* All good */
 }
-#endif
 
 #define ELF_HWCAP get_elf_hwcap()
 
@@ -427,23 +426,103 @@ static uint32_t get_elf_hwcap(void)
     hwcaps |= ARM_HWCAP_ARM_HALF;
     hwcaps |= ARM_HWCAP_ARM_THUMB;
     hwcaps |= ARM_HWCAP_ARM_FAST_MULT;
-    hwcaps |= ARM_HWCAP_ARM_FPA;
 
     /* probe for the extra features */
 #define GET_FEATURE(feat, hwcap) \
     do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0)
+    /* EDSP is in v5TE and above, but all our v5 CPUs are v5TE */
+    GET_FEATURE(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP);
     GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP);
     GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT);
     GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE);
     GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON);
     GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3);
-    GET_FEATURE(ARM_FEATURE_VFP_FP16, ARM_HWCAP_ARM_VFPv3D16);
+    GET_FEATURE(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS);
+    GET_FEATURE(ARM_FEATURE_VFP4, ARM_HWCAP_ARM_VFPv4);
+    GET_FEATURE(ARM_FEATURE_ARM_DIV, ARM_HWCAP_ARM_IDIVA);
+    GET_FEATURE(ARM_FEATURE_THUMB_DIV, ARM_HWCAP_ARM_IDIVT);
+    /* All QEMU's VFPv3 CPUs have 32 registers, see VFP_DREG in translate.c.
+     * Note that the ARM_HWCAP_ARM_VFPv3D16 bit is always the inverse of
+     * ARM_HWCAP_ARM_VFPD32 (and so always clear for QEMU); it is unrelated
+     * to our VFP_FP16 feature bit.
+     */
+    GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPD32);
+    GET_FEATURE(ARM_FEATURE_LPAE, ARM_HWCAP_ARM_LPAE);
 #undef GET_FEATURE
 
     return hwcaps;
 }
 
-#endif
+#else
+/* 64 bit ARM definitions */
+#define ELF_START_MMAP 0x80000000
+
+#define elf_check_arch(x) ((x) == ELF_MACHINE)
+
+#define ELF_ARCH        ELF_MACHINE
+#define ELF_CLASS       ELFCLASS64
+#define ELF_PLATFORM    "aarch64"
+
+static inline void init_thread(struct target_pt_regs *regs,
+                               struct image_info *infop)
+{
+    abi_long stack = infop->start_stack;
+    memset(regs, 0, sizeof(*regs));
+
+    regs->pc = infop->entry & ~0x3ULL;
+    regs->sp = stack;
+}
+
+#define ELF_NREG    34
+typedef target_elf_greg_t  target_elf_gregset_t[ELF_NREG];
+
+static void elf_core_copy_regs(target_elf_gregset_t *regs,
+                               const CPUARMState *env)
+{
+    int i;
+
+    for (i = 0; i < 32; i++) {
+        (*regs)[i] = tswapreg(env->xregs[i]);
+    }
+    (*regs)[32] = tswapreg(env->pc);
+    (*regs)[33] = tswapreg(pstate_read((CPUARMState *)env));
+}
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE       4096
+
+enum {
+    ARM_HWCAP_A64_FP            = 1 << 0,
+    ARM_HWCAP_A64_ASIMD         = 1 << 1,
+    ARM_HWCAP_A64_EVTSTRM       = 1 << 2,
+    ARM_HWCAP_A64_AES           = 1 << 3,
+    ARM_HWCAP_A64_PMULL         = 1 << 4,
+    ARM_HWCAP_A64_SHA1          = 1 << 5,
+    ARM_HWCAP_A64_SHA2          = 1 << 6,
+    ARM_HWCAP_A64_CRC32         = 1 << 7,
+};
+
+#define ELF_HWCAP get_elf_hwcap()
+
+static uint32_t get_elf_hwcap(void)
+{
+    ARMCPU *cpu = ARM_CPU(thread_cpu);
+    uint32_t hwcaps = 0;
+
+    hwcaps |= ARM_HWCAP_A64_FP;
+    hwcaps |= ARM_HWCAP_A64_ASIMD;
+
+    /* probe for the extra features */
+#define GET_FEATURE(feat, hwcap) \
+    do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0)
+    GET_FEATURE(ARM_FEATURE_V8_AES, ARM_HWCAP_A64_PMULL);
+#undef GET_FEATURE
+
+    return hwcaps;
+}
+
+#endif /* not TARGET_AARCH64 */
+#endif /* TARGET_ARM */
 
 #ifdef TARGET_UNICORE32
 
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9864813..2d28bdb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7499,6 +7499,22 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sys_sched_getaffinity(arg1, mask_size, mask));
 
             if (!is_error(ret)) {
+                if (ret > arg2) {
+                    /* More data returned than the caller's buffer will fit.
+                     * This only happens if sizeof(abi_long) < sizeof(long)
+                     * and the caller passed us a buffer holding an odd number
+                     * of abi_longs. If the host kernel is actually using the
+                     * extra 4 bytes then fail EINVAL; otherwise we can just
+                     * ignore them and only copy the interesting part.
+                     */
+                    int numcpus = sysconf(_SC_NPROCESSORS_CONF);
+                    if (numcpus > arg2 * 8) {
+                        ret = -TARGET_EINVAL;
+                        break;
+                    }
+                    ret = arg2;
+                }
+
                 if (copy_to_user(arg3, mask, ret)) {
                     goto efault;
                 }
diff --git a/migration-rdma.c b/migration-rdma.c
index eeb4302..5cd90bd 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -1589,13 +1589,11 @@ static int qemu_rdma_post_send_control(RDMAContext *rdma, uint8_t *buf,
     }
 
 
-    if (ibv_post_send(rdma->qp, &send_wr, &bad_wr)) {
-        return -1;
-    }
+    ret = ibv_post_send(rdma->qp, &send_wr, &bad_wr);
 
-    if (ret < 0) {
+    if (ret > 0) {
         fprintf(stderr, "Failed to use post IB SEND for control!\n");
-        return ret;
+        return -ret;
     }
 
     ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_SEND_CONTROL, NULL);
@@ -2237,10 +2235,6 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
         }
     }
 
-    if (rdma->qp) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX8f-0001st-LG; Thu, 02 Oct 2014 03:33:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8e-0001sl-31
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:08 +0000
Received: from [193.109.254.147:10869] by server-4.bemta-14.messagelabs.com id
	13/FA-01677-377CC245; Thu, 02 Oct 2014 03:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1412220785!12872517!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9272 invoked from network); 2 Oct 2014 03:33:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8Z-000576-A9
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8Z-0007CT-3t
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:03 +0000
Date: Thu, 02 Oct 2014 03:33:03 +0000
Message-Id: <E1XZX8Z-0007CT-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.4-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d01ba5b39d25e12cff51591c00ca82fea6567a59
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 23 14:45:06 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:45:06 2014 +0200

    update Xen version to 4.3.4-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 116aed2..fcbd02e 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 3
-export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX8f-0001st-LG; Thu, 02 Oct 2014 03:33:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8e-0001sl-31
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:08 +0000
Received: from [193.109.254.147:10869] by server-4.bemta-14.messagelabs.com id
	13/FA-01677-377CC245; Thu, 02 Oct 2014 03:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1412220785!12872517!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9272 invoked from network); 2 Oct 2014 03:33:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8Z-000576-A9
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8Z-0007CT-3t
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:03 +0000
Date: Thu, 02 Oct 2014 03:33:03 +0000
Message-Id: <E1XZX8Z-0007CT-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.4-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d01ba5b39d25e12cff51591c00ca82fea6567a59
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 23 14:45:06 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:45:06 2014 +0200

    update Xen version to 4.3.4-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 116aed2..fcbd02e 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 3
-export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX8p-0001th-PZ; Thu, 02 Oct 2014 03:33:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8o-0001tT-E8
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:18 +0000
Received: from [85.158.137.68:41566] by server-5.bemta-3.messagelabs.com id
	8E/42-30889-D77CC245; Thu, 02 Oct 2014 03:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1412220795!8535861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12850 invoked from network); 2 Oct 2014 03:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8l-000579-JY
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8l-0007Cs-H7
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:15 +0000
Date: Thu, 02 Oct 2014 03:33:15 +0000
Message-Id: <E1XZX8l-0007Cs-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/shadow: fix race condition
	sampling the dirty vram state
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2fe29bc7cbebcfe7c343cc25c70298442babbb4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 23 14:45:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:45:56 2014 +0200

    x86/shadow: fix race condition sampling the dirty vram state
    
    d->arch.hvm_domain.dirty_vram must be read with the domain's paging lock held.
    
    If not, two concurrent hypercalls could both end up attempting to free
    dirty_vram (the second of which will free a wild pointer), or both end up
    allocating a new dirty_vram structure (the first of which will be leaked).
    
    This is XSA-104.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 46a49b91f1026f64430b84dd83e845a33f06415e
    master date: 2014-09-23 14:31:47 +0200
---
 xen/arch/x86/mm/shadow/common.c  |    4 +++-
 xen/include/asm-x86/hvm/domain.h |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 72f5718..49d9e06 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3486,7 +3486,7 @@ int shadow_track_dirty_vram(struct domain *d,
     int flush_tlb = 0;
     unsigned long i;
     p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct sh_dirty_vram *dirty_vram;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     if ( end_pfn < begin_pfn || end_pfn > p2m->max_mapped_pfn + 1 )
@@ -3496,6 +3496,8 @@ int shadow_track_dirty_vram(struct domain *d,
     p2m_lock(p2m_get_hostp2m(d));
     paging_lock(d);
 
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
     if ( dirty_vram && (!nr ||
              ( begin_pfn != dirty_vram->begin_pfn
             || end_pfn   != dirty_vram->end_pfn )) )
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..863b097 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -73,7 +73,7 @@ struct hvm_domain {
     /* Memory ranges with pinned cache attributes. */
     struct list_head       pinned_cacheattr_ranges;
 
-    /* VRAM dirty support. */
+    /* VRAM dirty support.  Protect with the domain paging lock. */
     struct sh_dirty_vram *dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX8z-0001ua-SA; Thu, 02 Oct 2014 03:33:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8y-0001uR-8C
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:28 +0000
Received: from [85.158.139.211:18117] by server-2.bemta-5.messagelabs.com id
	5D/E6-31832-787CC245; Thu, 02 Oct 2014 03:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1412220806!8145071!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20756 invoked from network); 2 Oct 2014 03:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8v-00057C-PI
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8v-0007DE-Nn
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:25 +0000
Date: Thu, 02 Oct 2014 03:33:25 +0000
Message-Id: <E1XZX8v-0007DE-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/emulate: check cpl for all
	privileged instructions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e66d14038c0ef4b0f35b7ecdb158a765d57d669c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 23 14:47:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:47:04 2014 +0200

    x86/emulate: check cpl for all privileged instructions
    
    Without this, it is possible for userspace to load its own IDT or GDT.
    
    This is XSA-105.
    
    Reported-by: Andrei LUTAS <vlutas@bitdefender.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrei LUTAS <vlutas@bitdefender.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0e442727ceccfa32a7276cccd205b4722e68fdc1
    master date: 2014-09-23 14:33:06 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 4fdbfc7..e479d86 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3293,6 +3293,7 @@ x86_emulate(
         goto swint;
 
     case 0xf4: /* hlt */
+        generate_exception_if(!mode_ring0(), EXC_GP, 0);
         ctxt->retire.flags.hlt = 1;
         break;
 
@@ -3718,6 +3719,7 @@ x86_emulate(
             break;
         case 2: /* lgdt */
         case 3: /* lidt */
+            generate_exception_if(!mode_ring0(), EXC_GP, 0);
             generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
             fail_if(ops->write_segment == NULL);
             memset(&reg, 0, sizeof(reg));
@@ -3746,6 +3748,7 @@ x86_emulate(
         case 6: /* lmsw */
             fail_if(ops->read_cr == NULL);
             fail_if(ops->write_cr == NULL);
+            generate_exception_if(!mode_ring0(), EXC_GP, 0);
             if ( (rc = ops->read_cr(0, &cr0, ctxt)) )
                 goto done;
             if ( ea.type == OP_REG )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX8z-0001ua-SA; Thu, 02 Oct 2014 03:33:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8y-0001uR-8C
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:28 +0000
Received: from [85.158.139.211:18117] by server-2.bemta-5.messagelabs.com id
	5D/E6-31832-787CC245; Thu, 02 Oct 2014 03:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1412220806!8145071!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20756 invoked from network); 2 Oct 2014 03:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8v-00057C-PI
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8v-0007DE-Nn
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:25 +0000
Date: Thu, 02 Oct 2014 03:33:25 +0000
Message-Id: <E1XZX8v-0007DE-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/emulate: check cpl for all
	privileged instructions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e66d14038c0ef4b0f35b7ecdb158a765d57d669c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 23 14:47:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:47:04 2014 +0200

    x86/emulate: check cpl for all privileged instructions
    
    Without this, it is possible for userspace to load its own IDT or GDT.
    
    This is XSA-105.
    
    Reported-by: Andrei LUTAS <vlutas@bitdefender.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrei LUTAS <vlutas@bitdefender.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0e442727ceccfa32a7276cccd205b4722e68fdc1
    master date: 2014-09-23 14:33:06 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 4fdbfc7..e479d86 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3293,6 +3293,7 @@ x86_emulate(
         goto swint;
 
     case 0xf4: /* hlt */
+        generate_exception_if(!mode_ring0(), EXC_GP, 0);
         ctxt->retire.flags.hlt = 1;
         break;
 
@@ -3718,6 +3719,7 @@ x86_emulate(
             break;
         case 2: /* lgdt */
         case 3: /* lidt */
+            generate_exception_if(!mode_ring0(), EXC_GP, 0);
             generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
             fail_if(ops->write_segment == NULL);
             memset(&reg, 0, sizeof(reg));
@@ -3746,6 +3748,7 @@ x86_emulate(
         case 6: /* lmsw */
             fail_if(ops->read_cr == NULL);
             fail_if(ops->write_cr == NULL);
+            generate_exception_if(!mode_ring0(), EXC_GP, 0);
             if ( (rc = ops->read_cr(0, &cr0, ctxt)) )
                 goto done;
             if ( ea.type == OP_REG )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX8p-0001th-PZ; Thu, 02 Oct 2014 03:33:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8o-0001tT-E8
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:18 +0000
Received: from [85.158.137.68:41566] by server-5.bemta-3.messagelabs.com id
	8E/42-30889-D77CC245; Thu, 02 Oct 2014 03:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1412220795!8535861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12850 invoked from network); 2 Oct 2014 03:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8l-000579-JY
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX8l-0007Cs-H7
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:15 +0000
Date: Thu, 02 Oct 2014 03:33:15 +0000
Message-Id: <E1XZX8l-0007Cs-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/shadow: fix race condition
	sampling the dirty vram state
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2fe29bc7cbebcfe7c343cc25c70298442babbb4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 23 14:45:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:45:56 2014 +0200

    x86/shadow: fix race condition sampling the dirty vram state
    
    d->arch.hvm_domain.dirty_vram must be read with the domain's paging lock held.
    
    If not, two concurrent hypercalls could both end up attempting to free
    dirty_vram (the second of which will free a wild pointer), or both end up
    allocating a new dirty_vram structure (the first of which will be leaked).
    
    This is XSA-104.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 46a49b91f1026f64430b84dd83e845a33f06415e
    master date: 2014-09-23 14:31:47 +0200
---
 xen/arch/x86/mm/shadow/common.c  |    4 +++-
 xen/include/asm-x86/hvm/domain.h |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 72f5718..49d9e06 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3486,7 +3486,7 @@ int shadow_track_dirty_vram(struct domain *d,
     int flush_tlb = 0;
     unsigned long i;
     p2m_type_t t;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct sh_dirty_vram *dirty_vram;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     if ( end_pfn < begin_pfn || end_pfn > p2m->max_mapped_pfn + 1 )
@@ -3496,6 +3496,8 @@ int shadow_track_dirty_vram(struct domain *d,
     p2m_lock(p2m_get_hostp2m(d));
     paging_lock(d);
 
+    dirty_vram = d->arch.hvm_domain.dirty_vram;
+
     if ( dirty_vram && (!nr ||
              ( begin_pfn != dirty_vram->begin_pfn
             || end_pfn   != dirty_vram->end_pfn )) )
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 27b3de5..863b097 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -73,7 +73,7 @@ struct hvm_domain {
     /* Memory ranges with pinned cache attributes. */
     struct list_head       pinned_cacheattr_ranges;
 
-    /* VRAM dirty support. */
+    /* VRAM dirty support.  Protect with the domain paging lock. */
     struct sh_dirty_vram *dirty_vram;
 
     /* If one of vcpus of this domain is in no_fill_mode or
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX99-0001wn-VG; Thu, 02 Oct 2014 03:33:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX98-0001wS-Jt
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:38 +0000
Received: from [85.158.137.68:46030] by server-7.bemta-3.messagelabs.com id
	0D/23-01084-197CC245; Thu, 02 Oct 2014 03:33:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412220816!7261588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27019 invoked from network); 2 Oct 2014 03:33:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX96-00057H-0h
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX95-0007De-W0
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:35 +0000
Date: Thu, 02 Oct 2014 03:33:35 +0000
Message-Id: <E1XZX95-0007De-W0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86emul: only emulate software
	interrupt injection for real mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da91ee426e63b0a76582dac24007379fb07c94d1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 23 14:47:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:47:46 2014 +0200

    x86emul: only emulate software interrupt injection for real mode
    
    Protected mode emulation currently lacks proper privilege checking of
    the referenced IDT entry, and there's currently no legitimate way for
    any of the respective instructions to reach the emulator when the guest
    is in protected mode.
    
    This is XSA-106.
    
    Reported-by: Andrei LUTAS <vlutas@bitdefender.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 346d4545569928b652c40c7815c1732676f8587c
    master date: 2014-09-23 14:33:50 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index e479d86..b95f8a7 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2613,6 +2613,7 @@ x86_emulate(
     case 0xcd: /* int imm8 */
         src.val = insn_fetch_type(uint8_t);
     swint:
+        fail_if(!in_realmode(ctxt, ops)); /* XSA-106 */
         fail_if(ops->inject_sw_interrupt == NULL);
         rc = ops->inject_sw_interrupt(src.val, _regs.eip - ctxt->regs->eip,
                                       ctxt) ? : X86EMUL_EXCEPTION;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 02 03:33:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Oct 2014 03:33:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZX99-0001wn-VG; Thu, 02 Oct 2014 03:33:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX98-0001wS-Jt
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:38 +0000
Received: from [85.158.137.68:46030] by server-7.bemta-3.messagelabs.com id
	0D/23-01084-197CC245; Thu, 02 Oct 2014 03:33:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412220816!7261588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27019 invoked from network); 2 Oct 2014 03:33:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Oct 2014 03:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX96-00057H-0h
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZX95-0007De-W0
	for xen-changelog@lists.xensource.com; Thu, 02 Oct 2014 03:33:35 +0000
Date: Thu, 02 Oct 2014 03:33:35 +0000
Message-Id: <E1XZX95-0007De-W0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86emul: only emulate software
	interrupt injection for real mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da91ee426e63b0a76582dac24007379fb07c94d1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 23 14:47:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 23 14:47:46 2014 +0200

    x86emul: only emulate software interrupt injection for real mode
    
    Protected mode emulation currently lacks proper privilege checking of
    the referenced IDT entry, and there's currently no legitimate way for
    any of the respective instructions to reach the emulator when the guest
    is in protected mode.
    
    This is XSA-106.
    
    Reported-by: Andrei LUTAS <vlutas@bitdefender.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 346d4545569928b652c40c7815c1732676f8587c
    master date: 2014-09-23 14:33:50 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index e479d86..b95f8a7 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2613,6 +2613,7 @@ x86_emulate(
     case 0xcd: /* int imm8 */
         src.val = insn_fetch_type(uint8_t);
     swint:
+        fail_if(!in_realmode(ctxt, ops)); /* XSA-106 */
         fail_if(ops->inject_sw_interrupt == NULL);
         rc = ops->inject_sw_interrupt(src.val, _regs.eip - ctxt->regs->eip,
                                       ctxt) ? : X86EMUL_EXCEPTION;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUI-0003GU-IT; Fri, 03 Oct 2014 05:33:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUH-0003GL-EJ
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:05 +0000
Received: from [85.158.143.35:8833] by server-3.bemta-4.messagelabs.com id
	11/F5-06192-0153E245; Fri, 03 Oct 2014 05:33:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1412314383!13572211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9242 invoked from network); 3 Oct 2014 05:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUF-0005Ea-34
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUE-00024S-Sz
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:02 +0000
Date: Fri, 03 Oct 2014 05:33:02 +0000
Message-Id: <E1XZvUE-00024S-Sz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: properly bound x2APIC MSR
	range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6de14eebd7b414c25094e942f24b2791d7c66c2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 14:59:00 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 14:59:00 2014 +0200

    x86/HVM: properly bound x2APIC MSR range
    
    While the write path change appears to be purely cosmetic (but still
    gets done here for consistency), the read side mistake permitted
    accesses beyond the virtual APIC page.
    
    Note that while this isn't fully in line with the specification
    (digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
    possible fix addressing the security issue and getting x2APIC related
    code into a consistent shape (elsewhere a 256 rather than 1024 wide
    window is being used too). This will be dealt with subsequently.
    
    This is CVE-2014-7188 / XSA-108.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61fdda7acf3de11f3d50d50e5b4f4ecfac7e0d04
    master date: 2014-10-01 14:54:47 +0200
---
 xen/arch/x86/hvm/hvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index be1a2d3..3289604 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3022,7 +3022,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -3148,7 +3148,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUI-0003GU-IT; Fri, 03 Oct 2014 05:33:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUH-0003GL-EJ
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:05 +0000
Received: from [85.158.143.35:8833] by server-3.bemta-4.messagelabs.com id
	11/F5-06192-0153E245; Fri, 03 Oct 2014 05:33:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1412314383!13572211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9242 invoked from network); 3 Oct 2014 05:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUF-0005Ea-34
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUE-00024S-Sz
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:02 +0000
Date: Fri, 03 Oct 2014 05:33:02 +0000
Message-Id: <E1XZvUE-00024S-Sz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: properly bound x2APIC MSR
	range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6de14eebd7b414c25094e942f24b2791d7c66c2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 14:59:00 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 14:59:00 2014 +0200

    x86/HVM: properly bound x2APIC MSR range
    
    While the write path change appears to be purely cosmetic (but still
    gets done here for consistency), the read side mistake permitted
    accesses beyond the virtual APIC page.
    
    Note that while this isn't fully in line with the specification
    (digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
    possible fix addressing the security issue and getting x2APIC related
    code into a consistent shape (elsewhere a 256 rather than 1024 wide
    window is being used too). This will be dealt with subsequently.
    
    This is CVE-2014-7188 / XSA-108.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61fdda7acf3de11f3d50d50e5b4f4ecfac7e0d04
    master date: 2014-10-01 14:54:47 +0200
---
 xen/arch/x86/hvm/hvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index be1a2d3..3289604 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3022,7 +3022,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -3148,7 +3148,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUS-0003HR-L2; Fri, 03 Oct 2014 05:33:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUR-0003HI-Ld
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:15 +0000
Received: from [85.158.139.211:57697] by server-4.bemta-5.messagelabs.com id
	2C/32-10551-B153E245; Fri, 03 Oct 2014 05:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1412314393!11720658!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21703 invoked from network); 3 Oct 2014 05:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUP-0005Eg-CU
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUP-00024q-7C
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:13 +0000
Date: Fri, 03 Oct 2014 05:33:13 +0000
Message-Id: <E1XZvUP-00024q-7C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VMX: fix DebugCtl MSR clearing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 539238ab7a19f8df6743ea96ab4906980b5c2f35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:01:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:01:57 2014 +0200

    VMX: fix DebugCtl MSR clearing
    
    The previous shortcut was wrong, as it bypassed the necessary vmwrite:
    All we really want to avoid if the guest writes zero is to add the MSR
    to the host-load list.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: dfa625e15f3d6c374637f2bb789e1f444c2781c3
    master date: 2014-08-22 14:29:37 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 2cd4c59..678cc59 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2170,8 +2170,6 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         int i, rc = 0;
         uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
 
-        if ( !msr_content )
-            break;
         if ( msr_content & ~supported )
         {
             /* Perhaps some other bits are supported in vpmu. */
@@ -2191,12 +2189,10 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         }
 
         if ( (rc < 0) ||
-             (vmx_add_host_load_msr(msr) < 0) )
+             (msr_content && (vmx_add_host_load_msr(msr) < 0)) )
             hvm_inject_hw_exception(TRAP_machine_check, 0);
         else
-        {
             __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
-        }
 
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUS-0003HR-L2; Fri, 03 Oct 2014 05:33:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUR-0003HI-Ld
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:15 +0000
Received: from [85.158.139.211:57697] by server-4.bemta-5.messagelabs.com id
	2C/32-10551-B153E245; Fri, 03 Oct 2014 05:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1412314393!11720658!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21703 invoked from network); 3 Oct 2014 05:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUP-0005Eg-CU
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUP-00024q-7C
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:13 +0000
Date: Fri, 03 Oct 2014 05:33:13 +0000
Message-Id: <E1XZvUP-00024q-7C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VMX: fix DebugCtl MSR clearing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 539238ab7a19f8df6743ea96ab4906980b5c2f35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:01:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:01:57 2014 +0200

    VMX: fix DebugCtl MSR clearing
    
    The previous shortcut was wrong, as it bypassed the necessary vmwrite:
    All we really want to avoid if the guest writes zero is to add the MSR
    to the host-load list.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: dfa625e15f3d6c374637f2bb789e1f444c2781c3
    master date: 2014-08-22 14:29:37 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 2cd4c59..678cc59 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2170,8 +2170,6 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         int i, rc = 0;
         uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
 
-        if ( !msr_content )
-            break;
         if ( msr_content & ~supported )
         {
             /* Perhaps some other bits are supported in vpmu. */
@@ -2191,12 +2189,10 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         }
 
         if ( (rc < 0) ||
-             (vmx_add_host_load_msr(msr) < 0) )
+             (msr_content && (vmx_add_host_load_msr(msr) < 0)) )
             hvm_inject_hw_exception(TRAP_machine_check, 0);
         else
-        {
             __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
-        }
 
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUd-0003Iy-Ng; Fri, 03 Oct 2014 05:33:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUc-0003Ij-7t
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:26 +0000
Received: from [85.158.139.211:37910] by server-14.bemta-5.messagelabs.com id
	70/3E-12422-5253E245; Fri, 03 Oct 2014 05:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412314403!6344549!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11532 invoked from network); 3 Oct 2014 05:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUZ-0005Em-Hd
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUZ-00025C-FY
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:23 +0000
Date: Fri, 03 Oct 2014 05:33:23 +0000
Message-Id: <E1XZvUZ-00025C-FY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/irq: process softirqs in irq
	keyhandlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 607f9586d144e7f4a0a503f3c1b8cd9ec1fce6da
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 1 15:02:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:02:42 2014 +0200

    x86/irq: process softirqs in irq keyhandlers
    
    Large machines with lots of interrupts can trip over the Xen watchdog.
    
    Suggested-by: Santosh Jodh <Santosh.Jodh@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Santosh Jodh <Santosh.Jodh@citrix.com>
    
    x86/IO-APIC: don't process softirqs during early boot
    
    Commit e13b320399 ("x86/irq: process softirqs in irq keyhandlers")
    made this unconditional, but the boot time use of __print_IO_APIC()
    (when "apic_verbosity=debug" was given) can't tolerate that.
    
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by:  Sander Eikelenboom <linux@eikelenboom.it>
    master commit: e13b3203990706db1313ec2aadd9a30b249ee793
    master date: 2014-08-22 14:32:45 +0200
    master commit: bd083922f9e78ed19ef98e7de372e5f568402ed3
    master date: 2014-08-26 17:56:52 +0200
---
 xen/arch/x86/io_apic.c |   17 ++++++++++++++---
 xen/arch/x86/irq.c     |    4 ++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index bddc588..8f41a06 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -28,6 +28,7 @@
 #include <xen/sched.h>
 #include <xen/acpi.h>
 #include <xen/keyhandler.h>
+#include <xen/softirq.h>
 #include <asm/mc146818rtc.h>
 #include <asm/smp.h>
 #include <asm/desc.h>
@@ -1091,7 +1092,7 @@ static inline void UNEXPECTED_IO_APIC(void)
 {
 }
 
-static void /*__init*/ __print_IO_APIC(void)
+static void /*__init*/ __print_IO_APIC(bool_t boot)
 {
     int apic, i;
     union IO_APIC_reg_00 reg_00;
@@ -1112,6 +1113,9 @@ static void /*__init*/ __print_IO_APIC(void)
     printk(KERN_INFO "testing the IO APIC.......................\n");
 
     for (apic = 0; apic < nr_ioapics; apic++) {
+        if ( !boot )
+            process_pending_softirqs();
+
         if (!nr_ioapic_entries[apic])
             continue;
 
@@ -1215,6 +1219,10 @@ static void /*__init*/ __print_IO_APIC(void)
     printk(KERN_DEBUG "IRQ to pin mappings:\n");
     for (i = 0; i < nr_irqs_gsi; i++) {
         struct irq_pin_list *entry = irq_2_pin + i;
+
+        if ( !boot && !(i & 0x1f) )
+            process_pending_softirqs();
+
         if (entry->pin < 0)
             continue;
         printk(KERN_DEBUG "IRQ%d ", irq_to_desc(i)->arch.vector);
@@ -1235,12 +1243,12 @@ static void /*__init*/ __print_IO_APIC(void)
 static void __init print_IO_APIC(void)
 {
     if (apic_verbosity != APIC_QUIET)
-        __print_IO_APIC();
+        __print_IO_APIC(1);
 }
 
 static void _print_IO_APIC_keyhandler(unsigned char key)
 {
-    __print_IO_APIC();
+    __print_IO_APIC(0);
 }
 static struct keyhandler print_IO_APIC_keyhandler = {
     .diagnostic = 1,
@@ -2454,6 +2462,9 @@ void dump_ioapic_irq_info(void)
 
     for ( irq = 0; irq < nr_irqs_gsi; irq++ )
     {
+        if ( !(irq & 0x1f) )
+            process_pending_softirqs();
+
         entry = &irq_2_pin[irq];
         if ( entry->pin == -1 )
             continue;
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 88444be..72faed0 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -19,6 +19,7 @@
 #include <xen/iommu.h>
 #include <xen/symbols.h>
 #include <xen/trace.h>
+#include <xen/softirq.h>
 #include <xsm/xsm.h>
 #include <asm/msi.h>
 #include <asm/current.h>
@@ -2231,6 +2232,8 @@ static void dump_irqs(unsigned char key)
 
     for ( irq = 0; irq < nr_irqs; irq++ )
     {
+        if ( !(irq & 0x1f) )
+            process_pending_softirqs();
 
         desc = irq_to_desc(irq);
 
@@ -2284,6 +2287,7 @@ static void dump_irqs(unsigned char key)
         xfree(ssid);
     }
 
+    process_pending_softirqs();
     printk("Direct vector information:\n");
     for ( i = FIRST_DYNAMIC_VECTOR; i < NR_VECTORS; ++i )
         if ( direct_apic_vector[i] )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUd-0003Iy-Ng; Fri, 03 Oct 2014 05:33:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUc-0003Ij-7t
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:26 +0000
Received: from [85.158.139.211:37910] by server-14.bemta-5.messagelabs.com id
	70/3E-12422-5253E245; Fri, 03 Oct 2014 05:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412314403!6344549!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11532 invoked from network); 3 Oct 2014 05:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUZ-0005Em-Hd
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUZ-00025C-FY
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:23 +0000
Date: Fri, 03 Oct 2014 05:33:23 +0000
Message-Id: <E1XZvUZ-00025C-FY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/irq: process softirqs in irq
	keyhandlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 607f9586d144e7f4a0a503f3c1b8cd9ec1fce6da
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 1 15:02:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:02:42 2014 +0200

    x86/irq: process softirqs in irq keyhandlers
    
    Large machines with lots of interrupts can trip over the Xen watchdog.
    
    Suggested-by: Santosh Jodh <Santosh.Jodh@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Santosh Jodh <Santosh.Jodh@citrix.com>
    
    x86/IO-APIC: don't process softirqs during early boot
    
    Commit e13b320399 ("x86/irq: process softirqs in irq keyhandlers")
    made this unconditional, but the boot time use of __print_IO_APIC()
    (when "apic_verbosity=debug" was given) can't tolerate that.
    
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by:  Sander Eikelenboom <linux@eikelenboom.it>
    master commit: e13b3203990706db1313ec2aadd9a30b249ee793
    master date: 2014-08-22 14:32:45 +0200
    master commit: bd083922f9e78ed19ef98e7de372e5f568402ed3
    master date: 2014-08-26 17:56:52 +0200
---
 xen/arch/x86/io_apic.c |   17 ++++++++++++++---
 xen/arch/x86/irq.c     |    4 ++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index bddc588..8f41a06 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -28,6 +28,7 @@
 #include <xen/sched.h>
 #include <xen/acpi.h>
 #include <xen/keyhandler.h>
+#include <xen/softirq.h>
 #include <asm/mc146818rtc.h>
 #include <asm/smp.h>
 #include <asm/desc.h>
@@ -1091,7 +1092,7 @@ static inline void UNEXPECTED_IO_APIC(void)
 {
 }
 
-static void /*__init*/ __print_IO_APIC(void)
+static void /*__init*/ __print_IO_APIC(bool_t boot)
 {
     int apic, i;
     union IO_APIC_reg_00 reg_00;
@@ -1112,6 +1113,9 @@ static void /*__init*/ __print_IO_APIC(void)
     printk(KERN_INFO "testing the IO APIC.......................\n");
 
     for (apic = 0; apic < nr_ioapics; apic++) {
+        if ( !boot )
+            process_pending_softirqs();
+
         if (!nr_ioapic_entries[apic])
             continue;
 
@@ -1215,6 +1219,10 @@ static void /*__init*/ __print_IO_APIC(void)
     printk(KERN_DEBUG "IRQ to pin mappings:\n");
     for (i = 0; i < nr_irqs_gsi; i++) {
         struct irq_pin_list *entry = irq_2_pin + i;
+
+        if ( !boot && !(i & 0x1f) )
+            process_pending_softirqs();
+
         if (entry->pin < 0)
             continue;
         printk(KERN_DEBUG "IRQ%d ", irq_to_desc(i)->arch.vector);
@@ -1235,12 +1243,12 @@ static void /*__init*/ __print_IO_APIC(void)
 static void __init print_IO_APIC(void)
 {
     if (apic_verbosity != APIC_QUIET)
-        __print_IO_APIC();
+        __print_IO_APIC(1);
 }
 
 static void _print_IO_APIC_keyhandler(unsigned char key)
 {
-    __print_IO_APIC();
+    __print_IO_APIC(0);
 }
 static struct keyhandler print_IO_APIC_keyhandler = {
     .diagnostic = 1,
@@ -2454,6 +2462,9 @@ void dump_ioapic_irq_info(void)
 
     for ( irq = 0; irq < nr_irqs_gsi; irq++ )
     {
+        if ( !(irq & 0x1f) )
+            process_pending_softirqs();
+
         entry = &irq_2_pin[irq];
         if ( entry->pin == -1 )
             continue;
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 88444be..72faed0 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -19,6 +19,7 @@
 #include <xen/iommu.h>
 #include <xen/symbols.h>
 #include <xen/trace.h>
+#include <xen/softirq.h>
 #include <xsm/xsm.h>
 #include <asm/msi.h>
 #include <asm/current.h>
@@ -2231,6 +2232,8 @@ static void dump_irqs(unsigned char key)
 
     for ( irq = 0; irq < nr_irqs; irq++ )
     {
+        if ( !(irq & 0x1f) )
+            process_pending_softirqs();
 
         desc = irq_to_desc(irq);
 
@@ -2284,6 +2287,7 @@ static void dump_irqs(unsigned char key)
         xfree(ssid);
     }
 
+    process_pending_softirqs();
     printk("Direct vector information:\n");
     for ( i = FIRST_DYNAMIC_VECTOR; i < NR_VECTORS; ++i )
         if ( direct_apic_vector[i] )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUn-0003KY-QW; Fri, 03 Oct 2014 05:33:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUm-0003KE-5T
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:36 +0000
Received: from [85.158.143.35:24338] by server-1.bemta-4.messagelabs.com id
	A9/C4-05872-F253E245; Fri, 03 Oct 2014 05:33:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1412314413!13512915!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13619 invoked from network); 3 Oct 2014 05:33:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUj-0005Eu-N9
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUj-00025c-Lo
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:33 +0000
Date: Fri, 03 Oct 2014 05:33:33 +0000
Message-Id: <E1XZvUj-00025c-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/ats: Disable Address
	Translation Services by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 755a81ec9860c3f2291e275c13832d58677b39bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 1 15:03:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:03:52 2014 +0200

    x86/ats: Disable Address Translation Services by default
    
    Xen cannot safely use any ATS functionality until it gains asynchronous queued
    invalidation support, because of the current synchronous wait for completion.
    
    Do not turn ATS on by default.
    
    While editing the default in the command line documentation, correct the
    statement regarding PCI Passthrough.  ATS is purely a performance
    optimisation, and is certainly not required for PCI Passthrough to function.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: ad6eddb742577d182e634785bcfaf92732a50024
    master date: 2014-08-28 16:05:10 +0200
---
 docs/misc/xen-command-line.markdown |    9 ++++++---
 xen/drivers/passthrough/x86/ats.c   |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 293d5ac..6841f04 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -167,10 +167,13 @@ developers wishing Xen to fall back to older timing methods on newer hardware.
 ### ats
 > `= <boolean>`
 
-> Default: `true`
+> Default: `false`
+
+Permits Xen to set up and use PCI Address Translation Services.  This is a
+performance optimisation for PCI Passthrough.
 
-Permits Xen to set up and use PCI Address Translation Services, which
-is required for PCI Passthrough.
+**WARNING: Xen cannot currently safely use ATS because of its synchronous wait
+loops for Queued Invalidation completions.**
 
 ### availmem
 > `= <size>`
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index 1e3e03a..436eada 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -20,7 +20,7 @@
 
 LIST_HEAD(ats_devices);
 
-bool_t __read_mostly ats_enabled = 1;
+bool_t __read_mostly ats_enabled = 0;
 boolean_param("ats", ats_enabled);
 
 int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUn-0003KY-QW; Fri, 03 Oct 2014 05:33:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUm-0003KE-5T
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:36 +0000
Received: from [85.158.143.35:24338] by server-1.bemta-4.messagelabs.com id
	A9/C4-05872-F253E245; Fri, 03 Oct 2014 05:33:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1412314413!13512915!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13619 invoked from network); 3 Oct 2014 05:33:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUj-0005Eu-N9
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUj-00025c-Lo
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:33 +0000
Date: Fri, 03 Oct 2014 05:33:33 +0000
Message-Id: <E1XZvUj-00025c-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/ats: Disable Address
	Translation Services by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 755a81ec9860c3f2291e275c13832d58677b39bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 1 15:03:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:03:52 2014 +0200

    x86/ats: Disable Address Translation Services by default
    
    Xen cannot safely use any ATS functionality until it gains asynchronous queued
    invalidation support, because of the current synchronous wait for completion.
    
    Do not turn ATS on by default.
    
    While editing the default in the command line documentation, correct the
    statement regarding PCI Passthrough.  ATS is purely a performance
    optimisation, and is certainly not required for PCI Passthrough to function.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: ad6eddb742577d182e634785bcfaf92732a50024
    master date: 2014-08-28 16:05:10 +0200
---
 docs/misc/xen-command-line.markdown |    9 ++++++---
 xen/drivers/passthrough/x86/ats.c   |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 293d5ac..6841f04 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -167,10 +167,13 @@ developers wishing Xen to fall back to older timing methods on newer hardware.
 ### ats
 > `= <boolean>`
 
-> Default: `true`
+> Default: `false`
+
+Permits Xen to set up and use PCI Address Translation Services.  This is a
+performance optimisation for PCI Passthrough.
 
-Permits Xen to set up and use PCI Address Translation Services, which
-is required for PCI Passthrough.
+**WARNING: Xen cannot currently safely use ATS because of its synchronous wait
+loops for Queued Invalidation completions.**
 
 ### availmem
 > `= <size>`
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index 1e3e03a..436eada 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -20,7 +20,7 @@
 
 LIST_HEAD(ats_devices);
 
-bool_t __read_mostly ats_enabled = 1;
+bool_t __read_mostly ats_enabled = 0;
 boolean_param("ats", ats_enabled);
 
 int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUy-0003MK-TG; Fri, 03 Oct 2014 05:33:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUx-0003M3-8L
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:47 +0000
Received: from [193.109.254.147:26281] by server-10.bemta-14.messagelabs.com
	id EA/F2-01463-A353E245; Fri, 03 Oct 2014 05:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1412314424!13109615!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2281 invoked from network); 3 Oct 2014 05:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUt-0005F0-SX
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUt-00026k-Ql
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:43 +0000
Date: Fri, 03 Oct 2014 05:33:43 +0000
Message-Id: <E1XZvUt-00026k-Ql@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NMI: allow processing unknown
	NMIs when watchdog is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae5c3023da9a2cfa869f78094e5da3b89361a915
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Wed Oct 1 15:05:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:05:40 2014 +0200

    x86/NMI: allow processing unknown NMIs when watchdog is enabled
    
    Change NMI processing so that if watchdog=force is passed on the
    command-line and the NMI is not caused by a perf counter overflow (i.e.
    likely not a watchdog "tick"), the NMI is handled by the unknown NMI
    handler.
    
    This allows injection of NMIs from IPMI controllers that don't set the
    IOCK/SERR bits to trigger the unknown NMI handler rather than be
    ignored.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Fix command line parsing (don't enable the watchdog on e.g.
    "watchdog=xyz").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    x86/NMI: allow passing just "watchdog" again
    
    This capability got inadvertently lost in commit 3ea2ba980a ("x86/NMI:
    allow processing unknown NMIs when watchdog is enabled") due to an
    oversight of mine.
    
    Reported-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3ea2ba980afe7356c613c8e1ba00d223d1c25412
    master date: 2014-08-28 16:11:37 +0200
    master commit: fd553ae5f0f57baa63d033bedee84f607de57d33
    master date: 2014-09-03 15:09:59 +0200
---
 docs/misc/xen-command-line.markdown |    6 ++-
 xen/arch/x86/nmi.c                  |   53 +++++++++++++++++++++++++++++++++-
 xen/arch/x86/traps.c                |    7 ++--
 xen/include/asm-x86/apic.h          |    2 +-
 xen/include/asm-x86/nmi.h           |    3 ++
 5 files changed, 63 insertions(+), 8 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 6841f04..43f6fdd 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1013,12 +1013,14 @@ As the BTS virtualisation is not 100% safe and because of the nehalem quirk
 don't use the vpmu flag on production systems with Intel cpus!
 
 ### watchdog
-> `= <boolean>`
+> `= force | <boolean>`
 
 > Default: `false`
 
 Run an NMI watchdog on each processor.  If a processor is stuck for
-longer than the **watchdog\_timeout**, a panic occurs.
+longer than the **watchdog\_timeout**, a panic occurs.  When `force` is
+specified, in addition to running an NMI watchdog on each processor,
+unknown NMIs will still be processed.
 
 ### watchdog\_timeout
 > `= <integer>`
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 7aaab8a..eb26f98 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -43,7 +43,32 @@ static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks);
 
 /* opt_watchdog: If true, run a watchdog NMI on each processor. */
 bool_t __initdata opt_watchdog = 0;
-boolean_param("watchdog", opt_watchdog);
+
+/* watchdog_force: If true, process unknown NMIs when running the watchdog. */
+bool_t watchdog_force = 0;
+
+static void __init parse_watchdog(char *s)
+{
+    if ( !*s )
+    {
+        opt_watchdog = 1;
+        return;
+    }
+
+    switch ( parse_bool(s) )
+    {
+    case 0:
+        opt_watchdog = 0;
+        return;
+    case 1:
+        opt_watchdog = 1;
+        return;
+    }
+
+    if ( !strcmp(s, "force") )
+        watchdog_force = opt_watchdog = 1;
+}
+custom_param("watchdog", parse_watchdog);
 
 /* opt_watchdog_timeout: Number of seconds to wait before panic. */
 static unsigned int opt_watchdog_timeout = 5;
@@ -82,6 +107,7 @@ int nmi_active;
 #define K7_EVNTSEL_USR		(1 << 16)
 #define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING	0x76
 #define K7_NMI_EVENT		K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING
+#define K7_EVENT_WIDTH          32
 
 #define P6_EVNTSEL0_ENABLE	(1 << 22)
 #define P6_EVNTSEL_INT		(1 << 20)
@@ -89,10 +115,12 @@ int nmi_active;
 #define P6_EVNTSEL_USR		(1 << 16)
 #define P6_EVENT_CPU_CLOCKS_NOT_HALTED	 0x79
 #define CORE_EVENT_CPU_CLOCKS_NOT_HALTED 0x3c
+#define P6_EVENT_WIDTH          32
 
 #define P4_ESCR_EVENT_SELECT(N)	((N)<<25)
 #define P4_CCCR_OVF_PMI0	(1<<26)
 #define P4_CCCR_OVF_PMI1	(1<<27)
+#define P4_CCCR_OVF		(1<<31)
 #define P4_CCCR_THRESHOLD(N)	((N)<<20)
 #define P4_CCCR_COMPLEMENT	(1<<19)
 #define P4_CCCR_COMPARE		(1<<18)
@@ -433,8 +461,10 @@ int __init watchdog_setup(void)
     return 0;
 }
 
-void nmi_watchdog_tick(struct cpu_user_regs * regs)
+/* Returns false if this was not a watchdog NMI, true otherwise */
+bool_t nmi_watchdog_tick(struct cpu_user_regs *regs)
 {
+    bool_t watchdog_tick = 1;
     unsigned int sum = this_cpu(nmi_timer_ticks);
 
     if ( (this_cpu(last_irq_sums) == sum) && watchdog_enabled() )
@@ -460,8 +490,15 @@ void nmi_watchdog_tick(struct cpu_user_regs * regs)
 
     if ( nmi_perfctr_msr )
     {
+        uint64_t msr_content;
+
+        /* Work out if this is a watchdog tick by checking for overflow. */
         if ( nmi_perfctr_msr == MSR_P4_IQ_PERFCTR0 )
         {
+            rdmsrl(MSR_P4_IQ_CCCR0, msr_content);
+            if ( !(msr_content & P4_CCCR_OVF) )
+                watchdog_tick = 0;
+
             /*
              * P4 quirks:
              * - An overflown perfctr will assert its interrupt
@@ -474,14 +511,26 @@ void nmi_watchdog_tick(struct cpu_user_regs * regs)
         }
         else if ( nmi_perfctr_msr == MSR_P6_PERFCTR0 )
         {
+            rdmsrl(MSR_P6_PERFCTR0, msr_content);
+            if ( msr_content & (1ULL << P6_EVENT_WIDTH) )
+                watchdog_tick = 0;
+
             /*
              * Only P6 based Pentium M need to re-unmask the apic vector but
              * it doesn't hurt other P6 variants.
              */
             apic_write(APIC_LVTPC, APIC_DM_NMI);
         }
+        else if ( nmi_perfctr_msr == MSR_K7_PERFCTR0 )
+        {
+            rdmsrl(MSR_K7_PERFCTR0, msr_content);
+            if ( msr_content & (1ULL << K7_EVENT_WIDTH) )
+                watchdog_tick = 0;
+        }
         write_watchdog_counter(NULL);
     }
+
+    return watchdog_tick;
 }
 
 /*
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4d27e12..feb7cb0 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3226,14 +3226,15 @@ void do_nmi(struct cpu_user_regs *regs)
 {
     unsigned int cpu = smp_processor_id();
     unsigned char reason;
+    bool_t handle_unknown = 0;
 
     ++nmi_count(cpu);
 
     if ( nmi_callback(regs, cpu) )
         return;
 
-    if ( nmi_watchdog )
-        nmi_watchdog_tick(regs);
+    if ( !nmi_watchdog || (!nmi_watchdog_tick(regs) && watchdog_force) )
+        handle_unknown = 1;
 
     /* Only the BSP gets external NMIs from the system. */
     if ( cpu == 0 )
@@ -3243,7 +3244,7 @@ void do_nmi(struct cpu_user_regs *regs)
             pci_serr_error(regs);
         if ( reason & 0x40 )
             io_check_error(regs);
-        if ( !(reason & 0xc0) && !nmi_watchdog )
+        if ( !(reason & 0xc0) && handle_unknown )
             unknown_nmi_error(regs, reason);
     }
 }
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 43b39ce..a807ca0 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -206,7 +206,7 @@ extern void release_lapic_nmi(void);
 extern void self_nmi(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
-extern void nmi_watchdog_tick (struct cpu_user_regs *regs);
+extern bool_t nmi_watchdog_tick (struct cpu_user_regs *regs);
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
diff --git a/xen/include/asm-x86/nmi.h b/xen/include/asm-x86/nmi.h
index 98b5e04..a8bcbea 100644
--- a/xen/include/asm-x86/nmi.h
+++ b/xen/include/asm-x86/nmi.h
@@ -8,6 +8,9 @@ struct cpu_user_regs;
 
 /* Watchdog boolean from the command line */
 extern bool_t opt_watchdog;
+
+/* Watchdog force parameter from the command line */
+extern bool_t watchdog_force;
  
 typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
  
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvUy-0003MK-TG; Fri, 03 Oct 2014 05:33:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUx-0003M3-8L
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:47 +0000
Received: from [193.109.254.147:26281] by server-10.bemta-14.messagelabs.com
	id EA/F2-01463-A353E245; Fri, 03 Oct 2014 05:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1412314424!13109615!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2281 invoked from network); 3 Oct 2014 05:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUt-0005F0-SX
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvUt-00026k-Ql
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:43 +0000
Date: Fri, 03 Oct 2014 05:33:43 +0000
Message-Id: <E1XZvUt-00026k-Ql@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/NMI: allow processing unknown
	NMIs when watchdog is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae5c3023da9a2cfa869f78094e5da3b89361a915
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Wed Oct 1 15:05:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:05:40 2014 +0200

    x86/NMI: allow processing unknown NMIs when watchdog is enabled
    
    Change NMI processing so that if watchdog=force is passed on the
    command-line and the NMI is not caused by a perf counter overflow (i.e.
    likely not a watchdog "tick"), the NMI is handled by the unknown NMI
    handler.
    
    This allows injection of NMIs from IPMI controllers that don't set the
    IOCK/SERR bits to trigger the unknown NMI handler rather than be
    ignored.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Fix command line parsing (don't enable the watchdog on e.g.
    "watchdog=xyz").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    
    x86/NMI: allow passing just "watchdog" again
    
    This capability got inadvertently lost in commit 3ea2ba980a ("x86/NMI:
    allow processing unknown NMIs when watchdog is enabled") due to an
    oversight of mine.
    
    Reported-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3ea2ba980afe7356c613c8e1ba00d223d1c25412
    master date: 2014-08-28 16:11:37 +0200
    master commit: fd553ae5f0f57baa63d033bedee84f607de57d33
    master date: 2014-09-03 15:09:59 +0200
---
 docs/misc/xen-command-line.markdown |    6 ++-
 xen/arch/x86/nmi.c                  |   53 +++++++++++++++++++++++++++++++++-
 xen/arch/x86/traps.c                |    7 ++--
 xen/include/asm-x86/apic.h          |    2 +-
 xen/include/asm-x86/nmi.h           |    3 ++
 5 files changed, 63 insertions(+), 8 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 6841f04..43f6fdd 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1013,12 +1013,14 @@ As the BTS virtualisation is not 100% safe and because of the nehalem quirk
 don't use the vpmu flag on production systems with Intel cpus!
 
 ### watchdog
-> `= <boolean>`
+> `= force | <boolean>`
 
 > Default: `false`
 
 Run an NMI watchdog on each processor.  If a processor is stuck for
-longer than the **watchdog\_timeout**, a panic occurs.
+longer than the **watchdog\_timeout**, a panic occurs.  When `force` is
+specified, in addition to running an NMI watchdog on each processor,
+unknown NMIs will still be processed.
 
 ### watchdog\_timeout
 > `= <integer>`
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 7aaab8a..eb26f98 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -43,7 +43,32 @@ static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks);
 
 /* opt_watchdog: If true, run a watchdog NMI on each processor. */
 bool_t __initdata opt_watchdog = 0;
-boolean_param("watchdog", opt_watchdog);
+
+/* watchdog_force: If true, process unknown NMIs when running the watchdog. */
+bool_t watchdog_force = 0;
+
+static void __init parse_watchdog(char *s)
+{
+    if ( !*s )
+    {
+        opt_watchdog = 1;
+        return;
+    }
+
+    switch ( parse_bool(s) )
+    {
+    case 0:
+        opt_watchdog = 0;
+        return;
+    case 1:
+        opt_watchdog = 1;
+        return;
+    }
+
+    if ( !strcmp(s, "force") )
+        watchdog_force = opt_watchdog = 1;
+}
+custom_param("watchdog", parse_watchdog);
 
 /* opt_watchdog_timeout: Number of seconds to wait before panic. */
 static unsigned int opt_watchdog_timeout = 5;
@@ -82,6 +107,7 @@ int nmi_active;
 #define K7_EVNTSEL_USR		(1 << 16)
 #define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING	0x76
 #define K7_NMI_EVENT		K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING
+#define K7_EVENT_WIDTH          32
 
 #define P6_EVNTSEL0_ENABLE	(1 << 22)
 #define P6_EVNTSEL_INT		(1 << 20)
@@ -89,10 +115,12 @@ int nmi_active;
 #define P6_EVNTSEL_USR		(1 << 16)
 #define P6_EVENT_CPU_CLOCKS_NOT_HALTED	 0x79
 #define CORE_EVENT_CPU_CLOCKS_NOT_HALTED 0x3c
+#define P6_EVENT_WIDTH          32
 
 #define P4_ESCR_EVENT_SELECT(N)	((N)<<25)
 #define P4_CCCR_OVF_PMI0	(1<<26)
 #define P4_CCCR_OVF_PMI1	(1<<27)
+#define P4_CCCR_OVF		(1<<31)
 #define P4_CCCR_THRESHOLD(N)	((N)<<20)
 #define P4_CCCR_COMPLEMENT	(1<<19)
 #define P4_CCCR_COMPARE		(1<<18)
@@ -433,8 +461,10 @@ int __init watchdog_setup(void)
     return 0;
 }
 
-void nmi_watchdog_tick(struct cpu_user_regs * regs)
+/* Returns false if this was not a watchdog NMI, true otherwise */
+bool_t nmi_watchdog_tick(struct cpu_user_regs *regs)
 {
+    bool_t watchdog_tick = 1;
     unsigned int sum = this_cpu(nmi_timer_ticks);
 
     if ( (this_cpu(last_irq_sums) == sum) && watchdog_enabled() )
@@ -460,8 +490,15 @@ void nmi_watchdog_tick(struct cpu_user_regs * regs)
 
     if ( nmi_perfctr_msr )
     {
+        uint64_t msr_content;
+
+        /* Work out if this is a watchdog tick by checking for overflow. */
         if ( nmi_perfctr_msr == MSR_P4_IQ_PERFCTR0 )
         {
+            rdmsrl(MSR_P4_IQ_CCCR0, msr_content);
+            if ( !(msr_content & P4_CCCR_OVF) )
+                watchdog_tick = 0;
+
             /*
              * P4 quirks:
              * - An overflown perfctr will assert its interrupt
@@ -474,14 +511,26 @@ void nmi_watchdog_tick(struct cpu_user_regs * regs)
         }
         else if ( nmi_perfctr_msr == MSR_P6_PERFCTR0 )
         {
+            rdmsrl(MSR_P6_PERFCTR0, msr_content);
+            if ( msr_content & (1ULL << P6_EVENT_WIDTH) )
+                watchdog_tick = 0;
+
             /*
              * Only P6 based Pentium M need to re-unmask the apic vector but
              * it doesn't hurt other P6 variants.
              */
             apic_write(APIC_LVTPC, APIC_DM_NMI);
         }
+        else if ( nmi_perfctr_msr == MSR_K7_PERFCTR0 )
+        {
+            rdmsrl(MSR_K7_PERFCTR0, msr_content);
+            if ( msr_content & (1ULL << K7_EVENT_WIDTH) )
+                watchdog_tick = 0;
+        }
         write_watchdog_counter(NULL);
     }
+
+    return watchdog_tick;
 }
 
 /*
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4d27e12..feb7cb0 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3226,14 +3226,15 @@ void do_nmi(struct cpu_user_regs *regs)
 {
     unsigned int cpu = smp_processor_id();
     unsigned char reason;
+    bool_t handle_unknown = 0;
 
     ++nmi_count(cpu);
 
     if ( nmi_callback(regs, cpu) )
         return;
 
-    if ( nmi_watchdog )
-        nmi_watchdog_tick(regs);
+    if ( !nmi_watchdog || (!nmi_watchdog_tick(regs) && watchdog_force) )
+        handle_unknown = 1;
 
     /* Only the BSP gets external NMIs from the system. */
     if ( cpu == 0 )
@@ -3243,7 +3244,7 @@ void do_nmi(struct cpu_user_regs *regs)
             pci_serr_error(regs);
         if ( reason & 0x40 )
             io_check_error(regs);
-        if ( !(reason & 0xc0) && !nmi_watchdog )
+        if ( !(reason & 0xc0) && handle_unknown )
             unknown_nmi_error(regs, reason);
     }
 }
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 43b39ce..a807ca0 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -206,7 +206,7 @@ extern void release_lapic_nmi(void);
 extern void self_nmi(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
-extern void nmi_watchdog_tick (struct cpu_user_regs *regs);
+extern bool_t nmi_watchdog_tick (struct cpu_user_regs *regs);
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
diff --git a/xen/include/asm-x86/nmi.h b/xen/include/asm-x86/nmi.h
index 98b5e04..a8bcbea 100644
--- a/xen/include/asm-x86/nmi.h
+++ b/xen/include/asm-x86/nmi.h
@@ -8,6 +8,9 @@ struct cpu_user_regs;
 
 /* Watchdog boolean from the command line */
 extern bool_t opt_watchdog;
+
+/* Watchdog force parameter from the command line */
+extern bool_t watchdog_force;
  
 typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
  
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvV8-0003NY-2u; Fri, 03 Oct 2014 05:33:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvV6-0003NL-LF
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:56 +0000
Received: from [193.109.254.147:38091] by server-14.bemta-14.messagelabs.com
	id 38/D2-18345-4453E245; Fri, 03 Oct 2014 05:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1412314434!13100613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14760 invoked from network); 3 Oct 2014 05:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvV4-0005F9-3F
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvV4-000276-0S
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:54 +0000
Date: Fri, 03 Oct 2014 05:33:54 +0000
Message-Id: <E1XZvV4-000276-0S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: suppress UR signaling for
	further desktop chipsets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b46a92326fe68625d7563da3f8f06164654757e3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:06:39 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:06:39 2014 +0200

    VT-d: suppress UR signaling for further desktop chipsets
    
    This extends commit d6cb14b34f ("VT-d: suppress UR signaling for
    desktop chipsets") as per the finally obtained list of affected
    chipsets from Intel.
    
    Also pad the IDs we had listed there before to full 4 hex digits.
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 3e2331d271cc0882e4013c8f20398c46c35f90a1
    master date: 2014-09-18 15:03:22 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 647723d..2fac35d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -474,10 +474,12 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                action, seg, bus, dev, func);
         break;
 
-    case 0x100: case 0x104: case 0x108: /* Sandybridge */
-    case 0x150: case 0x154: case 0x158: /* Ivybridge */
-    case 0xa04: /* Haswell ULT */
-    case 0xc00: case 0xc04: case 0xc08: /* Haswell */
+    case 0x0040: case 0x0044: case 0x0048: /* Nehalem/Westmere */
+    case 0x0100: case 0x0104: case 0x0108: /* Sandybridge */
+    case 0x0150: case 0x0154: case 0x0158: /* Ivybridge */
+    case 0x0a04: /* Haswell ULT */
+    case 0x0c00: case 0x0c04: case 0x0c08: /* Haswell */
+    case 0x1600: case 0x1604: case 0x1608: /* Broadwell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
         pa = bar & 0x7ffffff000UL; /* bits 12...38 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 03 05:33:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2014 05:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XZvV8-0003NY-2u; Fri, 03 Oct 2014 05:33:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvV6-0003NL-LF
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:56 +0000
Received: from [193.109.254.147:38091] by server-14.bemta-14.messagelabs.com
	id 38/D2-18345-4453E245; Fri, 03 Oct 2014 05:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1412314434!13100613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14760 invoked from network); 3 Oct 2014 05:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Oct 2014 05:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvV4-0005F9-3F
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XZvV4-000276-0S
	for xen-changelog@lists.xensource.com; Fri, 03 Oct 2014 05:33:54 +0000
Date: Fri, 03 Oct 2014 05:33:54 +0000
Message-Id: <E1XZvV4-000276-0S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: suppress UR signaling for
	further desktop chipsets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b46a92326fe68625d7563da3f8f06164654757e3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:06:39 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:06:39 2014 +0200

    VT-d: suppress UR signaling for further desktop chipsets
    
    This extends commit d6cb14b34f ("VT-d: suppress UR signaling for
    desktop chipsets") as per the finally obtained list of affected
    chipsets from Intel.
    
    Also pad the IDs we had listed there before to full 4 hex digits.
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 3e2331d271cc0882e4013c8f20398c46c35f90a1
    master date: 2014-09-18 15:03:22 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 647723d..2fac35d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -474,10 +474,12 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                action, seg, bus, dev, func);
         break;
 
-    case 0x100: case 0x104: case 0x108: /* Sandybridge */
-    case 0x150: case 0x154: case 0x158: /* Ivybridge */
-    case 0xa04: /* Haswell ULT */
-    case 0xc00: case 0xc04: case 0xc08: /* Haswell */
+    case 0x0040: case 0x0044: case 0x0048: /* Nehalem/Westmere */
+    case 0x0100: case 0x0104: case 0x0108: /* Sandybridge */
+    case 0x0150: case 0x0154: case 0x0158: /* Ivybridge */
+    case 0x0a04: /* Haswell ULT */
+    case 0x0c00: case 0x0c04: case 0x0c08: /* Haswell */
+    case 0x1600: case 0x1604: case 0x1608: /* Broadwell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
         pa = bar & 0x7ffffff000UL; /* bits 12...38 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sun Oct 05 13:22:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Oct 2014 13:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XallG-0003xa-IO; Sun, 05 Oct 2014 13:22:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XallF-0003xV-Pp
	for xen-changelog@lists.xensource.com; Sun, 05 Oct 2014 13:22:05 +0000
Received: from [85.158.139.211:29516] by server-11.bemta-5.messagelabs.com id
	83/A2-11011-CF541345; Sun, 05 Oct 2014 13:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412515323!6681148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30139 invoked from network); 5 Oct 2014 13:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2014 13:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XallD-00078w-0W
	for xen-changelog@lists.xensource.com; Sun, 05 Oct 2014 13:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XallC-0006pc-KR
	for xen-changelog@lists.xensource.com; Sun, 05 Oct 2014 13:22:02 +0000
Date: Sun, 05 Oct 2014 13:22:02 +0000
Message-Id: <E1XallC-0006pc-KR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/HVM: properly bound x2APIC MSR
	range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fad105dd0ac1a224d91757afee01acd4566f7e82
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:13:17 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:13:17 2014 +0200

    x86/HVM: properly bound x2APIC MSR range
    
    While the write path change appears to be purely cosmetic (but still
    gets done here for consistency), the read side mistake permitted
    accesses beyond the virtual APIC page.
    
    Note that while this isn't fully in line with the specification
    (digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
    possible fix addressing the security issue and getting x2APIC related
    code into a consistent shape (elsewhere a 256 rather than 1024 wide
    window is being used too). This will be dealt with subsequently.
    
    This is CVE-2014-7188 / XSA-108.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61fdda7acf3de11f3d50d50e5b4f4ecfac7e0d04
    master date: 2014-10-01 14:54:47 +0200
---
 xen/arch/x86/hvm/hvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 153b89a..edef31b 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2878,7 +2878,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -2998,7 +2998,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sun Oct 05 13:22:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Oct 2014 13:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XallG-0003xa-IO; Sun, 05 Oct 2014 13:22:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XallF-0003xV-Pp
	for xen-changelog@lists.xensource.com; Sun, 05 Oct 2014 13:22:05 +0000
Received: from [85.158.139.211:29516] by server-11.bemta-5.messagelabs.com id
	83/A2-11011-CF541345; Sun, 05 Oct 2014 13:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412515323!6681148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30139 invoked from network); 5 Oct 2014 13:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2014 13:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XallD-00078w-0W
	for xen-changelog@lists.xensource.com; Sun, 05 Oct 2014 13:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XallC-0006pc-KR
	for xen-changelog@lists.xensource.com; Sun, 05 Oct 2014 13:22:02 +0000
Date: Sun, 05 Oct 2014 13:22:02 +0000
Message-Id: <E1XallC-0006pc-KR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/HVM: properly bound x2APIC MSR
	range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fad105dd0ac1a224d91757afee01acd4566f7e82
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:13:17 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:13:17 2014 +0200

    x86/HVM: properly bound x2APIC MSR range
    
    While the write path change appears to be purely cosmetic (but still
    gets done here for consistency), the read side mistake permitted
    accesses beyond the virtual APIC page.
    
    Note that while this isn't fully in line with the specification
    (digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
    possible fix addressing the security issue and getting x2APIC related
    code into a consistent shape (elsewhere a 256 rather than 1024 wide
    window is being used too). This will be dealt with subsequently.
    
    This is CVE-2014-7188 / XSA-108.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61fdda7acf3de11f3d50d50e5b4f4ecfac7e0d04
    master date: 2014-10-01 14:54:47 +0200
---
 xen/arch/x86/hvm/hvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 153b89a..edef31b 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2878,7 +2878,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -2998,7 +2998,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Oct 06 09:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2014 09:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xb4Ju-0004xN-CO; Mon, 06 Oct 2014 09:11:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Xb4Jt-0004xI-CS
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 09:11:05 +0000
Received: from [85.158.143.35:16611] by server-3.bemta-4.messagelabs.com id
	A1/F4-06192-8AC52345; Mon, 06 Oct 2014 09:11:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1412586663!14065293!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22248 invoked from network); 6 Oct 2014 09:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2014 09:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Xb4Jq-0003Xu-Rh
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 09:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Xb4Jq-0002aL-I3
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 09:11:02 +0000
Message-Id: <E1Xb4Jq-0002aL-I3@xenbits.xen.org>
Date: Mon, 06 Oct 2014 09:11:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] usbback: don't access request
	fields in shared ring more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1412586418 -7200
# Node ID 809680069660b199d48fc9e235cfdefdcf391ca7
# Parent  ab22257ffed27a8700322f1a185a399dca909c59
usbback: don't access request fields in shared ring more than once

... as being unsafe (prone to the fields changing under our feet). Now
that we copy the request, undo 1264:ab22257ffed2 ("usbback: mark
request as consumed after finished using it") at once.

For the usbbk_hotplug_notify() case adjust the code slightly too
despite there not being explicit issues - just make obvious that there
are no multiple field accesses here by not even using an intermediate
variable.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r ab22257ffed2 -r 809680069660 drivers/xen/usbback/usbback.c
--- a/drivers/xen/usbback/usbback.c	Fri Sep 26 12:04:11 2014 +0200
+++ b/drivers/xen/usbback/usbback.c	Mon Oct 06 11:06:58 2014 +0200
@@ -970,7 +970,6 @@ fail_response:
 static int usbbk_start_submit_urb(usbif_t *usbif)
 {
 	usbif_urb_back_ring_t *urb_ring = &usbif->urb_ring;
-	usbif_urb_request_t *req;
 	pending_req_t *pending_req;
 	RING_IDX rc, rp;
 	int more_to_do = 0;
@@ -989,6 +988,8 @@ static int usbbk_start_submit_urb(usbif_
 	}
 
 	while (rc != rp) {
+		usbif_urb_request_t req;
+
 		if (RING_REQUEST_CONS_OVERFLOW(urb_ring, rc)) {
 			if(printk_ratelimit())
 				printk(KERN_WARNING "usbback: "
@@ -1002,11 +1003,11 @@ static int usbbk_start_submit_urb(usbif_
 			break;
 		}
 
-		req = RING_GET_REQUEST(urb_ring, rc);
+		req = *RING_GET_REQUEST(urb_ring, rc);
+		urb_ring->req_cons = ++rc;
+		barrier();
 
-		dispatch_request_to_pending_reqs(usbif, req,
-							pending_req);
-		urb_ring->req_cons = ++rc;
+		dispatch_request_to_pending_reqs(usbif, &req, pending_req);
 
 		cond_resched();
 	}
@@ -1019,7 +1020,6 @@ static int usbbk_start_submit_urb(usbif_
 void usbbk_hotplug_notify(usbif_t *usbif, int portnum, int speed)
 {
 	usbif_conn_back_ring_t *ring = &usbif->conn_ring;
-	usbif_conn_request_t *req;
 	usbif_conn_response_t *res;
 	unsigned long flags;
 	u16 id;
@@ -1027,8 +1027,7 @@ void usbbk_hotplug_notify(usbif_t *usbif
 
 	spin_lock_irqsave(&usbif->conn_ring_lock, flags);
 
-	req = RING_GET_REQUEST(ring, ring->req_cons);;
-	id = req->id;
+	id = RING_GET_REQUEST(ring, ring->req_cons)->id;
 	ring->req_cons++;
 	ring->sring->req_event = ring->req_cons + 1;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Oct 06 09:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2014 09:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xb4Ju-0004xN-CO; Mon, 06 Oct 2014 09:11:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Xb4Jt-0004xI-CS
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 09:11:05 +0000
Received: from [85.158.143.35:16611] by server-3.bemta-4.messagelabs.com id
	A1/F4-06192-8AC52345; Mon, 06 Oct 2014 09:11:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1412586663!14065293!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22248 invoked from network); 6 Oct 2014 09:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2014 09:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Xb4Jq-0003Xu-Rh
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 09:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Xb4Jq-0002aL-I3
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 09:11:02 +0000
Message-Id: <E1Xb4Jq-0002aL-I3@xenbits.xen.org>
Date: Mon, 06 Oct 2014 09:11:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] usbback: don't access request
	fields in shared ring more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1412586418 -7200
# Node ID 809680069660b199d48fc9e235cfdefdcf391ca7
# Parent  ab22257ffed27a8700322f1a185a399dca909c59
usbback: don't access request fields in shared ring more than once

... as being unsafe (prone to the fields changing under our feet). Now
that we copy the request, undo 1264:ab22257ffed2 ("usbback: mark
request as consumed after finished using it") at once.

For the usbbk_hotplug_notify() case adjust the code slightly too
despite there not being explicit issues - just make obvious that there
are no multiple field accesses here by not even using an intermediate
variable.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r ab22257ffed2 -r 809680069660 drivers/xen/usbback/usbback.c
--- a/drivers/xen/usbback/usbback.c	Fri Sep 26 12:04:11 2014 +0200
+++ b/drivers/xen/usbback/usbback.c	Mon Oct 06 11:06:58 2014 +0200
@@ -970,7 +970,6 @@ fail_response:
 static int usbbk_start_submit_urb(usbif_t *usbif)
 {
 	usbif_urb_back_ring_t *urb_ring = &usbif->urb_ring;
-	usbif_urb_request_t *req;
 	pending_req_t *pending_req;
 	RING_IDX rc, rp;
 	int more_to_do = 0;
@@ -989,6 +988,8 @@ static int usbbk_start_submit_urb(usbif_
 	}
 
 	while (rc != rp) {
+		usbif_urb_request_t req;
+
 		if (RING_REQUEST_CONS_OVERFLOW(urb_ring, rc)) {
 			if(printk_ratelimit())
 				printk(KERN_WARNING "usbback: "
@@ -1002,11 +1003,11 @@ static int usbbk_start_submit_urb(usbif_
 			break;
 		}
 
-		req = RING_GET_REQUEST(urb_ring, rc);
+		req = *RING_GET_REQUEST(urb_ring, rc);
+		urb_ring->req_cons = ++rc;
+		barrier();
 
-		dispatch_request_to_pending_reqs(usbif, req,
-							pending_req);
-		urb_ring->req_cons = ++rc;
+		dispatch_request_to_pending_reqs(usbif, &req, pending_req);
 
 		cond_resched();
 	}
@@ -1019,7 +1020,6 @@ static int usbbk_start_submit_urb(usbif_
 void usbbk_hotplug_notify(usbif_t *usbif, int portnum, int speed)
 {
 	usbif_conn_back_ring_t *ring = &usbif->conn_ring;
-	usbif_conn_request_t *req;
 	usbif_conn_response_t *res;
 	unsigned long flags;
 	u16 id;
@@ -1027,8 +1027,7 @@ void usbbk_hotplug_notify(usbif_t *usbif
 
 	spin_lock_irqsave(&usbif->conn_ring_lock, flags);
 
-	req = RING_GET_REQUEST(ring, ring->req_cons);;
-	id = req->id;
+	id = RING_GET_REQUEST(ring, ring->req_cons)->id;
 	ring->req_cons++;
 	ring->sring->req_event = ring->req_cons + 1;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Oct 06 16:22:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2014 16:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbB2z-0001Cv-Tf; Mon, 06 Oct 2014 16:22:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbB2z-0001Cq-4U
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 16:22:05 +0000
Received: from [85.158.137.68:51775] by server-14.bemta-3.messagelabs.com id
	4F/86-01575-CA1C2345; Mon, 06 Oct 2014 16:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1412612522!11796049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1332 invoked from network); 6 Oct 2014 16:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2014 16:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbB2w-0000Bt-Jm
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 16:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbB2w-0000Ps-Fn
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 16:22:02 +0000
Date: Mon, 06 Oct 2014 16:22:02 +0000
Message-Id: <E1XbB2w-0000Ps-Fn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen-trad: Switch to
	$(LIBEXEC_BIN) from $(LIBEXEC)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0d42741f8e9a00854c3b3faca1da84bfc69bf22
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Oct 6 16:24:46 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 6 16:50:24 2014 +0100

    qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
    
    The meaning of LIBEXEC in the Xen build system has been made to
    follow the more conventional meaning.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen-config.mak    |    2 +-
 xen-setup-stubdom |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen-config.mak b/xen-config.mak
index 77fef4f..280af0c 100644
--- a/xen-config.mak
+++ b/xen-config.mak
@@ -9,4 +9,4 @@ CONFIG_SOFTMMU=yes
 
 CFLAGS += -I$(QEMU_ROOT)/hw
 
-bindir = ${LIBEXEC}
+bindir = ${LIBEXEC_BIN}
diff --git a/xen-setup-stubdom b/xen-setup-stubdom
index 4f1b081..b523509 100755
--- a/xen-setup-stubdom
+++ b/xen-setup-stubdom
@@ -22,7 +22,7 @@ TARGET_CPPFLAGS += $TARGET_CPPFLAGS -DCONFIG_STUBDOM -D__XEN_TOOLS__
 TARGET_CFLAGS= $TARGET_CFLAGS
 TARGET_LDFLAGS= $TARGET_LDFLAGS
 
-bindir = \${LIBEXEC}
+bindir = \${LIBEXEC_BIN}
 END
 mv -f $target/config.mak.new $target/config.mak
 #----------
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Oct 06 16:22:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2014 16:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbB2z-0001Cv-Tf; Mon, 06 Oct 2014 16:22:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbB2z-0001Cq-4U
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 16:22:05 +0000
Received: from [85.158.137.68:51775] by server-14.bemta-3.messagelabs.com id
	4F/86-01575-CA1C2345; Mon, 06 Oct 2014 16:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1412612522!11796049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1332 invoked from network); 6 Oct 2014 16:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Oct 2014 16:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbB2w-0000Bt-Jm
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 16:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbB2w-0000Ps-Fn
	for xen-changelog@lists.xensource.com; Mon, 06 Oct 2014 16:22:02 +0000
Date: Mon, 06 Oct 2014 16:22:02 +0000
Message-Id: <E1XbB2w-0000Ps-Fn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen-trad: Switch to
	$(LIBEXEC_BIN) from $(LIBEXEC)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0d42741f8e9a00854c3b3faca1da84bfc69bf22
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Oct 6 16:24:46 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 6 16:50:24 2014 +0100

    qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
    
    The meaning of LIBEXEC in the Xen build system has been made to
    follow the more conventional meaning.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen-config.mak    |    2 +-
 xen-setup-stubdom |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen-config.mak b/xen-config.mak
index 77fef4f..280af0c 100644
--- a/xen-config.mak
+++ b/xen-config.mak
@@ -9,4 +9,4 @@ CONFIG_SOFTMMU=yes
 
 CFLAGS += -I$(QEMU_ROOT)/hw
 
-bindir = ${LIBEXEC}
+bindir = ${LIBEXEC_BIN}
diff --git a/xen-setup-stubdom b/xen-setup-stubdom
index 4f1b081..b523509 100755
--- a/xen-setup-stubdom
+++ b/xen-setup-stubdom
@@ -22,7 +22,7 @@ TARGET_CPPFLAGS += $TARGET_CPPFLAGS -DCONFIG_STUBDOM -D__XEN_TOOLS__
 TARGET_CFLAGS= $TARGET_CFLAGS
 TARGET_LDFLAGS= $TARGET_LDFLAGS
 
-bindir = \${LIBEXEC}
+bindir = \${LIBEXEC_BIN}
 END
 mv -f $target/config.mak.new $target/config.mak
 #----------
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Oct 07 10:00:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2014 10:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbRZ4-0000Jd-Rc; Tue, 07 Oct 2014 10:00:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1XbRZ2-0000JY-HH
	for xen-changelog@lists.xensource.com; Tue, 07 Oct 2014 10:00:16 +0000
Received: from [85.158.139.211:48842] by server-11.bemta-5.messagelabs.com id
	16/D1-11011-FA9B3345; Tue, 07 Oct 2014 10:00:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1412676013!12419037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24918 invoked from network); 7 Oct 2014 10:00:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Oct 2014 10:00:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1XbRYu-0002ci-GY
	for xen-changelog@lists.xensource.com; Tue, 07 Oct 2014 10:00:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1XbRYp-00024u-5Q
	for xen-changelog@lists.xensource.com; Tue, 07 Oct 2014 10:00:03 +0000
Message-Id: <E1XbRYp-00024u-5Q@xenbits.xen.org>
Date: Tue, 07 Oct 2014 10:00:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] PCI/MSI: drop dead control word
	read
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1412675816 -7200
# Node ID 851b8fba77e7bc08cacab58c3ff277ed8473f048
# Parent  809680069660b199d48fc9e235cfdefdcf391ca7
PCI/MSI: drop dead control word read

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 809680069660 -r 851b8fba77e7 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Mon Oct 06 11:06:58 2014 +0200
+++ b/drivers/pci/msi-xen.c	Tue Oct 07 11:56:56 2014 +0200
@@ -508,11 +508,8 @@ void pci_restore_msix_state(struct pci_d
 static int msi_capability_init(struct pci_dev *dev)
 {
 	int pos, pirq;
-	u16 control;
 
 	pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
-	pci_read_config_word(dev, msi_control_reg(pos), &control);
-
 	pirq = msi_map_vector(dev, 0, 0);
 	if (pirq < 0)
 		return -EBUSY;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Oct 07 10:00:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2014 10:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbRZ4-0000Jd-Rc; Tue, 07 Oct 2014 10:00:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1XbRZ2-0000JY-HH
	for xen-changelog@lists.xensource.com; Tue, 07 Oct 2014 10:00:16 +0000
Received: from [85.158.139.211:48842] by server-11.bemta-5.messagelabs.com id
	16/D1-11011-FA9B3345; Tue, 07 Oct 2014 10:00:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-206.messagelabs.com!1412676013!12419037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24918 invoked from network); 7 Oct 2014 10:00:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Oct 2014 10:00:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1XbRYu-0002ci-GY
	for xen-changelog@lists.xensource.com; Tue, 07 Oct 2014 10:00:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1XbRYp-00024u-5Q
	for xen-changelog@lists.xensource.com; Tue, 07 Oct 2014 10:00:03 +0000
Message-Id: <E1XbRYp-00024u-5Q@xenbits.xen.org>
Date: Tue, 07 Oct 2014 10:00:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] PCI/MSI: drop dead control word
	read
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1412675816 -7200
# Node ID 851b8fba77e7bc08cacab58c3ff277ed8473f048
# Parent  809680069660b199d48fc9e235cfdefdcf391ca7
PCI/MSI: drop dead control word read

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 809680069660 -r 851b8fba77e7 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Mon Oct 06 11:06:58 2014 +0200
+++ b/drivers/pci/msi-xen.c	Tue Oct 07 11:56:56 2014 +0200
@@ -508,11 +508,8 @@ void pci_restore_msix_state(struct pci_d
 static int msi_capability_init(struct pci_dev *dev)
 {
 	int pos, pirq;
-	u16 control;
 
 	pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
-	pci_read_config_word(dev, msi_control_reg(pos), &control);
-
 	pirq = msi_map_vector(dev, 0, 0);
 	if (pirq < 0)
 		return -EBUSY;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 00:55:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 00:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbfX5-0001qg-QW; Wed, 08 Oct 2014 00:55:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbfX4-0001qb-LQ
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 00:55:10 +0000
Received: from [85.158.139.211:10477] by server-17.bemta-5.messagelabs.com id
	6E/46-08943-E6B84345; Wed, 08 Oct 2014 00:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1412729708!10957556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2236 invoked from network); 8 Oct 2014 00:55:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 00:55:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbfX1-0004rC-0q
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 00:55:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbfX0-0000GE-An
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 00:55:06 +0000
Date: Wed, 08 Oct 2014 00:55:06 +0000
Message-Id: <E1XbfX0-0000GE-An@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move vtpmmgr helpers from tools to
	stubdom
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***
    Previously reported histories end at:
        e01fa4e223fc077e18936d890dbd4813c3e7c9b1

commit f9b87b670cb2757d2f537f38f836deae4dc63fb8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Oct 1 18:41:29 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 6 17:00:24 2014 +0100

    move vtpmmgr helpers from tools to stubdom
    
    Tools.mk contains a dead CONFIG_VTPM, @vtpm@ is never expanded because
    @vtpm@ is only known by stubdom/configure.ac. Move the two perl scripts
    to stubdom/vtpmmgr and install them as executeable. This was introduced
    by the recent commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
    add example control tools")
    Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently)
    not used by make itself.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 00:55:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 00:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbfX5-0001qg-QW; Wed, 08 Oct 2014 00:55:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbfX4-0001qb-LQ
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 00:55:10 +0000
Received: from [85.158.139.211:10477] by server-17.bemta-5.messagelabs.com id
	6E/46-08943-E6B84345; Wed, 08 Oct 2014 00:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1412729708!10957556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2236 invoked from network); 8 Oct 2014 00:55:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 00:55:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbfX1-0004rC-0q
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 00:55:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbfX0-0000GE-An
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 00:55:06 +0000
Date: Wed, 08 Oct 2014 00:55:06 +0000
Message-Id: <E1XbfX0-0000GE-An@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move vtpmmgr helpers from tools to
	stubdom
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

*** New tip has no discernable common ancestor with previous history ***
    Previously reported histories end at:
        e01fa4e223fc077e18936d890dbd4813c3e7c9b1

commit f9b87b670cb2757d2f537f38f836deae4dc63fb8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Oct 1 18:41:29 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 6 17:00:24 2014 +0100

    move vtpmmgr helpers from tools to stubdom
    
    Tools.mk contains a dead CONFIG_VTPM, @vtpm@ is never expanded because
    @vtpm@ is only known by stubdom/configure.ac. Move the two perl scripts
    to stubdom/vtpmmgr and install them as executeable. This was introduced
    by the recent commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
    add example control tools")
    Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently)
    not used by make itself.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwT7-0006wS-6U; Wed, 08 Oct 2014 19:00:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwT6-0006wH-8o
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:12 +0000
Received: from [85.158.139.211:23244] by server-4.bemta-5.messagelabs.com id
	08/25-10551-BB985345; Wed, 08 Oct 2014 19:00:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1412794810!12790942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1325 invoked from network); 8 Oct 2014 19:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwT2-0007Xj-DF
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwSx-0003OT-0Q
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:03 +0000
Date: Wed, 08 Oct 2014 19:00:03 +0000
Message-Id: <E1XbwSx-0003OT-0Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: properly bound x2APIC MSR
	range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 534084207cca8e2060b2ed2fe1c8b7190a3e1897
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:09:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:09:12 2014 +0200

    x86/HVM: properly bound x2APIC MSR range
    
    While the write path change appears to be purely cosmetic (but still
    gets done here for consistency), the read side mistake permitted
    accesses beyond the virtual APIC page.
    
    Note that while this isn't fully in line with the specification
    (digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
    possible fix addressing the security issue and getting x2APIC related
    code into a consistent shape (elsewhere a 256 rather than 1024 wide
    window is being used too). This will be dealt with subsequently.
    
    This is CVE-2014-7188 / XSA-108.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61fdda7acf3de11f3d50d50e5b4f4ecfac7e0d04
    master date: 2014-10-01 14:54:47 +0200
---
 xen/arch/x86/hvm/hvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 329369b..7f669f9 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2944,7 +2944,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -3070,7 +3070,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwT7-0006wS-6U; Wed, 08 Oct 2014 19:00:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwT6-0006wH-8o
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:12 +0000
Received: from [85.158.139.211:23244] by server-4.bemta-5.messagelabs.com id
	08/25-10551-BB985345; Wed, 08 Oct 2014 19:00:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1412794810!12790942!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1325 invoked from network); 8 Oct 2014 19:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwT2-0007Xj-DF
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwSx-0003OT-0Q
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:03 +0000
Date: Wed, 08 Oct 2014 19:00:03 +0000
Message-Id: <E1XbwSx-0003OT-0Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: properly bound x2APIC MSR
	range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 534084207cca8e2060b2ed2fe1c8b7190a3e1897
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:09:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:09:12 2014 +0200

    x86/HVM: properly bound x2APIC MSR range
    
    While the write path change appears to be purely cosmetic (but still
    gets done here for consistency), the read side mistake permitted
    accesses beyond the virtual APIC page.
    
    Note that while this isn't fully in line with the specification
    (digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
    possible fix addressing the security issue and getting x2APIC related
    code into a consistent shape (elsewhere a 256 rather than 1024 wide
    window is being used too). This will be dealt with subsequently.
    
    This is CVE-2014-7188 / XSA-108.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61fdda7acf3de11f3d50d50e5b4f4ecfac7e0d04
    master date: 2014-10-01 14:54:47 +0200
---
 xen/arch/x86/hvm/hvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 329369b..7f669f9 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2944,7 +2944,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -3070,7 +3070,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwTI-0006yM-9X; Wed, 08 Oct 2014 19:00:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTG-0006y1-Ls
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:22 +0000
Received: from [193.109.254.147:19401] by server-8.bemta-14.messagelabs.com id
	F0/37-01875-6C985345; Wed, 08 Oct 2014 19:00:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1412794820!14192704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4506 invoked from network); 8 Oct 2014 19:00:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTE-0007Xp-8Y
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTE-0003Ox-2C
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:20 +0000
Date: Wed, 08 Oct 2014 19:00:20 +0000
Message-Id: <E1XbwTE-0003Ox-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/ats: Disable Address
	Translation Services by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f72b736b94140b31caaabfb0e26171c0624ebd9e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 1 15:10:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:10:08 2014 +0200

    x86/ats: Disable Address Translation Services by default
    
    Xen cannot safely use any ATS functionality until it gains asynchronous queued
    invalidation support, because of the current synchronous wait for completion.
    
    Do not turn ATS on by default.
    
    While editing the default in the command line documentation, correct the
    statement regarding PCI Passthrough.  ATS is purely a performance
    optimisation, and is certainly not required for PCI Passthrough to function.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: ad6eddb742577d182e634785bcfaf92732a50024
    master date: 2014-08-28 16:05:10 +0200
---
 docs/misc/xen-command-line.markdown |    9 ++++++---
 xen/drivers/passthrough/x86/ats.c   |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 1057190..6e50f0a 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -158,10 +158,13 @@ Increase the verbosity of the APIC code from the default value.
 ### ats
 > `= <boolean>`
 
-> Default: `true`
+> Default: `false`
+
+Permits Xen to set up and use PCI Address Translation Services.  This is a
+performance optimisation for PCI Passthrough.
 
-Permits Xen to set up and use PCI Address Translation Services, which
-is required for PCI Passthrough.
+**WARNING: Xen cannot currently safely use ATS because of its synchronous wait
+loops for Queued Invalidation completions.**
 
 ### availmem
 > `= <size>`
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index 1e3e03a..436eada 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -20,7 +20,7 @@
 
 LIST_HEAD(ats_devices);
 
-bool_t __read_mostly ats_enabled = 1;
+bool_t __read_mostly ats_enabled = 0;
 boolean_param("ats", ats_enabled);
 
 int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwTI-0006yM-9X; Wed, 08 Oct 2014 19:00:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTG-0006y1-Ls
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:22 +0000
Received: from [193.109.254.147:19401] by server-8.bemta-14.messagelabs.com id
	F0/37-01875-6C985345; Wed, 08 Oct 2014 19:00:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1412794820!14192704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4506 invoked from network); 8 Oct 2014 19:00:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTE-0007Xp-8Y
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTE-0003Ox-2C
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:20 +0000
Date: Wed, 08 Oct 2014 19:00:20 +0000
Message-Id: <E1XbwTE-0003Ox-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/ats: Disable Address
	Translation Services by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f72b736b94140b31caaabfb0e26171c0624ebd9e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 1 15:10:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:10:08 2014 +0200

    x86/ats: Disable Address Translation Services by default
    
    Xen cannot safely use any ATS functionality until it gains asynchronous queued
    invalidation support, because of the current synchronous wait for completion.
    
    Do not turn ATS on by default.
    
    While editing the default in the command line documentation, correct the
    statement regarding PCI Passthrough.  ATS is purely a performance
    optimisation, and is certainly not required for PCI Passthrough to function.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: ad6eddb742577d182e634785bcfaf92732a50024
    master date: 2014-08-28 16:05:10 +0200
---
 docs/misc/xen-command-line.markdown |    9 ++++++---
 xen/drivers/passthrough/x86/ats.c   |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 1057190..6e50f0a 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -158,10 +158,13 @@ Increase the verbosity of the APIC code from the default value.
 ### ats
 > `= <boolean>`
 
-> Default: `true`
+> Default: `false`
+
+Permits Xen to set up and use PCI Address Translation Services.  This is a
+performance optimisation for PCI Passthrough.
 
-Permits Xen to set up and use PCI Address Translation Services, which
-is required for PCI Passthrough.
+**WARNING: Xen cannot currently safely use ATS because of its synchronous wait
+loops for Queued Invalidation completions.**
 
 ### availmem
 > `= <size>`
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index 1e3e03a..436eada 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -20,7 +20,7 @@
 
 LIST_HEAD(ats_devices);
 
-bool_t __read_mostly ats_enabled = 1;
+bool_t __read_mostly ats_enabled = 0;
 boolean_param("ats", ats_enabled);
 
 int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwTS-00071B-EM; Wed, 08 Oct 2014 19:00:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTR-00070z-1Q
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:33 +0000
Received: from [193.109.254.147:9455] by server-16.bemta-14.messagelabs.com id
	BA/67-16990-0D985345; Wed, 08 Oct 2014 19:00:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1412794830!14178838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31198 invoked from network); 8 Oct 2014 19:00:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTO-0007Y0-Iv
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTO-0003PK-BT
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:30 +0000
Date: Wed, 08 Oct 2014 19:00:30 +0000
Message-Id: <E1XbwTO-0003PK-BT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: suppress UR signaling for
	further desktop chipsets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b4c96f62222a7a4a61e0ab8c6171f968af7b665
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:11:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:11:07 2014 +0200

    VT-d: suppress UR signaling for further desktop chipsets
    
    This extends commit d6cb14b34f ("VT-d: suppress UR signaling for
    desktop chipsets") as per the finally obtained list of affected
    chipsets from Intel.
    
    Also pad the IDs we had listed there before to full 4 hex digits.
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 3e2331d271cc0882e4013c8f20398c46c35f90a1
    master date: 2014-09-18 15:03:22 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 647723d..2fac35d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -474,10 +474,12 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                action, seg, bus, dev, func);
         break;
 
-    case 0x100: case 0x104: case 0x108: /* Sandybridge */
-    case 0x150: case 0x154: case 0x158: /* Ivybridge */
-    case 0xa04: /* Haswell ULT */
-    case 0xc00: case 0xc04: case 0xc08: /* Haswell */
+    case 0x0040: case 0x0044: case 0x0048: /* Nehalem/Westmere */
+    case 0x0100: case 0x0104: case 0x0108: /* Sandybridge */
+    case 0x0150: case 0x0154: case 0x0158: /* Ivybridge */
+    case 0x0a04: /* Haswell ULT */
+    case 0x0c00: case 0x0c04: case 0x0c08: /* Haswell */
+    case 0x1600: case 0x1604: case 0x1608: /* Broadwell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
         pa = bar & 0x7ffffff000UL; /* bits 12...38 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwTS-00071B-EM; Wed, 08 Oct 2014 19:00:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTR-00070z-1Q
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:33 +0000
Received: from [193.109.254.147:9455] by server-16.bemta-14.messagelabs.com id
	BA/67-16990-0D985345; Wed, 08 Oct 2014 19:00:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1412794830!14178838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31198 invoked from network); 8 Oct 2014 19:00:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTO-0007Y0-Iv
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTO-0003PK-BT
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:30 +0000
Date: Wed, 08 Oct 2014 19:00:30 +0000
Message-Id: <E1XbwTO-0003PK-BT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: suppress UR signaling for
	further desktop chipsets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b4c96f62222a7a4a61e0ab8c6171f968af7b665
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:11:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:11:07 2014 +0200

    VT-d: suppress UR signaling for further desktop chipsets
    
    This extends commit d6cb14b34f ("VT-d: suppress UR signaling for
    desktop chipsets") as per the finally obtained list of affected
    chipsets from Intel.
    
    Also pad the IDs we had listed there before to full 4 hex digits.
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 3e2331d271cc0882e4013c8f20398c46c35f90a1
    master date: 2014-09-18 15:03:22 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 647723d..2fac35d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -474,10 +474,12 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                action, seg, bus, dev, func);
         break;
 
-    case 0x100: case 0x104: case 0x108: /* Sandybridge */
-    case 0x150: case 0x154: case 0x158: /* Ivybridge */
-    case 0xa04: /* Haswell ULT */
-    case 0xc00: case 0xc04: case 0xc08: /* Haswell */
+    case 0x0040: case 0x0044: case 0x0048: /* Nehalem/Westmere */
+    case 0x0100: case 0x0104: case 0x0108: /* Sandybridge */
+    case 0x0150: case 0x0154: case 0x0158: /* Ivybridge */
+    case 0x0a04: /* Haswell ULT */
+    case 0x0c00: case 0x0c04: case 0x0c08: /* Haswell */
+    case 0x1600: case 0x1604: case 0x1608: /* Broadwell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
         pa = bar & 0x7ffffff000UL; /* bits 12...38 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwTd-00073I-HL; Wed, 08 Oct 2014 19:00:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTb-00072o-Iz
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:43 +0000
Received: from [85.158.137.68:10785] by server-5.bemta-3.messagelabs.com id
	A7/91-30889-AD985345; Wed, 08 Oct 2014 19:00:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412794840!8600090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13689 invoked from network); 8 Oct 2014 19:00:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTY-0007Y6-Oe
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTY-0003Qm-MC
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:40 +0000
Date: Wed, 08 Oct 2014 19:00:40 +0000
Message-Id: <E1XbwTY-0003Qm-MC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: fix DebugCtl MSR clearing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2510d34206f0b10a8684da5611e24f4f53a23f1e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:11:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:11:46 2014 +0200

    VMX: fix DebugCtl MSR clearing
    
    The previous shortcut was wrong, as it bypassed the necessary vmwrite:
    All we really want to avoid if the guest writes zero is to add the MSR
    to the host-load list.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: dfa625e15f3d6c374637f2bb789e1f444c2781c3
    master date: 2014-08-22 14:29:37 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index c60fb22..bf7d8f1 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2132,8 +2132,6 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         int i, rc = 0;
         uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
 
-        if ( !msr_content )
-            break;
         if ( msr_content & ~supported )
         {
             /* Perhaps some other bits are supported in vpmu. */
@@ -2153,12 +2151,10 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         }
 
         if ( (rc < 0) ||
-             (vmx_add_host_load_msr(msr) < 0) )
+             (msr_content && (vmx_add_host_load_msr(msr) < 0)) )
             hvm_inject_hw_exception(TRAP_machine_check, 0);
         else
-        {
             __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
-        }
 
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 08 19:00:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2014 19:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XbwTd-00073I-HL; Wed, 08 Oct 2014 19:00:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTb-00072o-Iz
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:43 +0000
Received: from [85.158.137.68:10785] by server-5.bemta-3.messagelabs.com id
	A7/91-30889-AD985345; Wed, 08 Oct 2014 19:00:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412794840!8600090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13689 invoked from network); 8 Oct 2014 19:00:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2014 19:00:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTY-0007Y6-Oe
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XbwTY-0003Qm-MC
	for xen-changelog@lists.xensource.com; Wed, 08 Oct 2014 19:00:40 +0000
Date: Wed, 08 Oct 2014 19:00:40 +0000
Message-Id: <E1XbwTY-0003Qm-MC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: fix DebugCtl MSR clearing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2510d34206f0b10a8684da5611e24f4f53a23f1e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 1 15:11:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 1 15:11:46 2014 +0200

    VMX: fix DebugCtl MSR clearing
    
    The previous shortcut was wrong, as it bypassed the necessary vmwrite:
    All we really want to avoid if the guest writes zero is to add the MSR
    to the host-load list.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: dfa625e15f3d6c374637f2bb789e1f444c2781c3
    master date: 2014-08-22 14:29:37 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index c60fb22..bf7d8f1 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2132,8 +2132,6 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         int i, rc = 0;
         uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
 
-        if ( !msr_content )
-            break;
         if ( msr_content & ~supported )
         {
             /* Perhaps some other bits are supported in vpmu. */
@@ -2153,12 +2151,10 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         }
 
         if ( (rc < 0) ||
-             (vmx_add_host_load_msr(msr) < 0) )
+             (msr_content && (vmx_add_host_load_msr(msr) < 0)) )
             hvm_inject_hw_exception(TRAP_machine_check, 0);
         else
-        {
             __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
-        }
 
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDq7-0006UR-AI; Thu, 09 Oct 2014 13:33:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDq6-0006UD-4o
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:06 +0000
Received: from [85.158.143.35:53937] by server-3.bemta-4.messagelabs.com id
	95/C5-06192-19E86345; Thu, 09 Oct 2014 13:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1412861583!11871483!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13736 invoked from network); 9 Oct 2014 13:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDq3-000276-EZ
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDq3-00077C-Co
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:03 +0000
Date: Thu, 09 Oct 2014 13:33:03 +0000
Message-Id: <E1XcDq3-00077C-Co@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix error handling in
	libxl_userdata_unlink
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fe1ab70752d81a65b2a1492c46d9119438c0e9e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Sep 24 15:22:08 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 8 11:51:37 2014 +0100

    libxl: Fix error handling in libxl_userdata_unlink
    
    Previously:
      * rc would not be set before leaving the function, with the
        result that an uninitialised value would be returned
      * failures of libxl__userdata_path would result in a NULL dereference
      * failures of unlink() would not be usefully logged
    
    This appears to be due to an attempt to avoid having to repeat the
    call to libxl__unlock_domain_userdata by informally sharing parts of
    the success and failure paths.
    
    Change to use the canonical error-handling style:
      * Initialise lock to 0.
      * Do the unlock in the `out' section - always attempt to unlock
        lock if it is non-0.
      * Explicitly set rc and `goto out' on all error paths, even
        those right at the end of the function.
      * Add an error check for filename = libxl__userdata_path(...);
    
    Coverity-ID: 1240237, 1240235.
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: coverity@xenproject.org
    Reviewed-by: Andrew Cooper<andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl_dom.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index d63ae1b..9d830e1 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -2243,12 +2243,12 @@ int libxl_userdata_unlink(libxl_ctx *ctx, uint32_t domid,
                           const char *userdata_userid)
 {
     GC_INIT(ctx);
-    int rc;
+    CTX_LOCK;
 
-    libxl__domain_userdata_lock *lock;
+    int rc;
+    libxl__domain_userdata_lock *lock = NULL;
     const char *filename;
 
-    CTX_LOCK;
     lock = libxl__lock_domain_userdata(gc, domid);
     if (!lock) {
         rc = ERROR_LOCK_FAIL;
@@ -2256,10 +2256,20 @@ int libxl_userdata_unlink(libxl_ctx *ctx, uint32_t domid,
     }
 
     filename = libxl__userdata_path(gc, domid, userdata_userid, "d");
-    if (unlink(filename)) rc = ERROR_FAIL;
+    if (!filename) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+    if (unlink(filename)) {
+        LOGE(ERROR, "error deleting userdata file: %s", filename);
+        rc = ERROR_FAIL;
+        goto out;
+    }
 
-    libxl__unlock_domain_userdata(lock);
+    rc = 0;
 out:
+    if (lock)
+        libxl__unlock_domain_userdata(lock);
     CTX_UNLOCK;
     GC_FREE;
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDq7-0006UR-AI; Thu, 09 Oct 2014 13:33:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDq6-0006UD-4o
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:06 +0000
Received: from [85.158.143.35:53937] by server-3.bemta-4.messagelabs.com id
	95/C5-06192-19E86345; Thu, 09 Oct 2014 13:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1412861583!11871483!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13736 invoked from network); 9 Oct 2014 13:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDq3-000276-EZ
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDq3-00077C-Co
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:03 +0000
Date: Thu, 09 Oct 2014 13:33:03 +0000
Message-Id: <E1XcDq3-00077C-Co@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix error handling in
	libxl_userdata_unlink
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fe1ab70752d81a65b2a1492c46d9119438c0e9e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Sep 24 15:22:08 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 8 11:51:37 2014 +0100

    libxl: Fix error handling in libxl_userdata_unlink
    
    Previously:
      * rc would not be set before leaving the function, with the
        result that an uninitialised value would be returned
      * failures of libxl__userdata_path would result in a NULL dereference
      * failures of unlink() would not be usefully logged
    
    This appears to be due to an attempt to avoid having to repeat the
    call to libxl__unlock_domain_userdata by informally sharing parts of
    the success and failure paths.
    
    Change to use the canonical error-handling style:
      * Initialise lock to 0.
      * Do the unlock in the `out' section - always attempt to unlock
        lock if it is non-0.
      * Explicitly set rc and `goto out' on all error paths, even
        those right at the end of the function.
      * Add an error check for filename = libxl__userdata_path(...);
    
    Coverity-ID: 1240237, 1240235.
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: coverity@xenproject.org
    Reviewed-by: Andrew Cooper<andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl_dom.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index d63ae1b..9d830e1 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -2243,12 +2243,12 @@ int libxl_userdata_unlink(libxl_ctx *ctx, uint32_t domid,
                           const char *userdata_userid)
 {
     GC_INIT(ctx);
-    int rc;
+    CTX_LOCK;
 
-    libxl__domain_userdata_lock *lock;
+    int rc;
+    libxl__domain_userdata_lock *lock = NULL;
     const char *filename;
 
-    CTX_LOCK;
     lock = libxl__lock_domain_userdata(gc, domid);
     if (!lock) {
         rc = ERROR_LOCK_FAIL;
@@ -2256,10 +2256,20 @@ int libxl_userdata_unlink(libxl_ctx *ctx, uint32_t domid,
     }
 
     filename = libxl__userdata_path(gc, domid, userdata_userid, "d");
-    if (unlink(filename)) rc = ERROR_FAIL;
+    if (!filename) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+    if (unlink(filename)) {
+        LOGE(ERROR, "error deleting userdata file: %s", filename);
+        rc = ERROR_FAIL;
+        goto out;
+    }
 
-    libxl__unlock_domain_userdata(lock);
+    rc = 0;
 out:
+    if (lock)
+        libxl__unlock_domain_userdata(lock);
     CTX_UNLOCK;
     GC_FREE;
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqI-0006Vx-Cv; Thu, 09 Oct 2014 13:33:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqH-0006Vg-IK
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:17 +0000
Received: from [85.158.137.68:10573] by server-1.bemta-3.messagelabs.com id
	5B/30-30185-C9E86345; Thu, 09 Oct 2014 13:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412861594!8769622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10435 invoked from network); 9 Oct 2014 13:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqD-00027E-KB
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqD-00078B-Ip
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:13 +0000
Date: Thu, 09 Oct 2014 13:33:13 +0000
Message-Id: <E1XcDqD-00078B-Ip@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: update rc.d dependency
	for NetBSD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0f241e430521155cd64455315eb340168e9798a9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:55:26 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:27:06 2014 +0100

    tools/hotplug: update rc.d dependency for NetBSD
    
    While searching remaining xend strings I noticed that xen-domains wants
    xencommons as dependency now.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/NetBSD/rc.d/xendomains |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/NetBSD/rc.d/xendomains b/tools/hotplug/NetBSD/rc.d/xendomains
index 3e62038..b0e7111 100644
--- a/tools/hotplug/NetBSD/rc.d/xendomains
+++ b/tools/hotplug/NetBSD/rc.d/xendomains
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # PROVIDE: xendomains
-# REQUIRE: xend
+# REQUIRE: xencommons
 # KEYWORD: shutdown
 #
 # xendomains		This required variable is a whitespace-separated
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqI-0006Vx-Cv; Thu, 09 Oct 2014 13:33:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqH-0006Vg-IK
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:17 +0000
Received: from [85.158.137.68:10573] by server-1.bemta-3.messagelabs.com id
	5B/30-30185-C9E86345; Thu, 09 Oct 2014 13:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412861594!8769622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10435 invoked from network); 9 Oct 2014 13:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqD-00027E-KB
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqD-00078B-Ip
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:13 +0000
Date: Thu, 09 Oct 2014 13:33:13 +0000
Message-Id: <E1XcDqD-00078B-Ip@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: update rc.d dependency
	for NetBSD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0f241e430521155cd64455315eb340168e9798a9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:55:26 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:27:06 2014 +0100

    tools/hotplug: update rc.d dependency for NetBSD
    
    While searching remaining xend strings I noticed that xen-domains wants
    xencommons as dependency now.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/NetBSD/rc.d/xendomains |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/NetBSD/rc.d/xendomains b/tools/hotplug/NetBSD/rc.d/xendomains
index 3e62038..b0e7111 100644
--- a/tools/hotplug/NetBSD/rc.d/xendomains
+++ b/tools/hotplug/NetBSD/rc.d/xendomains
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # PROVIDE: xendomains
-# REQUIRE: xend
+# REQUIRE: xencommons
 # KEYWORD: shutdown
 #
 # xendomains		This required variable is a whitespace-separated
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqS-0006Xv-FV; Thu, 09 Oct 2014 13:33:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqR-0006Xb-H4
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:27 +0000
Received: from [85.158.143.35:58718] by server-3.bemta-4.messagelabs.com id
	AE/86-06192-6AE86345; Thu, 09 Oct 2014 13:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1412861603!11781616!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14288 invoked from network); 9 Oct 2014 13:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqN-00027N-On
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqN-00078d-Nl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:23 +0000
Date: Thu, 09 Oct 2014 13:33:23 +0000
Message-Id: <E1XcDqN-00078d-Nl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/tests: remove code using xend
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84c067cc33f446cdd96826c20548289b7ea011bb
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 16:25:28 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:21 2014 +0100

    tools/tests: remove code using xend
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/tests/utests/run_all_tests.py         |   10 +--
 tools/tests/utests/ut_util/ut_fileuri.py    |  209 ---------------------------
 tools/tests/utests/ut_xend/ut_XendConfig.py |  117 ---------------
 tools/tests/utests/ut_xend/ut_image.py      |  147 -------------------
 4 files changed, 1 insertions(+), 482 deletions(-)

diff --git a/tools/tests/utests/run_all_tests.py b/tools/tests/utests/run_all_tests.py
index e36fa4d..3e302dd 100644
--- a/tools/tests/utests/run_all_tests.py
+++ b/tools/tests/utests/run_all_tests.py
@@ -17,15 +17,7 @@
 
 import unittest
 
-import utests.ut_util.ut_fileuri
-import utests.ut_xend.ut_XendConfig
-import utests.ut_xend.ut_image
-
-suite = unittest.TestSuite(
-    [utests.ut_util.ut_fileuri.suite(),
-     utests.ut_xend.ut_XendConfig.suite(),
-     utests.ut_xend.ut_image.suite(),
-     ])
+suite = unittest.TestSuite([])
 
 if __name__ == "__main__":
     testresult = unittest.TextTestRunner(verbosity=3).run(suite)
diff --git a/tools/tests/utests/ut_util/ut_fileuri.py b/tools/tests/utests/ut_util/ut_fileuri.py
deleted file mode 100644
index cd64e7d..0000000
--- a/tools/tests/utests/ut_util/ut_fileuri.py
+++ /dev/null
@@ -1,209 +0,0 @@
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2009 flonatel GmbH & Co. KG
-#============================================================================
-
-import os
-import unittest
-
-from xen.util.fileuri import scheme_error
-from xen.util.fileuri import scheme_data
-from xen.util.fileuri import scheme_file
-from xen.util.fileuri import schemes
-
-class scheme_data_unit_tests(unittest.TestCase):
-
-    def check_basic_encoding(self):
-        "util.fileuri.scheme_data - basic encoding"
-        sd = scheme_data.encode('Hello!')
-        self.assertEqual(sd, 'data:application/octet-stream;base64,SGVsbG8h')
-
-    def check_encoding_with_given_mediatype(self):
-        "util.fileuri.scheme_data - encoding with given media name"
-        sd = scheme_data.encode('Hello!', 'application/x-my-linux-kernel')
-        self.assertEqual(sd,
-              'data:application/x-my-linux-kernel;base64,SGVsbG8h')
-
-    def check_parse_01(self):
-        "util.fileuri.scheme_data - parsing of None"
-        self.assertRaises(scheme_error, scheme_data.parse, None)
-
-    def check_parse_02(self):
-        "util.fileuri.scheme_data - parsing of empty string"
-        self.assertRaises(scheme_error, scheme_data.parse, "")
-
-    def check_parse_03(self):
-        "util.fileuri.scheme_data - parsing of unstructured data"
-        self.assertRaises(scheme_error, scheme_data.parse, "akskdjdfhezezu")
-
-    def check_parse_04(self):
-        "util.fileuri.scheme_data - data: is not at the first place"
-        self.assertRaises(scheme_error, scheme_data.parse, 'ggdata:sossm')
-
-    def check_parse_05(self):
-        "util.fileuri.scheme_data - no comma in data"
-        self.assertRaises(scheme_error, scheme_data.parse, 'data:sossm')
-
-    def check_parse_06(self):
-        "util.fileuri.scheme_data - encoding is empty"
-        self.assertRaises(scheme_error, scheme_data.parse, 'data:,')
-
-    def check_parse_07(self):
-        "util.fileuri.scheme_data - unknown encoding"
-        self.assertRaises(scheme_error, scheme_data.parse,
-                          'data:somemediatype;unknown,')
-
-    def check_parse_08(self):
-        "util.fileuri.scheme_data - parse ok - empty data"
-        mediatype, encoding, data_start = scheme_data.parse(
-            'data:somemedia;base64,')
-        self.assertEqual(mediatype, 'somemedia')
-        self.assertEqual(encoding, 'base64')
-        self.assertEqual(data_start, 22)
-
-    def check_parse_09(self):
-        "util.fileuri.scheme_data - parse ok - some data"
-        mediatype, encoding, data_start = scheme_data.parse(
-            'data:somemedia;base64,HereComesTheSun')
-        self.assertEqual(mediatype, 'somemedia')
-        self.assertEqual(encoding, 'base64')
-        self.assertEqual(data_start, 22)
-
-    def check_parse_10(self):
-        "util.fileuri.scheme_data - header ok - data error"
-        self.assertRaises(scheme_error, scheme_data.decode,
-               'data:application/octet-stream;base64,H!$ere"Co<mesT>heS_.un')
-
-    def check_cff_file_does_not_exist(self):
-        "util.fileuri.scheme_data - create from file - non existent file"
-        self.assertRaises(scheme_error, scheme_data.create_from_file,
-                          "/there/is/hopefully/no/file/like/this")
-
-    def check_cff_ok(self):
-        "util.fileuri.scheme_data - create from file - ok"
-        tmppath = "/tmp/scheme_data_check_cff_ok"
-        f = open(tmppath, "w")
-        f.write("huhuhu")
-        f.close()
-        d = scheme_data.create_from_file(tmppath)
-        os.unlink(tmppath)
-        self.assertEqual(d, "data:application/octet-stream;base64,aHVodWh1")
-
-
-class scheme_file_unit_tests(unittest.TestCase):
-
-    def check_encode_empty_filename(self):
-        "util.fileuri.scheme_file - encode empty filename"
-        self.assertRaises(scheme_error, scheme_file.encode, "")
-
-    def check_encode_relative_filename(self):
-        "util.fileuri.scheme_file - encode relative filename"
-        self.assertRaises(scheme_error, scheme_file.encode, "../there")
-
-    def check_encode_absolut_filename(self):
-        "util.fileuri.scheme_file - encode absolut filename"
-        self.assertEqual(
-            scheme_file.encode("/here/and/there/again"),
-            'file:///here/and/there/again')
-
-    def check_decode_01(self):
-        "util.fileuri.scheme_file - decode empty data"
-        self.assertRaises(scheme_error, scheme_file.decode, "")
-
-    def check_decode_02(self):
-        "util.fileuri.scheme_file - decode data with no file:// at the beginning (1)"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "phonehome://bbbb")
-
-    def check_decode_03(self):
-        "util.fileuri.scheme_file - decode data with no file:// at the beginning (2)"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "file:/bbbb")
-
-    def check_decode_04(self):
-        "util.fileuri.scheme_file - decode empty path"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "file://")
-
-    def check_decode_05(self):
-        "util.fileuri.scheme_file - decode empty relative path"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "file://somewhere")
-
-    def check_decode_06(self):
-        "util.fileuri.scheme_file - decode ok"
-        path, tmp_file = scheme_file.decode("file:///boot/vmlinuz")
-        self.assertEqual(path, "/boot/vmlinuz")
-        self.assertEqual(tmp_file, False)
-
-class scheme_set_unit_tests(unittest.TestCase):
-
-    def check_data_01(self):
-        "util.fileuri.scheme_set - data with error in media type"
-
-        u = "data:something_wrong,base64:swer"
-        uri, tmp_file = schemes.decode(u)
-        self.assertEqual(uri, u)
-        self.assertEqual(tmp_file, False)
-
-    def check_data_02(self):
-        "util.fileuri.scheme_set - data with error in base64 data"
-
-        u = "data:application/octet-stream;base64,S!VsbG8h"
-        uri, tmp_file = schemes.decode(u)
-        self.assertEqual(uri, u)
-        self.assertEqual(tmp_file, False)
- 
-    def check_data_03(self):
-        "util.fileuri.scheme_set - data ok"
-
-        u = "data:application/octet-stream;base64,SGVsbG8h"
-        uri, tmp_file = schemes.decode(u)
-
-        # Read file contents
-        f = open(uri, "r")
-        d = f.read()
-        f.close()
-        os.unlink(uri)
-
-        self.assertEqual(d, "Hello!")
-        self.assertEqual(tmp_file, True)
-       
-    def check_file_01(self):
-        "util.fileuri.scheme_set - file ok"
-
-        f = "/The/Path/To/The/File.txt"
-        uri, tmp_file = schemes.decode("file://" + f)
-        self.assertEqual(uri, f)
-        self.assertEqual(tmp_file, False)
-
-    def check_without_scheme_01(self):
-        "util.fileuri.scheme_set - without scheme"
-
-        f = "/The/Path/To/The/File.txt"
-        uri, tmp_file = schemes.decode(f)
-        self.assertEqual(uri, f)
-        self.assertEqual(tmp_file, False)
-
-
-def suite():
-    return unittest.TestSuite(
-        [unittest.makeSuite(scheme_data_unit_tests, 'check_'),
-         unittest.makeSuite(scheme_file_unit_tests, 'check_'),
-         unittest.makeSuite(scheme_set_unit_tests, 'check_'),])
-
-if __name__ == "__main__":
-    testresult = unittest.TextTestRunner(verbosity=3).run(suite())
-
diff --git a/tools/tests/utests/ut_xend/ut_XendConfig.py b/tools/tests/utests/ut_xend/ut_XendConfig.py
deleted file mode 100644
index 724ad08..0000000
--- a/tools/tests/utests/ut_xend/ut_XendConfig.py
+++ /dev/null
@@ -1,117 +0,0 @@
-#===========================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2009 flonatel GmbH & Co. KG
-#============================================================================
-
-import os
-import unittest
-
-# This does not work because of a cyclic import loop
-#from xen.xend.XendConfig import XendConfig
-import xen.xend.XendDomain
-
-class XendConfigUnitTest(unittest.TestCase):
-
-    def minimal_vmconf(self):
-        return {
-            'memory_dynamic_min': 64,
-            'memory_dynamic_max': 128,
-            'memory_static_max': 128,
-            }
-
-    def check_hf_01(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk not set"
-        vmconf = self.minimal_vmconf()
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(not xc.has_key('use_tmp_kernel'))
-        self.assert_(not xc.has_key('use_tmp_ramdisk'))
-
-    def check_hf_02(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk set to some path"
-        vmconf = self.minimal_vmconf()
-        vmconf['PV_kernel'] = '/some/where/under/the/rainbow-kernel'
-        vmconf['PV_ramdisk'] = '/some/where/under/the/rainbow-ramdisk'
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(xc.has_key('use_tmp_kernel'))
-        self.assert_(xc.has_key('use_tmp_ramdisk'))
-
-        self.assert_(not xc['use_tmp_kernel'])
-        self.assert_(not xc['use_tmp_ramdisk'])
-
-    def check_hf_03(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk using file: scheme"
-        vmconf = self.minimal_vmconf()
-        vmconf['PV_kernel'] = 'file:///some/where/under/the/rainbow-kernel'
-        vmconf['PV_ramdisk'] = 'file:///some/where/under/the/rainbow-ramdisk'
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(xc.has_key('use_tmp_kernel'))
-        self.assert_(xc.has_key('use_tmp_ramdisk'))
-
-        self.assert_(not xc['use_tmp_kernel'])
-        self.assert_(not xc['use_tmp_ramdisk'])
-
-        self.assert_('PV_kernel' in xc)
-        self.assert_('PV_ramdisk' in xc)
-
-        self.assertEqual("/some/where/under/the/rainbow-kernel",
-                         xc['PV_kernel'])
-        self.assertEqual("/some/where/under/the/rainbow-ramdisk",
-                         xc['PV_ramdisk'])
-
-    def check_hf_04(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk using data: scheme"
-        vmconf = self.minimal_vmconf()
-        vmconf['PV_kernel'] = 'data:application/octet-stream;base64,VGhpcyBpcyB0aGUga2VybmVsCg=='
-        vmconf['PV_ramdisk'] = 'data:application/octet-stream;base64,TXkgZ3JlYXQgcmFtZGlzawo='
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(xc.has_key('use_tmp_kernel'))
-        self.assert_(xc.has_key('use_tmp_ramdisk'))
-
-        self.assert_(xc['use_tmp_kernel'])
-        self.assert_(xc['use_tmp_ramdisk'])
-
-        self.assert_('PV_kernel' in xc)
-        self.assert_('PV_ramdisk' in xc)
-
-        self.assert_(xc['PV_kernel'].startswith(
-                "/var/run/xend/boot/data_uri_file."))
-        self.assert_(xc['PV_ramdisk'].startswith(
-                "/var/run/xend/boot/data_uri_file."))
-
-        f = file(xc['PV_kernel'])
-        kc = f.read()
-        f.close()
-
-        f = file(xc['PV_ramdisk'])
-        rc = f.read()
-        f.close()
-
-        os.unlink(xc['PV_kernel'])
-        os.unlink(xc['PV_ramdisk'])
-
-        self.assertEqual(kc, "This is the kernel\n")
-        self.assertEqual(rc, "My great ramdisk\n")
-
-def suite():
-    return unittest.TestSuite(
-        [unittest.makeSuite(XendConfigUnitTest, 'check_'),])
-
-if __name__ == "__main__":
-    testresult = unittest.TextTestRunner(verbosity=3).run(suite())
-
diff --git a/tools/tests/utests/ut_xend/ut_image.py b/tools/tests/utests/ut_xend/ut_image.py
deleted file mode 100644
index 92ec645..0000000
--- a/tools/tests/utests/ut_xend/ut_image.py
+++ /dev/null
@@ -1,147 +0,0 @@
-#===========================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2009 flonatel GmbH & Co. KG
-#============================================================================
-
-import unittest
-import tempfile
-import os
-
-import xen.xend.image
-
-class ImageHandlerUnitTests(unittest.TestCase):
-
-    class ImageHandlerUnitTestsVirtualMachine:
-
-        def __init__(self):
-            self.info = {
-                'name_label': 'ItsMyParty',
-                }
-
-        def storeVm(self, *args):
-            pass
-
-        def permissionsVm(self, *args):
-            pass
-
-        def getDomid(self):
-            return 7
-
-    # Sets up a vm_config with no bootloader.
-    def vm_config_no_bootloader(self):
-        return {
-            'PV_kernel': 'value_of_PV_kernel',
-            'PV_args': 'value_of_PV_args',
-            'PV_ramdisk': 'value_of_PV_ramdisk',
-            'platform': {},
-            'console_refs': [],
-            }
-
-    def check_configure_01(self):
-        # This retests the problem reported by Jun Koi on 24.07.2009
-        # see http://lists.xensource.com/archives/html/xen-devel/2009-07/msg01006.html
-        "ImageHandler - call configure with mostly empty vmConfig"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        self.assertEqual(ih.use_tmp_kernel, False)
-        self.assertEqual(ih.use_tmp_ramdisk, False)
-
-    def check_configure_02(self):
-        "ImageHandler - call configure with use_tmp_xxx set to false"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = False
-        vmConfig['use_tmp_ramdisk'] = False
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        self.assertEqual(ih.use_tmp_kernel, False)
-        self.assertEqual(ih.use_tmp_ramdisk, False)
-
-
-    def check_configure_03(self):
-        "ImageHandler - call configure with use_tmp_xxx set to true"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = True
-        vmConfig['use_tmp_ramdisk'] = True
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        self.assertEqual(ih.use_tmp_kernel, True)
-        self.assertEqual(ih.use_tmp_ramdisk, True)
-
-    def cleanup_tmp_images_base(self, vmConfig):
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        k, ih.kernel = tempfile.mkstemp(
-            prefix = "ImageHandler-cleanupTmpImages-k", dir = "/tmp")
-        r, ih.ramdisk = tempfile.mkstemp(
-            prefix = "ImageHandler-cleanupTmpImages-r", dir = "/tmp")
-
-        ih.cleanupTmpImages()
-
-        kres = os.path.exists(ih.kernel)
-        rres = os.path.exists(ih.ramdisk)
-
-        if not ih.use_tmp_kernel:
-            os.unlink(ih.kernel)
-        if not ih.use_tmp_ramdisk:
-            os.unlink(ih.ramdisk)
-
-        return kres, rres
-
-    def check_cleanup_tmp_images_01(self):
-        "ImageHandler - cleanupTmpImages with use_tmp_xxx unset"
-
-        vmConfig = self.vm_config_no_bootloader()
-        kres, rres = self.cleanup_tmp_images_base(vmConfig)
-
-        self.assertEqual(kres, True)
-        self.assertEqual(rres, True)
-
-    def check_cleanup_tmp_images_02(self):
-        "ImageHandler - cleanupTmpImages with use_tmp_xxx set to false"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = False
-        vmConfig['use_tmp_ramdisk'] = False
-        kres, rres = self.cleanup_tmp_images_base(vmConfig)
-
-        self.assertEqual(kres, True)
-        self.assertEqual(rres, True)
-
-    def check_cleanup_tmp_images_03(self):
-        "ImageHandler - cleanupTmpImages with use_tmp_xxx set to true"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = True
-        vmConfig['use_tmp_ramdisk'] = True
-        kres, rres = self.cleanup_tmp_images_base(vmConfig)
-
-        self.assertEqual(kres, False)
-        self.assertEqual(rres, False)
-
-def suite():
-    return unittest.TestSuite(
-        [unittest.makeSuite(ImageHandlerUnitTests, 'check_'),])
-
-if __name__ == "__main__":
-    testresult = unittest.TextTestRunner(verbosity=3).run(suite())
-
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqS-0006Xv-FV; Thu, 09 Oct 2014 13:33:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqR-0006Xb-H4
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:27 +0000
Received: from [85.158.143.35:58718] by server-3.bemta-4.messagelabs.com id
	AE/86-06192-6AE86345; Thu, 09 Oct 2014 13:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1412861603!11781616!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14288 invoked from network); 9 Oct 2014 13:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqN-00027N-On
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqN-00078d-Nl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:23 +0000
Date: Thu, 09 Oct 2014 13:33:23 +0000
Message-Id: <E1XcDqN-00078d-Nl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/tests: remove code using xend
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84c067cc33f446cdd96826c20548289b7ea011bb
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 16:25:28 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:21 2014 +0100

    tools/tests: remove code using xend
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/tests/utests/run_all_tests.py         |   10 +--
 tools/tests/utests/ut_util/ut_fileuri.py    |  209 ---------------------------
 tools/tests/utests/ut_xend/ut_XendConfig.py |  117 ---------------
 tools/tests/utests/ut_xend/ut_image.py      |  147 -------------------
 4 files changed, 1 insertions(+), 482 deletions(-)

diff --git a/tools/tests/utests/run_all_tests.py b/tools/tests/utests/run_all_tests.py
index e36fa4d..3e302dd 100644
--- a/tools/tests/utests/run_all_tests.py
+++ b/tools/tests/utests/run_all_tests.py
@@ -17,15 +17,7 @@
 
 import unittest
 
-import utests.ut_util.ut_fileuri
-import utests.ut_xend.ut_XendConfig
-import utests.ut_xend.ut_image
-
-suite = unittest.TestSuite(
-    [utests.ut_util.ut_fileuri.suite(),
-     utests.ut_xend.ut_XendConfig.suite(),
-     utests.ut_xend.ut_image.suite(),
-     ])
+suite = unittest.TestSuite([])
 
 if __name__ == "__main__":
     testresult = unittest.TextTestRunner(verbosity=3).run(suite)
diff --git a/tools/tests/utests/ut_util/ut_fileuri.py b/tools/tests/utests/ut_util/ut_fileuri.py
deleted file mode 100644
index cd64e7d..0000000
--- a/tools/tests/utests/ut_util/ut_fileuri.py
+++ /dev/null
@@ -1,209 +0,0 @@
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2009 flonatel GmbH & Co. KG
-#============================================================================
-
-import os
-import unittest
-
-from xen.util.fileuri import scheme_error
-from xen.util.fileuri import scheme_data
-from xen.util.fileuri import scheme_file
-from xen.util.fileuri import schemes
-
-class scheme_data_unit_tests(unittest.TestCase):
-
-    def check_basic_encoding(self):
-        "util.fileuri.scheme_data - basic encoding"
-        sd = scheme_data.encode('Hello!')
-        self.assertEqual(sd, 'data:application/octet-stream;base64,SGVsbG8h')
-
-    def check_encoding_with_given_mediatype(self):
-        "util.fileuri.scheme_data - encoding with given media name"
-        sd = scheme_data.encode('Hello!', 'application/x-my-linux-kernel')
-        self.assertEqual(sd,
-              'data:application/x-my-linux-kernel;base64,SGVsbG8h')
-
-    def check_parse_01(self):
-        "util.fileuri.scheme_data - parsing of None"
-        self.assertRaises(scheme_error, scheme_data.parse, None)
-
-    def check_parse_02(self):
-        "util.fileuri.scheme_data - parsing of empty string"
-        self.assertRaises(scheme_error, scheme_data.parse, "")
-
-    def check_parse_03(self):
-        "util.fileuri.scheme_data - parsing of unstructured data"
-        self.assertRaises(scheme_error, scheme_data.parse, "akskdjdfhezezu")
-
-    def check_parse_04(self):
-        "util.fileuri.scheme_data - data: is not at the first place"
-        self.assertRaises(scheme_error, scheme_data.parse, 'ggdata:sossm')
-
-    def check_parse_05(self):
-        "util.fileuri.scheme_data - no comma in data"
-        self.assertRaises(scheme_error, scheme_data.parse, 'data:sossm')
-
-    def check_parse_06(self):
-        "util.fileuri.scheme_data - encoding is empty"
-        self.assertRaises(scheme_error, scheme_data.parse, 'data:,')
-
-    def check_parse_07(self):
-        "util.fileuri.scheme_data - unknown encoding"
-        self.assertRaises(scheme_error, scheme_data.parse,
-                          'data:somemediatype;unknown,')
-
-    def check_parse_08(self):
-        "util.fileuri.scheme_data - parse ok - empty data"
-        mediatype, encoding, data_start = scheme_data.parse(
-            'data:somemedia;base64,')
-        self.assertEqual(mediatype, 'somemedia')
-        self.assertEqual(encoding, 'base64')
-        self.assertEqual(data_start, 22)
-
-    def check_parse_09(self):
-        "util.fileuri.scheme_data - parse ok - some data"
-        mediatype, encoding, data_start = scheme_data.parse(
-            'data:somemedia;base64,HereComesTheSun')
-        self.assertEqual(mediatype, 'somemedia')
-        self.assertEqual(encoding, 'base64')
-        self.assertEqual(data_start, 22)
-
-    def check_parse_10(self):
-        "util.fileuri.scheme_data - header ok - data error"
-        self.assertRaises(scheme_error, scheme_data.decode,
-               'data:application/octet-stream;base64,H!$ere"Co<mesT>heS_.un')
-
-    def check_cff_file_does_not_exist(self):
-        "util.fileuri.scheme_data - create from file - non existent file"
-        self.assertRaises(scheme_error, scheme_data.create_from_file,
-                          "/there/is/hopefully/no/file/like/this")
-
-    def check_cff_ok(self):
-        "util.fileuri.scheme_data - create from file - ok"
-        tmppath = "/tmp/scheme_data_check_cff_ok"
-        f = open(tmppath, "w")
-        f.write("huhuhu")
-        f.close()
-        d = scheme_data.create_from_file(tmppath)
-        os.unlink(tmppath)
-        self.assertEqual(d, "data:application/octet-stream;base64,aHVodWh1")
-
-
-class scheme_file_unit_tests(unittest.TestCase):
-
-    def check_encode_empty_filename(self):
-        "util.fileuri.scheme_file - encode empty filename"
-        self.assertRaises(scheme_error, scheme_file.encode, "")
-
-    def check_encode_relative_filename(self):
-        "util.fileuri.scheme_file - encode relative filename"
-        self.assertRaises(scheme_error, scheme_file.encode, "../there")
-
-    def check_encode_absolut_filename(self):
-        "util.fileuri.scheme_file - encode absolut filename"
-        self.assertEqual(
-            scheme_file.encode("/here/and/there/again"),
-            'file:///here/and/there/again')
-
-    def check_decode_01(self):
-        "util.fileuri.scheme_file - decode empty data"
-        self.assertRaises(scheme_error, scheme_file.decode, "")
-
-    def check_decode_02(self):
-        "util.fileuri.scheme_file - decode data with no file:// at the beginning (1)"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "phonehome://bbbb")
-
-    def check_decode_03(self):
-        "util.fileuri.scheme_file - decode data with no file:// at the beginning (2)"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "file:/bbbb")
-
-    def check_decode_04(self):
-        "util.fileuri.scheme_file - decode empty path"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "file://")
-
-    def check_decode_05(self):
-        "util.fileuri.scheme_file - decode empty relative path"
-        self.assertRaises(scheme_error, scheme_file.decode,
-                          "file://somewhere")
-
-    def check_decode_06(self):
-        "util.fileuri.scheme_file - decode ok"
-        path, tmp_file = scheme_file.decode("file:///boot/vmlinuz")
-        self.assertEqual(path, "/boot/vmlinuz")
-        self.assertEqual(tmp_file, False)
-
-class scheme_set_unit_tests(unittest.TestCase):
-
-    def check_data_01(self):
-        "util.fileuri.scheme_set - data with error in media type"
-
-        u = "data:something_wrong,base64:swer"
-        uri, tmp_file = schemes.decode(u)
-        self.assertEqual(uri, u)
-        self.assertEqual(tmp_file, False)
-
-    def check_data_02(self):
-        "util.fileuri.scheme_set - data with error in base64 data"
-
-        u = "data:application/octet-stream;base64,S!VsbG8h"
-        uri, tmp_file = schemes.decode(u)
-        self.assertEqual(uri, u)
-        self.assertEqual(tmp_file, False)
- 
-    def check_data_03(self):
-        "util.fileuri.scheme_set - data ok"
-
-        u = "data:application/octet-stream;base64,SGVsbG8h"
-        uri, tmp_file = schemes.decode(u)
-
-        # Read file contents
-        f = open(uri, "r")
-        d = f.read()
-        f.close()
-        os.unlink(uri)
-
-        self.assertEqual(d, "Hello!")
-        self.assertEqual(tmp_file, True)
-       
-    def check_file_01(self):
-        "util.fileuri.scheme_set - file ok"
-
-        f = "/The/Path/To/The/File.txt"
-        uri, tmp_file = schemes.decode("file://" + f)
-        self.assertEqual(uri, f)
-        self.assertEqual(tmp_file, False)
-
-    def check_without_scheme_01(self):
-        "util.fileuri.scheme_set - without scheme"
-
-        f = "/The/Path/To/The/File.txt"
-        uri, tmp_file = schemes.decode(f)
-        self.assertEqual(uri, f)
-        self.assertEqual(tmp_file, False)
-
-
-def suite():
-    return unittest.TestSuite(
-        [unittest.makeSuite(scheme_data_unit_tests, 'check_'),
-         unittest.makeSuite(scheme_file_unit_tests, 'check_'),
-         unittest.makeSuite(scheme_set_unit_tests, 'check_'),])
-
-if __name__ == "__main__":
-    testresult = unittest.TextTestRunner(verbosity=3).run(suite())
-
diff --git a/tools/tests/utests/ut_xend/ut_XendConfig.py b/tools/tests/utests/ut_xend/ut_XendConfig.py
deleted file mode 100644
index 724ad08..0000000
--- a/tools/tests/utests/ut_xend/ut_XendConfig.py
+++ /dev/null
@@ -1,117 +0,0 @@
-#===========================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2009 flonatel GmbH & Co. KG
-#============================================================================
-
-import os
-import unittest
-
-# This does not work because of a cyclic import loop
-#from xen.xend.XendConfig import XendConfig
-import xen.xend.XendDomain
-
-class XendConfigUnitTest(unittest.TestCase):
-
-    def minimal_vmconf(self):
-        return {
-            'memory_dynamic_min': 64,
-            'memory_dynamic_max': 128,
-            'memory_static_max': 128,
-            }
-
-    def check_hf_01(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk not set"
-        vmconf = self.minimal_vmconf()
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(not xc.has_key('use_tmp_kernel'))
-        self.assert_(not xc.has_key('use_tmp_ramdisk'))
-
-    def check_hf_02(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk set to some path"
-        vmconf = self.minimal_vmconf()
-        vmconf['PV_kernel'] = '/some/where/under/the/rainbow-kernel'
-        vmconf['PV_ramdisk'] = '/some/where/under/the/rainbow-ramdisk'
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(xc.has_key('use_tmp_kernel'))
-        self.assert_(xc.has_key('use_tmp_ramdisk'))
-
-        self.assert_(not xc['use_tmp_kernel'])
-        self.assert_(not xc['use_tmp_ramdisk'])
-
-    def check_hf_03(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk using file: scheme"
-        vmconf = self.minimal_vmconf()
-        vmconf['PV_kernel'] = 'file:///some/where/under/the/rainbow-kernel'
-        vmconf['PV_ramdisk'] = 'file:///some/where/under/the/rainbow-ramdisk'
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(xc.has_key('use_tmp_kernel'))
-        self.assert_(xc.has_key('use_tmp_ramdisk'))
-
-        self.assert_(not xc['use_tmp_kernel'])
-        self.assert_(not xc['use_tmp_ramdisk'])
-
-        self.assert_('PV_kernel' in xc)
-        self.assert_('PV_ramdisk' in xc)
-
-        self.assertEqual("/some/where/under/the/rainbow-kernel",
-                         xc['PV_kernel'])
-        self.assertEqual("/some/where/under/the/rainbow-ramdisk",
-                         xc['PV_ramdisk'])
-
-    def check_hf_04(self):
-        "xend.XendConfig.handle_fileutils - PV_kernel/ramdisk using data: scheme"
-        vmconf = self.minimal_vmconf()
-        vmconf['PV_kernel'] = 'data:application/octet-stream;base64,VGhpcyBpcyB0aGUga2VybmVsCg=='
-        vmconf['PV_ramdisk'] = 'data:application/octet-stream;base64,TXkgZ3JlYXQgcmFtZGlzawo='
-        xc = xen.xend.XendConfig.XendConfig(xapi = vmconf)
-
-        self.assert_(xc.has_key('use_tmp_kernel'))
-        self.assert_(xc.has_key('use_tmp_ramdisk'))
-
-        self.assert_(xc['use_tmp_kernel'])
-        self.assert_(xc['use_tmp_ramdisk'])
-
-        self.assert_('PV_kernel' in xc)
-        self.assert_('PV_ramdisk' in xc)
-
-        self.assert_(xc['PV_kernel'].startswith(
-                "/var/run/xend/boot/data_uri_file."))
-        self.assert_(xc['PV_ramdisk'].startswith(
-                "/var/run/xend/boot/data_uri_file."))
-
-        f = file(xc['PV_kernel'])
-        kc = f.read()
-        f.close()
-
-        f = file(xc['PV_ramdisk'])
-        rc = f.read()
-        f.close()
-
-        os.unlink(xc['PV_kernel'])
-        os.unlink(xc['PV_ramdisk'])
-
-        self.assertEqual(kc, "This is the kernel\n")
-        self.assertEqual(rc, "My great ramdisk\n")
-
-def suite():
-    return unittest.TestSuite(
-        [unittest.makeSuite(XendConfigUnitTest, 'check_'),])
-
-if __name__ == "__main__":
-    testresult = unittest.TextTestRunner(verbosity=3).run(suite())
-
diff --git a/tools/tests/utests/ut_xend/ut_image.py b/tools/tests/utests/ut_xend/ut_image.py
deleted file mode 100644
index 92ec645..0000000
--- a/tools/tests/utests/ut_xend/ut_image.py
+++ /dev/null
@@ -1,147 +0,0 @@
-#===========================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2009 flonatel GmbH & Co. KG
-#============================================================================
-
-import unittest
-import tempfile
-import os
-
-import xen.xend.image
-
-class ImageHandlerUnitTests(unittest.TestCase):
-
-    class ImageHandlerUnitTestsVirtualMachine:
-
-        def __init__(self):
-            self.info = {
-                'name_label': 'ItsMyParty',
-                }
-
-        def storeVm(self, *args):
-            pass
-
-        def permissionsVm(self, *args):
-            pass
-
-        def getDomid(self):
-            return 7
-
-    # Sets up a vm_config with no bootloader.
-    def vm_config_no_bootloader(self):
-        return {
-            'PV_kernel': 'value_of_PV_kernel',
-            'PV_args': 'value_of_PV_args',
-            'PV_ramdisk': 'value_of_PV_ramdisk',
-            'platform': {},
-            'console_refs': [],
-            }
-
-    def check_configure_01(self):
-        # This retests the problem reported by Jun Koi on 24.07.2009
-        # see http://lists.xensource.com/archives/html/xen-devel/2009-07/msg01006.html
-        "ImageHandler - call configure with mostly empty vmConfig"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        self.assertEqual(ih.use_tmp_kernel, False)
-        self.assertEqual(ih.use_tmp_ramdisk, False)
-
-    def check_configure_02(self):
-        "ImageHandler - call configure with use_tmp_xxx set to false"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = False
-        vmConfig['use_tmp_ramdisk'] = False
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        self.assertEqual(ih.use_tmp_kernel, False)
-        self.assertEqual(ih.use_tmp_ramdisk, False)
-
-
-    def check_configure_03(self):
-        "ImageHandler - call configure with use_tmp_xxx set to true"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = True
-        vmConfig['use_tmp_ramdisk'] = True
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        self.assertEqual(ih.use_tmp_kernel, True)
-        self.assertEqual(ih.use_tmp_ramdisk, True)
-
-    def cleanup_tmp_images_base(self, vmConfig):
-        vm = self.ImageHandlerUnitTestsVirtualMachine()
-        ih = xen.xend.image.ImageHandler(vm, vmConfig)
-
-        k, ih.kernel = tempfile.mkstemp(
-            prefix = "ImageHandler-cleanupTmpImages-k", dir = "/tmp")
-        r, ih.ramdisk = tempfile.mkstemp(
-            prefix = "ImageHandler-cleanupTmpImages-r", dir = "/tmp")
-
-        ih.cleanupTmpImages()
-
-        kres = os.path.exists(ih.kernel)
-        rres = os.path.exists(ih.ramdisk)
-
-        if not ih.use_tmp_kernel:
-            os.unlink(ih.kernel)
-        if not ih.use_tmp_ramdisk:
-            os.unlink(ih.ramdisk)
-
-        return kres, rres
-
-    def check_cleanup_tmp_images_01(self):
-        "ImageHandler - cleanupTmpImages with use_tmp_xxx unset"
-
-        vmConfig = self.vm_config_no_bootloader()
-        kres, rres = self.cleanup_tmp_images_base(vmConfig)
-
-        self.assertEqual(kres, True)
-        self.assertEqual(rres, True)
-
-    def check_cleanup_tmp_images_02(self):
-        "ImageHandler - cleanupTmpImages with use_tmp_xxx set to false"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = False
-        vmConfig['use_tmp_ramdisk'] = False
-        kres, rres = self.cleanup_tmp_images_base(vmConfig)
-
-        self.assertEqual(kres, True)
-        self.assertEqual(rres, True)
-
-    def check_cleanup_tmp_images_03(self):
-        "ImageHandler - cleanupTmpImages with use_tmp_xxx set to true"
-
-        vmConfig = self.vm_config_no_bootloader()
-        vmConfig['use_tmp_kernel'] = True
-        vmConfig['use_tmp_ramdisk'] = True
-        kres, rres = self.cleanup_tmp_images_base(vmConfig)
-
-        self.assertEqual(kres, False)
-        self.assertEqual(rres, False)
-
-def suite():
-    return unittest.TestSuite(
-        [unittest.makeSuite(ImageHandlerUnitTests, 'check_'),])
-
-if __name__ == "__main__":
-    testresult = unittest.TextTestRunner(verbosity=3).run(suite())
-
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqf-0006aS-KG; Thu, 09 Oct 2014 13:33:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqe-0006aD-Lg
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:40 +0000
Received: from [85.158.137.68:32303] by server-10.bemta-3.messagelabs.com id
	57/C8-01456-3BE86345; Thu, 09 Oct 2014 13:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1412861617!12438446!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32303 invoked from network); 9 Oct 2014 13:33:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqY-00027V-0O
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqX-000796-Tu
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:33 +0000
Date: Thu, 09 Oct 2014 13:33:33 +0000
Message-Id: <E1XcDqX-000796-Tu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: remove references to
	xend-config.sxp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e7b19a44441999e800540df4dadac1ca2deeff3e
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:37:49 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:21 2014 +0100

    tools: remove references to xend-config.sxp
    
    xend is gone. Remove references to its config file.
    Also remove python script sxp-pretty which relies on removed code.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/examples/README               |    1 -
 tools/hotplug/Linux/vif-bridge      |    4 ---
 tools/hotplug/Linux/vif-nat         |    4 ---
 tools/hotplug/Linux/vif-openvswitch |    4 ---
 tools/hotplug/Linux/vif-route       |    4 ---
 tools/misc/sxp-pretty               |   37 -----------------------------------
 6 files changed, 0 insertions(+), 54 deletions(-)

diff --git a/tools/examples/README b/tools/examples/README
index 5916df3..115ca02 100644
--- a/tools/examples/README
+++ b/tools/examples/README
@@ -25,7 +25,6 @@ vif-route           - xen virtual network start/stop script in routed mode
 xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
                       devices  
 xen-backend.rules   - hotplug script rules
-xend-config.sxp     - default xend configuration file
 xen-hotplug-common.sh - sourced by vif-common.sh
 xen-network-common.sh - sourced by vif-common.sh
 xen-script-common.sh  - sourced by xen-hotplug-common.sh
diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index df44789..3d72ca4 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-bridge
 #
 # Script for configuring a vif in bridged mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then this script is the default.
 #
 # Usage:
 # vif-bridge (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-nat b/tools/hotplug/Linux/vif-nat
index 0b900d5..a76d9c7 100644
--- a/tools/hotplug/Linux/vif-nat
+++ b/tools/hotplug/Linux/vif-nat
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-nat
 #
 # Script for configuring a vif in routed-nat mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then vif-bridge is the default.
 #
 # Usage:
 # vif-nat (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-openvswitch b/tools/hotplug/Linux/vif-openvswitch
index a8e4fc7..18bfb6c 100644
--- a/tools/hotplug/Linux/vif-openvswitch
+++ b/tools/hotplug/Linux/vif-openvswitch
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-openvswitch
 #
 # Script for configuring a vif in openvswitch mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then this script is the default.
 #
 # Usage:
 # vif-openvswitch (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-route b/tools/hotplug/Linux/vif-route
index 02f1403..c149ffc 100644
--- a/tools/hotplug/Linux/vif-route
+++ b/tools/hotplug/Linux/vif-route
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-route
 #
 # Script for configuring a vif in routed mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then vif-bridge is the default.
 #
 # Usage:
 # vif-route (add|remove|online|offline)
diff --git a/tools/misc/sxp-pretty b/tools/misc/sxp-pretty
deleted file mode 100644
index dd642b0..0000000
--- a/tools/misc/sxp-pretty
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#  -*- mode: python; -*-
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (c) 2007 XenSource Inc.
-#============================================================================
-
-
-import commands
-import os.path
-import pprint
-import sys
-
-import xen.xend.sxp as sxp
-
-def main():
-    if len(sys.argv) == 1 or sys.argv[1] in ['', '-']:
-        s = sxp.parse(sys.stdin)
-    else:
-        s = sxp.parse(open(sys.argv[1]))
-
-    pprint.pprint(s)
-
-if __name__ == '__main__':
-    sys.exit(main())
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqf-0006aS-KG; Thu, 09 Oct 2014 13:33:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqe-0006aD-Lg
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:40 +0000
Received: from [85.158.137.68:32303] by server-10.bemta-3.messagelabs.com id
	57/C8-01456-3BE86345; Thu, 09 Oct 2014 13:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1412861617!12438446!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32303 invoked from network); 9 Oct 2014 13:33:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqY-00027V-0O
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqX-000796-Tu
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:33 +0000
Date: Thu, 09 Oct 2014 13:33:33 +0000
Message-Id: <E1XcDqX-000796-Tu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: remove references to
	xend-config.sxp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e7b19a44441999e800540df4dadac1ca2deeff3e
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:37:49 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:21 2014 +0100

    tools: remove references to xend-config.sxp
    
    xend is gone. Remove references to its config file.
    Also remove python script sxp-pretty which relies on removed code.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/examples/README               |    1 -
 tools/hotplug/Linux/vif-bridge      |    4 ---
 tools/hotplug/Linux/vif-nat         |    4 ---
 tools/hotplug/Linux/vif-openvswitch |    4 ---
 tools/hotplug/Linux/vif-route       |    4 ---
 tools/misc/sxp-pretty               |   37 -----------------------------------
 6 files changed, 0 insertions(+), 54 deletions(-)

diff --git a/tools/examples/README b/tools/examples/README
index 5916df3..115ca02 100644
--- a/tools/examples/README
+++ b/tools/examples/README
@@ -25,7 +25,6 @@ vif-route           - xen virtual network start/stop script in routed mode
 xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug
                       devices  
 xen-backend.rules   - hotplug script rules
-xend-config.sxp     - default xend configuration file
 xen-hotplug-common.sh - sourced by vif-common.sh
 xen-network-common.sh - sourced by vif-common.sh
 xen-script-common.sh  - sourced by xen-hotplug-common.sh
diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index df44789..3d72ca4 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-bridge
 #
 # Script for configuring a vif in bridged mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then this script is the default.
 #
 # Usage:
 # vif-bridge (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-nat b/tools/hotplug/Linux/vif-nat
index 0b900d5..a76d9c7 100644
--- a/tools/hotplug/Linux/vif-nat
+++ b/tools/hotplug/Linux/vif-nat
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-nat
 #
 # Script for configuring a vif in routed-nat mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then vif-bridge is the default.
 #
 # Usage:
 # vif-nat (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-openvswitch b/tools/hotplug/Linux/vif-openvswitch
index a8e4fc7..18bfb6c 100644
--- a/tools/hotplug/Linux/vif-openvswitch
+++ b/tools/hotplug/Linux/vif-openvswitch
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-openvswitch
 #
 # Script for configuring a vif in openvswitch mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then this script is the default.
 #
 # Usage:
 # vif-openvswitch (add|remove|online|offline)
diff --git a/tools/hotplug/Linux/vif-route b/tools/hotplug/Linux/vif-route
index 02f1403..c149ffc 100644
--- a/tools/hotplug/Linux/vif-route
+++ b/tools/hotplug/Linux/vif-route
@@ -3,10 +3,6 @@
 # ${XEN_SCRIPT_DIR}/vif-route
 #
 # Script for configuring a vif in routed mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
-# neither of those places, then vif-bridge is the default.
 #
 # Usage:
 # vif-route (add|remove|online|offline)
diff --git a/tools/misc/sxp-pretty b/tools/misc/sxp-pretty
deleted file mode 100644
index dd642b0..0000000
--- a/tools/misc/sxp-pretty
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#  -*- mode: python; -*-
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (c) 2007 XenSource Inc.
-#============================================================================
-
-
-import commands
-import os.path
-import pprint
-import sys
-
-import xen.xend.sxp as sxp
-
-def main():
-    if len(sys.argv) == 1 or sys.argv[1] in ['', '-']:
-        s = sxp.parse(sys.stdin)
-    else:
-        s = sxp.parse(open(sys.argv[1]))
-
-    pprint.pprint(s)
-
-if __name__ == '__main__':
-    sys.exit(main())
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDql-0006bi-NL; Thu, 09 Oct 2014 13:33:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqk-0006bU-OC
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:46 +0000
Received: from [85.158.139.211:49063] by server-3.bemta-5.messagelabs.com id
	81/6A-00307-ABE86345; Thu, 09 Oct 2014 13:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1412861624!12974542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24560 invoked from network); 9 Oct 2014 13:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqi-00027c-6m
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqi-00079V-5d
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:44 +0000
Date: Thu, 09 Oct 2014 13:33:44 +0000
Message-Id: <E1XcDqi-00079V-5d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: remove references to xend
	from README
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 34edcec2647a1b0af6080fa82606f90ad408197d
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:42:53 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    stubdom: remove references to xend from README
    
    .. the xl part of the config is right above the removed lines.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/README |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/stubdom/README b/stubdom/README
index 8d5da9a..de7b6c7 100644
--- a/stubdom/README
+++ b/stubdom/README
@@ -22,15 +22,6 @@ See xl.cfg(5) for more details of the xl domain configuration syntax
 and http://wiki.xen.org/wiki/Device_Model_Stub_Domains for more
 information on device model stub domains
 
-Using with XM/xend
-------------------
-
-There is a sample configuration set in xmexample.hvm-stubdom
-
-In your HVM config "hvmconfig" use stubdom-dm as dm script:
-
-device_model = 'stubdom-dm'
-
 
                                    PV-GRUB
                                    =======
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDql-0006bi-NL; Thu, 09 Oct 2014 13:33:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqk-0006bU-OC
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:46 +0000
Received: from [85.158.139.211:49063] by server-3.bemta-5.messagelabs.com id
	81/6A-00307-ABE86345; Thu, 09 Oct 2014 13:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1412861624!12974542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24560 invoked from network); 9 Oct 2014 13:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqi-00027c-6m
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqi-00079V-5d
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:44 +0000
Date: Thu, 09 Oct 2014 13:33:44 +0000
Message-Id: <E1XcDqi-00079V-5d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: remove references to xend
	from README
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 34edcec2647a1b0af6080fa82606f90ad408197d
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:42:53 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    stubdom: remove references to xend from README
    
    .. the xl part of the config is right above the removed lines.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/README |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/stubdom/README b/stubdom/README
index 8d5da9a..de7b6c7 100644
--- a/stubdom/README
+++ b/stubdom/README
@@ -22,15 +22,6 @@ See xl.cfg(5) for more details of the xl domain configuration syntax
 and http://wiki.xen.org/wiki/Device_Model_Stub_Domains for more
 information on device model stub domains
 
-Using with XM/xend
-------------------
-
-There is a sample configuration set in xmexample.hvm-stubdom
-
-In your HVM config "hvmconfig" use stubdom-dm as dm script:
-
-device_model = 'stubdom-dm'
-
 
                                    PV-GRUB
                                    =======
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqw-0006eB-Py; Thu, 09 Oct 2014 13:33:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqv-0006dn-FC
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:57 +0000
Received: from [85.158.143.35:33407] by server-2.bemta-4.messagelabs.com id
	42/41-04525-4CE86345; Thu, 09 Oct 2014 13:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1412861634!11504612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19070 invoked from network); 9 Oct 2014 13:33:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqs-00027o-Cw
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqs-00079r-Bx
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:54 +0000
Date: Thu, 09 Oct 2014 13:33:54 +0000
Message-Id: <E1XcDqs-00079r-Bx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix comment typo in m4/paths.m4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b4faf310a73c12c08a4961ebb94cb89e2b20566
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 7 10:51:31 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    Fix comment typo in m4/paths.m4
    
    Please rerun autogen.sh after applying this patch.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 configure       |    2 +-
 m4/paths.m4     |    2 +-
 tools/configure |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 9020df3..98a73d4 100755
--- a/configure
+++ b/configure
@@ -1294,7 +1294,7 @@ Optional Packages:
   --with-sysconfig-leaf-dir=SUBDIR
                           Name of subdirectory in /etc to store runtime
                           options for runlevel scripts and daemons such as
-                          xenstoerd. This should be either "sysconfig" or
+                          xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
 
 Report bugs to <xen-devel@lists.xen.org>.
diff --git a/m4/paths.m4 b/m4/paths.m4
index b35596c..7ede5bd 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -54,7 +54,7 @@ AC_ARG_WITH([initddir],
 AC_ARG_WITH([sysconfig-leaf-dir],
     AS_HELP_STRING([--with-sysconfig-leaf-dir=SUBDIR],
     [Name of subdirectory in /etc to store runtime options for runlevel
-    scripts and daemons such as xenstoerd.
+    scripts and daemons such as xenstored.
     This should be either "sysconfig" or "default". [sysconfig]]),
     [config_leaf_dir=$withval],
     [config_leaf_dir=sysconfig
diff --git a/tools/configure b/tools/configure
index 446f707..db73fba 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1480,7 +1480,7 @@ Optional Packages:
   --with-sysconfig-leaf-dir=SUBDIR
                           Name of subdirectory in /etc to store runtime
                           options for runlevel scripts and daemons such as
-                          xenstoerd. This should be either "sysconfig" or
+                          xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
   --with-linux-backend-modules="mod1 mod2"
                           List of Linux backend module or modalias names to be
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:33:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDqw-0006eB-Py; Thu, 09 Oct 2014 13:33:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqv-0006dn-FC
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:57 +0000
Received: from [85.158.143.35:33407] by server-2.bemta-4.messagelabs.com id
	42/41-04525-4CE86345; Thu, 09 Oct 2014 13:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1412861634!11504612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19070 invoked from network); 9 Oct 2014 13:33:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:33:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqs-00027o-Cw
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDqs-00079r-Bx
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:33:54 +0000
Date: Thu, 09 Oct 2014 13:33:54 +0000
Message-Id: <E1XcDqs-00079r-Bx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix comment typo in m4/paths.m4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b4faf310a73c12c08a4961ebb94cb89e2b20566
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 7 10:51:31 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    Fix comment typo in m4/paths.m4
    
    Please rerun autogen.sh after applying this patch.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 configure       |    2 +-
 m4/paths.m4     |    2 +-
 tools/configure |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 9020df3..98a73d4 100755
--- a/configure
+++ b/configure
@@ -1294,7 +1294,7 @@ Optional Packages:
   --with-sysconfig-leaf-dir=SUBDIR
                           Name of subdirectory in /etc to store runtime
                           options for runlevel scripts and daemons such as
-                          xenstoerd. This should be either "sysconfig" or
+                          xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
 
 Report bugs to <xen-devel@lists.xen.org>.
diff --git a/m4/paths.m4 b/m4/paths.m4
index b35596c..7ede5bd 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -54,7 +54,7 @@ AC_ARG_WITH([initddir],
 AC_ARG_WITH([sysconfig-leaf-dir],
     AS_HELP_STRING([--with-sysconfig-leaf-dir=SUBDIR],
     [Name of subdirectory in /etc to store runtime options for runlevel
-    scripts and daemons such as xenstoerd.
+    scripts and daemons such as xenstored.
     This should be either "sysconfig" or "default". [sysconfig]]),
     [config_leaf_dir=$withval],
     [config_leaf_dir=sysconfig
diff --git a/tools/configure b/tools/configure
index 446f707..db73fba 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1480,7 +1480,7 @@ Optional Packages:
   --with-sysconfig-leaf-dir=SUBDIR
                           Name of subdirectory in /etc to store runtime
                           options for runlevel scripts and daemons such as
-                          xenstoerd. This should be either "sysconfig" or
+                          xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
   --with-linux-backend-modules="mod1 mod2"
                           List of Linux backend module or modalias names to be
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDr9-0006h1-Sl; Thu, 09 Oct 2014 13:34:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDr8-0006gX-PV
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:10 +0000
Received: from [85.158.139.211:44836] by server-14.bemta-5.messagelabs.com id
	3F/5F-12422-2DE86345; Thu, 09 Oct 2014 13:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412861645!7596173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5570 invoked from network); 9 Oct 2014 13:34:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDr2-00028N-Or
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDr2-0007Az-Gl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:04 +0000
Date: Thu, 09 Oct 2014 13:34:04 +0000
Message-Id: <E1XcDr2-0007Az-Gl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] config: remove unused MSGFMT and
	MSGMERGE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59182cf4f3e8351b87b177ab7f18679ddcde4e57
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 7 16:04:06 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    config: remove unused MSGFMT and MSGMERGE
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/StdGNU.mk |    3 ---
 config/SunOS.mk  |    2 --
 2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 1566d7f..4efebe3 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -16,9 +16,6 @@ OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJDUMP    = $(CROSS_COMPILE)objdump
 SIZEUTIL   = $(CROSS_COMPILE)size
 
-MSGFMT     = msgfmt
-MSGMERGE   = msgmerge
-
 # Allow git to be wrappered in the environment
 GIT        ?= git
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index bb8073f..3316280 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -10,8 +10,6 @@ OBJCOPY    = $(CROSS_COMPILE)gobjcopy
 OBJDUMP    = $(CROSS_COMPILE)gobjdump
 SIZEUTIL   = $(CROSS_COMPILE)gsize
 
-MSGFMT     = gmsgfmt
-
 SHELL      = bash
 
 INSTALL      = ginstall
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDr9-0006h1-Sl; Thu, 09 Oct 2014 13:34:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDr8-0006gX-PV
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:10 +0000
Received: from [85.158.139.211:44836] by server-14.bemta-5.messagelabs.com id
	3F/5F-12422-2DE86345; Thu, 09 Oct 2014 13:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412861645!7596173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5570 invoked from network); 9 Oct 2014 13:34:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDr2-00028N-Or
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDr2-0007Az-Gl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:04 +0000
Date: Thu, 09 Oct 2014 13:34:04 +0000
Message-Id: <E1XcDr2-0007Az-Gl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] config: remove unused MSGFMT and
	MSGMERGE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59182cf4f3e8351b87b177ab7f18679ddcde4e57
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 7 16:04:06 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    config: remove unused MSGFMT and MSGMERGE
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 config/StdGNU.mk |    3 ---
 config/SunOS.mk  |    2 --
 2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 1566d7f..4efebe3 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -16,9 +16,6 @@ OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJDUMP    = $(CROSS_COMPILE)objdump
 SIZEUTIL   = $(CROSS_COMPILE)size
 
-MSGFMT     = msgfmt
-MSGMERGE   = msgmerge
-
 # Allow git to be wrappered in the environment
 GIT        ?= git
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index bb8073f..3316280 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -10,8 +10,6 @@ OBJCOPY    = $(CROSS_COMPILE)gobjcopy
 OBJDUMP    = $(CROSS_COMPILE)gobjdump
 SIZEUTIL   = $(CROSS_COMPILE)gsize
 
-MSGFMT     = gmsgfmt
-
 SHELL      = bash
 
 INSTALL      = ginstall
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrG-0006iW-VR; Thu, 09 Oct 2014 13:34:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrG-0006iF-5P
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:18 +0000
Received: from [85.158.139.211:56566] by server-9.bemta-5.messagelabs.com id
	9D/60-20744-9DE86345; Thu, 09 Oct 2014 13:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1412861655!8871089!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22373 invoked from network); 9 Oct 2014 13:34:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrD-00028R-EC
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrD-0007BZ-DF
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:15 +0000
Date: Thu, 09 Oct 2014 13:34:15 +0000
Message-Id: <E1XcDrD-0007BZ-DF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: use APPEND_CFLAGS and
	APPEND_LDFLAGS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a547da77cd7dd018b74dc2d5c9fa405046c7c57b
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:22:40 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    tools/ocaml: use APPEND_CFLAGS and APPEND_LDFLAGS
    
    While implementing the --enable-rpath change I noticed that a ocaml
    build does not use APPEND_LDFLAGS. Make use of APPEND_CFLAGS and
    APPEND_LDFLAGS as it is done already in other places.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: David Scott <dave.scott@eu.citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xb/Makefile         |    1 +
 tools/ocaml/libs/xc/Makefile         |    1 +
 tools/ocaml/libs/xentoollog/Makefile |    1 +
 tools/ocaml/libs/xl/Makefile         |    1 +
 tools/ocaml/test/Makefile            |    1 +
 tools/ocaml/xenstored/Makefile       |    2 ++
 6 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/xb/Makefile b/tools/ocaml/libs/xb/Makefile
index 62ffefb..09d1bc8 100644
--- a/tools/ocaml/libs/xb/Makefile
+++ b/tools/ocaml/libs/xb/Makefile
@@ -5,6 +5,7 @@ include $(TOPLEVEL)/common.make
 CFLAGS += -I../mmap
 CFLAGS += $(CFLAGS_libxenctrl) # For xen_mb()
 CFLAGS += $(CFLAGS_xeninclude)
+CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE += -I ../mmap
 OCAMLOPTFLAGS += -for-pack Xenbus
 
diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
index 239c187..d24b014 100644
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -3,6 +3,7 @@ XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE += -I ../mmap
 
 OBJS = xenctrl
diff --git a/tools/ocaml/libs/xentoollog/Makefile b/tools/ocaml/libs/xentoollog/Makefile
index f2134b8..666eb66 100644
--- a/tools/ocaml/libs/xentoollog/Makefile
+++ b/tools/ocaml/libs/xentoollog/Makefile
@@ -6,6 +6,7 @@ include $(TOPLEVEL)/common.make
 CFLAGS += -Wno-declaration-after-statement
 
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE +=
 
 OBJS = xentoollog
diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile
index 61eb44c..0d1549d 100644
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -7,6 +7,7 @@ CFLAGS += -Wno-unused -Wno-declaration-after-statement
 
 CFLAGS += $(CFLAGS_libxenlight)
 CFLAGS += -I ../xentoollog
+CFLAGS += $(APPEND_CFLAGS)
 
 OBJS = xenlight
 INTF = xenlight.cmi
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index 8033089..b75726f 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -3,6 +3,7 @@ OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
 CFLAGS += $(CFLAGS_libxenlight)
+CFLAGS += $(APPEND_CFLAGS)
 LIBS_xenlight = $(LDLIBS_libxenlight)
 
 OCAMLINCLUDE += \
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 068e04a..ec19709 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -7,7 +7,9 @@ CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
 LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
 
 CFLAGS  += $(CFLAGS-y)
+CFLAGS  += $(APPEND_CFLAGS)
 LDFLAGS += $(LDFLAGS-y)
+LDFLAGS += $(APPEND_LDFLAGS)
 
 OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xb \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrG-0006iW-VR; Thu, 09 Oct 2014 13:34:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrG-0006iF-5P
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:18 +0000
Received: from [85.158.139.211:56566] by server-9.bemta-5.messagelabs.com id
	9D/60-20744-9DE86345; Thu, 09 Oct 2014 13:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1412861655!8871089!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22373 invoked from network); 9 Oct 2014 13:34:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrD-00028R-EC
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrD-0007BZ-DF
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:15 +0000
Date: Thu, 09 Oct 2014 13:34:15 +0000
Message-Id: <E1XcDrD-0007BZ-DF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: use APPEND_CFLAGS and
	APPEND_LDFLAGS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a547da77cd7dd018b74dc2d5c9fa405046c7c57b
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Mon Oct 6 15:22:40 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    tools/ocaml: use APPEND_CFLAGS and APPEND_LDFLAGS
    
    While implementing the --enable-rpath change I noticed that a ocaml
    build does not use APPEND_LDFLAGS. Make use of APPEND_CFLAGS and
    APPEND_LDFLAGS as it is done already in other places.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: David Scott <dave.scott@eu.citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xb/Makefile         |    1 +
 tools/ocaml/libs/xc/Makefile         |    1 +
 tools/ocaml/libs/xentoollog/Makefile |    1 +
 tools/ocaml/libs/xl/Makefile         |    1 +
 tools/ocaml/test/Makefile            |    1 +
 tools/ocaml/xenstored/Makefile       |    2 ++
 6 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/xb/Makefile b/tools/ocaml/libs/xb/Makefile
index 62ffefb..09d1bc8 100644
--- a/tools/ocaml/libs/xb/Makefile
+++ b/tools/ocaml/libs/xb/Makefile
@@ -5,6 +5,7 @@ include $(TOPLEVEL)/common.make
 CFLAGS += -I../mmap
 CFLAGS += $(CFLAGS_libxenctrl) # For xen_mb()
 CFLAGS += $(CFLAGS_xeninclude)
+CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE += -I ../mmap
 OCAMLOPTFLAGS += -for-pack Xenbus
 
diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
index 239c187..d24b014 100644
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -3,6 +3,7 @@ XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE += -I ../mmap
 
 OBJS = xenctrl
diff --git a/tools/ocaml/libs/xentoollog/Makefile b/tools/ocaml/libs/xentoollog/Makefile
index f2134b8..666eb66 100644
--- a/tools/ocaml/libs/xentoollog/Makefile
+++ b/tools/ocaml/libs/xentoollog/Makefile
@@ -6,6 +6,7 @@ include $(TOPLEVEL)/common.make
 CFLAGS += -Wno-declaration-after-statement
 
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE +=
 
 OBJS = xentoollog
diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile
index 61eb44c..0d1549d 100644
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -7,6 +7,7 @@ CFLAGS += -Wno-unused -Wno-declaration-after-statement
 
 CFLAGS += $(CFLAGS_libxenlight)
 CFLAGS += -I ../xentoollog
+CFLAGS += $(APPEND_CFLAGS)
 
 OBJS = xenlight
 INTF = xenlight.cmi
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index 8033089..b75726f 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -3,6 +3,7 @@ OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
 CFLAGS += $(CFLAGS_libxenlight)
+CFLAGS += $(APPEND_CFLAGS)
 LIBS_xenlight = $(LDLIBS_libxenlight)
 
 OCAMLINCLUDE += \
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 068e04a..ec19709 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -7,7 +7,9 @@ CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
 LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
 
 CFLAGS  += $(CFLAGS-y)
+CFLAGS  += $(APPEND_CFLAGS)
 LDFLAGS += $(LDFLAGS-y)
+LDFLAGS += $(APPEND_LDFLAGS)
 
 OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xb \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrS-0006kg-1n; Thu, 09 Oct 2014 13:34:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrQ-0006kS-SR
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:29 +0000
Received: from [85.158.143.35:10707] by server-1.bemta-4.messagelabs.com id
	81/96-05872-4EE86345; Thu, 09 Oct 2014 13:34:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1412861665!11872003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26530 invoked from network); 9 Oct 2014 13:34:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrN-00028Z-JK
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrN-0007CA-IQ
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:25 +0000
Date: Thu, 09 Oct 2014 13:34:25 +0000
Message-Id: <E1XcDrN-0007CA-IQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: another for fix for lwip
	compile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d172da1bb44462e6ef87e00aa6d12e4996968d4f
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 7 16:15:46 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    stubdom: another for fix for lwip compile
    
    stubdom/lwip-x86_64/src/core/dhcp.c: In function 'dhcp_create_request':
    stubdom/lwip-x86_64/src/core/dhcp.c:1361:64: error: array subscript is above array bounds
    
    The previous attempt to fix the failure above worked fine in SLE11,
    openSUSE 13.1 and newer. But gcc-4.5 as included in openSUSE 11.4 still
    failed to compile. To fix compilation also with this version of gcc move
    the range check right into the code instead of assigning it to a
    temporary variable.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/lwip.dhcp_create_request-hwaddr_len.patch |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/stubdom/lwip.dhcp_create_request-hwaddr_len.patch b/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
index 12f1014..c43f282 100644
--- a/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
+++ b/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
@@ -1,26 +1,13 @@
----
- lwip-x86_64/src/core/dhcp.c |    4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
 Index: src/core/dhcp.c
 ===================================================================
 --- src/core/dhcp.c
 +++ src/core/dhcp.c
-@@ -1322,6 +1322,8 @@ dhcp_create_request(struct netif *netif)
- {
-   struct dhcp *dhcp;
-   u16_t i;
-+  /* gcc can not know if hwaddr_len exceeds the hwaddr array size */
-+  u8_t hwaddr_len = netif->hwaddr_len > NETIF_MAX_HWADDR_LEN ? NETIF_MAX_HWADDR_LEN : netif->hwaddr_len;
-   LWIP_ERROR("dhcp_create_request: netif != NULL", (netif != NULL), return ERR_ARG;);
-   dhcp = netif->dhcp;
-   LWIP_ERROR("dhcp_create_request: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
 @@ -1356,7 +1358,7 @@ dhcp_create_request(struct netif *netif)
    dhcp->msg_out->giaddr.addr = 0;
    for (i = 0; i < DHCP_CHADDR_LEN; i++) {
      /* copy netif hardware address, pad with zeroes */
 -    dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
-+    dhcp->msg_out->chaddr[i] = (i < hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
++    dhcp->msg_out->chaddr[i] = (i < (netif->hwaddr_len > NETIF_MAX_HWADDR_LEN ? NETIF_MAX_HWADDR_LEN : netif->hwaddr_len)) ? netif->hwaddr[i] : 0/* pad byte*/;
    }
    for (i = 0; i < DHCP_SNAME_LEN; i++) {
      dhcp->msg_out->sname[i] = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrS-0006kg-1n; Thu, 09 Oct 2014 13:34:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrQ-0006kS-SR
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:29 +0000
Received: from [85.158.143.35:10707] by server-1.bemta-4.messagelabs.com id
	81/96-05872-4EE86345; Thu, 09 Oct 2014 13:34:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1412861665!11872003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26530 invoked from network); 9 Oct 2014 13:34:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrN-00028Z-JK
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrN-0007CA-IQ
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:25 +0000
Date: Thu, 09 Oct 2014 13:34:25 +0000
Message-Id: <E1XcDrN-0007CA-IQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: another for fix for lwip
	compile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d172da1bb44462e6ef87e00aa6d12e4996968d4f
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 7 16:15:46 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:22 2014 +0100

    stubdom: another for fix for lwip compile
    
    stubdom/lwip-x86_64/src/core/dhcp.c: In function 'dhcp_create_request':
    stubdom/lwip-x86_64/src/core/dhcp.c:1361:64: error: array subscript is above array bounds
    
    The previous attempt to fix the failure above worked fine in SLE11,
    openSUSE 13.1 and newer. But gcc-4.5 as included in openSUSE 11.4 still
    failed to compile. To fix compilation also with this version of gcc move
    the range check right into the code instead of assigning it to a
    temporary variable.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/lwip.dhcp_create_request-hwaddr_len.patch |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/stubdom/lwip.dhcp_create_request-hwaddr_len.patch b/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
index 12f1014..c43f282 100644
--- a/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
+++ b/stubdom/lwip.dhcp_create_request-hwaddr_len.patch
@@ -1,26 +1,13 @@
----
- lwip-x86_64/src/core/dhcp.c |    4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
 Index: src/core/dhcp.c
 ===================================================================
 --- src/core/dhcp.c
 +++ src/core/dhcp.c
-@@ -1322,6 +1322,8 @@ dhcp_create_request(struct netif *netif)
- {
-   struct dhcp *dhcp;
-   u16_t i;
-+  /* gcc can not know if hwaddr_len exceeds the hwaddr array size */
-+  u8_t hwaddr_len = netif->hwaddr_len > NETIF_MAX_HWADDR_LEN ? NETIF_MAX_HWADDR_LEN : netif->hwaddr_len;
-   LWIP_ERROR("dhcp_create_request: netif != NULL", (netif != NULL), return ERR_ARG;);
-   dhcp = netif->dhcp;
-   LWIP_ERROR("dhcp_create_request: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
 @@ -1356,7 +1358,7 @@ dhcp_create_request(struct netif *netif)
    dhcp->msg_out->giaddr.addr = 0;
    for (i = 0; i < DHCP_CHADDR_LEN; i++) {
      /* copy netif hardware address, pad with zeroes */
 -    dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
-+    dhcp->msg_out->chaddr[i] = (i < hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
++    dhcp->msg_out->chaddr[i] = (i < (netif->hwaddr_len > NETIF_MAX_HWADDR_LEN ? NETIF_MAX_HWADDR_LEN : netif->hwaddr_len)) ? netif->hwaddr[i] : 0/* pad byte*/;
    }
    for (i = 0; i < DHCP_SNAME_LEN; i++) {
      dhcp->msg_out->sname[i] = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrb-0006mx-8U; Thu, 09 Oct 2014 13:34:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDra-0006mS-5S
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:38 +0000
Received: from [85.158.139.211:62846] by server-14.bemta-5.messagelabs.com id
	1E/60-12422-DEE86345; Thu, 09 Oct 2014 13:34:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1412861675!13018316!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2692 invoked from network); 9 Oct 2014 13:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrX-00028h-Nz
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrX-0007Cm-N0
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:35 +0000
Date: Thu, 09 Oct 2014 13:34:35 +0000
Message-Id: <E1XcDrX-0007Cm-N0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove dead qemu code from toplevel
	Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ed06911dc596d23f21dee209b7f2db294e34b56
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Oct 8 09:41:27 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    Remove dead qemu code from toplevel Makefile
    
    After commit b0f69ec5c71de1248d915c193b57c43e786857dd ("tools: Make
    qemu-xen-traditional build optional.") the existing make targets are
    wrapped in ifeq ($(CONF),y), but CONF is never set because
    config/Tools.mk is not included.
    
    Drop the dead code. The same effect can be achieved by calling the make
    commands directly, after calling configure.
    
    A better approach would be a simple, single 'make $something' which
    should be a wrapper around a targets in tools/Makefile that clones,
    updates and cleans the subprojects. That has to be worked out in a
    different patch.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |   22 ----------------------
 1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index bf8028a..0355b49 100644
--- a/Makefile
+++ b/Makefile
@@ -64,28 +64,6 @@ docs: dist-docs
 install-xen:
 	$(MAKE) -C xen install
 
-ifeq ($(CONFIG_QEMU_TRAD),y)
-QEMU_TRAD_DIR_TGT := tools/qemu-xen-traditional-dir
-
-tools/qemu-xen-traditional-dir:
-	$(MAKE) -C tools qemu-xen-traditional-dir-find
-
-.PHONY: tools/qemu-xen-traditional-dir-force-update
-tools/qemu-xen-traditional-dir-force-update:
-	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
-endif
-
-ifeq ($(CONFIG_QEMU_XEN),y)
-QEMU_XEN_DIR_TGT := tools/qemu-xen-dir
-
-tools/qemu-xen-dir:
-	$(MAKE) -C tools qemu-xen-dir-find
-
-.PHONY: tools/qemu-xen-dir-force-update
-tools/qemu-xen-dir-force-update:
-	$(MAKE) -C tools qemu-xen-dir-force-update
-endif
-
 .PHONY: install-tools
 install-tools: $(QEMU_TRAD_DIR_TARGET) $(QEMU_XEN_DIR_TARGET)
 	$(MAKE) -C tools install
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrb-0006mx-8U; Thu, 09 Oct 2014 13:34:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDra-0006mS-5S
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:38 +0000
Received: from [85.158.139.211:62846] by server-14.bemta-5.messagelabs.com id
	1E/60-12422-DEE86345; Thu, 09 Oct 2014 13:34:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1412861675!13018316!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2692 invoked from network); 9 Oct 2014 13:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrX-00028h-Nz
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrX-0007Cm-N0
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:35 +0000
Date: Thu, 09 Oct 2014 13:34:35 +0000
Message-Id: <E1XcDrX-0007Cm-N0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove dead qemu code from toplevel
	Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ed06911dc596d23f21dee209b7f2db294e34b56
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Oct 8 09:41:27 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    Remove dead qemu code from toplevel Makefile
    
    After commit b0f69ec5c71de1248d915c193b57c43e786857dd ("tools: Make
    qemu-xen-traditional build optional.") the existing make targets are
    wrapped in ifeq ($(CONF),y), but CONF is never set because
    config/Tools.mk is not included.
    
    Drop the dead code. The same effect can be achieved by calling the make
    commands directly, after calling configure.
    
    A better approach would be a simple, single 'make $something' which
    should be a wrapper around a targets in tools/Makefile that clones,
    updates and cleans the subprojects. That has to be worked out in a
    different patch.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |   22 ----------------------
 1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index bf8028a..0355b49 100644
--- a/Makefile
+++ b/Makefile
@@ -64,28 +64,6 @@ docs: dist-docs
 install-xen:
 	$(MAKE) -C xen install
 
-ifeq ($(CONFIG_QEMU_TRAD),y)
-QEMU_TRAD_DIR_TGT := tools/qemu-xen-traditional-dir
-
-tools/qemu-xen-traditional-dir:
-	$(MAKE) -C tools qemu-xen-traditional-dir-find
-
-.PHONY: tools/qemu-xen-traditional-dir-force-update
-tools/qemu-xen-traditional-dir-force-update:
-	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
-endif
-
-ifeq ($(CONFIG_QEMU_XEN),y)
-QEMU_XEN_DIR_TGT := tools/qemu-xen-dir
-
-tools/qemu-xen-dir:
-	$(MAKE) -C tools qemu-xen-dir-find
-
-.PHONY: tools/qemu-xen-dir-force-update
-tools/qemu-xen-dir-force-update:
-	$(MAKE) -C tools qemu-xen-dir-force-update
-endif
-
 .PHONY: install-tools
 install-tools: $(QEMU_TRAD_DIR_TARGET) $(QEMU_XEN_DIR_TARGET)
 	$(MAKE) -C tools install
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrl-0006qH-Oa; Thu, 09 Oct 2014 13:34:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrk-0006pl-DY
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:48 +0000
Received: from [85.158.139.211:64086] by server-6.bemta-5.messagelabs.com id
	84/28-06284-7FE86345; Thu, 09 Oct 2014 13:34:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412861686!7596420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14172 invoked from network); 9 Oct 2014 13:34:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrh-00028o-T1
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrh-0007DN-RW
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:45 +0000
Date: Thu, 09 Oct 2014 13:34:45 +0000
Message-Id: <E1XcDrh-0007DN-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gitignore: Cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30f58b8696be6e4fef1d581c2ce0880f975ba2b0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    gitignore: Cleanup
    
    This is a rough pruning based mainly on directories which no longer exist.
    Some of this was code deleted in 2007.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Tim Deegan <tim@xen.org>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore |   39 ---------------------------------------
 1 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/.gitignore b/.gitignore
index 2201cb0..b24e905 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,24 +52,6 @@ extras/mini-os/include/xen
 extras/mini-os/include/list.h
 extras/mini-os/mini-os*
 install/*
-linux-[^/]*-paravirt/*
-linux-2.6[^/]*/*
-linux-[^/]*-rc/*
-linux-[^/]*-tip/*
-linux-[^/]*-git/*
-linux-[^/]*.patch
-mkddbxen
-netbsd-[^/]*-tools/*
-netbsd-[^/]*-xen0/*
-netbsd-[^/]*-xenU/*
-netbsd-[^/]*.patch
-patches/*/.makedep
-patches/ebtables-brnf-5_vs_2.4.25.diff
-patches/ebtables.diff
-patches/tmp/*
-pristine-*
-ref-*
-tmp-*
 stubdom/autom4te.cache/
 stubdom/binutils-*
 stubdom/config.log
@@ -124,7 +106,6 @@ tools/blktap/drivers/img2qcow
 tools/blktap/drivers/qcow-create
 tools/blktap/drivers/qcow2raw
 tools/blktap/drivers/tapdisk
-tools/check/.*
 tools/console/xenconsole
 tools/console/xenconsoled
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
@@ -158,7 +139,6 @@ tools/flask/utils/flask-loadpolicy
 tools/flask/utils/flask-setenforce
 tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
-tools/fs-back/fs-backend
 tools/hotplug/common/hotplugpath.sh
 tools/hotplug/FreeBSD/rc.d/xencommons
 tools/hotplug/Linux/init.d/xen-watchdog
@@ -193,8 +173,6 @@ tools/misc/lowmemd
 tools/misc/xencov
 tools/pygrub/build/*
 tools/python/build/*
-tools/remus/imqebt/imqebt
-tools/remus/kmod/*(.cmd|.mod|.ko|.mod.c|.symvers|.xen)
 tools/security/secpol_tool
 tools/security/xen/*
 tools/security/xensec_tool
@@ -208,22 +186,14 @@ tools/tests/regression/build/*
 tools/tests/regression/downloads/*
 tools/tests/mem-sharing/memshrtool
 tools/tests/mce-test/tools/xen-mceinj
-tools/vtpm/tpm_emulator-*.tar.gz
-tools/vtpm/tpm_emulator/*
-tools/vtpm/vtpm/*
-tools/vtpm_manager/manager/vtpm_managerd
 tools/xcutils/lsevtchn
 tools/xcutils/readnotes
-tools/xenfb/sdlfb
-tools/xenfb/vncfb
 tools/xenmon/xentrace_setmask
 tools/xenmon/xenbaked
 tools/xenpaging/xenpaging
 tools/xenpmd/xenpmd
 tools/xenstat/xentop/xentop
-tools/xenstore/testsuite/tmp/*
 tools/xenstore/init-xenstore-domain
-tools/xenstore/xen
 tools/xenstore/xenstore
 tools/xenstore/xenstore-chmod
 tools/xenstore/xenstore-exists
@@ -235,17 +205,11 @@ tools/xenstore/xenstore-control
 tools/xenstore/xenstore-ls
 tools/xenstore/xenstored
 tools/xenstore/xenstored_test
-tools/xenstore/xs_crashme
-tools/xenstore/xs_random
-tools/xenstore/xs_stress
 tools/xenstore/xs_tdb_dump
-tools/xenstore/xs_test
-tools/xenstore/xs_watch_stress
 tools/xentrace/xentrace_setsize
 tools/xentrace/tbctl
 tools/xentrace/xenctx
 tools/xentrace/xentrace
-tools/ocaml-xenstored*
 xen/.banner
 xen/System.map
 xen/arch/arm/asm-offsets.s
@@ -264,13 +228,10 @@ xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/efi.h
 xen/arch/*/efi/runtime.c
-xen/ddb/*
 xen/include/headers.chk
 xen/include/asm
 xen/include/asm-*/asm-offsets.h
 xen/include/compat/*
-xen/include/hypervisor-ifs/arch
-xen/include/linux
 xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrl-0006qH-Oa; Thu, 09 Oct 2014 13:34:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrk-0006pl-DY
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:48 +0000
Received: from [85.158.139.211:64086] by server-6.bemta-5.messagelabs.com id
	84/28-06284-7FE86345; Thu, 09 Oct 2014 13:34:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1412861686!7596420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14172 invoked from network); 9 Oct 2014 13:34:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrh-00028o-T1
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrh-0007DN-RW
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:45 +0000
Date: Thu, 09 Oct 2014 13:34:45 +0000
Message-Id: <E1XcDrh-0007DN-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gitignore: Cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30f58b8696be6e4fef1d581c2ce0880f975ba2b0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    gitignore: Cleanup
    
    This is a rough pruning based mainly on directories which no longer exist.
    Some of this was code deleted in 2007.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Tim Deegan <tim@xen.org>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore |   39 ---------------------------------------
 1 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/.gitignore b/.gitignore
index 2201cb0..b24e905 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,24 +52,6 @@ extras/mini-os/include/xen
 extras/mini-os/include/list.h
 extras/mini-os/mini-os*
 install/*
-linux-[^/]*-paravirt/*
-linux-2.6[^/]*/*
-linux-[^/]*-rc/*
-linux-[^/]*-tip/*
-linux-[^/]*-git/*
-linux-[^/]*.patch
-mkddbxen
-netbsd-[^/]*-tools/*
-netbsd-[^/]*-xen0/*
-netbsd-[^/]*-xenU/*
-netbsd-[^/]*.patch
-patches/*/.makedep
-patches/ebtables-brnf-5_vs_2.4.25.diff
-patches/ebtables.diff
-patches/tmp/*
-pristine-*
-ref-*
-tmp-*
 stubdom/autom4te.cache/
 stubdom/binutils-*
 stubdom/config.log
@@ -124,7 +106,6 @@ tools/blktap/drivers/img2qcow
 tools/blktap/drivers/qcow-create
 tools/blktap/drivers/qcow2raw
 tools/blktap/drivers/tapdisk
-tools/check/.*
 tools/console/xenconsole
 tools/console/xenconsoled
 tools/debugger/gdb/gdb-6.2.1-linux-i386-xen/*
@@ -158,7 +139,6 @@ tools/flask/utils/flask-loadpolicy
 tools/flask/utils/flask-setenforce
 tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
-tools/fs-back/fs-backend
 tools/hotplug/common/hotplugpath.sh
 tools/hotplug/FreeBSD/rc.d/xencommons
 tools/hotplug/Linux/init.d/xen-watchdog
@@ -193,8 +173,6 @@ tools/misc/lowmemd
 tools/misc/xencov
 tools/pygrub/build/*
 tools/python/build/*
-tools/remus/imqebt/imqebt
-tools/remus/kmod/*(.cmd|.mod|.ko|.mod.c|.symvers|.xen)
 tools/security/secpol_tool
 tools/security/xen/*
 tools/security/xensec_tool
@@ -208,22 +186,14 @@ tools/tests/regression/build/*
 tools/tests/regression/downloads/*
 tools/tests/mem-sharing/memshrtool
 tools/tests/mce-test/tools/xen-mceinj
-tools/vtpm/tpm_emulator-*.tar.gz
-tools/vtpm/tpm_emulator/*
-tools/vtpm/vtpm/*
-tools/vtpm_manager/manager/vtpm_managerd
 tools/xcutils/lsevtchn
 tools/xcutils/readnotes
-tools/xenfb/sdlfb
-tools/xenfb/vncfb
 tools/xenmon/xentrace_setmask
 tools/xenmon/xenbaked
 tools/xenpaging/xenpaging
 tools/xenpmd/xenpmd
 tools/xenstat/xentop/xentop
-tools/xenstore/testsuite/tmp/*
 tools/xenstore/init-xenstore-domain
-tools/xenstore/xen
 tools/xenstore/xenstore
 tools/xenstore/xenstore-chmod
 tools/xenstore/xenstore-exists
@@ -235,17 +205,11 @@ tools/xenstore/xenstore-control
 tools/xenstore/xenstore-ls
 tools/xenstore/xenstored
 tools/xenstore/xenstored_test
-tools/xenstore/xs_crashme
-tools/xenstore/xs_random
-tools/xenstore/xs_stress
 tools/xenstore/xs_tdb_dump
-tools/xenstore/xs_test
-tools/xenstore/xs_watch_stress
 tools/xentrace/xentrace_setsize
 tools/xentrace/tbctl
 tools/xentrace/xenctx
 tools/xentrace/xentrace
-tools/ocaml-xenstored*
 xen/.banner
 xen/System.map
 xen/arch/arm/asm-offsets.s
@@ -264,13 +228,10 @@ xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/efi.h
 xen/arch/*/efi/runtime.c
-xen/ddb/*
 xen/include/headers.chk
 xen/include/asm
 xen/include/asm-*/asm-offsets.h
 xen/include/compat/*
-xen/include/hypervisor-ifs/arch
-xen/include/linux
 xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrv-0006sv-RA; Thu, 09 Oct 2014 13:34:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDru-0006sQ-I7
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:58 +0000
Received: from [85.158.143.35:15955] by server-1.bemta-4.messagelabs.com id
	BB/87-05872-10F86345; Thu, 09 Oct 2014 13:34:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1412861696!11858499!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1972 invoked from network); 9 Oct 2014 13:34:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrs-00028z-1Z
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrs-0007Dy-0X
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:56 +0000
Date: Thu, 09 Oct 2014 13:34:56 +0000
Message-Id: <E1XcDrs-0007Dy-0X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Introduce
	clients-install target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be188d211d26afd872a43843563bfbe3923d5af9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:08 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    tools/xenstore: Introduce clients-install target
    
    ...to match the existing 'clients' built target.  This is particularly useful
    when rebuilding the xenstore clients separately for a non-dom0 environment.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 563abd4..cb4ab42 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -150,6 +150,14 @@ endif
 	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
+.PHONY: clients-install
+clients-install: clients
+	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
+	$(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)
+	set -e ; for c in $(CLIENTS) ; do \
+		ln -f $(DESTDIR)$(BINDIR)/xenstore $(DESTDIR)$(BINDIR)/$${c} ; \
+	done
+
 -include $(DEPS)
 
 # never delete any intermediate files.
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:34:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:34:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDrv-0006sv-RA; Thu, 09 Oct 2014 13:34:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDru-0006sQ-I7
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:58 +0000
Received: from [85.158.143.35:15955] by server-1.bemta-4.messagelabs.com id
	BB/87-05872-10F86345; Thu, 09 Oct 2014 13:34:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1412861696!11858499!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1972 invoked from network); 9 Oct 2014 13:34:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:34:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrs-00028z-1Z
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDrs-0007Dy-0X
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:34:56 +0000
Date: Thu, 09 Oct 2014 13:34:56 +0000
Message-Id: <E1XcDrs-0007Dy-0X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Introduce
	clients-install target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be188d211d26afd872a43843563bfbe3923d5af9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:08 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    tools/xenstore: Introduce clients-install target
    
    ...to match the existing 'clients' built target.  This is particularly useful
    when rebuilding the xenstore clients separately for a non-dom0 environment.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 563abd4..cb4ab42 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -150,6 +150,14 @@ endif
 	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
+.PHONY: clients-install
+clients-install: clients
+	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
+	$(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)
+	set -e ; for c in $(CLIENTS) ; do \
+		ln -f $(DESTDIR)$(BINDIR)/xenstore $(DESTDIR)$(BINDIR)/$${c} ; \
+	done
+
 -include $(DEPS)
 
 # never delete any intermediate files.
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDs9-0006vZ-Ua; Thu, 09 Oct 2014 13:35:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDs9-0006vK-2S
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:13 +0000
Received: from [85.158.143.35:61537] by server-3.bemta-4.messagelabs.com id
	73/D9-06192-01F86345; Thu, 09 Oct 2014 13:35:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1412861706!11820509!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6541 invoked from network); 9 Oct 2014 13:35:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDs2-00029W-J6
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDs2-0007Fd-5U
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:06 +0000
Date: Thu, 09 Oct 2014 13:35:06 +0000
Message-Id: <E1XcDs2-0007Fd-5U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Only create SBINDIR if
	it is to be used
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3657f11bb8dab074e2397606c9f2eeb3e9a25e60
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:09 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    tools/xenstore: Only create SBINDIR if it is to be used
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index cb4ab42..bff9b25 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -126,10 +126,10 @@ tarball: clean
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat
 ifeq ($(XENSTORE_XENSTORED),y)
+	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_STORED)
 	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
 endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDs9-0006vZ-Ua; Thu, 09 Oct 2014 13:35:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDs9-0006vK-2S
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:13 +0000
Received: from [85.158.143.35:61537] by server-3.bemta-4.messagelabs.com id
	73/D9-06192-01F86345; Thu, 09 Oct 2014 13:35:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1412861706!11820509!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6541 invoked from network); 9 Oct 2014 13:35:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDs2-00029W-J6
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDs2-0007Fd-5U
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:06 +0000
Date: Thu, 09 Oct 2014 13:35:06 +0000
Message-Id: <E1XcDs2-0007Fd-5U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Only create SBINDIR if
	it is to be used
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3657f11bb8dab074e2397606c9f2eeb3e9a25e60
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:09 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    tools/xenstore: Only create SBINDIR if it is to be used
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index cb4ab42..bff9b25 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -126,10 +126,10 @@ tarball: clean
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat
 ifeq ($(XENSTORE_XENSTORED),y)
+	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_STORED)
 	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
 endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsG-0006x8-0l; Thu, 09 Oct 2014 13:35:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsF-0006wp-E8
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:19 +0000
Received: from [85.158.139.211:6940] by server-8.bemta-5.messagelabs.com id
	F6/58-22440-61F86345; Thu, 09 Oct 2014 13:35:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1412861716!13055877!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14285 invoked from network); 9 Oct 2014 13:35:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsC-00029Z-Nx
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsC-0007GK-MG
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:16 +0000
Date: Thu, 09 Oct 2014 13:35:16 +0000
Message-Id: <E1XcDsC-0007GK-MG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: Gate building tests on
	CONFIG_TESTS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc2bf9d2f867ea3e22e5b3badc45d16069bd48a3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:10 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    tools/ocaml: Gate building tests on CONFIG_TESTS
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: David Scott <dave.scott@eu.citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 8e4ca36..5710a5f 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -1,9 +1,12 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS_PROGRAMS = xenstored test
+SUBDIRS := libs
+SUBDIRS += xenstored
 
-SUBDIRS = libs $(SUBDIRS_PROGRAMS)
+ifeq ($(CONFIG_TESTS),y)
+SUBDIRS += test
+endif
 
 .NOTPARALLEL:
 # targets here must be run in order, otherwise we can try
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsG-0006x8-0l; Thu, 09 Oct 2014 13:35:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsF-0006wp-E8
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:19 +0000
Received: from [85.158.139.211:6940] by server-8.bemta-5.messagelabs.com id
	F6/58-22440-61F86345; Thu, 09 Oct 2014 13:35:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1412861716!13055877!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14285 invoked from network); 9 Oct 2014 13:35:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsC-00029Z-Nx
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsC-0007GK-MG
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:16 +0000
Date: Thu, 09 Oct 2014 13:35:16 +0000
Message-Id: <E1XcDsC-0007GK-MG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: Gate building tests on
	CONFIG_TESTS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc2bf9d2f867ea3e22e5b3badc45d16069bd48a3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 7 12:02:10 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 13:38:23 2014 +0100

    tools/ocaml: Gate building tests on CONFIG_TESTS
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: David Scott <dave.scott@eu.citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 8e4ca36..5710a5f 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -1,9 +1,12 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS_PROGRAMS = xenstored test
+SUBDIRS := libs
+SUBDIRS += xenstored
 
-SUBDIRS = libs $(SUBDIRS_PROGRAMS)
+ifeq ($(CONFIG_TESTS),y)
+SUBDIRS += test
+endif
 
 .NOTPARALLEL:
 # targets here must be run in order, otherwise we can try
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsR-00070U-3V; Thu, 09 Oct 2014 13:35:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsP-0006z9-Nu
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:29 +0000
Received: from [85.158.139.211:17127] by server-5.bemta-5.messagelabs.com id
	DA/7A-11546-12F86345; Thu, 09 Oct 2014 13:35:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1412861727!13002049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5347 invoked from network); 9 Oct 2014 13:35:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsM-00029n-Td
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsM-0007Gy-Sa
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:26 +0000
Date: Thu, 09 Oct 2014 13:35:26 +0000
Message-Id: <E1XcDsM-0007Gy-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add a poll-based select
	mechanism
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1322076727ef8b21a3a0eb9726d89ff56dfcb837
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:54 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add a poll-based select mechanism
    
    Currently, oxenstored uses Unix.select underneath, so it doesn't work properly
    if given a FD number >= 1024. This is a scalability bottleneck for hosts
    running large number of VMs.
    
    To remove this limitation, we implemented a poll-based mechanism but with the
    same type signature as the Unix.select currently in use. So these two functions
    can be interchangeable at any stage.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/Makefile       |    9 +++-
 tools/ocaml/xenstored/select.ml      |   54 +++++++++++++++++++++++++++
 tools/ocaml/xenstored/select.mli     |   20 ++++++++++
 tools/ocaml/xenstored/select_stubs.c |   68 ++++++++++++++++++++++++++++++++++
 tools/ocaml/xenstored/xenstored.ml   |    2 +-
 5 files changed, 149 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index ec19709..48f1079 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -17,10 +17,12 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
 	-I $(OCAML_TOPLEVEL)/libs/eventchn
 
-LIBS = syslog.cma syslog.cmxa
+LIBS = syslog.cma syslog.cmxa select.cma select.cmxa
 syslog_OBJS = syslog
 syslog_C_OBJS = syslog_stubs
-OCAML_LIBRARY = syslog
+select_OBJS = select
+select_C_OBJS = select_stubs
+OCAML_LIBRARY = syslog select
 
 LIBS += systemd.cma systemd.cmxa
 systemd_OBJS = systemd
@@ -48,12 +50,13 @@ OBJS = define \
 	process \
 	xenstored
 
-INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi
+INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi select.cmi
 
 XENSTOREDLIBS = \
 	unix.cmxa \
 	-ccopt -L -ccopt . syslog.cmxa \
 	-ccopt -L -ccopt . systemd.cmxa \
+	-ccopt -L -ccopt . select.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
diff --git a/tools/ocaml/xenstored/select.ml b/tools/ocaml/xenstored/select.ml
new file mode 100644
index 0000000..3f4b671
--- /dev/null
+++ b/tools/ocaml/xenstored/select.ml
@@ -0,0 +1,54 @@
+(*
+ * Copyright (C) 2014 Zheng Li <dev@zheng.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+
+(* The [read], [write], [except] are fields mapped to the POLLIN/OUT/PRI
+   subscription flags used by poll, which have a correspondence to the
+   readfds, writefds, exceptfds concept as in select. *)
+type event = {
+	mutable read: bool;
+	mutable write: bool;
+	mutable except: bool;
+}
+
+external select_on_poll: (Unix.file_descr * event) array -> int -> int = "stub_select_on_poll"
+
+let init_event () = {read = false; write = false; except = false}
+
+let select in_fds out_fds exc_fds timeout =
+	let h = Hashtbl.create 57 in
+	let add_event event_set fd =
+		let e =
+			try Hashtbl.find h fd
+			with Not_found ->
+				let e = init_event () in
+				Hashtbl.add h fd e; e in
+		event_set e in
+	List.iter (add_event (fun x -> x.read <- true)) in_fds;
+	List.iter (add_event (fun x -> x.write <- true)) out_fds;
+	List.iter (add_event (fun x -> x.except <- true)) exc_fds;
+	(* Unix.stdin and init_event are dummy input as stubs, which will
+           always be overwritten later on.  *)
+	let a = Array.make (Hashtbl.length h) (Unix.stdin, init_event ()) in
+	let i = ref (-1) in
+	Hashtbl.iter (fun fd event -> incr i; Array.set a !i (fd, event)) h;
+	let n = select_on_poll a (int_of_float (timeout *. 1000.)) in
+	let r = [], [], [] in
+	if n = 0 then r else
+		Array.fold_right
+			(fun (fd, event) (r, w, x) ->
+			 (if event.read then fd :: r else r),
+			 (if event.write then fd :: w else w),
+			 (if event.except then fd :: x else x))
+			a r
diff --git a/tools/ocaml/xenstored/select.mli b/tools/ocaml/xenstored/select.mli
new file mode 100644
index 0000000..1253d4e
--- /dev/null
+++ b/tools/ocaml/xenstored/select.mli
@@ -0,0 +1,20 @@
+(*
+ * Copyright (C) 2014 Zheng Li <dev@zheng.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+
+(** Same interface and semantics as [Unix.select] but with an extra alternative
+    implementation based on poll. *)
+val select:
+	Unix.file_descr list -> Unix.file_descr list -> Unix.file_descr list -> float
+	-> Unix.file_descr list * Unix.file_descr list * Unix.file_descr list
diff --git a/tools/ocaml/xenstored/select_stubs.c b/tools/ocaml/xenstored/select_stubs.c
new file mode 100644
index 0000000..33beeb9
--- /dev/null
+++ b/tools/ocaml/xenstored/select_stubs.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2014 Zheng Li <dev@zheng.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include <poll.h>
+#include <errno.h>
+#include <sys/resource.h>
+#include <unistd.h>
+#include <caml/mlvalues.h>
+#include <caml/memory.h>
+#include <caml/fail.h>
+#include <caml/alloc.h>
+#include <caml/signals.h>
+#include <caml/unixsupport.h>
+
+CAMLprim value stub_select_on_poll(value fd_events, value timeo) {
+
+	CAMLparam2(fd_events, timeo);
+	CAMLlocal1(events);
+	int i, rc, c_len = Wosize_val(fd_events), c_timeo = Int_val(timeo);
+	struct pollfd c_fds[c_len];
+
+
+	for (i = 0; i < c_len; i++) {
+
+		events = Field(Field(fd_events, i), 1);
+
+		c_fds[i].fd = Int_val(Field(Field(fd_events, i), 0));
+		c_fds[i].events = c_fds[i].revents = 0;
+		c_fds[i].events |= Bool_val(Field(events, 0)) ? POLLIN : 0;
+		c_fds[i].events |= Bool_val(Field(events, 1)) ? POLLOUT: 0;
+		c_fds[i].events |= Bool_val(Field(events, 2)) ? POLLPRI: 0;
+
+	};
+
+	caml_enter_blocking_section();
+	rc = poll(c_fds, c_len, c_timeo);
+	caml_leave_blocking_section();
+
+	if (rc < 0) uerror("poll", Nothing);
+
+	if (rc > 0) {
+
+		for (i = 0; i < c_len; i++) {
+
+			events = Field(Field(fd_events, i), 1);
+
+			if (c_fds[i].revents & POLLNVAL) unix_error(EBADF, "select", Nothing);
+			Field(events, 0) = Val_bool(c_fds[i].events | POLLIN  && c_fds[i].revents & (POLLIN |POLLHUP|POLLERR));
+			Field(events, 1) = Val_bool(c_fds[i].events | POLLOUT && c_fds[i].revents & (POLLOUT|POLLHUP|POLLERR));
+			Field(events, 2) = Val_bool(c_fds[i].revents & POLLPRI);
+
+		}
+
+	}
+
+	CAMLreturn(Val_int(rc));
+}
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1c02f2f..bfa488f 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -368,7 +368,7 @@ let _ =
 		let timeout = if List.length mw > 0 then 0. else -1. in
 		let rset, wset, _ =
 		try
-			Unix.select (spec_fds @ inset) outset [] timeout
+			Select.select (spec_fds @ inset) outset [] timeout
 		with Unix.Unix_error(Unix.EINTR, _, _) ->
 			[], [], [] in
 		let sfds, cfds =
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsR-00070U-3V; Thu, 09 Oct 2014 13:35:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsP-0006z9-Nu
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:29 +0000
Received: from [85.158.139.211:17127] by server-5.bemta-5.messagelabs.com id
	DA/7A-11546-12F86345; Thu, 09 Oct 2014 13:35:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1412861727!13002049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5347 invoked from network); 9 Oct 2014 13:35:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsM-00029n-Td
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsM-0007Gy-Sa
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:26 +0000
Date: Thu, 09 Oct 2014 13:35:26 +0000
Message-Id: <E1XcDsM-0007Gy-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add a poll-based select
	mechanism
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1322076727ef8b21a3a0eb9726d89ff56dfcb837
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:54 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add a poll-based select mechanism
    
    Currently, oxenstored uses Unix.select underneath, so it doesn't work properly
    if given a FD number >= 1024. This is a scalability bottleneck for hosts
    running large number of VMs.
    
    To remove this limitation, we implemented a poll-based mechanism but with the
    same type signature as the Unix.select currently in use. So these two functions
    can be interchangeable at any stage.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/Makefile       |    9 +++-
 tools/ocaml/xenstored/select.ml      |   54 +++++++++++++++++++++++++++
 tools/ocaml/xenstored/select.mli     |   20 ++++++++++
 tools/ocaml/xenstored/select_stubs.c |   68 ++++++++++++++++++++++++++++++++++
 tools/ocaml/xenstored/xenstored.ml   |    2 +-
 5 files changed, 149 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index ec19709..48f1079 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -17,10 +17,12 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
 	-I $(OCAML_TOPLEVEL)/libs/eventchn
 
-LIBS = syslog.cma syslog.cmxa
+LIBS = syslog.cma syslog.cmxa select.cma select.cmxa
 syslog_OBJS = syslog
 syslog_C_OBJS = syslog_stubs
-OCAML_LIBRARY = syslog
+select_OBJS = select
+select_C_OBJS = select_stubs
+OCAML_LIBRARY = syslog select
 
 LIBS += systemd.cma systemd.cmxa
 systemd_OBJS = systemd
@@ -48,12 +50,13 @@ OBJS = define \
 	process \
 	xenstored
 
-INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi
+INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi select.cmi
 
 XENSTOREDLIBS = \
 	unix.cmxa \
 	-ccopt -L -ccopt . syslog.cmxa \
 	-ccopt -L -ccopt . systemd.cmxa \
+	-ccopt -L -ccopt . select.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
diff --git a/tools/ocaml/xenstored/select.ml b/tools/ocaml/xenstored/select.ml
new file mode 100644
index 0000000..3f4b671
--- /dev/null
+++ b/tools/ocaml/xenstored/select.ml
@@ -0,0 +1,54 @@
+(*
+ * Copyright (C) 2014 Zheng Li <dev@zheng.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+
+(* The [read], [write], [except] are fields mapped to the POLLIN/OUT/PRI
+   subscription flags used by poll, which have a correspondence to the
+   readfds, writefds, exceptfds concept as in select. *)
+type event = {
+	mutable read: bool;
+	mutable write: bool;
+	mutable except: bool;
+}
+
+external select_on_poll: (Unix.file_descr * event) array -> int -> int = "stub_select_on_poll"
+
+let init_event () = {read = false; write = false; except = false}
+
+let select in_fds out_fds exc_fds timeout =
+	let h = Hashtbl.create 57 in
+	let add_event event_set fd =
+		let e =
+			try Hashtbl.find h fd
+			with Not_found ->
+				let e = init_event () in
+				Hashtbl.add h fd e; e in
+		event_set e in
+	List.iter (add_event (fun x -> x.read <- true)) in_fds;
+	List.iter (add_event (fun x -> x.write <- true)) out_fds;
+	List.iter (add_event (fun x -> x.except <- true)) exc_fds;
+	(* Unix.stdin and init_event are dummy input as stubs, which will
+           always be overwritten later on.  *)
+	let a = Array.make (Hashtbl.length h) (Unix.stdin, init_event ()) in
+	let i = ref (-1) in
+	Hashtbl.iter (fun fd event -> incr i; Array.set a !i (fd, event)) h;
+	let n = select_on_poll a (int_of_float (timeout *. 1000.)) in
+	let r = [], [], [] in
+	if n = 0 then r else
+		Array.fold_right
+			(fun (fd, event) (r, w, x) ->
+			 (if event.read then fd :: r else r),
+			 (if event.write then fd :: w else w),
+			 (if event.except then fd :: x else x))
+			a r
diff --git a/tools/ocaml/xenstored/select.mli b/tools/ocaml/xenstored/select.mli
new file mode 100644
index 0000000..1253d4e
--- /dev/null
+++ b/tools/ocaml/xenstored/select.mli
@@ -0,0 +1,20 @@
+(*
+ * Copyright (C) 2014 Zheng Li <dev@zheng.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+
+(** Same interface and semantics as [Unix.select] but with an extra alternative
+    implementation based on poll. *)
+val select:
+	Unix.file_descr list -> Unix.file_descr list -> Unix.file_descr list -> float
+	-> Unix.file_descr list * Unix.file_descr list * Unix.file_descr list
diff --git a/tools/ocaml/xenstored/select_stubs.c b/tools/ocaml/xenstored/select_stubs.c
new file mode 100644
index 0000000..33beeb9
--- /dev/null
+++ b/tools/ocaml/xenstored/select_stubs.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2014 Zheng Li <dev@zheng.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include <poll.h>
+#include <errno.h>
+#include <sys/resource.h>
+#include <unistd.h>
+#include <caml/mlvalues.h>
+#include <caml/memory.h>
+#include <caml/fail.h>
+#include <caml/alloc.h>
+#include <caml/signals.h>
+#include <caml/unixsupport.h>
+
+CAMLprim value stub_select_on_poll(value fd_events, value timeo) {
+
+	CAMLparam2(fd_events, timeo);
+	CAMLlocal1(events);
+	int i, rc, c_len = Wosize_val(fd_events), c_timeo = Int_val(timeo);
+	struct pollfd c_fds[c_len];
+
+
+	for (i = 0; i < c_len; i++) {
+
+		events = Field(Field(fd_events, i), 1);
+
+		c_fds[i].fd = Int_val(Field(Field(fd_events, i), 0));
+		c_fds[i].events = c_fds[i].revents = 0;
+		c_fds[i].events |= Bool_val(Field(events, 0)) ? POLLIN : 0;
+		c_fds[i].events |= Bool_val(Field(events, 1)) ? POLLOUT: 0;
+		c_fds[i].events |= Bool_val(Field(events, 2)) ? POLLPRI: 0;
+
+	};
+
+	caml_enter_blocking_section();
+	rc = poll(c_fds, c_len, c_timeo);
+	caml_leave_blocking_section();
+
+	if (rc < 0) uerror("poll", Nothing);
+
+	if (rc > 0) {
+
+		for (i = 0; i < c_len; i++) {
+
+			events = Field(Field(fd_events, i), 1);
+
+			if (c_fds[i].revents & POLLNVAL) unix_error(EBADF, "select", Nothing);
+			Field(events, 0) = Val_bool(c_fds[i].events | POLLIN  && c_fds[i].revents & (POLLIN |POLLHUP|POLLERR));
+			Field(events, 1) = Val_bool(c_fds[i].events | POLLOUT && c_fds[i].revents & (POLLOUT|POLLHUP|POLLERR));
+			Field(events, 2) = Val_bool(c_fds[i].revents & POLLPRI);
+
+		}
+
+	}
+
+	CAMLreturn(Val_int(rc));
+}
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1c02f2f..bfa488f 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -368,7 +368,7 @@ let _ =
 		let timeout = if List.length mw > 0 then 0. else -1. in
 		let rset, wset, _ =
 		try
-			Unix.select (spec_fds @ inset) outset [] timeout
+			Select.select (spec_fds @ inset) outset [] timeout
 		with Unix.Unix_error(Unix.EINTR, _, _) ->
 			[], [], [] in
 		let sfds, cfds =
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsc-00072z-8F; Thu, 09 Oct 2014 13:35:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsa-00072a-OF
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:40 +0000
Received: from [85.158.137.68:61826] by server-2.bemta-3.messagelabs.com id
	12/A0-09149-C2F86345; Thu, 09 Oct 2014 13:35:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412861737!8770176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22993 invoked from network); 9 Oct 2014 13:35:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsX-00029z-3A
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsX-0007HX-1q
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:37 +0000
Date: Thu, 09 Oct 2014 13:35:37 +0000
Message-Id: <E1XcDsX-0007HX-1q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add facilities to raise
	the max open fds uplimit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b6afbcf41ddf5f44125eb6c2c3a27231b6af3e79
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add facilities to raise the max open fds uplimit
    
    To go beyond 1024 fds, we also need to raise the process limitation on max
    open fds (usually defaults to 1024).
    
    We need to know the system level max open fds so that we won't go above that.
    Simply setting the limit to RLIM_INFINITY doesn't work on Linux 3.x (EPERM), a
    patch on this went into the 2.x branch but not 3.x for some reason.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/select.ml      |   10 ++++++++++
 tools/ocaml/xenstored/select_stubs.c |   12 ++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/xenstored/select.ml b/tools/ocaml/xenstored/select.ml
index 3f4b671..ab8c847 100644
--- a/tools/ocaml/xenstored/select.ml
+++ b/tools/ocaml/xenstored/select.ml
@@ -23,6 +23,16 @@ type event = {
 }
 
 external select_on_poll: (Unix.file_descr * event) array -> int -> int = "stub_select_on_poll"
+external set_fd_limit: int -> unit = "stub_set_fd_limit"
+
+(* The rlim_max given to setrlimit must not go above the system level nr_open,
+   which we can read from /proc/sys. *)
+let get_sys_fs_nr_open () =
+	try
+		let ch = open_in "/proc/sys/fs/nr_open" in
+		let v = int_of_string (input_line ch) in
+		close_in_noerr ch; v
+	with _ -> 1024 * 1024
 
 let init_event () = {read = false; write = false; except = false}
 
diff --git a/tools/ocaml/xenstored/select_stubs.c b/tools/ocaml/xenstored/select_stubs.c
index 33beeb9..4a8edb5 100644
--- a/tools/ocaml/xenstored/select_stubs.c
+++ b/tools/ocaml/xenstored/select_stubs.c
@@ -66,3 +66,15 @@ CAMLprim value stub_select_on_poll(value fd_events, value timeo) {
 
 	CAMLreturn(Val_int(rc));
 }
+
+
+CAMLprim value stub_set_fd_limit(value limit) {
+
+	CAMLparam1(limit);
+	struct rlimit rl;
+
+	rl.rlim_cur = rl.rlim_max = Int_val(limit);
+	if (setrlimit(RLIMIT_NOFILE, &rl) != 0) uerror("setrlimit", Nothing);
+	CAMLreturn(Val_unit);
+
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsc-00072z-8F; Thu, 09 Oct 2014 13:35:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsa-00072a-OF
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:40 +0000
Received: from [85.158.137.68:61826] by server-2.bemta-3.messagelabs.com id
	12/A0-09149-C2F86345; Thu, 09 Oct 2014 13:35:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1412861737!8770176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22993 invoked from network); 9 Oct 2014 13:35:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsX-00029z-3A
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsX-0007HX-1q
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:37 +0000
Date: Thu, 09 Oct 2014 13:35:37 +0000
Message-Id: <E1XcDsX-0007HX-1q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add facilities to raise
	the max open fds uplimit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b6afbcf41ddf5f44125eb6c2c3a27231b6af3e79
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add facilities to raise the max open fds uplimit
    
    To go beyond 1024 fds, we also need to raise the process limitation on max
    open fds (usually defaults to 1024).
    
    We need to know the system level max open fds so that we won't go above that.
    Simply setting the limit to RLIM_INFINITY doesn't work on Linux 3.x (EPERM), a
    patch on this went into the 2.x branch but not 3.x for some reason.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/select.ml      |   10 ++++++++++
 tools/ocaml/xenstored/select_stubs.c |   12 ++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/xenstored/select.ml b/tools/ocaml/xenstored/select.ml
index 3f4b671..ab8c847 100644
--- a/tools/ocaml/xenstored/select.ml
+++ b/tools/ocaml/xenstored/select.ml
@@ -23,6 +23,16 @@ type event = {
 }
 
 external select_on_poll: (Unix.file_descr * event) array -> int -> int = "stub_select_on_poll"
+external set_fd_limit: int -> unit = "stub_set_fd_limit"
+
+(* The rlim_max given to setrlimit must not go above the system level nr_open,
+   which we can read from /proc/sys. *)
+let get_sys_fs_nr_open () =
+	try
+		let ch = open_in "/proc/sys/fs/nr_open" in
+		let v = int_of_string (input_line ch) in
+		close_in_noerr ch; v
+	with _ -> 1024 * 1024
 
 let init_event () = {read = false; write = false; except = false}
 
diff --git a/tools/ocaml/xenstored/select_stubs.c b/tools/ocaml/xenstored/select_stubs.c
index 33beeb9..4a8edb5 100644
--- a/tools/ocaml/xenstored/select_stubs.c
+++ b/tools/ocaml/xenstored/select_stubs.c
@@ -66,3 +66,15 @@ CAMLprim value stub_select_on_poll(value fd_events, value timeo) {
 
 	CAMLreturn(Val_int(rc));
 }
+
+
+CAMLprim value stub_set_fd_limit(value limit) {
+
+	CAMLparam1(limit);
+	struct rlimit rl;
+
+	rl.rlim_cur = rl.rlim_max = Int_val(limit);
+	if (setrlimit(RLIMIT_NOFILE, &rl) != 0) uerror("setrlimit", Nothing);
+	CAMLreturn(Val_unit);
+
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsl-00074p-Ak; Thu, 09 Oct 2014 13:35:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsj-00074P-Vh
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:50 +0000
Received: from [85.158.137.68:35816] by server-14.bemta-3.messagelabs.com id
	BE/74-01575-53F86345; Thu, 09 Oct 2014 13:35:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1412861747!10039808!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15746 invoked from network); 9 Oct 2014 13:35:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsh-0002A5-8M
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsh-0007IF-73
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:47 +0000
Date: Thu, 09 Oct 2014 13:35:47 +0000
Message-Id: <E1XcDsh-0007IF-73@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add a --use-select command
	line flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6a0fa7ce2e0c06edfd8c7e4d5d6ac0bdd7b2a43b
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add a --use-select command line flag
    
    This allows to fall back to the original Unix.select if preferred. It could be
    useful for debugging purposes too.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/parse_arg.ml |    8 ++++++--
 tools/ocaml/xenstored/select.ml    |   15 ++++++++++++++-
 tools/ocaml/xenstored/select.mli   |    9 ++++++++-
 tools/ocaml/xenstored/xenstored.ml |    2 ++
 4 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/parse_arg.ml b/tools/ocaml/xenstored/parse_arg.ml
index 5d21601..6e22c16 100644
--- a/tools/ocaml/xenstored/parse_arg.ml
+++ b/tools/ocaml/xenstored/parse_arg.ml
@@ -25,6 +25,7 @@ type config =
 	tracefile: string option; (* old xenstored compatibility *)
 	restart: bool;
 	disable_socket: bool;
+	use_select: bool;
 }
 
 let do_argv =
@@ -35,7 +36,8 @@ let do_argv =
 	and reraise_top_level = ref false
 	and config_file = ref ""
 	and restart = ref false
-	and disable_socket = ref false in
+	and disable_socket = ref false
+	and use_select = ref false in
 
 	let speclist =
 		[ ("--no-domain-init", Arg.Unit (fun () -> domain_init := false),
@@ -52,8 +54,9 @@ let do_argv =
 		  ("-T", Arg.Set_string tracefile, ""); (* for compatibility *)
 		  ("--restart", Arg.Set restart, "Read database on starting");
 		  ("--disable-socket", Arg.Unit (fun () -> disable_socket := true), "Disable socket");
+		  ("--use-select", Arg.Unit (fun () -> use_select := true), "Use select instead of poll"); (* for backward compatibility and testing *)
 		] in
-	let usage_msg = "usage : xenstored [--config-file <filename>] [--no-domain-init] [--help] [--no-fork] [--reraise-top-level] [--restart] [--disable-socket]" in
+	let usage_msg = "usage : xenstored [--config-file <filename>] [--no-domain-init] [--help] [--no-fork] [--reraise-top-level] [--restart] [--disable-socket] [--use-select]" in
 	Arg.parse speclist (fun s -> ()) usage_msg;
 	{
 		domain_init = !domain_init;
@@ -65,4 +68,5 @@ let do_argv =
 		tracefile = if !tracefile <> "" then Some !tracefile else None;
 		restart = !restart;
 		disable_socket = !disable_socket;
+		use_select = !use_select;
 	}
diff --git a/tools/ocaml/xenstored/select.ml b/tools/ocaml/xenstored/select.ml
index ab8c847..0455e16 100644
--- a/tools/ocaml/xenstored/select.ml
+++ b/tools/ocaml/xenstored/select.ml
@@ -36,7 +36,7 @@ let get_sys_fs_nr_open () =
 
 let init_event () = {read = false; write = false; except = false}
 
-let select in_fds out_fds exc_fds timeout =
+let poll_select in_fds out_fds exc_fds timeout =
 	let h = Hashtbl.create 57 in
 	let add_event event_set fd =
 		let e =
@@ -62,3 +62,16 @@ let select in_fds out_fds exc_fds timeout =
 			 (if event.write then fd :: w else w),
 			 (if event.except then fd :: x else x))
 			a r
+
+(* If the use_poll function is not called at all, we default to the original Unix.select behavior *)
+let select_fun = ref Unix.select
+
+let use_poll yes =
+	let sel_fun, max_fd =
+		if yes then poll_select, get_sys_fs_nr_open ()
+		else Unix.select, 1024 in
+	select_fun := sel_fun;
+	set_fd_limit max_fd
+
+let select in_fds out_fds exc_fds timeout =
+	(!select_fun) in_fds out_fds exc_fds timeout
diff --git a/tools/ocaml/xenstored/select.mli b/tools/ocaml/xenstored/select.mli
index 1253d4e..3912779 100644
--- a/tools/ocaml/xenstored/select.mli
+++ b/tools/ocaml/xenstored/select.mli
@@ -14,7 +14,14 @@
 
 
 (** Same interface and semantics as [Unix.select] but with an extra alternative
-    implementation based on poll. *)
+    implementation based on poll. Switching implementations is done by calling
+     the [use_poll] function. *)
 val select:
 	Unix.file_descr list -> Unix.file_descr list -> Unix.file_descr list -> float
 	-> Unix.file_descr list * Unix.file_descr list * Unix.file_descr list
+
+(** [use_poll true] will use poll based select with max fds number limitation
+   eliminated; [use_poll false] will use standard [Unix.select] with max fd
+   number set to 1024; not calling this function at all equals to use the
+   standard [Unix.select] with max fd number setting untouched. *)
+val use_poll: bool -> unit
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index bfa488f..dacea21 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -274,6 +274,8 @@ let _ =
 		);
 	);
 
+	Select.use_poll (not cf.use_select);
+
 	Sys.set_signal Sys.sighup (Sys.Signal_handle sighup_handler);
 	Sys.set_signal Sys.sigterm (Sys.Signal_handle (fun i -> quit := true));
 	Sys.set_signal Sys.sigusr1 (Sys.Signal_handle (fun i -> sigusr1_handler store));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:35:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:35:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsl-00074p-Ak; Thu, 09 Oct 2014 13:35:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsj-00074P-Vh
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:50 +0000
Received: from [85.158.137.68:35816] by server-14.bemta-3.messagelabs.com id
	BE/74-01575-53F86345; Thu, 09 Oct 2014 13:35:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1412861747!10039808!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15746 invoked from network); 9 Oct 2014 13:35:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsh-0002A5-8M
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsh-0007IF-73
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:47 +0000
Date: Thu, 09 Oct 2014 13:35:47 +0000
Message-Id: <E1XcDsh-0007IF-73@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add a --use-select command
	line flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6a0fa7ce2e0c06edfd8c7e4d5d6ac0bdd7b2a43b
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add a --use-select command line flag
    
    This allows to fall back to the original Unix.select if preferred. It could be
    useful for debugging purposes too.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/parse_arg.ml |    8 ++++++--
 tools/ocaml/xenstored/select.ml    |   15 ++++++++++++++-
 tools/ocaml/xenstored/select.mli   |    9 ++++++++-
 tools/ocaml/xenstored/xenstored.ml |    2 ++
 4 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/parse_arg.ml b/tools/ocaml/xenstored/parse_arg.ml
index 5d21601..6e22c16 100644
--- a/tools/ocaml/xenstored/parse_arg.ml
+++ b/tools/ocaml/xenstored/parse_arg.ml
@@ -25,6 +25,7 @@ type config =
 	tracefile: string option; (* old xenstored compatibility *)
 	restart: bool;
 	disable_socket: bool;
+	use_select: bool;
 }
 
 let do_argv =
@@ -35,7 +36,8 @@ let do_argv =
 	and reraise_top_level = ref false
 	and config_file = ref ""
 	and restart = ref false
-	and disable_socket = ref false in
+	and disable_socket = ref false
+	and use_select = ref false in
 
 	let speclist =
 		[ ("--no-domain-init", Arg.Unit (fun () -> domain_init := false),
@@ -52,8 +54,9 @@ let do_argv =
 		  ("-T", Arg.Set_string tracefile, ""); (* for compatibility *)
 		  ("--restart", Arg.Set restart, "Read database on starting");
 		  ("--disable-socket", Arg.Unit (fun () -> disable_socket := true), "Disable socket");
+		  ("--use-select", Arg.Unit (fun () -> use_select := true), "Use select instead of poll"); (* for backward compatibility and testing *)
 		] in
-	let usage_msg = "usage : xenstored [--config-file <filename>] [--no-domain-init] [--help] [--no-fork] [--reraise-top-level] [--restart] [--disable-socket]" in
+	let usage_msg = "usage : xenstored [--config-file <filename>] [--no-domain-init] [--help] [--no-fork] [--reraise-top-level] [--restart] [--disable-socket] [--use-select]" in
 	Arg.parse speclist (fun s -> ()) usage_msg;
 	{
 		domain_init = !domain_init;
@@ -65,4 +68,5 @@ let do_argv =
 		tracefile = if !tracefile <> "" then Some !tracefile else None;
 		restart = !restart;
 		disable_socket = !disable_socket;
+		use_select = !use_select;
 	}
diff --git a/tools/ocaml/xenstored/select.ml b/tools/ocaml/xenstored/select.ml
index ab8c847..0455e16 100644
--- a/tools/ocaml/xenstored/select.ml
+++ b/tools/ocaml/xenstored/select.ml
@@ -36,7 +36,7 @@ let get_sys_fs_nr_open () =
 
 let init_event () = {read = false; write = false; except = false}
 
-let select in_fds out_fds exc_fds timeout =
+let poll_select in_fds out_fds exc_fds timeout =
 	let h = Hashtbl.create 57 in
 	let add_event event_set fd =
 		let e =
@@ -62,3 +62,16 @@ let select in_fds out_fds exc_fds timeout =
 			 (if event.write then fd :: w else w),
 			 (if event.except then fd :: x else x))
 			a r
+
+(* If the use_poll function is not called at all, we default to the original Unix.select behavior *)
+let select_fun = ref Unix.select
+
+let use_poll yes =
+	let sel_fun, max_fd =
+		if yes then poll_select, get_sys_fs_nr_open ()
+		else Unix.select, 1024 in
+	select_fun := sel_fun;
+	set_fd_limit max_fd
+
+let select in_fds out_fds exc_fds timeout =
+	(!select_fun) in_fds out_fds exc_fds timeout
diff --git a/tools/ocaml/xenstored/select.mli b/tools/ocaml/xenstored/select.mli
index 1253d4e..3912779 100644
--- a/tools/ocaml/xenstored/select.mli
+++ b/tools/ocaml/xenstored/select.mli
@@ -14,7 +14,14 @@
 
 
 (** Same interface and semantics as [Unix.select] but with an extra alternative
-    implementation based on poll. *)
+    implementation based on poll. Switching implementations is done by calling
+     the [use_poll] function. *)
 val select:
 	Unix.file_descr list -> Unix.file_descr list -> Unix.file_descr list -> float
 	-> Unix.file_descr list * Unix.file_descr list * Unix.file_descr list
+
+(** [use_poll true] will use poll based select with max fds number limitation
+   eliminated; [use_poll false] will use standard [Unix.select] with max fd
+   number set to 1024; not calling this function at all equals to use the
+   standard [Unix.select] with max fd number setting untouched. *)
+val use_poll: bool -> unit
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index bfa488f..dacea21 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -274,6 +274,8 @@ let _ =
 		);
 	);
 
+	Select.use_poll (not cf.use_select);
+
 	Sys.set_signal Sys.sighup (Sys.Signal_handle sighup_handler);
 	Sys.set_signal Sys.sigterm (Sys.Signal_handle (fun i -> quit := true));
 	Sys.set_signal Sys.sigusr1 (Sys.Signal_handle (fun i -> sigusr1_handler store));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsv-00076K-FB; Thu, 09 Oct 2014 13:36:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsu-000761-5Y
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:00 +0000
Received: from [85.158.143.35:5464] by server-2.bemta-4.messagelabs.com id
	1A/F4-04525-F3F86345; Thu, 09 Oct 2014 13:35:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1412861757!11872560!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5814 invoked from network); 9 Oct 2014 13:35:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsr-0002AE-Gt
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsr-0007J6-Dj
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:57 +0000
Date: Thu, 09 Oct 2014 13:35:57 +0000
Message-Id: <E1XcDsr-0007J6-Dj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: catch the error when a
	connection is already deleted
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57ba43cdf804998fc7dd70025d870effb4b4686c
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:57 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: catch the error when a connection is already deleted
    
    The function process_fdset_with is called on the read set connections first.
    During the process, it might destroy a connection and remove it from the
    connections database if some errors occur. However, a reference to the same
    connection might still exist in the write set, which is awaiting to be
    processed next. In this case, a Not_found error will be raised and the process
    is aborted.
    
    This patch changes the logic to ignore connections just missing from the
    connection database and continue the rest part of the work.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/xenstored.ml |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index dacea21..ea1a08f 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -43,8 +43,11 @@ let process_connection_fds store cons domains rset wset =
 			debug "closing socket connection"
 		in
 	let process_fdset_with fds fct =
-		List.iter (fun fd -> try_fct fct (Connections.find cons fd)) fds
-	in
+		List.iter
+			(fun fd ->
+			 try try_fct fct (Connections.find cons fd)
+			 with Not_found -> ()
+			) fds in
 	process_fdset_with rset Process.do_input;
 	process_fdset_with wset Process.do_output
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDsv-00076K-FB; Thu, 09 Oct 2014 13:36:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsu-000761-5Y
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:00 +0000
Received: from [85.158.143.35:5464] by server-2.bemta-4.messagelabs.com id
	1A/F4-04525-F3F86345; Thu, 09 Oct 2014 13:35:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1412861757!11872560!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5814 invoked from network); 9 Oct 2014 13:35:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:35:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsr-0002AE-Gt
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDsr-0007J6-Dj
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:35:57 +0000
Date: Thu, 09 Oct 2014 13:35:57 +0000
Message-Id: <E1XcDsr-0007J6-Dj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: catch the error when a
	connection is already deleted
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57ba43cdf804998fc7dd70025d870effb4b4686c
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:57 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: catch the error when a connection is already deleted
    
    The function process_fdset_with is called on the read set connections first.
    During the process, it might destroy a connection and remove it from the
    connections database if some errors occur. However, a reference to the same
    connection might still exist in the write set, which is awaiting to be
    processed next. In this case, a Not_found error will be raised and the process
    is aborted.
    
    This patch changes the logic to ignore connections just missing from the
    connection database and continue the rest part of the work.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/xenstored.ml |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index dacea21..ea1a08f 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -43,8 +43,11 @@ let process_connection_fds store cons domains rset wset =
 			debug "closing socket connection"
 		in
 	let process_fdset_with fds fct =
-		List.iter (fun fd -> try_fct fct (Connections.find cons fd)) fds
-	in
+		List.iter
+			(fun fd ->
+			 try try_fct fct (Connections.find cons fd)
+			 with Not_found -> ()
+			) fds in
 	process_fdset_with rset Process.do_input;
 	process_fdset_with wset Process.do_output
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDt6-00078F-Hr; Thu, 09 Oct 2014 13:36:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDt5-00077x-BI
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:11 +0000
Received: from [85.158.139.211:20996] by server-3.bemta-5.messagelabs.com id
	54/71-00307-A4F86345; Thu, 09 Oct 2014 13:36:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1412861767!12971593!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20058 invoked from network); 9 Oct 2014 13:36:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDt1-0002An-Nl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDt1-0007KP-LE
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:07 +0000
Date: Thu, 09 Oct 2014 13:36:07 +0000
Message-Id: <E1XcDt1-0007KP-LE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: use hash table to store
	socket connections
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a3967c5e42f7c50ea4ece2350020ef7b5ece49ba
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: use hash table to store socket connections
    
    Currently we use list to store socket connections. This is fine for smaller
    number of connections. But when we scale up, traveling through a list of
    hundreds or thousands of connections just to find a single one of them is very
    low efficient.
    
    This patch replaces the list with a (Unix.file_descr -> Connection.t) hash table.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/connections.ml |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index f4550f9..3e6a48b 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -18,17 +18,17 @@
 let debug fmt = Logging.debug "connections" fmt
 
 type t = {
-	mutable anonymous: Connection.t list;
+	anonymous: (Unix.file_descr, Connection.t) Hashtbl.t;
 	domains: (int, Connection.t) Hashtbl.t;
 	mutable watches: (string, Connection.watch list) Trie.t;
 }
 
-let create () = { anonymous = []; domains = Hashtbl.create 8; watches = Trie.create () }
+let create () = { anonymous = Hashtbl.create 37; domains = Hashtbl.create 37; watches = Trie.create () }
 
 let add_anonymous cons fd can_write =
 	let xbcon = Xenbus.Xb.open_fd fd in
 	let con = Connection.create xbcon None in
-	cons.anonymous <- con :: cons.anonymous
+	Hashtbl.add cons.anonymous (Xenbus.Xb.get_fd xbcon) con
 
 let add_domain cons dom =
 	let xbcon = Xenbus.Xb.open_mmap (Domain.get_interface dom) (fun () -> Domain.notify dom) in
@@ -36,14 +36,14 @@ let add_domain cons dom =
 	Hashtbl.add cons.domains (Domain.get_id dom) con
 
 let select cons =
-	let inset = List.map (fun c -> Connection.get_fd c) cons.anonymous
-	and outset = List.fold_left (fun l c -> if Connection.has_output c
-						then Connection.get_fd c :: l
-						else l) [] cons.anonymous in
-	inset, outset
+	Hashtbl.fold
+		(fun _ con (ins, outs) ->
+		 let fd = Connection.get_fd con in
+		 (fd :: ins,  if Connection.has_output con then fd :: outs else outs))
+		cons.anonymous ([], [])
 
-let find cons fd =
-	List.find (fun c -> Connection.get_fd c = fd) cons.anonymous
+let find cons =
+	Hashtbl.find cons.anonymous
 
 let find_domain cons id =
 	Hashtbl.find cons.domains id
@@ -55,7 +55,7 @@ let del_watches_of_con con watches =
 
 let del_anonymous cons con =
 	try
-		cons.anonymous <- Utils.list_remove con cons.anonymous;
+		Hashtbl.remove cons.anonymous (Connection.get_fd con);
 		cons.watches <- Trie.map (del_watches_of_con con) cons.watches;
 		Connection.close con
 	with exn ->
@@ -74,7 +74,7 @@ let iter_domains cons fct =
 	Hashtbl.iter (fun k c -> fct c) cons.domains
 
 let iter_anonymous cons fct =
-	List.iter (fun c -> fct c) (List.rev cons.anonymous)
+	Hashtbl.iter (fun _ c -> fct c) cons.anonymous
 
 let iter cons fct =
 	iter_domains cons fct; iter_anonymous cons fct
@@ -163,10 +163,10 @@ let stats cons =
 		nb_ops_dom := !nb_ops_dom + con_ops;
 		nb_watchs_dom := !nb_watchs_dom + con_watchs;
 	);
-	(List.length cons.anonymous, !nb_ops_anon, !nb_watchs_anon,
+	(Hashtbl.length cons.anonymous, !nb_ops_anon, !nb_watchs_anon,
 	 Hashtbl.length cons.domains, !nb_ops_dom, !nb_watchs_dom)
 
 let debug cons =
-	let anonymous = List.map Connection.debug cons.anonymous in
+	let anonymous = Hashtbl.fold (fun _ con accu -> Connection.debug con :: accu) cons.anonymous [] in
 	let domains = Hashtbl.fold (fun _ con accu -> Connection.debug con :: accu) cons.domains [] in
 	String.concat "" (domains @ anonymous)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDt6-00078F-Hr; Thu, 09 Oct 2014 13:36:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDt5-00077x-BI
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:11 +0000
Received: from [85.158.139.211:20996] by server-3.bemta-5.messagelabs.com id
	54/71-00307-A4F86345; Thu, 09 Oct 2014 13:36:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1412861767!12971593!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20058 invoked from network); 9 Oct 2014 13:36:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDt1-0002An-Nl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDt1-0007KP-LE
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:07 +0000
Date: Thu, 09 Oct 2014 13:36:07 +0000
Message-Id: <E1XcDt1-0007KP-LE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: use hash table to store
	socket connections
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a3967c5e42f7c50ea4ece2350020ef7b5ece49ba
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: use hash table to store socket connections
    
    Currently we use list to store socket connections. This is fine for smaller
    number of connections. But when we scale up, traveling through a list of
    hundreds or thousands of connections just to find a single one of them is very
    low efficient.
    
    This patch replaces the list with a (Unix.file_descr -> Connection.t) hash table.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/connections.ml |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index f4550f9..3e6a48b 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -18,17 +18,17 @@
 let debug fmt = Logging.debug "connections" fmt
 
 type t = {
-	mutable anonymous: Connection.t list;
+	anonymous: (Unix.file_descr, Connection.t) Hashtbl.t;
 	domains: (int, Connection.t) Hashtbl.t;
 	mutable watches: (string, Connection.watch list) Trie.t;
 }
 
-let create () = { anonymous = []; domains = Hashtbl.create 8; watches = Trie.create () }
+let create () = { anonymous = Hashtbl.create 37; domains = Hashtbl.create 37; watches = Trie.create () }
 
 let add_anonymous cons fd can_write =
 	let xbcon = Xenbus.Xb.open_fd fd in
 	let con = Connection.create xbcon None in
-	cons.anonymous <- con :: cons.anonymous
+	Hashtbl.add cons.anonymous (Xenbus.Xb.get_fd xbcon) con
 
 let add_domain cons dom =
 	let xbcon = Xenbus.Xb.open_mmap (Domain.get_interface dom) (fun () -> Domain.notify dom) in
@@ -36,14 +36,14 @@ let add_domain cons dom =
 	Hashtbl.add cons.domains (Domain.get_id dom) con
 
 let select cons =
-	let inset = List.map (fun c -> Connection.get_fd c) cons.anonymous
-	and outset = List.fold_left (fun l c -> if Connection.has_output c
-						then Connection.get_fd c :: l
-						else l) [] cons.anonymous in
-	inset, outset
+	Hashtbl.fold
+		(fun _ con (ins, outs) ->
+		 let fd = Connection.get_fd con in
+		 (fd :: ins,  if Connection.has_output con then fd :: outs else outs))
+		cons.anonymous ([], [])
 
-let find cons fd =
-	List.find (fun c -> Connection.get_fd c = fd) cons.anonymous
+let find cons =
+	Hashtbl.find cons.anonymous
 
 let find_domain cons id =
 	Hashtbl.find cons.domains id
@@ -55,7 +55,7 @@ let del_watches_of_con con watches =
 
 let del_anonymous cons con =
 	try
-		cons.anonymous <- Utils.list_remove con cons.anonymous;
+		Hashtbl.remove cons.anonymous (Connection.get_fd con);
 		cons.watches <- Trie.map (del_watches_of_con con) cons.watches;
 		Connection.close con
 	with exn ->
@@ -74,7 +74,7 @@ let iter_domains cons fct =
 	Hashtbl.iter (fun k c -> fct c) cons.domains
 
 let iter_anonymous cons fct =
-	List.iter (fun c -> fct c) (List.rev cons.anonymous)
+	Hashtbl.iter (fun _ c -> fct c) cons.anonymous
 
 let iter cons fct =
 	iter_domains cons fct; iter_anonymous cons fct
@@ -163,10 +163,10 @@ let stats cons =
 		nb_ops_dom := !nb_ops_dom + con_ops;
 		nb_watchs_dom := !nb_watchs_dom + con_watchs;
 	);
-	(List.length cons.anonymous, !nb_ops_anon, !nb_watchs_anon,
+	(Hashtbl.length cons.anonymous, !nb_ops_anon, !nb_watchs_anon,
 	 Hashtbl.length cons.domains, !nb_ops_dom, !nb_watchs_dom)
 
 let debug cons =
-	let anonymous = List.map Connection.debug cons.anonymous in
+	let anonymous = Hashtbl.fold (fun _ con accu -> Connection.debug con :: accu) cons.anonymous [] in
 	let domains = Hashtbl.fold (fun _ con accu -> Connection.debug con :: accu) cons.domains [] in
 	String.concat "" (domains @ anonymous)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtF-0007AB-Ka; Thu, 09 Oct 2014 13:36:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtE-00079O-JR
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:20 +0000
Received: from [85.158.143.35:29627] by server-3.bemta-4.messagelabs.com id
	CD/0C-06192-35F86345; Thu, 09 Oct 2014 13:36:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1412861778!11820698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23274 invoked from network); 9 Oct 2014 13:36:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtB-0002At-UW
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtB-0007Kz-Ry
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:17 +0000
Date: Thu, 09 Oct 2014 13:36:17 +0000
Message-Id: <E1XcDtB-0007Kz-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: enable domain connection
	indexing based on eventchn port
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec609f3254dd88f1a208758dd42245ee3f9bc34e
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: enable domain connection indexing based on eventchn port
    
    Currently in xenstore connection database,  we use a hash table of
    (domid -> connection) to store domain connections. This allows fast indexing
    based on dom ids.
    
    This patch adds another dimention of fast indexing that is based on eventchn
    port number. This is useful when doing selective connection processing
    based on the port numbers of incoming events.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/connections.ml |   26 ++++++++++++++++++++++----
 tools/ocaml/xenstored/domain.ml      |    1 +
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 3e6a48b..1c8d911 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -20,10 +20,16 @@ let debug fmt = Logging.debug "connections" fmt
 type t = {
 	anonymous: (Unix.file_descr, Connection.t) Hashtbl.t;
 	domains: (int, Connection.t) Hashtbl.t;
+	ports: (Xeneventchn.t, Connection.t) Hashtbl.t;
 	mutable watches: (string, Connection.watch list) Trie.t;
 }
 
-let create () = { anonymous = Hashtbl.create 37; domains = Hashtbl.create 37; watches = Trie.create () }
+let create () = {
+	anonymous = Hashtbl.create 37;
+	domains = Hashtbl.create 37;
+	ports = Hashtbl.create 37;
+	watches = Trie.create ()
+}
 
 let add_anonymous cons fd can_write =
 	let xbcon = Xenbus.Xb.open_fd fd in
@@ -33,7 +39,10 @@ let add_anonymous cons fd can_write =
 let add_domain cons dom =
 	let xbcon = Xenbus.Xb.open_mmap (Domain.get_interface dom) (fun () -> Domain.notify dom) in
 	let con = Connection.create xbcon (Some dom) in
-	Hashtbl.add cons.domains (Domain.get_id dom) con
+	Hashtbl.add cons.domains (Domain.get_id dom) con;
+	match Domain.get_port dom with
+	| Some p -> Hashtbl.add cons.ports p con;
+	| None -> ()
 
 let select cons =
 	Hashtbl.fold
@@ -45,8 +54,11 @@ let select cons =
 let find cons =
 	Hashtbl.find cons.anonymous
 
-let find_domain cons id =
-	Hashtbl.find cons.domains id
+let find_domain cons =
+	Hashtbl.find cons.domains
+
+let find_domain_by_port cons port =
+	Hashtbl.find cons.ports port
 
 let del_watches_of_con con watches =
 	match List.filter (fun w -> Connection.get_con w != con) watches with
@@ -65,6 +77,12 @@ let del_domain cons id =
 	try
 		let con = find_domain cons id in
 		Hashtbl.remove cons.domains id;
+		(match Connection.get_domain con with
+		 | Some d ->
+		   (match Domain.get_port d with
+		    | Some p -> Hashtbl.remove cons.ports p
+		    | None -> ())
+		 | None -> ());
 		cons.watches <- Trie.map (del_watches_of_con con) cons.watches;
 		Connection.close con
 	with exn ->
diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain.ml
index 444069d..06d5749 100644
--- a/tools/ocaml/xenstored/domain.ml
+++ b/tools/ocaml/xenstored/domain.ml
@@ -35,6 +35,7 @@ let get_id domain = domain.id
 let get_interface d = d.interface
 let get_mfn d = d.mfn
 let get_remote_port d = d.remote_port
+let get_port d = d.port
 
 let is_bad_domain domain = domain.bad_client
 let mark_as_bad domain = domain.bad_client <- true
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtF-0007AB-Ka; Thu, 09 Oct 2014 13:36:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtE-00079O-JR
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:20 +0000
Received: from [85.158.143.35:29627] by server-3.bemta-4.messagelabs.com id
	CD/0C-06192-35F86345; Thu, 09 Oct 2014 13:36:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1412861778!11820698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23274 invoked from network); 9 Oct 2014 13:36:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtB-0002At-UW
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtB-0007Kz-Ry
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:17 +0000
Date: Thu, 09 Oct 2014 13:36:17 +0000
Message-Id: <E1XcDtB-0007Kz-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: enable domain connection
	indexing based on eventchn port
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec609f3254dd88f1a208758dd42245ee3f9bc34e
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:34:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: enable domain connection indexing based on eventchn port
    
    Currently in xenstore connection database,  we use a hash table of
    (domid -> connection) to store domain connections. This allows fast indexing
    based on dom ids.
    
    This patch adds another dimention of fast indexing that is based on eventchn
    port number. This is useful when doing selective connection processing
    based on the port numbers of incoming events.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/connections.ml |   26 ++++++++++++++++++++++----
 tools/ocaml/xenstored/domain.ml      |    1 +
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 3e6a48b..1c8d911 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -20,10 +20,16 @@ let debug fmt = Logging.debug "connections" fmt
 type t = {
 	anonymous: (Unix.file_descr, Connection.t) Hashtbl.t;
 	domains: (int, Connection.t) Hashtbl.t;
+	ports: (Xeneventchn.t, Connection.t) Hashtbl.t;
 	mutable watches: (string, Connection.watch list) Trie.t;
 }
 
-let create () = { anonymous = Hashtbl.create 37; domains = Hashtbl.create 37; watches = Trie.create () }
+let create () = {
+	anonymous = Hashtbl.create 37;
+	domains = Hashtbl.create 37;
+	ports = Hashtbl.create 37;
+	watches = Trie.create ()
+}
 
 let add_anonymous cons fd can_write =
 	let xbcon = Xenbus.Xb.open_fd fd in
@@ -33,7 +39,10 @@ let add_anonymous cons fd can_write =
 let add_domain cons dom =
 	let xbcon = Xenbus.Xb.open_mmap (Domain.get_interface dom) (fun () -> Domain.notify dom) in
 	let con = Connection.create xbcon (Some dom) in
-	Hashtbl.add cons.domains (Domain.get_id dom) con
+	Hashtbl.add cons.domains (Domain.get_id dom) con;
+	match Domain.get_port dom with
+	| Some p -> Hashtbl.add cons.ports p con;
+	| None -> ()
 
 let select cons =
 	Hashtbl.fold
@@ -45,8 +54,11 @@ let select cons =
 let find cons =
 	Hashtbl.find cons.anonymous
 
-let find_domain cons id =
-	Hashtbl.find cons.domains id
+let find_domain cons =
+	Hashtbl.find cons.domains
+
+let find_domain_by_port cons port =
+	Hashtbl.find cons.ports port
 
 let del_watches_of_con con watches =
 	match List.filter (fun w -> Connection.get_con w != con) watches with
@@ -65,6 +77,12 @@ let del_domain cons id =
 	try
 		let con = find_domain cons id in
 		Hashtbl.remove cons.domains id;
+		(match Connection.get_domain con with
+		 | Some d ->
+		   (match Domain.get_port d with
+		    | Some p -> Hashtbl.remove cons.ports p
+		    | None -> ())
+		 | None -> ());
 		cons.watches <- Trie.map (del_watches_of_con con) cons.watches;
 		Connection.close con
 	with exn ->
diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain.ml
index 444069d..06d5749 100644
--- a/tools/ocaml/xenstored/domain.ml
+++ b/tools/ocaml/xenstored/domain.ml
@@ -35,6 +35,7 @@ let get_id domain = domain.id
 let get_interface d = d.interface
 let get_mfn d = d.mfn
 let get_remote_port d = d.remote_port
+let get_port d = d.port
 
 let is_bad_domain domain = domain.bad_client
 let mark_as_bad domain = domain.bad_client <- true
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtQ-0007C9-NK; Thu, 09 Oct 2014 13:36:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtP-0007Bw-11
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:31 +0000
Received: from [193.109.254.147:11992] by server-6.bemta-14.messagelabs.com id
	E5/D8-01867-E5F86345; Thu, 09 Oct 2014 13:36:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1412861788!11733818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31654 invoked from network); 9 Oct 2014 13:36:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtM-0002B1-4z
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtM-0007Lc-2Z
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:28 +0000
Date: Thu, 09 Oct 2014 13:36:28 +0000
Message-Id: <E1XcDtM-0007Lc-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: only process domain
	connections that notify us by events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 923611a13d835c097839f14a18326ff353e9adf8
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:35:00 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: only process domain connections that notify us by events
    
    Currently, upon receiving an event, oxenstored will always scan/process all
    the domain connections (xs rings), disregarding which domain sent that event.
    This is rather costy and inefficient. It also shadows and indulges client
    for not correctly communicating with us on message/space availability.
    
    With this patch, oxenstore will only scan/process the domain connections
    that have correctly notified us by events or have IO actions leftover from
    previous communication.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/connection.ml  |    4 ++++
 tools/ocaml/xenstored/connections.ml |    9 ++++-----
 tools/ocaml/xenstored/xenstored.ml   |   13 ++++++++++---
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 47695f8..807fc00 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -223,10 +223,14 @@ let pop_in con = Xenbus.Xb.get_in_packet con.xb
 let has_more_input con = Xenbus.Xb.has_more_input con.xb
 
 let has_output con = Xenbus.Xb.has_output con.xb
+let has_old_output con = Xenbus.Xb.has_old_output con.xb
 let has_new_output con = Xenbus.Xb.has_new_output con.xb
 let peek_output con = Xenbus.Xb.peek_output con.xb
 let do_output con = Xenbus.Xb.output con.xb
 
+let has_more_work con =
+	has_more_input con || not (has_old_output con) && has_new_output con
+
 let incr_ops con = con.stat_nb_ops <- con.stat_nb_ops + 1
 
 let mark_symbols con =
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 1c8d911..f9bc225 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -98,11 +98,10 @@ let iter cons fct =
 	iter_domains cons fct; iter_anonymous cons fct
 
 let has_more_work cons =
-	Hashtbl.fold (fun id con acc ->
-		if Connection.has_more_input con then
-			con :: acc
-		else
-			acc) cons.domains []
+	Hashtbl.fold
+		(fun id con acc ->
+		 if Connection.has_more_work con then con :: acc else acc)
+		cons.domains []
 
 let key_of_str path =
 	if path.[0] = '@'
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index ea1a08f..b13393c 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -57,7 +57,10 @@ let process_domains store cons domains =
 			let con = Connections.find_domain cons (Domain.get_id domain) in
 				Process.do_input store cons domains con;
 				Process.do_output store cons domains con in
-	Domains.iter domains do_io_domain
+	List.iter
+		(fun c ->
+		 match Connection.get_domain c with
+		 | Some d -> do_io_domain d | _ -> ())
 
 let sigusr1_handler store =
 	try
@@ -305,6 +308,7 @@ let _ =
 			Connections.add_anonymous cons cfd can_write
 		and handle_eventchn fd =
 			let port = Event.pending eventchn in
+			debug "pending port %d" (Xeneventchn.to_int port);
 			finally (fun () ->
 				if Some port = eventchn.Event.virq_port then (
 					let (notify, deaddom) = Domains.cleanup xc domains in
@@ -312,7 +316,10 @@ let _ =
 					if deaddom <> [] || notify then
 						Connections.fire_spec_watches cons "@releaseDomain"
 				)
-			) (fun () -> Event.unmask eventchn port);
+				else
+					let c = Connections.find_domain_by_port cons port in
+					process_domains store cons domains [c]
+				) (fun () -> Event.unmask eventchn port)
 		and do_if_set fd set fct =
 			if List.mem fd set then
 				fct fd in
@@ -382,7 +389,7 @@ let _ =
 			process_special_fds sfds;
 		if List.length cfds > 0 || List.length wset > 0 then
 			process_connection_fds store cons domains cfds wset;
-		process_domains store cons domains
+		process_domains store cons domains mw
 		in
 
 	while not !quit
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtQ-0007C9-NK; Thu, 09 Oct 2014 13:36:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtP-0007Bw-11
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:31 +0000
Received: from [193.109.254.147:11992] by server-6.bemta-14.messagelabs.com id
	E5/D8-01867-E5F86345; Thu, 09 Oct 2014 13:36:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1412861788!11733818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31654 invoked from network); 9 Oct 2014 13:36:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtM-0002B1-4z
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtM-0007Lc-2Z
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:28 +0000
Date: Thu, 09 Oct 2014 13:36:28 +0000
Message-Id: <E1XcDtM-0007Lc-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: only process domain
	connections that notify us by events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 923611a13d835c097839f14a18326ff353e9adf8
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:35:00 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: only process domain connections that notify us by events
    
    Currently, upon receiving an event, oxenstored will always scan/process all
    the domain connections (xs rings), disregarding which domain sent that event.
    This is rather costy and inefficient. It also shadows and indulges client
    for not correctly communicating with us on message/space availability.
    
    With this patch, oxenstore will only scan/process the domain connections
    that have correctly notified us by events or have IO actions leftover from
    previous communication.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/connection.ml  |    4 ++++
 tools/ocaml/xenstored/connections.ml |    9 ++++-----
 tools/ocaml/xenstored/xenstored.ml   |   13 ++++++++++---
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 47695f8..807fc00 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -223,10 +223,14 @@ let pop_in con = Xenbus.Xb.get_in_packet con.xb
 let has_more_input con = Xenbus.Xb.has_more_input con.xb
 
 let has_output con = Xenbus.Xb.has_output con.xb
+let has_old_output con = Xenbus.Xb.has_old_output con.xb
 let has_new_output con = Xenbus.Xb.has_new_output con.xb
 let peek_output con = Xenbus.Xb.peek_output con.xb
 let do_output con = Xenbus.Xb.output con.xb
 
+let has_more_work con =
+	has_more_input con || not (has_old_output con) && has_new_output con
+
 let incr_ops con = con.stat_nb_ops <- con.stat_nb_ops + 1
 
 let mark_symbols con =
diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index 1c8d911..f9bc225 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -98,11 +98,10 @@ let iter cons fct =
 	iter_domains cons fct; iter_anonymous cons fct
 
 let has_more_work cons =
-	Hashtbl.fold (fun id con acc ->
-		if Connection.has_more_input con then
-			con :: acc
-		else
-			acc) cons.domains []
+	Hashtbl.fold
+		(fun id con acc ->
+		 if Connection.has_more_work con then con :: acc else acc)
+		cons.domains []
 
 let key_of_str path =
 	if path.[0] = '@'
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index ea1a08f..b13393c 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -57,7 +57,10 @@ let process_domains store cons domains =
 			let con = Connections.find_domain cons (Domain.get_id domain) in
 				Process.do_input store cons domains con;
 				Process.do_output store cons domains con in
-	Domains.iter domains do_io_domain
+	List.iter
+		(fun c ->
+		 match Connection.get_domain c with
+		 | Some d -> do_io_domain d | _ -> ())
 
 let sigusr1_handler store =
 	try
@@ -305,6 +308,7 @@ let _ =
 			Connections.add_anonymous cons cfd can_write
 		and handle_eventchn fd =
 			let port = Event.pending eventchn in
+			debug "pending port %d" (Xeneventchn.to_int port);
 			finally (fun () ->
 				if Some port = eventchn.Event.virq_port then (
 					let (notify, deaddom) = Domains.cleanup xc domains in
@@ -312,7 +316,10 @@ let _ =
 					if deaddom <> [] || notify then
 						Connections.fire_spec_watches cons "@releaseDomain"
 				)
-			) (fun () -> Event.unmask eventchn port);
+				else
+					let c = Connections.find_domain_by_port cons port in
+					process_domains store cons domains [c]
+				) (fun () -> Event.unmask eventchn port)
 		and do_if_set fd set fct =
 			if List.mem fd set then
 				fct fd in
@@ -382,7 +389,7 @@ let _ =
 			process_special_fds sfds;
 		if List.length cfds > 0 || List.length wset > 0 then
 			process_connection_fds store cons domains cfds wset;
-		process_domains store cons domains
+		process_domains store cons domains mw
 		in
 
 	while not !quit
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtc-0007EV-SI; Thu, 09 Oct 2014 13:36:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDta-0007EA-RS
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:43 +0000
Received: from [193.109.254.147:25266] by server-8.bemta-14.messagelabs.com id
	5C/D1-01875-96F86345; Thu, 09 Oct 2014 13:36:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1412861798!11757611!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5416 invoked from network); 9 Oct 2014 13:36:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtW-0002B7-CE
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtW-0007ME-9w
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:38 +0000
Date: Thu, 09 Oct 2014 13:36:38 +0000
Message-Id: <E1XcDtW-0007ME-9w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add a safe net mechanism
	for existing ill-behaved clients
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0074c64aefc7e2b552503bbbd0d1b5dd08b11144
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:35:01 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add a safe net mechanism for existing ill-behaved clients
    
    In previous commit, we moved from exhaustively scanning all domain connections
    to only processing those have correctly notified us by events. The benefits are
    not only efficiency but also correctness, because it could potentially block an
    ill-behaved client and have it waiting on its own mistake. If someone makes a
    mistake on this when developing a piece of code, he/she would immediately
    notice the problem (as the process being blocked), so that he/she could fix it
    rightaway before anything else. Note that the chances of making such mistakes
    are rare in reality, because most client code would use the libxenstore library
    (which has all the notification logic built in correctly) instead of having to
    implement raw accessing from scratch.
    
    On the other hand, we did notice that there were some legacy code that didn't do
    the notification correctly. As some code might be still running in wild, it
    would be bad if they break by this change (e.g. after an upgrade). This patch
    introduces a safe net mechanism to ensure ill-behaved clients continue to work,
    but still retain most of the performance benefits here.
    
      * We add a checker to still scan all the rings periodically, so that we can
        still pick up these messages at an acceptable frequency.
    
      * Internally, we introduce an io_credit concept for domain connections. It
        represents the rounds of ring scan we are going to perform on a domain
        connection. For well-behaved connections, this value is changing between 0
        and 1; but for connections detected as ill-behaved, we'll bump its credit
        to a high value so that we'll unconditionally scan its ring for the next
        $n$ rounds. This way, the client won't hiccupped by the interval between
        checker's running (especially during periods when it continously interacts
        with oxenstored); and oxenstored doesn't have to keep scanning these
        rings indefinitely (with the credit running out), as they are usually quite
        most of the time.
    
      * We log an message when a domain connection is suspected as ill-behaved.
        Enable [info] level logging if you want/need to see it in action. Note that
        this information won't be accurate, as false positives are possible due to
        time window (e.g. we detect a client has written to the ring and we get no
        notificiation from it for the time being, but still the notification could
        potentially arrive at some time later). It's no harm to give a domain
        connection extra credit though.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/domain.ml       |   11 ++++-
 tools/ocaml/xenstored/oxenstored.conf |    3 +
 tools/ocaml/xenstored/xenstored.ml    |   76 ++++++++++++++++++++++++---------
 3 files changed, 69 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain.ml
index 06d5749..ab34314 100644
--- a/tools/ocaml/xenstored/domain.ml
+++ b/tools/ocaml/xenstored/domain.ml
@@ -28,6 +28,9 @@ type t =
 	eventchn: Event.t;
 	mutable port: Xeneventchn.t option;
 	mutable bad_client: bool;
+	mutable io_credit: int; (* the rounds of ring process left to do, default is 0,
+	                           usually set to 1 when there is work detected, could
+	                           also set to n to give "lazy" clients extra credit *)
 }
 
 let get_path dom = "/local/domain/" ^ (sprintf "%u" dom.id)
@@ -40,6 +43,11 @@ let get_port d = d.port
 let is_bad_domain domain = domain.bad_client
 let mark_as_bad domain = domain.bad_client <- true
 
+let get_io_credit domain = domain.io_credit
+let set_io_credit ?(n=1) domain = domain.io_credit <- max 0 n
+let incr_io_credit domain = domain.io_credit <- domain.io_credit + 1
+let decr_io_credit domain = domain.io_credit <- max 0 (domain.io_credit - 1)
+
 let string_of_port = function
 | None -> "None"
 | Some x -> string_of_int (Xeneventchn.to_int x)
@@ -74,7 +82,8 @@ let make id mfn remote_port interface eventchn = {
 	interface = interface;
 	eventchn = eventchn;
 	port = None;
-	bad_client = false
+	bad_client = false;
+	io_credit = 0;
 }
 
 let is_dom0 d = d.id = 0
diff --git a/tools/ocaml/xenstored/oxenstored.conf b/tools/ocaml/xenstored/oxenstored.conf
index 13ee770..dd20eda 100644
--- a/tools/ocaml/xenstored/oxenstored.conf
+++ b/tools/ocaml/xenstored/oxenstored.conf
@@ -33,3 +33,6 @@ persistent = false
 # acesss-log-nb-chars = 180
 # access-log-special-ops = false
 
+# Perodically scanning all the rings as a safenet for lazy clients.
+# Define the interval in seconds, set to negative to disable.
+# ring-scan-interval = 20
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index b13393c..bfe689b 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -54,13 +54,14 @@ let process_connection_fds store cons domains rset wset =
 let process_domains store cons domains =
 	let do_io_domain domain =
 		if not (Domain.is_bad_domain domain) then
-			let con = Connections.find_domain cons (Domain.get_id domain) in
+			let io_credit = Domain.get_io_credit domain in
+			if io_credit > 0 then (
+				let con = Connections.find_domain cons (Domain.get_id domain) in
 				Process.do_input store cons domains con;
-				Process.do_output store cons domains con in
-	List.iter
-		(fun c ->
-		 match Connection.get_domain c with
-		 | Some d -> do_io_domain d | _ -> ())
+				Process.do_output store cons domains con;
+				Domain.decr_io_credit domain;
+			) in
+	Domains.iter domains do_io_domain
 
 let sigusr1_handler store =
 	try
@@ -82,6 +83,8 @@ let config_filename cf =
 
 let default_pidfile = "/var/run/xenstored.pid"
 
+let ring_scan_interval = ref 20
+
 let parse_config filename =
 	let pidfile = ref default_pidfile in
 	let options = [
@@ -108,6 +111,7 @@ let parse_config filename =
 		("access-log-transactions-ops", Config.Set_bool Logging.access_log_transaction_ops);
 		("access-log-special-ops", Config.Set_bool Logging.access_log_special_ops);
 		("allow-debug", Config.Set_bool Process.allow_debug);
+		("ring-scan-interval", Config.Set_int ring_scan_interval);
 		("pid-file", Config.Set_string pidfile); ] in
 	begin try Config.read filename options (fun _ _ -> raise Not_found)
 	with
@@ -318,7 +322,8 @@ let _ =
 				)
 				else
 					let c = Connections.find_domain_by_port cons port in
-					process_domains store cons domains [c]
+					match Connection.get_domain c with
+					| Some dom -> Domain.incr_io_credit dom | None -> ()
 				) (fun () -> Event.unmask eventchn port)
 		and do_if_set fd set fct =
 			if List.mem fd set then
@@ -327,11 +332,30 @@ let _ =
 		maybe (fun fd -> do_if_set fd rset (accept_connection true)) rw_sock;
 		maybe (fun fd -> do_if_set fd rset (accept_connection false)) ro_sock;
 		do_if_set (Event.fd eventchn) rset (handle_eventchn)
-		in
+	in
+
+	let ring_scan_checker dom =
+		(* no need to scan domains already marked as for processing *)
+		if not (Domain.get_io_credit dom > 0) then
+			let con = Connections.find_domain cons (Domain.get_id dom) in
+			if not (Connection.has_more_work con) then (
+				Process.do_output store cons domains con;
+				Process.do_input store cons domains con;
+				if Connection.has_more_work con then
+					(* Previously thought as no work, but detect some after scan (as
+					   processing a new message involves multiple steps.) It's very
+					   likely to be a "lazy" client, bump its credit. It could be false
+					   positive though (due to time window), but it's no harm to give a
+					   domain extra credit. *)
+					let n = 32 + 2 * (Domains.number domains) in
+					info "found lazy domain %d, credit %d" (Domain.get_id dom) n;
+					Domain.set_io_credit ~n dom
+			) in
 
 	let last_stat_time = ref 0. in
-	let periodic_ops_counter = ref 0 in
-	let periodic_ops () =
+	let last_scan_time = ref 0. in
+
+	let periodic_ops now =
 		(* we garbage collect the string->int dictionary after a sizeable amount of operations,
 		 * there's no need to be really fast even if we got loose
 		 * objects since names are often reuse.
@@ -344,10 +368,13 @@ let _ =
 			Symbol.garbage ()
 		end;
 
+		(* scan all the xs rings as a safenet for ill-behaved clients *)
+		if !ring_scan_interval >= 0 && now > (!last_scan_time +. float !ring_scan_interval) then
+			(last_scan_time := now; Domains.iter domains ring_scan_checker);
+
 		(* make sure we don't print general stats faster than 2 min *)
-		let ntime = Unix.gettimeofday () in
-		if ntime > (!last_stat_time +. 120.) then (
-			last_stat_time := ntime;
+		if now > (!last_stat_time +. 120.) then (
+			last_stat_time := now;
 
 			let gc = Gc.stat () in
 			let (lanon, lanon_ops, lanon_watchs,
@@ -368,16 +395,20 @@ let _ =
 		)
 		in
 
+		let period_ops_interval = 15. in
+		let period_start = ref 0. in
+
 	let main_loop () =
-		incr periodic_ops_counter;
-		if !periodic_ops_counter > 20 then (
-			periodic_ops_counter := 0;
-			periodic_ops ();
-		);
 
 		let mw = Connections.has_more_work cons in
+		List.iter
+			(fun c ->
+			 match Connection.get_domain c with
+			 | None -> () | Some d -> Domain.incr_io_credit d)
+			mw;
+		let timeout =
+			if List.length mw > 0 then 0. else period_ops_interval in
 		let inset, outset = Connections.select cons in
-		let timeout = if List.length mw > 0 then 0. else -1. in
 		let rset, wset, _ =
 		try
 			Select.select (spec_fds @ inset) outset [] timeout
@@ -389,7 +420,12 @@ let _ =
 			process_special_fds sfds;
 		if List.length cfds > 0 || List.length wset > 0 then
 			process_connection_fds store cons domains cfds wset;
-		process_domains store cons domains mw
+		if timeout <> 0. then (
+			let now = Unix.gettimeofday () in
+			if now > !period_start +. period_ops_interval then
+				(period_start := now; periodic_ops now)
+		);
+		process_domains store cons domains
 		in
 
 	while not !quit
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtc-0007EV-SI; Thu, 09 Oct 2014 13:36:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDta-0007EA-RS
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:43 +0000
Received: from [193.109.254.147:25266] by server-8.bemta-14.messagelabs.com id
	5C/D1-01875-96F86345; Thu, 09 Oct 2014 13:36:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1412861798!11757611!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5416 invoked from network); 9 Oct 2014 13:36:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtW-0002B7-CE
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtW-0007ME-9w
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:38 +0000
Date: Thu, 09 Oct 2014 13:36:38 +0000
Message-Id: <E1XcDtW-0007ME-9w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: add a safe net mechanism
	for existing ill-behaved clients
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0074c64aefc7e2b552503bbbd0d1b5dd08b11144
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:35:01 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:18:46 2014 +0100

    oxenstored: add a safe net mechanism for existing ill-behaved clients
    
    In previous commit, we moved from exhaustively scanning all domain connections
    to only processing those have correctly notified us by events. The benefits are
    not only efficiency but also correctness, because it could potentially block an
    ill-behaved client and have it waiting on its own mistake. If someone makes a
    mistake on this when developing a piece of code, he/she would immediately
    notice the problem (as the process being blocked), so that he/she could fix it
    rightaway before anything else. Note that the chances of making such mistakes
    are rare in reality, because most client code would use the libxenstore library
    (which has all the notification logic built in correctly) instead of having to
    implement raw accessing from scratch.
    
    On the other hand, we did notice that there were some legacy code that didn't do
    the notification correctly. As some code might be still running in wild, it
    would be bad if they break by this change (e.g. after an upgrade). This patch
    introduces a safe net mechanism to ensure ill-behaved clients continue to work,
    but still retain most of the performance benefits here.
    
      * We add a checker to still scan all the rings periodically, so that we can
        still pick up these messages at an acceptable frequency.
    
      * Internally, we introduce an io_credit concept for domain connections. It
        represents the rounds of ring scan we are going to perform on a domain
        connection. For well-behaved connections, this value is changing between 0
        and 1; but for connections detected as ill-behaved, we'll bump its credit
        to a high value so that we'll unconditionally scan its ring for the next
        $n$ rounds. This way, the client won't hiccupped by the interval between
        checker's running (especially during periods when it continously interacts
        with oxenstored); and oxenstored doesn't have to keep scanning these
        rings indefinitely (with the credit running out), as they are usually quite
        most of the time.
    
      * We log an message when a domain connection is suspected as ill-behaved.
        Enable [info] level logging if you want/need to see it in action. Note that
        this information won't be accurate, as false positives are possible due to
        time window (e.g. we detect a client has written to the ring and we get no
        notificiation from it for the time being, but still the notification could
        potentially arrive at some time later). It's no harm to give a domain
        connection extra credit though.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/domain.ml       |   11 ++++-
 tools/ocaml/xenstored/oxenstored.conf |    3 +
 tools/ocaml/xenstored/xenstored.ml    |   76 ++++++++++++++++++++++++---------
 3 files changed, 69 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain.ml
index 06d5749..ab34314 100644
--- a/tools/ocaml/xenstored/domain.ml
+++ b/tools/ocaml/xenstored/domain.ml
@@ -28,6 +28,9 @@ type t =
 	eventchn: Event.t;
 	mutable port: Xeneventchn.t option;
 	mutable bad_client: bool;
+	mutable io_credit: int; (* the rounds of ring process left to do, default is 0,
+	                           usually set to 1 when there is work detected, could
+	                           also set to n to give "lazy" clients extra credit *)
 }
 
 let get_path dom = "/local/domain/" ^ (sprintf "%u" dom.id)
@@ -40,6 +43,11 @@ let get_port d = d.port
 let is_bad_domain domain = domain.bad_client
 let mark_as_bad domain = domain.bad_client <- true
 
+let get_io_credit domain = domain.io_credit
+let set_io_credit ?(n=1) domain = domain.io_credit <- max 0 n
+let incr_io_credit domain = domain.io_credit <- domain.io_credit + 1
+let decr_io_credit domain = domain.io_credit <- max 0 (domain.io_credit - 1)
+
 let string_of_port = function
 | None -> "None"
 | Some x -> string_of_int (Xeneventchn.to_int x)
@@ -74,7 +82,8 @@ let make id mfn remote_port interface eventchn = {
 	interface = interface;
 	eventchn = eventchn;
 	port = None;
-	bad_client = false
+	bad_client = false;
+	io_credit = 0;
 }
 
 let is_dom0 d = d.id = 0
diff --git a/tools/ocaml/xenstored/oxenstored.conf b/tools/ocaml/xenstored/oxenstored.conf
index 13ee770..dd20eda 100644
--- a/tools/ocaml/xenstored/oxenstored.conf
+++ b/tools/ocaml/xenstored/oxenstored.conf
@@ -33,3 +33,6 @@ persistent = false
 # acesss-log-nb-chars = 180
 # access-log-special-ops = false
 
+# Perodically scanning all the rings as a safenet for lazy clients.
+# Define the interval in seconds, set to negative to disable.
+# ring-scan-interval = 20
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index b13393c..bfe689b 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -54,13 +54,14 @@ let process_connection_fds store cons domains rset wset =
 let process_domains store cons domains =
 	let do_io_domain domain =
 		if not (Domain.is_bad_domain domain) then
-			let con = Connections.find_domain cons (Domain.get_id domain) in
+			let io_credit = Domain.get_io_credit domain in
+			if io_credit > 0 then (
+				let con = Connections.find_domain cons (Domain.get_id domain) in
 				Process.do_input store cons domains con;
-				Process.do_output store cons domains con in
-	List.iter
-		(fun c ->
-		 match Connection.get_domain c with
-		 | Some d -> do_io_domain d | _ -> ())
+				Process.do_output store cons domains con;
+				Domain.decr_io_credit domain;
+			) in
+	Domains.iter domains do_io_domain
 
 let sigusr1_handler store =
 	try
@@ -82,6 +83,8 @@ let config_filename cf =
 
 let default_pidfile = "/var/run/xenstored.pid"
 
+let ring_scan_interval = ref 20
+
 let parse_config filename =
 	let pidfile = ref default_pidfile in
 	let options = [
@@ -108,6 +111,7 @@ let parse_config filename =
 		("access-log-transactions-ops", Config.Set_bool Logging.access_log_transaction_ops);
 		("access-log-special-ops", Config.Set_bool Logging.access_log_special_ops);
 		("allow-debug", Config.Set_bool Process.allow_debug);
+		("ring-scan-interval", Config.Set_int ring_scan_interval);
 		("pid-file", Config.Set_string pidfile); ] in
 	begin try Config.read filename options (fun _ _ -> raise Not_found)
 	with
@@ -318,7 +322,8 @@ let _ =
 				)
 				else
 					let c = Connections.find_domain_by_port cons port in
-					process_domains store cons domains [c]
+					match Connection.get_domain c with
+					| Some dom -> Domain.incr_io_credit dom | None -> ()
 				) (fun () -> Event.unmask eventchn port)
 		and do_if_set fd set fct =
 			if List.mem fd set then
@@ -327,11 +332,30 @@ let _ =
 		maybe (fun fd -> do_if_set fd rset (accept_connection true)) rw_sock;
 		maybe (fun fd -> do_if_set fd rset (accept_connection false)) ro_sock;
 		do_if_set (Event.fd eventchn) rset (handle_eventchn)
-		in
+	in
+
+	let ring_scan_checker dom =
+		(* no need to scan domains already marked as for processing *)
+		if not (Domain.get_io_credit dom > 0) then
+			let con = Connections.find_domain cons (Domain.get_id dom) in
+			if not (Connection.has_more_work con) then (
+				Process.do_output store cons domains con;
+				Process.do_input store cons domains con;
+				if Connection.has_more_work con then
+					(* Previously thought as no work, but detect some after scan (as
+					   processing a new message involves multiple steps.) It's very
+					   likely to be a "lazy" client, bump its credit. It could be false
+					   positive though (due to time window), but it's no harm to give a
+					   domain extra credit. *)
+					let n = 32 + 2 * (Domains.number domains) in
+					info "found lazy domain %d, credit %d" (Domain.get_id dom) n;
+					Domain.set_io_credit ~n dom
+			) in
 
 	let last_stat_time = ref 0. in
-	let periodic_ops_counter = ref 0 in
-	let periodic_ops () =
+	let last_scan_time = ref 0. in
+
+	let periodic_ops now =
 		(* we garbage collect the string->int dictionary after a sizeable amount of operations,
 		 * there's no need to be really fast even if we got loose
 		 * objects since names are often reuse.
@@ -344,10 +368,13 @@ let _ =
 			Symbol.garbage ()
 		end;
 
+		(* scan all the xs rings as a safenet for ill-behaved clients *)
+		if !ring_scan_interval >= 0 && now > (!last_scan_time +. float !ring_scan_interval) then
+			(last_scan_time := now; Domains.iter domains ring_scan_checker);
+
 		(* make sure we don't print general stats faster than 2 min *)
-		let ntime = Unix.gettimeofday () in
-		if ntime > (!last_stat_time +. 120.) then (
-			last_stat_time := ntime;
+		if now > (!last_stat_time +. 120.) then (
+			last_stat_time := now;
 
 			let gc = Gc.stat () in
 			let (lanon, lanon_ops, lanon_watchs,
@@ -368,16 +395,20 @@ let _ =
 		)
 		in
 
+		let period_ops_interval = 15. in
+		let period_start = ref 0. in
+
 	let main_loop () =
-		incr periodic_ops_counter;
-		if !periodic_ops_counter > 20 then (
-			periodic_ops_counter := 0;
-			periodic_ops ();
-		);
 
 		let mw = Connections.has_more_work cons in
+		List.iter
+			(fun c ->
+			 match Connection.get_domain c with
+			 | None -> () | Some d -> Domain.incr_io_credit d)
+			mw;
+		let timeout =
+			if List.length mw > 0 then 0. else period_ops_interval in
 		let inset, outset = Connections.select cons in
-		let timeout = if List.length mw > 0 then 0. else -1. in
 		let rset, wset, _ =
 		try
 			Select.select (spec_fds @ inset) outset [] timeout
@@ -389,7 +420,12 @@ let _ =
 			process_special_fds sfds;
 		if List.length cfds > 0 || List.length wset > 0 then
 			process_connection_fds store cons domains cfds wset;
-		process_domains store cons domains mw
+		if timeout <> 0. then (
+			let now = Unix.gettimeofday () in
+			if now > !period_start +. period_ops_interval then
+				(period_start := now; periodic_ops now)
+		);
+		process_domains store cons domains
 		in
 
 	while not !quit
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtk-0007Fz-V2; Thu, 09 Oct 2014 13:36:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtj-0007Fi-DT
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:51 +0000
Received: from [193.109.254.147:2289] by server-7.bemta-14.messagelabs.com id
	3B/33-13362-27F86345; Thu, 09 Oct 2014 13:36:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1412861808!7114632!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11156 invoked from network); 9 Oct 2014 13:36:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtg-0002BG-Hl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtg-0007Mm-GS
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:48 +0000
Date: Thu, 09 Oct 2014 13:36:48 +0000
Message-Id: <E1XcDtg-0007Mm-GS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: reduce syslog call overhead
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 025a232326ed6fae55a7853262b2f09473cf7983
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:35:02 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:28:56 2014 +0100

    oxenstored: reduce syslog call overhead
    
    We noticed that, if configured to use syslog as the logging backend, every
    single line of access logging (via the syslog C binding) will call stat on
    /etc/localtime for 3 times. The rational behind this is probably to detect any
    timezone changes over time.
    
    This is a considerable cost we'd like to avoid, given the intensiveness of our
    access logging --- we log almost every xenstore status change (for good
    reason). Also a running Xen host is rarely a mobile environment, so the little
    benefit can hardly justify the cost.
    
    Setting up the TZ environment varialbe can avoid stat calls.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/logging.ml |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tools/ocaml/xenstored/logging.ml b/tools/ocaml/xenstored/logging.ml
index 3d4a329..665b922 100644
--- a/tools/ocaml/xenstored/logging.ml
+++ b/tools/ocaml/xenstored/logging.ml
@@ -130,8 +130,17 @@ let string_of_date () =
 		tm.Unix.tm_hour tm.Unix.tm_min tm.Unix.tm_sec
 		(int_of_float (1000.0 *. msec))
 
+(* We can defer to syslog for log management *)
 let make_syslog_logger facility =
-	(* We defer to syslog for log management *)
+	(* When TZ is unset in the environment, each syslog call will stat the
+	   /etc/localtime file at least three times during the process. We'd like to
+	   avoid this cost given that we are not a mobile environment and we log
+	   almost every xenstore entry update/watch. *)
+	let () =
+		let tz_is_set =
+			try String.length (Unix.getenv "TZ") > 0
+			with Not_found -> false in
+		if not tz_is_set then Unix.putenv "TZ" "/etc/localtime" in
 	let nothing () = () in
 	let write ?level s =
 		let level = match level with
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:36:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:36:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtk-0007Fz-V2; Thu, 09 Oct 2014 13:36:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtj-0007Fi-DT
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:51 +0000
Received: from [193.109.254.147:2289] by server-7.bemta-14.messagelabs.com id
	3B/33-13362-27F86345; Thu, 09 Oct 2014 13:36:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1412861808!7114632!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11156 invoked from network); 9 Oct 2014 13:36:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:36:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtg-0002BG-Hl
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtg-0007Mm-GS
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:48 +0000
Date: Thu, 09 Oct 2014 13:36:48 +0000
Message-Id: <E1XcDtg-0007Mm-GS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: reduce syslog call overhead
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 025a232326ed6fae55a7853262b2f09473cf7983
Author:     Zheng Li <dev@zheng.li>
AuthorDate: Thu Sep 25 18:35:02 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:28:56 2014 +0100

    oxenstored: reduce syslog call overhead
    
    We noticed that, if configured to use syslog as the logging backend, every
    single line of access logging (via the syslog C binding) will call stat on
    /etc/localtime for 3 times. The rational behind this is probably to detect any
    timezone changes over time.
    
    This is a considerable cost we'd like to avoid, given the intensiveness of our
    access logging --- we log almost every xenstore status change (for good
    reason). Also a running Xen host is rarely a mobile environment, so the little
    benefit can hardly justify the cost.
    
    Setting up the TZ environment varialbe can avoid stat calls.
    
    Signed-off-by: Zheng Li <dev@zheng.li>
    Reviewed-by: David Scott <dave.scott@citrix.com>
---
 tools/ocaml/xenstored/logging.ml |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tools/ocaml/xenstored/logging.ml b/tools/ocaml/xenstored/logging.ml
index 3d4a329..665b922 100644
--- a/tools/ocaml/xenstored/logging.ml
+++ b/tools/ocaml/xenstored/logging.ml
@@ -130,8 +130,17 @@ let string_of_date () =
 		tm.Unix.tm_hour tm.Unix.tm_min tm.Unix.tm_sec
 		(int_of_float (1000.0 *. msec))
 
+(* We can defer to syslog for log management *)
 let make_syslog_logger facility =
-	(* We defer to syslog for log management *)
+	(* When TZ is unset in the environment, each syslog call will stat the
+	   /etc/localtime file at least three times during the process. We'd like to
+	   avoid this cost given that we are not a mobile environment and we log
+	   almost every xenstore entry update/watch. *)
+	let () =
+		let tz_is_set =
+			try String.length (Unix.getenv "TZ") > 0
+			with Not_found -> false in
+		if not tz_is_set then Unix.putenv "TZ" "/etc/localtime" in
 	let nothing () = () in
 	let write ?level s =
 		let level = match level with
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:37:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:37:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtx-0007Hk-1d; Thu, 09 Oct 2014 13:37:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtv-0007HS-O4
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:37:04 +0000
Received: from [85.158.137.68:5108] by server-11.bemta-3.messagelabs.com id
	61/42-01568-F7F86345; Thu, 09 Oct 2014 13:37:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1412861819!12502092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10319 invoked from network); 9 Oct 2014 13:37:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:37:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtq-0002BP-N1
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtq-0007NH-Lw
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:58 +0000
Date: Thu, 09 Oct 2014 13:36:58 +0000
Message-Id: <E1XcDtq-0007NH-Lw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: extend the xenstore ring
	with a 'closing' signal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 674ad2be409da77ebda3616085a2f67c72556c11
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Sep 25 15:58:41 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:29:08 2014 +0100

    xenstore: extend the xenstore ring with a 'closing' signal
    
    Hvmloader uses the xenstore ring and then tries to reset it back
    to its initial state before booting the guest. Occasionally xenstored
    will read the ring while it is being zeroed and conclude it has
    been corrupted. This prevents PV drivers from loading in the guest.
    
    This patch updates the xenstore ring protocol definition, enabling
    a server to advertise additional features to the guest. One such feature
    is defined: the ability to cleanly reset the ring including the
    higher-level protocol, like an enhanced RESET_WATCHES for rings.
    
    This patch implements the ring reconnection features in oxenstored
    and hvmloader, fixing the bug.
    
    This patch also defines an 'invalid' xenstore packet type and uses this
    to poison the ring over a reconnect. This will make diagnosing this
    bug much easier in future.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Reviewed-by: Jon Ludlam <jonathan.ludlam@citrix.com>
---
 docs/misc/xenstore-ring.txt         |  116 +++++++++++++++++++++++++++++++++++
 tools/firmware/hvmloader/xenbus.c   |   48 +++++++++------
 tools/ocaml/libs/xb/xb.ml           |   21 ++++++
 tools/ocaml/libs/xb/xb.mli          |    4 +-
 tools/ocaml/libs/xb/xs_ring.ml      |   28 ++++++++
 tools/ocaml/libs/xb/xs_ring_stubs.c |  109 ++++++++++++++++++++++++---------
 tools/ocaml/xenstored/connection.ml |   16 +++++-
 tools/ocaml/xenstored/process.ml    |   14 ++++-
 xen/include/public/io/xs_wire.h     |   13 ++++-
 9 files changed, 316 insertions(+), 53 deletions(-)

diff --git a/docs/misc/xenstore-ring.txt b/docs/misc/xenstore-ring.txt
new file mode 100644
index 0000000..16b4d0f
--- /dev/null
+++ b/docs/misc/xenstore-ring.txt
@@ -0,0 +1,116 @@
+The xenstore ring is a datastructure stored within a single 4KiB page
+shared between the xenstore server and the guest. The ring contains
+two queues of bytes -- one in each direction -- and some signalling
+information. The [xenstore protocol](xenstore.txt) is layered on top of
+the byte streams.
+
+The xenstore ring datastructure
+===============================
+
+The following table describes the ring structure where
+  - offsets and lengths are in bytes;
+  - "Input" is used to describe the data sent to the server; and
+  - "Output" is used to describe the data sent to the domain.
+
+Offset  Length  Description
+-----------------------------------------------------------------
+0       1024    Input data
+1024    1024    Output data
+2048    4       Input consumer offset
+2052    4       Input producer offset
+2056    4       Output consumer offset
+2060    4       Output producer offset
+2064    4       Server feature bitmap
+2068    4       Connection state
+
+The Input data and Output data are circular buffers. Each buffer is
+associated with a pair of free-running offsets labelled "consumer" and
+"producer".
+
+A "producer" offset is the offset in the byte stream of the next byte
+to be written modulo 2^32. A "consumer" offset is the offset in the byte
+stream of the next byte to be read modulo 2^32. Implementations must
+take care to handle wraparound properly when performing arithmetic with
+these values.
+
+The byte at offset 'x' in the byte stream will be stored at offset
+'x modulo 1024' in the circular buffer.
+
+Implementations may only overwrite previously-written data if it has
+been marked as 'consumed' by the relevant consumer pointer.
+
+When the guest domain is created, there is no outstanding Input or Output
+data. However
+
+  - guests must not assume that producer or consumer pointers start
+    at zero; and
+  - guests must not assume that unused bytes in either the Input or
+    Output data buffers has any particular value.
+
+A xenstore ring is always associated with an event channel. Whenever the
+ring structure is updated the event channel must be signalled. The
+guest and server are free to inspect the contents of the ring at any
+time, not only in response to an event channel event. This implies that
+updates must be ordered carefully to ensure consistency.
+
+The xenstore server may decide to advertise some features via the
+"Server feature bitmap". The server can start advertising features
+at any time by setting bits but it will never stop advertising features
+i.e. bits will never be cleared. The guest is not permitted to write to
+the server feature bitmap. The server features are offered to the guest;
+it is up to the guest whether to use them or not. The guest should ignore
+any unknown feature bits.
+
+The following features are defined:
+
+Mask    Description
+-----------------------------------------------------------------
+1       Ring reconnection (see the ring reconnection feature below)
+
+The "Connection state" field is used to request a ring close and reconnect.
+The "Connection state" field only contains valid data if the server has
+advertised the ring reconnection feature. If the feature has been advertised
+then the "Connection state" may take the following values:
+
+Value   Description
+-----------------------------------------------------------------
+0       Ring is connected
+1       Ring close and reconnect is in progress (see the "ring
+        reconnection feature" described below)
+
+The ring reconnection feature
+=============================
+
+The ring reconnection feature allows the guest to ask the server to
+reset the ring to a valid initial state i.e. one in which the Input
+and Output queues contain no data and there are no outstanding requests,
+watches or transactions.
+
+The ring reconnection feature is only available if the 'Ring reconnection'
+feature bit has been set by the server in the "Server feature bitmap".
+If a server supports ring reconnection, it will guarantee to advertise
+the feature before producing or consuming any data from the Input or Output
+queues.
+
+Assuming the server has advertised the feature, the guest can initiate
+a reconnection by setting the the Connection state to 1 ("Ring close
+and reconnect is in progress") and signalling the event channel.
+The guest must now ignore all fields except the Connection state and
+wait for it to be set to 0 ("Ring is connected")
+
+The server will guarantee to
+
+  - drop any partially read or written higher-level
+    [xenstore protocol](xenstore.txt) packets it may have;
+  - empty the Input and Output queues in the xenstore ring;
+  - discard any in-flight requests
+  - discard any watches associated with the connection
+  - discard any transactions associated with the connection
+  - set the Connection state to 0 ("Ring is connected"); and
+  - signal the event channel.
+
+From the point of view of the guest, the connection has been reset on a
+packet boundary.
+
+Note that only the guest may set the Connection state to 1 and only the
+server may set it back to 0.
diff --git a/tools/firmware/hvmloader/xenbus.c b/tools/firmware/hvmloader/xenbus.c
index 64c2176..f900a1e 100644
--- a/tools/firmware/hvmloader/xenbus.c
+++ b/tools/firmware/hvmloader/xenbus.c
@@ -37,6 +37,19 @@ static struct xenstore_domain_interface *rings; /* Shared ring with dom0 */
 static evtchn_port_t event;                     /* Event-channel to dom0 */
 static char payload[XENSTORE_PAYLOAD_MAX + 1];  /* Unmarshalling area */
 
+static void ring_wait(void)
+{
+    struct shared_info *shinfo = get_shared_info();
+    struct sched_poll poll;
+
+    memset(&poll, 0, sizeof(poll));
+    set_xen_guest_handle(poll.ports, &event);
+    poll.nr_ports = 1;
+
+    while ( !test_and_clear_bit(event, shinfo->evtchn_pending) )
+        hypercall_sched_op(SCHEDOP_poll, &poll);
+}
+
 /* Connect our xenbus client to the backend.
  * Call once, before any other xenbus actions. */
 void xenbus_setup(void)
@@ -61,14 +74,26 @@ void xenbus_setup(void)
 void xenbus_shutdown(void)
 {
     struct shared_info *shinfo = get_shared_info();
+    evtchn_send_t send;
 
     ASSERT(rings != NULL);
 
-    /* We zero out the whole ring -- the backend can handle this, and it's 
-     * not going to surprise any frontends since it's equivalent to never 
-     * having used the rings. */
-    memset(rings, 0, sizeof *rings);
-
+    if (rings->server_features & XENSTORE_SERVER_FEATURE_RECONNECTION) {
+        rings->connection = XENSTORE_RECONNECT;
+        send.port = event;
+        hypercall_event_channel_op(EVTCHNOP_send, &send);
+        while (*(volatile uint32_t*)&rings->connection == XENSTORE_RECONNECT)
+            ring_wait ();
+    } else {
+        /* If the backend reads the state while we're erasing it then the
+         * ring state will become corrupted, preventing guest frontends from
+         * connecting. This is rare. To help diagnose the failure, we fill
+         * the ring with XS_INVALID packets. */
+        memset(rings->req, 0xff, XENSTORE_RING_SIZE);
+        memset(rings->rsp, 0xff, XENSTORE_RING_SIZE);
+        rings->req_cons = rings->req_prod = 0;
+        rings->rsp_cons = rings->rsp_prod = 0;
+    }
     /* Clear the event-channel state too. */
     memset(shinfo->vcpu_info, 0, sizeof(shinfo->vcpu_info));
     memset(shinfo->evtchn_pending, 0, sizeof(shinfo->evtchn_pending));
@@ -77,19 +102,6 @@ void xenbus_shutdown(void)
     rings = NULL;
 }
 
-static void ring_wait(void)
-{
-    struct shared_info *shinfo = get_shared_info();
-    struct sched_poll poll;
-
-    memset(&poll, 0, sizeof(poll));
-    set_xen_guest_handle(poll.ports, &event);
-    poll.nr_ports = 1;
-
-    while ( !test_and_clear_bit(event, shinfo->evtchn_pending) )
-        hypercall_sched_op(SCHEDOP_poll, &poll);
-}
-
 /* Helper functions: copy data in and out of the ring */
 static void ring_write(const char *data, uint32_t len)
 {
diff --git a/tools/ocaml/libs/xb/xb.ml b/tools/ocaml/libs/xb/xb.ml
index 29d354d..50944b5 100644
--- a/tools/ocaml/libs/xb/xb.ml
+++ b/tools/ocaml/libs/xb/xb.ml
@@ -21,6 +21,10 @@ exception End_of_file
 exception Eagain
 exception Noent
 exception Invalid
+exception Reconnect
+
+let _ =
+  Callback.register_exception "Xb.Reconnect" Reconnect
 
 type backend_mmap =
 {
@@ -50,6 +54,19 @@ type t =
 let init_partial_in () = NoHdr
 	(Partial.header_size (), String.make (Partial.header_size()) '\000')
 
+let reconnect t = match t.backend with
+	| Fd _ ->
+		(* should never happen, so close the connection *)
+		raise End_of_file
+	| Xenmmap backend ->
+		Xs_ring.close backend.mmap;
+		backend.eventchn_notify ();
+		(* Clear our old connection state *)
+		Queue.clear t.pkt_in;
+		Queue.clear t.pkt_out;
+		t.partial_in <- init_partial_in ();
+		t.partial_out <- ""
+
 let queue con pkt = Queue.push pkt con.pkt_out
 
 let read_fd back con s len =
@@ -84,6 +101,7 @@ let write con s len =
 	| Fd backfd     -> write_fd backfd con s len
 	| Xenmmap backmmap -> write_mmap backmmap con s len
 
+(* NB: can throw Reconnect *)
 let output con =
 	(* get the output string from a string_of(packet) or partial_out *)
 	let s = if String.length con.partial_out > 0 then
@@ -102,6 +120,7 @@ let output con =
 	(* after sending one packet, partial is empty *)
 	con.partial_out = ""
 
+(* NB: can throw Reconnect *)
 let input con =
 	let newpacket = ref false in
 	let to_read =
@@ -145,6 +164,8 @@ let newcon backend = {
 let open_fd fd = newcon (Fd { fd = fd; })
 
 let open_mmap mmap notifyfct =
+	(* Advertise XENSTORE_SERVER_FEATURE_RECONNECTION *)
+	Xs_ring.set_server_features mmap (Xs_ring.Server_features.singleton Xs_ring.Server_feature.Reconnection);
 	newcon (Xenmmap {
 		mmap = mmap;
 		eventchn_notify = notifyfct;
diff --git a/tools/ocaml/libs/xb/xb.mli b/tools/ocaml/libs/xb/xb.mli
index 58234ae..4e1f833 100644
--- a/tools/ocaml/libs/xb/xb.mli
+++ b/tools/ocaml/libs/xb/xb.mli
@@ -23,7 +23,7 @@ module Op :
       | Resume
       | Set_target
       | Restrict
-      | Invalid (* Not a valid wire operation *)
+      | Invalid
     val operation_c_mapping : operation array
     val size : int
     val array_search : 'a -> 'a array -> int
@@ -57,6 +57,7 @@ exception End_of_file
 exception Eagain
 exception Noent
 exception Invalid
+exception Reconnect
 type backend_mmap = {
   mmap : Xenmmap.mmap_interface;
   eventchn_notify : unit -> unit;
@@ -73,6 +74,7 @@ type t = {
   mutable partial_out : string;
 }
 val init_partial_in : unit -> partial_buf
+val reconnect : t -> unit
 val queue : t -> Packet.t -> unit
 val read_fd : backend_fd -> 'a -> string -> int -> int
 val read_mmap : backend_mmap -> 'a -> string -> int -> int
diff --git a/tools/ocaml/libs/xb/xs_ring.ml b/tools/ocaml/libs/xb/xs_ring.ml
index 9469609..48e06f4 100644
--- a/tools/ocaml/libs/xb/xs_ring.ml
+++ b/tools/ocaml/libs/xb/xs_ring.ml
@@ -14,5 +14,33 @@
  * GNU Lesser General Public License for more details.
  *)
 
+module Server_feature = struct
+	type t =
+	| Reconnection
+end
+
+module Server_features = Set.Make(struct
+	type t = Server_feature.t
+	let compare = compare
+end)
+
 external read: Xenmmap.mmap_interface -> string -> int -> int = "ml_interface_read"
 external write: Xenmmap.mmap_interface -> string -> int -> int = "ml_interface_write"
+
+external _internal_set_server_features: Xenmmap.mmap_interface -> int -> unit = "ml_interface_set_server_features" "noalloc"
+external _internal_get_server_features: Xenmmap.mmap_interface -> int = "ml_interface_get_server_features" "noalloc"
+
+
+let get_server_features mmap =
+	(* NB only one feature currently defined above *)
+	let x = _internal_get_server_features mmap in
+	if x = 0
+	then Server_features.empty
+	else Server_features.singleton Server_feature.Reconnection
+
+let set_server_features mmap set =
+	(* NB only one feature currently defined above *)
+	let x = if set = Server_features.empty then 0 else 1 in
+	_internal_set_server_features mmap x
+
+external close: Xenmmap.mmap_interface -> unit = "ml_interface_close" "noalloc"
diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 17656c2..fc9b0c5 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -36,22 +36,39 @@
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
 
-static int xs_ring_read(struct mmap_interface *interface,
-                             char *buffer, int len)
+CAMLprim value ml_interface_read(value ml_interface,
+                                 value ml_buffer,
+                                 value ml_len)
 {
+	CAMLparam3(ml_interface, ml_buffer, ml_len);
+	CAMLlocal1(ml_result);
+
+	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
+	char *buffer = String_val(ml_buffer);
+	int len = Int_val(ml_len);
+	int result;
+
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
 	int to_read;
+	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
 	prod = *(volatile uint32_t*)&intf->req_prod;
+	connection = *(volatile uint32*)&intf->connection;
+
+	if (connection != XENSTORE_CONNECTED)
+		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
+
 	xen_mb();
 
 	if ((prod - cons) > XENSTORE_RING_SIZE)
-	    return -1;
+		caml_failwith("bad connection");
 
-	if (prod == cons)
-		return 0;
+	if (prod == cons) {
+		result = 0;
+		goto exit;
+	}
 	cons = MASK_XENSTORE_IDX(cons);
 	prod = MASK_XENSTORE_IDX(prod);
 	if (prod > cons)
@@ -63,21 +80,41 @@ static int xs_ring_read(struct mmap_interface *interface,
 	memcpy(buffer, intf->req + cons, len);
 	xen_mb();
 	intf->req_cons += len;
-	return len;
+	result = len;
+exit:
+	ml_result = Val_int(result);
+	CAMLreturn(ml_result);
 }
 
-static int xs_ring_write(struct mmap_interface *interface,
-                              char *buffer, int len)
+CAMLprim value ml_interface_write(value ml_interface,
+                                  value ml_buffer,
+                                  value ml_len)
 {
+	CAMLparam3(ml_interface, ml_buffer, ml_len);
+	CAMLlocal1(ml_result);
+
+	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
+	char *buffer = String_val(ml_buffer);
+	int len = Int_val(ml_len);
+	int result;
+
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
 	int can_write;
+	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
 	prod = *(volatile uint32_t*)&intf->rsp_prod;
+	connection = *(volatile uint32*)&intf->connection;
+
+	if (connection != XENSTORE_CONNECTED)
+		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
+
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE )
-		return 0;
+	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+		result = 0;
+		goto exit;
+	}
 	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
 		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
 	else 
@@ -87,31 +124,43 @@ static int xs_ring_write(struct mmap_interface *interface,
 	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
 	xen_mb();
 	intf->rsp_prod += len;
-	return len;
+	result = len;
+exit:
+	ml_result = Val_int(result);
+	CAMLreturn(ml_result);
 }
 
-CAMLprim value ml_interface_read(value interface, value buffer, value len)
+CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
-	CAMLparam3(interface, buffer, len);
-	CAMLlocal1(result);
-	int res;
+	CAMLparam2(interface, v);
+	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
 
-	res = xs_ring_read(GET_C_STRUCT(interface),
-	                   String_val(buffer), Int_val(len));
-	if (res == -1)
-		caml_failwith("bad connection");
-	result = Val_int(res);
-	CAMLreturn(result);
+	intf->server_features = Int_val(v);
+
+	CAMLreturn(Val_unit);
+}
+
+CAMLprim value ml_interface_get_server_features(value interface)
+{
+	CAMLparam1(interface);
+	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+
+	CAMLreturn(Val_int (intf->server_features));
 }
 
-CAMLprim value ml_interface_write(value interface, value buffer, value len)
+CAMLprim value ml_interface_close(value interface)
 {
-	CAMLparam3(interface, buffer, len);
-	CAMLlocal1(result);
-	int res;
-
-	res = xs_ring_write(GET_C_STRUCT(interface),
-	                    String_val(buffer), Int_val(len));
-	result = Val_int(res);
-	CAMLreturn(result);
+	CAMLparam1(interface);
+	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	int i;
+
+	intf->req_cons = intf->req_prod = intf->rsp_cons = intf->rsp_prod = 0;
+	/* Ensure the unused space is full of invalid xenstore packets. */
+	for (i = 0; i < XENSTORE_RING_SIZE; i++) {
+		intf->req[i] = 0xff; /* XS_INVALID = 0xffff */
+		intf->rsp[i] = 0xff;
+	}
+	xen_mb ();
+	intf->connection = XENSTORE_CONNECTED;
+	CAMLreturn(Val_unit);
 }
diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 807fc00..b4dc9cb 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -45,6 +45,20 @@ let mark_as_bad con =
 	|None -> ()
 	| Some domain -> Domain.mark_as_bad domain
 
+let initial_next_tid = 1
+
+let reconnect con =
+	Xenbus.Xb.reconnect con.xb;
+	(* dom is the same *)
+	Hashtbl.clear con.transactions;
+	con.next_tid <- initial_next_tid;
+	Hashtbl.clear con.watches;
+	(* anonid is the same *)
+	con.nb_watches <- 0;
+	con.stat_nb_ops <- 0;
+	(* perm is the same *)
+	()
+
 let get_path con =
 Printf.sprintf "/local/domain/%i/" (match con.dom with None -> 0 | Some d -> Domain.get_id d)
 
@@ -89,7 +103,7 @@ let create xbcon dom =
 	xb = xbcon;
 	dom = dom;
 	transactions = Hashtbl.create 5;
-	next_tid = 1;
+	next_tid = initial_next_tid;
 	watches = Hashtbl.create 8;
 	nb_watches = 0;
 	anonid = id;
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 89db56c..0620585 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -377,7 +377,12 @@ let do_input store cons doms con =
 	let newpacket =
 		try
 			Connection.do_input con
-		with Failure exp ->
+		with Xenbus.Xb.Reconnect ->
+			info "%s requests a reconnect" (Connection.get_domstr con);
+			Connection.reconnect con;
+			info "%s reconnection complete" (Connection.get_domstr con);
+			false
+		| Failure exp ->
 			error "caught exception %s" exp;
 			error "got a bad client %s" (sprintf "%-8s" (Connection.get_domstr con));
 			Connection.mark_as_bad con;
@@ -407,6 +412,11 @@ let do_output store cons doms con =
 			         (Xenbus.Xb.Op.to_string ty) (sanitize_data data);*)
 			write_answer_log ~ty ~tid ~con ~data;
 		);
-		ignore (Connection.do_output con)
+		try
+			ignore (Connection.do_output con)
+		with Xenbus.Xb.Reconnect ->
+			info "%s requests a reconnect" (Connection.get_domstr con);
+			Connection.reconnect con;
+			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 585f0c8..0a0cdbc 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -49,7 +49,9 @@ enum xsd_sockmsg_type
     XS_RESUME,
     XS_SET_TARGET,
     XS_RESTRICT,
-    XS_RESET_WATCHES
+    XS_RESET_WATCHES,
+
+    XS_INVALID = 0xffff /* Guaranteed to remain an invalid type */
 };
 
 #define XS_WRITE_NONE "NONE"
@@ -116,6 +118,8 @@ struct xenstore_domain_interface {
     char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
     XENSTORE_RING_IDX req_cons, req_prod;
     XENSTORE_RING_IDX rsp_cons, rsp_prod;
+    uint32_t server_features; /* Bitmap of features supported by the server */
+    uint32_t connection;
 };
 
 /* Violating this is very bad.  See docs/misc/xenstore.txt. */
@@ -125,6 +129,13 @@ struct xenstore_domain_interface {
 #define XENSTORE_ABS_PATH_MAX 3072
 #define XENSTORE_REL_PATH_MAX 2048
 
+/* The ability to reconnect a ring */
+#define XENSTORE_SERVER_FEATURE_RECONNECTION 1
+
+/* Valid values for the connection field */
+#define XENSTORE_CONNECTED 0 /* the steady-state */
+#define XENSTORE_RECONNECT 1 /* guest has initiated a reconnect */
+
 #endif /* _XS_WIRE_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 09 13:37:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2014 13:37:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcDtx-0007Hk-1d; Thu, 09 Oct 2014 13:37:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtv-0007HS-O4
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:37:04 +0000
Received: from [85.158.137.68:5108] by server-11.bemta-3.messagelabs.com id
	61/42-01568-F7F86345; Thu, 09 Oct 2014 13:37:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1412861819!12502092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10319 invoked from network); 9 Oct 2014 13:37:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Oct 2014 13:37:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtq-0002BP-N1
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcDtq-0007NH-Lw
	for xen-changelog@lists.xensource.com; Thu, 09 Oct 2014 13:36:58 +0000
Date: Thu, 09 Oct 2014 13:36:58 +0000
Message-Id: <E1XcDtq-0007NH-Lw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: extend the xenstore ring
	with a 'closing' signal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 674ad2be409da77ebda3616085a2f67c72556c11
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Sep 25 15:58:41 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 8 14:29:08 2014 +0100

    xenstore: extend the xenstore ring with a 'closing' signal
    
    Hvmloader uses the xenstore ring and then tries to reset it back
    to its initial state before booting the guest. Occasionally xenstored
    will read the ring while it is being zeroed and conclude it has
    been corrupted. This prevents PV drivers from loading in the guest.
    
    This patch updates the xenstore ring protocol definition, enabling
    a server to advertise additional features to the guest. One such feature
    is defined: the ability to cleanly reset the ring including the
    higher-level protocol, like an enhanced RESET_WATCHES for rings.
    
    This patch implements the ring reconnection features in oxenstored
    and hvmloader, fixing the bug.
    
    This patch also defines an 'invalid' xenstore packet type and uses this
    to poison the ring over a reconnect. This will make diagnosing this
    bug much easier in future.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Reviewed-by: Jon Ludlam <jonathan.ludlam@citrix.com>
---
 docs/misc/xenstore-ring.txt         |  116 +++++++++++++++++++++++++++++++++++
 tools/firmware/hvmloader/xenbus.c   |   48 +++++++++------
 tools/ocaml/libs/xb/xb.ml           |   21 ++++++
 tools/ocaml/libs/xb/xb.mli          |    4 +-
 tools/ocaml/libs/xb/xs_ring.ml      |   28 ++++++++
 tools/ocaml/libs/xb/xs_ring_stubs.c |  109 ++++++++++++++++++++++++---------
 tools/ocaml/xenstored/connection.ml |   16 +++++-
 tools/ocaml/xenstored/process.ml    |   14 ++++-
 xen/include/public/io/xs_wire.h     |   13 ++++-
 9 files changed, 316 insertions(+), 53 deletions(-)

diff --git a/docs/misc/xenstore-ring.txt b/docs/misc/xenstore-ring.txt
new file mode 100644
index 0000000..16b4d0f
--- /dev/null
+++ b/docs/misc/xenstore-ring.txt
@@ -0,0 +1,116 @@
+The xenstore ring is a datastructure stored within a single 4KiB page
+shared between the xenstore server and the guest. The ring contains
+two queues of bytes -- one in each direction -- and some signalling
+information. The [xenstore protocol](xenstore.txt) is layered on top of
+the byte streams.
+
+The xenstore ring datastructure
+===============================
+
+The following table describes the ring structure where
+  - offsets and lengths are in bytes;
+  - "Input" is used to describe the data sent to the server; and
+  - "Output" is used to describe the data sent to the domain.
+
+Offset  Length  Description
+-----------------------------------------------------------------
+0       1024    Input data
+1024    1024    Output data
+2048    4       Input consumer offset
+2052    4       Input producer offset
+2056    4       Output consumer offset
+2060    4       Output producer offset
+2064    4       Server feature bitmap
+2068    4       Connection state
+
+The Input data and Output data are circular buffers. Each buffer is
+associated with a pair of free-running offsets labelled "consumer" and
+"producer".
+
+A "producer" offset is the offset in the byte stream of the next byte
+to be written modulo 2^32. A "consumer" offset is the offset in the byte
+stream of the next byte to be read modulo 2^32. Implementations must
+take care to handle wraparound properly when performing arithmetic with
+these values.
+
+The byte at offset 'x' in the byte stream will be stored at offset
+'x modulo 1024' in the circular buffer.
+
+Implementations may only overwrite previously-written data if it has
+been marked as 'consumed' by the relevant consumer pointer.
+
+When the guest domain is created, there is no outstanding Input or Output
+data. However
+
+  - guests must not assume that producer or consumer pointers start
+    at zero; and
+  - guests must not assume that unused bytes in either the Input or
+    Output data buffers has any particular value.
+
+A xenstore ring is always associated with an event channel. Whenever the
+ring structure is updated the event channel must be signalled. The
+guest and server are free to inspect the contents of the ring at any
+time, not only in response to an event channel event. This implies that
+updates must be ordered carefully to ensure consistency.
+
+The xenstore server may decide to advertise some features via the
+"Server feature bitmap". The server can start advertising features
+at any time by setting bits but it will never stop advertising features
+i.e. bits will never be cleared. The guest is not permitted to write to
+the server feature bitmap. The server features are offered to the guest;
+it is up to the guest whether to use them or not. The guest should ignore
+any unknown feature bits.
+
+The following features are defined:
+
+Mask    Description
+-----------------------------------------------------------------
+1       Ring reconnection (see the ring reconnection feature below)
+
+The "Connection state" field is used to request a ring close and reconnect.
+The "Connection state" field only contains valid data if the server has
+advertised the ring reconnection feature. If the feature has been advertised
+then the "Connection state" may take the following values:
+
+Value   Description
+-----------------------------------------------------------------
+0       Ring is connected
+1       Ring close and reconnect is in progress (see the "ring
+        reconnection feature" described below)
+
+The ring reconnection feature
+=============================
+
+The ring reconnection feature allows the guest to ask the server to
+reset the ring to a valid initial state i.e. one in which the Input
+and Output queues contain no data and there are no outstanding requests,
+watches or transactions.
+
+The ring reconnection feature is only available if the 'Ring reconnection'
+feature bit has been set by the server in the "Server feature bitmap".
+If a server supports ring reconnection, it will guarantee to advertise
+the feature before producing or consuming any data from the Input or Output
+queues.
+
+Assuming the server has advertised the feature, the guest can initiate
+a reconnection by setting the the Connection state to 1 ("Ring close
+and reconnect is in progress") and signalling the event channel.
+The guest must now ignore all fields except the Connection state and
+wait for it to be set to 0 ("Ring is connected")
+
+The server will guarantee to
+
+  - drop any partially read or written higher-level
+    [xenstore protocol](xenstore.txt) packets it may have;
+  - empty the Input and Output queues in the xenstore ring;
+  - discard any in-flight requests
+  - discard any watches associated with the connection
+  - discard any transactions associated with the connection
+  - set the Connection state to 0 ("Ring is connected"); and
+  - signal the event channel.
+
+From the point of view of the guest, the connection has been reset on a
+packet boundary.
+
+Note that only the guest may set the Connection state to 1 and only the
+server may set it back to 0.
diff --git a/tools/firmware/hvmloader/xenbus.c b/tools/firmware/hvmloader/xenbus.c
index 64c2176..f900a1e 100644
--- a/tools/firmware/hvmloader/xenbus.c
+++ b/tools/firmware/hvmloader/xenbus.c
@@ -37,6 +37,19 @@ static struct xenstore_domain_interface *rings; /* Shared ring with dom0 */
 static evtchn_port_t event;                     /* Event-channel to dom0 */
 static char payload[XENSTORE_PAYLOAD_MAX + 1];  /* Unmarshalling area */
 
+static void ring_wait(void)
+{
+    struct shared_info *shinfo = get_shared_info();
+    struct sched_poll poll;
+
+    memset(&poll, 0, sizeof(poll));
+    set_xen_guest_handle(poll.ports, &event);
+    poll.nr_ports = 1;
+
+    while ( !test_and_clear_bit(event, shinfo->evtchn_pending) )
+        hypercall_sched_op(SCHEDOP_poll, &poll);
+}
+
 /* Connect our xenbus client to the backend.
  * Call once, before any other xenbus actions. */
 void xenbus_setup(void)
@@ -61,14 +74,26 @@ void xenbus_setup(void)
 void xenbus_shutdown(void)
 {
     struct shared_info *shinfo = get_shared_info();
+    evtchn_send_t send;
 
     ASSERT(rings != NULL);
 
-    /* We zero out the whole ring -- the backend can handle this, and it's 
-     * not going to surprise any frontends since it's equivalent to never 
-     * having used the rings. */
-    memset(rings, 0, sizeof *rings);
-
+    if (rings->server_features & XENSTORE_SERVER_FEATURE_RECONNECTION) {
+        rings->connection = XENSTORE_RECONNECT;
+        send.port = event;
+        hypercall_event_channel_op(EVTCHNOP_send, &send);
+        while (*(volatile uint32_t*)&rings->connection == XENSTORE_RECONNECT)
+            ring_wait ();
+    } else {
+        /* If the backend reads the state while we're erasing it then the
+         * ring state will become corrupted, preventing guest frontends from
+         * connecting. This is rare. To help diagnose the failure, we fill
+         * the ring with XS_INVALID packets. */
+        memset(rings->req, 0xff, XENSTORE_RING_SIZE);
+        memset(rings->rsp, 0xff, XENSTORE_RING_SIZE);
+        rings->req_cons = rings->req_prod = 0;
+        rings->rsp_cons = rings->rsp_prod = 0;
+    }
     /* Clear the event-channel state too. */
     memset(shinfo->vcpu_info, 0, sizeof(shinfo->vcpu_info));
     memset(shinfo->evtchn_pending, 0, sizeof(shinfo->evtchn_pending));
@@ -77,19 +102,6 @@ void xenbus_shutdown(void)
     rings = NULL;
 }
 
-static void ring_wait(void)
-{
-    struct shared_info *shinfo = get_shared_info();
-    struct sched_poll poll;
-
-    memset(&poll, 0, sizeof(poll));
-    set_xen_guest_handle(poll.ports, &event);
-    poll.nr_ports = 1;
-
-    while ( !test_and_clear_bit(event, shinfo->evtchn_pending) )
-        hypercall_sched_op(SCHEDOP_poll, &poll);
-}
-
 /* Helper functions: copy data in and out of the ring */
 static void ring_write(const char *data, uint32_t len)
 {
diff --git a/tools/ocaml/libs/xb/xb.ml b/tools/ocaml/libs/xb/xb.ml
index 29d354d..50944b5 100644
--- a/tools/ocaml/libs/xb/xb.ml
+++ b/tools/ocaml/libs/xb/xb.ml
@@ -21,6 +21,10 @@ exception End_of_file
 exception Eagain
 exception Noent
 exception Invalid
+exception Reconnect
+
+let _ =
+  Callback.register_exception "Xb.Reconnect" Reconnect
 
 type backend_mmap =
 {
@@ -50,6 +54,19 @@ type t =
 let init_partial_in () = NoHdr
 	(Partial.header_size (), String.make (Partial.header_size()) '\000')
 
+let reconnect t = match t.backend with
+	| Fd _ ->
+		(* should never happen, so close the connection *)
+		raise End_of_file
+	| Xenmmap backend ->
+		Xs_ring.close backend.mmap;
+		backend.eventchn_notify ();
+		(* Clear our old connection state *)
+		Queue.clear t.pkt_in;
+		Queue.clear t.pkt_out;
+		t.partial_in <- init_partial_in ();
+		t.partial_out <- ""
+
 let queue con pkt = Queue.push pkt con.pkt_out
 
 let read_fd back con s len =
@@ -84,6 +101,7 @@ let write con s len =
 	| Fd backfd     -> write_fd backfd con s len
 	| Xenmmap backmmap -> write_mmap backmmap con s len
 
+(* NB: can throw Reconnect *)
 let output con =
 	(* get the output string from a string_of(packet) or partial_out *)
 	let s = if String.length con.partial_out > 0 then
@@ -102,6 +120,7 @@ let output con =
 	(* after sending one packet, partial is empty *)
 	con.partial_out = ""
 
+(* NB: can throw Reconnect *)
 let input con =
 	let newpacket = ref false in
 	let to_read =
@@ -145,6 +164,8 @@ let newcon backend = {
 let open_fd fd = newcon (Fd { fd = fd; })
 
 let open_mmap mmap notifyfct =
+	(* Advertise XENSTORE_SERVER_FEATURE_RECONNECTION *)
+	Xs_ring.set_server_features mmap (Xs_ring.Server_features.singleton Xs_ring.Server_feature.Reconnection);
 	newcon (Xenmmap {
 		mmap = mmap;
 		eventchn_notify = notifyfct;
diff --git a/tools/ocaml/libs/xb/xb.mli b/tools/ocaml/libs/xb/xb.mli
index 58234ae..4e1f833 100644
--- a/tools/ocaml/libs/xb/xb.mli
+++ b/tools/ocaml/libs/xb/xb.mli
@@ -23,7 +23,7 @@ module Op :
       | Resume
       | Set_target
       | Restrict
-      | Invalid (* Not a valid wire operation *)
+      | Invalid
     val operation_c_mapping : operation array
     val size : int
     val array_search : 'a -> 'a array -> int
@@ -57,6 +57,7 @@ exception End_of_file
 exception Eagain
 exception Noent
 exception Invalid
+exception Reconnect
 type backend_mmap = {
   mmap : Xenmmap.mmap_interface;
   eventchn_notify : unit -> unit;
@@ -73,6 +74,7 @@ type t = {
   mutable partial_out : string;
 }
 val init_partial_in : unit -> partial_buf
+val reconnect : t -> unit
 val queue : t -> Packet.t -> unit
 val read_fd : backend_fd -> 'a -> string -> int -> int
 val read_mmap : backend_mmap -> 'a -> string -> int -> int
diff --git a/tools/ocaml/libs/xb/xs_ring.ml b/tools/ocaml/libs/xb/xs_ring.ml
index 9469609..48e06f4 100644
--- a/tools/ocaml/libs/xb/xs_ring.ml
+++ b/tools/ocaml/libs/xb/xs_ring.ml
@@ -14,5 +14,33 @@
  * GNU Lesser General Public License for more details.
  *)
 
+module Server_feature = struct
+	type t =
+	| Reconnection
+end
+
+module Server_features = Set.Make(struct
+	type t = Server_feature.t
+	let compare = compare
+end)
+
 external read: Xenmmap.mmap_interface -> string -> int -> int = "ml_interface_read"
 external write: Xenmmap.mmap_interface -> string -> int -> int = "ml_interface_write"
+
+external _internal_set_server_features: Xenmmap.mmap_interface -> int -> unit = "ml_interface_set_server_features" "noalloc"
+external _internal_get_server_features: Xenmmap.mmap_interface -> int = "ml_interface_get_server_features" "noalloc"
+
+
+let get_server_features mmap =
+	(* NB only one feature currently defined above *)
+	let x = _internal_get_server_features mmap in
+	if x = 0
+	then Server_features.empty
+	else Server_features.singleton Server_feature.Reconnection
+
+let set_server_features mmap set =
+	(* NB only one feature currently defined above *)
+	let x = if set = Server_features.empty then 0 else 1 in
+	_internal_set_server_features mmap x
+
+external close: Xenmmap.mmap_interface -> unit = "ml_interface_close" "noalloc"
diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index 17656c2..fc9b0c5 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -36,22 +36,39 @@
 
 #define GET_C_STRUCT(a) ((struct mmap_interface *) a)
 
-static int xs_ring_read(struct mmap_interface *interface,
-                             char *buffer, int len)
+CAMLprim value ml_interface_read(value ml_interface,
+                                 value ml_buffer,
+                                 value ml_len)
 {
+	CAMLparam3(ml_interface, ml_buffer, ml_len);
+	CAMLlocal1(ml_result);
+
+	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
+	char *buffer = String_val(ml_buffer);
+	int len = Int_val(ml_len);
+	int result;
+
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
 	int to_read;
+	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
 	prod = *(volatile uint32_t*)&intf->req_prod;
+	connection = *(volatile uint32*)&intf->connection;
+
+	if (connection != XENSTORE_CONNECTED)
+		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
+
 	xen_mb();
 
 	if ((prod - cons) > XENSTORE_RING_SIZE)
-	    return -1;
+		caml_failwith("bad connection");
 
-	if (prod == cons)
-		return 0;
+	if (prod == cons) {
+		result = 0;
+		goto exit;
+	}
 	cons = MASK_XENSTORE_IDX(cons);
 	prod = MASK_XENSTORE_IDX(prod);
 	if (prod > cons)
@@ -63,21 +80,41 @@ static int xs_ring_read(struct mmap_interface *interface,
 	memcpy(buffer, intf->req + cons, len);
 	xen_mb();
 	intf->req_cons += len;
-	return len;
+	result = len;
+exit:
+	ml_result = Val_int(result);
+	CAMLreturn(ml_result);
 }
 
-static int xs_ring_write(struct mmap_interface *interface,
-                              char *buffer, int len)
+CAMLprim value ml_interface_write(value ml_interface,
+                                  value ml_buffer,
+                                  value ml_len)
 {
+	CAMLparam3(ml_interface, ml_buffer, ml_len);
+	CAMLlocal1(ml_result);
+
+	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
+	char *buffer = String_val(ml_buffer);
+	int len = Int_val(ml_len);
+	int result;
+
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
 	int can_write;
+	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
 	prod = *(volatile uint32_t*)&intf->rsp_prod;
+	connection = *(volatile uint32*)&intf->connection;
+
+	if (connection != XENSTORE_CONNECTED)
+		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
+
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE )
-		return 0;
+	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+		result = 0;
+		goto exit;
+	}
 	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
 		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
 	else 
@@ -87,31 +124,43 @@ static int xs_ring_write(struct mmap_interface *interface,
 	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
 	xen_mb();
 	intf->rsp_prod += len;
-	return len;
+	result = len;
+exit:
+	ml_result = Val_int(result);
+	CAMLreturn(ml_result);
 }
 
-CAMLprim value ml_interface_read(value interface, value buffer, value len)
+CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
-	CAMLparam3(interface, buffer, len);
-	CAMLlocal1(result);
-	int res;
+	CAMLparam2(interface, v);
+	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
 
-	res = xs_ring_read(GET_C_STRUCT(interface),
-	                   String_val(buffer), Int_val(len));
-	if (res == -1)
-		caml_failwith("bad connection");
-	result = Val_int(res);
-	CAMLreturn(result);
+	intf->server_features = Int_val(v);
+
+	CAMLreturn(Val_unit);
+}
+
+CAMLprim value ml_interface_get_server_features(value interface)
+{
+	CAMLparam1(interface);
+	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+
+	CAMLreturn(Val_int (intf->server_features));
 }
 
-CAMLprim value ml_interface_write(value interface, value buffer, value len)
+CAMLprim value ml_interface_close(value interface)
 {
-	CAMLparam3(interface, buffer, len);
-	CAMLlocal1(result);
-	int res;
-
-	res = xs_ring_write(GET_C_STRUCT(interface),
-	                    String_val(buffer), Int_val(len));
-	result = Val_int(res);
-	CAMLreturn(result);
+	CAMLparam1(interface);
+	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	int i;
+
+	intf->req_cons = intf->req_prod = intf->rsp_cons = intf->rsp_prod = 0;
+	/* Ensure the unused space is full of invalid xenstore packets. */
+	for (i = 0; i < XENSTORE_RING_SIZE; i++) {
+		intf->req[i] = 0xff; /* XS_INVALID = 0xffff */
+		intf->rsp[i] = 0xff;
+	}
+	xen_mb ();
+	intf->connection = XENSTORE_CONNECTED;
+	CAMLreturn(Val_unit);
 }
diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 807fc00..b4dc9cb 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -45,6 +45,20 @@ let mark_as_bad con =
 	|None -> ()
 	| Some domain -> Domain.mark_as_bad domain
 
+let initial_next_tid = 1
+
+let reconnect con =
+	Xenbus.Xb.reconnect con.xb;
+	(* dom is the same *)
+	Hashtbl.clear con.transactions;
+	con.next_tid <- initial_next_tid;
+	Hashtbl.clear con.watches;
+	(* anonid is the same *)
+	con.nb_watches <- 0;
+	con.stat_nb_ops <- 0;
+	(* perm is the same *)
+	()
+
 let get_path con =
 Printf.sprintf "/local/domain/%i/" (match con.dom with None -> 0 | Some d -> Domain.get_id d)
 
@@ -89,7 +103,7 @@ let create xbcon dom =
 	xb = xbcon;
 	dom = dom;
 	transactions = Hashtbl.create 5;
-	next_tid = 1;
+	next_tid = initial_next_tid;
 	watches = Hashtbl.create 8;
 	nb_watches = 0;
 	anonid = id;
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 89db56c..0620585 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -377,7 +377,12 @@ let do_input store cons doms con =
 	let newpacket =
 		try
 			Connection.do_input con
-		with Failure exp ->
+		with Xenbus.Xb.Reconnect ->
+			info "%s requests a reconnect" (Connection.get_domstr con);
+			Connection.reconnect con;
+			info "%s reconnection complete" (Connection.get_domstr con);
+			false
+		| Failure exp ->
 			error "caught exception %s" exp;
 			error "got a bad client %s" (sprintf "%-8s" (Connection.get_domstr con));
 			Connection.mark_as_bad con;
@@ -407,6 +412,11 @@ let do_output store cons doms con =
 			         (Xenbus.Xb.Op.to_string ty) (sanitize_data data);*)
 			write_answer_log ~ty ~tid ~con ~data;
 		);
-		ignore (Connection.do_output con)
+		try
+			ignore (Connection.do_output con)
+		with Xenbus.Xb.Reconnect ->
+			info "%s requests a reconnect" (Connection.get_domstr con);
+			Connection.reconnect con;
+			info "%s reconnection complete" (Connection.get_domstr con)
 	)
 
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 585f0c8..0a0cdbc 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -49,7 +49,9 @@ enum xsd_sockmsg_type
     XS_RESUME,
     XS_SET_TARGET,
     XS_RESTRICT,
-    XS_RESET_WATCHES
+    XS_RESET_WATCHES,
+
+    XS_INVALID = 0xffff /* Guaranteed to remain an invalid type */
 };
 
 #define XS_WRITE_NONE "NONE"
@@ -116,6 +118,8 @@ struct xenstore_domain_interface {
     char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
     XENSTORE_RING_IDX req_cons, req_prod;
     XENSTORE_RING_IDX rsp_cons, rsp_prod;
+    uint32_t server_features; /* Bitmap of features supported by the server */
+    uint32_t connection;
 };
 
 /* Violating this is very bad.  See docs/misc/xenstore.txt. */
@@ -125,6 +129,13 @@ struct xenstore_domain_interface {
 #define XENSTORE_ABS_PATH_MAX 3072
 #define XENSTORE_REL_PATH_MAX 2048
 
+/* The ability to reconnect a ring */
+#define XENSTORE_SERVER_FEATURE_RECONNECTION 1
+
+/* Valid values for the connection field */
+#define XENSTORE_CONNECTED 0 /* the steady-state */
+#define XENSTORE_RECONNECT 1 /* guest has initiated a reconnect */
+
 #endif /* _XS_WIRE_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xcwy1-0004NA-5z; Sat, 11 Oct 2014 13:44:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxz-0004Ms-JN
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:15 +0000
Received: from [85.158.143.35:48702] by server-1.bemta-4.messagelabs.com id
	9D/47-05872-E2439345; Sat, 11 Oct 2014 13:44:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1413035053!12304008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17935 invoked from network); 11 Oct 2014 13:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxw-0000QU-V8
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxw-0001KR-Tf
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:12 +0000
Date: Sat, 11 Oct 2014 13:44:12 +0000
Message-Id: <E1Xcwxw-0001KR-Tf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vlapic: don't silently accept bad
	vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5f32d186a8b1eeb707cd9bc468d84335d562491c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 10 10:53:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 10 10:53:01 2014 +0200

    x86/vlapic: don't silently accept bad vectors
    
    Vectors 0-15 are reserved, and a physical LAPIC - upon sending or
    receiving one - would generate an APIC error instead of doing the
    requested action. Make our emulation behave similarly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c        |   38 +++++++++++++++++++++++++++++++++++++-
 xen/include/asm-x86/hvm/vlapic.h |    1 +
 2 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 99ae1be..089d13f 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -123,10 +123,34 @@ static int vlapic_find_highest_irr(struct vlapic *vlapic)
     return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
 
+static void vlapic_error(struct vlapic *vlapic, unsigned int errmask)
+{
+    unsigned long flags;
+    uint32_t esr;
+
+    spin_lock_irqsave(&vlapic->esr_lock, flags);
+    esr = vlapic_get_reg(vlapic, APIC_ESR);
+    if ( (esr & errmask) != errmask )
+    {
+        uint32_t lvterr = vlapic_get_reg(vlapic, APIC_LVTERR);
+
+        vlapic_set_reg(vlapic, APIC_ESR, esr | errmask);
+        if ( !(lvterr & APIC_LVT_MASKED) )
+            vlapic_set_irq(vlapic, lvterr & APIC_VECTOR_MASK, 0);
+    }
+    spin_unlock_irqrestore(&vlapic->esr_lock, flags);
+}
+
 void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
     struct vcpu *target = vlapic_vcpu(vlapic);
 
+    if ( unlikely(vec < 16) )
+    {
+        vlapic_error(vlapic, APIC_ESR_RECVILL);
+        return;
+    }
+
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
@@ -459,11 +483,21 @@ void vlapic_ipi(
     case APIC_DM_LOWEST: {
         struct vlapic *target = vlapic_lowest_prio(
             vlapic_domain(vlapic), vlapic, short_hand, dest, dest_mode);
-        if ( target != NULL )
+
+        if ( unlikely((icr_low & APIC_VECTOR_MASK) < 16) )
+            vlapic_error(vlapic, APIC_ESR_SENDILL);
+        else if ( target )
             vlapic_accept_irq(vlapic_vcpu(target), icr_low);
         break;
     }
 
+    case APIC_DM_FIXED:
+        if ( unlikely((icr_low & APIC_VECTOR_MASK) < 16) )
+        {
+            vlapic_error(vlapic, APIC_ESR_SENDILL);
+            break;
+        }
+        /* fall through */
     default: {
         struct vcpu *v;
         bool_t batch = is_multicast_dest(vlapic, short_hand, dest, dest_mode);
@@ -1404,6 +1438,8 @@ int vlapic_init(struct vcpu *v)
     if ( v->vcpu_id == 0 )
         vlapic->hw.apic_base_msr |= MSR_IA32_APICBASE_BSP;
 
+    spin_lock_init(&vlapic->esr_lock);
+
     tasklet_init(&vlapic->init_sipi.tasklet,
                  vlapic_init_sipi_action,
                  (unsigned long)v);
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index bf59b95..16752b5 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -77,6 +77,7 @@ struct vlapic {
         bool_t               hw, regs;
         uint32_t             id, ldr;
     }                        loaded;
+    spinlock_t               esr_lock;
     struct periodic_time     pt;
     s_time_t                 timer_last_update;
     struct page_info         *regs_page;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xcwxq-0004Mc-N7; Sat, 11 Oct 2014 13:44:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxp-0004MX-EP
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:05 +0000
Received: from [193.109.254.147:10201] by server-5.bemta-14.messagelabs.com id
	FC/04-28255-42439345; Sat, 11 Oct 2014 13:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1413035043!12142068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1008 invoked from network); 11 Oct 2014 13:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxm-0000QR-R1
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxm-0001K2-OV
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:02 +0000
Date: Sat, 11 Oct 2014 13:44:02 +0000
Message-Id: <E1Xcwxm-0001K2-OV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "tools/hotplug: fix race during
	xen.conf creation"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66bb8b04f0032ddf0aa007b0850be1ec15477d60
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 10 09:35:34 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 10 09:35:42 2014 +0100

    Revert "tools/hotplug: fix race during xen.conf creation"
    
    This reverts commit eac3f5122fd4769b2885d8ad78bcbcf5df2472c1.
    
    The "all" target should never depend on "install", it is supposed to only build
    not install.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/systemd/Makefile |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 6950d24..9c58b33 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -21,11 +21,10 @@ ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
 			$(XEN_SYSTEMD_SERVICE)
 
 .PHONY: all
-all:	install
+all:	$(ALL_XEN_SYSTEMD)
 
 .PHONY: clean
 clean:
-	rm -f $(ALL_XEN_SYSTEMD)
 
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xcwy1-0004NA-5z; Sat, 11 Oct 2014 13:44:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxz-0004Ms-JN
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:15 +0000
Received: from [85.158.143.35:48702] by server-1.bemta-4.messagelabs.com id
	9D/47-05872-E2439345; Sat, 11 Oct 2014 13:44:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1413035053!12304008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17935 invoked from network); 11 Oct 2014 13:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxw-0000QU-V8
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxw-0001KR-Tf
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:12 +0000
Date: Sat, 11 Oct 2014 13:44:12 +0000
Message-Id: <E1Xcwxw-0001KR-Tf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vlapic: don't silently accept bad
	vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5f32d186a8b1eeb707cd9bc468d84335d562491c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 10 10:53:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 10 10:53:01 2014 +0200

    x86/vlapic: don't silently accept bad vectors
    
    Vectors 0-15 are reserved, and a physical LAPIC - upon sending or
    receiving one - would generate an APIC error instead of doing the
    requested action. Make our emulation behave similarly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c        |   38 +++++++++++++++++++++++++++++++++++++-
 xen/include/asm-x86/hvm/vlapic.h |    1 +
 2 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 99ae1be..089d13f 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -123,10 +123,34 @@ static int vlapic_find_highest_irr(struct vlapic *vlapic)
     return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
 
+static void vlapic_error(struct vlapic *vlapic, unsigned int errmask)
+{
+    unsigned long flags;
+    uint32_t esr;
+
+    spin_lock_irqsave(&vlapic->esr_lock, flags);
+    esr = vlapic_get_reg(vlapic, APIC_ESR);
+    if ( (esr & errmask) != errmask )
+    {
+        uint32_t lvterr = vlapic_get_reg(vlapic, APIC_LVTERR);
+
+        vlapic_set_reg(vlapic, APIC_ESR, esr | errmask);
+        if ( !(lvterr & APIC_LVT_MASKED) )
+            vlapic_set_irq(vlapic, lvterr & APIC_VECTOR_MASK, 0);
+    }
+    spin_unlock_irqrestore(&vlapic->esr_lock, flags);
+}
+
 void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
     struct vcpu *target = vlapic_vcpu(vlapic);
 
+    if ( unlikely(vec < 16) )
+    {
+        vlapic_error(vlapic, APIC_ESR_RECVILL);
+        return;
+    }
+
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
@@ -459,11 +483,21 @@ void vlapic_ipi(
     case APIC_DM_LOWEST: {
         struct vlapic *target = vlapic_lowest_prio(
             vlapic_domain(vlapic), vlapic, short_hand, dest, dest_mode);
-        if ( target != NULL )
+
+        if ( unlikely((icr_low & APIC_VECTOR_MASK) < 16) )
+            vlapic_error(vlapic, APIC_ESR_SENDILL);
+        else if ( target )
             vlapic_accept_irq(vlapic_vcpu(target), icr_low);
         break;
     }
 
+    case APIC_DM_FIXED:
+        if ( unlikely((icr_low & APIC_VECTOR_MASK) < 16) )
+        {
+            vlapic_error(vlapic, APIC_ESR_SENDILL);
+            break;
+        }
+        /* fall through */
     default: {
         struct vcpu *v;
         bool_t batch = is_multicast_dest(vlapic, short_hand, dest, dest_mode);
@@ -1404,6 +1438,8 @@ int vlapic_init(struct vcpu *v)
     if ( v->vcpu_id == 0 )
         vlapic->hw.apic_base_msr |= MSR_IA32_APICBASE_BSP;
 
+    spin_lock_init(&vlapic->esr_lock);
+
     tasklet_init(&vlapic->init_sipi.tasklet,
                  vlapic_init_sipi_action,
                  (unsigned long)v);
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index bf59b95..16752b5 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -77,6 +77,7 @@ struct vlapic {
         bool_t               hw, regs;
         uint32_t             id, ldr;
     }                        loaded;
+    spinlock_t               esr_lock;
     struct periodic_time     pt;
     s_time_t                 timer_last_update;
     struct page_info         *regs_page;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xcwxq-0004Mc-N7; Sat, 11 Oct 2014 13:44:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxp-0004MX-EP
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:05 +0000
Received: from [193.109.254.147:10201] by server-5.bemta-14.messagelabs.com id
	FC/04-28255-42439345; Sat, 11 Oct 2014 13:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1413035043!12142068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1008 invoked from network); 11 Oct 2014 13:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxm-0000QR-R1
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwxm-0001K2-OV
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:02 +0000
Date: Sat, 11 Oct 2014 13:44:02 +0000
Message-Id: <E1Xcwxm-0001K2-OV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "tools/hotplug: fix race during
	xen.conf creation"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66bb8b04f0032ddf0aa007b0850be1ec15477d60
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 10 09:35:34 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 10 09:35:42 2014 +0100

    Revert "tools/hotplug: fix race during xen.conf creation"
    
    This reverts commit eac3f5122fd4769b2885d8ad78bcbcf5df2472c1.
    
    The "all" target should never depend on "install", it is supposed to only build
    not install.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/systemd/Makefile |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 6950d24..9c58b33 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -21,11 +21,10 @@ ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
 			$(XEN_SYSTEMD_SERVICE)
 
 .PHONY: all
-all:	install
+all:	$(ALL_XEN_SYSTEMD)
 
 .PHONY: clean
 clean:
-	rm -f $(ALL_XEN_SYSTEMD)
 
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcwyC-0004Op-8j; Sat, 11 Oct 2014 13:44:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyA-0004OX-JV
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:26 +0000
Received: from [85.158.139.211:46787] by server-1.bemta-5.messagelabs.com id
	25/48-17892-93439345; Sat, 11 Oct 2014 13:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1413035063!13360394!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32434 invoked from network); 11 Oct 2014 13:44:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwy7-0000Qd-3W
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwy7-0001L2-1U
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:23 +0000
Date: Sat, 11 Oct 2014 13:44:23 +0000
Message-Id: <E1Xcwy7-0001L2-1U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: fix RMRR related error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b99f4400b695535153dcd5d949b3f63602ca8bf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 10 10:54:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 10 10:54:21 2014 +0200

    VT-d: fix RMRR related error handling
    
    - reassign_device_ownership() now tears down RMRR mappings (for other
      than Dom0)
    - to facilitate that, rmrr_identity_mapping() now deals with both
      establishing and tearing down of these mappings (the open coded
      equivalent in intel_iommu_remove_device() is being replaced at once)
    - intel_iommu_assign_device() now unrolls the assignment upon RMRR
      mapping errors
    - intel_iommu_add_device() now returns consistent values upon RMRR
      mapping failures (was: failure when last iteration ran into a
      problem, success otherwise)
    - intel_iommu_remove_device() no longer special cases Dom0 (it only
      ever gets called for devices removed from the _system_, not a domain)
    - rmrr_identity_mapping() now returns a proper error indicator instead
      of -1 when intel_iommu_map_page() failed
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |  200 ++++++++++++++++++-----------------
 1 files changed, 101 insertions(+), 99 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 98fb295..1c52981 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1661,38 +1661,6 @@ out:
     return ret;
 }
 
-static int reassign_device_ownership(
-    struct domain *source,
-    struct domain *target,
-    u8 devfn, struct pci_dev *pdev)
-{
-    int ret;
-
-    /*
-     * Devices assigned to untrusted domains (here assumed to be any domU)
-     * can attempt to send arbitrary LAPIC/MSI messages. We are unprotected
-     * by the root complex unless interrupt remapping is enabled.
-     */
-    if ( (target != hardware_domain) && !iommu_intremap )
-        untrusted_msi = 1;
-
-    ret = domain_context_unmap(source, devfn, pdev);
-    if ( ret )
-        return ret;
-
-    ret = domain_context_mapping(target, devfn, pdev);
-    if ( ret )
-        return ret;
-
-    if ( devfn == pdev->devfn )
-    {
-        list_move(&pdev->domain_list, &target->arch.pdev_list);
-        pdev->domain = target;
-    }
-
-    return ret;
-}
-
 static void iommu_domain_teardown(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
@@ -1839,11 +1807,11 @@ static void iommu_set_pgd(struct domain *d)
     hd->arch.pgd_maddr = pagetable_get_paddr(pagetable_from_mfn(pgd_mfn));
 }
 
-static int rmrr_identity_mapping(struct domain *d,
-                                 struct acpi_rmrr_unit *rmrr)
+static int rmrr_identity_mapping(struct domain *d, bool_t map,
+                                 const struct acpi_rmrr_unit *rmrr)
 {
-    u64 base, end;
-    unsigned long base_pfn, end_pfn;
+    unsigned long base_pfn = rmrr->base_address >> PAGE_SHIFT_4K;
+    unsigned long end_pfn = PAGE_ALIGN_4K(rmrr->end_address) >> PAGE_SHIFT_4K;
     struct mapped_rmrr *mrmrr;
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
@@ -1859,21 +1827,40 @@ static int rmrr_identity_mapping(struct domain *d,
         if ( mrmrr->base == rmrr->base_address &&
              mrmrr->end == rmrr->end_address )
         {
-            ++mrmrr->count;
-            return 0;
+            int ret = 0;
+
+            if ( map )
+            {
+                ++mrmrr->count;
+                return 0;
+            }
+
+            if ( --mrmrr->count )
+                return 0;
+
+            while ( base_pfn < end_pfn )
+            {
+                if ( intel_iommu_unmap_page(d, base_pfn) )
+                    ret = -ENXIO;
+                base_pfn++;
+            }
+
+            list_del(&mrmrr->list);
+            xfree(mrmrr);
+            return ret;
         }
     }
 
-    base = rmrr->base_address & PAGE_MASK_4K;
-    base_pfn = base >> PAGE_SHIFT_4K;
-    end = PAGE_ALIGN_4K(rmrr->end_address);
-    end_pfn = end >> PAGE_SHIFT_4K;
+    if ( !map )
+        return -ENOENT;
 
     while ( base_pfn < end_pfn )
     {
-        if ( intel_iommu_map_page(d, base_pfn, base_pfn,
-                                  IOMMUF_readable|IOMMUF_writable) )
-            return -1;
+        int err = intel_iommu_map_page(d, base_pfn, base_pfn,
+                                       IOMMUF_readable|IOMMUF_writable);
+
+        if ( err )
+            return err;
         base_pfn++;
     }
 
@@ -1913,14 +1900,14 @@ static int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)
              PCI_BUS(bdf) == pdev->bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(pdev->domain, rmrr);
+            ret = rmrr_identity_mapping(pdev->domain, 1, rmrr);
             if ( ret )
                 dprintk(XENLOG_ERR VTDPREFIX, "d%d: RMRR mapping failed\n",
                         pdev->domain->domain_id);
         }
     }
 
-    return ret;
+    return 0;
 }
 
 static int intel_iommu_enable_device(struct pci_dev *pdev)
@@ -1949,52 +1936,12 @@ static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 
     for_each_rmrr_device ( rmrr, bdf, i )
     {
-        struct hvm_iommu *hd;
-        struct mapped_rmrr *mrmrr, *tmp;
-
         if ( rmrr->segment != pdev->seg ||
              PCI_BUS(bdf) != pdev->bus ||
              PCI_DEVFN2(bdf) != devfn )
             continue;
 
-        /*
-         * If the device belongs to the hardware domain, and it has RMRR, don't
-         * remove it from the hardware domain, because BIOS may use RMRR at
-         * booting time.
-         */
-        if ( is_hardware_domain(pdev->domain) )
-            return 0;
-
-        hd = domain_hvm_iommu(pdev->domain);
-
-        /*
-         * No need to acquire hd->mapping_lock: Both insertion and removal
-         * get done while holding pcidevs_lock.
-         */
-        ASSERT(spin_is_locked(&pcidevs_lock));
-        list_for_each_entry_safe ( mrmrr, tmp, &hd->arch.mapped_rmrrs, list )
-        {
-            unsigned long base_pfn, end_pfn;
-
-            if ( rmrr->base_address != mrmrr->base ||
-                 rmrr->end_address != mrmrr->end )
-                continue;
-
-            if ( --mrmrr->count )
-                break;
-
-            base_pfn = (mrmrr->base & PAGE_MASK_4K) >> PAGE_SHIFT_4K;
-            end_pfn = PAGE_ALIGN_4K(mrmrr->end) >> PAGE_SHIFT_4K;
-            while ( base_pfn < end_pfn )
-            {
-                if ( intel_iommu_unmap_page(pdev->domain, base_pfn) )
-                    return -ENXIO;
-                base_pfn++;
-            }
-
-            list_del(&mrmrr->list);
-            xfree(mrmrr);
-        }
+        rmrr_identity_mapping(pdev->domain, 0, rmrr);
     }
 
     return domain_context_unmap(pdev->domain, devfn, pdev);
@@ -2152,7 +2099,7 @@ static void __hwdom_init setup_hwdom_rmrr(struct domain *d)
     spin_lock(&pcidevs_lock);
     for_each_rmrr_device ( rmrr, bdf, i )
     {
-        ret = rmrr_identity_mapping(d, rmrr);
+        ret = rmrr_identity_mapping(d, 1, rmrr);
         if ( ret )
             dprintk(XENLOG_ERR VTDPREFIX,
                      "IOMMU: mapping reserved region failed\n");
@@ -2262,6 +2209,62 @@ int __init intel_vtd_setup(void)
     return ret;
 }
 
+static int reassign_device_ownership(
+    struct domain *source,
+    struct domain *target,
+    u8 devfn, struct pci_dev *pdev)
+{
+    int ret;
+
+    /*
+     * Devices assigned to untrusted domains (here assumed to be any domU)
+     * can attempt to send arbitrary LAPIC/MSI messages. We are unprotected
+     * by the root complex unless interrupt remapping is enabled.
+     */
+    if ( (target != hardware_domain) && !iommu_intremap )
+        untrusted_msi = 1;
+
+    /*
+     * If the device belongs to the hardware domain, and it has RMRR, don't
+     * remove it from the hardware domain, because BIOS may use RMRR at
+     * booting time. Also account for the special casing of USB below (in
+     * intel_iommu_assign_device()).
+     */
+    if ( !is_hardware_domain(source) &&
+         !is_usb_device(pdev->seg, pdev->bus, pdev->devfn) )
+    {
+        const struct acpi_rmrr_unit *rmrr;
+        u16 bdf;
+        unsigned int i;
+
+        for_each_rmrr_device( rmrr, bdf, i )
+            if ( rmrr->segment == pdev->seg &&
+                 PCI_BUS(bdf) == pdev->bus &&
+                 PCI_DEVFN2(bdf) == devfn )
+            {
+                ret = rmrr_identity_mapping(source, 0, rmrr);
+                if ( ret != -ENOENT )
+                    return ret;
+            }
+    }
+
+    ret = domain_context_unmap(source, devfn, pdev);
+    if ( ret )
+        return ret;
+
+    ret = domain_context_mapping(target, devfn, pdev);
+    if ( ret )
+        return ret;
+
+    if ( devfn == pdev->devfn )
+    {
+        list_move(&pdev->domain_list, &target->arch.pdev_list);
+        pdev->domain = target;
+    }
+
+    return ret;
+}
+
 static int intel_iommu_assign_device(
     struct domain *d, u8 devfn, struct pci_dev *pdev)
 {
@@ -2275,7 +2278,7 @@ static int intel_iommu_assign_device(
 
     ret = reassign_device_ownership(hardware_domain, d, devfn, pdev);
     if ( ret )
-        goto done;
+        return ret;
 
     /* FIXME: Because USB RMRR conflicts with guest bios region,
      * ignore USB RMRR temporarily.
@@ -2283,10 +2286,7 @@ static int intel_iommu_assign_device(
     seg = pdev->seg;
     bus = pdev->bus;
     if ( is_usb_device(seg, bus, pdev->devfn) )
-    {
-        ret = 0;
-        goto done;
-    }
+        return 0;
 
     /* Setup rmrr identity mapping */
     for_each_rmrr_device( rmrr, bdf, i )
@@ -2295,17 +2295,19 @@ static int intel_iommu_assign_device(
              PCI_BUS(bdf) == bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(d, rmrr);
+            ret = rmrr_identity_mapping(d, 1, rmrr);
             if ( ret )
             {
-                dprintk(XENLOG_ERR VTDPREFIX,
-                        "IOMMU: mapping reserved region failed\n");
-                goto done;
+                reassign_device_ownership(d, hardware_domain, devfn, pdev);
+                printk(XENLOG_G_ERR VTDPREFIX
+                       " cannot map reserved region (%"PRIx64",%"PRIx64"] for Dom%d (%d)\n",
+                       rmrr->base_address, rmrr->end_address,
+                       d->domain_id, ret);
+                break;
             }
         }
     }
 
-done:
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcwyC-0004Op-8j; Sat, 11 Oct 2014 13:44:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyA-0004OX-JV
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:26 +0000
Received: from [85.158.139.211:46787] by server-1.bemta-5.messagelabs.com id
	25/48-17892-93439345; Sat, 11 Oct 2014 13:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1413035063!13360394!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32434 invoked from network); 11 Oct 2014 13:44:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwy7-0000Qd-3W
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xcwy7-0001L2-1U
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:23 +0000
Date: Sat, 11 Oct 2014 13:44:23 +0000
Message-Id: <E1Xcwy7-0001L2-1U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: fix RMRR related error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b99f4400b695535153dcd5d949b3f63602ca8bf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 10 10:54:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 10 10:54:21 2014 +0200

    VT-d: fix RMRR related error handling
    
    - reassign_device_ownership() now tears down RMRR mappings (for other
      than Dom0)
    - to facilitate that, rmrr_identity_mapping() now deals with both
      establishing and tearing down of these mappings (the open coded
      equivalent in intel_iommu_remove_device() is being replaced at once)
    - intel_iommu_assign_device() now unrolls the assignment upon RMRR
      mapping errors
    - intel_iommu_add_device() now returns consistent values upon RMRR
      mapping failures (was: failure when last iteration ran into a
      problem, success otherwise)
    - intel_iommu_remove_device() no longer special cases Dom0 (it only
      ever gets called for devices removed from the _system_, not a domain)
    - rmrr_identity_mapping() now returns a proper error indicator instead
      of -1 when intel_iommu_map_page() failed
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |  200 ++++++++++++++++++-----------------
 1 files changed, 101 insertions(+), 99 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 98fb295..1c52981 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1661,38 +1661,6 @@ out:
     return ret;
 }
 
-static int reassign_device_ownership(
-    struct domain *source,
-    struct domain *target,
-    u8 devfn, struct pci_dev *pdev)
-{
-    int ret;
-
-    /*
-     * Devices assigned to untrusted domains (here assumed to be any domU)
-     * can attempt to send arbitrary LAPIC/MSI messages. We are unprotected
-     * by the root complex unless interrupt remapping is enabled.
-     */
-    if ( (target != hardware_domain) && !iommu_intremap )
-        untrusted_msi = 1;
-
-    ret = domain_context_unmap(source, devfn, pdev);
-    if ( ret )
-        return ret;
-
-    ret = domain_context_mapping(target, devfn, pdev);
-    if ( ret )
-        return ret;
-
-    if ( devfn == pdev->devfn )
-    {
-        list_move(&pdev->domain_list, &target->arch.pdev_list);
-        pdev->domain = target;
-    }
-
-    return ret;
-}
-
 static void iommu_domain_teardown(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
@@ -1839,11 +1807,11 @@ static void iommu_set_pgd(struct domain *d)
     hd->arch.pgd_maddr = pagetable_get_paddr(pagetable_from_mfn(pgd_mfn));
 }
 
-static int rmrr_identity_mapping(struct domain *d,
-                                 struct acpi_rmrr_unit *rmrr)
+static int rmrr_identity_mapping(struct domain *d, bool_t map,
+                                 const struct acpi_rmrr_unit *rmrr)
 {
-    u64 base, end;
-    unsigned long base_pfn, end_pfn;
+    unsigned long base_pfn = rmrr->base_address >> PAGE_SHIFT_4K;
+    unsigned long end_pfn = PAGE_ALIGN_4K(rmrr->end_address) >> PAGE_SHIFT_4K;
     struct mapped_rmrr *mrmrr;
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
@@ -1859,21 +1827,40 @@ static int rmrr_identity_mapping(struct domain *d,
         if ( mrmrr->base == rmrr->base_address &&
              mrmrr->end == rmrr->end_address )
         {
-            ++mrmrr->count;
-            return 0;
+            int ret = 0;
+
+            if ( map )
+            {
+                ++mrmrr->count;
+                return 0;
+            }
+
+            if ( --mrmrr->count )
+                return 0;
+
+            while ( base_pfn < end_pfn )
+            {
+                if ( intel_iommu_unmap_page(d, base_pfn) )
+                    ret = -ENXIO;
+                base_pfn++;
+            }
+
+            list_del(&mrmrr->list);
+            xfree(mrmrr);
+            return ret;
         }
     }
 
-    base = rmrr->base_address & PAGE_MASK_4K;
-    base_pfn = base >> PAGE_SHIFT_4K;
-    end = PAGE_ALIGN_4K(rmrr->end_address);
-    end_pfn = end >> PAGE_SHIFT_4K;
+    if ( !map )
+        return -ENOENT;
 
     while ( base_pfn < end_pfn )
     {
-        if ( intel_iommu_map_page(d, base_pfn, base_pfn,
-                                  IOMMUF_readable|IOMMUF_writable) )
-            return -1;
+        int err = intel_iommu_map_page(d, base_pfn, base_pfn,
+                                       IOMMUF_readable|IOMMUF_writable);
+
+        if ( err )
+            return err;
         base_pfn++;
     }
 
@@ -1913,14 +1900,14 @@ static int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev)
              PCI_BUS(bdf) == pdev->bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(pdev->domain, rmrr);
+            ret = rmrr_identity_mapping(pdev->domain, 1, rmrr);
             if ( ret )
                 dprintk(XENLOG_ERR VTDPREFIX, "d%d: RMRR mapping failed\n",
                         pdev->domain->domain_id);
         }
     }
 
-    return ret;
+    return 0;
 }
 
 static int intel_iommu_enable_device(struct pci_dev *pdev)
@@ -1949,52 +1936,12 @@ static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 
     for_each_rmrr_device ( rmrr, bdf, i )
     {
-        struct hvm_iommu *hd;
-        struct mapped_rmrr *mrmrr, *tmp;
-
         if ( rmrr->segment != pdev->seg ||
              PCI_BUS(bdf) != pdev->bus ||
              PCI_DEVFN2(bdf) != devfn )
             continue;
 
-        /*
-         * If the device belongs to the hardware domain, and it has RMRR, don't
-         * remove it from the hardware domain, because BIOS may use RMRR at
-         * booting time.
-         */
-        if ( is_hardware_domain(pdev->domain) )
-            return 0;
-
-        hd = domain_hvm_iommu(pdev->domain);
-
-        /*
-         * No need to acquire hd->mapping_lock: Both insertion and removal
-         * get done while holding pcidevs_lock.
-         */
-        ASSERT(spin_is_locked(&pcidevs_lock));
-        list_for_each_entry_safe ( mrmrr, tmp, &hd->arch.mapped_rmrrs, list )
-        {
-            unsigned long base_pfn, end_pfn;
-
-            if ( rmrr->base_address != mrmrr->base ||
-                 rmrr->end_address != mrmrr->end )
-                continue;
-
-            if ( --mrmrr->count )
-                break;
-
-            base_pfn = (mrmrr->base & PAGE_MASK_4K) >> PAGE_SHIFT_4K;
-            end_pfn = PAGE_ALIGN_4K(mrmrr->end) >> PAGE_SHIFT_4K;
-            while ( base_pfn < end_pfn )
-            {
-                if ( intel_iommu_unmap_page(pdev->domain, base_pfn) )
-                    return -ENXIO;
-                base_pfn++;
-            }
-
-            list_del(&mrmrr->list);
-            xfree(mrmrr);
-        }
+        rmrr_identity_mapping(pdev->domain, 0, rmrr);
     }
 
     return domain_context_unmap(pdev->domain, devfn, pdev);
@@ -2152,7 +2099,7 @@ static void __hwdom_init setup_hwdom_rmrr(struct domain *d)
     spin_lock(&pcidevs_lock);
     for_each_rmrr_device ( rmrr, bdf, i )
     {
-        ret = rmrr_identity_mapping(d, rmrr);
+        ret = rmrr_identity_mapping(d, 1, rmrr);
         if ( ret )
             dprintk(XENLOG_ERR VTDPREFIX,
                      "IOMMU: mapping reserved region failed\n");
@@ -2262,6 +2209,62 @@ int __init intel_vtd_setup(void)
     return ret;
 }
 
+static int reassign_device_ownership(
+    struct domain *source,
+    struct domain *target,
+    u8 devfn, struct pci_dev *pdev)
+{
+    int ret;
+
+    /*
+     * Devices assigned to untrusted domains (here assumed to be any domU)
+     * can attempt to send arbitrary LAPIC/MSI messages. We are unprotected
+     * by the root complex unless interrupt remapping is enabled.
+     */
+    if ( (target != hardware_domain) && !iommu_intremap )
+        untrusted_msi = 1;
+
+    /*
+     * If the device belongs to the hardware domain, and it has RMRR, don't
+     * remove it from the hardware domain, because BIOS may use RMRR at
+     * booting time. Also account for the special casing of USB below (in
+     * intel_iommu_assign_device()).
+     */
+    if ( !is_hardware_domain(source) &&
+         !is_usb_device(pdev->seg, pdev->bus, pdev->devfn) )
+    {
+        const struct acpi_rmrr_unit *rmrr;
+        u16 bdf;
+        unsigned int i;
+
+        for_each_rmrr_device( rmrr, bdf, i )
+            if ( rmrr->segment == pdev->seg &&
+                 PCI_BUS(bdf) == pdev->bus &&
+                 PCI_DEVFN2(bdf) == devfn )
+            {
+                ret = rmrr_identity_mapping(source, 0, rmrr);
+                if ( ret != -ENOENT )
+                    return ret;
+            }
+    }
+
+    ret = domain_context_unmap(source, devfn, pdev);
+    if ( ret )
+        return ret;
+
+    ret = domain_context_mapping(target, devfn, pdev);
+    if ( ret )
+        return ret;
+
+    if ( devfn == pdev->devfn )
+    {
+        list_move(&pdev->domain_list, &target->arch.pdev_list);
+        pdev->domain = target;
+    }
+
+    return ret;
+}
+
 static int intel_iommu_assign_device(
     struct domain *d, u8 devfn, struct pci_dev *pdev)
 {
@@ -2275,7 +2278,7 @@ static int intel_iommu_assign_device(
 
     ret = reassign_device_ownership(hardware_domain, d, devfn, pdev);
     if ( ret )
-        goto done;
+        return ret;
 
     /* FIXME: Because USB RMRR conflicts with guest bios region,
      * ignore USB RMRR temporarily.
@@ -2283,10 +2286,7 @@ static int intel_iommu_assign_device(
     seg = pdev->seg;
     bus = pdev->bus;
     if ( is_usb_device(seg, bus, pdev->devfn) )
-    {
-        ret = 0;
-        goto done;
-    }
+        return 0;
 
     /* Setup rmrr identity mapping */
     for_each_rmrr_device( rmrr, bdf, i )
@@ -2295,17 +2295,19 @@ static int intel_iommu_assign_device(
              PCI_BUS(bdf) == bus &&
              PCI_DEVFN2(bdf) == devfn )
         {
-            ret = rmrr_identity_mapping(d, rmrr);
+            ret = rmrr_identity_mapping(d, 1, rmrr);
             if ( ret )
             {
-                dprintk(XENLOG_ERR VTDPREFIX,
-                        "IOMMU: mapping reserved region failed\n");
-                goto done;
+                reassign_device_ownership(d, hardware_domain, devfn, pdev);
+                printk(XENLOG_G_ERR VTDPREFIX
+                       " cannot map reserved region (%"PRIx64",%"PRIx64"] for Dom%d (%d)\n",
+                       rmrr->base_address, rmrr->end_address,
+                       d->domain_id, ret);
+                break;
             }
         }
     }
 
-done:
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcwyK-0004QE-BO; Sat, 11 Oct 2014 13:44:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyJ-0004Q2-QJ
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:35 +0000
Received: from [85.158.143.35:49248] by server-2.bemta-4.messagelabs.com id
	A4/46-04525-34439345; Sat, 11 Oct 2014 13:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1413035073!12284243!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 513 invoked from network); 11 Oct 2014 13:44:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyH-0000Ql-72
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyH-0001Lc-61
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:33 +0000
Date: Sat, 11 Oct 2014 13:44:33 +0000
Message-Id: <E1XcwyH-0001Lc-61@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot/reloc: remove redundant blank
	characters and reformat comments a bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d96cc5c4b2670a4220a50746fa17a0e8a4da1c2
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Fri Oct 10 10:55:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 10 10:55:03 2014 +0200

    x86/boot/reloc: remove redundant blank characters and reformat comments a bit
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/reloc.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index fa0fb6b..4609e55 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -1,11 +1,11 @@
-/******************************************************************************
+/*
  * reloc.c
- * 
+ *
  * 32-bit flat memory-map routines for relocating Multiboot structures
  * and modules. This is most easily done early with paging disabled.
- * 
+ *
  * Copyright (c) 2009, Citrix Systems, Inc.
- * 
+ *
  * Authors:
  *    Keir Fraser <keir@xen.org>
  */
@@ -21,8 +21,9 @@ asm (
     "    jmp  reloc                    \n"
     );
 
-/* This is our data.  Because the code must be relocatable, no BSS is
- * allowed.  All data is accessed PC-relative with inline assembly.
+/*
+ * This is our data. Because the code must be relocatable, no BSS is
+ * allowed. All data is accessed PC-relative with inline assembly.
  */
 asm (
     "alloc:                            \n"
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Oct 11 13:44:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Oct 2014 13:44:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XcwyK-0004QE-BO; Sat, 11 Oct 2014 13:44:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyJ-0004Q2-QJ
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:35 +0000
Received: from [85.158.143.35:49248] by server-2.bemta-4.messagelabs.com id
	A4/46-04525-34439345; Sat, 11 Oct 2014 13:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1413035073!12284243!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 513 invoked from network); 11 Oct 2014 13:44:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2014 13:44:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyH-0000Ql-72
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XcwyH-0001Lc-61
	for xen-changelog@lists.xensource.com; Sat, 11 Oct 2014 13:44:33 +0000
Date: Sat, 11 Oct 2014 13:44:33 +0000
Message-Id: <E1XcwyH-0001Lc-61@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot/reloc: remove redundant blank
	characters and reformat comments a bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d96cc5c4b2670a4220a50746fa17a0e8a4da1c2
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Fri Oct 10 10:55:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 10 10:55:03 2014 +0200

    x86/boot/reloc: remove redundant blank characters and reformat comments a bit
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/reloc.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index fa0fb6b..4609e55 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -1,11 +1,11 @@
-/******************************************************************************
+/*
  * reloc.c
- * 
+ *
  * 32-bit flat memory-map routines for relocating Multiboot structures
  * and modules. This is most easily done early with paging disabled.
- * 
+ *
  * Copyright (c) 2009, Citrix Systems, Inc.
- * 
+ *
  * Authors:
  *    Keir Fraser <keir@xen.org>
  */
@@ -21,8 +21,9 @@ asm (
     "    jmp  reloc                    \n"
     );
 
-/* This is our data.  Because the code must be relocatable, no BSS is
- * allowed.  All data is accessed PC-relative with inline assembly.
+/*
+ * This is our data. Because the code must be relocatable, no BSS is
+ * allowed. All data is accessed PC-relative with inline assembly.
  */
 asm (
     "alloc:                            \n"
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6N-0000Wk-6n; Wed, 15 Oct 2014 17:11:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6M-0000Wf-At
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:06 +0000
Received: from [193.109.254.147:12819] by server-6.bemta-14.messagelabs.com id
	14/EC-01867-9AAAE345; Wed, 15 Oct 2014 17:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1413393064!12985159!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13644 invoked from network); 15 Oct 2014 17:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6J-0005oZ-Pq
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6J-0001hK-Gm
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:03 +0000
Date: Wed, 15 Oct 2014 17:11:03 +0000
Message-Id: <E1XeS6J-0001hK-Gm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: Removing of "all"
	dependency from "install" rule.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e47df5f77bf50c50db6d7901a913003d4e8aa421
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Oct 13 15:31:36 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:03:12 2014 +0100

    tools/hotplug: Removing of "all" dependency from "install" rule.
    
    The "install" rules depends on both "all" and "subdirs-install" and
    "all" depends on "subdirs-all". This leads the "install" rules to call
    both "subdirs-all" and "subdirs-install" which create a race with two
    concurrent `make` within the same directory (systemd) trying to make the
    same things (xen.conf) and failing.
    
    Ultimatly, "install" should only depend on the things it needs to
    install, and not on "all".
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/Makefile |    2 +-
 tools/hotplug/Linux/Makefile   |    2 +-
 tools/hotplug/NetBSD/Makefile  |    2 +-
 tools/hotplug/common/Makefile  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index 169a124..6aba64a 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -15,7 +15,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-scripts install-rcd
+install: install-scripts install-rcd
 
 .PHONY: install-scripts
 install-scripts:
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 8cdaa9a..1706c05 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -43,7 +43,7 @@ all: subdirs-all
 build:
 
 .PHONY: install
-install: all install-initd install-scripts install-udev subdirs-install
+install: install-initd install-scripts install-udev subdirs-install
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile
index 9084859..0a370b8 100644
--- a/tools/hotplug/NetBSD/Makefile
+++ b/tools/hotplug/NetBSD/Makefile
@@ -17,7 +17,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-scripts install-rcd
+install: install-scripts install-rcd
 
 .PHONY: install-scripts
 install-scripts:
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 657a8e3..5623abb 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -19,7 +19,7 @@ all: build
 build: $(HOTPLUGPATH)
 
 .PHONY: install
-install: all install-scripts
+install: install-scripts
 
 .PHONY: install-scripts
 install-scripts: build
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6N-0000Wk-6n; Wed, 15 Oct 2014 17:11:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6M-0000Wf-At
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:06 +0000
Received: from [193.109.254.147:12819] by server-6.bemta-14.messagelabs.com id
	14/EC-01867-9AAAE345; Wed, 15 Oct 2014 17:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1413393064!12985159!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13644 invoked from network); 15 Oct 2014 17:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6J-0005oZ-Pq
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6J-0001hK-Gm
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:03 +0000
Date: Wed, 15 Oct 2014 17:11:03 +0000
Message-Id: <E1XeS6J-0001hK-Gm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: Removing of "all"
	dependency from "install" rule.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e47df5f77bf50c50db6d7901a913003d4e8aa421
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Mon Oct 13 15:31:36 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:03:12 2014 +0100

    tools/hotplug: Removing of "all" dependency from "install" rule.
    
    The "install" rules depends on both "all" and "subdirs-install" and
    "all" depends on "subdirs-all". This leads the "install" rules to call
    both "subdirs-all" and "subdirs-install" which create a race with two
    concurrent `make` within the same directory (systemd) trying to make the
    same things (xen.conf) and failing.
    
    Ultimatly, "install" should only depend on the things it needs to
    install, and not on "all".
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/Makefile |    2 +-
 tools/hotplug/Linux/Makefile   |    2 +-
 tools/hotplug/NetBSD/Makefile  |    2 +-
 tools/hotplug/common/Makefile  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index 169a124..6aba64a 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -15,7 +15,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-scripts install-rcd
+install: install-scripts install-rcd
 
 .PHONY: install-scripts
 install-scripts:
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 8cdaa9a..1706c05 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -43,7 +43,7 @@ all: subdirs-all
 build:
 
 .PHONY: install
-install: all install-initd install-scripts install-udev subdirs-install
+install: install-initd install-scripts install-udev subdirs-install
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile
index 9084859..0a370b8 100644
--- a/tools/hotplug/NetBSD/Makefile
+++ b/tools/hotplug/NetBSD/Makefile
@@ -17,7 +17,7 @@ all:
 build:
 
 .PHONY: install
-install: all install-scripts install-rcd
+install: install-scripts install-rcd
 
 .PHONY: install-scripts
 install-scripts:
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 657a8e3..5623abb 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -19,7 +19,7 @@ all: build
 build: $(HOTPLUGPATH)
 
 .PHONY: install
-install: all install-scripts
+install: install-scripts
 
 .PHONY: install-scripts
 install-scripts: build
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6X-0000XS-9S; Wed, 15 Oct 2014 17:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6W-0000XK-Hj
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:16 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	16/9A-10419-3BAAE345; Wed, 15 Oct 2014 17:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1413393074!13141134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23688 invoked from network); 15 Oct 2014 17:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6U-0005oc-5K
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6T-0001ho-TD
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:13 +0000
Date: Wed, 15 Oct 2014 17:11:13 +0000
Message-Id: <E1XeS6T-0001ho-TD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove stray blexit()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 254ddde3799c73ebc35c995fe63396a8dd17f339
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Mon Oct 13 12:56:29 2014 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:16:38 2014 +0100

    Remove stray blexit()
    
    A stray call to blexit() was in the normal processing path for handling
    FDTs specified in the config file, causing the EFI boot code to
    unconditionally exit.  Remove the blexit() call as it should never
    have been here.
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    Tested-by: Vijaya Kumar K<Vijaya.Kumar@caviumnetworks.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/efi/efi-boot.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 61cb13a..7abc059 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -359,7 +359,6 @@ static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *sec
     {
         split_string(name.s);
         read_file(dir_handle, s2w(&name), &dtbfile, NULL);
-            blexit(NULL);
         efi_bs->FreePool(name.w);
     }
     fdt = fdt_increase_size(&dtbfile, cfg.size + EFI_PAGE_SIZE);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6X-0000XS-9S; Wed, 15 Oct 2014 17:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6W-0000XK-Hj
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:16 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	16/9A-10419-3BAAE345; Wed, 15 Oct 2014 17:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1413393074!13141134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23688 invoked from network); 15 Oct 2014 17:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6U-0005oc-5K
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6T-0001ho-TD
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:13 +0000
Date: Wed, 15 Oct 2014 17:11:13 +0000
Message-Id: <E1XeS6T-0001ho-TD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove stray blexit()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 254ddde3799c73ebc35c995fe63396a8dd17f339
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Mon Oct 13 12:56:29 2014 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:16:38 2014 +0100

    Remove stray blexit()
    
    A stray call to blexit() was in the normal processing path for handling
    FDTs specified in the config file, causing the EFI boot code to
    unconditionally exit.  Remove the blexit() call as it should never
    have been here.
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    Tested-by: Vijaya Kumar K<Vijaya.Kumar@caviumnetworks.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/efi/efi-boot.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 61cb13a..7abc059 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -359,7 +359,6 @@ static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *sec
     {
         split_string(name.s);
         read_file(dir_handle, s2w(&name), &dtbfile, NULL);
-            blexit(NULL);
         efi_bs->FreePool(name.w);
     }
     fdt = fdt_increase_size(&dtbfile, cfg.size + EFI_PAGE_SIZE);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6i-0000Yy-C9; Wed, 15 Oct 2014 17:11:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6g-0000Yl-Uv
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:27 +0000
Received: from [193.109.254.147:13844] by server-7.bemta-14.messagelabs.com id
	03/53-13362-EBAAE345; Wed, 15 Oct 2014 17:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1413393084!7575798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6037 invoked from network); 15 Oct 2014 17:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6e-0005ol-Az
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6e-0001ig-9p
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:24 +0000
Date: Wed, 15 Oct 2014 17:11:24 +0000
Message-Id: <E1XeS6e-0001ig-9p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Do not enable EFI in dom0
	since it is not yet supported.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b095ec3d8828cbc063098d57be5fbf6d7dd2fac8
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Mon Oct 13 11:17:10 2014 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:18:05 2014 +0100

    xen: arm: Do not enable EFI in dom0 since it is not yet supported.
    
    Since EFI is not yet supported in dom0, we need to remove the following
    properties from the chosen node:
    
      * linux,uefi-mmap-start
      * linux,uefi-mmap-size
      * linux,uefi-mmap-desc-size
      * linux,uefi-mmap-desc-ver
    
    These are added by "arch/arm/efi/efi-boot.h: fdt_add_uefi_nodes()",
    and used by dom0 kernel to enable EFI.
    
    Cc: Julien Grall <julien.grall@linaro.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Roy Franz <roy.franz@linaro.org>
    Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Reviewed-by: Roy Franz <roy.franz@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 138ca89..5aca925 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -424,12 +424,21 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          *   bootargs (from module #1, above).
          * * remove bootargs,  xen,dom0-bootargs, xen,xen-bootargs,
          *   linux,initrd-start and linux,initrd-end.
+         * * remove bootargs, linux,uefi-system-table,
+         *   linux,uefi-mmap-start, linux,uefi-mmap-size,
+         *   linux,uefi-mmap-desc-size, and linux,uefi-mmap-desc-ver
+         *   (since EFI boot is not currently supported in dom0).
          */
         if ( dt_node_path_is_equal(node, "/chosen") )
         {
             if ( dt_property_name_is_equal(prop, "xen,xen-bootargs") ||
                  dt_property_name_is_equal(prop, "linux,initrd-start") ||
-                 dt_property_name_is_equal(prop, "linux,initrd-end") )
+                 dt_property_name_is_equal(prop, "linux,initrd-end") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-system-table") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-start") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-size") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-desc-size") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-desc-ver"))
                 continue;
 
             if ( dt_property_name_is_equal(prop, "xen,dom0-bootargs") )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6i-0000Yy-C9; Wed, 15 Oct 2014 17:11:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6g-0000Yl-Uv
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:27 +0000
Received: from [193.109.254.147:13844] by server-7.bemta-14.messagelabs.com id
	03/53-13362-EBAAE345; Wed, 15 Oct 2014 17:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1413393084!7575798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6037 invoked from network); 15 Oct 2014 17:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6e-0005ol-Az
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6e-0001ig-9p
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:24 +0000
Date: Wed, 15 Oct 2014 17:11:24 +0000
Message-Id: <E1XeS6e-0001ig-9p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Do not enable EFI in dom0
	since it is not yet supported.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b095ec3d8828cbc063098d57be5fbf6d7dd2fac8
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Mon Oct 13 11:17:10 2014 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:18:05 2014 +0100

    xen: arm: Do not enable EFI in dom0 since it is not yet supported.
    
    Since EFI is not yet supported in dom0, we need to remove the following
    properties from the chosen node:
    
      * linux,uefi-mmap-start
      * linux,uefi-mmap-size
      * linux,uefi-mmap-desc-size
      * linux,uefi-mmap-desc-ver
    
    These are added by "arch/arm/efi/efi-boot.h: fdt_add_uefi_nodes()",
    and used by dom0 kernel to enable EFI.
    
    Cc: Julien Grall <julien.grall@linaro.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Roy Franz <roy.franz@linaro.org>
    Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Reviewed-by: Roy Franz <roy.franz@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 138ca89..5aca925 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -424,12 +424,21 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          *   bootargs (from module #1, above).
          * * remove bootargs,  xen,dom0-bootargs, xen,xen-bootargs,
          *   linux,initrd-start and linux,initrd-end.
+         * * remove bootargs, linux,uefi-system-table,
+         *   linux,uefi-mmap-start, linux,uefi-mmap-size,
+         *   linux,uefi-mmap-desc-size, and linux,uefi-mmap-desc-ver
+         *   (since EFI boot is not currently supported in dom0).
          */
         if ( dt_node_path_is_equal(node, "/chosen") )
         {
             if ( dt_property_name_is_equal(prop, "xen,xen-bootargs") ||
                  dt_property_name_is_equal(prop, "linux,initrd-start") ||
-                 dt_property_name_is_equal(prop, "linux,initrd-end") )
+                 dt_property_name_is_equal(prop, "linux,initrd-end") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-system-table") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-start") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-size") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-desc-size") ||
+                 dt_property_name_is_equal(prop, "linux,uefi-mmap-desc-ver"))
                 continue;
 
             if ( dt_property_name_is_equal(prop, "xen,dom0-bootargs") )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6s-0000aD-En; Wed, 15 Oct 2014 17:11:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6r-0000a4-Eo
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:37 +0000
Received: from [85.158.137.68:37938] by server-14.bemta-3.messagelabs.com id
	BF/4F-01575-8CAAE345; Wed, 15 Oct 2014 17:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1413393094!8479800!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24277 invoked from network); 15 Oct 2014 17:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6o-0005ot-Gg
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6o-0001j6-FR
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:34 +0000
Date: Wed, 15 Oct 2014 17:11:34 +0000
Message-Id: <E1XeS6o-0001j6-FR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Initial support for PSCI-0.2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d3d72c0146776e7c8efe6e531561bcbdab1cea7
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Fri Oct 3 09:31:10 2014 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:19:39 2014 +0100

    xen/arm: Initial support for PSCI-0.2
    
    This patch adds SMC calls to suport a subset of PSCI-0.2 functions
    (PSCI_VERSION, CPU_ON, SYSTEM_OFF, SYSTEM_RESET).
    
    By default, the psci_init() will use PSCI-0.2. Otherwise, it will
    use PSCI-0.1 if PSCI-0.2 fails or un-supported.
    
    To add support for PSCI_VERSION, this patch replaces the "bool_t psci_available"
    variable with "int psci_ver", which contains the PSCI_VERSION as described in the
    PSCI-0.2 spec.
    
    Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/smpboot.c |    2 +-
 xen/arch/arm/platform.c      |    2 +-
 xen/arch/arm/psci.c          |   80 +++++++++++++++++++++++++++++++++++++-----
 xen/include/asm-arm/psci.h   |    4 ++-
 4 files changed, 76 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 9146476..341cc77 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -54,7 +54,7 @@ static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn)
 
 static int __init smp_psci_init(int cpu)
 {
-    if ( !psci_available )
+    if ( !psci_ver )
     {
         printk("CPU%d asks for PSCI, but DTB has no PSCI node\n", cpu);
         return -ENODEV;
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 74c3328..cb4cda8 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -110,7 +110,7 @@ int __init platform_specific_mapping(struct domain *d)
 #ifdef CONFIG_ARM_32
 int __init platform_cpu_up(int cpu)
 {
-    if ( psci_available )
+    if ( psci_ver )
         return call_psci_cpu_on(cpu);
 
     if ( platform && platform->cpu_up )
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index b6360d5..604ff4c 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -23,7 +23,7 @@
 #include <xen/smp.h>
 #include <asm/psci.h>
 
-bool_t psci_available;
+uint32_t psci_ver;
 
 #ifdef CONFIG_ARM_32
 #define REG_PREFIX "r"
@@ -58,16 +58,23 @@ int call_psci_cpu_on(int cpu)
                                 cpu_logical_map(cpu), __pa(init_secondary), 0);
 }
 
-int __init psci_init(void)
+void call_psci_system_off(void)
+{
+    if ( psci_ver > XEN_PSCI_V_0_1 )
+        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
+}
+
+void call_psci_system_reset(void)
+{
+    if ( psci_ver > XEN_PSCI_V_0_1 )
+        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
+}
+
+int __init psci_is_smc_method(const struct dt_device_node *psci)
 {
-    const struct dt_device_node *psci;
     int ret;
     const char *prop_str;
 
-    psci = dt_find_compatible_node(NULL, NULL, "arm,psci");
-    if ( !psci )
-        return -ENODEV;
-
     ret = dt_property_read_string(psci, "method", &prop_str);
     if ( ret )
     {
@@ -85,19 +92,74 @@ int __init psci_init(void)
         return -EINVAL;
     }
 
+    return 0;
+}
+
+int __init psci_init_0_1(void)
+{
+    int ret;
+    const struct dt_device_node *psci;
+
+    psci = dt_find_compatible_node(NULL, NULL, "arm,psci");
+    if ( !psci )
+        return -EOPNOTSUPP;
+
+    ret = psci_is_smc_method(psci);
+    if ( ret )
+        return -EINVAL;
+
     if ( !dt_property_read_u32(psci, "cpu_on", &psci_cpu_on_nr) )
     {
         printk("/psci node is missing the \"cpu_on\" property\n");
         return -ENOENT;
     }
 
-    psci_available = 1;
+    psci_ver = XEN_PSCI_V_0_1;
+
+    printk(XENLOG_INFO "Using PSCI-0.1 for SMP bringup\n");
+
+    return 0;
+}
+
+int __init psci_init_0_2(void)
+{
+    int ret;
+    const struct dt_device_node *psci;
+
+    psci = dt_find_compatible_node(NULL, NULL, "arm,psci-0.2");
+    if ( !psci )
+	return -EOPNOTSUPP;
+
+    ret = psci_is_smc_method(psci);
+    if ( ret )
+        return -EINVAL;
+
+    psci_ver = __invoke_psci_fn_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
+
+    if ( psci_ver != XEN_PSCI_V_0_2 )
+    {
+        printk("Error: PSCI version %#x is not supported.\n", psci_ver);
+        return -EOPNOTSUPP;
+    }
+
+    psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
 
-    printk(XENLOG_INFO "Using PSCI for SMP bringup\n");
+    printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
 
     return 0;
 }
 
+int __init psci_init(void)
+{
+    int ret;
+
+    ret = psci_init_0_2();
+    if ( ret )
+        ret = psci_init_0_1();
+
+    return ret;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 9777c03..5d17ee3 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -13,10 +13,12 @@
 #define PSCI_DISABLED               -8
 
 /* availability of PSCI on the host for SMP bringup */
-extern bool_t psci_available;
+extern uint32_t psci_ver;
 
 int psci_init(void);
 int call_psci_cpu_on(int cpu);
+void call_psci_system_off(void);
+void call_psci_system_reset(void);
 
 /* functions to handle guest PSCI requests */
 int32_t do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS6s-0000aD-En; Wed, 15 Oct 2014 17:11:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6r-0000a4-Eo
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:37 +0000
Received: from [85.158.137.68:37938] by server-14.bemta-3.messagelabs.com id
	BF/4F-01575-8CAAE345; Wed, 15 Oct 2014 17:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1413393094!8479800!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24277 invoked from network); 15 Oct 2014 17:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6o-0005ot-Gg
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6o-0001j6-FR
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:34 +0000
Date: Wed, 15 Oct 2014 17:11:34 +0000
Message-Id: <E1XeS6o-0001j6-FR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Initial support for PSCI-0.2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d3d72c0146776e7c8efe6e531561bcbdab1cea7
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Fri Oct 3 09:31:10 2014 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:19:39 2014 +0100

    xen/arm: Initial support for PSCI-0.2
    
    This patch adds SMC calls to suport a subset of PSCI-0.2 functions
    (PSCI_VERSION, CPU_ON, SYSTEM_OFF, SYSTEM_RESET).
    
    By default, the psci_init() will use PSCI-0.2. Otherwise, it will
    use PSCI-0.1 if PSCI-0.2 fails or un-supported.
    
    To add support for PSCI_VERSION, this patch replaces the "bool_t psci_available"
    variable with "int psci_ver", which contains the PSCI_VERSION as described in the
    PSCI-0.2 spec.
    
    Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/smpboot.c |    2 +-
 xen/arch/arm/platform.c      |    2 +-
 xen/arch/arm/psci.c          |   80 +++++++++++++++++++++++++++++++++++++-----
 xen/include/asm-arm/psci.h   |    4 ++-
 4 files changed, 76 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 9146476..341cc77 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -54,7 +54,7 @@ static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn)
 
 static int __init smp_psci_init(int cpu)
 {
-    if ( !psci_available )
+    if ( !psci_ver )
     {
         printk("CPU%d asks for PSCI, but DTB has no PSCI node\n", cpu);
         return -ENODEV;
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 74c3328..cb4cda8 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -110,7 +110,7 @@ int __init platform_specific_mapping(struct domain *d)
 #ifdef CONFIG_ARM_32
 int __init platform_cpu_up(int cpu)
 {
-    if ( psci_available )
+    if ( psci_ver )
         return call_psci_cpu_on(cpu);
 
     if ( platform && platform->cpu_up )
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index b6360d5..604ff4c 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -23,7 +23,7 @@
 #include <xen/smp.h>
 #include <asm/psci.h>
 
-bool_t psci_available;
+uint32_t psci_ver;
 
 #ifdef CONFIG_ARM_32
 #define REG_PREFIX "r"
@@ -58,16 +58,23 @@ int call_psci_cpu_on(int cpu)
                                 cpu_logical_map(cpu), __pa(init_secondary), 0);
 }
 
-int __init psci_init(void)
+void call_psci_system_off(void)
+{
+    if ( psci_ver > XEN_PSCI_V_0_1 )
+        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
+}
+
+void call_psci_system_reset(void)
+{
+    if ( psci_ver > XEN_PSCI_V_0_1 )
+        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
+}
+
+int __init psci_is_smc_method(const struct dt_device_node *psci)
 {
-    const struct dt_device_node *psci;
     int ret;
     const char *prop_str;
 
-    psci = dt_find_compatible_node(NULL, NULL, "arm,psci");
-    if ( !psci )
-        return -ENODEV;
-
     ret = dt_property_read_string(psci, "method", &prop_str);
     if ( ret )
     {
@@ -85,19 +92,74 @@ int __init psci_init(void)
         return -EINVAL;
     }
 
+    return 0;
+}
+
+int __init psci_init_0_1(void)
+{
+    int ret;
+    const struct dt_device_node *psci;
+
+    psci = dt_find_compatible_node(NULL, NULL, "arm,psci");
+    if ( !psci )
+        return -EOPNOTSUPP;
+
+    ret = psci_is_smc_method(psci);
+    if ( ret )
+        return -EINVAL;
+
     if ( !dt_property_read_u32(psci, "cpu_on", &psci_cpu_on_nr) )
     {
         printk("/psci node is missing the \"cpu_on\" property\n");
         return -ENOENT;
     }
 
-    psci_available = 1;
+    psci_ver = XEN_PSCI_V_0_1;
+
+    printk(XENLOG_INFO "Using PSCI-0.1 for SMP bringup\n");
+
+    return 0;
+}
+
+int __init psci_init_0_2(void)
+{
+    int ret;
+    const struct dt_device_node *psci;
+
+    psci = dt_find_compatible_node(NULL, NULL, "arm,psci-0.2");
+    if ( !psci )
+	return -EOPNOTSUPP;
+
+    ret = psci_is_smc_method(psci);
+    if ( ret )
+        return -EINVAL;
+
+    psci_ver = __invoke_psci_fn_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
+
+    if ( psci_ver != XEN_PSCI_V_0_2 )
+    {
+        printk("Error: PSCI version %#x is not supported.\n", psci_ver);
+        return -EOPNOTSUPP;
+    }
+
+    psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
 
-    printk(XENLOG_INFO "Using PSCI for SMP bringup\n");
+    printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
 
     return 0;
 }
 
+int __init psci_init(void)
+{
+    int ret;
+
+    ret = psci_init_0_2();
+    if ( ret )
+        ret = psci_init_0_1();
+
+    return ret;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 9777c03..5d17ee3 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -13,10 +13,12 @@
 #define PSCI_DISABLED               -8
 
 /* availability of PSCI on the host for SMP bringup */
-extern bool_t psci_available;
+extern uint32_t psci_ver;
 
 int psci_init(void);
 int call_psci_cpu_on(int cpu);
+void call_psci_system_off(void);
+void call_psci_system_reset(void);
 
 /* functions to handle guest PSCI requests */
 int32_t do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS72-0000bd-HM; Wed, 15 Oct 2014 17:11:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS71-0000bQ-2F
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:47 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	17/55-02699-2DAAE345; Wed, 15 Oct 2014 17:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1413393104!13182998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13128 invoked from network); 15 Oct 2014 17:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6y-0005p2-Lo
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6y-0001jS-Kd
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:44 +0000
Date: Wed, 15 Oct 2014 17:11:44 +0000
Message-Id: <E1XeS6y-0001jS-Kd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use PSCI-0.2 for
	machine_halt/restart by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e456d46ce0e17f88c0fcebea75b02d931bddcb9a
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Fri Oct 3 09:31:11 2014 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:19:39 2014 +0100

    xen/arm: Use PSCI-0.2 for machine_halt/restart by default
    
    "machine_halt()" and "machine_restart()" are modified to use PSCI interface
    by default if PSCI-0.2 is supported. The "raw_machine_reset()" is also removed
    since this is unnecessary.
    
    Also, machine_halt() is modified to add 10ms delay to make sure all auxiliary CPUs
    are offlined before calling the shutdown.
    
    For non-PSCI, platform_poweroff() and platform_reset() are used instead.
    
    Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/shutdown.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index adc0529..4988b03 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -5,11 +5,7 @@
 #include <xen/lib.h>
 #include <xen/smp.h>
 #include <asm/platform.h>
-
-static void raw_machine_reset(void)
-{
-    platform_reset();
-}
+#include <asm/psci.h>
 
 static void noreturn halt_this_cpu(void *arg)
 {
@@ -18,10 +14,23 @@ static void noreturn halt_this_cpu(void *arg)
 
 void machine_halt(void)
 {
+    int timeout = 10;
+
     watchdog_disable();
     console_start_sync();
     local_irq_enable();
     smp_call_function(halt_this_cpu, NULL, 0);
+    local_irq_disable();
+
+    /* Wait at most another 10ms for all other CPUs to go offline. */
+    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+        mdelay(1);
+
+    /* This is mainly for PSCI-0.2, which does not return if success. */
+    call_psci_system_off();
+
+    /* Alternative halt procedure */
+    platform_poweroff();
     halt_this_cpu(NULL);
 }
 
@@ -39,9 +48,13 @@ void machine_restart(unsigned int delay_millisecs)
     while ( (num_online_cpus() > 1) && (timeout-- > 0) )
         mdelay(1);
 
+    /* This is mainly for PSCI-0.2, which does not return if success. */
+    call_psci_system_reset();
+
+    /* Alternative reset procedure */
     while ( 1 )
     {
-        raw_machine_reset();
+        platform_reset();
         mdelay(100);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS72-0000bd-HM; Wed, 15 Oct 2014 17:11:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS71-0000bQ-2F
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:47 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	17/55-02699-2DAAE345; Wed, 15 Oct 2014 17:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1413393104!13182998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13128 invoked from network); 15 Oct 2014 17:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6y-0005p2-Lo
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS6y-0001jS-Kd
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:44 +0000
Date: Wed, 15 Oct 2014 17:11:44 +0000
Message-Id: <E1XeS6y-0001jS-Kd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Use PSCI-0.2 for
	machine_halt/restart by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e456d46ce0e17f88c0fcebea75b02d931bddcb9a
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Fri Oct 3 09:31:11 2014 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:19:39 2014 +0100

    xen/arm: Use PSCI-0.2 for machine_halt/restart by default
    
    "machine_halt()" and "machine_restart()" are modified to use PSCI interface
    by default if PSCI-0.2 is supported. The "raw_machine_reset()" is also removed
    since this is unnecessary.
    
    Also, machine_halt() is modified to add 10ms delay to make sure all auxiliary CPUs
    are offlined before calling the shutdown.
    
    For non-PSCI, platform_poweroff() and platform_reset() are used instead.
    
    Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/shutdown.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index adc0529..4988b03 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -5,11 +5,7 @@
 #include <xen/lib.h>
 #include <xen/smp.h>
 #include <asm/platform.h>
-
-static void raw_machine_reset(void)
-{
-    platform_reset();
-}
+#include <asm/psci.h>
 
 static void noreturn halt_this_cpu(void *arg)
 {
@@ -18,10 +14,23 @@ static void noreturn halt_this_cpu(void *arg)
 
 void machine_halt(void)
 {
+    int timeout = 10;
+
     watchdog_disable();
     console_start_sync();
     local_irq_enable();
     smp_call_function(halt_this_cpu, NULL, 0);
+    local_irq_disable();
+
+    /* Wait at most another 10ms for all other CPUs to go offline. */
+    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+        mdelay(1);
+
+    /* This is mainly for PSCI-0.2, which does not return if success. */
+    call_psci_system_off();
+
+    /* Alternative halt procedure */
+    platform_poweroff();
     halt_this_cpu(NULL);
 }
 
@@ -39,9 +48,13 @@ void machine_restart(unsigned int delay_millisecs)
     while ( (num_online_cpus() > 1) && (timeout-- > 0) )
         mdelay(1);
 
+    /* This is mainly for PSCI-0.2, which does not return if success. */
+    call_psci_system_reset();
+
+    /* Alternative reset procedure */
     while ( 1 )
     {
-        raw_machine_reset();
+        platform_reset();
         mdelay(100);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7C-0000dJ-K4; Wed, 15 Oct 2014 17:11:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7B-0000d3-02
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:57 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	AA/75-02699-CDAAE345; Wed, 15 Oct 2014 17:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1413393115!13182328!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14572 invoked from network); 15 Oct 2014 17:11:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS78-0005pB-Re
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS78-0001jp-P4
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:54 +0000
Date: Wed, 15 Oct 2014 17:11:54 +0000
Message-Id: <E1XeS78-0001jp-P4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: provide install-c target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afa33fa8dcf13c60f876cff5f57bc2a0e14e843a
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Oct 8 15:57:42 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:20:36 2014 +0100

    stubdom: provide install-c target
    
    configure --enable-c-stubdom fails to build with 'make rpmball' because
    no install target exists for it. Just provide it to fix build.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9dac103..2f9ca52 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -472,6 +472,8 @@ install-grub: pv-grub
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
 
+install-c: c-stubdom
+
 install-caml: caml-stubdom
 
 install-xenstore: xenstore-stubdom
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:11:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:11:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7C-0000dJ-K4; Wed, 15 Oct 2014 17:11:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7B-0000d3-02
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:57 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	AA/75-02699-CDAAE345; Wed, 15 Oct 2014 17:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1413393115!13182328!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14572 invoked from network); 15 Oct 2014 17:11:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:11:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS78-0005pB-Re
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS78-0001jp-P4
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:11:54 +0000
Date: Wed, 15 Oct 2014 17:11:54 +0000
Message-Id: <E1XeS78-0001jp-P4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: provide install-c target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afa33fa8dcf13c60f876cff5f57bc2a0e14e843a
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Oct 8 15:57:42 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:20:36 2014 +0100

    stubdom: provide install-c target
    
    configure --enable-c-stubdom fails to build with 'make rpmball' because
    no install target exists for it. Just provide it to fix build.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9dac103..2f9ca52 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -472,6 +472,8 @@ install-grub: pv-grub
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
 
+install-c: c-stubdom
+
 install-caml: caml-stubdom
 
 install-xenstore: xenstore-stubdom
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7N-0000es-Mm; Wed, 15 Oct 2014 17:12:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7M-0000eV-4M
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:08 +0000
Received: from [193.109.254.147:27389] by server-8.bemta-14.messagelabs.com id
	90/9F-01875-7EAAE345; Wed, 15 Oct 2014 17:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1413393125!12975971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7851 invoked from network); 15 Oct 2014 17:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7J-0005pk-3L
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7J-0001kL-1G
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:05 +0000
Date: Wed, 15 Oct 2014 17:12:05 +0000
Message-Id: <E1XeS7J-0001kL-1G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix typo in m4/xenstored.m4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b8f77ff99b61a96fc6d3c33705d70daa4f7ca604
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 9 18:44:43 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:23:45 2014 +0100

    Fix typo in m4/xenstored.m4
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ijc -- ran autogen.sh as requested]
---
 m4/xenstored.m4 |    2 +-
 tools/configure |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/m4/xenstored.m4 b/m4/xenstored.m4
index b268fc2..9c31a7f 100644
--- a/m4/xenstored.m4
+++ b/m4/xenstored.m4
@@ -20,7 +20,7 @@ AC_ARG_WITH([xenstored],
 		[This lets you choose which xenstore daemon you want, you have
 		two options: the original xenstored written in C (xenstored)
 		or the newer and robust one written in Ocaml (oxenstored).
-		The oxenstored daemon is the default but will but can only
+		The oxenstored daemon is the default but can only
 		be used if you have ocaml library / build dependencies solved,
 		if you have not specified a preference and do not have ocaml
 		dependencies resolved we'll enable the C xenstored for you. If
diff --git a/tools/configure b/tools/configure
index db73fba..2c76cb1 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1503,12 +1503,12 @@ Optional Packages:
                           you have two options: the original xenstored written
                           in C (xenstored) or the newer and robust one written
                           in Ocaml (oxenstored). The oxenstored daemon is the
-                          default but will but can only be used if you have
-                          ocaml library / build dependencies solved, if you
-                          have not specified a preference and do not have
-                          ocaml dependencies resolved we'll enable the C
-                          xenstored for you. If you ask for oxenstored we'll
-                          complain until you resolve those dependencies
+                          default but can only be used if you have ocaml
+                          library / build dependencies solved, if you have not
+                          specified a preference and do not have ocaml
+                          dependencies resolved we'll enable the C xenstored
+                          for you. If you ask for oxenstored we'll complain
+                          until you resolve those dependencies
   --with-systemd          set directory for systemd service files
   --with-systemd-modules-load          set directory for systemd modules load files
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7N-0000es-Mm; Wed, 15 Oct 2014 17:12:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7M-0000eV-4M
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:08 +0000
Received: from [193.109.254.147:27389] by server-8.bemta-14.messagelabs.com id
	90/9F-01875-7EAAE345; Wed, 15 Oct 2014 17:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1413393125!12975971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7851 invoked from network); 15 Oct 2014 17:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7J-0005pk-3L
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7J-0001kL-1G
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:05 +0000
Date: Wed, 15 Oct 2014 17:12:05 +0000
Message-Id: <E1XeS7J-0001kL-1G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix typo in m4/xenstored.m4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b8f77ff99b61a96fc6d3c33705d70daa4f7ca604
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 9 18:44:43 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:23:45 2014 +0100

    Fix typo in m4/xenstored.m4
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ijc -- ran autogen.sh as requested]
---
 m4/xenstored.m4 |    2 +-
 tools/configure |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/m4/xenstored.m4 b/m4/xenstored.m4
index b268fc2..9c31a7f 100644
--- a/m4/xenstored.m4
+++ b/m4/xenstored.m4
@@ -20,7 +20,7 @@ AC_ARG_WITH([xenstored],
 		[This lets you choose which xenstore daemon you want, you have
 		two options: the original xenstored written in C (xenstored)
 		or the newer and robust one written in Ocaml (oxenstored).
-		The oxenstored daemon is the default but will but can only
+		The oxenstored daemon is the default but can only
 		be used if you have ocaml library / build dependencies solved,
 		if you have not specified a preference and do not have ocaml
 		dependencies resolved we'll enable the C xenstored for you. If
diff --git a/tools/configure b/tools/configure
index db73fba..2c76cb1 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1503,12 +1503,12 @@ Optional Packages:
                           you have two options: the original xenstored written
                           in C (xenstored) or the newer and robust one written
                           in Ocaml (oxenstored). The oxenstored daemon is the
-                          default but will but can only be used if you have
-                          ocaml library / build dependencies solved, if you
-                          have not specified a preference and do not have
-                          ocaml dependencies resolved we'll enable the C
-                          xenstored for you. If you ask for oxenstored we'll
-                          complain until you resolve those dependencies
+                          default but can only be used if you have ocaml
+                          library / build dependencies solved, if you have not
+                          specified a preference and do not have ocaml
+                          dependencies resolved we'll enable the C xenstored
+                          for you. If you ask for oxenstored we'll complain
+                          until you resolve those dependencies
   --with-systemd          set directory for systemd service files
   --with-systemd-modules-load          set directory for systemd modules load files
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7X-0000gi-RQ; Wed, 15 Oct 2014 17:12:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7W-0000gT-KA
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:18 +0000
Received: from [85.158.137.68:21068] by server-7.bemta-3.messagelabs.com id
	15/71-01084-1FAAE345; Wed, 15 Oct 2014 17:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1413393136!10928130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14012 invoked from network); 15 Oct 2014 17:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7T-0005pt-Ub
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7T-0001lV-RS
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:15 +0000
Date: Wed, 15 Oct 2014 17:12:15 +0000
Message-Id: <E1XeS7T-0001lV-RS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Adjust helptext in m4/systemd.m4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4346115bee9b75d6a8d28c4d65642368b572cbf9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 09:19:48 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:23:55 2014 +0100

    Adjust helptext in m4/systemd.m4
    
    Use AS_HELP_STRING for proper formating, mention both options take a
    directory, mention the default value, quote the arguments in brackets.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    [ijc -- ran autogen.sh as requested]
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 m4/systemd.m4   |   12 ++++++++----
 tools/configure |    7 +++++--
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index 760bbad..629d202 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -18,12 +18,16 @@
 
 dnl Some optional path options
 AC_DEFUN([AX_SYSTEMD_OPTIONS], [
-	AC_ARG_WITH(systemd, [  --with-systemd          set directory for systemd service files],
-		SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
+	AC_ARG_WITH(systemd,
+		AS_HELP_STRING([--with-systemd=DIR],
+		[set directory for systemd service files [PREFIX/lib/systemd/system]]),
+		[SYSTEMD_DIR="$withval"],[SYSTEMD_DIR=""])
 	AC_SUBST(SYSTEMD_DIR)
 
-	AC_ARG_WITH(systemd, [  --with-systemd-modules-load          set directory for systemd modules load files],
-		SYSTEMD_MODULES_LOAD="$withval", SYSTEMD_MODULES_LOAD="")
+	AC_ARG_WITH(systemd,
+		AS_HELP_STRING([--with-systemd-modules-load=DIR],
+		[set directory for systemd modules load files [PREFIX/lib/modules-load.d/]]),
+		[SYSTEMD_MODULES_LOAD="$withval"], [SYSTEMD_MODULES_LOAD=""])
 	AC_SUBST(SYSTEMD_MODULES_LOAD)
 ])
 
diff --git a/tools/configure b/tools/configure
index 2c76cb1..491864f 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1509,8 +1509,11 @@ Optional Packages:
                           dependencies resolved we'll enable the C xenstored
                           for you. If you ask for oxenstored we'll complain
                           until you resolve those dependencies
-  --with-systemd          set directory for systemd service files
-  --with-systemd-modules-load          set directory for systemd modules load files
+  --with-systemd=DIR      set directory for systemd service files
+                          [PREFIX/lib/systemd/system]
+  --with-systemd-modules-load=DIR
+                          set directory for systemd modules load files
+                          [PREFIX/lib/modules-load.d/]
 
 Some influential environment variables:
   CC          C compiler command
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7X-0000gi-RQ; Wed, 15 Oct 2014 17:12:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7W-0000gT-KA
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:18 +0000
Received: from [85.158.137.68:21068] by server-7.bemta-3.messagelabs.com id
	15/71-01084-1FAAE345; Wed, 15 Oct 2014 17:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1413393136!10928130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14012 invoked from network); 15 Oct 2014 17:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7T-0005pt-Ub
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7T-0001lV-RS
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:15 +0000
Date: Wed, 15 Oct 2014 17:12:15 +0000
Message-Id: <E1XeS7T-0001lV-RS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Adjust helptext in m4/systemd.m4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4346115bee9b75d6a8d28c4d65642368b572cbf9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 09:19:48 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:23:55 2014 +0100

    Adjust helptext in m4/systemd.m4
    
    Use AS_HELP_STRING for proper formating, mention both options take a
    directory, mention the default value, quote the arguments in brackets.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    [ijc -- ran autogen.sh as requested]
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 m4/systemd.m4   |   12 ++++++++----
 tools/configure |    7 +++++--
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index 760bbad..629d202 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -18,12 +18,16 @@
 
 dnl Some optional path options
 AC_DEFUN([AX_SYSTEMD_OPTIONS], [
-	AC_ARG_WITH(systemd, [  --with-systemd          set directory for systemd service files],
-		SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
+	AC_ARG_WITH(systemd,
+		AS_HELP_STRING([--with-systemd=DIR],
+		[set directory for systemd service files [PREFIX/lib/systemd/system]]),
+		[SYSTEMD_DIR="$withval"],[SYSTEMD_DIR=""])
 	AC_SUBST(SYSTEMD_DIR)
 
-	AC_ARG_WITH(systemd, [  --with-systemd-modules-load          set directory for systemd modules load files],
-		SYSTEMD_MODULES_LOAD="$withval", SYSTEMD_MODULES_LOAD="")
+	AC_ARG_WITH(systemd,
+		AS_HELP_STRING([--with-systemd-modules-load=DIR],
+		[set directory for systemd modules load files [PREFIX/lib/modules-load.d/]]),
+		[SYSTEMD_MODULES_LOAD="$withval"], [SYSTEMD_MODULES_LOAD=""])
 	AC_SUBST(SYSTEMD_MODULES_LOAD)
 ])
 
diff --git a/tools/configure b/tools/configure
index 2c76cb1..491864f 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1509,8 +1509,11 @@ Optional Packages:
                           dependencies resolved we'll enable the C xenstored
                           for you. If you ask for oxenstored we'll complain
                           until you resolve those dependencies
-  --with-systemd          set directory for systemd service files
-  --with-systemd-modules-load          set directory for systemd modules load files
+  --with-systemd=DIR      set directory for systemd service files
+                          [PREFIX/lib/systemd/system]
+  --with-systemd-modules-load=DIR
+                          set directory for systemd modules load files
+                          [PREFIX/lib/modules-load.d/]
 
 Some influential environment variables:
   CC          C compiler command
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7i-0000iL-U7; Wed, 15 Oct 2014 17:12:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7g-0000i0-RR
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:29 +0000
Received: from [85.158.139.211:28704] by server-1.bemta-5.messagelabs.com id
	9A/9C-17892-CFAAE345; Wed, 15 Oct 2014 17:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1413393146!11419093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30298 invoked from network); 15 Oct 2014 17:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7e-0005pz-3j
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7e-0001lt-2F
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:26 +0000
Date: Wed, 15 Oct 2014 17:12:26 +0000
Message-Id: <E1XeS7e-0001lt-2F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Use C xenstored with
	--disable-ocamltools
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d45a0826d00d49d539b89af5e9e8edde6e8907e8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 10:32:24 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:25:13 2014 +0100

    Use C xenstored with --disable-ocamltools
    
    When xen is configured with --disable-ocamltools then oxenstored will
    still be the default if all required ocaml devel packages are installed.
    The reason is that xenstored.m4 is included before the ocamltools check.
    And xenstored.m4 does not use the result of --disable-ocamltools.
    
    Rearrange the code to check first for the presence of ocaml, then check
    --disable-ocamltools and finally decide what sort of xenstored should be
    the default.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran autogen.sh as requested]
---
 m4/xenstored.m4    |    4 +-
 tools/configure    |  141 ++++++++++++++++++++++++++--------------------------
 tools/configure.ac |    9 ++--
 3 files changed, 78 insertions(+), 76 deletions(-)

diff --git a/m4/xenstored.m4 b/m4/xenstored.m4
index 9c31a7f..fb77b4a 100644
--- a/m4/xenstored.m4
+++ b/m4/xenstored.m4
@@ -1,5 +1,5 @@
 AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
-	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
+	AS_IF([test "$ocamltools" = "n"], [
 		AC_MSG_ERROR([Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib])
 	])
 ])
@@ -7,7 +7,7 @@ AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
 AC_DEFUN([AX_XEN_OCAML_XENSTORE_DEFAULTS], [
 	xenstore="oxenstored"
 	xenstored=$sbindir/oxenstored
-	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
+	AS_IF([test "$ocamltools" = "n"], [
 		xenstore="xenstored"
 		xenstored=$sbindir/xenstored
 	])
diff --git a/tools/configure b/tools/configure
index 491864f..e44e754 100755
--- a/tools/configure
+++ b/tools/configure
@@ -656,8 +656,8 @@ CPP
 pyconfig
 PYTHONPATH
 CHECKPOLICY
-AWK
 XENSTORED
+AWK
 OCAMLFIND
 OCAMLBUILD
 OCAMLDOC
@@ -3658,14 +3658,6 @@ esac
 
 
 
-
-
-
-
-
-
-
-
 # systemd.m4 - Macros to check for and enable systemd          -*- Autoconf -*-
 #
 # Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
@@ -6138,67 +6130,6 @@ fi
 
 
 
-
-if test "x$XENSTORE" = "x"; then :
-
-
-# Check whether --with-xenstored was given.
-if test "${with_xenstored+set}" = set; then :
-  withval=$with_xenstored;
-		if test "x$withval" = "xxenstored"; then :
-
-			xenstore=$withval
-			xenstored=$sbindir/xenstored
-
-fi
-		if test "x$withval" = "xoxenstored"; then :
-
-			xenstore=$withval
-			xenstored=$sbindir/oxenstored
-
-	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
-
-		as_fn_error $? "Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib" "$LINENO" 5
-
-fi
-
-
-fi
-		if test "x$withval" != "xoxenstored" && test "x$withval" != "xxenstored"; then :
-
-			as_fn_error $? "Unsupported xenstored specified, supported types: oxenstored xenstored" "$LINENO" 5
-
-fi
-
-else
-
-
-	xenstore="oxenstored"
-	xenstored=$sbindir/oxenstored
-	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
-
-		xenstore="xenstored"
-		xenstored=$sbindir/xenstored
-
-fi
-
-
-fi
-
-
-fi
-
-
-	XENSTORE=$xenstore
-
-	if test "x$XENSTORED" = "x"; then :
-
-		XENSTORED=$xenstored
-
-fi
-
-
-
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6298,6 +6229,76 @@ fi
 fi
 
 fi
+
+
+
+
+
+
+
+
+
+
+if test "x$XENSTORE" = "x"; then :
+
+
+# Check whether --with-xenstored was given.
+if test "${with_xenstored+set}" = set; then :
+  withval=$with_xenstored;
+		if test "x$withval" = "xxenstored"; then :
+
+			xenstore=$withval
+			xenstored=$sbindir/xenstored
+
+fi
+		if test "x$withval" = "xoxenstored"; then :
+
+			xenstore=$withval
+			xenstored=$sbindir/oxenstored
+
+	if test "$ocamltools" = "n"; then :
+
+		as_fn_error $? "Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib" "$LINENO" 5
+
+fi
+
+
+fi
+		if test "x$withval" != "xoxenstored" && test "x$withval" != "xxenstored"; then :
+
+			as_fn_error $? "Unsupported xenstored specified, supported types: oxenstored xenstored" "$LINENO" 5
+
+fi
+
+else
+
+
+	xenstore="oxenstored"
+	xenstored=$sbindir/oxenstored
+	if test "$ocamltools" = "n"; then :
+
+		xenstore="xenstored"
+		xenstored=$sbindir/xenstored
+
+fi
+
+
+fi
+
+
+fi
+
+
+	XENSTORE=$xenstore
+
+	if test "x$XENSTORED" = "x"; then :
+
+		XENSTORED=$xenstored
+
+fi
+
+
+
 if test "x$xsmpolicy" = "xy"; then :
 
       # check for a checkpolicy binary with support for -t xen
diff --git a/tools/configure.ac b/tools/configure.ac
index 98b2455..f584798 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -75,7 +75,6 @@ m4_include([../m4/extfs.m4])
 m4_include([../m4/fetcher.m4])
 m4_include([../m4/ax_compare_version.m4])
 m4_include([../m4/paths.m4])
-m4_include([../m4/xenstored.m4])
 m4_include([../m4/systemd.m4])
 
 AX_XEN_EXPAND_CONFIG()
@@ -268,9 +267,6 @@ AX_PATH_PROG_OR_FAIL([PERL], [perl])
 AC_PROG_OCAML
 AC_PROG_FINDLIB
 
-AX_XENSTORE_OPTIONS
-AX_XENSTORE_SET
-
 AS_IF([test "x$ocamltools" = "xy"], [
     AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
         AS_IF([test "x$enable_ocamltools" = "xyes"], [
@@ -284,6 +280,11 @@ AS_IF([test "x$ocamltools" = "xy"], [
         ])
     ])
 ])
+
+m4_include([../m4/xenstored.m4])
+AX_XENSTORE_OPTIONS
+AX_XENSTORE_SET
+
 AS_IF([test "x$xsmpolicy" = "xy"], [
     AC_PROG_CHECKPOLICY
     AS_IF([test "x$CHECKPOLICY" = "xno"], [
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7i-0000iL-U7; Wed, 15 Oct 2014 17:12:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7g-0000i0-RR
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:29 +0000
Received: from [85.158.139.211:28704] by server-1.bemta-5.messagelabs.com id
	9A/9C-17892-CFAAE345; Wed, 15 Oct 2014 17:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1413393146!11419093!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30298 invoked from network); 15 Oct 2014 17:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7e-0005pz-3j
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7e-0001lt-2F
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:26 +0000
Date: Wed, 15 Oct 2014 17:12:26 +0000
Message-Id: <E1XeS7e-0001lt-2F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Use C xenstored with
	--disable-ocamltools
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d45a0826d00d49d539b89af5e9e8edde6e8907e8
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 10:32:24 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:25:13 2014 +0100

    Use C xenstored with --disable-ocamltools
    
    When xen is configured with --disable-ocamltools then oxenstored will
    still be the default if all required ocaml devel packages are installed.
    The reason is that xenstored.m4 is included before the ocamltools check.
    And xenstored.m4 does not use the result of --disable-ocamltools.
    
    Rearrange the code to check first for the presence of ocaml, then check
    --disable-ocamltools and finally decide what sort of xenstored should be
    the default.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran autogen.sh as requested]
---
 m4/xenstored.m4    |    4 +-
 tools/configure    |  141 ++++++++++++++++++++++++++--------------------------
 tools/configure.ac |    9 ++--
 3 files changed, 78 insertions(+), 76 deletions(-)

diff --git a/m4/xenstored.m4 b/m4/xenstored.m4
index 9c31a7f..fb77b4a 100644
--- a/m4/xenstored.m4
+++ b/m4/xenstored.m4
@@ -1,5 +1,5 @@
 AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
-	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
+	AS_IF([test "$ocamltools" = "n"], [
 		AC_MSG_ERROR([Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib])
 	])
 ])
@@ -7,7 +7,7 @@ AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
 AC_DEFUN([AX_XEN_OCAML_XENSTORE_DEFAULTS], [
 	xenstore="oxenstored"
 	xenstored=$sbindir/oxenstored
-	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
+	AS_IF([test "$ocamltools" = "n"], [
 		xenstore="xenstored"
 		xenstored=$sbindir/xenstored
 	])
diff --git a/tools/configure b/tools/configure
index 491864f..e44e754 100755
--- a/tools/configure
+++ b/tools/configure
@@ -656,8 +656,8 @@ CPP
 pyconfig
 PYTHONPATH
 CHECKPOLICY
-AWK
 XENSTORED
+AWK
 OCAMLFIND
 OCAMLBUILD
 OCAMLDOC
@@ -3658,14 +3658,6 @@ esac
 
 
 
-
-
-
-
-
-
-
-
 # systemd.m4 - Macros to check for and enable systemd          -*- Autoconf -*-
 #
 # Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
@@ -6138,67 +6130,6 @@ fi
 
 
 
-
-if test "x$XENSTORE" = "x"; then :
-
-
-# Check whether --with-xenstored was given.
-if test "${with_xenstored+set}" = set; then :
-  withval=$with_xenstored;
-		if test "x$withval" = "xxenstored"; then :
-
-			xenstore=$withval
-			xenstored=$sbindir/xenstored
-
-fi
-		if test "x$withval" = "xoxenstored"; then :
-
-			xenstore=$withval
-			xenstored=$sbindir/oxenstored
-
-	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
-
-		as_fn_error $? "Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib" "$LINENO" 5
-
-fi
-
-
-fi
-		if test "x$withval" != "xoxenstored" && test "x$withval" != "xxenstored"; then :
-
-			as_fn_error $? "Unsupported xenstored specified, supported types: oxenstored xenstored" "$LINENO" 5
-
-fi
-
-else
-
-
-	xenstore="oxenstored"
-	xenstored=$sbindir/oxenstored
-	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
-
-		xenstore="xenstored"
-		xenstored=$sbindir/xenstored
-
-fi
-
-
-fi
-
-
-fi
-
-
-	XENSTORE=$xenstore
-
-	if test "x$XENSTORED" = "x"; then :
-
-		XENSTORED=$xenstored
-
-fi
-
-
-
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6298,6 +6229,76 @@ fi
 fi
 
 fi
+
+
+
+
+
+
+
+
+
+
+if test "x$XENSTORE" = "x"; then :
+
+
+# Check whether --with-xenstored was given.
+if test "${with_xenstored+set}" = set; then :
+  withval=$with_xenstored;
+		if test "x$withval" = "xxenstored"; then :
+
+			xenstore=$withval
+			xenstored=$sbindir/xenstored
+
+fi
+		if test "x$withval" = "xoxenstored"; then :
+
+			xenstore=$withval
+			xenstored=$sbindir/oxenstored
+
+	if test "$ocamltools" = "n"; then :
+
+		as_fn_error $? "Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib" "$LINENO" 5
+
+fi
+
+
+fi
+		if test "x$withval" != "xoxenstored" && test "x$withval" != "xxenstored"; then :
+
+			as_fn_error $? "Unsupported xenstored specified, supported types: oxenstored xenstored" "$LINENO" 5
+
+fi
+
+else
+
+
+	xenstore="oxenstored"
+	xenstored=$sbindir/oxenstored
+	if test "$ocamltools" = "n"; then :
+
+		xenstore="xenstored"
+		xenstored=$sbindir/xenstored
+
+fi
+
+
+fi
+
+
+fi
+
+
+	XENSTORE=$xenstore
+
+	if test "x$XENSTORED" = "x"; then :
+
+		XENSTORED=$xenstored
+
+fi
+
+
+
 if test "x$xsmpolicy" = "xy"; then :
 
       # check for a checkpolicy binary with support for -t xen
diff --git a/tools/configure.ac b/tools/configure.ac
index 98b2455..f584798 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -75,7 +75,6 @@ m4_include([../m4/extfs.m4])
 m4_include([../m4/fetcher.m4])
 m4_include([../m4/ax_compare_version.m4])
 m4_include([../m4/paths.m4])
-m4_include([../m4/xenstored.m4])
 m4_include([../m4/systemd.m4])
 
 AX_XEN_EXPAND_CONFIG()
@@ -268,9 +267,6 @@ AX_PATH_PROG_OR_FAIL([PERL], [perl])
 AC_PROG_OCAML
 AC_PROG_FINDLIB
 
-AX_XENSTORE_OPTIONS
-AX_XENSTORE_SET
-
 AS_IF([test "x$ocamltools" = "xy"], [
     AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
         AS_IF([test "x$enable_ocamltools" = "xyes"], [
@@ -284,6 +280,11 @@ AS_IF([test "x$ocamltools" = "xy"], [
         ])
     ])
 ])
+
+m4_include([../m4/xenstored.m4])
+AX_XENSTORE_OPTIONS
+AX_XENSTORE_SET
+
 AS_IF([test "x$xsmpolicy" = "xy"], [
     AC_PROG_CHECKPOLICY
     AS_IF([test "x$CHECKPOLICY" = "xno"], [
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7s-0000jb-0V; Wed, 15 Oct 2014 17:12:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7q-0000jP-Ij
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:38 +0000
Received: from [193.109.254.147:62503] by server-15.bemta-14.messagelabs.com
	id 63/D6-30948-50BAE345; Wed, 15 Oct 2014 17:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1413393156!12976058!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9881 invoked from network); 15 Oct 2014 17:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7o-0005q7-8S
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7o-0001mJ-78
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:36 +0000
Date: Wed, 15 Oct 2014 17:12:36 +0000
Message-Id: <E1XeS7o-0001mJ-78@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove dead qemu variables from
	toplevel Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6feb6b1282b0dc1515fffcc26308111300a37615
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 11:23:25 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:25:57 2014 +0100

    Remove dead qemu variables from toplevel Makefile
    
    The variables should have been removed already in
    7ed06911dc596d23f21dee209b7f2db294e34b56 ("Remove dead qemu code from
    toplevel Makefile"), but I did not spot it at this time.
    Now it looks like the intention initially was to let the install-tools
    depend on tools/qemu-xen-traditional-dir. But that did not work because
    there was the typo in the variables (TGT vs. TARGET), and
    CONFIG_QEMU_TRAD was not defined anyway.
    
    So remove QEMU_TRAD_DIR_TARGET and QEMU_XEN_DIR_TARGET because they are
    not defined at all.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 0355b49..f540e07 100644
--- a/Makefile
+++ b/Makefile
@@ -65,11 +65,11 @@ install-xen:
 	$(MAKE) -C xen install
 
 .PHONY: install-tools
-install-tools: $(QEMU_TRAD_DIR_TARGET) $(QEMU_XEN_DIR_TARGET)
+install-tools:
 	$(MAKE) -C tools install
 
 .PHONY: install-stubdom
-install-stubdom: $(QEMU_TRAD_DIR_TARGET) install-tools
+install-stubdom: install-tools
 	$(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS7s-0000jb-0V; Wed, 15 Oct 2014 17:12:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7q-0000jP-Ij
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:38 +0000
Received: from [193.109.254.147:62503] by server-15.bemta-14.messagelabs.com
	id 63/D6-30948-50BAE345; Wed, 15 Oct 2014 17:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1413393156!12976058!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9881 invoked from network); 15 Oct 2014 17:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7o-0005q7-8S
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7o-0001mJ-78
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:36 +0000
Date: Wed, 15 Oct 2014 17:12:36 +0000
Message-Id: <E1XeS7o-0001mJ-78@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove dead qemu variables from
	toplevel Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6feb6b1282b0dc1515fffcc26308111300a37615
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 11:23:25 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:25:57 2014 +0100

    Remove dead qemu variables from toplevel Makefile
    
    The variables should have been removed already in
    7ed06911dc596d23f21dee209b7f2db294e34b56 ("Remove dead qemu code from
    toplevel Makefile"), but I did not spot it at this time.
    Now it looks like the intention initially was to let the install-tools
    depend on tools/qemu-xen-traditional-dir. But that did not work because
    there was the typo in the variables (TGT vs. TARGET), and
    CONFIG_QEMU_TRAD was not defined anyway.
    
    So remove QEMU_TRAD_DIR_TARGET and QEMU_XEN_DIR_TARGET because they are
    not defined at all.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 0355b49..f540e07 100644
--- a/Makefile
+++ b/Makefile
@@ -65,11 +65,11 @@ install-xen:
 	$(MAKE) -C xen install
 
 .PHONY: install-tools
-install-tools: $(QEMU_TRAD_DIR_TARGET) $(QEMU_XEN_DIR_TARGET)
+install-tools:
 	$(MAKE) -C tools install
 
 .PHONY: install-stubdom
-install-stubdom: $(QEMU_TRAD_DIR_TARGET) install-tools
+install-stubdom: install-tools
 	$(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS82-0000l6-38; Wed, 15 Oct 2014 17:12:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS80-0000ks-No
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:48 +0000
Received: from [85.158.139.211:16966] by server-15.bemta-5.messagelabs.com id
	0E/3B-12002-01BAE345; Wed, 15 Oct 2014 17:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1413393166!11391702!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11981 invoked from network); 15 Oct 2014 17:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7y-0005qD-De
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7y-0001mf-Cd
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:46 +0000
Date: Wed, 15 Oct 2014 17:12:46 +0000
Message-Id: <E1XeS7y-0001mf-Cd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove obsolete dev-docs target from
	toplevel Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f16ed0eaaf84cfbaf625b07fb515e6d1303233b0
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 11:53:29 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:26:33 2014 +0100

    Remove obsolete dev-docs target from toplevel Makefile
    
    The actual target was removed with commit
    5806093a20e20209d4b88ab866ae1e6017c95de7 ("docs: drop doxygen stuff")
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index f540e07..6e9a4c7 100644
--- a/Makefile
+++ b/Makefile
@@ -87,10 +87,6 @@ tools/firmware/ovmf-dir-force-update:
 install-docs:
 	$(MAKE) -C docs install
 
-.PHONY: dev-docs
-dev-docs:
-	$(MAKE) -C docs dev-docs
-
 # build xen and the tools and place them in the install
 # directory. 'make install' should then copy them to the normal system
 # directories
@@ -182,7 +178,6 @@ help:
 	@echo '  tools                 - build and install tools'
 	@echo '  stubdom               - build and install the stubdomain images'
 	@echo '  docs                  - build and install user documentation'
-	@echo '  dev-docs              - build developer-only documentation'
 	@echo ''
 	@echo 'Cleaning targets:'
 	@echo '  clean                 - clean the Xen, tools and docs (but not guest kernel trees)'
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS82-0000l6-38; Wed, 15 Oct 2014 17:12:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS80-0000ks-No
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:48 +0000
Received: from [85.158.139.211:16966] by server-15.bemta-5.messagelabs.com id
	0E/3B-12002-01BAE345; Wed, 15 Oct 2014 17:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1413393166!11391702!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11981 invoked from network); 15 Oct 2014 17:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7y-0005qD-De
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS7y-0001mf-Cd
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:46 +0000
Date: Wed, 15 Oct 2014 17:12:46 +0000
Message-Id: <E1XeS7y-0001mf-Cd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Remove obsolete dev-docs target from
	toplevel Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f16ed0eaaf84cfbaf625b07fb515e6d1303233b0
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 11:53:29 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:26:33 2014 +0100

    Remove obsolete dev-docs target from toplevel Makefile
    
    The actual target was removed with commit
    5806093a20e20209d4b88ab866ae1e6017c95de7 ("docs: drop doxygen stuff")
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index f540e07..6e9a4c7 100644
--- a/Makefile
+++ b/Makefile
@@ -87,10 +87,6 @@ tools/firmware/ovmf-dir-force-update:
 install-docs:
 	$(MAKE) -C docs install
 
-.PHONY: dev-docs
-dev-docs:
-	$(MAKE) -C docs dev-docs
-
 # build xen and the tools and place them in the install
 # directory. 'make install' should then copy them to the normal system
 # directories
@@ -182,7 +178,6 @@ help:
 	@echo '  tools                 - build and install tools'
 	@echo '  stubdom               - build and install the stubdomain images'
 	@echo '  docs                  - build and install user documentation'
-	@echo '  dev-docs              - build developer-only documentation'
 	@echo ''
 	@echo 'Cleaning targets:'
 	@echo '  clean                 - clean the Xen, tools and docs (but not guest kernel trees)'
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8B-0000ma-5x; Wed, 15 Oct 2014 17:12:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8A-0000mQ-QM
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:58 +0000
Content-Length: 2002
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	93/8C-10419-A1BAE345; Wed, 15 Oct 2014 17:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1413393176!13131888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7295 invoked from network); 15 Oct 2014 17:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS88-0005qM-IP
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS88-0001n1-H4
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:56 +0000
Date: Wed, 15 Oct 2014 17:12:56 +0000
Message-Id: <E1XeS88-0001n1-H4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: include sys/ioctl.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2354864923574211107=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2354864923574211107==
Content-Length: 1591
Content-Transfer-Encoding: quoted-printable

commit df8589760ec9a86276da241a5c94d341aa1ddfcb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 10 16:34:37 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:27:20 2014 +0100

    libxl: include sys/ioctl.h
    
    This is a requirement for the code in libxl_remus_disk_drbd.c that uses the
    ioctl syscall. Fixes the following error when building on FreeBSD:
    
    libxl_remus_disk_drbd.c: In function 'drbd_postsuspend':
    libxl_remus_disk_drbd.c:197:9: error: implicit declaration of function 'ioctl' [-Werror=3Dimplicit-function-declaration]
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
    Cc: Wen Congyang <wency@cn.fujitsu.com>
    Cc: Yang Hongyang <yanghy@cn.fujitsu.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 83bef59..7ed601e 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -44,6 +44,7 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/file.h>
+#include <sys/ioctl.h>
 
 #include <xenstore.h>
 #include <xenctrl.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2354864923574211107==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============2354864923574211107==--

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:12:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:12:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8B-0000ma-5x; Wed, 15 Oct 2014 17:12:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8A-0000mQ-QM
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:58 +0000
Content-Length: 2002
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	93/8C-10419-A1BAE345; Wed, 15 Oct 2014 17:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1413393176!13131888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7295 invoked from network); 15 Oct 2014 17:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:12:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS88-0005qM-IP
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS88-0001n1-H4
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:12:56 +0000
Date: Wed, 15 Oct 2014 17:12:56 +0000
Message-Id: <E1XeS88-0001n1-H4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: include sys/ioctl.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2354864923574211107=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2354864923574211107==
Content-Length: 1591
Content-Transfer-Encoding: quoted-printable

commit df8589760ec9a86276da241a5c94d341aa1ddfcb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Oct 10 16:34:37 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:27:20 2014 +0100

    libxl: include sys/ioctl.h
    
    This is a requirement for the code in libxl_remus_disk_drbd.c that uses the
    ioctl syscall. Fixes the following error when building on FreeBSD:
    
    libxl_remus_disk_drbd.c: In function 'drbd_postsuspend':
    libxl_remus_disk_drbd.c:197:9: error: implicit declaration of function 'ioctl' [-Werror=3Dimplicit-function-declaration]
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
    Cc: Wen Congyang <wency@cn.fujitsu.com>
    Cc: Yang Hongyang <yanghy@cn.fujitsu.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 83bef59..7ed601e 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -44,6 +44,7 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/file.h>
+#include <sys/ioctl.h>
 
 #include <xenstore.h>
 #include <xenctrl.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============2354864923574211107==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============2354864923574211107==--

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8M-0000oA-8h; Wed, 15 Oct 2014 17:13:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8L-0000o0-GM
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:09 +0000
Received: from [85.158.137.68:23388] by server-2.bemta-3.messagelabs.com id
	66/9D-09149-42BAE345; Wed, 15 Oct 2014 17:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1413393187!10928255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16442 invoked from network); 15 Oct 2014 17:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8I-0005qv-Q0
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8I-0001nl-Nn
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:06 +0000
Date: Wed, 15 Oct 2014 17:13:06 +0000
Message-Id: <E1XeS8I-0001nl-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix configure
	--with-systemd-modules-load=DIR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59286be58a165407a5d3c75e91ee68109e748838
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 17:32:42 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:30:17 2014 +0100

    Fix configure --with-systemd-modules-load=DIR
    
    Currently --with-systemd=DIR1 --with-systemd-modules-load=DIR2 will set
    both XEN_SYSTEMD_DIR and XEN_SYSTEMD_MODULES_LOAD to DIR1. The reason is
    that both AC_ARG_WITH() use 'systemd' as the name for the internal
    variable. As a result the value of the first option is also use as the
    value for the second option. Fix this by using another variable name.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ijc -- ran autogen.sh as requested]
---
 m4/systemd.m4   |    2 +-
 tools/configure |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index 629d202..a832d59 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -24,7 +24,7 @@ AC_DEFUN([AX_SYSTEMD_OPTIONS], [
 		[SYSTEMD_DIR="$withval"],[SYSTEMD_DIR=""])
 	AC_SUBST(SYSTEMD_DIR)
 
-	AC_ARG_WITH(systemd,
+	AC_ARG_WITH(systemd-modules-load,
 		AS_HELP_STRING([--with-systemd-modules-load=DIR],
 		[set directory for systemd modules load files [PREFIX/lib/modules-load.d/]]),
 		[SYSTEMD_MODULES_LOAD="$withval"], [SYSTEMD_MODULES_LOAD=""])
diff --git a/tools/configure b/tools/configure
index e44e754..950b4d4 100755
--- a/tools/configure
+++ b/tools/configure
@@ -802,6 +802,7 @@ with_extra_qemuu_configure_args
 with_xenstored
 enable_systemd
 with_systemd
+with_systemd_modules_load
 '
       ac_precious_vars='build_alias
 host_alias
@@ -8651,9 +8652,9 @@ fi
 
 
 
-# Check whether --with-systemd was given.
-if test "${with_systemd+set}" = set; then :
-  withval=$with_systemd; SYSTEMD_MODULES_LOAD="$withval"
+# Check whether --with-systemd-modules-load was given.
+if test "${with_systemd_modules_load+set}" = set; then :
+  withval=$with_systemd_modules_load; SYSTEMD_MODULES_LOAD="$withval"
 else
   SYSTEMD_MODULES_LOAD=""
 fi
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8M-0000oA-8h; Wed, 15 Oct 2014 17:13:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8L-0000o0-GM
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:09 +0000
Received: from [85.158.137.68:23388] by server-2.bemta-3.messagelabs.com id
	66/9D-09149-42BAE345; Wed, 15 Oct 2014 17:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1413393187!10928255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16442 invoked from network); 15 Oct 2014 17:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8I-0005qv-Q0
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8I-0001nl-Nn
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:06 +0000
Date: Wed, 15 Oct 2014 17:13:06 +0000
Message-Id: <E1XeS8I-0001nl-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix configure
	--with-systemd-modules-load=DIR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59286be58a165407a5d3c75e91ee68109e748838
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 10 17:32:42 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:30:17 2014 +0100

    Fix configure --with-systemd-modules-load=DIR
    
    Currently --with-systemd=DIR1 --with-systemd-modules-load=DIR2 will set
    both XEN_SYSTEMD_DIR and XEN_SYSTEMD_MODULES_LOAD to DIR1. The reason is
    that both AC_ARG_WITH() use 'systemd' as the name for the internal
    variable. As a result the value of the first option is also use as the
    value for the second option. Fix this by using another variable name.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ijc -- ran autogen.sh as requested]
---
 m4/systemd.m4   |    2 +-
 tools/configure |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index 629d202..a832d59 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -24,7 +24,7 @@ AC_DEFUN([AX_SYSTEMD_OPTIONS], [
 		[SYSTEMD_DIR="$withval"],[SYSTEMD_DIR=""])
 	AC_SUBST(SYSTEMD_DIR)
 
-	AC_ARG_WITH(systemd,
+	AC_ARG_WITH(systemd-modules-load,
 		AS_HELP_STRING([--with-systemd-modules-load=DIR],
 		[set directory for systemd modules load files [PREFIX/lib/modules-load.d/]]),
 		[SYSTEMD_MODULES_LOAD="$withval"], [SYSTEMD_MODULES_LOAD=""])
diff --git a/tools/configure b/tools/configure
index e44e754..950b4d4 100755
--- a/tools/configure
+++ b/tools/configure
@@ -802,6 +802,7 @@ with_extra_qemuu_configure_args
 with_xenstored
 enable_systemd
 with_systemd
+with_systemd_modules_load
 '
       ac_precious_vars='build_alias
 host_alias
@@ -8651,9 +8652,9 @@ fi
 
 
 
-# Check whether --with-systemd was given.
-if test "${with_systemd+set}" = set; then :
-  withval=$with_systemd; SYSTEMD_MODULES_LOAD="$withval"
+# Check whether --with-systemd-modules-load was given.
+if test "${with_systemd_modules_load+set}" = set; then :
+  withval=$with_systemd_modules_load; SYSTEMD_MODULES_LOAD="$withval"
 else
   SYSTEMD_MODULES_LOAD=""
 fi
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8W-0000pn-BK; Wed, 15 Oct 2014 17:13:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8V-0000pZ-6r
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:19 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	12/66-02699-E2BAE345; Wed, 15 Oct 2014 17:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1413393197!13104088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10861 invoked from network); 15 Oct 2014 17:13:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8S-0005r1-VU
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8S-0001oh-UA
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:16 +0000
Date: Wed, 15 Oct 2014 17:13:16 +0000
Message-Id: <E1XeS8S-0001oh-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd609429354e99479821fed561d0713fe5386d15
Merge: 59286be58a165407a5d3c75e91ee68109e748838 7d96cc5c4b2670a4220a50746fa17a0e8a4da1c2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 14 10:57:47 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:57:47 2014 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/boot/reloc.c           |   13 ++-
 xen/arch/x86/hvm/vlapic.c           |   38 +++++++-
 xen/drivers/passthrough/vtd/iommu.c |  200 ++++++++++++++++++-----------------
 xen/include/asm-x86/hvm/vlapic.h    |    1 +
 4 files changed, 146 insertions(+), 106 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8W-0000pn-BK; Wed, 15 Oct 2014 17:13:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8V-0000pZ-6r
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:19 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	12/66-02699-E2BAE345; Wed, 15 Oct 2014 17:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1413393197!13104088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10861 invoked from network); 15 Oct 2014 17:13:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8S-0005r1-VU
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8S-0001oh-UA
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:16 +0000
Date: Wed, 15 Oct 2014 17:13:16 +0000
Message-Id: <E1XeS8S-0001oh-UA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd609429354e99479821fed561d0713fe5386d15
Merge: 59286be58a165407a5d3c75e91ee68109e748838 7d96cc5c4b2670a4220a50746fa17a0e8a4da1c2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 14 10:57:47 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 10:57:47 2014 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/boot/reloc.c           |   13 ++-
 xen/arch/x86/hvm/vlapic.c           |   38 +++++++-
 xen/drivers/passthrough/vtd/iommu.c |  200 ++++++++++++++++++-----------------
 xen/include/asm-x86/hvm/vlapic.h    |    1 +
 4 files changed, 146 insertions(+), 106 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8g-0000rb-GI; Wed, 15 Oct 2014 17:13:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8f-0000rK-O9
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:29 +0000
Received: from [85.158.137.68:26697] by server-15.bemta-3.messagelabs.com id
	B6/0E-01573-93BAE345; Wed, 15 Oct 2014 17:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1413393207!10798515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26454 invoked from network); 15 Oct 2014 17:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8d-0005r7-4W
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8d-0001p4-34
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:27 +0000
Date: Wed, 15 Oct 2014 17:13:27 +0000
Message-Id: <E1XeS8d-0001p4-34@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: update MAINTAINERS after moving
	of files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45829021078fbd0149451e17423bb93e43734560
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 14 12:39:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 14 12:39:04 2014 +0200

    EFI: update MAINTAINERS after moving of files
    
    I forgot to request this to be done along with the files being moved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 891c2cb..1be16db 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -157,6 +157,7 @@ EFI
 M:     Jan Beulich <jbeulich@suse.com>
 S:     Supported
 F:     xen/arch/x86/efi/
+F:     xen/common/efi/
 F:     xen/include/efi/
 F:     xen/include/asm-x86/efi*.h
 F:     xen/include/asm-x86/x86_*/efi*.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8g-0000rb-GI; Wed, 15 Oct 2014 17:13:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8f-0000rK-O9
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:29 +0000
Received: from [85.158.137.68:26697] by server-15.bemta-3.messagelabs.com id
	B6/0E-01573-93BAE345; Wed, 15 Oct 2014 17:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1413393207!10798515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26454 invoked from network); 15 Oct 2014 17:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8d-0005r7-4W
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8d-0001p4-34
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:27 +0000
Date: Wed, 15 Oct 2014 17:13:27 +0000
Message-Id: <E1XeS8d-0001p4-34@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: update MAINTAINERS after moving
	of files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45829021078fbd0149451e17423bb93e43734560
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 14 12:39:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 14 12:39:04 2014 +0200

    EFI: update MAINTAINERS after moving of files
    
    I forgot to request this to be done along with the files being moved.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 891c2cb..1be16db 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -157,6 +157,7 @@ EFI
 M:     Jan Beulich <jbeulich@suse.com>
 S:     Supported
 F:     xen/arch/x86/efi/
+F:     xen/common/efi/
 F:     xen/include/efi/
 F:     xen/include/asm-x86/efi*.h
 F:     xen/include/asm-x86/x86_*/efi*.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8q-0000tB-Iz; Wed, 15 Oct 2014 17:13:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8p-0000sy-P0
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:39 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	64/96-02699-34BAE345; Wed, 15 Oct 2014 17:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1413393217!13141377!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29098 invoked from network); 15 Oct 2014 17:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8n-0005rF-CE
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8n-0001pU-AK
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:37 +0000
Date: Wed, 15 Oct 2014 17:13:37 +0000
Message-Id: <E1XeS8n-0001pU-AK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Handle memory banks which
	are not 1GB aligned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d57153b52a36183d58e8de6ba613929f906386a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 10 15:43:14 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 11:59:00 2014 +0100

    xen: arm64: Handle memory banks which are not 1GB aligned
    
    The code in the arm64 version of setup_xenheap_mappings was making
    some very confused attempts to handle this but was bogus.
    
    As well as adjusting the mapping to start on a 1GB boundary we also
    need to account for the offset between the start of the mapping and
    the actual start of the heap when converting between page pointers,
    virtual addresses and machine addresses.
    
    I preferred to do this by explicitly accounting for the offset rather
    than adding an offset to the frametable because that approach could
    potentially waste a large amount of frametable (up to just less than
    1GB worth) but also because of issues with converting mfns from
    outside the regions considered for pdx initialisation (which are not
    1GB aligned) back and forth.
    
    We already have an idea of the distinction between the start of the
    direct map and the start of the xenheap in the difference between
    DIRECTMAP_VIRT_START and XENHEAP_VIRT_START. Until now these were the
    same thing, but now we change XENHEAP_VIRT_START to point to the
    actual start of heap not the mapping. Surprisingly there was only one
    place which was using the conceptually wrong value.
    
    Also change xenheap_virt_end to a vaddr_t for consistency.
    
    We've been lucky so far that most hardware happens to locate memory
    on a 1GB boundary (we did have reports of a system with memory at a
    half gig boundary which exhibited failures which I didn't manage to
    follow up on successfully). The EFI support has exposed this
    shortcoming by the way it handles reserved memory, which has a
    similar effect to having memory non-1GB aligned.
    
    arm32 does things differently here due to using a small Xen heap and
    a demand mapped domain heap, so isn't affected.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
    Cc: Roy Franz <roy.franz@linaro.org>
    Cc: Vijay Kilari <vijay.kilari@gmail.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Roy Franz <roy.franz@linaro.org>
---
 xen/arch/arm/mm.c            |   36 +++++++++++++++++++++++++-----------
 xen/include/asm-arm/config.h |    2 +-
 xen/include/asm-arm/mm.h     |    7 +++++--
 3 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c5b48ef..97e5bc3 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -138,7 +138,10 @@ static paddr_t phys_offset;
 /* Limits of the Xen heap */
 unsigned long xenheap_mfn_start __read_mostly = ~0UL;
 unsigned long xenheap_mfn_end __read_mostly;
-unsigned long xenheap_virt_end __read_mostly;
+vaddr_t xenheap_virt_end __read_mostly;
+#ifdef CONFIG_ARM_64
+vaddr_t xenheap_virt_start __read_mostly;
+#endif
 
 unsigned long frametable_base_pdx __read_mostly;
 unsigned long frametable_virt_end __read_mostly;
@@ -155,7 +158,11 @@ static inline void check_memory_layout_alignment_constraints(void) {
     BUILD_BUG_ON(FIXMAP_ADDR(0) & ~SECOND_MASK);
     BUILD_BUG_ON(BOOT_RELOC_VIRT_START & ~SECOND_MASK);
     /* 1GB aligned regions */
+#ifdef CONFIG_ARM_32
     BUILD_BUG_ON(XENHEAP_VIRT_START & ~FIRST_MASK);
+#else
+    BUILD_BUG_ON(DIRECTMAP_VIRT_START & ~FIRST_MASK);
+#endif
     /* Page table structure constraints */
 #ifdef CONFIG_ARM_64
     BUILD_BUG_ON(zeroeth_table_offset(XEN_VIRT_START));
@@ -665,12 +672,19 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
                                    unsigned long nr_mfns)
 {
     lpae_t *first, pte;
-    unsigned long offset, end_mfn;
+    unsigned long mfn, end_mfn;
     vaddr_t vaddr;
 
-    /* First call sets the xenheap physical offset. */
+    /* Align to previous 1GB boundary */
+    mfn = base_mfn & ~((FIRST_SIZE>>PAGE_SHIFT)-1);
+
+    /* First call sets the xenheap physical and virtual offset. */
     if ( xenheap_mfn_start == ~0UL )
+    {
         xenheap_mfn_start = base_mfn;
+        xenheap_virt_start = DIRECTMAP_VIRT_START +
+            (base_mfn - mfn) * PAGE_SIZE;
+    }
 
     if ( base_mfn < xenheap_mfn_start )
         panic("cannot add xenheap mapping at %lx below heap start %lx",
@@ -678,13 +692,13 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
 
     end_mfn = base_mfn + nr_mfns;
 
-    /* Align to previous 1GB boundary */
-    base_mfn &= ~((FIRST_SIZE>>PAGE_SHIFT)-1);
-
-    offset = pfn_to_pdx(base_mfn - xenheap_mfn_start);
-    vaddr = DIRECTMAP_VIRT_START + offset*PAGE_SIZE;
+    /*
+     * Virtual address aligned to previous 1GB to match physical
+     * address alignment done above.
+     */
+    vaddr = (vaddr_t)mfn_to_virt(base_mfn) & FIRST_MASK;
 
-    while ( base_mfn < end_mfn )
+    while ( mfn < end_mfn )
     {
         int slot = zeroeth_table_offset(vaddr);
         lpae_t *p = &xen_pgtable[slot];
@@ -716,11 +730,11 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
             first = mfn_to_virt(first_mfn);
         }
 
-        pte = mfn_to_xen_entry(base_mfn, WRITEALLOC);
+        pte = mfn_to_xen_entry(mfn, WRITEALLOC);
         /* TODO: Set pte.pt.contig when appropriate. */
         write_pte(&first[first_table_offset(vaddr)], pte);
 
-        base_mfn += FIRST_SIZE>>PAGE_SHIFT;
+        mfn += FIRST_SIZE>>PAGE_SHIFT;
         vaddr += FIRST_SIZE;
     }
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 59b2887..264e2c1 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -162,7 +162,7 @@
 #define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (265-256))
 #define DIRECTMAP_VIRT_END     (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE - 1)
 
-#define XENHEAP_VIRT_START     DIRECTMAP_VIRT_START
+#define XENHEAP_VIRT_START     xenheap_virt_start
 
 #define HYPERVISOR_VIRT_END    DIRECTMAP_VIRT_END
 
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 1e4711c..d25e485 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -110,7 +110,10 @@ struct page_info
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
 extern unsigned long xenheap_mfn_start, xenheap_mfn_end;
-extern unsigned long xenheap_virt_end;
+extern vaddr_t xenheap_virt_end;
+#ifdef CONFIG_ARM_64
+extern vaddr_t xenheap_virt_start;
+#endif
 
 #ifdef CONFIG_ARM_32
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
@@ -227,7 +230,7 @@ static inline void *maddr_to_virt(paddr_t ma)
 static inline void *maddr_to_virt(paddr_t ma)
 {
     ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >> PAGE_SHIFT));
-    return (void *)(DIRECTMAP_VIRT_START -
+    return (void *)(XENHEAP_VIRT_START -
                     pfn_to_paddr(xenheap_mfn_start) +
                     ((ma & ma_va_bottom_mask) |
                      ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 15 17:13:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Oct 2014 17:13:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XeS8q-0000tB-Iz; Wed, 15 Oct 2014 17:13:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8p-0000sy-P0
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:39 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	64/96-02699-34BAE345; Wed, 15 Oct 2014 17:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1413393217!13141377!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29098 invoked from network); 15 Oct 2014 17:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Oct 2014 17:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8n-0005rF-CE
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XeS8n-0001pU-AK
	for xen-changelog@lists.xensource.com; Wed, 15 Oct 2014 17:13:37 +0000
Date: Wed, 15 Oct 2014 17:13:37 +0000
Message-Id: <E1XeS8n-0001pU-AK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Handle memory banks which
	are not 1GB aligned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d57153b52a36183d58e8de6ba613929f906386a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 10 15:43:14 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 14 11:59:00 2014 +0100

    xen: arm64: Handle memory banks which are not 1GB aligned
    
    The code in the arm64 version of setup_xenheap_mappings was making
    some very confused attempts to handle this but was bogus.
    
    As well as adjusting the mapping to start on a 1GB boundary we also
    need to account for the offset between the start of the mapping and
    the actual start of the heap when converting between page pointers,
    virtual addresses and machine addresses.
    
    I preferred to do this by explicitly accounting for the offset rather
    than adding an offset to the frametable because that approach could
    potentially waste a large amount of frametable (up to just less than
    1GB worth) but also because of issues with converting mfns from
    outside the regions considered for pdx initialisation (which are not
    1GB aligned) back and forth.
    
    We already have an idea of the distinction between the start of the
    direct map and the start of the xenheap in the difference between
    DIRECTMAP_VIRT_START and XENHEAP_VIRT_START. Until now these were the
    same thing, but now we change XENHEAP_VIRT_START to point to the
    actual start of heap not the mapping. Surprisingly there was only one
    place which was using the conceptually wrong value.
    
    Also change xenheap_virt_end to a vaddr_t for consistency.
    
    We've been lucky so far that most hardware happens to locate memory
    on a 1GB boundary (we did have reports of a system with memory at a
    half gig boundary which exhibited failures which I didn't manage to
    follow up on successfully). The EFI support has exposed this
    shortcoming by the way it handles reserved memory, which has a
    similar effect to having memory non-1GB aligned.
    
    arm32 does things differently here due to using a small Xen heap and
    a demand mapped domain heap, so isn't affected.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
    Cc: Roy Franz <roy.franz@linaro.org>
    Cc: Vijay Kilari <vijay.kilari@gmail.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Roy Franz <roy.franz@linaro.org>
---
 xen/arch/arm/mm.c            |   36 +++++++++++++++++++++++++-----------
 xen/include/asm-arm/config.h |    2 +-
 xen/include/asm-arm/mm.h     |    7 +++++--
 3 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c5b48ef..97e5bc3 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -138,7 +138,10 @@ static paddr_t phys_offset;
 /* Limits of the Xen heap */
 unsigned long xenheap_mfn_start __read_mostly = ~0UL;
 unsigned long xenheap_mfn_end __read_mostly;
-unsigned long xenheap_virt_end __read_mostly;
+vaddr_t xenheap_virt_end __read_mostly;
+#ifdef CONFIG_ARM_64
+vaddr_t xenheap_virt_start __read_mostly;
+#endif
 
 unsigned long frametable_base_pdx __read_mostly;
 unsigned long frametable_virt_end __read_mostly;
@@ -155,7 +158,11 @@ static inline void check_memory_layout_alignment_constraints(void) {
     BUILD_BUG_ON(FIXMAP_ADDR(0) & ~SECOND_MASK);
     BUILD_BUG_ON(BOOT_RELOC_VIRT_START & ~SECOND_MASK);
     /* 1GB aligned regions */
+#ifdef CONFIG_ARM_32
     BUILD_BUG_ON(XENHEAP_VIRT_START & ~FIRST_MASK);
+#else
+    BUILD_BUG_ON(DIRECTMAP_VIRT_START & ~FIRST_MASK);
+#endif
     /* Page table structure constraints */
 #ifdef CONFIG_ARM_64
     BUILD_BUG_ON(zeroeth_table_offset(XEN_VIRT_START));
@@ -665,12 +672,19 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
                                    unsigned long nr_mfns)
 {
     lpae_t *first, pte;
-    unsigned long offset, end_mfn;
+    unsigned long mfn, end_mfn;
     vaddr_t vaddr;
 
-    /* First call sets the xenheap physical offset. */
+    /* Align to previous 1GB boundary */
+    mfn = base_mfn & ~((FIRST_SIZE>>PAGE_SHIFT)-1);
+
+    /* First call sets the xenheap physical and virtual offset. */
     if ( xenheap_mfn_start == ~0UL )
+    {
         xenheap_mfn_start = base_mfn;
+        xenheap_virt_start = DIRECTMAP_VIRT_START +
+            (base_mfn - mfn) * PAGE_SIZE;
+    }
 
     if ( base_mfn < xenheap_mfn_start )
         panic("cannot add xenheap mapping at %lx below heap start %lx",
@@ -678,13 +692,13 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
 
     end_mfn = base_mfn + nr_mfns;
 
-    /* Align to previous 1GB boundary */
-    base_mfn &= ~((FIRST_SIZE>>PAGE_SHIFT)-1);
-
-    offset = pfn_to_pdx(base_mfn - xenheap_mfn_start);
-    vaddr = DIRECTMAP_VIRT_START + offset*PAGE_SIZE;
+    /*
+     * Virtual address aligned to previous 1GB to match physical
+     * address alignment done above.
+     */
+    vaddr = (vaddr_t)mfn_to_virt(base_mfn) & FIRST_MASK;
 
-    while ( base_mfn < end_mfn )
+    while ( mfn < end_mfn )
     {
         int slot = zeroeth_table_offset(vaddr);
         lpae_t *p = &xen_pgtable[slot];
@@ -716,11 +730,11 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
             first = mfn_to_virt(first_mfn);
         }
 
-        pte = mfn_to_xen_entry(base_mfn, WRITEALLOC);
+        pte = mfn_to_xen_entry(mfn, WRITEALLOC);
         /* TODO: Set pte.pt.contig when appropriate. */
         write_pte(&first[first_table_offset(vaddr)], pte);
 
-        base_mfn += FIRST_SIZE>>PAGE_SHIFT;
+        mfn += FIRST_SIZE>>PAGE_SHIFT;
         vaddr += FIRST_SIZE;
     }
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 59b2887..264e2c1 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -162,7 +162,7 @@
 #define DIRECTMAP_SIZE         (SLOT0_ENTRY_SIZE * (265-256))
 #define DIRECTMAP_VIRT_END     (DIRECTMAP_VIRT_START + DIRECTMAP_SIZE - 1)
 
-#define XENHEAP_VIRT_START     DIRECTMAP_VIRT_START
+#define XENHEAP_VIRT_START     xenheap_virt_start
 
 #define HYPERVISOR_VIRT_END    DIRECTMAP_VIRT_END
 
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 1e4711c..d25e485 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -110,7 +110,10 @@ struct page_info
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
 extern unsigned long xenheap_mfn_start, xenheap_mfn_end;
-extern unsigned long xenheap_virt_end;
+extern vaddr_t xenheap_virt_end;
+#ifdef CONFIG_ARM_64
+extern vaddr_t xenheap_virt_start;
+#endif
 
 #ifdef CONFIG_ARM_32
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
@@ -227,7 +230,7 @@ static inline void *maddr_to_virt(paddr_t ma)
 static inline void *maddr_to_virt(paddr_t ma)
 {
     ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >> PAGE_SHIFT));
-    return (void *)(DIRECTMAP_VIRT_START -
+    return (void *)(XENHEAP_VIRT_START -
                     pfn_to_paddr(xenheap_mfn_start) +
                     ((ma & ma_va_bottom_mask) |
                      ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 17 12:44:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2014 12:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xf6t6-0000ty-F3; Fri, 17 Oct 2014 12:44:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6t4-0000tg-Qb
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:07 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	5D/E2-02699-61F01445; Fri, 17 Oct 2014 12:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1413549843!13643263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11222 invoked from network); 17 Oct 2014 12:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2014 12:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6t1-0000Ew-Cd
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6t1-0001sz-8n
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:03 +0000
Date: Fri, 17 Oct 2014 12:44:03 +0000
Message-Id: <E1Xf6t1-0001sz-8n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: CMDs and APIs for Cache
	Monitoring Technology
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 747187995dd8cb28dcac1db8851d60e54f85f8e4
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Thu Oct 9 12:02:04 2014 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 15 08:34:46 2014 +0100

    tools: CMDs and APIs for Cache Monitoring Technology
    
    Introduced some new xl commands to enable/disable Cache Monitoring
    Technology(CMT) feature.
    
    The following two commands is to attach/detach the CMT feature
    to/from a certain domain.
    
    $ xl psr-cmt-attach domid
    $ xl psr-cmt-detach domid
    
    This command is to display the CMT information, such as L3 cache
    occupancy.
    
    $ xl psr-cmt-show cache_occupancy <domid>
    
    Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.pod.1             |   25 +++++
 tools/libxc/Makefile          |    1 +
 tools/libxc/include/xenctrl.h |   19 ++++
 tools/libxc/xc_msr_x86.h      |   36 +++++++
 tools/libxc/xc_psr.c          |  215 ++++++++++++++++++++++++++++++++++++++++
 tools/libxl/Makefile          |    2 +-
 tools/libxl/libxl.h           |   21 ++++
 tools/libxl/libxl_psr.c       |  217 +++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_types.idl   |    4 +
 tools/libxl/xl.h              |    5 +
 tools/libxl/xl_cmdimpl.c      |  160 ++++++++++++++++++++++++++++++
 tools/libxl/xl_cmdtable.c     |   19 ++++
 12 files changed, 723 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 362e92f..925cd7d 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1440,6 +1440,31 @@ Load FLASK policy from the given policy file. The initial policy is provided to
 the hypervisor as a multiboot module; this command allows runtime updates to the
 policy. Loading new security policy will reset runtime changes to device labels.
 
+=head1 Cache Monitoring Technology
+
+Intel Haswell and later server platforms offer monitoring capability in each
+logical processor to measure specific platform shared resource metric, for
+example, L3 cache occupancy. In Xen implementation, the monitoring granularity
+is domain level. To monitor a specific domain, just attach the domain id with
+the monitoring service. When the domain doesn't need to be monitored any more,
+detach the domain id from the monitoring service.
+
+=over 4
+
+=item B<psr-cmt-attach> [I<domain-id>]
+
+attach: Attach the platform shared resource monitoring service to a domain.
+
+=item B<psr-cmt-detach> [I<domain-id>]
+
+detach: Detach the platform shared resource monitoring service from a domain.
+
+=item B<psr-cmt-show> [I<psr-monitor-type>] [I<domain-id>]
+
+Show monitoring data for a certain domain or all domains. Current supported
+monitor types are:
+ - "cache-occupancy": showing the L3 cache occupancy.
+
 =back
 
 =head1 TO BE DOCUMENTED
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 0851273..bd2ca6c 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -36,6 +36,7 @@ CTRL_SRCS-y       += xc_kexec.c
 CTRL_SRCS-y       += xtl_core.c
 CTRL_SRCS-y       += xtl_logger_stdio.c
 CTRL_SRCS-y       += xc_resource.c
+CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
 CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index b73b157..564e187 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2679,6 +2679,25 @@ struct xc_resource_op {
 typedef struct xc_resource_op xc_resource_op_t;
 int xc_resource_op(xc_interface *xch, uint32_t nr_ops, xc_resource_op_t *ops);
 
+#if defined(__i386__) || defined(__x86_64__)
+enum xc_psr_cmt_type {
+    XC_PSR_CMT_L3_OCCUPANCY,
+};
+typedef enum xc_psr_cmt_type xc_psr_cmt_type;
+int xc_psr_cmt_attach(xc_interface *xch, uint32_t domid);
+int xc_psr_cmt_detach(xc_interface *xch, uint32_t domid);
+int xc_psr_cmt_get_domain_rmid(xc_interface *xch, uint32_t domid,
+    uint32_t *rmid);
+int xc_psr_cmt_get_total_rmid(xc_interface *xch, uint32_t *total_rmid);
+int xc_psr_cmt_get_l3_upscaling_factor(xc_interface *xch,
+    uint32_t *upscaling_factor);
+int xc_psr_cmt_get_l3_cache_size(xc_interface *xch, uint32_t cpu,
+    uint32_t *l3_cache_size);
+int xc_psr_cmt_get_data(xc_interface *xch, uint32_t rmid,
+    uint32_t cpu, uint32_t psr_cmt_type, uint64_t *monitor_data);
+int xc_psr_cmt_enabled(xc_interface *xch);
+#endif
+
 #endif /* XENCTRL_H */
 
 /*
diff --git a/tools/libxc/xc_msr_x86.h b/tools/libxc/xc_msr_x86.h
new file mode 100644
index 0000000..7c3e1a3
--- /dev/null
+++ b/tools/libxc/xc_msr_x86.h
@@ -0,0 +1,36 @@
+/*
+ * xc_msr_x86.h
+ *
+ * MSR definition macros
+ *
+ * Copyright (C) 2014      Intel Corporation
+ * Author Dongxiao Xu <dongxiao.xu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef XC_MSR_X86_H
+#define XC_MSR_X86_H
+
+#define MSR_IA32_CMT_EVTSEL     0x00000c8d
+#define MSR_IA32_CMT_CTR        0x00000c8e
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxc/xc_psr.c b/tools/libxc/xc_psr.c
new file mode 100644
index 0000000..872e6dc
--- /dev/null
+++ b/tools/libxc/xc_psr.c
@@ -0,0 +1,215 @@
+/*
+ * xc_psr.c
+ *
+ * platform shared resource related API functions.
+ *
+ * Copyright (C) 2014      Intel Corporation
+ * Author Dongxiao Xu <dongxiao.xu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "xc_private.h"
+#include "xc_msr_x86.h"
+
+#define IA32_CMT_CTR_ERROR_MASK         (0x3ull << 62)
+
+#define EVTID_L3_OCCUPANCY             0x1
+
+int xc_psr_cmt_attach(xc_interface *xch, uint32_t domid)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_psr_cmt_op;
+    domctl.domain = (domid_t)domid;
+    domctl.u.psr_cmt_op.cmd = XEN_DOMCTL_PSR_CMT_OP_ATTACH;
+
+    return do_domctl(xch, &domctl);
+}
+
+int xc_psr_cmt_detach(xc_interface *xch, uint32_t domid)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_psr_cmt_op;
+    domctl.domain = (domid_t)domid;
+    domctl.u.psr_cmt_op.cmd = XEN_DOMCTL_PSR_CMT_OP_DETACH;
+
+    return do_domctl(xch, &domctl);
+}
+
+int xc_psr_cmt_get_domain_rmid(xc_interface *xch, uint32_t domid,
+                                    uint32_t *rmid)
+{
+    int rc;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_psr_cmt_op;
+    domctl.domain = (domid_t)domid;
+    domctl.u.psr_cmt_op.cmd = XEN_DOMCTL_PSR_CMT_OP_QUERY_RMID;
+
+    rc = do_domctl(xch, &domctl);
+
+    if ( !rc )
+        *rmid = domctl.u.psr_cmt_op.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_total_rmid(xc_interface *xch, uint32_t *total_rmid)
+{
+    static int val = 0;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val )
+    {
+        *total_rmid = val;
+        return 0;
+    }
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd = XEN_SYSCTL_PSR_CMT_get_total_rmid;
+    sysctl.u.psr_cmt_op.flags = 0;
+
+    rc = xc_sysctl(xch, &sysctl);
+    if ( !rc )
+        val = *total_rmid = sysctl.u.psr_cmt_op.u.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_l3_upscaling_factor(xc_interface *xch,
+                                            uint32_t *upscaling_factor)
+{
+    static int val = 0;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val )
+    {
+        *upscaling_factor = val;
+        return 0;
+    }
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd =
+        XEN_SYSCTL_PSR_CMT_get_l3_upscaling_factor;
+    sysctl.u.psr_cmt_op.flags = 0;
+
+    rc = xc_sysctl(xch, &sysctl);
+    if ( !rc )
+        val = *upscaling_factor = sysctl.u.psr_cmt_op.u.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_l3_cache_size(xc_interface *xch, uint32_t cpu,
+                                      uint32_t *l3_cache_size)
+{
+    static int val = 0;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val )
+    {
+        *l3_cache_size = val;
+        return 0;
+    }
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd =
+        XEN_SYSCTL_PSR_CMT_get_l3_cache_size;
+    sysctl.u.psr_cmt_op.flags = 0;
+    sysctl.u.psr_cmt_op.u.l3_cache.cpu = cpu;
+
+    rc = xc_sysctl(xch, &sysctl);
+    if ( !rc )
+        val = *l3_cache_size= sysctl.u.psr_cmt_op.u.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_data(xc_interface *xch, uint32_t rmid,
+    uint32_t cpu, xc_psr_cmt_type type, uint64_t *monitor_data)
+{
+    xc_resource_op_t op;
+    xc_resource_entry_t entries[2];
+    uint32_t evtid;
+    int rc;
+
+    switch ( type )
+    {
+    case XC_PSR_CMT_L3_OCCUPANCY:
+        evtid = EVTID_L3_OCCUPANCY;
+        break;
+    default:
+        return -1;
+    }
+
+    entries[0].u.cmd = XEN_RESOURCE_OP_MSR_WRITE;
+    entries[0].idx = MSR_IA32_CMT_EVTSEL;
+    entries[0].val = (uint64_t)rmid << 32 | evtid;
+    entries[0].rsvd = 0;
+
+    entries[1].u.cmd = XEN_RESOURCE_OP_MSR_READ;
+    entries[1].idx = MSR_IA32_CMT_CTR;
+    entries[1].val = 0;
+    entries[1].rsvd = 0;
+
+    op.cpu = cpu;
+    op.nr_entries = 2;
+    op.entries = entries;
+
+    rc = xc_resource_op(xch, 1, &op);
+    if ( rc < 0 )
+        return rc;
+
+    if ( op.result !=2 || entries[1].val & IA32_CMT_CTR_ERROR_MASK )
+        return -1;
+
+    *monitor_data = entries[1].val;
+
+    return 0;
+}
+
+int xc_psr_cmt_enabled(xc_interface *xch)
+{
+    static int val = -1;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val >= 0 )
+        return val;
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd = XEN_SYSCTL_PSR_CMT_enabled;
+    sysctl.u.psr_cmt_op.flags = 0;
+
+    rc = do_sysctl(xch, &sysctl);
+    if ( !rc )
+    {
+        val = sysctl.u.psr_cmt_op.u.data;
+        return val;
+    }
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 0bf666f..df08c8a 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -58,7 +58,7 @@ endif
 
 LIBXL_OBJS-y += libxl_remus_device.o libxl_remus_disk_drbd.o
 
-LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o
+LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o libxl_psr.o
 LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o libxl_arm.o
 
 ifeq ($(CONFIG_NetBSD),y)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 2700cc1..3568e1e 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -659,6 +659,15 @@ typedef uint8_t libxl_mac[6];
 #define LIBXL_MAC_BYTES(mac) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
 void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
 
+#if defined(__i386__) || defined(__x86_64__)
+/*
+ * LIBXL_HAVE_PSR_CMT
+ *
+ * If this is defined, the Cache Monitoring Technology feature is supported.
+ */
+#define LIBXL_HAVE_PSR_CMT 1
+#endif
+
 typedef char **libxl_string_list;
 void libxl_string_list_dispose(libxl_string_list *sl);
 int libxl_string_list_length(const libxl_string_list *sl);
@@ -1400,6 +1409,18 @@ bool libxl_ms_vm_genid_is_zero(const libxl_ms_vm_genid *id);
 void libxl_ms_vm_genid_copy(libxl_ctx *ctx, libxl_ms_vm_genid *dst,
                             libxl_ms_vm_genid *src);
 
+#ifdef LIBXL_HAVE_PSR_CMT
+int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_enabled(libxl_ctx *ctx);
+int libxl_psr_cmt_get_total_rmid(libxl_ctx *ctx, uint32_t *total_rmid);
+int libxl_psr_cmt_get_l3_cache_size(libxl_ctx *ctx, uint32_t socketid,
+    uint32_t *l3_cache_size);
+int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx, uint32_t domid,
+    uint32_t socketid, uint32_t *l3_cache_occupancy);
+#endif
+
 /* misc */
 
 /* Each of these sets or clears the flag according to whether the
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
new file mode 100644
index 0000000..0437465
--- /dev/null
+++ b/tools/libxl/libxl_psr.c
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2014      Intel Corporation
+ * Author Dongxiao Xu <dongxiao.xu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_osdeps.h" /* must come before any other headers */
+#include "libxl_internal.h"
+
+
+#define IA32_QM_CTR_ERROR_MASK         (0x3ul << 62)
+
+static void libxl__psr_cmt_log_err_msg(libxl__gc *gc, int err)
+{
+    char *msg;
+
+    switch (err) {
+    case ENOSYS:
+        msg = "unsupported operation";
+        break;
+    case ENODEV:
+        msg = "CMT is not supported in this system";
+        break;
+    case EEXIST:
+        msg = "CMT is already attached to this domain";
+        break;
+    case ENOENT:
+        msg = "CMT is not attached to this domain";
+        break;
+    case EUSERS:
+        msg = "no free RMID available";
+        break;
+    case ESRCH:
+        msg = "invalid domain ID";
+        break;
+    case EFAULT:
+        msg = "failed to exchange data with Xen";
+        break;
+    default:
+        msg = "unknown error";
+        break;
+    }
+
+    LOGE(ERROR, "%s", msg);
+}
+
+static int libxl__pick_socket_cpu(libxl__gc *gc, uint32_t socketid)
+{
+    int i, nr_cpus;
+    libxl_cputopology *topology;
+    int cpu = ERROR_FAIL;
+
+    topology = libxl_get_cpu_topology(CTX, &nr_cpus);
+    if (!topology)
+        return ERROR_FAIL;
+
+    for (i = 0; i < nr_cpus; i++)
+        if (topology[i].socket == socketid) {
+            cpu = i;
+            break;
+        }
+
+    libxl_cputopology_list_free(topology, nr_cpus);
+    return cpu;
+}
+
+int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid)
+{
+    GC_INIT(ctx);
+    int rc;
+
+    rc = xc_psr_cmt_attach(ctx->xch, domid);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid)
+{
+    GC_INIT(ctx);
+    int rc;
+
+    rc = xc_psr_cmt_detach(ctx->xch, domid);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid)
+{
+    int rc;
+    uint32_t rmid;
+
+    rc = xc_psr_cmt_get_domain_rmid(ctx->xch, domid, &rmid);
+    if (rc < 0)
+        return 0;
+
+    return !!rmid;
+}
+
+int libxl_psr_cmt_enabled(libxl_ctx *ctx)
+{
+    return xc_psr_cmt_enabled(ctx->xch);
+}
+
+int libxl_psr_cmt_get_total_rmid(libxl_ctx *ctx, uint32_t *total_rmid)
+{
+    GC_INIT(ctx);
+    int rc;
+
+    rc = xc_psr_cmt_get_total_rmid(ctx->xch, total_rmid);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_get_l3_cache_size(libxl_ctx *ctx, uint32_t socketid,
+                                         uint32_t *l3_cache_size)
+{
+    GC_INIT(ctx);
+
+    int rc;
+    int cpu = libxl__pick_socket_cpu(gc, socketid);
+
+    if (cpu < 0) {
+        LOGE(ERROR, "failed to get socket cpu");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = xc_psr_cmt_get_l3_cache_size(ctx->xch, cpu, l3_cache_size);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+out:
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx, uint32_t domid,
+    uint32_t socketid, uint32_t *l3_cache_occupancy)
+{
+    GC_INIT(ctx);
+
+    unsigned int rmid;
+    uint32_t upscaling_factor;
+    uint64_t monitor_data;
+    int cpu, rc;
+    xc_psr_cmt_type type;
+
+    rc = xc_psr_cmt_get_domain_rmid(ctx->xch, domid, &rmid);
+    if (rc < 0 || rmid == 0) {
+        LOGE(ERROR, "fail to get the domain rmid, "
+            "or domain is not attached with platform QoS monitoring service");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    cpu = libxl__pick_socket_cpu(gc, socketid);
+    if (cpu < 0) {
+        LOGE(ERROR, "failed to get socket cpu");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    type = XC_PSR_CMT_L3_OCCUPANCY;
+    rc = xc_psr_cmt_get_data(ctx->xch, rmid, cpu, type, &monitor_data);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get monitoring data");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = xc_psr_cmt_get_l3_upscaling_factor(ctx->xch, &upscaling_factor);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get L3 upscaling factor");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    *l3_cache_occupancy = upscaling_factor * monitor_data / 1024;
+    rc = 0;
+out:
+    GC_FREE;
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index bbb03e2..df572c7 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -652,3 +652,7 @@ libxl_event = Struct("event",[
                                  ])),
            ("domain_create_console_available", None),
            ]))])
+
+libxl_psr_cmt_type = Enumeration("psr_cmt_type", [
+    (1, "CACHE_OCCUPANCY"),
+    ])
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 6c7aa8e..378245d 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -111,6 +111,11 @@ int main_loadpolicy(int argc, char **argv);
 int main_remus(int argc, char **argv);
 #endif
 int main_devd(int argc, char **argv);
+#ifdef LIBXL_HAVE_PSR_CMT
+int main_psr_cmt_attach(int argc, char **argv);
+int main_psr_cmt_detach(int argc, char **argv);
+int main_psr_cmt_show(int argc, char **argv);
+#endif
 
 void help(const char *command);
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c734f79..988ee28 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7626,6 +7626,166 @@ out:
     return ret;
 }
 
+#ifdef LIBXL_HAVE_PSR_CMT
+static void psr_cmt_print_domain_cache_occupancy(libxl_dominfo *dominfo,
+                                                    uint32_t nr_sockets)
+{
+    char *domain_name;
+    uint32_t socketid;
+    uint32_t l3_cache_occupancy;
+
+    if (!libxl_psr_cmt_domain_attached(ctx, dominfo->domid))
+        return;
+
+    domain_name = libxl_domid_to_name(ctx, dominfo->domid);
+    printf("%-40s %5d", domain_name, dominfo->domid);
+    free(domain_name);
+
+    for (socketid = 0; socketid < nr_sockets; socketid++) {
+        if ( !libxl_psr_cmt_get_cache_occupancy(ctx, dominfo->domid,
+                 socketid, &l3_cache_occupancy) )
+            printf("%13u KB", l3_cache_occupancy);
+    }
+
+    printf("\n");
+}
+
+static int psr_cmt_show_cache_occupancy(uint32_t domid)
+{
+    uint32_t i, socketid, nr_sockets, total_rmid;
+    uint32_t l3_cache_size;
+    libxl_physinfo info;
+    int rc, nr_domains;
+
+    if (!libxl_psr_cmt_enabled(ctx)) {
+        fprintf(stderr, "CMT is disabled in the system\n");
+        return -1;
+    }
+
+    libxl_physinfo_init(&info);
+    rc = libxl_get_physinfo(ctx, &info);
+    if (rc < 0) {
+        fprintf(stderr, "Failed getting physinfo, rc: %d\n", rc);
+        libxl_physinfo_dispose(&info);
+        return -1;
+    }
+    nr_sockets = info.nr_cpus / info.threads_per_core / info.cores_per_socket;
+    libxl_physinfo_dispose(&info);
+
+    rc = libxl_psr_cmt_get_total_rmid(ctx, &total_rmid);
+    if (rc < 0) {
+        fprintf(stderr, "Failed to get max RMID value\n");
+        return -1;
+    }
+
+    printf("Total RMID: %d\n", total_rmid);
+
+    /* Header */
+    printf("%-40s %5s", "Name", "ID");
+    for (socketid = 0; socketid < nr_sockets; socketid++)
+        printf("%14s %d", "Socket", socketid);
+    printf("\n");
+
+    /* Total L3 cache size */
+    printf("%-46s", "Total L3 Cache Size");
+    for (socketid = 0; socketid < nr_sockets; socketid++) {
+        rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+        if (rc < 0) {
+            fprintf(stderr, "Failed to get system l3 cache size for socket:%d\n",
+                            socketid);
+            return -1;
+        }
+        printf("%13u KB", l3_cache_size);
+    }
+    printf("\n");
+
+    /* Each domain */
+    if (domid != INVALID_DOMID) {
+        libxl_dominfo dominfo;
+        if (!libxl_domain_info(ctx, &dominfo, domid)) {
+            fprintf(stderr, "Failed to get domain info for %d\n", domid);
+            return -1;
+        }
+        psr_cmt_print_domain_cache_occupancy(&dominfo, nr_sockets);
+    }
+    else
+    {
+        libxl_dominfo *list;
+        if (!(list = libxl_list_domain(ctx, &nr_domains))) {
+            fprintf(stderr, "Failed to get domain info for domain list.\n");
+            return -1;
+        }
+        for (i = 0; i < nr_domains; i++)
+            psr_cmt_print_domain_cache_occupancy(list + i, nr_sockets);
+        libxl_dominfo_list_free(list, nr_domains);
+    }
+    return 0;
+}
+
+int main_psr_cmt_attach(int argc, char **argv)
+{
+    uint32_t domid;
+    int opt, ret = 0;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "psr-cmt-attach", 1) {
+        /* No options */
+    }
+
+    domid = find_domain(argv[optind]);
+    ret = libxl_psr_cmt_attach(ctx, domid);
+
+    return ret;
+}
+
+int main_psr_cmt_detach(int argc, char **argv)
+{
+    uint32_t domid;
+    int opt, ret = 0;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "psr-cmt-detach", 1) {
+        /* No options */
+    }
+
+    domid = find_domain(argv[optind]);
+    ret = libxl_psr_cmt_detach(ctx, domid);
+
+    return ret;
+}
+
+int main_psr_cmt_show(int argc, char **argv)
+{
+    int opt, ret = 0;
+    uint32_t domid;
+    libxl_psr_cmt_type type;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "psr-cmt-show", 1) {
+        /* No options */
+    }
+
+    libxl_psr_cmt_type_from_string(argv[optind], &type);
+
+    if (optind + 1 >= argc)
+        domid = INVALID_DOMID;
+    else if (optind + 1 == argc - 1)
+        domid = find_domain(argv[optind + 1]);
+    else {
+        help("psr-cmt-show");
+        return 2;
+    }
+
+    switch (type) {
+    case LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY:
+        ret = psr_cmt_show_cache_occupancy(domid);
+        break;
+    default:
+        help("psr-cmt-show");
+        return 2;
+    }
+
+    return ret;
+}
+#endif
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index f93ee4f..8ed8f45 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -517,6 +517,25 @@ struct cmd_spec cmd_table[] = {
       "[options]",
       "-F                      Run in the foreground",
     },
+#ifdef LIBXL_HAVE_PSR_CMT
+    { "psr-cmt-attach",
+      &main_psr_cmt_attach, 0, 1,
+      "Attach Cache Monitoring Technology service to a domain",
+      "<Domain>",
+    },
+    { "psr-cmt-detach",
+      &main_psr_cmt_detach, 0, 1,
+      "Detach Cache Monitoring Technology service from a domain",
+      "<Domain>",
+    },
+    { "psr-cmt-show",
+      &main_psr_cmt_show, 0, 1,
+      "Show Cache Monitoring Technology information",
+      "<PSR-CMT-Type> <Domain>",
+      "Available monitor types:\n"
+      "\"cache_occupancy\":         Show L3 cache occupancy\n",
+    },
+#endif
 };
 
 int cmdtable_len = sizeof(cmd_table)/sizeof(struct cmd_spec);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 17 12:44:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2014 12:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xf6t6-0000ty-F3; Fri, 17 Oct 2014 12:44:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6t4-0000tg-Qb
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:07 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	5D/E2-02699-61F01445; Fri, 17 Oct 2014 12:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1413549843!13643263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11222 invoked from network); 17 Oct 2014 12:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2014 12:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6t1-0000Ew-Cd
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6t1-0001sz-8n
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:03 +0000
Date: Fri, 17 Oct 2014 12:44:03 +0000
Message-Id: <E1Xf6t1-0001sz-8n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: CMDs and APIs for Cache
	Monitoring Technology
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 747187995dd8cb28dcac1db8851d60e54f85f8e4
Author:     Chao Peng <chao.p.peng@linux.intel.com>
AuthorDate: Thu Oct 9 12:02:04 2014 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 15 08:34:46 2014 +0100

    tools: CMDs and APIs for Cache Monitoring Technology
    
    Introduced some new xl commands to enable/disable Cache Monitoring
    Technology(CMT) feature.
    
    The following two commands is to attach/detach the CMT feature
    to/from a certain domain.
    
    $ xl psr-cmt-attach domid
    $ xl psr-cmt-detach domid
    
    This command is to display the CMT information, such as L3 cache
    occupancy.
    
    $ xl psr-cmt-show cache_occupancy <domid>
    
    Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
    Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.pod.1             |   25 +++++
 tools/libxc/Makefile          |    1 +
 tools/libxc/include/xenctrl.h |   19 ++++
 tools/libxc/xc_msr_x86.h      |   36 +++++++
 tools/libxc/xc_psr.c          |  215 ++++++++++++++++++++++++++++++++++++++++
 tools/libxl/Makefile          |    2 +-
 tools/libxl/libxl.h           |   21 ++++
 tools/libxl/libxl_psr.c       |  217 +++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_types.idl   |    4 +
 tools/libxl/xl.h              |    5 +
 tools/libxl/xl_cmdimpl.c      |  160 ++++++++++++++++++++++++++++++
 tools/libxl/xl_cmdtable.c     |   19 ++++
 12 files changed, 723 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 362e92f..925cd7d 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1440,6 +1440,31 @@ Load FLASK policy from the given policy file. The initial policy is provided to
 the hypervisor as a multiboot module; this command allows runtime updates to the
 policy. Loading new security policy will reset runtime changes to device labels.
 
+=head1 Cache Monitoring Technology
+
+Intel Haswell and later server platforms offer monitoring capability in each
+logical processor to measure specific platform shared resource metric, for
+example, L3 cache occupancy. In Xen implementation, the monitoring granularity
+is domain level. To monitor a specific domain, just attach the domain id with
+the monitoring service. When the domain doesn't need to be monitored any more,
+detach the domain id from the monitoring service.
+
+=over 4
+
+=item B<psr-cmt-attach> [I<domain-id>]
+
+attach: Attach the platform shared resource monitoring service to a domain.
+
+=item B<psr-cmt-detach> [I<domain-id>]
+
+detach: Detach the platform shared resource monitoring service from a domain.
+
+=item B<psr-cmt-show> [I<psr-monitor-type>] [I<domain-id>]
+
+Show monitoring data for a certain domain or all domains. Current supported
+monitor types are:
+ - "cache-occupancy": showing the L3 cache occupancy.
+
 =back
 
 =head1 TO BE DOCUMENTED
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 0851273..bd2ca6c 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -36,6 +36,7 @@ CTRL_SRCS-y       += xc_kexec.c
 CTRL_SRCS-y       += xtl_core.c
 CTRL_SRCS-y       += xtl_logger_stdio.c
 CTRL_SRCS-y       += xc_resource.c
+CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
 CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index b73b157..564e187 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2679,6 +2679,25 @@ struct xc_resource_op {
 typedef struct xc_resource_op xc_resource_op_t;
 int xc_resource_op(xc_interface *xch, uint32_t nr_ops, xc_resource_op_t *ops);
 
+#if defined(__i386__) || defined(__x86_64__)
+enum xc_psr_cmt_type {
+    XC_PSR_CMT_L3_OCCUPANCY,
+};
+typedef enum xc_psr_cmt_type xc_psr_cmt_type;
+int xc_psr_cmt_attach(xc_interface *xch, uint32_t domid);
+int xc_psr_cmt_detach(xc_interface *xch, uint32_t domid);
+int xc_psr_cmt_get_domain_rmid(xc_interface *xch, uint32_t domid,
+    uint32_t *rmid);
+int xc_psr_cmt_get_total_rmid(xc_interface *xch, uint32_t *total_rmid);
+int xc_psr_cmt_get_l3_upscaling_factor(xc_interface *xch,
+    uint32_t *upscaling_factor);
+int xc_psr_cmt_get_l3_cache_size(xc_interface *xch, uint32_t cpu,
+    uint32_t *l3_cache_size);
+int xc_psr_cmt_get_data(xc_interface *xch, uint32_t rmid,
+    uint32_t cpu, uint32_t psr_cmt_type, uint64_t *monitor_data);
+int xc_psr_cmt_enabled(xc_interface *xch);
+#endif
+
 #endif /* XENCTRL_H */
 
 /*
diff --git a/tools/libxc/xc_msr_x86.h b/tools/libxc/xc_msr_x86.h
new file mode 100644
index 0000000..7c3e1a3
--- /dev/null
+++ b/tools/libxc/xc_msr_x86.h
@@ -0,0 +1,36 @@
+/*
+ * xc_msr_x86.h
+ *
+ * MSR definition macros
+ *
+ * Copyright (C) 2014      Intel Corporation
+ * Author Dongxiao Xu <dongxiao.xu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef XC_MSR_X86_H
+#define XC_MSR_X86_H
+
+#define MSR_IA32_CMT_EVTSEL     0x00000c8d
+#define MSR_IA32_CMT_CTR        0x00000c8e
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxc/xc_psr.c b/tools/libxc/xc_psr.c
new file mode 100644
index 0000000..872e6dc
--- /dev/null
+++ b/tools/libxc/xc_psr.c
@@ -0,0 +1,215 @@
+/*
+ * xc_psr.c
+ *
+ * platform shared resource related API functions.
+ *
+ * Copyright (C) 2014      Intel Corporation
+ * Author Dongxiao Xu <dongxiao.xu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "xc_private.h"
+#include "xc_msr_x86.h"
+
+#define IA32_CMT_CTR_ERROR_MASK         (0x3ull << 62)
+
+#define EVTID_L3_OCCUPANCY             0x1
+
+int xc_psr_cmt_attach(xc_interface *xch, uint32_t domid)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_psr_cmt_op;
+    domctl.domain = (domid_t)domid;
+    domctl.u.psr_cmt_op.cmd = XEN_DOMCTL_PSR_CMT_OP_ATTACH;
+
+    return do_domctl(xch, &domctl);
+}
+
+int xc_psr_cmt_detach(xc_interface *xch, uint32_t domid)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_psr_cmt_op;
+    domctl.domain = (domid_t)domid;
+    domctl.u.psr_cmt_op.cmd = XEN_DOMCTL_PSR_CMT_OP_DETACH;
+
+    return do_domctl(xch, &domctl);
+}
+
+int xc_psr_cmt_get_domain_rmid(xc_interface *xch, uint32_t domid,
+                                    uint32_t *rmid)
+{
+    int rc;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_psr_cmt_op;
+    domctl.domain = (domid_t)domid;
+    domctl.u.psr_cmt_op.cmd = XEN_DOMCTL_PSR_CMT_OP_QUERY_RMID;
+
+    rc = do_domctl(xch, &domctl);
+
+    if ( !rc )
+        *rmid = domctl.u.psr_cmt_op.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_total_rmid(xc_interface *xch, uint32_t *total_rmid)
+{
+    static int val = 0;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val )
+    {
+        *total_rmid = val;
+        return 0;
+    }
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd = XEN_SYSCTL_PSR_CMT_get_total_rmid;
+    sysctl.u.psr_cmt_op.flags = 0;
+
+    rc = xc_sysctl(xch, &sysctl);
+    if ( !rc )
+        val = *total_rmid = sysctl.u.psr_cmt_op.u.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_l3_upscaling_factor(xc_interface *xch,
+                                            uint32_t *upscaling_factor)
+{
+    static int val = 0;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val )
+    {
+        *upscaling_factor = val;
+        return 0;
+    }
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd =
+        XEN_SYSCTL_PSR_CMT_get_l3_upscaling_factor;
+    sysctl.u.psr_cmt_op.flags = 0;
+
+    rc = xc_sysctl(xch, &sysctl);
+    if ( !rc )
+        val = *upscaling_factor = sysctl.u.psr_cmt_op.u.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_l3_cache_size(xc_interface *xch, uint32_t cpu,
+                                      uint32_t *l3_cache_size)
+{
+    static int val = 0;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val )
+    {
+        *l3_cache_size = val;
+        return 0;
+    }
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd =
+        XEN_SYSCTL_PSR_CMT_get_l3_cache_size;
+    sysctl.u.psr_cmt_op.flags = 0;
+    sysctl.u.psr_cmt_op.u.l3_cache.cpu = cpu;
+
+    rc = xc_sysctl(xch, &sysctl);
+    if ( !rc )
+        val = *l3_cache_size= sysctl.u.psr_cmt_op.u.data;
+
+    return rc;
+}
+
+int xc_psr_cmt_get_data(xc_interface *xch, uint32_t rmid,
+    uint32_t cpu, xc_psr_cmt_type type, uint64_t *monitor_data)
+{
+    xc_resource_op_t op;
+    xc_resource_entry_t entries[2];
+    uint32_t evtid;
+    int rc;
+
+    switch ( type )
+    {
+    case XC_PSR_CMT_L3_OCCUPANCY:
+        evtid = EVTID_L3_OCCUPANCY;
+        break;
+    default:
+        return -1;
+    }
+
+    entries[0].u.cmd = XEN_RESOURCE_OP_MSR_WRITE;
+    entries[0].idx = MSR_IA32_CMT_EVTSEL;
+    entries[0].val = (uint64_t)rmid << 32 | evtid;
+    entries[0].rsvd = 0;
+
+    entries[1].u.cmd = XEN_RESOURCE_OP_MSR_READ;
+    entries[1].idx = MSR_IA32_CMT_CTR;
+    entries[1].val = 0;
+    entries[1].rsvd = 0;
+
+    op.cpu = cpu;
+    op.nr_entries = 2;
+    op.entries = entries;
+
+    rc = xc_resource_op(xch, 1, &op);
+    if ( rc < 0 )
+        return rc;
+
+    if ( op.result !=2 || entries[1].val & IA32_CMT_CTR_ERROR_MASK )
+        return -1;
+
+    *monitor_data = entries[1].val;
+
+    return 0;
+}
+
+int xc_psr_cmt_enabled(xc_interface *xch)
+{
+    static int val = -1;
+    int rc;
+    DECLARE_SYSCTL;
+
+    if ( val >= 0 )
+        return val;
+
+    sysctl.cmd = XEN_SYSCTL_psr_cmt_op;
+    sysctl.u.psr_cmt_op.cmd = XEN_SYSCTL_PSR_CMT_enabled;
+    sysctl.u.psr_cmt_op.flags = 0;
+
+    rc = do_sysctl(xch, &sysctl);
+    if ( !rc )
+    {
+        val = sysctl.u.psr_cmt_op.u.data;
+        return val;
+    }
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 0bf666f..df08c8a 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -58,7 +58,7 @@ endif
 
 LIBXL_OBJS-y += libxl_remus_device.o libxl_remus_disk_drbd.o
 
-LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o
+LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o libxl_psr.o
 LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o libxl_arm.o
 
 ifeq ($(CONFIG_NetBSD),y)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 2700cc1..3568e1e 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -659,6 +659,15 @@ typedef uint8_t libxl_mac[6];
 #define LIBXL_MAC_BYTES(mac) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
 void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
 
+#if defined(__i386__) || defined(__x86_64__)
+/*
+ * LIBXL_HAVE_PSR_CMT
+ *
+ * If this is defined, the Cache Monitoring Technology feature is supported.
+ */
+#define LIBXL_HAVE_PSR_CMT 1
+#endif
+
 typedef char **libxl_string_list;
 void libxl_string_list_dispose(libxl_string_list *sl);
 int libxl_string_list_length(const libxl_string_list *sl);
@@ -1400,6 +1409,18 @@ bool libxl_ms_vm_genid_is_zero(const libxl_ms_vm_genid *id);
 void libxl_ms_vm_genid_copy(libxl_ctx *ctx, libxl_ms_vm_genid *dst,
                             libxl_ms_vm_genid *src);
 
+#ifdef LIBXL_HAVE_PSR_CMT
+int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_enabled(libxl_ctx *ctx);
+int libxl_psr_cmt_get_total_rmid(libxl_ctx *ctx, uint32_t *total_rmid);
+int libxl_psr_cmt_get_l3_cache_size(libxl_ctx *ctx, uint32_t socketid,
+    uint32_t *l3_cache_size);
+int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx, uint32_t domid,
+    uint32_t socketid, uint32_t *l3_cache_occupancy);
+#endif
+
 /* misc */
 
 /* Each of these sets or clears the flag according to whether the
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
new file mode 100644
index 0000000..0437465
--- /dev/null
+++ b/tools/libxl/libxl_psr.c
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2014      Intel Corporation
+ * Author Dongxiao Xu <dongxiao.xu@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_osdeps.h" /* must come before any other headers */
+#include "libxl_internal.h"
+
+
+#define IA32_QM_CTR_ERROR_MASK         (0x3ul << 62)
+
+static void libxl__psr_cmt_log_err_msg(libxl__gc *gc, int err)
+{
+    char *msg;
+
+    switch (err) {
+    case ENOSYS:
+        msg = "unsupported operation";
+        break;
+    case ENODEV:
+        msg = "CMT is not supported in this system";
+        break;
+    case EEXIST:
+        msg = "CMT is already attached to this domain";
+        break;
+    case ENOENT:
+        msg = "CMT is not attached to this domain";
+        break;
+    case EUSERS:
+        msg = "no free RMID available";
+        break;
+    case ESRCH:
+        msg = "invalid domain ID";
+        break;
+    case EFAULT:
+        msg = "failed to exchange data with Xen";
+        break;
+    default:
+        msg = "unknown error";
+        break;
+    }
+
+    LOGE(ERROR, "%s", msg);
+}
+
+static int libxl__pick_socket_cpu(libxl__gc *gc, uint32_t socketid)
+{
+    int i, nr_cpus;
+    libxl_cputopology *topology;
+    int cpu = ERROR_FAIL;
+
+    topology = libxl_get_cpu_topology(CTX, &nr_cpus);
+    if (!topology)
+        return ERROR_FAIL;
+
+    for (i = 0; i < nr_cpus; i++)
+        if (topology[i].socket == socketid) {
+            cpu = i;
+            break;
+        }
+
+    libxl_cputopology_list_free(topology, nr_cpus);
+    return cpu;
+}
+
+int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid)
+{
+    GC_INIT(ctx);
+    int rc;
+
+    rc = xc_psr_cmt_attach(ctx->xch, domid);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid)
+{
+    GC_INIT(ctx);
+    int rc;
+
+    rc = xc_psr_cmt_detach(ctx->xch, domid);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid)
+{
+    int rc;
+    uint32_t rmid;
+
+    rc = xc_psr_cmt_get_domain_rmid(ctx->xch, domid, &rmid);
+    if (rc < 0)
+        return 0;
+
+    return !!rmid;
+}
+
+int libxl_psr_cmt_enabled(libxl_ctx *ctx)
+{
+    return xc_psr_cmt_enabled(ctx->xch);
+}
+
+int libxl_psr_cmt_get_total_rmid(libxl_ctx *ctx, uint32_t *total_rmid)
+{
+    GC_INIT(ctx);
+    int rc;
+
+    rc = xc_psr_cmt_get_total_rmid(ctx->xch, total_rmid);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_get_l3_cache_size(libxl_ctx *ctx, uint32_t socketid,
+                                         uint32_t *l3_cache_size)
+{
+    GC_INIT(ctx);
+
+    int rc;
+    int cpu = libxl__pick_socket_cpu(gc, socketid);
+
+    if (cpu < 0) {
+        LOGE(ERROR, "failed to get socket cpu");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = xc_psr_cmt_get_l3_cache_size(ctx->xch, cpu, l3_cache_size);
+    if (rc < 0) {
+        libxl__psr_cmt_log_err_msg(gc, errno);
+        rc = ERROR_FAIL;
+    }
+
+out:
+    GC_FREE;
+    return rc;
+}
+
+int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx, uint32_t domid,
+    uint32_t socketid, uint32_t *l3_cache_occupancy)
+{
+    GC_INIT(ctx);
+
+    unsigned int rmid;
+    uint32_t upscaling_factor;
+    uint64_t monitor_data;
+    int cpu, rc;
+    xc_psr_cmt_type type;
+
+    rc = xc_psr_cmt_get_domain_rmid(ctx->xch, domid, &rmid);
+    if (rc < 0 || rmid == 0) {
+        LOGE(ERROR, "fail to get the domain rmid, "
+            "or domain is not attached with platform QoS monitoring service");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    cpu = libxl__pick_socket_cpu(gc, socketid);
+    if (cpu < 0) {
+        LOGE(ERROR, "failed to get socket cpu");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    type = XC_PSR_CMT_L3_OCCUPANCY;
+    rc = xc_psr_cmt_get_data(ctx->xch, rmid, cpu, type, &monitor_data);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get monitoring data");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = xc_psr_cmt_get_l3_upscaling_factor(ctx->xch, &upscaling_factor);
+    if (rc < 0) {
+        LOGE(ERROR, "failed to get L3 upscaling factor");
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    *l3_cache_occupancy = upscaling_factor * monitor_data / 1024;
+    rc = 0;
+out:
+    GC_FREE;
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index bbb03e2..df572c7 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -652,3 +652,7 @@ libxl_event = Struct("event",[
                                  ])),
            ("domain_create_console_available", None),
            ]))])
+
+libxl_psr_cmt_type = Enumeration("psr_cmt_type", [
+    (1, "CACHE_OCCUPANCY"),
+    ])
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 6c7aa8e..378245d 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -111,6 +111,11 @@ int main_loadpolicy(int argc, char **argv);
 int main_remus(int argc, char **argv);
 #endif
 int main_devd(int argc, char **argv);
+#ifdef LIBXL_HAVE_PSR_CMT
+int main_psr_cmt_attach(int argc, char **argv);
+int main_psr_cmt_detach(int argc, char **argv);
+int main_psr_cmt_show(int argc, char **argv);
+#endif
 
 void help(const char *command);
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c734f79..988ee28 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7626,6 +7626,166 @@ out:
     return ret;
 }
 
+#ifdef LIBXL_HAVE_PSR_CMT
+static void psr_cmt_print_domain_cache_occupancy(libxl_dominfo *dominfo,
+                                                    uint32_t nr_sockets)
+{
+    char *domain_name;
+    uint32_t socketid;
+    uint32_t l3_cache_occupancy;
+
+    if (!libxl_psr_cmt_domain_attached(ctx, dominfo->domid))
+        return;
+
+    domain_name = libxl_domid_to_name(ctx, dominfo->domid);
+    printf("%-40s %5d", domain_name, dominfo->domid);
+    free(domain_name);
+
+    for (socketid = 0; socketid < nr_sockets; socketid++) {
+        if ( !libxl_psr_cmt_get_cache_occupancy(ctx, dominfo->domid,
+                 socketid, &l3_cache_occupancy) )
+            printf("%13u KB", l3_cache_occupancy);
+    }
+
+    printf("\n");
+}
+
+static int psr_cmt_show_cache_occupancy(uint32_t domid)
+{
+    uint32_t i, socketid, nr_sockets, total_rmid;
+    uint32_t l3_cache_size;
+    libxl_physinfo info;
+    int rc, nr_domains;
+
+    if (!libxl_psr_cmt_enabled(ctx)) {
+        fprintf(stderr, "CMT is disabled in the system\n");
+        return -1;
+    }
+
+    libxl_physinfo_init(&info);
+    rc = libxl_get_physinfo(ctx, &info);
+    if (rc < 0) {
+        fprintf(stderr, "Failed getting physinfo, rc: %d\n", rc);
+        libxl_physinfo_dispose(&info);
+        return -1;
+    }
+    nr_sockets = info.nr_cpus / info.threads_per_core / info.cores_per_socket;
+    libxl_physinfo_dispose(&info);
+
+    rc = libxl_psr_cmt_get_total_rmid(ctx, &total_rmid);
+    if (rc < 0) {
+        fprintf(stderr, "Failed to get max RMID value\n");
+        return -1;
+    }
+
+    printf("Total RMID: %d\n", total_rmid);
+
+    /* Header */
+    printf("%-40s %5s", "Name", "ID");
+    for (socketid = 0; socketid < nr_sockets; socketid++)
+        printf("%14s %d", "Socket", socketid);
+    printf("\n");
+
+    /* Total L3 cache size */
+    printf("%-46s", "Total L3 Cache Size");
+    for (socketid = 0; socketid < nr_sockets; socketid++) {
+        rc = libxl_psr_cmt_get_l3_cache_size(ctx, socketid, &l3_cache_size);
+        if (rc < 0) {
+            fprintf(stderr, "Failed to get system l3 cache size for socket:%d\n",
+                            socketid);
+            return -1;
+        }
+        printf("%13u KB", l3_cache_size);
+    }
+    printf("\n");
+
+    /* Each domain */
+    if (domid != INVALID_DOMID) {
+        libxl_dominfo dominfo;
+        if (!libxl_domain_info(ctx, &dominfo, domid)) {
+            fprintf(stderr, "Failed to get domain info for %d\n", domid);
+            return -1;
+        }
+        psr_cmt_print_domain_cache_occupancy(&dominfo, nr_sockets);
+    }
+    else
+    {
+        libxl_dominfo *list;
+        if (!(list = libxl_list_domain(ctx, &nr_domains))) {
+            fprintf(stderr, "Failed to get domain info for domain list.\n");
+            return -1;
+        }
+        for (i = 0; i < nr_domains; i++)
+            psr_cmt_print_domain_cache_occupancy(list + i, nr_sockets);
+        libxl_dominfo_list_free(list, nr_domains);
+    }
+    return 0;
+}
+
+int main_psr_cmt_attach(int argc, char **argv)
+{
+    uint32_t domid;
+    int opt, ret = 0;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "psr-cmt-attach", 1) {
+        /* No options */
+    }
+
+    domid = find_domain(argv[optind]);
+    ret = libxl_psr_cmt_attach(ctx, domid);
+
+    return ret;
+}
+
+int main_psr_cmt_detach(int argc, char **argv)
+{
+    uint32_t domid;
+    int opt, ret = 0;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "psr-cmt-detach", 1) {
+        /* No options */
+    }
+
+    domid = find_domain(argv[optind]);
+    ret = libxl_psr_cmt_detach(ctx, domid);
+
+    return ret;
+}
+
+int main_psr_cmt_show(int argc, char **argv)
+{
+    int opt, ret = 0;
+    uint32_t domid;
+    libxl_psr_cmt_type type;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "psr-cmt-show", 1) {
+        /* No options */
+    }
+
+    libxl_psr_cmt_type_from_string(argv[optind], &type);
+
+    if (optind + 1 >= argc)
+        domid = INVALID_DOMID;
+    else if (optind + 1 == argc - 1)
+        domid = find_domain(argv[optind + 1]);
+    else {
+        help("psr-cmt-show");
+        return 2;
+    }
+
+    switch (type) {
+    case LIBXL_PSR_CMT_TYPE_CACHE_OCCUPANCY:
+        ret = psr_cmt_show_cache_occupancy(domid);
+        break;
+    default:
+        help("psr-cmt-show");
+        return 2;
+    }
+
+    return ret;
+}
+#endif
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index f93ee4f..8ed8f45 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -517,6 +517,25 @@ struct cmd_spec cmd_table[] = {
       "[options]",
       "-F                      Run in the foreground",
     },
+#ifdef LIBXL_HAVE_PSR_CMT
+    { "psr-cmt-attach",
+      &main_psr_cmt_attach, 0, 1,
+      "Attach Cache Monitoring Technology service to a domain",
+      "<Domain>",
+    },
+    { "psr-cmt-detach",
+      &main_psr_cmt_detach, 0, 1,
+      "Detach Cache Monitoring Technology service from a domain",
+      "<Domain>",
+    },
+    { "psr-cmt-show",
+      &main_psr_cmt_show, 0, 1,
+      "Show Cache Monitoring Technology information",
+      "<PSR-CMT-Type> <Domain>",
+      "Available monitor types:\n"
+      "\"cache_occupancy\":         Show L3 cache occupancy\n",
+    },
+#endif
 };
 
 int cmdtable_len = sizeof(cmd_table)/sizeof(struct cmd_spec);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 17 12:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2014 12:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xf6tF-0000uv-IH; Fri, 17 Oct 2014 12:44:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tE-0000um-EM
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:16 +0000
Received: from [85.158.137.68:45588] by server-7.bemta-3.messagelabs.com id
	16/ED-01084-F1F01445; Fri, 17 Oct 2014 12:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1413549853!11375473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32279 invoked from network); 17 Oct 2014 12:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2014 12:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tB-0000Ez-IL
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tB-0001tT-G2
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:13 +0000
Date: Fri, 17 Oct 2014 12:44:13 +0000
Message-Id: <E1Xf6tB-0001tT-G2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs,
	amd_ucode: condense amd_ucode notes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4c5e3a8e84f2158487d8f403b3053c52d8ee2dd7
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Thu Oct 16 10:07:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:07:56 2014 +0200

    docs, amd_ucode: condense amd_ucode notes
    
    Some cleanups to the documentation-
     - Remove unnecessary steps listed to apply ucode using initrd.
     - Condense 'Misc notes' section as well
    
    Suggested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 docs/misc/amd-ucode-container.txt |   43 +++++++++++++-----------------------
 1 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/docs/misc/amd-ucode-container.txt b/docs/misc/amd-ucode-container.txt
index ae3ceb0..1db6466 100644
--- a/docs/misc/amd-ucode-container.txt
+++ b/docs/misc/amd-ucode-container.txt
@@ -16,7 +16,8 @@ Intro to AMD Container Files:
   processor families 10h, 11h, 12h, 14h, and 15h.
 * There is one single file (container file) containing all microcode patches
   for AMD families 10h - 14h processors. [microcode_amd.bin]
-* For AMD family 15h processors there is a separate container file. [microcode_amd_fam15h.bin]
+* For AMD processor families 15h and later, there is a separate container file
+  for each family. (e.g. microcode_amd_fam15h.bin)
 * Microcode patches are not incremental, therefore you only need to make
   sure you have the latest container file for your AMD processor family.
 * One can find the latest AMD microcode containers from [1], [2]
@@ -24,7 +25,8 @@ Intro to AMD Container Files:
 Mutual Exclusivity Rule of AMD containers:
 * The patches for families 10h - 14h are guaranteed to be only on
   microcode_amd.bin
-* Similarly, patches for family 15h will only be on microcode_amd_fam15h.bin
+* Similarly, patches for family 15h and later will only be on their respective
+  family specific container file. (e.g. microcode_amd_fam15h.bin)
 * This is because, the processes and scripts used to create container files
   ensure that there is no mix-up
 
@@ -60,35 +62,22 @@ Example System base: Ubuntu 13.04 with 3.8.0-30-generic kernel
 1.  mkdir initrd-for-xen-with_append
 2.  cd initrd-for-xen-with_append
 3.  mkdir -p kernel/x86/microcode
-4.  cp /lib/firmware/amd-ucode/microcode_amd.bin .
-5.  cp /lib/firmware/amd-ucode/microcode_amd_fam15h.bin .
-6.  cat microcode_amd.bin microcode_amd_fam15h.bin > microcode_concatenated.bin
-7.  mv microcode_concatenated.bin kernel/x86/microcode/AuthenticAMD.bin
-8.  rm microcode_amd.bin microcode_amd_fam15h.bin
-9.  find . | cpio -o -H newc > ucode.cpio
-10.  cp /boot/initrd.img-3.8.0-30-generic .
-11. cat ucode.cpio initrd.img-3.8.0-30-generic > initrd_for_xen_with_ucode
-12. cp initrd_for_xen_with_ucode /boot/
-13. On grub.cfg, provide the above initrd name as module.
-14. Use 'ucode=scan' option as Xen boot parameter.
+4.  cat /lib/firmware/amd-ucode/microcode_amd.bin \
+        /lib/firmware/amd-ucode/microcode_amd_fam15h.bin > \
+	kernel/x86/microcode/AuthenticAMD.bin 
+5.  find . | cpio -o -H newc > ucode.cpio
+6.  cat ucode.cpio /boot/initrd.img-3.8.0-30-generic > /boot/initrd_for_xen_with_ucode
+7. On grub.cfg, provide the above initrd name as module.
+8. Use 'ucode=scan' option as Xen boot parameter.
 
 Misc Notes:
 -----------
 It is not recommended to concatenate two(or more) container files of
-the same kind. (two microcode_amd_fam15h.bin for example)
-This is because:
-There is no check in Xen currently to verify this.
-Now, given a situation where
-1. An earlier container has a patch that 'fits' the processor you are
-   currently on,
-2. There is a subsequent container that *also* has a patch that 'fits',
-3. The second patch happens to be an update over the patch found on the
-   first container file.
-
-In such a case, only the patch from the first container is applied.
-This is because Xen assumes that the the containers (if concatenated
-together) are different kinds AND the 'Mutual Exclusivity' rule is
-always true.
+the same kind. (e.g. two microcode_amd_fam15h.bin) since the hypervisor
+will apply a patch as and when it determines that it is a 'good fit'.
+Once the patch is applied, further parsing of the file is skipped.
+Therefore, if a subsequent container file has a newer/updated patch, that 
+patch will be ignored.
 
 In cases where users are not sure about provenance of containers 
 they should obtain a "good" set  by downloading them from source links
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 17 12:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2014 12:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xf6tF-0000uv-IH; Fri, 17 Oct 2014 12:44:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tE-0000um-EM
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:16 +0000
Received: from [85.158.137.68:45588] by server-7.bemta-3.messagelabs.com id
	16/ED-01084-F1F01445; Fri, 17 Oct 2014 12:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1413549853!11375473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32279 invoked from network); 17 Oct 2014 12:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2014 12:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tB-0000Ez-IL
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tB-0001tT-G2
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:13 +0000
Date: Fri, 17 Oct 2014 12:44:13 +0000
Message-Id: <E1Xf6tB-0001tT-G2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs,
	amd_ucode: condense amd_ucode notes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4c5e3a8e84f2158487d8f403b3053c52d8ee2dd7
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Thu Oct 16 10:07:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:07:56 2014 +0200

    docs, amd_ucode: condense amd_ucode notes
    
    Some cleanups to the documentation-
     - Remove unnecessary steps listed to apply ucode using initrd.
     - Condense 'Misc notes' section as well
    
    Suggested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 docs/misc/amd-ucode-container.txt |   43 +++++++++++++-----------------------
 1 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/docs/misc/amd-ucode-container.txt b/docs/misc/amd-ucode-container.txt
index ae3ceb0..1db6466 100644
--- a/docs/misc/amd-ucode-container.txt
+++ b/docs/misc/amd-ucode-container.txt
@@ -16,7 +16,8 @@ Intro to AMD Container Files:
   processor families 10h, 11h, 12h, 14h, and 15h.
 * There is one single file (container file) containing all microcode patches
   for AMD families 10h - 14h processors. [microcode_amd.bin]
-* For AMD family 15h processors there is a separate container file. [microcode_amd_fam15h.bin]
+* For AMD processor families 15h and later, there is a separate container file
+  for each family. (e.g. microcode_amd_fam15h.bin)
 * Microcode patches are not incremental, therefore you only need to make
   sure you have the latest container file for your AMD processor family.
 * One can find the latest AMD microcode containers from [1], [2]
@@ -24,7 +25,8 @@ Intro to AMD Container Files:
 Mutual Exclusivity Rule of AMD containers:
 * The patches for families 10h - 14h are guaranteed to be only on
   microcode_amd.bin
-* Similarly, patches for family 15h will only be on microcode_amd_fam15h.bin
+* Similarly, patches for family 15h and later will only be on their respective
+  family specific container file. (e.g. microcode_amd_fam15h.bin)
 * This is because, the processes and scripts used to create container files
   ensure that there is no mix-up
 
@@ -60,35 +62,22 @@ Example System base: Ubuntu 13.04 with 3.8.0-30-generic kernel
 1.  mkdir initrd-for-xen-with_append
 2.  cd initrd-for-xen-with_append
 3.  mkdir -p kernel/x86/microcode
-4.  cp /lib/firmware/amd-ucode/microcode_amd.bin .
-5.  cp /lib/firmware/amd-ucode/microcode_amd_fam15h.bin .
-6.  cat microcode_amd.bin microcode_amd_fam15h.bin > microcode_concatenated.bin
-7.  mv microcode_concatenated.bin kernel/x86/microcode/AuthenticAMD.bin
-8.  rm microcode_amd.bin microcode_amd_fam15h.bin
-9.  find . | cpio -o -H newc > ucode.cpio
-10.  cp /boot/initrd.img-3.8.0-30-generic .
-11. cat ucode.cpio initrd.img-3.8.0-30-generic > initrd_for_xen_with_ucode
-12. cp initrd_for_xen_with_ucode /boot/
-13. On grub.cfg, provide the above initrd name as module.
-14. Use 'ucode=scan' option as Xen boot parameter.
+4.  cat /lib/firmware/amd-ucode/microcode_amd.bin \
+        /lib/firmware/amd-ucode/microcode_amd_fam15h.bin > \
+	kernel/x86/microcode/AuthenticAMD.bin 
+5.  find . | cpio -o -H newc > ucode.cpio
+6.  cat ucode.cpio /boot/initrd.img-3.8.0-30-generic > /boot/initrd_for_xen_with_ucode
+7. On grub.cfg, provide the above initrd name as module.
+8. Use 'ucode=scan' option as Xen boot parameter.
 
 Misc Notes:
 -----------
 It is not recommended to concatenate two(or more) container files of
-the same kind. (two microcode_amd_fam15h.bin for example)
-This is because:
-There is no check in Xen currently to verify this.
-Now, given a situation where
-1. An earlier container has a patch that 'fits' the processor you are
-   currently on,
-2. There is a subsequent container that *also* has a patch that 'fits',
-3. The second patch happens to be an update over the patch found on the
-   first container file.
-
-In such a case, only the patch from the first container is applied.
-This is because Xen assumes that the the containers (if concatenated
-together) are different kinds AND the 'Mutual Exclusivity' rule is
-always true.
+the same kind. (e.g. two microcode_amd_fam15h.bin) since the hypervisor
+will apply a patch as and when it determines that it is a 'good fit'.
+Once the patch is applied, further parsing of the file is skipped.
+Therefore, if a subsequent container file has a newer/updated patch, that 
+patch will be ignored.
 
 In cases where users are not sure about provenance of containers 
 they should obtain a "good" set  by downloading them from source links
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 17 12:44:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2014 12:44:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xf6tP-0000wR-O4; Fri, 17 Oct 2014 12:44:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tO-0000wH-5f
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:26 +0000
Received: from [193.109.254.147:44220] by server-2.bemta-14.messagelabs.com id
	E2/19-07861-92F01445; Fri, 17 Oct 2014 12:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1413549863!10077647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3316 invoked from network); 17 Oct 2014 12:44:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2014 12:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tL-0000F8-NK
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tL-0001tp-Kk
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:23 +0000
Date: Fri, 17 Oct 2014 12:44:23 +0000
Message-Id: <E1Xf6tL-0001tp-Kk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move XENMEM_get_vnumainfo out of
	tools-only section of public/memory.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9cea500dc0294947b12b8e2479a238acd0e990f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 16 10:08:39 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:08:39 2014 +0200

    move XENMEM_get_vnumainfo out of tools-only section of public/memory.h
    
    After all this interface specifically exists for guest kernels to learn
    about their (virtual) topology. I'm sure I made a comment to this
    effect during review, but apparently I then didn't notice that this
    never got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/public/memory.h |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index db961ec..f021958 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -521,6 +521,14 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
  * The zero value is appropiate.
  */
 
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
+/*
+ * XENMEM_get_vnumainfo used by guest to get
+ * vNUMA topology from hypervisor.
+ */
+#define XENMEM_get_vnumainfo                26
+
 /* vNUMA node memory ranges */
 struct vmemrange {
     uint64_t start, end;
@@ -565,14 +573,6 @@ struct vnuma_topology_info {
 typedef struct vnuma_topology_info vnuma_topology_info_t;
 DEFINE_XEN_GUEST_HANDLE(vnuma_topology_info_t);
 
-/*
- * XENMEM_get_vnumainfo used by guest to get
- * vNUMA topology from hypervisor.
- */
-#define XENMEM_get_vnumainfo               26
-
-#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
-
 /* Next available subop number is 27 */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 17 12:44:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2014 12:44:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xf6tP-0000wR-O4; Fri, 17 Oct 2014 12:44:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tO-0000wH-5f
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:26 +0000
Received: from [193.109.254.147:44220] by server-2.bemta-14.messagelabs.com id
	E2/19-07861-92F01445; Fri, 17 Oct 2014 12:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1413549863!10077647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3316 invoked from network); 17 Oct 2014 12:44:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2014 12:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tL-0000F8-NK
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xf6tL-0001tp-Kk
	for xen-changelog@lists.xensource.com; Fri, 17 Oct 2014 12:44:23 +0000
Date: Fri, 17 Oct 2014 12:44:23 +0000
Message-Id: <E1Xf6tL-0001tp-Kk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move XENMEM_get_vnumainfo out of
	tools-only section of public/memory.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9cea500dc0294947b12b8e2479a238acd0e990f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 16 10:08:39 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:08:39 2014 +0200

    move XENMEM_get_vnumainfo out of tools-only section of public/memory.h
    
    After all this interface specifically exists for guest kernels to learn
    about their (virtual) topology. I'm sure I made a comment to this
    effect during review, but apparently I then didn't notice that this
    never got carried out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/public/memory.h |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index db961ec..f021958 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -521,6 +521,14 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
  * The zero value is appropiate.
  */
 
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
+/*
+ * XENMEM_get_vnumainfo used by guest to get
+ * vNUMA topology from hypervisor.
+ */
+#define XENMEM_get_vnumainfo                26
+
 /* vNUMA node memory ranges */
 struct vmemrange {
     uint64_t start, end;
@@ -565,14 +573,6 @@ struct vnuma_topology_info {
 typedef struct vnuma_topology_info vnuma_topology_info_t;
 DEFINE_XEN_GUEST_HANDLE(vnuma_topology_info_t);
 
-/*
- * XENMEM_get_vnumainfo used by guest to get
- * vNUMA topology from hypervisor.
- */
-#define XENMEM_get_vnumainfo               26
-
-#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
-
 /* Next available subop number is 27 */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pJ-0007xb-8A; Wed, 22 Oct 2014 19:44:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pH-0007xR-7S
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:07 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	46/B7-03246-60908445; Wed, 22 Oct 2014 19:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1414007044!11002802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29668 invoked from network); 22 Oct 2014 19:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pD-0007KR-HR
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pD-0006z0-EY
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:03 +0000
Date: Wed, 22 Oct 2014 19:44:03 +0000
Message-Id: <E1Xh1pD-0006z0-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86,
	idle: add barriers to CLFLUSH workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8bb89fae19059797e36935839f7f08fac6adf95a
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri Oct 17 16:02:06 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:02:06 2014 +0200

    x86, idle: add barriers to CLFLUSH workaround
    
    ... since the documentation is explicit that CLFLUSH is only ordered
    with respect to MFENCE.
    
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 48d32458bcd453e31b458bca868a079a6d0a38af
    master date: 2014-09-09 18:09:08 +0200
---
 xen/arch/x86/acpi/cpu_idle.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index a9b5ba9..d3fd793 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -297,7 +297,11 @@ void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
     s_time_t expires = per_cpu(timer_deadline, cpu);
 
     if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
+    {
+        mb();
         clflush((void *)&mwait_wakeup(cpu));
+        mb();
+    }
 
     __monitor((void *)&mwait_wakeup(cpu), 0, 0);
     smp_mb();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pJ-0007xb-8A; Wed, 22 Oct 2014 19:44:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pH-0007xR-7S
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:07 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	46/B7-03246-60908445; Wed, 22 Oct 2014 19:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1414007044!11002802!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29668 invoked from network); 22 Oct 2014 19:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pD-0007KR-HR
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pD-0006z0-EY
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:03 +0000
Date: Wed, 22 Oct 2014 19:44:03 +0000
Message-Id: <E1Xh1pD-0006z0-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86,
	idle: add barriers to CLFLUSH workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8bb89fae19059797e36935839f7f08fac6adf95a
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri Oct 17 16:02:06 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:02:06 2014 +0200

    x86, idle: add barriers to CLFLUSH workaround
    
    ... since the documentation is explicit that CLFLUSH is only ordered
    with respect to MFENCE.
    
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 48d32458bcd453e31b458bca868a079a6d0a38af
    master date: 2014-09-09 18:09:08 +0200
---
 xen/arch/x86/acpi/cpu_idle.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index a9b5ba9..d3fd793 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -297,7 +297,11 @@ void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
     s_time_t expires = per_cpu(timer_deadline, cpu);
 
     if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
+    {
+        mb();
         clflush((void *)&mwait_wakeup(cpu));
+        mb();
+    }
 
     __monitor((void *)&mwait_wakeup(cpu), 0, 0);
     smp_mb();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pS-0007yM-BG; Wed, 22 Oct 2014 19:44:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pQ-0007yA-KY
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:16 +0000
Received: from [193.109.254.147:16706] by server-9.bemta-14.messagelabs.com id
	E8/00-31535-F0908445; Wed, 22 Oct 2014 19:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1414007053!11822072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 846 invoked from network); 22 Oct 2014 19:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pN-0007KU-LT
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pN-0006zu-KH
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:13 +0000
Date: Wed, 22 Oct 2014 19:44:13 +0000
Message-Id: <E1Xh1pN-0006zu-KH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: don't unintentionally leave
	x2APIC MSR intercepts disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7d1bb848e1817273081bfc4ecb21d3e1e4e32b0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:03:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:03:01 2014 +0200

    VMX: don't unintentionally leave x2APIC MSR intercepts disabled
    
    These should be re-enabled in particular when the virtualized APIC
    transitions to HW-disabled state.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 72af6f455ac6afcd46d9a556f90349f2397507e8
    master date: 2014-09-16 13:58:20 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bf7d8f1..fb76a34 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2052,6 +2052,7 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
 {
     int virtualize_x2apic_mode;
     struct vlapic *vlapic = vcpu_vlapic(v);
+    unsigned int msr;
 
     virtualize_x2apic_mode = ( (cpu_has_vmx_apic_reg_virt ||
                                 cpu_has_vmx_virtual_intr_delivery) &&
@@ -2068,8 +2069,6 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
     if ( !vlapic_hw_disabled(vlapic) &&
          (vlapic_base_address(vlapic) == APIC_DEFAULT_PHYS_BASE) )
     {
-        unsigned int msr;
-
         if ( virtualize_x2apic_mode && vlapic_x2apic_mode(vlapic) )
         {
             v->arch.hvm_vmx.secondary_exec_control |=
@@ -2098,15 +2097,15 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
             }
         }
         else
-        {
             v->arch.hvm_vmx.secondary_exec_control |=
                 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
-            for ( msr = MSR_IA32_APICBASE_MSR;
-                  msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
-                vmx_enable_intercept_for_msr(v, msr,
-                                             MSR_TYPE_R | MSR_TYPE_W);
-        }
     }
+    if ( !(v->arch.hvm_vmx.secondary_exec_control &
+           SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE) )
+        for ( msr = MSR_IA32_APICBASE_MSR;
+              msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
+            vmx_enable_intercept_for_msr(v, msr, MSR_TYPE_R | MSR_TYPE_W);
+
     vmx_update_secondary_exec_control(v);
     vmx_vmcs_exit(v);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pS-0007yM-BG; Wed, 22 Oct 2014 19:44:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pQ-0007yA-KY
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:16 +0000
Received: from [193.109.254.147:16706] by server-9.bemta-14.messagelabs.com id
	E8/00-31535-F0908445; Wed, 22 Oct 2014 19:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1414007053!11822072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 846 invoked from network); 22 Oct 2014 19:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pN-0007KU-LT
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pN-0006zu-KH
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:13 +0000
Date: Wed, 22 Oct 2014 19:44:13 +0000
Message-Id: <E1Xh1pN-0006zu-KH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: don't unintentionally leave
	x2APIC MSR intercepts disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7d1bb848e1817273081bfc4ecb21d3e1e4e32b0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:03:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:03:01 2014 +0200

    VMX: don't unintentionally leave x2APIC MSR intercepts disabled
    
    These should be re-enabled in particular when the virtualized APIC
    transitions to HW-disabled state.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 72af6f455ac6afcd46d9a556f90349f2397507e8
    master date: 2014-09-16 13:58:20 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bf7d8f1..fb76a34 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2052,6 +2052,7 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
 {
     int virtualize_x2apic_mode;
     struct vlapic *vlapic = vcpu_vlapic(v);
+    unsigned int msr;
 
     virtualize_x2apic_mode = ( (cpu_has_vmx_apic_reg_virt ||
                                 cpu_has_vmx_virtual_intr_delivery) &&
@@ -2068,8 +2069,6 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
     if ( !vlapic_hw_disabled(vlapic) &&
          (vlapic_base_address(vlapic) == APIC_DEFAULT_PHYS_BASE) )
     {
-        unsigned int msr;
-
         if ( virtualize_x2apic_mode && vlapic_x2apic_mode(vlapic) )
         {
             v->arch.hvm_vmx.secondary_exec_control |=
@@ -2098,15 +2097,15 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
             }
         }
         else
-        {
             v->arch.hvm_vmx.secondary_exec_control |=
                 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
-            for ( msr = MSR_IA32_APICBASE_MSR;
-                  msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
-                vmx_enable_intercept_for_msr(v, msr,
-                                             MSR_TYPE_R | MSR_TYPE_W);
-        }
     }
+    if ( !(v->arch.hvm_vmx.secondary_exec_control &
+           SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE) )
+        for ( msr = MSR_IA32_APICBASE_MSR;
+              msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
+            vmx_enable_intercept_for_msr(v, msr, MSR_TYPE_R | MSR_TYPE_W);
+
     vmx_update_secondary_exec_control(v);
     vmx_vmcs_exit(v);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pc-0007zi-Dv; Wed, 22 Oct 2014 19:44:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pb-0007zR-9q
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:27 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	2D/D3-03128-91908445; Wed, 22 Oct 2014 19:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1414007064!7234356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23630 invoked from network); 22 Oct 2014 19:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pX-0007Ke-Px
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pX-00070G-OA
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:23 +0000
Date: Wed, 22 Oct 2014 19:44:23 +0000
Message-Id: <E1Xh1pX-00070G-OA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/EFI: fix freeing of
	uninitialized pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f73bada970ae0c687abe2a4ec1aa0bb960c1dfe8
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Fri Oct 17 16:03:50 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:03:50 2014 +0200

    x86/EFI: fix freeing of uninitialized pointer
    
    The only valid response from the LocateHandle() call is EFI_BUFFER_TOO_SMALL,
    so exit if we get anything else.  We pass a 0 size/NULL pointer buffer, so the
    only other returns we will get is an error.  Return right away as there is
    nothing to do.  Also return if there is an error allocating the buffer, as the
    previous code path also allowed for an undefined pointer to be freed.
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    
    Re-structure the change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c61690fb76f9a51a8c932d76929b67bd0940febe
    master date: 2014-09-24 11:09:11 +0200
---
 xen/arch/x86/efi/boot.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 68c9abe..7eabcea 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -594,11 +594,12 @@ static void __init setup_efi_pci(void)
     struct efi_pci_rom *last = NULL;
 
     status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, NULL);
-    if ( status == EFI_BUFFER_TOO_SMALL )
-        status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
-    if ( !EFI_ERROR(status) )
-        status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size,
-                                      handles);
+    if ( status != EFI_BUFFER_TOO_SMALL )
+        return;
+    status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
+    if ( EFI_ERROR(status) )
+        return;
+    status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, handles);
     if ( EFI_ERROR(status) )
         size = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pc-0007zi-Dv; Wed, 22 Oct 2014 19:44:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pb-0007zR-9q
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:27 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	2D/D3-03128-91908445; Wed, 22 Oct 2014 19:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1414007064!7234356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23630 invoked from network); 22 Oct 2014 19:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pX-0007Ke-Px
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pX-00070G-OA
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:23 +0000
Date: Wed, 22 Oct 2014 19:44:23 +0000
Message-Id: <E1Xh1pX-00070G-OA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/EFI: fix freeing of
	uninitialized pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f73bada970ae0c687abe2a4ec1aa0bb960c1dfe8
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Fri Oct 17 16:03:50 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:03:50 2014 +0200

    x86/EFI: fix freeing of uninitialized pointer
    
    The only valid response from the LocateHandle() call is EFI_BUFFER_TOO_SMALL,
    so exit if we get anything else.  We pass a 0 size/NULL pointer buffer, so the
    only other returns we will get is an error.  Return right away as there is
    nothing to do.  Also return if there is an error allocating the buffer, as the
    previous code path also allowed for an undefined pointer to be freed.
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    
    Re-structure the change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c61690fb76f9a51a8c932d76929b67bd0940febe
    master date: 2014-09-24 11:09:11 +0200
---
 xen/arch/x86/efi/boot.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 68c9abe..7eabcea 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -594,11 +594,12 @@ static void __init setup_efi_pci(void)
     struct efi_pci_rom *last = NULL;
 
     status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, NULL);
-    if ( status == EFI_BUFFER_TOO_SMALL )
-        status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
-    if ( !EFI_ERROR(status) )
-        status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size,
-                                      handles);
+    if ( status != EFI_BUFFER_TOO_SMALL )
+        return;
+    status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
+    if ( EFI_ERROR(status) )
+        return;
+    status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, handles);
     if ( EFI_ERROR(status) )
         size = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pl-000813-Gf; Wed, 22 Oct 2014 19:44:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pk-00080n-EP
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:36 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	32/FC-02952-32908445; Wed, 22 Oct 2014 19:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1414007074!12012354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8887 invoked from network); 22 Oct 2014 19:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ph-0007Km-UD
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ph-00070g-T0
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:33 +0000
Date: Wed, 22 Oct 2014 19:44:33 +0000
Message-Id: <E1Xh1ph-00070g-T0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: restore reserving of IO-APIC
	pages in XENMEM_machine_memory_map output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 687b232bb38e6de552ab95a944a52997ba3b8d4b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:04:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:04:40 2014 +0200

    x86: restore reserving of IO-APIC pages in XENMEM_machine_memory_map output
    
    Commit d1222afda4 ("x86: allow Dom0 read-only access to IO-APICs") had
    an unintended side effect: By no longer adding IO-APIC pages to Dom0's
    iomem_caps these also no longer get reported as reserved in the machine
    memory map presented to it (which got added there intentionally by
    commit b8a456caed ["x86: improve reporting through
    XENMEM_machine_memory_map"] because many BIOSes fail to add these).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 9d8edc5a8b4a0937193f80da72abdb44c5aeaec6
    master date: 2014-10-06 11:13:19 +0200
---
 xen/arch/x86/mm.c |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index aa13011..646b127 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -121,6 +121,7 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
+#include <asm/io_apic.h>
 #include <asm/pci.h>
 
 /* Mapping of the fixmap space needed early. */
@@ -4494,10 +4495,9 @@ struct memory_map_context
     struct xen_memory_map map;
 };
 
-static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+static int _handle_iomem_range(unsigned long s, unsigned long e,
+                               struct memory_map_context *ctxt)
 {
-    struct memory_map_context *ctxt = p;
-
     if ( s > ctxt->s )
     {
         e820entry_t ent;
@@ -4520,6 +4520,31 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
     return 0;
 }
 
+static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+{
+    int err = 0;
+
+    do {
+        unsigned long low = -1UL;
+        unsigned int i;
+
+        for ( i = 0; i < nr_ioapics; ++i )
+        {
+            unsigned long mfn = paddr_to_pfn(mp_ioapics[i].mpc_apicaddr);
+
+            if ( mfn >= s && mfn <= e && mfn < low )
+                low = mfn;
+        }
+        if ( !(low + 1) )
+            break;
+        if ( s < low )
+            err = _handle_iomem_range(s, low - 1, p);
+        s = low + 1;
+    } while ( !err );
+
+    return err || s > e ? err : _handle_iomem_range(s, e, p);
+}
+
 static int xenmem_add_to_physmap_once(
     struct domain *d,
     const struct xen_add_to_physmap *xatp)
@@ -4828,7 +4853,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         {
             unsigned long s = PFN_DOWN(e820.map[i].addr);
 
-            if ( s )
+            if ( s > ctxt.s )
             {
                 rc = rangeset_report_ranges(current->domain->iomem_caps,
                                             ctxt.s, s - 1,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1pl-000813-Gf; Wed, 22 Oct 2014 19:44:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1pk-00080n-EP
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:36 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	32/FC-02952-32908445; Wed, 22 Oct 2014 19:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1414007074!12012354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8887 invoked from network); 22 Oct 2014 19:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ph-0007Km-UD
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ph-00070g-T0
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:33 +0000
Date: Wed, 22 Oct 2014 19:44:33 +0000
Message-Id: <E1Xh1ph-00070g-T0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: restore reserving of IO-APIC
	pages in XENMEM_machine_memory_map output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 687b232bb38e6de552ab95a944a52997ba3b8d4b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:04:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:04:40 2014 +0200

    x86: restore reserving of IO-APIC pages in XENMEM_machine_memory_map output
    
    Commit d1222afda4 ("x86: allow Dom0 read-only access to IO-APICs") had
    an unintended side effect: By no longer adding IO-APIC pages to Dom0's
    iomem_caps these also no longer get reported as reserved in the machine
    memory map presented to it (which got added there intentionally by
    commit b8a456caed ["x86: improve reporting through
    XENMEM_machine_memory_map"] because many BIOSes fail to add these).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 9d8edc5a8b4a0937193f80da72abdb44c5aeaec6
    master date: 2014-10-06 11:13:19 +0200
---
 xen/arch/x86/mm.c |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index aa13011..646b127 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -121,6 +121,7 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
+#include <asm/io_apic.h>
 #include <asm/pci.h>
 
 /* Mapping of the fixmap space needed early. */
@@ -4494,10 +4495,9 @@ struct memory_map_context
     struct xen_memory_map map;
 };
 
-static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+static int _handle_iomem_range(unsigned long s, unsigned long e,
+                               struct memory_map_context *ctxt)
 {
-    struct memory_map_context *ctxt = p;
-
     if ( s > ctxt->s )
     {
         e820entry_t ent;
@@ -4520,6 +4520,31 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
     return 0;
 }
 
+static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+{
+    int err = 0;
+
+    do {
+        unsigned long low = -1UL;
+        unsigned int i;
+
+        for ( i = 0; i < nr_ioapics; ++i )
+        {
+            unsigned long mfn = paddr_to_pfn(mp_ioapics[i].mpc_apicaddr);
+
+            if ( mfn >= s && mfn <= e && mfn < low )
+                low = mfn;
+        }
+        if ( !(low + 1) )
+            break;
+        if ( s < low )
+            err = _handle_iomem_range(s, low - 1, p);
+        s = low + 1;
+    } while ( !err );
+
+    return err || s > e ? err : _handle_iomem_range(s, e, p);
+}
+
 static int xenmem_add_to_physmap_once(
     struct domain *d,
     const struct xen_add_to_physmap *xatp)
@@ -4828,7 +4853,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         {
             unsigned long s = PFN_DOWN(e820.map[i].addr);
 
-            if ( s )
+            if ( s > ctxt.s )
             {
                 rc = rangeset_report_ranges(current->domain->iomem_caps,
                                             ctxt.s, s - 1,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1py-00083U-JS; Wed, 22 Oct 2014 19:44:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1px-000837-9c
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:49 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	89/80-11509-03908445; Wed, 22 Oct 2014 19:44:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1414007084!11209938!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19008 invoked from network); 22 Oct 2014 19:44:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ps-0007Kw-2l
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ps-000712-1h
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:44 +0000
Date: Wed, 22 Oct 2014 19:44:44 +0000
Message-Id: <E1Xh1ps-000712-1h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] don't allow Dom0 access to IOMMUs'
	MMIO pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3845ef72a9a9fe7befa89339e36d201dd874a56e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:05:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:05:25 2014 +0200

    don't allow Dom0 access to IOMMUs' MMIO pages
    
    Just like for LAPIC, IO-APIC, MSI, and HT we shouldn't be granting Dom0
    access to these. This implicitly results in these pages also getting
    marked reserved in the machine memory map Dom0 uses to determine the
    ranges where PCI devices can have their MMIO ranges placed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: fdf30377fbc4fa6798bfda7d69e5d448c2b8e834
    master date: 2014-10-06 11:15:01 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    8 ++++++++
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index d0cb15c..4c27b10 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -19,6 +19,7 @@
  */
 
 #include <xen/sched.h>
+#include <xen/iocap.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <xen/paging.h>
@@ -317,6 +318,7 @@ static int amd_iommu_domain_init(struct domain *d)
 static void __init amd_iommu_dom0_init(struct domain *d)
 {
     unsigned long i; 
+    const struct amd_iommu *iommu;
 
     if ( !iommu_passthrough && !need_iommu(d) )
     {
@@ -338,6 +340,12 @@ static void __init amd_iommu_dom0_init(struct domain *d)
         }
     }
 
+    for_each_amd_iommu ( iommu )
+        if ( iomem_deny_access(d, PFN_DOWN(iommu->mmio_base_phys),
+                               PFN_DOWN(iommu->mmio_base_phys +
+                                        IOMMU_MMIO_REGION_LENGTH - 1)) )
+            BUG();
+
     setup_dom0_pci_devices(d, amd_iommu_setup_dom0_device);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 04c2639..4533554 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -23,6 +23,7 @@
 #include <xen/sched.h>
 #include <xen/xmalloc.h>
 #include <xen/domain_page.h>
+#include <xen/iocap.h>
 #include <xen/iommu.h>
 #include <asm/hvm/iommu.h>
 #include <xen/numa.h>
@@ -1260,6 +1261,9 @@ static void __init intel_iommu_dom0_init(struct domain *d)
 
     for_each_drhd_unit ( drhd )
     {
+        if ( iomem_deny_access(d, PFN_DOWN(drhd->address),
+                               PFN_DOWN(drhd->address)) )
+            BUG();
         iommu_enable_translation(drhd);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1py-00083U-JS; Wed, 22 Oct 2014 19:44:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1px-000837-9c
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:49 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	89/80-11509-03908445; Wed, 22 Oct 2014 19:44:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1414007084!11209938!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19008 invoked from network); 22 Oct 2014 19:44:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ps-0007Kw-2l
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1ps-000712-1h
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:44 +0000
Date: Wed, 22 Oct 2014 19:44:44 +0000
Message-Id: <E1Xh1ps-000712-1h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] don't allow Dom0 access to IOMMUs'
	MMIO pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3845ef72a9a9fe7befa89339e36d201dd874a56e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:05:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:05:25 2014 +0200

    don't allow Dom0 access to IOMMUs' MMIO pages
    
    Just like for LAPIC, IO-APIC, MSI, and HT we shouldn't be granting Dom0
    access to these. This implicitly results in these pages also getting
    marked reserved in the machine memory map Dom0 uses to determine the
    ranges where PCI devices can have their MMIO ranges placed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: fdf30377fbc4fa6798bfda7d69e5d448c2b8e834
    master date: 2014-10-06 11:15:01 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    8 ++++++++
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index d0cb15c..4c27b10 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -19,6 +19,7 @@
  */
 
 #include <xen/sched.h>
+#include <xen/iocap.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <xen/paging.h>
@@ -317,6 +318,7 @@ static int amd_iommu_domain_init(struct domain *d)
 static void __init amd_iommu_dom0_init(struct domain *d)
 {
     unsigned long i; 
+    const struct amd_iommu *iommu;
 
     if ( !iommu_passthrough && !need_iommu(d) )
     {
@@ -338,6 +340,12 @@ static void __init amd_iommu_dom0_init(struct domain *d)
         }
     }
 
+    for_each_amd_iommu ( iommu )
+        if ( iomem_deny_access(d, PFN_DOWN(iommu->mmio_base_phys),
+                               PFN_DOWN(iommu->mmio_base_phys +
+                                        IOMMU_MMIO_REGION_LENGTH - 1)) )
+            BUG();
+
     setup_dom0_pci_devices(d, amd_iommu_setup_dom0_device);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 04c2639..4533554 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -23,6 +23,7 @@
 #include <xen/sched.h>
 #include <xen/xmalloc.h>
 #include <xen/domain_page.h>
+#include <xen/iocap.h>
 #include <xen/iommu.h>
 #include <asm/hvm/iommu.h>
 #include <xen/numa.h>
@@ -1260,6 +1261,9 @@ static void __init intel_iommu_dom0_init(struct domain *d)
 
     for_each_drhd_unit ( drhd )
     {
+        if ( iomem_deny_access(d, PFN_DOWN(drhd->address),
+                               PFN_DOWN(drhd->address)) )
+            BUG();
         iommu_enable_translation(drhd);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1q7-00084z-M5; Wed, 22 Oct 2014 19:44:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1q6-00084k-Th
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:59 +0000
Received: from [193.109.254.147:58993] by server-3.bemta-14.messagelabs.com id
	23/18-23707-83908445; Wed, 22 Oct 2014 19:44:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414007094!11908271!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6890 invoked from network); 22 Oct 2014 19:44:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1q2-0007L2-7l
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1q2-00071O-5N
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:54 +0000
Date: Wed, 22 Oct 2014 19:44:54 +0000
Message-Id: <E1Xh1q2-00071O-5N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] AMD/guest_iommu: properly disable
	guest iommu support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9eb86d9513429e1a5bc30f6df77a1648bb67d73a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 16:06:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:06:03 2014 +0200

    AMD/guest_iommu: properly disable guest iommu support
    
    AMD Guest IOMMU support was added to allow correct use of PASID and PRI
    hardware support with an ATS-aware guest driver.
    
    However, support cannot possibly function as guest_iommu_set_base() has no
    callers.  This means that its MMIO region's P2M pages are not set to
    p2m_mmio_dm, preventing any invocation of the MMIO read/write handlers.
    
    c/s fd186384 "x86/HVM: extend LAPIC shortcuts around P2M lookups" introduces a
    path (via hvm_mmio_internal()) where iommu_mmio_handler claims its MMIO range,
    and causes __hvm_copy() to fail with HVMCOPY_bad_gfn_to_mfn.
    
    iommu->mmio_base defaults to 0, with a range of 8 pages, and is unilaterally
    enabled in any HVM guests when the host IOMMU(s) supports any extended
    features.
    
    Unfortunately, HVMLoader's AP boot trampoline executes an `lmsw` instruction
    at linear address 0x100c which unconditionally requires emulation.  The
    instruction fetch in turn fails as __hvm_copy() fails with
    HVMCOPY_bad_gfn_to_mfn.
    
    The result is that multi-vcpu HVM guests do not work on newer AMD hardware, if
    IOMMU support is enabled in the BIOS.
    
    Change the default mmio_base address to ~0ULL.  This prevents
    guest_iommu_mmio_range() from actually claiming any physical range
    whatsoever, which allows the emulation of `lmsw` to succeed.
    
    Reported-by: Roberto Luongo <rluongo@ready.it>
    Suggested-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Roberto Luongo <rluongo@ready.it>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: 02e4c89b2cc3c1f19ef42ed4fcb1931d8d704bb5
    master date: 2014-10-06 11:20:12 +0200
---
 xen/drivers/passthrough/amd/iommu_guest.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 477de20..b675a4b 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -885,6 +885,7 @@ int guest_iommu_init(struct domain* d)
     }
 
     guest_iommu_reg_init(iommu);
+    iommu->mmio_base = ~0ULL;
     iommu->domain = d;
     hd->g_iommu = iommu;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:44:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1q7-00084z-M5; Wed, 22 Oct 2014 19:44:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1q6-00084k-Th
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:59 +0000
Received: from [193.109.254.147:58993] by server-3.bemta-14.messagelabs.com id
	23/18-23707-83908445; Wed, 22 Oct 2014 19:44:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414007094!11908271!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6890 invoked from network); 22 Oct 2014 19:44:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:44:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1q2-0007L2-7l
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1q2-00071O-5N
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:44:54 +0000
Date: Wed, 22 Oct 2014 19:44:54 +0000
Message-Id: <E1Xh1q2-00071O-5N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] AMD/guest_iommu: properly disable
	guest iommu support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9eb86d9513429e1a5bc30f6df77a1648bb67d73a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 16:06:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:06:03 2014 +0200

    AMD/guest_iommu: properly disable guest iommu support
    
    AMD Guest IOMMU support was added to allow correct use of PASID and PRI
    hardware support with an ATS-aware guest driver.
    
    However, support cannot possibly function as guest_iommu_set_base() has no
    callers.  This means that its MMIO region's P2M pages are not set to
    p2m_mmio_dm, preventing any invocation of the MMIO read/write handlers.
    
    c/s fd186384 "x86/HVM: extend LAPIC shortcuts around P2M lookups" introduces a
    path (via hvm_mmio_internal()) where iommu_mmio_handler claims its MMIO range,
    and causes __hvm_copy() to fail with HVMCOPY_bad_gfn_to_mfn.
    
    iommu->mmio_base defaults to 0, with a range of 8 pages, and is unilaterally
    enabled in any HVM guests when the host IOMMU(s) supports any extended
    features.
    
    Unfortunately, HVMLoader's AP boot trampoline executes an `lmsw` instruction
    at linear address 0x100c which unconditionally requires emulation.  The
    instruction fetch in turn fails as __hvm_copy() fails with
    HVMCOPY_bad_gfn_to_mfn.
    
    The result is that multi-vcpu HVM guests do not work on newer AMD hardware, if
    IOMMU support is enabled in the BIOS.
    
    Change the default mmio_base address to ~0ULL.  This prevents
    guest_iommu_mmio_range() from actually claiming any physical range
    whatsoever, which allows the emulation of `lmsw` to succeed.
    
    Reported-by: Roberto Luongo <rluongo@ready.it>
    Suggested-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Roberto Luongo <rluongo@ready.it>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: 02e4c89b2cc3c1f19ef42ed4fcb1931d8d704bb5
    master date: 2014-10-06 11:20:12 +0200
---
 xen/drivers/passthrough/amd/iommu_guest.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 477de20..b675a4b 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -885,6 +885,7 @@ int guest_iommu_init(struct domain* d)
     }
 
     guest_iommu_reg_init(iommu);
+    iommu->mmio_base = ~0ULL;
     iommu->domain = d;
     hd->g_iommu = iommu;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:45:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:45:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1qP-000875-PG; Wed, 22 Oct 2014 19:45:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1qN-00086q-U8
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:45:17 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	CA/E1-02699-A4908445; Wed, 22 Oct 2014 19:45:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414007110!11930925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31135 invoked from network); 22 Oct 2014 19:45:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:45:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1qI-0007M3-5E
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:45:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1qH-00072Y-Bo
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:45:10 +0000
Date: Wed, 22 Oct 2014 19:45:09 +0000
Message-Id: <E1Xh1qH-00072Y-Bo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/paging: make log-dirty
	operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 425e9039b6532a8c5884e7fe4b6676f6cd493770
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:06:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:06:47 2014 +0200

    x86/paging: make log-dirty operations preemptible
    
    Both the freeing and the inspection of the bitmap get done in (nested)
    loops which - besides having a rather high iteration count in general,
    albeit that would be covered by XSA-77 - have the number of non-trivial
    iterations they need to perform (indirectly) controllable by both the
    guest they are for and any domain controlling the guest (including the
    one running qemu for it).
    
    Note that the tying of the continuations to the invoking domain (which
    previously [wrongly] used the invoking vCPU instead) implies that the
    tools requesting such operations have to make sure they don't issue
    multiple similar operations in parallel.
    
    Note further that this breaks supervisor-mode kernel assumptions in
    hypercall_create_continuation() (where regs->eip gets rewound to the
    current hypercall stub beginning), but otoh
    hypercall_cancel_continuation() doesn't work in that mode either.
    Perhaps time to rip out all the remains of that feature?
    
    This is part of CVE-2014-5146 / XSA-97.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 070493dfd2788e061b53f074b7ba97507fbcbf65
    master date: 2014-10-06 11:22:04 +0200
---
 xen/arch/x86/domain.c              |    4 +-
 xen/arch/x86/domctl.c              |    8 +-
 xen/arch/x86/hvm/hvm.c             |    6 +-
 xen/arch/x86/mm/paging.c           |  261 +++++++++++++++++++++++++++++-------
 xen/arch/x86/x86_64/compat/entry.S |    2 +
 xen/arch/x86/x86_64/entry.S        |    2 +
 xen/common/domain.c                |    1 -
 xen/include/asm-x86/domain.h       |   14 ++
 xen/include/asm-x86/paging.h       |   13 +-
 9 files changed, 250 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index ddf9c64..336cd79 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1867,7 +1867,9 @@ int domain_relinquish_resources(struct domain *d)
         pci_release_devices(d);
 
         /* Tear down paging-assistance stuff. */
-        paging_teardown(d);
+        ret = paging_teardown(d);
+        if ( ret )
+            return ret;
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 67afe8e..173bf01 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -58,9 +58,11 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        ret = paging_domctl(d,
-                            &domctl->u.shadow_op,
-                            guest_handle_cast(u_domctl, void));
+        ret = paging_domctl(d, &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void), 0);
+        if ( ret == -EAGAIN )
+            return hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                                 "h", u_domctl);
         copyback = 1;
     }
     break;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 7f669f9..a8d58b2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3353,7 +3353,8 @@ static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 #define COMPAT_CALL(x)                                        \
@@ -3372,7 +3373,8 @@ static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 int hvm_do_hypercall(struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 21344e5..9f8d2b3 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -26,6 +26,7 @@
 #include <asm/shadow.h>
 #include <asm/p2m.h>
 #include <asm/hap.h>
+#include <asm/event.h>
 #include <asm/hvm/nestedhvm.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
@@ -116,26 +117,46 @@ static void paging_free_log_dirty_page(struct domain *d, mfn_t mfn)
     d->arch.paging.free_page(d, mfn_to_page(mfn));
 }
 
-void paging_free_log_dirty_bitmap(struct domain *d)
+static int paging_free_log_dirty_bitmap(struct domain *d, int rc)
 {
     mfn_t *l4, *l3, *l2;
     int i4, i3, i2;
 
+    paging_lock(d);
+
     if ( !mfn_valid(d->arch.paging.log_dirty.top) )
-        return;
+    {
+        paging_unlock(d);
+        return 0;
+    }
 
-    paging_lock(d);
+    if ( !d->arch.paging.preempt.dom )
+    {
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+        ASSERT(rc <= 0);
+        d->arch.paging.preempt.log_dirty.done = -rc;
+    }
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF )
+    {
+        paging_unlock(d);
+        return -EBUSY;
+    }
 
     l4 = map_domain_page(mfn_x(d->arch.paging.log_dirty.top));
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    rc = 0;
 
-    for ( i4 = 0; i4 < LOGDIRTY_NODE_ENTRIES; i4++ )
+    for ( ; i4 < LOGDIRTY_NODE_ENTRIES; i4++, i3 = 0 )
     {
         if ( !mfn_valid(l4[i4]) )
             continue;
 
         l3 = map_domain_page(mfn_x(l4[i4]));
 
-        for ( i3 = 0; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
+        for ( ; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
         {
             if ( !mfn_valid(l3[i3]) )
                 continue;
@@ -148,20 +169,54 @@ void paging_free_log_dirty_bitmap(struct domain *d)
 
             unmap_domain_page(l2);
             paging_free_log_dirty_page(d, l3[i3]);
+            l3[i3] = _mfn(INVALID_MFN);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                rc = -EAGAIN;
+                break;
+            }
         }
 
         unmap_domain_page(l3);
+        if ( rc )
+            break;
         paging_free_log_dirty_page(d, l4[i4]);
+        l4[i4] = _mfn(INVALID_MFN);
+
+        if ( i4 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            rc = -EAGAIN;
+            break;
+        }
     }
 
     unmap_domain_page(l4);
-    paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 
-    ASSERT(d->arch.paging.log_dirty.allocs == 0);
-    d->arch.paging.log_dirty.failed_allocs = 0;
+    if ( !rc )
+    {
+        paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
+        d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
+        ASSERT(d->arch.paging.log_dirty.allocs == 0);
+        d->arch.paging.log_dirty.failed_allocs = 0;
+
+        rc = -d->arch.paging.preempt.log_dirty.done;
+        d->arch.paging.preempt.dom = NULL;
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = XEN_DOMCTL_SHADOW_OP_OFF;
+    }
 
     paging_unlock(d);
+
+    return rc;
 }
 
 int paging_log_dirty_enable(struct domain *d)
@@ -178,15 +233,25 @@ int paging_log_dirty_enable(struct domain *d)
     return ret;
 }
 
-int paging_log_dirty_disable(struct domain *d)
+static int paging_log_dirty_disable(struct domain *d, bool_t resuming)
 {
-    int ret;
+    int ret = 1;
+
+    if ( !resuming )
+    {
+        domain_pause(d);
+        /* Safe because the domain is paused. */
+        if ( paging_mode_log_dirty(d) )
+        {
+            ret = d->arch.paging.log_dirty.disable_log_dirty(d);
+            ASSERT(ret <= 0);
+        }
+    }
+
+    ret = paging_free_log_dirty_bitmap(d, ret);
+    if ( ret == -EAGAIN )
+        return ret;
 
-    domain_pause(d);
-    /* Safe because the domain is paused. */
-    ret = d->arch.paging.log_dirty.disable_log_dirty(d);
-    if ( !paging_mode_log_dirty(d) )
-        paging_free_log_dirty_bitmap(d);
     domain_unpause(d);
 
     return ret;
@@ -326,7 +391,9 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn)
 
 /* Read a domain's log-dirty bitmap and stats.  If the operation is a CLEAN,
  * clear the bitmap and stats as well. */
-int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
+static int paging_log_dirty_op(struct domain *d,
+                               struct xen_domctl_shadow_op *sc,
+                               bool_t resuming)
 {
     int rv = 0, clean = 0, peek = 1;
     unsigned long pages = 0;
@@ -334,9 +401,22 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     unsigned long *l1 = NULL;
     int i4, i3, i2;
 
-    domain_pause(d);
+    if ( !resuming )
+        domain_pause(d);
     paging_lock(d);
 
+    if ( !d->arch.paging.preempt.dom )
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != sc->op )
+    {
+        paging_unlock(d);
+        ASSERT(!resuming);
+        domain_unpause(d);
+        return -EBUSY;
+    }
+
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
 
     PAGING_DEBUG(LOGDIRTY, "log-dirty %s: dom %u faults=%u dirty=%u\n",
@@ -348,12 +428,6 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
-    if ( clean )
-    {
-        d->arch.paging.log_dirty.fault_count = 0;
-        d->arch.paging.log_dirty.dirty_count = 0;
-    }
-
     if ( guest_handle_is_null(sc->dirty_bitmap) )
         /* caller may have wanted just to clean the state or access stats. */
         peek = 0;
@@ -365,17 +439,15 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
         goto out;
     }
 
-    pages = 0;
     l4 = paging_map_log_dirty_bitmap(d);
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    pages = d->arch.paging.preempt.log_dirty.done;
 
-    for ( i4 = 0;
-          (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    for ( ; (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES); i4++, i3 = 0 )
     {
         l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = 0;
-              (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
+        for ( ; (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES); i3++ )
         {
             l2 = ((l3 && mfn_valid(l3[i3])) ?
                   map_domain_page(mfn_x(l3[i3])) : NULL);
@@ -410,18 +482,58 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
             }
             if ( l2 )
                 unmap_domain_page(l2);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                rv = -EAGAIN;
+                break;
+            }
         }
         if ( l3 )
             unmap_domain_page(l3);
+
+        if ( !rv && i4 < LOGDIRTY_NODE_ENTRIES - 1 &&
+             hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            rv = -EAGAIN;
+        }
+        if ( rv )
+            break;
     }
     if ( l4 )
         unmap_domain_page(l4);
 
-    if ( pages < sc->pages )
-        sc->pages = pages;
+    if ( !rv )
+    {
+        d->arch.paging.preempt.dom = NULL;
+        if ( clean )
+        {
+            d->arch.paging.log_dirty.fault_count = 0;
+            d->arch.paging.log_dirty.dirty_count = 0;
+        }
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = sc->op;
+        d->arch.paging.preempt.log_dirty.done = pages;
+    }
 
     paging_unlock(d);
 
+    if ( rv )
+    {
+        /* Never leave the domain paused on real errors. */
+        ASSERT(rv == -EAGAIN);
+        return rv;
+    }
+
+    if ( pages < sc->pages )
+        sc->pages = pages;
     if ( clean )
     {
         /* We need to further call clean_dirty_bitmap() functions of specific
@@ -432,6 +544,7 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     return rv;
 
  out:
+    d->arch.paging.preempt.dom = NULL;
     paging_unlock(d);
     domain_unpause(d);
 
@@ -498,12 +611,6 @@ void paging_log_dirty_init(struct domain *d,
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
 }
 
-/* This function fress log dirty bitmap resources. */
-static void paging_log_dirty_teardown(struct domain*d)
-{
-    paging_free_log_dirty_bitmap(d);
-}
-
 /************************************************/
 /*           CODE FOR PAGING SUPPORT            */
 /************************************************/
@@ -545,7 +652,7 @@ void paging_vcpu_init(struct vcpu *v)
 
 
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming)
 {
     int rc;
 
@@ -569,6 +676,21 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
+    if ( resuming
+         ? (d->arch.paging.preempt.dom != current->domain ||
+            d->arch.paging.preempt.op != sc->op)
+         : (d->arch.paging.preempt.dom &&
+            sc->op != XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION) )
+    {
+        printk(XENLOG_G_DEBUG
+               "d%d:v%d: Paging op %#x on Dom%u with unfinished prior op %#x by Dom%u\n",
+               current->domain->domain_id, current->vcpu_id,
+               sc->op, d->domain_id, d->arch.paging.preempt.op,
+               d->arch.paging.preempt.dom
+               ? d->arch.paging.preempt.dom->domain_id : DOMID_INVALID);
+        return -EBUSY;
+    }
+
     rc = xsm_shadow_control(XSM_HOOK, d, sc->op);
     if ( rc )
         return rc;
@@ -593,14 +715,13 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return paging_log_dirty_enable(d);
 
     case XEN_DOMCTL_SHADOW_OP_OFF:
-        if ( paging_mode_log_dirty(d) )
-            if ( (rc = paging_log_dirty_disable(d)) != 0 )
-                return rc;
+        if ( (rc = paging_log_dirty_disable(d, resuming)) != 0 )
+            return rc;
         break;
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
     case XEN_DOMCTL_SHADOW_OP_PEEK:
-        return paging_log_dirty_op(d, sc);
+        return paging_log_dirty_op(d, sc, resuming);
     }
 
     /* Here, dispatch domctl to the appropriate paging code */
@@ -610,19 +731,67 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return shadow_domctl(d, sc, u_domctl);
 }
 
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
+{
+    struct xen_domctl op;
+    struct domain *d;
+    int ret;
+
+    if ( copy_from_guest(&op, u_domctl, 1) )
+        return -EFAULT;
+
+    if ( op.interface_version != XEN_DOMCTL_INTERFACE_VERSION ||
+         op.cmd != XEN_DOMCTL_shadow_op )
+        return -EBADRQC;
+
+    d = rcu_lock_domain_by_id(op.domain);
+    if ( d == NULL )
+        return -ESRCH;
+
+    ret = xsm_domctl(XSM_OTHER, d, op.cmd);
+    if ( !ret )
+    {
+        if ( domctl_lock_acquire() )
+        {
+            ret = paging_domctl(d, &op.u.shadow_op,
+                                guest_handle_cast(u_domctl, void), 1);
+
+            domctl_lock_release();
+        }
+        else
+            ret = -EAGAIN;
+    }
+
+    rcu_unlock_domain(d);
+
+    if ( ret == -EAGAIN )
+        ret = hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                            "h", u_domctl);
+    else if ( __copy_field_to_guest(u_domctl, &op, u.shadow_op) )
+        ret = -EFAULT;
+
+    return ret;
+}
+
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d)
+int paging_teardown(struct domain *d)
 {
+    int rc;
+
     if ( hap_enabled(d) )
         hap_teardown(d);
     else
         shadow_teardown(d);
 
     /* clean up log dirty resources. */
-    paging_log_dirty_teardown(d);
+    rc = paging_free_log_dirty_bitmap(d, 0);
+    if ( rc == -EAGAIN )
+        return rc;
 
     /* Move populate-on-demand cache back to domain_list for destruction */
     p2m_pod_empty_cache(d);
+
+    return rc;
 }
 
 /* Call once all of the references to the domain have gone away */
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index c0afe2c..77a45f2 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -417,6 +417,7 @@ ENTRY(compat_hypercall_table)
         .quad compat_ni_hypercall
         .endr
         .quad do_mca                    /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-compat_hypercall_table)/8)
         .quad compat_ni_hypercall
         .endr
@@ -465,6 +466,7 @@ ENTRY(compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
         .byte 1 /* do_mca                   */
+        .byte 1 /* paging_domctl_continuation      */
         .rept NR_hypercalls-(.-compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 5beeccb..8870e84 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -766,6 +766,7 @@ ENTRY(hypercall_table)
         .quad do_ni_hypercall
         .endr
         .quad do_mca                /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-hypercall_table)/8)
         .quad do_ni_hypercall
         .endr
@@ -814,6 +815,7 @@ ENTRY(hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
         .byte 1 /* do_mca               */  /* 48 */
+        .byte 1 /* paging_domctl_continuation */
         .rept NR_hypercalls-(.-hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 6dbfaa5..9980d83 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -527,7 +527,6 @@ int domain_kill(struct domain *d)
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
         {
-            BUG_ON(rc != -EAGAIN);
             break;
         }
         if ( sched_move_domain(d, cpupool0) )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 1df8ea9..b477646 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -186,6 +186,20 @@ struct paging_domain {
     struct hap_domain       hap;
     /* log dirty support */
     struct log_dirty_domain log_dirty;
+
+    /* preemption handling */
+    struct {
+        const struct domain *dom;
+        unsigned int op;
+        union {
+            struct {
+                unsigned long done:PADDR_BITS - PAGE_SHIFT;
+                unsigned long i4:PAGETABLE_ORDER;
+                unsigned long i3:PAGETABLE_ORDER;
+            } log_dirty;
+        };
+    } preempt;
+
     /* alloc/free pages from the pool for paging-assistance structures
      * (used by p2m and log-dirty code for their tries) */
     struct page_info * (*alloc_page)(struct domain *d);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index cd7ee3b..dcc7471 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -133,9 +133,6 @@ struct paging_mode {
 /*****************************************************************************
  * Log dirty code */
 
-/* free log dirty bitmap resource */
-void paging_free_log_dirty_bitmap(struct domain *d);
-
 /* get the dirty bitmap for a specific range of pfns */
 void paging_log_dirty_range(struct domain *d,
                             unsigned long begin_pfn,
@@ -145,9 +142,6 @@ void paging_log_dirty_range(struct domain *d,
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
 
-/* disable log dirty */
-int paging_log_dirty_disable(struct domain *d);
-
 /* log dirty initialization */
 void paging_log_dirty_init(struct domain *d,
                            int  (*enable_log_dirty)(struct domain *d),
@@ -203,10 +197,13 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags);
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming);
+
+/* Helper hypercall for dealing with continuations. */
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d);
+int paging_teardown(struct domain *d);
 
 /* Call once all of the references to the domain have gone away */
 void paging_final_teardown(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 22 19:45:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2014 19:45:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xh1qP-000875-PG; Wed, 22 Oct 2014 19:45:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1qN-00086q-U8
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:45:17 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	CA/E1-02699-A4908445; Wed, 22 Oct 2014 19:45:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414007110!11930925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31135 invoked from network); 22 Oct 2014 19:45:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2014 19:45:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1qI-0007M3-5E
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:45:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xh1qH-00072Y-Bo
	for xen-changelog@lists.xensource.com; Wed, 22 Oct 2014 19:45:10 +0000
Date: Wed, 22 Oct 2014 19:45:09 +0000
Message-Id: <E1Xh1qH-00072Y-Bo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/paging: make log-dirty
	operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 425e9039b6532a8c5884e7fe4b6676f6cd493770
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 16:06:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 16:06:47 2014 +0200

    x86/paging: make log-dirty operations preemptible
    
    Both the freeing and the inspection of the bitmap get done in (nested)
    loops which - besides having a rather high iteration count in general,
    albeit that would be covered by XSA-77 - have the number of non-trivial
    iterations they need to perform (indirectly) controllable by both the
    guest they are for and any domain controlling the guest (including the
    one running qemu for it).
    
    Note that the tying of the continuations to the invoking domain (which
    previously [wrongly] used the invoking vCPU instead) implies that the
    tools requesting such operations have to make sure they don't issue
    multiple similar operations in parallel.
    
    Note further that this breaks supervisor-mode kernel assumptions in
    hypercall_create_continuation() (where regs->eip gets rewound to the
    current hypercall stub beginning), but otoh
    hypercall_cancel_continuation() doesn't work in that mode either.
    Perhaps time to rip out all the remains of that feature?
    
    This is part of CVE-2014-5146 / XSA-97.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 070493dfd2788e061b53f074b7ba97507fbcbf65
    master date: 2014-10-06 11:22:04 +0200
---
 xen/arch/x86/domain.c              |    4 +-
 xen/arch/x86/domctl.c              |    8 +-
 xen/arch/x86/hvm/hvm.c             |    6 +-
 xen/arch/x86/mm/paging.c           |  261 +++++++++++++++++++++++++++++-------
 xen/arch/x86/x86_64/compat/entry.S |    2 +
 xen/arch/x86/x86_64/entry.S        |    2 +
 xen/common/domain.c                |    1 -
 xen/include/asm-x86/domain.h       |   14 ++
 xen/include/asm-x86/paging.h       |   13 +-
 9 files changed, 250 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index ddf9c64..336cd79 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1867,7 +1867,9 @@ int domain_relinquish_resources(struct domain *d)
         pci_release_devices(d);
 
         /* Tear down paging-assistance stuff. */
-        paging_teardown(d);
+        ret = paging_teardown(d);
+        if ( ret )
+            return ret;
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 67afe8e..173bf01 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -58,9 +58,11 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        ret = paging_domctl(d,
-                            &domctl->u.shadow_op,
-                            guest_handle_cast(u_domctl, void));
+        ret = paging_domctl(d, &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void), 0);
+        if ( ret == -EAGAIN )
+            return hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                                 "h", u_domctl);
         copyback = 1;
     }
     break;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 7f669f9..a8d58b2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3353,7 +3353,8 @@ static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 #define COMPAT_CALL(x)                                        \
@@ -3372,7 +3373,8 @@ static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 int hvm_do_hypercall(struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 21344e5..9f8d2b3 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -26,6 +26,7 @@
 #include <asm/shadow.h>
 #include <asm/p2m.h>
 #include <asm/hap.h>
+#include <asm/event.h>
 #include <asm/hvm/nestedhvm.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
@@ -116,26 +117,46 @@ static void paging_free_log_dirty_page(struct domain *d, mfn_t mfn)
     d->arch.paging.free_page(d, mfn_to_page(mfn));
 }
 
-void paging_free_log_dirty_bitmap(struct domain *d)
+static int paging_free_log_dirty_bitmap(struct domain *d, int rc)
 {
     mfn_t *l4, *l3, *l2;
     int i4, i3, i2;
 
+    paging_lock(d);
+
     if ( !mfn_valid(d->arch.paging.log_dirty.top) )
-        return;
+    {
+        paging_unlock(d);
+        return 0;
+    }
 
-    paging_lock(d);
+    if ( !d->arch.paging.preempt.dom )
+    {
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+        ASSERT(rc <= 0);
+        d->arch.paging.preempt.log_dirty.done = -rc;
+    }
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF )
+    {
+        paging_unlock(d);
+        return -EBUSY;
+    }
 
     l4 = map_domain_page(mfn_x(d->arch.paging.log_dirty.top));
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    rc = 0;
 
-    for ( i4 = 0; i4 < LOGDIRTY_NODE_ENTRIES; i4++ )
+    for ( ; i4 < LOGDIRTY_NODE_ENTRIES; i4++, i3 = 0 )
     {
         if ( !mfn_valid(l4[i4]) )
             continue;
 
         l3 = map_domain_page(mfn_x(l4[i4]));
 
-        for ( i3 = 0; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
+        for ( ; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
         {
             if ( !mfn_valid(l3[i3]) )
                 continue;
@@ -148,20 +169,54 @@ void paging_free_log_dirty_bitmap(struct domain *d)
 
             unmap_domain_page(l2);
             paging_free_log_dirty_page(d, l3[i3]);
+            l3[i3] = _mfn(INVALID_MFN);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                rc = -EAGAIN;
+                break;
+            }
         }
 
         unmap_domain_page(l3);
+        if ( rc )
+            break;
         paging_free_log_dirty_page(d, l4[i4]);
+        l4[i4] = _mfn(INVALID_MFN);
+
+        if ( i4 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            rc = -EAGAIN;
+            break;
+        }
     }
 
     unmap_domain_page(l4);
-    paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 
-    ASSERT(d->arch.paging.log_dirty.allocs == 0);
-    d->arch.paging.log_dirty.failed_allocs = 0;
+    if ( !rc )
+    {
+        paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
+        d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
+        ASSERT(d->arch.paging.log_dirty.allocs == 0);
+        d->arch.paging.log_dirty.failed_allocs = 0;
+
+        rc = -d->arch.paging.preempt.log_dirty.done;
+        d->arch.paging.preempt.dom = NULL;
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = XEN_DOMCTL_SHADOW_OP_OFF;
+    }
 
     paging_unlock(d);
+
+    return rc;
 }
 
 int paging_log_dirty_enable(struct domain *d)
@@ -178,15 +233,25 @@ int paging_log_dirty_enable(struct domain *d)
     return ret;
 }
 
-int paging_log_dirty_disable(struct domain *d)
+static int paging_log_dirty_disable(struct domain *d, bool_t resuming)
 {
-    int ret;
+    int ret = 1;
+
+    if ( !resuming )
+    {
+        domain_pause(d);
+        /* Safe because the domain is paused. */
+        if ( paging_mode_log_dirty(d) )
+        {
+            ret = d->arch.paging.log_dirty.disable_log_dirty(d);
+            ASSERT(ret <= 0);
+        }
+    }
+
+    ret = paging_free_log_dirty_bitmap(d, ret);
+    if ( ret == -EAGAIN )
+        return ret;
 
-    domain_pause(d);
-    /* Safe because the domain is paused. */
-    ret = d->arch.paging.log_dirty.disable_log_dirty(d);
-    if ( !paging_mode_log_dirty(d) )
-        paging_free_log_dirty_bitmap(d);
     domain_unpause(d);
 
     return ret;
@@ -326,7 +391,9 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn)
 
 /* Read a domain's log-dirty bitmap and stats.  If the operation is a CLEAN,
  * clear the bitmap and stats as well. */
-int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
+static int paging_log_dirty_op(struct domain *d,
+                               struct xen_domctl_shadow_op *sc,
+                               bool_t resuming)
 {
     int rv = 0, clean = 0, peek = 1;
     unsigned long pages = 0;
@@ -334,9 +401,22 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     unsigned long *l1 = NULL;
     int i4, i3, i2;
 
-    domain_pause(d);
+    if ( !resuming )
+        domain_pause(d);
     paging_lock(d);
 
+    if ( !d->arch.paging.preempt.dom )
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != sc->op )
+    {
+        paging_unlock(d);
+        ASSERT(!resuming);
+        domain_unpause(d);
+        return -EBUSY;
+    }
+
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
 
     PAGING_DEBUG(LOGDIRTY, "log-dirty %s: dom %u faults=%u dirty=%u\n",
@@ -348,12 +428,6 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
-    if ( clean )
-    {
-        d->arch.paging.log_dirty.fault_count = 0;
-        d->arch.paging.log_dirty.dirty_count = 0;
-    }
-
     if ( guest_handle_is_null(sc->dirty_bitmap) )
         /* caller may have wanted just to clean the state or access stats. */
         peek = 0;
@@ -365,17 +439,15 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
         goto out;
     }
 
-    pages = 0;
     l4 = paging_map_log_dirty_bitmap(d);
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    pages = d->arch.paging.preempt.log_dirty.done;
 
-    for ( i4 = 0;
-          (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    for ( ; (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES); i4++, i3 = 0 )
     {
         l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = 0;
-              (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
+        for ( ; (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES); i3++ )
         {
             l2 = ((l3 && mfn_valid(l3[i3])) ?
                   map_domain_page(mfn_x(l3[i3])) : NULL);
@@ -410,18 +482,58 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
             }
             if ( l2 )
                 unmap_domain_page(l2);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                rv = -EAGAIN;
+                break;
+            }
         }
         if ( l3 )
             unmap_domain_page(l3);
+
+        if ( !rv && i4 < LOGDIRTY_NODE_ENTRIES - 1 &&
+             hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            rv = -EAGAIN;
+        }
+        if ( rv )
+            break;
     }
     if ( l4 )
         unmap_domain_page(l4);
 
-    if ( pages < sc->pages )
-        sc->pages = pages;
+    if ( !rv )
+    {
+        d->arch.paging.preempt.dom = NULL;
+        if ( clean )
+        {
+            d->arch.paging.log_dirty.fault_count = 0;
+            d->arch.paging.log_dirty.dirty_count = 0;
+        }
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = sc->op;
+        d->arch.paging.preempt.log_dirty.done = pages;
+    }
 
     paging_unlock(d);
 
+    if ( rv )
+    {
+        /* Never leave the domain paused on real errors. */
+        ASSERT(rv == -EAGAIN);
+        return rv;
+    }
+
+    if ( pages < sc->pages )
+        sc->pages = pages;
     if ( clean )
     {
         /* We need to further call clean_dirty_bitmap() functions of specific
@@ -432,6 +544,7 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     return rv;
 
  out:
+    d->arch.paging.preempt.dom = NULL;
     paging_unlock(d);
     domain_unpause(d);
 
@@ -498,12 +611,6 @@ void paging_log_dirty_init(struct domain *d,
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
 }
 
-/* This function fress log dirty bitmap resources. */
-static void paging_log_dirty_teardown(struct domain*d)
-{
-    paging_free_log_dirty_bitmap(d);
-}
-
 /************************************************/
 /*           CODE FOR PAGING SUPPORT            */
 /************************************************/
@@ -545,7 +652,7 @@ void paging_vcpu_init(struct vcpu *v)
 
 
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming)
 {
     int rc;
 
@@ -569,6 +676,21 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
+    if ( resuming
+         ? (d->arch.paging.preempt.dom != current->domain ||
+            d->arch.paging.preempt.op != sc->op)
+         : (d->arch.paging.preempt.dom &&
+            sc->op != XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION) )
+    {
+        printk(XENLOG_G_DEBUG
+               "d%d:v%d: Paging op %#x on Dom%u with unfinished prior op %#x by Dom%u\n",
+               current->domain->domain_id, current->vcpu_id,
+               sc->op, d->domain_id, d->arch.paging.preempt.op,
+               d->arch.paging.preempt.dom
+               ? d->arch.paging.preempt.dom->domain_id : DOMID_INVALID);
+        return -EBUSY;
+    }
+
     rc = xsm_shadow_control(XSM_HOOK, d, sc->op);
     if ( rc )
         return rc;
@@ -593,14 +715,13 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return paging_log_dirty_enable(d);
 
     case XEN_DOMCTL_SHADOW_OP_OFF:
-        if ( paging_mode_log_dirty(d) )
-            if ( (rc = paging_log_dirty_disable(d)) != 0 )
-                return rc;
+        if ( (rc = paging_log_dirty_disable(d, resuming)) != 0 )
+            return rc;
         break;
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
     case XEN_DOMCTL_SHADOW_OP_PEEK:
-        return paging_log_dirty_op(d, sc);
+        return paging_log_dirty_op(d, sc, resuming);
     }
 
     /* Here, dispatch domctl to the appropriate paging code */
@@ -610,19 +731,67 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return shadow_domctl(d, sc, u_domctl);
 }
 
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
+{
+    struct xen_domctl op;
+    struct domain *d;
+    int ret;
+
+    if ( copy_from_guest(&op, u_domctl, 1) )
+        return -EFAULT;
+
+    if ( op.interface_version != XEN_DOMCTL_INTERFACE_VERSION ||
+         op.cmd != XEN_DOMCTL_shadow_op )
+        return -EBADRQC;
+
+    d = rcu_lock_domain_by_id(op.domain);
+    if ( d == NULL )
+        return -ESRCH;
+
+    ret = xsm_domctl(XSM_OTHER, d, op.cmd);
+    if ( !ret )
+    {
+        if ( domctl_lock_acquire() )
+        {
+            ret = paging_domctl(d, &op.u.shadow_op,
+                                guest_handle_cast(u_domctl, void), 1);
+
+            domctl_lock_release();
+        }
+        else
+            ret = -EAGAIN;
+    }
+
+    rcu_unlock_domain(d);
+
+    if ( ret == -EAGAIN )
+        ret = hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                            "h", u_domctl);
+    else if ( __copy_field_to_guest(u_domctl, &op, u.shadow_op) )
+        ret = -EFAULT;
+
+    return ret;
+}
+
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d)
+int paging_teardown(struct domain *d)
 {
+    int rc;
+
     if ( hap_enabled(d) )
         hap_teardown(d);
     else
         shadow_teardown(d);
 
     /* clean up log dirty resources. */
-    paging_log_dirty_teardown(d);
+    rc = paging_free_log_dirty_bitmap(d, 0);
+    if ( rc == -EAGAIN )
+        return rc;
 
     /* Move populate-on-demand cache back to domain_list for destruction */
     p2m_pod_empty_cache(d);
+
+    return rc;
 }
 
 /* Call once all of the references to the domain have gone away */
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index c0afe2c..77a45f2 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -417,6 +417,7 @@ ENTRY(compat_hypercall_table)
         .quad compat_ni_hypercall
         .endr
         .quad do_mca                    /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-compat_hypercall_table)/8)
         .quad compat_ni_hypercall
         .endr
@@ -465,6 +466,7 @@ ENTRY(compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
         .byte 1 /* do_mca                   */
+        .byte 1 /* paging_domctl_continuation      */
         .rept NR_hypercalls-(.-compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 5beeccb..8870e84 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -766,6 +766,7 @@ ENTRY(hypercall_table)
         .quad do_ni_hypercall
         .endr
         .quad do_mca                /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-hypercall_table)/8)
         .quad do_ni_hypercall
         .endr
@@ -814,6 +815,7 @@ ENTRY(hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
         .byte 1 /* do_mca               */  /* 48 */
+        .byte 1 /* paging_domctl_continuation */
         .rept NR_hypercalls-(.-hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 6dbfaa5..9980d83 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -527,7 +527,6 @@ int domain_kill(struct domain *d)
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
         {
-            BUG_ON(rc != -EAGAIN);
             break;
         }
         if ( sched_move_domain(d, cpupool0) )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 1df8ea9..b477646 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -186,6 +186,20 @@ struct paging_domain {
     struct hap_domain       hap;
     /* log dirty support */
     struct log_dirty_domain log_dirty;
+
+    /* preemption handling */
+    struct {
+        const struct domain *dom;
+        unsigned int op;
+        union {
+            struct {
+                unsigned long done:PADDR_BITS - PAGE_SHIFT;
+                unsigned long i4:PAGETABLE_ORDER;
+                unsigned long i3:PAGETABLE_ORDER;
+            } log_dirty;
+        };
+    } preempt;
+
     /* alloc/free pages from the pool for paging-assistance structures
      * (used by p2m and log-dirty code for their tries) */
     struct page_info * (*alloc_page)(struct domain *d);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index cd7ee3b..dcc7471 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -133,9 +133,6 @@ struct paging_mode {
 /*****************************************************************************
  * Log dirty code */
 
-/* free log dirty bitmap resource */
-void paging_free_log_dirty_bitmap(struct domain *d);
-
 /* get the dirty bitmap for a specific range of pfns */
 void paging_log_dirty_range(struct domain *d,
                             unsigned long begin_pfn,
@@ -145,9 +142,6 @@ void paging_log_dirty_range(struct domain *d,
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);
 
-/* disable log dirty */
-int paging_log_dirty_disable(struct domain *d);
-
 /* log dirty initialization */
 void paging_log_dirty_init(struct domain *d,
                            int  (*enable_log_dirty)(struct domain *d),
@@ -203,10 +197,13 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags);
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming);
+
+/* Helper hypercall for dealing with continuations. */
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d);
+int paging_teardown(struct domain *d);
 
 /* Call once all of the references to the domain have gone away */
 void paging_final_teardown(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAW7-000154-8Q; Thu, 23 Oct 2014 05:00:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAW5-00014z-JO
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:00:53 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	34/E6-02959-48B88445; Thu, 23 Oct 2014 05:00:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1414040450!11007807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10027 invoked from network); 23 Oct 2014 05:00:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:00:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAW2-000480-G5
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:00:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAVJ-00018A-Fs
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:00:25 +0000
Date: Thu, 23 Oct 2014 05:00:05 +0000
Message-Id: <E1XhAVJ-00018A-Fs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: introduce assembly helper to
	call smc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4697555d2a2800a41d86c28cfaa1cca8037f3f06
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Oct 16 13:34:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:00:19 2014 +0100

    xen: arm: introduce assembly helper to call smc
    
    Commit 063188f4b3 "xen: arm: Add support for the Exynos secure firmware"
    introduced code assuming that exynos_smc() would get called with arguments in
    certain registers. While the "noinline" attribute guarantees the function to
    not get inlined, it does not guarantee that all arguments arrive in the assumed
    registers: gcc's interprocedural analysis can result in clone functions to be
    created where some of the incoming arguments (commonly when they have constant
    values) get replaced by putting in place the respective values inside the
    clone.
    
    Xen contains in multiple place of this SMC function: consolidate the function
    in a single place and write it in assembly.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reworded commit message as discussed ]
---
 xen/arch/arm/Makefile              |    1 +
 xen/arch/arm/platforms/exynos5.c   |   15 +--------------
 xen/arch/arm/platforms/seattle.c   |   12 ++----------
 xen/arch/arm/psci.c                |   34 ++++------------------------------
 xen/arch/arm/smc.S                 |   21 +++++++++++++++++++++
 xen/include/asm-arm/arm32/macros.h |    8 ++++++++
 xen/include/asm-arm/macros.h       |   16 ++++++++++++++++
 xen/include/asm-arm/processor.h    |    3 +++
 8 files changed, 56 insertions(+), 54 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 9a25290..41aba2e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -37,6 +37,7 @@ obj-y += hvm.o
 obj-y += device.o
 obj-y += decode.o
 obj-y += processor.o
+obj-y += smc.o
 
 #obj-bin-y += ....o
 
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index ac556cb..79e3a5f 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -37,19 +37,6 @@ static bool_t secure_firmware;
 
 #define SMC_CMD_CPU1BOOT            (-4)
 
-static noinline void exynos_smc(register_t function_id, register_t arg0,
-                                register_t arg1, register_t arg2)
-{
-    asm volatile(
-        __asmeq("%0", "r0")
-        __asmeq("%1", "r1")
-        __asmeq("%2", "r2")
-        __asmeq("%3", "r3")
-        "smc #0"
-        :
-        : "r" (function_id), "r" (arg0), "r" (arg1), "r" (arg2));
-}
-
 static int exynos5_init_time(void)
 {
     uint32_t reg;
@@ -263,7 +250,7 @@ static int exynos5_cpu_up(int cpu)
     iounmap(power);
 
     if ( secure_firmware )
-        exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
+        call_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
 
     return cpu_up_send_sgi(cpu);
 }
diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c
index edfc391..6cc5362 100644
--- a/xen/arch/arm/platforms/seattle.c
+++ b/xen/arch/arm/platforms/seattle.c
@@ -31,22 +31,14 @@ static const char * const seattle_dt_compat[] __initconst =
  * This is temporary until full PSCI-0.2 is supported.
  * Then, these function will be removed.
  */
-static noinline void seattle_smc_psci(register_t func_id)
-{
-    asm volatile(
-        "smc #0"
-        : "+r" (func_id)
-        :);
-}
-
 static void seattle_system_reset(void)
 {
-    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_RESET);
+    call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
 }
 
 static void seattle_system_off(void)
 {
-    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_OFF);
+    call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
 PLATFORM_START(seattle, "SEATTLE")
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 604ff4c..4066309 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -25,49 +25,23 @@
 
 uint32_t psci_ver;
 
-#ifdef CONFIG_ARM_32
-#define REG_PREFIX "r"
-#else
-#define REG_PREFIX "x"
-#endif
-
-static noinline int __invoke_psci_fn_smc(register_t function_id,
-                                         register_t arg0,
-                                         register_t arg1,
-                                         register_t arg2)
-{
-    asm volatile(
-        __asmeq("%0", REG_PREFIX"0")
-        __asmeq("%1", REG_PREFIX"1")
-        __asmeq("%2", REG_PREFIX"2")
-        __asmeq("%3", REG_PREFIX"3")
-        "smc #0"
-        : "+r" (function_id)
-        : "r" (arg0), "r" (arg1), "r" (arg2));
-
-    return function_id;
-}
-
-#undef REG_PREFIX
-
 static uint32_t psci_cpu_on_nr;
 
 int call_psci_cpu_on(int cpu)
 {
-    return __invoke_psci_fn_smc(psci_cpu_on_nr,
-                                cpu_logical_map(cpu), __pa(init_secondary), 0);
+    return call_smc(psci_cpu_on_nr, cpu_logical_map(cpu), __pa(init_secondary), 0);
 }
 
 void call_psci_system_off(void)
 {
     if ( psci_ver > XEN_PSCI_V_0_1 )
-        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
+        call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
 void call_psci_system_reset(void)
 {
     if ( psci_ver > XEN_PSCI_V_0_1 )
-        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
+        call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
 }
 
 int __init psci_is_smc_method(const struct dt_device_node *psci)
@@ -134,7 +108,7 @@ int __init psci_init_0_2(void)
     if ( ret )
         return -EINVAL;
 
-    psci_ver = __invoke_psci_fn_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
+    psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
 
     if ( psci_ver != XEN_PSCI_V_0_2 )
     {
diff --git a/xen/arch/arm/smc.S b/xen/arch/arm/smc.S
new file mode 100644
index 0000000..b8f1822
--- /dev/null
+++ b/xen/arch/arm/smc.S
@@ -0,0 +1,21 @@
+/*
+ * xen/arch/arm/smc.S
+ *
+ * Wrapper for Secure Monitors Calls
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/macros.h>
+
+ENTRY(call_smc)
+        smc   #0
+        ret
diff --git a/xen/include/asm-arm/arm32/macros.h b/xen/include/asm-arm/arm32/macros.h
new file mode 100644
index 0000000..a4e20aa
--- /dev/null
+++ b/xen/include/asm-arm/arm32/macros.h
@@ -0,0 +1,8 @@
+#ifndef __ASM_ARM_ARM32_MACROS_H
+#define __ASM_ARM_ARM32_MACROS_H
+
+    .macro ret
+        mov     pc, lr
+    .endm
+
+#endif /* __ASM_ARM_ARM32_MACROS_H */
diff --git a/xen/include/asm-arm/macros.h b/xen/include/asm-arm/macros.h
new file mode 100644
index 0000000..5d837cb
--- /dev/null
+++ b/xen/include/asm-arm/macros.h
@@ -0,0 +1,16 @@
+#ifndef __ASM_MACROS_H
+#define __ASM_MACROS_H
+
+#ifndef __ASSEMBLY__
+# error "This file should only be included in assembly file"
+#endif
+
+#if defined (CONFIG_ARM_32)
+# include <asm/arm32/macros.h>
+#elif defined(CONFIG_ARM_64)
+/* No specific ARM64 macros for now */
+#else
+# error "unknown ARM variant"
+#endif
+
+#endif /* __ASM_ARM_MACROS_H */
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index e719c26..b7ef817 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -614,6 +614,9 @@ void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
 void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
                            const struct vcpu_guest_core_regs *regs);
 
+int call_smc(register_t function_id, register_t arg0, register_t arg1,
+             register_t arg2);
+
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_ARM_PROCESSOR_H */
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAW7-000154-8Q; Thu, 23 Oct 2014 05:00:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAW5-00014z-JO
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:00:53 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	34/E6-02959-48B88445; Thu, 23 Oct 2014 05:00:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1414040450!11007807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10027 invoked from network); 23 Oct 2014 05:00:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:00:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAW2-000480-G5
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:00:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAVJ-00018A-Fs
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:00:25 +0000
Date: Thu, 23 Oct 2014 05:00:05 +0000
Message-Id: <E1XhAVJ-00018A-Fs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: introduce assembly helper to
	call smc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4697555d2a2800a41d86c28cfaa1cca8037f3f06
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Oct 16 13:34:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:00:19 2014 +0100

    xen: arm: introduce assembly helper to call smc
    
    Commit 063188f4b3 "xen: arm: Add support for the Exynos secure firmware"
    introduced code assuming that exynos_smc() would get called with arguments in
    certain registers. While the "noinline" attribute guarantees the function to
    not get inlined, it does not guarantee that all arguments arrive in the assumed
    registers: gcc's interprocedural analysis can result in clone functions to be
    created where some of the incoming arguments (commonly when they have constant
    values) get replaced by putting in place the respective values inside the
    clone.
    
    Xen contains in multiple place of this SMC function: consolidate the function
    in a single place and write it in assembly.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reworded commit message as discussed ]
---
 xen/arch/arm/Makefile              |    1 +
 xen/arch/arm/platforms/exynos5.c   |   15 +--------------
 xen/arch/arm/platforms/seattle.c   |   12 ++----------
 xen/arch/arm/psci.c                |   34 ++++------------------------------
 xen/arch/arm/smc.S                 |   21 +++++++++++++++++++++
 xen/include/asm-arm/arm32/macros.h |    8 ++++++++
 xen/include/asm-arm/macros.h       |   16 ++++++++++++++++
 xen/include/asm-arm/processor.h    |    3 +++
 8 files changed, 56 insertions(+), 54 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 9a25290..41aba2e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -37,6 +37,7 @@ obj-y += hvm.o
 obj-y += device.o
 obj-y += decode.o
 obj-y += processor.o
+obj-y += smc.o
 
 #obj-bin-y += ....o
 
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index ac556cb..79e3a5f 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -37,19 +37,6 @@ static bool_t secure_firmware;
 
 #define SMC_CMD_CPU1BOOT            (-4)
 
-static noinline void exynos_smc(register_t function_id, register_t arg0,
-                                register_t arg1, register_t arg2)
-{
-    asm volatile(
-        __asmeq("%0", "r0")
-        __asmeq("%1", "r1")
-        __asmeq("%2", "r2")
-        __asmeq("%3", "r3")
-        "smc #0"
-        :
-        : "r" (function_id), "r" (arg0), "r" (arg1), "r" (arg2));
-}
-
 static int exynos5_init_time(void)
 {
     uint32_t reg;
@@ -263,7 +250,7 @@ static int exynos5_cpu_up(int cpu)
     iounmap(power);
 
     if ( secure_firmware )
-        exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
+        call_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
 
     return cpu_up_send_sgi(cpu);
 }
diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c
index edfc391..6cc5362 100644
--- a/xen/arch/arm/platforms/seattle.c
+++ b/xen/arch/arm/platforms/seattle.c
@@ -31,22 +31,14 @@ static const char * const seattle_dt_compat[] __initconst =
  * This is temporary until full PSCI-0.2 is supported.
  * Then, these function will be removed.
  */
-static noinline void seattle_smc_psci(register_t func_id)
-{
-    asm volatile(
-        "smc #0"
-        : "+r" (func_id)
-        :);
-}
-
 static void seattle_system_reset(void)
 {
-    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_RESET);
+    call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
 }
 
 static void seattle_system_off(void)
 {
-    seattle_smc_psci(PSCI_0_2_FN_SYSTEM_OFF);
+    call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
 PLATFORM_START(seattle, "SEATTLE")
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 604ff4c..4066309 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -25,49 +25,23 @@
 
 uint32_t psci_ver;
 
-#ifdef CONFIG_ARM_32
-#define REG_PREFIX "r"
-#else
-#define REG_PREFIX "x"
-#endif
-
-static noinline int __invoke_psci_fn_smc(register_t function_id,
-                                         register_t arg0,
-                                         register_t arg1,
-                                         register_t arg2)
-{
-    asm volatile(
-        __asmeq("%0", REG_PREFIX"0")
-        __asmeq("%1", REG_PREFIX"1")
-        __asmeq("%2", REG_PREFIX"2")
-        __asmeq("%3", REG_PREFIX"3")
-        "smc #0"
-        : "+r" (function_id)
-        : "r" (arg0), "r" (arg1), "r" (arg2));
-
-    return function_id;
-}
-
-#undef REG_PREFIX
-
 static uint32_t psci_cpu_on_nr;
 
 int call_psci_cpu_on(int cpu)
 {
-    return __invoke_psci_fn_smc(psci_cpu_on_nr,
-                                cpu_logical_map(cpu), __pa(init_secondary), 0);
+    return call_smc(psci_cpu_on_nr, cpu_logical_map(cpu), __pa(init_secondary), 0);
 }
 
 void call_psci_system_off(void)
 {
     if ( psci_ver > XEN_PSCI_V_0_1 )
-        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
+        call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
 void call_psci_system_reset(void)
 {
     if ( psci_ver > XEN_PSCI_V_0_1 )
-        __invoke_psci_fn_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
+        call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
 }
 
 int __init psci_is_smc_method(const struct dt_device_node *psci)
@@ -134,7 +108,7 @@ int __init psci_init_0_2(void)
     if ( ret )
         return -EINVAL;
 
-    psci_ver = __invoke_psci_fn_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
+    psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);
 
     if ( psci_ver != XEN_PSCI_V_0_2 )
     {
diff --git a/xen/arch/arm/smc.S b/xen/arch/arm/smc.S
new file mode 100644
index 0000000..b8f1822
--- /dev/null
+++ b/xen/arch/arm/smc.S
@@ -0,0 +1,21 @@
+/*
+ * xen/arch/arm/smc.S
+ *
+ * Wrapper for Secure Monitors Calls
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/macros.h>
+
+ENTRY(call_smc)
+        smc   #0
+        ret
diff --git a/xen/include/asm-arm/arm32/macros.h b/xen/include/asm-arm/arm32/macros.h
new file mode 100644
index 0000000..a4e20aa
--- /dev/null
+++ b/xen/include/asm-arm/arm32/macros.h
@@ -0,0 +1,8 @@
+#ifndef __ASM_ARM_ARM32_MACROS_H
+#define __ASM_ARM_ARM32_MACROS_H
+
+    .macro ret
+        mov     pc, lr
+    .endm
+
+#endif /* __ASM_ARM_ARM32_MACROS_H */
diff --git a/xen/include/asm-arm/macros.h b/xen/include/asm-arm/macros.h
new file mode 100644
index 0000000..5d837cb
--- /dev/null
+++ b/xen/include/asm-arm/macros.h
@@ -0,0 +1,16 @@
+#ifndef __ASM_MACROS_H
+#define __ASM_MACROS_H
+
+#ifndef __ASSEMBLY__
+# error "This file should only be included in assembly file"
+#endif
+
+#if defined (CONFIG_ARM_32)
+# include <asm/arm32/macros.h>
+#elif defined(CONFIG_ARM_64)
+/* No specific ARM64 macros for now */
+#else
+# error "unknown ARM variant"
+#endif
+
+#endif /* __ASM_ARM_MACROS_H */
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index e719c26..b7ef817 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -614,6 +614,9 @@ void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
 void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
                            const struct vcpu_guest_core_regs *regs);
 
+int call_smc(register_t function_id, register_t arg0, register_t arg1,
+             register_t arg2);
+
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_ARM_PROCESSOR_H */
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWN-00015y-BR; Thu, 23 Oct 2014 05:01:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWL-00015p-RK
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:09 +0000
Received: from [193.109.254.147:62279] by server-2.bemta-14.messagelabs.com id
	37/91-07861-59B88445; Thu, 23 Oct 2014 05:01:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414040467!11955996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23000 invoked from network); 23 Oct 2014 05:01:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWJ-00048b-Ca
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWF-0001Ar-RP
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:07 +0000
Date: Thu, 23 Oct 2014 05:01:03 +0000
Message-Id: <E1XhAWF-0001Ar-RP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: point to correct location of
	README.remus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b264edffdf32e839977c7600c6de9d4bb3b7ffa1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Oct 19 18:48:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:23 2014 +0100

    README: point to correct location of README.remus
    
    The said file was moved in 20857ac ("remus: move remus README to docs
    directory").
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Yang Hongyang <yanghy@cn.fujitsu.com>
    Cc: Shriram Rajagopalan <rshriram@cs.ubc.ca>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Yang Hongyang <yanghy@cn.fujitsu.com>
---
 README |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/README b/README
index e860644..8162ec9 100644
--- a/README
+++ b/README
@@ -75,7 +75,7 @@ disabled at compile time:
     * systemd daemon development files
     * Development install of libnl3 (e.g., libnl-3-200,
       libnl-3-dev, etc).  Required if network buffering is desired
-      when using Remus with libxl.  See tools/remus/README for detailed
+      when using Remus with libxl.  See docs/README.remus for detailed
       information.
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWN-00015y-BR; Thu, 23 Oct 2014 05:01:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWL-00015p-RK
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:09 +0000
Received: from [193.109.254.147:62279] by server-2.bemta-14.messagelabs.com id
	37/91-07861-59B88445; Thu, 23 Oct 2014 05:01:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414040467!11955996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23000 invoked from network); 23 Oct 2014 05:01:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWJ-00048b-Ca
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWF-0001Ar-RP
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:07 +0000
Date: Thu, 23 Oct 2014 05:01:03 +0000
Message-Id: <E1XhAWF-0001Ar-RP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: point to correct location of
	README.remus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b264edffdf32e839977c7600c6de9d4bb3b7ffa1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Oct 19 18:48:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:23 2014 +0100

    README: point to correct location of README.remus
    
    The said file was moved in 20857ac ("remus: move remus README to docs
    directory").
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Yang Hongyang <yanghy@cn.fujitsu.com>
    Cc: Shriram Rajagopalan <rshriram@cs.ubc.ca>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Yang Hongyang <yanghy@cn.fujitsu.com>
---
 README |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/README b/README
index e860644..8162ec9 100644
--- a/README
+++ b/README
@@ -75,7 +75,7 @@ disabled at compile time:
     * systemd daemon development files
     * Development install of libnl3 (e.g., libnl-3-200,
       libnl-3-dev, etc).  Required if network buffering is desired
-      when using Remus with libxl.  See tools/remus/README for detailed
+      when using Remus with libxl.  See docs/README.remus for detailed
       information.
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWX-00016q-El; Thu, 23 Oct 2014 05:01:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWV-00016g-U7
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:20 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	20/12-10419-F9B88445; Thu, 23 Oct 2014 05:01:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1414040477!12095351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=BODY_RANDOM_LONG,
	SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20780 invoked from network); 23 Oct 2014 05:01:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWT-00048h-KU
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWT-0001BJ-IP
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:17 +0000
Date: Thu, 23 Oct 2014 05:01:17 +0000
Message-Id: <E1XhAWT-0001BJ-IP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/man: xl.pod.1: Fix build issue
	after commit 7471879
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 503eb59c926d0c2c9f8342e925f294e4496883b0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Oct 18 21:22:01 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:26 2014 +0100

    docs/man: xl.pod.1: Fix build issue after commit 7471879
    
    The commit 7471879 "tools: CMDs and APIs for Cache Monitoring Technology"
    has introduced a new section but forgot to add '=back'. This will result
    a build issue with newer podman:
    
    man/xl.pod.1 around line 1443: You forgot a '=back' before '=head1'
    
    or creating a section "POD ERRORS" with older one.
    
    At the same time, capitalize the title of the section to match the coding
    style used within the files.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.pod.1 |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 925cd7d..adc9f56 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1440,7 +1440,9 @@ Load FLASK policy from the given policy file. The initial policy is provided to
 the hypervisor as a multiboot module; this command allows runtime updates to the
 policy. Loading new security policy will reset runtime changes to device labels.
 
-=head1 Cache Monitoring Technology
+=back
+
+=head1 CACHE MONITORING TECHNOLOGY
 
 Intel Haswell and later server platforms offer monitoring capability in each
 logical processor to measure specific platform shared resource metric, for
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWX-00016q-El; Thu, 23 Oct 2014 05:01:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWV-00016g-U7
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:20 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	20/12-10419-F9B88445; Thu, 23 Oct 2014 05:01:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1414040477!12095351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=BODY_RANDOM_LONG,
	SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20780 invoked from network); 23 Oct 2014 05:01:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWT-00048h-KU
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWT-0001BJ-IP
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:17 +0000
Date: Thu, 23 Oct 2014 05:01:17 +0000
Message-Id: <E1XhAWT-0001BJ-IP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/man: xl.pod.1: Fix build issue
	after commit 7471879
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 503eb59c926d0c2c9f8342e925f294e4496883b0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Oct 18 21:22:01 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:26 2014 +0100

    docs/man: xl.pod.1: Fix build issue after commit 7471879
    
    The commit 7471879 "tools: CMDs and APIs for Cache Monitoring Technology"
    has introduced a new section but forgot to add '=back'. This will result
    a build issue with newer podman:
    
    man/xl.pod.1 around line 1443: You forgot a '=back' before '=head1'
    
    or creating a section "POD ERRORS" with older one.
    
    At the same time, capitalize the title of the section to match the coding
    style used within the files.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.pod.1 |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 925cd7d..adc9f56 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1440,7 +1440,9 @@ Load FLASK policy from the given policy file. The initial policy is provided to
 the hypervisor as a multiboot module; this command allows runtime updates to the
 policy. Loading new security policy will reset runtime changes to device labels.
 
-=head1 Cache Monitoring Technology
+=back
+
+=head1 CACHE MONITORING TECHNOLOGY
 
 Intel Haswell and later server platforms offer monitoring capability in each
 logical processor to measure specific platform shared resource metric, for
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWh-00018L-HS; Thu, 23 Oct 2014 05:01:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWg-00018C-Hu
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:30 +0000
Received: from [193.109.254.147:63542] by server-8.bemta-14.messagelabs.com id
	70/B5-01875-9AB88445; Thu, 23 Oct 2014 05:01:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414040488!11919747!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10643 invoked from network); 23 Oct 2014 05:01:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWd-00048n-Sq
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWd-0001Bj-Nt
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:27 +0000
Date: Thu, 23 Oct 2014 05:01:27 +0000
Message-Id: <E1XhAWd-0001Bj-Nt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Fix crash when
	p2m_lookup is used with an invalid IPA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eaba79e0a7d5d918860c98f729540cb1ca2b9050
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Oct 18 20:25:21 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    xen/arm: p2m: Fix crash when p2m_lookup is used with an invalid IPA
    
    Since the commit 58f0fd8 "xen: arm: handle variable p2m levels in p2m_lookup",
    Xen checks that the root_table offset is valid. If not, its unlock the p2m
    spinlock before returning an error. But, at this time, the lock has not been
    taken.
    
    On Xen built with debug=y, we can get the following stack trace if the guest
    use an invalid IPA in hypercall or mess-up the grant-table:
    
    (XEN) Assertion '_raw_spin_is_locked(lock)' failed at xen/include/asm/arm32/spinlock.h:22
    ...
    (XEN)    [<0022d1bc>] _spin_unlock+0x2c/0x50 (PC)
    (XEN)    [<00253264>] p2m_lookup+0x20c/0x230 (LR)
    (XEN)    [<7ffdfd54>] 7ffdfd54
    (XEN)    [<002539f4>] gmfn_to_mfn+0x24/0x3c
    (XEN)    [<0020e4d4>] __get_paged_frame+0x30/0x12c
    (XEN)    [<00210680>] __acquire_grant_for_copy+0x4e0/0x768
    (XEN)    [<00212030>] do_grant_table_op+0x13a0/0x2534
    (XEN)    [<00257b10>] do_trap_hypervisor+0xe10/0x1148
    (XEN)    [<0025b330>] return_from_trap+0/0x4
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1585d35..69191b9 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -207,9 +207,8 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t)
         *t = pte.p2m.type;
     }
 
-err:
     spin_unlock(&p2m->lock);
-
+err:
     return maddr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWh-00018L-HS; Thu, 23 Oct 2014 05:01:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWg-00018C-Hu
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:30 +0000
Received: from [193.109.254.147:63542] by server-8.bemta-14.messagelabs.com id
	70/B5-01875-9AB88445; Thu, 23 Oct 2014 05:01:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414040488!11919747!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10643 invoked from network); 23 Oct 2014 05:01:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWd-00048n-Sq
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWd-0001Bj-Nt
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:27 +0000
Date: Thu, 23 Oct 2014 05:01:27 +0000
Message-Id: <E1XhAWd-0001Bj-Nt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Fix crash when
	p2m_lookup is used with an invalid IPA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eaba79e0a7d5d918860c98f729540cb1ca2b9050
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sat Oct 18 20:25:21 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    xen/arm: p2m: Fix crash when p2m_lookup is used with an invalid IPA
    
    Since the commit 58f0fd8 "xen: arm: handle variable p2m levels in p2m_lookup",
    Xen checks that the root_table offset is valid. If not, its unlock the p2m
    spinlock before returning an error. But, at this time, the lock has not been
    taken.
    
    On Xen built with debug=y, we can get the following stack trace if the guest
    use an invalid IPA in hypercall or mess-up the grant-table:
    
    (XEN) Assertion '_raw_spin_is_locked(lock)' failed at xen/include/asm/arm32/spinlock.h:22
    ...
    (XEN)    [<0022d1bc>] _spin_unlock+0x2c/0x50 (PC)
    (XEN)    [<00253264>] p2m_lookup+0x20c/0x230 (LR)
    (XEN)    [<7ffdfd54>] 7ffdfd54
    (XEN)    [<002539f4>] gmfn_to_mfn+0x24/0x3c
    (XEN)    [<0020e4d4>] __get_paged_frame+0x30/0x12c
    (XEN)    [<00210680>] __acquire_grant_for_copy+0x4e0/0x768
    (XEN)    [<00212030>] do_grant_table_op+0x13a0/0x2534
    (XEN)    [<00257b10>] do_trap_hypervisor+0xe10/0x1148
    (XEN)    [<0025b330>] return_from_trap+0/0x4
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1585d35..69191b9 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -207,9 +207,8 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t)
         *t = pte.p2m.type;
     }
 
-err:
     spin_unlock(&p2m->lock);
-
+err:
     return maddr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWt-0001A9-K6; Thu, 23 Oct 2014 05:01:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWs-00019o-2Y
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:42 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A5/82-10419-5BB88445; Thu, 23 Oct 2014 05:01:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1414040498!12095445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23450 invoked from network); 23 Oct 2014 05:01:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWo-00048v-5P
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWo-0001C9-2F
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:38 +0000
Date: Thu, 23 Oct 2014 05:01:38 +0000
Message-Id: <E1XhAWo-0001C9-2F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: flush_tlb_domain: Disable IRQ
	when flushing TLB of another domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9bb013c878f2de645bb588938542d936e9bb2e58
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Oct 17 17:14:44 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    xen/arm: flush_tlb_domain: Disable IRQ when flushing TLB of another domain
    
    When Xen is flushing the TLB for another domain than current, it has to
    switch temporarily to the P2M of this domain. If IRQs are enabled, it may
    be possible to receive an interrupt that requires the use the P2M of the current
    domain, or even temporarily switch to another P2M.
    For the former case, the translation would be wrong. For the latter one,
    as the handler would restore the current P2M, Xen would flush the wrong domain
    TLB.
    
    Thankfully we don't have such interrupt handler, but it may be necessary
    in the future to do that during when the user asks to dump domain stack via
    a keystroke.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- spelling in the commit log ]
---
 xen/arch/arm/p2m.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 69191b9..76d2369 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -112,17 +112,25 @@ void p2m_restore_state(struct vcpu *n)
 
 void flush_tlb_domain(struct domain *d)
 {
+    unsigned long flags = 0;
+
     /* Update the VTTBR if necessary with the domain d. In this case,
      * it's only necessary to flush TLBs on every CPUs with the current VMID
      * (our domain).
      */
     if ( d != current->domain )
+    {
+        local_irq_save(flags);
         p2m_load_VTTBR(d);
+    }
 
     flush_tlb();
 
     if ( d != current->domain )
+    {
         p2m_load_VTTBR(current->domain);
+        local_irq_restore(flags);
+    }
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAWt-0001A9-K6; Thu, 23 Oct 2014 05:01:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWs-00019o-2Y
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:42 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A5/82-10419-5BB88445; Thu, 23 Oct 2014 05:01:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1414040498!12095445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23450 invoked from network); 23 Oct 2014 05:01:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWo-00048v-5P
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWo-0001C9-2F
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:38 +0000
Date: Thu, 23 Oct 2014 05:01:38 +0000
Message-Id: <E1XhAWo-0001C9-2F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: flush_tlb_domain: Disable IRQ
	when flushing TLB of another domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9bb013c878f2de645bb588938542d936e9bb2e58
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Oct 17 17:14:44 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    xen/arm: flush_tlb_domain: Disable IRQ when flushing TLB of another domain
    
    When Xen is flushing the TLB for another domain than current, it has to
    switch temporarily to the P2M of this domain. If IRQs are enabled, it may
    be possible to receive an interrupt that requires the use the P2M of the current
    domain, or even temporarily switch to another P2M.
    For the former case, the translation would be wrong. For the latter one,
    as the handler would restore the current P2M, Xen would flush the wrong domain
    TLB.
    
    Thankfully we don't have such interrupt handler, but it may be necessary
    in the future to do that during when the user asks to dump domain stack via
    a keystroke.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- spelling in the commit log ]
---
 xen/arch/arm/p2m.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 69191b9..76d2369 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -112,17 +112,25 @@ void p2m_restore_state(struct vcpu *n)
 
 void flush_tlb_domain(struct domain *d)
 {
+    unsigned long flags = 0;
+
     /* Update the VTTBR if necessary with the domain d. In this case,
      * it's only necessary to flush TLBs on every CPUs with the current VMID
      * (our domain).
      */
     if ( d != current->domain )
+    {
+        local_irq_save(flags);
         p2m_load_VTTBR(d);
+    }
 
     flush_tlb();
 
     if ( d != current->domain )
+    {
         p2m_load_VTTBR(current->domain);
+        local_irq_restore(flags);
+    }
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAX2-0001BZ-MY; Thu, 23 Oct 2014 05:01:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAX0-0001BH-PK
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:50 +0000
Received: from [193.109.254.147:58489] by server-5.bemta-14.messagelabs.com id
	2C/64-28255-EBB88445; Thu, 23 Oct 2014 05:01:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414040508!11919811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12627 invoked from network); 23 Oct 2014 05:01:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWy-000491-Cw
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWy-0001DE-A6
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:48 +0000
Date: Thu, 23 Oct 2014 05:01:48 +0000
Message-Id: <E1XhAWy-0001DE-A6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix a couple of log messages to
	print correct errnos
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 916d33f787fb0935a07257fc11bcbb3ddfa6eb08
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 16 18:44:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    libxl: Fix a couple of log messages to print correct errnos
    
    xc_domain_create and xc_cpupool_movedomain do not return errno values;
    they return -1 and set errno.  Fix the logging accordingly.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reviewed-by: Don Slutz <dslutz@verizon.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 8b82584..8ae9701 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -515,14 +515,14 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
 
     ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid);
     if (ret < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, ret, "domain creation fail");
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain creation fail");
         rc = ERROR_FAIL;
         goto out;
     }
 
     ret = xc_cpupool_movedomain(ctx->xch, info->poolid, *domid);
     if (ret < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, ret, "domain move fail");
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain move fail");
         rc = ERROR_FAIL;
         goto out;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:01:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:01:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAX2-0001BZ-MY; Thu, 23 Oct 2014 05:01:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAX0-0001BH-PK
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:50 +0000
Received: from [193.109.254.147:58489] by server-5.bemta-14.messagelabs.com id
	2C/64-28255-EBB88445; Thu, 23 Oct 2014 05:01:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414040508!11919811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12627 invoked from network); 23 Oct 2014 05:01:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:01:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWy-000491-Cw
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAWy-0001DE-A6
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:48 +0000
Date: Thu, 23 Oct 2014 05:01:48 +0000
Message-Id: <E1XhAWy-0001DE-A6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix a couple of log messages to
	print correct errnos
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 916d33f787fb0935a07257fc11bcbb3ddfa6eb08
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 16 18:44:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    libxl: Fix a couple of log messages to print correct errnos
    
    xc_domain_create and xc_cpupool_movedomain do not return errno values;
    they return -1 and set errno.  Fix the logging accordingly.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reviewed-by: Don Slutz <dslutz@verizon.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 8b82584..8ae9701 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -515,14 +515,14 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
 
     ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid);
     if (ret < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, ret, "domain creation fail");
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain creation fail");
         rc = ERROR_FAIL;
         goto out;
     }
 
     ret = xc_cpupool_movedomain(ctx->xch, info->poolid, *domid);
     if (ret < 0) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, ret, "domain move fail");
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain move fail");
         rc = ERROR_FAIL;
         goto out;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXC-0001D3-Rc; Thu, 23 Oct 2014 05:02:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXB-0001Cp-Hr
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:01 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	74/55-02954-8CB88445; Thu, 23 Oct 2014 05:02:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1414040519!7884117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29615 invoked from network); 23 Oct 2014 05:02:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAX8-00049A-Lc
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAX8-0001Db-JH
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:58 +0000
Date: Thu, 23 Oct 2014 05:01:58 +0000
Message-Id: <E1XhAX8-0001Db-JH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Avoid fd leak of qemu state fd
	during migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3091ae8de31fd65432d0e2d3b2b31b9042225f48
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 16 18:44:13 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    libxl: Avoid fd leak of qemu state fd during migration
    
    In a long-running process (such as virt-manager) this might eventually
    run the process out of fds.
    
    That qemu argument construction might generate an fd that needs to be
    fed to qemu is a bit odd, but we just run with it and provide a
    parameter to the qemu argument construction code for this purpose.
    
    There is no need to use the carefd machinery, because leaking the odd
    copy of this descriptor into a child unexpectedly forked out of
    another thread, is fine.  We just don't want to leak it back to the
    main process.
    
    Reported-by: ustermann.max@web.de
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d8992bb..b7c8a99 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -403,7 +403,8 @@ static char *dm_spice_options(libxl__gc *gc,
 static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
+                                        const libxl__domain_build_state *state,
+                                        int *dm_state_fd)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     const libxl_domain_create_info *c_info = &guest_config->c_info;
@@ -677,9 +678,9 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
 
     if (state->saved_state) {
         /* This file descriptor is meant to be used by QEMU */
-        int migration_fd = open(state->saved_state, O_RDONLY);
+        *dm_state_fd = open(state->saved_state, O_RDONLY);
         flexarray_append(dm_args, "-incoming");
-        flexarray_append(dm_args, libxl__sprintf(gc, "fd:%d", migration_fd));
+        flexarray_append(dm_args, GCSPRINTF("fd:%d",*dm_state_fd));
     }
     for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
         flexarray_append(dm_args, b_info->extra[i]);
@@ -792,7 +793,10 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
 static char ** libxl__build_device_model_args(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
+                                        const libxl__domain_build_state *state,
+                                        int *dm_state_fd)
+/* dm_state_fd may be NULL iff caller knows we are using old stubdom
+ * and therefore will be passing a filename rather than a fd. */
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
 
@@ -802,9 +806,11 @@ static char ** libxl__build_device_model_args(libxl__gc *gc,
                                                   guest_domid, guest_config,
                                                   state);
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        assert(dm_state_fd != NULL);
+        assert(*dm_state_fd < 0);
         return libxl__build_device_model_args_new(gc, dm,
                                                   guest_domid, guest_config,
-                                                  state);
+                                                  state, dm_state_fd);
     default:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
                          guest_config->b_info.device_model_version);
@@ -1016,7 +1022,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
         goto out;
 
     args = libxl__build_device_model_args(gc, "stubdom-dm", guest_domid,
-                                          guest_config, d_state);
+                                          guest_config, d_state, NULL);
     if (!args) {
         ret = ERROR_FAIL;
         goto out;
@@ -1268,6 +1274,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
     char *vm_path;
     char **pass_stuff;
     const char *dm;
+    int dm_state_fd = -1;
 
     if (libxl_defbool_val(b_info->device_model_stubdomain)) {
         abort();
@@ -1284,7 +1291,8 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
         rc = ERROR_FAIL;
         goto out;
     }
-    args = libxl__build_device_model_args(gc, dm, domid, guest_config, state);
+    args = libxl__build_device_model_args(gc, dm, domid, guest_config, state,
+                                          &dm_state_fd);
     if (!args) {
         rc = ERROR_FAIL;
         goto out;
@@ -1377,6 +1385,7 @@ out_close:
     if (null >= 0) close(null);
     if (logfile_w >= 0) close(logfile_w);
 out:
+    if (dm_state_fd >= 0) close(dm_state_fd);
     if (rc)
         device_model_spawn_outcome(egc, dmss, rc);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXC-0001D3-Rc; Thu, 23 Oct 2014 05:02:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXB-0001Cp-Hr
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:01 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	74/55-02954-8CB88445; Thu, 23 Oct 2014 05:02:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1414040519!7884117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29615 invoked from network); 23 Oct 2014 05:02:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAX8-00049A-Lc
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAX8-0001Db-JH
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:01:58 +0000
Date: Thu, 23 Oct 2014 05:01:58 +0000
Message-Id: <E1XhAX8-0001Db-JH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Avoid fd leak of qemu state fd
	during migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3091ae8de31fd65432d0e2d3b2b31b9042225f48
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 16 18:44:13 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    libxl: Avoid fd leak of qemu state fd during migration
    
    In a long-running process (such as virt-manager) this might eventually
    run the process out of fds.
    
    That qemu argument construction might generate an fd that needs to be
    fed to qemu is a bit odd, but we just run with it and provide a
    parameter to the qemu argument construction code for this purpose.
    
    There is no need to use the carefd machinery, because leaking the odd
    copy of this descriptor into a child unexpectedly forked out of
    another thread, is fine.  We just don't want to leak it back to the
    main process.
    
    Reported-by: ustermann.max@web.de
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index d8992bb..b7c8a99 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -403,7 +403,8 @@ static char *dm_spice_options(libxl__gc *gc,
 static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
+                                        const libxl__domain_build_state *state,
+                                        int *dm_state_fd)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     const libxl_domain_create_info *c_info = &guest_config->c_info;
@@ -677,9 +678,9 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
 
     if (state->saved_state) {
         /* This file descriptor is meant to be used by QEMU */
-        int migration_fd = open(state->saved_state, O_RDONLY);
+        *dm_state_fd = open(state->saved_state, O_RDONLY);
         flexarray_append(dm_args, "-incoming");
-        flexarray_append(dm_args, libxl__sprintf(gc, "fd:%d", migration_fd));
+        flexarray_append(dm_args, GCSPRINTF("fd:%d",*dm_state_fd));
     }
     for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
         flexarray_append(dm_args, b_info->extra[i]);
@@ -792,7 +793,10 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
 static char ** libxl__build_device_model_args(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
-                                        const libxl__domain_build_state *state)
+                                        const libxl__domain_build_state *state,
+                                        int *dm_state_fd)
+/* dm_state_fd may be NULL iff caller knows we are using old stubdom
+ * and therefore will be passing a filename rather than a fd. */
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
 
@@ -802,9 +806,11 @@ static char ** libxl__build_device_model_args(libxl__gc *gc,
                                                   guest_domid, guest_config,
                                                   state);
     case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+        assert(dm_state_fd != NULL);
+        assert(*dm_state_fd < 0);
         return libxl__build_device_model_args_new(gc, dm,
                                                   guest_domid, guest_config,
-                                                  state);
+                                                  state, dm_state_fd);
     default:
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown device model version %d",
                          guest_config->b_info.device_model_version);
@@ -1016,7 +1022,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
         goto out;
 
     args = libxl__build_device_model_args(gc, "stubdom-dm", guest_domid,
-                                          guest_config, d_state);
+                                          guest_config, d_state, NULL);
     if (!args) {
         ret = ERROR_FAIL;
         goto out;
@@ -1268,6 +1274,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
     char *vm_path;
     char **pass_stuff;
     const char *dm;
+    int dm_state_fd = -1;
 
     if (libxl_defbool_val(b_info->device_model_stubdomain)) {
         abort();
@@ -1284,7 +1291,8 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
         rc = ERROR_FAIL;
         goto out;
     }
-    args = libxl__build_device_model_args(gc, dm, domid, guest_config, state);
+    args = libxl__build_device_model_args(gc, dm, domid, guest_config, state,
+                                          &dm_state_fd);
     if (!args) {
         rc = ERROR_FAIL;
         goto out;
@@ -1377,6 +1385,7 @@ out_close:
     if (null >= 0) close(null);
     if (logfile_w >= 0) close(logfile_w);
 out:
+    if (dm_state_fd >= 0) close(dm_state_fd);
     if (rc)
         device_model_spawn_outcome(egc, dmss, rc);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXN-0001Fg-0F; Thu, 23 Oct 2014 05:02:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXL-0001FR-0r
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:11 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	93/1C-02952-2DB88445; Thu, 23 Oct 2014 05:02:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1414040529!4048735!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 745 invoked from network); 23 Oct 2014 05:02:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXI-00049j-Qv
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXI-0001E9-P6
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:08 +0000
Date: Thu, 23 Oct 2014 05:02:08 +0000
Message-Id: <E1XhAXI-0001E9-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: remove references to unneeded
	python helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68b19524a8fb81e94059317b7616d09cf5b135fd
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 16 14:48:00 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    README: remove references to unneeded python helpers
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |   23 +----------------------
 1 files changed, 1 insertions(+), 22 deletions(-)

diff --git a/README b/README
index 8162ec9..ac160a5 100644
--- a/README
+++ b/README
@@ -184,33 +184,12 @@ For more details refer to the xen xenstored systemd wiki page [3].
 Python Runtime Libraries
 ========================
 
-Xend (the Xen daemon) has the following runtime dependencies:
+Various tools, such as pygrub, have the following runtime dependencies:
 
     * Python 2.3 or later.
-      In some distros, the XML-aspects to the standard library
-      (xml.dom.minidom etc) are broken out into a separate python-xml package.
-      This is also required.
-      In more recent versions of Debian and Ubuntu the XML-aspects are included
-      in the base python package however (python-xml has been removed
-      from Debian in squeeze and from Ubuntu in intrepid).
-
           URL:    http://www.python.org/
           Debian: python
 
-    * For optional SSL support, pyOpenSSL:
-          URL:    http://pyopenssl.sourceforge.net/
-          Debian: python-pyopenssl
-
-    * For optional PAM support, PyPAM:
-          URL:    http://www.pangalactic.org/PyPAM/
-          Debian: python-pam
-
-    * For optional XenAPI support in XM, lxml:
-          URL:    http://lxml.de/
-          Debian: python-lxml
-          YUM:    python-lxml
-
-
 Intel(R) Trusted Execution Technology Support
 =============================================
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXN-0001Fg-0F; Thu, 23 Oct 2014 05:02:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXL-0001FR-0r
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:11 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	93/1C-02952-2DB88445; Thu, 23 Oct 2014 05:02:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1414040529!4048735!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 745 invoked from network); 23 Oct 2014 05:02:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXI-00049j-Qv
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXI-0001E9-P6
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:08 +0000
Date: Thu, 23 Oct 2014 05:02:08 +0000
Message-Id: <E1XhAXI-0001E9-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: remove references to unneeded
	python helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68b19524a8fb81e94059317b7616d09cf5b135fd
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 16 14:48:00 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:27 2014 +0100

    README: remove references to unneeded python helpers
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |   23 +----------------------
 1 files changed, 1 insertions(+), 22 deletions(-)

diff --git a/README b/README
index 8162ec9..ac160a5 100644
--- a/README
+++ b/README
@@ -184,33 +184,12 @@ For more details refer to the xen xenstored systemd wiki page [3].
 Python Runtime Libraries
 ========================
 
-Xend (the Xen daemon) has the following runtime dependencies:
+Various tools, such as pygrub, have the following runtime dependencies:
 
     * Python 2.3 or later.
-      In some distros, the XML-aspects to the standard library
-      (xml.dom.minidom etc) are broken out into a separate python-xml package.
-      This is also required.
-      In more recent versions of Debian and Ubuntu the XML-aspects are included
-      in the base python package however (python-xml has been removed
-      from Debian in squeeze and from Ubuntu in intrepid).
-
           URL:    http://www.python.org/
           Debian: python
 
-    * For optional SSL support, pyOpenSSL:
-          URL:    http://pyopenssl.sourceforge.net/
-          Debian: python-pyopenssl
-
-    * For optional PAM support, PyPAM:
-          URL:    http://www.pangalactic.org/PyPAM/
-          Debian: python-pam
-
-    * For optional XenAPI support in XM, lxml:
-          URL:    http://lxml.de/
-          Debian: python-lxml
-          YUM:    python-lxml
-
-
 Intel(R) Trusted Execution Technology Support
 =============================================
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXW-0001Gw-2g; Thu, 23 Oct 2014 05:02:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXV-0001Gn-Ax
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:21 +0000
Received: from [193.109.254.147:31480] by server-12.bemta-14.messagelabs.com
	id 32/34-01461-CDB88445; Thu, 23 Oct 2014 05:02:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1414040539!11944977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22790 invoked from network); 23 Oct 2014 05:02:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXT-00049p-24
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXT-0001EW-0V
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:19 +0000
Date: Thu, 23 Oct 2014 05:02:19 +0000
Message-Id: <E1XhAXT-0001EW-0V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: replace memset() with
	libxl__device_console_init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9991ecd77484f855a7bf90845f37e87f768c74f1
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:26 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    libxl: replace memset() with libxl__device_console_init
    
    The current implementation of libxl__device_console_init does the same
    memset() so this is identical for now.
    
    If libxl__device_console_init changes in future (e.g. to prefer a non-zero
    default value for some field) then this will continue to work.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_create.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 8ae9701..ca10fac 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -389,7 +389,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
 static int init_console_info(libxl__device_console *console, int dev_num)
 {
-    memset(console, 0x00, sizeof(libxl__device_console));
+    libxl__device_console_init(console);
     console->devid = dev_num;
     console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
     console->output = strdup("pty");
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXW-0001Gw-2g; Thu, 23 Oct 2014 05:02:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXV-0001Gn-Ax
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:21 +0000
Received: from [193.109.254.147:31480] by server-12.bemta-14.messagelabs.com
	id 32/34-01461-CDB88445; Thu, 23 Oct 2014 05:02:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1414040539!11944977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22790 invoked from network); 23 Oct 2014 05:02:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXT-00049p-24
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXT-0001EW-0V
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:19 +0000
Date: Thu, 23 Oct 2014 05:02:19 +0000
Message-Id: <E1XhAXT-0001EW-0V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: replace memset() with
	libxl__device_console_init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9991ecd77484f855a7bf90845f37e87f768c74f1
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:26 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    libxl: replace memset() with libxl__device_console_init
    
    The current implementation of libxl__device_console_init does the same
    memset() so this is identical for now.
    
    If libxl__device_console_init changes in future (e.g. to prefer a non-zero
    default value for some field) then this will continue to work.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_create.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 8ae9701..ca10fac 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -389,7 +389,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
 static int init_console_info(libxl__device_console *console, int dev_num)
 {
-    memset(console, 0x00, sizeof(libxl__device_console));
+    libxl__device_console_init(console);
     console->devid = dev_num;
     console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
     console->output = strdup("pty");
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXi-0001If-5b; Thu, 23 Oct 2014 05:02:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXg-0001IR-Ui
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:33 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	18/60-02699-8EB88445; Thu, 23 Oct 2014 05:02:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1414040549!11740980!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11224 invoked from network); 23 Oct 2014 05:02:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXd-00049x-DU
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXd-0001Ey-86
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:29 +0000
Date: Thu, 23 Oct 2014 05:02:29 +0000
Message-Id: <E1XhAXd-0001Ey-86@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: add support for 'channels'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91418eecea197bf66e59ab50c85d82866acb15d8
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:27 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    libxl: add support for 'channels'
    
    A 'channel':
      - is a low-bandwidth private communication channel that resembles
        a physical serial port.
      - is implemented as a PV console with a well-known string name
        which is used to hook the channel to the appropriate software
        in the guest (i.e. some kind of guest agent).
      - has a backend 'connection' which describes what should happen
        to the data.
    
    The following 'connection' types are defined:
    
     * PTY: the I/O surfaces as a pty in the backend domain
     * SOCKET: a listening Unix domain socket accepts a connection in
       the backend domain and proxies
    
    Channels may be listed but don't currently support hotplug/unplug.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/channel.txt                |  106 +++++++++++++
 docs/misc/console.txt                |   69 +++++++--
 tools/libxl/libxl.c                  |  273 +++++++++++++++++++++++++++++++---
 tools/libxl/libxl.h                  |   20 +++
 tools/libxl/libxl_create.c           |   43 ++++--
 tools/libxl/libxl_dm.c               |   46 ++++++-
 tools/libxl/libxl_internal.h         |   10 +-
 tools/libxl/libxl_types.idl          |   37 +++++
 tools/libxl/libxl_types_internal.idl |    5 +
 9 files changed, 555 insertions(+), 54 deletions(-)

diff --git a/docs/misc/channel.txt b/docs/misc/channel.txt
new file mode 100644
index 0000000..9fc701a
--- /dev/null
+++ b/docs/misc/channel.txt
@@ -0,0 +1,106 @@
+Xen PV Channels
+===============
+
+A channel is a low-bandwidth private byte stream similar to a serial
+link. Typical uses of channels are
+
+  1. to provide initial configuration information to a VM on boot
+     (example use: CloudStack's cloud-early-config service)
+  2. to signal/query an in-guest agent
+     (example use: oVirt's guest agent)
+
+Channels are similar to virtio-serial devices and emulated serial links.
+Channels are intended to be used in the implementation of libvirt <channel>s
+when running on Xen.
+
+Note: if an application requires a high-bandwidth link then it should use
+vchan instead.
+
+How to use channels: an example
+-------------------------------
+
+Consider a cloud deployment where VMs are cloned from pre-made templates,
+and customised on first boot by an in-guest agent which sets the IP address,
+hostname, ssh keys etc. To install the system the cloud administrator would
+first:
+
+  1. Install a guest as normal (no channel configuration necessary)
+  2. Install the in-guest agent specific to the cloud software. This will
+     prepare the guest to communicate over the channel, and also prepare
+     the guest to be cloned safely (sometimes known as "sysprepping")
+  3. Shutdown the guest
+  4. Register the guest as a template with the cloud orchestration software
+  5. Install the cloud orchestration agent in dom0
+
+At runtime, when a cloud tenant requests that a VM is created from the template,
+the sequence of events would be: (assuming a Linux domU)
+
+  1. A VM is "cloned" from the template
+  2. A unique Unix domain socket path in dom0 is allocated
+     (e.g. /my/cloud/software/talk/to/domain/<vm uuid>)
+  3. Domain configuration is created for the VM, listing the channel
+     name expected by the in-guest agent. In xl syntax this would be:
+
+     channel = [ "connection=socket, name=org.my.cloud.software.agent.version1,
+                  path = /my/cloud/software/talk/to/domain/<vm uuid>" ]
+
+  4. The VM is started
+  5. In dom0 the cloud orchestration agent connects to the Unix domain
+     socket, writes a handshake message and waits for a reply
+  6. Assuming the guest kernel has CONFIG_HVC_XEN_FRONTEND set then the console
+     driver will generate a hotplug event
+  7. A udev rule is activated by the hotplug event.
+
+     The udev rule would look something like:
+
+     SUBSYSTEM=="xen", DEVPATH=="/devices/console-[0-9]", RUN+="xen-console-setup"
+
+     where the "xen-console-setup" script would read the channel name and
+     make a symlink in /dev/xen-channel/org.my.cloud.software.agent.version1
+
+  8. The in-guest agent uses inotify to see the creation of the /dev/xen-channel
+     symlink and opens the device.
+  9. The in-guest agent completes the handshake with the dom0 agent
+ 10. The dom0 agent transmits the unique VM configuration: hostname, IP
+     address, ssh keys etc etc
+ 11. The in-guest agent receives the configuration and applies it.
+
+Using channels avoids having to use a temporary disk device or network
+connection.
+
+Design recommendations and pitfalls
+-----------------------------------
+
+It's necessary to install channel-specific software (an "agent") into the guest
+before you can use a channel. By default a channel will appear as a device
+which could be mistaken for a serial port or regular console. It is known
+that some software will proactively seek out serial ports and issue AT commands
+at them; make sure such software is disabled!
+
+Since channels are identified by names, application authors must ensure their
+channel names are unique to avoid clashes. We recommend that channel names
+include parts unique to the application such as a domain names. To assist
+prevent clashes we recommend authors add their names to our global channel
+registry at the end of this document.
+
+Limitations
+-----------
+
+Hotplug and unplug of channels is not currently implemented.
+
+Channel name registry
+---------------------
+
+It is important that channel names are globally unique. To help ensure
+that no-one's name clashes with yours, please add yours to this list.
+
+Key:
+N: Name
+C: Contact
+D: Short description of use, possibly including a URL to your software
+   or API
+
+N: org.xenproject.guest.clipboard.0.1
+C: David Scott <dave.scott@citrix.com>
+D: Share clipboard data via an in-guest agent. See:
+   http://wiki.xenproject.org/wiki/Clipboard_sharing_protocol
diff --git a/docs/misc/console.txt b/docs/misc/console.txt
index 8a53a95..ed7b795 100644
--- a/docs/misc/console.txt
+++ b/docs/misc/console.txt
@@ -9,10 +9,11 @@ relevant information in xenstore under /local/domain/$DOMID/console.
 
 Now many years after the introduction of the pv console we have
 multiple pv consoles support for pv and hvm guests; multiple pv
-console backends (qemu and xenconsoled) and emulated serial cards too.
+console backends (qemu and xenconsoled, see limitations below) and
+emulated serial cards too.
 
 This document tries to describe how the whole system works and how the
-different components interact with each others.
+different components interact with each other.
 
 The first PV console path in xenstore remains:
 
@@ -23,28 +24,63 @@ live in:
 
 /local/domain/$DOMID/device/console/$DEVID.
 
-The output of a PV console, whether it should be a file, a pty, a
-socket, or something else, is specified by the toolstack in the xenstore
-node "output", under the relevant console section.
-For example:
+PV consoles have
+* (optional) string names;
+* 'connection' information describing to what they should be
+  connected; and
+* a 'type' indicating which daemon should process the data.
+
+We call a PV console with a name a "channel", in reference to the libvirt
+concept with the same name and purpose. The file "channels.txt" describes
+how to use channels and includes a registry of well-known channel names.
+
+If the PV console has a name (i.e. it is a "channel") then the name
+is written to the frontend directory:
+
+name = <name>
+
+If the PV console has no name (i.e. it is a regular console) then the "name"
+key is omitted.
+
+The toolstack writes 'connection' information in the xenstore backend in
+the keys
+* connection: either 'pty' or 'socket'
+* path: only present if connection = 'socket', the path of the socket to
+  glue the channel to
+
+An artifact of the current implementation, the toolstack will write an
+extra backend key
+* output: an identifier only meaningful for qemu/xenconsoled
 
-# xenstore-read /local/domain/26/device/console/1/output
-pty
+If the toolstack wants the console to be connected to a pty, it will write
+to the backend:
 
-The backend chosen for a particular console is specified by the
-toolstack in the "type" node on xenstore, under the relevant console
-section.
+connection = pty
+output = pty
+
+The backend will write the pty device name to the "tty" node in the
+console frontend.
+
+If the toolstack wants a listening Unix domain socket to be created at path
+<path>, a connection accepted and data proxied to the console, it will write:
+
+connection = socket
+path = <path>
+output = chardev:<some internal identifier>
+
+where chardev:<some internal identifier> matches a qemu character device
+configured on the qemu command-line.
+
+The backend implementation daemon chosen for a particular console is specified
+by the toolstack in the "type" node in the xenstore frontend.
 For example:
 
 # xenstore-read /local/domain/26/console/1/type
-xenconsoled
+ioemu
 
 The supported values are only xenconsoled or ioemu; xenconsoled has
 several limitations: it can only be used for the first PV console and it
-can only have a pty as output.
-
-If the output is a pty, backends write the device name to the "tty" node
-in xenstore under the relevant console path.
+can only connect to a pty.
 
 Emulated serials are provided by qemu-dm only to hvm guests; the number
 of emulated serials depends on how many "-serial" command line options
@@ -54,7 +90,6 @@ xenstore in the following path:
 
 /local/domain/$DOMID/serial/$SERIAL_NUM/tty
 
-
 xenconsole is the tool to connect to a PV console or an emulated serial
 that has a pty as output. Xenconsole takes a domid as parameter plus an
 optional console type (pv for PV consoles or serial for emulated
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9c72df2..f27b581 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -21,6 +21,15 @@
 #define PAGE_TO_MEMKB(pages) ((pages) * 4)
 #define BACKEND_STRING_SIZE 5
 
+/* Utility to read backend xenstore keys */
+#define READ_BACKEND(tgc, subpath) ({                                   \
+        rc = libxl__xs_read_checked(tgc, XBT_NULL,                      \
+                                    GCSPRINTF("%s/" subpath, be_path),  \
+                                    &tmp);                              \
+        if (rc) goto out;                                               \
+        (char*)tmp;                                                     \
+    });
+
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags, xentoollog_logger * lg)
 {
@@ -3383,14 +3392,6 @@ static int libxl__device_nic_from_xs_be(libxl__gc *gc,
 
     libxl_device_nic_init(nic);
 
-#define READ_BACKEND(tgc, subpath) ({                                   \
-        rc = libxl__xs_read_checked(tgc, XBT_NULL,                      \
-                                    GCSPRINTF("%s/" subpath, be_path),  \
-                                    &tmp);                              \
-        if (rc) goto out;                                               \
-        (char*)tmp;                                                     \
-    });
-
     tmp = READ_BACKEND(gc, "handle");
     if (tmp)
         nic->devid = atoi(tmp);
@@ -3570,28 +3571,33 @@ const char *libxl__device_nic_devname(libxl__gc *gc,
 /******************************************************************************/
 int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
                               libxl__device_console *console,
-                              libxl__domain_build_state *state)
+                              libxl__domain_build_state *state,
+                              libxl__device *device)
 {
     flexarray_t *front, *ro_front;
     flexarray_t *back;
-    libxl__device device;
     int rc;
 
     if (console->devid && state) {
         rc = ERROR_INVAL;
         goto out;
     }
+    if (!console->devid && (console->name || console->path)) {
+        LOG(ERROR, "Primary console has invalid configuration");
+        rc = ERROR_INVAL;
+        goto out;
+    }
 
     front = flexarray_make(gc, 16, 1);
     ro_front = flexarray_make(gc, 16, 1);
     back = flexarray_make(gc, 16, 1);
 
-    device.backend_devid = console->devid;
-    device.backend_domid = console->backend_domid;
-    device.backend_kind = LIBXL__DEVICE_KIND_CONSOLE;
-    device.devid = console->devid;
-    device.domid = domid;
-    device.kind = LIBXL__DEVICE_KIND_CONSOLE;
+    device->backend_devid = console->devid;
+    device->backend_domid = console->backend_domid;
+    device->backend_kind = LIBXL__DEVICE_KIND_CONSOLE;
+    device->devid = console->devid;
+    device->domid = domid;
+    device->kind = LIBXL__DEVICE_KIND_CONSOLE;
 
     flexarray_append(back, "frontend-id");
     flexarray_append(back, libxl__sprintf(gc, "%d", domid));
@@ -3604,6 +3610,19 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
     flexarray_append(back, "protocol");
     flexarray_append(back, LIBXL_XENCONSOLE_PROTOCOL);
 
+    if (console->name) {
+        flexarray_append(ro_front, "name");
+        flexarray_append(ro_front, console->name);
+    }
+    if (console->connection) {
+        flexarray_append(back, "connection");
+        flexarray_append(back, console->connection);
+    }
+    if (console->path) {
+        flexarray_append(back, "path");
+        flexarray_append(back, console->path);
+    }
+
     flexarray_append(front, "backend-id");
     flexarray_append(front, libxl__sprintf(gc, "%d", console->backend_domid));
 
@@ -3630,8 +3649,7 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
         flexarray_append(front, "protocol");
         flexarray_append(front, LIBXL_XENCONSOLE_PROTOCOL);
     }
-
-    libxl__device_generic_add(gc, XBT_NULL, &device,
+    libxl__device_generic_add(gc, XBT_NULL, device,
                               libxl__xs_kvs_of_flexarray(gc, back, back->count),
                               libxl__xs_kvs_of_flexarray(gc, front, front->count),
                               libxl__xs_kvs_of_flexarray(gc, ro_front, ro_front->count));
@@ -3642,6 +3660,221 @@ out:
 
 /******************************************************************************/
 
+int libxl__init_console_from_channel(libxl__gc *gc,
+                                     libxl__device_console *console,
+                                     int dev_num,
+                                     libxl_device_channel *channel)
+{
+    int rc;
+
+    libxl__device_console_init(console);
+
+    /* Perform validation first, allocate second. */
+
+    if (!channel->name) {
+        LOG(ERROR, "channel %d has no name", channel->devid);
+        return ERROR_INVAL;
+    }
+
+    if (channel->backend_domname) {
+        rc = libxl_domain_qualifier_to_domid(CTX, channel->backend_domname,
+                                             &channel->backend_domid);
+        if (rc < 0) return rc;
+    }
+
+    /* The xenstore 'output' node tells the backend what to connect the console
+       to. If the channel has "connection = pty" then the "output" node will be
+       set to "pty". If the channel has "connection = socket" then the "output"
+       node will be set to "chardev:libxl-channel%d". This tells the qemu
+       backend to proxy data between the console ring and the character device
+       with id "libxl-channel%d". These character devices are currently defined
+       on the qemu command-line via "-chardev" options in libxl_dm.c */
+
+    switch (channel->connection) {
+        case LIBXL_CHANNEL_CONNECTION_UNKNOWN:
+            LOG(ERROR, "channel %d has no defined connection; "
+                "to where should it be connected?", channel->devid);
+            return ERROR_INVAL;
+        case LIBXL_CHANNEL_CONNECTION_PTY:
+            console->connection = libxl__strdup(NOGC, "pty");
+            console->output = libxl__sprintf(NOGC, "pty");
+            break;
+        case LIBXL_CHANNEL_CONNECTION_SOCKET:
+            if (!channel->u.socket.path) {
+                LOG(ERROR, "channel %d has no path", channel->devid);
+                return ERROR_INVAL;
+            }
+            console->connection = libxl__strdup(NOGC, "socket");
+            console->path = libxl__strdup(NOGC, channel->u.socket.path);
+            console->output = libxl__sprintf(NOGC, "chardev:libxl-channel%d",
+                                             channel->devid);
+            break;
+        default:
+            /* We've forgotten to add the clause */
+            LOG(ERROR, "%s: missing implementation for channel connection %d",
+                __func__, channel->connection);
+            abort();
+    }
+
+    console->devid = dev_num;
+    console->consback = LIBXL__CONSOLE_BACKEND_IOEMU;
+    console->backend_domid = channel->backend_domid;
+    console->name = libxl__strdup(NOGC, channel->name);
+
+    return 0;
+}
+
+static int libxl__device_channel_from_xs_be(libxl__gc *gc,
+                                            const char *be_path,
+                                            libxl_device_channel *channel)
+{
+    const char *tmp;
+    int rc;
+
+    libxl_device_channel_init(channel);
+
+    /* READ_BACKEND is from libxl__device_nic_from_xs_be above */
+    channel->name = READ_BACKEND(NOGC, "name");
+    tmp = READ_BACKEND(gc, "connection");
+    if (!strcmp(tmp, "pty")) {
+        channel->connection = LIBXL_CHANNEL_CONNECTION_PTY;
+    } else if (!strcmp(tmp, "socket")) {
+        channel->connection = LIBXL_CHANNEL_CONNECTION_SOCKET;
+        channel->u.socket.path = READ_BACKEND(NOGC, "path");
+    } else {
+        rc = ERROR_INVAL;
+        goto out;
+    }
+
+    rc = 0;
+ out:
+    return rc;
+}
+
+static int libxl__append_channel_list_of_type(libxl__gc *gc,
+                                              uint32_t domid,
+                                              const char *type,
+                                              libxl_device_channel **channels,
+                                              int *nchannels)
+{
+    char *fe_path = NULL, *be_path = NULL;
+    char **dir = NULL;
+    unsigned int n = 0, devid = 0;
+    libxl_device_channel *next = NULL;
+    int rc = 0, i;
+
+    fe_path = GCSPRINTF("%s/device/%s",
+                        libxl__xs_get_dompath(gc, domid), type);
+    dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &n);
+    if (!dir || !n)
+      goto out;
+
+    for (i = 0; i < n; i++) {
+        const char *p, *name;
+        libxl_device_channel *tmp;
+
+        p = libxl__sprintf(gc, "%s/%s", fe_path, dir[i]);
+        name = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/name", p));
+        /* 'channels' are consoles with names, so ignore all consoles
+           without names */
+        if (!name) continue;
+        be_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend", p));
+        tmp = realloc(*channels,
+                      sizeof(libxl_device_channel) * (*nchannels + devid + 1));
+        if (!tmp) {
+          rc = ERROR_NOMEM;
+          goto out;
+        }
+        *channels = tmp;
+        next = *channels + *nchannels + devid;
+        rc = libxl__device_channel_from_xs_be(gc, be_path, next);
+        if (rc) goto out;
+        next->devid = devid;
+        devid++;
+    }
+    *nchannels += devid;
+    return 0;
+
+ out:
+    return rc;
+}
+
+libxl_device_channel *libxl_device_channel_list(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                int *num)
+{
+    GC_INIT(ctx);
+    libxl_device_channel *channels = NULL;
+    int rc;
+
+    *num = 0;
+
+    rc = libxl__append_channel_list_of_type(gc, domid, "console", &channels, num);
+    if (rc) goto out_err;
+
+    GC_FREE;
+    return channels;
+
+out_err:
+    LOG(ERROR, "Unable to list channels");
+    while (*num) {
+        (*num)--;
+        libxl_device_channel_dispose(&channels[*num]);
+    }
+    free(channels);
+    return NULL;
+}
+
+int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 libxl_device_channel *channel,
+                                 libxl_channelinfo *channelinfo)
+{
+    GC_INIT(ctx);
+    char *dompath, *fe_path;
+    char *val;
+
+    dompath = libxl__xs_get_dompath(gc, domid);
+    channelinfo->devid = channel->devid;
+
+    fe_path = libxl__sprintf(gc, "%s/device/console/%d", dompath,
+                             channelinfo->devid + 1);
+    channelinfo->backend = xs_read(ctx->xsh, XBT_NULL,
+                                   libxl__sprintf(gc, "%s/backend",
+                                   fe_path), NULL);
+    if (!channelinfo->backend) {
+        GC_FREE;
+        return ERROR_FAIL;
+    }
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend-id", fe_path));
+    channelinfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", fe_path));
+    channelinfo->state = val ? strtoul(val, NULL, 10) : -1;
+    channelinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
+                                    GCSPRINTF("%s/frontend",
+                                    channelinfo->backend), NULL);
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id",
+                         channelinfo->backend));
+    channelinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", fe_path));
+    channelinfo->rref = val ? strtoul(val, NULL, 10) : -1;
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/port", fe_path));
+    channelinfo->evtch = val ? strtoul(val, NULL, 10) : -1;
+
+    channelinfo->connection = channel->connection;
+    switch (channel->connection) {
+         case LIBXL_CHANNEL_CONNECTION_PTY:
+             val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/tty", fe_path));
+             channelinfo->u.pty.path = strdup(val);
+             break;
+         default:
+             break;
+    }
+    GC_FREE;
+    return 0;
+}
+
+/******************************************************************************/
+
 int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
     int rc;
@@ -3906,6 +4139,10 @@ DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
 DEFINE_DEVICE_REMOVE(vtpm, remove, 0)
 DEFINE_DEVICE_REMOVE(vtpm, destroy, 1)
 
+/* channel/console hotunplug is not implemented. There are 2 possibilities:
+ * 1. add support for secondary consoles to xenconsoled
+ * 2. dynamically add/remove qemu chardevs via qmp messages. */
+
 #undef DEFINE_DEVICE_REMOVE
 
 /******************************************************************************/
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 3568e1e..28b614f 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -596,6 +596,15 @@ typedef struct libxl__ctx libxl_ctx;
  */
 #define LIBXL_HAVE_BUILDINFO_KERNEL 1
 
+/*
+ * LIBXL_HAVE_DEVICE_CHANNEL
+ *
+ * If this is defined, then the libxl_device_channel struct exists
+ * and channels can be attached to a domain. Channels manifest as consoles
+ * with names, see docs/misc/console.txt.
+ */
+#define LIBXL_HAVE_DEVICE_CHANNEL 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
@@ -1157,6 +1166,17 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
+/*
+ * Virtual Channels
+ * Channels manifest as consoles with names, see docs/misc/channels.txt
+ */
+libxl_device_channel *libxl_device_channel_list(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                int *num);
+int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 libxl_device_channel *channel,
+                                 libxl_channelinfo *channelinfo);
+
 /* Virtual TPMs */
 int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
                           const libxl_asyncop_how *ao_how)
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ca10fac..4b33d07 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -387,15 +387,16 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     return 0;
 }
 
-static int init_console_info(libxl__device_console *console, int dev_num)
+static void init_console_info(libxl__gc *gc,
+                             libxl__device_console *console,
+                             int dev_num)
 {
     libxl__device_console_init(console);
     console->devid = dev_num;
     console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
-    console->output = strdup("pty");
-    if (!console->output)
-        return ERROR_NOMEM;
-    return 0;
+    console->output = libxl__strdup(NOGC, "pty");
+    /* console->{name,connection,path} are NULL on normal consoles.
+       Only 'channels' when mapped to consoles have a string name. */
 }
 
 int libxl__domain_build(libxl__gc *gc,
@@ -1194,17 +1195,31 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         }
     }
 
+    /* For both HVM and PV the 0th console is a regular console. We
+       map channels to IOEMU consoles starting at 1 */
+    for (i = 0; i < d_config->num_channels; i++) {
+        libxl__device_console console;
+        libxl__device device;
+        ret = libxl__init_console_from_channel(gc, &console, i + 1,
+                                               &d_config->channels[i]);
+        if ( ret ) {
+            libxl__device_console_dispose(&console);
+            goto error_out;
+        }
+        libxl__device_console_add(gc, domid, &console, NULL, &device);
+        libxl__device_console_dispose(&console);
+    }
+
     switch (d_config->c_info.type) {
     case LIBXL_DOMAIN_TYPE_HVM:
     {
         libxl__device_console console;
+        libxl__device device;
         libxl_device_vkb vkb;
 
-        ret = init_console_info(&console, 0);
-        if ( ret )
-            goto error_out;
+        init_console_info(gc, &console, 0);
         console.backend_domid = state->console_domid;
-        libxl__device_console_add(gc, domid, &console, state);
+        libxl__device_console_add(gc, domid, &console, state, &device);
         libxl__device_console_dispose(&console);
 
         libxl_device_vkb_init(&vkb);
@@ -1231,22 +1246,22 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
     {
         int need_qemu = 0;
         libxl__device_console console;
+        libxl__device device;
 
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl__device_vfb_add(gc, domid, &d_config->vfbs[i]);
             libxl__device_vkb_add(gc, domid, &d_config->vkbs[i]);
         }
 
-        ret = init_console_info(&console, 0);
-        if ( ret )
-            goto error_out;
+        init_console_info(gc, &console, 0);
 
         need_qemu = libxl__need_xenpv_qemu(gc, 1, &console,
                 d_config->num_vfbs, d_config->vfbs,
-                d_config->num_disks, &d_config->disks[0]);
+                d_config->num_disks, &d_config->disks[0],
+                d_config->num_channels, &d_config->channels[0]);
 
         console.backend_domid = state->console_domid;
-        libxl__device_console_add(gc, domid, &console, state);
+        libxl__device_console_add(gc, domid, &console, state, &device);
         libxl__device_console_dispose(&console);
 
         if (need_qemu) {
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index b7c8a99..14dc9fa 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -417,8 +417,9 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     const libxl_sdl_info *sdl = dm_sdl(guest_config);
     const char *keymap = dm_keymap(guest_config);
     flexarray_t *dm_args;
-    int i;
+    int i, connection, devid;
     uint64_t ram_size;
+    const char *path, *chardev;
 
     dm_args = flexarray_make(gc, 16, 1);
 
@@ -435,6 +436,28 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
+    for (i = 0; i < guest_config->num_channels; i++) {
+        connection = guest_config->channels[i].connection;
+        devid = guest_config->channels[i].devid;
+        switch (connection) {
+            case LIBXL_CHANNEL_CONNECTION_PTY:
+                chardev = GCSPRINTF("pty,id=libxl-channel%d", devid);
+                break;
+            case LIBXL_CHANNEL_CONNECTION_SOCKET:
+                path = guest_config->channels[i].u.socket.path;
+                chardev = GCSPRINTF("socket,id=libxl-channel%d,path=%s,"
+                                    "server,nowait", devid, path);
+                break;
+            default:
+                /* We've forgotten to add the clause */
+                LOG(ERROR, "%s: unknown channel connection %d",
+                    __func__, connection);
+                return NULL;
+        }
+        flexarray_append(dm_args, "-chardev");
+        flexarray_append(dm_args, (void*)chardev);
+    }
+
     /*
      * Remove default devices created by qemu. Qemu will create only devices
      * defined by xen, since the devices not defined by xen are not usable.
@@ -1122,6 +1145,7 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
     }
 
     for (i = 0; i < num_console; i++) {
+        libxl__device device;
         console[i].devid = i;
         console[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU;
         /* STUBDOM_CONSOLE_LOGGING (console 0) is for minios logging
@@ -1152,7 +1176,8 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
                 break;
         }
         ret = libxl__device_console_add(gc, dm_domid, &console[i],
-                        i == STUBDOM_CONSOLE_LOGGING ? stubdom_state : NULL);
+                        i == STUBDOM_CONSOLE_LOGGING ? stubdom_state : NULL,
+                        &device);
         if (ret)
             goto out;
     }
@@ -1575,7 +1600,8 @@ int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid)
 int libxl__need_xenpv_qemu(libxl__gc *gc,
         int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
-        int nr_disks, libxl_device_disk *disks)
+        int nr_disks, libxl_device_disk *disks,
+        int nr_channels, libxl_device_channel *channels)
 {
     int i, ret = 0;
     uint32_t domid;
@@ -1615,6 +1641,20 @@ int libxl__need_xenpv_qemu(libxl__gc *gc,
         }
     }
 
+    if (nr_channels > 0) {
+        ret = libxl__get_domid(gc, &domid);
+        if (ret) goto out;
+        for (i = 0; i < nr_channels; i++) {
+            if (channels[i].backend_domid == domid) {
+                /* xenconsoled is limited to the first console only.
+                   Until this restriction is removed we must use qemu for
+                   secondary consoles which includes all channels. */
+                ret = 1;
+                goto out;
+            }
+        }
+    }
+
 out:
     return ret;
 }
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 7ed601e..4361421 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1034,7 +1034,8 @@ _hidden int libxl__device_disk_dev_number(const char *virtpath,
 
 _hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
                                       libxl__device_console *console,
-                                      libxl__domain_build_state *state);
+                                      libxl__domain_build_state *state,
+                                      libxl__device *device);
 
 /* Returns 1 if device exists, 0 if not, ERROR_* (<0) on error. */
 _hidden int libxl__device_exists(libxl__gc *gc, xs_transaction_t t,
@@ -1050,6 +1051,10 @@ _hidden int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
                                     const char *state);
 _hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev,
                             libxl_nic_type *nictype);
+_hidden int libxl__init_console_from_channel(libxl__gc *gc,
+                                             libxl__device_console *console,
+                                             int dev_num,
+                                             libxl_device_channel *channel);
 
 /*
  * For each aggregate type which can be used as an input we provide:
@@ -1469,7 +1474,8 @@ _hidden const char *libxl__domain_device_model(libxl__gc *gc,
 _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
         int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
-        int nr_disks, libxl_device_disk *disks);
+        int nr_disks, libxl_device_disk *disks,
+        int nr_channels, libxl_device_channel *channels);
 
 /*
  * This function will cause the whole libxl process to hang
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index df572c7..fdda761 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -71,6 +71,12 @@ libxl_domain_type = Enumeration("domain_type", [
     (2, "PV"),
     ], init_val = "LIBXL_DOMAIN_TYPE_INVALID")
 
+libxl_channel_connection = Enumeration("channel_connection", [
+    (0, "UNKNOWN"),
+    (1, "PTY"),
+    (2, "SOCKET"), # a listening Unix domain socket
+    ])
+
 libxl_device_model_version = Enumeration("device_model_version", [
     (0, "UNKNOWN"),
     (1, "QEMU_XEN_TRADITIONAL"), # Historical qemu-xen device model (qemu-dm)
@@ -279,6 +285,22 @@ libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("cpumap",      libxl_bitmap)
     ], dir=DIR_OUT)
 
+libxl_channelinfo = Struct("channelinfo", [
+    ("backend", string),
+    ("backend_id", uint32),
+    ("frontend", string),
+    ("frontend_id", uint32),
+    ("devid", libxl_devid),
+    ("state", integer),
+    ("evtch", integer),
+    ("rref", integer),
+    ("u", KeyedUnion(None, libxl_channel_connection, "connection",
+           [("unknown", None),
+            ("pty", Struct(None, [("path", string),])),
+            ("socket", None),
+           ])),
+    ], dir=DIR_OUT)
+
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
@@ -504,6 +526,18 @@ libxl_device_vtpm = Struct("device_vtpm", [
     ("uuid",             libxl_uuid),
 ])
 
+libxl_device_channel = Struct("device_channel", [
+    ("backend_domid", libxl_domid),
+    ("backend_domname", string),
+    ("devid", libxl_devid),
+    ("name", string),
+    ("u", KeyedUnion(None, libxl_channel_connection, "connection",
+           [("unknown", None),
+            ("pty", None),
+            ("socket", Struct(None, [("path", string)])),
+           ])),
+])
+
 libxl_domain_config = Struct("domain_config", [
     ("c_info", libxl_domain_create_info),
     ("b_info", libxl_domain_build_info),
@@ -514,6 +548,9 @@ libxl_domain_config = Struct("domain_config", [
     ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
     ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
     ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
+    # a channel manifests as a console with a name,
+    # see docs/misc/channels.txt
+    ("channels", Array(libxl_device_channel, "num_channels")),
 
     ("on_poweroff", libxl_action_on_shutdown),
     ("on_reboot", libxl_action_on_shutdown),
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
index 800361b..5e55685 100644
--- a/tools/libxl/libxl_types_internal.idl
+++ b/tools/libxl/libxl_types_internal.idl
@@ -34,6 +34,11 @@ libxl__device_console = Struct("device_console", [
     ("devid", integer),
     ("consback", libxl__console_backend),
     ("output", string),
+    # A regular console has no name.
+    # A console with a name is called a 'channel', see docs/misc/channels.txt
+    ("name", string),
+    ("connection", string),
+    ("path", string),
     ])
 
 libxl__device_action = Enumeration("device_action", [
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXi-0001If-5b; Thu, 23 Oct 2014 05:02:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXg-0001IR-Ui
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:33 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	18/60-02699-8EB88445; Thu, 23 Oct 2014 05:02:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1414040549!11740980!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11224 invoked from network); 23 Oct 2014 05:02:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXd-00049x-DU
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXd-0001Ey-86
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:29 +0000
Date: Thu, 23 Oct 2014 05:02:29 +0000
Message-Id: <E1XhAXd-0001Ey-86@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: add support for 'channels'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91418eecea197bf66e59ab50c85d82866acb15d8
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:27 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    libxl: add support for 'channels'
    
    A 'channel':
      - is a low-bandwidth private communication channel that resembles
        a physical serial port.
      - is implemented as a PV console with a well-known string name
        which is used to hook the channel to the appropriate software
        in the guest (i.e. some kind of guest agent).
      - has a backend 'connection' which describes what should happen
        to the data.
    
    The following 'connection' types are defined:
    
     * PTY: the I/O surfaces as a pty in the backend domain
     * SOCKET: a listening Unix domain socket accepts a connection in
       the backend domain and proxies
    
    Channels may be listed but don't currently support hotplug/unplug.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/channel.txt                |  106 +++++++++++++
 docs/misc/console.txt                |   69 +++++++--
 tools/libxl/libxl.c                  |  273 +++++++++++++++++++++++++++++++---
 tools/libxl/libxl.h                  |   20 +++
 tools/libxl/libxl_create.c           |   43 ++++--
 tools/libxl/libxl_dm.c               |   46 ++++++-
 tools/libxl/libxl_internal.h         |   10 +-
 tools/libxl/libxl_types.idl          |   37 +++++
 tools/libxl/libxl_types_internal.idl |    5 +
 9 files changed, 555 insertions(+), 54 deletions(-)

diff --git a/docs/misc/channel.txt b/docs/misc/channel.txt
new file mode 100644
index 0000000..9fc701a
--- /dev/null
+++ b/docs/misc/channel.txt
@@ -0,0 +1,106 @@
+Xen PV Channels
+===============
+
+A channel is a low-bandwidth private byte stream similar to a serial
+link. Typical uses of channels are
+
+  1. to provide initial configuration information to a VM on boot
+     (example use: CloudStack's cloud-early-config service)
+  2. to signal/query an in-guest agent
+     (example use: oVirt's guest agent)
+
+Channels are similar to virtio-serial devices and emulated serial links.
+Channels are intended to be used in the implementation of libvirt <channel>s
+when running on Xen.
+
+Note: if an application requires a high-bandwidth link then it should use
+vchan instead.
+
+How to use channels: an example
+-------------------------------
+
+Consider a cloud deployment where VMs are cloned from pre-made templates,
+and customised on first boot by an in-guest agent which sets the IP address,
+hostname, ssh keys etc. To install the system the cloud administrator would
+first:
+
+  1. Install a guest as normal (no channel configuration necessary)
+  2. Install the in-guest agent specific to the cloud software. This will
+     prepare the guest to communicate over the channel, and also prepare
+     the guest to be cloned safely (sometimes known as "sysprepping")
+  3. Shutdown the guest
+  4. Register the guest as a template with the cloud orchestration software
+  5. Install the cloud orchestration agent in dom0
+
+At runtime, when a cloud tenant requests that a VM is created from the template,
+the sequence of events would be: (assuming a Linux domU)
+
+  1. A VM is "cloned" from the template
+  2. A unique Unix domain socket path in dom0 is allocated
+     (e.g. /my/cloud/software/talk/to/domain/<vm uuid>)
+  3. Domain configuration is created for the VM, listing the channel
+     name expected by the in-guest agent. In xl syntax this would be:
+
+     channel = [ "connection=socket, name=org.my.cloud.software.agent.version1,
+                  path = /my/cloud/software/talk/to/domain/<vm uuid>" ]
+
+  4. The VM is started
+  5. In dom0 the cloud orchestration agent connects to the Unix domain
+     socket, writes a handshake message and waits for a reply
+  6. Assuming the guest kernel has CONFIG_HVC_XEN_FRONTEND set then the console
+     driver will generate a hotplug event
+  7. A udev rule is activated by the hotplug event.
+
+     The udev rule would look something like:
+
+     SUBSYSTEM=="xen", DEVPATH=="/devices/console-[0-9]", RUN+="xen-console-setup"
+
+     where the "xen-console-setup" script would read the channel name and
+     make a symlink in /dev/xen-channel/org.my.cloud.software.agent.version1
+
+  8. The in-guest agent uses inotify to see the creation of the /dev/xen-channel
+     symlink and opens the device.
+  9. The in-guest agent completes the handshake with the dom0 agent
+ 10. The dom0 agent transmits the unique VM configuration: hostname, IP
+     address, ssh keys etc etc
+ 11. The in-guest agent receives the configuration and applies it.
+
+Using channels avoids having to use a temporary disk device or network
+connection.
+
+Design recommendations and pitfalls
+-----------------------------------
+
+It's necessary to install channel-specific software (an "agent") into the guest
+before you can use a channel. By default a channel will appear as a device
+which could be mistaken for a serial port or regular console. It is known
+that some software will proactively seek out serial ports and issue AT commands
+at them; make sure such software is disabled!
+
+Since channels are identified by names, application authors must ensure their
+channel names are unique to avoid clashes. We recommend that channel names
+include parts unique to the application such as a domain names. To assist
+prevent clashes we recommend authors add their names to our global channel
+registry at the end of this document.
+
+Limitations
+-----------
+
+Hotplug and unplug of channels is not currently implemented.
+
+Channel name registry
+---------------------
+
+It is important that channel names are globally unique. To help ensure
+that no-one's name clashes with yours, please add yours to this list.
+
+Key:
+N: Name
+C: Contact
+D: Short description of use, possibly including a URL to your software
+   or API
+
+N: org.xenproject.guest.clipboard.0.1
+C: David Scott <dave.scott@citrix.com>
+D: Share clipboard data via an in-guest agent. See:
+   http://wiki.xenproject.org/wiki/Clipboard_sharing_protocol
diff --git a/docs/misc/console.txt b/docs/misc/console.txt
index 8a53a95..ed7b795 100644
--- a/docs/misc/console.txt
+++ b/docs/misc/console.txt
@@ -9,10 +9,11 @@ relevant information in xenstore under /local/domain/$DOMID/console.
 
 Now many years after the introduction of the pv console we have
 multiple pv consoles support for pv and hvm guests; multiple pv
-console backends (qemu and xenconsoled) and emulated serial cards too.
+console backends (qemu and xenconsoled, see limitations below) and
+emulated serial cards too.
 
 This document tries to describe how the whole system works and how the
-different components interact with each others.
+different components interact with each other.
 
 The first PV console path in xenstore remains:
 
@@ -23,28 +24,63 @@ live in:
 
 /local/domain/$DOMID/device/console/$DEVID.
 
-The output of a PV console, whether it should be a file, a pty, a
-socket, or something else, is specified by the toolstack in the xenstore
-node "output", under the relevant console section.
-For example:
+PV consoles have
+* (optional) string names;
+* 'connection' information describing to what they should be
+  connected; and
+* a 'type' indicating which daemon should process the data.
+
+We call a PV console with a name a "channel", in reference to the libvirt
+concept with the same name and purpose. The file "channels.txt" describes
+how to use channels and includes a registry of well-known channel names.
+
+If the PV console has a name (i.e. it is a "channel") then the name
+is written to the frontend directory:
+
+name = <name>
+
+If the PV console has no name (i.e. it is a regular console) then the "name"
+key is omitted.
+
+The toolstack writes 'connection' information in the xenstore backend in
+the keys
+* connection: either 'pty' or 'socket'
+* path: only present if connection = 'socket', the path of the socket to
+  glue the channel to
+
+An artifact of the current implementation, the toolstack will write an
+extra backend key
+* output: an identifier only meaningful for qemu/xenconsoled
 
-# xenstore-read /local/domain/26/device/console/1/output
-pty
+If the toolstack wants the console to be connected to a pty, it will write
+to the backend:
 
-The backend chosen for a particular console is specified by the
-toolstack in the "type" node on xenstore, under the relevant console
-section.
+connection = pty
+output = pty
+
+The backend will write the pty device name to the "tty" node in the
+console frontend.
+
+If the toolstack wants a listening Unix domain socket to be created at path
+<path>, a connection accepted and data proxied to the console, it will write:
+
+connection = socket
+path = <path>
+output = chardev:<some internal identifier>
+
+where chardev:<some internal identifier> matches a qemu character device
+configured on the qemu command-line.
+
+The backend implementation daemon chosen for a particular console is specified
+by the toolstack in the "type" node in the xenstore frontend.
 For example:
 
 # xenstore-read /local/domain/26/console/1/type
-xenconsoled
+ioemu
 
 The supported values are only xenconsoled or ioemu; xenconsoled has
 several limitations: it can only be used for the first PV console and it
-can only have a pty as output.
-
-If the output is a pty, backends write the device name to the "tty" node
-in xenstore under the relevant console path.
+can only connect to a pty.
 
 Emulated serials are provided by qemu-dm only to hvm guests; the number
 of emulated serials depends on how many "-serial" command line options
@@ -54,7 +90,6 @@ xenstore in the following path:
 
 /local/domain/$DOMID/serial/$SERIAL_NUM/tty
 
-
 xenconsole is the tool to connect to a PV console or an emulated serial
 that has a pty as output. Xenconsole takes a domid as parameter plus an
 optional console type (pv for PV consoles or serial for emulated
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9c72df2..f27b581 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -21,6 +21,15 @@
 #define PAGE_TO_MEMKB(pages) ((pages) * 4)
 #define BACKEND_STRING_SIZE 5
 
+/* Utility to read backend xenstore keys */
+#define READ_BACKEND(tgc, subpath) ({                                   \
+        rc = libxl__xs_read_checked(tgc, XBT_NULL,                      \
+                                    GCSPRINTF("%s/" subpath, be_path),  \
+                                    &tmp);                              \
+        if (rc) goto out;                                               \
+        (char*)tmp;                                                     \
+    });
+
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags, xentoollog_logger * lg)
 {
@@ -3383,14 +3392,6 @@ static int libxl__device_nic_from_xs_be(libxl__gc *gc,
 
     libxl_device_nic_init(nic);
 
-#define READ_BACKEND(tgc, subpath) ({                                   \
-        rc = libxl__xs_read_checked(tgc, XBT_NULL,                      \
-                                    GCSPRINTF("%s/" subpath, be_path),  \
-                                    &tmp);                              \
-        if (rc) goto out;                                               \
-        (char*)tmp;                                                     \
-    });
-
     tmp = READ_BACKEND(gc, "handle");
     if (tmp)
         nic->devid = atoi(tmp);
@@ -3570,28 +3571,33 @@ const char *libxl__device_nic_devname(libxl__gc *gc,
 /******************************************************************************/
 int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
                               libxl__device_console *console,
-                              libxl__domain_build_state *state)
+                              libxl__domain_build_state *state,
+                              libxl__device *device)
 {
     flexarray_t *front, *ro_front;
     flexarray_t *back;
-    libxl__device device;
     int rc;
 
     if (console->devid && state) {
         rc = ERROR_INVAL;
         goto out;
     }
+    if (!console->devid && (console->name || console->path)) {
+        LOG(ERROR, "Primary console has invalid configuration");
+        rc = ERROR_INVAL;
+        goto out;
+    }
 
     front = flexarray_make(gc, 16, 1);
     ro_front = flexarray_make(gc, 16, 1);
     back = flexarray_make(gc, 16, 1);
 
-    device.backend_devid = console->devid;
-    device.backend_domid = console->backend_domid;
-    device.backend_kind = LIBXL__DEVICE_KIND_CONSOLE;
-    device.devid = console->devid;
-    device.domid = domid;
-    device.kind = LIBXL__DEVICE_KIND_CONSOLE;
+    device->backend_devid = console->devid;
+    device->backend_domid = console->backend_domid;
+    device->backend_kind = LIBXL__DEVICE_KIND_CONSOLE;
+    device->devid = console->devid;
+    device->domid = domid;
+    device->kind = LIBXL__DEVICE_KIND_CONSOLE;
 
     flexarray_append(back, "frontend-id");
     flexarray_append(back, libxl__sprintf(gc, "%d", domid));
@@ -3604,6 +3610,19 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
     flexarray_append(back, "protocol");
     flexarray_append(back, LIBXL_XENCONSOLE_PROTOCOL);
 
+    if (console->name) {
+        flexarray_append(ro_front, "name");
+        flexarray_append(ro_front, console->name);
+    }
+    if (console->connection) {
+        flexarray_append(back, "connection");
+        flexarray_append(back, console->connection);
+    }
+    if (console->path) {
+        flexarray_append(back, "path");
+        flexarray_append(back, console->path);
+    }
+
     flexarray_append(front, "backend-id");
     flexarray_append(front, libxl__sprintf(gc, "%d", console->backend_domid));
 
@@ -3630,8 +3649,7 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
         flexarray_append(front, "protocol");
         flexarray_append(front, LIBXL_XENCONSOLE_PROTOCOL);
     }
-
-    libxl__device_generic_add(gc, XBT_NULL, &device,
+    libxl__device_generic_add(gc, XBT_NULL, device,
                               libxl__xs_kvs_of_flexarray(gc, back, back->count),
                               libxl__xs_kvs_of_flexarray(gc, front, front->count),
                               libxl__xs_kvs_of_flexarray(gc, ro_front, ro_front->count));
@@ -3642,6 +3660,221 @@ out:
 
 /******************************************************************************/
 
+int libxl__init_console_from_channel(libxl__gc *gc,
+                                     libxl__device_console *console,
+                                     int dev_num,
+                                     libxl_device_channel *channel)
+{
+    int rc;
+
+    libxl__device_console_init(console);
+
+    /* Perform validation first, allocate second. */
+
+    if (!channel->name) {
+        LOG(ERROR, "channel %d has no name", channel->devid);
+        return ERROR_INVAL;
+    }
+
+    if (channel->backend_domname) {
+        rc = libxl_domain_qualifier_to_domid(CTX, channel->backend_domname,
+                                             &channel->backend_domid);
+        if (rc < 0) return rc;
+    }
+
+    /* The xenstore 'output' node tells the backend what to connect the console
+       to. If the channel has "connection = pty" then the "output" node will be
+       set to "pty". If the channel has "connection = socket" then the "output"
+       node will be set to "chardev:libxl-channel%d". This tells the qemu
+       backend to proxy data between the console ring and the character device
+       with id "libxl-channel%d". These character devices are currently defined
+       on the qemu command-line via "-chardev" options in libxl_dm.c */
+
+    switch (channel->connection) {
+        case LIBXL_CHANNEL_CONNECTION_UNKNOWN:
+            LOG(ERROR, "channel %d has no defined connection; "
+                "to where should it be connected?", channel->devid);
+            return ERROR_INVAL;
+        case LIBXL_CHANNEL_CONNECTION_PTY:
+            console->connection = libxl__strdup(NOGC, "pty");
+            console->output = libxl__sprintf(NOGC, "pty");
+            break;
+        case LIBXL_CHANNEL_CONNECTION_SOCKET:
+            if (!channel->u.socket.path) {
+                LOG(ERROR, "channel %d has no path", channel->devid);
+                return ERROR_INVAL;
+            }
+            console->connection = libxl__strdup(NOGC, "socket");
+            console->path = libxl__strdup(NOGC, channel->u.socket.path);
+            console->output = libxl__sprintf(NOGC, "chardev:libxl-channel%d",
+                                             channel->devid);
+            break;
+        default:
+            /* We've forgotten to add the clause */
+            LOG(ERROR, "%s: missing implementation for channel connection %d",
+                __func__, channel->connection);
+            abort();
+    }
+
+    console->devid = dev_num;
+    console->consback = LIBXL__CONSOLE_BACKEND_IOEMU;
+    console->backend_domid = channel->backend_domid;
+    console->name = libxl__strdup(NOGC, channel->name);
+
+    return 0;
+}
+
+static int libxl__device_channel_from_xs_be(libxl__gc *gc,
+                                            const char *be_path,
+                                            libxl_device_channel *channel)
+{
+    const char *tmp;
+    int rc;
+
+    libxl_device_channel_init(channel);
+
+    /* READ_BACKEND is from libxl__device_nic_from_xs_be above */
+    channel->name = READ_BACKEND(NOGC, "name");
+    tmp = READ_BACKEND(gc, "connection");
+    if (!strcmp(tmp, "pty")) {
+        channel->connection = LIBXL_CHANNEL_CONNECTION_PTY;
+    } else if (!strcmp(tmp, "socket")) {
+        channel->connection = LIBXL_CHANNEL_CONNECTION_SOCKET;
+        channel->u.socket.path = READ_BACKEND(NOGC, "path");
+    } else {
+        rc = ERROR_INVAL;
+        goto out;
+    }
+
+    rc = 0;
+ out:
+    return rc;
+}
+
+static int libxl__append_channel_list_of_type(libxl__gc *gc,
+                                              uint32_t domid,
+                                              const char *type,
+                                              libxl_device_channel **channels,
+                                              int *nchannels)
+{
+    char *fe_path = NULL, *be_path = NULL;
+    char **dir = NULL;
+    unsigned int n = 0, devid = 0;
+    libxl_device_channel *next = NULL;
+    int rc = 0, i;
+
+    fe_path = GCSPRINTF("%s/device/%s",
+                        libxl__xs_get_dompath(gc, domid), type);
+    dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &n);
+    if (!dir || !n)
+      goto out;
+
+    for (i = 0; i < n; i++) {
+        const char *p, *name;
+        libxl_device_channel *tmp;
+
+        p = libxl__sprintf(gc, "%s/%s", fe_path, dir[i]);
+        name = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/name", p));
+        /* 'channels' are consoles with names, so ignore all consoles
+           without names */
+        if (!name) continue;
+        be_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend", p));
+        tmp = realloc(*channels,
+                      sizeof(libxl_device_channel) * (*nchannels + devid + 1));
+        if (!tmp) {
+          rc = ERROR_NOMEM;
+          goto out;
+        }
+        *channels = tmp;
+        next = *channels + *nchannels + devid;
+        rc = libxl__device_channel_from_xs_be(gc, be_path, next);
+        if (rc) goto out;
+        next->devid = devid;
+        devid++;
+    }
+    *nchannels += devid;
+    return 0;
+
+ out:
+    return rc;
+}
+
+libxl_device_channel *libxl_device_channel_list(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                int *num)
+{
+    GC_INIT(ctx);
+    libxl_device_channel *channels = NULL;
+    int rc;
+
+    *num = 0;
+
+    rc = libxl__append_channel_list_of_type(gc, domid, "console", &channels, num);
+    if (rc) goto out_err;
+
+    GC_FREE;
+    return channels;
+
+out_err:
+    LOG(ERROR, "Unable to list channels");
+    while (*num) {
+        (*num)--;
+        libxl_device_channel_dispose(&channels[*num]);
+    }
+    free(channels);
+    return NULL;
+}
+
+int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 libxl_device_channel *channel,
+                                 libxl_channelinfo *channelinfo)
+{
+    GC_INIT(ctx);
+    char *dompath, *fe_path;
+    char *val;
+
+    dompath = libxl__xs_get_dompath(gc, domid);
+    channelinfo->devid = channel->devid;
+
+    fe_path = libxl__sprintf(gc, "%s/device/console/%d", dompath,
+                             channelinfo->devid + 1);
+    channelinfo->backend = xs_read(ctx->xsh, XBT_NULL,
+                                   libxl__sprintf(gc, "%s/backend",
+                                   fe_path), NULL);
+    if (!channelinfo->backend) {
+        GC_FREE;
+        return ERROR_FAIL;
+    }
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend-id", fe_path));
+    channelinfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", fe_path));
+    channelinfo->state = val ? strtoul(val, NULL, 10) : -1;
+    channelinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
+                                    GCSPRINTF("%s/frontend",
+                                    channelinfo->backend), NULL);
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id",
+                         channelinfo->backend));
+    channelinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", fe_path));
+    channelinfo->rref = val ? strtoul(val, NULL, 10) : -1;
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/port", fe_path));
+    channelinfo->evtch = val ? strtoul(val, NULL, 10) : -1;
+
+    channelinfo->connection = channel->connection;
+    switch (channel->connection) {
+         case LIBXL_CHANNEL_CONNECTION_PTY:
+             val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/tty", fe_path));
+             channelinfo->u.pty.path = strdup(val);
+             break;
+         default:
+             break;
+    }
+    GC_FREE;
+    return 0;
+}
+
+/******************************************************************************/
+
 int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
     int rc;
@@ -3906,6 +4139,10 @@ DEFINE_DEVICE_REMOVE(vfb, destroy, 1)
 DEFINE_DEVICE_REMOVE(vtpm, remove, 0)
 DEFINE_DEVICE_REMOVE(vtpm, destroy, 1)
 
+/* channel/console hotunplug is not implemented. There are 2 possibilities:
+ * 1. add support for secondary consoles to xenconsoled
+ * 2. dynamically add/remove qemu chardevs via qmp messages. */
+
 #undef DEFINE_DEVICE_REMOVE
 
 /******************************************************************************/
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 3568e1e..28b614f 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -596,6 +596,15 @@ typedef struct libxl__ctx libxl_ctx;
  */
 #define LIBXL_HAVE_BUILDINFO_KERNEL 1
 
+/*
+ * LIBXL_HAVE_DEVICE_CHANNEL
+ *
+ * If this is defined, then the libxl_device_channel struct exists
+ * and channels can be attached to a domain. Channels manifest as consoles
+ * with names, see docs/misc/console.txt.
+ */
+#define LIBXL_HAVE_DEVICE_CHANNEL 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
@@ -1157,6 +1166,17 @@ libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num
 int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
+/*
+ * Virtual Channels
+ * Channels manifest as consoles with names, see docs/misc/channels.txt
+ */
+libxl_device_channel *libxl_device_channel_list(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                int *num);
+int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 libxl_device_channel *channel,
+                                 libxl_channelinfo *channelinfo);
+
 /* Virtual TPMs */
 int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
                           const libxl_asyncop_how *ao_how)
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ca10fac..4b33d07 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -387,15 +387,16 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     return 0;
 }
 
-static int init_console_info(libxl__device_console *console, int dev_num)
+static void init_console_info(libxl__gc *gc,
+                             libxl__device_console *console,
+                             int dev_num)
 {
     libxl__device_console_init(console);
     console->devid = dev_num;
     console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
-    console->output = strdup("pty");
-    if (!console->output)
-        return ERROR_NOMEM;
-    return 0;
+    console->output = libxl__strdup(NOGC, "pty");
+    /* console->{name,connection,path} are NULL on normal consoles.
+       Only 'channels' when mapped to consoles have a string name. */
 }
 
 int libxl__domain_build(libxl__gc *gc,
@@ -1194,17 +1195,31 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
         }
     }
 
+    /* For both HVM and PV the 0th console is a regular console. We
+       map channels to IOEMU consoles starting at 1 */
+    for (i = 0; i < d_config->num_channels; i++) {
+        libxl__device_console console;
+        libxl__device device;
+        ret = libxl__init_console_from_channel(gc, &console, i + 1,
+                                               &d_config->channels[i]);
+        if ( ret ) {
+            libxl__device_console_dispose(&console);
+            goto error_out;
+        }
+        libxl__device_console_add(gc, domid, &console, NULL, &device);
+        libxl__device_console_dispose(&console);
+    }
+
     switch (d_config->c_info.type) {
     case LIBXL_DOMAIN_TYPE_HVM:
     {
         libxl__device_console console;
+        libxl__device device;
         libxl_device_vkb vkb;
 
-        ret = init_console_info(&console, 0);
-        if ( ret )
-            goto error_out;
+        init_console_info(gc, &console, 0);
         console.backend_domid = state->console_domid;
-        libxl__device_console_add(gc, domid, &console, state);
+        libxl__device_console_add(gc, domid, &console, state, &device);
         libxl__device_console_dispose(&console);
 
         libxl_device_vkb_init(&vkb);
@@ -1231,22 +1246,22 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
     {
         int need_qemu = 0;
         libxl__device_console console;
+        libxl__device device;
 
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl__device_vfb_add(gc, domid, &d_config->vfbs[i]);
             libxl__device_vkb_add(gc, domid, &d_config->vkbs[i]);
         }
 
-        ret = init_console_info(&console, 0);
-        if ( ret )
-            goto error_out;
+        init_console_info(gc, &console, 0);
 
         need_qemu = libxl__need_xenpv_qemu(gc, 1, &console,
                 d_config->num_vfbs, d_config->vfbs,
-                d_config->num_disks, &d_config->disks[0]);
+                d_config->num_disks, &d_config->disks[0],
+                d_config->num_channels, &d_config->channels[0]);
 
         console.backend_domid = state->console_domid;
-        libxl__device_console_add(gc, domid, &console, state);
+        libxl__device_console_add(gc, domid, &console, state, &device);
         libxl__device_console_dispose(&console);
 
         if (need_qemu) {
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index b7c8a99..14dc9fa 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -417,8 +417,9 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     const libxl_sdl_info *sdl = dm_sdl(guest_config);
     const char *keymap = dm_keymap(guest_config);
     flexarray_t *dm_args;
-    int i;
+    int i, connection, devid;
     uint64_t ram_size;
+    const char *path, *chardev;
 
     dm_args = flexarray_make(gc, 16, 1);
 
@@ -435,6 +436,28 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
+    for (i = 0; i < guest_config->num_channels; i++) {
+        connection = guest_config->channels[i].connection;
+        devid = guest_config->channels[i].devid;
+        switch (connection) {
+            case LIBXL_CHANNEL_CONNECTION_PTY:
+                chardev = GCSPRINTF("pty,id=libxl-channel%d", devid);
+                break;
+            case LIBXL_CHANNEL_CONNECTION_SOCKET:
+                path = guest_config->channels[i].u.socket.path;
+                chardev = GCSPRINTF("socket,id=libxl-channel%d,path=%s,"
+                                    "server,nowait", devid, path);
+                break;
+            default:
+                /* We've forgotten to add the clause */
+                LOG(ERROR, "%s: unknown channel connection %d",
+                    __func__, connection);
+                return NULL;
+        }
+        flexarray_append(dm_args, "-chardev");
+        flexarray_append(dm_args, (void*)chardev);
+    }
+
     /*
      * Remove default devices created by qemu. Qemu will create only devices
      * defined by xen, since the devices not defined by xen are not usable.
@@ -1122,6 +1145,7 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
     }
 
     for (i = 0; i < num_console; i++) {
+        libxl__device device;
         console[i].devid = i;
         console[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU;
         /* STUBDOM_CONSOLE_LOGGING (console 0) is for minios logging
@@ -1152,7 +1176,8 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
                 break;
         }
         ret = libxl__device_console_add(gc, dm_domid, &console[i],
-                        i == STUBDOM_CONSOLE_LOGGING ? stubdom_state : NULL);
+                        i == STUBDOM_CONSOLE_LOGGING ? stubdom_state : NULL,
+                        &device);
         if (ret)
             goto out;
     }
@@ -1575,7 +1600,8 @@ int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid)
 int libxl__need_xenpv_qemu(libxl__gc *gc,
         int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
-        int nr_disks, libxl_device_disk *disks)
+        int nr_disks, libxl_device_disk *disks,
+        int nr_channels, libxl_device_channel *channels)
 {
     int i, ret = 0;
     uint32_t domid;
@@ -1615,6 +1641,20 @@ int libxl__need_xenpv_qemu(libxl__gc *gc,
         }
     }
 
+    if (nr_channels > 0) {
+        ret = libxl__get_domid(gc, &domid);
+        if (ret) goto out;
+        for (i = 0; i < nr_channels; i++) {
+            if (channels[i].backend_domid == domid) {
+                /* xenconsoled is limited to the first console only.
+                   Until this restriction is removed we must use qemu for
+                   secondary consoles which includes all channels. */
+                ret = 1;
+                goto out;
+            }
+        }
+    }
+
 out:
     return ret;
 }
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 7ed601e..4361421 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1034,7 +1034,8 @@ _hidden int libxl__device_disk_dev_number(const char *virtpath,
 
 _hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
                                       libxl__device_console *console,
-                                      libxl__domain_build_state *state);
+                                      libxl__domain_build_state *state,
+                                      libxl__device *device);
 
 /* Returns 1 if device exists, 0 if not, ERROR_* (<0) on error. */
 _hidden int libxl__device_exists(libxl__gc *gc, xs_transaction_t t,
@@ -1050,6 +1051,10 @@ _hidden int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
                                     const char *state);
 _hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev,
                             libxl_nic_type *nictype);
+_hidden int libxl__init_console_from_channel(libxl__gc *gc,
+                                             libxl__device_console *console,
+                                             int dev_num,
+                                             libxl_device_channel *channel);
 
 /*
  * For each aggregate type which can be used as an input we provide:
@@ -1469,7 +1474,8 @@ _hidden const char *libxl__domain_device_model(libxl__gc *gc,
 _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
         int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
-        int nr_disks, libxl_device_disk *disks);
+        int nr_disks, libxl_device_disk *disks,
+        int nr_channels, libxl_device_channel *channels);
 
 /*
  * This function will cause the whole libxl process to hang
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index df572c7..fdda761 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -71,6 +71,12 @@ libxl_domain_type = Enumeration("domain_type", [
     (2, "PV"),
     ], init_val = "LIBXL_DOMAIN_TYPE_INVALID")
 
+libxl_channel_connection = Enumeration("channel_connection", [
+    (0, "UNKNOWN"),
+    (1, "PTY"),
+    (2, "SOCKET"), # a listening Unix domain socket
+    ])
+
 libxl_device_model_version = Enumeration("device_model_version", [
     (0, "UNKNOWN"),
     (1, "QEMU_XEN_TRADITIONAL"), # Historical qemu-xen device model (qemu-dm)
@@ -279,6 +285,22 @@ libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("cpumap",      libxl_bitmap)
     ], dir=DIR_OUT)
 
+libxl_channelinfo = Struct("channelinfo", [
+    ("backend", string),
+    ("backend_id", uint32),
+    ("frontend", string),
+    ("frontend_id", uint32),
+    ("devid", libxl_devid),
+    ("state", integer),
+    ("evtch", integer),
+    ("rref", integer),
+    ("u", KeyedUnion(None, libxl_channel_connection, "connection",
+           [("unknown", None),
+            ("pty", Struct(None, [("path", string),])),
+            ("socket", None),
+           ])),
+    ], dir=DIR_OUT)
+
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
@@ -504,6 +526,18 @@ libxl_device_vtpm = Struct("device_vtpm", [
     ("uuid",             libxl_uuid),
 ])
 
+libxl_device_channel = Struct("device_channel", [
+    ("backend_domid", libxl_domid),
+    ("backend_domname", string),
+    ("devid", libxl_devid),
+    ("name", string),
+    ("u", KeyedUnion(None, libxl_channel_connection, "connection",
+           [("unknown", None),
+            ("pty", None),
+            ("socket", Struct(None, [("path", string)])),
+           ])),
+])
+
 libxl_domain_config = Struct("domain_config", [
     ("c_info", libxl_domain_create_info),
     ("b_info", libxl_domain_build_info),
@@ -514,6 +548,9 @@ libxl_domain_config = Struct("domain_config", [
     ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
     ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
     ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
+    # a channel manifests as a console with a name,
+    # see docs/misc/channels.txt
+    ("channels", Array(libxl_device_channel, "num_channels")),
 
     ("on_poweroff", libxl_action_on_shutdown),
     ("on_reboot", libxl_action_on_shutdown),
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
index 800361b..5e55685 100644
--- a/tools/libxl/libxl_types_internal.idl
+++ b/tools/libxl/libxl_types_internal.idl
@@ -34,6 +34,11 @@ libxl__device_console = Struct("device_console", [
     ("devid", integer),
     ("consback", libxl__console_backend),
     ("output", string),
+    # A regular console has no name.
+    # A console with a name is called a 'channel', see docs/misc/channels.txt
+    ("name", string),
+    ("connection", string),
+    ("path", string),
     ])
 
 libxl__device_action = Enumeration("device_action", [
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXr-0001KI-DI; Thu, 23 Oct 2014 05:02:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXp-0001Jz-Tu
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:42 +0000
Received: from [193.109.254.147:36768] by server-15.bemta-14.messagelabs.com
	id 06/FF-30948-1FB88445; Thu, 23 Oct 2014 05:02:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1414040559!11929631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25487 invoked from network); 23 Oct 2014 05:02:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXn-0004A3-ME
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXn-0001FP-K6
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:39 +0000
Date: Thu, 23 Oct 2014 05:02:39 +0000
Message-Id: <E1XhAXn-0001FP-K6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add 'xstrdup' next to 'xrealloc'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 11feefc7711ec2309d90146c74340e605c04eff3
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:28 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    xl: add 'xstrdup' next to 'xrealloc'
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/libxl/xl_cmdimpl.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 988ee28..abe9ac6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -300,6 +300,19 @@ static void *xrealloc(void *ptr, size_t sz) {
     return r;
 }
 
+static char *xstrdup(const char *x) __attribute__ ((unused));
+static char *xstrdup(const char *x)
+{
+    char *r;
+    r = strdup(x);
+    if (!r) {
+        fprintf(stderr, "xl: Unable to strdup a string of length %zu.\n",
+                strlen(x));
+        exit(-ERROR_FAIL);
+    }
+    return r;
+}
+
 #define ARRAY_EXTEND_INIT(array,count,initfn)                           \
     ({                                                                  \
         typeof((count)) array_extend_old_count = (count);               \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAXr-0001KI-DI; Thu, 23 Oct 2014 05:02:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXp-0001Jz-Tu
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:42 +0000
Received: from [193.109.254.147:36768] by server-15.bemta-14.messagelabs.com
	id 06/FF-30948-1FB88445; Thu, 23 Oct 2014 05:02:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1414040559!11929631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25487 invoked from network); 23 Oct 2014 05:02:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXn-0004A3-ME
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXn-0001FP-K6
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:39 +0000
Date: Thu, 23 Oct 2014 05:02:39 +0000
Message-Id: <E1XhAXn-0001FP-K6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add 'xstrdup' next to 'xrealloc'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 11feefc7711ec2309d90146c74340e605c04eff3
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:28 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    xl: add 'xstrdup' next to 'xrealloc'
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 tools/libxl/xl_cmdimpl.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 988ee28..abe9ac6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -300,6 +300,19 @@ static void *xrealloc(void *ptr, size_t sz) {
     return r;
 }
 
+static char *xstrdup(const char *x) __attribute__ ((unused));
+static char *xstrdup(const char *x)
+{
+    char *r;
+    r = strdup(x);
+    if (!r) {
+        fprintf(stderr, "xl: Unable to strdup a string of length %zu.\n",
+                strlen(x));
+        exit(-ERROR_FAIL);
+    }
+    return r;
+}
+
 #define ARRAY_EXTEND_INIT(array,count,initfn)                           \
     ({                                                                  \
         typeof((count)) array_extend_old_count = (count);               \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAY4-0001MA-Fy; Thu, 23 Oct 2014 05:02:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAY3-0001Ly-BE
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:55 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	AB/D3-10419-EFB88445; Thu, 23 Oct 2014 05:02:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414040570!11983292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18230 invoked from network); 23 Oct 2014 05:02:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXx-0004A9-Ui
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXx-0001GH-Ry
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:49 +0000
Date: Thu, 23 Oct 2014 05:02:49 +0000
Message-Id: <E1XhAXx-0001GH-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: move 'replace_string' further up
	the file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit badc6d4474dd6d3582853ca19a65c229f4105da0
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:29 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    xl: move 'replace_string' further up the file
    
    This allows the function to be reused more easily.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index abe9ac6..be809c8 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -836,6 +836,12 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
     }
 }
 
+static void replace_string(char **str, const char *val)
+{
+    free(*str);
+    *str = strdup(val);
+}
+
 static void parse_config_data(const char *config_source,
                               const char *config_data,
                               int config_len,
@@ -1981,13 +1987,6 @@ static int match_option_size(const char *prefix, size_t len,
 #define MATCH_OPTION(prefix, arg, oparg) \
     match_option_size((prefix "="), sizeof((prefix)), (arg), &(oparg))
 
-static void replace_string(char **str, const char *val)
-{
-    free(*str);
-    *str = strdup(val);
-}
-
-
 /* Preserve a copy of a domain under a new name. Updates *r_domid */
 static int preserve_domain(uint32_t *r_domid, libxl_event *event,
                            libxl_domain_config *d_config)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:02:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:02:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAY4-0001MA-Fy; Thu, 23 Oct 2014 05:02:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAY3-0001Ly-BE
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:55 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	AB/D3-10419-EFB88445; Thu, 23 Oct 2014 05:02:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414040570!11983292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18230 invoked from network); 23 Oct 2014 05:02:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:02:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXx-0004A9-Ui
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAXx-0001GH-Ry
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:02:49 +0000
Date: Thu, 23 Oct 2014 05:02:49 +0000
Message-Id: <E1XhAXx-0001GH-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: move 'replace_string' further up
	the file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit badc6d4474dd6d3582853ca19a65c229f4105da0
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:29 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:28 2014 +0100

    xl: move 'replace_string' further up the file
    
    This allows the function to be reused more easily.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index abe9ac6..be809c8 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -836,6 +836,12 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
     }
 }
 
+static void replace_string(char **str, const char *val)
+{
+    free(*str);
+    *str = strdup(val);
+}
+
 static void parse_config_data(const char *config_source,
                               const char *config_data,
                               int config_len,
@@ -1981,13 +1987,6 @@ static int match_option_size(const char *prefix, size_t len,
 #define MATCH_OPTION(prefix, arg, oparg) \
     match_option_size((prefix "="), sizeof((prefix)), (arg), &(oparg))
 
-static void replace_string(char **str, const char *val)
-{
-    free(*str);
-    *str = strdup(val);
-}
-
-
 /* Preserve a copy of a domain under a new name. Updates *r_domid */
 static int preserve_domain(uint32_t *r_domid, libxl_event *event,
                            libxl_domain_config *d_config)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYB-0001Nc-IY; Thu, 23 Oct 2014 05:03:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYA-0001NK-GM
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:02 +0000
Received: from [193.109.254.147:43795] by server-13.bemta-14.messagelabs.com
	id 19/B6-19311-50C88445; Thu, 23 Oct 2014 05:03:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1414040580!11929690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27013 invoked from network); 23 Oct 2014 05:03:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAY8-0004AI-4h
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAY8-0001Ge-2o
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:00 +0000
Date: Thu, 23 Oct 2014 05:03:00 +0000
Message-Id: <E1XhAY8-0001Ge-2o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: 'replace_string' now uses xstrdup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d87ab990c1aaa7d083a49081e8b33b8d10a88f7f
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:29 2014 +0100

    xl: 'replace_string' now uses xstrdup
    
    This catches the out-of-memory exception and exits the program.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index be809c8..70d70bd 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -839,7 +839,7 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
 static void replace_string(char **str, const char *val)
 {
     free(*str);
-    *str = strdup(val);
+    *str = xstrdup(val);
 }
 
 static void parse_config_data(const char *config_source,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYB-0001Nc-IY; Thu, 23 Oct 2014 05:03:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYA-0001NK-GM
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:02 +0000
Received: from [193.109.254.147:43795] by server-13.bemta-14.messagelabs.com
	id 19/B6-19311-50C88445; Thu, 23 Oct 2014 05:03:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1414040580!11929690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27013 invoked from network); 23 Oct 2014 05:03:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAY8-0004AI-4h
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAY8-0001Ge-2o
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:00 +0000
Date: Thu, 23 Oct 2014 05:03:00 +0000
Message-Id: <E1XhAY8-0001Ge-2o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: 'replace_string' now uses xstrdup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d87ab990c1aaa7d083a49081e8b33b8d10a88f7f
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:29 2014 +0100

    xl: 'replace_string' now uses xstrdup
    
    This catches the out-of-memory exception and exits the program.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index be809c8..70d70bd 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -839,7 +839,7 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
 static void replace_string(char **str, const char *val)
 {
     free(*str);
-    *str = strdup(val);
+    *str = xstrdup(val);
 }
 
 static void parse_config_data(const char *config_source,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYM-0001Pk-LF; Thu, 23 Oct 2014 05:03:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYL-0001PT-1E
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:13 +0000
Received: from [193.109.254.147:44284] by server-11.bemta-14.messagelabs.com
	id 80/5F-14213-01C88445; Thu, 23 Oct 2014 05:03:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414040590!7322932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7279 invoked from network); 23 Oct 2014 05:03:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYI-0004Ar-Dx
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYI-0001HE-9k
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:10 +0000
Date: Thu, 23 Oct 2014 05:03:10 +0000
Message-Id: <E1XhAYI-0001HE-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add 'trim' and
	'split_string_into_pair' functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8878d01936594d2b6a4366bc7be191edbc546aa8
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:31 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:29 2014 +0100

    xl: add 'trim' and 'split_string_into_pair' functions
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   68 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 70d70bd..26fae90 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -300,7 +300,6 @@ static void *xrealloc(void *ptr, size_t sz) {
     return r;
 }
 
-static char *xstrdup(const char *x) __attribute__ ((unused));
 static char *xstrdup(const char *x)
 {
     char *r;
@@ -588,6 +587,73 @@ static void split_string_into_string_list(const char *str,
     free(s);
 }
 
+/* NB: this follows the interface used by <ctype.h>. See 'man 3 ctype'
+   and look for CTYPE in libxl_internal.h */
+typedef int (*char_predicate_t)(const int c);
+
+static void trim(char_predicate_t predicate, const char *input, char **output) __attribute__ ((unused));
+static void trim(char_predicate_t predicate, const char *input, char **output)
+{
+    char *p, *q, *tmp;
+
+    *output = NULL;
+    if (*input == '\000')
+        return;
+    /* Input has length >= 1 */
+
+    p = tmp = xstrdup(input);
+    /* Skip past the characters for which predicate is true */
+    while ((*p != '\000') && (predicate((unsigned char)*p)))
+        p ++;
+    q = p + strlen(p) - 1;
+    /* q points to the last non-NULL character */
+    while ((q > p) && (predicate((unsigned char)*q)))
+        q --;
+    /* q points to the last character we want */
+    q ++;
+    *q = '\000';
+    *output = xstrdup(p);
+    free(tmp);
+}
+
+static int split_string_into_pair(const char *str,
+                                  const char *delim,
+                                  char **a,
+                                  char **b) __attribute__ ((unused));
+static int split_string_into_pair(const char *str,
+                                  const char *delim,
+                                  char **a,
+                                  char **b)
+{
+    char *s, *p, *saveptr, *aa = NULL, *bb = NULL;
+    int rc = 0;
+
+    s = xstrdup(str);
+
+    p = strtok_r(s, delim, &saveptr);
+    if (p == NULL) {
+        rc = ERROR_INVAL;
+        goto out;
+    }
+    aa = xstrdup(p);
+    p = strtok_r(NULL, delim, &saveptr);
+    if (p == NULL) {
+        rc = ERROR_INVAL;
+        goto out;
+    }
+    bb = xstrdup(p);
+
+    *a = aa;
+    aa = NULL;
+    *b = bb;
+    bb = NULL;
+out:
+    free(s);
+    free(aa);
+    free(bb);
+    return rc;
+}
+
 static int parse_range(const char *str, unsigned long *a, unsigned long *b)
 {
     const char *nstr;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYM-0001Pk-LF; Thu, 23 Oct 2014 05:03:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYL-0001PT-1E
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:13 +0000
Received: from [193.109.254.147:44284] by server-11.bemta-14.messagelabs.com
	id 80/5F-14213-01C88445; Thu, 23 Oct 2014 05:03:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414040590!7322932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7279 invoked from network); 23 Oct 2014 05:03:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYI-0004Ar-Dx
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYI-0001HE-9k
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:10 +0000
Date: Thu, 23 Oct 2014 05:03:10 +0000
Message-Id: <E1XhAYI-0001HE-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add 'trim' and
	'split_string_into_pair' functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8878d01936594d2b6a4366bc7be191edbc546aa8
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:31 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:29 2014 +0100

    xl: add 'trim' and 'split_string_into_pair' functions
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   68 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 70d70bd..26fae90 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -300,7 +300,6 @@ static void *xrealloc(void *ptr, size_t sz) {
     return r;
 }
 
-static char *xstrdup(const char *x) __attribute__ ((unused));
 static char *xstrdup(const char *x)
 {
     char *r;
@@ -588,6 +587,73 @@ static void split_string_into_string_list(const char *str,
     free(s);
 }
 
+/* NB: this follows the interface used by <ctype.h>. See 'man 3 ctype'
+   and look for CTYPE in libxl_internal.h */
+typedef int (*char_predicate_t)(const int c);
+
+static void trim(char_predicate_t predicate, const char *input, char **output) __attribute__ ((unused));
+static void trim(char_predicate_t predicate, const char *input, char **output)
+{
+    char *p, *q, *tmp;
+
+    *output = NULL;
+    if (*input == '\000')
+        return;
+    /* Input has length >= 1 */
+
+    p = tmp = xstrdup(input);
+    /* Skip past the characters for which predicate is true */
+    while ((*p != '\000') && (predicate((unsigned char)*p)))
+        p ++;
+    q = p + strlen(p) - 1;
+    /* q points to the last non-NULL character */
+    while ((q > p) && (predicate((unsigned char)*q)))
+        q --;
+    /* q points to the last character we want */
+    q ++;
+    *q = '\000';
+    *output = xstrdup(p);
+    free(tmp);
+}
+
+static int split_string_into_pair(const char *str,
+                                  const char *delim,
+                                  char **a,
+                                  char **b) __attribute__ ((unused));
+static int split_string_into_pair(const char *str,
+                                  const char *delim,
+                                  char **a,
+                                  char **b)
+{
+    char *s, *p, *saveptr, *aa = NULL, *bb = NULL;
+    int rc = 0;
+
+    s = xstrdup(str);
+
+    p = strtok_r(s, delim, &saveptr);
+    if (p == NULL) {
+        rc = ERROR_INVAL;
+        goto out;
+    }
+    aa = xstrdup(p);
+    p = strtok_r(NULL, delim, &saveptr);
+    if (p == NULL) {
+        rc = ERROR_INVAL;
+        goto out;
+    }
+    bb = xstrdup(p);
+
+    *a = aa;
+    aa = NULL;
+    *b = bb;
+    bb = NULL;
+out:
+    free(s);
+    free(aa);
+    free(bb);
+    return rc;
+}
+
 static int parse_range(const char *str, unsigned long *a, unsigned long *b)
 {
     const char *nstr;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYW-0001Qx-O1; Thu, 23 Oct 2014 05:03:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYV-0001Qp-Sd
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:24 +0000
Received: from [193.109.254.147:17933] by server-10.bemta-14.messagelabs.com
	id 04/1C-01463-B1C88445; Thu, 23 Oct 2014 05:03:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1414040601!11961917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1084 invoked from network); 23 Oct 2014 05:03:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYT-0004Ax-2T
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYS-0001Ha-Jy
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:20 +0000
Date: Thu, 23 Oct 2014 05:03:20 +0000
Message-Id: <E1XhAYS-0001Ha-Jy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add support for 'channels'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c09b6495e4ef39a486bb4e9e070bd045d5fed0e
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:32 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:29 2014 +0100

    xl: add support for 'channels'
    
    This adds support for channel declarations of the form:
    
     channel = [ "name=...,connection=...[,path=...][,backend=...]" ]
    
    where 'name' is a label to identify the channel to the frontend.
    
    If 'connection = pty' then the channel is connected to a pty in the
     backend domain
    If 'connection = socket' then the channel is connected to a Unix domain
     socket given by 'path = ...' in the backend domain.
    
    This patch also adds the command:
    
     xl channel-list <domain>
    
    which allows the state of channels to be queried. In particular if
    'connection=pty' this will show the path of the pty slave device.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5     |   53 ++++++++++++++++++
 docs/man/xl.pod.1         |   10 ++++
 tools/libxl/xl.h          |    1 +
 tools/libxl/xl_cmdimpl.c  |  133 ++++++++++++++++++++++++++++++++++++++++++---
 tools/libxl/xl_cmdtable.c |    5 ++
 5 files changed, 194 insertions(+), 8 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 8bba21c..5830e09 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -530,6 +530,59 @@ L<qemu(1)> manpage. The default is B<en-us>.
 
 =back
 
+=item B<channel=[ "CHANNEL_SPEC_STRING", "CHANNEL_SPEC_STRING", ...]>
+
+Specifies the virtual channels to be provided to the guest. A
+channel is a low-bandwidth, bidirectional byte stream, which resembles
+a serial link. Typical uses for channels include transmitting VM
+configuration after boot and signalling to in-guest agents. Please see
+F<docs/misc/channels.txt> for more details.
+
+Each B<CHANNEL_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+seettings. Leading and trailing whitespace is ignored in both KEY and
+VALUE. Neither KEY nor VALUE may contain ',', '=' or '"'. Defined values
+are:
+
+=over 4
+
+=item C<backend=DOMAIN>
+
+Specify the backend domain name or id. This parameter is optional. If
+this parameter is omitted then the toolstack domain will be assumed.
+
+=item C<name=NAME>
+
+Specify the string name for this device. This parameter is mandatory.
+This should be a well-known name for the specific application (e.g.
+guest agent) and should be used by the frontend to connect the
+application to the right channel device. There is no formal registry
+of channel names, so application authors are encouraged to make their
+names unique by including domain name and version number in the string
+(e.g. org.mydomain.guestagent.1).
+
+=item C<connection=CONNECTION>
+
+Specify how the backend will be implemented. This following options are
+available:
+
+=over 4
+
+=item B<connection=SOCKET>
+
+The backend will bind a Unix domain socket (at the path given by
+B<path=PATH>), call listen and accept connections. The backend will proxy
+data between the channel and the connected socket.
+
+=item B<connection=PTY>
+
+The backend will create a pty and proxy data between the channel and the
+master device. The command B<xl channel-list> can be used to discover the
+assigned slave device.
+
+=back
+
+=back
+
 =item B<pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ... ]>
 
 Specifies the host PCI devices to passthrough to this guest. Each B<PCI_SPEC_STRING>
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index adc9f56..6b89ba8 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1268,6 +1268,16 @@ List virtual network interfaces for a domain.
 
 =back
 
+=head2 CHANNEL DEVICES
+
+=over 4
+
+=item B<channel-list> I<domain-id>
+
+List virtual channel interfaces for a domain.
+
+=back
+
 =head2 VTPM DEVICES
 
 =over 4
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 378245d..c91de4f 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -79,6 +79,7 @@ int main_top(int argc, char **argv);
 int main_networkattach(int argc, char **argv);
 int main_networklist(int argc, char **argv);
 int main_networkdetach(int argc, char **argv);
+int main_channellist(int argc, char **argv);
 int main_blockattach(int argc, char **argv);
 int main_blocklist(int argc, char **argv);
 int main_blockdetach(int argc, char **argv);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 26fae90..ea43761 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -554,7 +554,7 @@ static void split_string_into_string_list(const char *str,
 
     s = strdup(str);
     if (s == NULL) {
-        fprintf(stderr, "unable to allocate memory to parse bootloader args\n");
+        fprintf(stderr, "unable to allocate memory to split string\n");
         exit(-1);
     }
 
@@ -570,7 +570,7 @@ static void split_string_into_string_list(const char *str,
 
     sl = malloc((nr+1) * sizeof (char *));
     if (sl == NULL) {
-        fprintf(stderr, "unable to allocate memory for bootloader args\n");
+        fprintf(stderr, "unable to allocate memory to split string\n");
         exit(-1);
     }
 
@@ -591,7 +591,6 @@ static void split_string_into_string_list(const char *str,
    and look for CTYPE in libxl_internal.h */
 typedef int (*char_predicate_t)(const int c);
 
-static void trim(char_predicate_t predicate, const char *input, char **output) __attribute__ ((unused));
 static void trim(char_predicate_t predicate, const char *input, char **output)
 {
     char *p, *q, *tmp;
@@ -619,10 +618,6 @@ static void trim(char_predicate_t predicate, const char *input, char **output)
 static int split_string_into_pair(const char *str,
                                   const char *delim,
                                   char **a,
-                                  char **b) __attribute__ ((unused));
-static int split_string_into_pair(const char *str,
-                                  const char *delim,
-                                  char **a,
                                   char **b)
 {
     char *s, *p, *saveptr, *aa = NULL, *bb = NULL;
@@ -917,7 +912,7 @@ static void parse_config_data(const char *config_source,
     long l;
     XLU_Config *config;
     XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms;
-    XLU_ConfigList *ioports, *irqs, *iomem, *viridian;
+    XLU_ConfigList *channels, *ioports, *irqs, *iomem, *viridian;
     int num_ioports, num_irqs, num_iomem, num_cpus, num_viridian;
     int pci_power_mgmt = 0;
     int pci_msitranslate = 0;
@@ -1451,6 +1446,84 @@ static void parse_config_data(const char *config_source,
         }
     }
 
+    if (!xlu_cfg_get_list (config, "channel", &channels, 0, 0)) {
+        d_config->num_channels = 0;
+        d_config->channels = NULL;
+        while ((buf = xlu_cfg_get_listitem (channels,
+                d_config->num_channels)) != NULL) {
+            libxl_device_channel *chn;
+            libxl_string_list pairs;
+            char *path = NULL;
+            int len;
+
+            chn = ARRAY_EXTEND_INIT(d_config->channels, d_config->num_channels,
+                                   libxl_device_channel_init);
+
+            split_string_into_string_list(buf, ",", &pairs);
+            len = libxl_string_list_length(&pairs);
+            for (i = 0; i < len; i++) {
+                char *key, *key_untrimmed, *value, *value_untrimmed;
+                int rc;
+                rc = split_string_into_pair(pairs[i], "=",
+                                            &key_untrimmed,
+                                            &value_untrimmed);
+                if (rc != 0) {
+                    fprintf(stderr, "failed to parse channel configuration: %s",
+                            pairs[i]);
+                    exit(1);
+                }
+                trim(isspace, key_untrimmed, &key);
+                trim(isspace, value_untrimmed, &value);
+
+                if (!strcmp(key, "backend")) {
+                    replace_string(&chn->backend_domname, value);
+                } else if (!strcmp(key, "name")) {
+                    replace_string(&chn->name, value);
+                } else if (!strcmp(key, "path")) {
+                    replace_string(&path, value);
+                } else if (!strcmp(key, "connection")) {
+                    if (!strcmp(value, "pty")) {
+                        chn->connection = LIBXL_CHANNEL_CONNECTION_PTY;
+                    } else if (!strcmp(value, "socket")) {
+                        chn->connection = LIBXL_CHANNEL_CONNECTION_SOCKET;
+                    } else {
+                        fprintf(stderr, "unknown channel connection '%s'\n",
+                                value);
+                        exit(1);
+                    }
+                } else {
+                    fprintf(stderr, "unknown channel parameter '%s',"
+                                  " ignoring\n", key);
+                }
+                free(key);
+                free(key_untrimmed);
+                free(value);
+                free(value_untrimmed);
+            }
+            switch (chn->connection) {
+            case LIBXL_CHANNEL_CONNECTION_UNKNOWN:
+                fprintf(stderr, "channel has unknown 'connection'\n");
+                exit(1);
+            case LIBXL_CHANNEL_CONNECTION_SOCKET:
+                if (!path) {
+                    fprintf(stderr, "channel connection 'socket' requires path=..\n");
+                    exit(1);
+                }
+                chn->u.socket.path = xstrdup(path);
+                break;
+            case LIBXL_CHANNEL_CONNECTION_PTY:
+                /* Nothing to do since PTY has no arguments */
+                break;
+            default:
+                fprintf(stderr, "unknown channel connection: %d",
+                        chn->connection);
+                exit(1);
+            }
+            libxl_string_list_dispose(&pairs);
+            free(path);
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "vif", &nics, 0, 0)) {
         d_config->num_nics = 0;
         d_config->nics = NULL;
@@ -6225,6 +6298,50 @@ int main_networkdetach(int argc, char **argv)
     return 0;
 }
 
+int main_channellist(int argc, char **argv)
+{
+    int opt;
+    libxl_device_channel *channels;
+    libxl_channelinfo channelinfo;
+    int nb, i;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "channel-list", 1) {
+        /* No options */
+    }
+
+    /*      Idx BE state evt-ch ring-ref connection params*/
+    printf("%-3s %-2s %-5s %-6s %8s %-10s %-30s\n",
+           "Idx", "BE", "state", "evt-ch", "ring-ref", "connection", "");
+    for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
+        uint32_t domid = find_domain(*argv);
+        channels = libxl_device_channel_list(ctx, domid, &nb);
+        if (!channels)
+            continue;
+        for (i = 0; i < nb; ++i) {
+            if (!libxl_device_channel_getinfo(ctx, domid, &channels[i],
+                &channelinfo)) {
+                printf("%-3d %-2d ", channels[i].devid, channelinfo.backend_id);
+                printf("%-5d ", channelinfo.state);
+                printf("%-6d %-8d ", channelinfo.evtch, channelinfo.rref);
+                printf("%-10s ", libxl_channel_connection_to_string(
+                       channels[i].connection));
+                switch (channels[i].connection) {
+                    case LIBXL_CHANNEL_CONNECTION_PTY:
+                        printf("%-30s ", channelinfo.u.pty.path);
+                        break;
+                    default:
+                        break;
+                }
+                printf("\n");
+                libxl_channelinfo_dispose(&channelinfo);
+            }
+            libxl_device_channel_dispose(&channels[i]);
+        }
+        free(channels);
+    }
+    return 0;
+}
+
 int main_blockattach(int argc, char **argv)
 {
     int opt;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 8ed8f45..4b30d3d 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -345,6 +345,11 @@ struct cmd_spec cmd_table[] = {
       "Destroy a domain's virtual network device",
       "<Domain> <DevId|mac>",
     },
+    { "channel-list",
+      &main_channellist, 0, 0,
+      "List virtual channel devices for a domain",
+      "<Domain(s)>",
+    },
     { "block-attach",
       &main_blockattach, 1, 1,
       "Create a new virtual block device",
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYW-0001Qx-O1; Thu, 23 Oct 2014 05:03:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYV-0001Qp-Sd
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:24 +0000
Received: from [193.109.254.147:17933] by server-10.bemta-14.messagelabs.com
	id 04/1C-01463-B1C88445; Thu, 23 Oct 2014 05:03:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1414040601!11961917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1084 invoked from network); 23 Oct 2014 05:03:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYT-0004Ax-2T
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYS-0001Ha-Jy
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:20 +0000
Date: Thu, 23 Oct 2014 05:03:20 +0000
Message-Id: <E1XhAYS-0001Ha-Jy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add support for 'channels'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c09b6495e4ef39a486bb4e9e070bd045d5fed0e
Author:     David Scott <dave.scott@citrix.com>
AuthorDate: Thu Oct 9 10:17:32 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 13:51:29 2014 +0100

    xl: add support for 'channels'
    
    This adds support for channel declarations of the form:
    
     channel = [ "name=...,connection=...[,path=...][,backend=...]" ]
    
    where 'name' is a label to identify the channel to the frontend.
    
    If 'connection = pty' then the channel is connected to a pty in the
     backend domain
    If 'connection = socket' then the channel is connected to a Unix domain
     socket given by 'path = ...' in the backend domain.
    
    This patch also adds the command:
    
     xl channel-list <domain>
    
    which allows the state of channels to be queried. In particular if
    'connection=pty' this will show the path of the pty slave device.
    
    Signed-off-by: David Scott <dave.scott@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5     |   53 ++++++++++++++++++
 docs/man/xl.pod.1         |   10 ++++
 tools/libxl/xl.h          |    1 +
 tools/libxl/xl_cmdimpl.c  |  133 ++++++++++++++++++++++++++++++++++++++++++---
 tools/libxl/xl_cmdtable.c |    5 ++
 5 files changed, 194 insertions(+), 8 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 8bba21c..5830e09 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -530,6 +530,59 @@ L<qemu(1)> manpage. The default is B<en-us>.
 
 =back
 
+=item B<channel=[ "CHANNEL_SPEC_STRING", "CHANNEL_SPEC_STRING", ...]>
+
+Specifies the virtual channels to be provided to the guest. A
+channel is a low-bandwidth, bidirectional byte stream, which resembles
+a serial link. Typical uses for channels include transmitting VM
+configuration after boot and signalling to in-guest agents. Please see
+F<docs/misc/channels.txt> for more details.
+
+Each B<CHANNEL_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+seettings. Leading and trailing whitespace is ignored in both KEY and
+VALUE. Neither KEY nor VALUE may contain ',', '=' or '"'. Defined values
+are:
+
+=over 4
+
+=item C<backend=DOMAIN>
+
+Specify the backend domain name or id. This parameter is optional. If
+this parameter is omitted then the toolstack domain will be assumed.
+
+=item C<name=NAME>
+
+Specify the string name for this device. This parameter is mandatory.
+This should be a well-known name for the specific application (e.g.
+guest agent) and should be used by the frontend to connect the
+application to the right channel device. There is no formal registry
+of channel names, so application authors are encouraged to make their
+names unique by including domain name and version number in the string
+(e.g. org.mydomain.guestagent.1).
+
+=item C<connection=CONNECTION>
+
+Specify how the backend will be implemented. This following options are
+available:
+
+=over 4
+
+=item B<connection=SOCKET>
+
+The backend will bind a Unix domain socket (at the path given by
+B<path=PATH>), call listen and accept connections. The backend will proxy
+data between the channel and the connected socket.
+
+=item B<connection=PTY>
+
+The backend will create a pty and proxy data between the channel and the
+master device. The command B<xl channel-list> can be used to discover the
+assigned slave device.
+
+=back
+
+=back
+
 =item B<pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ... ]>
 
 Specifies the host PCI devices to passthrough to this guest. Each B<PCI_SPEC_STRING>
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index adc9f56..6b89ba8 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -1268,6 +1268,16 @@ List virtual network interfaces for a domain.
 
 =back
 
+=head2 CHANNEL DEVICES
+
+=over 4
+
+=item B<channel-list> I<domain-id>
+
+List virtual channel interfaces for a domain.
+
+=back
+
 =head2 VTPM DEVICES
 
 =over 4
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 378245d..c91de4f 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -79,6 +79,7 @@ int main_top(int argc, char **argv);
 int main_networkattach(int argc, char **argv);
 int main_networklist(int argc, char **argv);
 int main_networkdetach(int argc, char **argv);
+int main_channellist(int argc, char **argv);
 int main_blockattach(int argc, char **argv);
 int main_blocklist(int argc, char **argv);
 int main_blockdetach(int argc, char **argv);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 26fae90..ea43761 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -554,7 +554,7 @@ static void split_string_into_string_list(const char *str,
 
     s = strdup(str);
     if (s == NULL) {
-        fprintf(stderr, "unable to allocate memory to parse bootloader args\n");
+        fprintf(stderr, "unable to allocate memory to split string\n");
         exit(-1);
     }
 
@@ -570,7 +570,7 @@ static void split_string_into_string_list(const char *str,
 
     sl = malloc((nr+1) * sizeof (char *));
     if (sl == NULL) {
-        fprintf(stderr, "unable to allocate memory for bootloader args\n");
+        fprintf(stderr, "unable to allocate memory to split string\n");
         exit(-1);
     }
 
@@ -591,7 +591,6 @@ static void split_string_into_string_list(const char *str,
    and look for CTYPE in libxl_internal.h */
 typedef int (*char_predicate_t)(const int c);
 
-static void trim(char_predicate_t predicate, const char *input, char **output) __attribute__ ((unused));
 static void trim(char_predicate_t predicate, const char *input, char **output)
 {
     char *p, *q, *tmp;
@@ -619,10 +618,6 @@ static void trim(char_predicate_t predicate, const char *input, char **output)
 static int split_string_into_pair(const char *str,
                                   const char *delim,
                                   char **a,
-                                  char **b) __attribute__ ((unused));
-static int split_string_into_pair(const char *str,
-                                  const char *delim,
-                                  char **a,
                                   char **b)
 {
     char *s, *p, *saveptr, *aa = NULL, *bb = NULL;
@@ -917,7 +912,7 @@ static void parse_config_data(const char *config_source,
     long l;
     XLU_Config *config;
     XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms;
-    XLU_ConfigList *ioports, *irqs, *iomem, *viridian;
+    XLU_ConfigList *channels, *ioports, *irqs, *iomem, *viridian;
     int num_ioports, num_irqs, num_iomem, num_cpus, num_viridian;
     int pci_power_mgmt = 0;
     int pci_msitranslate = 0;
@@ -1451,6 +1446,84 @@ static void parse_config_data(const char *config_source,
         }
     }
 
+    if (!xlu_cfg_get_list (config, "channel", &channels, 0, 0)) {
+        d_config->num_channels = 0;
+        d_config->channels = NULL;
+        while ((buf = xlu_cfg_get_listitem (channels,
+                d_config->num_channels)) != NULL) {
+            libxl_device_channel *chn;
+            libxl_string_list pairs;
+            char *path = NULL;
+            int len;
+
+            chn = ARRAY_EXTEND_INIT(d_config->channels, d_config->num_channels,
+                                   libxl_device_channel_init);
+
+            split_string_into_string_list(buf, ",", &pairs);
+            len = libxl_string_list_length(&pairs);
+            for (i = 0; i < len; i++) {
+                char *key, *key_untrimmed, *value, *value_untrimmed;
+                int rc;
+                rc = split_string_into_pair(pairs[i], "=",
+                                            &key_untrimmed,
+                                            &value_untrimmed);
+                if (rc != 0) {
+                    fprintf(stderr, "failed to parse channel configuration: %s",
+                            pairs[i]);
+                    exit(1);
+                }
+                trim(isspace, key_untrimmed, &key);
+                trim(isspace, value_untrimmed, &value);
+
+                if (!strcmp(key, "backend")) {
+                    replace_string(&chn->backend_domname, value);
+                } else if (!strcmp(key, "name")) {
+                    replace_string(&chn->name, value);
+                } else if (!strcmp(key, "path")) {
+                    replace_string(&path, value);
+                } else if (!strcmp(key, "connection")) {
+                    if (!strcmp(value, "pty")) {
+                        chn->connection = LIBXL_CHANNEL_CONNECTION_PTY;
+                    } else if (!strcmp(value, "socket")) {
+                        chn->connection = LIBXL_CHANNEL_CONNECTION_SOCKET;
+                    } else {
+                        fprintf(stderr, "unknown channel connection '%s'\n",
+                                value);
+                        exit(1);
+                    }
+                } else {
+                    fprintf(stderr, "unknown channel parameter '%s',"
+                                  " ignoring\n", key);
+                }
+                free(key);
+                free(key_untrimmed);
+                free(value);
+                free(value_untrimmed);
+            }
+            switch (chn->connection) {
+            case LIBXL_CHANNEL_CONNECTION_UNKNOWN:
+                fprintf(stderr, "channel has unknown 'connection'\n");
+                exit(1);
+            case LIBXL_CHANNEL_CONNECTION_SOCKET:
+                if (!path) {
+                    fprintf(stderr, "channel connection 'socket' requires path=..\n");
+                    exit(1);
+                }
+                chn->u.socket.path = xstrdup(path);
+                break;
+            case LIBXL_CHANNEL_CONNECTION_PTY:
+                /* Nothing to do since PTY has no arguments */
+                break;
+            default:
+                fprintf(stderr, "unknown channel connection: %d",
+                        chn->connection);
+                exit(1);
+            }
+            libxl_string_list_dispose(&pairs);
+            free(path);
+        }
+    }
+
     if (!xlu_cfg_get_list (config, "vif", &nics, 0, 0)) {
         d_config->num_nics = 0;
         d_config->nics = NULL;
@@ -6225,6 +6298,50 @@ int main_networkdetach(int argc, char **argv)
     return 0;
 }
 
+int main_channellist(int argc, char **argv)
+{
+    int opt;
+    libxl_device_channel *channels;
+    libxl_channelinfo channelinfo;
+    int nb, i;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "channel-list", 1) {
+        /* No options */
+    }
+
+    /*      Idx BE state evt-ch ring-ref connection params*/
+    printf("%-3s %-2s %-5s %-6s %8s %-10s %-30s\n",
+           "Idx", "BE", "state", "evt-ch", "ring-ref", "connection", "");
+    for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
+        uint32_t domid = find_domain(*argv);
+        channels = libxl_device_channel_list(ctx, domid, &nb);
+        if (!channels)
+            continue;
+        for (i = 0; i < nb; ++i) {
+            if (!libxl_device_channel_getinfo(ctx, domid, &channels[i],
+                &channelinfo)) {
+                printf("%-3d %-2d ", channels[i].devid, channelinfo.backend_id);
+                printf("%-5d ", channelinfo.state);
+                printf("%-6d %-8d ", channelinfo.evtch, channelinfo.rref);
+                printf("%-10s ", libxl_channel_connection_to_string(
+                       channels[i].connection));
+                switch (channels[i].connection) {
+                    case LIBXL_CHANNEL_CONNECTION_PTY:
+                        printf("%-30s ", channelinfo.u.pty.path);
+                        break;
+                    default:
+                        break;
+                }
+                printf("\n");
+                libxl_channelinfo_dispose(&channelinfo);
+            }
+            libxl_device_channel_dispose(&channels[i]);
+        }
+        free(channels);
+    }
+    return 0;
+}
+
 int main_blockattach(int argc, char **argv)
 {
     int opt;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 8ed8f45..4b30d3d 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -345,6 +345,11 @@ struct cmd_spec cmd_table[] = {
       "Destroy a domain's virtual network device",
       "<Domain> <DevId|mac>",
     },
+    { "channel-list",
+      &main_channellist, 0, 0,
+      "List virtual channel devices for a domain",
+      "<Domain(s)>",
+    },
     { "block-attach",
       &main_blockattach, 1, 1,
       "Create a new virtual block device",
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYh-0001Sk-T9; Thu, 23 Oct 2014 05:03:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYg-0001SW-Pe
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:34 +0000
Received: from [193.109.254.147:25062] by server-1.bemta-14.messagelabs.com id
	66/71-24760-62C88445; Thu, 23 Oct 2014 05:03:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414040612!11956370!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6271 invoked from network); 23 Oct 2014 05:03:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYe-0004B5-FC
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYd-0001Hx-BW
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:32 +0000
Date: Thu, 23 Oct 2014 05:03:31 +0000
Message-Id: <E1XhAYd-0001Hx-BW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/mceinject: Fix build after
	31d2d1e08a
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf30c7b27ef76beb284e2a88662486c3753e69a3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 15 18:33:54 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 15:42:33 2014 +0100

    tools/mceinject: Fix build after 31d2d1e08a
    
    xen-mceinj is another utility which incorrectly makes use of xg_private.h  Fix
    up its include path.
    
    While fixing this Makefile, remove some trailing whitespace.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/tests/mce-test/tools/Makefile |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/tests/mce-test/tools/Makefile b/tools/tests/mce-test/tools/Makefile
index 5ee001f..aba7177 100644
--- a/tools/tests/mce-test/tools/Makefile
+++ b/tools/tests/mce-test/tools/Makefile
@@ -3,9 +3,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
+# xen-mceinj.c incorrectly use libxc internals
+CFLAGS += -I$(XEN_ROOT)/tools/libxc
 CFLAGS += $(CFLAGS_libxenguest)
-CFLAGS += $(CFLAGS_libxenstore) 
-CFLAGS += $(CFLAGS_xeninclude) 
+CFLAGS += $(CFLAGS_libxenstore)
+CFLAGS += $(CFLAGS_xeninclude)
 
 .PHONY: all
 all: xen-mceinj
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYh-0001Sk-T9; Thu, 23 Oct 2014 05:03:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYg-0001SW-Pe
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:34 +0000
Received: from [193.109.254.147:25062] by server-1.bemta-14.messagelabs.com id
	66/71-24760-62C88445; Thu, 23 Oct 2014 05:03:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414040612!11956370!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6271 invoked from network); 23 Oct 2014 05:03:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYe-0004B5-FC
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYd-0001Hx-BW
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:32 +0000
Date: Thu, 23 Oct 2014 05:03:31 +0000
Message-Id: <E1XhAYd-0001Hx-BW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/mceinject: Fix build after
	31d2d1e08a
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf30c7b27ef76beb284e2a88662486c3753e69a3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 15 18:33:54 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 15:42:33 2014 +0100

    tools/mceinject: Fix build after 31d2d1e08a
    
    xen-mceinj is another utility which incorrectly makes use of xg_private.h  Fix
    up its include path.
    
    While fixing this Makefile, remove some trailing whitespace.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/tests/mce-test/tools/Makefile |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/tests/mce-test/tools/Makefile b/tools/tests/mce-test/tools/Makefile
index 5ee001f..aba7177 100644
--- a/tools/tests/mce-test/tools/Makefile
+++ b/tools/tests/mce-test/tools/Makefile
@@ -3,9 +3,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
+# xen-mceinj.c incorrectly use libxc internals
+CFLAGS += -I$(XEN_ROOT)/tools/libxc
 CFLAGS += $(CFLAGS_libxenguest)
-CFLAGS += $(CFLAGS_libxenstore) 
-CFLAGS += $(CFLAGS_xeninclude) 
+CFLAGS += $(CFLAGS_libxenstore)
+CFLAGS += $(CFLAGS_xeninclude)
 
 .PHONY: all
 all: xen-mceinj
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYt-0001U5-09; Thu, 23 Oct 2014 05:03:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYr-0001Tt-HA
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:45 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	18/AA-02834-03C88445; Thu, 23 Oct 2014 05:03:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1414040623!6575448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4316 invoked from network); 23 Oct 2014 05:03:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYo-0004BB-V2
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYo-0001IQ-KC
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:42 +0000
Date: Thu, 23 Oct 2014 05:03:42 +0000
Message-Id: <E1XhAYo-0001IQ-KC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/build: Fix root build target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0785dcc3d282598493cbbaa95d78943f15240e5a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 15 18:33:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 15:42:33 2014 +0100

    tools/build: Fix root build target
    
    The root Makefile 'build' rule recurses into the tools directory and invokes
    the 'build' rule.  However, the tools Makefile doesn't contain a 'build' rule,
    resulting in failure.
    
    Introduce a 'build' rule identical to the existing 'all' rule.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 543cd29..af9798a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -54,8 +54,8 @@ export CROSS_SYS_ROOT # exported for check/funcs.sh
 export CROSS_BIN_PATH # exported for cross-install.sh
 endif
 
-.PHONY: all
-all: subdirs-all
+.PHONY: build all
+build all: subdirs-all
 
 .PHONY: install
 install: subdirs-install
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAYt-0001U5-09; Thu, 23 Oct 2014 05:03:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYr-0001Tt-HA
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:45 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	18/AA-02834-03C88445; Thu, 23 Oct 2014 05:03:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1414040623!6575448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4316 invoked from network); 23 Oct 2014 05:03:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYo-0004BB-V2
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYo-0001IQ-KC
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:42 +0000
Date: Thu, 23 Oct 2014 05:03:42 +0000
Message-Id: <E1XhAYo-0001IQ-KC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/build: Fix root build target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0785dcc3d282598493cbbaa95d78943f15240e5a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 15 18:33:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 15:42:33 2014 +0100

    tools/build: Fix root build target
    
    The root Makefile 'build' rule recurses into the tools directory and invokes
    the 'build' rule.  However, the tools Makefile doesn't contain a 'build' rule,
    resulting in failure.
    
    Introduce a 'build' rule identical to the existing 'all' rule.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 543cd29..af9798a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -54,8 +54,8 @@ export CROSS_SYS_ROOT # exported for check/funcs.sh
 export CROSS_BIN_PATH # exported for cross-install.sh
 endif
 
-.PHONY: all
-all: subdirs-all
+.PHONY: build all
+build all: subdirs-all
 
 .PHONY: install
 install: subdirs-install
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZ5-0001Vz-2v; Thu, 23 Oct 2014 05:03:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZ3-0001Vb-6t
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:57 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	AD/A1-02699-C3C88445; Thu, 23 Oct 2014 05:03:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1414040633!11741301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20451 invoked from network); 23 Oct 2014 05:03:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYz-0004BK-O7
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYz-0001JW-8U
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:53 +0000
Date: Thu, 23 Oct 2014 05:03:53 +0000
Message-Id: <E1XhAYz-0001JW-8U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/misc: Delete more obsolete
	utilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a1b7407bfdb6bc0b33bc10a798e0c55799ae051
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 15 18:33:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 15:42:33 2014 +0100

    tools/misc: Delete more obsolete utilities
    
    * nsplitd has been orphaned from the build since its introduction in c/s
      dc44ed4764 (in 2004), and never been developed since.  While it does appear
      to compile, it is full of pointer width mismatch, pointer sign mismatch, and
      uninitialised variable warnings, which makes it unlikely to function
      correctly when compiled for a 64bit environment.
    
    * xen-python-path was declared obsolete in c/s 11e1149fe (in 2009) and can't
      actually be used correctly by out-of-tree components.  5 years is long enough
      for out-of-tree callers to catch up.
    
    There are no subdirectories any more, so drop the notion from the Makefile.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/misc/Makefile          |    7 +-
 tools/misc/nsplitd/Makefile  |   25 --
 tools/misc/nsplitd/nsplitd.c |  686 ------------------------------------------
 tools/misc/xen-python-path   |   24 --
 4 files changed, 1 insertions(+), 741 deletions(-)

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 3237461..7a2bfd2 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -16,13 +16,11 @@ TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash xen-lowmemd xen-mfnd
 TARGETS-$(CONFIG_MIGRATE) += xen-hptool
 TARGETS := $(TARGETS-y)
 
-SUBDIRS := $(SUBDIRS-y)
-
 INSTALL_BIN-y := xencons xencov_split
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
-INSTALL_SBIN-y := xen-bugtool xen-python-path xenperf xenpm xen-tmem-list-parse gtraceview \
+INSTALL_SBIN-y := xen-bugtool xenperf xenpm xen-tmem-list-parse gtraceview \
 	gtracestat xenlockprof xenwatchdogd xen-ringwatch xencov
 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash xen-lowmemd xen-mfndump
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
@@ -39,7 +37,6 @@ all: build
 
 .PHONY: build
 build: $(TARGETS)
-	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
 
 .PHONY: install
 install: build
@@ -49,12 +46,10 @@ install: build
 	$(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(LIBEXEC_BIN)
-	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
 
 .PHONY: clean
 clean:
 	$(RM) *.o $(TARGETS) *~ $(DEPS)
-	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
 
 xen-hvmctx: xen-hvmctx.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
diff --git a/tools/misc/nsplitd/Makefile b/tools/misc/nsplitd/Makefile
deleted file mode 100644
index 91ccf4d..0000000
--- a/tools/misc/nsplitd/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-XEN_ROOT := $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-CFILES = $(wildcard *.c)
-
-HDRS     = $(wildcard *.h)
-OBJS     = $(patsubst %.c,%.o,$(wildcard *.c))
-
-TARGET   = nsplitd
-
-.PHONY: all
-all: $(TARGET)
-
-.PHONY: install
-install: all
-
-.PHONY: clean
-clean:
-	$(RM) *.o $(TARGET) *~
-
-$(TARGET): $(OBJS)
-	$(HOSTCC) $(HOSTCFLAGS) -o $@ $^
-
-%.o: %.c $(HDRS) Makefile
-	$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
diff --git a/tools/misc/nsplitd/nsplitd.c b/tools/misc/nsplitd/nsplitd.c
deleted file mode 100644
index 32f0b56..0000000
--- a/tools/misc/nsplitd/nsplitd.c
+++ /dev/null
@@ -1,686 +0,0 @@
-/*
- *	nsplitd.c
- *	---------
- *
- * $Id: nsplitd.c,v 2.6 1998/09/17 14:28:37 sde1000 Exp $
- *
- * Copyright (c) 1995, University of Cambridge Computer Laboratory,
- * Copyright (c) 1995, Richard Black, All Rights Reserved.
- *
- *
- * A complete re-implementation of DME's nsplitd for use from inetd
- *
- */
-
-/* The basic stream comes in (via inetd) and we then conenct to
- * somewhere else providing a loop-through service, except we offer
- * two other ports for connection - one of which gets a second channel
- * using the top bit to distinguish, and the other is a master control
- * port (normally used for gdb) which gets complete exclusive access
- * for its duration.
- *
- * Originally designed for multiplexing a xwcons/telnet with a gdb
- * post-mortem debugging session.
- *
- * Here is a picture:
- *
- * 					    port0 (from inetd)
- *      8-bit connection     	       	   /
- * 	   made by us	   <----> nsplitd <-----gdbport (default port0+2)
- * 	to host:port/tcp		  |\
- * 					  | port1 (default port0+1)
- *                                         \
- *                                          control (default port0+3)
- *
- * If port1 is explicitly disabled (through a command-line option) then
- * port0 becomes 8-bit clean.
- */
-
-/*
- * N.B.: We do NOT support 8 bit stdin/stdout usage on a
- * /dev/... because to do that right involves much messing with ioctl
- * and TIOC... etc.  If you want to do that sort of thing then the
- * right way to do it is to chain this onto wconsd (which does know
- * about and understand all the ioctl and TIOC grief).
- */
-
-#include <sys/types.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <netdb.h>
-#include <string.h>
-
-#include <sys/time.h>
-#include <sys/signal.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <sys/ioctl.h>
-#include <syslog.h>
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef LOG_DAEMON
-#define LOG_DAEMON 0
-#endif
-
-#define DB(x)  /* ((x), fflush(stderr)) */
-
-extern char *optarg;
-
-extern int optind, opterr, optopt;
-
-static char *prog_name;
-
-static void usage(void)
-{
-    fprintf(stderr, "This program (%s) should be run via inetd (tcp)\n\n",
-	    prog_name);
-    fprintf(stderr, "usage: %s [-h<highport>][-g<gdbport>]"
-	    "[-c<ctlport>][-8] host:service\n",
-	    prog_name);
-    exit(1);
-}
-
-static void fault(char *format, ...)
-{
-    va_list		ap;
-    char		logbuf[1024];
-
-    va_start(ap, format);
-    fprintf(stderr, "%s: ", prog_name);
-    vfprintf(stderr, format, ap);
-    fflush(stderr);
-    va_end(ap);
-    
-    /* XXX This is a bit dubious, but there is no vsyslog */
-    va_start(ap, format);
-    vsnprintf(logbuf, sizeof(logbuf), format, ap);
-    syslog(LOG_ERR, logbuf);
-    va_end(ap);
-    exit(1);
-}
-
-static int getservice(char *name, unsigned short *port)
-{
-    struct servent		*se;
-
-    if (!name) return -1;
-
-    if (isdigit(name[0]))
-	*port = atoi(name);
-    else
-    {
-	if (!(se = getservbyname(name, "tcp")))
-	    return -1;
-	*port = ntohs(se->s_port);
-    }
-    return 0;
-}
-
-/* 
- *  connect_host: connect to ("name", "port")
- */
-static int connect_host (char *name, unsigned int port)
-{
-    int			fd;
-    struct hostent	*hostent;
-    struct sockaddr_in	sin;
-    int			on;
-    
-    if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0)
-	fault("socket");
-    
-    if (!(hostent = gethostbyname(name)))
-	fault("gethostbyname: %s: %s\n", name, strerror(errno));
-    
-    memset(&sin, 0, sizeof(sin));
-    sin.sin_family = AF_INET;
-    sin.sin_port   = htons (port);
-    memcpy(&sin.sin_addr.s_addr, hostent->h_addr, sizeof(struct in_addr));
-    
-    if (connect(fd, (struct sockaddr *) &sin, sizeof (sin)) < 0)
-	fault("connect: %s:%u: %s\n", name, port, strerror(errno));
-    
-    on = 1;
-    if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof (on)) < 0)
-	syslog(LOG_WARNING, "setsockopt (TCP_NODELAY): %m");
-
-    on = 1;
-    if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof (on)) < 0)
-	syslog(LOG_WARNING, "setsockopt (SO_KEEPALIVE): %m");
-
-    return fd;
-}
-
-/*
- * open a tcp socket and start listening for connections on it
- */
-static int startlistening(unsigned short port)
-{
-    int			fd, on;
-    struct sockaddr_in	sin;
-
-    if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0)
-	fault("socket");
-    
-    on = 1;
-    if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) < 0)
-      syslog(LOG_WARNING, "setsockopt (SO_REUSEADDR): %m");
-
-    memset(&sin, 0, sizeof(sin));
-    sin.sin_family      = AF_INET;
-    sin.sin_port        = htons (port);
-    sin.sin_addr.s_addr = INADDR_ANY;
-    if (bind(fd, &sin, sizeof(sin)) < 0)
-	fault("bind: %u: %s\n", port, strerror(errno));
-    
-    if (listen(fd, 1) < 0)
-	fault("listen: %s\n", strerror(errno));
-    
-    return fd;
-}
-
-static void noblock(int fd)
-{
-    int on=1;
-    
-    if (ioctl(fd, FIONBIO, &on) < 0)
-	fault("ioctl: FIONBIO: %s\n", strerror(errno));
-}
-
-
-/* You might not believe this, but fd_sets don't have to be a 32-bit
- * integer.  In particular, in glibc2 it is an array of unsigned
- * longs.  Hence, this hacked up FD_SET_rjb() that works out if it
- * would have been a nop. */
-#define FD_SET_rjb(fd, setp) \
-do {						\
-    if ((fd) != 32)				\
-	FD_SET((fd), (setp));			\
-} while(0)
-
-#define FD_ISSET_rjb(fd, setp) (((fd) != 32)? FD_ISSET((fd), (setp)) : 0)
-
-#define MAXSIZE	256
-
-/* -----------------------------------------------------------------
- * The main bit of the algorithm. Note we use 32 to mean not connected
- * because this gives us 1<<32 == 0. We could have done this one
- * character at a time, but that would have been very inefficient and
- * not the unix way.  */
-static int debug;
-
-static void doit(int actl, int acto, int lish, int lisg, int lisc)
-{
-    int		acth, actg, actc;
-    int		gdbmode = FALSE;
-    char	gibuf[MAXSIZE], oibuf[MAXSIZE];
-    char	libuf[MAXSIZE], lobuf[MAXSIZE];
-    char	hibuf[MAXSIZE], hobuf[MAXSIZE];
-    char	ctlbuf[MAXSIZE];
-    fd_set	rdfs, wrfs, exfs;
-    int		gicc, oicc, licc, locc, hicc, hocc, ctlcc;
-    char	*giptr, *oiptr, *liptr, *loptr, *hiptr, *hoptr;
-    int		rc, fromlen;
-    struct sockaddr_in		from;
-    
-    gicc = oicc = licc = locc = hicc = hocc = ctlcc = 0;
-    acth = actg = actc = 32;			/* XXX yummy */
-
-    noblock(actl);
-    noblock(acto);
-
-    for(;;)
-    {
-	FD_ZERO(&rdfs);
-	FD_ZERO(&wrfs);
-	FD_ZERO(&exfs);
-
-	/* always take input from the control port (if it's connected) */
-	FD_SET_rjb(actc, &rdfs);
-
-	if (gdbmode)
-	{
-	    if (oicc)
-		FD_SET_rjb(actg, &wrfs);
-	    else
-		FD_SET_rjb(acto, &rdfs);
-	    
-	    if (gicc)
-		FD_SET_rjb(acto, &wrfs);
-	    else
-		FD_SET_rjb(actg, &rdfs);
-	}
-	else
-	{
-	    /* There is no such thing as oibuf because its been split into
-	     * lobuf and hobuf
-	     */
-	    if (locc || hocc)
-	    {
-		if (locc)
-		    FD_SET_rjb(actl, &wrfs);
-		if (hocc)
-		    FD_SET_rjb(acth, &wrfs);
-	    }
-	    else
-		FD_SET_rjb(acto, &rdfs);
-	    
-	    if (licc)
-		FD_SET_rjb(acto, &wrfs);
-	    else
-		FD_SET_rjb(actl, &rdfs);
-	    
-	    if (hicc)
-		FD_SET_rjb(acto, &wrfs);
-	    else
-		FD_SET_rjb(acth, &rdfs);
-	}
-	
-	if (acth == 32 && lish>=0)	FD_SET_rjb(lish, &rdfs);
-	if (actg == 32)			FD_SET_rjb(lisg, &rdfs);
-	if (actc == 32)			FD_SET_rjb(lisc, &rdfs);
-
-	/* now make exfs the union of the read and write fd sets, plus
-	 * "actl" */
-	{
-	    int i;
-	    exfs = rdfs;
-	    for(i=0; i<32; i++)  /* XXX we only copy fd numbers up to 31 */
-		if (FD_ISSET(i, &wrfs))
-		    FD_SET_rjb(i, &exfs);
-	    FD_SET_rjb(actl, &exfs);
-	}
-
-	/* XXX AND: can't print something of type fd_set as %x - it
-         * might be an array */
-	DB(fprintf(stderr, "%s: before select: %08x %08x %08x\n",
-		   prog_name, rdfs, wrfs, exfs));
-	
-	if (select(32, &rdfs, &wrfs, &exfs, NULL) < 0)
-	    fault("select: %s\n", strerror(errno));
-	
-	DB(fprintf(stderr, "%s: after  select: %08x %08x %08x\n",
-		   prog_name, rdfs, wrfs, exfs));
-	
-	/* XXX it appears that a non-blocking socket may not show up
-	 * correctly in exfs but instead goes readable with no data in
-	 * it. Thus we check for zero and goto the appropriate close
-	 * method.  */
-
-	/* Deal with exceptions */
-	if (FD_ISSET_rjb(actg, &exfs))
-	{
-	exfs_actg:
-	    close(actg);
-	    gdbmode = FALSE;
-	    oicc = 0;
-	    oiptr = oibuf;
-	    actg = 32;
-	    continue;		/* because assumptions changed */
-	}
-	if (FD_ISSET_rjb(acth, &exfs))
-	{
-	exfs_acth:
-	    close(acth);
-	    hicc = hocc = 0;
-	    hiptr = hibuf;
-	    hoptr = hibuf;
-	    acth = 32;
-	    continue;		/* because assumptions changed */
-	}
-	if (FD_ISSET_rjb(actl, &exfs) ||
-	    FD_ISSET_rjb(acto, &exfs))
-	{
-	exfs_actl:
-	exfs_acto:
-	    /* Thats all folks ... */
-	    break;
-	}
-	if (FD_ISSET_rjb(actc, &exfs))
-	{
-	exfs_ctl:
-	    close(actc);
-	    actc = 32;
-	    ctlcc = 0;
-	    continue;
-	}
-
-	/* Deal with reading */
-	if (FD_ISSET_rjb(acto, &rdfs))
-	{
-	    if ((oicc = read(acto, oiptr = oibuf, MAXSIZE)) < 0)
-		fault("read acto: %d: %s\n", oicc, strerror(errno));
-	    if (!oicc) goto exfs_acto;
-	    
-	    if (!gdbmode)
-	    {
-		int t;
-
-		assert((locc == 0) && (hocc == 0));
-		loptr = lobuf;
-		hoptr = hobuf;
-		
-		if (lish>=0) {
-		    for(t=0; t<oicc; t++)
-			if (oibuf[t] & 0x80)
-			    hobuf[hocc++] = oibuf[t] & 0x7f;
-			else
-			    lobuf[locc++] = oibuf[t];
-		} else {
-		    for (t=0; t<oicc; t++)
-			lobuf[locc++] = oibuf[t];
-		}
-		/* If no high connection scratch that */
-		if (acth == 32)
-		    hocc=0;
-	    }
-	}
-	if (FD_ISSET_rjb(actl, &rdfs))
-	{
-	    if ((licc = read(actl, liptr = libuf, MAXSIZE)) < 0)
-		fault("read actl: %d: %s\n", licc, strerror(errno));
-	    if (!licc) goto exfs_actl;
-	}
-	if (FD_ISSET_rjb(acth, &rdfs))
-	{
-	    int t;
-	    
-	    if ((hicc = read(acth, hiptr = hibuf, MAXSIZE)) < 0)
-		fault("read acth: %d: %s\n", hicc, strerror(errno));
-	    if (!hicc) goto exfs_acth;
-	    for(t=0; t<hicc; t++)
-		hibuf[t] |= 0x80;
-	}
-	if (FD_ISSET_rjb(actg, &rdfs))
-	{
-	    if ((gicc = read(actg, giptr = gibuf, MAXSIZE)) < 0)
-		fault("read actg: %d: %s\n", gicc, strerror(errno));
-	    if (debug) write(1, giptr, gicc);		/* XXX */
-	    if (!gicc) goto exfs_actg;
-	}
-	if (FD_ISSET_rjb(actc, &rdfs))
-	{
-	    if ((ctlcc = read(actc, ctlbuf, MAXSIZE)) < 0)
-		fault("read actc: %d: %s\n", ctlcc, strerror(errno));
-	    if (debug) write(1, ctlbuf, gicc);
-	    if (!ctlcc) goto exfs_ctl;
-	    if (ctlbuf[0] == 'r') /* reset command */
-	    {
-		syslog(LOG_INFO, "reset command read, exiting");
-		if (debug) write(1, "reseting\n", sizeof("reseting\n"));
-		break;
-	    }
-	}
-	
-	/* Deal with writing */
-	if (FD_ISSET_rjb(actg, &wrfs))
-	{
-	    /* We must be in gdb mode so send oi buffer data */
-	    assert(gdbmode);
-	    if (debug) write(2, oiptr, oicc);		/* XXX */
-	    if ((rc = write(actg, oiptr, oicc)) <= 0)
-		fault("write actg: %d: %s\n", rc, strerror(errno));
-	    oiptr += rc;
-	    oicc  -= rc;
-	}
-	if (FD_ISSET_rjb(actl, &wrfs))
-	{
-	    if ((rc = write(actl, loptr, locc)) <= 0)
-		fault("write actl: %d: %s\n", rc, strerror(errno));
-	    loptr += rc;
-	    locc  -= rc;
-	}
-	if (FD_ISSET_rjb(acth, &wrfs))
-	{
-	    if ((rc = write(acth, hoptr, hocc)) <= 0)
-		fault("write acth: %d: %s\n", rc, strerror(errno));
-	    hoptr += rc;
-	    hocc  -= rc;
-	}
-	if (FD_ISSET_rjb(acto, &wrfs))
-	{
-	    /* If in gdb mode send gdb input, otherwise send low data
-	       preferentially */
-	    if (gdbmode)
-	    {
-		assert(gicc);
-		if ((rc = write(acto, giptr, gicc)) <= 0)
-		    fault("write acto: %d: %s\n", rc, strerror(errno));
-		giptr += rc;
-		gicc  -= rc;
-	    }
-	    else
-	    {
-		if (licc)
-		{
-		    if ((rc = write(acto, liptr, licc)) <= 0)
-			fault("write acto: %d: %s\n", rc, strerror(errno));
-		    liptr += rc;
-		    licc  -= rc;
-		}
-		else
-		{
-		    assert(hicc);
-		    if ((rc = write(acto, hiptr, hicc)) <= 0)
-			fault("write acto: %d: %s\n", rc, strerror(errno));
-		    hiptr += rc;
-		    hicc  -= rc;
-		}
-	    }
-	}
-	
-	/* Deals with new connections */
-	if ((acth == 32) && lish>=0 && (FD_ISSET_rjb(lish, &rdfs)))
-	{
-	    fromlen = sizeof(from);
-	    if ((acth = accept(lish, &from, &fromlen)) < 0)
-	    {
-		syslog(LOG_WARNING, "accept: %m");
-		acth = 32;
-	    }
-	    else
-	    {
-		noblock(acth);
-		hicc = hocc = 0;
-		syslog(LOG_INFO, "highbit client peer is %s:%u\n",
-		       inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-	    }
-	}
-	
-	if ((actg == 32) && (FD_ISSET_rjb(lisg, &rdfs)))
-	{
-	    fromlen = sizeof(from);
-	    if ((actg = accept(lisg, &from, &fromlen)) < 0)
-	    {
-		syslog(LOG_WARNING, "accept: %m");
-		actg = 32;
-	    }
-	    else
-	    {
-		noblock(actg);
-		gicc = 0;
-		gdbmode = TRUE;
-		syslog(LOG_INFO, "gdb client peer is %s:%u\n",
-		       inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-	    }
-	}
-
-	if ((actc == 32) && (FD_ISSET_rjb(lisc, &rdfs)))
-	{
-	    fromlen = sizeof(from);
-	    if ((actc = accept(lisc, &from, &fromlen)) < 0)
-	    {
-		syslog(LOG_WARNING, "accept (ctl): %m");
-		actc = 32;
-	    }
-	    else
-	    {
-		noblock(actc);
-		syslog(LOG_INFO, "ctl client peer is %s:%u\n",
-		       inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-	    }
-	}
-	    
-	/* Back to top of loop */
-    }
-    
-    /* We are bailing because one of the primary connections has gone
-     * away. We close these all explicitly here because that way the
-     * timeout on reusing the port numbers is smnaller. */
-    
-    close(acth);
-    close(actg);
-    /* XXX AND: why are we closing all these "character counts" ?? */
-    close(gicc);
-    close(oicc);
-    close(licc);
-    close(locc);
-    close(hicc);
-    close(hocc);
-}
-
-/*
- * ------------------------------------------------------------
- */
-int main(int argc, char **argv)
-{
-    /* In general, suffix "l" is low channel, "h" is high channel, "g"
-     * is gdb channel, "c" is control channel and "o" is output channel.
-     */
-    struct sockaddr_in		from;
-    int				infd = 0, outfd;
-    unsigned short		portl, porth, portg, portc, porto;
-    int				on = 1, c;
-    char			*outname, *outservice;
-    int				fromlen;
-    int				lish, lisg, lisc;
-#if 0
-    FILE			*newerr;
-#endif /* 0 */
-    
-    prog_name = argv[0];
-
-    if (isatty(infd))
-	usage();
-
-    /* Here, then not just a simple idiot. */
-
-    signal(SIGPIPE, SIG_IGN);
-
-    openlog(prog_name, LOG_PID, LOG_DAEMON);
-
-    fromlen = sizeof(from);
-    if (getsockname(infd, &from, &fromlen) < 0)
-	fault("getsockname: %s", strerror(errno));
-    if ((fromlen != sizeof(from)) || (from.sin_family != AF_INET))
-	fault("not an inet socket (family=%d)\n", from.sin_family);
-    
-    portl = ntohs(from.sin_port);
-    porth = portl+1;
-    portg = porth+1;
-    portc = portg+1;
-
-    fromlen = sizeof(from);
-    if (getpeername(infd, &from, &fromlen) < 0)
-	fault("getpeername: %s", strerror(errno));
-    if ((fromlen != sizeof(from)) || (from.sin_family != AF_INET))
-	fault("not an inet socket (family=%d)\n", from.sin_family);
-
-    syslog(LOG_INFO, "on port %u peer is %s:%u\n", portl,
-	   inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-    
-    if (setsockopt(infd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof (on)) < 0)
-	syslog(LOG_WARNING, "setsockopt (SO_KEEPALIVE): %m");
-
-    /* from here on, we map stderr to output on the connection so we can
-     * report errors to the remote user.
-     */
-#if 0
-    if (!(newerr = fdopen(infd, "w")))
-	syslog(LOG_WARNING, "fdopen: %m");
-    else
-	*stderr = *newerr;
-#endif
-	
-    while((c = getopt(argc, argv, "d8h:g:c:")) != EOF)
-    {
-	switch(c)
-	{
-	case 'd':
-	    debug++;
-	    break;
-	    
-	case 'h':
-	    /* high bit port */
-	    if (getservice(optarg, &porth) < 0)
-		fault("getservice failed (high port '%s')\n", optarg);
-	    break;
-	    
-	case 'g':
-	    /* gdb port */
-	    if (getservice(optarg, &portg) < 0)
-		fault("getservice failed (gdb port '%s')\n", optarg);
-	    break;
-
-	case 'c':
-	    /* control port */
-	    if (getservice(optarg, &portc) < 0)
-		fault("getservice failed (control port '%s')\n", optarg);
-	    break;
-
-	case '8':
-	    /* 8-bit clean; no high port */
-	    porth=0;
-	    break;
-
-	default:
-	    fault("bad argument list!\n");
-	}
-    }
-    
-    if (argc != optind + 1)
-	fault("unparsed arguments (%d!=%d)\n", argc, optind+1);
-
-    outname = argv[optind];
-    if (!(outservice = strchr(outname, ':')))
-	fault("output arg '%s' doesn't contain ':'\n", outname);
-    *outservice++ = 0;
-    if (getservice(outservice, &porto) < 0)
-	fault("getservice failed (output port '%s')\n", outservice);
-    
-    /* Time to start the sockets */
-
-    if (porth) {
-	lish  = startlistening(porth);
-    } else {
-	lish  = -1;
-    }
-    lisg  = startlistening(portg);
-    lisc  = startlistening(portc);
-    
-    outfd = connect_host(outname, porto);
-    
-    doit(infd, outfd, lish, lisg, lisc);
-
-    syslog(LOG_INFO, "terminating normally\n");
-
-    fclose(stderr);
-
-    closelog();
-    exit(0); 
-}
-
-/* End $Id: nsplitd.c,v 2.6 1998/09/17 14:28:37 sde1000 Exp $ */
diff --git a/tools/misc/xen-python-path b/tools/misc/xen-python-path
deleted file mode 100644
index 073abae..0000000
--- a/tools/misc/xen-python-path
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-#  -*- mode: python; -*-
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2007 XenSource Inc.
-#============================================================================
-
-# Nowadays we install xen in the standard python site-packages
-# directories.  This script is still provided for the benefit of old
-# out-of-xen-tree callers.  It is deprecated and will be removed.
-
-print '/dev/enoent/xen/python-path'
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:03:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:03:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZ5-0001Vz-2v; Thu, 23 Oct 2014 05:03:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZ3-0001Vb-6t
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:57 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	AD/A1-02699-C3C88445; Thu, 23 Oct 2014 05:03:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1414040633!11741301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20451 invoked from network); 23 Oct 2014 05:03:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:03:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYz-0004BK-O7
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAYz-0001JW-8U
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:03:53 +0000
Date: Thu, 23 Oct 2014 05:03:53 +0000
Message-Id: <E1XhAYz-0001JW-8U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/misc: Delete more obsolete
	utilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a1b7407bfdb6bc0b33bc10a798e0c55799ae051
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 15 18:33:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 20 15:42:33 2014 +0100

    tools/misc: Delete more obsolete utilities
    
    * nsplitd has been orphaned from the build since its introduction in c/s
      dc44ed4764 (in 2004), and never been developed since.  While it does appear
      to compile, it is full of pointer width mismatch, pointer sign mismatch, and
      uninitialised variable warnings, which makes it unlikely to function
      correctly when compiled for a 64bit environment.
    
    * xen-python-path was declared obsolete in c/s 11e1149fe (in 2009) and can't
      actually be used correctly by out-of-tree components.  5 years is long enough
      for out-of-tree callers to catch up.
    
    There are no subdirectories any more, so drop the notion from the Makefile.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/misc/Makefile          |    7 +-
 tools/misc/nsplitd/Makefile  |   25 --
 tools/misc/nsplitd/nsplitd.c |  686 ------------------------------------------
 tools/misc/xen-python-path   |   24 --
 4 files changed, 1 insertions(+), 741 deletions(-)

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 3237461..7a2bfd2 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -16,13 +16,11 @@ TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash xen-lowmemd xen-mfnd
 TARGETS-$(CONFIG_MIGRATE) += xen-hptool
 TARGETS := $(TARGETS-y)
 
-SUBDIRS := $(SUBDIRS-y)
-
 INSTALL_BIN-y := xencons xencov_split
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
-INSTALL_SBIN-y := xen-bugtool xen-python-path xenperf xenpm xen-tmem-list-parse gtraceview \
+INSTALL_SBIN-y := xen-bugtool xenperf xenpm xen-tmem-list-parse gtraceview \
 	gtracestat xenlockprof xenwatchdogd xen-ringwatch xencov
 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash xen-lowmemd xen-mfndump
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
@@ -39,7 +37,6 @@ all: build
 
 .PHONY: build
 build: $(TARGETS)
-	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
 
 .PHONY: install
 install: build
@@ -49,12 +46,10 @@ install: build
 	$(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(LIBEXEC_BIN)
-	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
 
 .PHONY: clean
 clean:
 	$(RM) *.o $(TARGETS) *~ $(DEPS)
-	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
 
 xen-hvmctx: xen-hvmctx.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
diff --git a/tools/misc/nsplitd/Makefile b/tools/misc/nsplitd/Makefile
deleted file mode 100644
index 91ccf4d..0000000
--- a/tools/misc/nsplitd/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-XEN_ROOT := $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-CFILES = $(wildcard *.c)
-
-HDRS     = $(wildcard *.h)
-OBJS     = $(patsubst %.c,%.o,$(wildcard *.c))
-
-TARGET   = nsplitd
-
-.PHONY: all
-all: $(TARGET)
-
-.PHONY: install
-install: all
-
-.PHONY: clean
-clean:
-	$(RM) *.o $(TARGET) *~
-
-$(TARGET): $(OBJS)
-	$(HOSTCC) $(HOSTCFLAGS) -o $@ $^
-
-%.o: %.c $(HDRS) Makefile
-	$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
diff --git a/tools/misc/nsplitd/nsplitd.c b/tools/misc/nsplitd/nsplitd.c
deleted file mode 100644
index 32f0b56..0000000
--- a/tools/misc/nsplitd/nsplitd.c
+++ /dev/null
@@ -1,686 +0,0 @@
-/*
- *	nsplitd.c
- *	---------
- *
- * $Id: nsplitd.c,v 2.6 1998/09/17 14:28:37 sde1000 Exp $
- *
- * Copyright (c) 1995, University of Cambridge Computer Laboratory,
- * Copyright (c) 1995, Richard Black, All Rights Reserved.
- *
- *
- * A complete re-implementation of DME's nsplitd for use from inetd
- *
- */
-
-/* The basic stream comes in (via inetd) and we then conenct to
- * somewhere else providing a loop-through service, except we offer
- * two other ports for connection - one of which gets a second channel
- * using the top bit to distinguish, and the other is a master control
- * port (normally used for gdb) which gets complete exclusive access
- * for its duration.
- *
- * Originally designed for multiplexing a xwcons/telnet with a gdb
- * post-mortem debugging session.
- *
- * Here is a picture:
- *
- * 					    port0 (from inetd)
- *      8-bit connection     	       	   /
- * 	   made by us	   <----> nsplitd <-----gdbport (default port0+2)
- * 	to host:port/tcp		  |\
- * 					  | port1 (default port0+1)
- *                                         \
- *                                          control (default port0+3)
- *
- * If port1 is explicitly disabled (through a command-line option) then
- * port0 becomes 8-bit clean.
- */
-
-/*
- * N.B.: We do NOT support 8 bit stdin/stdout usage on a
- * /dev/... because to do that right involves much messing with ioctl
- * and TIOC... etc.  If you want to do that sort of thing then the
- * right way to do it is to chain this onto wconsd (which does know
- * about and understand all the ioctl and TIOC grief).
- */
-
-#include <sys/types.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <netdb.h>
-#include <string.h>
-
-#include <sys/time.h>
-#include <sys/signal.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <sys/ioctl.h>
-#include <syslog.h>
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef LOG_DAEMON
-#define LOG_DAEMON 0
-#endif
-
-#define DB(x)  /* ((x), fflush(stderr)) */
-
-extern char *optarg;
-
-extern int optind, opterr, optopt;
-
-static char *prog_name;
-
-static void usage(void)
-{
-    fprintf(stderr, "This program (%s) should be run via inetd (tcp)\n\n",
-	    prog_name);
-    fprintf(stderr, "usage: %s [-h<highport>][-g<gdbport>]"
-	    "[-c<ctlport>][-8] host:service\n",
-	    prog_name);
-    exit(1);
-}
-
-static void fault(char *format, ...)
-{
-    va_list		ap;
-    char		logbuf[1024];
-
-    va_start(ap, format);
-    fprintf(stderr, "%s: ", prog_name);
-    vfprintf(stderr, format, ap);
-    fflush(stderr);
-    va_end(ap);
-    
-    /* XXX This is a bit dubious, but there is no vsyslog */
-    va_start(ap, format);
-    vsnprintf(logbuf, sizeof(logbuf), format, ap);
-    syslog(LOG_ERR, logbuf);
-    va_end(ap);
-    exit(1);
-}
-
-static int getservice(char *name, unsigned short *port)
-{
-    struct servent		*se;
-
-    if (!name) return -1;
-
-    if (isdigit(name[0]))
-	*port = atoi(name);
-    else
-    {
-	if (!(se = getservbyname(name, "tcp")))
-	    return -1;
-	*port = ntohs(se->s_port);
-    }
-    return 0;
-}
-
-/* 
- *  connect_host: connect to ("name", "port")
- */
-static int connect_host (char *name, unsigned int port)
-{
-    int			fd;
-    struct hostent	*hostent;
-    struct sockaddr_in	sin;
-    int			on;
-    
-    if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0)
-	fault("socket");
-    
-    if (!(hostent = gethostbyname(name)))
-	fault("gethostbyname: %s: %s\n", name, strerror(errno));
-    
-    memset(&sin, 0, sizeof(sin));
-    sin.sin_family = AF_INET;
-    sin.sin_port   = htons (port);
-    memcpy(&sin.sin_addr.s_addr, hostent->h_addr, sizeof(struct in_addr));
-    
-    if (connect(fd, (struct sockaddr *) &sin, sizeof (sin)) < 0)
-	fault("connect: %s:%u: %s\n", name, port, strerror(errno));
-    
-    on = 1;
-    if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof (on)) < 0)
-	syslog(LOG_WARNING, "setsockopt (TCP_NODELAY): %m");
-
-    on = 1;
-    if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof (on)) < 0)
-	syslog(LOG_WARNING, "setsockopt (SO_KEEPALIVE): %m");
-
-    return fd;
-}
-
-/*
- * open a tcp socket and start listening for connections on it
- */
-static int startlistening(unsigned short port)
-{
-    int			fd, on;
-    struct sockaddr_in	sin;
-
-    if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0)
-	fault("socket");
-    
-    on = 1;
-    if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) < 0)
-      syslog(LOG_WARNING, "setsockopt (SO_REUSEADDR): %m");
-
-    memset(&sin, 0, sizeof(sin));
-    sin.sin_family      = AF_INET;
-    sin.sin_port        = htons (port);
-    sin.sin_addr.s_addr = INADDR_ANY;
-    if (bind(fd, &sin, sizeof(sin)) < 0)
-	fault("bind: %u: %s\n", port, strerror(errno));
-    
-    if (listen(fd, 1) < 0)
-	fault("listen: %s\n", strerror(errno));
-    
-    return fd;
-}
-
-static void noblock(int fd)
-{
-    int on=1;
-    
-    if (ioctl(fd, FIONBIO, &on) < 0)
-	fault("ioctl: FIONBIO: %s\n", strerror(errno));
-}
-
-
-/* You might not believe this, but fd_sets don't have to be a 32-bit
- * integer.  In particular, in glibc2 it is an array of unsigned
- * longs.  Hence, this hacked up FD_SET_rjb() that works out if it
- * would have been a nop. */
-#define FD_SET_rjb(fd, setp) \
-do {						\
-    if ((fd) != 32)				\
-	FD_SET((fd), (setp));			\
-} while(0)
-
-#define FD_ISSET_rjb(fd, setp) (((fd) != 32)? FD_ISSET((fd), (setp)) : 0)
-
-#define MAXSIZE	256
-
-/* -----------------------------------------------------------------
- * The main bit of the algorithm. Note we use 32 to mean not connected
- * because this gives us 1<<32 == 0. We could have done this one
- * character at a time, but that would have been very inefficient and
- * not the unix way.  */
-static int debug;
-
-static void doit(int actl, int acto, int lish, int lisg, int lisc)
-{
-    int		acth, actg, actc;
-    int		gdbmode = FALSE;
-    char	gibuf[MAXSIZE], oibuf[MAXSIZE];
-    char	libuf[MAXSIZE], lobuf[MAXSIZE];
-    char	hibuf[MAXSIZE], hobuf[MAXSIZE];
-    char	ctlbuf[MAXSIZE];
-    fd_set	rdfs, wrfs, exfs;
-    int		gicc, oicc, licc, locc, hicc, hocc, ctlcc;
-    char	*giptr, *oiptr, *liptr, *loptr, *hiptr, *hoptr;
-    int		rc, fromlen;
-    struct sockaddr_in		from;
-    
-    gicc = oicc = licc = locc = hicc = hocc = ctlcc = 0;
-    acth = actg = actc = 32;			/* XXX yummy */
-
-    noblock(actl);
-    noblock(acto);
-
-    for(;;)
-    {
-	FD_ZERO(&rdfs);
-	FD_ZERO(&wrfs);
-	FD_ZERO(&exfs);
-
-	/* always take input from the control port (if it's connected) */
-	FD_SET_rjb(actc, &rdfs);
-
-	if (gdbmode)
-	{
-	    if (oicc)
-		FD_SET_rjb(actg, &wrfs);
-	    else
-		FD_SET_rjb(acto, &rdfs);
-	    
-	    if (gicc)
-		FD_SET_rjb(acto, &wrfs);
-	    else
-		FD_SET_rjb(actg, &rdfs);
-	}
-	else
-	{
-	    /* There is no such thing as oibuf because its been split into
-	     * lobuf and hobuf
-	     */
-	    if (locc || hocc)
-	    {
-		if (locc)
-		    FD_SET_rjb(actl, &wrfs);
-		if (hocc)
-		    FD_SET_rjb(acth, &wrfs);
-	    }
-	    else
-		FD_SET_rjb(acto, &rdfs);
-	    
-	    if (licc)
-		FD_SET_rjb(acto, &wrfs);
-	    else
-		FD_SET_rjb(actl, &rdfs);
-	    
-	    if (hicc)
-		FD_SET_rjb(acto, &wrfs);
-	    else
-		FD_SET_rjb(acth, &rdfs);
-	}
-	
-	if (acth == 32 && lish>=0)	FD_SET_rjb(lish, &rdfs);
-	if (actg == 32)			FD_SET_rjb(lisg, &rdfs);
-	if (actc == 32)			FD_SET_rjb(lisc, &rdfs);
-
-	/* now make exfs the union of the read and write fd sets, plus
-	 * "actl" */
-	{
-	    int i;
-	    exfs = rdfs;
-	    for(i=0; i<32; i++)  /* XXX we only copy fd numbers up to 31 */
-		if (FD_ISSET(i, &wrfs))
-		    FD_SET_rjb(i, &exfs);
-	    FD_SET_rjb(actl, &exfs);
-	}
-
-	/* XXX AND: can't print something of type fd_set as %x - it
-         * might be an array */
-	DB(fprintf(stderr, "%s: before select: %08x %08x %08x\n",
-		   prog_name, rdfs, wrfs, exfs));
-	
-	if (select(32, &rdfs, &wrfs, &exfs, NULL) < 0)
-	    fault("select: %s\n", strerror(errno));
-	
-	DB(fprintf(stderr, "%s: after  select: %08x %08x %08x\n",
-		   prog_name, rdfs, wrfs, exfs));
-	
-	/* XXX it appears that a non-blocking socket may not show up
-	 * correctly in exfs but instead goes readable with no data in
-	 * it. Thus we check for zero and goto the appropriate close
-	 * method.  */
-
-	/* Deal with exceptions */
-	if (FD_ISSET_rjb(actg, &exfs))
-	{
-	exfs_actg:
-	    close(actg);
-	    gdbmode = FALSE;
-	    oicc = 0;
-	    oiptr = oibuf;
-	    actg = 32;
-	    continue;		/* because assumptions changed */
-	}
-	if (FD_ISSET_rjb(acth, &exfs))
-	{
-	exfs_acth:
-	    close(acth);
-	    hicc = hocc = 0;
-	    hiptr = hibuf;
-	    hoptr = hibuf;
-	    acth = 32;
-	    continue;		/* because assumptions changed */
-	}
-	if (FD_ISSET_rjb(actl, &exfs) ||
-	    FD_ISSET_rjb(acto, &exfs))
-	{
-	exfs_actl:
-	exfs_acto:
-	    /* Thats all folks ... */
-	    break;
-	}
-	if (FD_ISSET_rjb(actc, &exfs))
-	{
-	exfs_ctl:
-	    close(actc);
-	    actc = 32;
-	    ctlcc = 0;
-	    continue;
-	}
-
-	/* Deal with reading */
-	if (FD_ISSET_rjb(acto, &rdfs))
-	{
-	    if ((oicc = read(acto, oiptr = oibuf, MAXSIZE)) < 0)
-		fault("read acto: %d: %s\n", oicc, strerror(errno));
-	    if (!oicc) goto exfs_acto;
-	    
-	    if (!gdbmode)
-	    {
-		int t;
-
-		assert((locc == 0) && (hocc == 0));
-		loptr = lobuf;
-		hoptr = hobuf;
-		
-		if (lish>=0) {
-		    for(t=0; t<oicc; t++)
-			if (oibuf[t] & 0x80)
-			    hobuf[hocc++] = oibuf[t] & 0x7f;
-			else
-			    lobuf[locc++] = oibuf[t];
-		} else {
-		    for (t=0; t<oicc; t++)
-			lobuf[locc++] = oibuf[t];
-		}
-		/* If no high connection scratch that */
-		if (acth == 32)
-		    hocc=0;
-	    }
-	}
-	if (FD_ISSET_rjb(actl, &rdfs))
-	{
-	    if ((licc = read(actl, liptr = libuf, MAXSIZE)) < 0)
-		fault("read actl: %d: %s\n", licc, strerror(errno));
-	    if (!licc) goto exfs_actl;
-	}
-	if (FD_ISSET_rjb(acth, &rdfs))
-	{
-	    int t;
-	    
-	    if ((hicc = read(acth, hiptr = hibuf, MAXSIZE)) < 0)
-		fault("read acth: %d: %s\n", hicc, strerror(errno));
-	    if (!hicc) goto exfs_acth;
-	    for(t=0; t<hicc; t++)
-		hibuf[t] |= 0x80;
-	}
-	if (FD_ISSET_rjb(actg, &rdfs))
-	{
-	    if ((gicc = read(actg, giptr = gibuf, MAXSIZE)) < 0)
-		fault("read actg: %d: %s\n", gicc, strerror(errno));
-	    if (debug) write(1, giptr, gicc);		/* XXX */
-	    if (!gicc) goto exfs_actg;
-	}
-	if (FD_ISSET_rjb(actc, &rdfs))
-	{
-	    if ((ctlcc = read(actc, ctlbuf, MAXSIZE)) < 0)
-		fault("read actc: %d: %s\n", ctlcc, strerror(errno));
-	    if (debug) write(1, ctlbuf, gicc);
-	    if (!ctlcc) goto exfs_ctl;
-	    if (ctlbuf[0] == 'r') /* reset command */
-	    {
-		syslog(LOG_INFO, "reset command read, exiting");
-		if (debug) write(1, "reseting\n", sizeof("reseting\n"));
-		break;
-	    }
-	}
-	
-	/* Deal with writing */
-	if (FD_ISSET_rjb(actg, &wrfs))
-	{
-	    /* We must be in gdb mode so send oi buffer data */
-	    assert(gdbmode);
-	    if (debug) write(2, oiptr, oicc);		/* XXX */
-	    if ((rc = write(actg, oiptr, oicc)) <= 0)
-		fault("write actg: %d: %s\n", rc, strerror(errno));
-	    oiptr += rc;
-	    oicc  -= rc;
-	}
-	if (FD_ISSET_rjb(actl, &wrfs))
-	{
-	    if ((rc = write(actl, loptr, locc)) <= 0)
-		fault("write actl: %d: %s\n", rc, strerror(errno));
-	    loptr += rc;
-	    locc  -= rc;
-	}
-	if (FD_ISSET_rjb(acth, &wrfs))
-	{
-	    if ((rc = write(acth, hoptr, hocc)) <= 0)
-		fault("write acth: %d: %s\n", rc, strerror(errno));
-	    hoptr += rc;
-	    hocc  -= rc;
-	}
-	if (FD_ISSET_rjb(acto, &wrfs))
-	{
-	    /* If in gdb mode send gdb input, otherwise send low data
-	       preferentially */
-	    if (gdbmode)
-	    {
-		assert(gicc);
-		if ((rc = write(acto, giptr, gicc)) <= 0)
-		    fault("write acto: %d: %s\n", rc, strerror(errno));
-		giptr += rc;
-		gicc  -= rc;
-	    }
-	    else
-	    {
-		if (licc)
-		{
-		    if ((rc = write(acto, liptr, licc)) <= 0)
-			fault("write acto: %d: %s\n", rc, strerror(errno));
-		    liptr += rc;
-		    licc  -= rc;
-		}
-		else
-		{
-		    assert(hicc);
-		    if ((rc = write(acto, hiptr, hicc)) <= 0)
-			fault("write acto: %d: %s\n", rc, strerror(errno));
-		    hiptr += rc;
-		    hicc  -= rc;
-		}
-	    }
-	}
-	
-	/* Deals with new connections */
-	if ((acth == 32) && lish>=0 && (FD_ISSET_rjb(lish, &rdfs)))
-	{
-	    fromlen = sizeof(from);
-	    if ((acth = accept(lish, &from, &fromlen)) < 0)
-	    {
-		syslog(LOG_WARNING, "accept: %m");
-		acth = 32;
-	    }
-	    else
-	    {
-		noblock(acth);
-		hicc = hocc = 0;
-		syslog(LOG_INFO, "highbit client peer is %s:%u\n",
-		       inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-	    }
-	}
-	
-	if ((actg == 32) && (FD_ISSET_rjb(lisg, &rdfs)))
-	{
-	    fromlen = sizeof(from);
-	    if ((actg = accept(lisg, &from, &fromlen)) < 0)
-	    {
-		syslog(LOG_WARNING, "accept: %m");
-		actg = 32;
-	    }
-	    else
-	    {
-		noblock(actg);
-		gicc = 0;
-		gdbmode = TRUE;
-		syslog(LOG_INFO, "gdb client peer is %s:%u\n",
-		       inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-	    }
-	}
-
-	if ((actc == 32) && (FD_ISSET_rjb(lisc, &rdfs)))
-	{
-	    fromlen = sizeof(from);
-	    if ((actc = accept(lisc, &from, &fromlen)) < 0)
-	    {
-		syslog(LOG_WARNING, "accept (ctl): %m");
-		actc = 32;
-	    }
-	    else
-	    {
-		noblock(actc);
-		syslog(LOG_INFO, "ctl client peer is %s:%u\n",
-		       inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-	    }
-	}
-	    
-	/* Back to top of loop */
-    }
-    
-    /* We are bailing because one of the primary connections has gone
-     * away. We close these all explicitly here because that way the
-     * timeout on reusing the port numbers is smnaller. */
-    
-    close(acth);
-    close(actg);
-    /* XXX AND: why are we closing all these "character counts" ?? */
-    close(gicc);
-    close(oicc);
-    close(licc);
-    close(locc);
-    close(hicc);
-    close(hocc);
-}
-
-/*
- * ------------------------------------------------------------
- */
-int main(int argc, char **argv)
-{
-    /* In general, suffix "l" is low channel, "h" is high channel, "g"
-     * is gdb channel, "c" is control channel and "o" is output channel.
-     */
-    struct sockaddr_in		from;
-    int				infd = 0, outfd;
-    unsigned short		portl, porth, portg, portc, porto;
-    int				on = 1, c;
-    char			*outname, *outservice;
-    int				fromlen;
-    int				lish, lisg, lisc;
-#if 0
-    FILE			*newerr;
-#endif /* 0 */
-    
-    prog_name = argv[0];
-
-    if (isatty(infd))
-	usage();
-
-    /* Here, then not just a simple idiot. */
-
-    signal(SIGPIPE, SIG_IGN);
-
-    openlog(prog_name, LOG_PID, LOG_DAEMON);
-
-    fromlen = sizeof(from);
-    if (getsockname(infd, &from, &fromlen) < 0)
-	fault("getsockname: %s", strerror(errno));
-    if ((fromlen != sizeof(from)) || (from.sin_family != AF_INET))
-	fault("not an inet socket (family=%d)\n", from.sin_family);
-    
-    portl = ntohs(from.sin_port);
-    porth = portl+1;
-    portg = porth+1;
-    portc = portg+1;
-
-    fromlen = sizeof(from);
-    if (getpeername(infd, &from, &fromlen) < 0)
-	fault("getpeername: %s", strerror(errno));
-    if ((fromlen != sizeof(from)) || (from.sin_family != AF_INET))
-	fault("not an inet socket (family=%d)\n", from.sin_family);
-
-    syslog(LOG_INFO, "on port %u peer is %s:%u\n", portl,
-	   inet_ntoa(from.sin_addr), ntohs(from.sin_port));
-    
-    if (setsockopt(infd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof (on)) < 0)
-	syslog(LOG_WARNING, "setsockopt (SO_KEEPALIVE): %m");
-
-    /* from here on, we map stderr to output on the connection so we can
-     * report errors to the remote user.
-     */
-#if 0
-    if (!(newerr = fdopen(infd, "w")))
-	syslog(LOG_WARNING, "fdopen: %m");
-    else
-	*stderr = *newerr;
-#endif
-	
-    while((c = getopt(argc, argv, "d8h:g:c:")) != EOF)
-    {
-	switch(c)
-	{
-	case 'd':
-	    debug++;
-	    break;
-	    
-	case 'h':
-	    /* high bit port */
-	    if (getservice(optarg, &porth) < 0)
-		fault("getservice failed (high port '%s')\n", optarg);
-	    break;
-	    
-	case 'g':
-	    /* gdb port */
-	    if (getservice(optarg, &portg) < 0)
-		fault("getservice failed (gdb port '%s')\n", optarg);
-	    break;
-
-	case 'c':
-	    /* control port */
-	    if (getservice(optarg, &portc) < 0)
-		fault("getservice failed (control port '%s')\n", optarg);
-	    break;
-
-	case '8':
-	    /* 8-bit clean; no high port */
-	    porth=0;
-	    break;
-
-	default:
-	    fault("bad argument list!\n");
-	}
-    }
-    
-    if (argc != optind + 1)
-	fault("unparsed arguments (%d!=%d)\n", argc, optind+1);
-
-    outname = argv[optind];
-    if (!(outservice = strchr(outname, ':')))
-	fault("output arg '%s' doesn't contain ':'\n", outname);
-    *outservice++ = 0;
-    if (getservice(outservice, &porto) < 0)
-	fault("getservice failed (output port '%s')\n", outservice);
-    
-    /* Time to start the sockets */
-
-    if (porth) {
-	lish  = startlistening(porth);
-    } else {
-	lish  = -1;
-    }
-    lisg  = startlistening(portg);
-    lisc  = startlistening(portc);
-    
-    outfd = connect_host(outname, porto);
-    
-    doit(infd, outfd, lish, lisg, lisc);
-
-    syslog(LOG_INFO, "terminating normally\n");
-
-    fclose(stderr);
-
-    closelog();
-    exit(0); 
-}
-
-/* End $Id: nsplitd.c,v 2.6 1998/09/17 14:28:37 sde1000 Exp $ */
diff --git a/tools/misc/xen-python-path b/tools/misc/xen-python-path
deleted file mode 100644
index 073abae..0000000
--- a/tools/misc/xen-python-path
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-#  -*- mode: python; -*-
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2007 XenSource Inc.
-#============================================================================
-
-# Nowadays we install xen in the standard python site-packages
-# directories.  This script is still provided for the benefit of old
-# out-of-xen-tree callers.  It is deprecated and will be removed.
-
-print '/dev/enoent/xen/python-path'
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZG-0001Xz-8u; Thu, 23 Oct 2014 05:04:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZE-0001Xe-Lk
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:08 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6F/81-02972-74C88445; Thu, 23 Oct 2014 05:04:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1414040646!11054324!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9072 invoked from network); 23 Oct 2014 05:04:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZA-0004Bt-5H
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZA-0001KJ-2n
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:04 +0000
Date: Thu, 23 Oct 2014 05:04:04 +0000
Message-Id: <E1XhAZA-0001KJ-2n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce specification for x86
	pv bootloader chainloading paths/formats.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 250073f452484912ee21c63c5d9efca40f5398d9
Author:     Ian Campbell <ijc@hellion.org.uk>
AuthorDate: Fri Aug 29 21:14:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 21 08:59:56 2014 +0100

    docs: Introduce specification for x86 pv bootloader chainloading paths/formats.
    
    In order to support pvgrub (or other bootloader) from dom0 chainloading a
    pvgrub (or other) from within the domU filesystem we need a standard for where
    the stage 1 bootloader should look and what it should expect to find there.
    
    Add a document along those lines.
    
    This is currently x86-specific since it is expected that other new architecures
    (including ARM) will either not need to implement this due to the existence of
    more generic specifications for that arch (e.g. the ARM VM spec) or will update
    this document in due course.
    
    Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Colin Watson <cjwatson@debian.org>
    Cc: 759018@bugs.debian.org
---
 docs/misc/x86-xenpv-bootloader.markdown |   49 +++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/docs/misc/x86-xenpv-bootloader.markdown b/docs/misc/x86-xenpv-bootloader.markdown
new file mode 100644
index 0000000..ec8854e
--- /dev/null
+++ b/docs/misc/x86-xenpv-bootloader.markdown
@@ -0,0 +1,49 @@
+# Xen x86 PV Bootloader Protocol
+
+## Introduction
+
+One method for booting an x86 Xen PV guest is to use a PV bootloader,
+that is, a bootloader which is itself a PV kernel but which behaves as
+a bootloader (examples include the pvgrub-legacy and grub2 targeting
+Xen).
+
+In many cases the user wishes to manage this PV bootloader from within
+the guest, and therefore wishes to chainload something from the guest
+filesystem, most likely via a stage 1 PV bootloader provided by dom0.
+
+The purpose of this document is to define the paths within the guest
+filesystem where a stage 1 bootloader should look for the in-guest PV
+bootloader to load and the protocol/format expected from the
+to-be-chainloaded bootloader.
+
+## Protocol
+
+The bootloader binary should be an ELF file of the appropriate type
+(32- or 64-bit). It should contain the standard Xen ELF notes allowing
+it to be loaded by the Xen toolstack domain builder (TBD: Reference).
+
+## Path
+
+The second stage bootloader should be installed into the guest
+filesystem as:
+
+ * `/boot/xen/pvboot-<ARCH>.elf`
+
+Where `<ARCH>` is the first element of the GNU triplet e.g. one of:
+
+ * i386 (nb only i386, not i686 etc), corresponding to the Xen
+   x86\_32(p) arch;
+ * x86\_64, corresponding to the Xen x86\_64 arch;
+
+It is allowable for `/boot` to be a separate filesystem from `/` and
+therefore stage 1 bootloaders should search
+`/boot/xen/pvboot-<ARCH>.elf` and `/xen/pvboot-<ARCH>.elf` (in that
+order). The `xen` directory should be on the same filesystem as /boot
+and therefore it is not necessary to search for /pvboot-<ARCH>.elf.
+
+It is not in general possible under Xen for a bootloader to boot a
+kernel of a different width from itself, and this extends to
+chainloading from a stage one. Therefore it is permissible to have
+both `/boot/xen/pvboot-i386.elf` and `/boot/xen/pvboot-x86\_64.elf`
+present in a guest to be used by the appropriate stage 1 (e.g. for
+systems with 32-bit userspace and an optional 64-bit kernel).
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZG-0001Xz-8u; Thu, 23 Oct 2014 05:04:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZE-0001Xe-Lk
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:08 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6F/81-02972-74C88445; Thu, 23 Oct 2014 05:04:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1414040646!11054324!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9072 invoked from network); 23 Oct 2014 05:04:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZA-0004Bt-5H
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZA-0001KJ-2n
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:04 +0000
Date: Thu, 23 Oct 2014 05:04:04 +0000
Message-Id: <E1XhAZA-0001KJ-2n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce specification for x86
	pv bootloader chainloading paths/formats.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 250073f452484912ee21c63c5d9efca40f5398d9
Author:     Ian Campbell <ijc@hellion.org.uk>
AuthorDate: Fri Aug 29 21:14:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 21 08:59:56 2014 +0100

    docs: Introduce specification for x86 pv bootloader chainloading paths/formats.
    
    In order to support pvgrub (or other bootloader) from dom0 chainloading a
    pvgrub (or other) from within the domU filesystem we need a standard for where
    the stage 1 bootloader should look and what it should expect to find there.
    
    Add a document along those lines.
    
    This is currently x86-specific since it is expected that other new architecures
    (including ARM) will either not need to implement this due to the existence of
    more generic specifications for that arch (e.g. the ARM VM spec) or will update
    this document in due course.
    
    Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Colin Watson <cjwatson@debian.org>
    Cc: 759018@bugs.debian.org
---
 docs/misc/x86-xenpv-bootloader.markdown |   49 +++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/docs/misc/x86-xenpv-bootloader.markdown b/docs/misc/x86-xenpv-bootloader.markdown
new file mode 100644
index 0000000..ec8854e
--- /dev/null
+++ b/docs/misc/x86-xenpv-bootloader.markdown
@@ -0,0 +1,49 @@
+# Xen x86 PV Bootloader Protocol
+
+## Introduction
+
+One method for booting an x86 Xen PV guest is to use a PV bootloader,
+that is, a bootloader which is itself a PV kernel but which behaves as
+a bootloader (examples include the pvgrub-legacy and grub2 targeting
+Xen).
+
+In many cases the user wishes to manage this PV bootloader from within
+the guest, and therefore wishes to chainload something from the guest
+filesystem, most likely via a stage 1 PV bootloader provided by dom0.
+
+The purpose of this document is to define the paths within the guest
+filesystem where a stage 1 bootloader should look for the in-guest PV
+bootloader to load and the protocol/format expected from the
+to-be-chainloaded bootloader.
+
+## Protocol
+
+The bootloader binary should be an ELF file of the appropriate type
+(32- or 64-bit). It should contain the standard Xen ELF notes allowing
+it to be loaded by the Xen toolstack domain builder (TBD: Reference).
+
+## Path
+
+The second stage bootloader should be installed into the guest
+filesystem as:
+
+ * `/boot/xen/pvboot-<ARCH>.elf`
+
+Where `<ARCH>` is the first element of the GNU triplet e.g. one of:
+
+ * i386 (nb only i386, not i686 etc), corresponding to the Xen
+   x86\_32(p) arch;
+ * x86\_64, corresponding to the Xen x86\_64 arch;
+
+It is allowable for `/boot` to be a separate filesystem from `/` and
+therefore stage 1 bootloaders should search
+`/boot/xen/pvboot-<ARCH>.elf` and `/xen/pvboot-<ARCH>.elf` (in that
+order). The `xen` directory should be on the same filesystem as /boot
+and therefore it is not necessary to search for /pvboot-<ARCH>.elf.
+
+It is not in general possible under Xen for a bootloader to boot a
+kernel of a different width from itself, and this extends to
+chainloading from a stage one. Therefore it is permissible to have
+both `/boot/xen/pvboot-i386.elf` and `/boot/xen/pvboot-x86\_64.elf`
+present in a guest to be used by the appropriate stage 1 (e.g. for
+systems with 32-bit userspace and an optional 64-bit kernel).
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZQ-0001ZT-CK; Thu, 23 Oct 2014 05:04:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZO-0001ZH-MD
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:18 +0000
Received: from [193.109.254.147:26437] by server-7.bemta-14.messagelabs.com id
	E5/78-13362-25C88445; Thu, 23 Oct 2014 05:04:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1414040656!11872387!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11401 invoked from network); 23 Oct 2014 05:04:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZM-0004Bz-2e
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZL-0001Kn-Vj
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:16 +0000
Date: Thu, 23 Oct 2014 05:04:15 +0000
Message-Id: <E1XhAZL-0001Kn-Vj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: Use __flush_dcache_area
	instead of __flush_dcache_all
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91086d09f742ffceb499862562bbf50cd9e6aaeb
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Mon Oct 20 20:55:25 2014 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 21 09:02:28 2014 +0100

    xen/arm64: Use __flush_dcache_area instead of __flush_dcache_all
    
    When booting with EFI, __flush_dcache_all does not correctly flush data.
    According to Mark Rutland, __flush_dcache_all is not guaranteed to push
    data to the PoC if there is a system-level cache as it uses Set/Way
    operations.  Therefore, this patch switchs to use the "__flush_dcache_area"
    mechanism, which is coppied from Linux.
    Add flushing of FDT in addition to Xen text/data.
    Remove now unused __flush_dcache_all and related helper functions.
    Invalidate the instruction tlb before turning on paging
    later on when starting Xen in EL2.
    
    Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/cache.S  |   89 ++++++++++--------------------------------
 xen/arch/arm/arm64/head.S   |   31 ++++++++++++---
 xen/arch/arm/efi/efi-boot.h |    4 +-
 3 files changed, 48 insertions(+), 76 deletions(-)

diff --git a/xen/arch/arm/arm64/cache.S b/xen/arch/arm/arm64/cache.S
index a445cbf..eff4e16 100644
--- a/xen/arch/arm/arm64/cache.S
+++ b/xen/arch/arm/arm64/cache.S
@@ -20,80 +20,33 @@
  */
 
 /*
- * Enable and disable interrupts.
+ * dcache_line_size - get the minimum D-cache line size from the CTR register.
  */
-	.macro	disable_irq
-	msr	daifset, #2
-	.endm
-
-	.macro	enable_irq
-	msr	daifclr, #2
-	.endm
-
-/*
- * Save/disable and restore interrupts.
- */
-	.macro	save_and_disable_irqs, olddaif
-	mrs	\olddaif, daif
-	disable_irq
-	.endm
-
-	.macro	restore_irqs, olddaif
-	msr	daif, \olddaif
+	.macro	dcache_line_size, reg, tmp
+	mrs	\tmp, ctr_el0			// read CTR
+	ubfm	\tmp, \tmp, #16, #19		// cache line size encoding
+	mov	\reg, #4			// bytes per word
+	lsl	\reg, \reg, \tmp		// actual cache line size
 	.endm
 
 /*
- *	__flush_dcache_all()
+ *	__flush_dcache_area(kaddr, size)
  *
- *	Flush the whole D-cache.
+ *	Ensure that the data held in the page kaddr is written back to the
+ *	page in question.
  *
- *	Corrupted registers: x0-x7, x9-x11
+ *	- kaddr   - kernel address
+ *	- size    - size in question
  */
-ENTRY(__flush_dcache_all)
-	dmb	sy				// ensure ordering with previous memory accesses
-	mrs	x0, clidr_el1			// read clidr
-	and	x3, x0, #0x7000000		// extract loc from clidr
-	lsr	x3, x3, #23			// left align loc bit field
-	cbz	x3, finished			// if loc is 0, then no need to clean
-	mov	x10, #0				// start clean at cache level 0
-loop1:
-	add	x2, x10, x10, lsr #1		// work out 3x current cache level
-	lsr	x1, x0, x2			// extract cache type bits from clidr
-	and	x1, x1, #7			// mask of the bits for current cache only
-	cmp	x1, #2				// see what cache we have at this level
-	b.lt	skip				// skip if no cache, or just i-cache
-	save_and_disable_irqs x9		// make CSSELR and CCSIDR access atomic
-	msr	csselr_el1, x10			// select current cache level in csselr
-	isb					// isb to sych the new cssr&csidr
-	mrs	x1, ccsidr_el1			// read the new ccsidr
-	restore_irqs x9
-	and	x2, x1, #7			// extract the length of the cache lines
-	add	x2, x2, #4			// add 4 (line length offset)
-	mov	x4, #0x3ff
-	and	x4, x4, x1, lsr #3		// find maximum number on the way size
-	clz	w5, w4				// find bit position of way size increment
-	mov	x7, #0x7fff
-	and	x7, x7, x1, lsr #13		// extract max number of the index size
-loop2:
-	mov	x9, x4				// create working copy of max way size
-loop3:
-	lsl	x6, x9, x5
-	orr	x11, x10, x6			// factor way and cache number into x11
-	lsl	x6, x7, x2
-	orr	x11, x11, x6			// factor index number into x11
-	dc	cisw, x11			// clean & invalidate by set/way
-	subs	x9, x9, #1			// decrement the way
-	b.ge	loop3
-	subs	x7, x7, #1			// decrement the index
-	b.ge	loop2
-skip:
-	add	x10, x10, #2			// increment cache number
-	cmp	x3, x10
-	b.gt	loop1
-finished:
-	mov	x10, #0				// swith back to cache level 0
-	msr	csselr_el1, x10			// select current cache level in csselr
+ENTRY(__flush_dcache_area)
+	dcache_line_size x2, x3
+	add	x1, x0, x1
+	sub	x3, x2, #1
+	bic	x0, x0, x3
+1:	dc	civac, x0			// clean & invalidate D line / unified line
+	add	x0, x0, x2
+	cmp	x0, x1
+	b.lo	1b
 	dsb	sy
-	isb
 	ret
-ENDPROC(__flush_dcache_all)
+ENDPROC(__flush_dcache_area)
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 7650abe..75b7ee1 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -736,20 +736,39 @@ ENTRY(lookup_processor_type)
         ret
 /*
  *  Function to transition from EFI loader in C, to Xen entry point.
- *  void noreturn efi_xen_start(void *fdt_ptr);
+ *  void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
  */
 ENTRY(efi_xen_start)
         /*
+         * Preserve x0 (fdt pointer) across call to __flush_dcache_area,
+         * restore for entry into Xen.
+         */
+        mov   x20, x0
+
+        /* flush dcache covering the FDT updated by EFI boot code */
+        bl    __flush_dcache_area
+
+        /*
+         * Flush dcache covering current runtime addresses
+         * of xen text/data. Then flush all of icache.
+         */
+        adrp  x1, _start
+        add   x1, x1, #:lo12:_start
+        mov   x0, x1
+        adrp  x2, _end
+        add   x2, x2, #:lo12:_end
+        sub   x1, x2, x1
+
+        bl    __flush_dcache_area
+        ic    ialluis
+        tlbi  alle2
+
+        /*
          * Turn off cache and MMU as Xen expects. EFI enables them, but also
          * mandates a 1:1 (unity) VA->PA mapping, so we can turn off the
          * MMU while executing EFI code before entering Xen.
          * The EFI loader calls this to start Xen.
-         * Preserve x0 (fdf pointer) across call to __flush_dcache_all,
-         * restore for entry into Xen.
          */
-        mov   x20, x0
-        bl    __flush_dcache_all
-        ic    ialluis
 
         /* Turn off Dcache and MMU */
         mrs   x0, sctlr_el2
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 7abc059..d40d8b2 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -7,7 +7,7 @@
 #include <xen/libfdt/libfdt.h>
 #include <asm/setup.h>
 
-void noreturn efi_xen_start(void *fdt_ptr);
+void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
 
 #define DEVICE_TREE_GUID \
 {0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
@@ -343,7 +343,7 @@ static void __init efi_arch_pre_exit_boot(void)
 
 static void __init efi_arch_post_exit_boot(void)
 {
-    efi_xen_start(fdt);
+    efi_xen_start(fdt, fdt_totalsize(fdt));
 }
 
 static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *section)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZQ-0001ZT-CK; Thu, 23 Oct 2014 05:04:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZO-0001ZH-MD
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:18 +0000
Received: from [193.109.254.147:26437] by server-7.bemta-14.messagelabs.com id
	E5/78-13362-25C88445; Thu, 23 Oct 2014 05:04:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1414040656!11872387!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11401 invoked from network); 23 Oct 2014 05:04:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZM-0004Bz-2e
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZL-0001Kn-Vj
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:16 +0000
Date: Thu, 23 Oct 2014 05:04:15 +0000
Message-Id: <E1XhAZL-0001Kn-Vj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: Use __flush_dcache_area
	instead of __flush_dcache_all
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91086d09f742ffceb499862562bbf50cd9e6aaeb
Author:     Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
AuthorDate: Mon Oct 20 20:55:25 2014 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 21 09:02:28 2014 +0100

    xen/arm64: Use __flush_dcache_area instead of __flush_dcache_all
    
    When booting with EFI, __flush_dcache_all does not correctly flush data.
    According to Mark Rutland, __flush_dcache_all is not guaranteed to push
    data to the PoC if there is a system-level cache as it uses Set/Way
    operations.  Therefore, this patch switchs to use the "__flush_dcache_area"
    mechanism, which is coppied from Linux.
    Add flushing of FDT in addition to Xen text/data.
    Remove now unused __flush_dcache_all and related helper functions.
    Invalidate the instruction tlb before turning on paging
    later on when starting Xen in EL2.
    
    Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/cache.S  |   89 ++++++++++--------------------------------
 xen/arch/arm/arm64/head.S   |   31 ++++++++++++---
 xen/arch/arm/efi/efi-boot.h |    4 +-
 3 files changed, 48 insertions(+), 76 deletions(-)

diff --git a/xen/arch/arm/arm64/cache.S b/xen/arch/arm/arm64/cache.S
index a445cbf..eff4e16 100644
--- a/xen/arch/arm/arm64/cache.S
+++ b/xen/arch/arm/arm64/cache.S
@@ -20,80 +20,33 @@
  */
 
 /*
- * Enable and disable interrupts.
+ * dcache_line_size - get the minimum D-cache line size from the CTR register.
  */
-	.macro	disable_irq
-	msr	daifset, #2
-	.endm
-
-	.macro	enable_irq
-	msr	daifclr, #2
-	.endm
-
-/*
- * Save/disable and restore interrupts.
- */
-	.macro	save_and_disable_irqs, olddaif
-	mrs	\olddaif, daif
-	disable_irq
-	.endm
-
-	.macro	restore_irqs, olddaif
-	msr	daif, \olddaif
+	.macro	dcache_line_size, reg, tmp
+	mrs	\tmp, ctr_el0			// read CTR
+	ubfm	\tmp, \tmp, #16, #19		// cache line size encoding
+	mov	\reg, #4			// bytes per word
+	lsl	\reg, \reg, \tmp		// actual cache line size
 	.endm
 
 /*
- *	__flush_dcache_all()
+ *	__flush_dcache_area(kaddr, size)
  *
- *	Flush the whole D-cache.
+ *	Ensure that the data held in the page kaddr is written back to the
+ *	page in question.
  *
- *	Corrupted registers: x0-x7, x9-x11
+ *	- kaddr   - kernel address
+ *	- size    - size in question
  */
-ENTRY(__flush_dcache_all)
-	dmb	sy				// ensure ordering with previous memory accesses
-	mrs	x0, clidr_el1			// read clidr
-	and	x3, x0, #0x7000000		// extract loc from clidr
-	lsr	x3, x3, #23			// left align loc bit field
-	cbz	x3, finished			// if loc is 0, then no need to clean
-	mov	x10, #0				// start clean at cache level 0
-loop1:
-	add	x2, x10, x10, lsr #1		// work out 3x current cache level
-	lsr	x1, x0, x2			// extract cache type bits from clidr
-	and	x1, x1, #7			// mask of the bits for current cache only
-	cmp	x1, #2				// see what cache we have at this level
-	b.lt	skip				// skip if no cache, or just i-cache
-	save_and_disable_irqs x9		// make CSSELR and CCSIDR access atomic
-	msr	csselr_el1, x10			// select current cache level in csselr
-	isb					// isb to sych the new cssr&csidr
-	mrs	x1, ccsidr_el1			// read the new ccsidr
-	restore_irqs x9
-	and	x2, x1, #7			// extract the length of the cache lines
-	add	x2, x2, #4			// add 4 (line length offset)
-	mov	x4, #0x3ff
-	and	x4, x4, x1, lsr #3		// find maximum number on the way size
-	clz	w5, w4				// find bit position of way size increment
-	mov	x7, #0x7fff
-	and	x7, x7, x1, lsr #13		// extract max number of the index size
-loop2:
-	mov	x9, x4				// create working copy of max way size
-loop3:
-	lsl	x6, x9, x5
-	orr	x11, x10, x6			// factor way and cache number into x11
-	lsl	x6, x7, x2
-	orr	x11, x11, x6			// factor index number into x11
-	dc	cisw, x11			// clean & invalidate by set/way
-	subs	x9, x9, #1			// decrement the way
-	b.ge	loop3
-	subs	x7, x7, #1			// decrement the index
-	b.ge	loop2
-skip:
-	add	x10, x10, #2			// increment cache number
-	cmp	x3, x10
-	b.gt	loop1
-finished:
-	mov	x10, #0				// swith back to cache level 0
-	msr	csselr_el1, x10			// select current cache level in csselr
+ENTRY(__flush_dcache_area)
+	dcache_line_size x2, x3
+	add	x1, x0, x1
+	sub	x3, x2, #1
+	bic	x0, x0, x3
+1:	dc	civac, x0			// clean & invalidate D line / unified line
+	add	x0, x0, x2
+	cmp	x0, x1
+	b.lo	1b
 	dsb	sy
-	isb
 	ret
-ENDPROC(__flush_dcache_all)
+ENDPROC(__flush_dcache_area)
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 7650abe..75b7ee1 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -736,20 +736,39 @@ ENTRY(lookup_processor_type)
         ret
 /*
  *  Function to transition from EFI loader in C, to Xen entry point.
- *  void noreturn efi_xen_start(void *fdt_ptr);
+ *  void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
  */
 ENTRY(efi_xen_start)
         /*
+         * Preserve x0 (fdt pointer) across call to __flush_dcache_area,
+         * restore for entry into Xen.
+         */
+        mov   x20, x0
+
+        /* flush dcache covering the FDT updated by EFI boot code */
+        bl    __flush_dcache_area
+
+        /*
+         * Flush dcache covering current runtime addresses
+         * of xen text/data. Then flush all of icache.
+         */
+        adrp  x1, _start
+        add   x1, x1, #:lo12:_start
+        mov   x0, x1
+        adrp  x2, _end
+        add   x2, x2, #:lo12:_end
+        sub   x1, x2, x1
+
+        bl    __flush_dcache_area
+        ic    ialluis
+        tlbi  alle2
+
+        /*
          * Turn off cache and MMU as Xen expects. EFI enables them, but also
          * mandates a 1:1 (unity) VA->PA mapping, so we can turn off the
          * MMU while executing EFI code before entering Xen.
          * The EFI loader calls this to start Xen.
-         * Preserve x0 (fdf pointer) across call to __flush_dcache_all,
-         * restore for entry into Xen.
          */
-        mov   x20, x0
-        bl    __flush_dcache_all
-        ic    ialluis
 
         /* Turn off Dcache and MMU */
         mrs   x0, sctlr_el2
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 7abc059..d40d8b2 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -7,7 +7,7 @@
 #include <xen/libfdt/libfdt.h>
 #include <asm/setup.h>
 
-void noreturn efi_xen_start(void *fdt_ptr);
+void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size);
 
 #define DEVICE_TREE_GUID \
 {0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
@@ -343,7 +343,7 @@ static void __init efi_arch_pre_exit_boot(void)
 
 static void __init efi_arch_post_exit_boot(void)
 {
-    efi_xen_start(fdt);
+    efi_xen_start(fdt, fdt_totalsize(fdt));
 }
 
 static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *section)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZb-0001av-Fg; Thu, 23 Oct 2014 05:04:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZZ-0001ae-Cx
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:29 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	8B/0C-02693-C5C88445; Thu, 23 Oct 2014 05:04:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1414040666!11280265!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20981 invoked from network); 23 Oct 2014 05:04:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZW-0004C5-AY
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZW-0001LC-8U
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:26 +0000
Date: Thu, 23 Oct 2014 05:04:26 +0000
Message-Id: <E1XhAZW-0001LC-8U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/viridian: freeze time reference
	counter when domain is paused
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f6a07643e1cc0045c2a8eabb0fb106e8655ce25d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Oct 21 17:31:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:31:31 2014 +0200

    x86/viridian: freeze time reference counter when domain is paused
    
    In XenServer system test it has become apparent that versions of Windows
    that make use of the time reference counter enlightenment cannot cope with
    large jumps forward in the value read from the MSR. Specifically,
    suspending a very large domain took approx. 45 minutes to complete and
    when the domain was resumed it was discovered that the WMI (Windows
    Management Instrumentation) service had hung.
    
    The reason a large jump forward is seen by the guest is that, when a guest
    is suspended, the guest stops running when the SCHEDOP_suspend hypercall is
    made, however the MSR value essentially keeps incrementing until the
    tool-stack issues DOMCTL_gethvmcontext.
    
    This patch adds code to freeze the value of the time reference counter
    on domain pause and 'thaw' it on domain unpause, but only thaw it if the
    domain is not shutting down. The absolute value of the counter is then
    saved in the viridian domain context record. This prevents the guest OS
    from experiencing large jumps in the value of the MSR and has been shown
    to reliably fix the problem with WMI.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c                  |   12 ++++++
 xen/arch/x86/domain.c                  |   19 ++++++++++
 xen/arch/x86/hvm/viridian.c            |   60 +++++++++++++++++++++++++------
 xen/common/domain.c                    |   26 ++++++++-----
 xen/include/asm-x86/hvm/hvm.h          |    9 ++++-
 xen/include/asm-x86/hvm/viridian.h     |   27 ++++++++++++++
 xen/include/public/arch-x86/hvm/save.h |    1 +
 xen/include/xen/domain.h               |    4 ++
 8 files changed, 135 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2b53931..5043837 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -580,6 +580,18 @@ void arch_domain_destroy(struct domain *d)
     free_xenheap_page(d->shared_info);
 }
 
+void arch_domain_shutdown(struct domain *d)
+{
+}
+
+void arch_domain_pause(struct domain *d)
+{
+}
+
+void arch_domain_unpause(struct domain *d)
+{
+}
+
 static int is_guest_pv32_psr(uint32_t psr)
 {
     switch (psr & PSR_MODE_MASK)
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 558d8d5..ae0a344 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -51,6 +51,7 @@
 #include <asm/fixmap.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
+#include <asm/hvm/viridian.h>
 #include <asm/debugreg.h>
 #include <asm/msr.h>
 #include <asm/traps.h>
@@ -666,6 +667,24 @@ void arch_domain_destroy(struct domain *d)
     psr_free_rmid(d);
 }
 
+void arch_domain_shutdown(struct domain *d)
+{
+    if ( has_viridian_time_ref_count(d) )
+        viridian_time_ref_count_freeze(d);
+}
+
+void arch_domain_pause(struct domain *d)
+{
+    if ( has_viridian_time_ref_count(d) )
+        viridian_time_ref_count_freeze(d);
+}
+
+void arch_domain_unpause(struct domain *d)
+{
+    if ( has_viridian_time_ref_count(d) )
+        viridian_time_ref_count_thaw(d);
+}
+
 unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)
 {
     unsigned long hv_cr4_mask, hv_cr4 = real_cr4_to_pv_guest_cr4(read_cr4());
diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
index 6726168..3197b6b 100644
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -289,6 +289,39 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_t val)
     return 1;
 }
 
+static int64_t raw_trc_val(struct domain *d)
+{
+    uint64_t tsc;
+    struct time_scale tsc_to_ns;
+
+    tsc = hvm_get_guest_tsc(pt_global_vcpu_target(d));
+
+    /* convert tsc to count of 100ns periods */
+    set_time_scale(&tsc_to_ns, d->arch.tsc_khz * 1000ul);
+    return scale_delta(tsc, &tsc_to_ns) / 100ul;
+}
+
+void viridian_time_ref_count_freeze(struct domain *d)
+{
+    struct viridian_time_ref_count *trc;
+
+    trc = &d->arch.hvm_domain.viridian.time_ref_count;
+
+    if ( test_and_clear_bit(_TRC_running, &trc->flags) )
+        trc->val = raw_trc_val(d) + trc->off;
+}
+
+void viridian_time_ref_count_thaw(struct domain *d)
+{
+    struct viridian_time_ref_count *trc;
+
+    trc = &d->arch.hvm_domain.viridian.time_ref_count;
+
+    if ( !d->is_shutting_down &&
+         !test_and_set_bit(_TRC_running, &trc->flags) )
+        trc->off = (int64_t)trc->val - raw_trc_val(d);
+}
+
 int rdmsr_viridian_regs(uint32_t idx, uint64_t *val)
 {
     struct vcpu *v = current;
@@ -348,18 +381,19 @@ int rdmsr_viridian_regs(uint32_t idx, uint64_t *val)
 
     case VIRIDIAN_MSR_TIME_REF_COUNT:
     {
-        uint64_t tsc;
-        struct time_scale tsc_to_ns;
+        struct viridian_time_ref_count *trc;
+
+        trc = &d->arch.hvm_domain.viridian.time_ref_count;
 
         if ( !(viridian_feature_mask(d) & HVMPV_time_ref_count) )
             return 0;
 
-        perfc_incr(mshv_rdmsr_time_ref_count);
-        tsc = hvm_get_guest_tsc(pt_global_vcpu_target(d));
+        if ( !test_and_set_bit(_TRC_accessed, &trc->flags) )
+            printk(XENLOG_G_INFO "d%d: VIRIDIAN MSR_TIME_REF_COUNT: accessed\n",
+                   d->domain_id);
 
-        /* convert tsc to count of 100ns periods */
-        set_time_scale(&tsc_to_ns, d->arch.tsc_khz * 1000ul);
-        *val = scale_delta(tsc, &tsc_to_ns) / 100ul;
+        perfc_incr(mshv_rdmsr_time_ref_count);
+        *val = raw_trc_val(d) + trc->off;
         break;
     }
 
@@ -450,8 +484,9 @@ static int viridian_save_domain_ctxt(struct domain *d, hvm_domain_context_t *h)
     if ( !is_viridian_domain(d) )
         return 0;
 
-    ctxt.hypercall_gpa = d->arch.hvm_domain.viridian.hypercall_gpa.raw;
-    ctxt.guest_os_id   = d->arch.hvm_domain.viridian.guest_os_id.raw;
+    ctxt.time_ref_count = d->arch.hvm_domain.viridian.time_ref_count.val;
+    ctxt.hypercall_gpa  = d->arch.hvm_domain.viridian.hypercall_gpa.raw;
+    ctxt.guest_os_id    = d->arch.hvm_domain.viridian.guest_os_id.raw;
 
     return (hvm_save_entry(VIRIDIAN_DOMAIN, 0, h, &ctxt) != 0);
 }
@@ -460,11 +495,12 @@ static int viridian_load_domain_ctxt(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_viridian_domain_context ctxt;
 
-    if ( hvm_load_entry(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
+    if ( hvm_load_entry_zeroextend(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
         return -EINVAL;
 
-    d->arch.hvm_domain.viridian.hypercall_gpa.raw = ctxt.hypercall_gpa;
-    d->arch.hvm_domain.viridian.guest_os_id.raw   = ctxt.guest_os_id;
+    d->arch.hvm_domain.viridian.time_ref_count.val = ctxt.time_ref_count;
+    d->arch.hvm_domain.viridian.hypercall_gpa.raw  = ctxt.hypercall_gpa;
+    d->arch.hvm_domain.viridian.guest_os_id.raw    = ctxt.guest_os_id;
 
     return 0;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 190998c..a3f51ec 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -706,6 +706,8 @@ void domain_shutdown(struct domain *d, u8 reason)
         v->paused_for_shutdown = 1;
     }
 
+    arch_domain_shutdown(d);
+
     __domain_finalise_shutdown(d);
 
     spin_unlock(&d->shutdown_lock);
@@ -925,32 +927,36 @@ int vcpu_unpause_by_systemcontroller(struct vcpu *v)
     return 0;
 }
 
-void domain_pause(struct domain *d)
+static void do_domain_pause(struct domain *d,
+                            void (*sleep_fn)(struct vcpu *v))
 {
     struct vcpu *v;
 
-    ASSERT(d != current->domain);
-
     atomic_inc(&d->pause_count);
 
     for_each_vcpu( d, v )
-        vcpu_sleep_sync(v);
+        sleep_fn(v);
+
+    arch_domain_pause(d);
 }
 
-void domain_pause_nosync(struct domain *d)
+void domain_pause(struct domain *d)
 {
-    struct vcpu *v;
-
-    atomic_inc(&d->pause_count);
+    ASSERT(d != current->domain);
+    do_domain_pause(d, vcpu_sleep_sync);
+}
 
-    for_each_vcpu( d, v )
-        vcpu_sleep_nosync(v);
+void domain_pause_nosync(struct domain *d)
+{
+    do_domain_pause(d, vcpu_sleep_nosync);
 }
 
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
 
+    arch_domain_unpause(d);
+
     if ( atomic_dec_and_test(&d->pause_count) )
         for_each_vcpu( d, v )
             vcpu_wake(v);
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0d94c48..e3d2d9a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -340,12 +340,19 @@ static inline unsigned long hvm_get_shadow_gs_base(struct vcpu *v)
     return hvm_funcs.get_shadow_gs_base(v);
 }
 
+
+#define has_hvm_params(d) \
+    ((d)->arch.hvm_domain.params != NULL)
+
 #define viridian_feature_mask(d) \
-    ((d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN])
+    (has_hvm_params(d) ? (d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN] : 0)
 
 #define is_viridian_domain(d) \
     (is_hvm_domain(d) && (viridian_feature_mask(d) & HVMPV_base_freq))
 
+#define has_viridian_time_ref_count(d) \
+    (is_viridian_domain(d) && (viridian_feature_mask(d) & HVMPV_time_ref_count))
+
 void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
                                uint32_t *eax, uint32_t *ebx,
                                uint32_t *ecx, uint32_t *edx);
diff --git a/xen/include/asm-x86/hvm/viridian.h b/xen/include/asm-x86/hvm/viridian.h
index 496da33..4cab2e8 100644
--- a/xen/include/asm-x86/hvm/viridian.h
+++ b/xen/include/asm-x86/hvm/viridian.h
@@ -48,10 +48,24 @@ union viridian_hypercall_gpa
     } fields;
 };
 
+struct viridian_time_ref_count
+{
+    unsigned long flags;
+
+#define _TRC_accessed 0
+#define TRC_accessed (1 << _TRC_accessed)
+#define _TRC_running 1
+#define TRC_running (1 << _TRC_running)
+
+    uint64_t val;
+    int64_t off;
+};
+
 struct viridian_domain
 {
     union viridian_guest_os_id guest_os_id;
     union viridian_hypercall_gpa hypercall_gpa;
+    struct viridian_time_ref_count time_ref_count;
 };
 
 int
@@ -75,4 +89,17 @@ rdmsr_viridian_regs(
 int
 viridian_hypercall(struct cpu_user_regs *regs);
 
+void viridian_time_ref_count_freeze(struct domain *d);
+void viridian_time_ref_count_thaw(struct domain *d);
+
 #endif /* __ASM_X86_HVM_VIRIDIAN_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 16d85a3..88aab7e 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -568,6 +568,7 @@ struct hvm_hw_cpu_xsave {
 struct hvm_viridian_domain_context {
     uint64_t hypercall_gpa;
     uint64_t guest_os_id;
+    uint64_t time_ref_count;
 };
 
 DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct hvm_viridian_domain_context);
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index c5664c2..9215b0e 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -59,6 +59,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags);
 
 void arch_domain_destroy(struct domain *d);
 
+void arch_domain_shutdown(struct domain *d);
+void arch_domain_pause(struct domain *d);
+void arch_domain_unpause(struct domain *d);
+
 int arch_set_info_guest(struct vcpu *, vcpu_guest_context_u);
 void arch_get_info_guest(struct vcpu *, vcpu_guest_context_u);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZb-0001av-Fg; Thu, 23 Oct 2014 05:04:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZZ-0001ae-Cx
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:29 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	8B/0C-02693-C5C88445; Thu, 23 Oct 2014 05:04:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1414040666!11280265!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20981 invoked from network); 23 Oct 2014 05:04:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZW-0004C5-AY
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZW-0001LC-8U
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:26 +0000
Date: Thu, 23 Oct 2014 05:04:26 +0000
Message-Id: <E1XhAZW-0001LC-8U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/viridian: freeze time reference
	counter when domain is paused
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f6a07643e1cc0045c2a8eabb0fb106e8655ce25d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Oct 21 17:31:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:31:31 2014 +0200

    x86/viridian: freeze time reference counter when domain is paused
    
    In XenServer system test it has become apparent that versions of Windows
    that make use of the time reference counter enlightenment cannot cope with
    large jumps forward in the value read from the MSR. Specifically,
    suspending a very large domain took approx. 45 minutes to complete and
    when the domain was resumed it was discovered that the WMI (Windows
    Management Instrumentation) service had hung.
    
    The reason a large jump forward is seen by the guest is that, when a guest
    is suspended, the guest stops running when the SCHEDOP_suspend hypercall is
    made, however the MSR value essentially keeps incrementing until the
    tool-stack issues DOMCTL_gethvmcontext.
    
    This patch adds code to freeze the value of the time reference counter
    on domain pause and 'thaw' it on domain unpause, but only thaw it if the
    domain is not shutting down. The absolute value of the counter is then
    saved in the viridian domain context record. This prevents the guest OS
    from experiencing large jumps in the value of the MSR and has been shown
    to reliably fix the problem with WMI.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c                  |   12 ++++++
 xen/arch/x86/domain.c                  |   19 ++++++++++
 xen/arch/x86/hvm/viridian.c            |   60 +++++++++++++++++++++++++------
 xen/common/domain.c                    |   26 ++++++++-----
 xen/include/asm-x86/hvm/hvm.h          |    9 ++++-
 xen/include/asm-x86/hvm/viridian.h     |   27 ++++++++++++++
 xen/include/public/arch-x86/hvm/save.h |    1 +
 xen/include/xen/domain.h               |    4 ++
 8 files changed, 135 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2b53931..5043837 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -580,6 +580,18 @@ void arch_domain_destroy(struct domain *d)
     free_xenheap_page(d->shared_info);
 }
 
+void arch_domain_shutdown(struct domain *d)
+{
+}
+
+void arch_domain_pause(struct domain *d)
+{
+}
+
+void arch_domain_unpause(struct domain *d)
+{
+}
+
 static int is_guest_pv32_psr(uint32_t psr)
 {
     switch (psr & PSR_MODE_MASK)
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 558d8d5..ae0a344 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -51,6 +51,7 @@
 #include <asm/fixmap.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
+#include <asm/hvm/viridian.h>
 #include <asm/debugreg.h>
 #include <asm/msr.h>
 #include <asm/traps.h>
@@ -666,6 +667,24 @@ void arch_domain_destroy(struct domain *d)
     psr_free_rmid(d);
 }
 
+void arch_domain_shutdown(struct domain *d)
+{
+    if ( has_viridian_time_ref_count(d) )
+        viridian_time_ref_count_freeze(d);
+}
+
+void arch_domain_pause(struct domain *d)
+{
+    if ( has_viridian_time_ref_count(d) )
+        viridian_time_ref_count_freeze(d);
+}
+
+void arch_domain_unpause(struct domain *d)
+{
+    if ( has_viridian_time_ref_count(d) )
+        viridian_time_ref_count_thaw(d);
+}
+
 unsigned long pv_guest_cr4_fixup(const struct vcpu *v, unsigned long guest_cr4)
 {
     unsigned long hv_cr4_mask, hv_cr4 = real_cr4_to_pv_guest_cr4(read_cr4());
diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
index 6726168..3197b6b 100644
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -289,6 +289,39 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_t val)
     return 1;
 }
 
+static int64_t raw_trc_val(struct domain *d)
+{
+    uint64_t tsc;
+    struct time_scale tsc_to_ns;
+
+    tsc = hvm_get_guest_tsc(pt_global_vcpu_target(d));
+
+    /* convert tsc to count of 100ns periods */
+    set_time_scale(&tsc_to_ns, d->arch.tsc_khz * 1000ul);
+    return scale_delta(tsc, &tsc_to_ns) / 100ul;
+}
+
+void viridian_time_ref_count_freeze(struct domain *d)
+{
+    struct viridian_time_ref_count *trc;
+
+    trc = &d->arch.hvm_domain.viridian.time_ref_count;
+
+    if ( test_and_clear_bit(_TRC_running, &trc->flags) )
+        trc->val = raw_trc_val(d) + trc->off;
+}
+
+void viridian_time_ref_count_thaw(struct domain *d)
+{
+    struct viridian_time_ref_count *trc;
+
+    trc = &d->arch.hvm_domain.viridian.time_ref_count;
+
+    if ( !d->is_shutting_down &&
+         !test_and_set_bit(_TRC_running, &trc->flags) )
+        trc->off = (int64_t)trc->val - raw_trc_val(d);
+}
+
 int rdmsr_viridian_regs(uint32_t idx, uint64_t *val)
 {
     struct vcpu *v = current;
@@ -348,18 +381,19 @@ int rdmsr_viridian_regs(uint32_t idx, uint64_t *val)
 
     case VIRIDIAN_MSR_TIME_REF_COUNT:
     {
-        uint64_t tsc;
-        struct time_scale tsc_to_ns;
+        struct viridian_time_ref_count *trc;
+
+        trc = &d->arch.hvm_domain.viridian.time_ref_count;
 
         if ( !(viridian_feature_mask(d) & HVMPV_time_ref_count) )
             return 0;
 
-        perfc_incr(mshv_rdmsr_time_ref_count);
-        tsc = hvm_get_guest_tsc(pt_global_vcpu_target(d));
+        if ( !test_and_set_bit(_TRC_accessed, &trc->flags) )
+            printk(XENLOG_G_INFO "d%d: VIRIDIAN MSR_TIME_REF_COUNT: accessed\n",
+                   d->domain_id);
 
-        /* convert tsc to count of 100ns periods */
-        set_time_scale(&tsc_to_ns, d->arch.tsc_khz * 1000ul);
-        *val = scale_delta(tsc, &tsc_to_ns) / 100ul;
+        perfc_incr(mshv_rdmsr_time_ref_count);
+        *val = raw_trc_val(d) + trc->off;
         break;
     }
 
@@ -450,8 +484,9 @@ static int viridian_save_domain_ctxt(struct domain *d, hvm_domain_context_t *h)
     if ( !is_viridian_domain(d) )
         return 0;
 
-    ctxt.hypercall_gpa = d->arch.hvm_domain.viridian.hypercall_gpa.raw;
-    ctxt.guest_os_id   = d->arch.hvm_domain.viridian.guest_os_id.raw;
+    ctxt.time_ref_count = d->arch.hvm_domain.viridian.time_ref_count.val;
+    ctxt.hypercall_gpa  = d->arch.hvm_domain.viridian.hypercall_gpa.raw;
+    ctxt.guest_os_id    = d->arch.hvm_domain.viridian.guest_os_id.raw;
 
     return (hvm_save_entry(VIRIDIAN_DOMAIN, 0, h, &ctxt) != 0);
 }
@@ -460,11 +495,12 @@ static int viridian_load_domain_ctxt(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_viridian_domain_context ctxt;
 
-    if ( hvm_load_entry(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
+    if ( hvm_load_entry_zeroextend(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
         return -EINVAL;
 
-    d->arch.hvm_domain.viridian.hypercall_gpa.raw = ctxt.hypercall_gpa;
-    d->arch.hvm_domain.viridian.guest_os_id.raw   = ctxt.guest_os_id;
+    d->arch.hvm_domain.viridian.time_ref_count.val = ctxt.time_ref_count;
+    d->arch.hvm_domain.viridian.hypercall_gpa.raw  = ctxt.hypercall_gpa;
+    d->arch.hvm_domain.viridian.guest_os_id.raw    = ctxt.guest_os_id;
 
     return 0;
 }
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 190998c..a3f51ec 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -706,6 +706,8 @@ void domain_shutdown(struct domain *d, u8 reason)
         v->paused_for_shutdown = 1;
     }
 
+    arch_domain_shutdown(d);
+
     __domain_finalise_shutdown(d);
 
     spin_unlock(&d->shutdown_lock);
@@ -925,32 +927,36 @@ int vcpu_unpause_by_systemcontroller(struct vcpu *v)
     return 0;
 }
 
-void domain_pause(struct domain *d)
+static void do_domain_pause(struct domain *d,
+                            void (*sleep_fn)(struct vcpu *v))
 {
     struct vcpu *v;
 
-    ASSERT(d != current->domain);
-
     atomic_inc(&d->pause_count);
 
     for_each_vcpu( d, v )
-        vcpu_sleep_sync(v);
+        sleep_fn(v);
+
+    arch_domain_pause(d);
 }
 
-void domain_pause_nosync(struct domain *d)
+void domain_pause(struct domain *d)
 {
-    struct vcpu *v;
-
-    atomic_inc(&d->pause_count);
+    ASSERT(d != current->domain);
+    do_domain_pause(d, vcpu_sleep_sync);
+}
 
-    for_each_vcpu( d, v )
-        vcpu_sleep_nosync(v);
+void domain_pause_nosync(struct domain *d)
+{
+    do_domain_pause(d, vcpu_sleep_nosync);
 }
 
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
 
+    arch_domain_unpause(d);
+
     if ( atomic_dec_and_test(&d->pause_count) )
         for_each_vcpu( d, v )
             vcpu_wake(v);
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0d94c48..e3d2d9a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -340,12 +340,19 @@ static inline unsigned long hvm_get_shadow_gs_base(struct vcpu *v)
     return hvm_funcs.get_shadow_gs_base(v);
 }
 
+
+#define has_hvm_params(d) \
+    ((d)->arch.hvm_domain.params != NULL)
+
 #define viridian_feature_mask(d) \
-    ((d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN])
+    (has_hvm_params(d) ? (d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN] : 0)
 
 #define is_viridian_domain(d) \
     (is_hvm_domain(d) && (viridian_feature_mask(d) & HVMPV_base_freq))
 
+#define has_viridian_time_ref_count(d) \
+    (is_viridian_domain(d) && (viridian_feature_mask(d) & HVMPV_time_ref_count))
+
 void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
                                uint32_t *eax, uint32_t *ebx,
                                uint32_t *ecx, uint32_t *edx);
diff --git a/xen/include/asm-x86/hvm/viridian.h b/xen/include/asm-x86/hvm/viridian.h
index 496da33..4cab2e8 100644
--- a/xen/include/asm-x86/hvm/viridian.h
+++ b/xen/include/asm-x86/hvm/viridian.h
@@ -48,10 +48,24 @@ union viridian_hypercall_gpa
     } fields;
 };
 
+struct viridian_time_ref_count
+{
+    unsigned long flags;
+
+#define _TRC_accessed 0
+#define TRC_accessed (1 << _TRC_accessed)
+#define _TRC_running 1
+#define TRC_running (1 << _TRC_running)
+
+    uint64_t val;
+    int64_t off;
+};
+
 struct viridian_domain
 {
     union viridian_guest_os_id guest_os_id;
     union viridian_hypercall_gpa hypercall_gpa;
+    struct viridian_time_ref_count time_ref_count;
 };
 
 int
@@ -75,4 +89,17 @@ rdmsr_viridian_regs(
 int
 viridian_hypercall(struct cpu_user_regs *regs);
 
+void viridian_time_ref_count_freeze(struct domain *d);
+void viridian_time_ref_count_thaw(struct domain *d);
+
 #endif /* __ASM_X86_HVM_VIRIDIAN_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 16d85a3..88aab7e 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -568,6 +568,7 @@ struct hvm_hw_cpu_xsave {
 struct hvm_viridian_domain_context {
     uint64_t hypercall_gpa;
     uint64_t guest_os_id;
+    uint64_t time_ref_count;
 };
 
 DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct hvm_viridian_domain_context);
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index c5664c2..9215b0e 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -59,6 +59,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags);
 
 void arch_domain_destroy(struct domain *d);
 
+void arch_domain_shutdown(struct domain *d);
+void arch_domain_pause(struct domain *d);
+void arch_domain_unpause(struct domain *d);
+
 int arch_set_info_guest(struct vcpu *, vcpu_guest_context_u);
 void arch_get_info_guest(struct vcpu *, vcpu_guest_context_u);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZl-0001cF-IM; Thu, 23 Oct 2014 05:04:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZk-0001c7-Cp
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:40 +0000
Received: from [85.158.139.211] by server-8.bemta-5.messagelabs.com id
	FB/28-03671-76C88445; Thu, 23 Oct 2014 05:04:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1414040676!11208810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19718 invoked from network); 23 Oct 2014 05:04:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZg-0004CD-HQ
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZg-0001Lf-F0
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:36 +0000
Date: Thu, 23 Oct 2014 05:04:36 +0000
Message-Id: <E1XhAZg-0001Lf-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] clean target should remove xen.efi
	binary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c73844904dafb23ae6e9d0bd71b14db423bcdffe
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Oct 21 17:32:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:32:43 2014 +0200

    clean target should remove xen.efi binary
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 9d91ca7..28b4b79 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -84,7 +84,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
 	rm -f .banner
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZl-0001cF-IM; Thu, 23 Oct 2014 05:04:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZk-0001c7-Cp
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:40 +0000
Received: from [85.158.139.211] by server-8.bemta-5.messagelabs.com id
	FB/28-03671-76C88445; Thu, 23 Oct 2014 05:04:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1414040676!11208810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19718 invoked from network); 23 Oct 2014 05:04:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZg-0004CD-HQ
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZg-0001Lf-F0
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:36 +0000
Date: Thu, 23 Oct 2014 05:04:36 +0000
Message-Id: <E1XhAZg-0001Lf-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] clean target should remove xen.efi
	binary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c73844904dafb23ae6e9d0bd71b14db423bcdffe
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Oct 21 17:32:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:32:43 2014 +0200

    clean target should remove xen.efi binary
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 9d91ca7..28b4b79 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -84,7 +84,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
 	rm -f .banner
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZt-0001dq-Mo; Thu, 23 Oct 2014 05:04:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZt-0001df-0M
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:49 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	28/0B-13367-07C88445; Thu, 23 Oct 2014 05:04:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414040686!11226525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23385 invoked from network); 23 Oct 2014 05:04:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZq-0004CJ-N9
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZq-0001M1-LP
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:46 +0000
Date: Thu, 23 Oct 2014 05:04:46 +0000
Message-Id: <E1XhAZq-0001M1-LP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: define cmdline_cook() loader_name
	argument as a const
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2be76df6c4e61904b6c107f089fd7195dac1d5cc
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Oct 21 17:33:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:33:13 2014 +0200

    x86: define cmdline_cook() loader_name argument as a const
    
    cmdline_cook() loader_name argument is not changed so
    define it as a const.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/arch/x86/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8c8b91f..bfbb310 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -508,7 +508,7 @@ static bool_t __init loader_is_grub2(const char *loader_name)
     return (p != NULL) && (p[5] != '0');
 }
 
-static char * __init cmdline_cook(char *p, char *loader_name)
+static char * __init cmdline_cook(char *p, const char *loader_name)
 {
     p = p ? : "";
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAZt-0001dq-Mo; Thu, 23 Oct 2014 05:04:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZt-0001df-0M
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:49 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	28/0B-13367-07C88445; Thu, 23 Oct 2014 05:04:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414040686!11226525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23385 invoked from network); 23 Oct 2014 05:04:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZq-0004CJ-N9
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAZq-0001M1-LP
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:46 +0000
Date: Thu, 23 Oct 2014 05:04:46 +0000
Message-Id: <E1XhAZq-0001M1-LP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: define cmdline_cook() loader_name
	argument as a const
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2be76df6c4e61904b6c107f089fd7195dac1d5cc
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Oct 21 17:33:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:33:13 2014 +0200

    x86: define cmdline_cook() loader_name argument as a const
    
    cmdline_cook() loader_name argument is not changed so
    define it as a const.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/arch/x86/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8c8b91f..bfbb310 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -508,7 +508,7 @@ static bool_t __init loader_is_grub2(const char *loader_name)
     return (p != NULL) && (p[5] != '0');
 }
 
-static char * __init cmdline_cook(char *p, char *loader_name)
+static char * __init cmdline_cook(char *p, const char *loader_name)
 {
     p = p ? : "";
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAa3-0001fY-PN; Thu, 23 Oct 2014 05:04:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAa3-0001fK-7l
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:59 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B7/7D-03123-A7C88445; Thu, 23 Oct 2014 05:04:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1414040697!5939474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8018 invoked from network); 23 Oct 2014 05:04:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAa0-0004CS-Rl
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAa0-0001Mt-Qi
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:56 +0000
Date: Thu, 23 Oct 2014 05:04:56 +0000
Message-Id: <E1XhAa0-0001Mt-Qi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: further restrict access to
	x2apic MSRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d0a20587e4ebf3691ee88a55f91f398c4d2ee83
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 21 17:34:20 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:34:20 2014 +0200

    x86/hvm: further restrict access to x2apic MSRs
    
    The x2apic specification reserves the entire MSR range 0x800-0xbff, while only
    the first 0x3f MSRs have defined purposes.  All reserved MSRs in this region
    are architecturally required to raise #GP faults upon access.
    
    Xen used to pass this entire range to hvm_x2apic_msr_{read,write}(), but the
    range was restricted somewhat by XSA-108 (c/s 61fdda7ac) to prevent guests
    being able to read pages adjacent to the domheap page backing the vlapic->regs
    array.
    
    While removing the vulnerability, a side effect of XSA-108 was that the MSR
    range 0x900-0xbff fell through the switch statement and ends up reading the
    hosts x2apic range. This behaviour is a problem in general, but specifically
    it turns out that MSRs 0xa00-0xa02 are implemented (but undocumented) on
    certain SandyBridge and IvyBridge systems.
    
    Experimentally, no operating system in XenServer's test suite (including all
    versions of Windows currently supported by Microsoft) ever peek at these MSRs,
    even on hosts where some of them are implemented.
    
    This patch undoes the fix for XSA-108 (c/s 61fdda7ac), returning the primary
    bounds check to the entire specified range.  hvm_x2apic_msr_write() was always
    safe, as it is whitelist based.  hvm_x2apic_msr_read() changes to a whitelist
    approach, which avoids the vulnerability, and provides a more architecturally
    accurate emulation of the reserved MSRs (which would previously read as 0
    rather than fault).
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/hvm.c    |    4 ++--
 xen/arch/x86/hvm/vlapic.c |   27 +++++++++++++++++++++++----
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f0e1edc..559b769 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4355,7 +4355,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -4482,7 +4482,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 089d13f..2f09713 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -649,16 +649,35 @@ int hvm_x2apic_msr_read(struct vcpu *v, unsigned int msr, uint64_t *msr_content)
     if ( !vlapic_x2apic_mode(vlapic) )
         return X86EMUL_UNHANDLEABLE;
 
-    vlapic_read_aligned(vlapic, offset, &low);
     switch ( offset )
     {
     case APIC_ICR:
         vlapic_read_aligned(vlapic, APIC_ICR2, &high);
+        /* Fallthrough. */
+    case APIC_ID:
+    case APIC_LVR:
+    case APIC_TASKPRI:
+    case APIC_PROCPRI:
+    case APIC_LDR:
+    case APIC_SPIV:
+    case APIC_ISR ... APIC_ISR + 0x70:
+    case APIC_TMR ... APIC_TMR + 0x70:
+    case APIC_IRR ... APIC_IRR + 0x70:
+    case APIC_ESR:
+    case APIC_CMCI:
+    case APIC_LVTT:
+    case APIC_LVTTHMR:
+    case APIC_LVTPC:
+    case APIC_LVT0:
+    case APIC_LVT1:
+    case APIC_LVTERR:
+    case APIC_TMICT:
+    case APIC_TMCCT:
+    case APIC_TDCR:
+        vlapic_read_aligned(vlapic, offset, &low);
         break;
 
-    case APIC_EOI:
-    case APIC_ICR2:
-    case APIC_SELF_IPI:
+    default:
         return X86EMUL_UNHANDLEABLE;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 23 05:04:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Oct 2014 05:04:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XhAa3-0001fY-PN; Thu, 23 Oct 2014 05:04:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAa3-0001fK-7l
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:59 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	B7/7D-03123-A7C88445; Thu, 23 Oct 2014 05:04:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1414040697!5939474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8018 invoked from network); 23 Oct 2014 05:04:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Oct 2014 05:04:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAa0-0004CS-Rl
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XhAa0-0001Mt-Qi
	for xen-changelog@lists.xensource.com; Thu, 23 Oct 2014 05:04:56 +0000
Date: Thu, 23 Oct 2014 05:04:56 +0000
Message-Id: <E1XhAa0-0001Mt-Qi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: further restrict access to
	x2apic MSRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d0a20587e4ebf3691ee88a55f91f398c4d2ee83
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 21 17:34:20 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 17:34:20 2014 +0200

    x86/hvm: further restrict access to x2apic MSRs
    
    The x2apic specification reserves the entire MSR range 0x800-0xbff, while only
    the first 0x3f MSRs have defined purposes.  All reserved MSRs in this region
    are architecturally required to raise #GP faults upon access.
    
    Xen used to pass this entire range to hvm_x2apic_msr_{read,write}(), but the
    range was restricted somewhat by XSA-108 (c/s 61fdda7ac) to prevent guests
    being able to read pages adjacent to the domheap page backing the vlapic->regs
    array.
    
    While removing the vulnerability, a side effect of XSA-108 was that the MSR
    range 0x900-0xbff fell through the switch statement and ends up reading the
    hosts x2apic range. This behaviour is a problem in general, but specifically
    it turns out that MSRs 0xa00-0xa02 are implemented (but undocumented) on
    certain SandyBridge and IvyBridge systems.
    
    Experimentally, no operating system in XenServer's test suite (including all
    versions of Windows currently supported by Microsoft) ever peek at these MSRs,
    even on hosts where some of them are implemented.
    
    This patch undoes the fix for XSA-108 (c/s 61fdda7ac), returning the primary
    bounds check to the entire specified range.  hvm_x2apic_msr_write() was always
    safe, as it is whitelist based.  hvm_x2apic_msr_read() changes to a whitelist
    approach, which avoids the vulnerability, and provides a more architecturally
    accurate emulation of the reserved MSRs (which would previously read as 0
    rather than fault).
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/hvm.c    |    4 ++--
 xen/arch/x86/hvm/vlapic.c |   27 +++++++++++++++++++++++----
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f0e1edc..559b769 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4355,7 +4355,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
             goto gp_fault;
         break;
@@ -4482,7 +4482,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
         break;
 
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
             goto gp_fault;
         break;
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 089d13f..2f09713 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -649,16 +649,35 @@ int hvm_x2apic_msr_read(struct vcpu *v, unsigned int msr, uint64_t *msr_content)
     if ( !vlapic_x2apic_mode(vlapic) )
         return X86EMUL_UNHANDLEABLE;
 
-    vlapic_read_aligned(vlapic, offset, &low);
     switch ( offset )
     {
     case APIC_ICR:
         vlapic_read_aligned(vlapic, APIC_ICR2, &high);
+        /* Fallthrough. */
+    case APIC_ID:
+    case APIC_LVR:
+    case APIC_TASKPRI:
+    case APIC_PROCPRI:
+    case APIC_LDR:
+    case APIC_SPIV:
+    case APIC_ISR ... APIC_ISR + 0x70:
+    case APIC_TMR ... APIC_TMR + 0x70:
+    case APIC_IRR ... APIC_IRR + 0x70:
+    case APIC_ESR:
+    case APIC_CMCI:
+    case APIC_LVTT:
+    case APIC_LVTTHMR:
+    case APIC_LVTPC:
+    case APIC_LVT0:
+    case APIC_LVT1:
+    case APIC_LVTERR:
+    case APIC_TMICT:
+    case APIC_TMCCT:
+    case APIC_TDCR:
+        vlapic_read_aligned(vlapic, offset, &low);
         break;
 
-    case APIC_EOI:
-    case APIC_ICR2:
-    case APIC_SELF_IPI:
+    default:
         return X86EMUL_UNHANDLEABLE;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 24 15:22:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2014 15:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xhggt-0005Wh-Cy; Fri, 24 Oct 2014 15:22:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggs-0005WY-4W
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:10 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	BD/24-02704-1AE6A445; Fri, 24 Oct 2014 15:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1414164126!11614754!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9294 invoked from network); 24 Oct 2014 15:22:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2014 15:22:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggl-0001dB-FX
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggl-0007H0-9G
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:03 +0000
Date: Fri, 24 Oct 2014 15:22:03 +0000
Message-Id: <E1Xhggl-0007H0-9G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xen 4.5.0-rc1: Update tag for both
	QEMU trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b068a5b485062c862c20d8ba7674faa97ee3714
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Oct 24 10:22:40 2014 -0400
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CommitDate: Fri Oct 24 10:22:40 2014 -0400

    Xen 4.5.0-rc1: Update tag for both QEMU trees.
    
    And change 'unstable' to 'rc1'.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6324237..a5b6c41 100644
--- a/Config.mk
+++ b/Config.mk
@@ -252,7 +252,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.0-rc1
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
 # python3 fixes for vgabios and csm builds.
@@ -260,7 +260,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= b0d42741f8e9a00854c3b3faca1da84bfc69bf22
+QEMU_TRADITIONAL_REVISION ?= xen-4.5.0-rc1
 # Mon Oct 6 16:24:46 2014 +0100
 # qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
 
diff --git a/xen/Makefile b/xen/Makefile
index 28b4b79..bd2fa18 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= -rc1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 24 15:22:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2014 15:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xhggt-0005Wh-Cy; Fri, 24 Oct 2014 15:22:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggs-0005WY-4W
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:10 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	BD/24-02704-1AE6A445; Fri, 24 Oct 2014 15:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1414164126!11614754!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9294 invoked from network); 24 Oct 2014 15:22:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2014 15:22:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggl-0001dB-FX
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggl-0007H0-9G
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:03 +0000
Date: Fri, 24 Oct 2014 15:22:03 +0000
Message-Id: <E1Xhggl-0007H0-9G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xen 4.5.0-rc1: Update tag for both
	QEMU trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b068a5b485062c862c20d8ba7674faa97ee3714
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Oct 24 10:22:40 2014 -0400
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CommitDate: Fri Oct 24 10:22:40 2014 -0400

    Xen 4.5.0-rc1: Update tag for both QEMU trees.
    
    And change 'unstable' to 'rc1'.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6324237..a5b6c41 100644
--- a/Config.mk
+++ b/Config.mk
@@ -252,7 +252,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.0-rc1
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
 # python3 fixes for vgabios and csm builds.
@@ -260,7 +260,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= b0d42741f8e9a00854c3b3faca1da84bfc69bf22
+QEMU_TRADITIONAL_REVISION ?= xen-4.5.0-rc1
 # Mon Oct 6 16:24:46 2014 +0100
 # qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
 
diff --git a/xen/Makefile b/xen/Makefile
index 28b4b79..bd2fa18 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= -unstable$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= -rc1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 24 15:22:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2014 15:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xhgh3-0005Xf-FW; Fri, 24 Oct 2014 15:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhgh1-0005XS-TW
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:20 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	65/07-02954-BAE6A445; Fri, 24 Oct 2014 15:22:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1414164136!11599343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28389 invoked from network); 24 Oct 2014 15:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2014 15:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggy-0001dE-85
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggy-0007HO-3M
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:16 +0000
Date: Fri, 24 Oct 2014 15:22:16 +0000
Message-Id: <E1Xhggy-0007HO-3M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/Makefile: Update version to
	4.5.0-rc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6688825c240586708129df8887ad9b12a1708497
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 24 16:00:00 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 24 16:11:23 2014 +0100

    xen/Makefile: Update version to 4.5.0-rc
    
    * Remove the rc number as this makes rc releases more convenient.
    * Add the .0, since we conventionally call our actual releases things
      like `4.4.0'.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index bd2fa18..72c1313 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= -rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Oct 24 15:22:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2014 15:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xhgh3-0005Xf-FW; Fri, 24 Oct 2014 15:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhgh1-0005XS-TW
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:20 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	65/07-02954-BAE6A445; Fri, 24 Oct 2014 15:22:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1414164136!11599343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28389 invoked from network); 24 Oct 2014 15:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Oct 2014 15:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggy-0001dE-85
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xhggy-0007HO-3M
	for xen-changelog@lists.xensource.com; Fri, 24 Oct 2014 15:22:16 +0000
Date: Fri, 24 Oct 2014 15:22:16 +0000
Message-Id: <E1Xhggy-0007HO-3M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/Makefile: Update version to
	4.5.0-rc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6688825c240586708129df8887ad9b12a1708497
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 24 16:00:00 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 24 16:11:23 2014 +0100

    xen/Makefile: Update version to 4.5.0-rc
    
    * Remove the rc number as this makes rc releases more convenient.
    * Add the .0, since we conventionally call our actual releases things
      like `4.4.0'.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index bd2fa18..72c1313 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= -rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTXi-00020c-IE; Wed, 29 Oct 2014 13:44:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXh-00020O-Fk
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:05 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	60/F5-02712-42FE0545; Wed, 29 Oct 2014 13:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414590243!8593542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16796 invoked from network); 29 Oct 2014 13:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXf-0001Tt-1i
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXe-0007op-S2
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:02 +0000
Date: Wed, 29 Oct 2014 13:44:02 +0000
Message-Id: <E1XjTXe-0007op-S2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86,
	idle: add barriers to CLFLUSH workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a9e120bb9adbc0a420c2a4ad88ff7abbc3e79cd8
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri Oct 17 15:51:20 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:51:20 2014 +0200

    x86, idle: add barriers to CLFLUSH workaround
    
    ... since the documentation is explicit that CLFLUSH is only ordered
    with respect to MFENCE.
    
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 48d32458bcd453e31b458bca868a079a6d0a38af
    master date: 2014-09-09 18:09:08 +0200
---
 xen/arch/x86/acpi/cpu_idle.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 6aaa7ab..2279f8f 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -300,7 +300,11 @@ void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
     s_time_t expires = per_cpu(timer_deadline, cpu);
 
     if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
+    {
+        mb();
         clflush((void *)&mwait_wakeup(cpu));
+        mb();
+    }
 
     __monitor((void *)&mwait_wakeup(cpu), 0, 0);
     smp_mb();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTXi-00020c-IE; Wed, 29 Oct 2014 13:44:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXh-00020O-Fk
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:05 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	60/F5-02712-42FE0545; Wed, 29 Oct 2014 13:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414590243!8593542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16796 invoked from network); 29 Oct 2014 13:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXf-0001Tt-1i
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXe-0007op-S2
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:02 +0000
Date: Wed, 29 Oct 2014 13:44:02 +0000
Message-Id: <E1XjTXe-0007op-S2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86,
	idle: add barriers to CLFLUSH workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a9e120bb9adbc0a420c2a4ad88ff7abbc3e79cd8
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri Oct 17 15:51:20 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:51:20 2014 +0200

    x86, idle: add barriers to CLFLUSH workaround
    
    ... since the documentation is explicit that CLFLUSH is only ordered
    with respect to MFENCE.
    
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 48d32458bcd453e31b458bca868a079a6d0a38af
    master date: 2014-09-09 18:09:08 +0200
---
 xen/arch/x86/acpi/cpu_idle.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 6aaa7ab..2279f8f 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -300,7 +300,11 @@ void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
     s_time_t expires = per_cpu(timer_deadline, cpu);
 
     if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
+    {
+        mb();
         clflush((void *)&mwait_wakeup(cpu));
+        mb();
+    }
 
     __monitor((void *)&mwait_wakeup(cpu), 0, 0);
     smp_mb();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTXs-000229-M2; Wed, 29 Oct 2014 13:44:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXr-00021w-Tz
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:16 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	AC/E9-02699-F2FE0545; Wed, 29 Oct 2014 13:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1414590253!13244283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30626 invoked from network); 29 Oct 2014 13:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXp-0001Tw-B1
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXp-0007pK-6X
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:13 +0000
Date: Wed, 29 Oct 2014 13:44:13 +0000
Message-Id: <E1XjTXp-0007pK-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VMX: don't unintentionally leave
	x2APIC MSR intercepts disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9e1e5b6b1968b09f7eccf8292bdbdc1b51d47f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:52:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:52:27 2014 +0200

    VMX: don't unintentionally leave x2APIC MSR intercepts disabled
    
    These should be re-enabled in particular when the virtualized APIC
    transitions to HW-disabled state.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 72af6f455ac6afcd46d9a556f90349f2397507e8
    master date: 2014-09-16 13:58:20 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 678cc59..b05c88e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2090,6 +2090,7 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
 {
     int virtualize_x2apic_mode;
     struct vlapic *vlapic = vcpu_vlapic(v);
+    unsigned int msr;
 
     virtualize_x2apic_mode = ( (cpu_has_vmx_apic_reg_virt ||
                                 cpu_has_vmx_virtual_intr_delivery) &&
@@ -2106,8 +2107,6 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
     if ( !vlapic_hw_disabled(vlapic) &&
          (vlapic_base_address(vlapic) == APIC_DEFAULT_PHYS_BASE) )
     {
-        unsigned int msr;
-
         if ( virtualize_x2apic_mode && vlapic_x2apic_mode(vlapic) )
         {
             v->arch.hvm_vmx.secondary_exec_control |=
@@ -2136,15 +2135,15 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
             }
         }
         else
-        {
             v->arch.hvm_vmx.secondary_exec_control |=
                 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
-            for ( msr = MSR_IA32_APICBASE_MSR;
-                  msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
-                vmx_enable_intercept_for_msr(v, msr,
-                                             MSR_TYPE_R | MSR_TYPE_W);
-        }
     }
+    if ( !(v->arch.hvm_vmx.secondary_exec_control &
+           SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE) )
+        for ( msr = MSR_IA32_APICBASE_MSR;
+              msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
+            vmx_enable_intercept_for_msr(v, msr, MSR_TYPE_R | MSR_TYPE_W);
+
     vmx_update_secondary_exec_control(v);
     vmx_vmcs_exit(v);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTXs-000229-M2; Wed, 29 Oct 2014 13:44:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXr-00021w-Tz
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:16 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	AC/E9-02699-F2FE0545; Wed, 29 Oct 2014 13:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1414590253!13244283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30626 invoked from network); 29 Oct 2014 13:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXp-0001Tw-B1
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXp-0007pK-6X
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:13 +0000
Date: Wed, 29 Oct 2014 13:44:13 +0000
Message-Id: <E1XjTXp-0007pK-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VMX: don't unintentionally leave
	x2APIC MSR intercepts disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9e1e5b6b1968b09f7eccf8292bdbdc1b51d47f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:52:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:52:27 2014 +0200

    VMX: don't unintentionally leave x2APIC MSR intercepts disabled
    
    These should be re-enabled in particular when the virtualized APIC
    transitions to HW-disabled state.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 72af6f455ac6afcd46d9a556f90349f2397507e8
    master date: 2014-09-16 13:58:20 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 678cc59..b05c88e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2090,6 +2090,7 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
 {
     int virtualize_x2apic_mode;
     struct vlapic *vlapic = vcpu_vlapic(v);
+    unsigned int msr;
 
     virtualize_x2apic_mode = ( (cpu_has_vmx_apic_reg_virt ||
                                 cpu_has_vmx_virtual_intr_delivery) &&
@@ -2106,8 +2107,6 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
     if ( !vlapic_hw_disabled(vlapic) &&
          (vlapic_base_address(vlapic) == APIC_DEFAULT_PHYS_BASE) )
     {
-        unsigned int msr;
-
         if ( virtualize_x2apic_mode && vlapic_x2apic_mode(vlapic) )
         {
             v->arch.hvm_vmx.secondary_exec_control |=
@@ -2136,15 +2135,15 @@ void vmx_vlapic_msr_changed(struct vcpu *v)
             }
         }
         else
-        {
             v->arch.hvm_vmx.secondary_exec_control |=
                 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
-            for ( msr = MSR_IA32_APICBASE_MSR;
-                  msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
-                vmx_enable_intercept_for_msr(v, msr,
-                                             MSR_TYPE_R | MSR_TYPE_W);
-        }
     }
+    if ( !(v->arch.hvm_vmx.secondary_exec_control &
+           SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE) )
+        for ( msr = MSR_IA32_APICBASE_MSR;
+              msr <= MSR_IA32_APICBASE_MSR + 0xff; msr++ )
+            vmx_enable_intercept_for_msr(v, msr, MSR_TYPE_R | MSR_TYPE_W);
+
     vmx_update_secondary_exec_control(v);
     vmx_vmcs_exit(v);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:26 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTY2-00023p-Ob; Wed, 29 Oct 2014 13:44:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTY2-00023d-42
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:26 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	7E/CF-02954-93FE0545; Wed, 29 Oct 2014 13:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414590263!8593656!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19747 invoked from network); 29 Oct 2014 13:44:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXz-0001U5-Fu
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXz-0007qK-E9
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:23 +0000
Date: Wed, 29 Oct 2014 13:44:23 +0000
Message-Id: <E1XjTXz-0007qK-E9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/EFI: fix freeing of
	uninitialized pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41997d3666baeea34e965c4975d33e7e79d1782d
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Fri Oct 17 15:53:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:53:46 2014 +0200

    x86/EFI: fix freeing of uninitialized pointer
    
    The only valid response from the LocateHandle() call is EFI_BUFFER_TOO_SMALL,
    so exit if we get anything else.  We pass a 0 size/NULL pointer buffer, so the
    only other returns we will get is an error.  Return right away as there is
    nothing to do.  Also return if there is an error allocating the buffer, as the
    previous code path also allowed for an undefined pointer to be freed.
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    
    Re-structure the change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c61690fb76f9a51a8c932d76929b67bd0940febe
    master date: 2014-09-24 11:09:11 +0200
---
 xen/arch/x86/efi/boot.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 0dd935c..7044892 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -594,11 +594,12 @@ static void __init setup_efi_pci(void)
     struct efi_pci_rom *last = NULL;
 
     status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, NULL);
-    if ( status == EFI_BUFFER_TOO_SMALL )
-        status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
-    if ( !EFI_ERROR(status) )
-        status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size,
-                                      handles);
+    if ( status != EFI_BUFFER_TOO_SMALL )
+        return;
+    status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
+    if ( EFI_ERROR(status) )
+        return;
+    status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, handles);
     if ( EFI_ERROR(status) )
         size = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:26 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTY2-00023p-Ob; Wed, 29 Oct 2014 13:44:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTY2-00023d-42
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:26 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	7E/CF-02954-93FE0545; Wed, 29 Oct 2014 13:44:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414590263!8593656!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19747 invoked from network); 29 Oct 2014 13:44:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXz-0001U5-Fu
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTXz-0007qK-E9
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:23 +0000
Date: Wed, 29 Oct 2014 13:44:23 +0000
Message-Id: <E1XjTXz-0007qK-E9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/EFI: fix freeing of
	uninitialized pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41997d3666baeea34e965c4975d33e7e79d1782d
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Fri Oct 17 15:53:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:53:46 2014 +0200

    x86/EFI: fix freeing of uninitialized pointer
    
    The only valid response from the LocateHandle() call is EFI_BUFFER_TOO_SMALL,
    so exit if we get anything else.  We pass a 0 size/NULL pointer buffer, so the
    only other returns we will get is an error.  Return right away as there is
    nothing to do.  Also return if there is an error allocating the buffer, as the
    previous code path also allowed for an undefined pointer to be freed.
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    
    Re-structure the change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c61690fb76f9a51a8c932d76929b67bd0940febe
    master date: 2014-09-24 11:09:11 +0200
---
 xen/arch/x86/efi/boot.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 0dd935c..7044892 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -594,11 +594,12 @@ static void __init setup_efi_pci(void)
     struct efi_pci_rom *last = NULL;
 
     status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, NULL);
-    if ( status == EFI_BUFFER_TOO_SMALL )
-        status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
-    if ( !EFI_ERROR(status) )
-        status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size,
-                                      handles);
+    if ( status != EFI_BUFFER_TOO_SMALL )
+        return;
+    status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles);
+    if ( EFI_ERROR(status) )
+        return;
+    status = efi_bs->LocateHandle(ByProtocol, &pci_guid, NULL, &size, handles);
     if ( EFI_ERROR(status) )
         size = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYD-00025s-RU; Wed, 29 Oct 2014 13:44:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYC-00025Z-G0
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:36 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	BF/7A-03123-34FE0545; Wed, 29 Oct 2014 13:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1414590274!9124284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16002 invoked from network); 29 Oct 2014 13:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTY9-0001UD-N2
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTY9-0007qk-K0
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:33 +0000
Date: Wed, 29 Oct 2014 13:44:33 +0000
Message-Id: <E1XjTY9-0007qk-K0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/MSI: fix MSI-X case of freeing
	IRQ
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e08d1280f026e48bdf38e95a7c2a175b8256369
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:54:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:54:31 2014 +0200

    x86/MSI: fix MSI-X case of freeing IRQ
    
    Commit d1b6d0a024 ("x86: enable multi-vector MSI") went a little too
    far with moving things around in msi_free_irqs() in order to streamline
    the code: We shouldn't drop the MSI-X control page reference before
    calling destroy_irq(), as the latter will call us back via
    desc->handler->shutdown() (effectively invoking to msi_set_mask_bit()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 44d20c69516f8d5e71fc14bf216e230a9910d729
    master date: 2014-10-06 11:11:28 +0200
---
 xen/arch/x86/msi.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 61d6dd0..99312d9 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -496,15 +496,8 @@ int __setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc,
 
 int msi_free_irq(struct msi_desc *entry)
 {
-    unsigned int nr = entry->msi.nvec;
-
-    if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
-    {
-        unsigned long start;
-        start = (unsigned long)entry->mask_base & ~(PAGE_SIZE - 1);
-        msix_put_fixmap(entry->dev->msix, virt_to_fix(start));
-        nr = 1;
-    }
+    unsigned int nr = entry->msi_attrib.type != PCI_CAP_ID_MSIX
+                      ? entry->msi.nvec : 1;
 
     while ( nr-- )
     {
@@ -515,6 +508,10 @@ int msi_free_irq(struct msi_desc *entry)
             iommu_update_ire_from_msi(entry + nr, NULL);
     }
 
+    if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+        msix_put_fixmap(entry->dev->msix,
+                        virt_to_fix((unsigned long)entry->mask_base));
+
     list_del(&entry->list);
     xfree(entry);
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYD-00025s-RU; Wed, 29 Oct 2014 13:44:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYC-00025Z-G0
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:36 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	BF/7A-03123-34FE0545; Wed, 29 Oct 2014 13:44:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1414590274!9124284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16002 invoked from network); 29 Oct 2014 13:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTY9-0001UD-N2
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTY9-0007qk-K0
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:33 +0000
Date: Wed, 29 Oct 2014 13:44:33 +0000
Message-Id: <E1XjTY9-0007qk-K0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/MSI: fix MSI-X case of freeing
	IRQ
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e08d1280f026e48bdf38e95a7c2a175b8256369
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:54:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:54:31 2014 +0200

    x86/MSI: fix MSI-X case of freeing IRQ
    
    Commit d1b6d0a024 ("x86: enable multi-vector MSI") went a little too
    far with moving things around in msi_free_irqs() in order to streamline
    the code: We shouldn't drop the MSI-X control page reference before
    calling destroy_irq(), as the latter will call us back via
    desc->handler->shutdown() (effectively invoking to msi_set_mask_bit()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 44d20c69516f8d5e71fc14bf216e230a9910d729
    master date: 2014-10-06 11:11:28 +0200
---
 xen/arch/x86/msi.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 61d6dd0..99312d9 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -496,15 +496,8 @@ int __setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc,
 
 int msi_free_irq(struct msi_desc *entry)
 {
-    unsigned int nr = entry->msi.nvec;
-
-    if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
-    {
-        unsigned long start;
-        start = (unsigned long)entry->mask_base & ~(PAGE_SIZE - 1);
-        msix_put_fixmap(entry->dev->msix, virt_to_fix(start));
-        nr = 1;
-    }
+    unsigned int nr = entry->msi_attrib.type != PCI_CAP_ID_MSIX
+                      ? entry->msi.nvec : 1;
 
     while ( nr-- )
     {
@@ -515,6 +508,10 @@ int msi_free_irq(struct msi_desc *entry)
             iommu_update_ire_from_msi(entry + nr, NULL);
     }
 
+    if ( entry->msi_attrib.type == PCI_CAP_ID_MSIX )
+        msix_put_fixmap(entry->dev->msix,
+                        virt_to_fix((unsigned long)entry->mask_base));
+
     list_del(&entry->list);
     xfree(entry);
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYN-00028D-U9; Wed, 29 Oct 2014 13:44:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYM-00027p-Dv
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:46 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	58/37-02699-D4FE0545; Wed, 29 Oct 2014 13:44:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1414590284!13472008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17636 invoked from network); 29 Oct 2014 13:44:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYJ-0001UJ-Rb
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYJ-0007r6-Qh
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:43 +0000
Date: Wed, 29 Oct 2014 13:44:43 +0000
Message-Id: <E1XjTYJ-0007r6-Qh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: restore reserving of IO-APIC
	pages in XENMEM_machine_memory_map output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d1cb4abdfb53e471bd019757c6e683e444bf7dd9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:55:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:55:27 2014 +0200

    x86: restore reserving of IO-APIC pages in XENMEM_machine_memory_map output
    
    Commit d1222afda4 ("x86: allow Dom0 read-only access to IO-APICs") had
    an unintended side effect: By no longer adding IO-APIC pages to Dom0's
    iomem_caps these also no longer get reported as reserved in the machine
    memory map presented to it (which got added there intentionally by
    commit b8a456caed ["x86: improve reporting through
    XENMEM_machine_memory_map"] because many BIOSes fail to add these).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 9d8edc5a8b4a0937193f80da72abdb44c5aeaec6
    master date: 2014-10-06 11:13:19 +0200
---
 xen/arch/x86/mm.c |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fdc5ed3..486e520 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -121,6 +121,7 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
+#include <asm/io_apic.h>
 #include <asm/pci.h>
 
 /* Mapping of the fixmap space needed early. */
@@ -4494,10 +4495,9 @@ struct memory_map_context
     struct xen_memory_map map;
 };
 
-static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+static int _handle_iomem_range(unsigned long s, unsigned long e,
+                               struct memory_map_context *ctxt)
 {
-    struct memory_map_context *ctxt = p;
-
     if ( s > ctxt->s )
     {
         e820entry_t ent;
@@ -4520,6 +4520,31 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
     return 0;
 }
 
+static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+{
+    int err = 0;
+
+    do {
+        unsigned long low = -1UL;
+        unsigned int i;
+
+        for ( i = 0; i < nr_ioapics; ++i )
+        {
+            unsigned long mfn = paddr_to_pfn(mp_ioapics[i].mpc_apicaddr);
+
+            if ( mfn >= s && mfn <= e && mfn < low )
+                low = mfn;
+        }
+        if ( !(low + 1) )
+            break;
+        if ( s < low )
+            err = _handle_iomem_range(s, low - 1, p);
+        s = low + 1;
+    } while ( !err );
+
+    return err || s > e ? err : _handle_iomem_range(s, e, p);
+}
+
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
@@ -4744,7 +4769,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         {
             unsigned long s = PFN_DOWN(e820.map[i].addr);
 
-            if ( s )
+            if ( s > ctxt.s )
             {
                 rc = rangeset_report_ranges(current->domain->iomem_caps,
                                             ctxt.s, s - 1,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYN-00028D-U9; Wed, 29 Oct 2014 13:44:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYM-00027p-Dv
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:46 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	58/37-02699-D4FE0545; Wed, 29 Oct 2014 13:44:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1414590284!13472008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17636 invoked from network); 29 Oct 2014 13:44:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYJ-0001UJ-Rb
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYJ-0007r6-Qh
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:43 +0000
Date: Wed, 29 Oct 2014 13:44:43 +0000
Message-Id: <E1XjTYJ-0007r6-Qh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: restore reserving of IO-APIC
	pages in XENMEM_machine_memory_map output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d1cb4abdfb53e471bd019757c6e683e444bf7dd9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:55:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:55:27 2014 +0200

    x86: restore reserving of IO-APIC pages in XENMEM_machine_memory_map output
    
    Commit d1222afda4 ("x86: allow Dom0 read-only access to IO-APICs") had
    an unintended side effect: By no longer adding IO-APIC pages to Dom0's
    iomem_caps these also no longer get reported as reserved in the machine
    memory map presented to it (which got added there intentionally by
    commit b8a456caed ["x86: improve reporting through
    XENMEM_machine_memory_map"] because many BIOSes fail to add these).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 9d8edc5a8b4a0937193f80da72abdb44c5aeaec6
    master date: 2014-10-06 11:13:19 +0200
---
 xen/arch/x86/mm.c |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fdc5ed3..486e520 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -121,6 +121,7 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
+#include <asm/io_apic.h>
 #include <asm/pci.h>
 
 /* Mapping of the fixmap space needed early. */
@@ -4494,10 +4495,9 @@ struct memory_map_context
     struct xen_memory_map map;
 };
 
-static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+static int _handle_iomem_range(unsigned long s, unsigned long e,
+                               struct memory_map_context *ctxt)
 {
-    struct memory_map_context *ctxt = p;
-
     if ( s > ctxt->s )
     {
         e820entry_t ent;
@@ -4520,6 +4520,31 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
     return 0;
 }
 
+static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
+{
+    int err = 0;
+
+    do {
+        unsigned long low = -1UL;
+        unsigned int i;
+
+        for ( i = 0; i < nr_ioapics; ++i )
+        {
+            unsigned long mfn = paddr_to_pfn(mp_ioapics[i].mpc_apicaddr);
+
+            if ( mfn >= s && mfn <= e && mfn < low )
+                low = mfn;
+        }
+        if ( !(low + 1) )
+            break;
+        if ( s < low )
+            err = _handle_iomem_range(s, low - 1, p);
+        s = low + 1;
+    } while ( !err );
+
+    return err || s > e ? err : _handle_iomem_range(s, e, p);
+}
+
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
@@ -4744,7 +4769,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
         {
             unsigned long s = PFN_DOWN(e820.map[i].addr);
 
-            if ( s )
+            if ( s > ctxt.s )
             {
                 rc = rangeset_report_ranges(current->domain->iomem_caps,
                                             ctxt.s, s - 1,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYY-00029y-0j; Wed, 29 Oct 2014 13:44:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYW-00029g-Nf
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:56 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	6B/4C-02861-75FE0545; Wed, 29 Oct 2014 13:44:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1414590294!12300575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25073 invoked from network); 29 Oct 2014 13:44:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYU-0001US-0g
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYT-0007rh-VG
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:53 +0000
Date: Wed, 29 Oct 2014 13:44:53 +0000
Message-Id: <E1XjTYT-0007rh-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] don't allow Dom0 access to IOMMUs'
	MMIO pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d61d8ebfa641d2624ccbce5d23906f711f83a37
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:56:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:56:07 2014 +0200

    don't allow Dom0 access to IOMMUs' MMIO pages
    
    Just like for LAPIC, IO-APIC, MSI, and HT we shouldn't be granting Dom0
    access to these. This implicitly results in these pages also getting
    marked reserved in the machine memory map Dom0 uses to determine the
    ranges where PCI devices can have their MMIO ranges placed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: fdf30377fbc4fa6798bfda7d69e5d448c2b8e834
    master date: 2014-10-06 11:15:01 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    8 ++++++++
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index f97fcf2..d462e5b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -19,6 +19,7 @@
  */
 
 #include <xen/sched.h>
+#include <xen/iocap.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <xen/paging.h>
@@ -283,6 +284,7 @@ static int amd_iommu_domain_init(struct domain *d)
 static void __init amd_iommu_dom0_init(struct domain *d)
 {
     unsigned long i; 
+    const struct amd_iommu *iommu;
 
     if ( !iommu_passthrough && !need_iommu(d) )
     {
@@ -304,6 +306,12 @@ static void __init amd_iommu_dom0_init(struct domain *d)
         }
     }
 
+    for_each_amd_iommu ( iommu )
+        if ( iomem_deny_access(d, PFN_DOWN(iommu->mmio_base_phys),
+                               PFN_DOWN(iommu->mmio_base_phys +
+                                        IOMMU_MMIO_REGION_LENGTH - 1)) )
+            BUG();
+
     setup_dom0_pci_devices(d, amd_iommu_setup_dom0_device);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e543c08..be346b2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -23,6 +23,7 @@
 #include <xen/sched.h>
 #include <xen/xmalloc.h>
 #include <xen/domain_page.h>
+#include <xen/iocap.h>
 #include <xen/iommu.h>
 #include <asm/hvm/iommu.h>
 #include <xen/numa.h>
@@ -1259,6 +1260,9 @@ static void __init intel_iommu_dom0_init(struct domain *d)
 
     for_each_drhd_unit ( drhd )
     {
+        if ( iomem_deny_access(d, PFN_DOWN(drhd->address),
+                               PFN_DOWN(drhd->address)) )
+            BUG();
         iommu_enable_translation(drhd);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:44:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:44:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYY-00029y-0j; Wed, 29 Oct 2014 13:44:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYW-00029g-Nf
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:56 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	6B/4C-02861-75FE0545; Wed, 29 Oct 2014 13:44:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1414590294!12300575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25073 invoked from network); 29 Oct 2014 13:44:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:44:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYU-0001US-0g
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYT-0007rh-VG
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:44:53 +0000
Date: Wed, 29 Oct 2014 13:44:53 +0000
Message-Id: <E1XjTYT-0007rh-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] don't allow Dom0 access to IOMMUs'
	MMIO pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d61d8ebfa641d2624ccbce5d23906f711f83a37
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:56:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:56:07 2014 +0200

    don't allow Dom0 access to IOMMUs' MMIO pages
    
    Just like for LAPIC, IO-APIC, MSI, and HT we shouldn't be granting Dom0
    access to these. This implicitly results in these pages also getting
    marked reserved in the machine memory map Dom0 uses to determine the
    ranges where PCI devices can have their MMIO ranges placed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: fdf30377fbc4fa6798bfda7d69e5d448c2b8e834
    master date: 2014-10-06 11:15:01 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    8 ++++++++
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index f97fcf2..d462e5b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -19,6 +19,7 @@
  */
 
 #include <xen/sched.h>
+#include <xen/iocap.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <xen/paging.h>
@@ -283,6 +284,7 @@ static int amd_iommu_domain_init(struct domain *d)
 static void __init amd_iommu_dom0_init(struct domain *d)
 {
     unsigned long i; 
+    const struct amd_iommu *iommu;
 
     if ( !iommu_passthrough && !need_iommu(d) )
     {
@@ -304,6 +306,12 @@ static void __init amd_iommu_dom0_init(struct domain *d)
         }
     }
 
+    for_each_amd_iommu ( iommu )
+        if ( iomem_deny_access(d, PFN_DOWN(iommu->mmio_base_phys),
+                               PFN_DOWN(iommu->mmio_base_phys +
+                                        IOMMU_MMIO_REGION_LENGTH - 1)) )
+            BUG();
+
     setup_dom0_pci_devices(d, amd_iommu_setup_dom0_device);
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e543c08..be346b2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -23,6 +23,7 @@
 #include <xen/sched.h>
 #include <xen/xmalloc.h>
 #include <xen/domain_page.h>
+#include <xen/iocap.h>
 #include <xen/iommu.h>
 #include <asm/hvm/iommu.h>
 #include <xen/numa.h>
@@ -1259,6 +1260,9 @@ static void __init intel_iommu_dom0_init(struct domain *d)
 
     for_each_drhd_unit ( drhd )
     {
+        if ( iomem_deny_access(d, PFN_DOWN(drhd->address),
+                               PFN_DOWN(drhd->address)) )
+            BUG();
         iommu_enable_translation(drhd);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:45:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYo-0002C4-3Y; Wed, 29 Oct 2014 13:45:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYm-0002Bn-HJ
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:12 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	06/03-02954-76FE0545; Wed, 29 Oct 2014 13:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1414590309!10770743!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11321 invoked from network); 29 Oct 2014 13:45:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:45:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYj-0001VQ-H1
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYe-0007si-4D
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:04 +0000
Date: Wed, 29 Oct 2014 13:45:04 +0000
Message-Id: <E1XjTYe-0007si-4D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] AMD/guest_iommu: properly disable
	guest iommu support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a61f3ab1d172a0a026556e0f80f7cfde3c38a41
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 15:56:51 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:56:51 2014 +0200

    AMD/guest_iommu: properly disable guest iommu support
    
    AMD Guest IOMMU support was added to allow correct use of PASID and PRI
    hardware support with an ATS-aware guest driver.
    
    However, support cannot possibly function as guest_iommu_set_base() has no
    callers.  This means that its MMIO region's P2M pages are not set to
    p2m_mmio_dm, preventing any invocation of the MMIO read/write handlers.
    
    c/s fd186384 "x86/HVM: extend LAPIC shortcuts around P2M lookups" introduces a
    path (via hvm_mmio_internal()) where iommu_mmio_handler claims its MMIO range,
    and causes __hvm_copy() to fail with HVMCOPY_bad_gfn_to_mfn.
    
    iommu->mmio_base defaults to 0, with a range of 8 pages, and is unilaterally
    enabled in any HVM guests when the host IOMMU(s) supports any extended
    features.
    
    Unfortunately, HVMLoader's AP boot trampoline executes an `lmsw` instruction
    at linear address 0x100c which unconditionally requires emulation.  The
    instruction fetch in turn fails as __hvm_copy() fails with
    HVMCOPY_bad_gfn_to_mfn.
    
    The result is that multi-vcpu HVM guests do not work on newer AMD hardware, if
    IOMMU support is enabled in the BIOS.
    
    Change the default mmio_base address to ~0ULL.  This prevents
    guest_iommu_mmio_range() from actually claiming any physical range
    whatsoever, which allows the emulation of `lmsw` to succeed.
    
    Reported-by: Roberto Luongo <rluongo@ready.it>
    Suggested-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Roberto Luongo <rluongo@ready.it>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: 02e4c89b2cc3c1f19ef42ed4fcb1931d8d704bb5
    master date: 2014-10-06 11:20:12 +0200
---
 xen/drivers/passthrough/amd/iommu_guest.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 477de20..b675a4b 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -885,6 +885,7 @@ int guest_iommu_init(struct domain* d)
     }
 
     guest_iommu_reg_init(iommu);
+    iommu->mmio_base = ~0ULL;
     iommu->domain = d;
     hd->g_iommu = iommu;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:45:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYo-0002C4-3Y; Wed, 29 Oct 2014 13:45:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYm-0002Bn-HJ
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:12 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	06/03-02954-76FE0545; Wed, 29 Oct 2014 13:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1414590309!10770743!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11321 invoked from network); 29 Oct 2014 13:45:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:45:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYj-0001VQ-H1
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYe-0007si-4D
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:04 +0000
Date: Wed, 29 Oct 2014 13:45:04 +0000
Message-Id: <E1XjTYe-0007si-4D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] AMD/guest_iommu: properly disable
	guest iommu support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a61f3ab1d172a0a026556e0f80f7cfde3c38a41
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 15:56:51 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:56:51 2014 +0200

    AMD/guest_iommu: properly disable guest iommu support
    
    AMD Guest IOMMU support was added to allow correct use of PASID and PRI
    hardware support with an ATS-aware guest driver.
    
    However, support cannot possibly function as guest_iommu_set_base() has no
    callers.  This means that its MMIO region's P2M pages are not set to
    p2m_mmio_dm, preventing any invocation of the MMIO read/write handlers.
    
    c/s fd186384 "x86/HVM: extend LAPIC shortcuts around P2M lookups" introduces a
    path (via hvm_mmio_internal()) where iommu_mmio_handler claims its MMIO range,
    and causes __hvm_copy() to fail with HVMCOPY_bad_gfn_to_mfn.
    
    iommu->mmio_base defaults to 0, with a range of 8 pages, and is unilaterally
    enabled in any HVM guests when the host IOMMU(s) supports any extended
    features.
    
    Unfortunately, HVMLoader's AP boot trampoline executes an `lmsw` instruction
    at linear address 0x100c which unconditionally requires emulation.  The
    instruction fetch in turn fails as __hvm_copy() fails with
    HVMCOPY_bad_gfn_to_mfn.
    
    The result is that multi-vcpu HVM guests do not work on newer AMD hardware, if
    IOMMU support is enabled in the BIOS.
    
    Change the default mmio_base address to ~0ULL.  This prevents
    guest_iommu_mmio_range() from actually claiming any physical range
    whatsoever, which allows the emulation of `lmsw` to succeed.
    
    Reported-by: Roberto Luongo <rluongo@ready.it>
    Suggested-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Roberto Luongo <rluongo@ready.it>
    Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
    master commit: 02e4c89b2cc3c1f19ef42ed4fcb1931d8d704bb5
    master date: 2014-10-06 11:20:12 +0200
---
 xen/drivers/passthrough/amd/iommu_guest.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 477de20..b675a4b 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -885,6 +885,7 @@ int guest_iommu_init(struct domain* d)
     }
 
     guest_iommu_reg_init(iommu);
+    iommu->mmio_base = ~0ULL;
     iommu->domain = d;
     hd->g_iommu = iommu;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:45:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:45:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYz-0002EM-8s; Wed, 29 Oct 2014 13:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYx-0002Dy-VQ
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:24 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	B6/96-13367-37FE0545; Wed, 29 Oct 2014 13:45:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1414590320!11787099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22156 invoked from network); 29 Oct 2014 13:45:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:45:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYu-0001VY-97
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYu-0007tY-74
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:20 +0000
Date: Wed, 29 Oct 2014 13:45:20 +0000
Message-Id: <E1XjTYu-0007tY-74@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/paging: make log-dirty
	operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c8ed54edda001163a5ff7610424dd2ef4244e8d6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:57:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:57:42 2014 +0200

    x86/paging: make log-dirty operations preemptible
    
    Both the freeing and the inspection of the bitmap get done in (nested)
    loops which - besides having a rather high iteration count in general,
    albeit that would be covered by XSA-77 - have the number of non-trivial
    iterations they need to perform (indirectly) controllable by both the
    guest they are for and any domain controlling the guest (including the
    one running qemu for it).
    
    Note that the tying of the continuations to the invoking domain (which
    previously [wrongly] used the invoking vCPU instead) implies that the
    tools requesting such operations have to make sure they don't issue
    multiple similar operations in parallel.
    
    Note further that this breaks supervisor-mode kernel assumptions in
    hypercall_create_continuation() (where regs->eip gets rewound to the
    current hypercall stub beginning), but otoh
    hypercall_cancel_continuation() doesn't work in that mode either.
    Perhaps time to rip out all the remains of that feature?
    
    This is part of CVE-2014-5146 / XSA-97.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 070493dfd2788e061b53f074b7ba97507fbcbf65
    master date: 2014-10-06 11:22:04 +0200
---
 xen/arch/x86/domain.c              |    4 +-
 xen/arch/x86/domctl.c              |    8 +-
 xen/arch/x86/hvm/hvm.c             |    9 +-
 xen/arch/x86/mm/paging.c           |  261 +++++++++++++++++++++++++++++-------
 xen/arch/x86/x86_64/compat/entry.S |    2 +
 xen/arch/x86/x86_64/entry.S        |    2 +
 xen/common/domain.c                |    1 -
 xen/include/asm-x86/domain.h       |   14 ++
 xen/include/asm-x86/paging.h       |   13 +-
 9 files changed, 252 insertions(+), 62 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 195b07f..789e4a0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1915,7 +1915,9 @@ int domain_relinquish_resources(struct domain *d)
         pci_release_devices(d);
 
         /* Tear down paging-assistance stuff. */
-        paging_teardown(d);
+        ret = paging_teardown(d);
+        if ( ret )
+            return ret;
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index a967b65..f5e9e2c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -58,9 +58,11 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        ret = paging_domctl(d,
-                            &domctl->u.shadow_op,
-                            guest_handle_cast(u_domctl, void));
+        ret = paging_domctl(d, &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void), 0);
+        if ( ret == -EAGAIN )
+            return hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                                 "h", u_domctl);
         copyback = 1;
     }
     break;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3289604..0c04972 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3440,7 +3440,8 @@ static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 #define COMPAT_CALL(x)                                        \
@@ -3460,7 +3461,8 @@ static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 /* PVH 32bitfixme. */
@@ -3478,7 +3480,8 @@ static hvm_hypercall_t *const pvh_hypercall64_table[NR_hypercalls] = {
     [ __HYPERVISOR_physdev_op ]      = (hvm_hypercall_t *)hvm_physdev_op,
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
-    HYPERCALL(domctl)
+    HYPERCALL(domctl),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 int hvm_do_hypercall(struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ab5eacb..fb418fe 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -26,6 +26,7 @@
 #include <asm/shadow.h>
 #include <asm/p2m.h>
 #include <asm/hap.h>
+#include <asm/event.h>
 #include <asm/hvm/nestedhvm.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
@@ -116,26 +117,46 @@ static void paging_free_log_dirty_page(struct domain *d, mfn_t mfn)
     d->arch.paging.free_page(d, mfn_to_page(mfn));
 }
 
-void paging_free_log_dirty_bitmap(struct domain *d)
+static int paging_free_log_dirty_bitmap(struct domain *d, int rc)
 {
     mfn_t *l4, *l3, *l2;
     int i4, i3, i2;
 
+    paging_lock(d);
+
     if ( !mfn_valid(d->arch.paging.log_dirty.top) )
-        return;
+    {
+        paging_unlock(d);
+        return 0;
+    }
 
-    paging_lock(d);
+    if ( !d->arch.paging.preempt.dom )
+    {
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+        ASSERT(rc <= 0);
+        d->arch.paging.preempt.log_dirty.done = -rc;
+    }
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF )
+    {
+        paging_unlock(d);
+        return -EBUSY;
+    }
 
     l4 = map_domain_page(mfn_x(d->arch.paging.log_dirty.top));
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    rc = 0;
 
-    for ( i4 = 0; i4 < LOGDIRTY_NODE_ENTRIES; i4++ )
+    for ( ; i4 < LOGDIRTY_NODE_ENTRIES; i4++, i3 = 0 )
     {
         if ( !mfn_valid(l4[i4]) )
             continue;
 
         l3 = map_domain_page(mfn_x(l4[i4]));
 
-        for ( i3 = 0; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
+        for ( ; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
         {
             if ( !mfn_valid(l3[i3]) )
                 continue;
@@ -148,20 +169,54 @@ void paging_free_log_dirty_bitmap(struct domain *d)
 
             unmap_domain_page(l2);
             paging_free_log_dirty_page(d, l3[i3]);
+            l3[i3] = _mfn(INVALID_MFN);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                rc = -EAGAIN;
+                break;
+            }
         }
 
         unmap_domain_page(l3);
+        if ( rc )
+            break;
         paging_free_log_dirty_page(d, l4[i4]);
+        l4[i4] = _mfn(INVALID_MFN);
+
+        if ( i4 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            rc = -EAGAIN;
+            break;
+        }
     }
 
     unmap_domain_page(l4);
-    paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 
-    ASSERT(d->arch.paging.log_dirty.allocs == 0);
-    d->arch.paging.log_dirty.failed_allocs = 0;
+    if ( !rc )
+    {
+        paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
+        d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
+        ASSERT(d->arch.paging.log_dirty.allocs == 0);
+        d->arch.paging.log_dirty.failed_allocs = 0;
+
+        rc = -d->arch.paging.preempt.log_dirty.done;
+        d->arch.paging.preempt.dom = NULL;
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = XEN_DOMCTL_SHADOW_OP_OFF;
+    }
 
     paging_unlock(d);
+
+    return rc;
 }
 
 int paging_log_dirty_enable(struct domain *d, bool_t log_global)
@@ -178,15 +233,25 @@ int paging_log_dirty_enable(struct domain *d, bool_t log_global)
     return ret;
 }
 
-int paging_log_dirty_disable(struct domain *d)
+static int paging_log_dirty_disable(struct domain *d, bool_t resuming)
 {
-    int ret;
+    int ret = 1;
+
+    if ( !resuming )
+    {
+        domain_pause(d);
+        /* Safe because the domain is paused. */
+        if ( paging_mode_log_dirty(d) )
+        {
+            ret = d->arch.paging.log_dirty.disable_log_dirty(d);
+            ASSERT(ret <= 0);
+        }
+    }
+
+    ret = paging_free_log_dirty_bitmap(d, ret);
+    if ( ret == -EAGAIN )
+        return ret;
 
-    domain_pause(d);
-    /* Safe because the domain is paused. */
-    ret = d->arch.paging.log_dirty.disable_log_dirty(d);
-    if ( !paging_mode_log_dirty(d) )
-        paging_free_log_dirty_bitmap(d);
     domain_unpause(d);
 
     return ret;
@@ -326,7 +391,9 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn)
 
 /* Read a domain's log-dirty bitmap and stats.  If the operation is a CLEAN,
  * clear the bitmap and stats as well. */
-int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
+static int paging_log_dirty_op(struct domain *d,
+                               struct xen_domctl_shadow_op *sc,
+                               bool_t resuming)
 {
     int rv = 0, clean = 0, peek = 1;
     unsigned long pages = 0;
@@ -334,9 +401,22 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     unsigned long *l1 = NULL;
     int i4, i3, i2;
 
-    domain_pause(d);
+    if ( !resuming )
+        domain_pause(d);
     paging_lock(d);
 
+    if ( !d->arch.paging.preempt.dom )
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != sc->op )
+    {
+        paging_unlock(d);
+        ASSERT(!resuming);
+        domain_unpause(d);
+        return -EBUSY;
+    }
+
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
 
     PAGING_DEBUG(LOGDIRTY, "log-dirty %s: dom %u faults=%u dirty=%u\n",
@@ -348,12 +428,6 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
-    if ( clean )
-    {
-        d->arch.paging.log_dirty.fault_count = 0;
-        d->arch.paging.log_dirty.dirty_count = 0;
-    }
-
     if ( guest_handle_is_null(sc->dirty_bitmap) )
         /* caller may have wanted just to clean the state or access stats. */
         peek = 0;
@@ -365,17 +439,15 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
         goto out;
     }
 
-    pages = 0;
     l4 = paging_map_log_dirty_bitmap(d);
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    pages = d->arch.paging.preempt.log_dirty.done;
 
-    for ( i4 = 0;
-          (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    for ( ; (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES); i4++, i3 = 0 )
     {
         l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = 0;
-              (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
+        for ( ; (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES); i3++ )
         {
             l2 = ((l3 && mfn_valid(l3[i3])) ?
                   map_domain_page(mfn_x(l3[i3])) : NULL);
@@ -410,18 +482,58 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
             }
             if ( l2 )
                 unmap_domain_page(l2);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                rv = -EAGAIN;
+                break;
+            }
         }
         if ( l3 )
             unmap_domain_page(l3);
+
+        if ( !rv && i4 < LOGDIRTY_NODE_ENTRIES - 1 &&
+             hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            rv = -EAGAIN;
+        }
+        if ( rv )
+            break;
     }
     if ( l4 )
         unmap_domain_page(l4);
 
-    if ( pages < sc->pages )
-        sc->pages = pages;
+    if ( !rv )
+    {
+        d->arch.paging.preempt.dom = NULL;
+        if ( clean )
+        {
+            d->arch.paging.log_dirty.fault_count = 0;
+            d->arch.paging.log_dirty.dirty_count = 0;
+        }
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = sc->op;
+        d->arch.paging.preempt.log_dirty.done = pages;
+    }
 
     paging_unlock(d);
 
+    if ( rv )
+    {
+        /* Never leave the domain paused on real errors. */
+        ASSERT(rv == -EAGAIN);
+        return rv;
+    }
+
+    if ( pages < sc->pages )
+        sc->pages = pages;
     if ( clean )
     {
         /* We need to further call clean_dirty_bitmap() functions of specific
@@ -432,6 +544,7 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     return rv;
 
  out:
+    d->arch.paging.preempt.dom = NULL;
     paging_unlock(d);
     domain_unpause(d);
 
@@ -499,12 +612,6 @@ void paging_log_dirty_init(struct domain *d,
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
 }
 
-/* This function fress log dirty bitmap resources. */
-static void paging_log_dirty_teardown(struct domain*d)
-{
-    paging_free_log_dirty_bitmap(d);
-}
-
 /************************************************/
 /*           CODE FOR PAGING SUPPORT            */
 /************************************************/
@@ -546,7 +653,7 @@ void paging_vcpu_init(struct vcpu *v)
 
 
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming)
 {
     int rc;
 
@@ -570,6 +677,21 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
+    if ( resuming
+         ? (d->arch.paging.preempt.dom != current->domain ||
+            d->arch.paging.preempt.op != sc->op)
+         : (d->arch.paging.preempt.dom &&
+            sc->op != XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION) )
+    {
+        printk(XENLOG_G_DEBUG
+               "d%d:v%d: Paging op %#x on Dom%u with unfinished prior op %#x by Dom%u\n",
+               current->domain->domain_id, current->vcpu_id,
+               sc->op, d->domain_id, d->arch.paging.preempt.op,
+               d->arch.paging.preempt.dom
+               ? d->arch.paging.preempt.dom->domain_id : DOMID_INVALID);
+        return -EBUSY;
+    }
+
     rc = xsm_shadow_control(XSM_HOOK, d, sc->op);
     if ( rc )
         return rc;
@@ -594,14 +716,13 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return paging_log_dirty_enable(d, 1);
 
     case XEN_DOMCTL_SHADOW_OP_OFF:
-        if ( paging_mode_log_dirty(d) )
-            if ( (rc = paging_log_dirty_disable(d)) != 0 )
-                return rc;
+        if ( (rc = paging_log_dirty_disable(d, resuming)) != 0 )
+            return rc;
         break;
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
     case XEN_DOMCTL_SHADOW_OP_PEEK:
-        return paging_log_dirty_op(d, sc);
+        return paging_log_dirty_op(d, sc, resuming);
     }
 
     /* Here, dispatch domctl to the appropriate paging code */
@@ -611,19 +732,67 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return shadow_domctl(d, sc, u_domctl);
 }
 
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
+{
+    struct xen_domctl op;
+    struct domain *d;
+    int ret;
+
+    if ( copy_from_guest(&op, u_domctl, 1) )
+        return -EFAULT;
+
+    if ( op.interface_version != XEN_DOMCTL_INTERFACE_VERSION ||
+         op.cmd != XEN_DOMCTL_shadow_op )
+        return -EBADRQC;
+
+    d = rcu_lock_domain_by_id(op.domain);
+    if ( d == NULL )
+        return -ESRCH;
+
+    ret = xsm_domctl(XSM_OTHER, d, op.cmd);
+    if ( !ret )
+    {
+        if ( domctl_lock_acquire() )
+        {
+            ret = paging_domctl(d, &op.u.shadow_op,
+                                guest_handle_cast(u_domctl, void), 1);
+
+            domctl_lock_release();
+        }
+        else
+            ret = -EAGAIN;
+    }
+
+    rcu_unlock_domain(d);
+
+    if ( ret == -EAGAIN )
+        ret = hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                            "h", u_domctl);
+    else if ( __copy_field_to_guest(u_domctl, &op, u.shadow_op) )
+        ret = -EFAULT;
+
+    return ret;
+}
+
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d)
+int paging_teardown(struct domain *d)
 {
+    int rc;
+
     if ( hap_enabled(d) )
         hap_teardown(d);
     else
         shadow_teardown(d);
 
     /* clean up log dirty resources. */
-    paging_log_dirty_teardown(d);
+    rc = paging_free_log_dirty_bitmap(d, 0);
+    if ( rc == -EAGAIN )
+        return rc;
 
     /* Move populate-on-demand cache back to domain_list for destruction */
     p2m_pod_empty_cache(d);
+
+    return rc;
 }
 
 /* Call once all of the references to the domain have gone away */
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 594b0b9..94f5b8d 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -420,6 +420,7 @@ ENTRY(compat_hypercall_table)
         .quad compat_ni_hypercall
         .endr
         .quad do_mca                    /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-compat_hypercall_table)/8)
         .quad compat_ni_hypercall
         .endr
@@ -468,6 +469,7 @@ ENTRY(compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
         .byte 1 /* do_mca                   */
+        .byte 1 /* paging_domctl_continuation      */
         .rept NR_hypercalls-(.-compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 3ea4683..c634217 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -761,6 +761,7 @@ ENTRY(hypercall_table)
         .quad do_ni_hypercall
         .endr
         .quad do_mca                /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-hypercall_table)/8)
         .quad do_ni_hypercall
         .endr
@@ -809,6 +810,7 @@ ENTRY(hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
         .byte 1 /* do_mca               */  /* 48 */
+        .byte 1 /* paging_domctl_continuation */
         .rept NR_hypercalls-(.-hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 1308193..f050af5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -536,7 +536,6 @@ int domain_kill(struct domain *d)
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
         {
-            BUG_ON(rc != -EAGAIN);
             break;
         }
         if ( sched_move_domain(d, cpupool0) )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 4ff89f0..7dfbbcb 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -186,6 +186,20 @@ struct paging_domain {
     struct hap_domain       hap;
     /* log dirty support */
     struct log_dirty_domain log_dirty;
+
+    /* preemption handling */
+    struct {
+        const struct domain *dom;
+        unsigned int op;
+        union {
+            struct {
+                unsigned long done:PADDR_BITS - PAGE_SHIFT;
+                unsigned long i4:PAGETABLE_ORDER;
+                unsigned long i3:PAGETABLE_ORDER;
+            } log_dirty;
+        };
+    } preempt;
+
     /* alloc/free pages from the pool for paging-assistance structures
      * (used by p2m and log-dirty code for their tries) */
     struct page_info * (*alloc_page)(struct domain *d);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 8dd2a61..0a7c73c 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -133,9 +133,6 @@ struct paging_mode {
 /*****************************************************************************
  * Log dirty code */
 
-/* free log dirty bitmap resource */
-void paging_free_log_dirty_bitmap(struct domain *d);
-
 /* get the dirty bitmap for a specific range of pfns */
 void paging_log_dirty_range(struct domain *d,
                             unsigned long begin_pfn,
@@ -145,9 +142,6 @@ void paging_log_dirty_range(struct domain *d,
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d, bool_t log_global);
 
-/* disable log dirty */
-int paging_log_dirty_disable(struct domain *d);
-
 /* log dirty initialization */
 void paging_log_dirty_init(struct domain *d,
                            int  (*enable_log_dirty)(struct domain *d,
@@ -204,10 +198,13 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags);
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming);
+
+/* Helper hypercall for dealing with continuations. */
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d);
+int paging_teardown(struct domain *d);
 
 /* Call once all of the references to the domain have gone away */
 void paging_final_teardown(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 13:45:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 13:45:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjTYz-0002EM-8s; Wed, 29 Oct 2014 13:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYx-0002Dy-VQ
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:24 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	B6/96-13367-37FE0545; Wed, 29 Oct 2014 13:45:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1414590320!11787099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22156 invoked from network); 29 Oct 2014 13:45:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 13:45:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYu-0001VY-97
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjTYu-0007tY-74
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 13:45:20 +0000
Date: Wed, 29 Oct 2014 13:45:20 +0000
Message-Id: <E1XjTYu-0007tY-74@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/paging: make log-dirty
	operations preemptible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c8ed54edda001163a5ff7610424dd2ef4244e8d6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 17 15:57:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 17 15:57:42 2014 +0200

    x86/paging: make log-dirty operations preemptible
    
    Both the freeing and the inspection of the bitmap get done in (nested)
    loops which - besides having a rather high iteration count in general,
    albeit that would be covered by XSA-77 - have the number of non-trivial
    iterations they need to perform (indirectly) controllable by both the
    guest they are for and any domain controlling the guest (including the
    one running qemu for it).
    
    Note that the tying of the continuations to the invoking domain (which
    previously [wrongly] used the invoking vCPU instead) implies that the
    tools requesting such operations have to make sure they don't issue
    multiple similar operations in parallel.
    
    Note further that this breaks supervisor-mode kernel assumptions in
    hypercall_create_continuation() (where regs->eip gets rewound to the
    current hypercall stub beginning), but otoh
    hypercall_cancel_continuation() doesn't work in that mode either.
    Perhaps time to rip out all the remains of that feature?
    
    This is part of CVE-2014-5146 / XSA-97.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 070493dfd2788e061b53f074b7ba97507fbcbf65
    master date: 2014-10-06 11:22:04 +0200
---
 xen/arch/x86/domain.c              |    4 +-
 xen/arch/x86/domctl.c              |    8 +-
 xen/arch/x86/hvm/hvm.c             |    9 +-
 xen/arch/x86/mm/paging.c           |  261 +++++++++++++++++++++++++++++-------
 xen/arch/x86/x86_64/compat/entry.S |    2 +
 xen/arch/x86/x86_64/entry.S        |    2 +
 xen/common/domain.c                |    1 -
 xen/include/asm-x86/domain.h       |   14 ++
 xen/include/asm-x86/paging.h       |   13 +-
 9 files changed, 252 insertions(+), 62 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 195b07f..789e4a0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1915,7 +1915,9 @@ int domain_relinquish_resources(struct domain *d)
         pci_release_devices(d);
 
         /* Tear down paging-assistance stuff. */
-        paging_teardown(d);
+        ret = paging_teardown(d);
+        if ( ret )
+            return ret;
 
         /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index a967b65..f5e9e2c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -58,9 +58,11 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        ret = paging_domctl(d,
-                            &domctl->u.shadow_op,
-                            guest_handle_cast(u_domctl, void));
+        ret = paging_domctl(d, &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void), 0);
+        if ( ret == -EAGAIN )
+            return hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                                 "h", u_domctl);
         copyback = 1;
     }
     break;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3289604..0c04972 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3440,7 +3440,8 @@ static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 #define COMPAT_CALL(x)                                        \
@@ -3460,7 +3461,8 @@ static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
     HYPERCALL(domctl),
-    HYPERCALL(tmem_op)
+    HYPERCALL(tmem_op),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 /* PVH 32bitfixme. */
@@ -3478,7 +3480,8 @@ static hvm_hypercall_t *const pvh_hypercall64_table[NR_hypercalls] = {
     [ __HYPERVISOR_physdev_op ]      = (hvm_hypercall_t *)hvm_physdev_op,
     HYPERCALL(hvm_op),
     HYPERCALL(sysctl),
-    HYPERCALL(domctl)
+    HYPERCALL(domctl),
+    [ __HYPERVISOR_arch_1 ] = (hvm_hypercall_t *)paging_domctl_continuation
 };
 
 int hvm_do_hypercall(struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index ab5eacb..fb418fe 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -26,6 +26,7 @@
 #include <asm/shadow.h>
 #include <asm/p2m.h>
 #include <asm/hap.h>
+#include <asm/event.h>
 #include <asm/hvm/nestedhvm.h>
 #include <xen/numa.h>
 #include <xsm/xsm.h>
@@ -116,26 +117,46 @@ static void paging_free_log_dirty_page(struct domain *d, mfn_t mfn)
     d->arch.paging.free_page(d, mfn_to_page(mfn));
 }
 
-void paging_free_log_dirty_bitmap(struct domain *d)
+static int paging_free_log_dirty_bitmap(struct domain *d, int rc)
 {
     mfn_t *l4, *l3, *l2;
     int i4, i3, i2;
 
+    paging_lock(d);
+
     if ( !mfn_valid(d->arch.paging.log_dirty.top) )
-        return;
+    {
+        paging_unlock(d);
+        return 0;
+    }
 
-    paging_lock(d);
+    if ( !d->arch.paging.preempt.dom )
+    {
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+        ASSERT(rc <= 0);
+        d->arch.paging.preempt.log_dirty.done = -rc;
+    }
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF )
+    {
+        paging_unlock(d);
+        return -EBUSY;
+    }
 
     l4 = map_domain_page(mfn_x(d->arch.paging.log_dirty.top));
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    rc = 0;
 
-    for ( i4 = 0; i4 < LOGDIRTY_NODE_ENTRIES; i4++ )
+    for ( ; i4 < LOGDIRTY_NODE_ENTRIES; i4++, i3 = 0 )
     {
         if ( !mfn_valid(l4[i4]) )
             continue;
 
         l3 = map_domain_page(mfn_x(l4[i4]));
 
-        for ( i3 = 0; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
+        for ( ; i3 < LOGDIRTY_NODE_ENTRIES; i3++ )
         {
             if ( !mfn_valid(l3[i3]) )
                 continue;
@@ -148,20 +169,54 @@ void paging_free_log_dirty_bitmap(struct domain *d)
 
             unmap_domain_page(l2);
             paging_free_log_dirty_page(d, l3[i3]);
+            l3[i3] = _mfn(INVALID_MFN);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                rc = -EAGAIN;
+                break;
+            }
         }
 
         unmap_domain_page(l3);
+        if ( rc )
+            break;
         paging_free_log_dirty_page(d, l4[i4]);
+        l4[i4] = _mfn(INVALID_MFN);
+
+        if ( i4 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            rc = -EAGAIN;
+            break;
+        }
     }
 
     unmap_domain_page(l4);
-    paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 
-    ASSERT(d->arch.paging.log_dirty.allocs == 0);
-    d->arch.paging.log_dirty.failed_allocs = 0;
+    if ( !rc )
+    {
+        paging_free_log_dirty_page(d, d->arch.paging.log_dirty.top);
+        d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
+        ASSERT(d->arch.paging.log_dirty.allocs == 0);
+        d->arch.paging.log_dirty.failed_allocs = 0;
+
+        rc = -d->arch.paging.preempt.log_dirty.done;
+        d->arch.paging.preempt.dom = NULL;
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = XEN_DOMCTL_SHADOW_OP_OFF;
+    }
 
     paging_unlock(d);
+
+    return rc;
 }
 
 int paging_log_dirty_enable(struct domain *d, bool_t log_global)
@@ -178,15 +233,25 @@ int paging_log_dirty_enable(struct domain *d, bool_t log_global)
     return ret;
 }
 
-int paging_log_dirty_disable(struct domain *d)
+static int paging_log_dirty_disable(struct domain *d, bool_t resuming)
 {
-    int ret;
+    int ret = 1;
+
+    if ( !resuming )
+    {
+        domain_pause(d);
+        /* Safe because the domain is paused. */
+        if ( paging_mode_log_dirty(d) )
+        {
+            ret = d->arch.paging.log_dirty.disable_log_dirty(d);
+            ASSERT(ret <= 0);
+        }
+    }
+
+    ret = paging_free_log_dirty_bitmap(d, ret);
+    if ( ret == -EAGAIN )
+        return ret;
 
-    domain_pause(d);
-    /* Safe because the domain is paused. */
-    ret = d->arch.paging.log_dirty.disable_log_dirty(d);
-    if ( !paging_mode_log_dirty(d) )
-        paging_free_log_dirty_bitmap(d);
     domain_unpause(d);
 
     return ret;
@@ -326,7 +391,9 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn)
 
 /* Read a domain's log-dirty bitmap and stats.  If the operation is a CLEAN,
  * clear the bitmap and stats as well. */
-int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
+static int paging_log_dirty_op(struct domain *d,
+                               struct xen_domctl_shadow_op *sc,
+                               bool_t resuming)
 {
     int rv = 0, clean = 0, peek = 1;
     unsigned long pages = 0;
@@ -334,9 +401,22 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     unsigned long *l1 = NULL;
     int i4, i3, i2;
 
-    domain_pause(d);
+    if ( !resuming )
+        domain_pause(d);
     paging_lock(d);
 
+    if ( !d->arch.paging.preempt.dom )
+        memset(&d->arch.paging.preempt.log_dirty, 0,
+               sizeof(d->arch.paging.preempt.log_dirty));
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != sc->op )
+    {
+        paging_unlock(d);
+        ASSERT(!resuming);
+        domain_unpause(d);
+        return -EBUSY;
+    }
+
     clean = (sc->op == XEN_DOMCTL_SHADOW_OP_CLEAN);
 
     PAGING_DEBUG(LOGDIRTY, "log-dirty %s: dom %u faults=%u dirty=%u\n",
@@ -348,12 +428,6 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     sc->stats.fault_count = d->arch.paging.log_dirty.fault_count;
     sc->stats.dirty_count = d->arch.paging.log_dirty.dirty_count;
 
-    if ( clean )
-    {
-        d->arch.paging.log_dirty.fault_count = 0;
-        d->arch.paging.log_dirty.dirty_count = 0;
-    }
-
     if ( guest_handle_is_null(sc->dirty_bitmap) )
         /* caller may have wanted just to clean the state or access stats. */
         peek = 0;
@@ -365,17 +439,15 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
         goto out;
     }
 
-    pages = 0;
     l4 = paging_map_log_dirty_bitmap(d);
+    i4 = d->arch.paging.preempt.log_dirty.i4;
+    i3 = d->arch.paging.preempt.log_dirty.i3;
+    pages = d->arch.paging.preempt.log_dirty.done;
 
-    for ( i4 = 0;
-          (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
+    for ( ; (pages < sc->pages) && (i4 < LOGDIRTY_NODE_ENTRIES); i4++, i3 = 0 )
     {
         l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = 0;
-              (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
+        for ( ; (pages < sc->pages) && (i3 < LOGDIRTY_NODE_ENTRIES); i3++ )
         {
             l2 = ((l3 && mfn_valid(l3[i3])) ?
                   map_domain_page(mfn_x(l3[i3])) : NULL);
@@ -410,18 +482,58 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
             }
             if ( l2 )
                 unmap_domain_page(l2);
+
+            if ( i3 < LOGDIRTY_NODE_ENTRIES - 1 && hypercall_preempt_check() )
+            {
+                d->arch.paging.preempt.log_dirty.i4 = i4;
+                d->arch.paging.preempt.log_dirty.i3 = i3 + 1;
+                rv = -EAGAIN;
+                break;
+            }
         }
         if ( l3 )
             unmap_domain_page(l3);
+
+        if ( !rv && i4 < LOGDIRTY_NODE_ENTRIES - 1 &&
+             hypercall_preempt_check() )
+        {
+            d->arch.paging.preempt.log_dirty.i4 = i4 + 1;
+            d->arch.paging.preempt.log_dirty.i3 = 0;
+            rv = -EAGAIN;
+        }
+        if ( rv )
+            break;
     }
     if ( l4 )
         unmap_domain_page(l4);
 
-    if ( pages < sc->pages )
-        sc->pages = pages;
+    if ( !rv )
+    {
+        d->arch.paging.preempt.dom = NULL;
+        if ( clean )
+        {
+            d->arch.paging.log_dirty.fault_count = 0;
+            d->arch.paging.log_dirty.dirty_count = 0;
+        }
+    }
+    else
+    {
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = sc->op;
+        d->arch.paging.preempt.log_dirty.done = pages;
+    }
 
     paging_unlock(d);
 
+    if ( rv )
+    {
+        /* Never leave the domain paused on real errors. */
+        ASSERT(rv == -EAGAIN);
+        return rv;
+    }
+
+    if ( pages < sc->pages )
+        sc->pages = pages;
     if ( clean )
     {
         /* We need to further call clean_dirty_bitmap() functions of specific
@@ -432,6 +544,7 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
     return rv;
 
  out:
+    d->arch.paging.preempt.dom = NULL;
     paging_unlock(d);
     domain_unpause(d);
 
@@ -499,12 +612,6 @@ void paging_log_dirty_init(struct domain *d,
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
 }
 
-/* This function fress log dirty bitmap resources. */
-static void paging_log_dirty_teardown(struct domain*d)
-{
-    paging_free_log_dirty_bitmap(d);
-}
-
 /************************************************/
 /*           CODE FOR PAGING SUPPORT            */
 /************************************************/
@@ -546,7 +653,7 @@ void paging_vcpu_init(struct vcpu *v)
 
 
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl)
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming)
 {
     int rc;
 
@@ -570,6 +677,21 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return -EINVAL;
     }
 
+    if ( resuming
+         ? (d->arch.paging.preempt.dom != current->domain ||
+            d->arch.paging.preempt.op != sc->op)
+         : (d->arch.paging.preempt.dom &&
+            sc->op != XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION) )
+    {
+        printk(XENLOG_G_DEBUG
+               "d%d:v%d: Paging op %#x on Dom%u with unfinished prior op %#x by Dom%u\n",
+               current->domain->domain_id, current->vcpu_id,
+               sc->op, d->domain_id, d->arch.paging.preempt.op,
+               d->arch.paging.preempt.dom
+               ? d->arch.paging.preempt.dom->domain_id : DOMID_INVALID);
+        return -EBUSY;
+    }
+
     rc = xsm_shadow_control(XSM_HOOK, d, sc->op);
     if ( rc )
         return rc;
@@ -594,14 +716,13 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return paging_log_dirty_enable(d, 1);
 
     case XEN_DOMCTL_SHADOW_OP_OFF:
-        if ( paging_mode_log_dirty(d) )
-            if ( (rc = paging_log_dirty_disable(d)) != 0 )
-                return rc;
+        if ( (rc = paging_log_dirty_disable(d, resuming)) != 0 )
+            return rc;
         break;
 
     case XEN_DOMCTL_SHADOW_OP_CLEAN:
     case XEN_DOMCTL_SHADOW_OP_PEEK:
-        return paging_log_dirty_op(d, sc);
+        return paging_log_dirty_op(d, sc, resuming);
     }
 
     /* Here, dispatch domctl to the appropriate paging code */
@@ -611,19 +732,67 @@ int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
         return shadow_domctl(d, sc, u_domctl);
 }
 
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
+{
+    struct xen_domctl op;
+    struct domain *d;
+    int ret;
+
+    if ( copy_from_guest(&op, u_domctl, 1) )
+        return -EFAULT;
+
+    if ( op.interface_version != XEN_DOMCTL_INTERFACE_VERSION ||
+         op.cmd != XEN_DOMCTL_shadow_op )
+        return -EBADRQC;
+
+    d = rcu_lock_domain_by_id(op.domain);
+    if ( d == NULL )
+        return -ESRCH;
+
+    ret = xsm_domctl(XSM_OTHER, d, op.cmd);
+    if ( !ret )
+    {
+        if ( domctl_lock_acquire() )
+        {
+            ret = paging_domctl(d, &op.u.shadow_op,
+                                guest_handle_cast(u_domctl, void), 1);
+
+            domctl_lock_release();
+        }
+        else
+            ret = -EAGAIN;
+    }
+
+    rcu_unlock_domain(d);
+
+    if ( ret == -EAGAIN )
+        ret = hypercall_create_continuation(__HYPERVISOR_arch_1,
+                                            "h", u_domctl);
+    else if ( __copy_field_to_guest(u_domctl, &op, u.shadow_op) )
+        ret = -EFAULT;
+
+    return ret;
+}
+
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d)
+int paging_teardown(struct domain *d)
 {
+    int rc;
+
     if ( hap_enabled(d) )
         hap_teardown(d);
     else
         shadow_teardown(d);
 
     /* clean up log dirty resources. */
-    paging_log_dirty_teardown(d);
+    rc = paging_free_log_dirty_bitmap(d, 0);
+    if ( rc == -EAGAIN )
+        return rc;
 
     /* Move populate-on-demand cache back to domain_list for destruction */
     p2m_pod_empty_cache(d);
+
+    return rc;
 }
 
 /* Call once all of the references to the domain have gone away */
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 594b0b9..94f5b8d 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -420,6 +420,7 @@ ENTRY(compat_hypercall_table)
         .quad compat_ni_hypercall
         .endr
         .quad do_mca                    /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-compat_hypercall_table)/8)
         .quad compat_ni_hypercall
         .endr
@@ -468,6 +469,7 @@ ENTRY(compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
         .byte 1 /* do_mca                   */
+        .byte 1 /* paging_domctl_continuation      */
         .rept NR_hypercalls-(.-compat_hypercall_args_table)
         .byte 0 /* compat_ni_hypercall      */
         .endr
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 3ea4683..c634217 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -761,6 +761,7 @@ ENTRY(hypercall_table)
         .quad do_ni_hypercall
         .endr
         .quad do_mca                /* 48 */
+        .quad paging_domctl_continuation
         .rept NR_hypercalls-((.-hypercall_table)/8)
         .quad do_ni_hypercall
         .endr
@@ -809,6 +810,7 @@ ENTRY(hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
         .byte 1 /* do_mca               */  /* 48 */
+        .byte 1 /* paging_domctl_continuation */
         .rept NR_hypercalls-(.-hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 1308193..f050af5 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -536,7 +536,6 @@ int domain_kill(struct domain *d)
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
         {
-            BUG_ON(rc != -EAGAIN);
             break;
         }
         if ( sched_move_domain(d, cpupool0) )
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 4ff89f0..7dfbbcb 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -186,6 +186,20 @@ struct paging_domain {
     struct hap_domain       hap;
     /* log dirty support */
     struct log_dirty_domain log_dirty;
+
+    /* preemption handling */
+    struct {
+        const struct domain *dom;
+        unsigned int op;
+        union {
+            struct {
+                unsigned long done:PADDR_BITS - PAGE_SHIFT;
+                unsigned long i4:PAGETABLE_ORDER;
+                unsigned long i3:PAGETABLE_ORDER;
+            } log_dirty;
+        };
+    } preempt;
+
     /* alloc/free pages from the pool for paging-assistance structures
      * (used by p2m and log-dirty code for their tries) */
     struct page_info * (*alloc_page)(struct domain *d);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 8dd2a61..0a7c73c 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -133,9 +133,6 @@ struct paging_mode {
 /*****************************************************************************
  * Log dirty code */
 
-/* free log dirty bitmap resource */
-void paging_free_log_dirty_bitmap(struct domain *d);
-
 /* get the dirty bitmap for a specific range of pfns */
 void paging_log_dirty_range(struct domain *d,
                             unsigned long begin_pfn,
@@ -145,9 +142,6 @@ void paging_log_dirty_range(struct domain *d,
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d, bool_t log_global);
 
-/* disable log dirty */
-int paging_log_dirty_disable(struct domain *d);
-
 /* log dirty initialization */
 void paging_log_dirty_init(struct domain *d,
                            int  (*enable_log_dirty)(struct domain *d,
@@ -204,10 +198,13 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags);
  * and disable ephemeral shadow modes (test mode and log-dirty mode) and
  * manipulate the log-dirty bitmap. */
 int paging_domctl(struct domain *d, xen_domctl_shadow_op_t *sc,
-                  XEN_GUEST_HANDLE_PARAM(void) u_domctl);
+                  XEN_GUEST_HANDLE_PARAM(void) u_domctl, bool_t resuming);
+
+/* Helper hypercall for dealing with continuations. */
+long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 /* Call when destroying a domain */
-void paging_teardown(struct domain *d);
+int paging_teardown(struct domain *d);
 
 /* Call once all of the references to the domain have gone away */
 void paging_final_teardown(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Oct 29 19:22:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 19:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjYoo-0001Rl-RG; Wed, 29 Oct 2014 19:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjYon-0001Rf-0g
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 19:22:05 +0000
Content-Length: 4037
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	98/BE-02954-C5E31545; Wed, 29 Oct 2014 19:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1414610522!13320708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 827 invoked from network); 29 Oct 2014 19:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 19:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjYok-0005cq-DT
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 19:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjYok-0003KT-6Q
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 19:22:02 +0000
Date: Wed, 29 Oct 2014 19:22:02 +0000
Message-Id: <E1XjYok-0003KT-6Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] block: char devices on
	FreeBSD are not behind a pager
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5354755932201687306=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5354755932201687306==
Content-Length: 3680
Content-Transfer-Encoding: quoted-printable

commit ca78cc83650b535d7e24baeaea32947be0141534
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 16:03:03 2014 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 27 15:16:20 2014 +0000

    block: char devices on FreeBSD are not behind a pager
    
    Introduce a new flag to mark devices that require requests to be aligned and
    replace the usage of BDRV_O_NOCACHE and O_DIRECT with this flag when
    appropriate.
    
    If a character device is used as a backend on a FreeBSD host set this flag
    unconditionally.
    
    upstream-commit-id: 3cad83075c7b847fe0eb6e61316fdf50984d4570
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Cc: Kevin Wolf <kwolf@redhat.com>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 block/raw-posix.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 1688e16..474cc42 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -146,6 +146,7 @@ typedef struct BDRVRawState {
     bool has_discard:1;
     bool has_write_zeroes:1;
     bool discard_zeroes:1;
+    bool needs_alignment;
 } BDRVRawState;
 
 typedef struct BDRVRawReopenState {
@@ -223,7 +224,7 @@ static void raw_probe_alignment(BlockDriverState *bs)
 
     /* For /dev/sg devices the alignment is not really used.
        With buffered I/O, we don't have any restrictions. */
-    if (bs->sg || !(s->open_flags & O_DIRECT)) {
+    if (bs->sg || !s->needs_alignment) {
         bs->request_alignment =3D 1;
         s->buf_align =3D 1;
         return;
@@ -411,6 +412,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
 
     s->has_discard =3D true;
     s->has_write_zeroes =3D true;
+    if ((bs->open_flags & BDRV_O_NOCACHE) !=3D 0) {
+        s->needs_alignment =3D true;
+    }
 
     if (fstat(s->fd, &st) < 0) {
         error_setg_errno(errp, errno, "Could not stat file");
@@ -437,6 +441,17 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
         }
 #endif
     }
+#ifdef __FreeBSD__
+    if (S_ISCHR(st.st_mode)) {
+        /*
+         * The file is a char device (disk), which on FreeBSD isn't behind
+         * a pager, so force all requests to be aligned. This is needed
+         * so QEMU makes sure all IO operations on the device are aligned
+         * to sector size, or else FreeBSD will reject them with EINVAL.
+         */
+        s->needs_alignment =3D true;
+    }
+#endif
 
 #ifdef CONFIG_XFS
     if (platform_test_xfs_fd(s->fd)) {
@@ -1004,11 +1019,12 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,
         return NULL;
 
     /*
-     * If O_DIRECT is used the buffer needs to be aligned on a sector
-     * boundary.  Check if this is the case or tell the low-level
-     * driver that it needs to copy the buffer.
+     * Check if the underlying device requires requests to be aligned,
+     * and if the request we are trying to submit is aligned or not.
+     * If this is the case tell the low-level driver that it needs
+     * to copy the buffer.
      */
-    if ((bs->open_flags & BDRV_O_NOCACHE)) {
+    if (s->needs_alignment) {
         if (!bdrv_qiov_is_aligned(bs, qiov)) {
             type |=3D QEMU_AIO_MISALIGNED;
 #ifdef CONFIG_LINUX_AIO
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============5354755932201687306==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============5354755932201687306==--

From xen-changelog-bounces@lists.xen.org Wed Oct 29 19:22:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2014 19:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjYoo-0001Rl-RG; Wed, 29 Oct 2014 19:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjYon-0001Rf-0g
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 19:22:05 +0000
Content-Length: 4037
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	98/BE-02954-C5E31545; Wed, 29 Oct 2014 19:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1414610522!13320708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 827 invoked from network); 29 Oct 2014 19:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Oct 2014 19:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjYok-0005cq-DT
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 19:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjYok-0003KT-6Q
	for xen-changelog@lists.xensource.com; Wed, 29 Oct 2014 19:22:02 +0000
Date: Wed, 29 Oct 2014 19:22:02 +0000
Message-Id: <E1XjYok-0003KT-6Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] block: char devices on
	FreeBSD are not behind a pager
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5354755932201687306=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5354755932201687306==
Content-Length: 3680
Content-Transfer-Encoding: quoted-printable

commit ca78cc83650b535d7e24baeaea32947be0141534
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 16:03:03 2014 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Oct 27 15:16:20 2014 +0000

    block: char devices on FreeBSD are not behind a pager
    
    Introduce a new flag to mark devices that require requests to be aligned and
    replace the usage of BDRV_O_NOCACHE and O_DIRECT with this flag when
    appropriate.
    
    If a character device is used as a backend on a FreeBSD host set this flag
    unconditionally.
    
    upstream-commit-id: 3cad83075c7b847fe0eb6e61316fdf50984d4570
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Cc: Kevin Wolf <kwolf@redhat.com>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 block/raw-posix.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 1688e16..474cc42 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -146,6 +146,7 @@ typedef struct BDRVRawState {
     bool has_discard:1;
     bool has_write_zeroes:1;
     bool discard_zeroes:1;
+    bool needs_alignment;
 } BDRVRawState;
 
 typedef struct BDRVRawReopenState {
@@ -223,7 +224,7 @@ static void raw_probe_alignment(BlockDriverState *bs)
 
     /* For /dev/sg devices the alignment is not really used.
        With buffered I/O, we don't have any restrictions. */
-    if (bs->sg || !(s->open_flags & O_DIRECT)) {
+    if (bs->sg || !s->needs_alignment) {
         bs->request_alignment =3D 1;
         s->buf_align =3D 1;
         return;
@@ -411,6 +412,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
 
     s->has_discard =3D true;
     s->has_write_zeroes =3D true;
+    if ((bs->open_flags & BDRV_O_NOCACHE) !=3D 0) {
+        s->needs_alignment =3D true;
+    }
 
     if (fstat(s->fd, &st) < 0) {
         error_setg_errno(errp, errno, "Could not stat file");
@@ -437,6 +441,17 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
         }
 #endif
     }
+#ifdef __FreeBSD__
+    if (S_ISCHR(st.st_mode)) {
+        /*
+         * The file is a char device (disk), which on FreeBSD isn't behind
+         * a pager, so force all requests to be aligned. This is needed
+         * so QEMU makes sure all IO operations on the device are aligned
+         * to sector size, or else FreeBSD will reject them with EINVAL.
+         */
+        s->needs_alignment =3D true;
+    }
+#endif
 
 #ifdef CONFIG_XFS
     if (platform_test_xfs_fd(s->fd)) {
@@ -1004,11 +1019,12 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,
         return NULL;
 
     /*
-     * If O_DIRECT is used the buffer needs to be aligned on a sector
-     * boundary.  Check if this is the case or tell the low-level
-     * driver that it needs to copy the buffer.
+     * Check if the underlying device requires requests to be aligned,
+     * and if the request we are trying to submit is aligned or not.
+     * If this is the case tell the low-level driver that it needs
+     * to copy the buffer.
      */
-    if ((bs->open_flags & BDRV_O_NOCACHE)) {
+    if (s->needs_alignment) {
         if (!bdrv_qiov_is_aligned(bs, qiov)) {
             type |=3D QEMU_AIO_MISALIGNED;
 #ifdef CONFIG_LINUX_AIO
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============5354755932201687306==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============5354755932201687306==--

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjll7-0007Gh-9M; Thu, 30 Oct 2014 09:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjll5-0007GS-QH
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:07 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	B7/DE-11509-BA002545; Thu, 30 Oct 2014 09:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1414660264!10934125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12478 invoked from network); 30 Oct 2014 09:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjll2-0005eJ-Gf
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjll2-0000RR-AT
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:04 +0000
Date: Thu, 30 Oct 2014 09:11:04 +0000
Message-Id: <E1Xjll2-0000RR-AT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/setup: correct register clobbers
	for the asm statement when resyncing the stack
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d3a7bcd0b1181c9dc0fb04ef3abdfcdb5f20441
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 10:18:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:18:29 2014 +0200

    x86/setup: correct register clobbers for the asm statement when resyncing the stack
    
    When resyncing the stack, the asm statement does not identify %rsi, %rdi and
    %rcx as clobbered by the 'rep movsq'.
    
    Luckily, there are no functional problems in the generated code.  GCC decides
    not to save any of them before calling boostrap_map(), which clobbers them.
    
    Correct the clobbers, by listing them as earlyclobber discarded outputs.
    
    Reported-by: Daniel Kiper <daniel.kiper@oracle.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
    Tested-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/arch/x86/setup.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index bfbb310..73e95c6 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -902,11 +902,13 @@ void __init noreturn __start_xen(unsigned long mbi_p)
                 "movq %%cr4,%%rsi ; "
                 "andb $0x7f,%%sil ; "
                 "movq %%rsi,%%cr4 ; " /* CR4.PGE == 0 */
-                "movq %0,%%cr3    ; " /* CR3 == new pagetables */
+                "movq %[pg],%%cr3 ; " /* CR3 == new pagetables */
                 "orb $0x80,%%sil  ; "
                 "movq %%rsi,%%cr4   " /* CR4.PGE == 1 */
-                : : "r" (__pa(idle_pg_table)), "S" (cpu0_stack),
-                "D" (__va(__pa(cpu0_stack))), "c" (STACK_SIZE / 8) : "memory" );
+                : "=&S" (i), "=&D" (i), "=&c" (i) /* All outputs discarded. */
+                :  [pg] "r" (__pa(idle_pg_table)), "0" (cpu0_stack),
+                   "1" (__va(__pa(cpu0_stack))), "2" (STACK_SIZE / 8)
+                : "memory" );
 
             bootstrap_map(NULL);
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjll7-0007Gh-9M; Thu, 30 Oct 2014 09:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjll5-0007GS-QH
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:07 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	B7/DE-11509-BA002545; Thu, 30 Oct 2014 09:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1414660264!10934125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12478 invoked from network); 30 Oct 2014 09:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjll2-0005eJ-Gf
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjll2-0000RR-AT
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:04 +0000
Date: Thu, 30 Oct 2014 09:11:04 +0000
Message-Id: <E1Xjll2-0000RR-AT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/setup: correct register clobbers
	for the asm statement when resyncing the stack
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d3a7bcd0b1181c9dc0fb04ef3abdfcdb5f20441
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 10:18:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:18:29 2014 +0200

    x86/setup: correct register clobbers for the asm statement when resyncing the stack
    
    When resyncing the stack, the asm statement does not identify %rsi, %rdi and
    %rcx as clobbered by the 'rep movsq'.
    
    Luckily, there are no functional problems in the generated code.  GCC decides
    not to save any of them before calling boostrap_map(), which clobbers them.
    
    Correct the clobbers, by listing them as earlyclobber discarded outputs.
    
    Reported-by: Daniel Kiper <daniel.kiper@oracle.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
    Tested-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/arch/x86/setup.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index bfbb310..73e95c6 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -902,11 +902,13 @@ void __init noreturn __start_xen(unsigned long mbi_p)
                 "movq %%cr4,%%rsi ; "
                 "andb $0x7f,%%sil ; "
                 "movq %%rsi,%%cr4 ; " /* CR4.PGE == 0 */
-                "movq %0,%%cr3    ; " /* CR3 == new pagetables */
+                "movq %[pg],%%cr3 ; " /* CR3 == new pagetables */
                 "orb $0x80,%%sil  ; "
                 "movq %%rsi,%%cr4   " /* CR4.PGE == 1 */
-                : : "r" (__pa(idle_pg_table)), "S" (cpu0_stack),
-                "D" (__va(__pa(cpu0_stack))), "c" (STACK_SIZE / 8) : "memory" );
+                : "=&S" (i), "=&D" (i), "=&c" (i) /* All outputs discarded. */
+                :  [pg] "r" (__pa(idle_pg_table)), "0" (cpu0_stack),
+                   "1" (__va(__pa(cpu0_stack))), "2" (STACK_SIZE / 8)
+                : "memory" );
 
             bootstrap_map(NULL);
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjllH-0007I6-HC; Thu, 30 Oct 2014 09:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllG-0007Hr-06
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:18 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	B5/4B-03668-5B002545; Thu, 30 Oct 2014 09:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1414660275!8788965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10285 invoked from network); 30 Oct 2014 09:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllC-0005eM-RP
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllC-0000Rq-MQ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:14 +0000
Date: Thu, 30 Oct 2014 09:11:14 +0000
Message-Id: <E1XjllC-0000Rq-MQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix listing of vcpus when domains
	lacking any vcpus exist
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93e52d5242804ff928131553599afa769f85481b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 10:19:53 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:19:53 2014 +0200

    fix listing of vcpus when domains lacking any vcpus exist
    
    On a system which looks like this:
    
    [root@st04 ~]# xl list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   752     4     r-----   46699.3
    (null)                                       1     0     0     --p---       0.0
    (null)                                       2     0     0     --p---       0.0
    (null)                                       3     0     0     --p---       0.0
    badger                                      25     0     1     --p---       0.0
    
    `xl vcpu-list` failes as so:
    
    [root@st04 ~]# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) CPU Affinity
    Domain-0                             0     0    0   -b-   12171.0  all
    Domain-0                             0     1    1   -b-   11779.6  all
    Domain-0                             0     2    2   -b-   11599.0  all
    Domain-0                             0     3    3   r--   11007.0  all
    libxl: critical: libxl__calloc: libxl: FATAL ERROR: memory allocation failure (libxl__calloc, 4294935299 x 40)
    : Cannot allocate memory
    libxl: FATAL ERROR: memory allocation failure (libxl__calloc, 4294935299 x 40)
    
    The root cause of this is in Xen.  getdomaininfo() has no way of expressing
    "this domain has no vcpus".  Previously, info->max_vcpu_id would be returned
    uninitialised in such a case.
    
    Unfortunately, setting it to 0 as a default is not appropriate.  A max_vcpu_id
    of 0 and nr_online_cpus of 0 is the valid state for a single vcpu domain which
    is in the process of being destroyed.
    
    As all components are required to add 1 to max_vcpu_id to get the number of
    vcpus, an id of ~0U is not valid to be used.  Explicitly define this as an
    invalid max vcpu value, and use it to express "no vcpus" in getdomaininfo()
    
    In libxl, the issue is seen as libxl_list_vcpu() attempts to use the
    uninitialised domaininfo.max_vcpu_id for memory allocation.
    
    Check domaininfo.max_vcpu_id against the new sentinel value
    XEN_INVALID_MAX_VCPU_ID, and return early.  This means that it is now valid
    for libxl_list_vcpu() to return NULL for a domain which lacks any vcpus.
    
    As part of this change, remove the pointless call to libxl_get_max_cpus(),
    whose returned value is unconditionally clobbered in the for() loop.
    
    Reported-by: Euan Harris <euan.harris@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Don Slutz <dslutz@verizon.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl.c         |    7 ++++++-
 tools/libxl/xl_cmdimpl.c    |    4 +---
 xen/common/domctl.c         |    1 +
 xen/include/public/domctl.h |    1 +
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index f27b581..ee127d8 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5246,7 +5246,12 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         GC_FREE;
         return NULL;
     }
-    *nr_cpus_out = libxl_get_max_cpus(ctx);
+
+    if (domaininfo.max_vcpu_id == XEN_INVALID_MAX_VCPU_ID) {
+        GC_FREE;
+        return NULL;
+    }
+
     ret = ptr = libxl__calloc(NOGC, domaininfo.max_vcpu_id + 1,
                               sizeof(libxl_vcpuinfo));
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index ea43761..0882644 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4813,10 +4813,8 @@ static void print_domain_vcpuinfo(uint32_t domid, uint32_t nr_cpus)
 
     vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nrcpus);
 
-    if (!vcpuinfo) {
-        fprintf(stderr, "libxl_list_vcpu failed.\n");
+    if (!vcpuinfo)
         return;
-    }
 
     for (i = 0; i < nb_vcpu; i++) {
         print_vcpuinfo(domid, &vcpuinfo[i], nr_cpus);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index b6f9708..d9c2635 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -156,6 +156,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     struct vcpu_runstate_info runstate;
     
     info->domain = d->domain_id;
+    info->max_vcpu_id = XEN_INVALID_MAX_VCPU_ID;
     info->nr_online_vcpus = 0;
     info->ssidref = 0;
     
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f519524..58b19e7 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -108,6 +108,7 @@ struct xen_domctl_getdomaininfo {
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
     uint64_aligned_t cpu_time;
     uint32_t nr_online_vcpus;    /* Number of VCPUs currently online. */
+#define XEN_INVALID_MAX_VCPU_ID (~0U) /* Domain has no vcpus? */
     uint32_t max_vcpu_id;        /* Maximum VCPUID in use by this domain. */
     uint32_t ssidref;
     xen_domain_handle_t handle;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjllH-0007I6-HC; Thu, 30 Oct 2014 09:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllG-0007Hr-06
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:18 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	B5/4B-03668-5B002545; Thu, 30 Oct 2014 09:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1414660275!8788965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10285 invoked from network); 30 Oct 2014 09:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllC-0005eM-RP
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllC-0000Rq-MQ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:14 +0000
Date: Thu, 30 Oct 2014 09:11:14 +0000
Message-Id: <E1XjllC-0000Rq-MQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix listing of vcpus when domains
	lacking any vcpus exist
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93e52d5242804ff928131553599afa769f85481b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 10:19:53 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:19:53 2014 +0200

    fix listing of vcpus when domains lacking any vcpus exist
    
    On a system which looks like this:
    
    [root@st04 ~]# xl list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   752     4     r-----   46699.3
    (null)                                       1     0     0     --p---       0.0
    (null)                                       2     0     0     --p---       0.0
    (null)                                       3     0     0     --p---       0.0
    badger                                      25     0     1     --p---       0.0
    
    `xl vcpu-list` failes as so:
    
    [root@st04 ~]# xl vcpu-list
    Name                                ID  VCPU   CPU State   Time(s) CPU Affinity
    Domain-0                             0     0    0   -b-   12171.0  all
    Domain-0                             0     1    1   -b-   11779.6  all
    Domain-0                             0     2    2   -b-   11599.0  all
    Domain-0                             0     3    3   r--   11007.0  all
    libxl: critical: libxl__calloc: libxl: FATAL ERROR: memory allocation failure (libxl__calloc, 4294935299 x 40)
    : Cannot allocate memory
    libxl: FATAL ERROR: memory allocation failure (libxl__calloc, 4294935299 x 40)
    
    The root cause of this is in Xen.  getdomaininfo() has no way of expressing
    "this domain has no vcpus".  Previously, info->max_vcpu_id would be returned
    uninitialised in such a case.
    
    Unfortunately, setting it to 0 as a default is not appropriate.  A max_vcpu_id
    of 0 and nr_online_cpus of 0 is the valid state for a single vcpu domain which
    is in the process of being destroyed.
    
    As all components are required to add 1 to max_vcpu_id to get the number of
    vcpus, an id of ~0U is not valid to be used.  Explicitly define this as an
    invalid max vcpu value, and use it to express "no vcpus" in getdomaininfo()
    
    In libxl, the issue is seen as libxl_list_vcpu() attempts to use the
    uninitialised domaininfo.max_vcpu_id for memory allocation.
    
    Check domaininfo.max_vcpu_id against the new sentinel value
    XEN_INVALID_MAX_VCPU_ID, and return early.  This means that it is now valid
    for libxl_list_vcpu() to return NULL for a domain which lacks any vcpus.
    
    As part of this change, remove the pointless call to libxl_get_max_cpus(),
    whose returned value is unconditionally clobbered in the for() loop.
    
    Reported-by: Euan Harris <euan.harris@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Don Slutz <dslutz@verizon.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxl/libxl.c         |    7 ++++++-
 tools/libxl/xl_cmdimpl.c    |    4 +---
 xen/common/domctl.c         |    1 +
 xen/include/public/domctl.h |    1 +
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index f27b581..ee127d8 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5246,7 +5246,12 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         GC_FREE;
         return NULL;
     }
-    *nr_cpus_out = libxl_get_max_cpus(ctx);
+
+    if (domaininfo.max_vcpu_id == XEN_INVALID_MAX_VCPU_ID) {
+        GC_FREE;
+        return NULL;
+    }
+
     ret = ptr = libxl__calloc(NOGC, domaininfo.max_vcpu_id + 1,
                               sizeof(libxl_vcpuinfo));
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index ea43761..0882644 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4813,10 +4813,8 @@ static void print_domain_vcpuinfo(uint32_t domid, uint32_t nr_cpus)
 
     vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nrcpus);
 
-    if (!vcpuinfo) {
-        fprintf(stderr, "libxl_list_vcpu failed.\n");
+    if (!vcpuinfo)
         return;
-    }
 
     for (i = 0; i < nb_vcpu; i++) {
         print_vcpuinfo(domid, &vcpuinfo[i], nr_cpus);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index b6f9708..d9c2635 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -156,6 +156,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     struct vcpu_runstate_info runstate;
     
     info->domain = d->domain_id;
+    info->max_vcpu_id = XEN_INVALID_MAX_VCPU_ID;
     info->nr_online_vcpus = 0;
     info->ssidref = 0;
     
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index f519524..58b19e7 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -108,6 +108,7 @@ struct xen_domctl_getdomaininfo {
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
     uint64_aligned_t cpu_time;
     uint32_t nr_online_vcpus;    /* Number of VCPUs currently online. */
+#define XEN_INVALID_MAX_VCPU_ID (~0U) /* Domain has no vcpus? */
     uint32_t max_vcpu_id;        /* Maximum VCPUID in use by this domain. */
     uint32_t ssidref;
     xen_domain_handle_t handle;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjllQ-0007Jh-Jv; Thu, 30 Oct 2014 09:11:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllP-0007JO-D8
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:27 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	D3/93-02952-EB002545; Thu, 30 Oct 2014 09:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1414660285!13585335!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23791 invoked from network); 30 Oct 2014 09:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllN-0005eV-1W
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllM-0000SC-WB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:25 +0000
Date: Thu, 30 Oct 2014 09:11:24 +0000
Message-Id: <E1XjllM-0000SC-WB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] correct the documentation of where the
	Xen cpuid leaves can be found
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9d361be3ccbb922ea7f0b8a73a8688f59765fd4c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 10:20:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:20:40 2014 +0200

    correct the documentation of where the Xen cpuid leaves can be found
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/public/arch-x86/cpuid.h |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-x86/cpuid.h
index e57a457..6005dfe 100644
--- a/xen/include/public/arch-x86/cpuid.h
+++ b/xen/include/public/arch-x86/cpuid.h
@@ -30,12 +30,20 @@
 #ifndef __XEN_PUBLIC_ARCH_X86_CPUID_H__
 #define __XEN_PUBLIC_ARCH_X86_CPUID_H__
 
-/* Xen identification leaves start at 0x40000000. */
+/*
+ * For compatibility with other hypervisor interfaces, the Xen cpuid leaves
+ * can be found at the first otherwise unused 0x100 aligned boundary starting
+ * from 0x40000000.
+ *
+ * e.g If viridian extensions are enabled for an HVM domain, the Xen cpuid
+ * leaves will start at 0x40000100
+ */
+
 #define XEN_CPUID_FIRST_LEAF 0x40000000
 #define XEN_CPUID_LEAF(i)    (XEN_CPUID_FIRST_LEAF + (i))
 
 /*
- * Leaf 1 (0x40000000)
+ * Leaf 1 (0x40000x00)
  * EAX: Largest Xen-information leaf. All leaves up to an including @EAX
  *      are supported by the Xen host.
  * EBX-EDX: "XenVMMXenVMM" signature, allowing positive identification
@@ -46,14 +54,14 @@
 #define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */
 
 /*
- * Leaf 2 (0x40000001)
+ * Leaf 2 (0x40000x01)
  * EAX[31:16]: Xen major version.
  * EAX[15: 0]: Xen minor version.
  * EBX-EDX: Reserved (currently all zeroes).
  */
 
 /*
- * Leaf 3 (0x40000002)
+ * Leaf 3 (0x40000x02)
  * EAX: Number of hypercall transfer pages. This register is always guaranteed
  *      to specify one hypercall page.
  * EBX: Base address of Xen-specific MSRs.
@@ -66,7 +74,7 @@
 #define XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD  (1u<<0)
 
 /*
- * Leaf 5 (0x40000004)
+ * Leaf 5 (0x40000x04)
  * HVM-specific features
  */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjllQ-0007Jh-Jv; Thu, 30 Oct 2014 09:11:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllP-0007JO-D8
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:27 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	D3/93-02952-EB002545; Thu, 30 Oct 2014 09:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1414660285!13585335!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23791 invoked from network); 30 Oct 2014 09:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllN-0005eV-1W
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllM-0000SC-WB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:25 +0000
Date: Thu, 30 Oct 2014 09:11:24 +0000
Message-Id: <E1XjllM-0000SC-WB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] correct the documentation of where the
	Xen cpuid leaves can be found
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9d361be3ccbb922ea7f0b8a73a8688f59765fd4c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 10:20:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:20:40 2014 +0200

    correct the documentation of where the Xen cpuid leaves can be found
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/public/arch-x86/cpuid.h |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-x86/cpuid.h
index e57a457..6005dfe 100644
--- a/xen/include/public/arch-x86/cpuid.h
+++ b/xen/include/public/arch-x86/cpuid.h
@@ -30,12 +30,20 @@
 #ifndef __XEN_PUBLIC_ARCH_X86_CPUID_H__
 #define __XEN_PUBLIC_ARCH_X86_CPUID_H__
 
-/* Xen identification leaves start at 0x40000000. */
+/*
+ * For compatibility with other hypervisor interfaces, the Xen cpuid leaves
+ * can be found at the first otherwise unused 0x100 aligned boundary starting
+ * from 0x40000000.
+ *
+ * e.g If viridian extensions are enabled for an HVM domain, the Xen cpuid
+ * leaves will start at 0x40000100
+ */
+
 #define XEN_CPUID_FIRST_LEAF 0x40000000
 #define XEN_CPUID_LEAF(i)    (XEN_CPUID_FIRST_LEAF + (i))
 
 /*
- * Leaf 1 (0x40000000)
+ * Leaf 1 (0x40000x00)
  * EAX: Largest Xen-information leaf. All leaves up to an including @EAX
  *      are supported by the Xen host.
  * EBX-EDX: "XenVMMXenVMM" signature, allowing positive identification
@@ -46,14 +54,14 @@
 #define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */
 
 /*
- * Leaf 2 (0x40000001)
+ * Leaf 2 (0x40000x01)
  * EAX[31:16]: Xen major version.
  * EAX[15: 0]: Xen minor version.
  * EBX-EDX: Reserved (currently all zeroes).
  */
 
 /*
- * Leaf 3 (0x40000002)
+ * Leaf 3 (0x40000x02)
  * EAX: Number of hypercall transfer pages. This register is always guaranteed
  *      to specify one hypercall page.
  * EBX: Base address of Xen-specific MSRs.
@@ -66,7 +74,7 @@
 #define XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD  (1u<<0)
 
 /*
- * Leaf 5 (0x40000004)
+ * Leaf 5 (0x40000x04)
  * HVM-specific features
  */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlla-0007LP-MX; Thu, 30 Oct 2014 09:11:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllZ-0007LG-Qb
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:37 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	15/F3-02952-9C002545; Thu, 30 Oct 2014 09:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414660295!13515150!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27719 invoked from network); 30 Oct 2014 09:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllX-0005ea-Di
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllX-0000Sc-5J
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:35 +0000
Date: Thu, 30 Oct 2014 09:11:35 +0000
Message-Id: <E1XjllX-0000Sc-5J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: fix reloc.S build
	dependencies
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c42070df66c9fcedf477959b8371b85aa4ac4933
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 23 10:21:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:21:13 2014 +0200

    x86/boot: fix reloc.S build dependencies
    
    reloc.S is not rebuild if header included
    in reloc.c is updated. Fix this issue.
    
    Additionally, remove reloc.S build dependency
    on head.S because anything from reloc.S does
    not depend on head.S.
    
    Add reloc.c dependency to reloc.o build rule for consistency.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/Makefile   |    8 ++++----
 xen/arch/x86/boot/build32.mk |    3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 13f4a66..5fdb5ae 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,8 +1,8 @@
 obj-bin-y += head.o
 
-head.o: reloc.S
+RELOC_DEPS = $(BASEDIR)/include/asm-x86/config.h $(BASEDIR)/include/xen/multiboot.h
 
-%.S: %.c
-	$(MAKE) -f build32.mk $@
+head.o: reloc.S
 
-reloc.S: head.S
+reloc.S: reloc.c $(RELOC_DEPS)
+	$(MAKE) -f build32.mk $@ RELOC_DEPS="$(RELOC_DEPS)"
diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index a36f620..c208249 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -30,5 +30,6 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 			esac; \
 		done
 
-reloc.o: $(BASEDIR)/include/asm-x86/config.h
+reloc.o: reloc.c $(RELOC_DEPS)
+
 .PRECIOUS: %.bin %.lnk
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlla-0007LP-MX; Thu, 30 Oct 2014 09:11:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllZ-0007LG-Qb
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:37 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	15/F3-02952-9C002545; Thu, 30 Oct 2014 09:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414660295!13515150!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27719 invoked from network); 30 Oct 2014 09:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllX-0005ea-Di
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjllX-0000Sc-5J
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:35 +0000
Date: Thu, 30 Oct 2014 09:11:35 +0000
Message-Id: <E1XjllX-0000Sc-5J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: fix reloc.S build
	dependencies
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c42070df66c9fcedf477959b8371b85aa4ac4933
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 23 10:21:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:21:13 2014 +0200

    x86/boot: fix reloc.S build dependencies
    
    reloc.S is not rebuild if header included
    in reloc.c is updated. Fix this issue.
    
    Additionally, remove reloc.S build dependency
    on head.S because anything from reloc.S does
    not depend on head.S.
    
    Add reloc.c dependency to reloc.o build rule for consistency.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/Makefile   |    8 ++++----
 xen/arch/x86/boot/build32.mk |    3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 13f4a66..5fdb5ae 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,8 +1,8 @@
 obj-bin-y += head.o
 
-head.o: reloc.S
+RELOC_DEPS = $(BASEDIR)/include/asm-x86/config.h $(BASEDIR)/include/xen/multiboot.h
 
-%.S: %.c
-	$(MAKE) -f build32.mk $@
+head.o: reloc.S
 
-reloc.S: head.S
+reloc.S: reloc.c $(RELOC_DEPS)
+	$(MAKE) -f build32.mk $@ RELOC_DEPS="$(RELOC_DEPS)"
diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index a36f620..c208249 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -30,5 +30,6 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 			esac; \
 		done
 
-reloc.o: $(BASEDIR)/include/asm-x86/config.h
+reloc.o: reloc.c $(RELOC_DEPS)
+
 .PRECIOUS: %.bin %.lnk
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjllk-0007No-Q9; Thu, 30 Oct 2014 09:11:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllk-0007NX-5l
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:48 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	04/4C-03668-3D002545; Thu, 30 Oct 2014 09:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1414660305!12503298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20732 invoked from network); 30 Oct 2014 09:11:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllh-0005ej-Iu
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllh-0000T0-Hd
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:45 +0000
Date: Thu, 30 Oct 2014 09:11:45 +0000
Message-Id: <E1Xjllh-0000T0-Hd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: use constant in head.S
	instead of hardcoded value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d6ea91d6e7a118bdf2384dfbaa9caa14b19bc61d
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 23 10:22:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:22:01 2014 +0200

    x86/boot: use constant in head.S instead of hardcoded value
    
    ..to access multiboot.mem_lower data.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/head.S          |    2 +-
 xen/arch/x86/x86_64/asm-offsets.c |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index cd43952..c99f739 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -101,7 +101,7 @@ __start:
          */
         testb   $MBI_MEMLIMITS,(%ebx)
         jz      2f                  /* not available? BDA value will be fine */
-        mov     4(%ebx),%edx
+        mov     MB_mem_lower(%ebx),%edx
         cmp     $0x100,%edx         /* is the multiboot value too small? */
         jb      2f                  /* if so, do not use it */
         shl     $10-4,%edx
diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 3994f4d..447c650 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -165,4 +165,5 @@ void __dummy__(void)
 
     OFFSET(MB_flags, multiboot_info_t, flags);
     OFFSET(MB_cmdline, multiboot_info_t, cmdline);
+    OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjllk-0007No-Q9; Thu, 30 Oct 2014 09:11:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllk-0007NX-5l
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:48 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	04/4C-03668-3D002545; Thu, 30 Oct 2014 09:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1414660305!12503298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20732 invoked from network); 30 Oct 2014 09:11:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllh-0005ej-Iu
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllh-0000T0-Hd
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:45 +0000
Date: Thu, 30 Oct 2014 09:11:45 +0000
Message-Id: <E1Xjllh-0000T0-Hd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: use constant in head.S
	instead of hardcoded value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d6ea91d6e7a118bdf2384dfbaa9caa14b19bc61d
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 23 10:22:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:22:01 2014 +0200

    x86/boot: use constant in head.S instead of hardcoded value
    
    ..to access multiboot.mem_lower data.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/head.S          |    2 +-
 xen/arch/x86/x86_64/asm-offsets.c |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index cd43952..c99f739 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -101,7 +101,7 @@ __start:
          */
         testb   $MBI_MEMLIMITS,(%ebx)
         jz      2f                  /* not available? BDA value will be fine */
-        mov     4(%ebx),%edx
+        mov     MB_mem_lower(%ebx),%edx
         cmp     $0x100,%edx         /* is the multiboot value too small? */
         jb      2f                  /* if so, do not use it */
         shl     $10-4,%edx
diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 3994f4d..447c650 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -165,4 +165,5 @@ void __dummy__(void)
 
     OFFSET(MB_flags, multiboot_info_t, flags);
     OFFSET(MB_cmdline, multiboot_info_t, cmdline);
+    OFFSET(MB_mem_lower, multiboot_info_t, mem_lower);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjllv-0007Qk-Sq; Thu, 30 Oct 2014 09:11:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllu-0007QN-B5
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:58 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	0B/8C-02746-DD002545; Thu, 30 Oct 2014 09:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414660316!11284503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9021 invoked from network); 30 Oct 2014 09:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllr-0005es-QK
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllr-0000Tz-OU
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:55 +0000
Date: Thu, 30 Oct 2014 09:11:55 +0000
Message-Id: <E1Xjllr-0000Tz-OU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: add memory to clobber list
	in reloc_mbi_struct()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04dbb22e89c0e5f947e509d4728354923082264a
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 23 10:22:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:22:52 2014 +0200

    x86/boot: add memory to clobber list in reloc_mbi_struct()
    
    Assembly inline in reloc_mbi_struct() clobbers
    memory so tell compiler about that.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/reloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index 4609e55..f971920 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -46,7 +46,7 @@ static void *reloc_mbi_struct(void *old, unsigned int bytes)
     "    mov  %0,%%edi                \n"
     "    rep  movsb                   \n"
        : "=&r" (new), "+c" (bytes), "+S" (old)
-	: : "edx", "edi");
+	: : "edx", "edi", "memory");
     return new;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:11:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjllv-0007Qk-Sq; Thu, 30 Oct 2014 09:11:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllu-0007QN-B5
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:58 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	0B/8C-02746-DD002545; Thu, 30 Oct 2014 09:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414660316!11284503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9021 invoked from network); 30 Oct 2014 09:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllr-0005es-QK
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjllr-0000Tz-OU
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:11:55 +0000
Date: Thu, 30 Oct 2014 09:11:55 +0000
Message-Id: <E1Xjllr-0000Tz-OU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: add memory to clobber list
	in reloc_mbi_struct()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04dbb22e89c0e5f947e509d4728354923082264a
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu Oct 23 10:22:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:22:52 2014 +0200

    x86/boot: add memory to clobber list in reloc_mbi_struct()
    
    Assembly inline in reloc_mbi_struct() clobbers
    memory so tell compiler about that.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/reloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index 4609e55..f971920 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -46,7 +46,7 @@ static void *reloc_mbi_struct(void *old, unsigned int bytes)
     "    mov  %0,%%edi                \n"
     "    rep  movsb                   \n"
        : "=&r" (new), "+c" (bytes), "+S" (old)
-	: : "edx", "edi");
+	: : "edx", "edi", "memory");
     return new;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlm6-0007Sl-1K; Thu, 30 Oct 2014 09:12:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlm4-0007SQ-Fx
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:08 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	29/62-02823-7E002545; Thu, 30 Oct 2014 09:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1414660326!12529918!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14855 invoked from network); 30 Oct 2014 09:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlm2-0005fR-0B
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlm1-0000UV-Uy
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:05 +0000
Date: Thu, 30 Oct 2014 09:12:05 +0000
Message-Id: <E1Xjlm1-0000UV-Uy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: fix
	efi_arch_allocate_mmap_buffer() to return new size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 932881d953476444ed934c94dbc098c0fefb4d77
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Thu Oct 23 10:23:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:23:43 2014 +0200

    EFI: fix efi_arch_allocate_mmap_buffer() to return new size
    
    efi_arch_allocate_mmap_buffer() allocates a buffer for the EFI memory map, and
    for ARM it allocates a larger buffer than requested. This is done to account
    for the increase in the map size that may occur when the allocation is made.
    The previous code allocated a larger buffer, but did not adjust the size to
    match.  This caused the later call to GetMemoryMap() to fail with a
    BUFFER_TOO_SMALL error, since the original, smaller size was used.  This patch
    changes the argument to efi_arch_allocate_mmap_buffer() to be a pointer to
    UINTN, and the ARM version updates the size on a successful allocation.
    The x86 version uses a different allocation method, so only the function
    argument type is changed.
    Also add decode of the BUFFER_TOO_SMALL error code to PrintErrMesg().
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com> [ARM]
    Acked-by: Jan Beulich <jbeulich@suse.com> [non-ARM]
---
 xen/arch/arm/efi/efi-boot.h |    6 ++++--
 xen/arch/x86/efi/efi-boot.h |    4 ++--
 xen/common/efi/boot.c       |    5 ++++-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index d40d8b2..639942d 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -370,14 +370,16 @@ static void __init efi_arch_cfg_file_late(EFI_FILE_HANDLE dir_handle, char *sect
 {
 }
 
-static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
+static void *__init efi_arch_allocate_mmap_buffer(UINTN *map_size)
 {
     void *ptr;
     EFI_STATUS status;
+    UINTN map_size_alloc = *map_size + EFI_PAGE_SIZE;
 
-    status = efi_bs->AllocatePool(EfiLoaderData, map_size + EFI_PAGE_SIZE, &ptr);
+    status = efi_bs->AllocatePool(EfiLoaderData, map_size_alloc, &ptr);
     if ( status != EFI_SUCCESS )
         return NULL;
+    *map_size = map_size_alloc;
     return ptr;
 }
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 4348cfe..454ffb6 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -190,10 +190,10 @@ static void __init efi_arch_process_memory_map(EFI_SYSTEM_TABLE *SystemTable,
 
 }
 
-static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
+static void *__init efi_arch_allocate_mmap_buffer(UINTN *map_size)
 {
     place_string(&mbi.mem_upper, NULL);
-    mbi.mem_upper -= map_size;
+    mbi.mem_upper -= *map_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
         return NULL;
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index f272171..4257341 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -271,6 +271,9 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     case EFI_COMPROMISED_DATA:
         mesg = L"Compromised data";
         break;
+    case EFI_BUFFER_TOO_SMALL:
+        mesg = L"Buffer too small";
+        break;
     default:
         PrintErr(L"ErrCode: ");
         DisplayUint(ErrCode, 0);
@@ -1038,7 +1041,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
                          &efi_mdesc_size, &mdesc_ver);
-    efi_memmap = efi_arch_allocate_mmap_buffer(efi_memmap_size);
+    efi_memmap = efi_arch_allocate_mmap_buffer(&efi_memmap_size);
     if ( !efi_memmap )
         blexit(L"Unable to allocate memory for EFI memory map");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlm6-0007Sl-1K; Thu, 30 Oct 2014 09:12:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlm4-0007SQ-Fx
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:08 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	29/62-02823-7E002545; Thu, 30 Oct 2014 09:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1414660326!12529918!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14855 invoked from network); 30 Oct 2014 09:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlm2-0005fR-0B
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlm1-0000UV-Uy
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:05 +0000
Date: Thu, 30 Oct 2014 09:12:05 +0000
Message-Id: <E1Xjlm1-0000UV-Uy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: fix
	efi_arch_allocate_mmap_buffer() to return new size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 932881d953476444ed934c94dbc098c0fefb4d77
Author:     Roy Franz <roy.franz@linaro.org>
AuthorDate: Thu Oct 23 10:23:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:23:43 2014 +0200

    EFI: fix efi_arch_allocate_mmap_buffer() to return new size
    
    efi_arch_allocate_mmap_buffer() allocates a buffer for the EFI memory map, and
    for ARM it allocates a larger buffer than requested. This is done to account
    for the increase in the map size that may occur when the allocation is made.
    The previous code allocated a larger buffer, but did not adjust the size to
    match.  This caused the later call to GetMemoryMap() to fail with a
    BUFFER_TOO_SMALL error, since the original, smaller size was used.  This patch
    changes the argument to efi_arch_allocate_mmap_buffer() to be a pointer to
    UINTN, and the ARM version updates the size on a successful allocation.
    The x86 version uses a different allocation method, so only the function
    argument type is changed.
    Also add decode of the BUFFER_TOO_SMALL error code to PrintErrMesg().
    
    Signed-off-by: Roy Franz <roy.franz@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com> [ARM]
    Acked-by: Jan Beulich <jbeulich@suse.com> [non-ARM]
---
 xen/arch/arm/efi/efi-boot.h |    6 ++++--
 xen/arch/x86/efi/efi-boot.h |    4 ++--
 xen/common/efi/boot.c       |    5 ++++-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index d40d8b2..639942d 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -370,14 +370,16 @@ static void __init efi_arch_cfg_file_late(EFI_FILE_HANDLE dir_handle, char *sect
 {
 }
 
-static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
+static void *__init efi_arch_allocate_mmap_buffer(UINTN *map_size)
 {
     void *ptr;
     EFI_STATUS status;
+    UINTN map_size_alloc = *map_size + EFI_PAGE_SIZE;
 
-    status = efi_bs->AllocatePool(EfiLoaderData, map_size + EFI_PAGE_SIZE, &ptr);
+    status = efi_bs->AllocatePool(EfiLoaderData, map_size_alloc, &ptr);
     if ( status != EFI_SUCCESS )
         return NULL;
+    *map_size = map_size_alloc;
     return ptr;
 }
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 4348cfe..454ffb6 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -190,10 +190,10 @@ static void __init efi_arch_process_memory_map(EFI_SYSTEM_TABLE *SystemTable,
 
 }
 
-static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
+static void *__init efi_arch_allocate_mmap_buffer(UINTN *map_size)
 {
     place_string(&mbi.mem_upper, NULL);
-    mbi.mem_upper -= map_size;
+    mbi.mem_upper -= *map_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
         return NULL;
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index f272171..4257341 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -271,6 +271,9 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     case EFI_COMPROMISED_DATA:
         mesg = L"Compromised data";
         break;
+    case EFI_BUFFER_TOO_SMALL:
+        mesg = L"Buffer too small";
+        break;
     default:
         PrintErr(L"ErrCode: ");
         DisplayUint(ErrCode, 0);
@@ -1038,7 +1041,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
                          &efi_mdesc_size, &mdesc_ver);
-    efi_memmap = efi_arch_allocate_mmap_buffer(efi_memmap_size);
+    efi_memmap = efi_arch_allocate_mmap_buffer(&efi_memmap_size);
     if ( !efi_memmap )
         blexit(L"Unable to allocate memory for EFI memory map");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlmG-0007Uq-Ft; Thu, 30 Oct 2014 09:12:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmE-0007UT-Hc
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:18 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	6E/7C-02699-1F002545; Thu, 30 Oct 2014 09:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1414660336!13623013!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25903 invoked from network); 30 Oct 2014 09:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmC-0005fX-52
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmC-0000Ut-3O
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:16 +0000
Date: Thu, 30 Oct 2014 09:12:16 +0000
Message-Id: <E1XjlmC-0000Ut-3O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: EFI configuration file must be
	ASCII type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 204c7a873fbe1ac62a61c93babb858635dfe9c3a
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu Oct 23 10:24:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:24:19 2014 +0200

    docs: EFI configuration file must be ASCII type
    
    Currently Xen can only read the configuration file if it is in ASCII
    format. If it is in CHAR16 or CHAR8 it will choke. One way to verify
    this is to use 'file':
    
    xen.cfg:        ASCII text
    xen-char16.cfg: Little-endian UTF-16 Unicode text, with CRLF, CR line terminators
    
    The latter is no good.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/misc/efi.markdown |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/docs/misc/efi.markdown b/docs/misc/efi.markdown
index ad8da93..5e48aa3 100644
--- a/docs/misc/efi.markdown
+++ b/docs/misc/efi.markdown
@@ -34,7 +34,8 @@ The configuration file consists of one or more sections headed by a section
 name enclosed in square brackets, with individual values specified in each
 section. A section named `[global]` is treated specially to allow certain
 settings to apply to all other sections (or to provide defaults for certain
-settings in case individual sections don't specify them). A typical file would
+settings in case individual sections don't specify them). This file (for now)
+needs to be of ASCII type and not e.g. UTF-8 or UTF-16. A typical file would
 thus look like this (`#` serving as comment character):
 
     **************************example begin******************************
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlmG-0007Uq-Ft; Thu, 30 Oct 2014 09:12:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmE-0007UT-Hc
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:18 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	6E/7C-02699-1F002545; Thu, 30 Oct 2014 09:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1414660336!13623013!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25903 invoked from network); 30 Oct 2014 09:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmC-0005fX-52
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmC-0000Ut-3O
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:16 +0000
Date: Thu, 30 Oct 2014 09:12:16 +0000
Message-Id: <E1XjlmC-0000Ut-3O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: EFI configuration file must be
	ASCII type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 204c7a873fbe1ac62a61c93babb858635dfe9c3a
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Thu Oct 23 10:24:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 10:24:19 2014 +0200

    docs: EFI configuration file must be ASCII type
    
    Currently Xen can only read the configuration file if it is in ASCII
    format. If it is in CHAR16 or CHAR8 it will choke. One way to verify
    this is to use 'file':
    
    xen.cfg:        ASCII text
    xen-char16.cfg: Little-endian UTF-16 Unicode text, with CRLF, CR line terminators
    
    The latter is no good.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/misc/efi.markdown |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/docs/misc/efi.markdown b/docs/misc/efi.markdown
index ad8da93..5e48aa3 100644
--- a/docs/misc/efi.markdown
+++ b/docs/misc/efi.markdown
@@ -34,7 +34,8 @@ The configuration file consists of one or more sections headed by a section
 name enclosed in square brackets, with individual values specified in each
 section. A section named `[global]` is treated specially to allow certain
 settings to apply to all other sections (or to provide defaults for certain
-settings in case individual sections don't specify them). A typical file would
+settings in case individual sections don't specify them). This file (for now)
+needs to be of ASCII type and not e.g. UTF-8 or UTF-16. A typical file would
 thus look like this (`#` serving as comment character):
 
     **************************example begin******************************
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlmQ-0007X0-MI; Thu, 30 Oct 2014 09:12:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmP-0007Wi-3l
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:29 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	21/22-27785-CF002545; Thu, 30 Oct 2014 09:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1414660346!13406056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20384 invoked from network); 30 Oct 2014 09:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmM-0005fd-BD
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmM-0000VF-9S
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:26 +0000
Date: Thu, 30 Oct 2014 09:12:26 +0000
Message-Id: <E1XjlmM-0000VF-9S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce gnttab_max_frames and
	gnttab_max_maptrack_frames command line options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7157012293ec31da5b94d054739a1e07fedde736
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 11:59:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 11:59:46 2014 +0200

    introduce gnttab_max_frames and gnttab_max_maptrack_frames command line options
    
    Introduce gnttab_max_maptrack_frames: a new Xen command line option to
    specify the max number of maptrack frames per domain.
    Deprecate the old gnttab_max_nr_frames and introduce gnttab_max_frames
    instead, that doesn't affect the maptrack. Keep gnttab_max_nr_frames for
    compatibility.
    
    Rename internally max_nr_grant_frames to max_grant_frames to avoid
    confusions.
    
    Introduce DEFAULT_MAX_MAPTRACK_FRAMES, that is completely independent
    from max_nr_grant_frames.
    
    Remove MAX_MAPTRACK_TO_GRANTS_RATIO that is now only used in one place
    for compatibility.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.markdown |   17 +++++++++-
 xen/arch/arm/domain.c               |    2 +-
 xen/arch/arm/mm.c                   |    2 +-
 xen/arch/x86/mm.c                   |    2 +-
 xen/common/compat/grant_table.c     |   12 +++---
 xen/common/grant_table.c            |   62 ++++++++++++++++++++++++-----------
 xen/include/asm-arm/grant_table.h   |    2 +-
 xen/include/xen/grant_table.h       |    4 +--
 8 files changed, 70 insertions(+), 33 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 28bbaaf..00416af 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -608,11 +608,26 @@ does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT.
 
 Specify the serial parameters for the GDB stub.
 
-### gnttab\_max\_nr\_frames
+### gnttab\_max\_frames
 > `= <integer>`
 
 Specify the maximum number of frames per grant table operation.
 
+### gnttab\_max\_maptrack\_frames
+> `= <integer>`
+
+Specify the maximum number of maptrack frames domain.
+The default value is 8 times gnttab_max_frames.
+
+### gnttab\_max\_nr\_frames
+> `= <integer>`
+
+*Deprecated*
+Use gnttab\_max\_frames and gnttab\_max\_maptrack\_frames instead.
+
+Specify the maximum number of frames per grant table operation and the
+maximum number of maptrack frames domain.
+
 ### guest\_loglvl
 > `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
 
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 5043837..7221bc8 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -409,7 +409,7 @@ struct domain *alloc_domain_struct(void)
         return NULL;
 
     clear_page(d);
-    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_nr_grant_frames);
+    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_grant_frames);
     return d;
 }
 
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 97e5bc3..911c850 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1054,7 +1054,7 @@ int xenmem_add_to_physmap_one(
         else
         {
             if ( (idx >= nr_grant_frames(d->grant_table)) &&
-                    (idx < max_nr_grant_frames) )
+                 (idx < max_grant_frames) )
                 gnttab_grow_table(d, idx + 1);
 
             if ( idx < nr_grant_frames(d->grant_table) )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6cd7f45..edd1923 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4564,7 +4564,7 @@ int xenmem_add_to_physmap_one(
             else
             {
                 if ( (idx >= nr_grant_frames(d->grant_table)) &&
-                     (idx < max_nr_grant_frames) )
+                     (idx < max_grant_frames) )
                     gnttab_grow_table(d, idx + 1);
 
                 if ( idx < nr_grant_frames(d->grant_table) )
diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index 7ebbbc1..2dc1e44 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -146,11 +146,11 @@ int compat_grant_table_op(unsigned int cmd,
                 unsigned int max_frame_list_size_in_page =
                     (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.setup)) /
                     sizeof(*nat.setup->frame_list.p);
-                if ( max_frame_list_size_in_page < max_nr_grant_frames )
+                if ( max_frame_list_size_in_page < max_grant_frames )
                 {
                     gdprintk(XENLOG_WARNING,
-                             "max_nr_grant_frames is too large (%u,%u)\n",
-                             max_nr_grant_frames, max_frame_list_size_in_page);
+                             "max_grant_frames is too large (%u,%u)\n",
+                             max_grant_frames, max_frame_list_size_in_page);
                     rc = -EINVAL;
                 }
                 else
@@ -284,11 +284,11 @@ int compat_grant_table_op(unsigned int cmd,
                 break;
             }
             if ( max_frame_list_size_in_pages <
-                 grant_to_status_frames(max_nr_grant_frames) )
+                 grant_to_status_frames(max_grant_frames) )
             {
                 gdprintk(XENLOG_WARNING,
-                         "grant_to_status_frames(max_nr_grant_frames) is too large (%u,%u)\n",
-                         grant_to_status_frames(max_nr_grant_frames),
+                         "grant_to_status_frames(max_grant_frames) is too large (%u,%u)\n",
+                         grant_to_status_frames(max_grant_frames),
                          max_frame_list_size_in_pages);
                 rc = -EINVAL;
                 break;
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 23266c3..f9a9b44 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -40,16 +40,27 @@
 #include <xsm/xsm.h>
 #include <asm/flushtlb.h>
 
-#ifndef max_nr_grant_frames
-unsigned int max_nr_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES;
+/* 
+ * This option is deprecated, use gnttab_max_frames and
+ * gnttab_max_maptrack_frames instead.
+ */
+static unsigned int __initdata max_nr_grant_frames;
 integer_param("gnttab_max_nr_frames", max_nr_grant_frames);
-#endif
+
+unsigned int __read_mostly max_grant_frames;
+integer_param("gnttab_max_frames", max_grant_frames);
 
 /* The maximum number of grant mappings is defined as a multiplier of the
  * maximum number of grant table entries. This defines the multiplier used.
  * Pretty arbitrary. [POLICY]
+ * As gnttab_max_nr_frames has been deprecated, this multiplier is deprecated too.
+ * New options allow to set max_maptrack_frames and
+ * map_grant_table_frames independently.
  */
-#define MAX_MAPTRACK_TO_GRANTS_RATIO 8
+#define DEFAULT_MAX_MAPTRACK_FRAMES 256
+
+static unsigned int __read_mostly max_maptrack_frames;
+integer_param("gnttab_max_maptrack_frames", max_maptrack_frames);
 
 /*
  * The first two members of a grant entry are updated as a combined pair.
@@ -102,11 +113,6 @@ nr_maptrack_frames(struct grant_table *t)
     return t->maptrack_limit / MAPTRACK_PER_PAGE;
 }
 
-static unsigned inline int max_nr_maptrack_frames(void)
-{
-    return (max_nr_grant_frames * MAX_MAPTRACK_TO_GRANTS_RATIO);
-}
-
 #define MAPTRACK_TAIL (~0u)
 
 #define SHGNT_PER_PAGE_V1 (PAGE_SIZE / sizeof(grant_entry_v1_t))
@@ -164,7 +170,7 @@ num_act_frames_from_sha_frames(const unsigned int num)
 }
 
 #define max_nr_active_grant_frames \
-    num_act_frames_from_sha_frames(max_nr_grant_frames)
+    num_act_frames_from_sha_frames(max_grant_frames)
 
 static inline unsigned int
 nr_active_grant_frames(struct grant_table *gt)
@@ -271,7 +277,7 @@ get_maptrack_handle(
     while ( unlikely((handle = __get_maptrack_handle(lgt)) == -1) )
     {
         nr_frames = nr_maptrack_frames(lgt);
-        if ( nr_frames >= max_nr_maptrack_frames() )
+        if ( nr_frames >= max_maptrack_frames )
             break;
 
         new_mt = alloc_xenheap_page();
@@ -1265,7 +1271,7 @@ gnttab_grow_table(struct domain *d, unsigned int req_nr_frames)
     struct grant_table *gt = d->grant_table;
     unsigned int i;
 
-    ASSERT(req_nr_frames <= max_nr_grant_frames);
+    ASSERT(req_nr_frames <= max_grant_frames);
 
     gdprintk(XENLOG_INFO,
             "Expanding dom (%d) grant table from (%d) to (%d) frames.\n",
@@ -1338,11 +1344,11 @@ gnttab_setup_table(
         return -EFAULT;
     }
 
-    if ( unlikely(op.nr_frames > max_nr_grant_frames) )
+    if ( unlikely(op.nr_frames > max_grant_frames) )
     {
         gdprintk(XENLOG_INFO, "Xen only supports up to %d grant-table frames"
                 " per domain.\n",
-                max_nr_grant_frames);
+                max_grant_frames);
         op.status = GNTST_general_error;
         goto out1;
     }
@@ -1377,7 +1383,7 @@ gnttab_setup_table(
     {
         gdprintk(XENLOG_INFO,
                  "Expand grant table to %u failed. Current: %u Max: %u\n",
-                 op.nr_frames, nr_grant_frames(gt), max_nr_grant_frames);
+                 op.nr_frames, nr_grant_frames(gt), max_grant_frames);
         op.status = GNTST_general_error;
         goto out3;
     }
@@ -1438,7 +1444,7 @@ gnttab_query_size(
     spin_lock(&d->grant_table->lock);
 
     op.nr_frames     = nr_grant_frames(d->grant_table);
-    op.max_nr_frames = max_nr_grant_frames;
+    op.max_nr_frames = max_grant_frames;
     op.status        = GNTST_okay;
 
     spin_unlock(&d->grant_table->lock);
@@ -2659,7 +2665,7 @@ grant_table_create(
 
     /* Tracking of mapped foreign frames table */
     if ( (t->maptrack = xzalloc_array(struct grant_mapping *,
-                                      max_nr_maptrack_frames())) == NULL )
+                                      max_maptrack_frames)) == NULL )
         goto no_mem_2;
     if ( (t->maptrack[0] = alloc_xenheap_page()) == NULL )
         goto no_mem_3;
@@ -2670,7 +2676,7 @@ grant_table_create(
     t->maptrack[0][i - 1].ref = MAPTRACK_TAIL;
 
     /* Shared grant table. */
-    if ( (t->shared_raw = xzalloc_array(void *, max_nr_grant_frames)) == NULL )
+    if ( (t->shared_raw = xzalloc_array(void *, max_grant_frames)) == NULL )
         goto no_mem_3;
     for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
     {
@@ -2681,7 +2687,7 @@ grant_table_create(
     
     /* Status pages for grant table - for version 2 */
     t->status = xzalloc_array(grant_status_t *,
-                              grant_to_status_frames(max_nr_grant_frames));
+                              grant_to_status_frames(max_grant_frames));
     if ( t->status == NULL )
         goto no_mem_4;
 
@@ -2930,6 +2936,24 @@ static struct keyhandler gnttab_usage_print_all_keyhandler = {
 
 static int __init gnttab_usage_init(void)
 {
+    if ( max_nr_grant_frames )
+    {
+        printk(XENLOG_WARNING
+               "gnttab_max_nr_frames is deprecated, use gnttab_max_frames instead\n");
+        if ( !max_grant_frames )
+            max_grant_frames = max_nr_grant_frames;
+        BUILD_BUG_ON(DEFAULT_MAX_MAPTRACK_FRAMES < DEFAULT_MAX_NR_GRANT_FRAMES);
+        if ( !max_maptrack_frames )
+            max_maptrack_frames = max_nr_grant_frames *
+                (DEFAULT_MAX_MAPTRACK_FRAMES / DEFAULT_MAX_NR_GRANT_FRAMES);
+    }
+
+    if ( !max_grant_frames )
+        max_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES;
+
+    if ( !max_maptrack_frames )
+        max_maptrack_frames = DEFAULT_MAX_MAPTRACK_FRAMES;
+
     register_keyhandler('g', &gnttab_usage_print_all_keyhandler);
     return 0;
 }
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index 47147ce..e798880 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -31,7 +31,7 @@ static inline int replace_grant_supported(void)
 
 #define gnttab_shared_gmfn(d, t, i)                                      \
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
-     (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
+     (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
 
 #define gnttab_need_iommu_mapping(d)           (is_domain_direct_mapped(d))
 
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 5941191..32f5786 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -49,10 +49,8 @@
 /* Default maximum size of a grant table. [POLICY] */
 #define DEFAULT_MAX_NR_GRANT_FRAMES   32
 #endif
-#ifndef max_nr_grant_frames /* to allow arch to override */
 /* The maximum size of a grant table. */
-extern unsigned int max_nr_grant_frames;
-#endif
+extern unsigned int max_grant_frames;
 
 /*
  * Tracks a mapping of another domain's grant reference. Each domain has a
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlmQ-0007X0-MI; Thu, 30 Oct 2014 09:12:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmP-0007Wi-3l
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:29 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	21/22-27785-CF002545; Thu, 30 Oct 2014 09:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1414660346!13406056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20384 invoked from network); 30 Oct 2014 09:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmM-0005fd-BD
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmM-0000VF-9S
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:26 +0000
Date: Thu, 30 Oct 2014 09:12:26 +0000
Message-Id: <E1XjlmM-0000VF-9S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce gnttab_max_frames and
	gnttab_max_maptrack_frames command line options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7157012293ec31da5b94d054739a1e07fedde736
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 11:59:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 11:59:46 2014 +0200

    introduce gnttab_max_frames and gnttab_max_maptrack_frames command line options
    
    Introduce gnttab_max_maptrack_frames: a new Xen command line option to
    specify the max number of maptrack frames per domain.
    Deprecate the old gnttab_max_nr_frames and introduce gnttab_max_frames
    instead, that doesn't affect the maptrack. Keep gnttab_max_nr_frames for
    compatibility.
    
    Rename internally max_nr_grant_frames to max_grant_frames to avoid
    confusions.
    
    Introduce DEFAULT_MAX_MAPTRACK_FRAMES, that is completely independent
    from max_nr_grant_frames.
    
    Remove MAX_MAPTRACK_TO_GRANTS_RATIO that is now only used in one place
    for compatibility.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.markdown |   17 +++++++++-
 xen/arch/arm/domain.c               |    2 +-
 xen/arch/arm/mm.c                   |    2 +-
 xen/arch/x86/mm.c                   |    2 +-
 xen/common/compat/grant_table.c     |   12 +++---
 xen/common/grant_table.c            |   62 ++++++++++++++++++++++++-----------
 xen/include/asm-arm/grant_table.h   |    2 +-
 xen/include/xen/grant_table.h       |    4 +--
 8 files changed, 70 insertions(+), 33 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 28bbaaf..00416af 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -608,11 +608,26 @@ does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT.
 
 Specify the serial parameters for the GDB stub.
 
-### gnttab\_max\_nr\_frames
+### gnttab\_max\_frames
 > `= <integer>`
 
 Specify the maximum number of frames per grant table operation.
 
+### gnttab\_max\_maptrack\_frames
+> `= <integer>`
+
+Specify the maximum number of maptrack frames domain.
+The default value is 8 times gnttab_max_frames.
+
+### gnttab\_max\_nr\_frames
+> `= <integer>`
+
+*Deprecated*
+Use gnttab\_max\_frames and gnttab\_max\_maptrack\_frames instead.
+
+Specify the maximum number of frames per grant table operation and the
+maximum number of maptrack frames domain.
+
 ### guest\_loglvl
 > `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
 
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 5043837..7221bc8 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -409,7 +409,7 @@ struct domain *alloc_domain_struct(void)
         return NULL;
 
     clear_page(d);
-    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_nr_grant_frames);
+    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_grant_frames);
     return d;
 }
 
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 97e5bc3..911c850 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1054,7 +1054,7 @@ int xenmem_add_to_physmap_one(
         else
         {
             if ( (idx >= nr_grant_frames(d->grant_table)) &&
-                    (idx < max_nr_grant_frames) )
+                 (idx < max_grant_frames) )
                 gnttab_grow_table(d, idx + 1);
 
             if ( idx < nr_grant_frames(d->grant_table) )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6cd7f45..edd1923 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4564,7 +4564,7 @@ int xenmem_add_to_physmap_one(
             else
             {
                 if ( (idx >= nr_grant_frames(d->grant_table)) &&
-                     (idx < max_nr_grant_frames) )
+                     (idx < max_grant_frames) )
                     gnttab_grow_table(d, idx + 1);
 
                 if ( idx < nr_grant_frames(d->grant_table) )
diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index 7ebbbc1..2dc1e44 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -146,11 +146,11 @@ int compat_grant_table_op(unsigned int cmd,
                 unsigned int max_frame_list_size_in_page =
                     (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.setup)) /
                     sizeof(*nat.setup->frame_list.p);
-                if ( max_frame_list_size_in_page < max_nr_grant_frames )
+                if ( max_frame_list_size_in_page < max_grant_frames )
                 {
                     gdprintk(XENLOG_WARNING,
-                             "max_nr_grant_frames is too large (%u,%u)\n",
-                             max_nr_grant_frames, max_frame_list_size_in_page);
+                             "max_grant_frames is too large (%u,%u)\n",
+                             max_grant_frames, max_frame_list_size_in_page);
                     rc = -EINVAL;
                 }
                 else
@@ -284,11 +284,11 @@ int compat_grant_table_op(unsigned int cmd,
                 break;
             }
             if ( max_frame_list_size_in_pages <
-                 grant_to_status_frames(max_nr_grant_frames) )
+                 grant_to_status_frames(max_grant_frames) )
             {
                 gdprintk(XENLOG_WARNING,
-                         "grant_to_status_frames(max_nr_grant_frames) is too large (%u,%u)\n",
-                         grant_to_status_frames(max_nr_grant_frames),
+                         "grant_to_status_frames(max_grant_frames) is too large (%u,%u)\n",
+                         grant_to_status_frames(max_grant_frames),
                          max_frame_list_size_in_pages);
                 rc = -EINVAL;
                 break;
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 23266c3..f9a9b44 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -40,16 +40,27 @@
 #include <xsm/xsm.h>
 #include <asm/flushtlb.h>
 
-#ifndef max_nr_grant_frames
-unsigned int max_nr_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES;
+/* 
+ * This option is deprecated, use gnttab_max_frames and
+ * gnttab_max_maptrack_frames instead.
+ */
+static unsigned int __initdata max_nr_grant_frames;
 integer_param("gnttab_max_nr_frames", max_nr_grant_frames);
-#endif
+
+unsigned int __read_mostly max_grant_frames;
+integer_param("gnttab_max_frames", max_grant_frames);
 
 /* The maximum number of grant mappings is defined as a multiplier of the
  * maximum number of grant table entries. This defines the multiplier used.
  * Pretty arbitrary. [POLICY]
+ * As gnttab_max_nr_frames has been deprecated, this multiplier is deprecated too.
+ * New options allow to set max_maptrack_frames and
+ * map_grant_table_frames independently.
  */
-#define MAX_MAPTRACK_TO_GRANTS_RATIO 8
+#define DEFAULT_MAX_MAPTRACK_FRAMES 256
+
+static unsigned int __read_mostly max_maptrack_frames;
+integer_param("gnttab_max_maptrack_frames", max_maptrack_frames);
 
 /*
  * The first two members of a grant entry are updated as a combined pair.
@@ -102,11 +113,6 @@ nr_maptrack_frames(struct grant_table *t)
     return t->maptrack_limit / MAPTRACK_PER_PAGE;
 }
 
-static unsigned inline int max_nr_maptrack_frames(void)
-{
-    return (max_nr_grant_frames * MAX_MAPTRACK_TO_GRANTS_RATIO);
-}
-
 #define MAPTRACK_TAIL (~0u)
 
 #define SHGNT_PER_PAGE_V1 (PAGE_SIZE / sizeof(grant_entry_v1_t))
@@ -164,7 +170,7 @@ num_act_frames_from_sha_frames(const unsigned int num)
 }
 
 #define max_nr_active_grant_frames \
-    num_act_frames_from_sha_frames(max_nr_grant_frames)
+    num_act_frames_from_sha_frames(max_grant_frames)
 
 static inline unsigned int
 nr_active_grant_frames(struct grant_table *gt)
@@ -271,7 +277,7 @@ get_maptrack_handle(
     while ( unlikely((handle = __get_maptrack_handle(lgt)) == -1) )
     {
         nr_frames = nr_maptrack_frames(lgt);
-        if ( nr_frames >= max_nr_maptrack_frames() )
+        if ( nr_frames >= max_maptrack_frames )
             break;
 
         new_mt = alloc_xenheap_page();
@@ -1265,7 +1271,7 @@ gnttab_grow_table(struct domain *d, unsigned int req_nr_frames)
     struct grant_table *gt = d->grant_table;
     unsigned int i;
 
-    ASSERT(req_nr_frames <= max_nr_grant_frames);
+    ASSERT(req_nr_frames <= max_grant_frames);
 
     gdprintk(XENLOG_INFO,
             "Expanding dom (%d) grant table from (%d) to (%d) frames.\n",
@@ -1338,11 +1344,11 @@ gnttab_setup_table(
         return -EFAULT;
     }
 
-    if ( unlikely(op.nr_frames > max_nr_grant_frames) )
+    if ( unlikely(op.nr_frames > max_grant_frames) )
     {
         gdprintk(XENLOG_INFO, "Xen only supports up to %d grant-table frames"
                 " per domain.\n",
-                max_nr_grant_frames);
+                max_grant_frames);
         op.status = GNTST_general_error;
         goto out1;
     }
@@ -1377,7 +1383,7 @@ gnttab_setup_table(
     {
         gdprintk(XENLOG_INFO,
                  "Expand grant table to %u failed. Current: %u Max: %u\n",
-                 op.nr_frames, nr_grant_frames(gt), max_nr_grant_frames);
+                 op.nr_frames, nr_grant_frames(gt), max_grant_frames);
         op.status = GNTST_general_error;
         goto out3;
     }
@@ -1438,7 +1444,7 @@ gnttab_query_size(
     spin_lock(&d->grant_table->lock);
 
     op.nr_frames     = nr_grant_frames(d->grant_table);
-    op.max_nr_frames = max_nr_grant_frames;
+    op.max_nr_frames = max_grant_frames;
     op.status        = GNTST_okay;
 
     spin_unlock(&d->grant_table->lock);
@@ -2659,7 +2665,7 @@ grant_table_create(
 
     /* Tracking of mapped foreign frames table */
     if ( (t->maptrack = xzalloc_array(struct grant_mapping *,
-                                      max_nr_maptrack_frames())) == NULL )
+                                      max_maptrack_frames)) == NULL )
         goto no_mem_2;
     if ( (t->maptrack[0] = alloc_xenheap_page()) == NULL )
         goto no_mem_3;
@@ -2670,7 +2676,7 @@ grant_table_create(
     t->maptrack[0][i - 1].ref = MAPTRACK_TAIL;
 
     /* Shared grant table. */
-    if ( (t->shared_raw = xzalloc_array(void *, max_nr_grant_frames)) == NULL )
+    if ( (t->shared_raw = xzalloc_array(void *, max_grant_frames)) == NULL )
         goto no_mem_3;
     for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
     {
@@ -2681,7 +2687,7 @@ grant_table_create(
     
     /* Status pages for grant table - for version 2 */
     t->status = xzalloc_array(grant_status_t *,
-                              grant_to_status_frames(max_nr_grant_frames));
+                              grant_to_status_frames(max_grant_frames));
     if ( t->status == NULL )
         goto no_mem_4;
 
@@ -2930,6 +2936,24 @@ static struct keyhandler gnttab_usage_print_all_keyhandler = {
 
 static int __init gnttab_usage_init(void)
 {
+    if ( max_nr_grant_frames )
+    {
+        printk(XENLOG_WARNING
+               "gnttab_max_nr_frames is deprecated, use gnttab_max_frames instead\n");
+        if ( !max_grant_frames )
+            max_grant_frames = max_nr_grant_frames;
+        BUILD_BUG_ON(DEFAULT_MAX_MAPTRACK_FRAMES < DEFAULT_MAX_NR_GRANT_FRAMES);
+        if ( !max_maptrack_frames )
+            max_maptrack_frames = max_nr_grant_frames *
+                (DEFAULT_MAX_MAPTRACK_FRAMES / DEFAULT_MAX_NR_GRANT_FRAMES);
+    }
+
+    if ( !max_grant_frames )
+        max_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES;
+
+    if ( !max_maptrack_frames )
+        max_maptrack_frames = DEFAULT_MAX_MAPTRACK_FRAMES;
+
     register_keyhandler('g', &gnttab_usage_print_all_keyhandler);
     return 0;
 }
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index 47147ce..e798880 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -31,7 +31,7 @@ static inline int replace_grant_supported(void)
 
 #define gnttab_shared_gmfn(d, t, i)                                      \
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
-     (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
+     (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
 
 #define gnttab_need_iommu_mapping(d)           (is_domain_direct_mapped(d))
 
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 5941191..32f5786 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -49,10 +49,8 @@
 /* Default maximum size of a grant table. [POLICY] */
 #define DEFAULT_MAX_NR_GRANT_FRAMES   32
 #endif
-#ifndef max_nr_grant_frames /* to allow arch to override */
 /* The maximum size of a grant table. */
-extern unsigned int max_nr_grant_frames;
-#endif
+extern unsigned int max_grant_frames;
 
 /*
  * Tracks a mapping of another domain's grant reference. Each domain has a
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlmZ-0007Ye-PM; Thu, 30 Oct 2014 09:12:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmZ-0007YV-BV
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:39 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	19/D8-13389-60102545; Thu, 30 Oct 2014 09:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1414660356!12605503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7096 invoked from network); 30 Oct 2014 09:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmW-0005fl-Fv
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmW-0000Vi-Ev
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:36 +0000
Date: Thu, 30 Oct 2014 09:12:36 +0000
Message-Id: <E1XjlmW-0000Vi-Ev@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: rename *_xen_dcache_* operations
	to *_dcache_*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ca94c6bff41be3e8676f28a5383b87d0e46280d
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:03:09 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:03:09 2014 +0200

    arm: rename *_xen_dcache_* operations to *_dcache_*
    
    Given that we are in Xen, it is obvious that these are Xen flushes.
    Also the correspondent x86 functions are going to be named without
    _xen_, so remove it here for consistency.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/guestcopy.c         |    2 +-
 xen/arch/arm/kernel.c            |    2 +-
 xen/arch/arm/mm.c                |   24 ++++++++++++------------
 xen/arch/arm/p2m.c               |    4 ++--
 xen/arch/arm/smpboot.c           |    2 +-
 xen/include/asm-arm/arm32/page.h |    4 ++--
 xen/include/asm-arm/arm64/page.h |    4 ++--
 xen/include/asm-arm/page.h       |   20 ++++++++++----------
 8 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index 0173597..7dbaeca 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -27,7 +27,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
         p += offset;
         memcpy(p, from, size);
         if ( flush_dcache )
-            clean_xen_dcache_va_range(p, size);
+            clean_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
         put_page(page);
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 1b8ac9a..209c3dd 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -57,7 +57,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
 
         set_fixmap(FIXMAP_MISC, p, BUFFERABLE);
         memcpy(dst, src + s, l);
-        clean_xen_dcache_va_range(dst, l);
+        clean_dcache_va_range(dst, l);
 
         paddr += l;
         dst += l;
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 911c850..7d4ba0c 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -388,7 +388,7 @@ void flush_page_to_ram(unsigned long mfn)
 {
     void *v = map_domain_page(mfn);
 
-    clean_and_invalidate_xen_dcache_va_range(v, PAGE_SIZE);
+    clean_and_invalidate_dcache_va_range(v, PAGE_SIZE);
     unmap_domain_page(v);
 }
 
@@ -511,17 +511,17 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     /* Clear the copy of the boot pagetables. Each secondary CPU
      * rebuilds these itself (see head.S) */
     memset(boot_pgtable, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_pgtable);
+    clean_and_invalidate_dcache(boot_pgtable);
 #ifdef CONFIG_ARM_64
     memset(boot_first, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_first);
+    clean_and_invalidate_dcache(boot_first);
     memset(boot_first_id, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_first_id);
+    clean_and_invalidate_dcache(boot_first_id);
 #endif
     memset(boot_second, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_second);
+    clean_and_invalidate_dcache(boot_second);
     memset(boot_third, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_third);
+    clean_and_invalidate_dcache(boot_third);
 
     /* Break up the Xen mapping into 4k pages and protect them separately. */
     for ( i = 0; i < LPAE_ENTRIES; i++ )
@@ -559,7 +559,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 
     /* Make sure it is clear */
     memset(this_cpu(xen_dommap), 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
-    clean_xen_dcache_va_range(this_cpu(xen_dommap),
+    clean_dcache_va_range(this_cpu(xen_dommap),
                               DOMHEAP_SECOND_PAGES*PAGE_SIZE);
 #endif
 }
@@ -570,7 +570,7 @@ int init_secondary_pagetables(int cpu)
     /* Set init_ttbr for this CPU coming up. All CPus share a single setof
      * pagetables, but rewrite it each time for consistency with 32 bit. */
     init_ttbr = (uintptr_t) xen_pgtable + phys_offset;
-    clean_xen_dcache(init_ttbr);
+    clean_dcache(init_ttbr);
     return 0;
 }
 #else
@@ -605,15 +605,15 @@ int init_secondary_pagetables(int cpu)
         write_pte(&first[first_table_offset(DOMHEAP_VIRT_START+i*FIRST_SIZE)], pte);
     }
 
-    clean_xen_dcache_va_range(first, PAGE_SIZE);
-    clean_xen_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+    clean_dcache_va_range(first, PAGE_SIZE);
+    clean_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
 
     per_cpu(xen_pgtable, cpu) = first;
     per_cpu(xen_dommap, cpu) = domheap;
 
     /* Set init_ttbr for this CPU coming up */
     init_ttbr = __pa(first);
-    clean_xen_dcache(init_ttbr);
+    clean_dcache(init_ttbr);
 
     return 0;
 }
@@ -1287,7 +1287,7 @@ void clear_and_clean_page(struct page_info *page)
     void *p = __map_domain_page(page);
 
     clear_page(p);
-    clean_xen_dcache_va_range(p, PAGE_SIZE);
+    clean_dcache_va_range(p, PAGE_SIZE);
     unmap_domain_page(p);
 }
 
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 76d2369..2760d98 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -350,7 +350,7 @@ static inline void p2m_write_pte(lpae_t *p, lpae_t pte, bool_t flush_cache)
 {
     write_pte(p, pte);
     if ( flush_cache )
-        clean_xen_dcache(*p);
+        clean_dcache(*p);
 }
 
 /*
@@ -410,7 +410,7 @@ static int p2m_create_table(struct domain *d, lpae_t *entry,
         clear_page(p);
 
     if ( flush_cache )
-        clean_xen_dcache_va_range(p, PAGE_SIZE);
+        clean_dcache_va_range(p, PAGE_SIZE);
 
     unmap_domain_page(p);
 
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ee395a1..14054ae 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -374,7 +374,7 @@ int __cpu_up(unsigned int cpu)
 
     /* Open the gate for this CPU */
     smp_up_cpu = cpu_logical_map(cpu);
-    clean_xen_dcache(smp_up_cpu);
+    clean_dcache(smp_up_cpu);
 
     rc = arch_cpu_up(cpu);
 
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 9740672..20a6a7f 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -20,11 +20,11 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 }
 
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
-#define __clean_xen_dcache_one(R) STORE_CP32(R, DCCMVAC)
+#define __clean_dcache_one(R) STORE_CP32(R, DCCMVAC)
 
 /* Inline ASM to clean and invalidate dcache on register R (may be an
  * inline asm operand) */
-#define __clean_and_invalidate_xen_dcache_one(R) STORE_CP32(R, DCCIMVAC)
+#define __clean_and_invalidate_dcache_one(R) STORE_CP32(R, DCCIMVAC)
 
 /*
  * Flush all hypervisor mappings from the TLB and branch predictor of
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index bb10164..101d7a8 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -15,11 +15,11 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 }
 
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
-#define __clean_xen_dcache_one(R) "dc cvac, %" #R ";"
+#define __clean_dcache_one(R) "dc cvac, %" #R ";"
 
 /* Inline ASM to clean and invalidate dcache on register R (may be an
  * inline asm operand) */
-#define __clean_and_invalidate_xen_dcache_one(R) "dc  civac, %" #R ";"
+#define __clean_and_invalidate_dcache_one(R) "dc  civac, %" #R ";"
 
 /*
  * Flush all hypervisor mappings from the TLB of the local processor.
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index d758b61..fb1e710 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -268,48 +268,48 @@ extern size_t cacheline_bytes;
 /* Functions for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
-static inline void clean_xen_dcache_va_range(const void *p, unsigned long size)
+static inline void clean_dcache_va_range(const void *p, unsigned long size)
 {
     const void *end;
     dsb(sy);           /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
-        asm volatile (__clean_xen_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_dcache_one(0) : : "r" (p));
     dsb(sy);           /* So we know the flushes happen before continuing */
 }
 
-static inline void clean_and_invalidate_xen_dcache_va_range
+static inline void clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     const void *end;
     dsb(sy);         /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
-        asm volatile (__clean_and_invalidate_xen_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
     dsb(sy);         /* So we know the flushes happen before continuing */
 }
 
 /* Macros for flushing a single small item.  The predicate is always
  * compile-time constant so this will compile down to 3 instructions in
  * the common case. */
-#define clean_xen_dcache(x) do {                                        \
+#define clean_dcache(x) do {                                            \
     typeof(x) *_p = &(x);                                               \
     if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
-        clean_xen_dcache_va_range(_p, sizeof(x));                       \
+        clean_dcache_va_range(_p, sizeof(x));                           \
     else                                                                \
         asm volatile (                                                  \
             "dsb sy;"   /* Finish all earlier writes */                 \
-            __clean_xen_dcache_one(0)                                   \
+            __clean_dcache_one(0)                                       \
             "dsb sy;"   /* Finish flush before continuing */            \
             : : "r" (_p), "m" (*_p));                                   \
 } while (0)
 
-#define clean_and_invalidate_xen_dcache(x) do {                         \
+#define clean_and_invalidate_dcache(x) do {                             \
     typeof(x) *_p = &(x);                                               \
     if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
-        clean_and_invalidate_xen_dcache_va_range(_p, sizeof(x));        \
+        clean_and_invalidate_dcache_va_range(_p, sizeof(x));            \
     else                                                                \
         asm volatile (                                                  \
             "dsb sy;"   /* Finish all earlier writes */                 \
-            __clean_and_invalidate_xen_dcache_one(0)                    \
+            __clean_and_invalidate_dcache_one(0)                        \
             "dsb sy;"   /* Finish flush before continuing */            \
             : : "r" (_p), "m" (*_p));                                   \
 } while (0)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlmZ-0007Ye-PM; Thu, 30 Oct 2014 09:12:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmZ-0007YV-BV
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:39 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	19/D8-13389-60102545; Thu, 30 Oct 2014 09:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1414660356!12605503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7096 invoked from network); 30 Oct 2014 09:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmW-0005fl-Fv
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlmW-0000Vi-Ev
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:36 +0000
Date: Thu, 30 Oct 2014 09:12:36 +0000
Message-Id: <E1XjlmW-0000Vi-Ev@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: rename *_xen_dcache_* operations
	to *_dcache_*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ca94c6bff41be3e8676f28a5383b87d0e46280d
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:03:09 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:03:09 2014 +0200

    arm: rename *_xen_dcache_* operations to *_dcache_*
    
    Given that we are in Xen, it is obvious that these are Xen flushes.
    Also the correspondent x86 functions are going to be named without
    _xen_, so remove it here for consistency.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/guestcopy.c         |    2 +-
 xen/arch/arm/kernel.c            |    2 +-
 xen/arch/arm/mm.c                |   24 ++++++++++++------------
 xen/arch/arm/p2m.c               |    4 ++--
 xen/arch/arm/smpboot.c           |    2 +-
 xen/include/asm-arm/arm32/page.h |    4 ++--
 xen/include/asm-arm/arm64/page.h |    4 ++--
 xen/include/asm-arm/page.h       |   20 ++++++++++----------
 8 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index 0173597..7dbaeca 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -27,7 +27,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
         p += offset;
         memcpy(p, from, size);
         if ( flush_dcache )
-            clean_xen_dcache_va_range(p, size);
+            clean_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
         put_page(page);
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 1b8ac9a..209c3dd 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -57,7 +57,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
 
         set_fixmap(FIXMAP_MISC, p, BUFFERABLE);
         memcpy(dst, src + s, l);
-        clean_xen_dcache_va_range(dst, l);
+        clean_dcache_va_range(dst, l);
 
         paddr += l;
         dst += l;
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 911c850..7d4ba0c 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -388,7 +388,7 @@ void flush_page_to_ram(unsigned long mfn)
 {
     void *v = map_domain_page(mfn);
 
-    clean_and_invalidate_xen_dcache_va_range(v, PAGE_SIZE);
+    clean_and_invalidate_dcache_va_range(v, PAGE_SIZE);
     unmap_domain_page(v);
 }
 
@@ -511,17 +511,17 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     /* Clear the copy of the boot pagetables. Each secondary CPU
      * rebuilds these itself (see head.S) */
     memset(boot_pgtable, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_pgtable);
+    clean_and_invalidate_dcache(boot_pgtable);
 #ifdef CONFIG_ARM_64
     memset(boot_first, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_first);
+    clean_and_invalidate_dcache(boot_first);
     memset(boot_first_id, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_first_id);
+    clean_and_invalidate_dcache(boot_first_id);
 #endif
     memset(boot_second, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_second);
+    clean_and_invalidate_dcache(boot_second);
     memset(boot_third, 0x0, PAGE_SIZE);
-    clean_and_invalidate_xen_dcache(boot_third);
+    clean_and_invalidate_dcache(boot_third);
 
     /* Break up the Xen mapping into 4k pages and protect them separately. */
     for ( i = 0; i < LPAE_ENTRIES; i++ )
@@ -559,7 +559,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
 
     /* Make sure it is clear */
     memset(this_cpu(xen_dommap), 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
-    clean_xen_dcache_va_range(this_cpu(xen_dommap),
+    clean_dcache_va_range(this_cpu(xen_dommap),
                               DOMHEAP_SECOND_PAGES*PAGE_SIZE);
 #endif
 }
@@ -570,7 +570,7 @@ int init_secondary_pagetables(int cpu)
     /* Set init_ttbr for this CPU coming up. All CPus share a single setof
      * pagetables, but rewrite it each time for consistency with 32 bit. */
     init_ttbr = (uintptr_t) xen_pgtable + phys_offset;
-    clean_xen_dcache(init_ttbr);
+    clean_dcache(init_ttbr);
     return 0;
 }
 #else
@@ -605,15 +605,15 @@ int init_secondary_pagetables(int cpu)
         write_pte(&first[first_table_offset(DOMHEAP_VIRT_START+i*FIRST_SIZE)], pte);
     }
 
-    clean_xen_dcache_va_range(first, PAGE_SIZE);
-    clean_xen_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+    clean_dcache_va_range(first, PAGE_SIZE);
+    clean_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
 
     per_cpu(xen_pgtable, cpu) = first;
     per_cpu(xen_dommap, cpu) = domheap;
 
     /* Set init_ttbr for this CPU coming up */
     init_ttbr = __pa(first);
-    clean_xen_dcache(init_ttbr);
+    clean_dcache(init_ttbr);
 
     return 0;
 }
@@ -1287,7 +1287,7 @@ void clear_and_clean_page(struct page_info *page)
     void *p = __map_domain_page(page);
 
     clear_page(p);
-    clean_xen_dcache_va_range(p, PAGE_SIZE);
+    clean_dcache_va_range(p, PAGE_SIZE);
     unmap_domain_page(p);
 }
 
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 76d2369..2760d98 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -350,7 +350,7 @@ static inline void p2m_write_pte(lpae_t *p, lpae_t pte, bool_t flush_cache)
 {
     write_pte(p, pte);
     if ( flush_cache )
-        clean_xen_dcache(*p);
+        clean_dcache(*p);
 }
 
 /*
@@ -410,7 +410,7 @@ static int p2m_create_table(struct domain *d, lpae_t *entry,
         clear_page(p);
 
     if ( flush_cache )
-        clean_xen_dcache_va_range(p, PAGE_SIZE);
+        clean_dcache_va_range(p, PAGE_SIZE);
 
     unmap_domain_page(p);
 
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ee395a1..14054ae 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -374,7 +374,7 @@ int __cpu_up(unsigned int cpu)
 
     /* Open the gate for this CPU */
     smp_up_cpu = cpu_logical_map(cpu);
-    clean_xen_dcache(smp_up_cpu);
+    clean_dcache(smp_up_cpu);
 
     rc = arch_cpu_up(cpu);
 
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 9740672..20a6a7f 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -20,11 +20,11 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 }
 
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
-#define __clean_xen_dcache_one(R) STORE_CP32(R, DCCMVAC)
+#define __clean_dcache_one(R) STORE_CP32(R, DCCMVAC)
 
 /* Inline ASM to clean and invalidate dcache on register R (may be an
  * inline asm operand) */
-#define __clean_and_invalidate_xen_dcache_one(R) STORE_CP32(R, DCCIMVAC)
+#define __clean_and_invalidate_dcache_one(R) STORE_CP32(R, DCCIMVAC)
 
 /*
  * Flush all hypervisor mappings from the TLB and branch predictor of
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index bb10164..101d7a8 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -15,11 +15,11 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 }
 
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
-#define __clean_xen_dcache_one(R) "dc cvac, %" #R ";"
+#define __clean_dcache_one(R) "dc cvac, %" #R ";"
 
 /* Inline ASM to clean and invalidate dcache on register R (may be an
  * inline asm operand) */
-#define __clean_and_invalidate_xen_dcache_one(R) "dc  civac, %" #R ";"
+#define __clean_and_invalidate_dcache_one(R) "dc  civac, %" #R ";"
 
 /*
  * Flush all hypervisor mappings from the TLB of the local processor.
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index d758b61..fb1e710 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -268,48 +268,48 @@ extern size_t cacheline_bytes;
 /* Functions for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
-static inline void clean_xen_dcache_va_range(const void *p, unsigned long size)
+static inline void clean_dcache_va_range(const void *p, unsigned long size)
 {
     const void *end;
     dsb(sy);           /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
-        asm volatile (__clean_xen_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_dcache_one(0) : : "r" (p));
     dsb(sy);           /* So we know the flushes happen before continuing */
 }
 
-static inline void clean_and_invalidate_xen_dcache_va_range
+static inline void clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     const void *end;
     dsb(sy);         /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
-        asm volatile (__clean_and_invalidate_xen_dcache_one(0) : : "r" (p));
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
     dsb(sy);         /* So we know the flushes happen before continuing */
 }
 
 /* Macros for flushing a single small item.  The predicate is always
  * compile-time constant so this will compile down to 3 instructions in
  * the common case. */
-#define clean_xen_dcache(x) do {                                        \
+#define clean_dcache(x) do {                                            \
     typeof(x) *_p = &(x);                                               \
     if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
-        clean_xen_dcache_va_range(_p, sizeof(x));                       \
+        clean_dcache_va_range(_p, sizeof(x));                           \
     else                                                                \
         asm volatile (                                                  \
             "dsb sy;"   /* Finish all earlier writes */                 \
-            __clean_xen_dcache_one(0)                                   \
+            __clean_dcache_one(0)                                       \
             "dsb sy;"   /* Finish flush before continuing */            \
             : : "r" (_p), "m" (*_p));                                   \
 } while (0)
 
-#define clean_and_invalidate_xen_dcache(x) do {                         \
+#define clean_and_invalidate_dcache(x) do {                             \
     typeof(x) *_p = &(x);                                               \
     if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) )    \
-        clean_and_invalidate_xen_dcache_va_range(_p, sizeof(x));        \
+        clean_and_invalidate_dcache_va_range(_p, sizeof(x));            \
     else                                                                \
         asm volatile (                                                  \
             "dsb sy;"   /* Finish all earlier writes */                 \
-            __clean_and_invalidate_xen_dcache_one(0)                    \
+            __clean_and_invalidate_dcache_one(0)                        \
             "dsb sy;"   /* Finish flush before continuing */            \
             : : "r" (_p), "m" (*_p));                                   \
 } while (0)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlmj-0007aV-S3; Thu, 30 Oct 2014 09:12:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmj-0007aG-3m
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:49 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	23/42-02953-01102545; Thu, 30 Oct 2014 09:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1414660366!8789525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22774 invoked from network); 30 Oct 2014 09:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmg-0005fr-LC
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmg-0000W4-Ju
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:46 +0000
Date: Thu, 30 Oct 2014 09:12:46 +0000
Message-Id: <E1Xjlmg-0000W4-Ju@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: return int from *_dcache_va_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71d64afe3e122f22bebf9ae277f573b849eb75f4
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:03:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:03:47 2014 +0200

    arm: return int from *_dcache_va_range
    
    These functions cannot really fail on ARM, but their x86 equivalents can
    (-EOPNOTSUPP). Change the prototype to return int.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/page.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index fb1e710..69e9a61 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -268,16 +268,18 @@ extern size_t cacheline_bytes;
 /* Functions for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
-static inline void clean_dcache_va_range(const void *p, unsigned long size)
+static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     const void *end;
     dsb(sy);           /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
         asm volatile (__clean_dcache_one(0) : : "r" (p));
     dsb(sy);           /* So we know the flushes happen before continuing */
+    /* ARM callers assume that dcache_* functions cannot fail. */
+    return 0;
 }
 
-static inline void clean_and_invalidate_dcache_va_range
+static inline int clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     const void *end;
@@ -285,6 +287,8 @@ static inline void clean_and_invalidate_dcache_va_range
     for ( end = p + size; p < end; p += cacheline_bytes )
         asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
     dsb(sy);         /* So we know the flushes happen before continuing */
+    /* ARM callers assume that dcache_* functions cannot fail. */
+    return 0;
 }
 
 /* Macros for flushing a single small item.  The predicate is always
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:12:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlmj-0007aV-S3; Thu, 30 Oct 2014 09:12:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmj-0007aG-3m
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:49 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	23/42-02953-01102545; Thu, 30 Oct 2014 09:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1414660366!8789525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22774 invoked from network); 30 Oct 2014 09:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmg-0005fr-LC
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmg-0000W4-Ju
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:46 +0000
Date: Thu, 30 Oct 2014 09:12:46 +0000
Message-Id: <E1Xjlmg-0000W4-Ju@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: return int from *_dcache_va_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71d64afe3e122f22bebf9ae277f573b849eb75f4
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:03:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:03:47 2014 +0200

    arm: return int from *_dcache_va_range
    
    These functions cannot really fail on ARM, but their x86 equivalents can
    (-EOPNOTSUPP). Change the prototype to return int.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/page.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index fb1e710..69e9a61 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -268,16 +268,18 @@ extern size_t cacheline_bytes;
 /* Functions for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
-static inline void clean_dcache_va_range(const void *p, unsigned long size)
+static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     const void *end;
     dsb(sy);           /* So the CPU issues all writes to the range */
     for ( end = p + size; p < end; p += cacheline_bytes )
         asm volatile (__clean_dcache_one(0) : : "r" (p));
     dsb(sy);           /* So we know the flushes happen before continuing */
+    /* ARM callers assume that dcache_* functions cannot fail. */
+    return 0;
 }
 
-static inline void clean_and_invalidate_dcache_va_range
+static inline int clean_and_invalidate_dcache_va_range
     (const void *p, unsigned long size)
 {
     const void *end;
@@ -285,6 +287,8 @@ static inline void clean_and_invalidate_dcache_va_range
     for ( end = p + size; p < end; p += cacheline_bytes )
         asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
     dsb(sy);         /* So we know the flushes happen before continuing */
+    /* ARM callers assume that dcache_* functions cannot fail. */
+    return 0;
 }
 
 /* Macros for flushing a single small item.  The predicate is always
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlmu-0007ce-0e; Thu, 30 Oct 2014 09:13:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmt-0007cS-GD
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:59 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	67/28-02954-A1102545; Thu, 30 Oct 2014 09:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1414660377!12613863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21519 invoked from network); 30 Oct 2014 09:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmq-0005g4-SR
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmq-0000X9-Qp
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:56 +0000
Date: Thu, 30 Oct 2014 09:12:56 +0000
Message-Id: <E1Xjlmq-0000X9-Qp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: introduce
	invalidate_dcache_va_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 09146ae71bab04fc0f4487444196632aee6de8bf
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:04:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:04:19 2014 +0200

    arm: introduce invalidate_dcache_va_range
    
    Take care of handling non-cacheline aligned addresses and sizes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/arm32/page.h |    3 +++
 xen/include/asm-arm/arm64/page.h |    3 +++
 xen/include/asm-arm/page.h       |   32 ++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 20a6a7f..a07e217 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -19,6 +19,9 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+/* Inline ASM to invalidate dcache on register R (may be an inline asm operand) */
+#define __invalidate_dcache_one(R) STORE_CP32(R, DCIMVAC)
+
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
 #define __clean_dcache_one(R) STORE_CP32(R, DCCMVAC)
 
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 101d7a8..1fd416d 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -14,6 +14,9 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+/* Inline ASM to invalidate dcache on register R (may be an inline asm operand) */
+#define __invalidate_dcache_one(R) "dc ivac, %" #R ";"
+
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
 #define __clean_dcache_one(R) "dc cvac, %" #R ";"
 
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 69e9a61..53d4b63 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -268,6 +268,38 @@ extern size_t cacheline_bytes;
 /* Functions for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
+
+static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
+{
+    size_t off;
+    const void *end = p + size;
+
+    dsb(sy);           /* So the CPU issues all writes to the range */
+
+    off = (unsigned long)p % cacheline_bytes;
+    if ( off )
+    {
+        p -= off;
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+        p += cacheline_bytes;
+        size -= cacheline_bytes - off;
+    }
+    off = (unsigned long)end % cacheline_bytes;
+    if ( off )
+    {
+        end -= off;
+        size -= off;
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (end));
+    }
+
+    for ( ; p < end; p += cacheline_bytes )
+        asm volatile (__invalidate_dcache_one(0) : : "r" (p));
+
+    dsb(sy);           /* So we know the flushes happen before continuing */
+
+    return 0;
+}
+
 static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     const void *end;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlmu-0007ce-0e; Thu, 30 Oct 2014 09:13:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmt-0007cS-GD
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:59 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	67/28-02954-A1102545; Thu, 30 Oct 2014 09:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1414660377!12613863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21519 invoked from network); 30 Oct 2014 09:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmq-0005g4-SR
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlmq-0000X9-Qp
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:12:56 +0000
Date: Thu, 30 Oct 2014 09:12:56 +0000
Message-Id: <E1Xjlmq-0000X9-Qp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: introduce
	invalidate_dcache_va_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 09146ae71bab04fc0f4487444196632aee6de8bf
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:04:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:04:19 2014 +0200

    arm: introduce invalidate_dcache_va_range
    
    Take care of handling non-cacheline aligned addresses and sizes.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/arm32/page.h |    3 +++
 xen/include/asm-arm/arm64/page.h |    3 +++
 xen/include/asm-arm/page.h       |   32 ++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 20a6a7f..a07e217 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -19,6 +19,9 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+/* Inline ASM to invalidate dcache on register R (may be an inline asm operand) */
+#define __invalidate_dcache_one(R) STORE_CP32(R, DCIMVAC)
+
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
 #define __clean_dcache_one(R) STORE_CP32(R, DCCMVAC)
 
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 101d7a8..1fd416d 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -14,6 +14,9 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
         : : "r" (pte.bits), "r" (p) : "memory");
 }
 
+/* Inline ASM to invalidate dcache on register R (may be an inline asm operand) */
+#define __invalidate_dcache_one(R) "dc ivac, %" #R ";"
+
 /* Inline ASM to flush dcache on register R (may be an inline asm operand) */
 #define __clean_dcache_one(R) "dc cvac, %" #R ";"
 
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 69e9a61..53d4b63 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -268,6 +268,38 @@ extern size_t cacheline_bytes;
 /* Functions for flushing medium-sized areas.
  * if 'range' is large enough we might want to use model-specific
  * full-cache flushes. */
+
+static inline int invalidate_dcache_va_range(const void *p, unsigned long size)
+{
+    size_t off;
+    const void *end = p + size;
+
+    dsb(sy);           /* So the CPU issues all writes to the range */
+
+    off = (unsigned long)p % cacheline_bytes;
+    if ( off )
+    {
+        p -= off;
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p));
+        p += cacheline_bytes;
+        size -= cacheline_bytes - off;
+    }
+    off = (unsigned long)end % cacheline_bytes;
+    if ( off )
+    {
+        end -= off;
+        size -= off;
+        asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (end));
+    }
+
+    for ( ; p < end; p += cacheline_bytes )
+        asm volatile (__invalidate_dcache_one(0) : : "r" (p));
+
+    dsb(sy);           /* So we know the flushes happen before continuing */
+
+    return 0;
+}
+
 static inline int clean_dcache_va_range(const void *p, unsigned long size)
 {
     const void *end;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjln4-0007gV-HL; Thu, 30 Oct 2014 09:13:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjln3-0007g0-GL
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:09 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	26/88-02954-42102545; Thu, 30 Oct 2014 09:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414660387!11284640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12272 invoked from network); 30 Oct 2014 09:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjln1-0005gg-2y
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjln1-0000Xj-0I
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:07 +0000
Date: Thu, 30 Oct 2014 09:13:07 +0000
Message-Id: <E1Xjln1-0000Xj-0I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: introduce more cache maintenance
	operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f62dc81c2df7778e1b5a2b7282fc3dc8e5ebf455
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:04:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:04:54 2014 +0200

    x86: introduce more cache maintenance operations
    
    Move the existing flush_page_to_ram flushtlb.h.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/flushtlb.h |   18 ++++++++++++++++++
 xen/include/asm-x86/page.h     |    3 ---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-x86/flushtlb.h b/xen/include/asm-x86/flushtlb.h
index 7f46632..8dbe2d6 100644
--- a/xen/include/asm-x86/flushtlb.h
+++ b/xen/include/asm-x86/flushtlb.h
@@ -11,6 +11,7 @@
 #define __FLUSHTLB_H__
 
 #include <xen/config.h>
+#include <xen/mm.h>
 #include <xen/percpu.h>
 #include <xen/smp.h>
 #include <xen/types.h>
@@ -115,4 +116,21 @@ void flush_area_mask(const cpumask_t *, const void *va, unsigned int flags);
 #define flush_tlb_one_all(v)                    \
     flush_tlb_one_mask(&cpu_online_map, v)
 
+static inline void flush_page_to_ram(unsigned long mfn) {}
+static inline int invalidate_dcache_va_range(const void *p,
+                                             unsigned long size)
+{ return -EOPNOTSUPP; }
+static inline int clean_and_invalidate_dcache_va_range(const void *p,
+                                                       unsigned long size)
+{
+    unsigned int order = get_order_from_bytes(size);
+    /* sub-page granularity support needs to be added if necessary */
+    flush_area_local(p, FLUSH_CACHE|FLUSH_ORDER(order));
+    return 0;
+}
+static inline int clean_dcache_va_range(const void *p, unsigned long size)
+{
+    return clean_and_invalidate_dcache_va_range(p, size);
+}
+
 #endif /* __FLUSHTLB_H__ */
diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
index 9aa780e..a8bc999 100644
--- a/xen/include/asm-x86/page.h
+++ b/xen/include/asm-x86/page.h
@@ -344,9 +344,6 @@ static inline uint32_t cacheattr_to_pte_flags(uint32_t cacheattr)
     return ((cacheattr & 4) << 5) | ((cacheattr & 3) << 3);
 }
 
-/* No cache maintenance required on x86 architecture. */
-static inline void flush_page_to_ram(unsigned long mfn) {}
-
 /* return true if permission increased */
 static inline bool_t
 perms_strictly_increased(uint32_t old_flags, uint32_t new_flags)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjln4-0007gV-HL; Thu, 30 Oct 2014 09:13:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjln3-0007g0-GL
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:09 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	26/88-02954-42102545; Thu, 30 Oct 2014 09:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414660387!11284640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12272 invoked from network); 30 Oct 2014 09:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjln1-0005gg-2y
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjln1-0000Xj-0I
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:07 +0000
Date: Thu, 30 Oct 2014 09:13:07 +0000
Message-Id: <E1Xjln1-0000Xj-0I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: introduce more cache maintenance
	operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f62dc81c2df7778e1b5a2b7282fc3dc8e5ebf455
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:04:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:04:54 2014 +0200

    x86: introduce more cache maintenance operations
    
    Move the existing flush_page_to_ram flushtlb.h.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/flushtlb.h |   18 ++++++++++++++++++
 xen/include/asm-x86/page.h     |    3 ---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-x86/flushtlb.h b/xen/include/asm-x86/flushtlb.h
index 7f46632..8dbe2d6 100644
--- a/xen/include/asm-x86/flushtlb.h
+++ b/xen/include/asm-x86/flushtlb.h
@@ -11,6 +11,7 @@
 #define __FLUSHTLB_H__
 
 #include <xen/config.h>
+#include <xen/mm.h>
 #include <xen/percpu.h>
 #include <xen/smp.h>
 #include <xen/types.h>
@@ -115,4 +116,21 @@ void flush_area_mask(const cpumask_t *, const void *va, unsigned int flags);
 #define flush_tlb_one_all(v)                    \
     flush_tlb_one_mask(&cpu_online_map, v)
 
+static inline void flush_page_to_ram(unsigned long mfn) {}
+static inline int invalidate_dcache_va_range(const void *p,
+                                             unsigned long size)
+{ return -EOPNOTSUPP; }
+static inline int clean_and_invalidate_dcache_va_range(const void *p,
+                                                       unsigned long size)
+{
+    unsigned int order = get_order_from_bytes(size);
+    /* sub-page granularity support needs to be added if necessary */
+    flush_area_local(p, FLUSH_CACHE|FLUSH_ORDER(order));
+    return 0;
+}
+static inline int clean_dcache_va_range(const void *p, unsigned long size)
+{
+    return clean_and_invalidate_dcache_va_range(p, size);
+}
+
 #endif /* __FLUSHTLB_H__ */
diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
index 9aa780e..a8bc999 100644
--- a/xen/include/asm-x86/page.h
+++ b/xen/include/asm-x86/page.h
@@ -344,9 +344,6 @@ static inline uint32_t cacheattr_to_pte_flags(uint32_t cacheattr)
     return ((cacheattr & 4) << 5) | ((cacheattr & 3) << 3);
 }
 
-/* No cache maintenance required on x86 architecture. */
-static inline void flush_page_to_ram(unsigned long mfn) {}
-
 /* return true if permission increased */
 static inline bool_t
 perms_strictly_increased(uint32_t old_flags, uint32_t new_flags)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlnF-0007jJ-K2; Thu, 30 Oct 2014 09:13:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnE-0007iv-6b
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:20 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	C7/F6-02696-F2102545; Thu, 30 Oct 2014 09:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414660397!8762990!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14126 invoked from network); 30 Oct 2014 09:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnB-0005gp-8m
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnB-0000YK-7J
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:17 +0000
Date: Thu, 30 Oct 2014 09:13:17 +0000
Message-Id: <E1XjlnB-0000YK-7J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce GNTTABOP_cache_flush
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18e8d22fe750c8c7b2830fa37961352693425cf1
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:06:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:06:11 2014 +0200

    introduce GNTTABOP_cache_flush
    
    Introduce a new hypercall to perform cache maintenance operation on
    behalf of the guest. The argument is a machine address and a size. The
    implementation checks that the memory range is owned by the guest or the
    guest has been granted access to it by another domain.
    
    Introduce grant_map_exists: an internal grant table function to check
    whether an mfn has been granted to a given domain on a target grant
    table. Check hypercall_preempt_check() every 4096 iterations in the
    implementation of grant_map_exists.
    Use the top 20 bits of the GNTTABOP cmd encoding to save the last ref
    across the hypercall continuation.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/compat/grant_table.c  |   15 +++-
 xen/common/grant_table.c         |  173 +++++++++++++++++++++++++++++++++++++-
 xen/include/public/grant_table.h |   20 +++++
 xen/include/xlat.lst             |    1 +
 4 files changed, 202 insertions(+), 7 deletions(-)

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index 2dc1e44..0368289 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -51,16 +51,21 @@ CHECK_gnttab_get_version;
 CHECK_gnttab_swap_grant_ref;
 #undef xen_gnttab_swap_grant_ref
 
+#define xen_gnttab_cache_flush gnttab_cache_flush
+CHECK_gnttab_cache_flush;
+#undef xen_gnttab_cache_flush
+
 int compat_grant_table_op(unsigned int cmd,
                           XEN_GUEST_HANDLE_PARAM(void) cmp_uop,
                           unsigned int count)
 {
     int rc = 0;
-    unsigned int i;
+    unsigned int i, cmd_op;
     XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
     set_xen_guest_handle(cnt_uop, NULL);
-    switch ( cmd )
+    cmd_op = cmd & GNTTABOP_CMD_MASK;
+    switch ( cmd_op )
     {
 #define CASE(name) \
     case GNTTABOP_##name: \
@@ -106,6 +111,10 @@ int compat_grant_table_op(unsigned int cmd,
     CASE(swap_grant_ref);
 #endif
 
+#ifndef CHECK_gnttab_cache_flush
+    CASE(cache_flush);
+#endif
+
 #undef CASE
     default:
         return do_grant_table_op(cmd, cmp_uop, count);
@@ -132,7 +141,7 @@ int compat_grant_table_op(unsigned int cmd,
         } cmp;
 
         set_xen_guest_handle(nat.uop, COMPAT_ARG_XLAT_VIRT_BASE);
-        switch ( cmd )
+        switch ( cmd_op )
         {
         case GNTTABOP_setup_table:
             if ( unlikely(count > 1) )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f9a9b44..e1296d8 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -62,6 +62,10 @@ integer_param("gnttab_max_frames", max_grant_frames);
 static unsigned int __read_mostly max_maptrack_frames;
 integer_param("gnttab_max_maptrack_frames", max_maptrack_frames);
 
+#define GNTTABOP_CONTINUATION_ARG_SHIFT 12
+#define GNTTABOP_CMD_MASK               ((1<<GNTTABOP_CONTINUATION_ARG_SHIFT)-1)
+#define GNTTABOP_ARG_MASK               (~GNTTABOP_CMD_MASK)
+
 /*
  * The first two members of a grant entry are updated as a combined pair.
  * The following union allows that to happen in an endian-neutral fashion.
@@ -490,6 +494,43 @@ static int _set_status(unsigned gt_version,
         return _set_status_v2(domid, readonly, mapflag, shah, act, status);
 }
 
+static int grant_map_exists(const struct domain *ld,
+                            struct grant_table *rgt,
+                            unsigned long mfn,
+                            unsigned int *ref_count)
+{
+    const struct active_grant_entry *act;
+    unsigned int ref, max_iter;
+    
+    ASSERT(spin_is_locked(&rgt->lock));
+
+    max_iter = min(*ref_count + (1 << GNTTABOP_CONTINUATION_ARG_SHIFT),
+                   nr_grant_entries(rgt));
+    for ( ref = *ref_count; ref < max_iter; ref++ )
+    {
+        act = &active_entry(rgt, ref);
+
+        if ( !act->pin )
+            continue;
+
+        if ( act->domid != ld->domain_id )
+            continue;
+
+        if ( act->frame != mfn )
+            continue;
+
+        return 0;
+    }
+
+    if ( ref < nr_grant_entries(rgt) )
+    {
+        *ref_count = ref;
+        return 1;
+    }
+
+    return -EINVAL;
+}
+
 static void mapcount(
     struct grant_table *lgt, struct domain *rd, unsigned long mfn,
     unsigned int *wrc, unsigned int *rdc)
@@ -2488,17 +2529,124 @@ gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t) uop,
     return 0;
 }
 
+static int __gnttab_cache_flush(gnttab_cache_flush_t *cflush,
+                                unsigned int *ref_count)
+{
+    struct domain *d, *owner;
+    struct page_info *page;
+    unsigned long mfn;
+    void *v;
+    int ret;
+
+    if ( (cflush->offset >= PAGE_SIZE) ||
+         (cflush->length > PAGE_SIZE) ||
+         (cflush->offset + cflush->length > PAGE_SIZE) )
+        return -EINVAL;
+
+    if ( cflush->length == 0 || cflush->op == 0 )
+        return 0;
+
+    /* currently unimplemented */
+    if ( cflush->op & GNTTAB_CACHE_SOURCE_GREF )
+        return -EOPNOTSUPP;
+
+    if ( cflush->op & ~(GNTTAB_CACHE_INVAL|GNTTAB_CACHE_CLEAN) )
+        return -EINVAL;
+
+    d = rcu_lock_current_domain();
+    mfn = cflush->a.dev_bus_addr >> PAGE_SHIFT;
+
+    if ( !mfn_valid(mfn) )
+    {
+        rcu_unlock_domain(d);
+        return -EINVAL;
+    }
+
+    page = mfn_to_page(mfn);
+    owner = page_get_owner_and_reference(page);
+    if ( !owner )
+    {
+        rcu_unlock_domain(d);
+        return -EPERM;
+    }
+
+    if ( d != owner )
+    {
+        spin_lock(&owner->grant_table->lock);
+
+        ret = grant_map_exists(d, owner->grant_table, mfn, ref_count);
+        if ( ret != 0 )
+        {
+            spin_unlock(&owner->grant_table->lock);
+            rcu_unlock_domain(d);
+            put_page(page);
+            return ret;
+        }
+    }
+
+    v = map_domain_page(mfn);
+    v += cflush->offset;
+
+    if ( (cflush->op & GNTTAB_CACHE_INVAL) && (cflush->op & GNTTAB_CACHE_CLEAN) )
+        ret = clean_and_invalidate_dcache_va_range(v, cflush->length);
+    else if ( cflush->op & GNTTAB_CACHE_INVAL )
+        ret = invalidate_dcache_va_range(v, cflush->length);
+    else if ( cflush->op & GNTTAB_CACHE_CLEAN )
+        ret = clean_dcache_va_range(v, cflush->length);
+    else
+        ret = 0;
+
+    if ( d != owner )
+        spin_unlock(&owner->grant_table->lock);
+    unmap_domain_page(v);
+    put_page(page);
+
+    return ret;
+}
+
+static long
+gnttab_cache_flush(XEN_GUEST_HANDLE_PARAM(gnttab_cache_flush_t) uop,
+                      unsigned int *ref_count,
+                      unsigned int count)
+{
+    unsigned int i;
+    gnttab_cache_flush_t op;
+
+    for ( i = 0; i < count; i++ )
+    {
+        if ( i && hypercall_preempt_check() )
+            return i;
+        if ( unlikely(__copy_from_guest(&op, uop, 1)) )
+            return -EFAULT;
+        for ( ; ; )
+        {
+            int ret = __gnttab_cache_flush(&op, ref_count);
+
+            if ( ret < 0 )
+                return ret;
+            if ( ret == 0 )
+                break;
+            if ( hypercall_preempt_check() )
+                return i;
+        }
+        *ref_count = 0;
+        guest_handle_add_offset(uop, 1);
+    }
+    return 0;
+}
+
 long
 do_grant_table_op(
     unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
 {
     long rc;
+    unsigned int opaque_in = cmd & GNTTABOP_ARG_MASK, opaque_out = 0;
     
     if ( (int)count < 0 )
         return -EINVAL;
     
     rc = -EFAULT;
-    switch ( cmd )
+    switch ( cmd &= GNTTABOP_CMD_MASK )
     {
     case GNTTABOP_map_grant_ref:
     {
@@ -2617,17 +2765,34 @@ do_grant_table_op(
         }
         break;
     }
+    case GNTTABOP_cache_flush:
+    {
+        XEN_GUEST_HANDLE_PARAM(gnttab_cache_flush_t) cflush =
+            guest_handle_cast(uop, gnttab_cache_flush_t);
+
+        if ( unlikely(!guest_handle_okay(cflush, count)) )
+            goto out;
+        rc = gnttab_cache_flush(cflush, &opaque_in, count);
+        if ( rc > 0 )
+        {
+            guest_handle_add_offset(cflush, rc);
+            uop = guest_handle_cast(cflush, void);
+        }
+        opaque_out = opaque_in;
+        break;
+    }
     default:
         rc = -ENOSYS;
         break;
     }
     
   out:
-    if ( rc > 0 )
+    if ( rc > 0 || opaque_out != 0 )
     {
         ASSERT(rc < count);
-        rc = hypercall_create_continuation(__HYPERVISOR_grant_table_op,
-                                           "ihi", cmd, uop, count - rc);
+        ASSERT((opaque_out & GNTTABOP_CMD_MASK) == 0);
+        rc = hypercall_create_continuation(__HYPERVISOR_grant_table_op, "ihi",
+                                           opaque_out | cmd, uop, count - rc);
     }
     
     return rc;
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index b8a3d6c..20d4e77 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -309,6 +309,7 @@ typedef uint16_t grant_status_t;
 #define GNTTABOP_get_status_frames    9
 #define GNTTABOP_get_version          10
 #define GNTTABOP_swap_grant_ref	      11
+#define GNTTABOP_cache_flush	      12
 #endif /* __XEN_INTERFACE_VERSION__ */
 /* ` } */
 
@@ -574,6 +575,25 @@ struct gnttab_swap_grant_ref {
 typedef struct gnttab_swap_grant_ref gnttab_swap_grant_ref_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t);
 
+/*
+ * Issue one or more cache maintenance operations on a portion of a
+ * page granted to the calling domain by a foreign domain.
+ */
+struct gnttab_cache_flush {
+    union {
+        uint64_t dev_bus_addr;
+        grant_ref_t ref;
+    } a;
+    uint16_t offset; /* offset from start of grant */
+    uint16_t length; /* size within the grant */
+#define GNTTAB_CACHE_CLEAN          (1<<0)
+#define GNTTAB_CACHE_INVAL          (1<<1)
+#define GNTTAB_CACHE_SOURCE_GREF    (1<<31)
+    uint32_t op;
+};
+typedef struct gnttab_cache_flush gnttab_cache_flush_t;
+DEFINE_XEN_GUEST_HANDLE(gnttab_cache_flush_t);
+
 #endif /* __XEN_INTERFACE_VERSION__ */
 
 /*
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 234b668..41b3e35 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -37,6 +37,7 @@
 ?	evtchn_send			event_channel.h
 ?	evtchn_status			event_channel.h
 ?	evtchn_unmask			event_channel.h
+?	gnttab_cache_flush		grant_table.h
 !	gnttab_copy			grant_table.h
 ?	gnttab_dump_table		grant_table.h
 ?	gnttab_map_grant_ref		grant_table.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlnF-0007jJ-K2; Thu, 30 Oct 2014 09:13:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnE-0007iv-6b
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:20 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	C7/F6-02696-F2102545; Thu, 30 Oct 2014 09:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1414660397!8762990!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14126 invoked from network); 30 Oct 2014 09:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnB-0005gp-8m
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnB-0000YK-7J
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:17 +0000
Date: Thu, 30 Oct 2014 09:13:17 +0000
Message-Id: <E1XjlnB-0000YK-7J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] introduce GNTTABOP_cache_flush
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18e8d22fe750c8c7b2830fa37961352693425cf1
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:06:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:06:11 2014 +0200

    introduce GNTTABOP_cache_flush
    
    Introduce a new hypercall to perform cache maintenance operation on
    behalf of the guest. The argument is a machine address and a size. The
    implementation checks that the memory range is owned by the guest or the
    guest has been granted access to it by another domain.
    
    Introduce grant_map_exists: an internal grant table function to check
    whether an mfn has been granted to a given domain on a target grant
    table. Check hypercall_preempt_check() every 4096 iterations in the
    implementation of grant_map_exists.
    Use the top 20 bits of the GNTTABOP cmd encoding to save the last ref
    across the hypercall continuation.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/compat/grant_table.c  |   15 +++-
 xen/common/grant_table.c         |  173 +++++++++++++++++++++++++++++++++++++-
 xen/include/public/grant_table.h |   20 +++++
 xen/include/xlat.lst             |    1 +
 4 files changed, 202 insertions(+), 7 deletions(-)

diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index 2dc1e44..0368289 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -51,16 +51,21 @@ CHECK_gnttab_get_version;
 CHECK_gnttab_swap_grant_ref;
 #undef xen_gnttab_swap_grant_ref
 
+#define xen_gnttab_cache_flush gnttab_cache_flush
+CHECK_gnttab_cache_flush;
+#undef xen_gnttab_cache_flush
+
 int compat_grant_table_op(unsigned int cmd,
                           XEN_GUEST_HANDLE_PARAM(void) cmp_uop,
                           unsigned int count)
 {
     int rc = 0;
-    unsigned int i;
+    unsigned int i, cmd_op;
     XEN_GUEST_HANDLE_PARAM(void) cnt_uop;
 
     set_xen_guest_handle(cnt_uop, NULL);
-    switch ( cmd )
+    cmd_op = cmd & GNTTABOP_CMD_MASK;
+    switch ( cmd_op )
     {
 #define CASE(name) \
     case GNTTABOP_##name: \
@@ -106,6 +111,10 @@ int compat_grant_table_op(unsigned int cmd,
     CASE(swap_grant_ref);
 #endif
 
+#ifndef CHECK_gnttab_cache_flush
+    CASE(cache_flush);
+#endif
+
 #undef CASE
     default:
         return do_grant_table_op(cmd, cmp_uop, count);
@@ -132,7 +141,7 @@ int compat_grant_table_op(unsigned int cmd,
         } cmp;
 
         set_xen_guest_handle(nat.uop, COMPAT_ARG_XLAT_VIRT_BASE);
-        switch ( cmd )
+        switch ( cmd_op )
         {
         case GNTTABOP_setup_table:
             if ( unlikely(count > 1) )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f9a9b44..e1296d8 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -62,6 +62,10 @@ integer_param("gnttab_max_frames", max_grant_frames);
 static unsigned int __read_mostly max_maptrack_frames;
 integer_param("gnttab_max_maptrack_frames", max_maptrack_frames);
 
+#define GNTTABOP_CONTINUATION_ARG_SHIFT 12
+#define GNTTABOP_CMD_MASK               ((1<<GNTTABOP_CONTINUATION_ARG_SHIFT)-1)
+#define GNTTABOP_ARG_MASK               (~GNTTABOP_CMD_MASK)
+
 /*
  * The first two members of a grant entry are updated as a combined pair.
  * The following union allows that to happen in an endian-neutral fashion.
@@ -490,6 +494,43 @@ static int _set_status(unsigned gt_version,
         return _set_status_v2(domid, readonly, mapflag, shah, act, status);
 }
 
+static int grant_map_exists(const struct domain *ld,
+                            struct grant_table *rgt,
+                            unsigned long mfn,
+                            unsigned int *ref_count)
+{
+    const struct active_grant_entry *act;
+    unsigned int ref, max_iter;
+    
+    ASSERT(spin_is_locked(&rgt->lock));
+
+    max_iter = min(*ref_count + (1 << GNTTABOP_CONTINUATION_ARG_SHIFT),
+                   nr_grant_entries(rgt));
+    for ( ref = *ref_count; ref < max_iter; ref++ )
+    {
+        act = &active_entry(rgt, ref);
+
+        if ( !act->pin )
+            continue;
+
+        if ( act->domid != ld->domain_id )
+            continue;
+
+        if ( act->frame != mfn )
+            continue;
+
+        return 0;
+    }
+
+    if ( ref < nr_grant_entries(rgt) )
+    {
+        *ref_count = ref;
+        return 1;
+    }
+
+    return -EINVAL;
+}
+
 static void mapcount(
     struct grant_table *lgt, struct domain *rd, unsigned long mfn,
     unsigned int *wrc, unsigned int *rdc)
@@ -2488,17 +2529,124 @@ gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t) uop,
     return 0;
 }
 
+static int __gnttab_cache_flush(gnttab_cache_flush_t *cflush,
+                                unsigned int *ref_count)
+{
+    struct domain *d, *owner;
+    struct page_info *page;
+    unsigned long mfn;
+    void *v;
+    int ret;
+
+    if ( (cflush->offset >= PAGE_SIZE) ||
+         (cflush->length > PAGE_SIZE) ||
+         (cflush->offset + cflush->length > PAGE_SIZE) )
+        return -EINVAL;
+
+    if ( cflush->length == 0 || cflush->op == 0 )
+        return 0;
+
+    /* currently unimplemented */
+    if ( cflush->op & GNTTAB_CACHE_SOURCE_GREF )
+        return -EOPNOTSUPP;
+
+    if ( cflush->op & ~(GNTTAB_CACHE_INVAL|GNTTAB_CACHE_CLEAN) )
+        return -EINVAL;
+
+    d = rcu_lock_current_domain();
+    mfn = cflush->a.dev_bus_addr >> PAGE_SHIFT;
+
+    if ( !mfn_valid(mfn) )
+    {
+        rcu_unlock_domain(d);
+        return -EINVAL;
+    }
+
+    page = mfn_to_page(mfn);
+    owner = page_get_owner_and_reference(page);
+    if ( !owner )
+    {
+        rcu_unlock_domain(d);
+        return -EPERM;
+    }
+
+    if ( d != owner )
+    {
+        spin_lock(&owner->grant_table->lock);
+
+        ret = grant_map_exists(d, owner->grant_table, mfn, ref_count);
+        if ( ret != 0 )
+        {
+            spin_unlock(&owner->grant_table->lock);
+            rcu_unlock_domain(d);
+            put_page(page);
+            return ret;
+        }
+    }
+
+    v = map_domain_page(mfn);
+    v += cflush->offset;
+
+    if ( (cflush->op & GNTTAB_CACHE_INVAL) && (cflush->op & GNTTAB_CACHE_CLEAN) )
+        ret = clean_and_invalidate_dcache_va_range(v, cflush->length);
+    else if ( cflush->op & GNTTAB_CACHE_INVAL )
+        ret = invalidate_dcache_va_range(v, cflush->length);
+    else if ( cflush->op & GNTTAB_CACHE_CLEAN )
+        ret = clean_dcache_va_range(v, cflush->length);
+    else
+        ret = 0;
+
+    if ( d != owner )
+        spin_unlock(&owner->grant_table->lock);
+    unmap_domain_page(v);
+    put_page(page);
+
+    return ret;
+}
+
+static long
+gnttab_cache_flush(XEN_GUEST_HANDLE_PARAM(gnttab_cache_flush_t) uop,
+                      unsigned int *ref_count,
+                      unsigned int count)
+{
+    unsigned int i;
+    gnttab_cache_flush_t op;
+
+    for ( i = 0; i < count; i++ )
+    {
+        if ( i && hypercall_preempt_check() )
+            return i;
+        if ( unlikely(__copy_from_guest(&op, uop, 1)) )
+            return -EFAULT;
+        for ( ; ; )
+        {
+            int ret = __gnttab_cache_flush(&op, ref_count);
+
+            if ( ret < 0 )
+                return ret;
+            if ( ret == 0 )
+                break;
+            if ( hypercall_preempt_check() )
+                return i;
+        }
+        *ref_count = 0;
+        guest_handle_add_offset(uop, 1);
+    }
+    return 0;
+}
+
 long
 do_grant_table_op(
     unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count)
 {
     long rc;
+    unsigned int opaque_in = cmd & GNTTABOP_ARG_MASK, opaque_out = 0;
     
     if ( (int)count < 0 )
         return -EINVAL;
     
     rc = -EFAULT;
-    switch ( cmd )
+    switch ( cmd &= GNTTABOP_CMD_MASK )
     {
     case GNTTABOP_map_grant_ref:
     {
@@ -2617,17 +2765,34 @@ do_grant_table_op(
         }
         break;
     }
+    case GNTTABOP_cache_flush:
+    {
+        XEN_GUEST_HANDLE_PARAM(gnttab_cache_flush_t) cflush =
+            guest_handle_cast(uop, gnttab_cache_flush_t);
+
+        if ( unlikely(!guest_handle_okay(cflush, count)) )
+            goto out;
+        rc = gnttab_cache_flush(cflush, &opaque_in, count);
+        if ( rc > 0 )
+        {
+            guest_handle_add_offset(cflush, rc);
+            uop = guest_handle_cast(cflush, void);
+        }
+        opaque_out = opaque_in;
+        break;
+    }
     default:
         rc = -ENOSYS;
         break;
     }
     
   out:
-    if ( rc > 0 )
+    if ( rc > 0 || opaque_out != 0 )
     {
         ASSERT(rc < count);
-        rc = hypercall_create_continuation(__HYPERVISOR_grant_table_op,
-                                           "ihi", cmd, uop, count - rc);
+        ASSERT((opaque_out & GNTTABOP_CMD_MASK) == 0);
+        rc = hypercall_create_continuation(__HYPERVISOR_grant_table_op, "ihi",
+                                           opaque_out | cmd, uop, count - rc);
     }
     
     return rc;
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index b8a3d6c..20d4e77 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -309,6 +309,7 @@ typedef uint16_t grant_status_t;
 #define GNTTABOP_get_status_frames    9
 #define GNTTABOP_get_version          10
 #define GNTTABOP_swap_grant_ref	      11
+#define GNTTABOP_cache_flush	      12
 #endif /* __XEN_INTERFACE_VERSION__ */
 /* ` } */
 
@@ -574,6 +575,25 @@ struct gnttab_swap_grant_ref {
 typedef struct gnttab_swap_grant_ref gnttab_swap_grant_ref_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_swap_grant_ref_t);
 
+/*
+ * Issue one or more cache maintenance operations on a portion of a
+ * page granted to the calling domain by a foreign domain.
+ */
+struct gnttab_cache_flush {
+    union {
+        uint64_t dev_bus_addr;
+        grant_ref_t ref;
+    } a;
+    uint16_t offset; /* offset from start of grant */
+    uint16_t length; /* size within the grant */
+#define GNTTAB_CACHE_CLEAN          (1<<0)
+#define GNTTAB_CACHE_INVAL          (1<<1)
+#define GNTTAB_CACHE_SOURCE_GREF    (1<<31)
+    uint32_t op;
+};
+typedef struct gnttab_cache_flush gnttab_cache_flush_t;
+DEFINE_XEN_GUEST_HANDLE(gnttab_cache_flush_t);
+
 #endif /* __XEN_INTERFACE_VERSION__ */
 
 /*
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 234b668..41b3e35 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -37,6 +37,7 @@
 ?	evtchn_send			event_channel.h
 ?	evtchn_status			event_channel.h
 ?	evtchn_unmask			event_channel.h
+?	gnttab_cache_flush		grant_table.h
 !	gnttab_copy			grant_table.h
 ?	gnttab_dump_table		grant_table.h
 ?	gnttab_map_grant_ref		grant_table.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlnP-0007ma-N1; Thu, 30 Oct 2014 09:13:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnO-0007mC-6s
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:30 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	0A/53-02886-93102545; Thu, 30 Oct 2014 09:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1414660407!12507628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1256 invoked from network); 30 Oct 2014 09:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnL-0005gv-Fo
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnL-0000Yh-Dr
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:27 +0000
Date: Thu, 30 Oct 2014 09:13:27 +0000
Message-Id: <E1XjlnL-0000Yh-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "xen/arm: introduce
	XENFEAT_grant_map_identity"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2865a9d3f7fe004949106ad672f3435709d4253d
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:07:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:07:35 2014 +0200

    Revert "xen/arm: introduce XENFEAT_grant_map_identity"
    
    Revert commit id 8d09ef6906ca0a9957e21334ad2c3eed626abe63.
    Just keep the definition of XENFEAT_grant_map_identity.
    
    XENFEAT_grant_map_identity is superseeded by GNTTABOP_cache_flush.  As
    XENFEAT_grant_map_identity causes additional tlb flushes, it is best to
    remove the feature entirely now.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/grant_table.c           |   30 +++++-------------------------
 xen/common/kernel.c                |    2 --
 xen/drivers/passthrough/arm/smmu.c |   33 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/grant_table.h  |    3 ++-
 xen/include/public/features.h      |    4 +++-
 5 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index e1296d8..8fba923 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -785,23 +785,13 @@ __gnttab_map_grant_ref(
              !(old_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
         {
             if ( wrc == 0 )
-            {
-                if ( is_domain_direct_mapped(ld) )
-                    err = arch_grant_map_page_identity(ld, frame, 1);
-                else
-                    err = iommu_map_page(ld, frame, frame,
-                            IOMMUF_readable|IOMMUF_writable);
-            }
+                err = iommu_map_page(ld, frame, frame,
+                                     IOMMUF_readable|IOMMUF_writable);
         }
         else if ( act_pin && !old_pin )
         {
             if ( (wrc + rdc) == 0 )
-            {
-                if ( is_domain_direct_mapped(ld) )
-                    err = arch_grant_map_page_identity(ld, frame, 0);
-                else
-                    err = iommu_map_page(ld, frame, frame, IOMMUF_readable);
-            }
+                err = iommu_map_page(ld, frame, frame, IOMMUF_readable);
         }
         if ( err )
         {
@@ -998,19 +988,9 @@ __gnttab_unmap_common(
         int err = 0;
         mapcount(lgt, rd, op->frame, &wrc, &rdc);
         if ( (wrc + rdc) == 0 )
-        {
-            if ( is_domain_direct_mapped(ld) )
-                err = arch_grant_unmap_page_identity(ld, op->frame);
-            else
-                err = iommu_unmap_page(ld, op->frame);
-        }
+            err = iommu_unmap_page(ld, op->frame);
         else if ( wrc == 0 )
-        {
-            if ( is_domain_direct_mapped(ld) )
-                err = arch_grant_map_page_identity(ld, op->frame, 0);
-            else
-                err = iommu_map_page(ld, op->frame, op->frame, IOMMUF_readable);
-        }
+            err = iommu_map_page(ld, op->frame, op->frame, IOMMUF_readable);
         if ( err )
         {
             rc = GNTST_general_error;
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index ce65486..d23c422 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -332,8 +332,6 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
                 break;
             }
 #endif
-            if ( is_domain_direct_mapped(d) )
-                fi.submap |= 1U << XENFEAT_grant_map_identity;
             break;
         default:
             return -EINVAL;
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 3cbd206..9a95ac9 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1536,6 +1536,37 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d)
     xfree(smmu_domain);
 }
 
+static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
+                             unsigned long mfn, unsigned int flags)
+{
+    /* Grant mappings can be used for DMA requests. The dev_bus_addr returned by
+     * the hypercall is the MFN (not the IPA). For device protected by
+     * an IOMMU, Xen needs to add a 1:1 mapping in the domain p2m to
+     * allow DMA request to work.
+     * This is only valid when the domain is directed mapped. Hence this
+     * function should only be used by gnttab code with gfn == mfn.
+     */
+    BUG_ON(!is_domain_direct_mapped(d));
+    BUG_ON(mfn != gfn);
+
+    /* We only support readable and writable flags */
+    if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) )
+        return -EINVAL;
+
+    return arch_grant_map_page_identity(d, mfn, flags & IOMMUF_writable);
+}
+
+static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
+{
+    /* This function should only be used by gnttab code when the domain
+     * is direct mapped
+     */
+    if ( !is_domain_direct_mapped(d) )
+        return -EINVAL;
+
+    return arch_grant_unmap_page_identity(d, gfn);
+}
+
 static const struct iommu_ops arm_smmu_iommu_ops = {
     .init = arm_smmu_iommu_domain_init,
     .hwdom_init = arm_smmu_iommu_hwdom_init,
@@ -1544,6 +1575,8 @@ static const struct iommu_ops arm_smmu_iommu_ops = {
     .iotlb_flush_all = arm_smmu_iotlb_flush_all,
     .assign_dt_device = arm_smmu_attach_dev,
     .reassign_dt_device = arm_smmu_reassign_dt_dev,
+    .map_page = arm_smmu_map_page,
+    .unmap_page = arm_smmu_unmap_page,
 };
 
 static int __init smmu_init(struct dt_device_node *dev,
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index e798880..0edad67 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -33,7 +33,8 @@ static inline int replace_grant_supported(void)
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
      (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
 
-#define gnttab_need_iommu_mapping(d)           (is_domain_direct_mapped(d))
+#define gnttab_need_iommu_mapping(d)                    \
+    (is_domain_direct_mapped(d) && need_iommu(d))
 
 #endif /* __ASM_GRANT_TABLE_H__ */
 /*
diff --git a/xen/include/public/features.h b/xen/include/public/features.h
index b7bf83f..16d92aa 100644
--- a/xen/include/public/features.h
+++ b/xen/include/public/features.h
@@ -94,8 +94,10 @@
 /* operation as Dom0 is supported */
 #define XENFEAT_dom0                      11
 
-/* Xen also maps grant references at pfn = mfn */
+/* Xen also maps grant references at pfn = mfn.
+ * This feature flag is deprecated and should not be used.
 #define XENFEAT_grant_map_identity        12
+ */
 
 #define XENFEAT_NR_SUBMAPS 1
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlnP-0007ma-N1; Thu, 30 Oct 2014 09:13:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnO-0007mC-6s
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:30 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	0A/53-02886-93102545; Thu, 30 Oct 2014 09:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1414660407!12507628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1256 invoked from network); 30 Oct 2014 09:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnL-0005gv-Fo
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnL-0000Yh-Dr
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:27 +0000
Date: Thu, 30 Oct 2014 09:13:27 +0000
Message-Id: <E1XjlnL-0000Yh-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "xen/arm: introduce
	XENFEAT_grant_map_identity"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2865a9d3f7fe004949106ad672f3435709d4253d
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:07:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:07:35 2014 +0200

    Revert "xen/arm: introduce XENFEAT_grant_map_identity"
    
    Revert commit id 8d09ef6906ca0a9957e21334ad2c3eed626abe63.
    Just keep the definition of XENFEAT_grant_map_identity.
    
    XENFEAT_grant_map_identity is superseeded by GNTTABOP_cache_flush.  As
    XENFEAT_grant_map_identity causes additional tlb flushes, it is best to
    remove the feature entirely now.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/grant_table.c           |   30 +++++-------------------------
 xen/common/kernel.c                |    2 --
 xen/drivers/passthrough/arm/smmu.c |   33 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/grant_table.h  |    3 ++-
 xen/include/public/features.h      |    4 +++-
 5 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index e1296d8..8fba923 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -785,23 +785,13 @@ __gnttab_map_grant_ref(
              !(old_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
         {
             if ( wrc == 0 )
-            {
-                if ( is_domain_direct_mapped(ld) )
-                    err = arch_grant_map_page_identity(ld, frame, 1);
-                else
-                    err = iommu_map_page(ld, frame, frame,
-                            IOMMUF_readable|IOMMUF_writable);
-            }
+                err = iommu_map_page(ld, frame, frame,
+                                     IOMMUF_readable|IOMMUF_writable);
         }
         else if ( act_pin && !old_pin )
         {
             if ( (wrc + rdc) == 0 )
-            {
-                if ( is_domain_direct_mapped(ld) )
-                    err = arch_grant_map_page_identity(ld, frame, 0);
-                else
-                    err = iommu_map_page(ld, frame, frame, IOMMUF_readable);
-            }
+                err = iommu_map_page(ld, frame, frame, IOMMUF_readable);
         }
         if ( err )
         {
@@ -998,19 +988,9 @@ __gnttab_unmap_common(
         int err = 0;
         mapcount(lgt, rd, op->frame, &wrc, &rdc);
         if ( (wrc + rdc) == 0 )
-        {
-            if ( is_domain_direct_mapped(ld) )
-                err = arch_grant_unmap_page_identity(ld, op->frame);
-            else
-                err = iommu_unmap_page(ld, op->frame);
-        }
+            err = iommu_unmap_page(ld, op->frame);
         else if ( wrc == 0 )
-        {
-            if ( is_domain_direct_mapped(ld) )
-                err = arch_grant_map_page_identity(ld, op->frame, 0);
-            else
-                err = iommu_map_page(ld, op->frame, op->frame, IOMMUF_readable);
-        }
+            err = iommu_map_page(ld, op->frame, op->frame, IOMMUF_readable);
         if ( err )
         {
             rc = GNTST_general_error;
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index ce65486..d23c422 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -332,8 +332,6 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
                 break;
             }
 #endif
-            if ( is_domain_direct_mapped(d) )
-                fi.submap |= 1U << XENFEAT_grant_map_identity;
             break;
         default:
             return -EINVAL;
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 3cbd206..9a95ac9 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1536,6 +1536,37 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d)
     xfree(smmu_domain);
 }
 
+static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
+                             unsigned long mfn, unsigned int flags)
+{
+    /* Grant mappings can be used for DMA requests. The dev_bus_addr returned by
+     * the hypercall is the MFN (not the IPA). For device protected by
+     * an IOMMU, Xen needs to add a 1:1 mapping in the domain p2m to
+     * allow DMA request to work.
+     * This is only valid when the domain is directed mapped. Hence this
+     * function should only be used by gnttab code with gfn == mfn.
+     */
+    BUG_ON(!is_domain_direct_mapped(d));
+    BUG_ON(mfn != gfn);
+
+    /* We only support readable and writable flags */
+    if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) )
+        return -EINVAL;
+
+    return arch_grant_map_page_identity(d, mfn, flags & IOMMUF_writable);
+}
+
+static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
+{
+    /* This function should only be used by gnttab code when the domain
+     * is direct mapped
+     */
+    if ( !is_domain_direct_mapped(d) )
+        return -EINVAL;
+
+    return arch_grant_unmap_page_identity(d, gfn);
+}
+
 static const struct iommu_ops arm_smmu_iommu_ops = {
     .init = arm_smmu_iommu_domain_init,
     .hwdom_init = arm_smmu_iommu_hwdom_init,
@@ -1544,6 +1575,8 @@ static const struct iommu_ops arm_smmu_iommu_ops = {
     .iotlb_flush_all = arm_smmu_iotlb_flush_all,
     .assign_dt_device = arm_smmu_attach_dev,
     .reassign_dt_device = arm_smmu_reassign_dt_dev,
+    .map_page = arm_smmu_map_page,
+    .unmap_page = arm_smmu_unmap_page,
 };
 
 static int __init smmu_init(struct dt_device_node *dev,
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index e798880..0edad67 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -33,7 +33,8 @@ static inline int replace_grant_supported(void)
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
      (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
 
-#define gnttab_need_iommu_mapping(d)           (is_domain_direct_mapped(d))
+#define gnttab_need_iommu_mapping(d)                    \
+    (is_domain_direct_mapped(d) && need_iommu(d))
 
 #endif /* __ASM_GRANT_TABLE_H__ */
 /*
diff --git a/xen/include/public/features.h b/xen/include/public/features.h
index b7bf83f..16d92aa 100644
--- a/xen/include/public/features.h
+++ b/xen/include/public/features.h
@@ -94,8 +94,10 @@
 /* operation as Dom0 is supported */
 #define XENFEAT_dom0                      11
 
-/* Xen also maps grant references at pfn = mfn */
+/* Xen also maps grant references at pfn = mfn.
+ * This feature flag is deprecated and should not be used.
 #define XENFEAT_grant_map_identity        12
+ */
 
 #define XENFEAT_NR_SUBMAPS 1
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlnl-0007pt-3z; Thu, 30 Oct 2014 09:13:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlni-0007pg-Ot
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:50 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7A/06-10419-E4102545; Thu, 30 Oct 2014 09:13:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1414660428!13552240!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5996 invoked from network); 30 Oct 2014 09:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnf-0005h6-Re
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnf-0000ZT-QQ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:47 +0000
Date: Thu, 30 Oct 2014 09:13:47 +0000
Message-Id: <E1Xjlnf-0000ZT-QQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: hvm: Allow configuration of the
	size of the mmio_hole.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d927fc41b8e130b3b8910e4442d4691111d2ac7
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Tue Oct 21 08:42:26 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 11:47:49 2014 +0100

    x86: hvm: Allow configuration of the size of the mmio_hole.
    
    If you add enough PCI devices then all mmio may not fit below 4G
    which may not be the layout the user wanted. This allows you to
    increase the below 4G address space that PCI devices can use and
    therefore in more cases not have any mmio that is above 4G.
    
    There are real PCI cards that do not support mmio over 4G, so if you
    want to emulate them precisely, you may also need to increase the
    space below 4G for them. There are drivers for these cards that also
    do not work if they have their mmio space mapped above 4G.
    
    This allows growing the MMIO hole to the size needed.
    
    This may help with using pci passthru and HVM.
    
    In the tools this is named mmio_hole_memkb.
    
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fixed build error in xl_cmdimpl.c with s/%PRIu64/%ld/.
             Reworded title ]
---
 docs/man/xl.cfg.pod.5             |   15 ++++++++
 tools/firmware/hvmloader/config.h |    1 -
 tools/firmware/hvmloader/pci.c    |   71 ++++++++++++++++++++++++++-----------
 tools/libxl/libxl.h               |    5 +++
 tools/libxl/libxl_create.c        |   29 +++++++++++----
 tools/libxl/libxl_dm.c            |   20 +++++++++-
 tools/libxl/libxl_dom.c           |    8 ++++
 tools/libxl/libxl_types.idl       |    1 +
 tools/libxl/xl_cmdimpl.c          |   13 +++++++
 9 files changed, 132 insertions(+), 31 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 5830e09..622ea53 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1164,6 +1164,21 @@ wallclock (i.e., real) time.
 
 =back
 
+=head3 Memory layout
+
+=over 4
+
+=item B<mmio_hole=MBYTES>
+
+Specifies the size the MMIO hole below 4GiB will be.  Only valid for
+device_model_version = "qemu-xen".
+
+Cannot be smaller than 256. Cannot be larger than 3840.
+
+Known good large value is 3072.
+
+=back
+
 =head3 Support for Paravirtualisation of HVM Guests
 
 The following options allow Paravirtualised features (such as devices)
diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index 80bea46..b838cf9 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -53,7 +53,6 @@ extern struct bios_config ovmf_config;
 #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
 
 /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
-#define PCI_MEM_START       0xf0000000
 #define PCI_MEM_END         0xfc000000
 
 extern unsigned long pci_mem_start, pci_mem_end;
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 3712988..4e8d803 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -28,9 +28,10 @@
 #include <xen/memory.h>
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/hvm_xs_strings.h>
+#include <xen/hvm/e820.h>
 #include <stdbool.h>
 
-unsigned long pci_mem_start = PCI_MEM_START;
+unsigned long pci_mem_start = HVM_BELOW_4G_MMIO_START;
 unsigned long pci_mem_end = PCI_MEM_END;
 uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0;
 
@@ -59,6 +60,7 @@ void pci_setup(void)
         uint64_t bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
+    uint64_t mmio_hole_size = 0;
 
     const char *s;
     /*
@@ -86,6 +88,10 @@ void pci_setup(void)
     printf("Relocating guest memory for lowmem MMIO space %s\n",
            allow_memory_relocate?"enabled":"disabled");
 
+    s = xenstore_read("platform/mmio_hole_size", NULL);
+    if ( s )
+        mmio_hole_size = strtoll(s, NULL, 0);
+
     /* Program PCI-ISA bridge with appropriate link routes. */
     isa_irq = 0;
     for ( link = 0; link < 4; link++ )
@@ -237,26 +243,49 @@ void pci_setup(void)
         pci_writew(devfn, PCI_COMMAND, cmd);
     }
 
-    /*
-     * At the moment qemu-xen can't deal with relocated memory regions.
-     * It's too close to the release to make a proper fix; for now,
-     * only allow the MMIO hole to grow large enough to move guest memory
-     * if we're running qemu-traditional.  Items that don't fit will be
-     * relocated into the 64-bit address space.
-     *
-     * This loop now does the following:
-     * - If allow_memory_relocate, increase the MMIO hole until it's
-     *   big enough, or until it's 2GiB
-     * - If !allow_memory_relocate, increase the MMIO hole until it's
-     *   big enough, or until it's 2GiB, or until it overlaps guest
-     *   memory
-     */
-    while ( (mmio_total > (pci_mem_end - pci_mem_start)) 
-            && ((pci_mem_start << 1) != 0)
-            && (allow_memory_relocate
-                || (((pci_mem_start << 1) >> PAGE_SHIFT)
-                    >= hvm_info->low_mem_pgend)) )
-        pci_mem_start <<= 1;
+    if ( mmio_hole_size )
+    {
+        uint64_t max_ram_below_4g = (1ULL << 32) - mmio_hole_size;
+
+        if ( max_ram_below_4g > HVM_BELOW_4G_MMIO_START )
+        {
+            printf("max_ram_below_4g=0x"PRIllx
+                   " too big for mmio_hole_size=0x"PRIllx
+                   " has been ignored.\n",
+                   PRIllx_arg(max_ram_below_4g),
+                   PRIllx_arg(mmio_hole_size));
+        }
+        else
+        {
+            pci_mem_start = max_ram_below_4g;
+            printf("pci_mem_start=0x%lx (was 0x%x) for mmio_hole_size=%lu\n",
+                   pci_mem_start, HVM_BELOW_4G_MMIO_START,
+                   (long)mmio_hole_size);
+        }
+    }
+    else
+    {
+        /*
+         * At the moment qemu-xen can't deal with relocated memory regions.
+         * It's too close to the release to make a proper fix; for now,
+         * only allow the MMIO hole to grow large enough to move guest memory
+         * if we're running qemu-traditional.  Items that don't fit will be
+         * relocated into the 64-bit address space.
+         *
+         * This loop now does the following:
+         * - If allow_memory_relocate, increase the MMIO hole until it's
+         *   big enough, or until it's 2GiB
+         * - If !allow_memory_relocate, increase the MMIO hole until it's
+         *   big enough, or until it's 2GiB, or until it overlaps guest
+         *   memory
+         */
+        while ( (mmio_total > (pci_mem_end - pci_mem_start))
+                && ((pci_mem_start << 1) != 0)
+                && (allow_memory_relocate
+                    || (((pci_mem_start << 1) >> PAGE_SHIFT)
+                        >= hvm_info->low_mem_pgend)) )
+            pci_mem_start <<= 1;
+    }
 
     if ( mmio_total > (pci_mem_end - pci_mem_start) )
     {
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 28b614f..c3451bd 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -158,6 +158,11 @@
 #define LIBXL_BUILDINFO_HVM_VIRIDIAN_ENABLE_DISABLE_WIDTH 64
 
 /*
+ * libxl_domain_build_info has the u.hvm.mmio_hole_memkb field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_MMIO_HOLE_MEMKB 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 4b33d07..b1ff5ae 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -23,6 +23,7 @@
 #include <xc_dom.h>
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
+#include <xen/hvm/e820.h>
 
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
@@ -226,6 +227,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     case LIBXL_DOMAIN_TYPE_HVM:
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
+        if (b_info->u.hvm.mmio_hole_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->u.hvm.mmio_hole_memkb = 0;
 
         if (!b_info->u.hvm.vga.kind)
             b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
@@ -429,13 +432,25 @@ int libxl__domain_build(libxl__gc *gc,
         vments[4] = "start_time";
         vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
 
-        localents = libxl__calloc(gc, 7, sizeof(char *));
-        localents[0] = "platform/acpi";
-        localents[1] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
-        localents[2] = "platform/acpi_s3";
-        localents[3] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
-        localents[4] = "platform/acpi_s4";
-        localents[5] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
+        localents = libxl__calloc(gc, 9, sizeof(char *));
+        i = 0;
+        localents[i++] = "platform/acpi";
+        localents[i++] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
+        localents[i++] = "platform/acpi_s3";
+        localents[i++] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[i++] = "platform/acpi_s4";
+        localents[i++] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
+        if (info->u.hvm.mmio_hole_memkb) {
+            uint64_t max_ram_below_4g =
+                (1ULL << 32) - (info->u.hvm.mmio_hole_memkb << 10);
+
+            if (max_ram_below_4g <= HVM_BELOW_4G_MMIO_START) {
+                localents[i++] = "platform/mmio_hole_size";
+                localents[i++] =
+                    libxl__sprintf(gc, "%"PRIu64,
+                                   info->u.hvm.mmio_hole_memkb << 10);
+            }
+        }
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 14dc9fa..3e191c3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -18,6 +18,7 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
+#include <xen/hvm/e820.h>
 
 static const char *libxl_tapif_script(libxl__gc *gc)
 {
@@ -416,6 +417,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
     const libxl_sdl_info *sdl = dm_sdl(guest_config);
     const char *keymap = dm_keymap(guest_config);
+    char *machinearg;
     flexarray_t *dm_args;
     int i, connection, devid;
     uint64_t ram_size;
@@ -720,10 +722,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             /* Switching here to the machine "pc" which does not add
              * the xen-platform device instead of the default "xenfv" machine.
              */
-            flexarray_append(dm_args, "pc,accel=xen");
+            machinearg = libxl__sprintf(gc, "pc,accel=xen");
         } else {
-            flexarray_append(dm_args, "xenfv");
+            machinearg = libxl__sprintf(gc, "xenfv");
         }
+        if (b_info->u.hvm.mmio_hole_memkb) {
+            uint64_t max_ram_below_4g = (1ULL << 32) -
+                (b_info->u.hvm.mmio_hole_memkb << 10);
+
+            if (max_ram_below_4g > HVM_BELOW_4G_MMIO_START) {
+                LOG(WARN, "mmio_hole_memkb=%"PRIu64
+                    " invalid ignored.\n",
+                    b_info->u.hvm.mmio_hole_memkb);
+            } else {
+                machinearg = libxl__sprintf(gc, "%s,max-ram-below-4g=%"PRIu64,
+                                            machinearg, max_ram_below_4g);
+            }
+        }
+        flexarray_append(dm_args, machinearg);
         for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
             flexarray_append(dm_args, b_info->extra_hvm[i]);
         break;
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 9d830e1..74ea84b 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -23,6 +23,7 @@
 #include <xc_dom.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/hvm_xs_strings.h>
+#include <xen/hvm/e820.h>
 
 libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
 {
@@ -800,6 +801,13 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     args.mem_size = (uint64_t)(info->max_memkb - info->video_memkb) << 10;
     args.mem_target = (uint64_t)(info->target_memkb - info->video_memkb) << 10;
     args.claim_enabled = libxl_defbool_val(info->claim_mode);
+    if (info->u.hvm.mmio_hole_memkb) {
+        uint64_t max_ram_below_4g = (1ULL << 32) -
+            (info->u.hvm.mmio_hole_memkb << 10);
+
+        if (max_ram_below_4g < HVM_BELOW_4G_MMIO_START)
+            args.mmio_size = info->u.hvm.mmio_hole_memkb << 10;
+    }
     if (libxl__domain_firmware(gc, info, &args)) {
         LOG(ERROR, "initializing domain firmware failed");
         goto out;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index fdda761..ca3f724 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -413,6 +413,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("timeoffset",       string),
                                        ("hpet",             libxl_defbool),
                                        ("vpt_align",        libxl_defbool),
+                                       ("mmio_hole_memkb",  MemKB),
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
                                        ("smbios_firmware",  string),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 0882644..3c9f146 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -34,6 +34,7 @@
 #include <ctype.h>
 #include <inttypes.h>
 #include <limits.h>
+#include <xen/hvm/e820.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -1191,6 +1192,18 @@ static void parse_config_data(const char *config_source,
             exit(-ERROR_FAIL);
         }
 
+        if (!xlu_cfg_get_long(config, "mmio_hole", &l, 0)) {
+            uint64_t mmio_hole_size;
+
+            b_info->u.hvm.mmio_hole_memkb = l * 1024;
+            mmio_hole_size = b_info->u.hvm.mmio_hole_memkb * 1024;
+            if (mmio_hole_size < HVM_BELOW_4G_MMIO_LENGTH ||
+                mmio_hole_size > HVM_BELOW_4G_MMIO_START) {
+                fprintf(stderr,
+                        "ERROR: invalid value %ld for \"mmio_hole\"\n", l);
+                exit (1);
+            }
+        }
         if (!xlu_cfg_get_long(config, "timer_mode", &l, 1)) {
             const char *s = libxl_timer_mode_to_string(l);
             fprintf(stderr, "WARNING: specifying \"timer_mode\" as an integer is deprecated. "
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:13:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:13:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlnl-0007pt-3z; Thu, 30 Oct 2014 09:13:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlni-0007pg-Ot
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:50 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7A/06-10419-E4102545; Thu, 30 Oct 2014 09:13:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1414660428!13552240!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5996 invoked from network); 30 Oct 2014 09:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnf-0005h6-Re
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnf-0000ZT-QQ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:47 +0000
Date: Thu, 30 Oct 2014 09:13:47 +0000
Message-Id: <E1Xjlnf-0000ZT-QQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: hvm: Allow configuration of the
	size of the mmio_hole.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d927fc41b8e130b3b8910e4442d4691111d2ac7
Author:     Don Slutz <dslutz@verizon.com>
AuthorDate: Tue Oct 21 08:42:26 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 11:47:49 2014 +0100

    x86: hvm: Allow configuration of the size of the mmio_hole.
    
    If you add enough PCI devices then all mmio may not fit below 4G
    which may not be the layout the user wanted. This allows you to
    increase the below 4G address space that PCI devices can use and
    therefore in more cases not have any mmio that is above 4G.
    
    There are real PCI cards that do not support mmio over 4G, so if you
    want to emulate them precisely, you may also need to increase the
    space below 4G for them. There are drivers for these cards that also
    do not work if they have their mmio space mapped above 4G.
    
    This allows growing the MMIO hole to the size needed.
    
    This may help with using pci passthru and HVM.
    
    In the tools this is named mmio_hole_memkb.
    
    Signed-off-by: Don Slutz <dslutz@verizon.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fixed build error in xl_cmdimpl.c with s/%PRIu64/%ld/.
             Reworded title ]
---
 docs/man/xl.cfg.pod.5             |   15 ++++++++
 tools/firmware/hvmloader/config.h |    1 -
 tools/firmware/hvmloader/pci.c    |   71 ++++++++++++++++++++++++++-----------
 tools/libxl/libxl.h               |    5 +++
 tools/libxl/libxl_create.c        |   29 +++++++++++----
 tools/libxl/libxl_dm.c            |   20 +++++++++-
 tools/libxl/libxl_dom.c           |    8 ++++
 tools/libxl/libxl_types.idl       |    1 +
 tools/libxl/xl_cmdimpl.c          |   13 +++++++
 9 files changed, 132 insertions(+), 31 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 5830e09..622ea53 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1164,6 +1164,21 @@ wallclock (i.e., real) time.
 
 =back
 
+=head3 Memory layout
+
+=over 4
+
+=item B<mmio_hole=MBYTES>
+
+Specifies the size the MMIO hole below 4GiB will be.  Only valid for
+device_model_version = "qemu-xen".
+
+Cannot be smaller than 256. Cannot be larger than 3840.
+
+Known good large value is 3072.
+
+=back
+
 =head3 Support for Paravirtualisation of HVM Guests
 
 The following options allow Paravirtualised features (such as devices)
diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index 80bea46..b838cf9 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -53,7 +53,6 @@ extern struct bios_config ovmf_config;
 #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
 
 /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
-#define PCI_MEM_START       0xf0000000
 #define PCI_MEM_END         0xfc000000
 
 extern unsigned long pci_mem_start, pci_mem_end;
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 3712988..4e8d803 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -28,9 +28,10 @@
 #include <xen/memory.h>
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/hvm_xs_strings.h>
+#include <xen/hvm/e820.h>
 #include <stdbool.h>
 
-unsigned long pci_mem_start = PCI_MEM_START;
+unsigned long pci_mem_start = HVM_BELOW_4G_MMIO_START;
 unsigned long pci_mem_end = PCI_MEM_END;
 uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0;
 
@@ -59,6 +60,7 @@ void pci_setup(void)
         uint64_t bar_sz;
     } *bars = (struct bars *)scratch_start;
     unsigned int i, nr_bars = 0;
+    uint64_t mmio_hole_size = 0;
 
     const char *s;
     /*
@@ -86,6 +88,10 @@ void pci_setup(void)
     printf("Relocating guest memory for lowmem MMIO space %s\n",
            allow_memory_relocate?"enabled":"disabled");
 
+    s = xenstore_read("platform/mmio_hole_size", NULL);
+    if ( s )
+        mmio_hole_size = strtoll(s, NULL, 0);
+
     /* Program PCI-ISA bridge with appropriate link routes. */
     isa_irq = 0;
     for ( link = 0; link < 4; link++ )
@@ -237,26 +243,49 @@ void pci_setup(void)
         pci_writew(devfn, PCI_COMMAND, cmd);
     }
 
-    /*
-     * At the moment qemu-xen can't deal with relocated memory regions.
-     * It's too close to the release to make a proper fix; for now,
-     * only allow the MMIO hole to grow large enough to move guest memory
-     * if we're running qemu-traditional.  Items that don't fit will be
-     * relocated into the 64-bit address space.
-     *
-     * This loop now does the following:
-     * - If allow_memory_relocate, increase the MMIO hole until it's
-     *   big enough, or until it's 2GiB
-     * - If !allow_memory_relocate, increase the MMIO hole until it's
-     *   big enough, or until it's 2GiB, or until it overlaps guest
-     *   memory
-     */
-    while ( (mmio_total > (pci_mem_end - pci_mem_start)) 
-            && ((pci_mem_start << 1) != 0)
-            && (allow_memory_relocate
-                || (((pci_mem_start << 1) >> PAGE_SHIFT)
-                    >= hvm_info->low_mem_pgend)) )
-        pci_mem_start <<= 1;
+    if ( mmio_hole_size )
+    {
+        uint64_t max_ram_below_4g = (1ULL << 32) - mmio_hole_size;
+
+        if ( max_ram_below_4g > HVM_BELOW_4G_MMIO_START )
+        {
+            printf("max_ram_below_4g=0x"PRIllx
+                   " too big for mmio_hole_size=0x"PRIllx
+                   " has been ignored.\n",
+                   PRIllx_arg(max_ram_below_4g),
+                   PRIllx_arg(mmio_hole_size));
+        }
+        else
+        {
+            pci_mem_start = max_ram_below_4g;
+            printf("pci_mem_start=0x%lx (was 0x%x) for mmio_hole_size=%lu\n",
+                   pci_mem_start, HVM_BELOW_4G_MMIO_START,
+                   (long)mmio_hole_size);
+        }
+    }
+    else
+    {
+        /*
+         * At the moment qemu-xen can't deal with relocated memory regions.
+         * It's too close to the release to make a proper fix; for now,
+         * only allow the MMIO hole to grow large enough to move guest memory
+         * if we're running qemu-traditional.  Items that don't fit will be
+         * relocated into the 64-bit address space.
+         *
+         * This loop now does the following:
+         * - If allow_memory_relocate, increase the MMIO hole until it's
+         *   big enough, or until it's 2GiB
+         * - If !allow_memory_relocate, increase the MMIO hole until it's
+         *   big enough, or until it's 2GiB, or until it overlaps guest
+         *   memory
+         */
+        while ( (mmio_total > (pci_mem_end - pci_mem_start))
+                && ((pci_mem_start << 1) != 0)
+                && (allow_memory_relocate
+                    || (((pci_mem_start << 1) >> PAGE_SHIFT)
+                        >= hvm_info->low_mem_pgend)) )
+            pci_mem_start <<= 1;
+    }
 
     if ( mmio_total > (pci_mem_end - pci_mem_start) )
     {
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 28b614f..c3451bd 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -158,6 +158,11 @@
 #define LIBXL_BUILDINFO_HVM_VIRIDIAN_ENABLE_DISABLE_WIDTH 64
 
 /*
+ * libxl_domain_build_info has the u.hvm.mmio_hole_memkb field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_MMIO_HOLE_MEMKB 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 4b33d07..b1ff5ae 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -23,6 +23,7 @@
 #include <xc_dom.h>
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
+#include <xen/hvm/e820.h>
 
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
@@ -226,6 +227,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     case LIBXL_DOMAIN_TYPE_HVM:
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
+        if (b_info->u.hvm.mmio_hole_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->u.hvm.mmio_hole_memkb = 0;
 
         if (!b_info->u.hvm.vga.kind)
             b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
@@ -429,13 +432,25 @@ int libxl__domain_build(libxl__gc *gc,
         vments[4] = "start_time";
         vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
 
-        localents = libxl__calloc(gc, 7, sizeof(char *));
-        localents[0] = "platform/acpi";
-        localents[1] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
-        localents[2] = "platform/acpi_s3";
-        localents[3] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
-        localents[4] = "platform/acpi_s4";
-        localents[5] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
+        localents = libxl__calloc(gc, 9, sizeof(char *));
+        i = 0;
+        localents[i++] = "platform/acpi";
+        localents[i++] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
+        localents[i++] = "platform/acpi_s3";
+        localents[i++] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[i++] = "platform/acpi_s4";
+        localents[i++] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
+        if (info->u.hvm.mmio_hole_memkb) {
+            uint64_t max_ram_below_4g =
+                (1ULL << 32) - (info->u.hvm.mmio_hole_memkb << 10);
+
+            if (max_ram_below_4g <= HVM_BELOW_4G_MMIO_START) {
+                localents[i++] = "platform/mmio_hole_size";
+                localents[i++] =
+                    libxl__sprintf(gc, "%"PRIu64,
+                                   info->u.hvm.mmio_hole_memkb << 10);
+            }
+        }
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 14dc9fa..3e191c3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -18,6 +18,7 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
+#include <xen/hvm/e820.h>
 
 static const char *libxl_tapif_script(libxl__gc *gc)
 {
@@ -416,6 +417,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
     const libxl_sdl_info *sdl = dm_sdl(guest_config);
     const char *keymap = dm_keymap(guest_config);
+    char *machinearg;
     flexarray_t *dm_args;
     int i, connection, devid;
     uint64_t ram_size;
@@ -720,10 +722,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             /* Switching here to the machine "pc" which does not add
              * the xen-platform device instead of the default "xenfv" machine.
              */
-            flexarray_append(dm_args, "pc,accel=xen");
+            machinearg = libxl__sprintf(gc, "pc,accel=xen");
         } else {
-            flexarray_append(dm_args, "xenfv");
+            machinearg = libxl__sprintf(gc, "xenfv");
         }
+        if (b_info->u.hvm.mmio_hole_memkb) {
+            uint64_t max_ram_below_4g = (1ULL << 32) -
+                (b_info->u.hvm.mmio_hole_memkb << 10);
+
+            if (max_ram_below_4g > HVM_BELOW_4G_MMIO_START) {
+                LOG(WARN, "mmio_hole_memkb=%"PRIu64
+                    " invalid ignored.\n",
+                    b_info->u.hvm.mmio_hole_memkb);
+            } else {
+                machinearg = libxl__sprintf(gc, "%s,max-ram-below-4g=%"PRIu64,
+                                            machinearg, max_ram_below_4g);
+            }
+        }
+        flexarray_append(dm_args, machinearg);
         for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
             flexarray_append(dm_args, b_info->extra_hvm[i]);
         break;
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 9d830e1..74ea84b 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -23,6 +23,7 @@
 #include <xc_dom.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/hvm_xs_strings.h>
+#include <xen/hvm/e820.h>
 
 libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
 {
@@ -800,6 +801,13 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     args.mem_size = (uint64_t)(info->max_memkb - info->video_memkb) << 10;
     args.mem_target = (uint64_t)(info->target_memkb - info->video_memkb) << 10;
     args.claim_enabled = libxl_defbool_val(info->claim_mode);
+    if (info->u.hvm.mmio_hole_memkb) {
+        uint64_t max_ram_below_4g = (1ULL << 32) -
+            (info->u.hvm.mmio_hole_memkb << 10);
+
+        if (max_ram_below_4g < HVM_BELOW_4G_MMIO_START)
+            args.mmio_size = info->u.hvm.mmio_hole_memkb << 10;
+    }
     if (libxl__domain_firmware(gc, info, &args)) {
         LOG(ERROR, "initializing domain firmware failed");
         goto out;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index fdda761..ca3f724 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -413,6 +413,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("timeoffset",       string),
                                        ("hpet",             libxl_defbool),
                                        ("vpt_align",        libxl_defbool),
+                                       ("mmio_hole_memkb",  MemKB),
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
                                        ("smbios_firmware",  string),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 0882644..3c9f146 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -34,6 +34,7 @@
 #include <ctype.h>
 #include <inttypes.h>
 #include <limits.h>
+#include <xen/hvm/e820.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -1191,6 +1192,18 @@ static void parse_config_data(const char *config_source,
             exit(-ERROR_FAIL);
         }
 
+        if (!xlu_cfg_get_long(config, "mmio_hole", &l, 0)) {
+            uint64_t mmio_hole_size;
+
+            b_info->u.hvm.mmio_hole_memkb = l * 1024;
+            mmio_hole_size = b_info->u.hvm.mmio_hole_memkb * 1024;
+            if (mmio_hole_size < HVM_BELOW_4G_MMIO_LENGTH ||
+                mmio_hole_size > HVM_BELOW_4G_MMIO_START) {
+                fprintf(stderr,
+                        "ERROR: invalid value %ld for \"mmio_hole\"\n", l);
+                exit (1);
+            }
+        }
         if (!xlu_cfg_get_long(config, "timer_mode", &l, 1)) {
             const char *s = libxl_timer_mode_to_string(l);
             fprintf(stderr, "WARNING: specifying \"timer_mode\" as an integer is deprecated. "
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlnt-0007rK-6e; Thu, 30 Oct 2014 09:14:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlns-0007r4-A9
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:00 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	77/FF-02699-75102545; Thu, 30 Oct 2014 09:13:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1414660438!6316851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12254 invoked from network); 30 Oct 2014 09:13:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnq-0005hF-1E
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnq-0000aL-0A
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:58 +0000
Date: Thu, 30 Oct 2014 09:13:58 +0000
Message-Id: <E1Xjlnq-0000aL-0A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: remove requirement for udev
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb1ed9af760bda12b25731d1f08fc4b07ac0a9e6
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 21 15:30:44 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 11:48:24 2014 +0100

    README: remove requirement for udev
    
    There is no requirement for udev during package build. It may be
    required at runtime even with libxl with run_hotplug_scripts=yes
    in xl.conf.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/README b/README
index ac160a5..548e30d 100644
--- a/README
+++ b/README
@@ -57,7 +57,6 @@ provided by your OS distributor:
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
-    * udev
     * GNU bison and GNU flex
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlnt-0007rK-6e; Thu, 30 Oct 2014 09:14:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlns-0007r4-A9
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:00 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	77/FF-02699-75102545; Thu, 30 Oct 2014 09:13:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1414660438!6316851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12254 invoked from network); 30 Oct 2014 09:13:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnq-0005hF-1E
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnq-0000aL-0A
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:58 +0000
Date: Thu, 30 Oct 2014 09:13:58 +0000
Message-Id: <E1Xjlnq-0000aL-0A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: remove requirement for udev
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb1ed9af760bda12b25731d1f08fc4b07ac0a9e6
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 21 15:30:44 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 11:48:24 2014 +0100

    README: remove requirement for udev
    
    There is no requirement for udev during package build. It may be
    required at runtime even with libxl with run_hotplug_scripts=yes
    in xl.conf.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/README b/README
index ac160a5..548e30d 100644
--- a/README
+++ b/README
@@ -57,7 +57,6 @@ provided by your OS distributor:
     * pkg-config
     * bridge-utils package (/sbin/brctl)
     * iproute package (/sbin/ip)
-    * udev
     * GNU bison and GNU flex
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlny-0007sc-92; Thu, 30 Oct 2014 09:14:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnx-0007sL-L7
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:05 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	56/D5-02834-C5102545; Thu, 30 Oct 2014 09:14:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1414660417!12456706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26419 invoked from network); 30 Oct 2014 09:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnV-0005h3-MI
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnV-0000Z7-KB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:37 +0000
Date: Thu, 30 Oct 2014 09:13:37 +0000
Message-Id: <E1XjlnV-0000Z7-KB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "xen: introduce
	arch_grant_(un)map_page_identity"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5fb8a70f45f4e14aab9b0900e8179ddfb14240a7
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:08:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:08:52 2014 +0200

    Revert "xen: introduce arch_grant_(un)map_page_identity"
    
    This reverts commit e25a5f4d8cf3b55718048abdd21c7d0de64ae54c.
    
    With the removal of XENFEAT_grant_map_identity, this commit is not
    needed anymore.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c                 |   26 --------------------------
 xen/drivers/passthrough/arm/smmu.c |   13 +++++++++++--
 xen/include/asm-arm/p2m.h          |    4 ----
 xen/include/asm-x86/p2m.h          |    4 ----
 4 files changed, 11 insertions(+), 36 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 2760d98..7b08f16 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -989,32 +989,6 @@ void guest_physmap_remove_page(struct domain *d,
                       pfn_to_paddr(mfn), MATTR_MEM, p2m_invalid);
 }
 
-int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
-                                 bool_t writeable)
-{
-    p2m_type_t t;
-
-    ASSERT(is_domain_direct_mapped(d));
-
-    /* This is not an IOMMU mapping but it is not a regular RAM p2m type
-     * either. We are using IOMMU p2m types here to prevent the pages
-     * from being used as grants. */
-    if ( writeable )
-        t = p2m_iommu_map_rw;
-    else
-        t = p2m_iommu_map_ro;
-
-    return guest_physmap_add_entry(d, frame, frame, 0, t);
-}
-
-int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame)
-{
-    ASSERT(is_domain_direct_mapped(d));
-
-    guest_physmap_remove_page(d, frame, frame, 0);
-    return 0;
-}
-
 int p2m_alloc_table(struct domain *d)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 9a95ac9..42bde75 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1539,6 +1539,8 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d)
 static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
                              unsigned long mfn, unsigned int flags)
 {
+    p2m_type_t t;
+
     /* Grant mappings can be used for DMA requests. The dev_bus_addr returned by
      * the hypercall is the MFN (not the IPA). For device protected by
      * an IOMMU, Xen needs to add a 1:1 mapping in the domain p2m to
@@ -1553,7 +1555,12 @@ static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
     if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) )
         return -EINVAL;
 
-    return arch_grant_map_page_identity(d, mfn, flags & IOMMUF_writable);
+    t = (flags & IOMMUF_writable) ? p2m_iommu_map_rw : p2m_iommu_map_ro;
+
+    /* The function guest_physmap_add_entry replaces the current mapping
+     * if there is already one...
+     */
+    return guest_physmap_add_entry(d, gfn, mfn, 0, t);
 }
 
 static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
@@ -1564,7 +1571,9 @@ static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
     if ( !is_domain_direct_mapped(d) )
         return -EINVAL;
 
-    return arch_grant_unmap_page_identity(d, gfn);
+    guest_physmap_remove_page(d, gfn, gfn, 0);
+
+    return 0;
 }
 
 static const struct iommu_ops arm_smmu_iommu_ops = {
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 10bf111..da36504 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -214,10 +214,6 @@ static inline int get_page_and_type(struct page_info *page,
     return rc;
 }
 
-int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
-                                 bool_t writeable);
-int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame);
-
 /* get host p2m table */
 #define p2m_get_hostp2m(d) (&(d)->arch.p2m)
 
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 90ddd15..5f7fe71 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -709,10 +709,6 @@ static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
     return flags;
 }
 
-extern int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
-                                 bool_t writeable);
-extern int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame);
-
 #endif /* _XEN_P2M_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlny-0007sc-92; Thu, 30 Oct 2014 09:14:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlnx-0007sL-L7
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:05 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	56/D5-02834-C5102545; Thu, 30 Oct 2014 09:14:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1414660417!12456706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26419 invoked from network); 30 Oct 2014 09:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnV-0005h3-MI
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlnV-0000Z7-KB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:13:37 +0000
Date: Thu, 30 Oct 2014 09:13:37 +0000
Message-Id: <E1XjlnV-0000Z7-KB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "xen: introduce
	arch_grant_(un)map_page_identity"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5fb8a70f45f4e14aab9b0900e8179ddfb14240a7
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Oct 23 12:08:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 23 12:08:52 2014 +0200

    Revert "xen: introduce arch_grant_(un)map_page_identity"
    
    This reverts commit e25a5f4d8cf3b55718048abdd21c7d0de64ae54c.
    
    With the removal of XENFEAT_grant_map_identity, this commit is not
    needed anymore.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c                 |   26 --------------------------
 xen/drivers/passthrough/arm/smmu.c |   13 +++++++++++--
 xen/include/asm-arm/p2m.h          |    4 ----
 xen/include/asm-x86/p2m.h          |    4 ----
 4 files changed, 11 insertions(+), 36 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 2760d98..7b08f16 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -989,32 +989,6 @@ void guest_physmap_remove_page(struct domain *d,
                       pfn_to_paddr(mfn), MATTR_MEM, p2m_invalid);
 }
 
-int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
-                                 bool_t writeable)
-{
-    p2m_type_t t;
-
-    ASSERT(is_domain_direct_mapped(d));
-
-    /* This is not an IOMMU mapping but it is not a regular RAM p2m type
-     * either. We are using IOMMU p2m types here to prevent the pages
-     * from being used as grants. */
-    if ( writeable )
-        t = p2m_iommu_map_rw;
-    else
-        t = p2m_iommu_map_ro;
-
-    return guest_physmap_add_entry(d, frame, frame, 0, t);
-}
-
-int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame)
-{
-    ASSERT(is_domain_direct_mapped(d));
-
-    guest_physmap_remove_page(d, frame, frame, 0);
-    return 0;
-}
-
 int p2m_alloc_table(struct domain *d)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 9a95ac9..42bde75 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1539,6 +1539,8 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d)
 static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
                              unsigned long mfn, unsigned int flags)
 {
+    p2m_type_t t;
+
     /* Grant mappings can be used for DMA requests. The dev_bus_addr returned by
      * the hypercall is the MFN (not the IPA). For device protected by
      * an IOMMU, Xen needs to add a 1:1 mapping in the domain p2m to
@@ -1553,7 +1555,12 @@ static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
     if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) )
         return -EINVAL;
 
-    return arch_grant_map_page_identity(d, mfn, flags & IOMMUF_writable);
+    t = (flags & IOMMUF_writable) ? p2m_iommu_map_rw : p2m_iommu_map_ro;
+
+    /* The function guest_physmap_add_entry replaces the current mapping
+     * if there is already one...
+     */
+    return guest_physmap_add_entry(d, gfn, mfn, 0, t);
 }
 
 static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
@@ -1564,7 +1571,9 @@ static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
     if ( !is_domain_direct_mapped(d) )
         return -EINVAL;
 
-    return arch_grant_unmap_page_identity(d, gfn);
+    guest_physmap_remove_page(d, gfn, gfn, 0);
+
+    return 0;
 }
 
 static const struct iommu_ops arm_smmu_iommu_ops = {
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 10bf111..da36504 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -214,10 +214,6 @@ static inline int get_page_and_type(struct page_info *page,
     return rc;
 }
 
-int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
-                                 bool_t writeable);
-int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame);
-
 /* get host p2m table */
 #define p2m_get_hostp2m(d) (&(d)->arch.p2m)
 
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 90ddd15..5f7fe71 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -709,10 +709,6 @@ static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
     return flags;
 }
 
-extern int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
-                                 bool_t writeable);
-extern int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame);
-
 #endif /* _XEN_P2M_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlo5-0007vD-Ub; Thu, 30 Oct 2014 09:14:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlo4-0007u9-EZ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:12 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	E8/2A-02709-36102545; Thu, 30 Oct 2014 09:14:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1414660448!7814000!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30905 invoked from network); 30 Oct 2014 09:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlo0-0005hn-7e
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlo0-0000ax-5c
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:08 +0000
Date: Thu, 30 Oct 2014 09:14:08 +0000
Message-Id: <E1Xjlo0-0000ax-5c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: mention git repos at xen.org
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 695d9e2fd0ee6c0070ef12a2ccd6e4caa69f8d62
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 21 15:31:26 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 11:48:24 2014 +0100

    README: mention git repos at xen.org
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 548e30d..6840290 100644
--- a/README
+++ b/README
@@ -90,8 +90,8 @@ performed with root privileges.]
 
 1. Download and untar the source tarball file. This will be a
    file named xen-unstable-src.tgz, or xen-$version-src.tgz.
-   You can also pull the current version from the mercurial
-   repository at http://xenbits.xen.org/
+   You can also pull the current version from the git or mercurial
+   repositories at http://xenbits.xen.org/
 
     # tar xzf xen-unstable-src.tgz
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlo5-0007vD-Ub; Thu, 30 Oct 2014 09:14:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlo4-0007u9-EZ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:12 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	E8/2A-02709-36102545; Thu, 30 Oct 2014 09:14:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1414660448!7814000!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30905 invoked from network); 30 Oct 2014 09:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlo0-0005hn-7e
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlo0-0000ax-5c
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:08 +0000
Date: Thu, 30 Oct 2014 09:14:08 +0000
Message-Id: <E1Xjlo0-0000ax-5c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] README: mention git repos at xen.org
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 695d9e2fd0ee6c0070ef12a2ccd6e4caa69f8d62
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Oct 21 15:31:26 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 11:48:24 2014 +0100

    README: mention git repos at xen.org
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 README |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 548e30d..6840290 100644
--- a/README
+++ b/README
@@ -90,8 +90,8 @@ performed with root privileges.]
 
 1. Download and untar the source tarball file. This will be a
    file named xen-unstable-src.tgz, or xen-$version-src.tgz.
-   You can also pull the current version from the mercurial
-   repository at http://xenbits.xen.org/
+   You can also pull the current version from the git or mercurial
+   repositories at http://xenbits.xen.org/
 
     # tar xzf xen-unstable-src.tgz
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjloE-0007yK-4h; Thu, 30 Oct 2014 09:14:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloC-0007xj-PP
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:20 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	21/A0-02699-C6102545; Thu, 30 Oct 2014 09:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1414660458!13586200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13006 invoked from network); 30 Oct 2014 09:14:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloA-0005hw-Dx
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloA-0000bX-CO
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:18 +0000
Date: Thu, 30 Oct 2014 09:14:18 +0000
Message-Id: <E1XjloA-0000bX-CO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix libxl_list_vcpu()
	following c/s 93e52d52
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c90a755f261b8ccb3dac7e1f695122cac95c6053
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 12:01:15 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 12:29:00 2014 +0100

    tools/libxl: Fix libxl_list_vcpu() following c/s 93e52d52
    
    My reasoning regarding nr_cpus_out was wrong, as I had confused nr_cpus_out
    with nr_vcpus_out.
    
    Dario pointed this out, but the patch (having gained appropriate acks) got
    committed before I could post a correction.
    
    Noticed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ee127d8..18561fb 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5252,6 +5252,7 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         return NULL;
     }
 
+    *nr_cpus_out = libxl_get_max_cpus(ctx);
     ret = ptr = libxl__calloc(NOGC, domaininfo.max_vcpu_id + 1,
                               sizeof(libxl_vcpuinfo));
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjloE-0007yK-4h; Thu, 30 Oct 2014 09:14:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloC-0007xj-PP
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:20 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	21/A0-02699-C6102545; Thu, 30 Oct 2014 09:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1414660458!13586200!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13006 invoked from network); 30 Oct 2014 09:14:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloA-0005hw-Dx
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloA-0000bX-CO
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:18 +0000
Date: Thu, 30 Oct 2014 09:14:18 +0000
Message-Id: <E1XjloA-0000bX-CO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix libxl_list_vcpu()
	following c/s 93e52d52
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c90a755f261b8ccb3dac7e1f695122cac95c6053
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 23 12:01:15 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 23 12:29:00 2014 +0100

    tools/libxl: Fix libxl_list_vcpu() following c/s 93e52d52
    
    My reasoning regarding nr_cpus_out was wrong, as I had confused nr_cpus_out
    with nr_vcpus_out.
    
    Dario pointed this out, but the patch (having gained appropriate acks) got
    committed before I could post a correction.
    
    Noticed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ee127d8..18561fb 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5252,6 +5252,7 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         return NULL;
     }
 
+    *nr_cpus_out = libxl_get_max_cpus(ctx);
     ret = ptr = libxl__calloc(NOGC, domaininfo.max_vcpu_id + 1,
                               sizeof(libxl_vcpuinfo));
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:33 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjloP-00081O-7T; Thu, 30 Oct 2014 09:14:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloN-00080x-BU
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:31 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	1B/A8-02696-67102545; Thu, 30 Oct 2014 09:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1414660468!13376063!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5164 invoked from network); 30 Oct 2014 09:14:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloK-0005i7-KB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloK-0000c6-Hw
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:28 +0000
Date: Thu, 30 Oct 2014 09:14:28 +0000
Message-Id: <E1XjloK-0000c6-Hw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'release-4.5.0-rc1' into
	staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 35555fff58fbcb90e6b094228c60a92f1b7e6c58
Merge: c90a755f261b8ccb3dac7e1f695122cac95c6053 6688825c240586708129df8887ad9b12a1708497
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 24 16:13:11 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 24 16:13:11 2014 +0100

    Merge branch 'release-4.5.0-rc1' into staging

 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:33 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjloP-00081O-7T; Thu, 30 Oct 2014 09:14:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloN-00080x-BU
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:31 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	1B/A8-02696-67102545; Thu, 30 Oct 2014 09:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1414660468!13376063!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5164 invoked from network); 30 Oct 2014 09:14:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloK-0005i7-KB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloK-0000c6-Hw
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:28 +0000
Date: Thu, 30 Oct 2014 09:14:28 +0000
Message-Id: <E1XjloK-0000c6-Hw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'release-4.5.0-rc1' into
	staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 35555fff58fbcb90e6b094228c60a92f1b7e6c58
Merge: c90a755f261b8ccb3dac7e1f695122cac95c6053 6688825c240586708129df8887ad9b12a1708497
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 24 16:13:11 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 24 16:13:11 2014 +0100

    Merge branch 'release-4.5.0-rc1' into staging

 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjloY-000849-A0; Thu, 30 Oct 2014 09:14:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloX-00083i-0X
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:41 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	16/E6-27785-08102545; Thu, 30 Oct 2014 09:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1414660478!13415444!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10519 invoked from network); 30 Oct 2014 09:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloU-0005iD-Q0
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloU-0000cW-O5
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:38 +0000
Date: Thu, 30 Oct 2014 09:14:38 +0000
Message-Id: <E1XjloU-0000cW-O5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/Makefile: use
	QEMU_TRADITIONAL_LOC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 37284698cd64cd71ecc4b354196904a9d0c40bb2
Author:     M A Young <m.a.young@durham.ac.uk>
AuthorDate: Thu Oct 23 18:37:43 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 24 16:19:26 2014 +0100

    stubdom/Makefile: use QEMU_TRADITIONAL_LOC
    
    In commit 8962a8f951ea83e8d10ee23aeb20266e4795b06e CONFIG_QEMU was
    replaced by QEMU_TRADITIONAL_LOC. However stubdom/Makefile still uses
    CONFIG_QEMU so building stubdom is likely to fail.  This patch
    replaces CONFIG_QEMU with QEMU_TRADITIONAL_LOC in stubdom/Makefile as
    well.
    
    Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 stubdom/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2f9ca52..8fb885a 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -263,7 +263,7 @@ $(OCAML_STAMPFILE): ocaml-$(XEN_TARGET_ARCH)/.dirstamp
 .PHONY: $(CROSS_ROOT)
 $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 
-QEMU_ROOT := $(shell if [ -d "$(CONFIG_QEMU)" ]; then echo "$(CONFIG_QEMU)"; else echo .; fi)
+QEMU_ROOT := $(shell if [ -d "$(QEMU_TRADITIONAL_LOC)" ]; then echo "$(QEMU_TRADITIONAL_LOC)"; else echo .; fi)
 
 ifneq ($(filter ioemu,$(STUBDOM_TARGETS)),)
 IOEMU_LINKFARM_TARGET := ioemu/linkfarm.stamp
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjloY-000849-A0; Thu, 30 Oct 2014 09:14:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloX-00083i-0X
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:41 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	16/E6-27785-08102545; Thu, 30 Oct 2014 09:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1414660478!13415444!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10519 invoked from network); 30 Oct 2014 09:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloU-0005iD-Q0
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjloU-0000cW-O5
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:38 +0000
Date: Thu, 30 Oct 2014 09:14:38 +0000
Message-Id: <E1XjloU-0000cW-O5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/Makefile: use
	QEMU_TRADITIONAL_LOC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 37284698cd64cd71ecc4b354196904a9d0c40bb2
Author:     M A Young <m.a.young@durham.ac.uk>
AuthorDate: Thu Oct 23 18:37:43 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 24 16:19:26 2014 +0100

    stubdom/Makefile: use QEMU_TRADITIONAL_LOC
    
    In commit 8962a8f951ea83e8d10ee23aeb20266e4795b06e CONFIG_QEMU was
    replaced by QEMU_TRADITIONAL_LOC. However stubdom/Makefile still uses
    CONFIG_QEMU so building stubdom is likely to fail.  This patch
    replaces CONFIG_QEMU with QEMU_TRADITIONAL_LOC in stubdom/Makefile as
    well.
    
    Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 stubdom/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2f9ca52..8fb885a 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -263,7 +263,7 @@ $(OCAML_STAMPFILE): ocaml-$(XEN_TARGET_ARCH)/.dirstamp
 .PHONY: $(CROSS_ROOT)
 $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 
-QEMU_ROOT := $(shell if [ -d "$(CONFIG_QEMU)" ]; then echo "$(CONFIG_QEMU)"; else echo .; fi)
+QEMU_ROOT := $(shell if [ -d "$(QEMU_TRADITIONAL_LOC)" ]; then echo "$(QEMU_TRADITIONAL_LOC)"; else echo .; fi)
 
 ifneq ($(filter ioemu,$(STUBDOM_TARGETS)),)
 IOEMU_LINKFARM_TARGET := ioemu/linkfarm.stamp
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjloj-000873-Cp; Thu, 30 Oct 2014 09:14:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjloh-00086f-6b
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:51 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	E0/20-03145-A8102545; Thu, 30 Oct 2014 09:14:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414660489!13350232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15617 invoked from network); 30 Oct 2014 09:14:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjloe-0005iJ-Uo
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjloe-0000cs-Tp
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:48 +0000
Date: Thu, 30 Oct 2014 09:14:48 +0000
Message-Id: <E1Xjloe-0000cs-Tp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix building against
	libxl for LIBXL_API_VERSION < 0x040500
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 67d95d0e6a96f274b0a85c7eec0e6fe4c03ef0bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 09:56:19 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:10:25 2014 +0000

    tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
    
    c/s 6276f66ebe "libxl: libxl_uuid_copy now takes a ctx argument" introduces
    API compatibiltiy for libxl_uuid_copy() which sadly is not valid C.  Fix it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_uuid.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
index 196b5bc..c5041c7 100644
--- a/tools/libxl/libxl_uuid.h
+++ b/tools/libxl/libxl_uuid.h
@@ -61,7 +61,12 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
 void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
                      const libxl_uuid *src);
 #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
-void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
+void static inline libxl_uuid_copy_0x040400(libxl_uuid *dst,
+                                            const libxl_uuid *src)
+{
+    libxl_uuid_copy(NULL, dst, src);
+}
+#define libxl_uuid_copy libxl_uuid_copy_0x040400
 #endif
 
 void libxl_uuid_clear(libxl_uuid *uuid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:14:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:14:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjloj-000873-Cp; Thu, 30 Oct 2014 09:14:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjloh-00086f-6b
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:51 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	E0/20-03145-A8102545; Thu, 30 Oct 2014 09:14:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414660489!13350232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15617 invoked from network); 30 Oct 2014 09:14:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:14:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjloe-0005iJ-Uo
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjloe-0000cs-Tp
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:48 +0000
Date: Thu, 30 Oct 2014 09:14:48 +0000
Message-Id: <E1Xjloe-0000cs-Tp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix building against
	libxl for LIBXL_API_VERSION < 0x040500
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 67d95d0e6a96f274b0a85c7eec0e6fe4c03ef0bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 09:56:19 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:10:25 2014 +0000

    tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
    
    c/s 6276f66ebe "libxl: libxl_uuid_copy now takes a ctx argument" introduces
    API compatibiltiy for libxl_uuid_copy() which sadly is not valid C.  Fix it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_uuid.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
index 196b5bc..c5041c7 100644
--- a/tools/libxl/libxl_uuid.h
+++ b/tools/libxl/libxl_uuid.h
@@ -61,7 +61,12 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
 void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
                      const libxl_uuid *src);
 #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
-void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
+void static inline libxl_uuid_copy_0x040400(libxl_uuid *dst,
+                                            const libxl_uuid *src)
+{
+    libxl_uuid_copy(NULL, dst, src);
+}
+#define libxl_uuid_copy libxl_uuid_copy_0x040400
 #endif
 
 void libxl_uuid_clear(libxl_uuid *uuid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:02 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlos-000897-FO; Thu, 30 Oct 2014 09:15:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlor-00088v-Tu
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:02 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	05/3C-02709-59102545; Thu, 30 Oct 2014 09:15:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1414660499!12614434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4869 invoked from network); 30 Oct 2014 09:15:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlop-0005iS-3c
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlop-0000dx-2P
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:59 +0000
Date: Thu, 30 Oct 2014 09:14:59 +0000
Message-Id: <E1Xjlop-0000dx-2P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: fix conditions in
	systemd service files for dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa5c183614f56fc833c283b3c18670de79ad13d9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:04 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:17 2014 +0000

    tools/hotplug: fix conditions in systemd service files for dom0
    
    ConditionVirtualization= checks if systemd runs in some sort of guest.
    It is not supposed to detect host capabilities. The current
    implementation happens to work because systemd-detect-virt from v208
    returns also 'xen' in a dom0. In v210 and later 'none' is returned and
    no service files will be started.
    
    Adjust the checks to detect a dom0 vs. native boot. Mounting xenfs
    depends on /proc/xen, but should only be done for pvops because xenfs
    exists only there. All other service files should not be started in
    domU. The file /proc/xen/capabilities exists in both dom0 and domU in a
    pvops kernel, but only in dom0 it contains 'control_d'. The existing
    ExecStartPre= check will prevent starting in a domU.
    
    ConditionVirtualization=!xen is true in a dom0. But this check is broken
    in systemd v208, so its not used.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/proc-xen.mount.in      |    3 ++-
 .../Linux/systemd/var-lib-xenstored.mount.in       |    4 +++-
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    2 +-
 .../hotplug/Linux/systemd/xen-watchdog.service.in  |    2 +-
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    2 +-
 tools/hotplug/Linux/systemd/xendomains.service.in  |    2 +-
 tools/hotplug/Linux/systemd/xenstored.service.in   |    2 +-
 tools/hotplug/Linux/systemd/xenstored.socket.in    |    2 +-
 tools/hotplug/Linux/systemd/xenstored_ro.socket.in |    2 +-
 9 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/proc-xen.mount.in b/tools/hotplug/Linux/systemd/proc-xen.mount.in
index f0c4f3a..64ebe7f 100644
--- a/tools/hotplug/Linux/systemd/proc-xen.mount.in
+++ b/tools/hotplug/Linux/systemd/proc-xen.mount.in
@@ -1,6 +1,7 @@
 [Unit]
 Description=Mount /proc/xen files
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen
+ConditionPathExists=!/proc/xen/capabilities
 RefuseManualStop=true
 
 [Mount]
diff --git a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
index 44dfce8..6c46be3 100644
--- a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
+++ b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
@@ -1,6 +1,8 @@
 [Unit]
 Description=mount xenstore file system
-ConditionVirtualization=xen
+Requires=proc-xen.mount
+After=proc-xen.mount
+ConditionPathExists=/proc/xen/capabilities
 RefuseManualStop=true
 
 [Mount]
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index d3470fc..52101af 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -4,7 +4,7 @@ Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
 After=xenstored.service xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=simple
diff --git a/tools/hotplug/Linux/systemd/xen-watchdog.service.in b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
index ee77bf9..1eecd2a 100644
--- a/tools/hotplug/Linux/systemd/xen-watchdog.service.in
+++ b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
@@ -2,7 +2,7 @@
 Description=Xen-watchdog - run xen watchdog daemon
 Requires=proc-xen.mount
 After=proc-xen.mount xendomains.service
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=forking
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index 7ca0264..6ab0fc1 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -2,7 +2,7 @@
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
 Requires=xenstored.socket
 After=xenstored.service
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=simple
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index f88c336..2684df0 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -2,7 +2,7 @@
 Description=Xendomains - start and stop guests on boot and shutdown
 Requires=xenstored.socket
 After=xenstored.service xenconsoled.service
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=oneshot
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
index 013e69e..0f0d77d 100644
--- a/tools/hotplug/Linux/systemd/xenstored.service.in
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -4,7 +4,7 @@ Requires=xenstored_ro.socket xenstored.socket proc-xen.mount var-lib-xenstored.m
 After=proc-xen.mount var-lib-xenstored.mount
 Before=libvirtd.service libvirt-guests.service
 RefuseManualStop=true
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=notify
diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
index 461e4f4..9b28e74 100644
--- a/tools/hotplug/Linux/systemd/xenstored.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored.socket.in
@@ -1,6 +1,6 @@
 [Unit]
 Description=xenstore socket
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
 ListenStream=/var/run/xenstored/socket
diff --git a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
index 6ab5c28..80402b3 100644
--- a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
@@ -1,6 +1,6 @@
 [Unit]
 Description=xenstore ro socket
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
 ListenStream=/var/run/xenstored/socket_ro
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:02 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlos-000897-FO; Thu, 30 Oct 2014 09:15:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlor-00088v-Tu
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:02 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	05/3C-02709-59102545; Thu, 30 Oct 2014 09:15:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1414660499!12614434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4869 invoked from network); 30 Oct 2014 09:15:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlop-0005iS-3c
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlop-0000dx-2P
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:14:59 +0000
Date: Thu, 30 Oct 2014 09:14:59 +0000
Message-Id: <E1Xjlop-0000dx-2P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: fix conditions in
	systemd service files for dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa5c183614f56fc833c283b3c18670de79ad13d9
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:04 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:17 2014 +0000

    tools/hotplug: fix conditions in systemd service files for dom0
    
    ConditionVirtualization= checks if systemd runs in some sort of guest.
    It is not supposed to detect host capabilities. The current
    implementation happens to work because systemd-detect-virt from v208
    returns also 'xen' in a dom0. In v210 and later 'none' is returned and
    no service files will be started.
    
    Adjust the checks to detect a dom0 vs. native boot. Mounting xenfs
    depends on /proc/xen, but should only be done for pvops because xenfs
    exists only there. All other service files should not be started in
    domU. The file /proc/xen/capabilities exists in both dom0 and domU in a
    pvops kernel, but only in dom0 it contains 'control_d'. The existing
    ExecStartPre= check will prevent starting in a domU.
    
    ConditionVirtualization=!xen is true in a dom0. But this check is broken
    in systemd v208, so its not used.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/proc-xen.mount.in      |    3 ++-
 .../Linux/systemd/var-lib-xenstored.mount.in       |    4 +++-
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    2 +-
 .../hotplug/Linux/systemd/xen-watchdog.service.in  |    2 +-
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    2 +-
 tools/hotplug/Linux/systemd/xendomains.service.in  |    2 +-
 tools/hotplug/Linux/systemd/xenstored.service.in   |    2 +-
 tools/hotplug/Linux/systemd/xenstored.socket.in    |    2 +-
 tools/hotplug/Linux/systemd/xenstored_ro.socket.in |    2 +-
 9 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/proc-xen.mount.in b/tools/hotplug/Linux/systemd/proc-xen.mount.in
index f0c4f3a..64ebe7f 100644
--- a/tools/hotplug/Linux/systemd/proc-xen.mount.in
+++ b/tools/hotplug/Linux/systemd/proc-xen.mount.in
@@ -1,6 +1,7 @@
 [Unit]
 Description=Mount /proc/xen files
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen
+ConditionPathExists=!/proc/xen/capabilities
 RefuseManualStop=true
 
 [Mount]
diff --git a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
index 44dfce8..6c46be3 100644
--- a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
+++ b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
@@ -1,6 +1,8 @@
 [Unit]
 Description=mount xenstore file system
-ConditionVirtualization=xen
+Requires=proc-xen.mount
+After=proc-xen.mount
+ConditionPathExists=/proc/xen/capabilities
 RefuseManualStop=true
 
 [Mount]
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index d3470fc..52101af 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -4,7 +4,7 @@ Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
 After=xenstored.service xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=simple
diff --git a/tools/hotplug/Linux/systemd/xen-watchdog.service.in b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
index ee77bf9..1eecd2a 100644
--- a/tools/hotplug/Linux/systemd/xen-watchdog.service.in
+++ b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
@@ -2,7 +2,7 @@
 Description=Xen-watchdog - run xen watchdog daemon
 Requires=proc-xen.mount
 After=proc-xen.mount xendomains.service
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=forking
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index 7ca0264..6ab0fc1 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -2,7 +2,7 @@
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
 Requires=xenstored.socket
 After=xenstored.service
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=simple
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index f88c336..2684df0 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -2,7 +2,7 @@
 Description=Xendomains - start and stop guests on boot and shutdown
 Requires=xenstored.socket
 After=xenstored.service xenconsoled.service
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=oneshot
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
index 013e69e..0f0d77d 100644
--- a/tools/hotplug/Linux/systemd/xenstored.service.in
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -4,7 +4,7 @@ Requires=xenstored_ro.socket xenstored.socket proc-xen.mount var-lib-xenstored.m
 After=proc-xen.mount var-lib-xenstored.mount
 Before=libvirtd.service libvirt-guests.service
 RefuseManualStop=true
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=notify
diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
index 461e4f4..9b28e74 100644
--- a/tools/hotplug/Linux/systemd/xenstored.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored.socket.in
@@ -1,6 +1,6 @@
 [Unit]
 Description=xenstore socket
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
 ListenStream=/var/run/xenstored/socket
diff --git a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
index 6ab5c28..80402b3 100644
--- a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
@@ -1,6 +1,6 @@
 [Unit]
 Description=xenstore ro socket
-ConditionVirtualization=xen
+ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
 ListenStream=/var/run/xenstored/socket_ro
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlp7-0008Bw-IU; Thu, 30 Oct 2014 09:15:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlp6-0008Bk-K8
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:16 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	DD/4C-02683-3A102545; Thu, 30 Oct 2014 09:15:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1414660514!12527189!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1602 invoked from network); 30 Oct 2014 09:15:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlp4-0005jS-94
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlp4-0000ee-7j
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:14 +0000
Date: Thu, 30 Oct 2014 09:15:14 +0000
Message-Id: <E1Xjlp4-0000ee-7j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: fix clean target in
	systemd Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 912054bbbc5914174b6f90c6bcd0a5c4f370bdbe
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 24 16:17:05 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:27 2014 +0000

    tools/hotplug: fix clean target in systemd Makefile
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 9c58b33..0c40a73 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -25,6 +25,7 @@ all:	$(ALL_XEN_SYSTEMD)
 
 .PHONY: clean
 clean:
+	rm -f $(XEN_SYSTEMD_MODULES)
 
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlp7-0008Bw-IU; Thu, 30 Oct 2014 09:15:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlp6-0008Bk-K8
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:16 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	DD/4C-02683-3A102545; Thu, 30 Oct 2014 09:15:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1414660514!12527189!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1602 invoked from network); 30 Oct 2014 09:15:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlp4-0005jS-94
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlp4-0000ee-7j
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:14 +0000
Date: Thu, 30 Oct 2014 09:15:14 +0000
Message-Id: <E1Xjlp4-0000ee-7j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: fix clean target in
	systemd Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 912054bbbc5914174b6f90c6bcd0a5c4f370bdbe
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 24 16:17:05 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:27 2014 +0000

    tools/hotplug: fix clean target in systemd Makefile
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 9c58b33..0c40a73 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -25,6 +25,7 @@ all:	$(ALL_XEN_SYSTEMD)
 
 .PHONY: clean
 clean:
+	rm -f $(XEN_SYSTEMD_MODULES)
 
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlpJ-0008E7-MS; Thu, 30 Oct 2014 09:15:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpI-0008Dt-Sw
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:29 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	C0/43-02699-0B102545; Thu, 30 Oct 2014 09:15:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1414660524!13575213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4123 invoked from network); 30 Oct 2014 09:15:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpE-0005jd-F9
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpE-0000f4-E1
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:24 +0000
Date: Thu, 30 Oct 2014 09:15:24 +0000
Message-Id: <E1XjlpE-0000f4-E1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: add systemd
	xen-init-dom0 service
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05b89048ce75f12682fdb7c4410f3fca3e9797de
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 24 16:17:06 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:43 2014 +0000

    tools/hotplug: add systemd xen-init-dom0 service
    
    Also prevent xenstored.service from writing Dom0 nodes. The
    initialisation is now done with xen-init-dom0.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- ran autogen.sh as requested ]
---
 tools/configure                                    |    3 ++-
 tools/configure.ac                                 |    1 +
 tools/hotplug/Linux/systemd/Makefile               |    1 +
 .../hotplug/Linux/systemd/xen-init-dom0.service.in |   14 ++++++++++++++
 tools/hotplug/Linux/systemd/xenstored.service.in   |    2 --
 5 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/tools/configure b/tools/configure
index 950b4d4..c65ad3a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2276,7 +2276,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons"
+ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-init-dom0.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -9602,6 +9602,7 @@ do
     "hotplug/Linux/init.d/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xendomains" ;;
     "hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/proc-xen.mount" ;;
     "hotplug/Linux/systemd/var-lib-xenstored.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/var-lib-xenstored.mount" ;;
+    "hotplug/Linux/systemd/xen-init-dom0.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-init-dom0.service" ;;
     "hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service" ;;
     "hotplug/Linux/systemd/xen-watchdog.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-watchdog.service" ;;
     "hotplug/Linux/systemd/xenconsoled.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenconsoled.service" ;;
diff --git a/tools/configure.ac b/tools/configure.ac
index f584798..1ac63a3 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -14,6 +14,7 @@ hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
 hotplug/Linux/systemd/proc-xen.mount
 hotplug/Linux/systemd/var-lib-xenstored.mount
+hotplug/Linux/systemd/xen-init-dom0.service
 hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
 hotplug/Linux/systemd/xen-watchdog.service
 hotplug/Linux/systemd/xenconsoled.service
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 0c40a73..51c10fe 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -14,6 +14,7 @@ XEN_SYSTEMD_SERVICE += xenconsoled.service
 XEN_SYSTEMD_SERVICE += xen-qemu-dom0-disk-backend.service
 XEN_SYSTEMD_SERVICE += xendomains.service
 XEN_SYSTEMD_SERVICE += xen-watchdog.service
+XEN_SYSTEMD_SERVICE += xen-init-dom0.service
 
 ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
 			$(XEN_SYSTEMD_MOUNT)	\
diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
new file mode 100644
index 0000000..e947760
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
@@ -0,0 +1,14 @@
+[Unit]
+Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
+Requires=xenstored.socket
+After=xenstored.service
+ConditionPathExists=/proc/xen/capabilities
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStart=@LIBEXEC_BIN@/xen-init-dom0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
index 0f0d77d..45fc0f2 100644
--- a/tools/hotplug/Linux/systemd/xenstored.service.in
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -17,8 +17,6 @@ ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb*
 ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
 ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS"
-ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/name" "Domain-0"
-ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/domid" 0
 
 [Install]
 WantedBy=multi-user.target
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlpJ-0008E7-MS; Thu, 30 Oct 2014 09:15:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpI-0008Dt-Sw
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:29 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	C0/43-02699-0B102545; Thu, 30 Oct 2014 09:15:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1414660524!13575213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4123 invoked from network); 30 Oct 2014 09:15:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpE-0005jd-F9
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpE-0000f4-E1
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:24 +0000
Date: Thu, 30 Oct 2014 09:15:24 +0000
Message-Id: <E1XjlpE-0000f4-E1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: add systemd
	xen-init-dom0 service
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05b89048ce75f12682fdb7c4410f3fca3e9797de
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 24 16:17:06 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:43 2014 +0000

    tools/hotplug: add systemd xen-init-dom0 service
    
    Also prevent xenstored.service from writing Dom0 nodes. The
    initialisation is now done with xen-init-dom0.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- ran autogen.sh as requested ]
---
 tools/configure                                    |    3 ++-
 tools/configure.ac                                 |    1 +
 tools/hotplug/Linux/systemd/Makefile               |    1 +
 .../hotplug/Linux/systemd/xen-init-dom0.service.in |   14 ++++++++++++++
 tools/hotplug/Linux/systemd/xenstored.service.in   |    2 --
 5 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/tools/configure b/tools/configure
index 950b4d4..c65ad3a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2276,7 +2276,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons"
+ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-init-dom0.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -9602,6 +9602,7 @@ do
     "hotplug/Linux/init.d/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xendomains" ;;
     "hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/proc-xen.mount" ;;
     "hotplug/Linux/systemd/var-lib-xenstored.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/var-lib-xenstored.mount" ;;
+    "hotplug/Linux/systemd/xen-init-dom0.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-init-dom0.service" ;;
     "hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service" ;;
     "hotplug/Linux/systemd/xen-watchdog.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-watchdog.service" ;;
     "hotplug/Linux/systemd/xenconsoled.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenconsoled.service" ;;
diff --git a/tools/configure.ac b/tools/configure.ac
index f584798..1ac63a3 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -14,6 +14,7 @@ hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
 hotplug/Linux/systemd/proc-xen.mount
 hotplug/Linux/systemd/var-lib-xenstored.mount
+hotplug/Linux/systemd/xen-init-dom0.service
 hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
 hotplug/Linux/systemd/xen-watchdog.service
 hotplug/Linux/systemd/xenconsoled.service
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 0c40a73..51c10fe 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -14,6 +14,7 @@ XEN_SYSTEMD_SERVICE += xenconsoled.service
 XEN_SYSTEMD_SERVICE += xen-qemu-dom0-disk-backend.service
 XEN_SYSTEMD_SERVICE += xendomains.service
 XEN_SYSTEMD_SERVICE += xen-watchdog.service
+XEN_SYSTEMD_SERVICE += xen-init-dom0.service
 
 ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
 			$(XEN_SYSTEMD_MOUNT)	\
diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
new file mode 100644
index 0000000..e947760
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
@@ -0,0 +1,14 @@
+[Unit]
+Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
+Requires=xenstored.socket
+After=xenstored.service
+ConditionPathExists=/proc/xen/capabilities
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStart=@LIBEXEC_BIN@/xen-init-dom0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
index 0f0d77d..45fc0f2 100644
--- a/tools/hotplug/Linux/systemd/xenstored.service.in
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -17,8 +17,6 @@ ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb*
 ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
 ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS"
-ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/name" "Domain-0"
-ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/domid" 0
 
 [Install]
 WantedBy=multi-user.target
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlpT-0008GK-RI; Thu, 30 Oct 2014 09:15:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpS-0008G4-UX
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:39 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	56/C2-02699-AB102545; Thu, 30 Oct 2014 09:15:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1414660534!13303316!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12005 invoked from network); 30 Oct 2014 09:15:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpO-0005jl-LI
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpO-0000fU-JS
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:34 +0000
Date: Thu, 30 Oct 2014 09:15:34 +0000
Message-Id: <E1XjlpO-0000fU-JS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: xendomains now depends
	on xen-init-dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d8bd422077ec8cee62154a7cf1fad40d3131135
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 24 16:17:07 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:56 2014 +0000

    tools/hotplug: xendomains now depends on xen-init-dom0
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/xendomains.service.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 2684df0..3ed4892 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
 Requires=xenstored.socket
-After=xenstored.service xenconsoled.service
+After=xenstored.service xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlpT-0008GK-RI; Thu, 30 Oct 2014 09:15:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpS-0008G4-UX
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:39 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	56/C2-02699-AB102545; Thu, 30 Oct 2014 09:15:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1414660534!13303316!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12005 invoked from network); 30 Oct 2014 09:15:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpO-0005jl-LI
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpO-0000fU-JS
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:34 +0000
Date: Thu, 30 Oct 2014 09:15:34 +0000
Message-Id: <E1XjlpO-0000fU-JS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: xendomains now depends
	on xen-init-dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d8bd422077ec8cee62154a7cf1fad40d3131135
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 24 16:17:07 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:56 2014 +0000

    tools/hotplug: xendomains now depends on xen-init-dom0
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/xendomains.service.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 2684df0..3ed4892 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
 Requires=xenstored.socket
-After=xenstored.service xenconsoled.service
+After=xenstored.service xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlpc-0008I5-U1; Thu, 30 Oct 2014 09:15:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpb-0008Hs-Sh
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:47 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	75/7E-02699-3C102545; Thu, 30 Oct 2014 09:15:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414660545!13363592!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11082 invoked from network); 30 Oct 2014 09:15:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpZ-0005jr-Cv
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpY-0000fr-Qo
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:45 +0000
Date: Thu, 30 Oct 2014 09:15:44 +0000
Message-Id: <E1XjlpY-0000fr-Qo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: systemd xenstored
	dependencies
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:08 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:57 2014 +0000

    tools/hotplug: systemd xenstored dependencies
    
    Everything which uses xenstored does this via the socket. Update the
    existing service files to enable the xenstored.socket with the Requires=
    statement. And schedule startup of the given service files after the
    socket is enabled with the After= statement.
    Once something tries to access the socket systemd will launch xenstored.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../hotplug/Linux/systemd/xen-init-dom0.service.in |    2 +-
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    2 +-
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    2 +-
 tools/hotplug/Linux/systemd/xendomains.service.in  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
index e947760..3ed1633 100644
--- a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
+++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
 Requires=xenstored.socket
-After=xenstored.service
+After=xenstored.socket
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 52101af..0b9c2e5 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=qemu for xen dom0 disk backend
 Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
-After=xenstored.service xenconsoled.service
+After=xenstored.socket xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
 ConditionPathExists=/proc/xen/capabilities
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index 6ab0fc1..d3b85a5 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
 Requires=xenstored.socket
-After=xenstored.service
+After=xenstored.socket
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 3ed4892..214da7a 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
 Requires=xenstored.socket
-After=xenstored.service xenconsoled.service xen-init-dom0.service
+After=xenstored.socket xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlpc-0008I5-U1; Thu, 30 Oct 2014 09:15:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpb-0008Hs-Sh
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:47 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	75/7E-02699-3C102545; Thu, 30 Oct 2014 09:15:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1414660545!13363592!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11082 invoked from network); 30 Oct 2014 09:15:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpZ-0005jr-Cv
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlpY-0000fr-Qo
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:45 +0000
Date: Thu, 30 Oct 2014 09:15:44 +0000
Message-Id: <E1XjlpY-0000fr-Qo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: systemd xenstored
	dependencies
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:08 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:13:57 2014 +0000

    tools/hotplug: systemd xenstored dependencies
    
    Everything which uses xenstored does this via the socket. Update the
    existing service files to enable the xenstored.socket with the Requires=
    statement. And schedule startup of the given service files after the
    socket is enabled with the After= statement.
    Once something tries to access the socket systemd will launch xenstored.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../hotplug/Linux/systemd/xen-init-dom0.service.in |    2 +-
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    2 +-
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    2 +-
 tools/hotplug/Linux/systemd/xendomains.service.in  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
index e947760..3ed1633 100644
--- a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
+++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
 Requires=xenstored.socket
-After=xenstored.service
+After=xenstored.socket
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 52101af..0b9c2e5 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=qemu for xen dom0 disk backend
 Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
-After=xenstored.service xenconsoled.service
+After=xenstored.socket xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
 ConditionPathExists=/proc/xen/capabilities
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index 6ab0fc1..d3b85a5 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
 Requires=xenstored.socket
-After=xenstored.service
+After=xenstored.socket
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 3ed4892..214da7a 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
 Requires=xenstored.socket
-After=xenstored.service xenconsoled.service xen-init-dom0.service
+After=xenstored.socket xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlpn-0008KG-0a; Thu, 30 Oct 2014 09:15:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpm-0008K5-1K
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:58 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	56/6C-02698-DC102545; Thu, 30 Oct 2014 09:15:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414660555!13350629!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25580 invoked from network); 30 Oct 2014 09:15:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpj-0005k0-Ip
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpj-0000gj-GJ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:55 +0000
Date: Thu, 30 Oct 2014 09:15:55 +0000
Message-Id: <E1Xjlpj-0000gj-GJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: every systemd service
	depends on proc-xen.mount
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f96b89e560d1b0b626c3738b66859aabdf77a533
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:09 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:14:05 2014 +0000

    tools/hotplug: every systemd service depends on proc-xen.mount
    
    Every systemd service file uses /proc/xen/capabilites to check if it
    runs in a dom0. Update every service file to enable proc-xen.mount with
    the Requires= statement and schedule its startup with the After=
    statement.
    In some places var-lib-xenstored.mount is removed. This is ok because
    its optional and this unit is enabled by xenstored itself. After all its
    a private directory for xenstored.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../hotplug/Linux/systemd/xen-init-dom0.service.in |    4 ++--
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    4 ++--
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    4 ++--
 tools/hotplug/Linux/systemd/xendomains.service.in  |    4 ++--
 tools/hotplug/Linux/systemd/xenstored.socket.in    |    2 ++
 tools/hotplug/Linux/systemd/xenstored_ro.socket.in |    2 ++
 6 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
index 3ed1633..4d4cb23 100644
--- a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
+++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
-Requires=xenstored.socket
-After=xenstored.socket
+Requires=xenstored.socket proc-xen.mount
+After=xenstored.socket proc-xen.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 0b9c2e5..1e21abb 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=qemu for xen dom0 disk backend
-Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
-After=xenstored.socket xenconsoled.service
+Requires=proc-xen.mount xenstored.socket
+After=proc-xen.mount xenstored.socket xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
 ConditionPathExists=/proc/xen/capabilities
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index d3b85a5..e6cb853 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
-Requires=xenstored.socket
-After=xenstored.socket
+Requires=proc-xen.mount xenstored.socket
+After=proc-xen.mount xenstored.socket
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 214da7a..757278f 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
-Requires=xenstored.socket
-After=xenstored.socket xenconsoled.service xen-init-dom0.service
+Requires=proc-xen.mount xenstored.socket
+After=proc-xen.mount xenstored.socket xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
index 9b28e74..2e8ee04 100644
--- a/tools/hotplug/Linux/systemd/xenstored.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored.socket.in
@@ -1,5 +1,7 @@
 [Unit]
 Description=xenstore socket
+Requires=proc-xen.mount var-lib-xenstored.mount
+After=proc-xen.mount var-lib-xenstored.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
diff --git a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
index 80402b3..140ad94 100644
--- a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
@@ -1,5 +1,7 @@
 [Unit]
 Description=xenstore ro socket
+Requires=proc-xen.mount var-lib-xenstored.mount
+After=proc-xen.mount var-lib-xenstored.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:15:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:15:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlpn-0008KG-0a; Thu, 30 Oct 2014 09:15:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpm-0008K5-1K
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:58 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	56/6C-02698-DC102545; Thu, 30 Oct 2014 09:15:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414660555!13350629!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25580 invoked from network); 30 Oct 2014 09:15:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:15:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpj-0005k0-Ip
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpj-0000gj-GJ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:15:55 +0000
Date: Thu, 30 Oct 2014 09:15:55 +0000
Message-Id: <E1Xjlpj-0000gj-GJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: every systemd service
	depends on proc-xen.mount
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f96b89e560d1b0b626c3738b66859aabdf77a533
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:09 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:14:05 2014 +0000

    tools/hotplug: every systemd service depends on proc-xen.mount
    
    Every systemd service file uses /proc/xen/capabilites to check if it
    runs in a dom0. Update every service file to enable proc-xen.mount with
    the Requires= statement and schedule its startup with the After=
    statement.
    In some places var-lib-xenstored.mount is removed. This is ok because
    its optional and this unit is enabled by xenstored itself. After all its
    a private directory for xenstored.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../hotplug/Linux/systemd/xen-init-dom0.service.in |    4 ++--
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |    4 ++--
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    4 ++--
 tools/hotplug/Linux/systemd/xendomains.service.in  |    4 ++--
 tools/hotplug/Linux/systemd/xenstored.socket.in    |    2 ++
 tools/hotplug/Linux/systemd/xenstored_ro.socket.in |    2 ++
 6 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
index 3ed1633..4d4cb23 100644
--- a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
+++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
-Requires=xenstored.socket
-After=xenstored.socket
+Requires=xenstored.socket proc-xen.mount
+After=xenstored.socket proc-xen.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 0b9c2e5..1e21abb 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=qemu for xen dom0 disk backend
-Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
-After=xenstored.socket xenconsoled.service
+Requires=proc-xen.mount xenstored.socket
+After=proc-xen.mount xenstored.socket xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
 ConditionPathExists=/proc/xen/capabilities
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index d3b85a5..e6cb853 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
-Requires=xenstored.socket
-After=xenstored.socket
+Requires=proc-xen.mount xenstored.socket
+After=proc-xen.mount xenstored.socket
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 214da7a..757278f 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
-Requires=xenstored.socket
-After=xenstored.socket xenconsoled.service xen-init-dom0.service
+Requires=proc-xen.mount xenstored.socket
+After=proc-xen.mount xenstored.socket xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
index 9b28e74..2e8ee04 100644
--- a/tools/hotplug/Linux/systemd/xenstored.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored.socket.in
@@ -1,5 +1,7 @@
 [Unit]
 Description=xenstore socket
+Requires=proc-xen.mount var-lib-xenstored.mount
+After=proc-xen.mount var-lib-xenstored.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
diff --git a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
index 80402b3..140ad94 100644
--- a/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
+++ b/tools/hotplug/Linux/systemd/xenstored_ro.socket.in
@@ -1,5 +1,7 @@
 [Unit]
 Description=xenstore ro socket
+Requires=proc-xen.mount var-lib-xenstored.mount
+After=proc-xen.mount var-lib-xenstored.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Socket]
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlpx-0008MQ-3B; Thu, 30 Oct 2014 09:16:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpw-0008MB-25
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:08 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	FB/BD-02952-7D102545; Thu, 30 Oct 2014 09:16:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1414660565!5598477!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12668 invoked from network); 30 Oct 2014 09:16:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpt-0005kZ-OV
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpt-0000hL-Mb
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:05 +0000
Date: Thu, 30 Oct 2014 09:16:05 +0000
Message-Id: <E1Xjlpt-0000hL-Mb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: add helper script to
	visualize systemd dependencies
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 757df439ab19d3e32540adfa8f642ccca1876d84
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:10 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:14:13 2014 +0000

    tools/hotplug: add helper script to visualize systemd dependencies
    
    A small helper to draw a graph with dot(1) and show it with display(1):
    bash tools/hotplug/Linux/systemd/show_service_dependencies.sh \
    	tools/hotplug/Linux/systemd/*.in
    
    A red line means Requires= aka "enable it"
    A blue line means After=
    A green line means Before=
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../Linux/systemd/show_service_dependencies.sh     |   31 ++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/show_service_dependencies.sh b/tools/hotplug/Linux/systemd/show_service_dependencies.sh
new file mode 100644
index 0000000..e3e4c68
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/show_service_dependencies.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# dot(1) from graphviz, display(1) from ImageMagick
+# Usage: bash $0 tools/hotplug/Linux/systemd/*.in
+(
+echo " digraph systemd {"
+for file in "$@"
+do
+	if test -f "$file"
+	then
+		unit=${file##*/}
+		unit=${unit%.in}
+		requires="`grep ^Requires= $file | cut -f 2- -d =`"
+		before="`grep ^Before= $file | cut -f 2- -d =`"
+		after="`grep ^After= $file | cut -f 2- -d =`"
+		echo "\"$unit\" [fillcolor=lightgray color=black fontcolor=black style=filled];"
+		for i in $requires
+		do
+			echo "\"$i\" -> \"$unit\" [color=red];"
+		done
+		for i in $after
+		do
+			echo "\"$i\" -> \"$unit\" [color=blue];"
+		done
+		for i in $before
+		do
+			echo "\"$unit\" -> \"$i\" [color=green];"
+		done
+	fi
+done
+echo "}"
+) | dot -Tpng | display -
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlpx-0008MQ-3B; Thu, 30 Oct 2014 09:16:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpw-0008MB-25
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:08 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	FB/BD-02952-7D102545; Thu, 30 Oct 2014 09:16:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1414660565!5598477!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12668 invoked from network); 30 Oct 2014 09:16:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpt-0005kZ-OV
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlpt-0000hL-Mb
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:05 +0000
Date: Thu, 30 Oct 2014 09:16:05 +0000
Message-Id: <E1Xjlpt-0000hL-Mb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: add helper script to
	visualize systemd dependencies
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 757df439ab19d3e32540adfa8f642ccca1876d84
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Fri Oct 24 16:17:10 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:14:13 2014 +0000

    tools/hotplug: add helper script to visualize systemd dependencies
    
    A small helper to draw a graph with dot(1) and show it with display(1):
    bash tools/hotplug/Linux/systemd/show_service_dependencies.sh \
    	tools/hotplug/Linux/systemd/*.in
    
    A red line means Requires= aka "enable it"
    A blue line means After=
    A green line means Before=
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../Linux/systemd/show_service_dependencies.sh     |   31 ++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/show_service_dependencies.sh b/tools/hotplug/Linux/systemd/show_service_dependencies.sh
new file mode 100644
index 0000000..e3e4c68
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/show_service_dependencies.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# dot(1) from graphviz, display(1) from ImageMagick
+# Usage: bash $0 tools/hotplug/Linux/systemd/*.in
+(
+echo " digraph systemd {"
+for file in "$@"
+do
+	if test -f "$file"
+	then
+		unit=${file##*/}
+		unit=${unit%.in}
+		requires="`grep ^Requires= $file | cut -f 2- -d =`"
+		before="`grep ^Before= $file | cut -f 2- -d =`"
+		after="`grep ^After= $file | cut -f 2- -d =`"
+		echo "\"$unit\" [fillcolor=lightgray color=black fontcolor=black style=filled];"
+		for i in $requires
+		do
+			echo "\"$i\" -> \"$unit\" [color=red];"
+		done
+		for i in $after
+		do
+			echo "\"$i\" -> \"$unit\" [color=blue];"
+		done
+		for i in $before
+		do
+			echo "\"$unit\" -> \"$i\" [color=green];"
+		done
+	fi
+done
+echo "}"
+) | dot -Tpng | display -
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlq8-0008OW-5n; Thu, 30 Oct 2014 09:16:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlq7-0008OH-4j
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:19 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	35/8F-02709-2E102545; Thu, 30 Oct 2014 09:16:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414660576!11285644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3681 invoked from network); 30 Oct 2014 09:16:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlq3-0005kf-UD
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlq3-0000hj-SB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:15 +0000
Date: Thu, 30 Oct 2014 09:16:15 +0000
Message-Id: <E1Xjlq3-0000hj-SB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Add INSTALL file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f519acfb45d2a8a836d566400895534d067a803
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 23 15:37:59 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:20:41 2014 +0000

    Add INSTALL file
    
    Document how to use configure and what to pass to make(1).
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix a few typos ]
---
 INSTALL |  341 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 README  |   18 +---
 2 files changed, 342 insertions(+), 17 deletions(-)

diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..6bb9d23
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,341 @@
+
+Compiling Xen from source
+
+* Overview
+* Options recognized by configure
+* Variables recognized by make
+* Systemd support
+* History of options
+* Examples
+
+Overview
+========
+
+The xen source contains four subsystems: xen, tools, stubdom and docs.
+All but xen have to be prepared for build with a configure script in the
+toplevel directory. configure recognizes certain arguments and
+environment variables which are used to adjust various aspects of the
+following compile process. Once configure is done, make(1) has to be
+called. Also make(1) recognizes certain arguments. The following sections
+will give an overview.
+
+Options recognized by configure
+===============================
+
+The configure script in the toplevel directory will recognize these
+options. It will pass them to the configure scripts in the tools,
+stubdom, and docs directory.
+
+Individual subsystems can be selected by one of the following options.
+Please note that stubdom requires tools.
+  --disable-xen
+  --disable-tools
+  --enable-stubdom
+  --disable-docs
+
+The well known GNU configure options to specify the target directories.
+Some components of these paths will be compiled into the binaries.
+Note: prefix defaults to /usr/local, sysconfdir defaults to /etc,
+localstatedir defaults to /var.
+  --prefix=DIR
+  --libdir=DIR
+  --libexecdir=BASEDIR
+  --bindir=DIR
+  --sbindir=DIR
+  --sysconfdir=DIR
+  --sharedstatedir=DIR
+  --localstatedir=DIR
+  --includedir=DIR
+  --datarootdir=DIR
+  --datadir=DIR
+  --mandir=DIR
+  --docdir=DIR
+
+To automatically run the toolstack in dom0 during system startup some
+sysv runlevel scripts are installed. This option allows to set the path
+for a given system. Possible values are /etc/init.d, /etc/rc.d/init.d or
+/etc/rc.d. If not specified configure tries to guess the path.
+  --with-initddir=DIR
+
+The runlevel scripts load certain configuration files. They are
+typically located in a subdirectory of /etc. Possible values are this
+subdirectory are "sysconfig" or "default". If not specified configure
+tries to guess the subdir.
+  --with-sysconfig-leaf-dir=SUBDIR
+
+If the tools are configured with a non-standard --prefix the runtime
+linker will either not find the required libraries or it will load them
+from a wrong location. Compiling the tools with rpath will force the
+linker to look in the correct location.
+  --enable-rpath
+
+During build in a git checkout the buildsystem needs to download
+additional tools such as qemu. This is done with either the native git
+protocol, or via http if this option is enabled.
+  --enable-githttp
+
+Disable xenstat and xentop monitoring tools.
+  --disable-monitors
+
+Disable build of certain ocaml libraries and tools. To actually build
+them ocaml development packages must be installed. If they are missing
+configure will automatically disable this option.
+  --disable-ocamltools
+
+Disable XSM policy compilation.
+  --disable-xsmpolicy
+
+Attempt to build of an OVMF firmware binary. This requires special
+versions of development tools. Use at your own risk.
+  --enable-ovmf
+
+Use the given OVMF binary instead of compiling a private copy.
+  --with-system-ovmf=PATH
+
+Build a private copy of SeaBIOS.
+  --disable-seabios
+
+Use the given SeaBIOS binary instead of compiling a private copy.
+  --with-system-seabios=PATH
+
+Build the old qemu used by xm/xend. This is required if existing domUs
+should be migrated to this host, or if existing domU snapshots should be
+started with this version of the tools. Only if all domUs used the new
+upstream qemu during initial start it is safe to disable this option.
+The old qemu requires rombios, which can be disable along with
+qemu-traditional.
+  --enable-qemu-traditional
+  --enable-rombios
+
+The libxl toolstack uses the upstream qemu per default. A private copy
+will be built. If desired this private copy can be configured with
+additional options passed to its configure script.
+  --with-extra-qemuu-configure-args="arg1 arg2"
+
+Use the given qemu binary instead of compiling a private copy.
+  --with-system-qemu=PATH
+
+A dom0 requires a set of backend drivers. The configure script already
+supplies a list of known drivers which are automatically loaded in dom0.
+This internal list can be changed with this option.
+  --with-linux-backend-modules="kmod1 kmod2"
+
+Two variants of a xenstored exist: the original xenstored written in C
+(xenstored) or the newer and robust one written in Ocaml (oxenstored).
+The oxenstored daemon is the default but can only be used if the
+required ocaml packages are installed. In case they are missing the
+original xenstored will be used. Valid names are xenstored and
+oxenstored.
+  --with-xenstored=name
+
+Using additional CFLAGS to build tools running in dom0 is required when
+building distro packages. This is the option to pass things like
+RPM_OPT_FLAGS.
+  --with-extra-cflags-tools=EXTRA_CFLAGS
+  --with-extra-cflags-qemu-traditional=EXTRA_CFLAGS
+  --with-extra-cflags-qemu-upstream=EXTRA_CFLAGS
+
+Instead of starting the tools in dom0 with sysv runlevel scripts they
+can also be started by systemd. If this option is enabled xenstored will
+receive the communication socked directly from systemd. So starting it
+manually will not work anymore. The paths to systemd internals can also
+be changed in case the default paths do not fit anymore.
+NOTE: if systemd development packages are installed the systemd support
+will be the enabled per default. Using --disable-systemd will override
+this detection and the sysv runlevel scripts have to be used.
+  --enable-systemd
+  --with-systemd=DIR
+  --with-systemd-modules-load=DIR
+
+The old backend drivers are disabled because qdisk is now the default.
+This option can be used to build them anyway.
+  --enable-blktap1
+  --enable-blktap2
+
+Build various stubom components, some are only example code. Its usually
+enough to specify just --enable-stubdom and leave these options alone.
+  --enable-ioemu-stubdom
+  --enable-c-stubdom
+  --enable-caml-stubdom
+  --disable-pv-grub
+  --disable-xenstore-stubdom
+  --enable-vtpm-stubdom
+  --enable-vtpmmgr-stubdom
+  --disable-extfiles
+
+Per default some parts of the tools code will print additional runtime
+debug. This option can be used to disable such code paths.
+  --disable-debug
+
+The configure script recognizes also many environment variables. Calling
+the individual configure scripts in the subdirectories with the "--help"
+option will list these environment variables.
+
+Variables recognized by make
+==========================
+
+The following variables are recognized by the build system. They have to
+be passed as make options, like 'make variable=value'. Having these
+variables in the environment, like 'env variable=value make', will not
+work for most of them.
+
+In addition to pass variables as make options it is also supported to
+create a ".config" file in the toplevel directory. The file will be
+sourced by make(1).
+
+The well known variable to specify an offset during make install,
+useful for packaging.
+DESTDIR=
+
+Per default some parts of the tools code will print additional runtime
+debug. This option can be used to disable such code paths.
+debug=y
+debug_symbols=y
+
+If --prefix= was used during configure the and ocaml was enabled the
+resulting libraries will not be installed in the specified path. Instead
+the path provided by ocamlfind(1) will be used. This variable can be
+used to override this path. Using the environment variable
+OCAMLFIND_DESTDIR= and OCAMLFIND_METADIR= will have the same effect.
+OCAMLDESTDIR=
+
+The xen subsystem will install the hypervisor into fixed locations.
+BOOT_DIR defaults to /boot, EFI_DIR to /usr/lib64/efi.
+BOOT_DIR=
+EFI_DIR=
+
+The make target 'rpmball' will build a xen.rpm. This variable can be
+used to append a custom string to the name.
+PKG_SUFFIX=
+
+The hypervisor will report a certain version string. This variable can
+be used to append a custom string to the version.
+XEN_VENDORVERSION=
+
+During boot xen will report a certain user@host string, which can be
+changed with these variables.
+XEN_WHOAMI=
+XEN_DOMAIN=
+
+The following variables can be used to tweak some aspects of the
+hypervisor build.
+verbose=y
+perfc=y
+perfc_arrays=y
+lock_profile=y
+crash_debug=y
+frame_pointer=y
+lto=y
+
+During tools build external repos will be cloned into the source tree.
+This variable can be used to point to a different git binary to be used.
+GIT=
+
+During tools build external repos will be cloned into the source tree.
+During stubdom build external packages will be downloaded into the
+source tree. These variables can be used to point to a different
+locations.
+XEN_EXTFILES_URL=
+OVMF_UPSTREAM_URL=
+QEMU_UPSTREAM_URL=
+QEMU_TRADITIONAL_URL=
+SEABIOS_UPSTREAM_URL=
+
+This variable can be used to use DIR/include and DIR/lib during build.
+This is the same as PREPEND_LIB and PREPEND_INCLUDES. APPEND_LIB and
+APPEND_INCLUDES= will be appended to the CFLAGS/LDFLAGS variable.
+EXTRA_PREFIX=DIR
+PREPEND_LIB=DIR
+PREPEND_INCLUDES=DIR
+APPEND_LIB=DIR
+APPEND_INCLUDES=DIR
+
+While the tools build will set the path to the python binary with the
+configure script, the hypervisor build has to use this variable to use a
+different python binary.
+PYTHON=
+
+Building the python tools may fail unless certain options are passed to
+setup.py. Config.mk contains additional info how to use this variable.
+PYTHON_PREFIX_ARG=
+
+The hypervisor may be build with XSM support, which can be changed with
+the following variables.
+XSM_ENABLE=y
+FLASK_ENABLE=y
+
+Do a build for coverage.
+coverage=y
+
+Use clang instead of GCC.
+clang=y
+
+
+Systemd support
+===============
+
+If the systemd development packages are available then the support for
+systemd will be enabled per default. It is required to manually enable
+the installed systemd service files. Systemd has dependency tracking,
+which means all dependencies will be started automatically:
+
+systemctl enable xen-qemu-dom0-disk-backend.service
+systemctl enable xen-init-dom0.service
+systemctl enable xenconsoled.service
+
+Other optional services are:
+systemctl enable xen-domains.service
+systemctl enable xen-watchdog.service
+
+
+History of options
+==================
+
+Prior to xen-4.5 configure recognized essentially only the --prefix= and
+--libdir= option to specify target directories. Starting with xen-4.5
+all paths can be adjusted once with configure.
+
+
+Examples
+========
+
+* To build a private copy of tools and xen:
+configure --prefix=/odd/path --sysconfdir=/odd/path/etc --enable-rpath
+make
+sudo make install BOOT_DIR=/ood/path/boot EFI_DIR=/odd/path/efi
+
+
+* Use configure and make to build a distro rpm package (it is required
+  to unset variables set by the rpm configure macro):
+%build
+export WGET=$(type -P false)
+export GIT=$(type -P false)
+%configure \
+        --with-extra-cflags-tools="$RPM_OPT_FLAGS" \
+        --with-extra-cflags-qemu-traditional="$RPM_OPT_FLAGS" \
+        --with-extra-cflags-qemu-upstream="$RPM_OPT_FLAGS" \
+        --with-initddir=%{_initddir}
+unset CFLAGS CXXFLAGS FFLAGS LDFLAGS
+make
+%install
+make install \
+        SYSCONFIG_DIR=/var/adm/fillup-templates \
+        DESTDIR=$RPM_BUILD_ROOT
+
+
+* To build xen and tools using a cross compiler:
+./configure --build=x86_64-unknown-linux-gnu --host=aarch64-linux-gnu
+make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
+make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
+        DESTDIR=/some/path install
+
+
+TODO
+====
+
+ - DESTDIR should be empty, not "/"
+ - add make uninstall targets
+ - replace private path variables as needed (SBINDIR/sbindir)
+ - ...
+
+# vim: tw=72 et
diff --git a/README b/README
index 6840290..412607a 100644
--- a/README
+++ b/README
@@ -109,8 +109,7 @@ performed with root privileges.]
     # make world
     # make install
 
-   If you want, you can run ./configure --help to see the list of
-   options available options when building and installing Xen.
+   See the documentation in the INSTALL file for more info.
 
    This will create and install onto the local machine. It will build
    the xen binary (xen.gz), the tools and the documentation.
@@ -165,21 +164,6 @@ change take effect.
 [1] http://wiki.xen.org/wiki/XenStoreReference
 [2] http://wiki.xen.org/wiki/Xenstored
 
-Systemd support
-===============
-
-If you have systemd development packages installed you can build binaries
-with systemd support. Systemd support is enabled by default if you have
-systemd development libraries present. If you want to force enable systemd to
-ensure you build binaries with systemd support you can use the --enable-systemd
-flag. Likewise if you want to force disable systemd you can use:
-
-	./configure --disable-systemd
-
-For more details refer to the xen xenstored systemd wiki page [3].
-
-[3] http://wiki.xen.org/wiki/Xenstored#xenstored_systemd_support
-
 Python Runtime Libraries
 ========================
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlq8-0008OW-5n; Thu, 30 Oct 2014 09:16:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlq7-0008OH-4j
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:19 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	35/8F-02709-2E102545; Thu, 30 Oct 2014 09:16:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1414660576!11285644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3681 invoked from network); 30 Oct 2014 09:16:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlq3-0005kf-UD
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlq3-0000hj-SB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:15 +0000
Date: Thu, 30 Oct 2014 09:16:15 +0000
Message-Id: <E1Xjlq3-0000hj-SB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Add INSTALL file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f519acfb45d2a8a836d566400895534d067a803
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 23 15:37:59 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:20:41 2014 +0000

    Add INSTALL file
    
    Document how to use configure and what to pass to make(1).
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fix a few typos ]
---
 INSTALL |  341 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 README  |   18 +---
 2 files changed, 342 insertions(+), 17 deletions(-)

diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..6bb9d23
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,341 @@
+
+Compiling Xen from source
+
+* Overview
+* Options recognized by configure
+* Variables recognized by make
+* Systemd support
+* History of options
+* Examples
+
+Overview
+========
+
+The xen source contains four subsystems: xen, tools, stubdom and docs.
+All but xen have to be prepared for build with a configure script in the
+toplevel directory. configure recognizes certain arguments and
+environment variables which are used to adjust various aspects of the
+following compile process. Once configure is done, make(1) has to be
+called. Also make(1) recognizes certain arguments. The following sections
+will give an overview.
+
+Options recognized by configure
+===============================
+
+The configure script in the toplevel directory will recognize these
+options. It will pass them to the configure scripts in the tools,
+stubdom, and docs directory.
+
+Individual subsystems can be selected by one of the following options.
+Please note that stubdom requires tools.
+  --disable-xen
+  --disable-tools
+  --enable-stubdom
+  --disable-docs
+
+The well known GNU configure options to specify the target directories.
+Some components of these paths will be compiled into the binaries.
+Note: prefix defaults to /usr/local, sysconfdir defaults to /etc,
+localstatedir defaults to /var.
+  --prefix=DIR
+  --libdir=DIR
+  --libexecdir=BASEDIR
+  --bindir=DIR
+  --sbindir=DIR
+  --sysconfdir=DIR
+  --sharedstatedir=DIR
+  --localstatedir=DIR
+  --includedir=DIR
+  --datarootdir=DIR
+  --datadir=DIR
+  --mandir=DIR
+  --docdir=DIR
+
+To automatically run the toolstack in dom0 during system startup some
+sysv runlevel scripts are installed. This option allows to set the path
+for a given system. Possible values are /etc/init.d, /etc/rc.d/init.d or
+/etc/rc.d. If not specified configure tries to guess the path.
+  --with-initddir=DIR
+
+The runlevel scripts load certain configuration files. They are
+typically located in a subdirectory of /etc. Possible values are this
+subdirectory are "sysconfig" or "default". If not specified configure
+tries to guess the subdir.
+  --with-sysconfig-leaf-dir=SUBDIR
+
+If the tools are configured with a non-standard --prefix the runtime
+linker will either not find the required libraries or it will load them
+from a wrong location. Compiling the tools with rpath will force the
+linker to look in the correct location.
+  --enable-rpath
+
+During build in a git checkout the buildsystem needs to download
+additional tools such as qemu. This is done with either the native git
+protocol, or via http if this option is enabled.
+  --enable-githttp
+
+Disable xenstat and xentop monitoring tools.
+  --disable-monitors
+
+Disable build of certain ocaml libraries and tools. To actually build
+them ocaml development packages must be installed. If they are missing
+configure will automatically disable this option.
+  --disable-ocamltools
+
+Disable XSM policy compilation.
+  --disable-xsmpolicy
+
+Attempt to build of an OVMF firmware binary. This requires special
+versions of development tools. Use at your own risk.
+  --enable-ovmf
+
+Use the given OVMF binary instead of compiling a private copy.
+  --with-system-ovmf=PATH
+
+Build a private copy of SeaBIOS.
+  --disable-seabios
+
+Use the given SeaBIOS binary instead of compiling a private copy.
+  --with-system-seabios=PATH
+
+Build the old qemu used by xm/xend. This is required if existing domUs
+should be migrated to this host, or if existing domU snapshots should be
+started with this version of the tools. Only if all domUs used the new
+upstream qemu during initial start it is safe to disable this option.
+The old qemu requires rombios, which can be disable along with
+qemu-traditional.
+  --enable-qemu-traditional
+  --enable-rombios
+
+The libxl toolstack uses the upstream qemu per default. A private copy
+will be built. If desired this private copy can be configured with
+additional options passed to its configure script.
+  --with-extra-qemuu-configure-args="arg1 arg2"
+
+Use the given qemu binary instead of compiling a private copy.
+  --with-system-qemu=PATH
+
+A dom0 requires a set of backend drivers. The configure script already
+supplies a list of known drivers which are automatically loaded in dom0.
+This internal list can be changed with this option.
+  --with-linux-backend-modules="kmod1 kmod2"
+
+Two variants of a xenstored exist: the original xenstored written in C
+(xenstored) or the newer and robust one written in Ocaml (oxenstored).
+The oxenstored daemon is the default but can only be used if the
+required ocaml packages are installed. In case they are missing the
+original xenstored will be used. Valid names are xenstored and
+oxenstored.
+  --with-xenstored=name
+
+Using additional CFLAGS to build tools running in dom0 is required when
+building distro packages. This is the option to pass things like
+RPM_OPT_FLAGS.
+  --with-extra-cflags-tools=EXTRA_CFLAGS
+  --with-extra-cflags-qemu-traditional=EXTRA_CFLAGS
+  --with-extra-cflags-qemu-upstream=EXTRA_CFLAGS
+
+Instead of starting the tools in dom0 with sysv runlevel scripts they
+can also be started by systemd. If this option is enabled xenstored will
+receive the communication socked directly from systemd. So starting it
+manually will not work anymore. The paths to systemd internals can also
+be changed in case the default paths do not fit anymore.
+NOTE: if systemd development packages are installed the systemd support
+will be the enabled per default. Using --disable-systemd will override
+this detection and the sysv runlevel scripts have to be used.
+  --enable-systemd
+  --with-systemd=DIR
+  --with-systemd-modules-load=DIR
+
+The old backend drivers are disabled because qdisk is now the default.
+This option can be used to build them anyway.
+  --enable-blktap1
+  --enable-blktap2
+
+Build various stubom components, some are only example code. Its usually
+enough to specify just --enable-stubdom and leave these options alone.
+  --enable-ioemu-stubdom
+  --enable-c-stubdom
+  --enable-caml-stubdom
+  --disable-pv-grub
+  --disable-xenstore-stubdom
+  --enable-vtpm-stubdom
+  --enable-vtpmmgr-stubdom
+  --disable-extfiles
+
+Per default some parts of the tools code will print additional runtime
+debug. This option can be used to disable such code paths.
+  --disable-debug
+
+The configure script recognizes also many environment variables. Calling
+the individual configure scripts in the subdirectories with the "--help"
+option will list these environment variables.
+
+Variables recognized by make
+==========================
+
+The following variables are recognized by the build system. They have to
+be passed as make options, like 'make variable=value'. Having these
+variables in the environment, like 'env variable=value make', will not
+work for most of them.
+
+In addition to pass variables as make options it is also supported to
+create a ".config" file in the toplevel directory. The file will be
+sourced by make(1).
+
+The well known variable to specify an offset during make install,
+useful for packaging.
+DESTDIR=
+
+Per default some parts of the tools code will print additional runtime
+debug. This option can be used to disable such code paths.
+debug=y
+debug_symbols=y
+
+If --prefix= was used during configure the and ocaml was enabled the
+resulting libraries will not be installed in the specified path. Instead
+the path provided by ocamlfind(1) will be used. This variable can be
+used to override this path. Using the environment variable
+OCAMLFIND_DESTDIR= and OCAMLFIND_METADIR= will have the same effect.
+OCAMLDESTDIR=
+
+The xen subsystem will install the hypervisor into fixed locations.
+BOOT_DIR defaults to /boot, EFI_DIR to /usr/lib64/efi.
+BOOT_DIR=
+EFI_DIR=
+
+The make target 'rpmball' will build a xen.rpm. This variable can be
+used to append a custom string to the name.
+PKG_SUFFIX=
+
+The hypervisor will report a certain version string. This variable can
+be used to append a custom string to the version.
+XEN_VENDORVERSION=
+
+During boot xen will report a certain user@host string, which can be
+changed with these variables.
+XEN_WHOAMI=
+XEN_DOMAIN=
+
+The following variables can be used to tweak some aspects of the
+hypervisor build.
+verbose=y
+perfc=y
+perfc_arrays=y
+lock_profile=y
+crash_debug=y
+frame_pointer=y
+lto=y
+
+During tools build external repos will be cloned into the source tree.
+This variable can be used to point to a different git binary to be used.
+GIT=
+
+During tools build external repos will be cloned into the source tree.
+During stubdom build external packages will be downloaded into the
+source tree. These variables can be used to point to a different
+locations.
+XEN_EXTFILES_URL=
+OVMF_UPSTREAM_URL=
+QEMU_UPSTREAM_URL=
+QEMU_TRADITIONAL_URL=
+SEABIOS_UPSTREAM_URL=
+
+This variable can be used to use DIR/include and DIR/lib during build.
+This is the same as PREPEND_LIB and PREPEND_INCLUDES. APPEND_LIB and
+APPEND_INCLUDES= will be appended to the CFLAGS/LDFLAGS variable.
+EXTRA_PREFIX=DIR
+PREPEND_LIB=DIR
+PREPEND_INCLUDES=DIR
+APPEND_LIB=DIR
+APPEND_INCLUDES=DIR
+
+While the tools build will set the path to the python binary with the
+configure script, the hypervisor build has to use this variable to use a
+different python binary.
+PYTHON=
+
+Building the python tools may fail unless certain options are passed to
+setup.py. Config.mk contains additional info how to use this variable.
+PYTHON_PREFIX_ARG=
+
+The hypervisor may be build with XSM support, which can be changed with
+the following variables.
+XSM_ENABLE=y
+FLASK_ENABLE=y
+
+Do a build for coverage.
+coverage=y
+
+Use clang instead of GCC.
+clang=y
+
+
+Systemd support
+===============
+
+If the systemd development packages are available then the support for
+systemd will be enabled per default. It is required to manually enable
+the installed systemd service files. Systemd has dependency tracking,
+which means all dependencies will be started automatically:
+
+systemctl enable xen-qemu-dom0-disk-backend.service
+systemctl enable xen-init-dom0.service
+systemctl enable xenconsoled.service
+
+Other optional services are:
+systemctl enable xen-domains.service
+systemctl enable xen-watchdog.service
+
+
+History of options
+==================
+
+Prior to xen-4.5 configure recognized essentially only the --prefix= and
+--libdir= option to specify target directories. Starting with xen-4.5
+all paths can be adjusted once with configure.
+
+
+Examples
+========
+
+* To build a private copy of tools and xen:
+configure --prefix=/odd/path --sysconfdir=/odd/path/etc --enable-rpath
+make
+sudo make install BOOT_DIR=/ood/path/boot EFI_DIR=/odd/path/efi
+
+
+* Use configure and make to build a distro rpm package (it is required
+  to unset variables set by the rpm configure macro):
+%build
+export WGET=$(type -P false)
+export GIT=$(type -P false)
+%configure \
+        --with-extra-cflags-tools="$RPM_OPT_FLAGS" \
+        --with-extra-cflags-qemu-traditional="$RPM_OPT_FLAGS" \
+        --with-extra-cflags-qemu-upstream="$RPM_OPT_FLAGS" \
+        --with-initddir=%{_initddir}
+unset CFLAGS CXXFLAGS FFLAGS LDFLAGS
+make
+%install
+make install \
+        SYSCONFIG_DIR=/var/adm/fillup-templates \
+        DESTDIR=$RPM_BUILD_ROOT
+
+
+* To build xen and tools using a cross compiler:
+./configure --build=x86_64-unknown-linux-gnu --host=aarch64-linux-gnu
+make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
+make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
+        DESTDIR=/some/path install
+
+
+TODO
+====
+
+ - DESTDIR should be empty, not "/"
+ - add make uninstall targets
+ - replace private path variables as needed (SBINDIR/sbindir)
+ - ...
+
+# vim: tw=72 et
diff --git a/README b/README
index 6840290..412607a 100644
--- a/README
+++ b/README
@@ -109,8 +109,7 @@ performed with root privileges.]
     # make world
     # make install
 
-   If you want, you can run ./configure --help to see the list of
-   options available options when building and installing Xen.
+   See the documentation in the INSTALL file for more info.
 
    This will create and install onto the local machine. It will build
    the xen binary (xen.gz), the tools and the documentation.
@@ -165,21 +164,6 @@ change take effect.
 [1] http://wiki.xen.org/wiki/XenStoreReference
 [2] http://wiki.xen.org/wiki/Xenstored
 
-Systemd support
-===============
-
-If you have systemd development packages installed you can build binaries
-with systemd support. Systemd support is enabled by default if you have
-systemd development libraries present. If you want to force enable systemd to
-ensure you build binaries with systemd support you can use the --enable-systemd
-flag. Likewise if you want to force disable systemd you can use:
-
-	./configure --disable-systemd
-
-For more details refer to the xen xenstored systemd wiki page [3].
-
-[3] http://wiki.xen.org/wiki/Xenstored#xenstored_systemd_support
-
 Python Runtime Libraries
 ========================
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlqH-0008QW-An; Thu, 30 Oct 2014 09:16:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqG-0008QD-9w
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:28 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7E/9B-10419-BE102545; Thu, 30 Oct 2014 09:16:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1414660586!13553185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29534 invoked from network); 30 Oct 2014 09:16:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqE-0005kl-3l
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqE-0000i6-2C
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:26 +0000
Date: Thu, 30 Oct 2014 09:16:26 +0000
Message-Id: <E1XjlqE-0000i6-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: dump guest stack even if not
	the current VCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 281c892e3bdb0a56cfd8ab6516cd1a33c095c857
Author:     Frediano Ziglio <frediano.ziglio@huawei.com>
AuthorDate: Thu Oct 23 17:18:52 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:25:00 2014 +0000

    xen/arm: dump guest stack even if not the current VCPU
    
    If show_guest_stack was called from Xen context (for instance hitting
    '0' key on Xen console) get_page_from_gva was not able to get the
    page returning NULL.
    Detecting different domain and changing VTTBR register make
    get_page_from_gva works for different domains.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c   |   24 ++++++++++++++++++++----
 xen/arch/arm/traps.c |    2 +-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 7b08f16..8809f5a 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1157,13 +1157,29 @@ struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     struct page_info *page = NULL;
-    paddr_t maddr;
-
-    ASSERT(d == current->domain);
+    paddr_t maddr = 0;
+    int rc;
 
     spin_lock(&p2m->lock);
 
-    if ( gvirt_to_maddr(va, &maddr, flags) )
+    if ( unlikely(d != current->domain) )
+    {
+        unsigned long irq_flags;
+
+        local_irq_save(irq_flags);
+        p2m_load_VTTBR(d);
+
+        rc = gvirt_to_maddr(va, &maddr, flags);
+
+        p2m_load_VTTBR(current->domain);
+        local_irq_restore(irq_flags);
+    }
+    else
+    {
+        rc = gvirt_to_maddr(va, &maddr, flags);
+    }
+
+    if ( rc )
         goto err;
 
     if ( !mfn_valid(maddr >> PAGE_SHIFT) )
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index f6fc8f8..4c93250 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -892,7 +892,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
         return;
     }
 
-    page = get_page_from_gva(current->domain, sp, GV2M_READ);
+    page = get_page_from_gva(v->domain, sp, GV2M_READ);
     if ( page == NULL )
     {
         printk("Failed to convert stack to physical address\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlqH-0008QW-An; Thu, 30 Oct 2014 09:16:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqG-0008QD-9w
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:28 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7E/9B-10419-BE102545; Thu, 30 Oct 2014 09:16:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1414660586!13553185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29534 invoked from network); 30 Oct 2014 09:16:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqE-0005kl-3l
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqE-0000i6-2C
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:26 +0000
Date: Thu, 30 Oct 2014 09:16:26 +0000
Message-Id: <E1XjlqE-0000i6-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: dump guest stack even if not
	the current VCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 281c892e3bdb0a56cfd8ab6516cd1a33c095c857
Author:     Frediano Ziglio <frediano.ziglio@huawei.com>
AuthorDate: Thu Oct 23 17:18:52 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Oct 27 10:25:00 2014 +0000

    xen/arm: dump guest stack even if not the current VCPU
    
    If show_guest_stack was called from Xen context (for instance hitting
    '0' key on Xen console) get_page_from_gva was not able to get the
    page returning NULL.
    Detecting different domain and changing VTTBR register make
    get_page_from_gva works for different domains.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c   |   24 ++++++++++++++++++++----
 xen/arch/arm/traps.c |    2 +-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 7b08f16..8809f5a 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1157,13 +1157,29 @@ struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     struct page_info *page = NULL;
-    paddr_t maddr;
-
-    ASSERT(d == current->domain);
+    paddr_t maddr = 0;
+    int rc;
 
     spin_lock(&p2m->lock);
 
-    if ( gvirt_to_maddr(va, &maddr, flags) )
+    if ( unlikely(d != current->domain) )
+    {
+        unsigned long irq_flags;
+
+        local_irq_save(irq_flags);
+        p2m_load_VTTBR(d);
+
+        rc = gvirt_to_maddr(va, &maddr, flags);
+
+        p2m_load_VTTBR(current->domain);
+        local_irq_restore(irq_flags);
+    }
+    else
+    {
+        rc = gvirt_to_maddr(va, &maddr, flags);
+    }
+
+    if ( rc )
         goto err;
 
     if ( !mfn_valid(maddr >> PAGE_SHIFT) )
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index f6fc8f8..4c93250 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -892,7 +892,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
         return;
     }
 
-    page = get_page_from_gva(current->domain, sp, GV2M_READ);
+    page = get_page_from_gva(v->domain, sp, GV2M_READ);
     if ( page == NULL )
     {
         printk("Failed to convert stack to physical address\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlqS-0008SP-De; Thu, 30 Oct 2014 09:16:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqQ-0008S4-S6
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:38 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	47/17-02696-6F102545; Thu, 30 Oct 2014 09:16:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1414660596!7814291!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7844 invoked from network); 30 Oct 2014 09:16:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqO-0005kt-AF
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqO-0000iX-8M
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:36 +0000
Date: Thu, 30 Oct 2014 09:16:36 +0000
Message-Id: <E1XjlqO-0000iX-8M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: fix save/restore issue with apicv
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 607e8494c42397fb249191904066cace6ac9a880
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Mon Oct 27 16:40:18 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:40:18 2014 +0100

    vmx: fix save/restore issue with apicv
    
    This patch fixes two issues:
    
    1. Interrupts on PIR are lost during save/restore. Syncing the PIR
    into IRR during save will fix it.
    
    2. EOI exit bitmap doesn't set up correctly after restore. Here we
    will construct the eoi exit bitmap via (IRR | ISR). Though it may cause
    unnecessary eoi exit of the interrupts that pending in IRR or ISR during
    save/restore, each pending interrupt only causes one vmexit. The
    subsequent interrupts will adjust the eoi exit bitmap correctly. So
    the performance hurt can be ignored.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c        |    3 +++
 xen/arch/x86/hvm/vmx/vmx.c       |   24 ++++++++++++++++++++++++
 xen/include/asm-x86/hvm/vlapic.h |    2 ++
 3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 2f09713..0b7b607 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1312,6 +1312,9 @@ static int lapic_save_regs(struct domain *d, hvm_domain_context_t *h)
 
     for_each_vcpu ( d, v )
     {
+        if ( hvm_funcs.sync_pir_to_irr )
+            hvm_funcs.sync_pir_to_irr(v);
+
         s = vcpu_vlapic(v);
         if ( (rc = hvm_save_entry(LAPIC_REGS, v->vcpu_id, h, s->regs)) != 0 )
             break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 304aeea..29aaad4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1584,6 +1584,8 @@ static void vmx_process_isr(int isr, struct vcpu *v)
 {
     unsigned long status;
     u8 old;
+    unsigned int i;
+    const struct vlapic *vlapic = vcpu_vlapic(v);
 
     if ( isr < 0 )
         isr = 0;
@@ -1597,6 +1599,28 @@ static void vmx_process_isr(int isr, struct vcpu *v)
         status |= isr << VMX_GUEST_INTR_STATUS_SVI_OFFSET;
         __vmwrite(GUEST_INTR_STATUS, status);
     }
+
+    /*
+     * Theoretically, only level triggered interrupts can have their
+     * corresponding bits set in the eoi exit bitmap. That is, the bits
+     * set in the eoi exit bitmap should also be set in TMR. But a periodic
+     * timer interrupt does not follow the rule: it is edge triggered, but
+     * requires its corresponding bit be set in the eoi exit bitmap. So we
+     * should not construct the eoi exit bitmap based on TMR.
+     * Here we will construct the eoi exit bitmap via (IRR | ISR). This
+     * means that EOIs to the interrupts that are set in the IRR or ISR will
+     * cause VM exits after restoring, regardless of the trigger modes. It
+     * is acceptable because the subsequent interrupts will set up the eoi
+     * bitmap correctly.
+     */
+    for ( i = 0x10; i < NR_VECTORS; ++i )
+        if ( vlapic_test_vector(i, &vlapic->regs->data[APIC_IRR]) ||
+             vlapic_test_vector(i, &vlapic->regs->data[APIC_ISR]) )
+            set_bit(i, v->arch.hvm_vmx.eoi_exit_bitmap);
+
+    for ( i = 0; i < ARRAY_SIZE(v->arch.hvm_vmx.eoi_exit_bitmap); ++i )
+        __vmwrite(EOI_EXIT_BITMAP(i), v->arch.hvm_vmx.eoi_exit_bitmap[i]);
+
     vmx_vmcs_exit(v);
 }
 
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index 16752b5..cfe9bdb 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -61,6 +61,8 @@
 
 #define VEC_POS(v) ((v) % 32)
 #define REG_POS(v) (((v) / 32) * 0x10)
+#define vlapic_test_vector(vec, bitmap)                                 \
+    test_bit(VEC_POS(vec), (const uint32_t *)((bitmap) + REG_POS(vec)))
 #define vlapic_test_and_set_vector(vec, bitmap)                         \
     test_and_set_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
 #define vlapic_test_and_clear_vector(vec, bitmap)                       \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlqS-0008SP-De; Thu, 30 Oct 2014 09:16:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqQ-0008S4-S6
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:38 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	47/17-02696-6F102545; Thu, 30 Oct 2014 09:16:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1414660596!7814291!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7844 invoked from network); 30 Oct 2014 09:16:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqO-0005kt-AF
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqO-0000iX-8M
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:36 +0000
Date: Thu, 30 Oct 2014 09:16:36 +0000
Message-Id: <E1XjlqO-0000iX-8M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: fix save/restore issue with apicv
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 607e8494c42397fb249191904066cace6ac9a880
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Mon Oct 27 16:40:18 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:40:18 2014 +0100

    vmx: fix save/restore issue with apicv
    
    This patch fixes two issues:
    
    1. Interrupts on PIR are lost during save/restore. Syncing the PIR
    into IRR during save will fix it.
    
    2. EOI exit bitmap doesn't set up correctly after restore. Here we
    will construct the eoi exit bitmap via (IRR | ISR). Though it may cause
    unnecessary eoi exit of the interrupts that pending in IRR or ISR during
    save/restore, each pending interrupt only causes one vmexit. The
    subsequent interrupts will adjust the eoi exit bitmap correctly. So
    the performance hurt can be ignored.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c        |    3 +++
 xen/arch/x86/hvm/vmx/vmx.c       |   24 ++++++++++++++++++++++++
 xen/include/asm-x86/hvm/vlapic.h |    2 ++
 3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 2f09713..0b7b607 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1312,6 +1312,9 @@ static int lapic_save_regs(struct domain *d, hvm_domain_context_t *h)
 
     for_each_vcpu ( d, v )
     {
+        if ( hvm_funcs.sync_pir_to_irr )
+            hvm_funcs.sync_pir_to_irr(v);
+
         s = vcpu_vlapic(v);
         if ( (rc = hvm_save_entry(LAPIC_REGS, v->vcpu_id, h, s->regs)) != 0 )
             break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 304aeea..29aaad4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1584,6 +1584,8 @@ static void vmx_process_isr(int isr, struct vcpu *v)
 {
     unsigned long status;
     u8 old;
+    unsigned int i;
+    const struct vlapic *vlapic = vcpu_vlapic(v);
 
     if ( isr < 0 )
         isr = 0;
@@ -1597,6 +1599,28 @@ static void vmx_process_isr(int isr, struct vcpu *v)
         status |= isr << VMX_GUEST_INTR_STATUS_SVI_OFFSET;
         __vmwrite(GUEST_INTR_STATUS, status);
     }
+
+    /*
+     * Theoretically, only level triggered interrupts can have their
+     * corresponding bits set in the eoi exit bitmap. That is, the bits
+     * set in the eoi exit bitmap should also be set in TMR. But a periodic
+     * timer interrupt does not follow the rule: it is edge triggered, but
+     * requires its corresponding bit be set in the eoi exit bitmap. So we
+     * should not construct the eoi exit bitmap based on TMR.
+     * Here we will construct the eoi exit bitmap via (IRR | ISR). This
+     * means that EOIs to the interrupts that are set in the IRR or ISR will
+     * cause VM exits after restoring, regardless of the trigger modes. It
+     * is acceptable because the subsequent interrupts will set up the eoi
+     * bitmap correctly.
+     */
+    for ( i = 0x10; i < NR_VECTORS; ++i )
+        if ( vlapic_test_vector(i, &vlapic->regs->data[APIC_IRR]) ||
+             vlapic_test_vector(i, &vlapic->regs->data[APIC_ISR]) )
+            set_bit(i, v->arch.hvm_vmx.eoi_exit_bitmap);
+
+    for ( i = 0; i < ARRAY_SIZE(v->arch.hvm_vmx.eoi_exit_bitmap); ++i )
+        __vmwrite(EOI_EXIT_BITMAP(i), v->arch.hvm_vmx.eoi_exit_bitmap[i]);
+
     vmx_vmcs_exit(v);
 }
 
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index 16752b5..cfe9bdb 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -61,6 +61,8 @@
 
 #define VEC_POS(v) ((v) % 32)
 #define REG_POS(v) (((v) / 32) * 0x10)
+#define vlapic_test_vector(vec, bitmap)                                 \
+    test_bit(VEC_POS(vec), (const uint32_t *)((bitmap) + REG_POS(vec)))
 #define vlapic_test_and_set_vector(vec, bitmap)                         \
     test_and_set_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
 #define vlapic_test_and_clear_vector(vec, bitmap)                       \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlqc-0008UX-GW; Thu, 30 Oct 2014 09:16:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqb-0008UJ-29
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:49 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	15/BF-03135-00202545; Thu, 30 Oct 2014 09:16:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1414660606!12552823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10008 invoked from network); 30 Oct 2014 09:16:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqY-0005kz-H1
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqY-0000it-EH
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:46 +0000
Date: Thu, 30 Oct 2014 09:16:46 +0000
Message-Id: <E1XjlqY-0000it-EH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvm/load: correct length checks for
	zeroextended records
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66d0c0aa1f3e57e873fd64d1d370e11758d25442
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 16:41:50 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:41:50 2014 +0100

    hvm/load: correct length checks for zeroextended records
    
    In the case that Xen is attempting to load a zeroextended HVM record where the
    difference needing extending would overflow the data blob, _hvm_check_entry()
    will incorrectly fail before working out that it would have been safe.
    
    The "len + sizeof(*d)" check is wrong.  Consider zeroextending a 16 byte
    record into a 32 byte structure.  "32 + hdr" will fail the overall context
    length check even though the pre-extended record in the stream is 16 bytes.
    
    The first condition is reduced to just a length check for hvm save header,
    while the second condition is extended to include a check that the record in
    the stream not exceeding the stream length.
    
    The error messages are extended to include further useful information.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <Paul.Durrant@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/hvm/save.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/xen/common/hvm/save.c b/xen/common/hvm/save.c
index 6c16399..da6e668 100644
--- a/xen/common/hvm/save.c
+++ b/xen/common/hvm/save.c
@@ -292,19 +292,22 @@ int _hvm_check_entry(struct hvm_domain_context *h,
 {
     struct hvm_save_descriptor *d 
         = (struct hvm_save_descriptor *)&h->data[h->cur];
-    if ( len + sizeof (*d) > h->size - h->cur)
+    if ( sizeof(*d) > h->size - h->cur)
     {
         printk(XENLOG_G_WARNING
-               "HVM restore: not enough data left to read %u bytes "
-               "for type %u\n", len, type);
+               "HVM restore: not enough data left to read %zu bytes "
+               "for type %u header\n", sizeof(*d), type);
         return -1;
-    }    
-    if ( (type != d->typecode) || (len < d->length) ||
-         (strict_length && (len != d->length)) )
+    }
+    if ( (type != d->typecode) ||
+         (strict_length ? (len != d->length) : (len < d->length)) ||
+         (d->length > (h->size - h->cur - sizeof(*d))) )
     {
         printk(XENLOG_G_WARNING
-               "HVM restore mismatch: expected type %u length %u, "
-               "saw type %u length %u\n", type, len, d->typecode, d->length);
+               "HVM restore mismatch: expected %s type %u length %u, "
+               "saw type %u length %u.  %zu bytes remaining\n",
+               strict_length ? "strict" : "zeroextended", type, len,
+               d->typecode, d->length, h->size - h->cur - sizeof(*d));
         return -1;
     }
     h->cur += sizeof(*d);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:16:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:16:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlqc-0008UX-GW; Thu, 30 Oct 2014 09:16:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqb-0008UJ-29
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:49 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	15/BF-03135-00202545; Thu, 30 Oct 2014 09:16:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1414660606!12552823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10008 invoked from network); 30 Oct 2014 09:16:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqY-0005kz-H1
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlqY-0000it-EH
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:46 +0000
Date: Thu, 30 Oct 2014 09:16:46 +0000
Message-Id: <E1XjlqY-0000it-EH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvm/load: correct length checks for
	zeroextended records
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66d0c0aa1f3e57e873fd64d1d370e11758d25442
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 16:41:50 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:41:50 2014 +0100

    hvm/load: correct length checks for zeroextended records
    
    In the case that Xen is attempting to load a zeroextended HVM record where the
    difference needing extending would overflow the data blob, _hvm_check_entry()
    will incorrectly fail before working out that it would have been safe.
    
    The "len + sizeof(*d)" check is wrong.  Consider zeroextending a 16 byte
    record into a 32 byte structure.  "32 + hdr" will fail the overall context
    length check even though the pre-extended record in the stream is 16 bytes.
    
    The first condition is reduced to just a length check for hvm save header,
    while the second condition is extended to include a check that the record in
    the stream not exceeding the stream length.
    
    The error messages are extended to include further useful information.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <Paul.Durrant@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/hvm/save.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/xen/common/hvm/save.c b/xen/common/hvm/save.c
index 6c16399..da6e668 100644
--- a/xen/common/hvm/save.c
+++ b/xen/common/hvm/save.c
@@ -292,19 +292,22 @@ int _hvm_check_entry(struct hvm_domain_context *h,
 {
     struct hvm_save_descriptor *d 
         = (struct hvm_save_descriptor *)&h->data[h->cur];
-    if ( len + sizeof (*d) > h->size - h->cur)
+    if ( sizeof(*d) > h->size - h->cur)
     {
         printk(XENLOG_G_WARNING
-               "HVM restore: not enough data left to read %u bytes "
-               "for type %u\n", len, type);
+               "HVM restore: not enough data left to read %zu bytes "
+               "for type %u header\n", sizeof(*d), type);
         return -1;
-    }    
-    if ( (type != d->typecode) || (len < d->length) ||
-         (strict_length && (len != d->length)) )
+    }
+    if ( (type != d->typecode) ||
+         (strict_length ? (len != d->length) : (len < d->length)) ||
+         (d->length > (h->size - h->cur - sizeof(*d))) )
     {
         printk(XENLOG_G_WARNING
-               "HVM restore mismatch: expected type %u length %u, "
-               "saw type %u length %u\n", type, len, d->typecode, d->length);
+               "HVM restore mismatch: expected %s type %u length %u, "
+               "saw type %u length %u.  %zu bytes remaining\n",
+               strict_length ? "strict" : "zeroextended", type, len,
+               d->typecode, d->length, h->size - h->cur - sizeof(*d));
         return -1;
     }
     h->cur += sizeof(*d);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlqx-00005K-JW; Thu, 30 Oct 2014 09:17:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqv-00005B-Ua
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:10 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	4A/E5-03668-51202545; Thu, 30 Oct 2014 09:17:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1414660627!12527971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20959 invoked from network); 30 Oct 2014 09:17:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqs-0005li-Sh
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqs-0000kU-RZ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:06 +0000
Date: Thu, 30 Oct 2014 09:17:06 +0000
Message-Id: <E1Xjlqs-0000kU-RZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: allow to suppress the use of
	runtime services
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5680244040d26234a43c7f884ecf98fa4928d0da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 16:43:52 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:43:52 2014 +0100

    EFI: allow to suppress the use of runtime services
    
    On certain systems some of the memory map entries designated for use by
    runtime services cannot be mapped (frequently due to firmware bugs). On
    others, some of the memory map entries aren't even marked for runtime
    services use, yet are being used by them. For both cases give people a
    way to suppress use of runtime services altogether.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    7 +++
 xen/common/efi/boot.c               |   12 +++++-
 xen/common/efi/runtime.c            |   86 +++++++++++++++++++++++++---------
 3 files changed, 81 insertions(+), 24 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 00416af..0830e5f 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -565,6 +565,13 @@ Either force retrieval of monitor EDID information via VESA DDC, or
 disable it (edid=no). This option should not normally be required
 except for debugging purposes.
 
+### efi-rs
+> `= <boolean>`
+
+> Default: `true`
+
+Force or disable use of EFI runtime services.
+
 ### extra\_guest\_irqs
 > `= [<domU number>][,<dom0 number>]`
 
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 4257341..d31b0f9 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1072,6 +1072,10 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 }
 
 #ifndef CONFIG_ARM /* TODO - runtime service support */
+
+static bool_t __initdata efi_rs_enable = 1;
+boolean_param("efi-rs", efi_rs_enable);
+
 #ifndef USE_SET_VIRTUAL_ADDRESS_MAP
 static __init void copy_mapping(unsigned long mfn, unsigned long end,
                                 bool_t (*is_valid)(unsigned long smfn,
@@ -1145,7 +1149,7 @@ void __init efi_init_memory(void)
                desc->PhysicalStart, desc->PhysicalStart + len - 1,
                desc->Type, desc->Attribute);
 
-        if ( !(desc->Attribute & EFI_MEMORY_RUNTIME) )
+        if ( !efi_rs_enable || !(desc->Attribute & EFI_MEMORY_RUNTIME) )
             continue;
 
         desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
@@ -1209,6 +1213,12 @@ void __init efi_init_memory(void)
         }
     }
 
+    if ( !efi_rs_enable )
+    {
+        efi_fw_vendor = NULL;
+        return;
+    }
+
 #ifdef USE_SET_VIRTUAL_ADDRESS_MAP
     efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size,
                                  mdesc_ver, efi_memmap);
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 553ff91..1a0caea 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -56,6 +56,9 @@ unsigned long efi_rs_enter(void)
     static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    if ( !efi_l4_pgtable )
+        return 0;
+
     save_fpu_enable();
     asm volatile ( "fldcw %0" :: "m" (fcw) );
     asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
@@ -83,6 +86,8 @@ unsigned long efi_rs_enter(void)
 
 void efi_rs_leave(unsigned long cr3)
 {
+    if ( !cr3 )
+        return;
     write_cr3(cr3);
     if ( is_pv_vcpu(current) && !is_idle_vcpu(current) )
     {
@@ -100,7 +105,7 @@ void efi_rs_leave(unsigned long cr3)
 
 paddr_t efi_rs_page_table(void)
 {
-    return virt_to_maddr(efi_l4_pgtable);
+    return efi_l4_pgtable ? virt_to_maddr(efi_l4_pgtable) : 0;
 }
 
 unsigned long efi_get_time(void)
@@ -109,6 +114,8 @@ unsigned long efi_get_time(void)
     EFI_STATUS status;
     unsigned long cr3 = efi_rs_enter(), flags;
 
+    if ( !cr3 )
+        return 0;
     spin_lock_irqsave(&rtc_lock, flags);
     status = efi_rs->GetTime(&time, NULL);
     spin_unlock_irqrestore(&rtc_lock, flags);
@@ -126,6 +133,8 @@ void efi_halt_system(void)
     EFI_STATUS status;
     unsigned long cr3 = efi_rs_enter();
 
+    if ( !cr3 )
+        return;
     status = efi_rs->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
     efi_rs_leave(cr3);
 
@@ -137,6 +146,8 @@ void efi_reset_system(bool_t warm)
     EFI_STATUS status;
     unsigned long cr3 = efi_rs_enter();
 
+    if ( !cr3 )
+        return;
     status = efi_rs->ResetSystem(warm ? EfiResetWarm : EfiResetCold,
                                  EFI_SUCCESS, 0, NULL);
     efi_rs_leave(cr3);
@@ -161,6 +172,8 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
     {
         unsigned long cr3 = efi_rs_enter();
 
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         info->version = efi_rs->Hdr.Revision;
         efi_rs_leave(cr3);
         break;
@@ -170,6 +183,8 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
         info->cfg.nent = efi_num_ct;
         break;
     case XEN_FW_EFI_VENDOR:
+        if ( !efi_fw_vendor )
+            return -EOPNOTSUPP;
         info->vendor.revision = efi_fw_revision;
         n = info->vendor.bufsz / sizeof(*efi_fw_vendor);
         if ( !guest_handle_okay(guest_handle_cast(info->vendor.name,
@@ -292,6 +307,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->GetTime(cast_time(&op->u.get_time.time), &caps);
         spin_unlock_irqrestore(&rtc_lock, flags);
@@ -312,6 +329,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->SetTime(cast_time(&op->u.set_time));
         spin_unlock_irqrestore(&rtc_lock, flags);
@@ -326,6 +345,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->GetWakeupTime(&enabled, &pending,
                                        cast_time(&op->u.get_wakeup_time));
@@ -348,6 +369,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->SetWakeupTime(!!(op->misc &
                                           XEN_EFI_SET_WAKEUP_TIME_ENABLE),
@@ -366,7 +389,10 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
-        status = efi_rs->GetNextHighMonotonicCount(&op->misc);
+        if ( cr3 )
+            status = efi_rs->GetNextHighMonotonicCount(&op->misc);
+        else
+            rc = -EOPNOTSUPP;
         efi_rs_leave(cr3);
         break;
 
@@ -402,15 +428,20 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             data = NULL;
 
         cr3 = efi_rs_enter();
-        status = efi_rs->GetVariable(
-            name, cast_guid(&op->u.get_variable.vendor_guid),
-            &op->misc, &size, data);
-        efi_rs_leave(cr3);
+        if ( cr3 )
+        {
+            status = efi_rs->GetVariable(
+                name, cast_guid(&op->u.get_variable.vendor_guid),
+                &op->misc, &size, data);
+            efi_rs_leave(cr3);
 
-        if ( !EFI_ERROR(status) &&
-             copy_to_guest(op->u.get_variable.data, data, size) )
-            rc = -EFAULT;
-        op->u.get_variable.size = size;
+            if ( !EFI_ERROR(status) &&
+                 copy_to_guest(op->u.get_variable.data, data, size) )
+                rc = -EFAULT;
+            op->u.get_variable.size = size;
+        }
+        else
+            rc = -EOPNOTSUPP;
 
         xfree(data);
         xfree(name);
@@ -440,9 +471,12 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         else
         {
             cr3 = efi_rs_enter();
-            status = efi_rs->SetVariable(
-                name, cast_guid(&op->u.set_variable.vendor_guid),
-                op->misc, op->u.set_variable.size, data);
+            if ( cr3 )
+                status = efi_rs->SetVariable(
+                    name, cast_guid(&op->u.set_variable.vendor_guid),
+                    op->misc, op->u.set_variable.size, data);
+            else
+                rc = -EOPNOTSUPP;
             efi_rs_leave(cr3);
         }
 
@@ -474,15 +508,21 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         }
 
         cr3 = efi_rs_enter();
-        status = efi_rs->GetNextVariableName(
-            &size, name.str,
-            cast_guid(&op->u.get_next_variable_name.vendor_guid));
-        efi_rs_leave(cr3);
+        if ( cr3 )
+        {
+            status = efi_rs->GetNextVariableName(
+                &size, name.str,
+                cast_guid(&op->u.get_next_variable_name.vendor_guid));
+            efi_rs_leave(cr3);
 
-        if ( !EFI_ERROR(status) &&
-             copy_to_guest(op->u.get_next_variable_name.name, name.raw, size) )
-            rc = -EFAULT;
-        op->u.get_next_variable_name.size = size;
+            if ( !EFI_ERROR(status) &&
+                 copy_to_guest(op->u.get_next_variable_name.name,
+                               name.raw, size) )
+                rc = -EFAULT;
+            op->u.get_next_variable_name.size = size;
+        }
+        else
+            rc = -EOPNOTSUPP;
 
         xfree(name.raw);
     }
@@ -519,7 +559,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         }
 
         cr3 = efi_rs_enter();
-        if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+        if ( !cr3 || (efi_rs->Hdr.Revision >> 16) < 2 )
         {
             efi_rs_leave(cr3);
             return -EOPNOTSUPP;
@@ -538,7 +578,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
-        if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+        if ( !cr3 || (efi_rs->Hdr.Revision >> 16) < 2 )
         {
             efi_rs_leave(cr3);
             return -EOPNOTSUPP;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlqx-00005K-JW; Thu, 30 Oct 2014 09:17:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqv-00005B-Ua
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:10 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	4A/E5-03668-51202545; Thu, 30 Oct 2014 09:17:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1414660627!12527971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20959 invoked from network); 30 Oct 2014 09:17:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqs-0005li-Sh
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqs-0000kU-RZ
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:06 +0000
Date: Thu, 30 Oct 2014 09:17:06 +0000
Message-Id: <E1Xjlqs-0000kU-RZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: allow to suppress the use of
	runtime services
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5680244040d26234a43c7f884ecf98fa4928d0da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 16:43:52 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:43:52 2014 +0100

    EFI: allow to suppress the use of runtime services
    
    On certain systems some of the memory map entries designated for use by
    runtime services cannot be mapped (frequently due to firmware bugs). On
    others, some of the memory map entries aren't even marked for runtime
    services use, yet are being used by them. For both cases give people a
    way to suppress use of runtime services altogether.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    7 +++
 xen/common/efi/boot.c               |   12 +++++-
 xen/common/efi/runtime.c            |   86 +++++++++++++++++++++++++---------
 3 files changed, 81 insertions(+), 24 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 00416af..0830e5f 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -565,6 +565,13 @@ Either force retrieval of monitor EDID information via VESA DDC, or
 disable it (edid=no). This option should not normally be required
 except for debugging purposes.
 
+### efi-rs
+> `= <boolean>`
+
+> Default: `true`
+
+Force or disable use of EFI runtime services.
+
 ### extra\_guest\_irqs
 > `= [<domU number>][,<dom0 number>]`
 
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 4257341..d31b0f9 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1072,6 +1072,10 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 }
 
 #ifndef CONFIG_ARM /* TODO - runtime service support */
+
+static bool_t __initdata efi_rs_enable = 1;
+boolean_param("efi-rs", efi_rs_enable);
+
 #ifndef USE_SET_VIRTUAL_ADDRESS_MAP
 static __init void copy_mapping(unsigned long mfn, unsigned long end,
                                 bool_t (*is_valid)(unsigned long smfn,
@@ -1145,7 +1149,7 @@ void __init efi_init_memory(void)
                desc->PhysicalStart, desc->PhysicalStart + len - 1,
                desc->Type, desc->Attribute);
 
-        if ( !(desc->Attribute & EFI_MEMORY_RUNTIME) )
+        if ( !efi_rs_enable || !(desc->Attribute & EFI_MEMORY_RUNTIME) )
             continue;
 
         desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
@@ -1209,6 +1213,12 @@ void __init efi_init_memory(void)
         }
     }
 
+    if ( !efi_rs_enable )
+    {
+        efi_fw_vendor = NULL;
+        return;
+    }
+
 #ifdef USE_SET_VIRTUAL_ADDRESS_MAP
     efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size,
                                  mdesc_ver, efi_memmap);
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 553ff91..1a0caea 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -56,6 +56,9 @@ unsigned long efi_rs_enter(void)
     static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    if ( !efi_l4_pgtable )
+        return 0;
+
     save_fpu_enable();
     asm volatile ( "fldcw %0" :: "m" (fcw) );
     asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
@@ -83,6 +86,8 @@ unsigned long efi_rs_enter(void)
 
 void efi_rs_leave(unsigned long cr3)
 {
+    if ( !cr3 )
+        return;
     write_cr3(cr3);
     if ( is_pv_vcpu(current) && !is_idle_vcpu(current) )
     {
@@ -100,7 +105,7 @@ void efi_rs_leave(unsigned long cr3)
 
 paddr_t efi_rs_page_table(void)
 {
-    return virt_to_maddr(efi_l4_pgtable);
+    return efi_l4_pgtable ? virt_to_maddr(efi_l4_pgtable) : 0;
 }
 
 unsigned long efi_get_time(void)
@@ -109,6 +114,8 @@ unsigned long efi_get_time(void)
     EFI_STATUS status;
     unsigned long cr3 = efi_rs_enter(), flags;
 
+    if ( !cr3 )
+        return 0;
     spin_lock_irqsave(&rtc_lock, flags);
     status = efi_rs->GetTime(&time, NULL);
     spin_unlock_irqrestore(&rtc_lock, flags);
@@ -126,6 +133,8 @@ void efi_halt_system(void)
     EFI_STATUS status;
     unsigned long cr3 = efi_rs_enter();
 
+    if ( !cr3 )
+        return;
     status = efi_rs->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
     efi_rs_leave(cr3);
 
@@ -137,6 +146,8 @@ void efi_reset_system(bool_t warm)
     EFI_STATUS status;
     unsigned long cr3 = efi_rs_enter();
 
+    if ( !cr3 )
+        return;
     status = efi_rs->ResetSystem(warm ? EfiResetWarm : EfiResetCold,
                                  EFI_SUCCESS, 0, NULL);
     efi_rs_leave(cr3);
@@ -161,6 +172,8 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
     {
         unsigned long cr3 = efi_rs_enter();
 
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         info->version = efi_rs->Hdr.Revision;
         efi_rs_leave(cr3);
         break;
@@ -170,6 +183,8 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
         info->cfg.nent = efi_num_ct;
         break;
     case XEN_FW_EFI_VENDOR:
+        if ( !efi_fw_vendor )
+            return -EOPNOTSUPP;
         info->vendor.revision = efi_fw_revision;
         n = info->vendor.bufsz / sizeof(*efi_fw_vendor);
         if ( !guest_handle_okay(guest_handle_cast(info->vendor.name,
@@ -292,6 +307,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->GetTime(cast_time(&op->u.get_time.time), &caps);
         spin_unlock_irqrestore(&rtc_lock, flags);
@@ -312,6 +329,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->SetTime(cast_time(&op->u.set_time));
         spin_unlock_irqrestore(&rtc_lock, flags);
@@ -326,6 +345,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->GetWakeupTime(&enabled, &pending,
                                        cast_time(&op->u.get_wakeup_time));
@@ -348,6 +369,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
+        if ( !cr3 )
+            return -EOPNOTSUPP;
         spin_lock_irqsave(&rtc_lock, flags);
         status = efi_rs->SetWakeupTime(!!(op->misc &
                                           XEN_EFI_SET_WAKEUP_TIME_ENABLE),
@@ -366,7 +389,10 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
-        status = efi_rs->GetNextHighMonotonicCount(&op->misc);
+        if ( cr3 )
+            status = efi_rs->GetNextHighMonotonicCount(&op->misc);
+        else
+            rc = -EOPNOTSUPP;
         efi_rs_leave(cr3);
         break;
 
@@ -402,15 +428,20 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             data = NULL;
 
         cr3 = efi_rs_enter();
-        status = efi_rs->GetVariable(
-            name, cast_guid(&op->u.get_variable.vendor_guid),
-            &op->misc, &size, data);
-        efi_rs_leave(cr3);
+        if ( cr3 )
+        {
+            status = efi_rs->GetVariable(
+                name, cast_guid(&op->u.get_variable.vendor_guid),
+                &op->misc, &size, data);
+            efi_rs_leave(cr3);
 
-        if ( !EFI_ERROR(status) &&
-             copy_to_guest(op->u.get_variable.data, data, size) )
-            rc = -EFAULT;
-        op->u.get_variable.size = size;
+            if ( !EFI_ERROR(status) &&
+                 copy_to_guest(op->u.get_variable.data, data, size) )
+                rc = -EFAULT;
+            op->u.get_variable.size = size;
+        }
+        else
+            rc = -EOPNOTSUPP;
 
         xfree(data);
         xfree(name);
@@ -440,9 +471,12 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         else
         {
             cr3 = efi_rs_enter();
-            status = efi_rs->SetVariable(
-                name, cast_guid(&op->u.set_variable.vendor_guid),
-                op->misc, op->u.set_variable.size, data);
+            if ( cr3 )
+                status = efi_rs->SetVariable(
+                    name, cast_guid(&op->u.set_variable.vendor_guid),
+                    op->misc, op->u.set_variable.size, data);
+            else
+                rc = -EOPNOTSUPP;
             efi_rs_leave(cr3);
         }
 
@@ -474,15 +508,21 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         }
 
         cr3 = efi_rs_enter();
-        status = efi_rs->GetNextVariableName(
-            &size, name.str,
-            cast_guid(&op->u.get_next_variable_name.vendor_guid));
-        efi_rs_leave(cr3);
+        if ( cr3 )
+        {
+            status = efi_rs->GetNextVariableName(
+                &size, name.str,
+                cast_guid(&op->u.get_next_variable_name.vendor_guid));
+            efi_rs_leave(cr3);
 
-        if ( !EFI_ERROR(status) &&
-             copy_to_guest(op->u.get_next_variable_name.name, name.raw, size) )
-            rc = -EFAULT;
-        op->u.get_next_variable_name.size = size;
+            if ( !EFI_ERROR(status) &&
+                 copy_to_guest(op->u.get_next_variable_name.name,
+                               name.raw, size) )
+                rc = -EFAULT;
+            op->u.get_next_variable_name.size = size;
+        }
+        else
+            rc = -EOPNOTSUPP;
 
         xfree(name.raw);
     }
@@ -519,7 +559,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         }
 
         cr3 = efi_rs_enter();
-        if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+        if ( !cr3 || (efi_rs->Hdr.Revision >> 16) < 2 )
         {
             efi_rs_leave(cr3);
             return -EOPNOTSUPP;
@@ -538,7 +578,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             return -EINVAL;
 
         cr3 = efi_rs_enter();
-        if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+        if ( !cr3 || (efi_rs->Hdr.Revision >> 16) < 2 )
         {
             efi_rs_leave(cr3);
             return -EOPNOTSUPP;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlr0-000068-Lw; Thu, 30 Oct 2014 09:17:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqz-00005n-6w
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:13 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	15/0A-02886-81202545; Thu, 30 Oct 2014 09:17:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1414660616!12531732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26284 invoked from network); 30 Oct 2014 09:16:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqi-0005lC-Mc
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqi-0000jy-Kh
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:56 +0000
Date: Thu, 30 Oct 2014 09:16:56 +0000
Message-Id: <E1Xjlqi-0000jy-Kh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: tolerate running on EFI runtime
	services page tables in map_domain_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e65436ba36be8f1b735573d8fc9af7d8a053ba5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 16:43:12 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:43:12 2014 +0100

    x86: tolerate running on EFI runtime services page tables in map_domain_page()
    
    In the event of a #PF while in an EFI runtime service function we
    otherwise can't dump the page tables, making the analysis of the
    problem more cumbersome.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_page.c |    6 +++++-
 xen/arch/x86/efi/stub.c    |    6 ++++++
 xen/common/efi/runtime.c   |    5 +++++
 xen/include/xen/efi.h      |    1 +
 4 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
index 3903952..158a164 100644
--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -7,6 +7,7 @@
  */
 
 #include <xen/domain_page.h>
+#include <xen/efi.h>
 #include <xen/mm.h>
 #include <xen/perfc.h>
 #include <xen/pfn.h>
@@ -37,11 +38,14 @@ static inline struct vcpu *mapcache_current_vcpu(void)
      */
     if ( unlikely(pagetable_is_null(v->arch.guest_table)) && is_pv_vcpu(v) )
     {
+        unsigned long cr3;
+
         /* If we really are idling, perform lazy context switch now. */
         if ( (v = idle_vcpu[smp_processor_id()]) == current )
             sync_local_execstate();
         /* We must now be running on the idle page table. */
-        ASSERT(read_cr3() == __pa(idle_pg_table));
+        ASSERT((cr3 = read_cr3()) == __pa(idle_pg_table) ||
+               (efi_enabled && cr3 == efi_rs_page_table()));
     }
 
     return v;
diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c
index 8916a2e..b8f49f8 100644
--- a/xen/arch/x86/efi/stub.c
+++ b/xen/arch/x86/efi/stub.c
@@ -9,6 +9,12 @@ const bool_t efi_enabled = 0;
 
 void __init efi_init_memory(void) { }
 
+paddr_t efi_rs_page_table(void)
+{
+    BUG();
+    return 0;
+}
+
 unsigned long efi_get_time(void)
 {
     BUG();
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 1c43d10..553ff91 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -98,6 +98,11 @@ void efi_rs_leave(unsigned long cr3)
     stts();
 }
 
+paddr_t efi_rs_page_table(void)
+{
+    return virt_to_maddr(efi_l4_pgtable);
+}
+
 unsigned long efi_get_time(void)
 {
     EFI_TIME time;
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 8a2b788..5e02724 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -28,6 +28,7 @@ struct xenpf_efi_runtime_call;
 struct compat_pf_efi_runtime_call;
 
 void efi_init_memory(void);
+paddr_t efi_rs_page_table(void);
 unsigned long efi_get_time(void);
 void efi_halt_system(void);
 void efi_reset_system(bool_t warm);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlr0-000068-Lw; Thu, 30 Oct 2014 09:17:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqz-00005n-6w
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:13 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	15/0A-02886-81202545; Thu, 30 Oct 2014 09:17:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1414660616!12531732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26284 invoked from network); 30 Oct 2014 09:16:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:16:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqi-0005lC-Mc
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlqi-0000jy-Kh
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:16:56 +0000
Date: Thu, 30 Oct 2014 09:16:56 +0000
Message-Id: <E1Xjlqi-0000jy-Kh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: tolerate running on EFI runtime
	services page tables in map_domain_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e65436ba36be8f1b735573d8fc9af7d8a053ba5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 16:43:12 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:43:12 2014 +0100

    x86: tolerate running on EFI runtime services page tables in map_domain_page()
    
    In the event of a #PF while in an EFI runtime service function we
    otherwise can't dump the page tables, making the analysis of the
    problem more cumbersome.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_page.c |    6 +++++-
 xen/arch/x86/efi/stub.c    |    6 ++++++
 xen/common/efi/runtime.c   |    5 +++++
 xen/include/xen/efi.h      |    1 +
 4 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
index 3903952..158a164 100644
--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -7,6 +7,7 @@
  */
 
 #include <xen/domain_page.h>
+#include <xen/efi.h>
 #include <xen/mm.h>
 #include <xen/perfc.h>
 #include <xen/pfn.h>
@@ -37,11 +38,14 @@ static inline struct vcpu *mapcache_current_vcpu(void)
      */
     if ( unlikely(pagetable_is_null(v->arch.guest_table)) && is_pv_vcpu(v) )
     {
+        unsigned long cr3;
+
         /* If we really are idling, perform lazy context switch now. */
         if ( (v = idle_vcpu[smp_processor_id()]) == current )
             sync_local_execstate();
         /* We must now be running on the idle page table. */
-        ASSERT(read_cr3() == __pa(idle_pg_table));
+        ASSERT((cr3 = read_cr3()) == __pa(idle_pg_table) ||
+               (efi_enabled && cr3 == efi_rs_page_table()));
     }
 
     return v;
diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c
index 8916a2e..b8f49f8 100644
--- a/xen/arch/x86/efi/stub.c
+++ b/xen/arch/x86/efi/stub.c
@@ -9,6 +9,12 @@ const bool_t efi_enabled = 0;
 
 void __init efi_init_memory(void) { }
 
+paddr_t efi_rs_page_table(void)
+{
+    BUG();
+    return 0;
+}
+
 unsigned long efi_get_time(void)
 {
     BUG();
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 1c43d10..553ff91 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -98,6 +98,11 @@ void efi_rs_leave(unsigned long cr3)
     stts();
 }
 
+paddr_t efi_rs_page_table(void)
+{
+    return virt_to_maddr(efi_l4_pgtable);
+}
+
 unsigned long efi_get_time(void)
 {
     EFI_TIME time;
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 8a2b788..5e02724 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -28,6 +28,7 @@ struct xenpf_efi_runtime_call;
 struct compat_pf_efi_runtime_call;
 
 void efi_init_memory(void);
+paddr_t efi_rs_page_table(void);
 unsigned long efi_get_time(void);
 void efi_halt_system(void);
 void efi_reset_system(bool_t warm);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlr6-00007r-Qg; Thu, 30 Oct 2014 09:17:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlr5-00007Q-Cs
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:19 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	40/7D-10419-E1202545; Thu, 30 Oct 2014 09:17:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414660637!13517163!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20091 invoked from network); 30 Oct 2014 09:17:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlr3-0005lo-3f
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlr3-0000ks-1H
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:17 +0000
Date: Thu, 30 Oct 2014 09:17:17 +0000
Message-Id: <E1Xjlr3-0000ks-1H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: constify a few table pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ed4dc689761a5597a492aeef89aff50cd9b39ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 16:44:31 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:44:31 2014 +0100

    EFI: constify a few table pointers
    
    We shouldn't (and don't) modify any of these tables.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/efi/boot.c    |    2 +-
 xen/common/efi/efi.h     |    4 ++--
 xen/common/efi/runtime.c |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index d31b0f9..3a71d7a 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -75,7 +75,7 @@ static size_t wstrlen(const CHAR16 * s);
 static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool_t match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
 
-static EFI_BOOT_SERVICES *__initdata efi_bs;
+static const EFI_BOOT_SERVICES *__initdata efi_bs;
 static EFI_HANDLE __initdata efi_ih;
 
 static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h
index bee3b77..c557104 100644
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -18,12 +18,12 @@ struct efi_pci_rom {
 };
 
 extern unsigned int efi_num_ct;
-extern EFI_CONFIGURATION_TABLE *efi_ct;
+extern const EFI_CONFIGURATION_TABLE *efi_ct;
 
 extern unsigned int efi_version, efi_fw_revision;
 extern const CHAR16 *efi_fw_vendor;
 
-extern EFI_RUNTIME_SERVICES *efi_rs;
+extern const EFI_RUNTIME_SERVICES *efi_rs;
 
 extern UINTN efi_memmap_size, efi_mdesc_size;
 extern void *efi_memmap;
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 1a0caea..c840e08 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -21,13 +21,13 @@ const bool_t efi_enabled = 1;
 #endif
 
 unsigned int __read_mostly efi_num_ct;
-EFI_CONFIGURATION_TABLE *__read_mostly efi_ct;
+const EFI_CONFIGURATION_TABLE *__read_mostly efi_ct;
 
 unsigned int __read_mostly efi_version;
 unsigned int __read_mostly efi_fw_revision;
 const CHAR16 *__read_mostly efi_fw_vendor;
 
-EFI_RUNTIME_SERVICES *__read_mostly efi_rs;
+const EFI_RUNTIME_SERVICES *__read_mostly efi_rs;
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
 static DEFINE_SPINLOCK(efi_rs_lock);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Xjlr6-00007r-Qg; Thu, 30 Oct 2014 09:17:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlr5-00007Q-Cs
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:19 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	40/7D-10419-E1202545; Thu, 30 Oct 2014 09:17:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1414660637!13517163!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20091 invoked from network); 30 Oct 2014 09:17:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlr3-0005lo-3f
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Xjlr3-0000ks-1H
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:17 +0000
Date: Thu, 30 Oct 2014 09:17:17 +0000
Message-Id: <E1Xjlr3-0000ks-1H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: constify a few table pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ed4dc689761a5597a492aeef89aff50cd9b39ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 16:44:31 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:44:31 2014 +0100

    EFI: constify a few table pointers
    
    We shouldn't (and don't) modify any of these tables.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/efi/boot.c    |    2 +-
 xen/common/efi/efi.h     |    4 ++--
 xen/common/efi/runtime.c |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index d31b0f9..3a71d7a 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -75,7 +75,7 @@ static size_t wstrlen(const CHAR16 * s);
 static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool_t match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
 
-static EFI_BOOT_SERVICES *__initdata efi_bs;
+static const EFI_BOOT_SERVICES *__initdata efi_bs;
 static EFI_HANDLE __initdata efi_ih;
 
 static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h
index bee3b77..c557104 100644
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -18,12 +18,12 @@ struct efi_pci_rom {
 };
 
 extern unsigned int efi_num_ct;
-extern EFI_CONFIGURATION_TABLE *efi_ct;
+extern const EFI_CONFIGURATION_TABLE *efi_ct;
 
 extern unsigned int efi_version, efi_fw_revision;
 extern const CHAR16 *efi_fw_vendor;
 
-extern EFI_RUNTIME_SERVICES *efi_rs;
+extern const EFI_RUNTIME_SERVICES *efi_rs;
 
 extern UINTN efi_memmap_size, efi_mdesc_size;
 extern void *efi_memmap;
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 1a0caea..c840e08 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -21,13 +21,13 @@ const bool_t efi_enabled = 1;
 #endif
 
 unsigned int __read_mostly efi_num_ct;
-EFI_CONFIGURATION_TABLE *__read_mostly efi_ct;
+const EFI_CONFIGURATION_TABLE *__read_mostly efi_ct;
 
 unsigned int __read_mostly efi_version;
 unsigned int __read_mostly efi_fw_revision;
 const CHAR16 *__read_mostly efi_fw_vendor;
 
-EFI_RUNTIME_SERVICES *__read_mostly efi_rs;
+const EFI_RUNTIME_SERVICES *__read_mostly efi_rs;
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
 static DEFINE_SPINLOCK(efi_rs_lock);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlrG-0000A4-Tq; Thu, 30 Oct 2014 09:17:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrF-00009j-Li
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:29 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	B1/DD-10419-92202545; Thu, 30 Oct 2014 09:17:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1414660647!10169156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27844 invoked from network); 30 Oct 2014 09:17:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrD-0005lx-9c
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrD-0000lE-8K
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:27 +0000
Date: Thu, 30 Oct 2014 09:17:27 +0000
Message-Id: <E1XjlrD-0000lE-8K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: sanity check xsave area when
	migrating or restoring from older Xen versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7bb8e88a087690feba63ef83c13ba067f041da0
Author:     Don Koch <dkoch@verizon.com>
AuthorDate: Mon Oct 27 16:45:09 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:45:09 2014 +0100

    x86/HVM: sanity check xsave area when migrating or restoring from older Xen versions
    
    Xen 4.3.0, 4.2.3 and older transferred a maximum sized xsave area (as
    if all the available XCR0 bits were set); the new version only
    transfers based on the actual XCR0 bits. This may result in a smaller
    area if the last sections were missing (e.g., the LWP area from an AMD
    machine). If the size doesn't match the XCR0 derived size, the size is
    checked against the maximum size and the part of the xsave area
    between the actual and maximum used size is checked for zero data. If
    either the max size check or any part of the overflow area is
    non-zero, we return with an error.
    
    Signed-off-by: Don Koch <dkoch@verizon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 559b769..78f519d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1971,6 +1971,7 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     struct vcpu *v;
     struct hvm_hw_cpu_xsave *ctxt;
     struct hvm_save_descriptor *desc;
+    unsigned int i, desc_start;
 
     /* Which vcpu is this? */
     vcpuid = hvm_load_instance(h);
@@ -2011,15 +2012,8 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
                         save_area) + XSTATE_AREA_MIN_SIZE);
         return -EINVAL;
     }
-    size = HVM_CPU_XSAVE_SIZE(xfeature_mask);
-    if ( desc->length > size )
-    {
-        printk(XENLOG_G_WARNING
-               "HVM%d.%d restore mismatch: xsave length %u > %u\n",
-               d->domain_id, vcpuid, desc->length, size);
-        return -EOPNOTSUPP;
-    }
     h->cur += sizeof (*desc);
+    desc_start = h->cur;
 
     ctxt = (struct hvm_hw_cpu_xsave *)&h->data[h->cur];
     h->cur += desc->length;
@@ -2038,10 +2032,24 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     size = HVM_CPU_XSAVE_SIZE(ctxt->xcr0_accum);
     if ( desc->length > size )
     {
+        /*
+         * Xen 4.3.0, 4.2.3 and older used to send longer-than-needed
+         * xsave regions.  Permit loading the record if the extra data
+         * is all zero.
+         */
+        for ( i = size; i < desc->length; i++ )
+        {
+            if ( h->data[desc_start + i] )
+            {
+                printk(XENLOG_G_WARNING
+                       "HVM%d.%u restore mismatch: xsave length %#x > %#x (non-zero data at %#x)\n",
+                       d->domain_id, vcpuid, desc->length, size, i);
+                return -EOPNOTSUPP;
+            }
+        }
         printk(XENLOG_G_WARNING
-               "HVM%d.%d restore mismatch: xsave length %u > %u\n",
+               "HVM%d.%u restore mismatch: xsave length %#x > %#x\n",
                d->domain_id, vcpuid, desc->length, size);
-        return -EOPNOTSUPP;
     }
     /* Checking finished */
 
@@ -2050,7 +2058,8 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     if ( ctxt->xcr0_accum & XSTATE_NONLAZY )
         v->arch.nonlazy_xstate_used = 1;
     memcpy(v->arch.xsave_area, &ctxt->save_area,
-           desc->length - offsetof(struct hvm_hw_cpu_xsave, save_area));
+           min(desc->length, size) - offsetof(struct hvm_hw_cpu_xsave,
+           save_area));
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlrG-0000A4-Tq; Thu, 30 Oct 2014 09:17:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrF-00009j-Li
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:29 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	B1/DD-10419-92202545; Thu, 30 Oct 2014 09:17:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1414660647!10169156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27844 invoked from network); 30 Oct 2014 09:17:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrD-0005lx-9c
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrD-0000lE-8K
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:27 +0000
Date: Thu, 30 Oct 2014 09:17:27 +0000
Message-Id: <E1XjlrD-0000lE-8K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: sanity check xsave area when
	migrating or restoring from older Xen versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7bb8e88a087690feba63ef83c13ba067f041da0
Author:     Don Koch <dkoch@verizon.com>
AuthorDate: Mon Oct 27 16:45:09 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 16:45:09 2014 +0100

    x86/HVM: sanity check xsave area when migrating or restoring from older Xen versions
    
    Xen 4.3.0, 4.2.3 and older transferred a maximum sized xsave area (as
    if all the available XCR0 bits were set); the new version only
    transfers based on the actual XCR0 bits. This may result in a smaller
    area if the last sections were missing (e.g., the LWP area from an AMD
    machine). If the size doesn't match the XCR0 derived size, the size is
    checked against the maximum size and the part of the xsave area
    between the actual and maximum used size is checked for zero data. If
    either the max size check or any part of the overflow area is
    non-zero, we return with an error.
    
    Signed-off-by: Don Koch <dkoch@verizon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 559b769..78f519d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1971,6 +1971,7 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     struct vcpu *v;
     struct hvm_hw_cpu_xsave *ctxt;
     struct hvm_save_descriptor *desc;
+    unsigned int i, desc_start;
 
     /* Which vcpu is this? */
     vcpuid = hvm_load_instance(h);
@@ -2011,15 +2012,8 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
                         save_area) + XSTATE_AREA_MIN_SIZE);
         return -EINVAL;
     }
-    size = HVM_CPU_XSAVE_SIZE(xfeature_mask);
-    if ( desc->length > size )
-    {
-        printk(XENLOG_G_WARNING
-               "HVM%d.%d restore mismatch: xsave length %u > %u\n",
-               d->domain_id, vcpuid, desc->length, size);
-        return -EOPNOTSUPP;
-    }
     h->cur += sizeof (*desc);
+    desc_start = h->cur;
 
     ctxt = (struct hvm_hw_cpu_xsave *)&h->data[h->cur];
     h->cur += desc->length;
@@ -2038,10 +2032,24 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     size = HVM_CPU_XSAVE_SIZE(ctxt->xcr0_accum);
     if ( desc->length > size )
     {
+        /*
+         * Xen 4.3.0, 4.2.3 and older used to send longer-than-needed
+         * xsave regions.  Permit loading the record if the extra data
+         * is all zero.
+         */
+        for ( i = size; i < desc->length; i++ )
+        {
+            if ( h->data[desc_start + i] )
+            {
+                printk(XENLOG_G_WARNING
+                       "HVM%d.%u restore mismatch: xsave length %#x > %#x (non-zero data at %#x)\n",
+                       d->domain_id, vcpuid, desc->length, size, i);
+                return -EOPNOTSUPP;
+            }
+        }
         printk(XENLOG_G_WARNING
-               "HVM%d.%d restore mismatch: xsave length %u > %u\n",
+               "HVM%d.%u restore mismatch: xsave length %#x > %#x\n",
                d->domain_id, vcpuid, desc->length, size);
-        return -EOPNOTSUPP;
     }
     /* Checking finished */
 
@@ -2050,7 +2058,8 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     if ( ctxt->xcr0_accum & XSTATE_NONLAZY )
         v->arch.nonlazy_xstate_used = 1;
     memcpy(v->arch.xsave_area, &ctxt->save_area,
-           desc->length - offsetof(struct hvm_hw_cpu_xsave, save_area));
+           min(desc->length, size) - offsetof(struct hvm_hw_cpu_xsave,
+           save_area));
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlrQ-0000Bt-0F; Thu, 30 Oct 2014 09:17:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrP-0000Bm-NB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:39 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	75/99-08051-33202545; Thu, 30 Oct 2014 09:17:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414660657!13351164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8144 invoked from network); 30 Oct 2014 09:17:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrN-0005m5-Ef
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrN-0000m3-Dg
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:37 +0000
Date: Thu, 30 Oct 2014 09:17:37 +0000
Message-Id: <E1XjlrN-0000m3-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vtd: correct some comments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0f2bde078ace619fe8e26730495b6ef2c3a2e9bf
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Tue Oct 28 11:55:04 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 28 11:55:04 2014 +0100

    vtd: correct some comments
    
    In some cases Dom0 and hardware domain are not one same domain.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 1c52981..19d8165 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1248,7 +1248,7 @@ static void __hwdom_init intel_iommu_hwdom_init(struct domain *d)
 
     if ( !iommu_passthrough && !need_iommu(d) )
     {
-        /* Set up 1:1 page table for dom0 */
+        /* Set up 1:1 page table for hardware domain. */
         vtd_set_hwdom_mapping(d);
     }
 
@@ -1696,7 +1696,7 @@ static int intel_iommu_map_page(
     if ( iommu_use_hap_pt(d) )
         return 0;
 
-    /* do nothing if dom0 and iommu supports pass thru */
+    /* Do nothing if hardware domain and iommu supports pass thru. */
     if ( iommu_passthrough && is_hardware_domain(d) )
         return 0;
 
@@ -1740,7 +1740,7 @@ static int intel_iommu_map_page(
 
 static int intel_iommu_unmap_page(struct domain *d, unsigned long gfn)
 {
-    /* Do nothing if dom0 and iommu supports pass thru. */
+    /* Do nothing if hardware domain and iommu supports pass thru. */
     if ( iommu_passthrough && is_hardware_domain(d) )
         return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Oct 30 09:17:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Oct 2014 09:17:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1XjlrQ-0000Bt-0F; Thu, 30 Oct 2014 09:17:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrP-0000Bm-NB
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:39 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	75/99-08051-33202545; Thu, 30 Oct 2014 09:17:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1414660657!13351164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.12.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8144 invoked from network); 30 Oct 2014 09:17:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2014 09:17:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrN-0005m5-Ef
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1XjlrN-0000m3-Dg
	for xen-changelog@lists.xensource.com; Thu, 30 Oct 2014 09:17:37 +0000
Date: Thu, 30 Oct 2014 09:17:37 +0000
Message-Id: <E1XjlrN-0000m3-Dg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vtd: correct some comments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0f2bde078ace619fe8e26730495b6ef2c3a2e9bf
Author:     Tiejun Chen <tiejun.chen@intel.com>
AuthorDate: Tue Oct 28 11:55:04 2014 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 28 11:55:04 2014 +0100

    vtd: correct some comments
    
    In some cases Dom0 and hardware domain are not one same domain.
    
    Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 1c52981..19d8165 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1248,7 +1248,7 @@ static void __hwdom_init intel_iommu_hwdom_init(struct domain *d)
 
     if ( !iommu_passthrough && !need_iommu(d) )
     {
-        /* Set up 1:1 page table for dom0 */
+        /* Set up 1:1 page table for hardware domain. */
         vtd_set_hwdom_mapping(d);
     }
 
@@ -1696,7 +1696,7 @@ static int intel_iommu_map_page(
     if ( iommu_use_hap_pt(d) )
         return 0;
 
-    /* do nothing if dom0 and iommu supports pass thru */
+    /* Do nothing if hardware domain and iommu supports pass thru. */
     if ( iommu_passthrough && is_hardware_domain(d) )
         return 0;
 
@@ -1740,7 +1740,7 @@ static int intel_iommu_map_page(
 
 static int intel_iommu_unmap_page(struct domain *d, unsigned long gfn)
 {
-    /* Do nothing if dom0 and iommu supports pass thru. */
+    /* Do nothing if hardware domain and iommu supports pass thru. */
     if ( iommu_passthrough && is_hardware_domain(d) )
         return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

